Remove more float support
[platform/upstream/libxkbcommon.git] / src / xkbcomp / xkbcomp.h
1 /************************************************************
2  Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
3
4  Permission to use, copy, modify, and distribute this
5  software and its documentation for any purpose and without
6  fee is hereby granted, provided that the above copyright
7  notice appear in all copies and that both that copyright
8  notice and this permission notice appear in supporting
9  documentation, and that the name of Silicon Graphics not be
10  used in advertising or publicity pertaining to distribution
11  of the software without specific prior written permission.
12  Silicon Graphics makes no representation about the suitability
13  of this software for any purpose. It is provided "as is"
14  without any express or implied warranty.
15
16  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
23  THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
25  ********************************************************/
26
27 #ifndef XKBCOMP_H
28 #define XKBCOMP_H 1
29
30 #ifndef DEBUG_VAR
31 #define DEBUG_VAR debugFlags
32 #endif
33
34 #include <X11/X.h>
35 #include <X11/Xdefs.h>
36
37 #include "utils.h"
38
39 #include "xkbcommon/xkbcommon.h"
40 #include "XKBcommonint.h"
41 #include "xkbmisc.h"
42
43 extern char *scanFile;
44
45 #define TypeUnknown     0
46 #define TypeBoolean     1
47 #define TypeInt         2
48 #define TypeString      4
49 #define TypeAction      5
50 #define TypeKeyName     6
51 #define TypeSymbols     7
52
53 #define StmtUnknown             0
54 #define StmtInclude             1
55 #define StmtKeycodeDef          2
56 #define StmtKeyAliasDef         3
57 #define StmtExpr                4
58 #define StmtVarDef              5
59 #define StmtKeyTypeDef          6
60 #define StmtInterpDef           7
61 #define StmtVModDef             8
62 #define StmtSymbolsDef          9
63 #define StmtModMapDef           10
64 #define StmtGroupCompatDef      11
65 #define StmtIndicatorMapDef     12
66 #define StmtIndicatorNameDef    13
67
68 #define FileSymInterp   100
69
70 typedef struct _ParseCommon
71 {
72     unsigned stmtType;
73     struct _ParseCommon *next;
74 } ParseCommon;
75
76 #define ExprValue       0
77 #define ExprIdent       1
78 #define ExprActionDecl  2
79 #define ExprFieldRef    3
80 #define ExprArrayRef    4
81 #define ExprKeysymList  5
82 #define ExprActionList  6
83 #define ExprCoord       7
84
85 #define OpAdd           20
86 #define OpSubtract      21
87 #define OpMultiply      22
88 #define OpDivide        23
89 #define OpAssign        24
90 #define OpNot           25
91 #define OpNegate        26
92 #define OpInvert        27
93 #define OpUnaryPlus     28
94
95 #define MergeDefault    0
96 #define MergeAugment    1
97 #define MergeOverride   2
98 #define MergeReplace    3
99 #define MergeAltForm    4
100
101 #define AutoKeyNames    (1L <<  0)
102 #define CreateKeyNames(x)       ((x)->flags&AutoKeyNames)
103
104 extern unsigned warningLevel;
105
106 typedef struct _IncludeStmt
107 {
108     ParseCommon common;
109     unsigned merge;
110     char *stmt;
111     char *file;
112     char *map;
113     char *modifier;
114     char *path;
115     struct _IncludeStmt *next;
116 } IncludeStmt;
117
118 typedef struct _Expr
119 {
120     ParseCommon common;
121     unsigned op;
122     unsigned type;
123     union
124     {
125         struct
126         {
127             struct _Expr *left;
128             struct _Expr *right;
129         } binary;
130         struct
131         {
132             xkb_atom_t element;
133             xkb_atom_t field;
134         } field;
135         struct
136         {
137             xkb_atom_t element;
138             xkb_atom_t field;
139             struct _Expr *entry;
140         } array;
141         struct
142         {
143             xkb_atom_t name;
144             struct _Expr *args;
145         } action;
146         struct
147         {
148             int nSyms;
149             int szSyms;
150             char **syms;
151         } list;
152         struct
153         {
154             int x;
155             int y;
156         } coord;
157         struct _Expr *child;
158         xkb_atom_t str;
159         unsigned uval;
160         int ival;
161         char keyName[5];
162         void * ptr;
163     } value;
164 } ExprDef;
165
166 typedef struct _VarDef
167 {
168     ParseCommon common;
169     unsigned merge;
170     ExprDef *name;
171     ExprDef *value;
172 } VarDef;
173
174 typedef struct _VModDef
175 {
176     ParseCommon common;
177     unsigned merge;
178     xkb_atom_t name;
179     ExprDef *value;
180 } VModDef;
181
182 typedef struct _KeycodeDef
183 {
184     ParseCommon common;
185     unsigned merge;
186     char name[5];
187     unsigned long value;
188 } KeycodeDef;
189
190 typedef struct _KeyAliasDef
191 {
192     ParseCommon common;
193     unsigned merge;
194     char alias[5];
195     char real[5];
196 } KeyAliasDef;
197
198 typedef struct _KeyTypeDef
199 {
200     ParseCommon common;
201     unsigned merge;
202     xkb_atom_t name;
203     VarDef *body;
204 } KeyTypeDef;
205
206 typedef struct _SymbolsDef
207 {
208     ParseCommon common;
209     unsigned merge;
210     char keyName[5];
211     ExprDef *symbols;
212 } SymbolsDef;
213
214 typedef struct _ModMapDef
215 {
216     ParseCommon common;
217     unsigned merge;
218     xkb_atom_t modifier;
219     ExprDef *keys;
220 } ModMapDef;
221
222 typedef struct _GroupCompatDef
223 {
224     ParseCommon common;
225     unsigned merge;
226     int group;
227     ExprDef *def;
228 } GroupCompatDef;
229
230 typedef struct _InterpDef
231 {
232     ParseCommon common;
233     unsigned merge;
234     char *sym;
235     ExprDef *match;
236     VarDef *def;
237 } InterpDef;
238
239 typedef struct _IndicatorNameDef
240 {
241     ParseCommon common;
242     unsigned merge;
243     int ndx;
244     ExprDef *name;
245     Bool virtual;
246 } IndicatorNameDef;
247
248 typedef struct _IndicatorMapDef
249 {
250     ParseCommon common;
251     unsigned merge;
252     unsigned type;
253     xkb_atom_t name;
254     VarDef *body;
255 } IndicatorMapDef;
256
257 typedef struct _XkbFile
258 {
259     ParseCommon common;
260     int type;
261     char *topName;
262     char *name;
263     ParseCommon *defs;
264     int id;
265     unsigned flags;
266     Bool compiled;
267 } XkbFile;
268
269 extern struct xkb_desc *
270 CompileKeymap(XkbFile *file, unsigned merge);
271
272 extern Bool
273 CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
274
275 extern Bool
276 CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
277
278 typedef struct _LEDInfo *LEDInfoPtr;
279
280 extern Bool
281 CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge,
282                  LEDInfoPtr *unboundLEDs);
283
284 extern Bool
285 CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
286
287 extern Bool
288 UpdateModifiersFromCompat(struct xkb_desc *xkb);
289
290 #endif /* XKBCOMP_H */