From 91051e9059b67b8d633e385afb48a36d4f9467ba Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 22 May 2022 18:26:35 -0400 Subject: Add action parameter to puglAcceptOffer() --- include/pugl/pugl.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 852003f..e57f6aa 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -158,6 +158,19 @@ typedef enum { PUGL_CLIPBOARD_GENERAL, ///< General clipboard for copy/pasted data } PuglClipboard; +/** + An action that can be performed on data from a clipboard. + + This is given when accepting a data offer, so the system can provide user + feedback, for example by changing the cursor or showing an animation. +*/ +typedef enum { + PUGL_ACTION_COPY, ///< Data will be copied + PUGL_ACTION_LINK, ///< Data will be linked to + PUGL_ACTION_MOVE, ///< Data will be moved + PUGL_ACTION_PRIVATE, ///< Unspecified private action +} PuglAction; + /// Common header for all event structs typedef struct { PuglEventType type; ///< Event type @@ -1540,6 +1553,10 @@ puglGetClipboardType(const PuglView* view, the `typeIndex` argument to the call of puglGetClipboardType() that returned the accepted type. + @param action The action that will be performed on the data. This may be + used to provide visual feedback to the user, for example by changing the + cursor. + @param region The region of the view that will accept the data. This may be used by the system to avoid sending redundant events. */ @@ -1548,6 +1565,7 @@ PuglStatus puglAcceptOffer(PuglView* view, const PuglDataOfferEvent* offer, uint32_t typeIndex, + PuglAction action, PuglRect region); /** -- cgit v1.2.1