From c59e88aa6fa60c6f7424da737fcaf0496a0bf3d6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 22 May 2022 17:48:16 -0400 Subject: Add API support for multiple clipboards Adds a PuglClipboard enum, and uses it everywhere necessary to "structurally" support multiple clipboards. Towards re-using this API to support DnD. --- test/test_remote_copy_paste.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/test_remote_copy_paste.c') diff --git a/test/test_remote_copy_paste.c b/test/test_remote_copy_paste.c index 8e2b752..de5a61b 100644 --- a/test/test_remote_copy_paste.c +++ b/test/test_remote_copy_paste.c @@ -60,8 +60,11 @@ onCopierEvent(PuglView* const view, const PuglEvent* const event) assert(event->timer.id == copierTimerId); if (test->state < COPIED) { - puglSetClipboard( - view, "text/plain", "Copied Text", strlen("Copied Text") + 1); + puglSetClipboard(view, + PUGL_CLIPBOARD_GENERAL, + "text/plain", + "Copied Text", + strlen("Copied Text") + 1); test->state = COPIED; } @@ -111,8 +114,9 @@ onPasterEvent(PuglView* const view, const PuglEvent* const event) case PUGL_DATA: if (test->state == RECEIVED_OFFER) { - size_t len = 0; - const char* text = (const char*)puglGetClipboard(view, 0, &len); + size_t len = 0; + const char* text = + (const char*)puglGetClipboard(view, PUGL_CLIPBOARD_GENERAL, 0, &len); // Check that the offered data is what we copied earlier assert(text); -- cgit v1.2.1