diff options
Diffstat (limited to 'tests/wayland/test_cursor.c')
| -rw-r--r-- | tests/wayland/test_cursor.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/tests/wayland/test_cursor.c b/tests/wayland/test_cursor.c index eb729a3..3425821 100644 --- a/tests/wayland/test_cursor.c +++ b/tests/wayland/test_cursor.c @@ -51,9 +51,9 @@ static uint32_t pointer_version(struct wl_pointer *pointer) int main(void) { - struct wayland_display display = {.base.ops = &yasl_wayland_backend}; + struct wayland_display display = {.base.ops = &yasl_private_wayland_backend}; struct wayland_surface surface = {.base.display = &display.base, .conn = &display, - .scale_factor = 1, .cursor = YASL_CURSOR_TEXT}; + .scale_factor = 1, .cursor = YASL_PRIVATE_CURSOR_TEXT}; surface.surface = (struct wl_surface *)&surface; wl_surface_set_user_data(surface.surface, &surface); display.surfaces = &surface; @@ -64,7 +64,7 @@ int main(void) tool.proxy = (struct zwp_tablet_tool_v2 *)&tool; /* The example selects hidden before either input device has entered. */ - yasl_surface_set_cursor(&surface.base, YASL_CURSOR_HIDDEN); + yasl_private_surface_set_cursor(&surface.base, YASL_PRIVATE_CURSOR_HIDDEN); assert(!pointer_hides && !tool_hides); pointer_enter(&seat, seat.pointer, 10, surface.surface, 0, 0); assert(pointer_hides == 1 && pointer_serial == 10); @@ -76,14 +76,16 @@ int main(void) pointer_frame(&seat, seat.pointer); tablet_tool_motion(&tool, tool.proxy, wl_fixed_from_int(56), wl_fixed_from_int(78)); tool_frame(&tool, tool.proxy, 0); - struct yasl_event event; - assert(yasl_surface_poll_event(&surface.base, &event)); - assert(event.type == YASL_EVENT_POINTER_MOTION && event.pointer.device == YASL_PTR_DEV_MOUSE); + struct yasl_private_event event; + assert(yasl_private_surface_poll_event(&surface.base, &event)); + assert(event.type == YASL_PRIVATE_EVENT_POINTER_MOTION && event.pointer.device == YASL_PRIVATE_PTR_DEV_MOUSE); assert(event.pointer.pos.x == 12 && event.pointer.pos.y == 34); - assert(yasl_surface_poll_event(&surface.base, &event)); - assert(event.type == YASL_EVENT_POINTER_MOTION && event.pointer.device == YASL_PTR_DEV_PEN); + assert(yasl_private_surface_poll_event(&surface.base, &event)); + assert(event.type == YASL_PRIVATE_EVENT_PEN && event.pen.action == YASL_PRIVATE_PEN_ENTER); + assert(yasl_private_surface_poll_event(&surface.base, &event)); + assert(event.type == YASL_PRIVATE_EVENT_POINTER_MOTION && event.pointer.device == YASL_PRIVATE_PTR_DEV_PEN); assert(event.pointer.pos.x == 56 && event.pointer.pos.y == 78); - assert(!yasl_surface_poll_event(&surface.base, &event)); + assert(!yasl_private_surface_poll_event(&surface.base, &event)); /* Each new entry needs a request with its own serial. */ pointer_leave(&seat, seat.pointer, 12, surface.surface); @@ -98,20 +100,20 @@ int main(void) /* Restore a visible shape on both currently focused devices. */ pointer_device = seat.cursor_shape_dev = (struct wp_cursor_shape_device_v1 *)&seat; tool.shape_dev = (struct wp_cursor_shape_device_v1 *)&tool; - yasl_surface_set_cursor(&surface.base, YASL_CURSOR_ARROW); + yasl_private_surface_set_cursor(&surface.base, YASL_PRIVATE_CURSOR_ARROW); assert(pointer_shapes == 1 && tool_shapes == 1); assert(pointer_shape == WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT); assert(tool_shape == WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT); - yasl_surface_set_cursor(&surface.base, YASL_CURSOR_HIDDEN); + yasl_private_surface_set_cursor(&surface.base, YASL_PRIVATE_CURSOR_HIDDEN); assert(pointer_hides == 3 && tool_hides == 3); assert(pointer_shapes == 1 && tool_shapes == 1); /* Updating an unfocused surface must not alter the active cursor. */ struct wayland_surface other = {.base.display = &display.base, .conn = &display}; - yasl_surface_set_cursor(&other.base, YASL_CURSOR_CROSSHAIR); + yasl_private_surface_set_cursor(&other.base, YASL_PRIVATE_CURSOR_CROSSHAIR); assert(pointer_shapes == 1 && tool_shapes == 1); - yasl_surface_set_cursor(&surface.base, (enum yasl_cursor)-1); - yasl_surface_set_cursor(&surface.base, (enum yasl_cursor)(YASL_CURSOR_HIDDEN + 1)); + yasl_private_surface_set_cursor(&surface.base, (enum yasl_private_cursor)-1); + yasl_private_surface_set_cursor(&surface.base, (enum yasl_private_cursor)(YASL_PRIVATE_CURSOR_HIDDEN + 1)); assert(pointer_hides == 3 && tool_hides == 3); assert(pointer_shapes == 1 && tool_shapes == 1); input_queue_clear(&surface.input); |
