From a1978b1299952586a2fd016aab682c7fdbe735ee Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Fri, 28 Jan 2022 13:55:28 -0500 Subject: types/wlr_keyboard: add base wlr_input_device wlr_keyboard owns its base wlr_input_device. It will be initialized when the keyboard is initialized, and finished when the keyboard is destroyed. --- include/wlr/interfaces/wlr_keyboard.h | 2 +- include/wlr/types/wlr_keyboard.h | 3 +++ include/wlr/types/wlr_keyboard_group.h | 2 -- include/wlr/types/wlr_virtual_keyboard_v1.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include/wlr') diff --git a/include/wlr/interfaces/wlr_keyboard.h b/include/wlr/interfaces/wlr_keyboard.h index 5d537827..4bcef57b 100644 --- a/include/wlr/interfaces/wlr_keyboard.h +++ b/include/wlr/interfaces/wlr_keyboard.h @@ -18,7 +18,7 @@ struct wlr_keyboard_impl { }; void wlr_keyboard_init(struct wlr_keyboard *keyboard, - const struct wlr_keyboard_impl *impl); + const struct wlr_keyboard_impl *impl, const char *name); void wlr_keyboard_destroy(struct wlr_keyboard *keyboard); void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard, struct wlr_event_keyboard_key *event); diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index ea16c432..b3be053a 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #define WLR_LED_COUNT 3 @@ -48,6 +49,8 @@ struct wlr_keyboard_modifiers { }; struct wlr_keyboard { + struct wlr_input_device base; + const struct wlr_keyboard_impl *impl; struct wlr_keyboard_group *group; diff --git a/include/wlr/types/wlr_keyboard_group.h b/include/wlr/types/wlr_keyboard_group.h index cb73899a..3906d948 100644 --- a/include/wlr/types/wlr_keyboard_group.h +++ b/include/wlr/types/wlr_keyboard_group.h @@ -11,11 +11,9 @@ #include #include -#include struct wlr_keyboard_group { struct wlr_keyboard keyboard; - struct wlr_input_device *input_device; struct wl_list devices; // keyboard_group_device::link struct wl_list keys; // keyboard_group_key::link diff --git a/include/wlr/types/wlr_virtual_keyboard_v1.h b/include/wlr/types/wlr_virtual_keyboard_v1.h index a3f4e452..8be6158d 100644 --- a/include/wlr/types/wlr_virtual_keyboard_v1.h +++ b/include/wlr/types/wlr_virtual_keyboard_v1.h @@ -26,7 +26,7 @@ struct wlr_virtual_keyboard_manager_v1 { }; struct wlr_virtual_keyboard_v1 { - struct wlr_input_device input_device; + struct wlr_keyboard keyboard; struct wl_resource *resource; struct wlr_seat *seat; bool has_keymap; -- cgit v1.2.3