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
29 #ifndef VS_FFI_SIGNATURE
33 /* Memory/load flags */
34 #define WRC_MO_MOVEABLE 0x0010
35 #define WRC_MO_PURE 0x0020
36 #define WRC_MO_PRELOAD 0x0040
37 #define WRC_MO_DISCARDABLE 0x1000
39 /* Resource type IDs */
40 #define WRC_RT_CURSOR (1)
41 #define WRC_RT_BITMAP (2)
42 #define WRC_RT_ICON (3)
43 #define WRC_RT_MENU (4)
44 #define WRC_RT_DIALOG (5)
45 #define WRC_RT_STRING (6)
46 #define WRC_RT_FONTDIR (7)
47 #define WRC_RT_FONT (8)
48 #define WRC_RT_ACCELERATOR (9)
49 #define WRC_RT_RCDATA (10)
50 #define WRC_RT_MESSAGETABLE (11)
51 #define WRC_RT_GROUP_CURSOR (12)
52 #define WRC_RT_GROUP_ICON (14)
53 #define WRC_RT_VERSION (16)
54 #define WRC_RT_DLGINCLUDE (17)
55 #define WRC_RT_PLUGPLAY (19)
56 #define WRC_RT_VXD (20)
57 #define WRC_RT_ANICURSOR (21)
58 #define WRC_RT_ANIICON (22)
59 #define WRC_RT_HTML (23)
60 #define WRC_RT_DLGINIT (240)
61 #define WRC_RT_TOOLBAR (241)
63 /* Default class type IDs */
64 #define CT_BUTTON 0x80
66 #define CT_STATIC 0x82
67 #define CT_LISTBOX 0x83
68 #define CT_SCROLLBAR 0x84
69 #define CT_COMBOBOX 0x85
71 /* Byteordering defines */
72 #define WRC_BO_NATIVE 0x00
73 #define WRC_BO_LITTLE 0x01
74 #define WRC_BO_BIG 0x02
76 #define WRC_LOBYTE(w) ((WORD)(w) & 0xff)
77 #define WRC_HIBYTE(w) (((WORD)(w) >> 8) & 0xff)
78 #define WRC_LOWORD(d) ((DWORD)(d) & 0xffff)
79 #define WRC_HIWORD(d) (((DWORD)(d) >> 16) & 0xffff)
80 #define BYTESWAP_WORD(w) ((WORD)(((WORD)WRC_LOBYTE(w) << 8) + (WORD)WRC_HIBYTE(w)))
81 #define BYTESWAP_DWORD(d) ((DWORD)(((DWORD)BYTESWAP_WORD(WRC_LOWORD(d)) << 16) + ((DWORD)BYTESWAP_WORD(WRC_HIWORD(d)))))
90 /* Binary resource structure */
91 #define RES_BLOCKSIZE 512
94 unsigned int allocsize
; /* Allocated datablock size */
95 unsigned int size
; /* Actual size of data */
96 unsigned int dataidx
; /* Tag behind the resource-header */
100 /* Resource strings are slightly more complex because they include '\0' */
101 enum str_e
{str_char
, str_unicode
};
103 typedef struct string
{
113 /* Resources are identified either by name or by number */
114 enum name_e
{name_str
, name_ord
};
116 typedef struct name_id
{
124 /* Language definitions */
125 typedef struct language
{
130 typedef DWORD characts_t
;
131 typedef DWORD version_t
;
134 language_t
*language
;
136 characts_t
*characts
;
139 typedef struct font_id
{
147 typedef struct style
{
153 /* These are in the same order (and ordinal) as the RT_xxx
154 * defines. This is _required_.
155 * I rolled my own numbers for the win32 extension that are
156 * documented, but generate either old RT_xxx numbers, or
157 * don't have an ordinal associated (user type).
158 * I don't know any specs for those noted such, for that matter,
159 * I don't even know whether they can be generated other than by
160 * using a user-type resource.
176 res_13
, /* Hm, wonder why it's not used... */
180 res_dlginc
, /* Not implemented, no layout available */
182 res_pnp
, /* Not implemented, no layout available */
183 res_vxd
, /* Not implemented, no layout available */
186 res_html
, /* Not implemented, no layout available */
188 res_dlginit
= WRC_RT_DLGINIT
, /* 240 */
189 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
194 /* Raw bytes in a row... */
195 typedef struct raw_data
{
198 lvc_t lvc
; /* Localized data */
201 /* Dialog structures */
202 typedef struct control
{
203 struct control
*next
; /* List of controls */
204 struct control
*prev
;
205 name_id_t
*ctlclass
; /* ControlClass */
206 name_id_t
*title
; /* Title of control */
208 int x
; /* Position */
210 int width
; /* Size */
212 style_t
*style
; /* Style */
214 DWORD helpid
; /* EX: */
215 int gotstyle
; /* Used to determine whether the default */
216 int gotexstyle
; /* styles must be set */
218 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
221 typedef struct dialog
{
223 int x
; /* Position */
225 int width
; /* Size */
227 style_t
*style
; /* Style */
229 DWORD helpid
; /* EX: */
230 int gotstyle
; /* Used to determine whether the default */
231 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
;
258 typedef struct menu
{
265 typedef struct itemex_opt
280 typedef struct font
{
285 typedef struct fontdir
{
293 typedef struct icon_header
{
294 WORD reserved
; /* Don't know, should be 0 I guess */
295 WORD type
; /* Always 1 for icons */
296 WORD count
; /* Number of packed icons in resource */
299 typedef struct icon_dir_entry
{
300 BYTE width
; /* From the SDK doc. */
310 typedef struct icon
{
314 int id
; /* Unique icon id within resource file */
315 int width
; /* Field from the IconDirEntry */
323 typedef struct icon_group
{
333 typedef struct cursor_header
{
334 WORD reserved
; /* Don't know, should be 0 I guess */
335 WORD type
; /* Always 2 for cursors */
336 WORD count
; /* Number of packed cursors in resource */
339 typedef struct cursor_dir_entry
{
340 BYTE width
; /* From the SDK doc. */
348 } cursor_dir_entry_t
;
350 typedef struct cursor
{
354 int id
; /* Unique icon id within resource file */
355 int width
; /* Field from the CursorDirEntry */
365 typedef struct cursor_group
{
368 cursor_t
*cursorlist
;
373 * Animated cursors and icons
375 typedef struct aniheader
{
376 DWORD structsize
; /* Header size (36 bytes) */
377 DWORD frames
; /* Number of unique icons in this cursor */
378 DWORD steps
; /* Number of blits before the animation cycles */
379 DWORD cx
; /* reserved, must be 0? */
380 DWORD cy
; /* reserved, must be 0? */
381 DWORD bitcount
; /* reserved, must be 0? */
382 DWORD planes
; /* reserved, must be 0? */
383 DWORD rate
; /* Default rate (1/60th of a second) if "rate" not present */
384 DWORD flags
; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
387 typedef struct riff_tag
{
392 typedef struct ani_curico
{
397 typedef struct ani_any
{
401 cursor_group_t
*curg
;
409 typedef struct bitmap
{
414 typedef struct html
{
419 typedef struct rcdata
{
433 typedef struct msgtab_block
{
434 DWORD idlo
; /* Lowest id in the set */
435 DWORD idhi
; /* Highest is in the set */
436 DWORD offset
; /* Offset from resource start to first entry */
439 typedef struct msgtab_entry
{
440 WORD length
; /* Length of the data in bytes */
441 WORD flags
; /* 0 for char, 1 for WCHAR */
442 /* {char}|{WCHAR} data[...]; */
445 typedef struct messagetable
{
450 /* StringTable structures */
451 typedef struct stt_entry
{
455 characts_t
*characts
;
459 typedef struct stringtable
{
460 struct stringtable
*next
;
461 struct stringtable
*prev
;
466 stt_entry_t
*entries
;
469 /* VersionInfo structures */
470 enum ver_val_e
{val_str
, val_words
, val_block
};
472 struct ver_block
; /* Forward ref */
474 typedef struct ver_words
{
479 typedef struct ver_value
{
480 struct ver_value
*next
;
481 struct ver_value
*prev
;
486 struct ver_block
*block
;
491 typedef struct ver_block
{
492 struct ver_block
*next
;
493 struct ver_block
*prev
;
498 typedef struct versioninfo
{
526 /* Accelerator structures */
527 #define WRC_AF_VIRTKEY 0x0001
528 #define WRC_AF_NOINVERT 0x0002
529 #define WRC_AF_SHIFT 0x0004
530 #define WRC_AF_CONTROL 0x0008
531 #define WRC_AF_ALT 0x0010
532 #define WRC_AF_ASCII 0x4000
534 typedef struct event
{
543 typedef struct accelerator
{
549 /* Toolbar structures */
550 typedef struct toolbar_item
{
551 struct toolbar_item
*next
;
552 struct toolbar_item
*prev
;
556 typedef struct toolbar
{
562 toolbar_item_t
*items
;
565 typedef struct dlginit
{
571 /* A top-level resource node */
572 typedef struct resource
{
573 struct resource
*next
;
574 struct resource
*prev
;
576 name_id_t
*name
; /* resource's name */
577 language_t
*lan
; /* Only used as a sorting key and c-name creation*/
583 cursor_group_t
*curg
;
598 void *overlay
; /* To catch all types at once... */
600 res_t
*binres
; /* To binary converted resource */
601 char *c_name
; /* BaseName in output */
606 typedef struct res32_count
{
611 typedef struct res_count
{
613 int count
; /* win16 mode */
614 resource_t
**rscarray
;
616 res32_count_t
*rsc32array
; /* win32 mode */
621 typedef struct style_pair
{