Commit Graph

138 Commits (0a19267f309485df0889b67be118274cbb94c7f6)

Author SHA1 Message Date
Ran Benita 0a19267f30 build: move custom targets to scripts/ and remove from makefile
These scripts generate source code that is committed to git and hence do
not really belong in the build system. A maintainer runs them as needed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 00b08eae82 build: rewrite the update-keysyms sed script in python
A bit more manageable this way, and the other part of the target is
already using python.

The output is the same, except I removed the reference to Makefile.am.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita d44ba481d7 build: remove unneeded preprocessor include flags
Better to avoid these unexpected include paths.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita 1b6fa0298a build: explain why we don't AC_DEFINE a couple of constants
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Daniel Stone 90bd9fdb01 interactive-wayland: Port to xdg-shell v6
Mutter only implements v6 now, and Weston also implements that. Port
interactive-wayland to this so people can keep on using it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-11 15:09:50 +01:00
Daniel Stone 7e123a10b6 test: Add interactive-wayland
interactive-wayland is very similar to x11/xev, and dumps out as much
state as possible.

It provides no titlebar and a completely random cursor, but such is
life.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2016-04-12 12:15:04 +01:00
Daniel Stone bea54b1f7d Add LICENSE to distributed files
Signed-off-by: Daniel Stone <daniels@collabora.com>
2016-03-31 16:43:58 +01:00
Daniel Stone a2974d5f8a doc: Fix Doxygen include for srcdir != builddir
Instead of giving Doxygen a series of absolute paths to the source
files and a relative path to the output directory, run it from the
source directory with purely relative paths to the source files, and
give it an absolute path to the build directory.

This fixes the parsing of README.md with a separate build directory,
since the relative includes for doc/quick-guide.md and doc/compat.md
don't resolve otherwise. Doxygen's INCLUDE_PATH turns out not to fix
this either, since that's just a set of paths to open and parse, rather
than an analogue to cpp's -I.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2016-03-15 11:21:29 +00:00
Ran Benita 914e84e018 build: don't run test/x11comp in make check for now
For some reason, the dumped keymap started repeating the two key types
FOUR_LEVEL_PLUS_LOCK and FOUR_LEVEL_KEYPAD. I need to investigate, but
let's disable it for now until I do (the problem would likely not be in
the xkbcommon - at most in the test itself).

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-03-13 23:17:23 +02:00
Ran Benita fa1b454328 test: add a test that all symbol version file is updated
It is easy to forget to update these files when adding new symbols.

Stolen with slight changes from libinput (commit by Marek Chalupa):
https://cgit.freedesktop.org/wayland/libinput/commit/?id=a9f216ab47ea2f643f20ed741b741a2b5766eba3

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-03-13 23:17:23 +02:00
Ran Benita 712b39ac7d build: make it easier to add non-built (e.g. script) tests
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-03-13 21:33:03 +02:00
Ran Benita c991a7df56 build: fix distcheck
File was renamed in 4266402.

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-01-20 23:30:51 +02:00
Mike Blumenkrantz 0ce17ef3ea keymap: add xkb_keymap_key_by_name(), xkb_keymap_key_get_name(), tests
xkb_keymap_key_by_name() allows finding a keycode from a given keyname and
is useful for generating keyboard events to use in regression tests
during CI

xkb_keymap_key_get_name() is the inverse of xkb_keymap_key_by_name()

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
[ran: some stylistic tweaks + another test case]
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-01-20 23:17:10 +02:00
Kazunobu Kuriyama 3c12d671cc bench: Modify benchmarks for a wider range of platforms
- Add the new files bench.c and bench.h to implement a timer module.
 - Implement the module with clock_gettime(), mach_absolute_time(), or
   gettimeofday(), depending on a given platform.
 - Replace the time measurement code of the benchmark programs with the
   functions of the module.
2015-08-28 20:02:26 +09:00
Ran Benita 257e38c821 build: don't fail if linker version scripts are not supported
Some platforms (such as OSX) do not support version scripts. In these
platforms the symbols will not be versioned, but it is OK to omit them.

https://github.com/xkbcommon/libxkbcommon/issues/24
2015-07-17 23:26:20 +03:00
Ran Benita 413954aa44 Add PACKAGING file
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-18 15:51:41 +03:00
Ran Benita 047d06122e Makefile.am: add symbol files to EXTRA_DIST
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-18 15:07:37 +03:00
Ran Benita 0419f6e783 docs: make html output have a fixed width, hide footer
It's hard to read text which stretches indefinitely.

The footer is not adding much.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-18 15:06:16 +03:00
Ran Benita 494a8fbf3f README: move compatibility notes to their own page
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-18 15:05:30 +03:00
Jasper Lievisse Adriaanse 3e169c4726 Make librt optional, required for at least OpenBSD 2014-10-15 21:08:17 +02: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 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 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 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 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
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 2a610ff411 build: add docs to EXTRA_DIST
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-03-27 20:37:43 +02:00
Ran Benita 2bbaf7c7d1 Add utf8.{c,h} for common UTF-8 util functions
We need to validate some UTF-8, so this adds an is_valid_utf8()
function, which is probably pretty slow but should work correctly.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-03-22 02:10:28 +02:00
Ran Benita aed3469474 build: small fixes and formatting of Makefile.am
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-11 17:44:11 +02:00
Ran Benita 9c48d3033a build: fix libtest AM_CLFLAGS typo
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-11 17:16:40 +02:00
Ran Benita e55a0cead1 Move src/xkbcomp/scanner-utils.h to src/
As we'll use it for things unrelated to xkbcomp.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-10 20:57:27 +02:00
Ran Benita 2f93c78894 x11: add a couple of tests
Add two tests:

    ./test/interactive-x11
