summaryrefslogtreecommitdiff
path: root/tests/common/test_app.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common/test_app.c')
-rw-r--r--tests/common/test_app.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/common/test_app.c b/tests/common/test_app.c
index 23c9a93..6972921 100644
--- a/tests/common/test_app.c
+++ b/tests/common/test_app.c
@@ -37,7 +37,7 @@ static uint64_t on_timer(void *ud, yasl_timer_id id, uint64_t interval_ns)
return 0; /* one-shot */
}
-static int on_init(void *ud, struct yasl_display *d)
+static enum yasl_app_result on_init(void *ud, struct yasl_display *d)
{
struct test_state *state = ud;
state->display = d;
@@ -51,8 +51,8 @@ static int on_init(void *ud, struct yasl_display *d)
assert(state->surface != NULL);
yasl_surface_set_pacing(state->surface, YASL_PACING_ON_DEMAND);
- yasl_surface_set_mouse_mode(state->surface, YASL_MOUSE_RELATIVE);
- yasl_surface_set_mouse_mode(state->surface, YASL_MOUSE_NORMAL);
+ yasl_surface_set_pointer_mode(state->surface, YASL_POINTER_RELATIVE);
+ yasl_surface_set_pointer_mode(state->surface, YASL_POINTER_NORMAL);
state->timer_id = yasl_app_add_timer(d, YASL_MS_TO_NS(20), on_timer, state);
assert(state->timer_id > 0);
@@ -66,15 +66,15 @@ static int on_init(void *ud, struct yasl_display *d)
return YASL_APP_CONTINUE;
}
-static int on_event(void *ud, const struct yasl_event *ev)
+static enum yasl_app_result on_event(void *ud, const struct yasl_event *ev)
{
struct test_state *state = ud;
if (ev->type == YASL_EVENT_USER) {
- assert(ev->user.type == 42);
+ assert(ev->user.code == 42);
assert(ev->user.payload == (void *)0x1234);
state->user_event_called = true;
yasl_surface_request_frame(state->surface);
- } else if (ev->type == YASL_EVENT_WINDOW_CLOSE_REQUEST) {
+ } else if (ev->type == YASL_EVENT_WINDOW_CLOSE) {
return YASL_APP_QUIT;
}
return YASL_APP_CONTINUE;