Commit Graph

127 Commits (fc664cf1cc8c1cccd6137134cf5018d8fc9b1ca5)

Author SHA1 Message Date
Pierre Le Marre fc664cf1cc Improve documentation
- Add introduction to XKB
- Embrace Doxygen features
- More cross links
2023-05-13 22:05:23 +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
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
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 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 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 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
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 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 ea6580cc39 Bump version to 1.4.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-02-04 12:41:50 +02:00
Alex Xu (Hello71) 8531ea723f 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>
2021-12-05 12:55:51 +02:00
Ran Benita 88222c8d40 Bump version to 1.3.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-09-10 22:51:34 +03:00
Ran Benita b6aadd57d9 tools: add compose tool for Compose debugging
Not very useful so not exposed in xkbcli.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-05-08 21:37:28 +03:00
Ran Benita 13ba9135c0 Bump version to 1.3.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-05-01 23:51:23 +03:00
Ran Benita baf5522649 bench: add atom benchmark
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-04-27 16:41:32 +03:00
Ran Benita 9d87f84915 build: fix missing includes
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-04-27 10:57:42 +03:00
Ran Benita de1b6943d2 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>
2021-04-27 10:10:26 +03:00
Ran Benita 8ff0232bda 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>
2021-04-27 10:02:54 +03:00
Adrian Perez de Castro 4238417ba0 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.
2021-04-27 09:54:58 +03:00
Adrian Perez de Castro 5cd76a8d93 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.
2021-04-27 09:54:00 +03:00
Ran Benita 097a0ca7d6 Bump version to 1.2.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-04-07 19:27:30 +03:00
Ran Benita 086353b380 Bump version to 1.2.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-04-03 14:11:38 +03:00
Ran Benita 90e2d5ee76 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>
2021-03-30 20:42:31 +03:00
Ran Benita 82a5bdc43c Bump version to 1.1.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-02-27 22:48:35 +02:00
Ran Benita 83e3a53ddc 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>
2021-02-27 22:38:21 +02:00
Peter Hutterer d1ba81c4dd meson.build: replace the remaining join_paths() with the nicer / syntax
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-22 13:43:16 +02:00
Peter Hutterer 0abd430e85 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>
2021-02-22 13:43:16 +02:00
Ran Benita c60b77ea51 Bump version to 1.0.3
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-11-23 20:30:13 +02:00
Ran Benita 13e6543ed4 Bump version to 1.0.2
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-11-20 21:02:44 +02:00
Ran Benita 1bd3b3c7cb x11: cache X11 atoms
On every keymap notify event, the keymap should be refreshed, which
fetches the required X11 atoms. A big keymap might have a few hundred of
atoms.

A profile by a user has shown this *might* be slow when some intensive
amount of keymap activity is occurring. It might also be slow on a
remote X server.

While I'm not really sure this is the actual bottleneck, caching the
atoms is easy enough and only needs a couple kb of memory, so do that.

On the added bench-x11:

Before: retrieved 2500 keymaps from X in 11.233237s
After : retrieved 2500 keymaps from X in 1.592339s

Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-11-20 13:04:21 +02:00
Ran Benita 9caa4128c2 build: combine test & bench internal deps
No need to duplicate this really.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-11-19 16:19:56 +02:00
Ran Benita 2c295b10aa Bump version to 1.0.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-09-11 15:07:49 +03:00
Ran Benita 6178924f28 test/tool-option-parsing: skip testing of disabled tools
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-09-08 09:45:34 +03:00
Ran Benita 737030ad5b build: move tests to after tools
So tests can refer to stuff set by the tools section.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-09-07 22:03:30 +03:00
Peter Hutterer 13745014c3 test: include unstd.h in the registry test to cut down the MacOS warnings
mkdtmp, rmdir and unlink are in unstd.h on MacOS. Since including that it
doesn't hurt us on Linux, let's do it without ifdefs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-07 22:01:57 +03:00
Ran Benita 12f99d0dfe Bump version to 1.0.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-09-06 00:00:14 +03:00
Peter Hutterer 66e7f0da20 Revert: tools: add xkbcli-scaffold-new-layout as helper tool
While this tool is useful for users starting with a new keyboard layout, it is a
somewhat bad fit for libxkbcommon. It's the only python tool, we don't even
install it yet (because we're not sure yet what it's supposed to do) and there's
a potential for it to expand into more corner cases.

The only tie it has to libxkbcommon is that it templates the data files that
libxkbcommon reads, but those files are effectively public API.

Let's remove this tool from there and instead move it to a separate git
repository where it can go its own way.

This reverts commit d00cf64dbc
2020-09-03 18:14:16 +10:00
Peter Hutterer 4d0d509129 meson.build: define PATH_MAX where it's missing
PATH_MAX is not POSIX and can be missing on some systems, notably Windows (which
provides MAX_PATH instead tough) and Hurd. Let's define it to a sane value where
missing, i.e.  the one it's defined to in limits.h. Except on Windows where
we're limited to 260.

Fixes https://github.com/xkbcommon/libxkbcommon/issues/180

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-01 08:56:56 +10:00
Ran Benita e50c3e2cc7 build: fix meson "uses features which were added in newer versions" warning
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-08-30 21:54:21 +03:00
Peter Hutterer d00cf64dbc tools: add xkbcli-scaffold-new-layout as helper tool
This tool set ups the required directory structure and template files to add new
keyboard layouts or options. For example, run like this:

    xkbcli-scaffold-new-layout  --layout 'us(myvariant)' --option 'custom:foo'

This will up the evdev rules file, the evdev.xml file, the symbols/us file and
symbols/custom file in $XDG_CONFIG_HOME so that the user has everything in place
and can start filling in the actual key mappings.

This tool is currently uninstalled until we figure out whether it's useful.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-30 21:49:41 +03:00
Peter Hutterer d7b39f6ffb Add /etc/xkb as extra lookup path for system data files
This completes the usual triplet of configuration locations available for most
processes:
- vendor-provided data files in /usr/share/X11/xkb
- system-specific data files in /etc/xkb
- user-specific data files in $XDG_CONFIG_HOME/xkb

The default lookup order user, system, vendor, just like everything else that
uses these conventions.

For include directives in rules files, the '%E' resolves to that path.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-30 21:49:41 +03:00
Ran Benita a0c1c2f42d build: fix byacc invocation
Fixes: https://github.com/xkbcommon/libxkbcommon/issues/133#issuecomment-670902025
Reported-by: Edward-0
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-08-08 14:43:09 +03:00
Ran Benita 608e9361e3 tools: run test-tool-option-parsing.py like a regular test
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-07-25 16:37:57 +03:00
Ran Benita 00530bea6b build: use gnu_symbol_visibility instead of explicit -fvisibility
Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-07-25 16:06:40 +03:00