diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 13:44:13 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 13:44:13 +0300 |
| commit | c059e3aa7f93da470f052a5cd8ee0d8dc969e679 (patch) | |
| tree | 63ffa378287ed2c606eda2e940501b9edc3d2b8b /tests/cocoa | |
| parent | 87d0bc50d53dc216efb2b04495f090616318bc5c (diff) | |
rename and simplification
Diffstat (limited to 'tests/cocoa')
| -rw-r--r-- | tests/cocoa/test_cursor.m | 2 | ||||
| -rw-r--r-- | tests/cocoa/test_keyboard.m | 2 | ||||
| -rw-r--r-- | tests/cocoa/test_native.c | 9 | ||||
| -rw-r--r-- | tests/cocoa/test_ownership.m | 2 | ||||
| -rw-r--r-- | tests/cocoa/test_tablet.m | 2 |
5 files changed, 10 insertions, 7 deletions
diff --git a/tests/cocoa/test_cursor.m b/tests/cocoa/test_cursor.m index 7a328f2..aaca815 100644 --- a/tests/cocoa/test_cursor.m +++ b/tests/cocoa/test_cursor.m @@ -17,7 +17,7 @@ int main(void) @autoreleasepool { struct yasl_display *display = yasl_display_open(NULL, NULL); assert(display); - struct yasl_surface_spec spec = {.title = "Cursor test", .size = {320, 240}}; + struct yasl_window_spec spec = {.title = "Cursor test", .size = {320, 240}}; struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec); assert(surface); NSWindow *window = (NSWindow *)yasl_surface_get_native_handle(surface); diff --git a/tests/cocoa/test_keyboard.m b/tests/cocoa/test_keyboard.m index 4854065..d6a1336 100644 --- a/tests/cocoa/test_keyboard.m +++ b/tests/cocoa/test_keyboard.m @@ -50,7 +50,7 @@ int main(void) @autoreleasepool { struct yasl_display *display = yasl_display_open(NULL, NULL); assert(display); - struct yasl_surface_spec spec = {.title = "Keyboard test", .size = {320, 240}}; + struct yasl_window_spec spec = {.title = "Keyboard test", .size = {320, 240}}; struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec); assert(surface); NSWindow *window = (NSWindow *)yasl_surface_get_native_handle(surface); diff --git a/tests/cocoa/test_native.c b/tests/cocoa/test_native.c index 0c101dd..674513d 100644 --- a/tests/cocoa/test_native.c +++ b/tests/cocoa/test_native.c @@ -48,11 +48,14 @@ static void test_window(enum yasl_backend request, bool null_spec) struct state state = {.display = yasl_display_open(NULL, null_spec ? NULL : &spec)}; assert(state.display); assert(yasl_display_backend(state.display) == YASL_BACKEND_COCOA); - struct yasl_surface_spec surface = {.title = "Native backend test", .size = {160, 100}}; + struct yasl_window_cbs callbacks = {.draw = draw}; + struct yasl_window_spec surface = { + .title = "Native backend test", .size = {160, 100}, + .cbs = &callbacks, .ud = &state, + }; state.surface = yasl_surface_create_toplevel(state.display, &surface); assert(state.surface); - struct yasl_surface_cbs callbacks = {.draw = draw}; - yasl_surface_set_callbacks(state.surface, &callbacks, &state); + assert(!state.draws); callbacks.draw = NULL; yasl_surface_schedule_redraw(state.surface); uint64_t deadline = yasl_loop_now_ns() + 3000000000ull; diff --git a/tests/cocoa/test_ownership.m b/tests/cocoa/test_ownership.m index 2b2f52d..4e3bbd6 100644 --- a/tests/cocoa/test_ownership.m +++ b/tests/cocoa/test_ownership.m @@ -10,7 +10,7 @@ int main(void) { struct yasl_display *d = yasl_display_open(NULL, NULL); assert(d); - struct yasl_surface_spec spec = {.title = "Ownership test", .size = {160, 100}}; + struct yasl_window_spec spec = {.title = "Ownership test", .size = {160, 100}}; struct yasl_surface *s = yasl_surface_create_toplevel(d, &spec); assert(s); assert(yasl_display_get_native_handle(d) == (void *)NSApp); diff --git a/tests/cocoa/test_tablet.m b/tests/cocoa/test_tablet.m index f1489a1..ed6dc64 100644 --- a/tests/cocoa/test_tablet.m +++ b/tests/cocoa/test_tablet.m @@ -49,7 +49,7 @@ int main(void) @autoreleasepool { struct yasl_display *display = yasl_display_open(NULL, NULL); assert(display && (yasl_display_caps(display) & YASL_CAP_TABLET)); - struct yasl_surface_spec spec = {.title = "Tablet test", .size = {320, 240}}; + struct yasl_window_spec spec = {.title = "Tablet test", .size = {320, 240}}; struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec); assert(surface); NSWindow *window = (NSWindow *)yasl_surface_get_native_handle(surface); |
