aboutsummaryrefslogtreecommitdiff
path: root/subprojects/d2tk/src/frontend_pugl.c
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/d2tk/src/frontend_pugl.c')
-rw-r--r--subprojects/d2tk/src/frontend_pugl.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/subprojects/d2tk/src/frontend_pugl.c b/subprojects/d2tk/src/frontend_pugl.c
index b607a6e..3473984 100644
--- a/subprojects/d2tk/src/frontend_pugl.c
+++ b/subprojects/d2tk/src/frontend_pugl.c
@@ -486,6 +486,32 @@ d2tk_frontend_poll(d2tk_frontend_t *dpugl, double timeout)
}
D2TK_API int
+d2tk_frontend_get_file_descriptors(d2tk_frontend_t *dpugl, int *fds, int numfds)
+{
+ int idx = 0;
+
+#if defined(__APPLE__) || de
+ //FIXME
+ (void)dpugl;
+ return -1;
+#elif defined(_WIN32)
+ //FIXME
+ (void)dpugl;
+ return -1;
+#else
+ Display *disp = puglGetNativeWorld(dpugl->world);
+ const int fd = disp ? ConnectionNumber(disp) : 0;
+
+ if( (fd > 0) && (idx < numfds) )
+ {
+ fds[idx++] = fd;
+ }
+#endif
+
+ return idx + d2tk_base_get_file_descriptors(dpugl->base, &fds[idx], numfds-idx);
+}
+
+D2TK_API int
d2tk_frontend_step(d2tk_frontend_t *dpugl)
{
return d2tk_frontend_poll(dpugl, 0.0);
@@ -707,3 +733,17 @@ d2tk_frontend_get_base(d2tk_frontend_t *dpugl)
{
return dpugl->base;
}
+
+D2TK_API int
+d2tk_frontend_set_clipboard(d2tk_frontend_t *dpugl, const char *type,
+ const void *buf, size_t buf_len)
+{
+ return puglSetClipboard(dpugl->view, type, buf, buf_len);
+}
+
+D2TK_API const void *
+d2tk_frontend_get_clipboard(d2tk_frontend_t *dpugl, const char **type,
+ size_t *buf_len)
+{
+ return puglGetClipboard(dpugl->view, type, buf_len);
+}