|
libxkbcommon 1.13.0
Library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
|
Modules | |
| Keymap formats | |
Data Structures | |
| struct | xkb_keymap_serialize_config |
| struct | xkb_keymap_serialize_result |
Macros | |
| #define | XKB_KEYMAP_USE_ORIGINAL_FORMAT ((enum xkb_keymap_format) -1) |
Enumerations | |
| enum | xkb_keymap_serialize_flags { XKB_KEYMAP_SERIALIZE_NO_FLAGS = 0 , XKB_KEYMAP_SERIALIZE_PRETTY = (1 << 0) , XKB_KEYMAP_SERIALIZE_KEEP_UNUSED = (1 << 1) , XKB_KEYMAP_SERIALIZE_STRICT_MODE = (1 << 2) , XKB_KEYMAP_SERIALIZE_EXPLICIT_DEFAULT_VALUES = (1 << 3) , XKB_KEYMAP_SERIALIZE_EXPLICIT_VMODS = (1 << 4) , XKB_KEYMAP_SERIALIZE_EXPLICIT_KEY_VALUES = (1 << 5) } |
Functions | |
| XKB_EXPORT enum xkb_error_code | xkb_keymap::xkb_keymap_serialize (const struct xkb_keymap *keymap, const struct xkb_keymap_serialize_config *config, struct xkb_keymap_serialize_result *result) |
| XKB_EXPORT char * | xkb_keymap::xkb_keymap_get_as_string (struct xkb_keymap *keymap, enum xkb_keymap_format format) |
| XKB_EXPORT char * | xkb_keymap::xkb_keymap_get_as_string2 (struct xkb_keymap *keymap, enum xkb_keymap_format format, enum xkb_keymap_serialize_flags flags) |
Serializing 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.
Flags to control keymap serialization.
| Enumerator | |
|---|---|
| XKB_KEYMAP_SERIALIZE_NO_FLAGS | Do not apply any flags.
|
| XKB_KEYMAP_SERIALIZE_PRETTY | Enable pretty-printing.
|
| XKB_KEYMAP_SERIALIZE_KEEP_UNUSED | Do not drop unused bits (key types, compatibility entries)
|
| XKB_KEYMAP_SERIALIZE_STRICT_MODE | Make the serializer operate in strict mode. This is useful mainly for debugging. When this flag is set, the following will raise an error:
|
| XKB_KEYMAP_SERIALIZE_EXPLICIT_DEFAULT_VALUES | Force default values to be explicit. This is useful mainly for debugging.
|
| XKB_KEYMAP_SERIALIZE_EXPLICIT_VMODS | Force [virtual modifier] encoding to be explicit. This is useful mainly for debugging.
|
| XKB_KEYMAP_SERIALIZE_EXPLICIT_KEY_VALUES | Force key values to be explicit. This is useful mainly for debugging, as it may increase considerably the size of the serialization. This is useful mainly for debugging.
|
| XKB_EXPORT enum xkb_error_code xkb_keymap_serialize | ( | const struct xkb_keymap * | keymap, |
| const struct xkb_keymap_serialize_config * | config, | ||
| struct xkb_keymap_serialize_result * | result | ||
| ) |
Serialize a compiled keymap to a string.
On success, returns a newly allocated serialized keymap in `result->serialized`, together with additional metadata. It is suitable to use with xkb_keymap_new_from_string2().
Use this function instead of xkb_keymap_get_as_string() or xkb_keymap_get_as_string2() when more control on serializing or its result is required.
XKB_KEYMAP_FORMAT_TEXT_V1,| [in] | keymap | The keymap to serialize. |
| [in] | config | Configuration guiding the serialization. |
| [in,out] | result | Result of the serialization. |
config must point to a zero-initialized struct with `size` set to sizeof(*config).result must point to a zero-initialized struct with `size` set to sizeof(*result).result that fall within result->size.XKB_SUCCESS, the caller is responsible for freeing `result->serialized`.NULL and all fields of result beyond it are left unspecified.XKB_SUCCESS on success; otherwise an error code.| XKB_EXPORT char * xkb_keymap_get_as_string | ( | struct xkb_keymap * | keymap, |
| enum xkb_keymap_format | format | ||
| ) |
Get the compiled keymap as a string.
Same as xkb_keymap::xkb_keymap_get_as_string2() using XKB_KEYMAP_SERIALIZE_NO_FLAGS.
| XKB_EXPORT char * xkb_keymap_get_as_string2 | ( | struct xkb_keymap * | keymap, |
| enum xkb_keymap_format | format, | ||
| enum xkb_keymap_serialize_flags | flags | ||
| ) |
Get the compiled keymap as a string.
| [in] | keymap | The keymap to get as a string. |
| [in] | 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. When used as an interchange format such as Wayland xkb_v1, the format should be explicit. |
| [in] | flags | Optional flags to control the serialization, or 0. |
NULL-terminated string, or NULL if unsuccessful.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.