2 Copyright 1985, 1987, 1990, 1998 The Open Group
3 Copyright 2008 Dan Nicholson
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
32 #include <X11/Xfuncproto.h>
33 #include <X11/extensions/XKBstrcommon.h>
34 #include <X11/extensions/XKBrulescommon.h>
36 /* Action structures used in the server */
37 typedef struct _XkbcModAction {
41 unsigned char real_mods;
45 typedef struct _XkbcISOAction {
49 unsigned char real_mods;
50 /* FIXME: Make this an int. */
56 typedef struct _XkbcPtrAction {
63 typedef struct _XkbcCtrlsAction {
69 typedef struct _XkbcRedirectKeyAction {
71 unsigned char new_key;
72 unsigned char mods_mask;
74 unsigned int vmods_mask;
76 } XkbcRedirectKeyAction;
78 typedef union _XkbcAction {
85 XkbPtrDfltAction dflt;
86 XkbSwitchScreenAction screen;
87 XkbcCtrlsAction ctrls;
89 XkbcRedirectKeyAction redirect;
90 XkbDeviceBtnAction devbtn;
91 XkbDeviceValuatorAction devval;
95 typedef struct _XkbcServerMapRec {
96 unsigned short num_acts;
97 unsigned short size_acts;
100 XkbBehavior * behaviors;
101 unsigned short * key_acts;
102 #if defined(__cplusplus) || defined(c_plusplus)
103 /* explicit is a C++ reserved word */
104 unsigned char * c_explicit;
106 unsigned char * explicit;
108 unsigned char vmods[XkbNumVirtualMods];
109 unsigned short * vmodmap;
110 } XkbcServerMapRec, *XkbcServerMapPtr;
112 /* Common keyboard description structure */
113 typedef struct _XkbcDesc {
114 unsigned int defined;
115 unsigned short flags;
116 unsigned short device_spec;
117 KeyCode min_key_code;
118 KeyCode max_key_code;
120 XkbControlsPtr ctrls;
121 XkbcServerMapPtr server;
123 XkbIndicatorPtr indicators;
125 XkbCompatMapPtr compat;
127 } XkbcDescRec, *XkbcDescPtr;
135 XkbcCompileKeymapFromRules(const XkbRMLVOSet *rmlvo);
138 XkbcCompileKeymapFromComponents(const XkbComponentNamesPtr ktcsg);
141 XkbcCompileKeymapFromFile(FILE *inputFile, const char *mapName);
143 extern XkbComponentListPtr
144 XkbcListComponents(XkbComponentNamesPtr ptrns, int *maxMatch);
147 * Converts a keysym to a string; will return unknown Unicode codepoints
148 * as "Ua1b2", and other unknown keysyms as "0xabcd1234".
150 * The string returned may become invalidated after the next call to
151 * XkbcKeysymToString: if you need to preserve it, then you must
155 XkbcKeysymToString(KeySym ks);
158 * See XkbcKeysymToString comments: this function will accept any string
159 * from that function.
162 XkbcStringToKeysym(const char *s);
166 #endif /* _XKBCOMMON_H_ */