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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WRC_WRCTYPES_H
22 #define __WRC_WRCTYPES_H
30 #ifndef VS_FFI_SIGNATURE
34 /* Memory/load flags */
35 #define WRC_MO_MOVEABLE 0x0010
36 #define WRC_MO_PURE 0x0020
37 #define WRC_MO_PRELOAD 0x0040
38 #define WRC_MO_DISCARDABLE 0x1000
40 /* Resource type IDs */
41 #define WRC_RT_CURSOR (1)
42 #define WRC_RT_BITMAP (2)
43 #define WRC_RT_ICON (3)
44 #define WRC_RT_MENU (4)
45 #define WRC_RT_DIALOG (5)
46 #define WRC_RT_STRING (6)
47 #define WRC_RT_FONTDIR (7)
48 #define WRC_RT_FONT (8)
49 #define WRC_RT_ACCELERATOR (9)
50 #define WRC_RT_RCDATA (10)
51 #define WRC_RT_MESSAGETABLE (11)
52 #define WRC_RT_GROUP_CURSOR (12)
53 #define WRC_RT_GROUP_ICON (14)
54 #define WRC_RT_VERSION (16)
55 #define WRC_RT_DLGINCLUDE (17)
56 #define WRC_RT_PLUGPLAY (19)
57 #define WRC_RT_VXD (20)
58 #define WRC_RT_ANICURSOR (21)
59 #define WRC_RT_ANIICON (22)
60 #define WRC_RT_HTML (23)
61 #define WRC_RT_DLGINIT (240)
62 #define WRC_RT_TOOLBAR (241)
64 /* Default class type IDs */
65 #define CT_BUTTON 0x80
67 #define CT_STATIC 0x82
68 #define CT_LISTBOX 0x83
69 #define CT_SCROLLBAR 0x84
70 #define CT_COMBOBOX 0x85
72 /* Byteordering defines */
73 #define WRC_BO_NATIVE 0x00
74 #define WRC_BO_LITTLE 0x01
75 #define WRC_BO_BIG 0x02
77 #define WRC_LOBYTE(w) ((WORD)(w) & 0xff)
78 #define WRC_HIBYTE(w) (((WORD)(w) >> 8) & 0xff)
79 #define WRC_LOWORD(d) ((DWORD)(d) & 0xffff)
80 #define WRC_HIWORD(d) (((DWORD)(d) >> 16) & 0xffff)
81 #define BYTESWAP_WORD(w) ((WORD)(((WORD)WRC_LOBYTE(w) << 8) + (WORD)WRC_HIBYTE(w)))
82 #define BYTESWAP_DWORD(d) ((DWORD)(((DWORD)BYTESWAP_WORD(WRC_LOWORD(d)) << 16) + ((DWORD)BYTESWAP_WORD(WRC_HIWORD(d)))))
84 /* Binary resource structure */
85 #define RES_BLOCKSIZE 512
88 int allocsize
; /* Allocated datablock size */
89 int size
; /* Actual size of data */
90 int dataidx
; /* Tag behind the resource-header */
94 /* Resource strings are slightly more complex because they include '\0' */
95 enum str_e
{str_char
, str_unicode
};
97 typedef struct string
{
106 /* Resources are identified either by name or by number */
107 enum name_e
{name_str
, name_ord
};
109 typedef struct name_id
{
117 /* Language definitions */
118 typedef struct language
{
123 typedef DWORD characts_t
;
124 typedef DWORD version_t
;
127 language_t
*language
;
129 characts_t
*characts
;
132 typedef struct font_id
{
140 typedef struct style
{
146 /* These are in the same order (and ordinal) as the RT_xxx
147 * defines. This is _required_.
148 * I rolled my own numbers for the win32 extension that are
149 * documented, but generate either old RT_xxx numbers, or
150 * don't have an ordinal associated (user type).
151 * I don't know any specs for those noted such, for that matter,
152 * I don't even know whether they can be generated other than by
153 * using a user-type resource.
169 res_13
, /* Hm, wonder why its not used... */
173 res_dlginc
, /* Not implemented, no layout available */
175 res_pnp
, /* Not implemented, no layout available */
176 res_vxd
, /* Not implemented, no layout available */
179 res_html
, /* Not implemented, no layout available */
181 res_dlginit
= WRC_RT_DLGINIT
, /* 240 */
182 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
189 /* Raw bytes in a row... */
190 typedef struct raw_data
{
193 lvc_t lvc
; /* Localized data */
196 /* Dialog structures */
197 typedef struct control
{
198 struct control
*next
; /* List of controls */
199 struct control
*prev
;
200 name_id_t
*ctlclass
; /* ControlClass */
201 name_id_t
*title
; /* Title of control */
203 int x
; /* Position */
205 int width
; /* Size */
207 style_t
*style
; /* Style */
209 DWORD helpid
; /* EX: */
210 int gotstyle
; /* Used to determine whether the default */
211 int gotexstyle
; /* styles must be set */
213 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
216 typedef struct dialog
{
218 int x
; /* Position */
220 int width
; /* Size */
222 style_t
*style
; /* Style */
224 int gotstyle
; /* Used to determine whether the default */
225 int gotexstyle
; /* styles must be set */
234 /* DialogEx structures */
235 typedef struct dialogex
{
237 int x
; /* Position */
239 int width
; /* Size */
241 style_t
*style
; /* Style */
243 DWORD helpid
; /* EX: */
244 int gotstyle
; /* Used to determine whether the default */
245 int gotexstyle
; /* styles must be set */
255 /* Menu structures */
256 typedef struct menu_item
{
257 struct menu_item
*next
;
258 struct menu_item
*prev
;
259 struct menu_item
*popup
;
265 typedef struct menu
{
271 /* MenuEx structures */
272 typedef struct menuex_item
{
273 struct menuex_item
*next
;
274 struct menuex_item
*prev
;
275 struct menuex_item
*popup
;
287 typedef struct menuex
{
290 menuex_item_t
*items
;
293 typedef struct itemex_opt
308 typedef struct font
{
313 typedef struct fontdir
{
321 typedef struct icon_header
{
322 WORD reserved
; /* Don't know, should be 0 I guess */
323 WORD type
; /* Always 1 for icons */
324 WORD count
; /* Number of packed icons in resource */
327 typedef struct icon_dir_entry
{
328 BYTE width
; /* From the SDK doc. */
338 typedef struct icon
{
342 int id
; /* Unique icon id within resource file */
343 int width
; /* Field from the IconDirEntry */
351 typedef struct icon_group
{
361 typedef struct cursor_header
{
362 WORD reserved
; /* Don't know, should be 0 I guess */
363 WORD type
; /* Always 2 for cursors */
364 WORD count
; /* Number of packed cursors in resource */
367 typedef struct cursor_dir_entry
{
368 BYTE width
; /* From the SDK doc. */
376 } cursor_dir_entry_t
;
378 typedef struct cursor
{
382 int id
; /* Unique icon id within resource file */
383 int width
; /* Field from the CursorDirEntry */
393 typedef struct cursor_group
{
396 cursor_t
*cursorlist
;
401 * Animated cursors and icons
403 typedef struct aniheader
{
404 DWORD structsize
; /* Header size (36 bytes) */
405 DWORD frames
; /* Number of unique icons in this cursor */
406 DWORD steps
; /* Number of blits before the animation cycles */
407 DWORD cx
; /* reserved, must be 0? */
408 DWORD cy
; /* reserved, must be 0? */
409 DWORD bitcount
; /* reserved, must be 0? */
410 DWORD planes
; /* reserved, must be 0? */
411 DWORD rate
; /* Default rate (1/60th of a second) if "rate" not present */
412 DWORD flags
; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
415 typedef struct riff_tag
{
420 typedef struct ani_curico
{
425 typedef struct ani_any
{
429 cursor_group_t
*curg
;
437 typedef struct bitmap
{
442 typedef struct rcdata
{
456 typedef struct msgtab_block
{
457 DWORD idlo
; /* Lowest id in the set */
458 DWORD idhi
; /* Highest is in the set */
459 DWORD offset
; /* Offset from resource start to first entry */
462 typedef struct msgtab_entry
{
463 WORD length
; /* Length of the data in bytes */
464 WORD flags
; /* 0 for char, 1 for WCHAR */
465 /* {char}|{WCHAR} data[...]; */
468 typedef struct messagetable
{
473 /* StringTable structures */
474 typedef struct stt_entry
{
478 characts_t
*characts
;
482 typedef struct stringtable
{
483 struct stringtable
*next
;
484 struct stringtable
*prev
;
489 stt_entry_t
*entries
;
492 /* VersionInfo structures */
493 enum ver_val_e
{val_str
, val_words
, val_block
};
495 struct ver_block
; /* Forward ref */
497 typedef struct ver_words
{
502 typedef struct ver_value
{
503 struct ver_value
*next
;
504 struct ver_value
*prev
;
509 struct ver_block
*block
;
514 typedef struct ver_block
{
515 struct ver_block
*next
;
516 struct ver_block
*prev
;
521 typedef struct versioninfo
{
549 /* Accelerator structures */
550 #define WRC_AF_VIRTKEY 0x0001
551 #define WRC_AF_NOINVERT 0x0002
552 #define WRC_AF_SHIFT 0x0004
553 #define WRC_AF_CONTROL 0x0008
554 #define WRC_AF_ALT 0x0010
555 #define WRC_AF_ASCII 0x4000
557 typedef struct event
{
565 typedef struct accelerator
{
571 /* Toolbar structures */
572 typedef struct toolbar_item
{
573 struct toolbar_item
*next
;
574 struct toolbar_item
*prev
;
578 typedef struct toolbar
{
584 toolbar_item_t
*items
;
587 typedef struct dlginit
{
593 /* A top-level resource node */
594 typedef struct resource
{
595 struct resource
*next
;
596 struct resource
*prev
;
598 name_id_t
*name
; /* resource's name */
599 language_t
*lan
; /* Only used as a sorting key and c-name creation*/
605 cursor_group_t
*curg
;
621 void *overlay
; /* To catch all types at once... */
623 res_t
*binres
; /* To binary converted resource */
624 char *c_name
; /* BaseName in output */
629 typedef struct res32_count
{
634 typedef struct res_count
{
636 int count
; /* win16 mode */
637 resource_t
**rscarray
;
639 res32_count_t
*rsc32array
; /* win32 mode */
644 typedef struct style_pair
{