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_TOOLBAR (241)
49 /* Default class type IDs */
50 #define CT_BUTTON 0x80
52 #define CT_STATIC 0x82
53 #define CT_LISTBOX 0x83
54 #define CT_SCROLLBAR 0x84
55 #define CT_COMBOBOX 0x85
58 /* Binary resource structure */
59 #define RES_BLOCKSIZE 512
62 int allocsize
; /* Allocated datablock size */
63 int size
; /* Actual size of data */
64 int dataidx
; /* Tag behind the resource-header */
68 /* Resource strings are slightly more complex because they include '\0' */
69 enum str_e
{str_char
, str_unicode
};
71 typedef struct string
{
80 /* Resources are identified either by name or by number */
81 enum name_e
{name_str
, name_ord
};
83 typedef struct name_id
{
91 /* Language definitions */
92 typedef struct language
{
97 typedef DWORD characts_t
;
98 typedef DWORD version_t
;
101 language_t
*language
;
103 characts_t
*characts
;
106 typedef struct font_id
{
114 /* These are in the same order (and ordinal) as the RT_xxx
115 * defines. This is _required_.
116 * I rolled my own numbers for the win32 extension that are
117 * documented, but generate either old RT_xxx numbers, or
118 * don't have an ordinal associated (user type).
119 * I don't know any specs for those noted such, for that matter,
120 * I don't even know whether they can be generated other than by
121 * using a user-type resource.
137 res_13
, /* Hm, wonder why its not used... */
141 res_dlginc
, /* Not implemented, no layout available */
143 res_pnp
, /* Not implemented, no layout available */
144 res_vxd
, /* Not implemented, no layout available */
145 res_anicur
, /* Not implemented, no layout available */
146 res_aniico
, /* Not implemented, no layout available */
148 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
155 /* Raw bytes in a row... */
156 typedef struct raw_data
{
161 /* Dialog structures */
162 typedef struct control
{
163 struct control
*next
; /* List of controls */
164 struct control
*prev
;
165 name_id_t
*ctlclass
; /* ControlClass */
166 string_t
*title
; /* Title of control */
168 int x
; /* Position */
170 int width
; /* Size */
172 DWORD style
; /* Style */
174 DWORD helpid
; /* EX: */
175 int gotstyle
; /* Used to determine whether the default */
176 int gotexstyle
; /* styles must be set */
178 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
181 typedef struct dialog
{
183 int x
; /* Position */
185 int width
; /* Size */
187 DWORD style
; /* Style */
189 int gotstyle
; /* Used to determine whether the default */
190 int gotexstyle
; /* styles must be set */
199 /* DialogEx structures */
200 typedef struct dialogex
{
202 int x
; /* Position */
204 int width
; /* Size */
206 DWORD style
; /* Style */
208 DWORD helpid
; /* EX: */
209 int gotstyle
; /* Used to determine whether the default */
210 int gotexstyle
; /* styles must be set */
220 /* Menu structures */
221 typedef struct menu_item
{
222 struct menu_item
*next
;
223 struct menu_item
*prev
;
224 struct menu_item
*popup
;
230 typedef struct menu
{
236 /* MenuEx structures */
237 typedef struct menuex_item
{
238 struct menuex_item
*next
;
239 struct menuex_item
*prev
;
240 struct menuex_item
*popup
;
252 typedef struct menuex
{
255 menuex_item_t
*items
;
258 typedef struct itemex_opt
270 /* RC structures for types read from file or supplied binary */
271 typedef struct font
{
276 typedef struct icon_dir_entry
{
277 BYTE width
; /* From the SDK doc. */
287 typedef struct icon
{
291 int id
; /* Unique icon id within resource file */
292 int width
; /* Field from the IconDirEntry */
300 typedef struct icon_group
{
307 typedef struct cursor_dir_entry
{
308 BYTE width
; /* From the SDK doc. */
316 } cursor_dir_entry_t
;
318 typedef struct cursor
{
322 int id
; /* Unique icon id within resource file */
323 int width
; /* Field from the CursorDirEntry */
333 typedef struct cursor_group
{
336 cursor_t
*cursorlist
;
340 typedef struct bitmap
{
345 typedef struct rcdata
{
351 typedef struct user
{
357 typedef struct messagetable
{
361 /* StringTable structures */
362 typedef struct stt_entry
{
366 characts_t
*characts
;
370 typedef struct stringtable
{
371 struct stringtable
*next
;
372 struct stringtable
*prev
;
377 stt_entry_t
*entries
;
380 /* VersionInfo structures */
381 enum ver_val_e
{val_str
, val_words
, val_block
};
383 struct ver_block
; /* Forward ref */
385 typedef struct ver_words
{
390 typedef struct ver_value
{
391 struct ver_value
*next
;
392 struct ver_value
*prev
;
397 struct ver_block
*block
;
402 typedef struct ver_block
{
403 struct ver_block
*next
;
404 struct ver_block
*prev
;
409 typedef struct versioninfo
{
435 /* Accelerator structures */
436 #define WRC_AF_VIRTKEY 0x0001
437 #define WRC_AF_NOINVERT 0x0002
438 #define WRC_AF_SHIFT 0x0004
439 #define WRC_AF_CONTROL 0x0008
440 #define WRC_AF_ALT 0x0010
441 #define WRC_AF_ASCII 0x4000
443 typedef struct event
{
451 typedef struct accelerator
{
457 /* Toolbar structures */
458 typedef struct toolbar_item
{
459 struct toolbar_item
*next
;
460 struct toolbar_item
*prev
;
464 typedef struct toolbar
{
470 toolbar_item_t
*items
;
473 /* A top-level resource node */
474 typedef struct resource
{
475 struct resource
*next
;
476 struct resource
*prev
;
478 name_id_t
*name
; /* resource's name */
479 language_t
*lan
; /* Only used as a sorting key and c-name creation*/
484 cursor_group_t
*curg
;
498 void *overlay
; /* To catch all types at once... */
500 res_t
*binres
; /* To binary converted resource */
501 char *c_name
; /* BaseName in output */
506 typedef struct res32_count
{
511 typedef struct res_count
{
513 int count
; /* win16 mode */
514 resource_t
**rscarray
;
516 res32_count_t
*rsc32array
; /* win32 mode */