Expose all the geometry allocation subroutines
[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 XkbcAllocGeomProps(XkbGeometryPtr geom, int nProps);
151
152 extern int
153 XkbcAllocGeomColors(XkbGeometryPtr geom, int nColors);
154
155 extern int
156 XkbcAllocGeomKeyAliases(XkbGeometryPtr geom, int nKeyAliases);
157
158 extern int
159 XkbcAllocGeomShapes(XkbGeometryPtr geom, int nShapes);
160
161 extern int
162 XkbcAllocGeomSections(XkbGeometryPtr geom, int nSections);
163
164 extern int
165 XkbcAllocGeomOverlays(XkbSectionPtr section, int nOverlays);
166
167 extern int
168 XkbcAllocGeomOverlayRows(XkbOverlayPtr overlay, int nRows);
169
170 extern int
171 XkbcAllocGeomOverlayKeys(XkbOverlayRowPtr row, int nKeys);
172
173 extern int
174 XkbcAllocGeomDoodads(XkbGeometryPtr geom, int nDoodads);
175
176 extern int
177 XkbcAllocGeomSectionDoodads(XkbSectionPtr section, int nDoodads);
178
179 extern int
180 XkbcAllocGeomOutlines(XkbShapePtr shape, int nOL);
181
182 extern int
183 XkbcAllocGeomRows(XkbSectionPtr section, int nRows);
184
185 extern int
186 XkbcAllocGeomPoints(XkbOutlinePtr ol, int nPts);
187
188 extern int
189 XkbcAllocGeomKeys(XkbRowPtr row, int nKeys);
190
191 extern int
192 XkbcAllocGeometry(XkbcDescPtr xkb, XkbGeometrySizesPtr sizes);
193
194 extern void
195 XkbcInitAtoms(void);
196
197 extern char *
198 XkbcAtomGetString(Atom atom);
199
200 extern Atom
201 XkbcInternAtom(char *name, Bool onlyIfExists);
202
203 extern char *
204 XkbcAtomText(Atom atm);
205
206 extern char *
207 XkbcModMaskText(unsigned mask, Bool cFormat);
208
209 extern char *
210 XkbcConfigText(unsigned config);
211
212 extern char *
213 XkbcGeomFPText(int val);
214
215 extern char *
216 XkbcActionTypeText(unsigned type);
217
218 extern char *
219 XkbcKeysymText(KeySym sym);
220
221 extern char *
222 XkbcKeyNameText(char *name);
223
224 extern char *
225 XkbcSIMatchText(unsigned type);
226
227 _XFUNCPROTOEND
228
229 #endif /* _XKBCOMMON_H_ */