xkbcomp: Lazy keysym parsing (avoid XStringToKeysym)
[profile/ivi/libxkbcommon.git] / src / xkbgeom.h
1 /*
2 Copyright 2009  Dan Nicholson
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21 Except as contained in this notice, the names of the authors or their
22 institutions shall not be used in advertising or otherwise to promote the
23 sale, use or other dealings in this Software without prior written
24 authorization from the authors.
25 */
26
27 #ifndef _XKBGEOM_H_
28 #define _XKBGEOM_H_
29
30 #include <X11/X.h>
31 #include <X11/Xdefs.h>
32 #include <X11/extensions/XKBstrcommon.h>
33 #include <X11/extensions/XKBgeomcommon.h>
34 #include <X11/extensions/XKBrulescommon.h>
35 #include "X11/extensions/XKBcommon.h"
36
37 extern void
38 XkbcFreeGeomProperties(XkbGeometryPtr geom, int first, int count, Bool freeAll);
39
40 extern void
41 XkbcFreeGeomKeyAliases(XkbGeometryPtr geom, int first, int count, Bool freeAll);
42
43 extern void
44 XkbcFreeGeomColors(XkbGeometryPtr geom, int first, int count, Bool freeAll);
45
46 extern void
47 XkbcFreeGeomPoints(XkbOutlinePtr outline, int first, int count, Bool freeAll);
48
49 extern void
50 XkbcFreeGeomOutlines(XkbShapePtr shape, int first, int count, Bool freeAll);
51
52 extern void
53 XkbcFreeGeomShapes(XkbGeometryPtr geom, int first, int count, Bool freeAll);
54
55 extern void
56 XkbcFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count,
57                         Bool freeAll);
58
59 extern void
60 XkbcFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count,
61                         Bool freeAll);
62
63 extern void
64 XkbcFreeGeomOverlays(XkbSectionPtr section, int first, int count, Bool freeAll);
65
66 extern void
67 XkbcFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll);
68
69 extern void
70 XkbcFreeGeomRows(XkbSectionPtr section, int first, int count, Bool freeAll);
71
72 extern void
73 XkbcFreeGeomSections(XkbGeometryPtr geom, int first, int count, Bool freeAll);
74
75 extern void
76 XkbcFreeGeomDoodads(XkbDoodadPtr doodads, int nDoodads, Bool freeAll);
77
78 extern void
79 XkbcFreeGeometry(XkbGeometryPtr geom, unsigned which, Bool freeMap);
80
81 extern int
82 XkbcAllocGeomProps(XkbGeometryPtr geom, int nProps);
83
84 extern int
85 XkbcAllocGeomColors(XkbGeometryPtr geom, int nColors);
86
87 extern int
88 XkbcAllocGeomKeyAliases(XkbGeometryPtr geom, int nKeyAliases);
89
90 extern int
91 XkbcAllocGeomShapes(XkbGeometryPtr geom, int nShapes);
92
93 extern int
94 XkbcAllocGeomSections(XkbGeometryPtr geom, int nSections);
95
96 extern int
97 XkbcAllocGeomOverlays(XkbSectionPtr section, int nOverlays);
98
99 extern int
100 XkbcAllocGeomOverlayRows(XkbOverlayPtr overlay, int nRows);
101
102 extern int
103 XkbcAllocGeomOverlayKeys(XkbOverlayRowPtr row, int nKeys);
104
105 extern int
106 XkbcAllocGeomDoodads(XkbGeometryPtr geom, int nDoodads);
107
108 extern int
109 XkbcAllocGeomSectionDoodads(XkbSectionPtr section, int nDoodads);
110
111 extern int
112 XkbcAllocGeomOutlines(XkbShapePtr shape, int nOL);
113
114 extern int
115 XkbcAllocGeomRows(XkbSectionPtr section, int nRows);
116
117 extern int
118 XkbcAllocGeomPoints(XkbOutlinePtr ol, int nPts);
119
120 extern int
121 XkbcAllocGeomKeys(XkbRowPtr row, int nKeys);
122
123 extern int
124 XkbcAllocGeometry(XkbcDescPtr xkb, XkbGeometrySizesPtr sizes);
125
126 extern XkbPropertyPtr
127 XkbcAddGeomProperty(XkbGeometryPtr geom, char *name, char *value);
128
129 extern XkbKeyAliasPtr
130 XkbcAddGeomKeyAlias(XkbGeometryPtr geom, char *aliasStr, char *realStr);
131
132 extern XkbColorPtr
133 XkbcAddGeomColor(XkbGeometryPtr geom, char *spec, unsigned int pixel);
134
135 extern XkbOutlinePtr
136 XkbcAddGeomOutline(XkbShapePtr shape, int sz_points);
137
138 extern XkbShapePtr
139 XkbcAddGeomShape(XkbGeometryPtr geom, Atom name, int sz_outlines);
140
141 extern XkbKeyPtr
142 XkbcAddGeomKey(XkbRowPtr row);
143
144 extern XkbRowPtr
145 XkbcAddGeomRow(XkbSectionPtr section, int sz_keys);
146
147 extern XkbSectionPtr
148 XkbcAddGeomSection(XkbGeometryPtr geom, Atom name,
149                    int sz_rows, int sz_doodads, int sz_over);
150
151 extern XkbDoodadPtr
152 XkbcAddGeomDoodad(XkbGeometryPtr geom, XkbSectionPtr section, Atom name);
153
154 extern XkbOverlayKeyPtr
155 XkbcAddGeomOverlayKey(XkbOverlayPtr overlay, XkbOverlayRowPtr row,
156                       char *over, char *under);
157
158 extern XkbOverlayRowPtr
159 XkbcAddGeomOverlayRow(XkbOverlayPtr overlay, int row_under, int sz_keys);
160
161 extern XkbOverlayPtr
162 XkbcAddGeomOverlay(XkbSectionPtr section, Atom name, int sz_rows);
163
164 /***====================================================================***/
165
166 extern Bool
167 XkbcComputeShapeBounds(XkbShapePtr shape);
168
169 extern Bool
170 XkbcComputeShapeTop(XkbShapePtr shape, XkbBoundsPtr bounds);
171
172 extern Bool
173 XkbcComputeRowBounds(XkbGeometryPtr geom, XkbSectionPtr section, XkbRowPtr row);
174
175 extern Bool
176 XkbcComputeSectionBounds(XkbGeometryPtr geom, XkbSectionPtr section);
177
178 #endif /* _XKBGEOM_H_ */