summaryrefslogtreecommitdiff
path: root/src/wayland/clipboard.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-11 21:53:42 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-11 21:53:42 +0300
commit927ae621c9a3d46dbc401b8e9ea7bbed1bf2e97b (patch)
treeaeb00c16770dcf5a36d28c1167cc39c6759059fb /src/wayland/clipboard.h
initial: Yet Another Surface Library (YASL) 0.1.0
A minimal, modern desktop window surface library in C. Supports Wayland on Linux and Cocoa/Metal on macOS with presentation timing, fractional scaling, IME, and CSD.
Diffstat (limited to 'src/wayland/clipboard.h')
-rw-r--r--src/wayland/clipboard.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/wayland/clipboard.h b/src/wayland/clipboard.h
new file mode 100644
index 0000000..6ea75c6
--- /dev/null
+++ b/src/wayland/clipboard.h
@@ -0,0 +1,41 @@
+#ifndef YASL_WAYLAND_CLIPBOARD_H
+#define YASL_WAYLAND_CLIPBOARD_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include "yasl/yasl.h"
+
+struct wl_display;
+struct wl_data_device_manager;
+struct wl_seat;
+struct wl_surface;
+struct wl_data_device;
+struct clipboard;
+struct zwp_primary_selection_device_manager_v1;
+
+typedef void (*clipboard_receive_fn)(const char *, size_t, bool uri_list,
+ struct wl_surface *on, void *);
+
+struct clipboard *clipboard_create(struct wl_display *, struct wl_data_device_manager *,
+ struct wl_seat *, struct yasl_loop *,
+ clipboard_receive_fn, void *);
+void clipboard_destroy(struct clipboard *);
+bool clipboard_set_seat(struct clipboard *, struct wl_seat *);
+void clipboard_set_primary_manager(struct clipboard *, struct zwp_primary_selection_device_manager_v1 *);
+void clipboard_copy(struct clipboard *, const char *, uint32_t);
+void clipboard_paste(struct clipboard *);
+void clipboard_copy_primary(struct clipboard *, const char *, uint32_t);
+void clipboard_paste_primary(struct clipboard *);
+
+typedef void (*clipboard_drag_fn)(enum yasl_drag_event, struct wl_surface *on,
+ double x, double y, void *);
+void clipboard_set_drag_handler(struct clipboard *, clipboard_drag_fn, void *);
+
+typedef void (*clipboard_drop_fn)(enum yasl_drop_event, struct wl_surface *on,
+ double x, double y, void *);
+void clipboard_set_drop_handler(struct clipboard *, clipboard_drop_fn, void *);
+const char *clipboard_drag_mime(void);
+struct wl_data_device *clipboard_data_device(const struct clipboard *);
+
+#endif