[gtkglarea/jjardon/epoxy: 1/4] Change ggla_widget to ggla_area



commit 0b865fa84a983c7ffe596f3b5eb09894c05accbb
Author: Javier Jardón <jjardon gnome org>
Date:   Fri Jun 6 20:50:44 2014 +0100

    Change ggla_widget to ggla_area
    
    As widget is a too generic name

 docs/HOWTO.txt            |    8 +++---
 docs/gtkglarea.txt        |   20 ++++++++--------
 examples/gtkglarea_demo.c |   52 ++++++++++++++++++++++----------------------
 examples/shaders.c        |   28 ++++++++++++------------
 examples/simple.c         |   10 ++++----
 examples/viewlw.c         |   12 +++++-----
 examples/zktor.c          |   14 ++++++------
 gtkgl/gdkgl.h             |    2 +-
 gtkgl/gtkgl.def           |   12 +++++-----
 gtkgl/gtkglarea.c         |   32 +++++++++++++-------------
 gtkgl/gtkglarea.h         |   36 +++++++++++++++---------------
 11 files changed, 113 insertions(+), 113 deletions(-)
---
diff --git a/docs/HOWTO.txt b/docs/HOWTO.txt
index 0b2d3f2..4956118 100644
--- a/docs/HOWTO.txt
+++ b/docs/HOWTO.txt
@@ -40,16 +40,16 @@
 
 
 
-6. Can I use gdk_gl functions and GglaWidget widget in the same program?
+6. Can I use gdk_gl functions and GglaArea widget in the same program?
 
-    Yes, just remember that ggla_widget_make_current() makes the GglaWidget
+    Yes, just remember that ggla_area_make_current() makes the GglaArea
     widget's internal context the current context and leaves it so.
 
 
 
-7. How do I capture keypress events for GglaWidget widget?
+7. How do I capture keypress events for GglaArea widget?
 
-    This is not a GglaWidget specific question, but here is a solution:
+    This is not a GglaArea specific question, but here is a solution:
 
     - Set an event mask:
          gtk_widget_set_events(glarea, GDK_KEY_PRESS_MASK);
diff --git a/docs/gtkglarea.txt b/docs/gtkglarea.txt
index bfba0e6..59a8aab 100644
--- a/docs/gtkglarea.txt
+++ b/docs/gtkglarea.txt
@@ -1,4 +1,4 @@
-GglaWidget widget is derived from GtkDrawingArea widget.
+GglaArea widget is derived from GtkDrawingArea widget.
 
 examples/simple.c is a good starting point.
 
@@ -6,9 +6,9 @@ examples/simple.c is a good starting point.
 ---------------------------------------------------------
 C SPECIFICATION
 
-GtkWidget* ggla_widget_new(int *attrList)
-GtkWidget* ggla_widget_share_new(int *attrList, GglaWidget *share)
-GtkWidget* ggla_widget_new_vargs(GglaWidget *share, ...)
+GtkWidget* ggla_area_new(int *attrList)
+GtkWidget* ggla_area_share_new(int *attrList, GglaArea *share)
+GtkWidget* ggla_area_new_vargs(GglaArea *share, ...)
 
 PARAMETERS
 
@@ -29,14 +29,14 @@ DESCRIPTION
        requested type and GLX context is created for this widget. You
        can't do opengl calls on widget until it has X window. X window
        is not created until widget is realized.
-       ggla_widget_new_vargs takes attrList as variable arguments,
+       ggla_area_new_vargs takes attrList as variable arguments,
        last argument must still be zero.
 
 ---------------------------------------------------------
 
 C SPECIFICATION
 
-gint ggla_widget_make_current(GglaWidget *gl_area)
+gint ggla_area_make_current(GglaArea *gl_area)
 
 PARAMETERS
 
@@ -44,20 +44,20 @@ gl_area
        Specifies a gtkglarea widget.
 
 DESCRIPTION
-       ggla_widget_make_current must be called before rendering into
+       ggla_area_make_current must be called before rendering into
        OpenGL widget, it returns TRUE if rendering to widget is
        possible. Rendering is not possible if widget is not
-       GglaWidget widget or widget is not realized.
+       GglaArea widget or widget is not realized.
 
 ---------------------------------------------------------
 
 C SPECIFICATION
