aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-18 14:05:51 -0400
committerGitHub <noreply@github.com>2017-08-18 14:05:51 -0400
commita1551bccc05caeb77ee7ce5e4151de964f29f444 (patch)
tree44f96d69d6d9c16645c1e28b5d1b937fc4e93aa1 /include/wlr
parent7d3f66eaa0aa48a1e1c289f33b6f0d1fdd29bcd5 (diff)
parentf2a90986919febd6d6a47e044ca7f1842980c5e9 (diff)
Merge pull request #107 from nyorain/wlr_data_device_manager
Implement wlr_data_{source,device,device_manager}
Diffstat (limited to 'include/wlr')
-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;