[gtkglext] Replace gdk_gl_window_impl_win32_get_type() with a G_DEFINE_TYPE



commit a4e96218c33c3a93340d253347a4c3a41cd8ee94
Author: Mukund Sivaraman <muks banu com>
Date:   Tue Jul 20 23:05:31 2010 +0530

    Replace gdk_gl_window_impl_win32_get_type() with a G_DEFINE_TYPE

 gdk/win32/gdkglwindow-win32.c |   42 +++++++++-------------------------------
 1 files changed, 10 insertions(+), 32 deletions(-)
---
diff --git a/gdk/win32/gdkglwindow-win32.c b/gdk/win32/gdkglwindow-win32.c
index c0893f4..c7e13a9 100644
--- a/gdk/win32/gdkglwindow-win32.c
+++ b/gdk/win32/gdkglwindow-win32.c
@@ -47,39 +47,17 @@ static void gdk_gl_window_impl_win32_gl_drawable_interface_init (GdkGLDrawableCl
 
 static gpointer parent_class = NULL;
 
-GType
-gdk_gl_window_impl_win32_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type)
-    {
-      static const GTypeInfo type_info = {
-        sizeof (GdkGLWindowImplWin32Class),
-        (GBaseInitFunc) NULL,
-        (GBaseFinalizeFunc) NULL,
-        (GClassInitFunc) gdk_gl_window_impl_win32_class_init,
-        (GClassFinalizeFunc) NULL,
-        NULL,                   /* class_data */
-        sizeof (GdkGLWindowImplWin32),
-        0,                      /* n_preallocs */
-        (GInstanceInitFunc) NULL
-      };
-      static const GInterfaceInfo gl_drawable_interface_info = {
-        (GInterfaceInitFunc) gdk_gl_window_impl_win32_gl_drawable_interface_init,
-        (GInterfaceFinalizeFunc) NULL,
-        NULL                    /* interface_data */
-      };
-
-      type = g_type_register_static (GDK_TYPE_GL_WINDOW,
-                                     "GdkGLWindowImplWin32",
-                                     &type_info, 0);
-      g_type_add_interface_static (type,
-                                   GDK_TYPE_GL_DRAWABLE,
-                                   &gl_drawable_interface_info);
-    }
+G_DEFINE_TYPE_EXTENDED (GdkGLWindowImplWin32,
+                        gdk_gl_window_impl_win32,
+                        GDK_TYPE_GL_WINDOW,
+                        0,
+                        G_IMPLEMENT_INTERFACE
+                        (GDK_TYPE_GL_DRAWABLE,
+                         gdk_gl_window_impl_win32_gl_drawable_interface_init));
 
-  return type;
+static void
+gdk_gl_window_impl_win32_init (GdkGLWindowImplWin32 *self)
+{
 }
 
 static void



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