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
25 #include "wrcrostypes.h"
27 /* Memory/load flags */
28 #define WRC_MO_MOVEABLE 0x0010
29 #define WRC_MO_PURE 0x0020
30 #define WRC_MO_PRELOAD 0x0040
31 #define WRC_MO_DISCARDABLE 0x1000
33 /* Resource type IDs */
34 #define WRC_RT_CURSOR (1)
35 #define WRC_RT_BITMAP (2)
36 #define WRC_RT_ICON (3)
37 #define WRC_RT_MENU (4)
38 #define WRC_RT_DIALOG (5)
39 #define WRC_RT_STRING (6)
40 #define WRC_RT_FONTDIR (7)
41 #define WRC_RT_FONT (8)
42 #define WRC_RT_ACCELERATOR (9)
43 #define WRC_RT_RCDATA (10)
44 #define WRC_RT_MESSAGETABLE (11)
45 #define WRC_RT_GROUP_CURSOR (12)
46 #define WRC_RT_GROUP_ICON (14)
47 #define WRC_RT_VERSION (16)
48 #define WRC_RT_DLGINCLUDE (17)
49 #define WRC_RT_PLUGPLAY (19)
50 #define WRC_RT_VXD (20)
51 #define WRC_RT_ANICURSOR (21)
52 #define WRC_RT_ANIICON (22)
53 #define WRC_RT_HTML (23)
54 #define WRC_RT_DLGINIT (240)
55 #define WRC_RT_TOOLBAR (241)
57 /* Default class type IDs */
58 #define CT_BUTTON 0x80
60 #define CT_STATIC 0x82
61 #define CT_LISTBOX 0x83
62 #define CT_SCROLLBAR 0x84
63 #define CT_COMBOBOX 0x85
65 /* Byteordering defines */
66 #define WRC_BO_NATIVE 0x00
67 #define WRC_BO_LITTLE 0x01
68 #define WRC_BO_BIG 0x02
70 #define WRC_LOBYTE(w) ((WORD)(w) & 0xff)
71 #define WRC_HIBYTE(w) (((WORD)(w) >> 8) & 0xff)
72 #define WRC_LOWORD(d) ((DWORD)(d) & 0xffff)
73 #define WRC_HIWORD(d) (((DWORD)(d) >> 16) & 0xffff)
74 #define BYTESWAP_WORD(w) ((WORD)(((WORD)WRC_LOBYTE(w) << 8) + (WORD)WRC_HIBYTE(w)))
75 #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 unsigned int allocsize
; /* Allocated datablock size */
89 unsigned int size
; /* Actual size of data */
90 unsigned 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
{
107 /* Resources are identified either by name or by number */
108 enum name_e
{name_str
, name_ord
};
110 typedef struct name_id
{
118 /* Language definitions */
119 typedef struct language
{
124 typedef DWORD characts_t
;
125 typedef DWORD version_t
;
128 language_t
*language
;
130 characts_t
*characts
;
133 typedef struct font_id
{
141 typedef struct style
{
147 /* These are in the same order (and ordinal) as the RT_xxx
148 * defines. This is _required_.
149 * I rolled my own numbers for the win32 extension that are
150 * documented, but generate either old RT_xxx numbers, or
151 * don't have an ordinal associated (user type).
152 * I don't know any specs for those noted such, for that matter,
153 * I don't even know whether they can be generated other than by
154 * using a user-type resource.
170 res_13
, /* Hm, wonder why its not used... */
174 res_dlginc
, /* Not implemented, no layout available */
176 res_pnp
, /* Not implemented, no layout available */
177 res_vxd
, /* Not implemented, no layout available */
180 res_html
, /* Not implemented, no layout available */
182 res_dlginit
= WRC_RT_DLGINIT
, /* 240 */
183 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
188 /* Raw bytes in a row... */
189 typedef struct raw_data
{
192 lvc_t lvc
; /* Localized data */
195 /* Dialog structures */
196 typedef struct control
{
197 struct control
*next
; /* List of controls */
198 struct control
*prev
;
199 name_id_t
*ctlclass
; /* ControlClass */
200 name_id_t
*title
; /* Title of control */
202 int x
; /* Position */
204 int width
; /* Size */
206 style_t
*style
; /* Style */
208 DWORD helpid
; /* EX: */
209 int gotstyle
; /* Used to determine whether the default */
210 int gotexstyle
; /* styles must be set */
212 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
215 typedef struct dialog
{
217 int x
; /* Position */
219 int width
; /* Size */
221 style_t
*style
; /* Style */
223 DWORD helpid
; /* EX: */
224 int gotstyle
; /* Used to determine whether the default */
225 int gotexstyle
; /* styles must be set */
236 /* Menu structures */
237 typedef struct menu_item
{
238 struct menu_item
*next
;
239 struct menu_item
*prev
;
240 struct menu_item
*popup
;
252 typedef struct menu
{
259 typedef struct itemex_opt
274 typedef struct font
{
279 typedef struct fontdir
{
287 typedef struct icon_header
{
288 WORD reserved
; /* Don't know, should be 0 I guess */
289 WORD type
; /* Always 1 for icons */
290 WORD count
; /* Number of packed icons in resource */
293 typedef struct icon_dir_entry
{
294 BYTE width
; /* From the SDK doc. */
304 typedef struct icon
{
308 int id
; /* Unique icon id within resource file */
309 int width
; /* Field from the IconDirEntry */
317 typedef struct icon_group
{
327 typedef struct cursor_header
{
328 WORD reserved
; /* Don't know, should be 0 I guess */
329 WORD type
; /* Always 2 for cursors */
330 WORD count
; /* Number of packed cursors in resource */
333 typedef struct cursor_dir_entry
{
334 BYTE width
; /* From the SDK doc. */
342 } cursor_dir_entry_t
;
344 typedef struct cursor
{
348 int id
; /* Unique icon id within resource file */
349 int width
; /* Field from the CursorDirEntry */
359 typedef struct cursor_group
{
362 cursor_t
*cursorlist
;
367 * Animated cursors and icons
369 typedef struct aniheader
{
370 DWORD structsize
; /* Header size (36 bytes) */
371 DWORD frames
; /* Number of unique icons in this cursor */
372 DWORD steps
; /* Number of blits before the animation cycles */
373 DWORD cx
; /* reserved, must be 0? */
374 DWORD cy
; /* reserved, must be 0? */
375 DWORD bitcount
; /* reserved, must be 0? */
376 DWORD planes
; /* reserved, must be 0? */
377 DWORD rate
; /* Default rate (1/60th of a second) if "rate" not present */
378 DWORD flags
; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
381 typedef struct riff_tag
{
386 typedef struct ani_curico
{
391 typedef struct ani_any
{
395 cursor_group_t
*curg
;
403 typedef struct bitmap
{
408 typedef struct html
{
413 typedef struct rcdata
{
427 typedef struct msgtab_block
{
428 DWORD idlo
; /* Lowest id in the set */
429 DWORD idhi
; /* Highest is in the set */
430 DWORD offset
; /* Offset from resource start to first entry */
433 typedef struct msgtab_entry
{
434 WORD length
; /* Length of the data in bytes */
435 WORD flags
; /* 0 for char, 1 for WCHAR */
436 /* {char}|{WCHAR} data[...]; */
439 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
;
591 void *overlay
; /* To catch all types at once... */
593 res_t
*binres
; /* To binary converted resource */
594 char *c_name
; /* BaseName in output */
599 typedef struct res32_count
{
604 typedef struct res_count
{
606 int count
; /* win16 mode */
607 resource_t
**rscarray
;
609 res32_count_t
*rsc32array
; /* win32 mode */
614 typedef struct style_pair
{