kbd: break out XKB kbd struct to a separate file

This commit is contained in:
Daniel Eklöf 2019-10-27 16:21:19 +01:00
parent 5ca1ee701b
commit 061bbd7049
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 56 additions and 44 deletions

18
kbd.c Normal file
View file

@ -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);
}