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
{
440 typedef struct messagetable
{
444 /* StringTable structures */
445 typedef struct stt_entry
{
449 characts_t
*characts
;
453 typedef struct stringtable
{
454 struct stringtable
*next
;
455 struct stringtable
*prev
;
460 stt_entry_t
*entries
;
463 /* VersionInfo structures */
464 enum ver_val_e
{val_str
, val_words
, val_block
};
466 struct ver_block
; /* Forward ref */
468 typedef struct ver_words
{
473 typedef struct ver_value
{
474 struct ver_value
*next
;
475 struct ver_value
*prev
;
480 struct ver_block
*block
;
485 typedef struct ver_block
{
486 struct ver_block
*next
;
487 struct ver_block
*prev
;
492 typedef struct versioninfo
{
520 /* Accelerator structures */
521 #define WRC_AF_VIRTKEY 0x0001
522 #define WRC_AF_NOINVERT 0x0002
523 #define WRC_AF_SHIFT 0x0004
524 #define WRC_AF_CONTROL 0x0008
525 #define WRC_AF_ALT 0x0010
526 #define WRC_AF_ASCII 0x4000
528 typedef struct event
{
536 typedef struct accelerator
{
542 /* Toolbar structures */
543 typedef struct toolbar_item
{
544 struct toolbar_item
*next
;
545 struct toolbar_item
*prev
;
549 typedef struct toolbar
{
555 toolbar_item_t
*items
;
558 typedef struct dlginit
{
564 /* A top-level resource node */
565 typedef struct resource
{
566 struct resource
*next
;
567 struct resource
*prev
;
569 name_id_t
*name
; /* resource's name */
570 language_t
*lan
; /* Only used as a sorting key and c-name creation*/
576 cursor_group_t
*curg
;
592 void *overlay
; /* To catch all types at once... */
594 res_t
*binres
; /* To binary converted resource */
595 char *c_name
; /* BaseName in output */
600 typedef struct res32_count
{
605 typedef struct res_count
{
607 int count
; /* win16 mode */
608 resource_t
**rscarray
;
610 res32_count_t
*rsc32array
; /* win32 mode */
615 typedef struct style_pair
{