summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-12 08:29:37 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-12 08:29:37 -0500
commit163edc5a900fda58e006ed30e14ae10cc4aa13b3 (patch)
treea43e355091da4545bf9f16c63accb7d853170195 /include
parentinput config (diff)
downloadsway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.tar.gz
sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.tar.zst
sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.zip
sway input device
Diffstat (limited to 'include')
-rw-r--r--include/sway/config.h1
-rw-r--r--include/sway/input/input-manager.h31
-rw-r--r--include/sway/input/keyboard.h4
-rw-r--r--include/sway/input/seat.h13
4 files changed, 32 insertions, 17 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 7de85ab7..d80f5a39 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -355,6 +355,7 @@ char *do_var_replacement(char *str);
355struct cmd_results *check_security_config(); 355struct cmd_results *check_security_config();
356 356
357int input_identifier_cmp(const void *item, const void *data); 357int input_identifier_cmp(const void *item, const void *data);
358struct input_config *new_input_config(const char* identifier);
358void merge_input_config(struct input_config *dst, struct input_config *src); 359void merge_input_config(struct input_config *dst, struct input_config *src);
359void apply_input_config(struct input_config *ic, struct libinput_device *dev); 360void apply_input_config(struct input_config *ic, struct libinput_device *dev);
360void free_input_config(struct input_config *ic); 361void free_input_config(struct input_config *ic);
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
8extern struct input_config *current_input_config; 8extern struct input_config *current_input_config;
9 9
10/**
11 * The global singleton input manager
12 * TODO: make me not a global
13 */
14extern struct sway_input_manager *input_manager;
15
16struct 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
10struct sway_input_manager { 24struct 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
17struct input_config *new_input_config(const char* identifier);
18
19char* libinput_dev_unique_id(struct libinput_device *dev);
20
21struct sway_input_manager *sway_input_manager_create( 32struct sway_input_manager *sway_input_manager_create(
22 struct sway_server *server); 33 struct sway_server *server);
23 34
24bool sway_input_manager_swayc_has_focus(struct sway_input_manager *input, 35bool sway_input_manager_has_focus(struct sway_input_manager *input,
25 swayc_t *container); 36 swayc_t *container);
26 37
38void sway_input_manager_set_focus(struct sway_input_manager *input,
39 swayc_t *container);
40
41void sway_input_manager_configure_xcursor(struct sway_input_manager *input);
42
43void 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
3struct sway_keyboard { 3struct 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
12struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, 12struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
13 struct wlr_input_device *device); 13 struct sway_input_device *device);
14 14
15void sway_keyboard_destroy(struct sway_keyboard *keyboard); 15void 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
19struct 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
25struct sway_seat *sway_seat_create(struct sway_input_manager *input, 20struct sway_seat *sway_seat_create(struct sway_input_manager *input,
26 const char *seat_name); 21 const char *seat_name);
27 22
28void sway_seat_add_device(struct sway_seat *seat, 23void sway_seat_add_device(struct sway_seat *seat,
29 struct wlr_input_device *device); 24 struct sway_input_device *device);
30 25
31void sway_seat_remove_device(struct sway_seat *seat, 26void sway_seat_remove_device(struct sway_seat *seat,
32 struct wlr_input_device *device); 27 struct sway_input_device *device);
33 28
34void sway_seat_configure_xcursor(struct sway_seat *seat); 29void sway_seat_configure_xcursor(struct sway_seat *seat);
35 30