gimp r26019 - in trunk: . app/dialogs app/display app/tools app/widgets



Author: mitch
Date: Sun Jun 29 13:41:24 2008
New Revision: 26019
URL: http://svn.gnome.org/viewvc/gimp?rev=26019&view=rev

Log:
2008-06-29  Michael Natterer  <mitch gimp org>

	* app/dialogs/channel-options-dialog.c
	* app/dialogs/palette-import-dialog.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpnavigationeditor.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpposterizetool.c
	* app/widgets/gimpbrusheditor.c
	* app/widgets/gimpbrushfactoryview.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcolormapeditor.c
	* app/widgets/gimpcontainertreeview-dnd.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimppaletteeditor.c
	* app/widgets/gimpscalebutton.c: replace adjustment->value by
	gtk_adjustment_get_value (adjustment).



Modified:
   trunk/ChangeLog
   trunk/app/dialogs/channel-options-dialog.c
   trunk/app/dialogs/palette-import-dialog.c
   trunk/app/display/gimpdisplayshell-callbacks.c
   trunk/app/display/gimpnavigationeditor.c
   trunk/app/tools/gimpbrightnesscontrasttool.c
   trunk/app/tools/gimpcolorbalancetool.c
   trunk/app/tools/gimpcolorizetool.c
   trunk/app/tools/gimphuesaturationtool.c
   trunk/app/tools/gimplevelstool.c
   trunk/app/tools/gimpposterizetool.c
   trunk/app/widgets/gimpbrusheditor.c
   trunk/app/widgets/gimpbrushfactoryview.c
   trunk/app/widgets/gimpbrushselect.c
   trunk/app/widgets/gimpcolormapeditor.c
   trunk/app/widgets/gimpcontainertreeview-dnd.c
   trunk/app/widgets/gimpgradienteditor.c
   trunk/app/widgets/gimphistogrambox.c
   trunk/app/widgets/gimppaletteeditor.c
   trunk/app/widgets/gimpscalebutton.c

Modified: trunk/app/dialogs/channel-options-dialog.c
==============================================================================
--- trunk/app/dialogs/channel-options-dialog.c	(original)
+++ trunk/app/dialogs/channel-options-dialog.c	Sun Jun 29 13:41:24 2008
@@ -191,7 +191,7 @@
   GimpRGB  color;
 
   gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
-  gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
+  gimp_rgb_set_alpha (&color, gtk_adjustment_get_value (adjustment) / 100.0);
   gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
 }
 

Modified: trunk/app/dialogs/palette-import-dialog.c
==============================================================================
--- trunk/app/dialogs/palette-import-dialog.c	(original)
+++ trunk/app/dialogs/palette-import-dialog.c	Sun Jun 29 13:41:24 2008
@@ -726,7 +726,8 @@
                                 ImportDialog  *dialog)
 {
   if (dialog->palette)
-    gimp_palette_set_columns (dialog->palette, ROUND (adj->value));
+    gimp_palette_set_columns (dialog->palette,
+                              ROUND (gtk_adjustment_get_value (adj)));
 }
 
 /*  functions & callbacks to keep the import dialog uptodate  ****************/
@@ -772,9 +773,9 @@
   if (! palette_name || ! strlen (palette_name))
     palette_name = _("Untitled");
 
-  n_colors  = ROUND (dialog->num_colors->value);
-  n_columns = ROUND (dialog->columns->value);
-  threshold = ROUND (dialog->threshold->value);
+  n_colors  = ROUND (gtk_adjustment_get_value (dialog->num_colors));
+  n_columns = ROUND (gtk_adjustment_get_value (dialog->columns));
+  threshold = ROUND (gtk_adjustment_get_value (dialog->threshold));
 
   switch (dialog->import_type)
     {

Modified: trunk/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.c	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.c	Sun Jun 29 13:41:24 2008
@@ -987,10 +987,11 @@
                 break;
               }
 