-void ggla_widget_swap_buffers(GglaWidget *gl_area)
+void ggla_area_swap_buffers(GglaArea *gl_area)
 
 PARAMETERS
 
 gl_area
-       Specifies a GglaWidget widget.
+       Specifies a GglaArea widget.
 
 DESCRIPTION
        Wrapper around ggla_swap_buffers. Promotes contents of back buffer
diff --git a/examples/gtkglarea_demo.c b/examples/gtkglarea_demo.c
index 19b7e7a..d6d7cc1 100644
--- a/examples/gtkglarea_demo.c
+++ b/examples/gtkglarea_demo.c
@@ -19,9 +19,9 @@
  ******************************************************************************
  *
  * This is a short, heavily commented demo program designed to help
- * get you started using the GglaWidget widget in your gtk programs.
+ * get you started using the GglaArea widget in your gtk programs.
  *
- * The program creates a window with a GglaWidget widget and a quit button.
+ * The program creates a window with a GglaArea widget and a quit button.
  * Some commonly used callbacks are registered, but nothing is drawn into
  * the window.
  *
@@ -103,11 +103,11 @@ GtkWidget* create_glarea (void) {
     return NULL;
   }
 
-  /* Now, create the GglaWidget using the attribute list that  */
+  /* Now, create the GglaArea using the attribute list that  */
   /* we defined above.                                        */
 
