diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/config.h | 23 | ||||
-rw-r--r-- | include/sway/input/cursor.h | 6 | ||||
-rw-r--r-- | include/util.h | 8 |
3 files changed, 34 insertions, 3 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 9d2e1bf9..032f4196 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -21,14 +21,28 @@ struct sway_variable { | |||
21 | char *value; | 21 | char *value; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | |||
25 | enum binding_input_type { | ||
26 | BINDING_KEYCODE, | ||
27 | BINDING_KEYSYM, | ||
28 | BINDING_MOUSE, | ||
29 | }; | ||
30 | |||
31 | enum binding_flags { | ||
32 | BINDING_RELEASE=1, | ||
33 | BINDING_LOCKED=2, // keyboard only | ||
34 | BINDING_BORDER=4, // mouse only; trigger on container border | ||
35 | BINDING_CONTENTS=8, // mouse only; trigger on container contents | ||
36 | BINDING_TITLEBAR=16 // mouse only; trigger on container titlebar | ||
37 | }; | ||
38 | |||
24 | /** | 39 | /** |
25 | * A key binding and an associated command. | 40 | * A key binding and an associated command. |
26 | */ | 41 | */ |
27 | struct sway_binding { | 42 | struct sway_binding { |
43 | enum binding_input_type type; | ||
28 | int order; | 44 | int order; |
29 | bool release; | 45 | uint32_t flags; |
30 | bool locked; | ||
31 | bool bindcode; | ||
32 | list_t *keys; // sorted in ascending order | 46 | list_t *keys; // sorted in ascending order |
33 | uint32_t modifiers; | 47 | uint32_t modifiers; |
34 | char *command; | 48 | char *command; |
@@ -49,6 +63,7 @@ struct sway_mode { | |||
49 | char *name; | 63 | char *name; |
50 | list_t *keysym_bindings; | 64 | list_t *keysym_bindings; |
51 | list_t *keycode_bindings; | 65 | list_t *keycode_bindings; |
66 | list_t *mouse_bindings; | ||
52 | bool pango; | 67 | bool pango; |
53 | }; | 68 | }; |
54 | 69 | ||
@@ -471,6 +486,8 @@ void free_sway_binding(struct sway_binding *sb); | |||
471 | 486 | ||
472 | struct sway_binding *sway_binding_dup(struct sway_binding *sb); | 487 | struct sway_binding *sway_binding_dup(struct sway_binding *sb); |
473 | 488 | ||
489 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding); | ||
490 | |||
474 | void load_swaybars(); | 491 | void load_swaybars(); |
475 | 492 | ||
476 | void invoke_swaybar(struct bar_config *bar); | 493 | 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); |
diff --git a/include/util.h b/include/util.h index f68deae8..bda941ce 100644 --- a/include/util.h +++ b/include/util.h | |||
@@ -51,6 +51,14 @@ pid_t get_parent_pid(pid_t pid); | |||
51 | uint32_t parse_color(const char *color); | 51 | uint32_t parse_color(const char *color); |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Given a string that represents a boolean, return the boolean value. This | ||
55 | * function also takes in the current boolean value to support toggling. If | ||
56 | * toggling is not desired, pass in true for current so that toggling values | ||
57 | * get parsed as not true. | ||
58 | */ | ||
59 | bool parse_boolean(const char *boolean, bool current); | ||
60 | |||
61 | /** | ||
54 | * Given a path string, recurseively resolves any symlinks to their targets | 62 | * Given a path string, recurseively resolves any symlinks to their targets |
55 | * (which may be a file, directory) and returns the result. | 63 | * (which may be a file, directory) and returns the result. |
56 | * argument is returned. Caller must free the returned buffer. | 64 | * argument is returned. Caller must free the returned buffer. |