kc3-lang/libxkbcommon/meson.build

Branch :


Log

Author Commit Date CI Message
f5d079f5 2025-08-04 09:58:42 tools: Improve interactive events output Improved the output of events for `xkbcli interactive-*` tools: - Added `--multiline` to enable multiline event output, which provides more details and does not have formatting limitations. - Added `--uniline` to enable uniline event output. While this is the current default, future versions may switch to multiline display.
a83a482c 2025-07-18 11:27:52 tools: Add variants with automatic session type detection Added: - `xkbcli-interactive` - `xkbcli-dump-keymap`
9600981a 2025-07-01 15:54:09 bench: Add --keymap to compile-keymap `--keymap` enables using a keymap file rather than resolving RMLVO.
56a32cc8 2025-06-18 11:37:19 xkbcli-interactive-wayland: xdg-decoration-unstable-v1 Use if available, to get window decoration. Also resize the window bigger enough to make its title readable.
c4c531da 2025-06-17 11:43:50 rules: Add layout-specific options for RMLVO builder Change the signature of `xkb_rmlvo_builder_append_layout()` to accept an array of options. Also add tests for layout-specific options.
da5caabb 2025-06-16 15:45:42 Add RMLVO builder API Before this commit, the API to work with RMLVO was quite minimal: it only uses raw strings from the `xkb_rule_names` struct. However: - it forces the users to deal with error-prone string formatting; - it does not enforce tying together layouts and variants; - it limits adding new features by requiring defining delimiter characters and the corresponding parsing. Added the following API: - `xkb_rmlvo_builder_new()` - `xkb_rmlvo_builder_append_layout()` - `xkb_rmlvo_builder_append_option()` - `xkb_rmlvo_builder_unref()` There is no intermediate `layout` nor `option` object, in order to to keep the API simple. The only foreseen extension is enabling configuring layout-specific options.
27ba56ae 2025-05-07 10:55:24 doc: Add initial documention for XKB_KEYMAP_FORMAT_TEXT_V2
82ea2915 2025-05-06 17:22:22 tools: Add options to use explicit keymap format The default output keymap format is `XKB_KEYMAP_USE_ORIGINAL_FORMAT`.
62712cfe 2025-05-06 17:42:54 bench: Add options to use an explicit keymap format
08149dae 2025-05-06 16:23:04 Add internal API to query and parse supported keymap formats
bffbef88 2025-05-21 23:57:11 build: Require Bison ≥ 3.6 Older versions don’t support `%define parse.error detailed`. Fixes: a3f1a9d3ba ("xkbcomp/parser: enable Bison detailed syntax error")
7888474d 2025-05-16 14:06:18 Bump version to 1.10.0
fb9fec18 2025-05-10 10:18:38 xkbcomp: Checked arithmetic Use a polyfill for C23 checked arithmetic. This is a bit paranoid, as we expect the user to use only 32 bit integers, so the signed 64 bit integer we use to store the result should be more than enough. Use jtckdint v1.0: - repository: https://github.com/jart/jtckdint - commit: 339450d13d8636f05dcb71ba36efddb226db481e - removed all C++-specific code
9da1a2eb 2025-05-16 10:33:43 doc: Add license in generated doc
61a1e646 2025-05-15 17:24:50 doc: Reformat release notes and include them in the HTML doc
bd552642 2025-05-15 17:20:44 doc: Use custom alias to fix HTML tags unsupported by Doxygen Previous solution with `sed` is both overkilled and unreliable. Prefer a hack using Doxygen’s buit-ins, although we are not sure these are much more stable… 😓
b5f7c843 2025-05-14 21:34:23 doc: Add script to fix HTML tags unsupported by Doxygen
48a6faa7 2025-05-14 15:13:50 tools: Remove internal interactive-evdev This *internal* tool is no longer necessary, as its single special feature, `--print-modmaps`, is now available in the *public* `compile-keymap` tool.
e6aec067 2025-04-29 17:14:01 build: drop support for byacc It doesn't support `%define parse.error detailed` which we want to use. If needed, we can probably bring back support using some macro hackery. Signed-off-by: Ran Benita <ran@unusedvar.com>
dd642359 2025-05-07 00:06:10 Bump version to 1.9.2
7df431ac 2025-05-02 19:44:15 Bump version to 1.9.1
9ffe3cfc 2025-04-29 12:48:10 doc: Create a FAQ page - Initialize with multiple recurrent questions. - Document how to get the vmod → rmod mapping. Rational: Some applications may need it to interface with legacy code.
ee1a98c5 2025-04-15 20:45:27 Bump version to 1.9.0 Signed-off-by: Ran Benita <ran@unusedvar.com>
21a341f2 2025-03-24 09:21:40 test: Enable 3rd party compilers
636b8b97 2025-03-19 14:11:52 test: Add merge mode tests for all the sections The merge modes tests C file is now only generated locally, because it is too large. The generator Python script requires Jinja2, so the test is optional and depends on Jinja22 availability. The test aim to be exhaustive with various combinations of a base and an update: - plain base + plain update, for every mode - plain base + include (for every mode) update (every mode) - single include (base +| update)
8d380f1b 2025-04-11 13:41:37 rules: Improve bench
dc50603c 2025-03-27 14:34:02 build: Force UTF-8 source files encoding on Windows Some of our test files (e.g. keysym strings) use UTF-8 encoded strings that require proper handling by the compiler. Let’s favor readability using modern compiler settings instead of escape sequences.
66f71890 2025-03-31 08:01:29 symbols: Enable writing keysyms list as UTF-8 strings Each Unicode code point of the string will be translated to their respective keysym, if possible. An empty string denotes `NoSymbol`. When such conversion is not possible, this will raise a syntax error. This introduces the following syntax: ```c // Empty string = `NoSymbol` key <1> {[""]}; // NoSymbol // Single code point = single keysym key <2> {["é"]}; // eacute // String = translate each code point to their respective keysym key <3> {["sßξك🎺"]}; // {s, ssharp, Greek_xi, Arabic_kaf, U1F3BA} // Mix string and keysyms key <4> {[{"ξ", Greek_kappa, "β"}]}; // { Greek_xi, Greek_kappa, Greek_beta} ``` It can also be used wherever a keysym is required, e.g. in `interpret` and `modifier_map` statements. In these cases a single keysym is expected, so the string should contain *exactly one* Unicode code point.
bc3e464b 2025-04-09 12:35:05 keysyms: Fix Unicode handling - `xkb_utf32_to_keysym`: Allow [Unicode noncharacters]. There is no requirement to drop them and this would be the only function of our API doing so. From the Unicode Standard 16.0, section 23.7 “Noncharacters”: > Applications are free to use any of these noncharacter code points > internally. They have no standard interpretation when exchanged > outside the context of internal use. However, they are not illegal > in interchange, nor does their presence cause Unicode text to be > ill-formed. > If a noncharacter is received in open interchange, an application is > not required to interpret it in any way. It is good practice, > however, to recognize it as a noncharacter and to take appropriate > action, such as replacing it with `U+FFFD` REPLACEMENT CHARACTER, > to indicate the problem in the text. The key part is: > an application is not required to interpret it in any way Since we handle the reverse conversion with `xkb_keysym_to_utf32` just fine, I do not see a good motivation to keep this asymmetry. This is the only function with a special case for these code points. - `xkb_keysym_from_name`: - Unicode format `UNNNN`: allow control characters C0 and C1 and use `xkb_utf32_to_keysym` for the conversion when `NNNN < 0x100`, for backward compatibility. - Numeric hexadecimal format `0xNNNN`: *unchanged*. Contrary to the Unicode format, it does not normalize any keysym values in order to enable roundtrip with `xkb_keysym_get_name`. Also added tests to ensure various properties and consistency. Note about *surrogates*: they are valid valid *code points* but invalid Unicode *scalar values*, i.e. they cannot be encoded in any Unicode encoding form (UTF-8, UTF-16, UTF-32). So their corresponding Unicode keysyms are valid, but: - cannot be used as input of `xkb_keysym_to_utf32` nor `xkb_keysym_to_utf8` - cannot result as output of `xkb_utf32_to_keysym`. Otherwise they are valid e.g. in the Unicode keysym notation. [Unicode noncharacters]: https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Noncharacters
3370ead3 2025-04-06 06:39:31 test: Better handling of missing xkbcomp for X11 tests - meson: Warn if missing xkbcomp for X11 tests; - test: Better logging to spot missing Xorg executables.
d5a91fa9 2025-04-04 16:38:16 xkbcomp: Use custom parsers instead of strtol* The use of `strtol*` functions was already restricted due to its slowness and its capacity to parse other stuff than digits (e.g. signs and spaces). There is also another *big* limitation: it requires a NULL-terminated string. This is incompatible with our functions that work on buffers, because we cannot guarantee this. This may lead to a memory violation if the last token is a number. We now roll out our own parsers, which are more efficients and compatible with buffers.
275ffa66 2025-03-13 21:28:35 tools: Make --kccgst xkbcli-compile-keymap option public The new public option `--kccgst` enables to display the result of RMLVO resolution to KcCGST components. This option has the same function than `setxkbmap -print`. This is particularly useful for debugging issues with the rules. Before this commit it was a private API. This commit enables us to remove the *internal* version of `xkbcli-compile-keymap`.
b3465081 2025-03-12 00:20:39 Bump version to 1.8.1 and update changelog
02b32244 2025-03-10 13:19:37 registry: Use safer contextual libxml2 functions Avoid using functions depreacted in 2.13 and 2.14 libxml releases. Follow-up of: 5f1b06b7497dc0e69ecfef8a934bce01f4f7fe8e.
311c8424 2025-03-10 13:18:51 meson: Fix libxml2 header test
113ac304 2025-01-25 03:18:01 meson: link tests and benches against shared library, not static library This makes the tests, and especially benches, more realistic, since xkbcommon is almost always used as a shared library. Also significantly reduces the build time with LTO enabled (for me, from 90s to 30s). Signed-off-by: Ran Benita <ran@unusedvar.com>
b5cde5c1 2025-02-05 11:47:56 doc: Improve README
4601b20e 2025-01-25 05:46:50 meson: fix typo Signed-off-by: Ran Benita <ran@unusedvar.com>
42dd1ca4 2025-02-03 11:50:14 meson: suppress MSVC C4100 unreferenced formal parameter warnings Equivalent to `-Wno-unused-parameter` which we use. Signed-off-by: Ran Benita <ran@unusedvar.com>
76740e0c 2025-01-30 14:21:00 Bump version to 1.8.0 and update changelog
848ecacf 2025-01-30 09:12:54 tools: Enable Compose file positional argument and piping Also deprecate the `--file` flag as redundant.
26807a90 2025-01-28 20:24:05 scanner: compute token line/column lazily on errors The scanner functions are hot, and the line/column location tracking is quite expensive. We only use it for errors, which don't need to be fast, because we bail if there are too many; and for warnings, which are usually not shown by default. So only keep the token start pos, and compute the line/column lazily from that. This will also allow some further improvements ahead. bench/rulescomp before: compiled 1000 keymaps in 1.669028s after: compiled 1000 keymaps in 1.550411s bench/compose: before: compiled 1000 compose tables in 2.145217s after: compiled 1000 compose tables in 2.016044s Signed-off-by: Ran Benita <ran@unusedvar.com>
e74e9cbc 2025-01-21 10:53:18 meson: change warning level 2 -> 3 Who doesn't like more warnings? :) In gcc/clang, 3 adds -Wpedantic, which sucks, so we turn it off. So no difference there. On msvc, it turns on "level 4 informational warnings that aren't off by default" and is recommended[0]. [0] https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level Signed-off-by: Ran Benita <ran@unusedvar.com>
2f0bc3e0 2025-01-21 10:51:45 meson: show compiler id in summary Useful for seeing whether the compiler is gcc, clang, etc. Signed-off-by: Ran Benita <ran@unusedvar.com>
38557e5b 2025-01-21 10:49:06 meson: remove explicit `b_lundef=true` It is already the default. Signed-off-by: Ran Benita <ran@unusedvar.com>
ddb731ce 2025-01-20 18:01:08 bench: Add xkb_keymap_get_as_string Based on the `compile-keymap` benchmark.
11140ded 2025-01-10 13:58:39 Use test map for checking --version-script, instead of full map Various problems can occur when using the full `xkbcommon.map` file when checking whether the `--version-script` linker option works in `meson.build`. For instance, newer linkers typically complain about non-existing symbols, so in commit ebe4157 `--undefined-version` was added to work around that. But then in commit 1d8a25d6 another workaround needed to be added for older linkers. It is better to use a minimalistic linker script for testing instead. The other workarounds can then be removed.
7036e46c 2025-01-13 15:20:47 symbols: Add tests for key merge modes (keysyms/actions) This commit adds tests for merging various key configurations: - With/without keysyms/actions - Single/multiple keysyms/actions per level We test all the merge modes for including a map (global) as well as directly on the keys (local): - default (global: include, local: implicit) - augment - override - replace The tests data are generated with: - A Python script `scripts/update-merge-modes-tests.py` for keycodes and symbols data. Use `--debug` for extra comments to help debugging. The script can optionally generate C headers for alternative key sequence tests, that were used before implementing golden tests. The latter tests are not used anymore (duplicate with golden tests) but their generator is kept for now, as they can still be useful for debugging or writing similar tests. - The `merge-modes` test generates its own keymap files for golden tests, using: `build/test-merge-modes update`. It can also replace them with the obtained output rather than the expected one using `build/test-merge-modes update-obtained`, which is very useful for debugging.
16eff222 2024-12-31 08:01:52 doc: Add debugging page and warning about session restart Co-authored-by: Pierre Le Marre <dev@wismill.eu> Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
b9b4ab47 2024-12-09 09:21:01 keysyms: Add sharp S upper case mapping exception The case mapping `ssharp` ß ↔ `U1E9E` ẞ was added in 13b30f4f0dccc08dfea426d73570b913596ed602 but was broken: - For the lower case mapping it returned the keysym `0x10000df`, which is an invalid Unicode keysym. - For the upper case mapping it returned the upper Unicode code point rather than the corresponding keysym. It did accidentally enable the detection of alphabetic key type for the pair (ß, ẞ) though. However this detection was accidentally removed in 5c7c79970a2800b6248e829464676e1f09c5f43d (v1.7) with an attempt to fix the wrong keysym case mapping. Finally both the *lower* case mapping and the key type detection were fixed for good when we implemented the complete Unicode simple case mappings and corresponding tests in e83d08ddbc9851944c662c18e86d4eb0eff23e68. However, the *upper* case mapping `ssharp` → `U1E9E` remained disabled. Indeed, ẞ is a relatively recent addition to Unicode (2008) and had no official recommendation, until recently. So while the lower mapping ẞ→ß exists in Unicode, its converse upper mapping does not. Yet since 2017 the Council for German Orthography (Rat für deutsche Rechtschreibung) recommends[^1] ẞ as the capitalization of ß. Due to its stability policies, the Unicode Character Database (UCD) that we use to generate our keysym case mappings (via ICU) cannot update the simple case mapping of ß. Discussions are currently ongoing in the Unicode mailing list[^2] and CLDR[^3] about how to deal with the new recommended case mapping. However, the discussions are oriented on text-processing and compatibility mappings, while libxkbcommon is on a rather lower level. It seems that the slow adoption of ẞ is partly due to the difficulty to type it. Since ẞ is used only for ALL CAPS casing, the expectation is to type it using CapsLock. While our detection of alphabetic key types works well[^4] for the pair (ß,ẞ), the *internal capitalization* currently does not work and is fixed by this commit. Added the ß → ẞ upper mapping: - Added an exception in the generation script - Fixed tests - Added documentation of the exceptions in `xkbcommon.h` - Added/updated log entries [^1]: https://www.rechtschreibrat.com/regeln-und-woerterverzeichnis/ [^2]: https://corp.unicode.org/pipermail/unicode/2024-November/011162.html [^3]: https://unicode-org.atlassian.net/browse/CLDR-17624 [^4]: Except libxkbcommon 1.7, see the second paragraph.
420123fd 2024-11-29 07:34:07 export-keysyms: Enable all keysyms export + char names This enable to check case mappings for Unicode keysyms.
5f1b06b7 2024-10-13 19:51:45 registry: Start using libxml2 contextual API Contextual functions are safer because they do not rely on a global state.
a47961b1 2024-10-12 16:43:46 registry: Restore default libxml2 error handler after parsing Leaving the custom error handler could have resulted in a crash after the context has been freed. Closes: https://github.com/xkbcommon/libxkbcommon/issues/529
b8888345 2024-09-20 09:17:23 tools: Add xkbcli dump-keymap-{wayland,x11} There is currently no easy way to dump a keymap from a Wayland compositor, such as `xkbcomp -xkb $DISPLAY -` could do for X servers. As `xkbcomp` may not be intuitive, a corresponding tool for X servers would also be useful. Add the tools `xkbcli-dump-keymap-{wayland,x11}` by tweaking the existing `xkbcli-interactive-{wayland,x11}` tools.
948f7a59 2024-10-09 08:34:27 symbols: Skip interprets only for groups with explicit actions Previously setting explicit actions for a group in symbols files made the parser skip compatibility interpretations for the corresponding *whole* key, so the other groups with *no* explicit actions could result broken on some levels. In the following example, `<RALT>` would have an action on group 2, because it is explicit, but none on group 1 because interpretation are also skipped there as a side effect: ```c key <RALT> { symbols[1]= [ ISO_Level3_Shift ], symbols[2]= [ ISO_Level3_Shift ], actions[2]= [ SetMods(modifiers=LevelThree) ] }; ``` Fixed by skipping interpretations *only* for groups with explicit actions. We still set `key->explicit |= EXPLICIT_INTERP` if at least one group has explicit actions. In such case, when dumping a keymap, we will write explicit actions for *all* groups, in order to ensure that X11 and previous versions of libxkbcommon can parse the keymap as intended. One side effect is that no interpretation will be run on this key anymore, so we may have to set some extra fields explicitly: repeat, virtualMods. Thus the previous example would be bumped as: ```c key <RALT> { repeat= No, symbols[1]= [ ISO_Level3_Shift ], actions[1]= [ SetMods(modifiers=LevelThree,clearLocks) ], symbols[2]= [ ISO_Level3_Shift ], actions[2]= [ SetMods(modifiers=LevelThree) ] }; ```
3ed763c3 2024-10-09 07:11:13 test: Add strip_lines and uncomment to text utils These allow us to store comments in files (especially keymaps), that can then be removed (e.g. to compare with output) or uncommented (e.g. to activate an optional line).
1b83771f 2024-09-24 22:48:01 logging: Use messages ID in registry
7697c712 2024-09-16 16:09:11 rules: Resolve relative include statements using XKB paths Contrary to keymap files, the `! include` statement in rules does not lookup include paths added to `xkb_context`. So it is not possible e.g. to import another file in the same folder without using an absolute path. - Added path utils: `is_absolute(path)`. - Added XKB paths lookup to enable e.g. `! include evdev` to work. - Added test.
0cd1087a 2024-09-12 01:43:56 xkbcli how-to-type: Enhance arguments parsing & doc Currently the positional parameter of the CLI is either a Unicode code point or a keysym. However their respective format is not documented. It turns out that there are multiple issues due to the use of `strtol`: - Code points can be parsed as octal, decimal and hexadecimal, while keysyms can only be parsed as hexadecimal. Some programs outputs keysyms in their decimal form (e.g. `wev`) so it is worth to bring symmetry with code points. - Octal format is unusual for both and is triggered by leading zeros, which is unintuitive in this context. - `U+NNNN` format is the standard format for Unicode code points but is not supported. - Plain characters are not supported, e.g.: a, é, ß, Æ, γ, 🦆, etc. Although this is probably the easiest format for most users. Fixed the issues above: - Allow the code point to be passed exactly in the following formats: - Literal character (requires UTF-8 character encoding of the terminal); - Decimal number; - Hexadecimal number: either `0xNNNN` or `U+NNNN` (any digit count) - Allow the keysym to be passed exactly in the following formats: - Decimal number; - Hexadecimal number: `0xNNNN` (any digit count); - Name. - Improve both `--help` message and manual page.
98dee225 2024-09-12 16:52:40 Add UTF-8 to UTF-32 decoding Add internal functions to convert UTF-32 to UTF-8, with corresponding tests.
f6f30c6b 2023-09-25 12:07:58 Add benchark for compile-keymap Implement `tasty-bench` method: 1. Set n = 1. 2. Measure execution time t_n of n iterations and execution time t_2n of 2n iterations. 3. Find t which minimizes deviation of (n·t, 2·n·t) from (t_n, t_2n), namely t = (t_n + 2·t_2n)/5n. 4. If deviation is small enough (see --stdev CLI parameter), return t as a mean execution time. 5. Otherwise set n = 2·n and jump back to Step 2. See: https://hackage.haskell.org/package/tasty-bench
8bc426e2 2024-07-30 14:45:35 compose: Add optional foreach traversal to benchmark This allow us to compare the iterator API to the fastest implementation, `foreach`.
4100bdd2 2024-09-01 10:57:40 compose: Add roundtrip test parse/dump
d4deb755 2024-09-01 09:07:00 compose: Add quickcheck test for traversal Test against the `foreach` reference implementation: - Suffle compose file lines randomly; - Compare traversal entry by entry. The `foreach` Compose traversal implementation is based on Ran’s work: https://github.com/bluetech/libxkbcommon/commit/f7f3c3c385fdc9ae91135f95e4b10f072603b812
652b03cc 2024-09-01 08:32:21 compose: Add Compose table dump internal API - Move `print_compose_table_entry` to own file and add a `file` argument to select output. - Add `xkb_compose_table_dump` to dump a Compose table. This change is needed in order to share the feature “dump a Compose table” between tests and tools.
ce32decc 2024-07-30 19:18:27 build: Set the ABI version properly Rational (from: https://gitlab.freedesktop.org/wayland/wayland/-/issues/175): The ABI of a shared library on Linux is given by a major version, which is part of the SONAME and is incremented (rarely) on incompatible changes, and a minor version, which is part of the basename of the regular file to which the SONAME provides a symlink. It's conventional to manage the ABI version in the style of semantic versioning (major.minor.micro where the major version goes up for incompatible changes, the minor version goes up for new ABI, or the micro version goes up for internal fixes), although this is not strictly required. The minor version is used by `ldconfig(8)` and by some projects to choose which of potentially several copies of a library is the newest; keeping it the same means we can't tell, and will potentially choose an outdated version. --- In xkbcommon we did not have an API break for a long time, so in order to avoid an unnecessary SONAME bump, let’s keep the major version version at 0, e.g. xkbcommon 1.x.y produces `libxkbcommon.so.0.x.y`. The same goes for `libxkbcommon-x11` and `libxkbregistry`.
e83d08dd 2024-02-23 17:10:15 keysyms: Fast and complete case mappings (Unicode 15.1) The current code to handle keysym case mappings is quite complex and slow. It is also incomplete, as it does not cover recent Unicode database. Finally, it does not handle title case correctly. It would be easier if we were to use only a lookup table, but a trivial implementation would lead to a huge array: the cased characters range from `U+0041` to `U+`1F189, i.e. a span of 127 304 elements. Thus we need some tricks to compress the lookup table. We based our work on the post: https://github.com/apankrat/notes/blob/3c551cb028595fd34046c5761fd12d1692576003/fast-case-conversion/README.md The compression algorithm is roughly: 1. Compute the delta between the characters and their mappings. 2. Split the delta array in chunk of a given size. 3. Rearrange the order of the chunks in order to optimize consecutive chunks overlap. 4. Create a data table with the reordered chunks and an index table that maps the original chunk index to its offset in the data table. The compression algorithm is then applied a second time to the previous index table. The complete algorithm optimizes the two chunk sizes in order to get the lowest total data size. The mappings were generated using CPython 3.12.4, PyICU 2.13, PyYaml 6.0.1 and ICU 75.1. Also: - Added explicit list of named keysyms and their case mappings. - Added benchmark for case mappings. - Rework ICU tests. Note: 13b30f4f0dccc08dfea426d73570b913596ed602 introduced a fix for sharp S `U+00DF`. With the new implementation, the *conversion* functions `xkb_keysym_to_{lower,upper}` leave it *unchanged*, while the *predicate* functions `xkb_keysym_is_{lower,upper_or_title}` produce the expected results: ```c xkb_keysym_to_upper(XKB_KEY_ssharp) == XKB_KEY_ssharp; xkb_keysym_to_lower(XKB_KEY_ssharp) == XKB_KEY_ssharp; xkb_keysym_to_lower(XKB_KEY_Ssharp) == XKB_KEY_ssharp; xkb_keysym_is_lower (XKB_KEY_ssharp) == true; xkb_keysym_is_upper_or_title(XKB_KEY_Ssharp) == true; ```
798b7b73 2024-02-23 17:10:15 keysyms: Export explicitly named keysyms Added a tool to export explicitly named keysyms to a yaml file. This includes the following keysyms properties: - Value - Name - Corresponding Unicode code point, if relevant - Corresponding case mapping, if relevant This will allow us to check the case mappings easier and to refactor the related functions.
45d64a7c 2024-02-23 17:10:14 keysyms: Add benchmark for case mapping functions
1d8a25d6 2024-07-12 11:10:46 build: Check for --undefined-version support Gate the use of `--undefined-version` in the linker because it breaks on older GNU `ld`: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58272.
621e3101 2024-07-16 07:00:53 build: Require meson >= 0.58 This will enable f-strings and allow us to simplify the build file.
11f7ef2e 2024-03-25 15:01:19 test(x11): Warn for missing Xvfb program Xvfb is required for *running* X11 tests. We do not make it mandatory in the meson setup though, because we did not find a way to require a *run* time dependency.
7a31e358 2024-03-23 23:23:43 Bump version to 1.7.0 Signed-off-by: Ran Benita <ran@unusedvar.com>
e4b20b91 2024-03-15 18:57:32 doc(keymap): Improve types & symbols sections - Add a diagram to illustrate how key types work. - Add examples to explain the key types mappings. - Add note for using `preserve` to tweak shortcuts. - Improve the key statement section.
41bdd33a 2024-03-14 11:39:38 test(X11): Avoid running X11 tests in parallel On macOS, it seems to be responsible for the following error in the CI: ``` _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created. ```
53d9881e 2024-03-05 10:28:11 keysyms: Fix inconsistent case-insensitive name lookup `xkb_keysym_from_name` has inconsistent behavior when used with the flag `XKB_KEYSYM_CASE_INSENSITIVE`: ```c xkb_keysym_from_name("a", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_a; xkb_keysym_from_name("A", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_a; xkb_keysym_from_name("dead_a", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_dead_A; xkb_keysym_from_name("dead_A", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_dead_A; xkb_keysym_from_name("dead_o", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_dead_o; xkb_keysym_from_name("dead_O", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_dead_o; xkb_keysym_from_name("KANA_tsu", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_kana_tsu; xkb_keysym_from_name("KANA_TSU", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_kana_tsu; xkb_keysym_from_name("KANA_ya", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_kana_YA; xkb_keysym_from_name("KANA_YA", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_kana_YA; xkb_keysym_from_name("XF86Screensaver", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_XF86ScreenSaver; xkb_keysym_from_name("XF86ScreenSaver", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_XF86ScreenSaver; ``` So currently, if two keysym names differ only by case, then the lower-case *keysym* is returned, not the keysym corresponding to the lower-case keysym *name*. Indeed, `xkb_keysym_from_name` uses `xkb_keysym_is_lower` to test if a keysym is a lower-case keysym. Let’s look at the example for keysyms `a` and `A`: we get the keysym `a` not because its name is lower case, but because `xkb_keysym_is_lower(XKB_KEY_a)` returns true and `xkb_keysym_is_lower(XKB_KEY_A)` returns false. So the results are correct according to the doc: - Katakana is not a bicameral script, so e.g. `kana_ya` is *not* the lower case of `kana_YA`. - As for the `dead_*` keysyms, they are not cased either because they do not correspond to characters. - `XF86ScreenSaver` and `XF86Screensaver` are two different keysyms. But this is also very counter-intuitive: `xkb_keysym_is_lower` is not the right function to use in this case, because one would expect to check only the name, not the corresponding character case: ```c xkb_keysym_from_name("KANA_YA", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_kana_ya; xkb_keysym_from_name("XF86ScreenSaver", XKB_KEYSYM_CASE_INSENSITIVE) == XKB_KEY_XF86Screensaver; ``` Fixed by making the order of the keysyms names consistent in `src/ks_tables.h`: 1. Sort by the casefolded name: e.g. `kana_ya` < `kana_YO`. 2. If same casefolded name, then sort by cased name, i.e for ASCII: upper before lower: e.g `kana_YA` < `kana_ya`. Thus we now have e.g. `kana_YA` < `kana_ya` < `kana_YO` < `kana_yo`. The lookup logic has also been simplified. Added exhaustive test for ambiguous case-insensitive names.
2c23852a 2024-02-29 18:16:54 Doc: Keymap format enhancement + misc - Add introduction to keymap and its components - Add a diagram to explain the relationships between RMLVO and KcCGST. - Add keywords & comments sections. - Improve Quick guide section in the index page. - Add links to User-configuration page. - Fix typos.
ebe4157d 2024-02-28 01:27:10 meson: inform ld to accept undefined symbols for version-scripts (#459) with lld 1.17, linking with a symbol map which contains symbols which actually do not exists now result in an error, which means the test in meson.build to check if -Wl,--version-script works always fails. because it tries to use the general map file with "int main(void) {}". Fixes #424
5270a553 2024-02-14 11:41:12 test: print the keyboard state as part of test_key_seq_va Makes it easier to debug modifier bugs.
c88fe4b6 2023-12-07 12:21:53 keysyms: Add tests with ICU Added tests of the simple case mappings when the ICU library is available. A warning is raised for missing mappings. Note: `xkb_keysym_is_upper` is interpreted as matching the disjunction of the Unicode character properties “Uppercase” or “Titlecase”.
4f52d606 2023-12-14 09:16:55 keysyms: Add xkb_keysym_is_assigned Add internal API `xkb_keysym_is_assigned` for tests, guarded by `ENABLE_PRIVATE_APIS` in order to avoid increasing the size of the installed library.
244128aa 2023-12-14 01:44:00 Update meson.build error message when enable-wayland enabled (#419) Let's drop the explicit versions, meson prints a message anyway that specifies the version we have vs the one we need.
20329baf 2023-11-23 09:30:57 xkbcomp: Use `steal` for better memory handling
20c6fa62 2023-11-21 08:50:38 registry: Use `steal` for better memory handling
bc330c00 2023-11-07 12:58:20 xkbcli: Promote compose to xkbcli-compile-compose Previously this tool was only used for internal testing and thus not installed. But it is useful for debugging, much like xkbcli-compile-keymap.
d2a08f76 2023-10-08 23:46:48 Bump version to 1.6.0 Signed-off-by: Ran Benita <ran@unusedvar.com>
1c1542d6 2023-09-29 20:44:06 Tools: Add bash completions for xkbcli - Add bash completion script. It parses the commands help messages to provide the completions, thus any new subcommand or option will be supported, as long as it has its entry in the help messages. This should result in low maintenancei effort. - Add installation entry in Meson. The path can be configured using the following options: - `enable-bash-completion` to enable the installation; - `bash-completion-path` to control the installation path. It will default to: `share/bash-completion/completions`. TODO: completion for other shells, such as zsh?
a1770132 2023-09-25 11:41:48 Compose: add iterator API Allow users to iterate the entries in a compose table. This is useful for other projects which want programmable access to the sequences, without having to write their own parser. - New API: - `xkb_compose_table_entry_sequence`; - `xkb_compose_table_entry_keysym`; - `xkb_compose_table_entry_utf8`; - `xkb_compose_table_iterator_new`; - `xkb_compose_table_iterator_free`; - `xkb_compose_table_iterator_next`. - Add tests in `test/compose.c`. - Add benchmark for compose traversal. - `tools/compose.c`: - Print entries instead of just validating them. - Add `--file` option. - TODO: make this tool part of the xkbcli commands. Co-authored-by: Pierre Le Marre <dev@wismill.eu> Co-authored-by: Ran Benita <ran@unusedvar.com> Signed-off-by: Ran Benita <ran@unusedvar.com>
417d0747 2023-09-18 18:17:39 Add xkb-check-messages tool This tool checks whether messages codes are supported. This is useful e.g. for CI, where one may want to grep for some XKB error codes and ensure that these are still supported.
ef81d04e 2023-09-18 18:17:34 Structured log messages with a message registry Currently there is little structure in the log messages, making difficult to use them for the following use cases: - A user looking for help about a log message: the user probably uses a search engine, thus the results will depend on the proper indexing of our documentation and the various forums. It relies only on the wording of the message, which may change with time. - A user wants to filter the logs resulting of the use of one of the components of xkbcommon. A typical example would be testing xkeyboard-config against libxkbcommon. It requires the use of a pattern (simple words detection or regex). The issue is that the pattern may become silently out-of-sync with xkbcommon. A common practice (e.g. in compilers) is to assign unique error codes to reference theses messages, along with an error index for documentation. Thus this commit implements the following features: - Create a message registry (message-registry.yaml) that defines the log messages produced by xkbcommon. This is a simple YAML file that provides, for each message: - A unique numeric code as a short identifier. It is used in the output message and thus can be easily be filtered to spot errors or searched in the internet. It must not change: if the semantics of message changes, it is better to introduce a new message for clarity. - A unique text identifier, meant for two uses: 1. Generate constants dealing with log information in our code base. 2. Generate human-friendly names for the documentation. - A type: currently warning or error. Used to prefix the constants (see hereinabove) and for basic classification in documentation. - A short description, used as concise and mandatory documentation. - An optionnal detailed description. - Optional examples, intended to help the user to fix issues themself. - Version of xkbcommon it was added. For old entries this often unknown, so they will default to 1.0.0. - Version of xkbcommon it was removed (optional) No entry should ever be deleted from this index, even if the message is not used anymore: it ensures we have unique identifiers along the history of xkbcommon, and that users can refer to the documentation even for older versions. - Add the script update-message-registry.py to generate the following files: - messages.h: message code enumeration for the messages currently used in the code base. Currently a private API. - message.registry.md: the error index documentation page. - Modify the logging functions to use structured messages. This is a work in progress.
0e3e2d17 2023-09-18 12:17:11 interactive-evdev: add option to print modmaps Add an option to print modmap and vmodmap of relevant keys, as well as virtual modifiers mapping to real modifier. This is useful for debugging. It uses private API, so we compile it separately in the fashion of `xkbcli-compile-keymap/compile-keymap`.
fe9cd66f 2023-09-18 13:17:30 Test: Enable x11comp and use the xvfb wrapper This test was previously disabled in 914e84e0188b5fbd67855f38f4499bb1412f4516. Note that it requires a recent version of xkeyboard-config to succeed.
26b1a076 2023-09-18 13:17:17 Test: Use a xvfb wrapper for x11 test The x11 test is currently silently skipped in CI, because it requires a running X server. Create a xvfb wrapper to run the test. We do not use `xvfb-run`, because it is a shell script and it causes valgrind to detect unrelated memory issues in the shell (dash, bash). Improve wrapper using a special ELF section TODO: The wrapper is intended to be used with the x11comp test as well.
37fdd87c 2023-06-27 20:31:01 Add a meson flag to make cool URIs optional The script `ensure-stable-doc-urls.py` relies on the Doxygen output files names. These may change between Doxygen versions, although the Doxygen developers intend stability. Since the script is useful mainly for the online documentation of xkbcommon, make the target `doc-cool-uris` optional.
64aaa7cd 2023-05-14 15:11:15 Add support for stable doc URLs (#342) Doc URLs may change with time because they depend on Doxygen machinery. This is unfortunate because it is good practice to keep valid URLs (see: https://www.w3.org/Provider/Style/URI.html). I could not find a built-in solution in Doxygen, so the solution proposed here is to maintain a registry of all URLs and manage legacy URLs as redirections to their canonical page. This commit adds a registry of URLs that has three functions: - Check no previous URL is now invalid. - Add aliases for moved pages. - Generate redirection pages for aliases. The redirection works with a simple <meta http-equiv="refresh"> HTML tag. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv This commit also initialize the URLs registry with current pages and some redirections needed after recent documentation refactoring. Finally, the CI is updated to catch any change that invalidate previous URLs.
fc664cf1 2023-05-13 05:30:11 Improve documentation - Add introduction to XKB - Embrace Doxygen features - More cross links
e020174a 2023-05-05 10:52:07 build: show a summary Signed-off-by: Ran Benita <ran@unusedvar.com>
80be81e5 2023-05-05 10:16:30 build: require bison >= 2.3a At least 2.3 (released 2006) which is the version shipped with macos doesn't work. Reading the changelog I think 2.3a *should* work, so require that. Signed-off-by: Ran Benita <ran@unusedvar.com>
60d38b0c 2023-05-05 10:11:00 build: bump required meson to 0.52.0 Support for version checks in `find_program()`. Signed-off-by: Ran Benita <ran@unusedvar.com>
46b7753f 2023-05-02 23:47:56 meson.build: register libxkbcommon.dylib link meson needs to know that the executable tools link against libxkbcommon.dylib so that the @rpath references used during the build/test phases can be rewritten to full path names on install