[gtk+] gtk_adjustment_new() should return a GtkAdjustment*



commit 42f480a537da89eac587a5a67fbf64ab248cd931
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Sep 27 14:48:26 2010 +0200

    gtk_adjustment_new() should return a GtkAdjustment*
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=630731

 docs/tutorial/gtk-tut.sgml           |   60 ++++++++++++++++------------------
 examples/rangewidgets/rangewidgets.c |    2 +-
 gtk/gtkadjustment.c                  |    2 +-
 gtk/gtkadjustment.h                  |    2 +-
 gtk/gtkhscale.c                      |    2 +-
 gtk/gtkscale.c                       |    2 +-
 gtk/gtkscalebutton.c                 |    2 +-
 gtk/gtkspinbutton.c                  |    4 +-
 gtk/gtkvolumebutton.c                |    2 +-
 gtk/gtkvscale.c                      |    2 +-
 tests/flicker.c                      |   42 ++++++++++++------------
 tests/testgtk.c                      |    2 +-
 tests/testtreeview.c                 |    2 +-
 13 files changed, 61 insertions(+), 65 deletions(-)
---
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index e7e93d8..f79f214 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -2584,12 +2584,12 @@ but some cases will be shown in later examples where you may need to
 create one yourself. You create an adjustment using:</para>
 
 <programlisting role="C">
-GtkObject *gtk_adjustment_new( gdouble value,
-                               gdouble lower,
-                               gdouble upper,
-                               gdouble step_increment,
-                               gdouble page_increment,
-                               gdouble page_size );
+GtkAdjustment *gtk_adjustment_new( gdouble value,
+                                   gdouble lower,
+                                   gdouble upper,
+                                   gdouble step_increment,
+                                   gdouble page_increment,
+                                   gdouble page_size );
 </programlisting>
 
 <para>The <literal>value</literal> argument is the initial value you want to give to the
@@ -3151,7 +3151,7 @@ static void create_range_controls( void )
     GtkWidget *opt, *menu, *item;
     GtkWidget *label;
     GtkWidget *scale;
-    GtkObject *adj1, *adj2;
+    GtkAdjustment *adj1, *adj2;
 
     /* Standard window-creating stuff */
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -4732,12 +4732,12 @@ button can take. This makes for a powerful Spin Button widget.</para>
 function, which illustrates the information that it holds:</para>
 
 <programlisting role="C">
-GtkObject *gtk_adjustment_new( gdouble value,
-                               gdouble lower,
-                               gdouble upper,
-                               gdouble step_increment,
-                               gdouble page_increment,
-                               gdouble page_size );
+GtkAdjustment *gtk_adjustment_new( gdouble value,
+                                   gdouble lower,
+                                   gdouble upper,
+                                   gdouble step_increment,
+                                   gdouble page_increment,
+                                   gdouble page_size );
 </programlisting>
 
 <para>These attributes of an Adjustment are used by the Spin Button in the
@@ -5030,9 +5030,8 @@ int main( int   argc,
   label = gtk_label_new ("Day :");
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
   gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
-  
-  adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0,
-					      5.0, 0.0);
+
+  adj = gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0);
   spinner = gtk_spin_button_new (adj, 0, 0);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
   gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
@@ -5043,9 +5042,8 @@ int main( int   argc,
   label = gtk_label_new ("Month :");
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
   gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
-  
-  adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0,
-					      5.0, 0.0);
+
+  adj = gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0);
   spinner = gtk_spin_button_new (adj, 0, 0);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
   gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
@@ -5056,9 +5054,8 @@ int main( int   argc,
   label = gtk_label_new ("Year :");
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
   gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
-  
-  adj = (GtkAdjustment *) gtk_adjustment_new (1998.0, 0.0, 2100.0,
-					      1.0, 100.0, 0.0);
+
+  adj = gtk_adjustment_new (1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0);
   spinner = gtk_spin_button_new (adj, 0, 0);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), FALSE);
   gtk_widget_set_size_request (spinner, 55, -1);
@@ -5080,9 +5077,8 @@ int main( int   argc,
   label = gtk_label_new ("Value :");
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
   gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
-  
-  adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0,
-					      0.5, 100.0, 0.0);
+
+  adj = gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0);
   spinner1 = gtk_spin_button_new (adj, 1.0, 2);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
   gtk_widget_set_size_request (spinner1, 100, -1);
