Hash :
3d79f459
Author :
Date :
2025-03-29T11:46:34
xkbcomp: Add Unicode code point escape sequence \u{NNNN}
Unicode code point escape sequences `\u{NNNN}` are replaced with the
UTF-8 encoding of their corresponding code point `U+NNNN`, if legal.
Supported Unicode code points are in the range `1‥0x10ffff`.
Note that we will reject the `U+0000` NULL code point, as we reject it
in the octal escape sequence `\0`.
This is intended mainly for the upcoming feature to write keysyms as
UTF-8 encoded strings. It can be used for various reasons:
- avoid encoding issues;
- avoid issue with font rendering (e.g. Asian scripts);
- make white space or zero-width characters more readable.
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
// NOTE: This file has been generated automatically by “update-message-registry.py”.
// Do not edit manually!
#pragma once
#include <stdint.h>
/*
* Macro sorcery: PREPEND_MESSAGE_ID enables the log functions to format messages
* with the message ID only if the ID is not 0 (XKB_LOG_MESSAGE_NO_ID).
* This avoid checking the ID value at run time.
*
* The trick resides in CHECK_ID:
* • CHECK_ID(0) expands to:
* ‣ SECOND(MATCH0, WITH_ID, unused)
* ‣ SECOND(unused,WITHOUT_ID, WITH_ID, unused)
* ‣ WITHOUT_ID
* • CHECK_ID(123) expands to:
* ‣ SECOND(MATCH123, WITH_ID, unused)
* ‣ WITH_ID
*/
#define EXPAND(...) __VA_ARGS__ /* needed for MSVC compatibility */
#define JOIN_EXPAND(a, b) a##b
#define JOIN(a, b) JOIN_EXPAND(a, b)
#define SECOND_EXPAND(a, b, ...) b
#define SECOND(...) EXPAND(SECOND_EXPAND(__VA_ARGS__))
#define MATCH0 unused,WITHOUT_ID
#define CHECK_ID(value) SECOND(JOIN(MATCH, value), WITH_ID, unused)
#define FORMAT_MESSAGE_WITHOUT_ID(id, fmt) fmt
#define FORMAT_MESSAGE_WITH_ID(id, fmt) "[XKB-%03d] " fmt, id
#define PREPEND_MESSAGE_ID(id, fmt) JOIN(FORMAT_MESSAGE_, CHECK_ID(id))(id, fmt)
/**
* Special case when no message identifier is defined.
*/
#define XKB_LOG_MESSAGE_NO_ID 0
/**
* @name Codes of the log messages
*/
enum xkb_message_code {
_XKB_LOG_MESSAGE_MIN_CODE = 34,
/** Warn on malformed number literals */
XKB_ERROR_MALFORMED_NUMBER_LITERAL = 34,
/** Conflicting “preserve” entries in a key type */
XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES = 43,
/** Warn on unsupported modifier mask */
XKB_ERROR_UNSUPPORTED_MODIFIER_MASK = 60,
/** Expected an array entry, but the index is missing */
XKB_ERROR_EXPECTED_ARRAY_ENTRY = 77,
/** Invalid numeric keysym */
XKB_ERROR_INVALID_NUMERIC_KEYSYM = 82,
/** Illegal keycode alias with the name of a real key */
XKB_WARNING_ILLEGAL_KEYCODE_ALIAS = 101,
/** Warn on unrecognized keysyms */
XKB_WARNING_UNRECOGNIZED_KEYSYM = 107,
/** A virtual modifier is used before being declared */
XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER = 123,
/** A buffer has an insufficient size */
XKB_ERROR_INSUFFICIENT_BUFFER_SIZE = 134,
/** The type of the statement is not allowed in the context */
XKB_ERROR_WRONG_STATEMENT_TYPE = 150,
/** The given path is invalid */
XKB_ERROR_INVALID_PATH = 161,
/** Geometry sections are not supported */
XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION = 172,
/** Warn if no key type can be inferred */
XKB_WARNING_CANNOT_INFER_KEY_TYPE = 183,
/** Invalid escape sequence in a string */
XKB_WARNING_INVALID_ESCAPE_SEQUENCE = 193,
/** The result of a key type “preserve” entry must be a subset of its input modifiers. */
XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT = 195,
/** Syntax error in the include statement */
XKB_ERROR_INVALID_INCLUDE_STATEMENT = 203,
/** A modmap entry is invalid */
XKB_ERROR_INVALID_MODMAP_ENTRY = 206,
/** Warn when a group index is not supported */
XKB_ERROR_UNSUPPORTED_GROUP_INDEX = 237,
/** The name of a key type level is defined multiple times. */
XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES = 239,
/** Invalid statement setting default values */
XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT = 254,
/** Conflicting “map” entries in type definition */
XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY = 266,
/** Warn if using an undefined key type */
XKB_WARNING_UNDEFINED_KEY_TYPE = 286,
/** A keysym has been deprecated: consider using an alternative keysym */
XKB_WARNING_DEPRECATED_KEYSYM = 301,
/** A keysym name has been deprecated: use the corresponding canonical name instead */
XKB_WARNING_DEPRECATED_KEYSYM_NAME = 302,
/** Warn if a group name was defined for group other than the first one */
XKB_WARNING_NON_BASE_GROUP_NAME = 305,
/** Warn when a shift level is not supported */
XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL = 312,
/** Could not find a file used in an include statement */
XKB_ERROR_INCLUDED_FILE_NOT_FOUND = 338,
/** Use of an operator that is unknown and thus unsupported */
XKB_ERROR_UNKNOWN_OPERATOR = 345,
/** An entry is duplicated and will be ignored */
XKB_WARNING_DUPLICATE_ENTRY = 378,
/** Included files form cycle */
XKB_ERROR_RECURSIVE_INCLUDE = 386,
/** Conflicting definitions of a key type */
XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS = 407,
/** A global defaults statement is in a wrong scope and should be moved */
XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE = 428,
/** Missing default section in included file */
XKB_WARNING_MISSING_DEFAULT_SECTION = 433,
/** Warn if there are conflicting keysyms while merging keys */
XKB_WARNING_CONFLICTING_KEY_SYMBOL = 461,
/** The operation is invalid in the context */
XKB_ERROR_INVALID_OPERATION = 478,
/** Warn on numeric keysym (other than 0-9) */
XKB_WARNING_NUMERIC_KEYSYM = 489,
/** TODO: add description */
XKB_WARNING_EXTRA_SYMBOLS_IGNORED = 516,
/** Conflicting definitions of a key name or alias */
XKB_WARNING_CONFLICTING_KEY_NAME = 523,
/** Invalid file encoding */
XKB_ERROR_INVALID_FILE_ENCODING = 542,
/** Cannot allocate memory */
XKB_ERROR_ALLOCATION_ERROR = 550,
/** Warn when a field has not the expected type */
XKB_ERROR_WRONG_FIELD_TYPE = 578,
/** Cannot resolve a given (Rules, Model, Layout, Variant, Options) configuration */
XKB_ERROR_CANNOT_RESOLVE_RMLVO = 595,
/** Invalid Unicode escape sequence */
XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE = 607,
/** Invalid _real_ modifier */
XKB_ERROR_INVALID_REAL_MODIFIER = 623,
/** Warn on unknown escape sequence in string literal */
XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE = 645,
/** The target file of an include statement could not be processed */
XKB_ERROR_INVALID_INCLUDED_FILE = 661,
/** The Compose file syntax is invalid and the entry cannot be parsed */
XKB_ERROR_INVALID_COMPOSE_SYNTAX = 685,
/** A level has a different number of keysyms and actions */
XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT = 693,
/** Warn if a key defines multiple groups at once */
XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE = 700,
/** A legacy X11 symbol field is not supported */
XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD = 711,
/** The XKB syntax is invalid and the file cannot be parsed */
XKB_ERROR_INVALID_XKB_SYNTAX = 769,
/** Reference to an undefined keycode */
XKB_WARNING_UNDEFINED_KEYCODE = 770,
/** An expression has not the expected type */
XKB_ERROR_INVALID_EXPRESSION_TYPE = 784,
/** A value is invalid and will be ignored */
XKB_ERROR_INVALID_VALUE = 796,
/** Warn if there are conflicting modmap definitions */
XKB_WARNING_CONFLICTING_MODMAP = 800,
/** A field is unknown and will be ignored */
XKB_ERROR_UNKNOWN_FIELD = 812,
/** Keymap compilation failed */
XKB_ERROR_KEYMAP_COMPILATION_FAILED = 822,
/** Warn if there are conflicting actions while merging keys */
XKB_WARNING_CONFLICTING_KEY_ACTION = 883,
/** Warn if there are conflicting key types while merging groups */
XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS = 893,
/** Conflicting symbols entry for a key */
XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY = 901,
/** Missing group index in a group name entry */
XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX = 903,
/** Warn if there are conflicting fields while merging keys */
XKB_WARNING_CONFLICTING_KEY_FIELDS = 935,
/** An identifier is used but is not built-in */
XKB_ERROR_INVALID_IDENTIFIER = 949,
/** Warn if using a symbol not defined in the keymap */
XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL = 965,
/** The rules syntax is invalid and the file cannot be parsed */
XKB_ERROR_INVALID_RULES_SYNTAX = 967,
/** Some modifiers used in a key type “map” or “preserve” entry are not declared */
XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE = 971,
_XKB_LOG_MESSAGE_MAX_CODE = 971
};
typedef uint32_t xkb_message_code_t;