Get rid of xkb_client_map

We don't make this distinction anymore, and the separate allocations
just make it harder to reason about. Since we require that all of
symbols, types, compat etc. be present, we should just put stuff
directly in the keymap struct.

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of xkb_server_map

Same as xkb_client_map which was removed before.

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of xkb_compat_map

Same as xkb_{client,server}_map which were already removed.

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of xkb_indicator

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of xkb_key_names

Signed-off-by: Ran Benita <ran234@gmail.com>
Move per_key_repeats and enabled_ctrls to keymap

All of the per-key data and global flags are now visible directly in the
keymap.

Signed-off-by: Ran Benita <ran234@gmail.com>
symbols: split initialization code from CompileSymbols

Signed-off-by: Ran Benita <ran234@gmail.com>
Convert indecipherable macros to inline functions

This was fun.

Signed-off-by: Ran Benita <ran234@gmail.com>
Replace xkb_keycode_t 'key' variable name by 'kc'

We want to reserve the name 'key' for something else.

Signed-off-by: Ran Benita <ran234@gmail.com>
Replace KeyInfo 'key' variable name by 'keyi'

We want to reserve the name 'key' for something else.

Signed-off-by: Ran Benita <ran234@gmail.com>
Add common xkb_key struct

Instead of having a million arrays from the keycode to various
key-specific info in the keymap, add a single struct xkb_key to hold all
of the data for the key in one object. This way we can pass it around,
do some refactoring and make the code simpler. It's also nice to see
everything in one place.

The keys array is still indexed by keycode, which is suboptimal because
there may be a lot of holes (i.e. unused keycodes between min_key_code
and max_key_code). By the end of this series it would be abstracted
enough to replace it by a hash table or similar if there's ever a need.

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of struct xkb_key_name

Just embed it directly.

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of struct xkb_sym_map

Past its usefulness; put the stuff directly in xkb_key.

Signed-off-by: Ran Benita <ran234@gmail.com>
Get rid of group_info

This is 8 bits which hold how many groups the key has, what to do the
key group is out of bound and the group to redirect to if want to. This
may save a few bytes, but is really annoying. So instead, just lay out
the fields separately. We can optimize later in a sane way, with pahole,
bitfields, etc. if we want.

Signed-off-by: Ran Benita <ran234@gmail.com>
Remove unused 'groupInfo' in KeyTypeInfo

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

Use key->width directly instead.

Signed-off-by: Ran Benita <ran234@gmail.com>
Remove redundant keymap->keys resizes

The size (i.e. max_keycode) is determined in the keycodes section, which
gets compiled first.

Signed-off-by: Ran Benita <ran234@gmail.com>
map: verifiy that the keycode is legal

In case someone passes in a bad keycode.

Signed-off-by: Ran Benita <ran234@gmail.com>
Pass around xkb_key's instead of keycodes

This way we don't need to look up the key every time. We now only deal
with keycodes in the public API and in keycodes.c.

Also adds an xkb_foreach_key macro, which is used a lot.

Signed-off-by: Ran Benita <ran234@gmail.com>
symbols: remove alias info

It's never used - all of the aliases are added in the keycodes section.

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