[gtkglext] Replace gdk_gl_window_impl_x11_get_type() with a G_DEFINE_TYPE



commit 8f98d1557ccfa517a771134719d5b7458c1c8bc3
Author: Mukund Sivaraman <muks banu com>
Date:   Tue Jul 20 21:36:45 2010 +0530

    Replace gdk_gl_window_impl_x11_get_type() with a G_DEFINE_TYPE

 gdk/x11/gdkglwindow-x11.c |   42 ++++++++++--------------------------------
 1 files changed, 10 insertions(+), 32 deletions(-)
---
diff --git a/gdk/x11/gdkglwindow-x11.c b/gdk/x11/gdkglwindow-x11.c
index 18b7d4f..e5973c7 100644
--- a/gdk/x11/gdkglwindow-x11.c
+++ b/gdk/x11/gdkglwindow-x11.c
@@ -49,39 +49,17 @@ static void gdk_gl_window_impl_x11_gl_drawable_interface_init (GdkGLDrawableClas
 
 static gpointer parent_class = NULL;
 
-GType
-gdk_gl_window_impl_x11_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type)
-    {
-      static const GTypeInfo type_info = {
-        sizeof (GdkGLWindowImplX11Class),
-        (GBaseInitFunc) NULL,
-        (GBaseFinalizeFunc) NULL,
-        (GClassInitFunc) gdk_gl_window_impl_x11_class_init,
-        (GClassFinalizeFunc) NULL,
-        NULL,                   /* class_data */
-        sizeof (GdkGLWindowImplX11),
-        0,                      /* n_preallocs */
-        (GInstanceInitFunc) NULL
-      };
-      static const GInterfaceInfo gl_drawable_interface_info = {
-        (GInterfaceInitFunc) gdk_gl_window_impl_x11_gl_drawable_interface_init,
-        (GInterfaceFinalizeFunc) NULL,
-        NULL                    /* interface_data */
-      };
-
-      type = g_type_register_static (GDK_TYPE_GL_WINDOW,
-                                     "GdkGLWindowImplX11",
-                                     &type_info, 0);
-      g_type_add_interface_static (type,
-                                   GDK_TYPE_GL_DRAWABLE,
-                                   &gl_drawable_interface_info);
-    }
+G_DEFINE_TYPE_EXTENDED (GdkGLWindowImplX11,
+                        gdk_gl_window_impl_x11,
+                        GDK_TYPE_GL_WINDOW,
+                        0,
+                        G_IMPLEMENT_INTERFACE
+                        (GDK_TYPE_GL_DRAWABLE,
+                         gdk_gl_window_impl_x11_gl_drawable_interface_init));
 
-  return type;
+static void
+gdk_gl_window_impl_x11_init (GdkGLWindowImplX11 *self)
+{
 }
 
 static void



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