keymap: refactor ApplyInterpsToKey

There's really not much to explain what the function used to do there...

Signed-off-by: Ran Benita <ran234@gmail.com>
keymap: optimize FindInterpsForKey a bit

Signed-off-by: Ran Benita <ran234@gmail.com>
types: remove outdated comments

The code is pretty straightforward now...

Signed-off-by: Ran Benita <ran234@gmail.com>
types: use darray for KeyTypesInfo instead of list

Simpler, uses less memory and more efficient.

Signed-off-by: Ran Benita <ran234@gmail.com>
types: don't strdup a default name

None of the other files does that.

Signed-off-by: Ran Benita <ran234@gmail.com>
action: clean up formatting of extern functions

Make it a bit easier to understand what they do.

Signed-off-by: Ran Benita <ran234@gmail.com>
action: disallow setting an action_field default for all types

Currently where it is possible to write:
    setMods.clearLocks = True;
It's also possible to write:
    action.clearLocks = True;
This will set the default value for the clearLocks action field for
*all* action types, as opposed to just setMods in this case. If
subsequently an action is used for which this field does not make sense,
it will error out.
This doesn't make any sense, because any given field is only possible by at
most 3 or 4 action types... which you might as well write explicitly and
avoid the side effect mentioned above.
Needless to say this is one of xkbcomp's "hidden features" and is not
used anywhere; remove it.

Signed-off-by: Ran Benita <ran234@gmail.com>
action: keep array of default actions, instead of list of changes

The implementation of changing the default properties of actions, e.g. a
statements such as (from test/data/compat/basic):
    setMods.clearLocks= True;
    latchMods.clearLocks= True;
    latchMods.latchToLock= True;
works by keeping a list of ActionInfo's, each containing the neccesary
info from each statement, and then when some action comes up (e.g. in an
interpret statment) it goes through the list, and applies the relevent
ActionInfo's to the newly-constructed xkb_action.

Instead of doing this, we add a struct ActionsInfo, which contains an
array of xkb_actions, one for each type. When a default changing
statement appears, we change the action in the array; when a new action
comes up, we just copy from the array. This is simpler to figure out,
and pretty straightforward.

Signed-off-by: Ran Benita <ran234@gmail.com>
action: remove redundant check

The NoAction handler always errors out with the same message.

Signed-off-by: Ran Benita <ran234@gmail.com>
log: replace "priority" by "level" everywhere

Now that we don't use syslog, "level" does sound more commonplace. We
should change it while there is still nobody using it.
Also leave some space between the integers of the xkb_log_level enum
values, if we ever need to shove more in between.

Signed-off-by: Ran Benita <ran234@gmail.com>
Set log level for tests through env, not directly

This way the test logs have all the information, but we don't get eye
bleed every time we run them manually. One can always use
TESTS_ENVIRONMENT (we correctly use AM_TESTS_ENVIRONMENT now), or set
the envvars from the shell.

Signed-off-by: Ran Benita <ran234@gmail.com>
include: properly use the default map if none is found

For some reason this piece of code wasn't copied from xkbcomp, which
causes all of the warnings like these:
Warning:       No map in include statement, but "pc" contains several; Using first defined map, "pc105"

Signed-off-by: Ran Benita <ran234@gmail.com>
test/data/symbols: keypad can only have one default section

Avoids a warning, from xkeyboard-config:

commit 6676053f2c93596c2aaa9905151a5c76355a1540
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 29 09:53:45 2012 +1000

    symbols: keypad can only have one default section

    Warning:          Multiple default components in keypad
                      Using x11, ignoring pointerkeys

    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Signed-off-by: Ran Benita <ran234@gmail.com>
include: document ParseIncludeMap better

The format of the include statment is not explained anywhere, the code
is confusing and the comments misleading. Try to explain it better.

Signed-off-by: Ran Benita <ran234@gmail.com>
xkbcomp: add debug messages of the RMLVO and KcCGST

Signed-off-by: Ran Benita <ran234@gmail.com>
Don't printf NULL strings

Signed-off-by: Ran Benita <ran234@gmail.com>
Use XKB_MOD_INVALID instead of XkbNoModifier

Signed-off-by: Ran Benita <ran234@gmail.com>
rules: fix check for appending '|' character when applying

There are two ways to separate multiple files in XKB include statements:
'+' will cause the later file to override the first in case of conflict,
while '|' will cause it augment it (this is done by xkbcomp). '!' is
unrelated here.
Since '|' is practically never used, this wasn't noticed.

In the modified test, the '|some_compat' previously was just ignored.

Signed-off-by: Ran Benita <ran234@gmail.com>
test: add rmlvo-to-kccgst tool

For a quick look at what components result from the rules.

Signed-off-by: Ran Benita <ran234@gmail.com>
test/rules-file: add benchmark

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