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)))))
93 /* Binary resource structure */
94 #define RES_BLOCKSIZE 512
97 unsigned int allocsize
; /* Allocated datablock size */
98 unsigned int size
; /* Actual size of data */
99 unsigned int dataidx
; /* Tag behind the resource-header */
103 /* Resource strings are slightly more complex because they include '\0' */
104 enum str_e
{str_char
, str_unicode
};
106 typedef struct string
{
116 /* Resources are identified either by name or by number */
117 enum name_e
{name_str
, name_ord
};
119 typedef struct name_id
{
127 /* Language definitions */
128 typedef struct language
{
133 typedef DWORD characts_t
;
134 typedef DWORD version_t
;
137 language_t
*language
;
139 characts_t
*characts
;
142 typedef struct font_id
{
150 typedef struct style
{
156 /* These are in the same order (and ordinal) as the RT_xxx
157 * defines. This is _required_.
158 * I rolled my own numbers for the win32 extension that are
159 * documented, but generate either old RT_xxx numbers, or
160 * don't have an ordinal associated (user type).
161 * I don't know any specs for those noted such, for that matter,
162 * I don't even know whether they can be generated other than by
163 * using a user-type resource.
179 res_13
, /* Hm, wonder why its not used... */
183 res_dlginc
, /* Not implemented, no layout available */
185 res_pnp
, /* Not implemented, no layout available */
186 res_vxd
, /* Not implemented, no layout available */
189 res_html
, /* Not implemented, no layout available */
191 res_dlginit
= WRC_RT_DLGINIT
, /* 240 */
192 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
197 /* Raw bytes in a row... */
198 typedef struct raw_data
{
201 lvc_t lvc
; /* Localized data */
204 /* Dialog structures */
205 typedef struct control
{
206 struct control
*next
; /* List of controls */
207 struct control
*prev
;
208 name_id_t
*ctlclass
; /* ControlClass */
209 name_id_t
*title
; /* Title of control */
211 int x
; /* Position */
213 int width
; /* Size */
215 style_t
*style
; /* Style */
217 DWORD helpid
; /* EX: */
218 int gotstyle
; /* Used to determine whether the default */
219 int gotexstyle
; /* styles must be set */
221 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
224 typedef struct dialog
{
226 int x
; /* Position */
228 int width
; /* Size */
230 style_t
*style
; /* Style */
232 DWORD helpid
; /* EX: */
233 int gotstyle
; /* Used to determine whether the default */
234 int gotexstyle
; /* styles must be set */
245 /* Menu structures */
246 typedef struct menu_item
{
247 struct menu_item
*next
;
248 struct menu_item
*prev
;
249 struct menu_item
*popup
;
261 typedef struct menu
{
268 typedef struct itemex_opt
283 typedef struct font
{
288 typedef struct fontdir
{
296 typedef struct icon_header
{
297 WORD reserved
; /* Don't know, should be 0 I guess */
298 WORD type
; /* Always 1 for icons */
299 WORD count
; /* Number of packed icons in resource */
302 typedef struct icon_dir_entry
{
303 BYTE width
; /* From the SDK doc. */
313 typedef struct icon
{
317 int id
; /* Unique icon id within resource file */
318 int width
; /* Field from the IconDirEntry */
326 typedef struct icon_group
{
336 typedef struct cursor_header
{
337 WORD reserved
; /* Don't know, should be 0 I guess */
338 WORD type
; /* Always 2 for cursors */
339 WORD count
; /* Number of packed cursors in resource */
342 typedef struct cursor_dir_entry
{
343 BYTE width
; /* From the SDK doc. */
351 } cursor_dir_entry_t
;
353 typedef struct cursor
{
357 int id
; /* Unique icon id within resource file */
358 int width
; /* Field from the CursorDirEntry */
368 typedef struct cursor_group
{
371 cursor_t
*cursorlist
;
376 * Animated cursors and icons
378 typedef struct aniheader
{
379 DWORD structsize
; /* Header size (36 bytes) */
380 DWORD frames
; /* Number of unique icons in this cursor */
381 DWORD steps
; /* Number of blits before the animation cycles */
382 DWORD cx
; /* reserved, must be 0? */
383 DWORD cy
; /* reserved, must be 0? */
384 DWORD bitcount
; /* reserved, must be 0? */
385 DWORD planes
; /* reserved, must be 0? */
386 DWORD rate
; /* Default rate (1/60th of a second) if "rate" not present */
387 DWORD flags
; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
390 typedef struct riff_tag
{
395 typedef struct ani_curico
{
400 typedef struct ani_any
{
404 cursor_group_t
*curg
;
412 typedef struct bitmap
{
417 typedef struct html
{
422 typedef struct rcdata
{
436 typedef struct msgtab_block
{
437 DWORD idlo
; /* Lowest id in the set */
438 DWORD idhi
; /* Highest is in the set */
439 DWORD offset
; /* Offset from resource start to first entry */
442 typedef struct msgtab_entry
{
443 WORD length
; /* Length of the data in bytes */
444 WORD flags
; /* 0 for char, 1 for WCHAR */
445 /* {char}|{WCHAR} data[...]; */
448 typedef struct messagetable
{
453 /* StringTable structures */
454 typedef struct stt_entry
{
458 characts_t
*characts
;
462 typedef struct stringtable
{
463 struct stringtable
*next
;
464 struct stringtable
*prev
;
469 stt_entry_t
*entries
;
472 /* VersionInfo structures */
473 enum ver_val_e
{val_str
, val_words
, val_block
};
475 struct ver_block
; /* Forward ref */
477 typedef struct ver_words
{
482 typedef struct ver_value
{
483 struct ver_value
*next
;
484 struct ver_value
*prev
;
489 struct ver_block
*block
;
494 typedef struct ver_block
{
495 struct ver_block
*next
;
496 struct ver_block
*prev
;
501 typedef struct versioninfo
{
529 /* Accelerator structures */
530 #define WRC_AF_VIRTKEY 0x0001
531 #define WRC_AF_NOINVERT 0x0002
532 #define WRC_AF_SHIFT 0x0004
533 #define WRC_AF_CONTROL 0x0008
534 #define WRC_AF_ALT 0x0010
535 #define WRC_AF_ASCII 0x4000
537 typedef struct event
{
546 typedef struct accelerator
{
552 /* Toolbar structures */
553 typedef struct toolbar_item
{
554 struct toolbar_item
*next
;
555 struct toolbar_item
*prev
;
559 typedef struct toolbar
{
565 toolbar_item_t
*items
;
568 typedef struct dlginit
{
574 /* A top-level resource node */
575 typedef struct resource
{
576 struct resource
*next
;
577 struct resource
*prev
;
579 name_id_t
*name
; /* resource's name */
580 language_t
*lan
; /* Only used as a sorting key and c-name creation*/
586 cursor_group_t
*curg
;
601 void *overlay
; /* To catch all types at once... */
603 res_t
*binres
; /* To binary converted resource */
604 char *c_name
; /* BaseName in output */
609 typedef struct res32_count
{
614 typedef struct res_count
{
616 int count
; /* win16 mode */
617 resource_t
**rscarray
;
619 res32_count_t
*rsc32array
; /* win32 mode */
624 typedef struct style_pair
{