diff options
author | David Robillard <d@drobilla.net> | 2023-01-07 19:27:05 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-01-07 19:27:05 -0500 |
commit | ba11bb80c96fc9c9124ba2fa929425f558f86824 (patch) | |
tree | 00ecd9857e672a101d722d86ef22a9cb48f8f827 /test | |
parent | 28631e2b202e661084039464f45228b9ce323a8f (diff) | |
download | pugl-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 'test')
-rw-r--r-- | test/test_realize.c | 8 | ||||
-rw-r--r-- | test/test_show_hide.c | 20 | ||||
-rw-r--r-- | test/test_size.c | 14 | ||||
-rw-r--r-- | test/test_utils.h | 8 | ||||
-rw-r--r-- | test/test_view.c | 8 |
5 files changed, 29 insertions, 29 deletions
diff --git a/test/test_realize.c b/test/test_realize.c index cf2cde6..4bdafae 100644 --- a/test/test_realize.c +++ b/test/test_realize.c @@ -22,7 +22,7 @@ typedef enum { START, - CREATED, + REALIZED, } State; typedef struct { @@ -42,9 +42,9 @@ onEvent(PuglView* view, const PuglEvent* event) } switch (event->type) { - case PUGL_CREATE: + case PUGL_REALIZE: assert(test->state == START); - test->state = CREATED; + test->state = REALIZED; break; default: break; @@ -77,7 +77,7 @@ main(int argc, char** argv) // Create initially invisible window assert(!puglRealize(test.view)); assert(!puglGetVisible(test.view)); - while (test.state < CREATED) { + while (test.state < REALIZED) { assert(!puglUpdate(test.world, -1.0)); } diff --git a/test/test_show_hide.c b/test/test_show_hide.c index 1dc17a2..a5c8622 100644 --- a/test/test_show_hide.c +++ b/test/test_show_hide.c @@ -19,12 +19,12 @@ typedef enum { START, - CREATED, + REALIZED, CONFIGURED, MAPPED, EXPOSED, UNMAPPED, - DESTROYED, + UNREALIZED, } State; typedef struct { @@ -44,12 +44,12 @@ onEvent(PuglView* view, const PuglEvent* event) } switch (event->type) { - case PUGL_CREATE: + case PUGL_REALIZE: assert(test->state == START); - test->state = CREATED; + test->state = REALIZED; break; case PUGL_CONFIGURE: - if (test->state == CREATED) { + if (test->state == REALIZED) { test->state = CONFIGURED; } break; @@ -65,9 +65,9 @@ onEvent(PuglView* view, const PuglEvent* event) assert(test->state == MAPPED || test->state == EXPOSED); test->state = UNMAPPED; break; - case PUGL_DESTROY: + case PUGL_UNREALIZE: assert(test->state == UNMAPPED); - test->state = DESTROYED; + test->state = UNREALIZED; break; default: break; @@ -126,7 +126,7 @@ main(int argc, char** argv) // Create initially invisible window assert(!puglRealize(test.view)); assert(!puglGetVisible(test.view)); - while (test.state < CREATED) { + while (test.state < REALIZED) { tick(test.world); } @@ -136,7 +136,7 @@ main(int argc, char** argv) // Unrealize view assert(!puglGetVisible(test.view)); assert(!puglUnrealize(test.view)); - assert(test.state == DESTROYED); + assert(test.state == UNREALIZED); // Realize and show again test.state = START; @@ -146,7 +146,7 @@ main(int argc, char** argv) // Tear down puglFreeView(test.view); - assert(test.state == DESTROYED); + assert(test.state == UNREALIZED); puglFreeWorld(test.world); return 0; diff --git a/test/test_size.c b/test/test_size.c index 1c2f0c6..ef8b738 100644 --- a/test/test_size.c +++ b/test/test_size.c @@ -16,10 +16,10 @@ typedef enum { START, - CREATED, + REALIZED, CONFIGURED, MAPPED, - DESTROYED, + UNREALIZED, } State; typedef struct { @@ -40,12 +40,12 @@ onEvent(PuglView* view, const PuglEvent* event) } switch (event->type) { - case PUGL_CREATE: + case PUGL_REALIZE: assert(test->state == START); - test->state = CREATED; + test->state = REALIZED; break; case PUGL_CONFIGURE: - if (test->state == CREATED) { + if (test->state == REALIZED) { test->state = CONFIGURED; } test->configuredFrame.x = event->configure.x; @@ -56,8 +56,8 @@ onEvent(PuglView* view, const PuglEvent* event) case PUGL_MAP: test->state = MAPPED; break; - case PUGL_DESTROY: - test->state = DESTROYED; + case PUGL_UNREALIZE: + test->state = UNREALIZED; break; default: break; diff --git a/test/test_utils.h b/test/test_utils.h index 359f51d..fd2c15b 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -101,10 +101,10 @@ printEvent(const PuglEvent* event, const char* prefix, const bool verbose) switch (event->type) { case PUGL_NOTHING: return 0; - case PUGL_CREATE: - return fprintf(stderr, "%sCreate\n", prefix); - case PUGL_DESTROY: - return fprintf(stderr, "%sDestroy\n", prefix); + case PUGL_REALIZE: + return fprintf(stderr, "%sRealize\n", prefix); + case PUGL_UNREALIZE: + return fprintf(stderr, "%sUnrealize\n", prefix); case PUGL_MAP: return fprintf(stderr, "%sMap\n", prefix); case PUGL_UNMAP: diff --git a/test/test_view.c b/test/test_view.c index f8b0cb5..34bf124 100644 --- a/test/test_view.c +++ b/test/test_view.c @@ -18,7 +18,7 @@ typedef enum { START, CREATED, MAPPED, - DESTROYED, + UNREALIZED, } State; typedef struct { @@ -38,15 +38,15 @@ onEvent(PuglView* view, const PuglEvent* event) } switch (event->type) { - case PUGL_CREATE: + case PUGL_REALIZE: assert(test->state == START); test->state = CREATED; break; case PUGL_MAP: test->state = MAPPED; break; - case PUGL_DESTROY: - test->state = DESTROYED; + case PUGL_UNREALIZE: + test->state = UNREALIZED; break; default: break; |