wlr-data-device: basic clipboard

This commit is contained in:
Tony Crisci 2017-10-12 11:41:11 -04:00
parent 6a7560fae0
commit 3892acecac
4 changed files with 206 additions and 9 deletions

View file

@ -9,6 +9,9 @@ struct wlr_data_device_manager {
struct wlr_data_offer {
struct wl_resource *resource;
struct wlr_data_source *source;
struct wl_listener source_destroy;
};
struct wlr_data_source {
@ -17,6 +20,11 @@ struct wlr_data_source {
struct wlr_seat_handle *seat;
struct wl_array mime_types;
bool accepted;
// TODO
//bool actions_set;
struct {
struct wl_signal destroy;
} events;
@ -28,4 +36,15 @@ struct wlr_data_source {
struct wlr_data_device_manager *wlr_data_device_manager_create(
struct wl_display *display);
/**
* Creates a new wl_data_offer if there is a wl_data_source currently set as the
* seat selection and sends it to the client for this handle, followed by the
* wl_data_device.selection() event.
* If there is no current selection, the wl_data_device.selection() event will
* carry a NULL wl_data_offer.
* If the client does not have a wl_data_device for the seat nothing * will be
* done.
*/
void wlr_seat_handle_send_selection(struct wlr_seat_handle *handle);
#endif

View file

@ -119,6 +119,8 @@ struct wlr_seat {
struct wlr_seat_pointer_state pointer_state;
struct wlr_seat_keyboard_state keyboard_state;
struct wl_listener selection_data_source_destroy;
struct {
struct wl_signal client_bound;
struct wl_signal client_unbound;