aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-14 11:11:56 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-14 11:11:56 -0500
commit92fef27eaa0b52c9d37bdabff14ae21cd6660f46 (patch)
tree7a923bbbc233079006597d82721117bae88b6ac6 /include/sway/input
parentseat configuration (diff)
downloadsway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.tar.gz
sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.tar.zst
sway-92fef27eaa0b52c9d37bdabff14ae21cd6660f46.zip
basic configuration
Diffstat (limited to 'include/sway/input')
-rw-r--r--include/sway/input/input-manager.h9
-rw-r--r--include/sway/input/keyboard.h9
-rw-r--r--include/sway/input/seat.h20
3 files changed, 29 insertions, 9 deletions
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
8extern struct input_config *current_input_config; 8extern struct input_config *current_input_config;
9extern 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
41void sway_input_manager_configure_xcursor(struct sway_input_manager *input); 41void sway_input_manager_configure_xcursor(struct sway_input_manager *input);
42 42
43void sway_input_manager_apply_config(struct sway_input_manager *input, 43void sway_input_manager_apply_input_config(struct sway_input_manager *input,
44 struct input_config *config); 44 struct input_config *input_config);
45
46void 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
3struct sway_keyboard { 3struct 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
12struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, 13struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,
13 struct sway_input_device *device); 14 struct sway_seat_device *device);
15
16void sway_keyboard_configure(struct sway_keyboard *keyboard);
14 17
15void sway_keyboard_destroy(struct sway_keyboard *keyboard); 18void 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
7struct 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
7struct sway_seat { 15struct 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,
23void sway_seat_add_device(struct sway_seat *seat, 32void sway_seat_add_device(struct sway_seat *seat,
24 struct sway_input_device *device); 33 struct sway_input_device *device);
25 34
35void sway_seat_configure_device(struct sway_seat *seat,
36 struct sway_input_device *device);
37
26void sway_seat_remove_device(struct sway_seat *seat, 38void 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
31void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container); 43void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container);
32 44
45void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config);
46
33#endif 47#endif