Commit Graph

113 Commits (2d9640651a791ccfa7d1c78bed790351582e7fd4)

Author SHA1 Message Date
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
Ran Benita 877fe59ac3 Bump version to 0.7.1
Signed-off-by: Ran Benita <ran234@gmail.com>
2017-01-18 20:17:46 +02:00
Ran Benita b5586a6c42 keysym: fix locale dependence in xkb_keysym_from_name()
We currently use strcasecmp, which is locale-dependent. In particular,
one well-known surprise even if restricted just ASCII input is found in
the tr_TR (Turkish) locale, see e.g.
https://msdn.microsoft.com/en-us/library/ms973919.aspx#stringsinnet20_topic5

We have known to avoid locale-dependent functions before, but in this
case, we forgot.

Fix it by implementing our own simple ASCII-only strcasecmp/strncasecmp.
Might have been possible to use strcasecmp_l() with the C locale, but
went the easy route.

Side advantage is that even this non-optimized version is faster than
the optimized libc one (__strcasecmp_l_sse42) since it doesn't need to
do the locale stuff. xkb_keysym_from_name(), which uses strcasecmp
heavily, becomes faster, and so for example Compose file parsing, which
uses xkb_keysym_from_name() heavily, becomes ~20% faster.

Resolves https://github.com/xkbcommon/libxkbcommon/issues/42
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-12-02 23:46:56 +02:00
Ran Benita d596f6e3ff Bump version to 0.7.0
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-11-11 20:02:41 +02:00
Ran Benita 9061171957 utils: add popcount function
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-10-22 20:13:46 +03: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 03f5d36b44 Bump version to 0.6.1
Our most minor release yet.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2016-04-08 10:38:57 +01:00
Ran Benita 3fee46a218 Bump version to 0.6.0
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-03-16 10:20:49 +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 ca58937da3 configure.ac: also print ${datarootdir} in summary
It goes something like:

    ${XLOCALEDIR} ->
    ${datarootdir}/locale/X11 ->
    ${prefix}/share/locale/X11 ->
    /usr/share/locale/X11

But AC_MSG_RESULT only performs one substitution. Instead of starting to
expand this stuff manually, just print datarootdir so all the pieces are
there.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-24 23:40:24 +03:00
Ran Benita c43c3c866e Bump version to 0.5.0
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-18 16:41:59 +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
Jasper Lievisse Adriaanse 3e169c4726 Make librt optional, required for at least OpenBSD 2014-10-15 21:08:17 +02: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 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
Michael Forney 76ae9fb948 Fix typo in default-variant configure option 2014-09-01 13:09:29 -07: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 76e1fca20a Bump version to 0.4.2
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-05-15 12:07:00 +03:00
Ran Benita 99af72fd09 configure.ac: fix enable_x11 handling
Explicitly passing --enable-x11=yes would actually disable it.

Reported-by: Quentin Glidic
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-03-31 18:01:35 +03:00
Ran Benita b5b86b6e7a Bump version to 0.4.1
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-03-27 21:00:58 +02:00
Ran Benita f604314962 configure.ac: fix message when X11 support is disabled
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-03-21 19:54:30 +02:00
Ran Benita 1aabc52235 build: fix configure test for yacc
It only works if 'bison' or 'byacc' are provided, but sometimes byacc
is installed as plain 'yacc'. The check fails for that.

I broke this in bdd8c11, restore Daniel's retrospectively clever check.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-10 20:50:58 +02:00
Ran Benita 10643d8aa4 Define likely()/unlikely() macros
It serves as nice "hotspot" annotations, and can also help things, so
why not.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-08 12:42:16 +02:00
Ran Benita 8aa2202d9d build: add -Wextra warnings
If it gets annoying, we can disable it. But for now it's clean.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-08 01:51:38 +02:00
Ran Benita 109fe7059c Use secure_getenv when available
We probably don't want to get a privileged process to compile arbitrary
keymaps. So we should be careful about the envvars which control include
paths or default RMLVOs. But then secure_getenv is more sensible for
everything we do.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-04 02:53:05 +02:00
Ran Benita bdd8c113a5 build: some fixes in configure.ac
- Use 'test =' instead of 'test ==' in the x11 test. The second one
  might not work with e.g. dash, whoops.

- Use AS_IF instead of 'if'. It actually blends in better..

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-04 02:52:31 +02:00
Ran Benita be16858c92 Bump version to 0.4.0
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-02 12:13:26 +02:00
Ran Benita 70717c5686 build: add configure summary
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-02 11:21:18 +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 8deff4f0ab Bump version to 0.3.2
Add a NEWS file, with some retroactive entries. Also add 'check-news' to
configure.ac, though this might be a bit annoying.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-11-22 21:02:24 +02:00
Ran Benita 14382a62ab configure.ac: add AM_PROG_CC_C_O
Older Automakes give this error without this directive:

