Use CARD32 instead of Atom, move geom headers in
[platform/upstream/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/XKBrulescommon.h>
34 #include "X11/extensions/XKBcommon.h"
35
36 extern void
37 XkbcFreeGeomProperties(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
38
39 extern void
40 XkbcFreeGeomKeyAliases(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
41
42 extern void
43 XkbcFreeGeomColors(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
44
45 extern void
46 XkbcFreeGeomPoints(XkbcOutlinePtr outline, int first, int count, Bool freeAll);
47
48 extern void
49 XkbcFreeGeomOutlines(XkbcShapePtr shape, int first, int count, Bool freeAll);
50
51 extern void
52 XkbcFreeGeomShapes(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
53
54 extern void
55 XkbcFreeGeomOverlayKeys(XkbcOverlayRowPtr row, int first, int count,
56                         Bool freeAll);
57
58 extern void
59 XkbcFreeGeomOverlayRows(XkbcOverlayPtr overlay, int first, int count,
60                         Bool freeAll);
61
62 extern void
63 XkbcFreeGeomOverlays(XkbcSectionPtr section, int first, int count, Bool freeAll);
64
65 extern void
66 XkbcFreeGeomKeys(XkbcRowPtr row, int first, int count, Bool freeAll);
67
68 extern void
69 XkbcFreeGeomRows(XkbcSectionPtr section, int first, int count, Bool freeAll);
70
71 extern void
72 XkbcFreeGeomSections(XkbcGeometryPtr geom, int first, int count, Bool freeAll);
73
74 extern void
75 XkbcFreeGeomDoodads(XkbcDoodadPtr doodads, int nDoodads, Bool freeAll);
76
77 extern void
78 XkbcFreeGeometry(XkbcGeometryPtr geom, unsigned which, Bool freeMap);
79
80 extern int
81 XkbcAllocGeomProps(XkbcGeometryPtr geom, int nProps);
82
83 extern int
84 XkbcAllocGeomColors(XkbcGeometryPtr geom, int nColors);
85
86 extern int
87 XkbcAllocGeomKeyAliases(XkbcGeometryPtr geom, int nKeyAliases);
88
89 extern int
90 XkbcAllocGeomShapes(XkbcGeometryPtr geom, int nShapes);
91
92 extern int
93 XkbcAllocGeomSections(XkbcGeometryPtr geom, int nSections);
94
95 extern int
96 XkbcAllocGeomOverlays(XkbcSectionPtr section, int nOverlays);
97
98 extern int
99 XkbcAllocGeomOverlayRows(XkbcOverlayPtr overlay, int nRows);
100
101 extern int
102 XkbcAllocGeomOverlayKeys(XkbcOverlayRowPtr row, int nKeys);
103
104 extern int
105 XkbcAllocGeomDoodads(XkbcGeometryPtr geom, int nDoodads);
106
107 extern int
108 XkbcAllocGeomSectionDoodads(XkbcSectionPtr section, int nDoodads);
109
110 extern int
111 XkbcAllocGeomOutlines(XkbcShapePtr shape, int nOL);
112
113 extern int
114 XkbcAllocGeomRows(XkbcSectionPtr section, int nRows);
115
116 extern int
117 XkbcAllocGeomPoints(XkbcOutlinePtr ol, int nPts);
118
119 extern int
120 XkbcAllocGeomKeys(XkbcRowPtr row, int nKeys);
121
122 extern int
123 XkbcAllocGeometry(XkbcDescPtr xkb, XkbcGeometrySizesPtr sizes);
124
125 extern XkbcPropertyPtr
126 XkbcAddGeomProperty(XkbcGeometryPtr geom, char *name, char *value);
127
128 extern XkbKeyAliasPtr
129 XkbcAddGeomKeyAlias(XkbcGeometryPtr geom, char *aliasStr, char *realStr);
130
131 extern XkbcColorPtr
132 XkbcAddGeomColor(XkbcGeometryPtr geom, char *spec, unsigned int pixel);
133
134 extern XkbcOutlinePtr
135 XkbcAddGeomOutline(XkbcShapePtr shape, int sz_points);
136
137 extern XkbcShapePtr
138 XkbcAddGeomShape(XkbcGeometryPtr geom, CARD32 name, int sz_outlines);
139
140 extern XkbcKeyPtr
141 XkbcAddGeomKey(XkbcRowPtr row);
142
143 extern XkbcRowPtr
144 XkbcAddGeomRow(XkbcSectionPtr section, int sz_keys);
145
146 extern XkbcSectionPtr
147 XkbcAddGeomSection(XkbcGeometryPtr geom, CARD32 name,
148                    int sz_rows, int sz_doodads, int sz_over);
149
150 extern XkbcDoodadPtr
151 XkbcAddGeomDoodad(XkbcGeometryPtr geom, XkbcSectionPtr section, CARD32 name);
152
153 extern XkbcOverlayKeyPtr
154 XkbcAddGeomOverlayKey(XkbcOverlayPtr overlay, XkbcOverlayRowPtr row,
155                       char *over, char *under);
156
157 extern XkbcOverlayRowPtr
158 XkbcAddGeomOverlayRow(XkbcOverlayPtr overlay, int row_under, int sz_keys);
159
160 extern XkbcOverlayPtr
161 XkbcAddGeomOverlay(XkbcSectionPtr section, CARD32 name, int sz_rows);
162
163 /***====================================================================***/
164
165 extern Bool
166 XkbcComputeShapeBounds(XkbcShapePtr shape);
167
168 extern Bool
169 XkbcComputeShapeTop(XkbcShapePtr shape, XkbcBoundsPtr bounds);
170
171 extern Bool
172 XkbcComputeRowBounds(XkbcGeometryPtr geom, XkbcSectionPtr section, XkbcRowPtr row);
173
174 extern Bool
175 XkbcComputeSectionBounds(XkbcGeometryPtr geom, XkbcSectionPtr section);
176
177 #endif /* _XKBGEOM_H_ */