7eafa77a7a20c3f9f18341672910ba215425068a
[platform/upstream/libxkbcommon.git] / include / X11 / extensions / XKBcommon.h
1 /*
2 Copyright 1985, 1987, 1990, 1998  The Open Group
3 Copyright 2008  Dan Nicholson
4
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:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
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.
21
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.
26 */
27
28 #ifndef _XKBCOMMON_H_
29 #define _XKBCOMMON_H_
30
31 #include <X11/X.h>
32 #include <X11/Xdefs.h>
33 #include <X11/Xfuncproto.h>
34 #include <X11/keysymdef.h>
35 #include <X11/extensions/XKBstrcommon.h>
36 #include <X11/extensions/XKBgeomcommon.h>
37
38 /* Common keyboard description structure */
39 typedef struct _XkbcDesc {
40     unsigned int        defined;
41     unsigned short      flags;
42     unsigned short      device_spec;
43     KeyCode             min_key_code;
44     KeyCode             max_key_code;
45
46     XkbControlsPtr      ctrls;
47     XkbServerMapPtr     server;
48     XkbClientMapPtr     map;
49     XkbIndicatorPtr     indicators;
50     XkbNamesPtr         names;
51     XkbCompatMapPtr     compat;
52     XkbGeometryPtr      geom;
53 } XkbcDescRec, *XkbcDescPtr;
54
55 _XFUNCPROTOBEGIN
56
57 extern char *
58 XkbcKeysymToString(KeySym ks);
59
60 extern KeySym
61 XkbcStringToKeysym(const char *s);
62
63 extern int
64 XkbcAllocCompatMap(XkbcDescPtr xkb, unsigned which, unsigned nSI);
65
66 extern void
67 XkbcFreeCompatMap(XkbcDescPtr xkb, unsigned which, Bool freeMap);
68
69 extern int
70 XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases);
71
72 extern void
73 XkbcFreeNames(XkbcDescPtr xkb, unsigned which, Bool freeMap);
74
75 extern int
76 XkbcAllocControls(XkbcDescPtr xkb, unsigned which);
77
78 extern void
79 XkbcFreeControls(XkbcDescPtr xkb, unsigned which, Bool freeMap);
80
81 extern int
82 XkbcAllocIndicatorMaps(XkbcDescPtr xkb);
83
84 extern void
85 XkbcFreeIndicatorMaps(XkbcDescPtr xkb);
86
87 extern XkbcDescRec *
88 XkbcAllocKeyboard(void);
89
90 extern int
91 XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes);
92
93 extern int
94 XkbcAllocServerMap(XkbcDescPtr xkb, unsigned which, unsigned nNewActions);
95
96 extern void
97 XkbcFreeClientMap(XkbcDescPtr xkb, unsigned what, Bool freeMap);
98
99 extern void
100 XkbcFreeServerMap(XkbcDescPtr xkb, unsigned what, Bool freeMap);
101
102 extern void
103 XkbcFreeKeyboard(XkbcDescPtr xkb, unsigned which, Bool freeAll);
104
105 extern void
106 XkbcFreeGeomProperties(XkbGeometryPtr geom, int first, int count, Bool freeAll);
107
108 extern void
109 XkbcFreeGeomKeyAliases(XkbGeometryPtr geom, int first, int count, Bool freeAll);
110
111 extern void
112 XkbcFreeGeomColors(XkbGeometryPtr geom, int first, int count, Bool freeAll);
113
114 extern void
115 XkbcFreeGeomPoints(XkbOutlinePtr outline, int first, int count, Bool freeAll);
116
117 extern void
118 XkbcFreeGeomOutlines(XkbShapePtr shape, int first, int count, Bool freeAll);
119
120 extern void
121 XkbcFreeGeomShapes(XkbGeometryPtr geom, int first, int count, Bool freeAll);
122
123 extern void
124 XkbcFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count,
125                         Bool freeAll);
126
127 extern void
128 XkbcFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count,
129                         Bool freeAll);
130
131 extern void
132 XkbcFreeGeomOverlays(XkbSectionPtr section, int first, int count, Bool freeAll);
133
134 extern void
135 XkbcFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll);
136
137 extern void
138 XkbcFreeGeomRows(XkbSectionPtr section, int first, int count, Bool freeAll);
139
140 extern void
141 XkbcFreeGeomSections(XkbGeometryPtr geom, int first, int count, Bool freeAll);
142
143 extern void
144 XkbcFreeGeomDoodads(XkbDoodadPtr doodads, int nDoodads, Bool freeAll);
145
146 extern void
147 XkbcFreeGeometry(XkbGeometryPtr geom, unsigned which, Bool freeMap);
148
149 extern int
150 XkbcAllocGeometry(XkbcDescPtr xkb, XkbGeometrySizesPtr sizes);
151
152 extern void
153 XkbcInitAtoms(void);
154
155 extern char *
156 XkbcAtomGetString(Atom atom);
157
158 extern Atom
159 XkbcInternAtom(char *name, Bool onlyIfExists);
160
161 extern char *
162 XkbcAtomText(Atom atm);
163
164 extern char *
165 XkbcModMaskText(unsigned mask, Bool cFormat);
166
167 extern char *
168 XkbcConfigText(unsigned config);
169
170 extern char *
171 XkbcGeomFPText(int val);
172
173 extern char *
174 XkbcActionTypeText(unsigned type);
175
176 extern char *
177 XkbcKeysymText(KeySym sym);
178
179 extern char *
180 XkbcKeyNameText(char *name);
181
182 extern char *
183 XkbcSIMatchText(unsigned type);
184
185 _XFUNCPROTOEND
186
187 #endif /* _XKBCOMMON_H_ */