aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_remote_copy_paste.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-22 17:48:16 -0400
committerDavid Robillard <d@drobilla.net>2023-11-11 09:49:51 -0500
commitc59e88aa6fa60c6f7424da737fcaf0496a0bf3d6 (patch)
treeca5e6f85207f3f51bd3015a67c23d9dd0c917846 /test/test_remote_copy_paste.c
parent32733abab8546b708cab59a4df09f92eb3214f73 (diff)
downloadpugl-c59e88aa6fa60c6f7424da737fcaf0496a0bf3d6.tar.gz
pugl-c59e88aa6fa60c6f7424da737fcaf0496a0bf3d6.tar.bz2
pugl-c59e88aa6fa60c6f7424da737fcaf0496a0bf3d6.zip
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.
Diffstat (limited to 'test/test_remote_copy_paste.c')
-rw-r--r--test/test_remote_copy_paste.c12
1 files changed, 8 insertions, 4 deletions
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);