aboutsummaryrefslogtreecommitdiff
path: root/kbd.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-10-27 15:21:19 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-10-27 15:21:19 +0000
commit061bbd704961b17419fd69344af6268487abb926 (patch)
treedbcd298ccffd325fb97e3deaee5d151df55f4bf8 /kbd.c
parentwayland: move clipboard/primary structs into the wayland struct (diff)
kbd: break out XKB kbd struct to a separate file
Diffstat (limited to 'kbd.c')
-rw-r--r--kbd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kbd.c b/kbd.c
new file mode 100644
index 00000000..c38e77ba
--- /dev/null
+++ b/kbd.c
@@ -0,0 +1,18 @@
+#include "kbd.h"
+
+#include <xkbcommon/xkbcommon-compose.h>
+
+void
+kbd_destroy(struct kbd *kbd)
+{
+ if (kbd->xkb_compose_state != NULL)
+ xkb_compose_state_unref(kbd->xkb_compose_state);
+ if (kbd->xkb_compose_table != NULL)
+ xkb_compose_table_unref(kbd->xkb_compose_table);
+ if (kbd->xkb_keymap != NULL)
+ xkb_keymap_unref(kbd->xkb_keymap);
+ if (kbd->xkb_state != NULL)
+ xkb_state_unref(kbd->xkb_state);
+ if (kbd->xkb != NULL)
+ xkb_context_unref(kbd->xkb);
+}