|
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>
|
|
1bd3b3c7
|
2020-11-19T00:28:37
|
|
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>
|
|
9caa4128
|
2020-11-19T16:15:42
|
|
build: combine test & bench internal deps
No need to duplicate this really.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
2c295b10
|
2020-09-11T15:07:39
|
|
Bump version to 1.0.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
6178924f
|
2020-09-07T12:27:26
|
|
test/tool-option-parsing: skip testing of disabled tools
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
737030ad
|
2020-09-07T12:19:17
|
|
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>
|
|
13745014
|
2020-09-07T19:24:12
|
|
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>
|
|
12f99d0d
|
2020-09-05T22:57:42
|
|
Bump version to 1.0.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
66e7f0da
|
2020-09-03T08:30:45
|
|
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 d00cf64dbc586a1052e1f0d0e7f1a48bbff293ec
|
|
4d0d5091
|
2020-08-31T08:36:38
|
|
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>
|
|
e50c3e2c
|
2020-08-30T21:54:21
|
|
build: fix meson "uses features which were added in newer versions" warning
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
d00cf64d
|
2020-07-10T11:32:48
|
|
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>
|
|
d7b39f6f
|
2020-07-10T08:50:02
|
|
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>
|
|
a0c1c2f4
|
2020-08-08T14:35:36
|
|
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>
|
|
608e9361
|
2020-07-25T16:30:39
|
|
tools: run test-tool-option-parsing.py like a regular test
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
00530bea
|
2020-07-25T16:06:40
|
|
build: use gnu_symbol_visibility instead of explicit -fvisibility
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
61772c77
|
2020-07-25T16:01:00
|
|
build: use nicer / syntax instead of join_paths()
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
0066e387
|
2020-07-25T15:49:17
|
|
tools: make independent from src/
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
d67c9cff
|
2020-07-25T15:24:40
|
|
build: use cc.get_supported_arguments()
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
0615c911
|
2020-07-25T15:15:31
|
|
build: remove explicit -Wextra
Implied by `warning_level=2`.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
f439ce18
|
2020-07-25T11:17:11
|
|
tools: some minor changes to xkbcli
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
ce5eb1ac
|
2020-07-24T13:31:03
|
|
tools: link the tools against libxkbcommon.so only
The tools previously linked against a static version (by simply recompiling
everythiong). This isn't necessary, we can link them against libxkbcommon.so.
Only exception: The xbkcli-compile-keymap tool needs a private API for the
--kccgst flag. Avoid this by disabling this flag in the installed tool and
building the same tool, statically linked but not-installed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
cd119a28
|
2020-07-23T09:37:15
|
|
Drop use of ronn, switch to raw roff instead
Drop the ronn source files, check in the generated files instead. This gets rid
of the ruby+gem+ronn toolchain requirement at the cost of having to edit raw man
pages.
ronn files are as-generated but with the preamble and generation date removed.
The latter isn't important enough to keep, it'll just go stale for manually
maintained files and it's not worth setting up a configure_file() just for that
date.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
d480f053
|
2020-07-13T15:38:50
|
|
tools: add a test program to parse the commandline options
A pytest wrapper around our xkbcli tool - copied from libinput.
This calls our various xkbcli tools with varying options and check that they
either succeed or return the right error code. The coverage is limited, it
does not (and cannot) test for all possible combinations but it should provide a
good red flag if we have inconsistent behavior or accidentally break some
combination of flags.
Meanwhile, we can at least assume that all our commandline arguments are parsed
without segfaulting or worse.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
449ed2b8
|
2020-07-13T12:28:43
|
|
tools: drop getopt vs getopt_long differentiation
On all platforms we build on where getopt.h is available, getopt_long is also
available. Only Windows doesn't have either but that's no reason for us to
differentiate between the two.
If we need to special-case getopt vs getopt_long, it's probably better to
implement our own cross-platform version of it and use that.
Fixes #161
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
ab3be693
|
2020-07-13T12:13:23
|
|
tools: switch interactive-evdev to getopt_long
Requiring long options for this tool means it's immediately obvious what an
invocation does, compare e.g.
xkbcli interactive-evdev -gcd
to the equivalent:
xkbcli interactive-evdev --consumed-mode=gtk --enalbe-compose --report-state-changes
This drops the evdev offset argument - that offset should never be anything
other than 8, having this as argument here is more likely to confuse or
produce misleading debugging logs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
29e80e7b
|
2020-07-08T13:30:47
|
|
tools: install our tools as xkbcli subcommands
The xkbcli tool usage help is ifdef'd out where the tool isn't built but the
man page always includes all tools. Easier that way.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
ed57fb8b
|
2020-07-08T12:51:54
|
|
tools: add a xkbcli tool as entry point for the various tools we have
This is the base tool, no subtools are currently connected so you only get help
and version for now. The goal here is to have a git-like infrastructure where
/usr/bin/xkbcli is the main tool, anything else will hide in libexec.
The infrastructure for this is copied from libinput. Tools themselves will
will be installed in $prefix/libexec/xkbcommon and the xkbcli tool forks
off whatever argv[1] is after modifying the PATH to include the libexec dir.
libinput has additional code for checking whether we're running this from the
builddir but it's a bit iffy and it's usefulness is limited - if you're in the
builddir anyway you can just run ./builddir/xkbcli-<toolname> directly.
So for this code here, running ./builddir/xkbcli <toolname> will execute the
one in the prefix/libexecdir.
Since we want that tool available everywhere even where some of the subtools
aren't present, we need to ifdef the getopt handling.
man page generation is handled via ronn which is a ruby program but allows
markdown for the sources. It's hidden behind a meson option to disable where
downloading ronn isn't an option. The setup is generic enough that we can add
other man-pages by just appending to the array.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
1b796a72
|
2020-07-09T13:52:58
|
|
meson.build: move registry-list tool down to the tools section
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
10a881a4
|
2020-07-09T13:31:20
|
|
meson.build: only build the tools where getopt.h is available
Windows doesn't have getopt.h. This would prevent building the tools but
they are behind other checks that cause them to be disabled. The only tools
that don't need getopt.h are interactive-wayland and interactive-x11 but
neither is particularly useful on Windows. Just hide all tools behind the getopt
check in preparation for the upcoming tool consolidation work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
76d847ac
|
2020-07-08T12:35:23
|
|
meson.build: move the config.h generation to the bottom
We cannot add to configh_data after this command so let's generate this last.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
90ece8fb
|
2020-07-09T11:06:23
|
|
meson.build: registry list is dependent on getopt_long
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
9cff8df2
|
2020-07-09T12:24:22
|
|
meson.build: drop install:false from configure_file
meson complains because this requires 0.50.0 and we don't require that. But
since it defaults to false anyway, let's just omit it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
c3d42390
|
2020-07-23T09:04:10
|
|
meson.build: add the valgrind test setup, exclude python tests
This way we can invoke the expected setup with
meson test --setup=valgrind
And because we don't care about valgrinding python script, mark that test as
part of the "python-tests" suite and skip it during our CI valgrind run.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
2a834305
|
2020-07-23T09:22:51
|
|
meson.build: fix pkgconfig deprecation warning
../meson.build:239: DEPRECATION: Library xkbcommon was passed to the "libraries"
keyword argument of a previous call to generate() method instead of first
positional argument. Adding xkbcommon to "Requires" field, but this is a
deprecated behaviour that will change in a future version of Meson. Please
report the issue if this warning cannot be avoided in your case.
This was introduced in meson 0.49.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
fa300b24
|
2020-07-22T11:47:15
|
|
test: fix Windows CI by rewriting symbols-leak-test from bash to python
The CI started installing some wrapper instead of a real bash which is
what gets found.
See:
https://github.com/actions/virtual-environments/pull/1081
Given meson is written in python, it should always be available
hopefully.
Disabled valgrind wrapper for now because it now also applies to the
python interpreter which leaks like a sieve.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
fc2d4fa2
|
2020-07-07T11:43:08
|
|
tools: add ability to compile from kccgst to rmlvo-to-keymap
This obsoletes the print-compiled-keymap tool though we now require that the
kccgst components are passed via stdin, there is no file loading ability.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
fd391471
|
2020-07-07T10:40:05
|
|
tools: add ability to print the KcCGST components for rmlvo-to-keymap
This makes the rmlvo-to-kccgst tool obsolete.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
e55587f4
|
2020-07-08T09:12:23
|
|
meson.build: always set the default variants/options
Make this more balanced with the rules/layouts so we can rely on that #define to
exist.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
afb26e7d
|
2020-05-12T14:09:50
|
|
Add libxkbregistry to query available RMLVO
This library is the replacement for clients parsing evdev.xml directly.
Instead, they should use the API here so that in the future we may even
be able to swap evdev.xml for a more suitable data format.
The library parses through evdev.xml (using libxml2) and - if requested -
through evdev.extras.xml as well. The merge approach is optimised for
the default case where we have a system-installed rules XML and another file in
$XDG_CONFIG_DIR that adds a few entries. We load the system file first, then
append any custom ones to that. It's not possible to overwrite the MLVO list
provided by the system files - if you want to do that, get the change upstream.
XML validation is handled through the DTD itself which means we only need to
check for a nonempty name, everything else the DTD validation should complain
about.
The logging system is effectively identical to xkbcommon.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
9b1b0c57
|
2020-06-16T10:34:07
|
|
Add a snprintf_safe() helper function
Returns true on success or false on error _or_ truncation. Since truncation is
almost always an error anyway, we might as well make this easier to check.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
362130de
|
2020-06-23T16:32:05
|
|
meson.build: prefix all tools with xkbcommon-
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
3adbe54e
|
2020-06-23T16:20:08
|
|
tools: move the remaining tools from test to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
f525f9f0
|
2020-06-23T16:25:50
|
|
test: disentangle interactive-wayland from the test headers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
1326d5ad
|
2020-06-23T16:23:24
|
|
test: untangle interactive-x11 from the test headers
Use the new tools headers and create a custom internal lib for the x11 tool.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
c09bf363
|
2020-06-23T14:01:48
|
|
test: untangle interactive-evdev from the test headers
Move (sometimes duplicate) the required bits into new shared files
tools-common.(c|h) that are compiled into the internal tools library. Rename the
test_foo() functions to tools_foo() and in one case just copy the code of the
keymap compile function to the tool.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
6c629a10
|
2020-06-23T15:56:16
|
|
Use a custom internal library for the tools
This is currently identical to the internal test library, but it's a start to
disentangle the two.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
ec2bbe59
|
2020-06-22T13:07:46
|
|
Move the various tools to a tools/ directory
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
5fb2c676
|
2020-06-02T16:18:47
|
|
doc: add documentation for user configuration
Most of this is currently hidden in the commit message for ca033a29d2ca, let's
make it a bit more public so we have a link to point users to.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
a2657874
|
2020-06-02T16:11:33
|
|
doc: add the rules-format file (as markdown)
Useful to have this as part of the documentation. The rendering isn't great but
at least not any worse than pure text. Markdown escapes % so explaining our use
of %S and %H would require a double % - not idea. Let's just wrap it as a code
block and done.
Includes two typo fixes too, yay.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
908e014f
|
2020-04-10T16:32:13
|
|
Fix building X11 tests on PE targets
Link libxkbcommon_x11_internal with libxkbcommon_test_internal, rather
than libxkbcommon.
This avoids some tests linking with both libxkbcommon_test_internal and
libxkbcommon, which causes duplicate symbol problems on PE targets (e.g.
Cygwin) (as all the symbols from libxkbcommon are pulled in at link
time, which clash with libxkbcommon_test_internal)
|
|
188a1c79
|
2020-03-20T18:29:03
|
|
test: add "how to type" demo program
The program takes a unicode codepoint and an RMLVO and prints out all
key + modifier combinations that would result in that codepoint.
The program was written to exercise the new
xkb_keymap_key_get_mods_for_level() function. It's handy and can be
extended in several ways, but enough for now.
Example:
$ ./build/how-to-type -l us,il,ru 0x41 | column -ts $'\t'
keysym: A (0x41)
KEYCODE KEY NAME LAYOUT# LAYOUT NAME LEVEL# MODIFIERS
38 AC01 1 English (US) 2 [ Shift ]
38 AC01 1 English (US) 2 [ Lock ]
38 AC01 2 Hebrew 2 [ Shift ]
38 AC01 2 Hebrew 2 [ Lock ]
$ ./build/how-to-type -l de -v neo 0x3b6 | column -ts $'\t'
keysym: Greek_zeta (0x7e6)
KEYCODE KEY NAME LAYOUT# LAYOUT NAME LEVEL# MODIFIERS
56 AB05 1 German (Neo 2) 4 [ Shift Mod5 ]
56 AB05 1 German (Neo 2) 4 [ Shift Mod2 Mod3 Mod5 ]
56 AB05 1 German (Neo 2) 4 [ Shift Lock Mod5 ]
56 AB05 1 German (Neo 2) 4 [ Lock Mod2 Mod3 Mod5 ]
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
1b23a650
|
2020-02-18T14:12:20
|
|
build: fix build with byacc
We apparently broke byacc support in the switch to meson.
byacc only supports short option names. And to make things fun, bison
only supports long option for `--defines`.
Fixes: https://github.com/xkbcommon/libxkbcommon/issues/133
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
e3c3420a
|
2020-01-18T23:08:28
|
|
Bump version to 0.10.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
f09ae987
|
2019-08-05T13:51:09
|
|
build: Skip building some tests on MSVC for now
This is a stopgap measure to quickly get tests building with MSVC for
now, at some point the tests could be rewritten to avoid using getopt()
and mkdtemp() or to ship an implementation.
|
|
578aeac6
|
2019-08-05T13:37:23
|
|
build: add some defines for MSVC to allow it to be unixy
[ran: combined some commits]
|
|
d59ff39d
|
2019-08-13T01:17:51
|
|
meson.build: Take win_bison as a possible variant for Bison
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
40aab05e
|
2019-12-27T13:03:20
|
|
build: include config.h manually
Previously we included it with an `-include` compiler directive. But
that's not portable. And it's better to be explicit anyway.
Every .c file should have `include "config.h"` first thing.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
bdff8ebe
|
2019-08-05T16:18:05
|
|
Provide a fallback implementation of [v]asprintf()
Some environments (e.g. Windows + MSVC) do not provide asprintf() or
vasprintf(). This tries to detect their presence, and provides suitable
fallback implementations when not available.
|
|
93a13050
|
2019-08-05T16:07:57
|
|
Provide a fallback implementation of strndup()
Some environments (e.g. Windows + MSVC) do not provide strndup(), this
tries to detect its presence and provide a fallback implementation when
not available.
[ran: some tweaks]
|
|
ca033a29
|
2019-09-03T11:23:14
|
|
rules: add include statements to rules files
The majority use-case for extending XKB on a machine is to override one or a
few keys with custom keycodes, not to define whole layouts.
Previously, we relied on the rules file to be a single file, making it hard to
extend. libxkbcommon parses $XDG_CONFIG_HOME/xkb/ but that only works as long
as there is a rule that matches the user-specified RMLVO. This works for MLV
but not for options which don't have a wildcard defined. Users have to copy
the whole rules file and then work from there - not something easy to extend
and maintain.
This patch adds a new ! include directive to rules files that allows including
another file. The file path must be without quotes and may not start with the
literal "include". Two directives are supported, %H to $HOME and %S for the
system-installed rules directory (usually /usr/share/X11/xkb/rules).
A user would typically use a custom rules file like this:
! option = symbols
custom:foo = +custom(foo)
custom:bar = +custom(baz)
! include %S/evdev
Where the above defines the two options and then includes the system-installed
evdev rule. Since most current implementations default to loading the "evdev"
ruleset, it's best to name this $XDG_CONFIG_HOME/xkb/rules/evdev, but any
valid name is allowed.
The include functionally replaces the line with the content of the included
file which means the behavior of rules files is maintained. Specifically,
custom options must be defined before including another file because the first
match usually wins. In other words, the following ruleset will not assign
my_model as one would expect:
! include %S/evdev
! model = symbols
my_model = +custom(foo)
The default evdev ruleset has wildcards for model and those match before the
my_model is hit.
The actual resolved components need only be in one of the XKB lookup
directories, e.g. for the example above:
$ cat $XDG_CONFIG_HOME/xkb/symbols/custom
partial alphanumeric_keys
xkb_symbols "foo" {
key <TLDE> { [ VoidSymbol ] };
};
partial alphanumeric_keys
xkb_symbols "baz" {
key <AB01> { [ k, K ] };
};
This can then be loaded with the XKB option "custom:foo,custom:bar".
The use of "custom" is just as an example, there are no naming requirements
beyond avoiding already-used ones. Also note the bar/baz above - the option
names don't have to match the component names.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
068e38ed
|
2019-12-14T13:45:35
|
|
meson: remove redundant malloc scribbling
Turns out meson already sets this (at least MALLOC_PERTURB) on its own
for the `test` target.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
6d83838c
|
2019-10-20T23:07:52
|
|
Bump version to 0.9.1
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
a88a0710
|
2019-10-19T00:33:09
|
|
Bump version to 0.9.0
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
934d5741
|
2019-09-09T17:56:42
|
|
build: Solaris needs __EXTENSIONS__ instead of _GNU_SOURCE
Fix meson build on Solaris by using __EXTENSIONS__ where Linux & other
platforms use _GNU_SOURCE. Without this the build fails due to missing
prototypes for functions like strdup & getopt not defined in the C99
standard. (In autoconf, this was handled by AC_USE_SYSTEM_EXTENSIONS.)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
97f41fe4
|
2019-07-25T13:24:00
|
|
test/symbols-leak-test: make it work with macOS diff
The <() stuff fails with an error:
diff: extra operand `/dev/fd/61'
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
909cc04d
|
2019-07-02T13:48:32
|
|
interactive-wayland: Port to stable xdg-shell (#100)
xdg_shell v6 was pretty close to the finalised stable version of
xdg-shell. We can now just use the stable version, which is supported
everywhere (Enlightenment, KWin, Mutter, Weston, wlroots).
This requires bumping the wayland-protocols dependency.
Signed-off-by: Daniel Stone <daniels@collabora.com>
|
|
9d58bbd4
|
2019-06-04T14:01:02
|
|
Use bitwise test instead of popcount to check if one bit is set
We don't need to determine the total number of bits set to determine if
exactly one is set.
Additionally, on x86_64 without any -march=* flag, __builtin_popcount
will get compiled to a function call to the compiler runtime (on gcc),
or a long sequence of bit operations (on clang).
Signed-off-by: Michael Forney <mforney@mforney.org>
|
|
9badb4e4
|
2019-02-23T05:55:00
|
|
meson.build: use program from build machine not host or target.
We can't always execute binaries from the host or target machine,
as is the case in cross compilation.
closes #89
|
|
d40b368b
|
2019-02-22T22:26:49
|
|
Bump version to 0.8.4
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
3f509533
|
2019-02-11T09:19:28
|
|
meson.build: link the sources directly into libxkbcommon-x11
Similar to 75ce741ab97e3d17a0c9b06dd4bdf57c00d5538e, just for the -x11
sublibrary.
This works around meson bug 3937, 'link_whole' arguments don't get added into
the final static library and we end up with a virtually empty 8-byte
libxkbcommon-x11.a file, see https://github.com/mesonbuild/meson/issues/3937
The internal lib is still built for the one test case that requires it.
Fixes #86
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
9f93ebcf
|
2019-02-08T12:39:01
|
|
Bump version to 0.8.3
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
caddfdb0
|
2019-02-08T12:29:27
|
|
meson: make comment make sense now
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
75ce741a
|
2019-02-08T12:15:48
|
|
meson.build: manually link all sources into the library
This works around meson bug 3937, 'link_whole' arguments don't get added into
the final static library and we end up with a virtually empty 8-byte
libxkbcommon.a file, see https://github.com/mesonbuild/meson/issues/3937
Workaround is simply to add all sources to both libraries we need them in.
This obviously compiles them twice but this year's winter was cold and
bit of extra warmth will be appreciated.
Fixes #84
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
87b0765f
|
2018-08-21T09:05:09
|
|
Merge pull request #68 from whot/wip/xkeyboard-config-tester
xkeyboard-config combination tester
|
|
d1cb8ad4
|
2018-08-14T11:16:30
|
|
test: add a tool to test-compile all LVO combinations from xkeyboard-config
This test contains of two parts:
- a simple program to convert RMLVO commandline arguments into a keymap (and
print that keymap if requested).
- a python script that runs through rules/evdev.xml, and tries to compile a
keymap for sort-of every layout/variant/option combination. Sort-of, because
we can have multiple options and it really only does one per layout(variant)
combination.
Same thing can be done using xkbcomp, but right now it doesn't take that as
argument, it's hard-coded.
This takes quite a while, installing python-tqdm is recommended to see fancy
progress bars instead of just miles of dumps.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
d7891d09
|
2018-08-18T15:12:15
|
|
build: turn off strict aliasing
The benchmarks don't show any effect, so turn it off to have one less
thing to worry about. The parser does a lot of casting between AST
nodes.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
a9ace75f
|
2018-08-18T14:28:15
|
|
x11: fix undefined behavior when copying the coordinates of ptr movements actions
Left shift of a negative integer. For some reason the protocol
representation here got really botched (in the spec it is just a nice
and simple INT16).
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
f8134c85
|
2018-08-05T08:51:30
|
|
Bump version to 0.8.2
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
87046f56
|
2018-08-03T13:55:52
|
|
Bump version to 0.8.1
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
2cb5c2a3
|
2018-03-11T00:04:05
|
|
Add fuzzing infrastructure
Though text formats aren't exactly fuzzer's strong suit, fuzzers can
catch many surface-level bugs.
The fuzz/ directory contains target programs, testcases and dictionaries
to drive the afl fuzzer.
This commit adds a fuzzer for the XKB keymap text format and the Compose
text format. On my slow machine, using a single core, a full cycle of
the XKB fuzzer takes 5 hours. For Compose, it takes a few minutes.
Fuzzing for the other file formats (rules files mostly) will be added
later.
To do some fuzzing, run `./fuzz/fuzz.sh`.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
83a553a0
|
2018-07-17T17:21:02
|
|
meson: Fix xkbcommon-x11.pc Requires versioning
Old meson expects an array with one dependency per element. Providing a
string containing multiple deps results in only the first dep getting
its whitespace properly applied. As a result, the output was:
Requires.private: xcb >= 1.10 xcb-xkb>=1.10
And downstream projects failed to find a package named 'xcb-xkb>=1.10'.
Specifying an array of versioned deps results in correct output:
Requires.private: xcb >= 1.10, xcb-xkb >= 1.10
Fixes #64.
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
|
|
a3c907d3
|
2018-07-17T01:15:30
|
|
meson: Fix xkbcommon-x11.pc Requires
The meson-generated pkgconfig file was missing Requires and
Requires.private.
[ran: adjust for older Meson versions.]
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
c8e17eed
|
2018-07-05T18:13:14
|
|
bench: simplify the bench helpers
Trim the API a bit.
Also, just always use gettimeofday(), which is portable. Hopefully the
system clock doesn't change while a benchmark is running.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
776cb523
|
2018-02-25T11:51:05
|
|
build/meson: fix x11 test/demo compilation with non-standard xcb
The x11 tests/demos did not depend on xcb and xcb-xkb directly, only
indirectly through link_with: libxkbcommon_x11_internal. So linking
worked, but the xcb and xcb-xkb cflags were *not* included when
compiling them. So when using xcb installed in a non-standard location,
what would happen is:
- Library will link with custom xcb and compile with custom xcb headers.
- Test will link with custom xcb and compile with system xcb headers (if
exist, otherwise fail).
Fixes: https://github.com/xkbcommon/libxkbcommon/issues/57
Reported-by: @remexre
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
edb1c662
|
2018-02-14T15:07:46
|
|
build/meson: fix the -Wl,--version-script configure check
Hopefully this fixes compilation on darwin, which doesn't support
version scripts.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b82e3b76
|
2017-12-15T21:41:51
|
|
Bump version to 0.8.0
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
5c904212
|
2017-12-14T17:12:52
|
|
build: disable -Wdocumentation-deprecated-sync
We will never remove the deprecated functions and there is no real
reason to annoy users into stop using them.
If there *will* be a reason, *then* we will add the attribute.
Fixes: https://github.com/xkbcommon/libxkbcommon/issues/56
Signed-off-by: Ran Benita <ran234@gmail.com>
|