| 1 |
/* |
| 2 |
* Copyright © 2025 Pierre Le Marre <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: MIT |
| 5 |
*/ |
| 6 |
|
| 7 |
#include "config.h" |
| 8 |
|
| 9 |
#include <stdbool.h> |
| 10 |
|
| 11 |
#include "xkbcommon/xkbcommon.h" |
| 12 |
#include "utils.h" |
| 13 |
|
| 14 |
/** |
| 15 |
* Keymap properties to compare in `xkb_keymap_compare()`. |
| 16 |
* |
| 17 |
* The level of detail should be adjusted to the need. |
| 18 |
*/ |
| 19 |
enum xkb_keymap_compare_property { |
| 20 |
XKB_KEYMAP_CMP_MODS = (1u << 0), |
| 21 |
XKB_KEYMAP_CMP_LEDS = (1u << 1), |
| 22 |
XKB_KEYMAP_CMP_TYPES = (1u << 2), |
| 23 |
/* TODO: compat entries */ |
| 24 |
XKB_KEYMAP_CMP_KEYCODES = (1u << 3), |
| 25 |
XKB_KEYMAP_CMP_SYMBOLS = (1u << 4), |
| 26 |
XKB_KEYMAP_CMP_ALL = XKB_KEYMAP_CMP_MODS |
| 27 |
| XKB_KEYMAP_CMP_LEDS |
| 28 |
| XKB_KEYMAP_CMP_TYPES |
| 29 |
| XKB_KEYMAP_CMP_KEYCODES |
| 30 |
| XKB_KEYMAP_CMP_SYMBOLS, |
| 31 |
/* TODO: add interprets to next */ |
| 32 |
XKB_KEYMAP_CMP_POSSIBLY_DROPPED = XKB_KEYMAP_CMP_TYPES, |
| 33 |
}; |
| 34 |
|
| 35 |
XKB_EXPORT_PRIVATE bool |
| 36 |
xkb_keymap_compare(struct xkb_context *ctx, |
| 37 |
const struct xkb_keymap *keymap1, |
| 38 |
const struct xkb_keymap *keymap2, |
| 39 |
enum xkb_keymap_compare_property properties); |