Removed client-side wait functions; all waiting is now done through
[wine/multimedia.git] / tools / wrc / wrctypes.h
blobeebdb5606453ee10b4dad4c1173020644f34323e
1 /*
2 * General type definitions
4 * Copyright 1998 Bertho A. Stultiens (BS)
6 */
8 #ifndef __WRC_WRCTYPES_H
9 #define __WRC_WRCTYPES_H
11 /* First is MS style, second wine style */
12 #if !defined(_INC_WINDOWS) && !defined(__WINE_WINDOWS_H)
13 #include "windows.h"
14 #endif
16 #ifndef MAKELANGID
17 #include "winnls.h"
18 #endif
20 #ifndef VS_FFI_SIGNATURE
21 #include "ver.h"
22 #endif
25 /* Binary resource structure */
26 #define RES_BLOCKSIZE 512
28 typedef struct res {
29 int allocsize; /* Allocated datablock size */
30 int size; /* Actual size of data */
31 int dataidx; /* Tag behind the resource-header */
32 char *data;
33 } res_t;
35 /* Resource strings are slightly more complex because they include '\0' */
36 enum str_e {str_char, str_unicode};
38 typedef struct string {
39 int size;
40 enum str_e type;
41 union {
42 char *cstr;
43 short *wstr;
44 } str;
45 } string_t;
47 /* Resources are identified either by name or by number */
48 enum name_e {name_str, name_ord};
50 typedef struct name_id {
51 union {
52 string_t *s_name;
53 int i_name;
54 } name;
55 enum name_e type;
56 } name_id_t;
58 /* Language definitions */
59 typedef struct language {
60 int id;
61 int sub;
62 } language_t;
64 typedef DWORD characts_t;
65 typedef DWORD version_t;
67 typedef struct lvc {
68 language_t *language;
69 version_t *version;
70 characts_t *characts;
71 } lvc_t;
73 typedef struct font_id {
74 string_t *name;
75 int size;
76 int weight;
77 int italic;
78 } font_id_t;
80 /* resource types */
81 /* These are in the same order (and ordinal) as the RT_xxx
82 * defines. This is _required_.
83 * I rolled my own numbers for the win32 extension that are
84 * documented, but generate either old RT_xxx numbers, or
85 * don't have an ordinal associated (user type).
86 * I don't know any specs for those noted such, for that matter,
87 * I don't even know whether they can be generated other than by
88 * using a user-type resource.
90 enum res_e {
91 res_0 = 0,
92 res_cur,
93 res_ico,
94 res_bmp,
95 res_men,
96 res_dlg,
97 res_stt,
98 res_fntdir,
99 res_fnt,
100 res_acc,
101 res_rdt,
102 res_msg,
103 res_curg,
104 res_13, /* Hm, wonder why its not used... */
105 res_icog,
106 res_15,
107 res_ver,
108 res_dlginc, /* Not implemented, no layout available */
109 res_18,
110 res_pnp, /* Not implemented, no layout available */
111 res_vxd, /* Not implemented, no layout available */
112 res_anicur, /* Not implemented, no layout available */
113 res_aniico, /* Not implemented, no layout available */
115 res_menex = 256 + 4,
116 res_dlgex,
117 res_usr,
120 /* Raw bytes in a row... */
121 typedef struct raw_data {
122 int size;
123 char *data;
124 } raw_data_t;
126 /* Dialog structures */
127 typedef struct control {
128 struct control *next; /* List of controls */
129 struct control *prev;
130 name_id_t *ctlclass; /* ControlClass */
131 string_t *title; /* Title of control */
132 int id;
133 int x; /* Position */
134 int y;
135 int width; /* Size */
136 int height;
137 DWORD style; /* Style */
138 DWORD exstyle;
139 DWORD helpid; /* EX: */
140 int gotstyle; /* Used to determine whether the default */
141 int gotexstyle; /* styles must be set */
142 int gothelpid;
143 raw_data_t *extra; /* EX: number of extra bytes in resource */
144 } control_t;
146 typedef struct dialog {
147 DWORD memopt;
148 int x; /* Position */
149 int y;
150 int width; /* Size */
151 int height;
152 DWORD style; /* Style */
153 DWORD exstyle;
154 int gotstyle; /* Used to determine whether the default */
155 int gotexstyle; /* styles must be set */
156 name_id_t *menu;
157 name_id_t *dlgclass;
158 string_t *title;
159 font_id_t *font;
160 lvc_t lvc;
161 control_t *controls;
162 } dialog_t;
164 /* DialogEx structures */
165 typedef struct dialogex {
166 DWORD memopt;
167 int x; /* Position */
168 int y;
169 int width; /* Size */
170 int height;
171 DWORD style; /* Style */
172 DWORD exstyle;
173 DWORD helpid; /* EX: */
174 int gotstyle; /* Used to determine whether the default */
175 int gotexstyle; /* styles must be set */
176 int gothelpid;
177 name_id_t *menu;
178 name_id_t *dlgclass;
179 string_t *title;
180 font_id_t *font;
181 lvc_t lvc;
182 control_t *controls;
183 } dialogex_t;
185 /* Menu structures */
186 typedef struct menu_item {
187 struct menu_item *next;
188 struct menu_item *prev;
189 struct menu_item *popup;
190 int id;
191 DWORD state;
192 string_t *name;
193 } menu_item_t;
195 typedef struct menu {
196 DWORD memopt;
197 lvc_t lvc;
198 menu_item_t *items;
199 } menu_t;
201 /* MenuEx structures */
202 typedef struct menuex_item {
203 struct menuex_item *next;
204 struct menuex_item *prev;
205 struct menuex_item *popup;
206 int id;
207 DWORD type;
208 DWORD state;
209 int helpid;
210 string_t *name;
211 int gotid;
212 int gottype;
213 int gotstate;
214 int gothelpid;
215 } menuex_item_t;
217 typedef struct menuex {
218 DWORD memopt;
219 lvc_t lvc;
220 menuex_item_t *items;
221 } menuex_t;
223 typedef struct itemex_opt
225 int id;
226 DWORD type;
227 DWORD state;
228 int helpid;
229 int gotid;
230 int gottype;
231 int gotstate;
232 int gothelpid;
233 } itemex_opt_t;
235 /* RC structures for types read from file or supplied binary */
236 typedef struct font {
237 DWORD memopt;
238 raw_data_t *data;
239 } font_t;
241 typedef struct icon_dir_entry {
242 BYTE width; /* From the SDK doc. */
243 BYTE height;
244 BYTE nclr;
245 BYTE reserved;
246 WORD planes;
247 WORD bits;
248 DWORD ressize;
249 DWORD offset;
250 } icon_dir_entry_t;
252 typedef struct icon {
253 struct icon *next;
254 struct icon *prev;
255 lvc_t lvc;
256 int id; /* Unique icon id within resource file */
257 int width; /* Field from the IconDirEntry */
258 int height;
259 int nclr;
260 int planes;
261 int bits;
262 raw_data_t *data;
263 } icon_t;
265 typedef struct icon_group {
266 DWORD memopt;
267 lvc_t lvc;
268 icon_t *iconlist;
269 int nicon;
270 } icon_group_t;
272 typedef struct cursor_dir_entry {
273 BYTE width; /* From the SDK doc. */
274 BYTE height;
275 BYTE nclr;
276 BYTE reserved;
277 WORD xhot;
278 WORD yhot;
279 DWORD ressize;
280 DWORD offset;
281 } cursor_dir_entry_t;
283 typedef struct cursor {
284 struct cursor *next;
285 struct cursor *prev;
286 lvc_t lvc;
287 int id; /* Unique icon id within resource file */
288 int width; /* Field from the CursorDirEntry */
289 int height;
290 int nclr;
291 int planes;
292 int bits;
293 int xhot;
294 int yhot;
295 raw_data_t *data;
296 } cursor_t;
298 typedef struct cursor_group {
299 DWORD memopt;
300 lvc_t lvc;
301 cursor_t *cursorlist;
302 int ncursor;
303 } cursor_group_t;
305 typedef struct bitmap {
306 DWORD memopt;
307 raw_data_t *data;
308 } bitmap_t;
310 typedef struct rcdata {
311 DWORD memopt;
312 lvc_t lvc;
313 raw_data_t *data;
314 } rcdata_t;
316 typedef struct user {
317 DWORD memopt;
318 name_id_t *type;
319 raw_data_t *data;
320 } user_t;
322 typedef struct messagetable {
323 raw_data_t *data;
324 } messagetable_t;
326 /* StringTable structures */
327 typedef struct stt_entry {
328 string_t *str;
329 int id;
330 DWORD memopt;
331 characts_t *characts;
332 version_t *version;
333 } stt_entry_t;
335 typedef struct stringtable {
336 struct stringtable *next;
337 struct stringtable *prev;
338 DWORD memopt;
339 lvc_t lvc;
340 int idbase;
341 int nentries;
342 stt_entry_t *entries;
343 } stringtable_t;
345 /* VersionInfo structures */
346 enum ver_val_e {val_str, val_words, val_block};
348 struct ver_block; /* Forward ref */
350 typedef struct ver_words {
351 WORD *words;
352 int nwords;
353 } ver_words_t;
355 typedef struct ver_value {
356 struct ver_value *next;
357 struct ver_value *prev;
358 string_t *key;
359 union {
360 string_t *str;
361 ver_words_t *words;
362 struct ver_block *block;
363 } value;
364 enum ver_val_e type;
365 } ver_value_t;
367 typedef struct ver_block {
368 struct ver_block *next;
369 struct ver_block *prev;
370 string_t *name;
371 ver_value_t *values;
372 } ver_block_t;
374 typedef struct versioninfo {
375 int filever_maj1;
376 int filever_maj2;
377 int filever_min1;
378 int filever_min2;
379 int prodver_maj1;
380 int prodver_maj2;
381 int prodver_min1;
382 int prodver_min2;
383 int fileos;
384 int fileflags;
385 int fileflagsmask;
386 int filetype;
387 int filesubtype;
388 struct {
389 int fv:1;
390 int pv:1;
391 int fo:1;
392 int ff:1;
393 int ffm:1;
394 int ft:1;
395 int fst:1;
396 } gotit;
397 ver_block_t *blocks;
398 } versioninfo_t;
400 /* Accelerator structures */
401 #define WRC_AF_VIRTKEY 0x0001
402 #define WRC_AF_NOINVERT 0x0002
403 #define WRC_AF_SHIFT 0x0004
404 #define WRC_AF_CONTROL 0x0008
405 #define WRC_AF_ALT 0x0010
406 #define WRC_AF_ASCII 0x4000
408 typedef struct event {
409 struct event *next;
410 struct event *prev;
411 int flags;
412 int key;
413 int id;
414 } event_t;
416 typedef struct accelerator {
417 DWORD memopt;
418 lvc_t lvc;
419 event_t *events;
420 } accelerator_t;
422 /* A top-level resource node */
423 typedef struct resource {
424 struct resource *next;
425 struct resource *prev;
426 enum res_e type;
427 name_id_t *name; /* resource's name */
428 language_t *lan; /* Only used as a sorting key and c-name creation*/
429 union {
430 accelerator_t *acc;
431 bitmap_t *bmp;
432 cursor_t *cur;
433 cursor_group_t *curg;
434 dialog_t *dlg;
435 dialogex_t *dlgex;
436 font_t *fnt;
437 icon_t *ico;
438 icon_group_t *icog;
439 menu_t *men;
440 menuex_t *menex;
441 messagetable_t *msg;
442 rcdata_t *rdt;
443 stringtable_t *stt;
444 user_t *usr;
445 versioninfo_t *ver;
446 void *overlay; /* To catch all types at once... */
447 } res;
448 res_t *binres; /* To binary converted resource */
449 char *c_name; /* BaseName in output */
450 DWORD memopt;
451 } resource_t;
453 /* Resource count */
454 typedef struct res32_count {
455 int count;
456 resource_t **rsc;
457 } res32_count_t;
459 typedef struct res_count {
460 name_id_t type;
461 int count; /* win16 mode */
462 resource_t **rscarray;
463 int count32;
464 res32_count_t *rsc32array; /* win32 mode */
465 int n_id_entries;
466 int n_name_entries;
467 } res_count_t;
469 #endif