|
d5a91fa9
|
2025-04-04T16: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-13T21: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-12T00:20:39
|
|
Bump version to 1.8.1 and update changelog
|
|
02b32244
|
2025-03-10T13: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-10T13:18:51
|
|
meson: Fix libxml2 header test
|
|
113ac304
|
2025-01-25T03: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-05T11:47:56
|
|
doc: Improve README
|
|
4601b20e
|
2025-01-25T05:46:50
|
|
meson: fix typo
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
42dd1ca4
|
2025-02-03T11: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-30T14:21:00
|
|
Bump version to 1.8.0 and update changelog
|
|
848ecacf
|
2025-01-30T09:12:54
|
|
tools: Enable Compose file positional argument and piping
Also deprecate the `--file` flag as redundant.
|
|
26807a90
|
2025-01-28T20: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-21T10: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-21T10: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-21T10:49:06
|
|
meson: remove explicit `b_lundef=true`
It is already the default.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
ddb731ce
|
2025-01-20T18:01:08
|
|
bench: Add xkb_keymap_get_as_string
Based on the `compile-keymap` benchmark.
|
|
11140ded
|
2025-01-10T13: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-13T15: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-31T08: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-09T09: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-29T07:34:07
|
|
export-keysyms: Enable all keysyms export + char names
This enable to check case mappings for Unicode keysyms.
|
|
5f1b06b7
|
2024-10-13T19:51:45
|
|
registry: Start using libxml2 contextual API
Contextual functions are safer because they do not rely on a global
state.
|
|
a47961b1
|
2024-10-12T16: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-20T09: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-09T08: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-09T07: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-24T22:48:01
|
|
logging: Use messages ID in registry
|
|
7697c712
|
2024-09-16T16: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-12T01: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-12T16: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-25T12: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-30T14: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-01T10:57:40
|
|
compose: Add roundtrip test parse/dump
|
|
d4deb755
|
2024-09-01T09: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-01T08: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-30T19: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-23T17: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-23T17: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-23T17:10:14
|
|
keysyms: Add benchmark for case mapping functions
|
|
1d8a25d6
|
2024-07-12T11: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-16T07:00:53
|
|
build: Require meson >= 0.58
This will enable f-strings and allow us to simplify the build file.
|
|
11f7ef2e
|
2024-03-25T15: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-23T23:23:43
|
|
Bump version to 1.7.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
e4b20b91
|
2024-03-15T18: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-14T11: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-05T10: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-29T18: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-28T01: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-14T11:41:12
|
|
test: print the keyboard state as part of test_key_seq_va
Makes it easier to debug modifier bugs.
|
|
c88fe4b6
|
2023-12-07T12: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-14T09: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-14T01: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-23T09:30:57
|
|
xkbcomp: Use `steal` for better memory handling
|
|
20c6fa62
|
2023-11-21T08:50:38
|
|
registry: Use `steal` for better memory handling
|
|
bc330c00
|
2023-11-07T12: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-08T23:46:48
|
|
Bump version to 1.6.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
1c1542d6
|
2023-09-29T20: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-25T11: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-18T18: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-18T18: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-18T12: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-18T13: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-18T13: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-27T20: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-14T15: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-13T05:30:11
|
|
Improve documentation
- Add introduction to XKB
- Embrace Doxygen features
- More cross links
|
|
e020174a
|
2023-05-05T10:52:07
|
|
build: show a summary
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
80be81e5
|
2023-05-05T10: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-05T10: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-02T23: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
|
|
5b5b67f2
|
2023-05-01T22:30:41
|
|
Add support for modmap None (#291)
Unlike current xkbcommon, X11’s xkbcomp allows to remove entries in
the modifiers’ map using “modifier_map None { … }”.
“None” is translated to the special value “XkbNoModifier” defined in
“X11/extensions/XKB.h”. Then it relies on the fact that in "CopyModMapDef",
the following code:
1U << entry->modifier
ends up being zero when “entry->modifier” is “XkbNoModifier” (i.e. 0xFF).
Indeed, it relies on the overflow behaviour of the left shift, which in
practice resolves to use only the 5 low bits of the shift amount, i.e.
0x1F here. Then the result of “1U << 0xFF” is cast to “char”, i.e. 0.
This is a good trick but too magical, so in libxkbcommon we will use
an explicit test against our new constant XKB_MOD_NONE.
|
|
0e9c2ec9
|
2023-04-30T21:30:36
|
|
Improve the doc of the XKB keymap text format, V1 (#321)
- Add table of contents
- Add terminology section
- (WIP) Add Introduction to the format
- Improve the keycode section
- Improve the interpret section
- Add guide to create and use modifiers
- (WIP) Add actions documentation
- Add cross-references
- Add keysyms header to documentation
|
|
5b5ec0ee
|
2023-02-18T11:01:30
|
|
build: override dependency for use as subproject
This allows xkbcommon to be used as a subproject.
Signed-off-by: Simon Ser <contact@emersion.fr>
|
|
cecaa01d
|
2023-01-02T21:23:05
|
|
Bump version to 1.5.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
233617d0
|
2023-01-02T21:10:45
|
|
build: fix wayland-scanner deprecation code -> private-code
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
e5444f41
|
2022-12-16T21:24:57
|
|
build: require meson >= 0.51, fix meson deprecations
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
9d1043dc
|
2022-12-14T18:21:13
|
|
build: remove -fsanitize-undefined-trap-on-error
Meson complains; it's probably not that important anymore when using the
`-Db_sanitize` options.
meson.build:36: WARNING: Consider using the built-in option for sanitizers instead of using "-fsanitize-undefined-trap-on-error".
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
2530f644
|
2022-09-24T10:30:00
|
|
build: reenable test-context in MSVC
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
f9858bf5
|
2022-09-24T10:27:51
|
|
test: move mkdir & mkdtemp calls to common place and fix them on MSVC
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
57af9cb7
|
2022-05-21T22:55:10
|
|
Bump version to 1.4.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
ea6580cc
|
2022-02-04T12:41:50
|
|
Bump version to 1.4.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
8531ea72
|
2021-10-08T09:51:10
|
|
build: add enable-tools option
this is mainly useful for multilib, but may be useful for other users as well
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
|
|
88222c8d
|
2021-09-10T22:51:34
|
|
Bump version to 1.3.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
b6aadd57
|
2021-05-08T21:30:52
|
|
tools: add compose tool for Compose debugging
Not very useful so not exposed in xkbcli.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
13ba9135
|
2021-05-01T23:51:23
|
|
Bump version to 1.3.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
baf55226
|
2021-04-08T10:51:07
|
|
bench: add atom benchmark
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
9d87f849
|
2021-04-27T10:53:36
|
|
build: fix missing includes
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
de1b6943
|
2021-04-27T10:10:26
|
|
Move include files to include/ subdirectory
This way we don't specify `include_directorories('.')` which brings in
more than needed.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
8ff0232b
|
2021-04-27T10:02:00
|
|
build: move the subproject variables to a common section at the end
As suggested in:
https://github.com/xkbcommon/libxkbcommon/pull/240#discussion_r620784021
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
4238417b
|
2021-04-26T17:27:01
|
|
Meson: Allow building as subproject
Specify where to find the headers for libxkbcommon_dep,
libxkbcommon_x11_dep, and libxkbregistry_dep, which allows other
projects to correctly locate the headers when libxkbcommon is being
built as a Meson subproject.
The dep_libxkbregistry variable is renamed to libxkbregistry_dep,
to follow the usual convention for variables which hold declared
dependencies to be used from subproject builds.
|
|
5cd76a8d
|
2021-04-26T17:38:48
|
|
Windows: Pass list of symbols to export to MSVC
Arrange for passing .def files with the lists of symbols to export from
DLLs when building on Windows with MSVC. Without this no symbols were
being exported at all.
The .def files are generated from the .map files at build time using
scripts/map-to-def, which avoids needing to maintain two different sets
of files.
|
|
097a0ca7
|
2021-04-07T19:23:55
|
|
Bump version to 1.2.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
086353b3
|
2021-04-02T22:12:00
|
|
Bump version to 1.2.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
90e2d5ee
|
2021-03-30T20:08:42
|
|
build: require C11
I'd really like to use anonymous unions/structs. Supposedly even MSVC
supports it now. Let's try and see.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
82a5bdc4
|
2021-02-27T22:48:12
|
|
Bump version to 1.1.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
83e3a53d
|
2021-02-27T22:38:21
|
|
doc: add keymap-format-text-v1.md to the HTML documentation
It's incomplete but might be helpful for someone.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
d1ba81c4
|
2021-02-22T20:07:45
|
|
meson.build: replace the remaining join_paths() with the nicer / syntax
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
0abd430e
|
2021-02-22T12:54:15
|
|
test: add a keysym tester
A simple script that creates a new layout with the given keysym replacing TLDE.
Then we compile a keymap and search for the keysym being assigned to TLDE and
bail if that fails.
The list of keysyms is manually maintained but we only need to add one or two to
spot-check whenever the xorgproto is updated.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
c60b77ea
|
2020-11-23T20:30:13
|
|
Bump version to 1.0.3
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
13e6543e
|
2020-11-20T21:01:56
|
|
Bump version to 1.0.2
Signed-off-by: Ran Benita <ran@unusedvar.com>
|