diff options
Diffstat (limited to 'include/pugl')
-rw-r--r-- | include/pugl/pugl.h | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 329acba..852003f 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -148,6 +148,16 @@ typedef enum { PUGL_CROSSING_UNGRAB ///< Crossing due to a grab release } PuglCrossingMode; +/** + A system clipboard. + + A clipboard provides a mechanism for transferring data between views, + including views in different processes. +*/ +typedef enum { + PUGL_CLIPBOARD_GENERAL, ///< General clipboard for copy/pasted data +} PuglClipboard; + /// Common header for all event structs typedef struct { PuglEventType type; ///< Event type @@ -649,11 +659,12 @@ typedef struct { puglAcceptOffer(). */ typedef struct { - PuglEventType type; ///< #PUGL_DATA_OFFER - PuglEventFlags flags; ///< Bitwise OR of #PuglEventFlag values - double time; ///< Time in seconds - double x; ///< View-relative X coordinate - double y; ///< View-relative Y coordinate + PuglEventType type; ///< #PUGL_DATA_OFFER + PuglEventFlags flags; ///< Bitwise OR of #PuglEventFlag values + double time; ///< Time in seconds + double x; ///< View-relative X coordinate + double y; ///< View-relative Y coordinate + PuglClipboard clipboard; ///< Clipboard with available data } PuglDataOfferEvent; /** @@ -669,6 +680,7 @@ typedef struct { double time; ///< Time in seconds double x; ///< View-relative X coordinate double y; ///< View-relative Y coordinate + PuglClipboard clipboard; ///< Clipboard with available data uint32_t typeIndex; ///< Index of datatype } PuglDataEvent; @@ -1495,7 +1507,7 @@ puglPaste(PuglView* view); */ PUGL_API uint32_t -puglGetNumClipboardTypes(const PuglView* view); +puglGetNumClipboardTypes(const PuglView* view, PuglClipboard clipboard); /** Return the identifier of a type available in a clipboard. @@ -1508,7 +1520,9 @@ puglGetNumClipboardTypes(const PuglView* view); */ PUGL_API const char* -puglGetClipboardType(const PuglView* view, uint32_t typeIndex); +puglGetClipboardType(const PuglView* view, + PuglClipboard clipboard, + uint32_t typeIndex); /** Accept data offered from a clipboard. @@ -1543,16 +1557,18 @@ puglAcceptOffer(PuglView* view, puglGetClipboard() or pasted into other applications. @param view The view. + @param clipboard Clipboard to set data for. @param type The MIME type of the data, "text/plain" is assumed if `NULL`. @param data The data to copy to the clipboard. @param len The length of data in bytes (including terminator if necessary). */ PUGL_API PuglStatus -puglSetClipboard(PuglView* view, - const char* type, - const void* data, - size_t len); +puglSetClipboard(PuglView* view, + PuglClipboard clipboard, + const char* type, + const void* data, + size_t len); /** Get the clipboard contents. @@ -1561,13 +1577,17 @@ puglSetClipboard(PuglView* view, puglSetClipboard() or copied from another application. @param view The view. + @param clipboard Clipboard to get data from. @param typeIndex Index of the data type to get the item as. @param[out] len Set to the length of the data in bytes. @return The clipboard contents, or null. */ PUGL_API const void* -puglGetClipboard(PuglView* view, uint32_t typeIndex, size_t* len); +puglGetClipboard(PuglView* view, + PuglClipboard clipboard, + uint32_t typeIndex, + size_t* len); /** Set the mouse cursor. |