[gimp] app: store adjustments as GtkAdjustment pointers instead of GtkObject ones



commit 400f5ac5f309bf983d6a91b973e0ee5ad4861e5e
Author: Michael Natterer <mitch gimp org>
Date:   Tue Oct 19 12:27:33 2010 +0200

    app: store adjustments as GtkAdjustment pointers instead of GtkObject ones
    
    and get rid of casting them.

 app/tools/gimpaligntool.c  |    2 +-
 app/tools/gimpaligntool.h  |    4 ++--
 app/tools/gimprotatetool.c |    6 +++---
 app/tools/gimprotatetool.h |    2 +-
 app/tools/gimpsheartool.c  |   10 ++++------
 app/tools/gimpsheartool.h  |    4 ++--
 6 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/app/tools/gimpaligntool.c b/app/tools/gimpaligntool.c
index 053fcdb..fefaef2 100644
--- a/app/tools/gimpaligntool.c
+++ b/app/tools/gimpaligntool.c
@@ -892,7 +892,7 @@ gimp_align_tool_controls (GimpAlignTool *align_tool)
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
 
-  spinbutton = gimp_spin_button_new (&align_tool->horz_offset_adjustment,
+  spinbutton = gimp_spin_button_new ((GtkObject **) &align_tool->horz_offset_adjustment,
                                      0,
                                      -100000,
                                      100000,
diff --git a/app/tools/gimpaligntool.h b/app/tools/gimpaligntool.h
index 89489d1..d5f66f0 100644
--- a/app/tools/gimpaligntool.h
+++ b/app/tools/gimpaligntool.h
@@ -62,8 +62,8 @@ struct _GimpAlignTool
   gdouble                horz_offset;
   gdouble                vert_offset;
 
-  GtkObject             *horz_offset_adjustment;
-  GtkObject             *vert_offset_adjustment;
+  GtkAdjustment         *horz_offset_adjustment;
+  GtkAdjustment         *vert_offset_adjustment;
 
   gint                   x0, y0, x1, y1;   /* rubber-band rectangle */
 
diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c
index 27f4847..f6d3e37 100644
--- a/app/tools/gimprotatetool.c
+++ b/app/tools/gimprotatetool.c
@@ -181,7 +181,7 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
                       table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
-  button = gimp_spin_button_new (&rotate->angle_adj,
+  button = gimp_spin_button_new ((GtkObject **) &rotate->angle_adj,
                                  0, -180, 180, 0.1, 15, 0, 2, 2);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (button), TRUE);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
@@ -193,7 +193,7 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
                     G_CALLBACK (rotate_angle_changed),
                     tr_tool);
 
-  scale = gtk_hscale_new (GTK_ADJUSTMENT (rotate->angle_adj));
+  scale = gtk_hscale_new (rotate->angle_adj);
   gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
   gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 1, 2,
                     GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
@@ -223,7 +223,7 @@ gimp_rotate_tool_dialog_update (GimpTransformTool *tr_tool)
 {
   GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);
 
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (rotate->angle_adj),
+  gtk_adjustment_set_value (rotate->angle_adj,
                             gimp_rad_to_deg (tr_tool->trans_info[ANGLE]));
 
   g_signal_handlers_block_by_func (rotate->sizeentry,
diff --git a/app/tools/gimprotatetool.h b/app/tools/gimprotatetool.h
index 2695574..e7e02d1 100644
--- a/app/tools/gimprotatetool.h
+++ b/app/tools/gimprotatetool.h
@@ -37,7 +37,7 @@ struct _GimpRotateTool
 {
   GimpTransformTool  parent_instance;
 
-  GtkObject         *angle_adj;
+  GtkAdjustment     *angle_adj;
   GtkWidget         *angle_spin_button;
   GtkWidget         *sizeentry;
 };
diff --git a/app/tools/gimpsheartool.c b/app/tools/gimpsheartool.c
index 082ae82..4da3077 100644
--- a/app/tools/gimpsheartool.c
+++ b/app/tools/gimpsheartool.c
@@ -127,7 +127,7 @@ gimp_shear_tool_dialog (GimpTransformTool *tr_tool)
                       table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
-  button = gimp_spin_button_new (&shear->x_adj,
+  button = gimp_spin_button_new ((GtkObject **) &shear->x_adj,
                                  0, -65536, 65536, 1, 15, 0, 1, 0);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Shear magnitude _X:"),
@@ -137,7 +137,7 @@ gimp_shear_tool_dialog (GimpTransformTool *tr_tool)
                     G_CALLBACK (shear_x_mag_changed),
                     tr_tool);
 
-  button = gimp_spin_button_new (&shear->y_adj,
+  button = gimp_spin_button_new ((GtkObject **) &shear->y_adj,
                                  0, -65536, 65536, 1, 15, 0, 1, 0);
   gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Shear magnitude _Y:"),
@@ -153,10 +153,8 @@ gimp_shear_tool_dialog_update (GimpTransformTool *tr_tool)
 {
   GimpShearTool *shear = GIMP_SHEAR_TOOL (tr_tool);
 
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (shear->x_adj),
-                            tr_tool->trans_info[XSHEAR]);
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (shear->y_adj),
-                            tr_tool->trans_info[YSHEAR]);
+  gtk_adjustment_set_value (shear->x_adj, tr_tool->trans_info[XSHEAR]);
+  gtk_adjustment_set_value (shear->y_adj, tr_tool->trans_info[YSHEAR]);
 }
 
 static void
diff --git a/app/tools/gimpsheartool.h b/app/tools/gimpsheartool.h
index 20df66c..32d278a 100644
--- a/app/tools/gimpsheartool.h
+++ b/app/tools/gimpsheartool.h
@@ -37,8 +37,8 @@ struct _GimpShearTool
 {
   GimpTransformTool  parent_instance;
 
-  GtkObject         *x_adj;
-  GtkObject         *y_adj;
+  GtkAdjustment     *x_adj;
+  GtkAdjustment     *y_adj;
 };
 
 struct _GimpShearToolClass



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