diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-14 11:11:56 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-14 11:11:56 -0500 |
commit | 92fef27eaa0b52c9d37bdabff14ae21cd6660f46 (patch) | |
tree | 7a923bbbc233079006597d82721117bae88b6ac6 /include/sway | |
parent | seat configuration (diff) | |
download | sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.tar.gz sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.tar.zst sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.zip |
basic configuration
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/commands.h | 5 | ||||
-rw-r--r-- | include/sway/config.h | 27 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 9 | ||||
-rw-r--r-- | include/sway/input/keyboard.h | 9 | ||||
-rw-r--r-- | include/sway/input/seat.h | 20 |
5 files changed, 59 insertions, 11 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h index 75340e03..ce74e1ed 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -17,6 +17,7 @@ enum cmd_status { | |||
17 | CMD_BLOCK_BAR, | 17 | CMD_BLOCK_BAR, |
18 | CMD_BLOCK_BAR_COLORS, | 18 | CMD_BLOCK_BAR_COLORS, |
19 | CMD_BLOCK_INPUT, | 19 | CMD_BLOCK_INPUT, |
20 | CMD_BLOCK_SEAT, | ||
20 | CMD_BLOCK_COMMANDS, | 21 | CMD_BLOCK_COMMANDS, |
21 | CMD_BLOCK_IPC, | 22 | CMD_BLOCK_IPC, |
22 | CMD_BLOCK_IPC_EVENTS, | 23 | CMD_BLOCK_IPC_EVENTS, |
@@ -42,6 +43,7 @@ enum expected_args { | |||
42 | }; | 43 | }; |
43 | 44 | ||
44 | void input_cmd_apply(struct input_config *input); | 45 | void input_cmd_apply(struct input_config *input); |
46 | void seat_cmd_apply(struct seat_config *seat); | ||
45 | 47 | ||
46 | struct cmd_results *checkarg(int argc, const char *name, | 48 | struct cmd_results *checkarg(int argc, const char *name, |
47 | enum expected_args type, int val); | 49 | enum expected_args type, int val); |
@@ -111,6 +113,7 @@ sway_cmd cmd_gaps; | |||
111 | sway_cmd cmd_hide_edge_borders; | 113 | sway_cmd cmd_hide_edge_borders; |
112 | sway_cmd cmd_include; | 114 | sway_cmd cmd_include; |
113 | sway_cmd cmd_input; | 115 | sway_cmd cmd_input; |
116 | sway_cmd cmd_seat; | ||
114 | sway_cmd cmd_ipc; | 117 | sway_cmd cmd_ipc; |
115 | sway_cmd cmd_kill; | 118 | sway_cmd cmd_kill; |
116 | sway_cmd cmd_layout; | 119 | sway_cmd cmd_layout; |
@@ -193,6 +196,8 @@ sway_cmd input_cmd_pointer_accel; | |||
193 | sway_cmd input_cmd_scroll_method; | 196 | sway_cmd input_cmd_scroll_method; |
194 | sway_cmd input_cmd_tap; | 197 | sway_cmd input_cmd_tap; |
195 | 198 | ||
199 | sway_cmd seat_cmd_attach; | ||
200 | |||
196 | sway_cmd cmd_ipc_cmd; | 201 | sway_cmd cmd_ipc_cmd; |
197 | sway_cmd cmd_ipc_events; | 202 | sway_cmd cmd_ipc_events; |
198 | sway_cmd cmd_ipc_event_cmd; | 203 | sway_cmd cmd_ipc_event_cmd; |
diff --git a/include/sway/config.h b/include/sway/config.h index 9fcecfd6..5df5d61e 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -69,7 +69,22 @@ struct input_config { | |||
69 | 69 | ||
70 | bool capturable; | 70 | bool capturable; |
71 | struct wlr_box region; | 71 | struct wlr_box region; |
72 | char *seat; | 72 | }; |
73 | |||
74 | /** | ||
75 | * Options for misc device configurations that happen in the seat block | ||
76 | */ | ||
77 | struct seat_attachment_config { | ||
78 | char *identifier; | ||
79 | // TODO other things are configured here for some reason | ||
80 | }; | ||
81 | |||
82 | /** | ||
83 | * Options for multiseat and other misc device configurations | ||
84 | */ | ||
85 | struct seat_config { | ||
86 | char *name; | ||
87 | list_t *attachments; // list of seat_attachment configs | ||
73 | }; | 88 | }; |
74 | 89 | ||
75 | /** | 90 | /** |
@@ -260,6 +275,7 @@ struct sway_config { | |||
260 | list_t *pid_workspaces; | 275 | list_t *pid_workspaces; |
261 | list_t *output_configs; | 276 | list_t *output_configs; |
262 | list_t *input_configs; | 277 | list_t *input_configs; |
278 | list_t *seat_configs; | ||
263 | list_t *criteria; | 279 | list_t *criteria; |
264 | list_t *no_focus; | 280 | list_t *no_focus; |
265 | list_t *active_bar_modifiers; | 281 | list_t *active_bar_modifiers; |
@@ -358,9 +374,16 @@ struct cmd_results *check_security_config(); | |||
358 | int input_identifier_cmp(const void *item, const void *data); | 374 | int input_identifier_cmp(const void *item, const void *data); |
359 | struct input_config *new_input_config(const char* identifier); | 375 | struct input_config *new_input_config(const char* identifier); |
360 | void merge_input_config(struct input_config *dst, struct input_config *src); | 376 | void merge_input_config(struct input_config *dst, struct input_config *src); |
361 | void apply_input_config(struct input_config *ic, struct libinput_device *dev); | ||
362 | void free_input_config(struct input_config *ic); | 377 | void free_input_config(struct input_config *ic); |
363 | 378 | ||
379 | int seat_name_cmp(const void *item, const void *data); | ||
380 | struct seat_config *new_seat_config(const char* name); | ||
381 | void merge_seat_config(struct seat_config *dst, struct seat_config *src); | ||
382 | void free_seat_config(struct seat_config *ic); | ||
383 | struct seat_attachment_config *seat_attachment_config_new(); | ||
384 | struct seat_attachment_config *seat_config_get_attachment( | ||
385 | struct seat_config *seat_config, char *identifier); | ||
386 | |||
364 | int output_name_cmp(const void *item, const void *data); | 387 | int output_name_cmp(const void *item, const void *data); |
365 | void merge_output_config(struct output_config *dst, struct output_config *src); | 388 | void merge_output_config(struct output_config *dst, struct output_config *src); |
366 | /** Sets up a WLC output handle based on a given output_config. | 389 | /** Sets up a WLC output handle based on a given output_config. |
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index 7d7c463f..cdcffab6 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "list.h" | 6 | #include "list.h" |
7 | 7 | ||
8 | extern struct input_config *current_input_config; | 8 | extern struct input_config *current_input_config; |
9 | extern struct seat_config *current_seat_config; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * The global singleton input manager | 12 | * The global singleton input manager |
@@ -17,7 +18,6 @@ struct sway_input_device { | |||
17 | char *identifier; | 18 | char *identifier; |
18 | struct wlr_input_device *wlr_device; | 19 | struct wlr_input_device *wlr_device; |
19 | struct input_config *config; | 20 | struct input_config *config; |
20 | struct sway_keyboard *keyboard; // managed by the seat | ||
21 | struct wl_list link; | 21 | struct wl_list link; |
22 | }; | 22 | }; |
23 | 23 | ||
@@ -40,7 +40,10 @@ void sway_input_manager_set_focus(struct sway_input_manager *input, | |||
40 | 40 | ||
41 | void sway_input_manager_configure_xcursor(struct sway_input_manager *input); | 41 | void sway_input_manager_configure_xcursor(struct sway_input_manager *input); |
42 | 42 | ||
43 | void sway_input_manager_apply_config(struct sway_input_manager *input, | 43 | void sway_input_manager_apply_input_config(struct sway_input_manager *input, |
44 | struct input_config *config); | 44 | struct input_config *input_config); |
45 | |||
46 | void sway_input_manager_apply_seat_config(struct sway_input_manager *input, | ||
47 | struct seat_config *seat_config); | ||
45 | 48 | ||
46 | #endif | 49 | #endif |
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h index 881805b4..89cde3fa 100644 --- a/include/sway/input/keyboard.h +++ b/include/sway/input/keyboard.h | |||
@@ -1,15 +1,18 @@ | |||
1 | #include "sway/input/seat.h" | 1 | #include "sway/input/seat.h" |
2 | 2 | ||
3 | struct sway_keyboard { | 3 | struct sway_keyboard { |
4 | struct sway_seat *seat; | 4 | struct sway_seat_device *seat_device; |
5 | struct sway_input_device *device; | ||
6 | struct wl_list link; // sway_seat::keyboards | 5 | struct wl_list link; // sway_seat::keyboards |
7 | 6 | ||
7 | struct xkb_keymap *keymap; | ||
8 | |||
8 | struct wl_listener keyboard_key; | 9 | struct wl_listener keyboard_key; |
9 | struct wl_listener keyboard_modifiers; | 10 | struct wl_listener keyboard_modifiers; |
10 | }; | 11 | }; |
11 | 12 | ||
12 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, | 13 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, |
13 | struct sway_input_device *device); | 14 | struct sway_seat_device *device); |
15 | |||
16 | void sway_keyboard_configure(struct sway_keyboard *keyboard); | ||
14 | 17 | ||
15 | void sway_keyboard_destroy(struct sway_keyboard *keyboard); | 18 | void sway_keyboard_destroy(struct sway_keyboard *keyboard); |
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index bd94a357..db69f83e 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -4,16 +4,25 @@ | |||
4 | #include <wlr/types/wlr_seat.h> | 4 | #include <wlr/types/wlr_seat.h> |
5 | #include "sway/input/input-manager.h" | 5 | #include "sway/input/input-manager.h" |
6 | 6 | ||
7 | struct sway_seat_device { | ||
8 | struct sway_seat *sway_seat; | ||
9 | struct sway_input_device *input_device; | ||
10 | struct sway_keyboard *keyboard; | ||
11 | struct seat_attachment_config *attachment_config; | ||
12 | struct wl_list link; // sway_seat::devices | ||
13 | }; | ||
14 | |||
7 | struct sway_seat { | 15 | struct sway_seat { |
8 | struct wlr_seat *seat; | 16 | struct wlr_seat *wlr_seat; |
17 | struct seat_config *config; | ||
9 | struct sway_cursor *cursor; | 18 | struct sway_cursor *cursor; |
10 | struct sway_input_manager *input; | 19 | struct sway_input_manager *input; |
11 | swayc_t *focus; | 20 | swayc_t *focus; |
12 | 21 | ||
13 | list_t *devices; | ||
14 | |||
15 | struct wl_listener focus_destroy; | 22 | struct wl_listener focus_destroy; |
16 | 23 | ||
24 | struct wl_list devices; // sway_seat_device::link | ||
25 | |||
17 | struct wl_list link; // input_manager::seats | 26 | struct wl_list link; // input_manager::seats |
18 | }; | 27 | }; |
19 | 28 | ||
@@ -23,6 +32,9 @@ struct sway_seat *sway_seat_create(struct sway_input_manager *input, | |||
23 | void sway_seat_add_device(struct sway_seat *seat, | 32 | void sway_seat_add_device(struct sway_seat *seat, |
24 | struct sway_input_device *device); | 33 | struct sway_input_device *device); |
25 | 34 | ||
35 | void sway_seat_configure_device(struct sway_seat *seat, | ||
36 | struct sway_input_device *device); | ||
37 | |||
26 | void sway_seat_remove_device(struct sway_seat *seat, | 38 | void sway_seat_remove_device(struct sway_seat *seat, |
27 | struct sway_input_device *device); | 39 | struct sway_input_device *device); |
28 | 40 | ||
@@ -30,4 +42,6 @@ void sway_seat_configure_xcursor(struct sway_seat *seat); | |||
30 | 42 | ||
31 | void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container); | 43 | void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container); |
32 | 44 | ||
45 | void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config); | ||
46 | |||
33 | #endif | 47 | #endif |