aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2017-08-18 18:51:09 +0200
committernyorain <nyorain@gmail.com>2017-08-18 18:56:21 +0200
commit86314caa5b6bd382c7532491d8fc02cafcdf7970 (patch)
tree5385a4f0506099c983f107dc1a2acb092c737e5e /include
parente5fd858394831388ad0677960387ed4a5331df47 (diff)
Implement wlr_data_{source,device,device_manager}
Diffstat (limited to 'include')
-rw-r--r--include/wlr/interfaces/wlr_data_source.h15
-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.h2
4 files changed, 75 insertions, 0 deletions
diff --git a/include/wlr/interfaces/wlr_data_source.h b/include/wlr/interfaces/wlr_data_source.h
new file mode 100644
index 00000000..221c8007
--- /dev/null
+++ b/include/wlr/interfaces/wlr_data_source.h
@@ -0,0 +1,15 @@
+#ifndef _WLR_INTERFACES_DATA_SOURCE_H
+#define _WLR_INTERFACES_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_manager.h b/include/wlr/types/wlr_data_device_manager.h
new file mode 100644
index 00000000..d7ae46c8
--- /dev/null
+++ b/include/wlr/types/wlr_data_device_manager.h
@@ -0,0 +1,26 @@
+#ifndef _WLR_TYPES_DATA_DEVICE_MANAGER_H
+#define _WLR_TYPES_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
new file mode 100644
index 00000000..63b0fe2a
--- /dev/null
+++ b/include/wlr/types/wlr_data_source.h
@@ -0,0 +1,32 @@
+#ifndef _WLR_TYPES_DATA_SOURCE_H
+#define _WLR_TYPES_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 99c09258..69f17b1e 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -14,6 +14,7 @@ struct wlr_seat_handle {
struct wl_resource *pointer;
struct wl_resource *keyboard;
struct wl_resource *touch;
+ struct wl_resource *data_device;
struct wl_list link;
};
@@ -23,6 +24,7 @@ struct wlr_seat {
struct wl_list handles;
char *name;
uint32_t capabilities;
+ struct wlr_data_device *data_device;
struct {
struct wl_signal client_bound;