From c059e3aa7f93da470f052a5cd8ee0d8dc969e679 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 13:44:13 +0300 Subject: rename and simplification --- src/platform/wayland/clipboard.h | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/platform/wayland/clipboard.h (limited to 'src/platform/wayland/clipboard.h') diff --git a/src/platform/wayland/clipboard.h b/src/platform/wayland/clipboard.h new file mode 100644 index 0000000..9fefa8e --- /dev/null +++ b/src/platform/wayland/clipboard.h @@ -0,0 +1,42 @@ +#ifndef YASL_WAYLAND_CLIPBOARD_H +#define YASL_WAYLAND_CLIPBOARD_H + +#include +#include +#include +#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 *, struct wl_surface *target); +void clipboard_forget_surface(struct clipboard *, struct wl_surface *); +void clipboard_copy_primary(struct clipboard *, const char *, uint32_t); +void clipboard_paste_primary(struct clipboard *, struct wl_surface *target); + +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 -- cgit v1.2.3