aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-12-23 14:02:39 -0500
committerGitHub <noreply@github.com>2017-12-23 14:02:39 -0500
commite8a35a84ba2118936e6a4b5dbcd7872d320216e4 (patch)
treeee9b14fedffed2871b5317220bde365d69d98b01 /include/wlr
parent0a370c529806077a11638e7fa856d5fbb539496b (diff)
parentd4d860666cc2dd10a105fadd33aad2f682139a6e (diff)
Merge pull request #509 from emersion/primary-selection
Add gtk-primary-selection protocol
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_primary_selection.h53
-rw-r--r--include/wlr/types/wlr_seat.h6
2 files changed, 59 insertions, 0 deletions
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;