From 3892acecac773b825532f84da4671c2a55f5e82a Mon Sep 17 00:00:00 2001
From: Tony Crisci <tony@dubstepdish.com>
Date: Thu, 12 Oct 2017 11:41:11 -0400
Subject: wlr-data-device: basic clipboard

---
 include/wlr/types/wlr_data_device.h | 19 +++++++++++++++++++
 include/wlr/types/wlr_seat.h        |  2 ++
 2 files changed, 21 insertions(+)

(limited to 'include')

diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h
index 38d1467c..5cb839bd 100644
--- a/include/wlr/types/wlr_data_device.h
+++ b/include/wlr/types/wlr_data_device.h
@@ -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
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index c84a1370..88d42112 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -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;
-- 
cgit v1.2.3