aboutsummaryrefslogtreecommitdiffstats
path: root/include/swaybar/input.h
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-10-17 20:21:27 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-10-18 14:19:00 +0100
commit499150a91b706b9829ca763ede9b97c573b51cb7 (patch)
tree09ff2da2b266f152e590db839f0c5e2016888552 /include/swaybar/input.h
parentMerge pull request #2871 from RyanDwyer/untangle-cursor-warp (diff)
downloadsway-499150a91b706b9829ca763ede9b97c573b51cb7.tar.gz
sway-499150a91b706b9829ca763ede9b97c573b51cb7.tar.zst
sway-499150a91b706b9829ca763ede9b97c573b51cb7.zip
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 @@
1#ifndef _SWAYBAR_INPUT_H
2#define _SWAYBAR_INPUT_H
3
4#include <wayland-client.h>
5#include "list.h"
6
7struct swaybar_output;
8
9struct swaybar_pointer {
10 struct wl_pointer *pointer;
11 struct wl_cursor_theme *cursor_theme;
12 struct wl_cursor_image *cursor_image;
13 struct wl_surface *cursor_surface;
14 struct swaybar_output *current;
15 int x, y;
16};
17
18enum x11_button {
19 NONE,
20 LEFT,
21 MIDDLE,
22 RIGHT,
23 SCROLL_UP,
24 SCROLL_DOWN,
25 SCROLL_LEFT,
26 SCROLL_RIGHT,
27 BACK,
28 FORWARD,
29};
30
31enum hotspot_event_handling {
32 HOTSPOT_IGNORE,
33 HOTSPOT_PROCESS,
34};
35
36struct swaybar_hotspot {
37 struct wl_list link; // swaybar_output::hotspots
38 int x, y, width, height;
39 enum hotspot_event_handling (*callback)(struct swaybar_output *output,
40 int x, int y, enum x11_button button, void *data);
41 void (*destroy)(void *data);
42 void *data;
43};
44
45extern const struct wl_seat_listener seat_listener;
46
47void free_hotspots(struct wl_list *list);
48
49#endif