aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-22 12:24:59 -0400
committerDavid Robillard <d@drobilla.net>2022-05-23 16:50:43 -0400
commit2501218801437ea413091007b535d7c097801713 (patch)
treecf938dd335f8aa9b547b458f97f05e7e18d8b9d3 /src/x11.h
parent0093196a4c624da6d7f78a909a442f2e784c37aa (diff)
downloadpugl-2501218801437ea413091007b535d7c097801713.tar.gz
pugl-2501218801437ea413091007b535d7c097801713.tar.bz2
pugl-2501218801437ea413091007b535d7c097801713.zip
Add rich clipboard support
This implements a more powerful protocol for working with clipboards, which supports datatype negotiation, and fixes various issues by mapping more directly to how things work on X11.
Diffstat (limited to 'src/x11.h')
-rw-r--r--src/x11.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/x11.h b/src/x11.h
index 1be54ad..27cfb73 100644
--- a/src/x11.h
+++ b/src/x11.h
@@ -27,6 +27,8 @@ typedef struct {
Atom NET_WM_STATE;
Atom NET_WM_STATE_DEMANDS_ATTENTION;
Atom NET_WM_STATE_HIDDEN;
+ Atom TARGETS;
+ Atom text_uri_list;
} PuglX11Atoms;
typedef struct {
@@ -35,6 +37,18 @@ typedef struct {
uintptr_t id;
} PuglTimer;
+typedef struct {
+ Atom selection;
+ Atom property;
+ Window source;
+ Atom* formats;
+ char** formatStrings;
+ unsigned long numFormats;
+ uint32_t acceptedFormatIndex;
+ Atom acceptedFormat;
+ PuglBlob data;
+} PuglX11Clipboard;
+
struct PuglWorldInternalsImpl {
Display* display;
PuglX11Atoms atoms;
@@ -49,14 +63,15 @@ struct PuglWorldInternalsImpl {
};
struct PuglInternalsImpl {
- XVisualInfo* vi;
- Window win;
- XIC xic;
- PuglSurface* surface;
- PuglEvent pendingConfigure;
- PuglEvent pendingExpose;
- int screen;
- const char* cursorName;
+ XVisualInfo* vi;
+ Window win;
+ XIC xic;
+ PuglSurface* surface;
+ PuglEvent pendingConfigure;
+ PuglEvent pendingExpose;
+ PuglX11Clipboard clipboard;
+ int screen;
+ const char* cursorName;
};
PUGL_WARN_UNUSED_RESULT