From be22fefdc73c8b2ca8375a1b3f19c8d05de18e24 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 28 Oct 2020 19:16:04 +0100 Subject: selection: add support for different mime-types Add support for `text/plain`, `text/plain;charset=utf-8` and `text/uri-list` to regular copy operations (both from clipboard and primary selection) and drag-and-drop operations. --- wayland.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'wayland.h') diff --git a/wayland.h b/wayland.h index bf3db76c..98830d8f 100644 --- a/wayland.h +++ b/wayland.h @@ -101,9 +101,20 @@ struct key_binding_search { enum bind_action_search action; }; +/* Mime-types we support when dealing with data offers (e.g. copy-paste, or DnD) */ +enum data_offer_mime_type { + DATA_OFFER_MIME_UNSET, + DATA_OFFER_MIME_TEXT_PLAIN, + DATA_OFFER_MIME_TEXT_UTF8, + DATA_OFFER_MIME_URI_LIST, +}; + +struct wl_window; struct wl_clipboard { + struct wl_window *window; /* For DnD */ struct wl_data_source *data_source; struct wl_data_offer *data_offer; + enum data_offer_mime_type mime_type; char *text; uint32_t serial; }; @@ -111,6 +122,7 @@ struct wl_clipboard { struct wl_primary { struct zwp_primary_selection_source_v1 *data_source; struct zwp_primary_selection_offer_v1 *data_offer; + enum data_offer_mime_type mime_type; char *text; uint32_t serial; }; @@ -205,9 +217,6 @@ struct seat { struct wl_clipboard clipboard; struct wl_primary primary; - - /* Drag ‘n’ drop */ - struct terminal *dnd_term; }; enum csd_surface { @@ -312,8 +321,6 @@ struct wl_window { struct wl_callback *frame_callback; - struct wl_data_offer *dnd_offer; - tll(const struct monitor *) on_outputs; /* Outputs we're mapped on */ bool is_configured; -- cgit v1.3