Commit Graph

2234 Commits (efdb05d193febfc519f9fe9b770925f27f6a6df1)

Author SHA1 Message Date
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
Ran Benita ea6580cc39 Bump version to 1.4.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-02-04 12:41:50 +02:00
Peter Hutterer 1c8ef9e0a5 test: add test for variant inheritance of ISO 639/3166 codes
See efa9962432
2022-02-04 12:30:27 +02:00
M Hickford efa9962432
Variants should inherit iso639, iso3166 and brief from parent layout if omitted (#266) 2022-01-24 11:16:08 +10:00
Peter Hutterer 9b05825e53 registry: skip over invalid ISO639 or ISO3166 entries
If the XML file is somehow off, don't load entries that are against the spec.
2022-01-24 10:44:31 +10:00
Peter Hutterer 34ef11d9c9 test: show the tool exit status on failure
We already do so for the non-successful cases, let's do this here too so we know
whether it was a signal or a normal exit.
2022-01-24 07:56:47 +10:00
Peter Hutterer 0e3f72af65 registry: don't call xmlCleanupParser()
From the documentation:
> It does not clean up parser state, it cleans up memory allocated by the library
> itself. It is a cleanup function for the XML library. It tries to reclaim all
> related global memory allocated for the library processing. [...]
> One should call xmlCleanupParser() only when the process has finished using the library.

http://xmlsoft.org/html/libxml-parser.html#xmlCleanupParser

Since we're a library ourselves we cannot know if something else in the same
proces uses the parser, so we must not call this.

Reported-by: M Hickford
2022-01-18 15:03:24 +10:00
Peter Hutterer be68829a6b CI: always run the linux workflow
This makes it easier for contributors to check if their code runs correctly
without having to file a PR.

The Mac and Windows workflows are a bit more involved, so let's keep those on
pull requests only.
2022-01-17 21:44:48 +10:00
Peter Hutterer 121cd37753 CI: split and rename the workflows to windows/macos/linux
"main" is a bit non-descriptive, let's name them after the platforms we run them
on. Splitting them up allows us to be less selective on how we run the various
workflows, e.g. always running the linux one.
2022-01-17 21:44:48 +10:00
M Hickford 9bbe629aad Update README.md
Co-authored-by: Ran Benita <ran@unusedvar.com>
2022-01-11 16:49:22 +02:00