aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-10-09 22:12:46 +0100
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-03-01 01:33:13 +0100
commitd1b979d9bd858c45e9ee23a418a390e0ea4ed0cc (patch)
treea1fab7b278a704927ba28115f59697a8cebe85fa /include
parent2a897af7dc532a3585401ae317d586a69c1af1d3 (diff)
ext-action-binder-v1: new protocol implementation
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_action_binder_v1.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_action_binder_v1.h b/include/wlr/types/wlr_action_binder_v1.h
new file mode 100644
index 00000000..d93f6dc4
--- /dev/null
+++ b/include/wlr/types/wlr_action_binder_v1.h
@@ -0,0 +1,64 @@
+/*
+ * This an unstable interface of wlroots. No guarantees are made regarding the
+ * future consistency of this API.
+ */
+#ifndef WLR_USE_UNSTABLE
+#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
+#endif
+
+#ifndef WLR_TYPES_WLR_ACTION_BINDER_V1_H
+#define WLR_TYPES_WLR_ACTION_BINDER_V1_H
+
+#include <wayland-server-core.h>
+#include <wayland-server-protocol.h>
+#include "ext-action-binder-v1-protocol.h"
+
+struct wlr_action_binder_v1 {
+ struct wl_global *global;
+ struct wl_list states; // wlr_action_binder_v1_state.link
+ struct wl_listener display_destroy;
+
+ struct {
+ struct wl_signal bind;
+ struct wl_signal destroy;
+ } events;
+
+ void *data;
+};
+
+struct wlr_action_binder_v1_state {
+ struct wl_list binds; // wlr_action_binding_v1.link
+ struct wl_list bind_queue; // wlr_action_binding_v1.link
+ struct wlr_action_binder_v1 *binder;
+ struct wl_resource *resource;
+
+ struct wl_list link;
+};
+
+struct wlr_action_binding_v1 {
+ struct wl_resource *resource;
+ struct wlr_action_binder_v1_state *state;
+
+ char *namespace, *name;
+
+ char *description; // may be NULL when the client doesn't set a description
+ char *trigger_kind, *trigger; // may be NULL when the client doesn't set a trigger hint
+ char *app_id; // may be NULL when the client doesn't set an app_id
+ struct wlr_seat *seat; // may be NULL when the client doesn't set a seat
+ struct wl_listener seat_destroy;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ bool bound;
+ struct wl_list link;
+};
+
+struct wlr_action_binder_v1 *wlr_action_binder_v1_create(struct wl_display *display);
+void wlr_action_binding_v1_bind(struct wlr_action_binding_v1 *bind, const char *trigger);
+void wlr_action_binding_v1_reject(struct wlr_action_binding_v1 *bind);
+void wlr_action_binding_v1_trigger(struct wlr_action_binding_v1 *binding, uint32_t trigger_type, uint32_t time_msec);
+void wlr_action_binding_v1_trigger_now(struct wlr_action_binding_v1 *binding, uint32_t trigger_type);
+
+#endif