[gtk+] Move classes that currently derive from GtkObject to GInitiallyUnowned



commit 3b8184cfee90f8f4e13ae64919a6a08921f78b8a
Author: Javier Jardón <jjardon gnome org>
Date:   Sat Sep 18 19:54:31 2010 -0400

    Move classes that currently derive from GtkObject to GInitiallyUnowned

 gtk/gtkadjustment.c     |    4 ++--
 gtk/gtkadjustment.h     |    9 ++++-----
 gtk/gtkcellrenderer.c   |    3 +--
 gtk/gtkcellrenderer.h   |    4 ++--
 gtk/gtkfilefilter.c     |    8 ++++----
 gtk/gtkhscale.c         |    2 +-
 gtk/gtkrecentfilter.c   |    8 ++++----
 gtk/gtkscale.c          |    2 +-
 gtk/gtkscalebutton.c    |    2 +-
 gtk/gtkspinbutton.c     |    8 +++-----
 gtk/gtktreeviewcolumn.h |    7 ++-----
 gtk/gtkvolumebutton.c   |    2 +-
 gtk/gtkvscale.c         |    2 +-
 tests/flicker.c         |   42 +++++++++++++++++++++---------------------
 tests/testgtk.c         |    2 +-
 tests/testtreeview.c    |    4 ++--
 16 files changed, 51 insertions(+), 58 deletions(-)
---
diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c
index d8d344e..146fbd4 100644
--- a/gtk/gtkadjustment.c
+++ b/gtk/gtkadjustment.c
@@ -66,7 +66,7 @@ static guint adjustment_signals[LAST_SIGNAL] = { 0 };
 
 static guint64 adjustment_changed_stamp = 0; /* protected by global gdk lock */
 
-G_DEFINE_TYPE (GtkAdjustment, gtk_adjustment, GTK_TYPE_OBJECT)
+G_DEFINE_TYPE (GtkAdjustment, gtk_adjustment, G_TYPE_INITIALLY_UNOWNED)
 
 static void
 gtk_adjustment_class_init (GtkAdjustmentClass *class)
@@ -318,7 +318,7 @@ gtk_adjustment_dispatch_properties_changed (GObject     *object,
     }
 }
 
