aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
Diffstat (limited to 'pugl')
-rw-r--r--pugl/pugl_internal_types.h4
-rw-r--r--pugl/pugl_x11.c22
-rw-r--r--pugl/pugl_x11.h16
-rw-r--r--pugl/pugl_x11_cairo.c6
-rw-r--r--pugl/pugl_x11_cairo.h2
-rw-r--r--pugl/pugl_x11_gl.c6
-rw-r--r--pugl/pugl_x11_gl.h2
7 files changed, 29 insertions, 29 deletions
diff --git a/pugl/pugl_internal_types.h b/pugl/pugl_internal_types.h
index 6a1ea80..cdca942 100644
--- a/pugl/pugl_internal_types.h
+++ b/pugl/pugl_internal_types.h
@@ -79,7 +79,7 @@ struct PuglViewImpl {
/** Opaque surface used by draw context. */
typedef void PuglSurface;
-/** Drawing context interface. */
+/** Graphics backend interface. */
typedef struct {
/** Get visual information from display and setup view as necessary. */
int (*configure)(PuglView*);
@@ -101,6 +101,6 @@ typedef struct {
/** Return the puglGetContext() handle for the application, if any. */
void* (*getHandle)(PuglView*);
-} PuglDrawContext;
+} PuglBackend;
#endif // PUGL_INTERNAL_TYPES_H
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index 692ec04..70f4466 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -70,13 +70,13 @@ puglInitInternals(void)
void
puglEnterContext(PuglView* view)
{
- view->impl->ctx.enter(view);
+ view->impl->backend.enter(view);
}
void
puglLeaveContext(PuglView* view, bool flush)
{
- view->impl->ctx.leave(view, flush);
+ view->impl->backend.leave(view, flush);
}
int
@@ -97,19 +97,19 @@ puglCreateWindow(PuglView* view, const char* title)
if (view->ctx_type == PUGL_GL) {
#ifdef PUGL_HAVE_GL
- impl->ctx = puglGetX11GlDrawContext();
+ impl->backend = puglGetX11GlBackend();
#endif
}
if (view->ctx_type == PUGL_CAIRO) {
#ifdef PUGL_HAVE_CAIRO
- impl->ctx = puglGetX11CairoDrawContext();
+ impl->backend = puglGetX11CairoBackend();
#endif
}
- if (!impl->ctx.configure) {
+ if (!impl->backend.configure) {
return 1;
- } else if (impl->ctx.configure(view) || !impl->vi) {
- impl->ctx.destroy(view);
+ } else if (impl->backend.configure(view) || !impl->vi) {
+ impl->backend.destroy(view);
return 2;
}
@@ -128,7 +128,7 @@ puglCreateWindow(PuglView* view, const char* title)
0, 0, view->width, view->height, 0, impl->vi->depth, InputOutput,
impl->vi->visual, CWColormap | CWEventMask, &attr);
- if (impl->ctx.create(view)) {
+ if (impl->backend.create(view)) {
return 3;
}
@@ -211,7 +211,7 @@ puglDestroy(PuglView* view)
if (view->impl->xim) {
XCloseIM(view->impl->xim);
}
- view->impl->ctx.destroy(view);
+ view->impl->backend.destroy(view);
XDestroyWindow(view->impl->display, view->impl->win);
XCloseDisplay(view->impl->display);
XFree(view->impl->vi);
@@ -564,7 +564,7 @@ puglProcessEvents(PuglView* view)
if (config_event.type) {
view->width = (int)config_event.configure.width;
view->height = (int)config_event.configure.height;
- impl->ctx.resize(view, view->width, view->height);
+ impl->backend.resize(view, view->width, view->height);
view->eventFunc(view, (const PuglEvent*)&config_event);
}
@@ -608,5 +608,5 @@ puglGetNativeWindow(PuglView* view)
void*
puglGetContext(PuglView* view)
{
- return view->impl->ctx.getHandle(view);
+ return view->impl->backend.getHandle(view);
}
diff --git a/pugl/pugl_x11.h b/pugl/pugl_x11.h
index 6a38c62..6efc145 100644
--- a/pugl/pugl_x11.h
+++ b/pugl/pugl_x11.h
@@ -21,14 +21,14 @@
#include <X11/Xutil.h>
struct PuglInternalsImpl {
- Display* display;
- int screen;
- XVisualInfo* vi;
- Window win;
- XIM xim;
- XIC xic;
- PuglDrawContext ctx;
- PuglSurface* surface;
+ Display* display;
+ int screen;
+ XVisualInfo* vi;
+ Window win;
+ XIM xim;
+ XIC xic;
+ PuglBackend backend;
+ PuglSurface* surface;
struct {
Atom WM_PROTOCOLS;
diff --git a/pugl/pugl_x11_cairo.c b/pugl/pugl_x11_cairo.c
index be6fe36..6992c1a 100644
--- a/pugl/pugl_x11_cairo.c
+++ b/pugl/pugl_x11_cairo.c
@@ -118,9 +118,9 @@ puglX11CairoGetHandle(PuglView* view)
return surface->cr;
}
-PuglDrawContext puglGetX11CairoDrawContext(void)
+PuglBackend puglGetX11CairoBackend(void)
{
- static const PuglDrawContext puglX11CairoDrawContext = {
+ static const PuglBackend puglX11CairoBackend = {
puglX11CairoConfigure,
puglX11CairoCreate,
puglX11CairoDestroy,
@@ -130,5 +130,5 @@ PuglDrawContext puglGetX11CairoDrawContext(void)
puglX11CairoGetHandle
};
- return puglX11CairoDrawContext;
+ return puglX11CairoBackend;
}
diff --git a/pugl/pugl_x11_cairo.h b/pugl/pugl_x11_cairo.h
index ffad90b..085cc0b 100644
--- a/pugl/pugl_x11_cairo.h
+++ b/pugl/pugl_x11_cairo.h
@@ -17,6 +17,6 @@
#ifndef PUGL_X11_CAIRO_H
#define PUGL_X11_CAIRO_H
-PuglDrawContext puglGetX11CairoDrawContext(void);
+PuglBackend puglGetX11CairoBackend(void);
#endif // PUGL_X11_CAIRO_H
diff --git a/pugl/pugl_x11_gl.c b/pugl/pugl_x11_gl.c
index 06b4b2e..66ba213 100644
--- a/pugl/pugl_x11_gl.c
+++ b/pugl/pugl_x11_gl.c
@@ -193,9 +193,9 @@ puglGetProcAddress(const char* name)
return glXGetProcAddress((const GLubyte*)name);
}
-PuglDrawContext puglGetX11GlDrawContext(void)
+PuglBackend puglGetX11GlBackend(void)
{
- static const PuglDrawContext puglX11GlDrawContext = {
+ static const PuglBackend puglX11GlBackend = {
puglX11GlConfigure,
puglX11GlCreate,
puglX11GlDestroy,
@@ -205,5 +205,5 @@ PuglDrawContext puglGetX11GlDrawContext(void)
puglX11GlGetHandle
};
- return puglX11GlDrawContext;
+ return puglX11GlBackend;
}
diff --git a/pugl/pugl_x11_gl.h b/pugl/pugl_x11_gl.h
index cba6473..66cd8f3 100644
--- a/pugl/pugl_x11_gl.h
+++ b/pugl/pugl_x11_gl.h
@@ -17,6 +17,6 @@
#ifndef PUGL_X11_GL_H
#define PUGL_X11_GL_H
-PuglDrawContext puglGetX11GlDrawContext(void);
+PuglBackend puglGetX11GlBackend(void);
#endif // PUGL_X11_GL_H