diff options
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/meson.build | 1 | ||||
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_keyboard_group.h | 37 |
3 files changed, 40 insertions, 0 deletions
diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build index 288fd1c5..aee5c6d9 100644 --- a/include/wlr/types/meson.build +++ b/include/wlr/types/meson.build @@ -16,6 +16,7 @@ install_headers( 'wlr_input_inhibitor.h', 'wlr_input_method_v2.h', 'wlr_keyboard.h', + 'wlr_keyboard_group.h', 'wlr_layer_shell_v1.h', 'wlr_linux_dmabuf_v1.h', 'wlr_list.h', diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index e16df7a7..9bd4acd9 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -49,6 +49,7 @@ struct wlr_keyboard_modifiers { struct wlr_keyboard { const struct wlr_keyboard_impl *impl; + struct wlr_keyboard_group *group; char *keymap_string; size_t keymap_size; @@ -84,6 +85,7 @@ struct wlr_keyboard { struct wl_signal modifiers; struct wl_signal keymap; struct wl_signal repeat_info; + struct wl_signal destroy; } events; void *data; diff --git a/include/wlr/types/wlr_keyboard_group.h b/include/wlr/types/wlr_keyboard_group.h new file mode 100644 index 00000000..023887f3 --- /dev/null +++ b/include/wlr/types/wlr_keyboard_group.h @@ -0,0 +1,37 @@ +/* + * This an unstable interface of wlroots. No guarantees are made regarding the + * future consistency of this API. + */ +#ifndef WLR_USE_UNSTABLE +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" +#endif + +#ifndef WLR_TYPES_WLR_KEYBOARD_GROUP_H +#define WLR_TYPES_WLR_KEYBOARD_GROUP_H + +#include <wayland-server-core.h> +#include "wlr/types/wlr_keyboard.h" +#include "wlr/types/wlr_input_device.h" + +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 + void *data; +}; + +struct wlr_keyboard_group *wlr_keyboard_group_create(void); + +struct wlr_keyboard_group *wlr_keyboard_group_from_wlr_keyboard( + struct wlr_keyboard *keyboard); + +bool wlr_keyboard_group_add_keyboard(struct wlr_keyboard_group *group, + struct wlr_keyboard *keyboard); + +void wlr_keyboard_group_remove_keyboard(struct wlr_keyboard_group *group, + struct wlr_keyboard *keyboard); + +void wlr_keyboard_group_destroy(struct wlr_keyboard_group *group); + +#endif |