2 * General type definitions
4 * Copyright 1998 Bertho A. Stultiens (BS)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WRC_WRCTYPES_H
22 #define __WRC_WRCTYPES_H
32 #ifndef VS_FFI_SIGNATURE
36 /* Memory/load flags */
37 #define WRC_MO_MOVEABLE 0x0010
38 #define WRC_MO_PURE 0x0020
39 #define WRC_MO_PRELOAD 0x0040
40 #define WRC_MO_DISCARDABLE 0x1000
42 /* Resource type IDs */
43 #define WRC_RT_CURSOR (1)
44 #define WRC_RT_BITMAP (2)
45 #define WRC_RT_ICON (3)
46 #define WRC_RT_MENU (4)
47 #define WRC_RT_DIALOG (5)
48 #define WRC_RT_STRING (6)
49 #define WRC_RT_FONTDIR (7)
50 #define WRC_RT_FONT (8)
51 #define WRC_RT_ACCELERATOR (9)
52 #define WRC_RT_RCDATA (10)
53 #define WRC_RT_MESSAGETABLE (11)
54 #define WRC_RT_GROUP_CURSOR (12)
55 #define WRC_RT_GROUP_ICON (14)
56 #define WRC_RT_VERSION (16)
57 #define WRC_RT_DLGINCLUDE (17)
58 #define WRC_RT_PLUGPLAY (19)
59 #define WRC_RT_VXD (20)
60 #define WRC_RT_ANICURSOR (21)
61 #define WRC_RT_ANIICON (22)
62 #define WRC_RT_HTML (23)
63 #define WRC_RT_DLGINIT (240)
64 #define WRC_RT_TOOLBAR (241)
66 /* Default class type IDs */
67 #define CT_BUTTON 0x80
69 #define CT_STATIC 0x82
70 #define CT_LISTBOX 0x83
71 #define CT_SCROLLBAR 0x84
72 #define CT_COMBOBOX 0x85
74 /* Byteordering defines */
75 #define WRC_BO_NATIVE 0x00
76 #define WRC_BO_LITTLE 0x01
77 #define WRC_BO_BIG 0x02
79 #define WRC_LOBYTE(w) ((WORD)(w) & 0xff)
80 #define WRC_HIBYTE(w) (((WORD)(w) >> 8) & 0xff)
81 #define WRC_LOWORD(d) ((DWORD)(d) & 0xffff)
82 #define WRC_HIWORD(d) (((DWORD)(d) >> 16) & 0xffff)
83 #define BYTESWAP_WORD(w) ((WORD)(((WORD)WRC_LOBYTE(w) << 8) + (WORD)WRC_HIBYTE(w)))
84 #define BYTESWAP_DWORD(d) ((DWORD)(((DWORD)BYTESWAP_WORD(WRC_LOWORD(d)) << 16) + ((DWORD)BYTESWAP_WORD(WRC_HIWORD(d)))))
86 /* Binary resource structure */
87 #define RES_BLOCKSIZE 512
90 unsigned int allocsize; /* Allocated datablock size */
91 unsigned int size; /* Actual size of data */
92 unsigned int dataidx; /* Tag behind the resource-header */
96 /* Resource strings are slightly more complex because they include '\0' */
97 enum str_e {str_char, str_unicode};
99 typedef struct string {
108 /* Resources are identified either by name or by number */
109 enum name_e {name_str, name_ord};
111 typedef struct name_id {
119 /* Language definitions */
120 typedef struct language {
125 typedef DWORD characts_t;
126 typedef DWORD version_t;
129 language_t *language;
131 characts_t *characts;
134 typedef struct font_id {
142 typedef struct style {
148 /* These are in the same order (and ordinal) as the RT_xxx
149 * defines. This is _required_.
150 * I rolled my own numbers for the win32 extension that are
151 * documented, but generate either old RT_xxx numbers, or
152 * don't have an ordinal associated (user type).
153 * I don't know any specs for those noted such, for that matter,
154 * I don't even know whether they can be generated other than by
155 * using a user-type resource.
171 res_13, /* Hm, wonder why its not used... */
175 res_dlginc, /* Not implemented, no layout available */
177 res_pnp, /* Not implemented, no layout available */
178 res_vxd, /* Not implemented, no layout available */
181 res_html, /* Not implemented, no layout available */
183 res_dlginit = WRC_RT_DLGINIT, /* 240 */
184 res_toolbar = WRC_RT_TOOLBAR, /* 241 */
191 /* Raw bytes in a row... */
192 typedef struct raw_data {
195 lvc_t lvc; /* Localized data */
198 /* Dialog structures */
199 typedef struct control {
200 struct control *next; /* List of controls */
201 struct control *prev;
202 name_id_t *ctlclass; /* ControlClass */
203 name_id_t *title; /* Title of control */
205 int x; /* Position */
207 int width; /* Size */
209 style_t *style; /* Style */
211 DWORD helpid; /* EX: */
212 int gotstyle; /* Used to determine whether the default */
213 int gotexstyle; /* styles must be set */
215 raw_data_t *extra; /* EX: number of extra bytes in resource */
218 typedef struct dialog {
220 int x; /* Position */
222 int width; /* Size */
224 style_t *style; /* Style */
226 int gotstyle; /* Used to determine whether the default */
227 int gotexstyle; /* styles must be set */
236 /* DialogEx structures */
237 typedef struct dialogex {
239 int x; /* Position */
241 int width; /* Size */
243 style_t *style; /* Style */
245 DWORD helpid; /* EX: */
246 int gotstyle; /* Used to determine whether the default */
247 int gotexstyle; /* styles must be set */
257 /* Menu structures */
258 typedef struct menu_item {
259 struct menu_item *next;
260 struct menu_item *prev;
261 struct menu_item *popup;
267 typedef struct menu {
273 /* MenuEx structures */
274 typedef struct menuex_item {
275 struct menuex_item *next;
276 struct menuex_item *prev;
277 struct menuex_item *popup;
289 typedef struct menuex {
292 menuex_item_t *items;
295 typedef struct itemex_opt
310 typedef struct font {
315 typedef struct fontdir {
323 typedef struct icon_header {
324 WORD reserved; /* Don't know, should be 0 I guess */
325 WORD type; /* Always 1 for icons */
326 WORD count; /* Number of packed icons in resource */
329 typedef struct icon_dir_entry {
330 BYTE width; /* From the SDK doc. */
340 typedef struct icon {
344 int id; /* Unique icon id within resource file */
345 int width; /* Field from the IconDirEntry */
353 typedef struct icon_group {
363 typedef struct cursor_header {
364 WORD reserved; /* Don't know, should be 0 I guess */
365 WORD type; /* Always 2 for cursors */
366 WORD count; /* Number of packed cursors in resource */
369 typedef struct cursor_dir_entry {
370 BYTE width; /* From the SDK doc. */
378 } cursor_dir_entry_t;
380 typedef struct cursor {
384 int id; /* Unique icon id within resource file */
385 int width; /* Field from the CursorDirEntry */
395 typedef struct cursor_group {
398 cursor_t *cursorlist;
403 * Animated cursors and icons
405 typedef struct aniheader {
406 DWORD structsize; /* Header size (36 bytes) */
407 DWORD frames; /* Number of unique icons in this cursor */
408 DWORD steps; /* Number of blits before the animation cycles */
409 DWORD cx; /* reserved, must be 0? */
410 DWORD cy; /* reserved, must be 0? */
411 DWORD bitcount; /* reserved, must be 0? */
412 DWORD planes; /* reserved, must be 0? */
413 DWORD rate; /* Default rate (1/60th of a second) if "rate" not present */
414 DWORD flags; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
417 typedef struct riff_tag {
422 typedef struct ani_curico {
427 typedef struct ani_any {
431 cursor_group_t *curg;
439 typedef struct bitmap {
444 typedef struct html {
449 typedef struct rcdata {
463 typedef struct msgtab_block {
464 DWORD idlo; /* Lowest id in the set */
465 DWORD idhi; /* Highest is in the set */
466 DWORD offset; /* Offset from resource start to first entry */
469 typedef struct msgtab_entry {
470 WORD length; /* Length of the data in bytes */
471 WORD flags; /* 0 for char, 1 for WCHAR */
472 /* {char}|{WCHAR} data[...]; */
475 typedef struct messagetable {
480 /* StringTable structures */
481 typedef struct stt_entry {
485 characts_t *characts;
489 typedef struct stringtable {
490 struct stringtable *next;
491 struct stringtable *prev;
496 stt_entry_t *entries;
499 /* VersionInfo structures */
500 enum ver_val_e {val_str, val_words, val_block};
502 struct ver_block; /* Forward ref */
504 typedef struct ver_words {
509 typedef struct ver_value {
510 struct ver_value *next;
511 struct ver_value *prev;
516 struct ver_block *block;
521 typedef struct ver_block {
522 struct ver_block *next;
523 struct ver_block *prev;
528 typedef struct versioninfo {
556 /* Accelerator structures */
557 #define WRC_AF_VIRTKEY 0x0001
558 #define WRC_AF_NOINVERT 0x0002
559 #define WRC_AF_SHIFT 0x0004
560 #define WRC_AF_CONTROL 0x0008
561 #define WRC_AF_ALT 0x0010
562 #define WRC_AF_ASCII 0x4000
564 typedef struct event {
572 typedef struct accelerator {
578 /* Toolbar structures */
579 typedef struct toolbar_item {
580 struct toolbar_item *next;
581 struct toolbar_item *prev;
585 typedef struct toolbar {
591 toolbar_item_t *items;
594 typedef struct dlginit {
600 /* A top-level resource node */
601 typedef struct resource {
602 struct resource *next;
603 struct resource *prev;
605 name_id_t *name; /* resource's name */
606 language_t *lan; /* Only used as a sorting key and c-name creation*/
612 cursor_group_t *curg;
629 void *overlay; /* To catch all types at once... */
631 res_t *binres; /* To binary converted resource */
632 char *c_name; /* BaseName in output */
637 typedef struct res32_count {
642 typedef struct res_count {
644 int count; /* win16 mode */
645 resource_t **rscarray;
647 res32_count_t *rsc32array; /* win32 mode */
652 typedef struct style_pair {