summaryrefslogtreecommitdiff
path: root/src/text.h
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-02 21:45:42 +0300
committerRan Benita <ran234@gmail.com>2012-09-03 10:31:13 +0300
commitaf2a8b3a3745078aba3534fb554eea125817f827 (patch)
tree20e0d4dec8a61b08bad7f56ee9c6d5355655b8f1 /src/text.h
parent7ae0c6bac4759e9b56c4a5115c321b66012ce9dc (diff)
downloadxorg-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.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/text.h b/src/text.h
index 7991b88..098936f 100644
--- a/src/text.h
+++ b/src/text.h
@@ -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);