aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-11-03 09:01:34 -0400
committerTony Crisci <tony@dubstepdish.com>2017-11-04 09:23:57 -0400
commit5354fe8729b8c52f8f3ff63f23f932c49bf8c880 (patch)
tree31b9c35b26329961e269724ede16cb1981ce0fb9 /include
parent9bd0f47efd9a0c851d1715f3b9427b5f51b6d8a3 (diff)
move keyboard to seat
Diffstat (limited to 'include')
-rw-r--r--include/rootston/input.h1
-rw-r--r--include/rootston/keyboard.h15
-rw-r--r--include/rootston/seat.h26
-rw-r--r--include/wlr/interfaces/wlr_keyboard.h3
-rw-r--r--include/wlr/types/wlr_keyboard.h11
5 files changed, 50 insertions, 6 deletions
diff --git a/include/rootston/input.h b/include/rootston/input.h
index 6d07de43..7b1358f8 100644
--- a/include/rootston/input.h
+++ b/include/rootston/input.h
@@ -67,6 +67,7 @@ struct roots_input {
struct wl_list pointers;
struct wl_list touch;
struct wl_list tablet_tools;
+ struct wl_list seats;
struct wl_listener input_add;
struct wl_listener input_remove;
diff --git a/include/rootston/keyboard.h b/include/rootston/keyboard.h
index f4acc0aa..cb639ba1 100644
--- a/include/rootston/keyboard.h
+++ b/include/rootston/keyboard.h
@@ -8,21 +8,28 @@
struct roots_keyboard {
struct roots_input *input;
+ struct roots_seat *seat;
struct wlr_input_device *device;
- struct wl_listener key;
- struct wl_listener modifiers;
+ struct wl_list seat_link;
+ // XXX temporary
struct wl_list link;
+ struct wl_listener keyboard_key;
+ struct wl_listener keyboard_modifiers;
+
xkb_keysym_t pressed_keysyms[ROOTS_KEYBOARD_PRESSED_KEYSYMS_CAP];
};
struct roots_keyboard *roots_keyboard_create(struct wlr_input_device *device,
struct roots_input *input);
-void roots_keyboard_destroy(struct wlr_input_device *device, struct roots_input *input);
+
+void roots_keyboard_destroy(struct wlr_input_device *device,
+ struct roots_input *input);
void roots_keyboard_handle_key(struct roots_keyboard *keyboard,
struct wlr_event_keyboard_key *event);
-void roots_keyboard_handle_modifiers(struct roots_keyboard *r_keyboard);
+void roots_keyboard_handle_modifiers(struct roots_keyboard *r_keyboard,
+ struct wlr_event_keyboard_modifiers *event);
#endif
diff --git a/include/rootston/seat.h b/include/rootston/seat.h
new file mode 100644
index 00000000..f6db63cc
--- /dev/null
+++ b/include/rootston/seat.h
@@ -0,0 +1,26 @@
+#ifndef _ROOTSTON_SEAT_H
+#define _ROOTSTON_SEAT_H
+
+#include <wayland-server.h>
+
+#include "rootston/input.h"
+#include "rootston/keyboard.h"
+
+struct roots_seat {
+ struct roots_input *input;
+ struct wlr_seat *seat;
+ struct wl_list keyboards;
+ struct wl_list link;
+};
+
+struct roots_seat *roots_seat_create(struct roots_input *input, char *name);
+
+void roots_seat_destroy(struct roots_seat *seat);
+
+void roots_seat_add_keyboard(struct roots_seat *seat,
+ struct roots_keyboard *keyboard);
+
+void roots_seat_remove_keyboard(struct roots_seat *seat,
+ struct roots_keyboard *keyboard);
+
+#endif
diff --git a/include/wlr/interfaces/wlr_keyboard.h b/include/wlr/interfaces/wlr_keyboard.h
index 570f5721..5848416d 100644
--- a/include/wlr/interfaces/wlr_keyboard.h
+++ b/include/wlr/interfaces/wlr_keyboard.h
@@ -14,7 +14,6 @@ void wlr_keyboard_destroy(struct wlr_keyboard *keyboard);
void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
struct wlr_event_keyboard_key *event);
void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
- uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked,
- uint32_t group);
+ struct wlr_event_keyboard_modifiers *event);
#endif
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h
index af837ff5..c42cea9c 100644
--- a/include/wlr/types/wlr_keyboard.h
+++ b/include/wlr/types/wlr_keyboard.h
@@ -63,12 +63,23 @@ enum wlr_key_state {
};
struct wlr_event_keyboard_key {
+ struct wlr_input_device *device;
+ struct wlr_keyboard *keyboard;
uint32_t time_msec;
uint32_t keycode;
bool update_state;
enum wlr_key_state state;
};
+struct wlr_event_keyboard_modifiers {
+ struct wlr_input_device *device;
+ struct wlr_keyboard *keyboard;
+ uint32_t mods_depressed;
+ uint32_t mods_latched;
+ uint32_t mods_locked;
+ uint32_t group;
+};
+
void wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
struct xkb_keymap *keymap);
void wlr_keyboard_led_update(struct wlr_keyboard *keyboard, uint32_t leds);