aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-22 22:22:29 +0100
committeremersion <contact@emersion.fr>2017-12-22 22:22:29 +0100
commita95d09d56181fe9bd639239b723942c5a333a245 (patch)
tree49ec4e6bd7bddb5012af2ca8750bdcd31a22d30b /include
parent0a171d3acec825b5a9115907b339dc29aec678fa (diff)
Add missing gtk-primary-selection interfaces
Diffstat (limited to 'include')
-rw-r--r--include/rootston/desktop.h2
-rw-r--r--include/wlr/types/wlr_primary_selection.h23
-rw-r--r--include/wlr/types/wlr_seat.h6
3 files changed, 31 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
index edbaf81e..e69feb89 100644
--- a/include/wlr/types/wlr_primary_selection.h
+++ b/include/wlr/types/wlr_primary_selection.h
@@ -1,6 +1,7 @@
#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 {
@@ -11,10 +12,21 @@ struct wlr_primary_selection_device_manager {
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;
+ bool accepted;
+
+ void (*accept)(struct wlr_primary_selection_source *source, uint32_t serial,
+ const char *mime_type);
+ 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;
@@ -23,9 +35,20 @@ struct wlr_primary_selection_source {
void *data;
};
+struct wlr_primary_selection_offer {
+ struct wl_resource *resource;
+ struct wlr_primary_selection_source *source;
+
+ struct wl_listener source_destroy;
+};
+
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;