diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | include/input_state.h | 20 | ||||
-rw-r--r-- | include/ipc-server.h | 6 | ||||
-rw-r--r-- | include/ipc.h | 1 | ||||
-rw-r--r-- | include/util.h | 18 |
5 files changed, 51 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h index a915fbed..5e1c39f3 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -135,6 +135,7 @@ struct sway_config { | |||
135 | list_t *workspace_outputs; | 135 | list_t *workspace_outputs; |
136 | list_t *output_configs; | 136 | list_t *output_configs; |
137 | list_t *criteria; | 137 | list_t *criteria; |
138 | list_t *active_bar_modifiers; | ||
138 | struct sway_mode *current_mode; | 139 | struct sway_mode *current_mode; |
139 | struct bar_config *current_bar; | 140 | struct bar_config *current_bar; |
140 | uint32_t floating_mod; | 141 | uint32_t floating_mod; |
@@ -176,6 +177,11 @@ void merge_output_config(struct output_config *dst, struct output_config *src); | |||
176 | void apply_output_config(struct output_config *oc, swayc_t *output); | 177 | void apply_output_config(struct output_config *oc, swayc_t *output); |
177 | void free_output_config(struct output_config *oc); | 178 | void free_output_config(struct output_config *oc); |
178 | 179 | ||
180 | /** | ||
181 | * Updates the list of active bar modifiers | ||
182 | */ | ||
183 | void update_active_bar_modifiers(void); | ||
184 | |||
179 | int workspace_output_cmp_workspace(const void *a, const void *b); | 185 | int workspace_output_cmp_workspace(const void *a, const void *b); |
180 | 186 | ||
181 | int sway_binding_cmp(const void *a, const void *b); | 187 | int sway_binding_cmp(const void *a, const void *b); |
diff --git a/include/input_state.h b/include/input_state.h index a1f238e1..79e27d91 100644 --- a/include/input_state.h +++ b/include/input_state.h | |||
@@ -60,6 +60,12 @@ extern struct pointer_state { | |||
60 | int mode; | 60 | int mode; |
61 | } pointer_state; | 61 | } pointer_state; |
62 | 62 | ||
63 | enum modifier_state { | ||
64 | MOD_STATE_UNCHANGED = 0, | ||
65 | MOD_STATE_PRESSED = 1, | ||
66 | MOD_STATE_RELEASED = 2 | ||
67 | }; | ||
68 | |||
63 | void pointer_position_set(struct wlc_origin *new_origin, bool force_focus); | 69 | void pointer_position_set(struct wlc_origin *new_origin, bool force_focus); |
64 | void center_pointer_on(swayc_t *view); | 70 | void center_pointer_on(swayc_t *view); |
65 | 71 | ||
@@ -75,5 +81,19 @@ void pointer_mode_reset(void); | |||
75 | 81 | ||
76 | void input_init(void); | 82 | void input_init(void); |
77 | 83 | ||
84 | /** | ||
85 | * Check if state of mod changed from current state to new_state. | ||
86 | * | ||
87 | * Returns MOD_STATE_UNCHANGED if the state didn't change, MOD_STATE_PRESSED if | ||
88 | * the state changed to pressed and MOD_STATE_RELEASED if the state changed to | ||
89 | * released. | ||
90 | */ | ||
91 | uint32_t modifier_state_changed(uint32_t new_state, uint32_t mod); | ||
92 | |||
93 | /** | ||
94 | * Update the current modifiers state to new_state. | ||
95 | */ | ||
96 | void modifiers_state_update(uint32_t new_state); | ||
97 | |||
78 | #endif | 98 | #endif |
79 | 99 | ||
diff --git a/include/ipc-server.h b/include/ipc-server.h index 04975093..47026bfd 100644 --- a/include/ipc-server.h +++ b/include/ipc-server.h | |||
@@ -15,6 +15,12 @@ void ipc_event_barconfig_update(struct bar_config *bar); | |||
15 | * Send IPC mode event to all listening clients | 15 | * Send IPC mode event to all listening clients |
16 | */ | 16 | */ |
17 | void ipc_event_mode(const char *mode); | 17 | void ipc_event_mode(const char *mode); |
18 | /** | ||
19 | * Sends an IPC modifier event to all listening clients. The modifier event | ||
20 | * includes a key 'change' with the value of state and a key 'modifier' with | ||
21 | * the name of that modifier. | ||
22 | */ | ||
23 | void ipc_event_modifier(uint32_t modifier, const char *state); | ||
18 | const char *swayc_type_string(enum swayc_types type); | 24 | const char *swayc_type_string(enum swayc_types type); |
19 | 25 | ||
20 | #endif | 26 | #endif |
diff --git a/include/ipc.h b/include/ipc.h index e0b3b736..56593529 100644 --- a/include/ipc.h +++ b/include/ipc.h | |||
@@ -17,6 +17,7 @@ enum ipc_command_type { | |||
17 | IPC_EVENT_WINDOW = (1 << 31 | 3), | 17 | IPC_EVENT_WINDOW = (1 << 31 | 3), |
18 | IPC_EVENT_BARCONFIG_UPDATE = (1 << 31 | 4), | 18 | IPC_EVENT_BARCONFIG_UPDATE = (1 << 31 | 4), |
19 | IPC_EVENT_BINDING = (1 << 31 | 5), | 19 | IPC_EVENT_BINDING = (1 << 31 | 5), |
20 | IPC_EVENT_MODIFIER = (1 << 31 | 6), | ||
20 | IPC_SWAY_GET_PIXELS = 0x81 | 21 | IPC_SWAY_GET_PIXELS = 0x81 |
21 | }; | 22 | }; |
22 | 23 | ||
diff --git a/include/util.h b/include/util.h index 9cb861dd..4bbb64c8 100644 --- a/include/util.h +++ b/include/util.h | |||
@@ -1,6 +1,10 @@ | |||
1 | #ifndef _SWAY_UTIL_H | 1 | #ifndef _SWAY_UTIL_H |
2 | #define _SWAY_UTIL_H | 2 | #define _SWAY_UTIL_H |
3 | 3 | ||
4 | #include <stdint.h> | ||
5 | #include <wlc/wlc.h> | ||
6 | #include <xkbcommon/xkbcommon.h> | ||
7 | |||
4 | /** | 8 | /** |
5 | * Wrap i into the range [0, max[ | 9 | * Wrap i into the range [0, max[ |
6 | */ | 10 | */ |
@@ -11,4 +15,18 @@ int wrap(int i, int max); | |||
11 | */ | 15 | */ |
12 | int numlen(int n); | 16 | int numlen(int n); |
13 | 17 | ||
18 | /** | ||
19 | * Get modifier mask from modifier name. | ||
20 | * | ||
21 | * Returns the modifer mask or 0 if the name isn't found. | ||
22 | */ | ||
23 | uint32_t get_modifier_mask_by_name(const char *name); | ||
24 | |||
25 | /** | ||
26 | * Get modifier name from modifier mask. | ||
27 | * | ||
28 | * Returns the modifier name or NULL if it isn't found. | ||
29 | */ | ||
30 | const char *get_modifier_name_by_mask(uint32_t modifier); | ||
31 | |||
14 | #endif | 32 | #endif |