summaryrefslogtreecommitdiff
path: root/tests/cocoa/test_cursor.m
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cocoa/test_cursor.m')
-rw-r--r--tests/cocoa/test_cursor.m24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/cocoa/test_cursor.m b/tests/cocoa/test_cursor.m
index 4054d59..4c961df 100644
--- a/tests/cocoa/test_cursor.m
+++ b/tests/cocoa/test_cursor.m
@@ -1,5 +1,5 @@
#import <AppKit/AppKit.h>
-#include <yasl/native.h>
+#include <common/private_native.h>
#include <assert.h>
static void assert_transparent(NSCursor *cursor)
@@ -15,18 +15,18 @@ static void assert_transparent(NSCursor *cursor)
int main(void)
{
@autoreleasepool {
- struct yasl_display *display = yasl_display_open(NULL, NULL);
+ struct yasl_private_display *display = yasl_private_display_open(NULL, NULL);
assert(display);
- struct yasl_window_spec spec = {.title = "Cursor test", .size = {320, 240}};
- struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec);
+ struct yasl_private_window_spec spec = {.title = "Cursor test", .size = {320, 240}};
+ struct yasl_surface *surface = yasl_private_surface_create_toplevel(display, &spec);
assert(surface);
- NSWindow *window = (NSWindow *)yasl_surface_get_native_handle(surface);
+ NSWindow *window = (NSWindow *)yasl_private_surface_get_native_handle(surface);
NSView *view = window.contentView;
NSEvent *cursor = [NSEvent enterExitEventWithType:NSEventTypeCursorUpdate
location:NSMakePoint(100, 120) modifierFlags:0 timestamp:0
windowNumber:window.windowNumber context:nil eventNumber:0 trackingNumber:0 userData:NULL];
assert(cursor);
- yasl_surface_set_cursor(surface, YASL_CURSOR_HIDDEN);
+ yasl_private_surface_set_cursor(surface, YASL_PRIVATE_CURSOR_HIDDEN);
[view cursorUpdate:cursor];
NSCursor *hidden = [NSCursor currentCursor];
assert_transparent(hidden);
@@ -37,21 +37,21 @@ int main(void)
[view mouseMoved:motion];
[view cursorUpdate:cursor];
assert([NSCursor currentCursor] == hidden);
- struct yasl_event event;
+ struct yasl_private_event event;
bool moved = false;
- while (yasl_surface_poll_event(surface, &event))
- if (event.type == YASL_EVENT_POINTER_MOTION)
+ while (yasl_private_surface_poll_event(surface, &event))
+ if (event.type == YASL_PRIVATE_EVENT_POINTER_MOTION)
moved = true;
assert(moved);
[[NSCursor arrowCursor] set]; /* Simulate leaving and re-entering. */
[view cursorUpdate:cursor];
assert([NSCursor currentCursor] == hidden);
- yasl_surface_set_cursor(surface, YASL_CURSOR_ARROW);
+ yasl_private_surface_set_cursor(surface, YASL_PRIVATE_CURSOR_ARROW);
[view cursorUpdate:cursor];
assert([NSCursor currentCursor] == [NSCursor arrowCursor]);
- yasl_surface_destroy(surface);
- yasl_display_close(display);
+ yasl_private_surface_destroy(surface);
+ yasl_private_display_close(display);
}
return 0;
}