aboutsummaryrefslogtreecommitdiffstats
path: root/src/internal.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-07 19:27:05 -0500
committerDavid Robillard <d@drobilla.net>2023-01-07 19:27:05 -0500
commitba11bb80c96fc9c9124ba2fa929425f558f86824 (patch)
tree00ecd9857e672a101d722d86ef22a9cb48f8f827 /src/internal.c
parent28631e2b202e661084039464f45228b9ce323a8f (diff)
downloadpugl-ba11bb80c96fc9c9124ba2fa929425f558f86824.tar.gz
pugl-ba11bb80c96fc9c9124ba2fa929425f558f86824.tar.bz2
pugl-ba11bb80c96fc9c9124ba2fa929425f558f86824.zip
Rename create/destroy events to realize/unrealize
As evidence that this was confusing, the documentation for these was an outright lie, and I've burned quite a bit of time in the past few days trying to rework things based around that flawed understanding. These names make it clear what these events actually are. If we need actual create/destroy events with a broader scope, they'll have to be added, but I suspect those aren't actually useful anyway.
Diffstat (limited to 'src/internal.c')
-rw-r--r--src/internal.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/internal.c b/src/internal.c
index ef1bcef..f1f2e65 100644
--- a/src/internal.c
+++ b/src/internal.c
@@ -131,7 +131,7 @@ puglPreRealize(PuglView* const view)
PuglStatus
puglDispatchSimpleEvent(PuglView* view, const PuglEventType type)
{
- assert(type == PUGL_CREATE || type == PUGL_DESTROY || type == PUGL_MAP ||
+ assert(type == PUGL_REALIZE || type == PUGL_UNREALIZE || type == PUGL_MAP ||
type == PUGL_UNMAP || type == PUGL_UPDATE || type == PUGL_CLOSE ||
type == PUGL_LOOP_ENTER || type == PUGL_LOOP_LEAVE);
@@ -183,17 +183,17 @@ puglDispatchEvent(PuglView* view, const PuglEvent* event)
case PUGL_NOTHING:
break;
- case PUGL_CREATE:
+ case PUGL_REALIZE:
assert(view->stage == PUGL_VIEW_STAGE_ALLOCATED);
if (!(st0 = view->backend->enter(view, NULL))) {
st0 = view->eventFunc(view, event);
st1 = view->backend->leave(view, NULL);
}
- view->stage = PUGL_VIEW_STAGE_CREATED;
+ view->stage = PUGL_VIEW_STAGE_REALIZED;
break;
- case PUGL_DESTROY:
- assert(view->stage >= PUGL_VIEW_STAGE_CREATED);
+ case PUGL_UNREALIZE:
+ assert(view->stage >= PUGL_VIEW_STAGE_REALIZED);
if (!(st0 = view->backend->enter(view, NULL))) {
st0 = view->eventFunc(view, event);
st1 = view->backend->leave(view, NULL);
@@ -202,14 +202,13 @@ puglDispatchEvent(PuglView* view, const PuglEvent* event)
break;
case PUGL_CONFIGURE:
- assert(view->stage >= PUGL_VIEW_STAGE_CREATED);
if (puglMustConfigure(view, &event->configure)) {
if (!(st0 = view->backend->enter(view, NULL))) {
st0 = puglConfigure(view, event);
st1 = view->backend->leave(view, NULL);
}
}
- if (view->stage == PUGL_VIEW_STAGE_CREATED) {
+ if (view->stage == PUGL_VIEW_STAGE_REALIZED) {
view->stage = PUGL_VIEW_STAGE_CONFIGURED;
}
break;