2 * General type definitions
4 * Copyright 1998 Bertho A. Stultiens (BS)
8 #ifndef __WRC_WRCTYPES_H
9 #define __WRC_WRCTYPES_H
17 #ifndef VS_FFI_SIGNATURE
21 /* Memory/load flags */
22 #define WRC_MO_MOVEABLE 0x0010
23 #define WRC_MO_PURE 0x0020
24 #define WRC_MO_PRELOAD 0x0040
25 #define WRC_MO_DISCARDABLE 0x1000
27 /* Resource type IDs */
28 #define WRC_RT_CURSOR (1)
29 #define WRC_RT_BITMAP (2)
30 #define WRC_RT_ICON (3)
31 #define WRC_RT_MENU (4)
32 #define WRC_RT_DIALOG (5)
33 #define WRC_RT_STRING (6)
34 #define WRC_RT_FONTDIR (7)
35 #define WRC_RT_FONT (8)
36 #define WRC_RT_ACCELERATOR (9)
37 #define WRC_RT_RCDATA (10)
38 #define WRC_RT_MESSAGETABLE (11)
39 #define WRC_RT_GROUP_CURSOR (12)
40 #define WRC_RT_GROUP_ICON (14)
41 #define WRC_RT_VERSION (16)
42 #define WRC_RT_DLGINCLUDE (17)
43 #define WRC_RT_PLUGPLAY (19)
44 #define WRC_RT_VXD (20)
45 #define WRC_RT_ANICURSOR (21)
46 #define WRC_RT_ANIICON (22)
47 #define WRC_RT_DLGINIT (240)
48 #define WRC_RT_TOOLBAR (241)
50 /* Default class type IDs */
51 #define CT_BUTTON 0x80
53 #define CT_STATIC 0x82
54 #define CT_LISTBOX 0x83
55 #define CT_SCROLLBAR 0x84
56 #define CT_COMBOBOX 0x85
59 /* Binary resource structure */
60 #define RES_BLOCKSIZE 512
63 int allocsize; /* Allocated datablock size */
64 int size; /* Actual size of data */
65 int dataidx; /* Tag behind the resource-header */
69 /* Resource strings are slightly more complex because they include '\0' */
70 enum str_e {str_char, str_unicode};
72 typedef struct string {
81 /* Resources are identified either by name or by number */
82 enum name_e {name_str, name_ord};
84 typedef struct name_id {
92 /* Language definitions */
93 typedef struct language {
98 typedef DWORD characts_t;
99 typedef DWORD version_t;
102 language_t *language;
104 characts_t *characts;
107 typedef struct font_id {
115 /* These are in the same order (and ordinal) as the RT_xxx
116 * defines. This is _required_.
117 * I rolled my own numbers for the win32 extension that are
118 * documented, but generate either old RT_xxx numbers, or
119 * don't have an ordinal associated (user type).
120 * I don't know any specs for those noted such, for that matter,
121 * I don't even know whether they can be generated other than by
122 * using a user-type resource.
138 res_13, /* Hm, wonder why its not used... */
142 res_dlginc, /* Not implemented, no layout available */
144 res_pnp, /* Not implemented, no layout available */
145 res_vxd, /* Not implemented, no layout available */
146 res_anicur, /* Not implemented, no layout available */
147 res_aniico, /* Not implemented, no layout available */
149 res_dlginit = WRC_RT_DLGINIT, /* 240 */
150 res_toolbar = WRC_RT_TOOLBAR, /* 241 */
157 /* Raw bytes in a row... */
158 typedef struct raw_data {
163 /* Dialog structures */
164 typedef struct control {
165 struct control *next; /* List of controls */
166 struct control *prev;
167 name_id_t *ctlclass; /* ControlClass */
168 name_id_t *title; /* Title of control */
170 int x; /* Position */
172 int width; /* Size */
174 DWORD style; /* Style */
176 DWORD helpid; /* EX: */
177 int gotstyle; /* Used to determine whether the default */
178 int gotexstyle; /* styles must be set */
180 raw_data_t *extra; /* EX: number of extra bytes in resource */
183 typedef struct dialog {
185 int x; /* Position */
187 int width; /* Size */
189 DWORD style; /* Style */
191 int gotstyle; /* Used to determine whether the default */
192 int gotexstyle; /* styles must be set */
201 /* DialogEx structures */
202 typedef struct dialogex {
204 int x; /* Position */
206 int width; /* Size */
208 DWORD style; /* Style */
210 DWORD helpid; /* EX: */
211 int gotstyle; /* Used to determine whether the default */
212 int gotexstyle; /* styles must be set */
222 /* Menu structures */
223 typedef struct menu_item {
224 struct menu_item *next;
225 struct menu_item *prev;
226 struct menu_item *popup;
232 typedef struct menu {
238 /* MenuEx structures */
239 typedef struct menuex_item {
240 struct menuex_item *next;
241 struct menuex_item *prev;
242 struct menuex_item *popup;
254 typedef struct menuex {
257 menuex_item_t *items;
260 typedef struct itemex_opt
272 /* RC structures for types read from file or supplied binary */
273 typedef struct font {
278 typedef struct icon_dir_entry {
279 BYTE width; /* From the SDK doc. */
289 typedef struct icon {
293 int id; /* Unique icon id within resource file */
294 int width; /* Field from the IconDirEntry */
302 typedef struct icon_group {
309 typedef struct cursor_dir_entry {
310 BYTE width; /* From the SDK doc. */
318 } cursor_dir_entry_t;
320 typedef struct cursor {
324 int id; /* Unique icon id within resource file */
325 int width; /* Field from the CursorDirEntry */
335 typedef struct cursor_group {
338 cursor_t *cursorlist;
342 typedef struct bitmap {
347 typedef struct rcdata {
353 typedef struct user {
359 typedef struct messagetable {
363 /* StringTable structures */
364 typedef struct stt_entry {
368 characts_t *characts;
372 typedef struct stringtable {
373 struct stringtable *next;
374 struct stringtable *prev;
379 stt_entry_t *entries;
382 /* VersionInfo structures */
383 enum ver_val_e {val_str, val_words, val_block};
385 struct ver_block; /* Forward ref */
387 typedef struct ver_words {
392 typedef struct ver_value {
393 struct ver_value *next;
394 struct ver_value *prev;
399 struct ver_block *block;
404 typedef struct ver_block {
405 struct ver_block *next;
406 struct ver_block *prev;
411 typedef struct versioninfo {
437 /* Accelerator structures */
438 #define WRC_AF_VIRTKEY 0x0001
439 #define WRC_AF_NOINVERT 0x0002
440 #define WRC_AF_SHIFT 0x0004
441 #define WRC_AF_CONTROL 0x0008
442 #define WRC_AF_ALT 0x0010
443 #define WRC_AF_ASCII 0x4000
445 typedef struct event {
453 typedef struct accelerator {
459 /* Toolbar structures */
460 typedef struct toolbar_item {
461 struct toolbar_item *next;
462 struct toolbar_item *prev;
466 typedef struct toolbar {
472 toolbar_item_t *items;
475 typedef struct dlginit {
482 /* A top-level resource node */
483 typedef struct resource {
484 struct resource *next;
485 struct resource *prev;
487 name_id_t *name; /* resource's name */
488 language_t *lan; /* Only used as a sorting key and c-name creation*/
493 cursor_group_t *curg;
508 void *overlay; /* To catch all types at once... */
510 res_t *binres; /* To binary converted resource */
511 char *c_name; /* BaseName in output */
516 typedef struct res32_count {
521 typedef struct res_count {
523 int count; /* win16 mode */
524 resource_t **rscarray;
526 res32_count_t *rsc32array; /* win32 mode */
531 typedef struct style_pair {