aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-08-17 20:50:20 +0200
committerDavid Robillard <d@drobilla.net>2019-09-07 09:51:48 +0200
commit7162fa4f5656ad7dfe2d6fea02f9f33c5aa1b1cf (patch)
tree0f885354b2d75875003401379d5aaf9aadda226f /pugl/pugl.h
parent27e43183d89aad98f6000ee187b05547776ae4c2 (diff)
downloadpugl-7162fa4f5656ad7dfe2d6fea02f9f33c5aa1b1cf.tar.gz
pugl-7162fa4f5656ad7dfe2d6fea02f9f33c5aa1b1cf.tar.bz2
pugl-7162fa4f5656ad7dfe2d6fea02f9f33c5aa1b1cf.zip
Add clipboard support
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r--pugl/pugl.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 4182225..580e9dc 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -22,6 +22,7 @@
#define PUGL_H_INCLUDED
#include <stdbool.h>
+#include <stddef.h>
#include <stdint.h>
#ifdef PUGL_SHARED
@@ -85,6 +86,7 @@ typedef enum {
PUGL_ERR_CREATE_WINDOW,
PUGL_ERR_SET_FORMAT,
PUGL_ERR_CREATE_CONTEXT,
+ PUGL_ERR_UNSUPPORTED_TYPE,
} PuglStatus;
/**
@@ -761,6 +763,31 @@ PUGL_API PuglStatus
puglGrabFocus(PuglView* view);
/**
+ Get clipboard contents.
+
+ @param view The view.
+ @param[out] type Set to the MIME type of the data.
+ @param[out] len Set to the length of the data in bytes.
+ @return The clipboard contents.
+*/
+PUGL_API const void*
+puglGetClipboard(PuglView* view, const char** type, size_t* len);
+
+/**
+ Set clipboard contents.
+
+ @param view The view.
+ @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);
+
+/**
Request user attention.
This hints to the system that the window or application requires attention