[gimp] app: replace the last GtkObject members by GtkAdjustment



commit ab0b88b5db06f48113063b799bf8d2966ae05c12
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 15 17:00:41 2011 +0200

    app: replace the last GtkObject members by GtkAdjustment
    
    Also get rid of some unneeded GTK_ADJUSTMENT() casts and replace some
    local GtkObject veriables by GtkAdjustment.

 app/display/gimpnavigationeditor.c |    2 +-
 app/tools/gimpcolorbalancetool.c   |   14 +++++++-------
 app/widgets/gimpbrushselect.c      |    3 +--
 app/widgets/gimpgradienteditor.c   |   22 +++++++++++-----------
 app/widgets/gimpgradienteditor.h   |    2 +-
 5 files changed, 21 insertions(+), 22 deletions(-)
---
diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c
index 6bcf882..7f97e82 100644
--- a/app/display/gimpnavigationeditor.c
+++ b/app/display/gimpnavigationeditor.c
@@ -416,7 +416,7 @@ gimp_navigation_editor_new_private (GimpMenuFactory  *menu_factory,
                         G_CALLBACK (gimp_navigation_editor_zoom_adj_changed),
                         editor);
 
-      hscale = gtk_hscale_new (GTK_ADJUSTMENT (editor->zoom_adjustment));
+      hscale = gtk_hscale_new (editor->zoom_adjustment);
       gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_DELAYED);
       gtk_scale_set_draw_value (GTK_SCALE (hscale), FALSE);
       gtk_box_pack_start (GTK_BOX (hbox), hscale, TRUE, TRUE, 0);
diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c
index 9e4a09a..7e118f1 100644
--- a/app/tools/gimpcolorbalancetool.c
+++ b/app/tools/gimpcolorbalancetool.c
@@ -214,10 +214,10 @@ create_levels_scale (gdouble        value,
                      GtkWidget     *table,
                      gint           col)
 {
-  GtkWidget *label;
-  GtkWidget *slider;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
+  GtkWidget     *label;
+  GtkWidget     *slider;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
 
   label = gtk_label_new (left);
   gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
@@ -225,11 +225,11 @@ create_levels_scale (gdouble        value,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (label);
 
-  spinbutton = gimp_spin_button_new (&adj,
+  spinbutton = gimp_spin_button_new ((GtkObject **) &adj,
                                      value, -100.0, 100.0,
                                      1.0, 10.0, 0.0, 1.0, 0);
 
-  slider = gtk_hscale_new (GTK_ADJUSTMENT (adj));
+  slider = gtk_hscale_new (adj);
   gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
   gtk_widget_set_size_request (slider, 100, -1);
   gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, col, col + 1);
@@ -245,7 +245,7 @@ create_levels_scale (gdouble        value,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
 
-  return GTK_ADJUSTMENT (adj);
+  return adj;
 }
 
 static void
diff --git a/app/widgets/gimpbrushselect.c b/app/widgets/gimpbrushselect.c
index df650c2..21dd0a3 100644
--- a/app/widgets/gimpbrushselect.c
+++ b/app/widgets/gimpbrushselect.c
@@ -288,8 +288,7 @@ gimp_brush_select_opacity_changed (GimpContext     *context,
                                    gimp_brush_select_opacity_update,
                                    select);
 
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (select->opacity_data),
-                            opacity * 100.0);
+  gtk_adjustment_set_value (select->opacity_data, opacity * 100.0);
 
   g_signal_handlers_unblock_by_func (select->opacity_data,
                                      gimp_brush_select_opacity_update,
diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c
index 1f7f0a3..d72cc04 100644
--- a/app/widgets/gimpgradienteditor.c
+++ b/app/widgets/gimpgradienteditor.c
@@ -363,10 +363,10 @@ gimp_gradient_editor_init (GimpGradientEditor *editor)
   /*  Scrollbar  */
   editor->zoom_factor = 1;
 
-  editor->scroll_data = gtk_adjustment_new (0.0, 0.0, 1.0,
-                                            GRAD_SCROLLBAR_STEP_SIZE,
-                                            GRAD_SCROLLBAR_PAGE_SIZE,
-                                            1.0);
+  editor->scroll_data = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1.0,
+                                                            GRAD_SCROLLBAR_STEP_SIZE,
+                                                            GRAD_SCROLLBAR_PAGE_SIZE,
+                                                            1.0));
 
   g_signal_connect (editor->scroll_data, "value-changed",
                     G_CALLBACK (gradient_editor_scrollbar_update),
@@ -375,7 +375,7 @@ gimp_gradient_editor_init (GimpGradientEditor *editor)
                     G_CALLBACK (gradient_editor_scrollbar_update),
                     editor);
 
