aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-11 15:48:40 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-15 05:59:52 -0400
commit6a7560fae05147ac5a1ac0dd3474670f1bd6c871 (patch)
treeb3cc7127ba2a6c8c526bf5d9267b71d70da239b3 /include
parent2b09105bde84ef52ed8f683782dbf2091dcccb08 (diff)
wlr-data-device interface
Diffstat (limited to 'include')
-rw-r--r--include/rootston/server.h2
-rw-r--r--include/wlr/interfaces/wlr_data_source.h16
-rw-r--r--include/wlr/types/wlr_data_device.h31
-rw-r--r--include/wlr/types/wlr_data_device_manager.h26
-rw-r--r--include/wlr/types/wlr_data_source.h32
-rw-r--r--include/wlr/types/wlr_seat.h5
6 files changed, 36 insertions, 76 deletions
diff --git a/include/rootston/server.h b/include/rootston/server.h
index a4eacb7f..8fc6530e 100644
--- a/include/rootston/server.h
+++ b/include/rootston/server.h
@@ -3,7 +3,7 @@
#include <wayland-server.h>
#include <wlr/backend.h>
#include <wlr/backend/session.h>
-#include <wlr/types/wlr_data_device_manager.h>
+#include <wlr/types/wlr_data_device.h>
#include <wlr/render.h>
#ifdef HAS_XWAYLAND
#include <wlr/xwayland.h>
diff --git a/include/wlr/interfaces/wlr_data_source.h b/include/wlr/interfaces/wlr_data_source.h
deleted file mode 100644
index 821bdea0..00000000
--- a/include/wlr/interfaces/wlr_data_source.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef WLR_INTERFACES_WLR_DATA_SOURCE_H
-#define WLR_INTERFACES_WLR_DATA_SOURCE_H
-
-#include <wlr/types/wlr_data_source.h>
-
-struct wlr_data_source_impl {
- void (*send)(struct wlr_data_source *data_source, const char *type, int fd);
- void (*accepted)(struct wlr_data_source *data_source, const char *type);
- void (*cancelled)(struct wlr_data_source *data_source);
-};
-
-bool wlr_data_source_init(struct wlr_data_source *source,
- struct wlr_data_source_impl *impl);
-void wlr_data_source_finish(struct wlr_data_source *source);
-
-#endif
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h
new file mode 100644
index 00000000..38d1467c
--- /dev/null
+++ b/include/wlr/types/wlr_data_device.h
@@ -0,0 +1,31 @@
+#ifndef WLR_TYPES_WLR_DATA_DEVICE_H
+#define WLR_TYPES_WLR_DATA_DEVICE_H
+
+#include <wayland-server.h>
+
+struct wlr_data_device_manager {
+ struct wl_global *global;
+};
+
+struct wlr_data_offer {
+ struct wl_resource *resource;
+};
+
+struct wlr_data_source {
+ struct wl_resource *resource;
+ struct wlr_data_offer *offer;
+ struct wlr_seat_handle *seat;
+ struct wl_array mime_types;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+};
+
+/**
+ * Create a wl data device manager global for this display.
+ */
+struct wlr_data_device_manager *wlr_data_device_manager_create(
+ struct wl_display *display);
+
+#endif
diff --git a/include/wlr/types/wlr_data_device_manager.h b/include/wlr/types/wlr_data_device_manager.h
deleted file mode 100644
index 500f8acd..00000000
--- a/include/wlr/types/wlr_data_device_manager.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef WLR_TYPES_WLR_DATA_DEVICE_MANAGER_H
-#define WLR_TYPES_WLR_DATA_DEVICE_MANAGER_H
-
-#include <wayland-server.h>
-
-struct wlr_data_device_manager {
- struct wl_global *global;
-};
-
-struct wlr_data_device_manager *wlr_data_device_manager_create(struct wl_display *dpy);
-void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager);
-
-struct wlr_data_device {
- struct wlr_seat *seat;
- struct wlr_data_source *selection;
- struct wl_listener selection_destroyed;
-
- struct {
- struct wl_signal selection_change;
- } events;
-};
-
-void wlr_data_device_set_selection(struct wlr_data_device *manager,
- struct wlr_data_source *source);
-
-#endif
diff --git a/include/wlr/types/wlr_data_source.h b/include/wlr/types/wlr_data_source.h
deleted file mode 100644
index 19834cb6..00000000
--- a/include/wlr/types/wlr_data_source.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef WLR_TYPES_WLR_DATA_SOURCE_H
-#define WLR_TYPES_WLR_DATA_SOURCE_H
-
-#include <wayland-server.h>
-#include <wlr/util/list.h>
-
-struct wlr_data_source_impl;
-
-struct wlr_data_source {
- struct wlr_data_source_impl *impl;
- list_t *types;
- void *data;
-
- struct {
- struct wl_signal destroy;
- } events;
-};
-
-void wlr_data_source_send(struct wlr_data_source *src, const char *type, int fd);
-void wlr_data_source_accepted(struct wlr_data_source *src, const char *type);
-void wlr_data_source_cancelled(struct wlr_data_source *src);
-
-struct wlr_wl_data_source {
- struct wlr_data_source base;
- struct wl_resource *resource;
-};
-
-struct wlr_wl_data_source *wlr_wl_data_source_create(
- struct wl_client *client,
- uint32_t version, uint32_t id);
-
-#endif
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index d267924c..c84a1370 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -111,7 +111,10 @@ struct wlr_seat {
struct wl_list keyboards;
char *name;
uint32_t capabilities;
- struct wlr_data_device *data_device;
+
+ struct wlr_data_device *data_device; // TODO needed?
+ struct wlr_data_source *selection_source;
+ uint32_t selection_serial;
struct wlr_seat_pointer_state pointer_state;
struct wlr_seat_keyboard_state keyboard_state;