diff options
Diffstat (limited to 'include/sway/input/input-manager.h')
-rw-r--r-- | include/sway/input/input-manager.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h new file mode 100644 index 00000000..89a3ac71 --- /dev/null +++ b/include/sway/input/input-manager.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef _SWAY_INPUT_INPUT_MANAGER_H | ||
2 | #define _SWAY_INPUT_INPUT_MANAGER_H | ||
3 | #include <libinput.h> | ||
4 | #include <wlr/types/wlr_input_inhibitor.h> | ||
5 | #include "sway/server.h" | ||
6 | #include "sway/config.h" | ||
7 | #include "list.h" | ||
8 | |||
9 | /** | ||
10 | * The global singleton input manager | ||
11 | * TODO: make me not a global | ||
12 | */ | ||
13 | extern struct sway_input_manager *input_manager; | ||
14 | |||
15 | struct sway_input_device { | ||
16 | char *identifier; | ||
17 | struct wlr_input_device *wlr_device; | ||
18 | struct wl_list link; | ||
19 | struct wl_listener device_destroy; | ||
20 | }; | ||
21 | |||
22 | struct sway_input_manager { | ||
23 | struct sway_server *server; | ||
24 | struct wl_list devices; | ||
25 | struct wl_list seats; | ||
26 | |||
27 | struct wlr_input_inhibit_manager *inhibit; | ||
28 | |||
29 | struct wl_listener new_input; | ||
30 | struct wl_listener inhibit_activate; | ||
31 | struct wl_listener inhibit_deactivate; | ||
32 | }; | ||
33 | |||
34 | struct sway_input_manager *input_manager_create(struct sway_server *server); | ||
35 | |||
36 | bool input_manager_has_focus(struct sway_input_manager *input, | ||
37 | struct sway_container *container); | ||
38 | |||
39 | void input_manager_set_focus(struct sway_input_manager *input, | ||
40 | struct sway_container *container); | ||
41 | |||
42 | void input_manager_configure_xcursor(struct sway_input_manager *input); | ||
43 | |||
44 | void input_manager_apply_input_config(struct sway_input_manager *input, | ||
45 | struct input_config *input_config); | ||
46 | |||
47 | void input_manager_apply_seat_config(struct sway_input_manager *input, | ||
48 | struct seat_config *seat_config); | ||
49 | |||
50 | struct sway_seat *input_manager_get_default_seat( | ||
51 | struct sway_input_manager *input); | ||
52 | |||
53 | struct sway_seat *input_manager_get_seat(struct sway_input_manager *input, | ||
54 | const char *seat_name); | ||
55 | |||
56 | /** | ||
57 | * Gets the last seat the user interacted with | ||
58 | */ | ||
59 | struct sway_seat *input_manager_current_seat(struct sway_input_manager *input); | ||
60 | |||
61 | struct input_config *input_device_get_config(struct sway_input_device *device); | ||
62 | |||
63 | |||
64 | #endif | ||