The current test is incorrect, since 'map[None]' is entirely valid. In
most cases this doesn't cause any problems, since the default fallback
is Level1, and it's almost always 'map[None] = Level1' anyway. But in
one case in xkeyboard-config it isn't, in types/numpad(mac):
type "KEYPAD" {
modifiers = None;
map[None] = Level2;
level_name[Level2] = "Number";
};
So before checking if no modifiers were mapped, make sure there *were*
any modifiers at all.
https://bugs.freedesktop.org/show_bug.cgi?id=85092
Reported-by: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
The keysym cache for the new scanner was not initialized.
To avoid such errors also in the future, require passing the priv
argument in scanner_init(), instead of initializing it separately.
Signed-off-by: Ran Benita <ran234@gmail.com>
Some results from the benchmark (compilation of en_US.UTF-8/Compose):
$ grep 'model name' /proc/cpuinfo
model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
$ uname -a
Linux ran 3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux
$ ./test/compose bench
compiled 1000 compose tables in 7.776488331s
So according to the above benchmark and valgrind --tool=massif, an
xkb_compose_table adds an overhead of about ~8ms time and ~130KB
resident memory.
For contrast, a plain US keymap adds an overhead of ~3ms time and 90KB
resident memory.
Signed-off-by: Ran Benita <ran234@gmail.com>
xkbcommon-compose is a Compose implementation for xkbcommon. It mostly
behaves like libX11's Compose, but the support is somewhat low-level and
is not transparent like in libX11. The user must add some supporting code
in order to utilize it.
The intended audience are users who use xkbcommon but not a full-blown
input method. With this they can add Compose support in a straightforward
manner, so they have a fairly complete keyboard input for Latin-like
languages at least.
See the header documentation for details.
Signed-off-by: Ran Benita <ran234@gmail.com>
If we have a big array which can be finalized, on average we can give
back 1/4 of its size, which the allocator might be able to use.
Signed-off-by: Ran Benita <ran234@gmail.com>
We added a -fvisibilty=default to the libtest.la CFLAGS. When automake
sees that the CFLAGS are different from those of libxkbcommon.la, it
figures it should recompile all of the $(libxkbcommon_la_SOURCES),
instead of reusing the already-compiled object files.
But actually, the convenience library is not a shared object, it's just
used as an archive, thus the -fvisibility is entirely pointless. So
avoid the recompilations by just removing it.
Signed-off-by: Ran Benita <ran234@gmail.com>
Replace the dog-slow unneeded strncasecmp() with an inlineable memcmp().
Before:
compiled 2500 keymaps in 8.348715629s
After:
compiled 2500 keymaps in 7.872640338s
Signed-off-by: Ran Benita <ran234@gmail.com>
The "width" terminology comes from the group*width+level layout of the
keysyms in a key, as used in the old implementations. We don't keep all
the keysyms of a key in one array so change it to a more accurate name.
Signed-off-by: Ran Benita <ran234@gmail.com>
It's easier to quickly go through the functions in a module this way.
The names provide enough "brief description" to get someone to click for
the full description.
Signed-off-by: Ran Benita <ran234@gmail.com>
An mlvo can also be used in an expansion, but we didn't mark them in
this case in commit d8a4f52cb9. This caused wrongful warnings on
something like -l ch -v fr -- the `fr` is only added via expansion.
Signed-off-by: Ran Benita <ran234@gmail.com>
Due to wildcard matches in the rules file, this is only really useful
for misspelled or missing options, e.g.
$ ./test/rmlvo-to-kccgst -o comprose:ralt > /dev/null
xkbcommon: ERROR: Unrecognized RMLVO option "comprose:ralt" was ignored
Although it is more of a warning, it indicates a misconfiguration which
the user probably wants to see. Therefore the log level is ERROR.
Signed-off-by: Ran Benita <ran234@gmail.com>