]> Pileus Git - ~andy/gtk/commitdiff
Don't use G_DEFINE_TYPE, since the instance struct name does not match the
authorMatthias Clasen <mclasen@redhat.com>
Wed, 31 May 2006 03:34:04 +0000 (03:34 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 31 May 2006 03:34:04 +0000 (03:34 +0000)
2006-05-30  Matthias Clasen  <mclasen@redhat.com>

* gdk/gdkpixmap.c:
* gdk/gdkwindow.c: Don't use G_DEFINE_TYPE, since the instance
struct name does not match the type name.  (#343453, Ed Catmur)

ChangeLog
ChangeLog.pre-2-10
gdk/gdkpixmap.c
gdk/gdkwindow.c

index 6a615160160aa53d4c27b02a1762c780e3edb2ca..ab50b55d582603af5bf22b4e91097e5321b789ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-05-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/gdkpixmap.c: 
+       * gdk/gdkwindow.c: Don't use G_DEFINE_TYPE, since the instance
+       struct name does not match the type name.  (#343453, Ed Catmur)
+
        * gtk/gtk.symbols: 
        * gtk/gtkbutton.h: 
        * gtk/gtkbutton.c: Add a GtkButton::image-position property
index 6a615160160aa53d4c27b02a1762c780e3edb2ca..ab50b55d582603af5bf22b4e91097e5321b789ef 100644 (file)
@@ -1,5 +1,9 @@
 2006-05-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/gdkpixmap.c: 
+       * gdk/gdkwindow.c: Don't use G_DEFINE_TYPE, since the instance
+       struct name does not match the type name.  (#343453, Ed Catmur)
+
        * gtk/gtk.symbols: 
        * gtk/gtkbutton.h: 
        * gtk/gtkbutton.c: Add a GtkButton::image-position property
index cf5dc288721f7541899434a5eb5bfce4b158ec7a..fdd9764e19b90fdd7da9bc12941f24fe0f411d77 100644 (file)
@@ -153,9 +153,28 @@ static void         gdk_pixmap_real_set_colormap (GdkDrawable *drawable,
 static GdkColormap* gdk_pixmap_real_get_colormap (GdkDrawable *drawable);
 static GdkScreen*   gdk_pixmap_real_get_screen   (GdkDrawable *drawable);
 
+static void gdk_pixmap_init       (GdkPixmapObject      *pixmap);
+static void gdk_pixmap_class_init (GdkPixmapObjectClass *klass);
 static void gdk_pixmap_finalize   (GObject              *object);
 
-G_DEFINE_TYPE (GdkPixmapObject, gdk_pixmap, GDK_TYPE_DRAWABLE)
+static gpointer parent_class = NULL;
+
+GType
+gdk_pixmap_get_type (void)
+{
+  static GType object_type = 0;
+
+  if (!object_type)
+    object_type = g_type_register_static_simple (GDK_TYPE_DRAWABLE,
+                                                "GdkPixmap",
+                                                sizeof (GdkPixmapObjectClass),
+                                                (GClassInitFunc) gdk_pixmap_class_init,
+                                                sizeof (GdkPixmapObject),
+                                                (GInstanceInitFunc) gdk_pixmap_init,
+                                                0);
+  
+  return object_type;
+}
 
 static void
 gdk_pixmap_init (GdkPixmapObject *pixmap)
@@ -170,6 +189,8 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
   
+  parent_class = g_type_class_peek_parent (klass);
+
   object_class->finalize = gdk_pixmap_finalize;
 
   drawable_class->create_gc = gdk_pixmap_create_gc;
@@ -205,7 +226,7 @@ gdk_pixmap_finalize (GObject *object)
   g_object_unref (obj->impl);
   obj->impl = NULL;
   
-  G_OBJECT_CLASS (gdk_pixmap_parent_class)->finalize (object);
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static GdkGC *
index 1f3f87b063630c1bff6135b346fe34a822812a3a..340c1d73fcae2036ae302fb79531dcb52173cac6 100644 (file)
@@ -183,6 +183,8 @@ static GdkRegion*   gdk_window_get_visible_region     (GdkDrawable *drawable);
 
 static void gdk_window_free_paint_stack (GdkWindow *window);
 
+static void gdk_window_init       (GdkWindowObject      *window);
+static void gdk_window_class_init (GdkWindowObjectClass *klass);
 static void gdk_window_finalize   (GObject              *object);
 static void gdk_window_clear_backing_rect (GdkWindow *window,
                                           gint       x,
@@ -190,7 +192,24 @@ static void gdk_window_clear_backing_rect (GdkWindow *window,
                                           gint       width,
                                           gint       height);
 
-G_DEFINE_TYPE (GdkWindowObject, gdk_window_object, GDK_TYPE_DRAWABLE)
+static gpointer parent_class = NULL;
+
+GType
+gdk_window_object_get_type (void)
+{
+  static GType object_type = 0;
+
+  if (!object_type)
+    object_type = g_type_register_static_simple (GDK_TYPE_DRAWABLE,
+                                                "GdkWindow",
+                                                sizeof (GdkWindowObjectClass),
+                                                (GClassInitFunc) gdk_window_class_init,
+                                                sizeof (GdkWindowObject),
+                                                (GInstanceInitFunc) gdk_window_init,
+                                                0);
+  
+  return object_type;
+}
 
 GType
 _gdk_paintable_get_type (void)
@@ -217,7 +236,7 @@ _gdk_paintable_get_type (void)
 }
 
 static void
-gdk_window_object_init (GdkWindowObject *window)
+gdk_window_init (GdkWindowObject *window)
 {
   /* 0-initialization is good for all other fields. */
 
@@ -229,11 +248,13 @@ gdk_window_object_init (GdkWindowObject *window)
 }
 
 static void
-gdk_window_object_class_init (GdkWindowObjectClass *klass)
+gdk_window_class_init (GdkWindowObjectClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
   
+  parent_class = g_type_class_peek_parent (klass);
+
   object_class->finalize = gdk_window_finalize;
 
   drawable_class->create_gc = gdk_window_create_gc;
@@ -287,7 +308,7 @@ gdk_window_finalize (GObject *object)
   g_object_unref (obj->impl);
   obj->impl = NULL;
   
-  G_OBJECT_CLASS (gdk_window_object_parent_class)->finalize (object);
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void