-            value = adj->value + ((direction == GDK_SCROLL_UP ||
-                                   direction == GDK_SCROLL_LEFT) ?
-                                  -adj->page_increment / 2 :
-                                  adj->page_increment / 2);
+            value = (gtk_adjustment_get_value (adj) +
+                     ((direction == GDK_SCROLL_UP ||
+                       direction == GDK_SCROLL_LEFT) ?
+                      -adj->page_increment / 2 :
+                      adj->page_increment / 2));
             value = CLAMP (value, adj->lower, adj->upper - adj->page_size);
 
             gtk_adjustment_set_value (adj, value);
@@ -1651,14 +1652,20 @@
 gimp_display_shell_vscrollbar_update (GtkAdjustment    *adjustment,
                                       GimpDisplayShell *shell)
 {
-  gimp_display_shell_scroll (shell, 0, (adjustment->value - shell->offset_y));
+  gimp_display_shell_scroll (shell,
+                             0,
+                             gtk_adjustment_get_value (adjustment) -
+                             shell->offset_y);
 }
 
 static void
 gimp_display_shell_hscrollbar_update (GtkAdjustment    *adjustment,
                                       GimpDisplayShell *shell)
 {
-  gimp_display_shell_scroll (shell, (adjustment->value - shell->offset_x), 0);
+  gimp_display_shell_scroll (shell,
+                             gtk_adjustment_get_value (adjustment) -
+                             shell->offset_x,
+                             0);
 }
 
 static GdkModifierType

Modified: trunk/app/display/gimpnavigationeditor.c
==============================================================================
--- trunk/app/display/gimpnavigationeditor.c	(original)
+++ trunk/app/display/gimpnavigationeditor.c	Sun Jun 29 13:41:24 2008
@@ -541,7 +541,7 @@
 
       g_assert (adj != NULL);
 
-      value = adj->value;
+      value = gtk_adjustment_get_value (adj);
 
       switch (direction)
         {
@@ -566,7 +566,8 @@
 gimp_navigation_editor_zoom_adj_changed (GtkAdjustment        *adj,
                                          GimpNavigationEditor *editor)
 {
-  gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO, pow (2.0, adj->value));
+  gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO,
+                            pow (2.0, gtk_adjustment_get_value (adj)));
 }
 
 static void

