diff options
author | David Robillard <d@drobilla.net> | 2019-07-26 23:11:17 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-28 19:06:39 +0200 |
commit | ffdc710f20ce8016bf5daeaf97cb75bcb479a22d (patch) | |
tree | 6b4bf3fa7912f1d8f55a7d54a3b88c526752983f | |
parent | a84fe498ef7e8786455cf480bb865e1708465207 (diff) |
Rename PuglDrawContext to PuglBackend
This name was pretty confusing since there is already the concept of a
"context".
-rw-r--r-- | pugl/pugl_internal_types.h | 4 | ||||
-rw-r--r-- | pugl/pugl_x11.c | 22 | ||||
-rw-r--r-- | pugl/pugl_x11.h | 16 | ||||
-rw-r--r-- | pugl/pugl_x11_cairo.c | 6 | ||||
-rw-r--r-- | pugl/pugl_x11_cairo.h | 2 | ||||
-rw-r--r-- | pugl/pugl_x11_gl.c | 6 | ||||
-rw-r--r-- | pugl/pugl_x11_gl.h | 2 |
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 |