aboutsummaryrefslogtreecommitdiff
path: root/include/swaybar/input.h
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-10-18 13:37:35 -0400
committerGitHub <noreply@github.com>2018-10-18 13:37:35 -0400
commit30dbb8eba053fda2e17678feb6cebffc424e1e57 (patch)
tree09ff2da2b266f152e590db839f0c5e2016888552 /include/swaybar/input.h
parentd88b7a63f487587d9507164de31d6e8508b32801 (diff)
parent499150a91b706b9829ca763ede9b97c573b51cb7 (diff)
Merge pull request #2874 from ianyfan/swaybar
swaybar: separate input code to new file
Diffstat (limited to 'include/swaybar/input.h')
-rw-r--r--include/swaybar/input.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/swaybar/input.h b/include/swaybar/input.h
new file mode 100644
index 00000000..a552e7ac
--- /dev/null
+++ b/include/swaybar/input.h
@@ -0,0 +1,49 @@
+#ifndef _SWAYBAR_INPUT_H
+#define _SWAYBAR_INPUT_H
+
+#include <wayland-client.h>
+#include "list.h"
+
+struct swaybar_output;
+
+struct swaybar_pointer {
+ struct wl_pointer *pointer;
+ struct wl_cursor_theme *cursor_theme;
+ struct wl_cursor_image *cursor_image;
+ struct wl_surface *cursor_surface;
+ struct swaybar_output *current;
+ int x, y;
+};
+
+enum x11_button {
+ NONE,
+ LEFT,
+ MIDDLE,
+ RIGHT,
+ SCROLL_UP,
+ SCROLL_DOWN,
+ SCROLL_LEFT,
+ SCROLL_RIGHT,
+ BACK,
+ FORWARD,
+};
+
+enum hotspot_event_handling {
+ HOTSPOT_IGNORE,
+ HOTSPOT_PROCESS,
+};
+
+struct swaybar_hotspot {
+ struct wl_list link; // swaybar_output::hotspots
+ int x, y, width, height;
+ enum hotspot_event_handling (*callback)(struct swaybar_output *output,
+ int x, int y, enum x11_button button, void *data);
+ void (*destroy)(void *data);
+ void *data;
+};
+
+extern const struct wl_seat_listener seat_listener;
+
+void free_hotspots(struct wl_list *list);
+
+#endif