From 5ef6ca21ab9e1cf4f69254234d190a634b777d52 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 09:38:31 +0300 Subject: Remove deprecated Cocoa OpenGL and private compatibility APIs --- tests/common/test_contracts.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'tests/common/test_contracts.c') diff --git a/tests/common/test_contracts.c b/tests/common/test_contracts.c index be84586..f9f427f 100644 --- a/tests/common/test_contracts.c +++ b/tests/common/test_contracts.c @@ -117,10 +117,10 @@ static bool present(struct yasl_surface *s, const struct yasl_private_framebuffe return true; } static uint32_t caps(const struct yasl_private_display *d) { (void)d; return 0; } -static void copy(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text) -{ (void)d; (void)sel; (void)text; copies++; } -static void paste(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *s) -{ (void)d; (void)sel; (void)s; pastes++; } +static bool copy(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text) +{ (void)d; (void)sel; (void)text; copies++; return true; } +static bool paste(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *s, uint64_t id) +{ (void)d; (void)sel; (void)s; assert(id); pastes++; return true; } static struct yasl_surface *create(struct yasl_private_display *d, const struct yasl_private_window_spec *spec, void *graphics_device) { (void)d; (void)spec; (void)graphics_device; creates++; return NULL; } @@ -260,7 +260,7 @@ static void test_native(void) static void test_validation(void) { const struct yasl_private_backend_ops ops = {.surface_present = present, - .display_caps = caps, .display_copy = copy, .display_paste = paste, + .display_caps = caps, .display_copy_text = copy, .display_request_paste = paste, .surface_create_toplevel = create}; struct yasl_private_display d = {.ops = &ops}; struct yasl_surface s = {.display = &d, .frame_generation = 1}; @@ -293,14 +293,16 @@ static void test_validation(void) assert(yasl_private_surface_present(&s, &fb, &damage) && received.n == -1); damage.n = 0; assert(yasl_private_surface_present(&s, &fb, &damage) && received.n == 0); - yasl_private_display_copy(&d, YASL_PRIVATE_PRIMARY, "no alias"); - yasl_private_display_copy(&d, (enum yasl_private_selection)255, "invalid"); - yasl_private_display_paste(&d, YASL_PRIVATE_PRIMARY, &s); - yasl_private_display_paste(&d, (enum yasl_private_selection)255, &s); + assert(yasl_private_events_open(&d)); + yasl_private_clipboard_set(&d, YASL_PRIVATE_PRIMARY, "no alias"); + yasl_private_clipboard_set(&d, (enum yasl_private_selection)255, "invalid"); + yasl_private_clipboard_request(&s, YASL_PRIVATE_PRIMARY); + yasl_private_clipboard_request(&s, (enum yasl_private_selection)255); assert(!copies && !pastes); - yasl_private_display_copy(&d, YASL_PRIVATE_CLIPBOARD, "yes"); - yasl_private_display_paste(&d, YASL_PRIVATE_CLIPBOARD, &s); + yasl_private_clipboard_set(&d, YASL_PRIVATE_CLIPBOARD, "yes"); + yasl_private_clipboard_request(&s, YASL_PRIVATE_CLIPBOARD); assert(copies == 1 && pastes == 1); + yasl_private_events_close(&d); struct yasl_private_window_spec spec = {.size = {100, 80}}; assert(!yasl_private_surface_create_native(&d, &spec, &d) && errno == ENOTSUP); assert(!yasl_private_surface_create_native(&d, &spec, NULL) && errno == EINVAL); -- cgit v1.2.3