comctl32: A couple fixes for tab icon offsets.
[wine] / tools / widl / widltypes.h
1 /*
2  * IDL Compiler
3  *
4  * Copyright 2002 Ove Kaaven
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WIDL_WIDLTYPES_H
22 #define __WIDL_WIDLTYPES_H
23
24 #include <stdarg.h>
25 #include "guiddef.h"
26 #include "wine/rpcfc.h"
27
28 #ifndef UUID_DEFINED
29 #define UUID_DEFINED
30 typedef GUID UUID;
31 #endif
32
33 #define TRUE 1
34 #define FALSE 0
35
36 typedef struct _attr_t attr_t;
37 typedef struct _expr_t expr_t;
38 typedef struct _type_t type_t;
39 typedef struct _typeref_t typeref_t;
40 typedef struct _var_t var_t;
41 typedef struct _func_t func_t;
42 typedef struct _ifref_t ifref_t;
43 typedef struct _class_t class_t;
44 typedef struct _typelib_entry_t typelib_entry_t;
45 typedef struct _typelib_t typelib_t;
46
47 #define DECL_LINK(type) \
48   type *l_next; \
49   type *l_prev;
50
51 #define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
52
53 #define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
54 #define NEXT_LINK(x) ((x)->l_next)
55 #define PREV_LINK(x) ((x)->l_prev)
56
57 enum attr_type
58 {
59     ATTR_AGGREGATABLE,
60     ATTR_APPOBJECT,
61     ATTR_ASYNC,
62     ATTR_AUTO_HANDLE,
63     ATTR_BINDABLE,
64     ATTR_CALLAS,
65     ATTR_CASE,
66     ATTR_CONTEXTHANDLE,
67     ATTR_CONTROL,
68     ATTR_DEFAULT,
69     ATTR_DEFAULTCOLLELEM,
70     ATTR_DEFAULTVALUE_EXPR,
71     ATTR_DEFAULTVALUE_STRING,
72     ATTR_DEFAULTVTABLE,
73     ATTR_DISPINTERFACE,
74     ATTR_DISPLAYBIND,
75     ATTR_DLLNAME,
76     ATTR_DUAL,
77     ATTR_ENDPOINT,
78     ATTR_ENTRY_ORDINAL,
79     ATTR_ENTRY_STRING,
80     ATTR_EXPLICIT_HANDLE,
81     ATTR_HANDLE,
82     ATTR_HELPCONTEXT,
83     ATTR_HELPFILE,
84     ATTR_HELPSTRING,
85     ATTR_HELPSTRINGCONTEXT,
86     ATTR_HELPSTRINGDLL,
87     ATTR_HIDDEN,
88     ATTR_ID,
89     ATTR_IDEMPOTENT,
90     ATTR_IIDIS,
91     ATTR_IMMEDIATEBIND,
92     ATTR_IMPLICIT_HANDLE,
93     ATTR_IN,
94     ATTR_INPUTSYNC,
95     ATTR_LENGTHIS,
96     ATTR_LOCAL,
97     ATTR_NONBROWSABLE,
98     ATTR_NONCREATABLE,
99     ATTR_NONEXTENSIBLE,
100     ATTR_OBJECT,
101     ATTR_ODL,
102     ATTR_OLEAUTOMATION,
103     ATTR_OPTIONAL,
104     ATTR_OUT,
105     ATTR_POINTERDEFAULT,
106     ATTR_POINTERTYPE,
107     ATTR_PROPGET,
108     ATTR_PROPPUT,
109     ATTR_PROPPUTREF,
110     ATTR_PUBLIC,
111     ATTR_RANGE,
112     ATTR_READONLY,
113     ATTR_REQUESTEDIT,
114     ATTR_RESTRICTED,
115     ATTR_RETVAL,
116     ATTR_SIZEIS,
117     ATTR_SOURCE,
118     ATTR_STRING,
119     ATTR_SWITCHIS,
120     ATTR_SWITCHTYPE,
121     ATTR_TRANSMITAS,
122     ATTR_UUID,
123     ATTR_V1ENUM,
124     ATTR_VARARG,
125     ATTR_VERSION,
126     ATTR_WIREMARSHAL
127 };
128
129 enum expr_type
130 {
131     EXPR_VOID,
132     EXPR_NUM,
133     EXPR_HEXNUM,
134     EXPR_IDENTIFIER,
135     EXPR_NEG,
136     EXPR_NOT,
137     EXPR_PPTR,
138     EXPR_CAST,
139     EXPR_SIZEOF,
140     EXPR_SHL,
141     EXPR_SHR,
142     EXPR_MUL,
143     EXPR_DIV,
144     EXPR_ADD,
145     EXPR_SUB,
146     EXPR_AND,
147     EXPR_OR,
148     EXPR_COND,
149 };
150
151 enum type_kind
152 {
153     TKIND_ENUM = 0,
154     TKIND_RECORD,
155     TKIND_MODULE,
156     TKIND_INTERFACE,
157     TKIND_DISPATCH,
158     TKIND_COCLASS,
159     TKIND_ALIAS,
160     TKIND_UNION,
161     TKIND_MAX
162 };
163    
164 struct _attr_t {
165   enum attr_type type;
166   union {
167     unsigned long ival;
168     void *pval;
169   } u;
170   /* parser-internal */
171   DECL_LINK(attr_t)
172 };
173
174 struct _expr_t {
175   enum expr_type type;
176   const expr_t *ref;
177   union {
178     long lval;
179     const char *sval;
180     const expr_t *ext;
181     const typeref_t *tref;
182   } u;
183   const expr_t *ext2;
184   int is_const;
185   long cval;
186   /* parser-internal */
187   DECL_LINK(expr_t)
188 };
189
190 struct _type_t {
191   char *name;
192   unsigned char type;
193   struct _type_t *ref;
194   const attr_t *attrs;
195   func_t *funcs;
196   var_t *fields;
197   int ignore, is_const, sign;
198   int defined, written, user_types_registered;
199   int typelib_idx;
200   /* parser-internal */
201   DECL_LINK(type_t)
202 };
203
204 struct _typeref_t {
205   char *name;
206   type_t *ref;
207   int uniq;
208 };
209
210 struct _var_t {
211   char *name;
212   int ptr_level;
213   expr_t *array;
214   type_t *type;
215   var_t *args;  /* for function pointers */
216   const char *tname;
217   attr_t *attrs;
218   expr_t *eval;
219   long lval;
220
221   /* parser-internal */
222   DECL_LINK(var_t)
223 };
224
225 struct _func_t {
226   var_t *def;
227   var_t *args;
228   int ignore, idx;
229
230   /* parser-internal */
231   DECL_LINK(func_t)
232 };
233
234 struct _ifref_t {
235   type_t *iface;
236   attr_t *attrs;
237
238   /* parser-internal */
239   DECL_LINK(ifref_t)
240 };
241
242 struct _class_t {
243   char *name;
244   attr_t *attrs;
245   ifref_t *ifaces;
246
247   /* parser-internal */
248   DECL_LINK(class_t)
249 };
250
251 struct _typelib_entry_t {
252     enum type_kind kind;
253     union {
254         class_t *class;
255         type_t *interface;
256         type_t *module;
257         type_t *structure;
258         type_t *enumeration;
259         var_t *tdef;
260     } u;
261     DECL_LINK(typelib_entry_t)
262 };
263
264 struct _typelib_t {
265     char *name;
266     char *filename;
267     attr_t *attrs;
268     typelib_entry_t *entry;
269 };
270
271 #endif