which is like test/interactive-evdev, but should behave exactly like your
X keyboard and react to state and keymap changes - in other words, just
like typing in xterm. Press ESC to exit.

    ./test/x11
which currently should only print out the same keymap as
    xkbcomp $DISPLAY out.xkb
(modulo some whitespace and some constructs we do not support.)

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-02 11:16:40 +02:00
Ran Benita eb34825560 x11: add XKB protocol keymap and state creation support
These are function to create an xkb_keymap directly from XKB requests
to the X server. This opens up the possibility for X clients to use
xcb + xcb-xkb + xkbcommon as a proper replacement for Xlib + xkbfile for
keyboard support.

The X11 support must be enabled with --enable-x11 for now.
The functions are in xkbcommon/xkbcommon-x11.h. It depends on a recent
libxcb with xkb enabled. The functions are in a new libxkbcommon-x11.so,
with a new pkg-config file, etc. so that the packages may be split, and
libxkbcommon.so itself remains dependency-free.

Why not just use the RMLVO that the server puts in the _XKB_RULES_NAMES
property? This does not account for custom keymaps, on-the-fly keymap
modifications, remote clients, etc., so is not a proper solution in
practice. Also, some servers don't even set it. Now, the client just
needs to recreate the keymap in response to a change in the server's
keymap (as Xlib clients do with XRefreshKeyboardMapping() and friends).

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-02 11:16:40 +02:00
Ran Benita ddbefda383 build: error out on undefined symbols
This helps ensure we don't ship a library with undefined symbols, which
can easily happen with multiple inter-dependent DSOs.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-01-13 18:24:24 +02:00
Ran Benita a9c56f643d context: split private functions to context-priv.c
(Same as keymap-priv.c).

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-01-13 17:22:15 +02:00
Ran Benita 7210497c63 keymap: split private functions to keymap-priv.c
This makes it easier to share the private functions in other DSOs
without relying (too much) on dead code elimination, exported symbols,
etc.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-01-13 17:22:02 +02:00
Ran Benita d63e0ab838 test: rename test/interactive to interactive-evdev
And share the key-printing functions. In preparation for adding more
interactive-* variants.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-01-13 17:21:56 +02:00
Jasper St. Pierre 938a2c379b makekeys: Move all of the table generation to Python
This makes it easier to run the Python script manually.
2014-01-01 13:01:18 -05:00
Ran Benita b246edc688 test/atom: add test for atom table
Mostly a random test.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-12-02 15:13:59 +02:00
Ran Benita 13da6da0e7 parser: drop %name-prefix, use -p yacc argument instead
Even though the %name-prefix is more sensible, byacc doesn't support it,
but both bison and byacc support the -p argument.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-09-29 00:24:50 +03:00
Ran Benita 0dbe20ae96 Makefile.am: drop AM_LFLAGS
We don't use a lex/flex anymore so this is not used.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-09-29 00:16:39 +03:00
Ran Benita 5d2b268dc1 build: distribute makekeys.py and keywords.gperf
This was an oversight: even though we ship the pre-built files, it is
still good behavior to include the original generators / source files in
the tarball.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-08-29 19:07:25 +03:00
Ran Benita 5b7f766898 build: build libtest.la only on 'make check'
For those just running 'make', compiling libtest is wasted heat.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-08-15 09:36:12 +03:00
Ran Benita 9bb1d0bc1d build: make all symbols in libtest visible
Signed-off-by: Ran Benita <ran234@gmail.com>
2013-08-02 12:37:45 +03:00
Ran Benita c25bdc3fca build: use AM_LDFLAGS for general flags
We want -no-undefined for every library so do it implictly.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-08-02 12:37:36 +03:00
Ran Benita a392d2682b Replace flex scanner with a hand-written one
The scanner is very similar in structure to the one in xkbcomp/rules.c.
It avoids copying and has nicer error reporting.

It uses gperf to generate a hashtable for the keywords, which gives a
nice speed boost (compared to the naive strcasecmp method at least). But
since there's hardly a reason to regenerate it every time and require
people to install gperf, the output (keywords.c) is added here as well.

Here are some stats from test/rulescomp:

Before:
compiled 1000 keymaps in 4.052939625s
==22063==   total heap usage: 101,101 allocs, 101,101 frees, 11,840,834 bytes allocated

After:
compiled 1000 keymaps in 3.519665434s
==26505==   total heap usage: 99,945 allocs, 99,945 frees, 7,033,608 bytes allocated

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-04-01 18:20:57 +01:00
Ran Benita e4bceec880 utils: add {un,}map_file to read an entire file
This wraps the current mmap call and adds a fallback implementation for
systems which do not have mmap (e.g. mingw).

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-04-01 18:20:56 +01:00