xkbcomp: improve a few log messages

Signed-off-by: Ran Benita <ran234@gmail.com>
scanner: don't fail over unknown escape sequence

This is too strict, and causes symbols/cz to fail parsing. Instead, just
emit a warning (not shown by default):
    xkbcommon: WARNING: cz:75:19: unknown escape sequence in string literal

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

Reported-By: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
doc: un-clarify one subtle point

Including the X server is a bit of a borderline case; we should mostly
encourage people to use update_mask() only when xkbcommon itself
serializes the state on the other side. But it's not entirely wrong
either.. So rephrase a bit.

Signed-off-by: Ran Benita <ran234@gmail.com>
test: make sure keycode 0 works fine

It is a legal keycode but we never tried it actually.

Signed-off-by: Ran Benita <ran234@gmail.com>
doc: tweak the wording on xkb_state/xkb_keymap relationship

Signed-off-by: Ran Benita <ran234@gmail.com>
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>
build: use AC_CONFIG_AUX_DIR([build-aux])

Less clutter, why not?

Signed-off-by: Ran Benita <ran234@gmail.com>
build: use build-aux as autom4te cache directory

Remove the generated directory ./autom4te.cache by reusing ./build-aux
as cache directory.

This was stolen from a libxcb commit by Daniel Martin:
http://lists.freedesktop.org/archives/xcb/2013-July/008431.html

Signed-off-by: Ran Benita <ran234@gmail.com>
keysym: add xkb_keysym_to_{lower,upper}

These functions are needed later; they are not API functions. The
capitalization is not locale sensitive.

Signed-off-by: Ran Benita <ran234@gmail.com>
test/interactive: use xkb_state_key_get_one_sym() when there's only 1

Kind of odd, but get_one_sym() will be getting a different behavior.
Real life users *should* pick one or the other.

Signed-off-by: Ran Benita <ran234@gmail.com>
state: apply capitalization transformation on keysyms

The xkbproto spec says:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Lock_Modifier

    If the Lock modifier is not consumed by the symbol lookup process,
    routines that determine the symbol and string that correspond to
    an event should capitalize the result.

This was not an issue until now, because most xkeyboard-config keymaps
do not utilize this "feature", and specify the keysyms for the Lock
modifier explicitly instead. However, some keymaps do depend on it, e.g.
ch(fr) for eacute and others.

The spec goes on to describe two options for doing this transformation:
locale-sensitive and locale-insensitive. We opt for the latter; it is
less desirable but we don't want *that* headache.

Also, only xkb_state_key_get_one_sym() is changed;
xkb_state_key_get_syms() is left as-is, and always reports the
untransformed keysyms. This is for the following reasons:

- The API doesn't allow it, since we return a const pointer directly to
  the keymap keysyms table and we can't transform that.

- The transformation doesn't make sense for multiple-keysyms.

- It can be useful for an application to get the "raw" keysyms if it
  wants to (e.g. maybe it wants to do the transformation itself).

Finally, note that xkb_state_mod_index_is_consumed() does *not*
report Lock as consumed even if it was used in the transformation. This
is what Xlib does.

This definitely doesn't fall under the "hard to misuse" API rule but
it's the best we can do.

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

Reported-By: Gatis Paeglis <gatis.paeglis@digia.com>
Signed-off-by: Ran Benita <ran234@gmail.com>