Commit Graph

1497 Commits (30e7445d846e45f68dd21fd6d954eb7806adc8bd)

Author SHA1 Message Date
Ran Benita 30e7445d84 state: correctly infer inactive type entries
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>
2014-10-17 01:17:59 +03:00
Ran Benita a4c667adf2 symbols: don't warn about conflicting syms if they are the same
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-17 01:17:14 +03:00
Ran Benita 2e5530ad20 parser: bring back warning about includes of files with no default
Using the same format as xkbcomp.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-17 01:17:14 +03:00
Ran Benita 57ad452b55 Merge pull request #14 from jasperla/undefined
disable -Wl,--no-undefined on OpenBSD for it doesn't have DT_NEEDED for libc
2014-10-16 13:11:26 +03:00
Jasper Lievisse Adriaanse dff65c0c70 disable -Wl,--no-undefined on OpenBSD for it doesn't have DT_NEEDED for libc 2014-10-16 11:35:18 +02:00
Ran Benita 1595f2b742 Merge pull request #13 from jasperla/librt
Make librt optional, required for at least OpenBSD
2014-10-15 22:38:17 +03:00
Jasper Lievisse Adriaanse 3e169c4726 Make librt optional, required for at least OpenBSD 2014-10-15 21:08:17 +02:00
Ran Benita c42b864654 test/compose: test include statement
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-14 11:47:25 +03:00
Ran Benita 3f489730d3 test/compose: test modifier syntax
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-14 11:36:00 +03:00
Ran Benita c6e63fd71c compose/parser: fix parsing of multiple modifiers
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-14 11:28:57 +03:00
Ran Benita d1c5dd14e0 compose/parser: parse (! mods) properly
We don't actually do anything with them. But if someone uses them we can
at least not choke.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-13 18:56:57 +03:00
Ran Benita 3c0c3afa09 compose/parser: resolve keysyms in parser instead of scanner
It will become context-sensitive.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-13 18:56:50 +03:00
Ran Benita 0b99c63cf4 compose/parser: use parameter as intended
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-13 18:54:58 +03:00
Ran Benita 8bba4b34ec compose/parser: one more skip_to_eol()
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-13 18:54:52 +03:00
Ran Benita a3116f97d0 compose/parser: fix segfault when including
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>
2014-10-13 18:54:52 +03:00
Ran Benita 65c355aa7a COPYING: add copyright notice from libX11:modules/im/ximcp/imLcPrs.c
We have used some portions of it, so add the notice.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-13 18:54:52 +03:00
Ran Benita 8a0acf2c67 scanner-utils: optimize one-line comments
Compose files have a lot of those.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-08 00:03:34 +03:00
Ran Benita 8d58e250b0 bench/compose: add new benchmark
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-05 12:56:46 +03:00
Ran Benita 5cefa5c5d0 test/interactive-evdev: add compose support
To try, do e.g.:
sudo ./test/interactive-evdev -l us -v intl -o compose:ralt -d

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-05 12:56:46 +03:00
Ran Benita 10a7a2bd69 test/compose: add new test
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>
2014-10-05 12:56:46 +03:00
Ran Benita edc98b5403 compose: add xkbcommon-compose - implementation
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-05 12:56:46 +03:00
Ran Benita 046c802e96 compose: add xkbcommon-compose - API
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>
2014-10-03 00:15:39 +03:00
Ran Benita 29a1a78008 scanner-utils: add priv member
For when a user of the scanner wants to pass something along with it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-03 00:15:39 +03:00
Ran Benita e8b112325c darray: add darray_shrink()
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>
2014-10-03 00:15:39 +03:00
Ran Benita b3f2396588 keysym: add function to test if a keysym is for a modifier
Needed for compose.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-03 00:15:36 +03:00
Ran Benita 94a8e01c52 scanner-utils: add helper for appending an entire string
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-02 22:21:06 +03:00
Ran Benita 8eb024d589 scanner-utils: add helper for hex string escape
Like the already existing oct.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-02 22:21:06 +03:00
Ran Benita bc3b4c084a Move benchmarks from tests to their own files in bench/
The tests only contain tests, and the benchmarks are more visible.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-02 22:03:28 +03:00
Ran Benita fd126551ed build: don't rebuild everything for libtest.la
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>
2014-10-02 21:24:29 +03:00
Ran Benita 4ed68120de scanner-utils: optimize str()/lit()
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>
2014-10-01 19:24:36 +03:00
Ran Benita 725ae134d4 keymap: rename XkbKeyGroupWidth to XkbKeyNumLevels
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>
2014-09-25 22:01:17 +03:00
Ran Benita 2c259f1782 symbols: improve FindKeyForSymbol()
A bit more involved, but can short circuit.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-25 21:55:52 +03:00
Ran Benita 485b736f17 symbols: use correct max value
xkb_level_index_t was initially uint16_t, now it's 32.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-25 21:26:26 +03:00
Ran Benita 9c088df3b3 doc: disable alphabetical data structure index
It is useless - we have very little data structures.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-22 15:46:13 +03:00
Ran Benita 805ed4e71b doc: disable BRIEF_MEMBER_DESC
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>
2014-09-22 15:31:51 +03:00
Ran Benita 08d05799dd doc: disable tree view
It is redundant with the header navigation.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-22 15:27:13 +03:00
Ran Benita 0b448548a8 doc: linkify some references
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-22 15:24:15 +03:00
Ran Benita f088d23f1e x11, doc: add note about Key{Press,Release}->state field
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-22 11:54:04 +03:00
Ran Benita 7831fe2198 x11, doc: add note about per-client flags like detectable autorepeat
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-22 11:54:04 +03:00
Ran Benita 68962aa1f9 keymap-dump: combine modifier_map's with the same modifier
A bit less efficient, but makes for shorter, nicer output.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-22 00:05:38 +03:00
Ran Benita 0224283fdf rules: fix mlvo-not-used warning
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>
2014-09-21 17:09:58 +03:00
Ran Benita f0cd7abcff quick-guide: fix xkb_state_key_get_syms() example
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-21 00:59:11 +03:00
Ran Benita 51ae4a172a quick-guide: fix Java-esque array syntax
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-21 00:56:33 +03:00
Ran Benita d8a4f52cb9 rules: warn when an RMLVO component isn't used
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>
2014-09-20 16:18:26 +03:00
Ran Benita d0c6fce24d parser: use "atom" instead of "sval" in yylval
"sval" is already used for "struct sval".

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-20 15:06:13 +03:00
Ran Benita 1ba7d9ecda doc: reorder "Keymap Components" functions
Put the general keymap stuff before key-specific functions.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-19 12:52:45 +03:00
Ran Benita 494e318946 doc: move consumed modifier description to its own section
With small edits.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-19 00:59:01 +03:00
Ran Benita 0aeb109518 doc: order the modules better
Explicitly specify the files in INPUT so that "X11 Support" appears
after the main modules.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-18 21:14:40 +03:00
Ran Benita c00df88577 x11, doc: fix typo
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-18 12:14:43 +03:00
Ran Benita ab4df099ca x11, doc: add overview
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-18 11:59:27 +03:00