diff options
author | emersion <contact@emersion.fr> | 2017-12-29 22:51:33 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-12-29 22:51:33 +0100 |
commit | f237b5c7a702a6641de6d49e9b0bd754246283c9 (patch) | |
tree | b1808ba0955cd4174cdef1bb13a03ea7b5ad0bfe /include | |
parent | 80ed4d4d20807f021c473b77d44ce6b464afc0c7 (diff) |
Make wlr_data_source abstract.
This removes some fields specific to sources coming from clients.
This adds some drag'n'drop-related callbacks.
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_data_device.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h index 92d15972..54514b4c 100644 --- a/include/wlr/types/wlr_data_device.h +++ b/include/wlr/types/wlr_data_device.h @@ -23,33 +23,39 @@ struct wlr_data_offer { struct wl_resource *resource; struct wlr_data_source *source; - uint32_t dnd_actions; - enum wl_data_device_manager_dnd_action preferred_dnd_action; + uint32_t actions; + enum wl_data_device_manager_dnd_action preferred_action; bool in_ask; struct wl_listener source_destroy; }; struct wlr_data_source { - struct wl_resource *resource; - struct wlr_data_offer *offer; - struct wlr_seat_client *seat_client; - + // source metadata struct wl_array mime_types; + int32_t actions; + + // source implementation + void (*send)(struct wlr_data_source *source, const char *mime_type, + int32_t fd); + void (*accept)(struct wlr_data_source *source, uint32_t serial, + const char *mime_type); + void (*cancel)(struct wlr_data_source *source); + // drag'n'drop implementation + void (*dnd_drop)(struct wlr_data_source *source); + void (*dnd_finish)(struct wlr_data_source *source); + void (*dnd_action)(struct wlr_data_source *source, + enum wl_data_device_manager_dnd_action action); + + // source status bool accepted; + struct wlr_data_offer *offer; + struct wlr_seat_client *seat_client; - // drag and drop + // drag'n'drop status enum wl_data_device_manager_dnd_action current_dnd_action; - uint32_t dnd_actions; uint32_t compositor_action; - bool actions_set; - - void (*accept)(struct wlr_data_source *source, uint32_t serial, - const char *mime_type); - void (*send)(struct wlr_data_source *source, const char *mime_type, - int32_t fd); - void (*cancel)(struct wlr_data_source *source); struct { struct wl_signal destroy; |