-GtkObject *
+GObject *
 gtk_adjustment_new (gdouble value,
 		    gdouble lower,
 		    gdouble upper,
diff --git a/gtk/gtkadjustment.h b/gtk/gtkadjustment.h
index 39a6f86..1435ba5 100644
--- a/gtk/gtkadjustment.h
+++ b/gtk/gtkadjustment.h
@@ -31,9 +31,8 @@
 #ifndef __GTK_ADJUSTMENT_H__
 #define __GTK_ADJUSTMENT_H__
 
-
-#include <gdk/gdk.h>
 #include <gtk/gtkobject.h>
+#include <gdk/gdk.h>
 
 G_BEGIN_DECLS
 
@@ -50,7 +49,7 @@ typedef struct _GtkAdjustmentClass  GtkAdjustmentClass;
 
 struct _GtkAdjustment
 {
-  GtkObject parent_instance;
+  GInitiallyUnowned parent_instance;
 
   gdouble GSEAL (lower);
   gdouble GSEAL (upper);
@@ -62,7 +61,7 @@ struct _GtkAdjustment
 
 struct _GtkAdjustmentClass
 {
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 
   void (* changed)	 (GtkAdjustment *adjustment);
   void (* value_changed) (GtkAdjustment *adjustment);
@@ -76,7 +75,7 @@ struct _GtkAdjustmentClass
 
 
 GType	   gtk_adjustment_get_type		(void) G_GNUC_CONST;
-GtkObject* gtk_adjustment_new			(gdouble	  value,
+GObject*   gtk_adjustment_new			(gdouble	  value,
 						 gdouble	  lower,
 						 gdouble	  upper,
 						 gdouble	  step_increment,
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index e0d6839..814a26c 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -112,8 +112,7 @@ enum {
 
 static guint  cell_renderer_signals[LAST_SIGNAL] = { 0 };
 
-
-G_DEFINE_ABSTRACT_TYPE(GtkCellRenderer, gtk_cell_renderer, GTK_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE(GtkCellRenderer, gtk_cell_renderer, G_TYPE_INITIALLY_UNOWNED)
 
 static void
 gtk_cell_renderer_init (GtkCellRenderer *cell)
diff --git a/gtk/gtkcellrenderer.h b/gtk/gtkcellrenderer.h
index 934406b..0264703 100644
--- a/gtk/gtkcellrenderer.h
+++ b/gtk/gtkcellrenderer.h
@@ -58,7 +58,7 @@ typedef struct _GtkCellRendererClass         GtkCellRendererClass;
 
 struct _GtkCellRenderer
 {
-  GtkObject parent;
+  GInitiallyUnowned parent_instance;
 
   /* <private> */
   GtkCellRendererPrivate *priv;
@@ -66,7 +66,7 @@ struct _GtkCellRenderer
 
 struct _GtkCellRendererClass
 {
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 
   /* vtable - not signals */
   GtkSizeRequestMode (* get_request_mode)                (GtkCellRenderer      *cell);
diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c
index f0e437f..9d4e248 100644
--- a/gtk/gtkfilefilter.c
+++ b/gtk/gtkfilefilter.c
@@ -41,13 +41,13 @@ typedef enum {
 
 struct _GtkFileFilterClass
 {
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 };
 
 struct _GtkFileFilter
 {
-  GtkObject parent_instance;
-  
+  GInitiallyUnowned parent_instance;
+
   gchar *name;
   GSList *rules;
 
@@ -74,7 +74,7 @@ struct _FilterRule
 static void gtk_file_filter_finalize   (GObject            *object);
 
 
-G_DEFINE_TYPE (GtkFileFilter, gtk_file_filter, GTK_TYPE_OBJECT)
+G_DEFINE_TYPE (GtkFileFilter, gtk_file_filter, G_TYPE_INITIALLY_UNOWNED)
 
 static void
 gtk_file_filter_init (GtkFileFilter *object)
diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c
index 5d4c54e..577493c 100644
--- a/gtk/gtkhscale.c
+++ b/gtk/gtkhscale.c
@@ -83,7 +83,7 @@ gtk_hscale_new_with_range (gdouble min,
                            gdouble max,
                            gdouble step)
 {
-  GtkObject *adj;
+  GObject *adj;
   GtkScale *scale;
   gint digits;
 
diff --git a/gtk/gtkrecentfilter.c b/gtk/gtkrecentfilter.c
index fd9d0b3..1f2b1fb 100644
--- a/gtk/gtkrecentfilter.c
+++ b/gtk/gtkrecentfilter.c
@@ -41,8 +41,8 @@ typedef enum {
 
 struct _GtkRecentFilter
 {
-  GtkObject parent_instance;
-  
+  GInitiallyUnowned parent_instance;
+
   gchar *name;
   GSList *rules;
   
@@ -51,7 +51,7 @@ struct _GtkRecentFilter
 
 struct _GtkRecentFilterClass
 {
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 };
 
 struct _FilterRule
@@ -75,7 +75,7 @@ struct _FilterRule
   } u;
 };
 
-G_DEFINE_TYPE (GtkRecentFilter, gtk_recent_filter, GTK_TYPE_OBJECT)
+G_DEFINE_TYPE (GtkRecentFilter, gtk_recent_filter, G_TYPE_INITIALLY_UNOWNED)
 
 
 static void
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index d869240..f136e7c 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -546,7 +546,7 @@ gtk_scale_new_with_range (GtkOrientation orientation,
                           gdouble        max,
                           gdouble        step)
 {
-  GtkObject *adj;
+  GObject *adj;
   gint digits;
 
   g_return_val_if_fail (min < max, NULL);
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 72a9620..3e4f653 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -580,7 +580,7 @@ gtk_scale_button_new (GtkIconSize   size,
 		      const gchar **icons)
 {
   GtkScaleButton *button;
-  GtkObject *adj;
+  GObject *adj;
 
   adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0);
 
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index cef3c7b..50f48d3 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -98,7 +98,6 @@ enum
 
 static void gtk_spin_button_editable_init  (GtkEditableInterface *iface);
 static void gtk_spin_button_finalize       (GObject            *object);
-static void gtk_spin_button_destroy        (GtkObject          *object);
 static void gtk_spin_button_set_property   (GObject         *object,
 					    guint            prop_id,
 					    const GValue    *value,
@@ -107,6 +106,7 @@ static void gtk_spin_button_get_property   (GObject         *object,
 					    guint            prop_id,
 					    GValue          *value,
 					    GParamSpec      *pspec);
+static void gtk_spin_button_destroy        (GtkObject          *object);
 static void gtk_spin_button_map            (GtkWidget          *widget);
 static void gtk_spin_button_unmap          (GtkWidget          *widget);
 static void gtk_spin_button_realize        (GtkWidget          *widget);
@@ -193,12 +193,10 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
   GtkBindingSet    *binding_set;
 
   gobject_class->finalize = gtk_spin_button_finalize;
-
   gobject_class->set_property = gtk_spin_button_set_property;
   gobject_class->get_property = gtk_spin_button_get_property;
 
   object_class->destroy = gtk_spin_button_destroy;
-
   widget_class->map = gtk_spin_button_map;
   widget_class->unmap = gtk_spin_button_unmap;
   widget_class->realize = gtk_spin_button_realize;
@@ -544,7 +542,7 @@ static void
 gtk_spin_button_destroy (GtkObject *object)
 {
   gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (object));
-  
+
   GTK_OBJECT_CLASS (gtk_spin_button_parent_class)->destroy (object);
 }
 
@@ -1785,7 +1783,7 @@ gtk_spin_button_new_with_range (gdouble min,
 				gdouble max,
 				gdouble step)
 {
-  GtkObject *adj;
+  GObject *adj;
   GtkSpinButton *spin;
   gint digits;
 
diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h
index 4e72235..01f6a2d 100644
--- a/gtk/gtktreeviewcolumn.h
+++ b/gtk/gtktreeviewcolumn.h
@@ -28,9 +28,6 @@
 #include <gtk/gtktreemodel.h>
 #include <gtk/gtktreesortable.h>
 
-/* Not needed, retained for compatibility -Yosh */
-#include <gtk/gtkobject.h>
-
 
 G_BEGIN_DECLS
 
@@ -61,7 +58,7 @@ typedef void (* GtkTreeCellDataFunc) (GtkTreeViewColumn *tree_column,
 
 struct _GtkTreeViewColumn
 {
-  GtkObject parent;
+  GInitiallyUnowned parent_instance;
 
   GtkWidget *GSEAL (tree_view);
   GtkWidget *GSEAL (button);
@@ -112,7 +109,7 @@ struct _GtkTreeViewColumn
 
 struct _GtkTreeViewColumnClass
 {
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 
   void (*clicked) (GtkTreeViewColumn *tree_column);
 
diff --git a/gtk/gtkvolumebutton.c b/gtk/gtkvolumebutton.c
index bcf2a8e..d84358d 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);
-  GtkObject *adj;
+  GObject *adj;
   GtkWidget *minus_button, *plus_button;
   const char *icons[] = {
 	"audio-volume-muted",
diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c
index d4570f8..5cb2856 100644
--- a/gtk/gtkvscale.c
+++ b/gtk/gtkvscale.c
@@ -102,7 +102,7 @@ gtk_vscale_new_with_range (gdouble min,
                            gdouble max,
                            gdouble step)
 {
-  GtkObject *adj;
+  GObject *adj;
   GtkScale *scale;
   gint digits;
 
diff --git a/tests/flicker.c b/tests/flicker.c
index 39c9601..117e3e3 100644
--- a/tests/flicker.c
+++ b/tests/flicker.c
@@ -7,51 +7,51 @@ create_flicker (void)
   GtkWidget *hpaned1;
   GtkWidget *vpaned2;
   GtkWidget *hbox2;
-  GtkObject *spinbutton7_adj;
+  GObject   *spinbutton7_adj;
   GtkWidget *spinbutton7;
-  GtkObject *spinbutton8_adj;
+  GObject   *spinbutton8_adj;
   GtkWidget *spinbutton8;
   GtkWidget *vbox1;
-  GtkObject *spinbutton9_adj;
+  GObject   *spinbutton9_adj;
   GtkWidget *spinbutton9;
-  GtkObject *spinbutton10_adj;
+  GObject   *spinbutton10_adj;
   GtkWidget *spinbutton10;
-  GtkObject *spinbutton11_adj;
+  GObject   *spinbutton11_adj;
   GtkWidget *spinbutton11;
-  GtkObject *spinbutton12_adj;
+  GObject   *spinbutton12_adj;
   GtkWidget *spinbutton12;
-  GtkObject *spinbutton13_adj;
+  GObject   *spinbutton13_adj;
   GtkWidget *spinbutton13;
-  GtkObject *spinbutton14_adj;
+  GObject   *spinbutton14_adj;
   GtkWidget *spinbutton14;
-  GtkObject *spinbutton15_adj;
+  GObject   *spinbutton15_adj;
   GtkWidget *spinbutton15;
-  GtkObject *spinbutton16_adj;
+  GObject   *spinbutton16_adj;
   GtkWidget *spinbutton16;
   GtkWidget *vpaned1;
   GtkWidget *hbox1;
-  GtkObject *spinbutton17_adj;
+  GObject   *spinbutton17_adj;
   GtkWidget *spinbutton17;
-  GtkObject *spinbutton18_adj;
+  GObject   *spinbutton18_adj;
   GtkWidget *spinbutton18;
-  GtkObject *spinbutton19_adj;
+  GObject   *spinbutton19_adj;
   GtkWidget *spinbutton19;
   GtkWidget *vbox2;
-  GtkObject *spinbutton20_adj;
+  GObject   *spinbutton20_adj;
   GtkWidget *spinbutton20;
-  GtkObject *spinbutton21_adj;
+  GObject   *spinbutton21_adj;
   GtkWidget *spinbutton21;
-  GtkObject *spinbutton22_adj;
+  GObject   *spinbutton22_adj;
   GtkWidget *spinbutton22;
-  GtkObject *spinbutton23_adj;
+  GObject   *spinbutton23_adj;
   GtkWidget *spinbutton23;
-  GtkObject *spinbutton24_adj;
+  GObject   *spinbutton24_adj;
   GtkWidget *spinbutton24;
-  GtkObject *spinbutton25_adj;
+  GObject   *spinbutton25_adj;
   GtkWidget *spinbutton25;
-  GtkObject *spinbutton26_adj;
+  GObject   *spinbutton26_adj;
   GtkWidget *spinbutton26;
-  GtkObject *spinbutton27_adj;
+  GObject   *spinbutton27_adj;
   GtkWidget *spinbutton27;
 
   window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 686cfa9..a1aa61c 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -5959,7 +5959,7 @@ create_range_controls (GtkWidget *widget)
   GtkWidget *scrollbar;
   GtkWidget *scale;
   GtkWidget *separator;
-  GtkObject *adjustment;
+  GObject *adjustment;
   GtkWidget *hbox;
 
   if (!window)
diff --git a/tests/testtreeview.c b/tests/testtreeview.c
index 9fbba7d..0b0c5bf 100644
--- a/tests/testtreeview.c
+++ b/tests/testtreeview.c
@@ -327,8 +327,8 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
   GtkCellRenderer *rend;
   GdkPixbuf *pixbuf;
   GtkWidget *image;
-  GtkObject *adjustment;
-    
+  GObject *adjustment;
+
   current_column_type = type;
   
   col = gtk_tree_view_get_column (tree_view, 0);



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