diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-23 14:02:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 14:02:39 -0500 |
commit | e8a35a84ba2118936e6a4b5dbcd7872d320216e4 (patch) | |
tree | ee9b14fedffed2871b5317220bde365d69d98b01 /include | |
parent | 0a370c529806077a11638e7fa856d5fbb539496b (diff) | |
parent | d4d860666cc2dd10a105fadd33aad2f682139a6e (diff) |
Merge pull request #509 from emersion/primary-selection
Add gtk-primary-selection protocol
Diffstat (limited to 'include')
-rw-r--r-- | include/rootston/desktop.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_primary_selection.h | 53 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 6 |
3 files changed, 61 insertions, 0 deletions
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index e5c5f806..289875c5 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -9,6 +9,7 @@ #include <wlr/types/wlr_xdg_shell_v6.h> #include <wlr/types/wlr_xcursor_manager.h> #include <wlr/types/wlr_gamma_control.h> +#include <wlr/types/wlr_primary_selection.h> #include <wlr/types/wlr_screenshooter.h> #include <wlr/types/wlr_list.h> #include "rootston/view.h" @@ -41,6 +42,7 @@ struct roots_desktop { struct wlr_gamma_control_manager *gamma_control_manager; struct wlr_screenshooter *screenshooter; struct wlr_server_decoration_manager *server_decoration_manager; + struct wlr_primary_selection_device_manager *primary_selection_device_manager; struct wl_listener output_add; struct wl_listener output_remove; diff --git a/include/wlr/types/wlr_primary_selection.h b/include/wlr/types/wlr_primary_selection.h new file mode 100644 index 00000000..a639b913 --- /dev/null +++ b/include/wlr/types/wlr_primary_selection.h @@ -0,0 +1,53 @@ +#ifndef WLR_TYPES_WLR_PRIMARY_SELECTION_H +#define WLR_TYPES_WLR_PRIMARY_SELECTION_H + +#include <wlr/types/wlr_seat.h> +#include <wayland-server.h> + +struct wlr_primary_selection_device_manager { + struct wl_global *global; + + struct wl_listener display_destroy; + + void *data; +}; + +struct wlr_primary_selection_offer; + +struct wlr_primary_selection_source { + struct wl_resource *resource; + struct wlr_primary_selection_offer *offer; + struct wlr_seat_client *seat_client; + + struct wl_array mime_types; + + void (*send)(struct wlr_primary_selection_source *source, + const char *mime_type, int32_t fd); + void (*cancel)(struct wlr_primary_selection_source *source); + + struct { + struct wl_signal destroy; + } events; + + void *data; +}; + +struct wlr_primary_selection_offer { + struct wl_resource *resource; + struct wlr_primary_selection_source *source; + + struct wl_listener source_destroy; + + void *data; +}; + +struct wlr_primary_selection_device_manager * + wlr_primary_selection_device_manager_create(struct wl_display *display); +void wlr_primary_selection_device_manager_destroy( + struct wlr_primary_selection_device_manager *manager); + +void wlr_seat_client_send_primary_selection(struct wlr_seat_client *seat_client); +void wlr_seat_set_primary_selection(struct wlr_seat *seat, + struct wlr_primary_selection_source *source, uint32_t serial); + +#endif diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index dea9a9d0..28e9a615 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -21,6 +21,7 @@ struct wlr_seat_client { struct wl_list keyboards; struct wl_list touches; struct wl_list data_devices; + struct wl_list primary_selection_devices; struct { struct wl_signal destroy; @@ -181,12 +182,16 @@ struct wlr_seat { struct wlr_data_source *selection_source; uint32_t selection_serial; + struct wlr_primary_selection_source *primary_selection_source; + uint32_t primary_selection_serial; + struct wlr_seat_pointer_state pointer_state; struct wlr_seat_keyboard_state keyboard_state; struct wlr_seat_touch_state touch_state; struct wl_listener display_destroy; struct wl_listener selection_data_source_destroy; + struct wl_listener primary_selection_source_destroy; struct { struct wl_signal pointer_grab_begin; @@ -201,6 +206,7 @@ struct wlr_seat { struct wl_signal request_set_cursor; struct wl_signal selection; + struct wl_signal primary_selection; } events; void *data; |