app: store adjustments as GtkAdjustment pointers instead of GtkObject ones

and get rid of casting them.
This commit is contained in:
Michael Natterer 2010-10-19 12:27:33 +02:00
parent 868fdcf99f
commit 400f5ac5f3
6 changed files with 13 additions and 15 deletions

View File

@ -892,7 +892,7 @@ gimp_align_tool_controls (GimpAlignTool *align_tool)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label); 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, 0,
-100000, -100000,
100000, 100000,

View File

@ -62,8 +62,8 @@ struct _GimpAlignTool
gdouble horz_offset; gdouble horz_offset;
gdouble vert_offset; gdouble vert_offset;
GtkObject *horz_offset_adjustment; GtkAdjustment *horz_offset_adjustment;
GtkObject *vert_offset_adjustment; GtkAdjustment *vert_offset_adjustment;
gint x0, y0, x1, y1; /* rubber-band rectangle */ gint x0, y0, x1, y1; /* rubber-band rectangle */

View File

@ -181,7 +181,7 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
table, FALSE, FALSE, 0); table, FALSE, FALSE, 0);
gtk_widget_show (table); 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); 0, -180, 180, 0.1, 15, 0, 2, 2);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (button), TRUE); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (button), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH); 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), G_CALLBACK (rotate_angle_changed),
tr_tool); 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_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 1, 2, gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0); 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); 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])); gimp_rad_to_deg (tr_tool->trans_info[ANGLE]));
g_signal_handlers_block_by_func (rotate->sizeentry, g_signal_handlers_block_by_func (rotate->sizeentry,

View File

@ -37,7 +37,7 @@ struct _GimpRotateTool
{ {
GimpTransformTool parent_instance; GimpTransformTool parent_instance;
GtkObject *angle_adj; GtkAdjustment *angle_adj;
GtkWidget *angle_spin_button; GtkWidget *angle_spin_button;
GtkWidget *sizeentry; GtkWidget *sizeentry;
}; };

View File

@ -127,7 +127,7 @@ gimp_shear_tool_dialog (GimpTransformTool *tr_tool)
table, FALSE, FALSE, 0); table, FALSE, FALSE, 0);
gtk_widget_show (table); 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); 0, -65536, 65536, 1, 15, 0, 1, 0);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH); gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Shear magnitude _X:"), 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), G_CALLBACK (shear_x_mag_changed),
tr_tool); 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); 0, -65536, 65536, 1, 15, 0, 1, 0);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH); gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Shear magnitude _Y:"), 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); GimpShearTool *shear = GIMP_SHEAR_TOOL (tr_tool);
gtk_adjustment_set_value (GTK_ADJUSTMENT (shear->x_adj), gtk_adjustment_set_value (shear->x_adj, tr_tool->trans_info[XSHEAR]);
tr_tool->trans_info[XSHEAR]); gtk_adjustment_set_value (shear->y_adj, tr_tool->trans_info[YSHEAR]);
gtk_adjustment_set_value (GTK_ADJUSTMENT (shear->y_adj),
tr_tool->trans_info[YSHEAR]);
} }
static void static void

View File

@ -37,8 +37,8 @@ struct _GimpShearTool
{ {
GimpTransformTool parent_instance; GimpTransformTool parent_instance;
GtkObject *x_adj; GtkAdjustment *x_adj;
GtkObject *y_adj; GtkAdjustment *y_adj;
}; };
struct _GimpShearToolClass struct _GimpShearToolClass