diff options
author | 2018-03-31 00:10:20 -0400 | |
---|---|---|
committer | 2018-03-31 00:10:20 -0400 | |
commit | 0441d124799dca510b3bf6621267b7838730af1a (patch) | |
tree | d5301c12dec48b570cee5d0a6daa3333ff4f575d /include/swaybar/bar.h | |
parent | Use wlr_surface_point_accepts_input (diff) | |
parent | Implement workspace switch on click (diff) | |
download | sway-0441d124799dca510b3bf6621267b7838730af1a.tar.gz sway-0441d124799dca510b3bf6621267b7838730af1a.tar.zst sway-0441d124799dca510b3bf6621267b7838730af1a.zip |
Merge pull request #1676 from swaywm/swaybar-input
Swaybar input
Diffstat (limited to 'include/swaybar/bar.h')
-rw-r--r-- | include/swaybar/bar.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index 1bf2ea2d..74292519 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h | |||
@@ -2,20 +2,39 @@ | |||
2 | #define _SWAYBAR_BAR_H | 2 | #define _SWAYBAR_BAR_H |
3 | #include <wayland-client.h> | 3 | #include <wayland-client.h> |
4 | #include "pool-buffer.h" | 4 | #include "pool-buffer.h" |
5 | #include "list.h" | ||
6 | 5 | ||
7 | struct swaybar_config; | 6 | struct swaybar_config; |
8 | struct swaybar_output; | 7 | struct swaybar_output; |
9 | struct swaybar_workspace; | 8 | struct swaybar_workspace; |
10 | 9 | ||
10 | struct swaybar_pointer { | ||
11 | struct wl_pointer *pointer; | ||
12 | struct wl_cursor_theme *cursor_theme; | ||
13 | struct wl_cursor_image *cursor_image; | ||
14 | struct wl_surface *cursor_surface; | ||
15 | struct swaybar_output *current; | ||
16 | int x, y; | ||
17 | }; | ||
18 | |||
19 | struct swaybar_hotspot { | ||
20 | struct wl_list link; | ||
21 | int x, y, width, height; | ||
22 | void (*callback)(struct swaybar_output *output, | ||
23 | int x, int y, uint32_t button, void *data); | ||
24 | void (*destroy)(void *data); | ||
25 | void *data; | ||
26 | }; | ||
27 | |||
11 | struct swaybar { | 28 | struct swaybar { |
12 | struct wl_display *display; | 29 | struct wl_display *display; |
13 | struct wl_compositor *compositor; | 30 | struct wl_compositor *compositor; |
14 | struct zwlr_layer_shell_v1 *layer_shell; | 31 | struct zwlr_layer_shell_v1 *layer_shell; |
15 | struct wl_shm *shm; | 32 | struct wl_shm *shm; |
33 | struct wl_seat *seat; | ||
16 | 34 | ||
17 | struct swaybar_config *config; | 35 | struct swaybar_config *config; |
18 | struct swaybar_output *focused_output; | 36 | struct swaybar_output *focused_output; |
37 | struct swaybar_pointer pointer; | ||
19 | struct status_line *status; | 38 | struct status_line *status; |
20 | 39 | ||
21 | int ipc_event_socketfd; | 40 | int ipc_event_socketfd; |
@@ -32,6 +51,7 @@ struct swaybar_output { | |||
32 | struct zwlr_layer_surface_v1 *layer_surface; | 51 | struct zwlr_layer_surface_v1 *layer_surface; |
33 | 52 | ||
34 | struct wl_list workspaces; | 53 | struct wl_list workspaces; |
54 | struct wl_list hotspots; | ||
35 | 55 | ||
36 | char *name; | 56 | char *name; |
37 | size_t index; | 57 | size_t index; |
@@ -51,7 +71,6 @@ struct swaybar_workspace { | |||
51 | bool urgent; | 71 | bool urgent; |
52 | }; | 72 | }; |
53 | 73 | ||
54 | // TODO: Rename stuff to match wlroots conventions (init/create/etc) | ||
55 | void bar_setup(struct swaybar *bar, | 74 | void bar_setup(struct swaybar *bar, |
56 | const char *socket_path, | 75 | const char *socket_path, |
57 | const char *bar_id); | 76 | const char *bar_id); |