-  if ((glarea = ggla_widget_new(attrlist)) == NULL) {
-    g_print("Error creating GglaWidget!\n");
+  if ((glarea = ggla_area_new(attrlist)) == NULL) {
+    g_print("Error creating GglaArea!\n");
     return NULL;
   }
 
@@ -172,7 +172,7 @@ GtkWidget* create_glarea (void) {
   /* destroy - The window has received a destroy event, this  */
   /*           is where you should do any cleanup that needs  */
   /*           to happen, such as de-allocating data objects  */
-  /*           that you have added to your GglaWidget.         */
+  /*           that you have added to your GglaArea.         */
 
   g_signal_connect (G_OBJECT(glarea), "destroy",
                     G_CALLBACK (glarea_destroy), NULL);
@@ -187,7 +187,7 @@ GtkWidget* create_glarea (void) {
 /*                                                                           */
 /* Function: glarea_button_release (GtkWidget*, GdkEventButton*)             */
 /*                                                                           */
-/* This function handles button-release events for the GglaWidget into which  */
+/* This function handles button-release events for the GglaArea into which  */
 /* we are drawing.                                                           */
 /*                                                                           */
 /*****************************************************************************/
@@ -223,7 +223,7 @@ gint glarea_button_release (GtkWidget* widget, GdkEventButton* event) {
 /*                                                                           */
 /* Function: glarea_button_press (GtkWidget*, GdkEventButton*)               */
 /*                                                                           */
-/* This function handles button-press events for the GglaWidget into which we */
+/* This function handles button-press events for the GglaArea into which we */
 /* are drawing.                                                              */
 /*                                                                           */
 /*****************************************************************************/
@@ -258,7 +258,7 @@ gint glarea_button_press (GtkWidget* widget, GdkEventButton* event) {
 /*                                                                           */
 /* Function: glarea_motion_notify (GtkWidget*, GdkEventMotion*)              */
 /*                                                                           */
-/* This function handles motion events for the GglaWidget into which we are   */
+/* This function handles motion events for the GglaArea into which we are   */
 /* drawing                                                                   */
 /*                                                                           */
 /*****************************************************************************/
@@ -302,7 +302,7 @@ gint glarea_motion_notify (GtkWidget* widget, GdkEventMotion* event) {
 /*                                                                           */
 /* Function: glarea_draw (GtkWidget*, cairo_t *cr, gpointer user_data)       */
 /*                                                                           */
-/* This is the function that should render your scene to the GglaWidget. It   */
+/* This is the function that should render your scene to the GglaArea. It   */
 /* can be used as a callback to the 'draw' signal.                           */
 /*                                                                           */
 /*****************************************************************************/
@@ -311,10 +311,10 @@ gboolean glarea_draw (GtkWidget* widget, cairo_t *cr, gpointer user_data) {
 
   g_print ("Draw Signal\n");
 
-  /* ggla_widget_make_current MUST be called before rendering */
-  /* into the GglaWidget.                                      */
+  /* ggla_area_make_current MUST be called before rendering */
+  /* into the GglaArea.                                      */
 
-  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current(GGLA_AREA(widget))) {
 
     /* Clear the drawing color buffer and depth buffers */
     /* before drawing.                                  */
@@ -330,7 +330,7 @@ gboolean glarea_draw (GtkWidget* widget, cairo_t *cr, gpointer user_data) {
     /* book if you don't already have an understanding of   */
     /* single vs. double buffered windows.                  */
 
-    ggla_widget_swap_buffers (GGLA_WIDGET(widget));
+    ggla_area_swap_buffers (GGLA_AREA(widget));
 
   }
 
@@ -343,7 +343,7 @@ gboolean glarea_draw (GtkWidget* widget, cairo_t *cr, gpointer user_data) {
 /* Function: glarea_reshape (GtkWidget*, GdkEventConfigure*)                 */
 /*                                                                           */
 /* This function performs the operations needed to maintain the viewing area */
-/* of the GglaWidget. This should be called whenever the size of the area     */
+/* of the GglaArea. This should be called whenever the size of the area     */
 /* is changed.                                                               */
 /*                                                                           */
 /*****************************************************************************/
@@ -357,10 +357,10 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
 
   g_print ("Reshape Event\n");
 
-  /* ggla_widget_make_current MUST be called before rendering */
-  /* into the GglaWidget.                                      */
+  /* ggla_area_make_current MUST be called before rendering */
+  /* into the GglaArea.                                      */
 
-  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current (GGLA_AREA(widget))) {
 
     /* This is an example 2D reshape function. Writing reshape */
     /* functions is beyond the scope of this demo. Check the   */
@@ -383,7 +383,7 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
 /*                                                                           */
 /* Function: glarea_init (GtkWidget*)                                        */
 /*                                                                           */
-/* This function is a callback for the realization of the GglaWidget widtget. */
+/* This function is a callback for the realization of the GglaArea widtget. */
 /* You should do any OpenGL initialization here.                             */
 /*                                                                           */
 /*****************************************************************************/
@@ -392,10 +392,10 @@ gint glarea_init (GtkWidget* widget) {
 
   g_print ("Realize Event\n");
 
-  /* ggla_widget_make_current MUST be called before rendering */
-  /* into the GglaWidget.                                      */
+  /* ggla_area_make_current MUST be called before rendering */
+  /* into the GglaArea.                                      */
 
-  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current (GGLA_AREA(widget))) {
 
     /* Insert your OpenGL initialization code here */
 
@@ -409,8 +409,8 @@ gint glarea_init (GtkWidget* widget) {
 /*                                                                           */
 /* Function: glarea_destroy (GtkWidget*)                                     */
 /*                                                                           */
-/* This function is a callback for the main GglaWidget. It deletes should     */
-/* delete any data structures stored in the GglaWidget.                       */
+/* This function is a callback for the main GglaArea. It deletes should     */
+/* delete any data structures stored in the GglaArea.                       */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -430,7 +430,7 @@ gint glarea_destroy (GtkWidget* widget) {
 /* Function: main (int, char**)                                              */
 /*                                                                           */
 /* The main function sets up our GUI and calls the functions needed to       */
-/* create our GglaWidget.                                                     */
+/* create our GglaArea.                                                     */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -462,7 +462,7 @@ int main (int argc, char** argv) {
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-  gtk_window_set_title (GTK_WINDOW(window), "GglaWidget Demo");
+  gtk_window_set_title (GTK_WINDOW(window), "GglaArea Demo");
 
   g_signal_connect (G_OBJECT(window), "delete-event",
                     G_CALLBACK(gtk_main_quit), NULL);
diff --git a/examples/shaders.c b/examples/shaders.c
index 773473c..db56cff 100644
--- a/examples/shaders.c
+++ b/examples/shaders.c
@@ -19,7 +19,7 @@
  *                                                                            *
  ******************************************************************************
  *
- * This program creates a window with a GglaWidget widget using a Vertex
+ * This program creates a window with a GglaArea widget using a Vertex
  * Shader and a Fragment shader. It should display a coloured texture. A
  * grayscale result means the shaders are not supported.
  *
@@ -237,8 +237,8 @@ GtkWidget* create_glarea (void) {
     return NULL;
   }
 
-  if ((glarea = ggla_widget_new(attrlist)) == NULL) {
-    g_print("Error creating GglaWidget!\n");
+  if ((glarea = ggla_area_new(attrlist)) == NULL) {
+    g_print("Error creating GglaArea!\n");
     return NULL;
   }
 
@@ -287,18 +287,18 @@ gint glarea_draw_scene (void) {
 /*                                                                           */
 /* Function: glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)*/
 /*                                                                           */
-/* This is the function that should render your scene to the GglaWidget. It   */
+/* This is the function that should render your scene to the GglaArea. It   */
 /* can be used as a callback to the 'draw' signal.                           */
 /*                                                                           */
 /*****************************************************************************/
 
 gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
 
-  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current(GGLA_AREA(widget))) {
 
     glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     glarea_draw_scene();
-    ggla_widget_swap_buffers (GGLA_WIDGET(widget));
+    ggla_area_swap_buffers (GGLA_AREA(widget));
 
   }
 
@@ -311,7 +311,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
 /* Function: glarea_reshape (GtkWidget*, GdkEventConfigure*)                 */
 /*                                                                           */
 /* This function performs the operations needed to maintain the viewing area */
-/* of the GglaWidget. This should be called whenever the size of the area     */
+/* of the GglaArea. This should be called whenever the size of the area     */
 /* is changed.                                                               */
 /*                                                                           */
 /*****************************************************************************/
@@ -323,7 +323,7 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
   int w = allocation.width;
   int h = allocation.height;
 
-  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current (GGLA_AREA(widget))) {
 
     glViewport (0, 0, w, h);
     glMatrixMode (GL_PROJECTION);
@@ -341,14 +341,14 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
 /*                                                                           */
 /* Function: glarea_init (GtkWidget*)                                        */
 /*                                                                           */
-/* This function is a callback for the realization of the GglaWidget widtget. */
+/* This function is a callback for the realization of the GglaArea widtget. */
 /* You should do any OpenGL initialization here.                             */
 /*                                                                           */
 /*****************************************************************************/
 
 gint glarea_init (GtkWidget* widget) {
 
-  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current (GGLA_AREA(widget))) {
 
     /* Procedural texture creation */
 
@@ -380,8 +380,8 @@ gint glarea_init (GtkWidget* widget) {
 /*                                                                           */
 /* Function: glarea_destroy (GtkWidget*)                                     */
 /*                                                                           */
-/* This function is a callback for the main GglaWidget. It deletes should     */
-/* delete any data structures stored in the GglaWidget.                       */
+/* This function is a callback for the main GglaArea. It deletes should     */
+/* delete any data structures stored in the GglaArea.                       */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -401,7 +401,7 @@ gint glarea_destroy (GtkWidget* widget) {
 /* Function: main (int, char**)                                              */
 /*                                                                           */
 /* The main function sets up our GUI and calls the functions needed to       */
-/* create our GglaWidget.                                                     */
+/* create our GglaArea.                                                     */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -440,7 +440,7 @@ int main (int argc, char** argv) {
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-  gtk_window_set_title (GTK_WINDOW(window), "GglaWidget Shader Demo");
+  gtk_window_set_title (GTK_WINDOW(window), "GglaArea Shader Demo");
 
   g_signal_connect (G_OBJECT(window), "delete-event",
                     G_CALLBACK(gtk_main_quit), NULL);
diff --git a/examples/simple.c b/examples/simple.c
index 1802022..bfb2e52 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -24,7 +24,7 @@
 gint init(GtkWidget *widget)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
+  if (ggla_area_make_current(GGLA_AREA(widget)))
     {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
@@ -43,7 +43,7 @@ gint init(GtkWidget *widget)
 gboolean draw (GtkWidget *widget, cairo_t *cr, gpointer data)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
+  if (ggla_area_make_current(GGLA_AREA(widget)))
     {
 
       /* Draw simple triangle */
@@ -57,7 +57,7 @@ gboolean draw (GtkWidget *widget, cairo_t *cr, gpointer data)
       glEnd();
 
       /* Swap backbuffer to front */
-      ggla_widget_swap_buffers(GGLA_WIDGET(widget));
+      ggla_area_swap_buffers(GGLA_AREA(widget));
 
     }
 
@@ -68,7 +68,7 @@ gboolean draw (GtkWidget *widget, cairo_t *cr, gpointer data)
 gint reshape(GtkWidget *widget, GdkEventConfigure *event)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
+  if (ggla_area_make_current(GGLA_AREA(widget)))
     {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
 
 
   /* Create new OpenGL widget. */
-  glarea = GTK_WIDGET(ggla_widget_new(attrlist));
+  glarea = GTK_WIDGET(ggla_area_new(attrlist));
   /* Events for widget must be set before X Window is created */
   gtk_widget_set_events(GTK_WIDGET(glarea),
                        GDK_EXPOSURE_MASK|
diff --git a/examples/viewlw.c b/examples/viewlw.c
index 17b1380..9d4b212 100644
--- a/examples/viewlw.c
+++ b/examples/viewlw.c
@@ -105,11 +105,11 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 {
   GLfloat m[4][4];
 
-  GglaWidget *glarea = GGLA_WIDGET(widget);
+  GglaArea *glarea = GGLA_AREA(widget);
   mesh_info *info = (mesh_info*) g_object_get_data (G_OBJECT (widget), "mesh_info");
 
   /* OpenGL calls can be done only if make_current returns true */
-  if (ggla_widget_make_current(glarea)) {
+  if (ggla_area_make_current(glarea)) {
     /* basic initialization */
     if (info->do_init == TRUE) {
       initgl();
@@ -134,7 +134,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
     lw_object_show(info->lwobject);
 
     /* swap backbuffer to front */
-    ggla_widget_swap_buffers(glarea);
+    ggla_area_swap_buffers(glarea);
   }
 
   return TRUE;
@@ -143,7 +143,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 gint glarea_configure(GtkWidget *widget, GdkEventConfigure *event)
 {
   /* OpenGL calls can be done only if make_current returns true */
-  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current(GGLA_AREA(widget))) {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
       glViewport(0, 0, allocation.width, allocation.height);
@@ -306,7 +306,7 @@ gint show_lwobject(char const *lwobject_name)
 
 
   /* create new OpenGL widget */
-  glarea = ggla_widget_new_vargs(NULL, /* no sharing */
+  glarea = ggla_area_new_vargs(NULL, /* no sharing */
                                 GGLA_RGBA,
                                 GGLA_RED_SIZE,1,
                                 GGLA_GREEN_SIZE,1,
@@ -316,7 +316,7 @@ gint show_lwobject(char const *lwobject_name)
                                 GGLA_NONE);  /* last argument must be GDK_GL_NONE */
   if (glarea == NULL) {
     lw_object_free(lwobject);
-    g_print("Can't create GglaWidget widget\n");
+    g_print("Can't create GglaArea widget\n");
     return FALSE;
   }
   /* set up events and signals for OpenGL widget */
diff --git a/examples/zktor.c b/examples/zktor.c
index 81c8d45..e3ead86 100644
--- a/examples/zktor.c
+++ b/examples/zktor.c
@@ -699,7 +699,7 @@ gint switch_fullscreen(GtkWidget *gl_area)
          if (gdk_pointer_grab(gl_area->window, FALSE, 0, NULL, NULL, GDK_CURRENT_TIME) == 0)
            {
              gtk_widget_grab_focus(gl_area);
-             if (ggla_widget_make_current(GGLA_WIDGET(gl_area)))
+             if (ggla_area_make_current(GGLA_AREA(gl_area)))
                {
                  if (XMesaSetFXmode((XMESA_FX_FULLSCREEN)))
                    {
@@ -716,7 +716,7 @@ gint switch_fullscreen(GtkWidget *gl_area)
 
   if (fullscreenwidget == gl_area)
     {
-      if (ggla_widget_make_current(GGLA_WIDGET(gl_area)))
+      if (ggla_area_make_current(GGLA_AREA(gl_area)))
        XMesaSetFXmode(XMESA_FX_WINDOW);
 
       gdk_keyboard_ungrab(GDK_CURRENT_TIME);
@@ -736,7 +736,7 @@ gint switch_fullscreen(GtkWidget *gl_area)
 gint init(GtkWidget *widget)
 {
   /* OpenGL functions can be called only if makecurrent returns true */
-  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
+  if (ggla_area_make_current(GGLA_AREA(widget))) {
 
     /* set viewport */
     GtkAllocation allocation;
@@ -750,11 +750,11 @@ gint init(GtkWidget *widget)
 /* When widget is exposed it's contents are redrawn. */
 gboolean  draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 {
-  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
+  if (ggla_area_make_current(GGLA_AREA(widget)))
     game_render();
 
   /* Swap backbuffer to front */
-  ggla_widget_swap_buffers(GGLA_WIDGET(widget));
+  ggla_area_swap_buffers(GGLA_AREA(widget));
 
   return TRUE;
 }
@@ -763,7 +763,7 @@ gboolean  draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 gint reshape(GtkWidget *widget, GdkEventConfigure *event)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
+  if (ggla_area_make_current(GGLA_AREA(widget)))
     {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
@@ -892,7 +892,7 @@ int main(int argc, char **argv)
 
 
   /* Create new OpenGL widget. */
-  glarea = GTK_WIDGET(ggla_widget_new(attrlist));
+  glarea = GTK_WIDGET(ggla_area_new(attrlist));
   /* Events for widget must be set before X Window is created */
   gtk_widget_set_events(GTK_WIDGET(glarea),
                        GDK_EXPOSURE_MASK|
diff --git a/gtkgl/gdkgl.h b/gtkgl/gdkgl.h
index 27d4d60..bdcd9a7 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 GglaWidget
+ * I don't want every program to include GL/glx.h because GglaArea
  * 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 f78a68d..ca99bd8 100644
--- a/gtkgl/gtkgl.def
+++ b/gtkgl/gtkgl.def
@@ -13,9 +13,9 @@ EXPORTS
        ggla_use_gdk_font
        ggla_wait_gdk
        ggla_wait_gl
-       ggla_widget_get_type
-       ggla_widget_make_current
-       ggla_widget_new
-       ggla_widget_new_vargs
-       ggla_widget_share_new
-       ggla_widget_swap_buffers
+       ggla_area_get_type
+       ggla_area_make_current
+       ggla_area_new
+       ggla_area_new_vargs
+       ggla_area_share_new
+       ggla_area_swap_buffers
diff --git a/gtkgl/gtkglarea.c b/gtkgl/gtkglarea.c
index 7a8a36d..585e1c5 100644
--- a/gtkgl/gtkglarea.c
+++ b/gtkgl/gtkglarea.c
@@ -23,23 +23,23 @@
 #include "gdkgl.h"
 #include "gtkglarea.h"
 
-static void ggla_widget_finalize       (GObject      *object);
+static void ggla_area_finalize       (GObject      *object);
 
-G_DEFINE_TYPE (GglaWidget, ggla_widget, GTK_TYPE_DRAWING_AREA);
+G_DEFINE_TYPE (GglaArea, ggla_area, GTK_TYPE_DRAWING_AREA);
 
 static void
-ggla_widget_class_init (GglaWidgetClass *klass)
+ggla_area_class_init (GglaAreaClass *klass)
 {
   GObjectClass *object_class;
 
   object_class = (GObjectClass*) klass;
 
-  object_class->finalize = ggla_widget_finalize;
+  object_class->finalize = ggla_area_finalize;
 }
 
 
 static void
-ggla_widget_init (GglaWidget *gl_area)
+ggla_area_init (GglaArea *gl_area)
 {
   gl_area->glcontext = NULL;
   gtk_widget_set_double_buffered(GTK_WIDGET(gl_area), FALSE);
@@ -48,7 +48,7 @@ ggla_widget_init (GglaWidget *gl_area)
 
 
 GtkWidget*
-ggla_widget_new_vargs(GglaWidget *share, ...)
+ggla_area_new_vargs(GglaArea *share, ...)
 {
   GtkWidget *glarea;
   va_list ap;
@@ -69,7 +69,7 @@ ggla_widget_new_vargs(GglaWidget *share, ...)
     i++;
   va_end(ap);
 
-  glarea = ggla_widget_share_new(attrlist, share);
+  glarea = ggla_area_share_new(attrlist, share);
 
   g_free(attrlist);
 
@@ -77,16 +77,16 @@ ggla_widget_new_vargs(GglaWidget *share, ...)
 }
 
 GtkWidget*
-ggla_widget_new (int *attrlist)
+ggla_area_new (int *attrlist)
 {
-  return ggla_widget_share_new(attrlist, NULL);
+  return ggla_area_share_new(attrlist, NULL);
 }
 
 GtkWidget*
-ggla_widget_share_new (int *attrlist, GglaWidget *share)
+ggla_area_share_new (int *attrlist, GglaArea *share)
 {
   GglaContext *glcontext;
-  GglaWidget *gl_area;
+  GglaArea *gl_area;
 #if defined GDK_WINDOWING_X11
   GdkVisual *visual;
 #endif
@@ -113,19 +113,19 @@ ggla_widget_share_new (int *attrlist, GglaWidget *share)
 
 
 static void
-ggla_widget_finalize(GObject *object)
+ggla_area_finalize(GObject *object)
 {
-  GglaWidget *gl_area = GGLA_WIDGET(object);
+  GglaArea *gl_area = GGLA_AREA(object);
 
   if (gl_area->glcontext)
     g_object_unref(gl_area->glcontext);
   gl_area->glcontext = NULL;
 
-  G_OBJECT_CLASS (ggla_widget_parent_class)->finalize (object);
+  G_OBJECT_CLASS (ggla_area_parent_class)->finalize (object);
 }
 
 
-gint ggla_widget_make_current(GglaWidget *gl_area)
+gint ggla_area_make_current(GglaArea *gl_area)
 {
   g_return_val_if_fail(gl_area != NULL, FALSE);
   g_return_val_if_fail(GGLA_IS_WIDGET (gl_area), FALSE);
@@ -136,7 +136,7 @@ gint ggla_widget_make_current(GglaWidget *gl_area)
                           gl_area->glcontext);
 }
 
-void ggla_widget_swap_buffers(GglaWidget *gl_area)
+void ggla_area_swap_buffers(GglaArea *gl_area)
 {
   g_return_if_fail(gl_area != NULL);
   g_return_if_fail(GGLA_IS_WIDGET(gl_area));
diff --git a/gtkgl/gtkglarea.h b/gtkgl/gtkglarea.h
index 9080bb8..8b45ccc 100644
--- a/gtkgl/gtkglarea.h
+++ b/gtkgl/gtkglarea.h
@@ -17,8 +17,8 @@
  */
 
 
-#ifndef __GGLA_WIDGET_H__
-#define __GGLA_WIDGET_H__
+#ifndef __GGLA_AREA_H__
+#define __GGLA_AREA_H__
 
 #include <gdk/gdk.h>
 #include <gtkgl/gdkgl.h>
@@ -27,42 +27,42 @@
 
 G_BEGIN_DECLS
 
-#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_TYPE_WIDGET            (ggla_area_get_type())
+#define GGLA_AREA(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GGLA_TYPE_WIDGET, GglaArea))
+#define GGLA_AREA_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST (klass, GGLA_TYPE_WIDGET, GglaAreaClass))
 #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))
+#define GGLA_AREA_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GGLA_TYPE_WIDGET, GglaArea))
 
 
-typedef struct _GglaWidget       GglaWidget;
-typedef struct _GglaWidgetClass  GglaWidgetClass;
+typedef struct _GglaArea       GglaArea;
+typedef struct _GglaAreaClass  GglaAreaClass;
 
 
-struct _GglaWidget
+struct _GglaArea
 {
   GtkDrawingArea  darea;
   GglaContext *glcontext;
 };
 
-struct _GglaWidgetClass
+struct _GglaAreaClass
 {
   GtkDrawingAreaClass parent_class;
 };
 
-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,
+GType      ggla_area_get_type     (void);
+GtkWidget* ggla_area_new          (int        *attrList);
+GtkWidget* ggla_area_share_new    (int        *attrList,
+                                   GglaArea *share);
+GtkWidget* ggla_area_new_vargs    (GglaArea *share,
                                   ...);
 
 
-gint       ggla_widget_make_current(GglaWidget *glarea);
+gint       ggla_area_make_current (GglaArea *glarea);
 
-void       ggla_widget_swap_buffers(GglaWidget *glarea);
+void       ggla_area_swap_buffers (GglaArea *glarea);
 
 
 G_END_DECLS
 
-#endif /* __GGLA_WIDGET_H__ */
+#endif /* __GGLA_AREA_H__ */


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