| 1 |
/* |
| 2 |
* Copyright © 2025 Pierre Le Marre <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: MIT |
| 5 |
*/ |
| 6 |
|
| 7 |
#pragma once |
| 8 |
|
| 9 |
#include "config.h" |
| 10 |
|
| 11 |
#include "xkbcommon/xkbcommon.h" |
| 12 |
|
| 13 |
#define DEFAULT_INPUT_KEYMAP_FORMAT XKB_KEYMAP_FORMAT_TEXT_V2 |
| 14 |
#define DEFAULT_OUTPUT_KEYMAP_FORMAT XKB_KEYMAP_USE_ORIGINAL_FORMAT |
| 15 |
|
| 16 |
/** |
| 17 |
* Provide an array of the supported keymap formats, sorted in ascending order |
| 18 |
* (newest last). |
| 19 |
* |
| 20 |
* @param[out] formats An array of the supported keymap formats. |
| 21 |
* |
| 22 |
* @returns The size of the array. |
| 23 |
* |
| 24 |
* @memberof xkb_keymap |
| 25 |
*/ |
| 26 |
size_t |
| 27 |
xkb_keymap_supported_formats(const enum xkb_keymap_format **formats); |
| 28 |
|
| 29 |
/** |
| 30 |
* Check if the given keymap format is supported. |
| 31 |
* |
| 32 |
* @param[in] format A keymap format to test. |
| 33 |
* |
| 34 |
* @memberof xkb_keymap |
| 35 |
*/ |
| 36 |
bool |
| 37 |
xkb_keymap_is_supported_format(enum xkb_keymap_format format); |
| 38 |
|
| 39 |
/** |
| 40 |
* Parse a keymap version. |
| 41 |
* |
| 42 |
* @param[in] raw A raw keymap format string. May be the numeric value or the |
| 43 |
* label of the version, starting with `v`. |
| 44 |
* |
| 45 |
* @return The corresponding format or 0 on error. |
| 46 |
*/ |
| 47 |
enum xkb_keymap_format |
| 48 |
xkb_keymap_parse_format(const char *raw); |