Hash :
44c8deb2
Author :
Date :
2025-05-07T10:20:25
Introduce keymap format v2 and make it the default for parsing - Added `XKB_KEYMAP_FORMAT_TEXT_V2`. - Made `xkb_keymap_new_from_names()` use the new keymap format. - Made the tools default to the new keymap format for input. This is in preparation for changes in the parsing & state handling. For now it changes nothing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/*
* Copyright © 2025 Pierre Le Marre <dev@wismill.eu>
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include "config.h"
#include "xkbcommon/xkbcommon.h"
#define DEFAULT_INPUT_KEYMAP_FORMAT XKB_KEYMAP_FORMAT_TEXT_V2
#define DEFAULT_OUTPUT_KEYMAP_FORMAT XKB_KEYMAP_USE_ORIGINAL_FORMAT
/**
* Provide an array of the supported keymap formats, sorted in ascending order
* (newest last).
*
* @param[out] formats An array of the supported keymap formats.
*
* @returns The size of the array.
*
* @memberof xkb_keymap
*/
size_t
xkb_keymap_supported_formats(const enum xkb_keymap_format **formats);
/**
* Check if the given keymap format is supported.
*
* @param[in] format A keymap format to test.
*
* @memberof xkb_keymap
*/
bool
xkb_keymap_is_supported_format(enum xkb_keymap_format format);
/**
* Parse a keymap version.
*
* @param[in] raw A raw keymap format string. May be the numeric value or the
* label of the version, starting with `v`.
*
* @return The corresponding format or 0 on error.
*/
enum xkb_keymap_format
xkb_keymap_parse_format(const char *raw);