diff options
author | David Robillard <d@drobilla.net> | 2022-05-22 20:24:05 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-11-11 09:47:23 -0500 |
commit | 32733abab8546b708cab59a4df09f92eb3214f73 (patch) | |
tree | b6bed60281f9dd3b71006b7cb7aa7ab056d6a70c /src | |
parent | 61980dbb9e6968f9d99df9cbd4bbe2f46f0c5050 (diff) | |
download | pugl-32733abab8546b708cab59a4df09f92eb3214f73.tar.gz pugl-32733abab8546b708cab59a4df09f92eb3214f73.tar.bz2 pugl-32733abab8546b708cab59a4df09f92eb3214f73.zip |
Add region parameter to puglAcceptOffer()
Diffstat (limited to 'src')
-rw-r--r-- | src/mac.m | 13 | ||||
-rw-r--r-- | src/win.c | 7 | ||||
-rw-r--r-- | src/x11.c | 14 |
3 files changed, 25 insertions, 9 deletions
@@ -1913,8 +1913,9 @@ puglGetClipboardType(const PuglView* PUGL_UNUSED(view), PuglStatus puglAcceptOffer(PuglView* const view, - const PuglDataOfferEvent* const PUGL_UNUSED(offer), - const uint32_t typeIndex) + const PuglDataOfferEvent* const offer, + const uint32_t typeIndex, + const PuglRect region) { PuglWrapperView* const wrapper = view->impl->wrapperView; NSPasteboard* const pasteboard = [NSPasteboard generalPasteboard]; @@ -1930,8 +1931,12 @@ puglAcceptOffer(PuglView* const view, wrapper->dragOperation = NSDragOperationCopy; wrapper->dragTypeIndex = typeIndex; - const PuglDataEvent data = { - PUGL_DATA, 0U, puglGetTime(view->world), (uint32_t)typeIndex}; + const PuglDataEvent data = {PUGL_DATA, + 0U, + puglGetTime(view->world), + (double)region.x, + (double)region.y, + (uint32_t)typeIndex}; PuglEvent dataEvent; dataEvent.data = data; @@ -1365,7 +1365,8 @@ puglGetClipboardType(const PuglView* const PUGL_UNUSED(view), PuglStatus puglAcceptOffer(PuglView* const view, const PuglDataOfferEvent* const PUGL_UNUSED(offer), - const uint32_t typeIndex) + const uint32_t typeIndex, + const PuglRect region) { if (typeIndex != 0) { return PUGL_UNSUPPORTED; @@ -1375,6 +1376,8 @@ puglAcceptOffer(PuglView* const view, PUGL_DATA, 0, GetMessageTime() / 1e3, + (double)region.x, + (double)region.y, 0, }; @@ -1469,6 +1472,8 @@ puglPaste(PuglView* const view) PUGL_DATA_OFFER, 0, GetMessageTime() / 1e3, + 0.0, + 0.0, }; PuglEvent offerEvent; @@ -1618,7 +1618,7 @@ handleSelectionNotify(const PuglWorld* const world, view, event->requestor, event->property, &numFormats, &formats) && !setClipboardFormats(view, board, numFormats, formats)) { const PuglDataOfferEvent offer = { - PUGL_DATA_OFFER, 0, (double)event->time / 1e3}; + PUGL_DATA_OFFER, 0, (double)event->time / 1e3, 0.0, 0.0}; puglEvent.offer = offer; board->acceptedFormatIndex = UINT32_MAX; @@ -1635,8 +1635,12 @@ handleSelectionNotify(const PuglWorld* const world, world, view, event->property, event->target, &board->data)) { board->source = XGetSelectionOwner(display, board->selection); - const PuglDataEvent data = { - PUGL_DATA, 0U, (double)event->time / 1e3, board->acceptedFormatIndex}; + const PuglDataEvent data = {PUGL_DATA, + 0U, + (double)event->time / 1e3, + 0.0, + 0.0, + board->acceptedFormatIndex}; puglEvent.data = data; } @@ -2092,9 +2096,11 @@ puglGetClipboard(PuglView* const view, PuglStatus puglAcceptOffer(PuglView* const view, const PuglDataOfferEvent* const offer, - const uint32_t typeIndex) + const uint32_t typeIndex, + const PuglRect region) { (void)offer; + (void)region; PuglInternals* const impl = view->impl; Display* const display = view->world->impl->display; |