@@ -5094,8 +5090,8 @@ int main( int   argc,
   label = gtk_label_new ("Digits :");
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
   gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
-  
-  adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 5, 1, 1, 0);
+
+  adj = gtk_adjustment_new (2, 1, 5, 1, 1, 0);
   spinner2 = gtk_spin_button_new (adj, 0.0, 0);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner2), TRUE);
   g_signal_connect (adj, "value_changed",
@@ -11796,7 +11792,7 @@ gtk_dial_new (GtkAdjustment *adjustment)
   dial = gtk_type_new (gtk_dial_get_type ());
 
   if (!adjustment)
-    adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+    adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
 
   gtk_dial_set_adjustment (dial, adjustment);
 
@@ -15002,7 +14998,7 @@ gtk_dial_new (GtkAdjustment *adjustment)
   dial = g_object_new (gtk_dial_get_type (), NULL);
 
   if (!adjustment)
-    adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+    adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
 
   gtk_dial_set_adjustment (dial, adjustment);
 
@@ -15590,9 +15586,9 @@ int main( int   argc,
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
   gtk_container_add (GTK_CONTAINER (vbox), frame);
   gtk_widget_show (frame); 
- 
-  adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0));
-  
+
+  adjustment = gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0);
+
   dial = gtk_dial_new (adjustment);
   gtk_dial_set_update_policy (GTK_DIAL (dial), GTK_UPDATE_DELAYED);
   /*  gtk_widget_set_size_request (dial, 100, 100); */
diff --git a/examples/rangewidgets/rangewidgets.c b/examples/rangewidgets/rangewidgets.c
index ba36b67..e72bc5c 100644
--- a/examples/rangewidgets/rangewidgets.c
+++ b/examples/rangewidgets/rangewidgets.c
@@ -87,7 +87,7 @@ static void create_range_controls( void )
     GtkWidget *opt, *menu, *item;
     GtkWidget *label;
     GtkWidget *scale;
-    GtkObject *adj1, *adj2;
+    GtkAdjustment *adj1, *adj2;
 
     /* Standard window-creating stuff */
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c
index 146fbd4..9c3b1d3 100644
--- a/gtk/gtkadjustment.c
+++ b/gtk/gtkadjustment.c
@@ -318,7 +318,7 @@ gtk_adjustment_dispatch_properties_changed (GObject     *object,
     }
 }
 
