diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-12 08:29:37 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-12 08:29:37 -0500 |
commit | 163edc5a900fda58e006ed30e14ae10cc4aa13b3 (patch) | |
tree | a43e355091da4545bf9f16c63accb7d853170195 /include/sway/input | |
parent | input config (diff) | |
download | sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.tar.gz sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.tar.zst sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.zip |
sway input device
Diffstat (limited to 'include/sway/input')
-rw-r--r-- | include/sway/input/input-manager.h | 31 | ||||
-rw-r--r-- | include/sway/input/keyboard.h | 4 | ||||
-rw-r--r-- | include/sway/input/seat.h | 13 |
3 files changed, 31 insertions, 17 deletions
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index 78bc161f..7d7c463f 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -7,21 +7,40 @@ | |||
7 | 7 | ||
8 | extern struct input_config *current_input_config; | 8 | extern struct input_config *current_input_config; |
9 | 9 | ||
10 | /** | ||
11 | * The global singleton input manager | ||
12 | * TODO: make me not a global | ||
13 | */ | ||
14 | extern struct sway_input_manager *input_manager; | ||
15 | |||
16 | struct sway_input_device { | ||
17 | char *identifier; | ||
18 | struct wlr_input_device *wlr_device; | ||
19 | struct input_config *config; | ||
20 | struct sway_keyboard *keyboard; // managed by the seat | ||
21 | struct wl_list link; | ||
22 | }; | ||
23 | |||
10 | struct sway_input_manager { | 24 | struct sway_input_manager { |
11 | struct wl_listener input_add; | 25 | struct wl_listener input_add; |
12 | struct wl_listener input_remove; | 26 | struct wl_listener input_remove; |
13 | struct sway_server *server; | 27 | struct sway_server *server; |
14 | list_t *seats; | 28 | struct wl_list devices; |
29 | struct wl_list seats; | ||
15 | }; | 30 | }; |
16 | 31 | ||
17 | struct input_config *new_input_config(const char* identifier); | ||
18 | |||
19 | char* libinput_dev_unique_id(struct libinput_device *dev); | ||
20 | |||
21 | struct sway_input_manager *sway_input_manager_create( | 32 | struct sway_input_manager *sway_input_manager_create( |
22 | struct sway_server *server); | 33 | struct sway_server *server); |
23 | 34 | ||
24 | bool sway_input_manager_swayc_has_focus(struct sway_input_manager *input, | 35 | bool sway_input_manager_has_focus(struct sway_input_manager *input, |
25 | swayc_t *container); | 36 | swayc_t *container); |
26 | 37 | ||
38 | void sway_input_manager_set_focus(struct sway_input_manager *input, | ||
39 | swayc_t *container); | ||
40 | |||
41 | void sway_input_manager_configure_xcursor(struct sway_input_manager *input); | ||
42 | |||
43 | void sway_input_manager_apply_config(struct sway_input_manager *input, | ||
44 | struct input_config *config); | ||
45 | |||
27 | #endif | 46 | #endif |
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h index 19d40bdc..881805b4 100644 --- a/include/sway/input/keyboard.h +++ b/include/sway/input/keyboard.h | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | struct sway_keyboard { | 3 | struct sway_keyboard { |
4 | struct sway_seat *seat; | 4 | struct sway_seat *seat; |
5 | struct wlr_input_device *device; | 5 | struct sway_input_device *device; |
6 | struct wl_list link; // sway_seat::keyboards | 6 | struct wl_list link; // sway_seat::keyboards |
7 | 7 | ||
8 | struct wl_listener keyboard_key; | 8 | struct wl_listener keyboard_key; |
@@ -10,6 +10,6 @@ struct sway_keyboard { | |||
10 | }; | 10 | }; |
11 | 11 | ||
12 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, | 12 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, |
13 | struct wlr_input_device *device); | 13 | struct sway_input_device *device); |
14 | 14 | ||
15 | void sway_keyboard_destroy(struct sway_keyboard *keyboard); | 15 | void sway_keyboard_destroy(struct sway_keyboard *keyboard); |
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 5455601e..bd94a357 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -10,26 +10,21 @@ struct sway_seat { | |||
10 | struct sway_input_manager *input; | 10 | struct sway_input_manager *input; |
11 | swayc_t *focus; | 11 | swayc_t *focus; |
12 | 12 | ||
13 | struct wl_list keyboards; // sway_keyboard::link | 13 | list_t *devices; |
14 | struct wl_list pointers; // sway_pointer::link | ||
15 | 14 | ||
16 | struct wl_listener focus_destroy; | 15 | struct wl_listener focus_destroy; |
17 | }; | ||
18 | 16 | ||
19 | struct sway_pointer { | 17 | struct wl_list link; // input_manager::seats |
20 | struct sway_seat *seat; | ||
21 | struct wlr_input_device *device; | ||
22 | struct wl_list link; | ||
23 | }; | 18 | }; |
24 | 19 | ||
25 | struct sway_seat *sway_seat_create(struct sway_input_manager *input, | 20 | struct sway_seat *sway_seat_create(struct sway_input_manager *input, |
26 | const char *seat_name); | 21 | const char *seat_name); |
27 | 22 | ||
28 | void sway_seat_add_device(struct sway_seat *seat, | 23 | void sway_seat_add_device(struct sway_seat *seat, |
29 | struct wlr_input_device *device); | 24 | struct sway_input_device *device); |
30 | 25 | ||
31 | void sway_seat_remove_device(struct sway_seat *seat, | 26 | void sway_seat_remove_device(struct sway_seat *seat, |
32 | struct wlr_input_device *device); | 27 | struct sway_input_device *device); |
33 | 28 | ||
34 | void sway_seat_configure_xcursor(struct sway_seat *seat); | 29 | void sway_seat_configure_xcursor(struct sway_seat *seat); |
35 | 30 | ||