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_HTML (23)
48 #define WRC_RT_DLGINIT (240)
49 #define WRC_RT_TOOLBAR (241)
51 /* Default class type IDs */
52 #define CT_BUTTON 0x80
54 #define CT_STATIC 0x82
55 #define CT_LISTBOX 0x83
56 #define CT_SCROLLBAR 0x84
57 #define CT_COMBOBOX 0x85
59 /* Byteordering defines */
60 #define WRC_BO_NATIVE 0x00
61 #define WRC_BO_LITTLE 0x01
62 #define WRC_BO_BIG 0x02
64 #define WRC_LOBYTE(w) ((WORD)(w) & 0xff)
65 #define WRC_HIBYTE(w) (((WORD)(w) >> 8) & 0xff)
66 #define WRC_LOWORD(d) ((DWORD)(d) & 0xffff)
67 #define WRC_HIWORD(d) (((DWORD)(d) >> 16) & 0xffff)
68 #define BYTESWAP_WORD(w) ((WORD)(((WORD)WRC_LOBYTE(w) << 8) + (WORD)WRC_HIBYTE(w)))
69 #define BYTESWAP_DWORD(d) ((DWORD)(((DWORD)BYTESWAP_WORD(WRC_LOWORD(d)) << 16) + ((DWORD)BYTESWAP_WORD(WRC_HIWORD(d)))))
71 /* Binary resource structure */
72 #define RES_BLOCKSIZE 512
75 int allocsize; /* Allocated datablock size */
76 int size; /* Actual size of data */
77 int dataidx; /* Tag behind the resource-header */
81 /* Resource strings are slightly more complex because they include '\0' */
82 enum str_e {str_char, str_unicode};
84 typedef struct string {
93 /* Resources are identified either by name or by number */
94 enum name_e {name_str, name_ord};
96 typedef struct name_id {
104 /* Language definitions */
105 typedef struct language {
110 typedef DWORD characts_t;
111 typedef DWORD version_t;
114 language_t *language;
116 characts_t *characts;
119 typedef struct font_id {
127 typedef struct style {
133 /* These are in the same order (and ordinal) as the RT_xxx
134 * defines. This is _required_.
135 * I rolled my own numbers for the win32 extension that are
136 * documented, but generate either old RT_xxx numbers, or
137 * don't have an ordinal associated (user type).
138 * I don't know any specs for those noted such, for that matter,
139 * I don't even know whether they can be generated other than by
140 * using a user-type resource.
156 res_13, /* Hm, wonder why its not used... */
160 res_dlginc, /* Not implemented, no layout available */
162 res_pnp, /* Not implemented, no layout available */
163 res_vxd, /* Not implemented, no layout available */
166 res_html, /* Not implemented, no layout available */
168 res_dlginit = WRC_RT_DLGINIT, /* 240 */
169 res_toolbar = WRC_RT_TOOLBAR, /* 241 */
176 /* Raw bytes in a row... */
177 typedef struct raw_data {
180 lvc_t lvc; /* Localized data */
183 /* Dialog structures */
184 typedef struct control {
185 struct control *next; /* List of controls */
186 struct control *prev;
187 name_id_t *ctlclass; /* ControlClass */
188 name_id_t *title; /* Title of control */
190 int x; /* Position */
192 int width; /* Size */
194 style_t *style; /* Style */
196 DWORD helpid; /* EX: */
197 int gotstyle; /* Used to determine whether the default */
198 int gotexstyle; /* styles must be set */
200 raw_data_t *extra; /* EX: number of extra bytes in resource */
203 typedef struct dialog {
205 int x; /* Position */
207 int width; /* Size */
209 style_t *style; /* Style */
211 int gotstyle; /* Used to determine whether the default */
212 int gotexstyle; /* styles must be set */
221 /* DialogEx structures */
222 typedef struct dialogex {
224 int x; /* Position */
226 int width; /* Size */
228 style_t *style; /* Style */
230 DWORD helpid; /* EX: */
231 int gotstyle; /* Used to determine whether the default */
232 int gotexstyle; /* styles must be set */
242 /* Menu structures */
243 typedef struct menu_item {
244 struct menu_item *next;
245 struct menu_item *prev;
246 struct menu_item *popup;
252 typedef struct menu {
258 /* MenuEx structures */
259 typedef struct menuex_item {
260 struct menuex_item *next;
261 struct menuex_item *prev;
262 struct menuex_item *popup;
274 typedef struct menuex {
277 menuex_item_t *items;
280 typedef struct itemex_opt
295 typedef struct font {
300 typedef struct fontdir {
308 typedef struct icon_header {
309 WORD reserved; /* Don't know, should be 0 I guess */
310 WORD type; /* Always 1 for icons */
311 WORD count; /* Number of packed icons in resource */
314 typedef struct icon_dir_entry {
315 BYTE width; /* From the SDK doc. */
325 typedef struct icon {
329 int id; /* Unique icon id within resource file */
330 int width; /* Field from the IconDirEntry */
338 typedef struct icon_group {
348 typedef struct cursor_header {
349 WORD reserved; /* Don't know, should be 0 I guess */
350 WORD type; /* Always 2 for cursors */
351 WORD count; /* Number of packed cursors in resource */
354 typedef struct cursor_dir_entry {
355 BYTE width; /* From the SDK doc. */
363 } cursor_dir_entry_t;
365 typedef struct cursor {
369 int id; /* Unique icon id within resource file */
370 int width; /* Field from the CursorDirEntry */
380 typedef struct cursor_group {
383 cursor_t *cursorlist;
388 * Animated cursors and icons
390 typedef struct aniheader {
391 DWORD structsize; /* Header size (36 bytes) */
392 DWORD frames; /* Number of unique icons in this cursor */
393 DWORD steps; /* Number of blits before the animation cycles */
394 DWORD cx; /* reserved, must be 0? */
395 DWORD cy; /* reserved, must be 0? */
396 DWORD bitcount; /* reserved, must be 0? */
397 DWORD planes; /* reserved, must be 0? */
398 DWORD rate; /* Default rate (1/60th of a second) if "rate" not present */
399 DWORD flags; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
402 typedef struct riff_tag {
407 typedef struct ani_curico {
412 typedef struct ani_any {
416 cursor_group_t *curg;
424 typedef struct bitmap {
429 typedef struct rcdata {
434 typedef struct user {
443 typedef struct msgtab_block {
444 DWORD idlo; /* Lowest id in the set */
445 DWORD idhi; /* Highest is in the set */
446 DWORD offset; /* Offset from resource start to first entry */
449 typedef struct msgtab_entry {
450 WORD length; /* Length of the data in bytes */
451 WORD flags; /* 0 for char, 1 for WCHAR */
452 /* {char}|{WCHAR} data[...]; */
455 typedef struct messagetable {
460 /* StringTable structures */
461 typedef struct stt_entry {
465 characts_t *characts;
469 typedef struct stringtable {
470 struct stringtable *next;
471 struct stringtable *prev;
476 stt_entry_t *entries;
479 /* VersionInfo structures */
480 enum ver_val_e {val_str, val_words, val_block};
482 struct ver_block; /* Forward ref */
484 typedef struct ver_words {
489 typedef struct ver_value {
490 struct ver_value *next;
491 struct ver_value *prev;
496 struct ver_block *block;
501 typedef struct ver_block {
502 struct ver_block *next;
503 struct ver_block *prev;
508 typedef struct versioninfo {
536 /* Accelerator structures */
537 #define WRC_AF_VIRTKEY 0x0001
538 #define WRC_AF_NOINVERT 0x0002
539 #define WRC_AF_SHIFT 0x0004
540 #define WRC_AF_CONTROL 0x0008
541 #define WRC_AF_ALT 0x0010
542 #define WRC_AF_ASCII 0x4000
544 typedef struct event {
552 typedef struct accelerator {
558 /* Toolbar structures */
559 typedef struct toolbar_item {
560 struct toolbar_item *next;
561 struct toolbar_item *prev;
565 typedef struct toolbar {
571 toolbar_item_t *items;
574 typedef struct dlginit {
580 /* A top-level resource node */
581 typedef struct resource {
582 struct resource *next;
583 struct resource *prev;
585 name_id_t *name; /* resource's name */
586 language_t *lan; /* Only used as a sorting key and c-name creation*/
592 cursor_group_t *curg;
608 void *overlay; /* To catch all types at once... */
610 res_t *binres; /* To binary converted resource */
611 char *c_name; /* BaseName in output */
616 typedef struct res32_count {
621 typedef struct res_count {
623 int count; /* win16 mode */
624 resource_t **rscarray;
626 res32_count_t *rsc32array; /* win32 mode */
631 typedef struct style_pair {