Commit Graph

2143 Commits (2c86216b5b50a3519b07c8a8e664bc75b854cc04)

Author SHA1 Message Date
Pierre Le Marre 2c86216b5b CI: Fix documentation generation for macOS
- Force Doxygen version 1.9.6, because 1.9.7 breaks our doc cool URIs,
  i.e. our system that maintain stable doc pages via redirection.

  Associated issue in Doxygen:
  https://github.com/doxygen/doxygen/issues/10146

- Install graphviz to build the .dot files.
2023-06-26 09:50:01 +02:00
Pierre Le Marre eec389037e Fix typo in ensure-stable-doc-urls.py 2023-06-26 09:50:01 +02:00
alois31 f3210cbf27
compose: drop the 65535 node limit (#343)
In commit 1638409b22, the number of
compose nodes was limited to 65535 to enable "future optimizations",
which apparently means slightly reduced memory usage due to fitting in
a uint16_t. At this time, it was mentioned that the author was not
aware of "any compose files which come close".

However, I'm one of the users that actually do require a larger number
of nodes for their compose file. Thus, use a uint32_t again and raise
the limit significantly.
2023-05-15 15:23:16 +03:00
Wismill 64aaa7cda2
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.
2023-05-14 15:11:15 +02:00
Pierre Le Marre fc664cf1cc Improve documentation
- Add introduction to XKB
- Embrace Doxygen features
- More cross links
2023-05-13 22:05:23 +03:00
Pierre Le Marre 183761ac24 Do not interpret nor emit invalid Unicode encoding forms
Surrogates are invalid in both UTF-32 and UTF-8.
See https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G28875
and https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G31703
2023-05-13 22:02:46 +03:00
Pierre Le Marre 5fbffaf035 Add warning when RMLVO with no layout but variant set
There is no feedback that they are both replaced with default values.
Fix it by adding a warning informing about missing layout and show the
defaults for both.
2023-05-13 21:59:37 +03:00
Ran Benita c8efb70406 ci: bump runs-on versions
Mostly to bump to macos one which will hopefully fix CI issues there.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-12 22:27:17 +03:00
Ran Benita 5a5ab3e880 utils: fix printf format warnings on mingw
See:
https://github.com/mesonbuild/wrapdb/pull/819
c86ae6acf5/src/image_int.hpp (L15)
https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/

Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-06 17:29:45 +03:00
Ran Benita 45ba936bf0 ci/windows: use the vs backend instead of ninja backend
So we have some coverage of that.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-05 11:17:07 +03:00
Ran Benita e020174ac6 build: show a summary
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-05 11:17:07 +03:00
Ran Benita 80be81e5ce 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>
2023-05-05 11:17:07 +03:00
Ran Benita 60d38b0c05 build: bump required meson to 0.52.0
Support for version checks in `find_program()`.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-05 11:17:07 +03:00
Peter Hutterer b06aedb8ba scanner: allow for a zero terminated string as keymap
As the documentation for xkb_keymap_new_from_buffer() states, the "input string
does not have to be zero-terminated". The actual implementation however failed
with "unrecognized token/syntax error" when it encountered a null byte.

Fix this by allowing a null byte at the last position of the buffer. Anything
else is likely a client error anyway.

Fixes #307
2023-05-05 09:57:23 +10:00
Peter Hutterer 98b3314278 README: use meson compile/test over ninja
This is backend-agnostic and the recommended way to invoke compilation.

This requires meson 0.55 (July 2020) and we only require 0.51 but at this point
I'm expecting most users who require the README instructions will have a
recent-enough meson anyway.
2023-05-05 09:44:56 +10:00
Pierre Le Marre 536cf42704 .editorconfig: add .md config
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-04 11:58:48 +03:00
Ran Benita e422601121 Use consistent indentation for map and CSS files
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-05-04 11:58:48 +03:00
Peter Hutterer 8b7c1850e1 registry: remove a few asprintf/free() calls with snprintf
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-04 18:46:16 +10:00
Peter Hutterer a50890b155 registry: simplify strdup() error handling
strdup() is the least likely call to fail here, let's move it to the bottom so
we don't need to worry about the allocated string.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-04 18:46:16 +10:00
Ken Cunningham 46b7753fb8 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
2023-05-04 10:17:22 +10:00
Wismill 5b5b67f28c
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.
2023-05-01 23:30:41 +03:00
Wismill 0e9c2ec97e
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
2023-04-30 22:30:36 +03:00
Ran Benita 003fdee137 keysyms: add new keysyms XF86EmojiPicker, XF86Dictate
Ref: 914d8f5e0f
Ref: a839f0c7fc
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-04-12 10:29:42 +03:00
Ran Benita bd79a960f5 Possible fix for non-MSVC windows compilers
`_MSC_VER` is specific to MSVC, but there can be other compilers targeting
windows. Hopefully they do define `_WIN32`, so let's use that.

Refs: https://github.com/xkbcommon/libxkbcommon/issues/305
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-04-11 23:29:25 +03:00
Peter Hutterer 13d4b7f641 keysym: replace deprecated Serbian_DZE with Cyrillic_DZHE
Same numeric value for both and the Serbian one has been listed as deprecated
for decades.

See https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/69#note_1843415

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-03-31 10:11:59 +10:00
Simon Ser 5b5ec0ee27 build: override dependency for use as subproject
This allows xkbcommon to be used as a subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-19 13:00:38 +02:00
Ran Benita c6ff79d5c1 NEWS: add "New API" section for last release
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-01-02 21:36:03 +02:00
Ran Benita cecaa01df1 Bump version to 1.5.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-01-02 21:23:30 +02:00
Ran Benita 233617d086 build: fix wayland-scanner deprecation code -> private-code
Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-01-02 21:10:45 +02:00
Ran Benita 5ba075abe0 doc: clarify "server state" and "client state" distinction
Add a common page for the concept and link to there from the relevant
functions.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-12-17 13:53:29 +02:00
Ran Benita e5444f4195 build: require meson >= 0.51, fix meson deprecations
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-12-16 21:37:06 +02:00
Ran Benita 7428eb6e8b ci: don't run linux on push to non-master branches
It's redundant with the pull request run.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-12-16 21:36:13 +02:00
Ronan Pigott b4e81ca172
context: add XKB_CONTEXT_NO_SECURE_GETENV flag (#312)
This flag is useful for clients that may have relatively benign capabilities
set, like CAP_SYS_NICE, that also want to use the xkb configuration from the
environment and user configs in XDG_CONFIG_HOME.

Fixes: https://github.com/xkbcommon/libxkbcommon/issues/308
Fixes: https://github.com/xkbcommon/libxkbcommon/issues/129
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-12-16 10:26:25 +02:00
Ran Benita 9d1043dcb5 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>
2022-12-14 18:58:11 +02:00
Peter Hutterer a005d06c1d CI: bump a few actions to newer versions
Node 12 is deprecated so let's bump the actions to newer versions that
use Node 16. See
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-12-14 18:22:55 +02:00
Ran Benita 2530f6444b build: reenable test-context in MSVC
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-09-24 12:31:53 +03:00
Ran Benita f9858bf5b9 test: move mkdir & mkdtemp calls to common place and fix them on MSVC
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-09-24 12:31:53 +03:00
Ran Benita 4d8293901b utils: move some MSVC compat stuff to common place
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-09-24 12:31:53 +03:00
Peter Hutterer b309514247 ci/linux: store the test logs as artifacts on failure
This makes debugging a lot easier than having to reproduce locally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-24 10:09:11 +03:00
Peter Hutterer cc0e97e911 ci/linux: split normal testing from valgrind testing
A test case failure usually also triggers valgrind leaks, sifting through those
to find the actual test failure is painful. So let's separate the tests and run
them separately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-24 10:09:11 +03:00
Jan Alexander Steffens (heftig) 320f56d2a4 interactive-wayland: Fix interface versioning
We need to request the lower version of the interface versions we
support and the server supports, not the higher version.

Using the higher version caused crashes due to unbound callbacks on
GNOME, which supports a higher version of `xdg_wm_base`.
2022-09-24 10:02:24 +03:00
Ran Benita 57af9cb71f Bump version to 1.4.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-05-21 22:55:22 +03:00
Ran Benita 4000a1bdde keysym-utf: remove bogus currency sign entries
These ended up being mapping in the 0x100xxxx Unicode range, which are
handled automatically ; these special keysyms don't exist (except for
EuroSign).

    #define XKB_KEY_EcuSign                    0x10020a0  /* U+20A0 EURO-CURRENCY SIGN */
    #define XKB_KEY_ColonSign                  0x10020a1  /* U+20A1 COLON SIGN */
    #define XKB_KEY_CruzeiroSign               0x10020a2  /* U+20A2 CRUZEIRO SIGN */
    #define XKB_KEY_FFrancSign                 0x10020a3  /* U+20A3 FRENCH FRANC SIGN */
    #define XKB_KEY_LiraSign                   0x10020a4  /* U+20A4 LIRA SIGN */
    #define XKB_KEY_MillSign                   0x10020a5  /* U+20A5 MILL SIGN */
    #define XKB_KEY_NairaSign                  0x10020a6  /* U+20A6 NAIRA SIGN */
    #define XKB_KEY_PesetaSign                 0x10020a7  /* U+20A7 PESETA SIGN */
    #define XKB_KEY_RupeeSign                  0x10020a8  /* U+20A8 RUPEE SIGN */
    #define XKB_KEY_WonSign                    0x10020a9  /* U+20A9 WON SIGN */
    #define XKB_KEY_NewSheqelSign              0x10020aa  /* U+20AA NEW SHEQEL SIGN */
    #define XKB_KEY_DongSign                   0x10020ab  /* U+20AB DONG SIGN */
    #define XKB_KEY_EuroSign                      0x20ac  /* U+20AC EURO SIGN */

Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-05-15 10:41:53 +03:00
Ran Benita 49e8a2d85b keysym-utf: remove bogus Korean Won sign entry
This entry maps a non existing special keysym 0x20a9.
The correct mapping for XKB_KEY_Korean_Won (0x0eff) already exists.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-05-15 10:35:30 +03:00
Sam Lantinga 2536713070 Remove bogus euro sign entry from keysymtab
Not sure what it's doing here, but converting "€" to a keysym
doesn't work with this entry. 0x13a4 doesn't appear in
xkbcommon-keysyms.h. 0x20ac is the keysym documented in the
header (and it's the last entry in the table).

It's been in the table since it was introduced in e0524296d2
("Add API for getting unicode representation of a keysym").

Co-authored-by: Simon Ser <contact@emersion.fr>
2022-05-15 10:26:44 +03:00
Weng Xuetian b064b60984 Do not clear sibling entries when override.
lokid and hikid actually stores the sibling to current node, which
should not be cleared when override. This would break the sequence with
a common prefix when override another.

Fix #286

Signed-off-by: Weng Xuetian <wengxt@gmail.com>
2022-05-15 10:07:57 +03:00
Ran Benita 3d56569ab2 ci/linux: bring back `apt update` to fix `apt install` 404s
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-03-20 13:51:14 +02:00
Ran Benita 0b3d90925c scanner: prefix functions with `scanner_` to avoid symbol conflicts
Particularly `eof()` in mingw-w64.

Fixes: https://github.com/xkbcommon/libxkbcommon/pull/285
Reported-by: Marko Lindqvist
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-03-14 16:45:19 +02:00
Mladen Milinkovic a2507c0866 Improve misleading comments #270 2022-02-24 12:43:20 +02:00
Ran Benita 9e7f3ba496 ci: another possible fix for release workflow
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-02-04 12:59:18 +02:00