diff options
author | 2016-07-06 08:45:05 -0400 | |
---|---|---|
committer | 2016-07-06 08:45:05 -0400 | |
commit | 378149b59c8d2a6d2b0bab7f2bb507dbac990734 (patch) | |
tree | d7a5edd481a0b8961eee20d3008b1fbf6ba51ee1 /include/client | |
parent | Merge pull request #740 from zandrmartin/json-fixes (diff) | |
parent | Fix formatting guide violations (spaces instead of tabs) (diff) | |
download | sway-378149b59c8d2a6d2b0bab7f2bb507dbac990734.tar.gz sway-378149b59c8d2a6d2b0bab7f2bb507dbac990734.tar.zst sway-378149b59c8d2a6d2b0bab7f2bb507dbac990734.zip |
Merge pull request #739 from deklov/swaybar-pointer-01
Enable windows to register to get notified of pointer button events
Diffstat (limited to 'include/client')
-rw-r--r-- | include/client/window.h | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/include/client/window.h b/include/client/window.h index e48ec4f3..7be4fff3 100644 --- a/include/client/window.h +++ b/include/client/window.h | |||
@@ -9,33 +9,43 @@ | |||
9 | #include "list.h" | 9 | #include "list.h" |
10 | #include "client/registry.h" | 10 | #include "client/registry.h" |
11 | 11 | ||
12 | struct window; | ||
13 | |||
12 | struct buffer { | 14 | struct buffer { |
13 | struct wl_buffer *buffer; | 15 | struct wl_buffer *buffer; |
14 | cairo_surface_t *surface; | 16 | cairo_surface_t *surface; |
15 | cairo_t *cairo; | 17 | cairo_t *cairo; |
16 | PangoContext *pango; | 18 | PangoContext *pango; |
17 | uint32_t width, height; | 19 | uint32_t width, height; |
18 | bool busy; | 20 | bool busy; |
19 | }; | 21 | }; |
20 | 22 | ||
21 | struct cursor { | 23 | struct cursor { |
22 | struct wl_surface *surface; | 24 | struct wl_surface *surface; |
23 | struct wl_cursor_theme *cursor_theme; | 25 | struct wl_cursor_theme *cursor_theme; |
24 | struct wl_cursor *cursor; | 26 | struct wl_cursor *cursor; |
25 | struct wl_poitner *pointer; | 27 | struct wl_poitner *pointer; |
28 | }; | ||
29 | |||
30 | struct pointer_input { | ||
31 | wl_fixed_t last_x; | ||
32 | wl_fixed_t last_y; | ||
33 | |||
34 | void (*notify)(struct window *window, wl_fixed_t x, wl_fixed_t y, uint32_t button); | ||
26 | }; | 35 | }; |
27 | 36 | ||
28 | struct window { | 37 | struct window { |
29 | struct registry *registry; | 38 | struct registry *registry; |
30 | struct buffer buffers[2]; | 39 | struct buffer buffers[2]; |
31 | struct buffer *buffer; | 40 | struct buffer *buffer; |
32 | struct wl_surface *surface; | 41 | struct wl_surface *surface; |
33 | struct wl_shell_surface *shell_surface; | 42 | struct wl_shell_surface *shell_surface; |
34 | struct wl_callback *frame_cb; | 43 | struct wl_callback *frame_cb; |
35 | struct cursor cursor; | 44 | struct cursor cursor; |
36 | uint32_t width, height; | 45 | uint32_t width, height; |
37 | char *font; | 46 | char *font; |
38 | cairo_t *cairo; | 47 | cairo_t *cairo; |
48 | struct pointer_input pointer_input; | ||
39 | }; | 49 | }; |
40 | 50 | ||
41 | struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface); | 51 | struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface); |