summaryrefslogtreecommitdiff
path: root/src/keymap-priv.c
Commit message (Collapse)AuthorAgeFilesLines
* build: include config.h manuallyRan Benita2019-12-271-0/+2
| | | | | | | | | Previously we included it with an `-include` compiler directive. But that's not portable. And it's better to be explicit anyway. Every .c file should have `include "config.h"` first thing. Signed-off-by: Ran Benita <ran@unusedvar.com>
* Fix signed vs. unsigned confusion in name sanitisationDaniel Stone2018-08-031-1/+2
| | | | | | | Don't try to divide through a signed char when indexing an array, lest ye try to index off the start of it. Signed-off-by: Daniel Stone <daniels@collabora.com>
* keymap: share LevelsSameSyms()Ran Benita2016-02-281-0/+10
| | | | | | The function is generic enough. Signed-off-by: Ran Benita <ran234@gmail.com>
* keymap: don't use darray in xkb_mod_setRan Benita2014-04-221-16/+17
| | | | | | | | Instead just statically allocate the mods array (of size MAX_MOD_SIZE = 32). The limit is not going anywhere, and static allocations are nicer (nicer code, no OOM, etc.). It's also small and dense enough. Signed-off-by: Ran Benita <ran234@gmail.com>
* keymap: add and use xkb_mods_{foreach,enumerate}()Ran Benita2014-04-221-1/+1
| | | | | | | To iterate over an xkb_mod_set. Slightly nicer interface and makes transitioning from darray easier. Signed-off-by: Ran Benita <ran234@gmail.com>
* keymap: rename xkb_foreach_key to xkb_keys_foreachRan Benita2014-04-221-1/+1
| | | | | | | We'll use the format xkb_foos_foreach and xkb_foos_enumerate for the various iterators. Signed-off-by: Ran Benita <ran234@gmail.com>
* symbols: use xkb_mod_set instead of entire keymapRan Benita2014-04-191-1/+1
| | | | | | | | The keymap is not removed entirely from the Info (just constified), since it is still needed in AddKeySymbols() for looking up aliases. This dependency will be removed in the future. Signed-off-by: Ran Benita <ran234@gmail.com>
* text: take xkb_mod_set instead of the entire keymapRan Benita2014-04-191-2/+2
| | | | | | | The modifier printing functions only need the modifier information, they don't care about keys or leds, etc. Signed-off-by: Ran Benita <ran234@gmail.com>
* Add struct xkb_mod_setRan Benita2014-04-191-2/+3
| | | | | | | | | | | The only thing that the compilation phase needs the keymap for currently is for access to the modifier information (it also modifies it in place!). We want to only pass along the neccessary information, to make it more tractable and testable, so instead of passing the entire keymap we add a new 'mod_set' object and pass a (const) reference to that. The new object is just the old array of 'struct xkb_mod'. Signed-off-by: Ran Benita <ran234@gmail.com>
* keymap: move ModNameToIndex from text.c and use it in keymap.cRan Benita2014-04-191-0/+14
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* darray: cleanupRan Benita2014-02-081-7/+9
| | | | | | | | We have quite diverged from the upstream file, so let's make it at least easier to look at. Remove some unused macros and rename some for consistency. Signed-off-by: Ran Benita <ran234@gmail.com>
* keymap: split private functions to keymap-priv.cRan Benita2014-01-131-0/+121
This makes it easier to share the private functions in other DSOs without relying (too much) on dead code elimination, exported symbols, etc. Signed-off-by: Ran Benita <ran234@gmail.com>