Modified: trunk/app/tools/gimpbrightnesscontrasttool.c
==============================================================================
--- trunk/app/tools/gimpbrightnesscontrasttool.c	(original)
+++ trunk/app/tools/gimpbrightnesscontrasttool.c	Sun Jun 29 13:41:24 2008
@@ -386,7 +386,9 @@
                                         GimpBrightnessContrastTool *bc_tool)
 {
   GimpBrightnessContrastConfig *config = bc_tool->config;
-  gdouble                       value  = adjustment->value / 127.0;
+  gdouble                       value;
+
+  value = gtk_adjustment_get_value (adjustment) / 127.0;
 
   if (config->brightness != value)
     {
@@ -401,7 +403,9 @@
                                       GimpBrightnessContrastTool *bc_tool)
 {
   GimpBrightnessContrastConfig *config = bc_tool->config;
-  gdouble                       value  = adjustment->value / 127.0;
+  gdouble                       value;
+
+  value = gtk_adjustment_get_value (adjustment) / 127.0;
 
   if (config->contrast != value)
     {

Modified: trunk/app/tools/gimpcolorbalancetool.c
==============================================================================
--- trunk/app/tools/gimpcolorbalancetool.c	(original)
+++ trunk/app/tools/gimpcolorbalancetool.c	Sun Jun 29 13:41:24 2008
@@ -424,12 +424,11 @@
 color_balance_preserve_toggled (GtkWidget            *widget,
                                 GimpColorBalanceTool *cb_tool)
 {
-  GimpColorBalanceConfig *config = cb_tool->config;
-  gboolean                active = GTK_TOGGLE_BUTTON (widget)->active;
+  gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
 
-  if (config->preserve_luminosity != active)
+  if (cb_tool->config->preserve_luminosity != active)
     {
-      g_object_set (config,
+      g_object_set (cb_tool->config,
                     "preserve-luminosity", active,
                     NULL);
     }
@@ -439,12 +438,11 @@
 color_balance_cr_changed (GtkAdjustment        *adjustment,
                           GimpColorBalanceTool *cb_tool)
 {
-  GimpColorBalanceConfig *config = cb_tool->config;
-  gdouble                 value  = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
-  if (config->cyan_red[config->range] != value)
+  if (cb_tool->config->cyan_red[cb_tool->config->range] != value)
     {
-      g_object_set (config,
+      g_object_set (cb_tool->config,
                     "cyan-red", value,
                     NULL);
     }
@@ -454,12 +452,11 @@
 color_balance_mg_changed (GtkAdjustment        *adjustment,
                           GimpColorBalanceTool *cb_tool)
 {
-  GimpColorBalanceConfig *config = cb_tool->config;
-  gdouble                 value  = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
-  if (config->magenta_green[config->range] != value)
+  if (cb_tool->config->magenta_green[cb_tool->config->range] != value)
     {
-      g_object_set (config,
+      g_object_set (cb_tool->config,
                     "magenta-green", value,
                     NULL);
     }
@@ -469,12 +466,11 @@
 color_balance_yb_changed (GtkAdjustment        *adjustment,
                           GimpColorBalanceTool *cb_tool)
 {
-  GimpColorBalanceConfig *config = cb_tool->config;
-  gdouble                 value  = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
-  if (config->yellow_blue[config->range] != value)
+  if (cb_tool->config->yellow_blue[cb_tool->config->range] != value)
     {
-      g_object_set (config,
+      g_object_set (cb_tool->config,
                     "yellow-blue", value,
                     NULL);
     }

Modified: trunk/app/tools/gimpcolorizetool.c
==============================================================================
--- trunk/app/tools/gimpcolorizetool.c	(original)
+++ trunk/app/tools/gimpcolorizetool.c	Sun Jun 29 13:41:24 2008
@@ -312,7 +312,7 @@
 colorize_hue_changed (GtkAdjustment    *adjustment,
                       GimpColorizeTool *col_tool)
 {
-  gdouble value = adjustment->value / 360.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 360.0;
 
   if (col_tool->config->hue != value)
     {
@@ -326,7 +326,7 @@
 colorize_saturation_changed (GtkAdjustment    *adjustment,
                              GimpColorizeTool *col_tool)
 {
-  gdouble value = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
   if (col_tool->config->saturation != value)
     {
@@ -340,7 +340,7 @@
 colorize_lightness_changed (GtkAdjustment    *adjustment,
                             GimpColorizeTool *col_tool)
 {
-  gdouble value = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
   if (col_tool->config->lightness != value)
     {

Modified: trunk/app/tools/gimphuesaturationtool.c
==============================================================================
--- trunk/app/tools/gimphuesaturationtool.c	(original)
+++ trunk/app/tools/gimphuesaturationtool.c	Sun Jun 29 13:41:24 2008
@@ -568,12 +568,11 @@
 hue_saturation_hue_changed (GtkAdjustment         *adjustment,
                             GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationConfig *config = hs_tool->config;
-  gdouble                  value  = adjustment->value / 180.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 180.0;
 
-  if (config->hue[config->range] != value)
+  if (hs_tool->config->hue[hs_tool->config->range] != value)
     {
-      g_object_set (config,
+      g_object_set (hs_tool->config,
                     "hue", value,
                     NULL);
     }
@@ -583,12 +582,11 @@
 hue_saturation_lightness_changed (GtkAdjustment         *adjustment,
                                   GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationConfig *config = hs_tool->config;
-  gdouble                  value  = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
-  if (config->lightness[config->range] != value)
+  if (hs_tool->config->lightness[hs_tool->config->range] != value)
     {
-      g_object_set (config,
+      g_object_set (hs_tool->config,
                     "lightness", value,
                     NULL);
     }
@@ -598,12 +596,11 @@
 hue_saturation_saturation_changed (GtkAdjustment         *adjustment,
                                    GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationConfig *config = hs_tool->config;
-  gdouble                  value  = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
-  if (config->saturation[config->range] != value)
+  if (hs_tool->config->saturation[hs_tool->config->range] != value)
     {
-      g_object_set (config,
+      g_object_set (hs_tool->config,
                     "saturation", value,
                     NULL);
     }
@@ -613,12 +610,11 @@
 hue_saturation_overlap_changed (GtkAdjustment         *adjustment,
                                 GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationConfig *config = hs_tool->config;
-  gdouble                  value  = adjustment->value / 100.0;
+  gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
 
-  if (config->overlap != value)
+  if (hs_tool->config->overlap != value)
     {
-      g_object_set (config,
+      g_object_set (hs_tool->config,
                     "overlap", value,
                     NULL);
     }

Modified: trunk/app/tools/gimplevelstool.c
==============================================================================
--- trunk/app/tools/gimplevelstool.c	(original)
+++ trunk/app/tools/gimplevelstool.c	Sun Jun 29 13:41:24 2008
@@ -797,10 +797,10 @@
       gtk_adjustment_set_value (tool->high_input,
                                 config->high_input[config->channel] * 255.0);
 
-      tool->low_input->upper    = tool->high_input->value;
-      tool->high_input->lower   = tool->low_input->value;
-      tool->gamma_linear->lower = tool->low_input->value;
-      tool->gamma_linear->upper = tool->high_input->value;
+      tool->low_input->upper    = gtk_adjustment_get_value (tool->high_input);
+      tool->high_input->lower   = gtk_adjustment_get_value (tool->low_input);
+      tool->gamma_linear->lower = gtk_adjustment_get_value (tool->low_input);
+      tool->gamma_linear->upper = gtk_adjustment_get_value (tool->high_input);
       gtk_adjustment_changed (tool->low_input);
       gtk_adjustment_changed (tool->high_input);
       gtk_adjustment_changed (tool->gamma_linear);
@@ -938,10 +938,12 @@
 static void
 levels_linear_gamma_update (GimpLevelsTool *tool)
 {
+  gdouble low_input  = gtk_adjustment_get_value (tool->low_input);
+  gdouble high_input = gtk_adjustment_get_value (tool->high_input);
   gdouble delta, mid, tmp, value;
 
-  delta = (tool->high_input->value - tool->low_input->value) / 2.0;
-  mid   = tool->low_input->value + delta;
+  delta = (high_input - low_input) / 2.0;
+  mid   = low_input + delta;
   tmp   = log10 (1.0 / tool->config->gamma[tool->config->channel]);
   value = mid + delta * tmp;
 
@@ -952,14 +954,16 @@
 levels_linear_gamma_changed (GtkAdjustment  *adjustment,
                              GimpLevelsTool *tool)
 {
+  gdouble low_input  = gtk_adjustment_get_value (tool->low_input);
+  gdouble high_input = gtk_adjustment_get_value (tool->high_input);
   gdouble delta, mid, tmp, value;
 
-  delta = (tool->high_input->value - tool->low_input->value) / 2.0;
+  delta = (high_input - low_input) / 2.0;
 
   if (delta >= 0.5)
     {
-      mid   = tool->low_input->value + delta;
-      tmp   = (adjustment->value - mid) / delta;
+      mid   = low_input + delta;
+      tmp   = (gtk_adjustment_get_value (adjustment) - mid) / delta;
       value = 1.0 / pow (10, tmp);
 
       /*  round the gamma value to the nearest 1/100th  */
@@ -974,7 +978,7 @@
                           GimpLevelsTool *tool)
 {
   GimpLevelsConfig *config = tool->config;
-  gint              value  = ROUND (adjustment->value);
+  gint              value  = ROUND (gtk_adjustment_get_value (adjustment));
 
   tool->high_input->lower   = value;
   tool->gamma_linear->lower = value;
@@ -996,11 +1000,12 @@
                       GimpLevelsTool *tool)
 {
   GimpLevelsConfig *config = tool->config;
+  gdouble           value  = gtk_adjustment_get_value (adjustment);
 
-  if (config->gamma[config->channel] != adjustment->value)
+  if (config->gamma[config->channel] != value)
     {
       g_object_set (config,
-                    "gamma", adjustment->value,
+                    "gamma", value,
                     NULL);
     }
 
@@ -1012,7 +1017,7 @@
                            GimpLevelsTool *tool)
 {
   GimpLevelsConfig *config = tool->config;
-  gint              value  = ROUND (adjustment->value);
+  gint              value  = ROUND (gtk_adjustment_get_value (adjustment));
 
   tool->low_input->upper    = value;
   tool->gamma_linear->upper = value;
@@ -1034,7 +1039,7 @@
                            GimpLevelsTool *tool)
 {
   GimpLevelsConfig *config = tool->config;
-  gint              value  = ROUND (adjustment->value);
+  gint              value  = ROUND (gtk_adjustment_get_value (adjustment));
 
   if (config->low_output[config->channel] != value / 255.0)
     {
@@ -1049,7 +1054,7 @@
                             GimpLevelsTool *tool)
 {
   GimpLevelsConfig *config = tool->config;
-  gint              value  = ROUND (adjustment->value);
+  gint              value  = ROUND (gtk_adjustment_get_value (adjustment));
 
   if (config->high_output[config->channel] != value / 255.0)
     {

Modified: trunk/app/tools/gimpposterizetool.c
==============================================================================
--- trunk/app/tools/gimpposterizetool.c	(original)
+++ trunk/app/tools/gimpposterizetool.c	Sun Jun 29 13:41:24 2008
@@ -260,12 +260,11 @@
 gimp_posterize_tool_levels_changed (GtkAdjustment     *adjustment,
                                     GimpPosterizeTool *posterize_tool)
 {
-  GimpPosterizeConfig *config = posterize_tool->config;
-  gint                 value  = ROUND (adjustment->value);
+  gint value = ROUND (gtk_adjustment_get_value (adjustment));
 
-  if (config->levels != value)
+  if (posterize_tool->config->levels != value)
     {
-      g_object_set (config,
+      g_object_set (posterize_tool->config,
                     "levels", value,
                     NULL);
     }

Modified: trunk/app/widgets/gimpbrusheditor.c
==============================================================================
--- trunk/app/widgets/gimpbrusheditor.c	(original)
+++ trunk/app/widgets/gimpbrusheditor.c	Sun Jun 29 13:41:24 2008
@@ -347,12 +347,12 @@
 
   brush = GIMP_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data);
 
-  radius   = editor->radius_data->value;
-  spikes   = ROUND (editor->spikes_data->value);
-  hardness = editor->hardness_data->value;
-  ratio    = editor->aspect_ratio_data->value;
-  angle    = editor->angle_data->value;
-  spacing  = editor->spacing_data->value;
+  radius   = gtk_adjustment_get_value (editor->radius_data);
+  spikes   = ROUND (gtk_adjustment_get_value (editor->spikes_data));
+  hardness = gtk_adjustment_get_value (editor->hardness_data);
+  ratio    = gtk_adjustment_get_value (editor->aspect_ratio_data);
+  angle    = gtk_adjustment_get_value (editor->angle_data);
+  spacing  = gtk_adjustment_get_value (editor->spacing_data);
 
   if (radius   != gimp_brush_generated_get_radius       (brush) ||
       spikes   != gimp_brush_generated_get_spikes       (brush) ||

Modified: trunk/app/widgets/gimpbrushfactoryview.c
==============================================================================
--- trunk/app/widgets/gimpbrushfactoryview.c	(original)
+++ trunk/app/widgets/gimpbrushfactoryview.c	Sun Jun 29 13:41:24 2008
@@ -242,7 +242,7 @@
                                        gimp_brush_factory_view_spacing_changed,
                                        view);
 
-      gimp_brush_set_spacing (brush, adjustment->value);
+      gimp_brush_set_spacing (brush, gtk_adjustment_get_value (adjustment));
 
       g_signal_handlers_unblock_by_func (brush,
                                          gimp_brush_factory_view_spacing_changed,

Modified: trunk/app/widgets/gimpbrushselect.c
==============================================================================
--- trunk/app/widgets/gimpbrushselect.c	(original)
+++ trunk/app/widgets/gimpbrushselect.c	Sun Jun 29 13:41:24 2008
@@ -332,7 +332,7 @@
                                   GimpBrushSelect *select)
 {
   gimp_context_set_opacity (GIMP_PDB_DIALOG (select)->context,
-                            adjustment->value / 100.0);
+                            gtk_adjustment_get_value (adjustment) / 100.0);
 }
 
 static void
@@ -353,9 +353,11 @@
 gimp_brush_select_spacing_update (GtkAdjustment   *adjustment,
                                   GimpBrushSelect *select)
 {
-  if (select->spacing != adjustment->value)
+  gdouble value = gtk_adjustment_get_value (adjustment);
+
+  if (select->spacing != value)
     {
-      select->spacing = adjustment->value;
+      select->spacing = value;
 
       gimp_pdb_dialog_run_callback (GIMP_PDB_DIALOG (select), FALSE);
     }

Modified: trunk/app/widgets/gimpcolormapeditor.c
==============================================================================
--- trunk/app/widgets/gimpcolormapeditor.c	(original)
+++ trunk/app/widgets/gimpcolormapeditor.c	Sun Jun 29 13:41:24 2008
@@ -829,7 +829,9 @@
 
   if (HAVE_COLORMAP (image))
     {
-      gimp_colormap_editor_set_index (editor, adjustment->value + 0.5, NULL);
+      gint index = ROUND (gtk_adjustment_get_value (adjustment));
+
+      gimp_colormap_editor_set_index (editor, index, NULL);
 
       gimp_colormap_editor_update_entries (editor);
     }

Modified: trunk/app/widgets/gimpcontainertreeview-dnd.c
==============================================================================
--- trunk/app/widgets/gimpcontainertreeview-dnd.c	(original)
+++ trunk/app/widgets/gimpcontainertreeview-dnd.c	Sun Jun 29 13:41:24 2008
@@ -185,9 +185,9 @@
 #endif
 
   if (tree_view->scroll_dir == GDK_SCROLL_UP)
-    new_value = adj->value - SCROLL_STEP;
+    new_value = gtk_adjustment_get_value (adj) - SCROLL_STEP;
   else
-    new_value = adj->value + SCROLL_STEP;
+    new_value = gtk_adjustment_get_value (adj) + SCROLL_STEP;
 
   new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
 

Modified: trunk/app/widgets/gimpgradienteditor.c
==============================================================================
--- trunk/app/widgets/gimpgradienteditor.c	(original)
+++ trunk/app/widgets/gimpgradienteditor.c	Sun Jun 29 13:41:24 2008
@@ -586,7 +586,7 @@
 
   adjustment = GTK_ADJUSTMENT (editor->scroll_data);
 
-  old_value     = adjustment->value;
+  old_value     = gtk_adjustment_get_value (adjustment);
   old_page_size = adjustment->page_size;
 
   switch (zoom_type)
@@ -776,8 +776,9 @@
                           editor->zoom_factor);
 
   str2 = g_strdup_printf (_("Displaying [%0.4f, %0.4f]"),
-                          adjustment->value,
-                          adjustment->value + adjustment->page_size);
+                          gtk_adjustment_get_value (adjustment),
+                          gtk_adjustment_get_value (adjustment) +
+                          adjustment->page_size);
 
   gradient_editor_set_hint (editor, str1, str2, NULL, NULL);
 
@@ -787,8 +788,8 @@
   renderer = GIMP_VIEW_RENDERER_GRADIENT (GIMP_VIEW (data_editor->view)->renderer);
 
   gimp_view_renderer_gradient_set_offsets (renderer,
-                                           adjustment->value,
-                                           adjustment->value +
+                                           gtk_adjustment_get_value (adjustment),
+                                           gtk_adjustment_get_value (adjustment) +
                                            adjustment->page_size,
                                            editor->instant_update);
   gimp_gradient_editor_update (editor);
@@ -923,7 +924,7 @@
         else
           {
             GtkAdjustment *adj   = GTK_ADJUSTMENT (editor->scroll_data);
-            gfloat         value = adj->value;
+            gfloat         value = gtk_adjustment_get_value (adj);
 
             switch (sevent->direction)
               {
@@ -1122,9 +1123,10 @@
 
             gfloat new_value;
 
-            new_value = adj->value + ((sevent->direction == GDK_SCROLL_UP) ?
-                                      - adj->page_increment / 2 :
-                                      adj->page_increment / 2);
+            new_value = (gtk_adjustment_get_value (adj) +
+                         ((sevent->direction == GDK_SCROLL_UP) ?
+                          - adj->page_increment / 2 :
+                          adj->page_increment / 2));
 
             new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
 
@@ -1238,8 +1240,9 @@
                 GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data),
                 cr,
                 width, height,
-                adj->value,
-                adj->value + adj->page_size);
+                gtk_adjustment_get_value (adj),
+                gtk_adjustment_get_value (adj) +
+                adj->page_size);
 
   cairo_destroy (cr);
 

Modified: trunk/app/widgets/gimphistogrambox.c
==============================================================================
--- trunk/app/widgets/gimphistogrambox.c	(original)
+++ trunk/app/widgets/gimphistogrambox.c	Sun Jun 29 13:41:24 2008
@@ -193,28 +193,30 @@
 gimp_histogram_box_low_adj_update (GtkAdjustment    *adjustment,
                                    GimpHistogramBox *box)
 {
-  if ((gdouble) box->view->start == adjustment->value)
-    return;
+  gint value = ROUND (gtk_adjustment_get_value (adjustment));
 
-  box->high_adj->lower = adjustment->value;
-  gtk_adjustment_changed (box->high_adj);
+  if (box->view->start != value)
+    {
+      box->high_adj->lower = value;
+      gtk_adjustment_changed (box->high_adj);
 
-  gimp_histogram_view_set_range (box->view,
-                                 adjustment->value, box->view->end);
+      gimp_histogram_view_set_range (box->view, value, box->view->end);
+    }
 }
 
 static void
 gimp_histogram_box_high_adj_update (GtkAdjustment    *adjustment,
                                     GimpHistogramBox *box)
 {
-  if ((gdouble) box->view->end == adjustment->value)
-    return;
+  gint value = ROUND (gtk_adjustment_get_value (value));
 
-  box->low_adj->upper = adjustment->value;
-  gtk_adjustment_changed (box->low_adj);
+  if (box->view->end != value)
+    {
+      box->low_adj->upper = value;
+      gtk_adjustment_changed (box->low_adj);
 
-  gimp_histogram_view_set_range (box->view,
-                                 box->view->start, adjustment->value);
+      gimp_histogram_view_set_range (box->view, box->view->start, value);
+    }
 }
 
 static void

Modified: trunk/app/widgets/gimppaletteeditor.c
==============================================================================
--- trunk/app/widgets/gimppaletteeditor.c	(original)
+++ trunk/app/widgets/gimppaletteeditor.c	Sun Jun 29 13:41:24 2008
@@ -823,7 +823,8 @@
     {
       GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
 
-      gimp_palette_set_columns (palette, ROUND (adj->value));
+      gimp_palette_set_columns (palette,
+                                ROUND (gtk_adjustment_get_value (adj)));
     }
 }
 

Modified: trunk/app/widgets/gimpscalebutton.c
==============================================================================
--- trunk/app/widgets/gimpscalebutton.c	(original)
+++ trunk/app/widgets/gimpscalebutton.c	Sun Jun 29 13:41:24 2008
@@ -90,14 +90,21 @@
 {
   GtkAdjustment *adj;
   gchar         *text;
+  gdouble        value;
+  gdouble        lower;
+  gdouble        upper;
 
   adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
 
+  value = gtk_adjustment_get_value (adj);
+  lower = adj->lower;
+  upper = adj->upper;
+
   /*  use U+2009 THIN SPACE to seperate the percent sign from the number */
 
   text = g_strdup_printf ("%d\342\200\211%%",
-                          (gint) (0.5 + ((adj->value - adj->lower) * 100.0 /
-                                         (adj->upper - adj->lower))));
+                          (gint) (0.5 + ((value - lower) * 100.0 /
+                                         (upper - lower))));
 
   gtk_widget_set_tooltip_text (GTK_WIDGET (button), text);
   g_free (text);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]