-GObject *
+GtkAdjustment *
 gtk_adjustment_new (gdouble value,
 		    gdouble lower,
 		    gdouble upper,
diff --git a/gtk/gtkadjustment.h b/gtk/gtkadjustment.h
index 0e7cafb..7cac642 100644
--- a/gtk/gtkadjustment.h
+++ b/gtk/gtkadjustment.h
@@ -74,7 +74,7 @@ struct _GtkAdjustmentClass
 
 
 GType	   gtk_adjustment_get_type		(void) G_GNUC_CONST;
-GObject*   gtk_adjustment_new			(gdouble	  value,
+GtkAdjustment*   gtk_adjustment_new		(gdouble	  value,
 						 gdouble	  lower,
 						 gdouble	  upper,
 						 gdouble	  step_increment,
diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c
index 577493c..a8b86e4 100644
--- a/gtk/gtkhscale.c
+++ b/gtk/gtkhscale.c
@@ -83,7 +83,7 @@ gtk_hscale_new_with_range (gdouble min,
                            gdouble max,
                            gdouble step)
 {
-  GObject *adj;
+  GtkAdjustment *adj;
   GtkScale *scale;
   gint digits;
 
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index f136e7c..4e727a1 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -546,7 +546,7 @@ gtk_scale_new_with_range (GtkOrientation orientation,
                           gdouble        max,
                           gdouble        step)
 {
-  GObject *adj;
+  GtkAdjustment *adj;
   gint digits;
 
   g_return_val_if_fail (min < max, NULL);
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 60b8153..2de9de9 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -580,7 +580,7 @@ gtk_scale_button_new (GtkIconSize   size,
 		      const gchar **icons)
 {
   GtkScaleButton *button;
-  GObject *adj;
+  GtkAdjustment *adj;
 
   adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0);
 
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index d711769..62f5e6b 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1782,7 +1782,7 @@ gtk_spin_button_new_with_range (gdouble min,
 				gdouble max,
 				gdouble step)
 {
-  GObject *adj;
+  GtkAdjustment *adj;
   GtkSpinButton *spin;
   gint digits;
 
@@ -1801,7 +1801,7 @@ gtk_spin_button_new_with_range (gdouble min,
       digits = MAX_DIGITS;
   }
 
-  gtk_spin_button_configure (spin, GTK_ADJUSTMENT (adj), step, digits);
+  gtk_spin_button_configure (spin, adj, step, digits);
 
   gtk_spin_button_set_numeric (spin, TRUE);
 
diff --git a/gtk/gtkvolumebutton.c b/gtk/gtkvolumebutton.c
index d84358d..a9c8703 100644
--- a/gtk/gtkvolumebutton.c
+++ b/gtk/gtkvolumebutton.c
@@ -69,7 +69,7 @@ static void
 gtk_volume_button_init (GtkVolumeButton *button)
 {
   GtkScaleButton *sbutton = GTK_SCALE_BUTTON (button);
-  GObject *adj;
+  GtkAdjustment *adj;
   GtkWidget *minus_button, *plus_button;
   const char *icons[] = {
 	"audio-volume-muted",
diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c
index 5cb2856..af7fa40 100644
--- a/gtk/gtkvscale.c
+++ b/gtk/gtkvscale.c
@@ -102,7 +102,7 @@ gtk_vscale_new_with_range (gdouble min,
                            gdouble max,
                            gdouble step)
 {
-  GObject *adj;
+  GtkAdjustment *adj;
   GtkScale *scale;
   gint digits;
 
diff --git a/tests/flicker.c b/tests/flicker.c
index 117e3e3..4bbe0c4 100644
--- a/tests/flicker.c
+++ b/tests/flicker.c
@@ -7,51 +7,51 @@ create_flicker (void)
   GtkWidget *hpaned1;
   GtkWidget *vpaned2;
   GtkWidget *hbox2;
-  GObject   *spinbutton7_adj;
+  GtkAdjustment *spinbutton7_adj;
   GtkWidget *spinbutton7;
-  GObject   *spinbutton8_adj;
+  GtkAdjustment *spinbutton8_adj;
   GtkWidget *spinbutton8;
   GtkWidget *vbox1;
-  GObject   *spinbutton9_adj;
+  GtkAdjustment *spinbutton9_adj;
   GtkWidget *spinbutton9;
-  GObject   *spinbutton10_adj;
+  GtkAdjustment *spinbutton10_adj;
   GtkWidget *spinbutton10;
-  GObject   *spinbutton11_adj;
+  GtkAdjustment *spinbutton11_adj;
   GtkWidget *spinbutton11;
-  GObject   *spinbutton12_adj;
+  GtkAdjustment *spinbutton12_adj;
   GtkWidget *spinbutton12;
-  GObject   *spinbutton13_adj;
+  GtkAdjustment *spinbutton13_adj;
   GtkWidget *spinbutton13;
-  GObject   *spinbutton14_adj;
+  GtkAdjustment *spinbutton14_adj;
   GtkWidget *spinbutton14;
-  GObject   *spinbutton15_adj;
+  GtkAdjustment *spinbutton15_adj;
   GtkWidget *spinbutton15;
-  GObject   *spinbutton16_adj;
+  GtkAdjustment *spinbutton16_adj;
   GtkWidget *spinbutton16;
   GtkWidget *vpaned1;
   GtkWidget *hbox1;
-  GObject   *spinbutton17_adj;
+  GtkAdjustment *spinbutton17_adj;
   GtkWidget *spinbutton17;
-  GObject   *spinbutton18_adj;
+  GtkAdjustment *spinbutton18_adj;
   GtkWidget *spinbutton18;
-  GObject   *spinbutton19_adj;
+  GtkAdjustment *spinbutton19_adj;
   GtkWidget *spinbutton19;
   GtkWidget *vbox2;
-  GObject   *spinbutton20_adj;
+  GtkAdjustment *spinbutton20_adj;
   GtkWidget *spinbutton20;
-  GObject   *spinbutton21_adj;
+  GtkAdjustment *spinbutton21_adj;
   GtkWidget *spinbutton21;
-  GObject   *spinbutton22_adj;
+  GtkAdjustment *spinbutton22_adj;
   GtkWidget *spinbutton22;
-  GObject   *spinbutton23_adj;
+  GtkAdjustment *spinbutton23_adj;
   GtkWidget *spinbutton23;
-  GObject   *spinbutton24_adj;
+  GtkAdjustment *spinbutton24_adj;
   GtkWidget *spinbutton24;
-  GObject   *spinbutton25_adj;
+  GtkAdjustment *spinbutton25_adj;
   GtkWidget *spinbutton25;
-  GObject   *spinbutton26_adj;
+  GtkAdjustment *spinbutton26_adj;
   GtkWidget *spinbutton26;
-  GObject   *spinbutton27_adj;
+  GtkAdjustment *spinbutton27_adj;
   GtkWidget *spinbutton27;
 
   window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 63e37b3..fd553bb 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -5959,7 +5959,7 @@ create_range_controls (GtkWidget *widget)
   GtkWidget *scrollbar;
   GtkWidget *scale;
   GtkWidget *separator;
-  GObject *adjustment;
+  GtkAdjustment *adjustment;
   GtkWidget *hbox;
 
   if (!window)
diff --git a/tests/testtreeview.c b/tests/testtreeview.c
index 0b0c5bf..5115ae4 100644
--- a/tests/testtreeview.c
+++ b/tests/testtreeview.c
@@ -327,7 +327,7 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
   GtkCellRenderer *rend;
   GdkPixbuf *pixbuf;
   GtkWidget *image;
-  GObject *adjustment;
+  GtkAdjustment *adjustment;
 
   current_column_type = type;
   



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