diff options
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/config.h | 23 | ||||
-rw-r--r-- | include/sway/input/cursor.h | 6 |
2 files changed, 26 insertions, 3 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index b8da29c5..bcd503a4 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -22,14 +22,28 @@ struct sway_variable { | |||
22 | char *value; | 22 | char *value; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | |||
26 | enum binding_input_type { | ||
27 | BINDING_KEYCODE, | ||
28 | BINDING_KEYSYM, | ||
29 | BINDING_MOUSE, | ||
30 | }; | ||
31 | |||
32 | enum binding_flags { | ||
33 | BINDING_RELEASE=1, | ||
34 | BINDING_LOCKED=2, // keyboard only | ||
35 | BINDING_BORDER=4, // mouse only; trigger on container border | ||
36 | BINDING_CONTENTS=8, // mouse only; trigger on container contents | ||
37 | BINDING_TITLEBAR=16 // mouse only; trigger on container titlebar | ||
38 | }; | ||
39 | |||
25 | /** | 40 | /** |
26 | * A key binding and an associated command. | 41 | * A key binding and an associated command. |
27 | */ | 42 | */ |
28 | struct sway_binding { | 43 | struct sway_binding { |
44 | enum binding_input_type type; | ||
29 | int order; | 45 | int order; |
30 | bool release; | 46 | uint32_t flags; |
31 | bool locked; | ||
32 | bool bindcode; | ||
33 | list_t *keys; // sorted in ascending order | 47 | list_t *keys; // sorted in ascending order |
34 | uint32_t modifiers; | 48 | uint32_t modifiers; |
35 | char *command; | 49 | char *command; |
@@ -50,6 +64,7 @@ struct sway_mode { | |||
50 | char *name; | 64 | char *name; |
51 | list_t *keysym_bindings; | 65 | list_t *keysym_bindings; |
52 | list_t *keycode_bindings; | 66 | list_t *keycode_bindings; |
67 | list_t *mouse_bindings; | ||
53 | bool pango; | 68 | bool pango; |
54 | }; | 69 | }; |
55 | 70 | ||
@@ -482,6 +497,8 @@ void free_sway_binding(struct sway_binding *sb); | |||
482 | 497 | ||
483 | struct sway_binding *sway_binding_dup(struct sway_binding *sb); | 498 | struct sway_binding *sway_binding_dup(struct sway_binding *sb); |
484 | 499 | ||
500 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding); | ||
501 | |||
485 | void load_swaybars(); | 502 | void load_swaybars(); |
486 | 503 | ||
487 | void invoke_swaybar(struct bar_config *bar); | 504 | void invoke_swaybar(struct bar_config *bar); |
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index b0a3a7c5..7ec45120 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h | |||
@@ -3,6 +3,8 @@ | |||
3 | #include <stdint.h> | 3 | #include <stdint.h> |
4 | #include "sway/input/seat.h" | 4 | #include "sway/input/seat.h" |
5 | 5 | ||
6 | #define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32 | ||
7 | |||
6 | struct sway_cursor { | 8 | struct sway_cursor { |
7 | struct sway_seat *seat; | 9 | struct sway_seat *seat; |
8 | struct wlr_cursor *cursor; | 10 | struct wlr_cursor *cursor; |
@@ -29,6 +31,10 @@ struct sway_cursor { | |||
29 | uint32_t tool_buttons; | 31 | uint32_t tool_buttons; |
30 | 32 | ||
31 | struct wl_listener request_set_cursor; | 33 | struct wl_listener request_set_cursor; |
34 | |||
35 | // Mouse binding state | ||
36 | uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP]; | ||
37 | size_t pressed_button_count; | ||
32 | }; | 38 | }; |
33 | 39 | ||
34 | void sway_cursor_destroy(struct sway_cursor *cursor); | 40 | void sway_cursor_destroy(struct sway_cursor *cursor); |