diff options
author | Ran Benita <ran234@gmail.com> | 2012-09-02 21:45:42 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-09-03 10:31:13 +0300 |
commit | af2a8b3a3745078aba3534fb554eea125817f827 (patch) | |
tree | 20e0d4dec8a61b08bad7f56ee9c6d5355655b8f1 /src/text.h | |
parent | 7ae0c6bac4759e9b56c4a5115c321b66012ce9dc (diff) | |
download | xorg-lib-libxkbcommon-af2a8b3a3745078aba3534fb554eea125817f827.tar.gz |
Unify some string tables from xkbcomp, text and keymap-dump
We move the LookupEntry struct from expr.h to text.h, along with most of
the lookup tables. This makes them available everywhere.
Looking up a value in the LookupEntry format is slower than direct index
mapping, but it allows multiple names per value (with the canonical one
being first) and "all"- and "none"-type masks. These functions are not
used anywhere efficiency matters.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/text.h')
-rw-r--r-- | src/text.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -29,6 +29,29 @@ #include "xkb-priv.h" +typedef struct { + const char *name; + unsigned int value; +} LookupEntry; + +bool +LookupString(const LookupEntry tab[], const char *string, + unsigned int *value_rtrn); + +const char * +LookupValue(const LookupEntry tab[], unsigned int value); + +extern const LookupEntry ctrlMaskNames[]; +extern const LookupEntry modComponentMaskNames[]; +extern const LookupEntry groupComponentMaskNames[]; +extern const LookupEntry groupMaskNames[]; +extern const LookupEntry groupNames[]; +extern const LookupEntry levelNames[]; +extern const LookupEntry buttonNames[]; +extern const LookupEntry useModMapValueNames[]; +extern const LookupEntry actionTypeNames[]; +extern const LookupEntry symInterpretMatchMaskNames[]; + const char * VModMaskText(struct xkb_keymap *keymap, xkb_mod_mask_t cmask); |