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 typedef struct style {
121 /* These are in the same order (and ordinal) as the RT_xxx
122 * defines. This is _required_.
123 * I rolled my own numbers for the win32 extension that are
124 * documented, but generate either old RT_xxx numbers, or
125 * don't have an ordinal associated (user type).
126 * I don't know any specs for those noted such, for that matter,
127 * I don't even know whether they can be generated other than by
128 * using a user-type resource.
144 res_13, /* Hm, wonder why its not used... */
148 res_dlginc, /* Not implemented, no layout available */
150 res_pnp, /* Not implemented, no layout available */
151 res_vxd, /* Not implemented, no layout available */
152 res_anicur, /* Not implemented, no layout available */
153 res_aniico, /* Not implemented, no layout available */
155 res_dlginit = WRC_RT_DLGINIT, /* 240 */
156 res_toolbar = WRC_RT_TOOLBAR, /* 241 */
163 /* Raw bytes in a row... */
164 typedef struct raw_data {
169 /* Dialog structures */
170 typedef struct control {
171 struct control *next; /* List of controls */
172 struct control *prev;
173 name_id_t *ctlclass; /* ControlClass */
174 name_id_t *title; /* Title of control */
176 int x; /* Position */
178 int width; /* Size */
180 style_t *style; /* Style */
182 DWORD helpid; /* EX: */
183 int gotstyle; /* Used to determine whether the default */
184 int gotexstyle; /* styles must be set */
186 raw_data_t *extra; /* EX: number of extra bytes in resource */
189 typedef struct dialog {
191 int x; /* Position */
193 int width; /* Size */
195 style_t *style; /* Style */
197 int gotstyle; /* Used to determine whether the default */
198 int gotexstyle; /* styles must be set */
207 /* DialogEx structures */
208 typedef struct dialogex {
210 int x; /* Position */
212 int width; /* Size */
214 style_t *style; /* Style */
216 DWORD helpid; /* EX: */
217 int gotstyle; /* Used to determine whether the default */
218 int gotexstyle; /* styles must be set */
228 /* Menu structures */
229 typedef struct menu_item {
230 struct menu_item *next;
231 struct menu_item *prev;
232 struct menu_item *popup;
238 typedef struct menu {
244 /* MenuEx structures */
245 typedef struct menuex_item {
246 struct menuex_item *next;
247 struct menuex_item *prev;
248 struct menuex_item *popup;
260 typedef struct menuex {
263 menuex_item_t *items;
266 typedef struct itemex_opt
278 /* RC structures for types read from file or supplied binary */
279 typedef struct font {
284 typedef struct icon_dir_entry {
285 BYTE width; /* From the SDK doc. */
295 typedef struct icon {
299 int id; /* Unique icon id within resource file */
300 int width; /* Field from the IconDirEntry */
308 typedef struct icon_group {
315 typedef struct cursor_dir_entry {
316 BYTE width; /* From the SDK doc. */
324 } cursor_dir_entry_t;
326 typedef struct cursor {
330 int id; /* Unique icon id within resource file */
331 int width; /* Field from the CursorDirEntry */
341 typedef struct cursor_group {
344 cursor_t *cursorlist;
348 typedef struct bitmap {
353 typedef struct rcdata {
359 typedef struct user {
365 typedef struct messagetable {
369 /* StringTable structures */
370 typedef struct stt_entry {
374 characts_t *characts;
378 typedef struct stringtable {
379 struct stringtable *next;
380 struct stringtable *prev;
385 stt_entry_t *entries;
388 /* VersionInfo structures */
389 enum ver_val_e {val_str, val_words, val_block};
391 struct ver_block; /* Forward ref */
393 typedef struct ver_words {
398 typedef struct ver_value {
399 struct ver_value *next;
400 struct ver_value *prev;
405 struct ver_block *block;
410 typedef struct ver_block {
411 struct ver_block *next;
412 struct ver_block *prev;
417 typedef struct versioninfo {
443 /* Accelerator structures */
444 #define WRC_AF_VIRTKEY 0x0001
445 #define WRC_AF_NOINVERT 0x0002
446 #define WRC_AF_SHIFT 0x0004
447 #define WRC_AF_CONTROL 0x0008
448 #define WRC_AF_ALT 0x0010
449 #define WRC_AF_ASCII 0x4000
451 typedef struct event {
459 typedef struct accelerator {
465 /* Toolbar structures */
466 typedef struct toolbar_item {
467 struct toolbar_item *next;
468 struct toolbar_item *prev;
472 typedef struct toolbar {
478 toolbar_item_t *items;
481 typedef struct dlginit {
488 /* A top-level resource node */
489 typedef struct resource {
490 struct resource *next;
491 struct resource *prev;
493 name_id_t *name; /* resource's name */
494 language_t *lan; /* Only used as a sorting key and c-name creation*/
499 cursor_group_t *curg;
514 void *overlay; /* To catch all types at once... */
516 res_t *binres; /* To binary converted resource */
517 char *c_name; /* BaseName in output */
522 typedef struct res32_count {
527 typedef struct res_count {
529 int count; /* win16 mode */
530 resource_t **rscarray;
532 res32_count_t *rsc32array; /* win32 mode */
537 typedef struct style_pair {