Makefile.am: C objects in subdir but `AM_PROG_CC_C_O' not in `configure.ac'

In newer autotools this is included under AC_PROG_CC, but it's harmless
to add.

https://github.com/xkbcommon/libxkbcommon/issues/3

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-10-13 22:25:24 +03:00
Ran Benita 8e14bff0a1 parser: add some notes about byacc working
We now also work with byacc (version tested: 20130925) which some people
prefer, perhaps due to its license (public domain) or performance
(haven't compared).

When using byacc, currently the following warning comes up:
    src/xkbcomp/parser.c:954:14: warning: declaration shadows a variable in the global scope [-Wshadow]
        YYSTYPE  yylval;
                ^
    src/xkbcomp/parser.c:37:20: note: expanded from macro 'yylval'
    #define yylval     _xkbcommon_lval
                    ^
    ./src/xkbcomp/parser.h:96:16: note: previous declaration is here
    extern YYSTYPE _xkbcommon_lval;

This is due to a bug in byacc - it shouldn't output that extern line in
%pure-parser mode. So the warning stays.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-09-29 01:41:52 +03:00
Ran Benita f505c4314e build: use AC_CONFIG_AUX_DIR([build-aux])
Less clutter, why not?

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-08-15 09:58:50 +03:00
Daniel Stone 9f01bd1e72 Bump version to 0.3.1
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2013-06-03 16:43:43 +01: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
Daniel Stone 27a11762ab Bump version to 0.3.0
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2013-04-01 18:04:06 +01:00
Daniel Stone fbe5e6751e Add environment overrides for default RMLVO
You can now set default values in the environment, as well as a context
option to ignore the environment, e.g. for tests.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2013-03-19 10:53:37 +00:00
Ran Benita a7b1f80d34 Build cleanly with clang
clang doesn't like the use of typeof with out default flags, so just
don't use it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18 22:20:04 +00:00
Ran Benita 79329e1022 Don't try to build linux-specific tests on non-linux
Some tests use linux/input.h (and epoll), but we're building on some
other kernels (e.g. debian freebsd). We could just copy the file but
it's GPL. We could also skip the tests (exit code 77) but it doesn't
really matter.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18 22:20:04 +00:00
Ran Benita 2b352c11dd Makefile.am: don't create INSTALL and ChangeLog
It may be xorg standard but it's completely useless and clutter the
directory.

Signed-off-by: Ran Benita <ran234@gmail.com>
2013-03-18 22:20:03 +00:00
Ran Benita 3d731eba5c configure.ac: add xkbcommon.com url to AC_INIT
Why not.
Also forgot to update the xorg-utils error message when bumping the
requirement.

Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Changed to xkbcommon.org.]
2012-12-13 14:02:12 +00:00
Daniel Stone 324d4dbd99 Only distribute .tar.xz archives
We definitely don't need .gz anymore, and .bz2 seems on its way out.
Mirror what Wayland does, and move to .xz exclusively.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-09 14:26:49 +11:00
Damien Lespiau 860fb171a9 build: Require xorg macros 1.16
For XORG_TESTSET_CFLAG and XORG_MEMORY_CHECK_FLAGS.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Cc: Daniel Stone <daniel@fooishbar.org>
2012-10-30 15:08:14 +02:00
Ran Benita 0a5e9d90e7 configure.ac: don't tramp on user's CFLAGS
The configure test shouldn't touch CFLAGS, because they come last on the
command line and allow to users to override settings if needed.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26 14:43:15 +02:00
Ran Benita a851ef1ed9 configure.ac: add explicit PKG_PROG_PKG_CONFIG
We still use pkg-config to get the xkb_base variable from
xkeyboard-config, but we removed all of the other PKG_ macro calls. This
still works now, because XORG_DEFAULT_OPTIONS runs it somehow. But we
shouldn't rely on it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-26 14:25:17 +02:00
Daniel Stone 5be22ad641 Bump to 0.2.0
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-24 03:13:46 +11:00
Ran Benita 5d9a5cb003 Commit and distribute ks_tables.h
The ks_tables.h file is generated by makekeys.py from
xkbcommon-keysyms.h, which in turn is generated initially by 'make
update-keysyms'. The xkbcommon-keysyms.h file is commited to git and
distributed in the tarball. Since ks_tables.h should only ever change
when xkbcommon-keysyms.h changes, it is more sensible to update them
together and treat them the same, instead of generating ks_tables.h
every time for every builder with 'make', as we do now.

This means we don't need python as a build dependency (only the one
running update-keysyms, i.e. no one, needs this), and we can be
sure exactly the same file is used by everyone. We also don't need to
run makekeys.py on every build.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-17 20:09:09 +02:00