Commit d9bc8db7 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/gimplayertreeview.c libgimpwidgets/gimpcolorscales.c

2008-08-29  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimplayertreeview.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimppropwidgets.c
	* libgimpwidgets/gimpscaleentry.c
	* libgimpwidgets/gimpwidgets.c: use gtk_adjustment_get_value()
	instead of adjustment->value.


svn path=/trunk/; revision=26815
parent aa318cd0
2008-08-29 Michael Natterer <mitch@gimp.org>
* app/widgets/gimplayertreeview.c
* libgimpwidgets/gimpcolorscales.c
* libgimpwidgets/gimppropwidgets.c
* libgimpwidgets/gimpscaleentry.c
* libgimpwidgets/gimpwidgets.c: use gtk_adjustment_get_value()
instead of adjustment->value.
2008-08-29 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/gimpui.defs
......
......@@ -1001,7 +1001,7 @@ gimp_layer_tree_view_opacity_scale_changed (GtkAdjustment *adjustment,
if (layer)
{
gdouble opacity = adjustment->value / 100.0;
gdouble opacity = gtk_adjustment_get_value (adjustment) / 100.0;
if (gimp_layer_get_opacity (layer) != opacity)
{
......@@ -1078,7 +1078,8 @@ gimp_layer_tree_view_update_options (GimpLayerTreeView *view,
gimp_layer_tree_view_lock_alpha_button_toggled);
}
if (gimp_layer_get_opacity (layer) * 100.0 != view->opacity_adjustment->value)
if (gimp_layer_get_opacity (layer) * 100.0 !=
gtk_adjustment_get_value (view->opacity_adjustment))
{
BLOCK (view->opacity_adjustment,
gimp_layer_tree_view_opacity_scale_changed);
......
......@@ -345,6 +345,7 @@ gimp_color_scales_scale_update (GtkAdjustment *adjustment,
GimpColorScales *scales)
{
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
gdouble value = gtk_adjustment_get_value (adjustment);
gint i;
for (i = 0; i < 7; i++)
......@@ -354,32 +355,31 @@ gimp_color_scales_scale_update (GtkAdjustment *adjustment,
switch (i)
{
case GIMP_COLOR_SELECTOR_HUE:
selector->hsv.h = GTK_ADJUSTMENT (adjustment)->value / 360.0;
selector->hsv.h = value / 360.0;
break;
case GIMP_COLOR_SELECTOR_SATURATION:
selector->hsv.s = GTK_ADJUSTMENT (adjustment)->value / 100.0;
selector->hsv.s = value / 100.0;
break;
case GIMP_COLOR_SELECTOR_VALUE:
selector->hsv.v = GTK_ADJUSTMENT (adjustment)->value / 100.0;
selector->hsv.v = value / 100.0;
break;
case GIMP_COLOR_SELECTOR_RED:
selector->rgb.r = GTK_ADJUSTMENT (adjustment)->value / 255.0;
selector->rgb.r = value / 255.0;
break;
case GIMP_COLOR_SELECTOR_GREEN:
selector->rgb.g = GTK_ADJUSTMENT (adjustment)->value / 255.0;
selector->rgb.g = value / 255.0;
break;
case GIMP_COLOR_SELECTOR_BLUE:
selector->rgb.b = GTK_ADJUSTMENT (adjustment)->value / 255.0;
selector->rgb.b = value / 255.0;
break;
case GIMP_COLOR_SELECTOR_ALPHA:
selector->hsv.a = selector->rgb.a =
GTK_ADJUSTMENT (adjustment)->value / 100.0;
selector->hsv.a = selector->rgb.a = value / 100.0;
break;
}
......
......@@ -1291,56 +1291,55 @@ gimp_prop_adjustment_callback (GtkAdjustment *adjustment,
GObject *config)
{
GParamSpec *param_spec;
gdouble value;
param_spec = get_param_spec (G_OBJECT (adjustment));
if (! param_spec)
return;
value = gtk_adjustment_get_value (adjustment);
if (G_IS_PARAM_SPEC_INT (param_spec))
{
g_object_set (config,
param_spec->name, (gint) adjustment->value,
param_spec->name, (gint) value,
NULL);
}
else if (G_IS_PARAM_SPEC_UINT (param_spec))
{
g_object_set (config,
param_spec->name, (guint) adjustment->value,
param_spec->name, (guint) value,
NULL);
}
else if (G_IS_PARAM_SPEC_LONG (param_spec))
{
g_object_set (config,
param_spec->name, (glong) adjustment->value,
param_spec->name, (glong) value,
NULL);
}
else if (G_IS_PARAM_SPEC_ULONG (param_spec))
{
g_object_set (config,
param_spec->name, (gulong) adjustment->value,
param_spec->name, (gulong) value,
NULL);
}
else if (G_IS_PARAM_SPEC_INT64 (param_spec))
{
g_object_set (config,
param_spec->name, (gint64) adjustment->value,
param_spec->name, (gint64) value,
NULL);
}
else if (G_IS_PARAM_SPEC_UINT64 (param_spec))
{
g_object_set (config,
param_spec->name, (guint64) adjustment->value,
param_spec->name, (guint64) value,
NULL);
}
else if (G_IS_PARAM_SPEC_DOUBLE (param_spec))
{
gdouble value;
if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (adjustment),
"opacity-scale")))
value = adjustment->value / 100.0;
else
value = adjustment->value;
value /= 100.0;
g_object_set (config, param_spec->name, value, NULL);
}
......@@ -1420,7 +1419,7 @@ gimp_prop_adjustment_notify (GObject *config,
return;
}
if (adjustment->value != value)
if (gtk_adjustment_get_value (adjustment) != value)
{
g_signal_handlers_block_by_func (adjustment,
gimp_prop_adjustment_callback,
......@@ -3528,14 +3527,15 @@ gimp_prop_stock_image_notify (GObject *config,
GParamSpec *param_spec,
GtkWidget *image)
{
gchar *stock_id;
gchar *stock_id;
GtkIconSize icon_size;
g_object_get (config,
param_spec->name, &stock_id,
NULL);
gtk_image_set_from_stock (GTK_IMAGE (image), stock_id,
GTK_IMAGE (image)->icon_size);
gtk_image_get_stock (GTK_IMAGE (image), NULL, &icon_size);
gtk_image_set_from_stock (GTK_IMAGE (image), stock_id, icon_size);
if (stock_id)
g_free (stock_id);
......
......@@ -66,7 +66,7 @@ gimp_scale_entry_unconstrained_adjustment_callback (GtkAdjustment *adjustment,
gimp_scale_entry_unconstrained_adjustment_callback,
adjustment);
gtk_adjustment_set_value (other_adj, adjustment->value);
gtk_adjustment_set_value (other_adj, gtk_adjustment_get_value (adjustment));
g_signal_handlers_unblock_by_func (other_adj,
gimp_scale_entry_unconstrained_adjustment_callback,
......@@ -104,7 +104,7 @@ gimp_scale_entry_exp_adjustment_callback (GtkAdjustment *adjustment,
gimp_scale_entry_log_adjustment_callback,
adjustment);
value = exp (adjustment->value);
value = exp (gtk_adjustment_get_value (adjustment));
if (other_adj->lower <= 0.0)
value += other_adj->lower - 0.1;
......
......@@ -975,7 +975,7 @@ gimp_int_adjustment_update (GtkAdjustment *adjustment,
{
gint *val = (gint *) data;
*val = RINT (adjustment->value);
*val = RINT (gtk_adjustment_get_value (adjustment));
}
/**
......@@ -993,7 +993,7 @@ gimp_uint_adjustment_update (GtkAdjustment *adjustment,
{
guint *val = (guint *) data;
*val = (guint) (adjustment->value + 0.5);
*val = (guint) (gtk_adjustment_get_value (adjustment) + 0.5);
}
/**
......@@ -1007,7 +1007,8 @@ gimp_float_adjustment_update (GtkAdjustment *adjustment,
gpointer data)
{
gfloat *val = (gfloat *) data;
*val = adjustment->value;
*val = gtk_adjustment_get_value (adjustment);
}
......@@ -1023,7 +1024,7 @@ gimp_double_adjustment_update (GtkAdjustment *adjustment,
{
gdouble *val = (gdouble *) data;
*val = adjustment->value;
*val = gtk_adjustment_get_value (adjustment);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment