2 * General type definitions
4 * Copyright 1998 Bertho A. Stultiens (BS)
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)
20 #ifndef VS_FFI_SIGNATURE
24 /* Memory/load flags */
25 #define WRC_MO_MOVEABLE 0x0010
26 #define WRC_MO_PURE 0x0020
27 #define WRC_MO_PRELOAD 0x0040
28 #define WRC_MO_DISCARDABLE 0x1000
30 /* Resource type IDs */
31 #define WRC_RT_CURSOR (1)
32 #define WRC_RT_BITMAP (2)
33 #define WRC_RT_ICON (3)
34 #define WRC_RT_MENU (4)
35 #define WRC_RT_DIALOG (5)
36 #define WRC_RT_STRING (6)
37 #define WRC_RT_FONTDIR (7)
38 #define WRC_RT_FONT (8)
39 #define WRC_RT_ACCELERATOR (9)
40 #define WRC_RT_RCDATA (10)
41 #define WRC_RT_MESSAGETABLE (11)
42 #define WRC_RT_GROUP_CURSOR (12)
43 #define WRC_RT_GROUP_ICON (14)
44 #define WRC_RT_VERSION (16)
45 #define WRC_RT_DLGINCLUDE (17)
46 #define WRC_RT_PLUGPLAY (19)
47 #define WRC_RT_VXD (20)
48 #define WRC_RT_ANICURSOR (21)
49 #define WRC_RT_ANIICON (22)
50 #define WRC_RT_TOOLBAR (241)
52 /* Default class type IDs */
53 #define CT_BUTTON 0x80
55 #define CT_STATIC 0x82
56 #define CT_LISTBOX 0x83
57 #define CT_SCROLLBAR 0x84
58 #define CT_COMBOBOX 0x85
61 /* Binary resource structure */
62 #define RES_BLOCKSIZE 512
65 int allocsize; /* Allocated datablock size */
66 int size; /* Actual size of data */
67 int dataidx; /* Tag behind the resource-header */
71 /* Resource strings are slightly more complex because they include '\0' */
72 enum str_e {str_char, str_unicode};
74 typedef struct string {
83 /* Resources are identified either by name or by number */
84 enum name_e {name_str, name_ord};
86 typedef struct name_id {
94 /* Language definitions */
95 typedef struct language {
100 typedef DWORD characts_t;
101 typedef DWORD version_t;
104 language_t *language;
106 characts_t *characts;
109 typedef struct font_id {
117 /* These are in the same order (and ordinal) as the RT_xxx
118 * defines. This is _required_.
119 * I rolled my own numbers for the win32 extension that are
120 * documented, but generate either old RT_xxx numbers, or
121 * don't have an ordinal associated (user type).
122 * I don't know any specs for those noted such, for that matter,
123 * I don't even know whether they can be generated other than by
124 * using a user-type resource.
140 res_13, /* Hm, wonder why its not used... */
144 res_dlginc, /* Not implemented, no layout available */
146 res_pnp, /* Not implemented, no layout available */
147 res_vxd, /* Not implemented, no layout available */
148 res_anicur, /* Not implemented, no layout available */
149 res_aniico, /* Not implemented, no layout available */
151 res_toolbar = WRC_RT_TOOLBAR, /* 241 */
158 /* Raw bytes in a row... */
159 typedef struct raw_data {
164 /* Dialog structures */
165 typedef struct control {
166 struct control *next; /* List of controls */
167 struct control *prev;
168 name_id_t *ctlclass; /* ControlClass */
169 string_t *title; /* Title of control */
171 int x; /* Position */
173 int width; /* Size */
175 DWORD style; /* Style */
177 DWORD helpid; /* EX: */
178 int gotstyle; /* Used to determine whether the default */
179 int gotexstyle; /* styles must be set */
181 raw_data_t *extra; /* EX: number of extra bytes in resource */
184 typedef struct dialog {
186 int x; /* Position */
188 int width; /* Size */
190 DWORD style; /* Style */
192 int gotstyle; /* Used to determine whether the default */
193 int gotexstyle; /* styles must be set */
202 /* DialogEx structures */
203 typedef struct dialogex {
205 int x; /* Position */
207 int width; /* Size */
209 DWORD style; /* Style */
211 DWORD helpid; /* EX: */
212 int gotstyle; /* Used to determine whether the default */
213 int gotexstyle; /* styles must be set */
223 /* Menu structures */
224 typedef struct menu_item {
225 struct menu_item *next;
226 struct menu_item *prev;
227 struct menu_item *popup;
233 typedef struct menu {
239 /* MenuEx structures */
240 typedef struct menuex_item {
241 struct menuex_item *next;
242 struct menuex_item *prev;
243 struct menuex_item *popup;
255 typedef struct menuex {
258 menuex_item_t *items;
261 typedef struct itemex_opt
273 /* RC structures for types read from file or supplied binary */
274 typedef struct font {
279 typedef struct icon_dir_entry {
280 BYTE width; /* From the SDK doc. */
290 typedef struct icon {
294 int id; /* Unique icon id within resource file */
295 int width; /* Field from the IconDirEntry */
303 typedef struct icon_group {
310 typedef struct cursor_dir_entry {
311 BYTE width; /* From the SDK doc. */
319 } cursor_dir_entry_t;
321 typedef struct cursor {
325 int id; /* Unique icon id within resource file */
326 int width; /* Field from the CursorDirEntry */
336 typedef struct cursor_group {
339 cursor_t *cursorlist;
343 typedef struct bitmap {
348 typedef struct rcdata {
354 typedef struct user {
360 typedef struct messagetable {
364 /* StringTable structures */
365 typedef struct stt_entry {
369 characts_t *characts;
373 typedef struct stringtable {
374 struct stringtable *next;
375 struct stringtable *prev;
380 stt_entry_t *entries;
383 /* VersionInfo structures */
384 enum ver_val_e {val_str, val_words, val_block};
386 struct ver_block; /* Forward ref */
388 typedef struct ver_words {
393 typedef struct ver_value {
394 struct ver_value *next;
395 struct ver_value *prev;
400 struct ver_block *block;
405 typedef struct ver_block {
406 struct ver_block *next;
407 struct ver_block *prev;
412 typedef struct versioninfo {
438 /* Accelerator structures */
439 #define WRC_AF_VIRTKEY 0x0001
440 #define WRC_AF_NOINVERT 0x0002
441 #define WRC_AF_SHIFT 0x0004
442 #define WRC_AF_CONTROL 0x0008
443 #define WRC_AF_ALT 0x0010
444 #define WRC_AF_ASCII 0x4000
446 typedef struct event {
454 typedef struct accelerator {
460 /* Toolbar structures */
461 typedef struct toolbar_item {
462 struct toolbar_item *next;
463 struct toolbar_item *prev;
467 typedef struct toolbar {
473 toolbar_item_t *items;
476 /* A top-level resource node */
477 typedef struct resource {
478 struct resource *next;
479 struct resource *prev;
481 name_id_t *name; /* resource's name */
482 language_t *lan; /* Only used as a sorting key and c-name creation*/
487 cursor_group_t *curg;
501 void *overlay; /* To catch all types at once... */
503 res_t *binres; /* To binary converted resource */
504 char *c_name; /* BaseName in output */
509 typedef struct res32_count {
514 typedef struct res_count {
516 int count; /* win16 mode */
517 resource_t **rscarray;
519 res32_count_t *rsc32array; /* win32 mode */