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.]
Sync test data from xkeyboard-config

Sync the files again from xkeyboard-config 2.8, since there have been
some changes we should test against.

Also added a script test/data/sync.sh if we want to do it again in the
future.

Signed-off-by: Ran Benita <ran234@gmail.com>
test/keyseq: re-add de(neo) level5 test

See:
https://bugs.freedesktop.org/show_bug.cgi?id=50935
This works now after syncing with recent xkeyboard-config.

Signed-off-by: Ran Benita <ran234@gmail.com>
test/interactive: also print the level

Signed-off-by: Ran Benita <ran234@gmail.com>
state: fix unbound virtual modifier bug

Recent xkeyboard-config introduced the following line in symbols/level3:
    vmods = LevelThree,
However, the XKM format which xkbcomp produces for the X server can't
handle explicit virtual modifiers such as this:
https://bugs.freedesktop.org/show_bug.cgi?id=4927

So by doing the following, for example:

setxkbmap -layout de (or another 3-level layouts)
xkbcomp $DISPLAY out.xkb
xkbcomp out.xkb $DISPLAY

The modifier is lost and can't be used for switching to Level3 (see the
included test).

We, however, are affected worse by this bug when we load the out.xkb
keymap. First, the FOUR_LEVEL_ALPHABETIC key type has these entries:
    map[None] = Level1;
    map[Shift] = Level2;
    map[Lock]  = Level2;
    map[LevelThree] = Level3;
    [...]
Now, because the LevelThree virtual modifier is not bound to anything,
the effective mask of the "map[LevelThree]" entry is just 0. So when
the modifier state is empty (initial state), this entry is chosen, and
we get Level3, instead of failing to match any entry and getting the
default Level1.

The difference in behavior from the xserver stems from this commit:
acdad6058d52dc8a3e724dc95448300850d474f2
Which removed the entry->active field. Without bugs, this would be
correct; however, it seems in this case we should just follow the
server's behavior.

The server sets the entry->active field like so in XKBMisc.c:
    /* entry is active if vmods are bound */
    entry->active = (mask != 0);
The xkblib spec explains this field, but does not specify how to
initialize it. This commit does the same as above but more directly.

Signed-off-by: Ran Benita <ran234@gmail.com>
test/interactive: change variable name for 'xkb' to 'keymap'

Signed-off-by: Ran Benita <ran234@gmail.com>
Change 'indicator' to 'led' everywhere possible

The code currently uses the two names interchangeably.
Settle on 'led', because it is shorter, more recognizable, and what we
use in our API (though of course the parser still uses 'indicator').

In camel case we make it 'Led'.
We change 'xkb_indicator_map' to just 'xkb_led' and the variables of
this type are 'led'. This mimics 'xkb_key' and 'key'.
IndicatorNameInfo and LEDInfo are changed to 'LedNameInfo' and
'LedInfo', and the variables are 'ledi' (like 'keyi' etc.). This is
instead of 'ii' and 'im'.

This might make a few places a bit confusing, but less than before I
think. It's also shorter.

Signed-off-by: Ran Benita <ran234@gmail.com>
symbols: fix bad 'merge' assignment

Bug introduced in 2a5b0c9dc1ad1488ecc6b139fd70e464eb687da6, was causing
some keys to be merged incorrectly.

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

Signed-off-by: Ran Benita <ran234@gmail.com>
symbols: make it clear which 'dflt' is meant

A bit easier at a glance. Also, vowels are cool, so just say 'default'.

Signed-off-by: Ran Benita <ran234@gmail.com>
compat: make it clear which 'dflt' is meant

Also s/dflt/default.

Signed-off-by: Ran Benita <ran234@gmail.com>
action: s/hndlrType/handler_type

Signed-off-by: Ran Benita <ran234@gmail.com>
keycodes: some minor style

Signed-off-by: Ran Benita <ran234@gmail.com>
Change some log functions to take ctx instead of keymap

They don't need the keymap, only the context.

Signed-off-by: Ran Benita <ran234@gmail.com>
keysym: print unicode keysyms uppercase and 0-padded

Use the same format as XKeysymToString.

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

"Value stored to 'stmt' is never read"
"Value stored to 'grp_to_use' is never read"

And change 'grp' to 'group' if we're here.

Signed-off-by: Ran Benita <ran234@gmail.com>
ast: add error handling to XkbFileFromComponents

And try to not repeat ourselves.

Signed-off-by: Ran Benita <ran234@gmail.com>
keymap-dump: style cleanups

Signed-off-by: Ran Benita <ran234@gmail.com>
keymap-dump: don't indent after xkb_keymap {

xkbcomp doesn't indent there, so it's easier to diff.
Also saves some horizontal space which is sorely needed when looking at
these files (especially the xkb_symbols).

Signed-off-by: Ran Benita <ran234@gmail.com>
keymap-dump: remove some ugly empty lines

xkbcomp prints them too, but that's just annoying. Also xkb_keycodes
doesn't have it already.

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