aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-17 08:42:24 -0400
committerGitHub <noreply@github.com>2017-08-17 08:42:24 -0400
commit18f153810871d4d39d057bd6ceceda91c4353300 (patch)
treeea183d8b014878a0887ee2c1c49b2b92c0d21e24 /include
parenta616437c83a51e4329f3ea280699073e43da6436 (diff)
parentedbaa7d6ac0bdbe3230b75e7cf7664dbda7207e0 (diff)
Merge pull request #99 from nyorain/wlr_seat2
wlr_seat
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_seat.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
new file mode 100644
index 00000000..99c09258
--- /dev/null
+++ b/include/wlr/types/wlr_seat.h
@@ -0,0 +1,62 @@
+#ifndef _WLR_TYPES_SEAT_H
+#define _WLR_TYPES_SEAT_H
+#include <wayland-server.h>
+
+/**
+ * Contains state for a single client's bound wl_seat resource and can be used
+ * to issue input events to that client. The lifetime of these objects is
+ * managed by wlr_seat; some may be NULL.
+ */
+struct wlr_seat_handle {
+ struct wl_resource *wl_resource;
+ struct wlr_seat *wlr_seat;
+
+ struct wl_resource *pointer;
+ struct wl_resource *keyboard;
+ struct wl_resource *touch;
+
+ struct wl_list link;
+};
+
+struct wlr_seat {
+ struct wl_global *wl_global;
+ struct wl_list handles;
+ char *name;
+ uint32_t capabilities;
+
+ struct {
+ struct wl_signal client_bound;
+ struct wl_signal client_unbound;
+ struct wl_signal keyboard_bound;
+ } events;
+
+ void *data;
+};
+
+
+/**
+ * Allocates a new wlr_seat and adds a wl_seat global to the display.
+ */
+struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name);
+/**
+ * Destroys a wlr_seat and removes its wl_seat global.
+ */
+void wlr_seat_destroy(struct wlr_seat *wlr_seat);
+/**
+ * Gets a wlr_seat_handle for the specified client, or returns NULL if no
+ * handle is bound for that client.
+ */
+struct wlr_seat_handle *wlr_seat_handle_for_client(struct wlr_seat *wlr_seat,
+ struct wl_client *client);
+/**
+ * Updates the capabilities available on this seat.
+ * Will automatically send them to all clients.
+ */
+void wlr_seat_set_capabilities(struct wlr_seat *wlr_seat, uint32_t capabilities);
+/**
+ * Updates the name of this seat.
+ * Will automatically send it to all clients.
+ */
+void wlr_seat_set_name(struct wlr_seat *wlr_seat, const char *name);
+
+#endif