-  editor->scrollbar = gtk_hscrollbar_new (GTK_ADJUSTMENT (editor->scroll_data));
+  editor->scrollbar = gtk_hscrollbar_new (editor->scroll_data);
   gtk_box_pack_start (GTK_BOX (editor), editor->scrollbar, FALSE, FALSE, 0);
   gtk_widget_show (editor->scrollbar);
 
@@ -560,7 +560,7 @@ gimp_gradient_editor_zoom (GimpGradientEditor *editor,
 
   g_return_if_fail (GIMP_IS_GRADIENT_EDITOR (editor));
 
-  adjustment = GTK_ADJUSTMENT (editor->scroll_data);
+  adjustment = editor->scroll_data;
 
   old_value     = gtk_adjustment_get_value (adjustment);
   old_page_size = gtk_adjustment_get_page_size (adjustment);
@@ -880,7 +880,7 @@ view_events (GtkWidget          *widget,
           }
         else
           {
-            GtkAdjustment *adj   = GTK_ADJUSTMENT (editor->scroll_data);
+            GtkAdjustment *adj   = editor->scroll_data;
             gfloat         value = gtk_adjustment_get_value (adj);
 
             switch (sevent->direction)
@@ -1076,7 +1076,7 @@ control_events (GtkWidget          *widget,
           }
         else
           {
-            GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data);
+            GtkAdjustment *adj = editor->scroll_data;
 
             gfloat new_value;
 
@@ -1183,7 +1183,7 @@ control_expose (GtkWidget          *widget,
                 GdkEventExpose     *event,
                 GimpGradientEditor *editor)
 {
-  GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data);
+  GtkAdjustment *adj = editor->scroll_data;
   cairo_t       *cr  = gdk_cairo_create (gtk_widget_get_window (widget));
   GtkAllocation  allocation;
 
@@ -1846,7 +1846,7 @@ static gint
 control_calc_p_pos (GimpGradientEditor *editor,
                     gdouble             pos)
 {
-  GtkAdjustment *adjustment = GTK_ADJUSTMENT (editor->scroll_data);
+  GtkAdjustment *adjustment = editor->scroll_data;
   GtkAllocation  allocation;
   gint           pwidth;
 
@@ -1868,7 +1868,7 @@ static gdouble
 control_calc_g_pos (GimpGradientEditor *editor,
                     gint                pos)
 {
-  GtkAdjustment *adjustment = GTK_ADJUSTMENT (editor->scroll_data);
+  GtkAdjustment *adjustment = editor->scroll_data;
   GtkAllocation  allocation;
   gint           pwidth;
 
diff --git a/app/widgets/gimpgradienteditor.h b/app/widgets/gimpgradienteditor.h
index e9b7272..6387c33 100644
--- a/app/widgets/gimpgradienteditor.h
+++ b/app/widgets/gimpgradienteditor.h
@@ -61,7 +61,7 @@ struct _GimpGradientEditor
 
   /*  Zoom and scrollbar  */
   guint           zoom_factor;
-  GtkObject      *scroll_data;
+  GtkAdjustment  *scroll_data;
 
   /*  Color dialog  */
   GtkWidget      *color_dialog;



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