[gtkglarea/jjardon/gtk3: 21/21] Change ggla_widget to ggla_area
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkglarea/jjardon/gtk3: 21/21] Change ggla_widget to ggla_area
- Date: Tue, 5 Aug 2014 01:11:45 +0000 (UTC)
commit be315eef15009b341bb777497bd8f385e3ae4a79
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 | 2 +-
docs/gtkglarea.txt | 14 +++++++-------
examples/gtkglarea_demo.c | 16 ++++++++--------
examples/shaders.c | 10 +++++-----
examples/simple.c | 10 +++++-----
examples/viewlw.c | 8 ++++----
examples/zktor.c | 14 +++++++-------
gtkgl/gtkgl.def | 12 ++++++------
gtkgl/gtkglarea.c | 28 ++++++++++++++--------------
gtkgl/gtkglarea.h | 14 +++++++-------
10 files changed, 64 insertions(+), 64 deletions(-)
---
diff --git a/docs/HOWTO.txt b/docs/HOWTO.txt
index 0b2d3f2..9ed43b7 100644
--- a/docs/HOWTO.txt
+++ b/docs/HOWTO.txt
@@ -42,7 +42,7 @@
6. Can I use gdk_gl functions and GglaWidget 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 GglaWidget
widget's internal context the current context and leaves it so.
diff --git a/docs/gtkglarea.txt b/docs/gtkglarea.txt
index bfba0e6..7c5c541 100644
--- a/docs/gtkglarea.txt
+++ b/docs/gtkglarea.txt
@@ -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, GglaWidget *share)
+GtkWidget* ggla_area_new_vargs(GglaWidget *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(GglaWidget *gl_area)
PARAMETERS
@@ -44,7 +44,7 @@ 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.
@@ -52,7 +52,7 @@ DESCRIPTION
---------------------------------------------------------
C SPECIFICATION
-void ggla_widget_swap_buffers(GglaWidget *gl_area)
+void ggla_area_swap_buffers(GglaWidget *gl_area)
PARAMETERS
diff --git a/examples/gtkglarea_demo.c b/examples/gtkglarea_demo.c
index 19b7e7a..7be9581 100644
--- a/examples/gtkglarea_demo.c
+++ b/examples/gtkglarea_demo.c
@@ -106,7 +106,7 @@ GtkWidget* create_glarea (void) {
/* Now, create the GglaWidget using the attribute list that */
/* we defined above. */
- if ((glarea = ggla_widget_new(attrlist)) == NULL) {
+ if ((glarea = ggla_area_new(attrlist)) == NULL) {
g_print("Error creating GglaWidget!\n");
return NULL;
}
@@ -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 */
+ /* ggla_area_make_current MUST be called before rendering */
/* into the GglaWidget. */
- if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
+ if (ggla_area_make_current(GGLA_WIDGET(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_WIDGET(widget));
}
@@ -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 */
+ /* ggla_area_make_current MUST be called before rendering */
/* into the GglaWidget. */
- if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+ if (ggla_area_make_current (GGLA_WIDGET(widget))) {
/* This is an example 2D reshape function. Writing reshape */
/* functions is beyond the scope of this demo. Check the */
@@ -392,10 +392,10 @@ gint glarea_init (GtkWidget* widget) {
g_print ("Realize Event\n");
- /* ggla_widget_make_current MUST be called before rendering */
+ /* ggla_area_make_current MUST be called before rendering */
/* into the GglaWidget. */
- if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+ if (ggla_area_make_current (GGLA_WIDGET(widget))) {
/* Insert your OpenGL initialization code here */
diff --git a/examples/shaders.c b/examples/shaders.c
index 773473c..6156120 100644
--- a/examples/shaders.c
+++ b/examples/shaders.c
@@ -237,7 +237,7 @@ GtkWidget* create_glarea (void) {
return NULL;
}
- if ((glarea = ggla_widget_new(attrlist)) == NULL) {
+ if ((glarea = ggla_area_new(attrlist)) == NULL) {
g_print("Error creating GglaWidget!\n");
return NULL;
}
@@ -294,11 +294,11 @@ gint glarea_draw_scene (void) {
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_WIDGET(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_WIDGET(widget));
}
@@ -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_WIDGET(widget))) {
glViewport (0, 0, w, h);
glMatrixMode (GL_PROJECTION);
@@ -348,7 +348,7 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
gint glarea_init (GtkWidget* widget) {
- if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
+ if (ggla_area_make_current (GGLA_WIDGET(widget))) {
/* Procedural texture creation */
diff --git a/examples/simple.c b/examples/simple.c
index 1802022..30b2e70 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_WIDGET(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_WIDGET(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_WIDGET(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_WIDGET(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..4c62648 100644
--- a/examples/viewlw.c
+++ b/examples/viewlw.c
@@ -109,7 +109,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
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_WIDGET(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,
diff --git a/examples/zktor.c b/examples/zktor.c
index 81c8d45..d595f55 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_WIDGET(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_WIDGET(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_WIDGET(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_WIDGET(widget)))
game_render();
/* Swap backbuffer to front */
- ggla_widget_swap_buffers(GGLA_WIDGET(widget));
+ ggla_area_swap_buffers(GGLA_WIDGET(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_WIDGET(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/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..b91fc48 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 (GglaWidget, ggla_area, GTK_TYPE_DRAWING_AREA);
static void
-ggla_widget_class_init (GglaWidgetClass *klass)
+ggla_area_class_init (GglaWidgetClass *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 (GglaWidget *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(GglaWidget *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,13 +77,13 @@ 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, GglaWidget *share)
{
GglaContext *glcontext;
GglaWidget *gl_area;
@@ -113,7 +113,7 @@ 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);
@@ -121,11 +121,11 @@ ggla_widget_finalize(GObject *object)
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(GglaWidget *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(GglaWidget *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..476cb08 100644
--- a/gtkgl/gtkglarea.h
+++ b/gtkgl/gtkglarea.h
@@ -27,7 +27,7 @@
G_BEGIN_DECLS
-#define GGLA_TYPE_WIDGET (ggla_widget_get_type())
+#define GGLA_TYPE_WIDGET (ggla_area_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))
@@ -50,17 +50,17 @@ struct _GglaWidgetClass
GtkDrawingAreaClass parent_class;
};
-GType ggla_widget_get_type (void);
-GtkWidget* ggla_widget_new (int *attrList);
-GtkWidget* ggla_widget_share_new (int *attrList,
+GType ggla_area_get_type (void);
+GtkWidget* ggla_area_new (int *attrList);
+GtkWidget* ggla_area_share_new (int *attrList,
GglaWidget *share);
-GtkWidget* ggla_widget_new_vargs (GglaWidget *share,
+GtkWidget* ggla_area_new_vargs (GglaWidget *share,
...);
-gint ggla_widget_make_current(GglaWidget *glarea);
+gint ggla_area_make_current (GglaWidget *glarea);
-void ggla_widget_swap_buffers(GglaWidget *glarea);
+void ggla_area_swap_buffers (GglaWidget *glarea);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]