[gtkglarea/jjardon/namespace_change: 1/4] gtkglglarea: Change namespace from gtk_gl_area to ggla_widget



commit 5ef6870bdde8dde559357d4c2020cd2e00546f0f
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Mar 26 19:44:51 2014 +0000

    gtkglglarea: Change namespace from gtk_gl_area to ggla_widget
    
    gtkglarea is overloading the GDK and GTK namespaces; this means that
    if we get a GdkGLContext in GTK+ in the future, and people link
    gtkglarea with gtk, they'll have a bad time

 gtkgl/gdkgl.h     |    2 +-
 gtkgl/gtkgl.def   |   12 ++++++------
 gtkgl/gtkglarea.c |   40 ++++++++++++++++++++--------------------
 gtkgl/gtkglarea.h |   40 ++++++++++++++++++++--------------------
 4 files changed, 47 insertions(+), 47 deletions(-)
---
diff --git a/gtkgl/gdkgl.h b/gtkgl/gdkgl.h
index ba7b8ac..5543297 100644
--- a/gtkgl/gdkgl.h
+++ b/gtkgl/gdkgl.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
 
 /*
  * These definitions are duplicated from GL/glx.h that comes with Mesa.
- * I don't want every program to include GL/glx.h because GtkGLArea
+ * I don't want every program to include GL/glx.h because GglaWidget
  * supports lecacy systems like Windows. You can still use GLX_xxxx
  * attributes with these, but then you lose portability.
  */
diff --git a/gtkgl/gtkgl.def b/gtkgl/gtkgl.def
index 03b8cfd..f0cf2d1 100644
--- a/gtkgl/gtkgl.def
+++ b/gtkgl/gtkgl.def
@@ -13,9 +13,9 @@ EXPORTS
        gdk_gl_use_gdk_font
        gdk_gl_wait_gdk
        gdk_gl_wait_gl
-       gtk_gl_area_get_type
-       gtk_gl_area_make_current
-       gtk_gl_area_new
-       gtk_gl_area_new_vargs
-       gtk_gl_area_share_new
-       gtk_gl_area_swap_buffers
+       ggla_widget_get_type
+       ggla_widget_make_current
+       ggla_widget_new
+       ggla_widget_new_vargs
+       ggla_widget_share_new
+       ggla_widget_swap_buffers
diff --git a/gtkgl/gtkglarea.c b/gtkgl/gtkglarea.c
index fc4e9a3..944b86a 100644
--- a/gtkgl/gtkglarea.c
+++ b/gtkgl/gtkglarea.c
@@ -23,23 +23,23 @@
 #include "gdkgl.h"
 #include "gtkglarea.h"
 
-static void gtk_gl_area_finalize       (GObject      *object);
+static void ggla_widget_finalize       (GObject      *object);
 
-G_DEFINE_TYPE (GtkGLArea, gtk_gl_area, GTK_TYPE_DRAWING_AREA);
+G_DEFINE_TYPE (GglaWidget, ggla_widget, GTK_TYPE_DRAWING_AREA);
 
 static void
-gtk_gl_area_class_init (GtkGLAreaClass *klass)
+ggla_widget_class_init (GglaWidgetClass *klass)
 {
   GObjectClass *object_class;
 
   object_class = (GObjectClass*) klass;
 
-  object_class->finalize = gtk_gl_area_finalize;
+  object_class->finalize = ggla_widget_finalize;
 }
 
 
 static void
