Commit Graph

1573 Commits (bea54b1f7db7a171b93cdfb272abc70a694df465)

Author SHA1 Message Date
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
Ran Benita 24846080db test/keyseq: add test
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-11 14:08:12 +03:00
Ran Benita 64fec8f31a configure.ac: add -Wdocumentation
It's supported by clang and warns about bad doxygen comments.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-11 12:15:31 +03:00
Ran Benita 5f8ccd18f6 doc: fix @param display for xkb_x11_setup_xkb_extension()
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-11 12:09:57 +03:00
Ran Benita 1054962d4c symbols: use darray_foreach_from for nicer loop
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-11 02:57:37 +03:00
Ran Benita f03dcf9fb6 Remove compatibility symbols
Remove the deprecated symbols that were used for ABI compatibility
during the transition period to the first stable version, 0.2.0.

The old *names* can still be used, programs which use the old names will
continue to work, as long as they were compiled against a stable
version (as they have been #defined to the new names from the start; see
xkbcommon/xkbcommon-compat.h). Namely, this will break binaries which:

1. Were compiled against a pre-stable version of libxkbcommon, and
2. Are linked against the next version of libxkbcommon, and
3. Expect to work.

This scenario is very unlikely, and will break in many other ways
anyway. Also, retaining support for these means including them in the
new symbol version file, which I would like to avoid.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-10 19:11:41 +03:00
Jan Engelhardt 5444f6a8ca build: use symbol versioning
Symbol versions provide a means by which ELF utilities can determine
whether a program is incompatible with a too-old library version so
that package management tools can autodetect version-based
dependencies and suggest upgrade paths.

[ran: swap xkbcommon.map and xkbcommon-x11.map]

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-10 18:52:13 +03:00
Ran Benita a931740cc7 keycodes: fix keymap compilation with no aliases and malloc(0)==NULL
If the keymap doesn't have any key-aliases (which is certainly
possible), the calloc(num_key_aliases, ...) is allowed to return NULL
according to the C standard, but this is not an error.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-10 13:44:33 +03:00
Ran Benita 7a87c202b7 ast-build: fix leak in error path
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-10 13:10:33 +03:00
Ran Benita ba98562909 test: make most tests portable by copying linux/input.h locally
There is really no reason to deny these tests from different platforms
only for a few #defines.

The only linux-only test (or test program, it is not run by make check)
is interactive-evdev, which actually uses evdev.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-06 11:29:15 +03:00
Pino Toscano e95fb475eb Remove <linux/input.h> include from test/x11comp.c
libxkbcommon 0.4.3 introduces a new test, x11comp, which does not build
on non-Linux OSes because of the unconditional <linux/input.h> include.

This seems not needed even on Linux, so attached there is a simple patch
to remove it.

https://bugs.freedesktop.org/show_bug.cgi?id=83551

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-06 11:11:13 +03:00
Ran Benita 00733da377 Merge pull request #11 from michaelforney/master
Fix typo in default-variant configure option
2014-09-02 01:12:18 +03:00
Michael Forney 76ae9fb948 Fix typo in default-variant configure option 2014-09-01 13:09:29 -07:00
Ran Benita fc95057c5f test/x11comp: don't hang if Xvfb is not available
If Xvfb is not present, posix_spawn still forks, but the child fails.
In that case, since we left the write fd of the pipe open in the parent,
we just kept waiting on the read() without noticing that the other side
is dead.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-09-01 17:20:40 +03:00
Ran Benita 527bf96f9b keymap: fix typo
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-24 10:16:41 +03:00
David Herrmann c62cde57f5 keymap: fix description of xkb_keymap_key_get_syms_by_level()
The @level argument is restricted by xkb_keymap_num_levels_for_key(). Fix
the description to no longer mention xkb_keymap_num_layouts_for_key().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-08-24 10:14:07 +03:00
Ran Benita 76016d5121 Bump version to 0.4.3
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-19 20:17:16 +03:00
Ran Benita 537c1700d6 Update NEWS
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-19 20:17:16 +03:00
Ran Benita f3597f1b62 test/state: add test_update_mask() test
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-18 21:51:57 +03:00
Ran Benita a1f0595a68 state: make sure the mods are fully resolved after xkb_state_update_mask()
Virtual modifiers can have "mappings" to real modifiers, e.g. NumLock
may also set Mod2. In a normal turn of events, the various components
(depressed, latched, locked, and consequently effective) include the
mapped mods, because the masks are pre-resolved everywhere. However,
xkb_state_update_mask() accepts arbitrary mod masks, which may not be
resolved (if it comes from somewhere other than
xkb_state_serialize_mods()). So let's always resolve them ourselves.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-18 21:46:39 +03:00
Ran Benita 99184f1614 Make the effective mod mask calculation available to other files
We will want to use that function in state.c as well.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-18 20:26:19 +03:00
Ran Benita 80ae8e61ff state: no need for loop in xkb_state_update_mask()
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-18 20:08:53 +03:00
Ran Benita a95c4e83e4 test/x11comp: server writes \n to displayfd
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-18 19:47:10 +03:00
Ran Benita 4df720b464 test/x11-keyseq: new test
It is like test/stringcomp, only instead of using
xkb_keymap_new_from_string(), it uses xkbcomp to upload the keymap to a
dummy Xvfb X server and then xkb_x11_keymap_new_from_device().

If any of these components are not present or fails, the test is shown
as skipped.

The test is messy, fragile, limited and depends on external tools, but I
will improve on that later -- it's better to have a test.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-09 22:57:24 +03:00
Ran Benita 56de0115e6 x11/keymap: handle private actions
Previously we treated them as NoAction().

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-09 22:42:45 +03:00