libxkbcommon
1.8.0
Library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
|
Macros | |
#define | XKB_KEYMAP_USE_ORIGINAL_FORMAT ((enum xkb_keymap_format) -1) |
Enumerations | |
enum | xkb_keymap_compile_flags { XKB_KEYMAP_COMPILE_NO_FLAGS = 0 } |
enum | xkb_keymap_format { XKB_KEYMAP_FORMAT_TEXT_V1 = 1 } |
Creating and destroying keymaps.
#define XKB_KEYMAP_USE_ORIGINAL_FORMAT ((enum xkb_keymap_format) -1) |
Get the keymap as a string in the format from which it was created.
enum xkb_keymap_format |
XKB_EXPORT struct xkb_keymap * xkb_keymap_new_from_names | ( | struct xkb_context * | context, |
const struct xkb_rule_names * | names, | ||
enum xkb_keymap_compile_flags | flags | ||
) |
Create a keymap from RMLVO names.
The primary keymap entry point: creates a new XKB keymap from a set of RMLVO (Rules + Model + Layouts + Variants + Options) names.
context | The context in which to create the keymap. |
names | The RMLVO names to use. See xkb_rule_names. |
flags | Optional flags for the keymap, or 0. |
XKB_EXPORT struct xkb_keymap * xkb_keymap_new_from_file | ( | struct xkb_context * | context, |
FILE * | file, | ||
enum xkb_keymap_format | format, | ||
enum xkb_keymap_compile_flags | flags | ||
) |
Create a keymap from a keymap file.
context | The context in which to create the keymap. |
file | The keymap file to compile. |
format | The text format of the keymap file to compile. |
flags | Optional flags for the keymap, or 0. |
The file must contain a complete keymap. For example, in the XKB_KEYMAP_FORMAT_TEXT_V1 format, this means the file must contain one top level 'xkb_keymap' section, which in turn contains other required sections.
XKB_EXPORT struct xkb_keymap * xkb_keymap_new_from_string | ( | struct xkb_context * | context, |
const char * | string, | ||
enum xkb_keymap_format | format, | ||
enum xkb_keymap_compile_flags | flags | ||
) |
Create a keymap from a keymap string.
This is just like xkb_keymap_new_from_file(), but instead of a file, gets the keymap as one enormous string.
XKB_EXPORT struct xkb_keymap * xkb_keymap_new_from_buffer | ( | struct xkb_context * | context, |
const char * | buffer, | ||
size_t | length, | ||
enum xkb_keymap_format | format, | ||
enum xkb_keymap_compile_flags | flags | ||
) |
Create a keymap from a memory buffer.
This is just like xkb_keymap_new_from_string(), but takes a length argument so the input string does not have to be zero-terminated.
XKB_EXPORT struct xkb_keymap * xkb_keymap_ref | ( | struct xkb_keymap * | keymap | ) |
Take a new reference on a keymap.
XKB_EXPORT void xkb_keymap_unref | ( | struct xkb_keymap * | keymap | ) |
Release a reference on a keymap, and possibly free it.
keymap | The keymap. If it is NULL, this function does nothing. |
XKB_EXPORT char * xkb_keymap_get_as_string | ( | struct xkb_keymap * | keymap, |
enum xkb_keymap_format | format | ||
) |
Get the compiled keymap as a string.
keymap | The keymap to get as a string. |
format | The keymap format to use for the string. You can pass in the special value XKB_KEYMAP_USE_ORIGINAL_FORMAT to use the format from which the keymap was originally created. |
The returned string may be fed back into xkb_keymap_new_from_string() to get the exact same keymap (possibly in another process, etc.).
The returned string is dynamically allocated and should be freed by the caller.