-gtk_gl_area_init (GtkGLArea *gl_area)
+ggla_widget_init (GglaWidget *gl_area)
 {
   gl_area->glcontext = NULL;
   gtk_widget_set_double_buffered(GTK_WIDGET(gl_area), FALSE);
@@ -48,7 +48,7 @@ gtk_gl_area_init (GtkGLArea *gl_area)
 
 
 GtkWidget*
-gtk_gl_area_new_vargs(GtkGLArea *share, ...)
+ggla_widget_new_vargs(GglaWidget *share, ...)
 {
   GtkWidget *glarea;
   va_list ap;
@@ -69,7 +69,7 @@ gtk_gl_area_new_vargs(GtkGLArea *share, ...)
     i++;
   va_end(ap);
 
-  glarea = gtk_gl_area_share_new(attrlist, share);
+  glarea = ggla_widget_share_new(attrlist, share);
 
   g_free(attrlist);
 
@@ -77,21 +77,21 @@ gtk_gl_area_new_vargs(GtkGLArea *share, ...)
 }
 
 GtkWidget*
-gtk_gl_area_new (int *attrlist)
+ggla_widget_new (int *attrlist)
 {
-  return gtk_gl_area_share_new(attrlist, NULL);
+  return ggla_widget_share_new(attrlist, NULL);
 }
 
 GtkWidget*
-gtk_gl_area_share_new (int *attrlist, GtkGLArea *share)
+ggla_widget_share_new (int *attrlist, GglaWidget *share)
 {
   GdkGLContext *glcontext;
-  GtkGLArea *gl_area;
+  GglaWidget *gl_area;
 #if defined GDK_WINDOWING_X11
   GdkVisual *visual;
 #endif
 
-  g_return_val_if_fail(share == NULL || GTK_IS_GL_AREA(share), NULL);
+  g_return_val_if_fail(share == NULL || GGLA_IS_WIDGET(share), NULL);
 
 #if defined GDK_WINDOWING_X11
   visual = gdk_gl_choose_visual(attrlist);
@@ -105,7 +105,7 @@ gtk_gl_area_share_new (int *attrlist, GtkGLArea *share)
   if (glcontext == NULL)
     return NULL;
 
-  gl_area = g_object_new(GTK_TYPE_GL_AREA, NULL);
+  gl_area = g_object_new(GGLA_TYPE_WIDGET, NULL);
   gl_area->glcontext = glcontext;
 
   return GTK_WIDGET(gl_area);
@@ -113,22 +113,22 @@ gtk_gl_area_share_new (int *attrlist, GtkGLArea *share)
 
 
 static void
-gtk_gl_area_finalize(GObject *object)
+ggla_widget_finalize(GObject *object)
 {
-  GtkGLArea *gl_area = GTK_GL_AREA(object);
+  GglaWidget *gl_area = GGLA_WIDGET(object);
 
   if (gl_area->glcontext)
     g_object_unref(gl_area->glcontext);
   gl_area->glcontext = NULL;
 
-  G_OBJECT_CLASS (gtk_gl_area_parent_class)->finalize (object);
+  G_OBJECT_CLASS (ggla_widget_parent_class)->finalize (object);
 }
 
 
-gint gtk_gl_area_make_current(GtkGLArea *gl_area)
+gint ggla_widget_make_current(GglaWidget *gl_area)
 {
   g_return_val_if_fail(gl_area != NULL, FALSE);
-  g_return_val_if_fail(GTK_IS_GL_AREA (gl_area), FALSE);
+  g_return_val_if_fail(GGLA_IS_WIDGET (gl_area), FALSE);
   GtkWidget *widget = GTK_WIDGET (gl_area);
   g_return_val_if_fail(gtk_widget_get_realized(widget), FALSE);
 
@@ -136,10 +136,10 @@ gint gtk_gl_area_make_current(GtkGLArea *gl_area)
                              gl_area->glcontext);
 }
 
-void gtk_gl_area_swap_buffers(GtkGLArea *gl_area)
+void ggla_widget_swap_buffers(GglaWidget *gl_area)
 {
   g_return_if_fail(gl_area != NULL);
-  g_return_if_fail(GTK_IS_GL_AREA(gl_area));
+  g_return_if_fail(GGLA_IS_WIDGET(gl_area));
   GtkWidget *widget = GTK_WIDGET (gl_area);
   g_return_if_fail(gtk_widget_get_realized(widget));
 
diff --git a/gtkgl/gtkglarea.h b/gtkgl/gtkglarea.h
index 40ff26a..3e0530b 100644
--- a/gtkgl/gtkglarea.h
+++ b/gtkgl/gtkglarea.h
@@ -17,8 +17,8 @@
  */
 
 
-#ifndef __GTK_GL_AREA_H__
-#define __GTK_GL_AREA_H__
+#ifndef __GGLA_WIDGET_H__
+#define __GGLA_WIDGET_H__
 
 #include <gdk/gdk.h>
 #include <gtkgl/gdkgl.h>
@@ -27,42 +27,42 @@
 
 G_BEGIN_DECLS
 
-#define GTK_TYPE_GL_AREA            (gtk_gl_area_get_type())
-#define GTK_GL_AREA(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_GL_AREA, GtkGLArea))
-#define GTK_GL_AREA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, GTK_TYPE_GL_AREA, GtkGLAreaClass))
-#define GTK_IS_GL_AREA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_GL_AREA))
-#define GTK_IS_GL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GL_AREA))
-#define GTK_GL_AREA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_GL_AREA, GtkGLArea))
+#define GGLA_TYPE_WIDGET            (ggla_widget_get_type())
+#define GGLA_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GGLA_TYPE_WIDGET, GglaWidget))
+#define GGLA_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, GGLA_TYPE_WIDGET, GglaWidgetClass))
+#define GGLA_IS_WIDGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GGLA_TYPE_WIDGET))
+#define GGLA_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GGLA_TYPE_WIDGET))
+#define GGLA_WIDGET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GGLA_TYPE_WIDGET, GglaWidget))
 
 
-typedef struct _GtkGLArea       GtkGLArea;
-typedef struct _GtkGLAreaClass  GtkGLAreaClass;
+typedef struct _GglaWidget       GglaWidget;
+typedef struct _GglaWidgetClass  GglaWidgetClass;
 
 
-struct _GtkGLArea
+struct _GglaWidget
 {
   GtkDrawingArea  darea;
   GdkGLContext *glcontext;
 };
 
-struct _GtkGLAreaClass
+struct _GglaWidgetClass
 {
   GtkDrawingAreaClass parent_class;
 };
 
-GType      gtk_gl_area_get_type   (void);
-GtkWidget* gtk_gl_area_new        (int       *attrList);
-GtkWidget* gtk_gl_area_share_new  (int       *attrList,
-                                   GtkGLArea *share);
-GtkWidget* gtk_gl_area_new_vargs  (GtkGLArea *share,
+GType      ggla_widget_get_type   (void);
+GtkWidget* ggla_widget_new        (int       *attrList);
+GtkWidget* ggla_widget_share_new  (int       *attrList,
+                                   GglaWidget *share);
+GtkWidget* ggla_widget_new_vargs  (GglaWidget *share,
                                   ...);
 
 
-gint       gtk_gl_area_make_current(GtkGLArea *glarea);
+gint       ggla_widget_make_current(GglaWidget *glarea);
 
-void       gtk_gl_area_swap_buffers(GtkGLArea *glarea);
+void       ggla_widget_swap_buffers(GglaWidget *glarea);
 
 
 G_END_DECLS
 
-#endif /* __GTK_GL_AREA_H__ */
+#endif /* __GGLA_WIDGET_H__ */


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