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 #define GET_WORD(ptr) (((unsigned char *)(ptr))[0] | (((unsigned char *)(ptr))[1] << 8))
72 #define GET_DWORD(ptr) (((unsigned char *)(ptr))[0] | (((unsigned char *)(ptr))[1] << 8) | (((unsigned char *)(ptr))[2] << 16) | (((unsigned char *)(ptr))[3] << 24))
81 /* Resource strings are slightly more complex because they include '\0' */
82 enum str_e
{str_char
, str_unicode
};
84 typedef struct string
{
94 /* Resources are identified either by name or by number */
95 enum name_e
{name_str
, name_ord
};
97 typedef struct name_id
{
105 /* Language definitions */
106 typedef struct language
{
111 typedef unsigned int characts_t
;
112 typedef unsigned int version_t
;
115 language_t
*language
;
117 characts_t
*characts
;
120 typedef struct font_id
{
128 typedef struct style
{
129 unsigned int or_mask
;
130 unsigned int and_mask
;
134 /* These are in the same order (and ordinal) as the RT_xxx
135 * defines. This is _required_.
136 * I rolled my own numbers for the win32 extension that are
137 * documented, but generate either old RT_xxx numbers, or
138 * don't have an ordinal associated (user type).
139 * I don't know any specs for those noted such, for that matter,
140 * I don't even know whether they can be generated other than by
141 * using a user-type resource.
157 res_13
, /* Hm, wonder why it's not used... */
161 res_dlginc
, /* Not implemented, no layout available */
163 res_pnp
, /* Not implemented, no layout available */
164 res_vxd
, /* Not implemented, no layout available */
167 res_html
, /* Not implemented, no layout available */
169 res_dlginit
= WRC_RT_DLGINIT
, /* 240 */
170 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
175 /* Raw bytes in a row... */
176 typedef struct raw_data
{
179 lvc_t lvc
; /* Localized data */
182 /* Dialog structures */
183 typedef struct control
{
184 struct control
*next
; /* List of controls */
185 struct control
*prev
;
186 name_id_t
*ctlclass
; /* ControlClass */
187 name_id_t
*title
; /* Title of control */
189 int x
; /* Position */
191 int width
; /* Size */
193 style_t
*style
; /* Style */
195 unsigned int helpid
; /* EX: */
196 int gotstyle
; /* Used to determine whether the default */
197 int gotexstyle
; /* styles must be set */
199 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
202 typedef struct dialog
{
204 int x
; /* Position */
206 int width
; /* Size */
208 style_t
*style
; /* Style */
210 unsigned int helpid
; /* EX: */
211 int gotstyle
; /* Used to determine whether the default */
212 int gotexstyle
; /* styles must be set */
223 /* Menu structures */
224 typedef struct menu_item
{
225 struct menu_item
*next
;
226 struct menu_item
*prev
;
227 struct menu_item
*popup
;
239 typedef struct menu
{
246 typedef struct itemex_opt
261 typedef struct font
{
266 typedef struct fontdir
{
274 typedef struct icon_header
{
275 unsigned short reserved
; /* Don't know, should be 0 I guess */
276 unsigned short type
; /* Always 1 for icons */
277 unsigned short count
; /* Number of packed icons in resource */
280 typedef struct icon_dir_entry
{
281 unsigned char width
; /* From the SDK doc. */
282 unsigned char height
;
284 unsigned char reserved
;
285 unsigned short planes
;
287 unsigned int ressize
;
291 typedef struct icon
{
295 int id
; /* Unique icon id within resource file */
296 int width
; /* Field from the IconDirEntry */
304 typedef struct icon_group
{
314 typedef struct cursor_header
{
315 unsigned short reserved
; /* Don't know, should be 0 I guess */
316 unsigned short type
; /* Always 2 for cursors */
317 unsigned short count
; /* Number of packed cursors in resource */
320 typedef struct cursor_dir_entry
{
321 unsigned char width
; /* From the SDK doc. */
322 unsigned char height
;
324 unsigned char reserved
;
327 unsigned int ressize
;
329 } cursor_dir_entry_t
;
331 typedef struct cursor
{
335 int id
; /* Unique icon id within resource file */
336 int width
; /* Field from the CursorDirEntry */
346 typedef struct cursor_group
{
349 cursor_t
*cursorlist
;
354 * Animated cursors and icons
356 typedef struct aniheader
{
357 unsigned int structsize
; /* Header size (36 bytes) */
358 unsigned int frames
; /* Number of unique icons in this cursor */
359 unsigned int steps
; /* Number of blits before the animation cycles */
360 unsigned int cx
; /* reserved, must be 0? */
361 unsigned int cy
; /* reserved, must be 0? */
362 unsigned int bitcount
; /* reserved, must be 0? */
363 unsigned int planes
; /* reserved, must be 0? */
364 unsigned int rate
; /* Default rate (1/60th of a second) if "rate" not present */
365 unsigned int flags
; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
368 typedef struct riff_tag
{
369 unsigned char tag
[4];
373 typedef struct ani_curico
{
378 typedef struct ani_any
{
382 cursor_group_t
*curg
;
390 typedef struct bitmap
{
395 typedef struct html
{
400 typedef struct rcdata
{
414 typedef struct msgtab_block
{
415 unsigned int idlo
; /* Lowest id in the set */
416 unsigned int idhi
; /* Highest is in the set */
417 unsigned int offset
; /* Offset from resource start to first entry */
420 typedef struct msgtab_entry
{
421 unsigned short length
; /* Length of the data in bytes */
422 unsigned short flags
; /* 0 for char, 1 for WCHAR */
423 /* {char}|{WCHAR} data[...]; */
426 typedef struct messagetable
{
431 /* StringTable structures */
432 typedef struct stt_entry
{
436 characts_t
*characts
;
440 typedef struct stringtable
{
441 struct stringtable
*next
;
442 struct stringtable
*prev
;
447 stt_entry_t
*entries
;
450 /* VersionInfo structures */
451 enum ver_val_e
{val_str
, val_words
, val_block
};
453 struct ver_block
; /* Forward ref */
455 typedef struct ver_words
{
456 unsigned short *words
;
460 typedef struct ver_value
{
461 struct ver_value
*next
;
462 struct ver_value
*prev
;
467 struct ver_block
*block
;
472 typedef struct ver_block
{
473 struct ver_block
*next
;
474 struct ver_block
*prev
;
479 typedef struct versioninfo
{
507 /* Accelerator structures */
508 #define WRC_AF_VIRTKEY 0x0001
509 #define WRC_AF_NOINVERT 0x0002
510 #define WRC_AF_SHIFT 0x0004
511 #define WRC_AF_CONTROL 0x0008
512 #define WRC_AF_ALT 0x0010
513 #define WRC_AF_ASCII 0x4000
515 typedef struct event
{
524 typedef struct accelerator
{
530 /* Toolbar structures */
531 typedef struct toolbar_item
{
532 struct toolbar_item
*next
;
533 struct toolbar_item
*prev
;
537 typedef struct toolbar
{
543 toolbar_item_t
*items
;
546 typedef struct dlginit
{
552 /* A top-level resource node */
553 typedef struct resource
{
554 struct resource
*next
;
555 struct resource
*prev
;
557 name_id_t
*name
; /* resource's name */
558 language_t
*lan
; /* Only used as a sorting key and c-name creation*/
564 cursor_group_t
*curg
;
579 void *overlay
; /* To catch all types at once... */
585 typedef struct res32_count
{
590 typedef struct res_count
{
592 int count
; /* win16 mode */
593 resource_t
**rscarray
;
595 res32_count_t
*rsc32array
; /* win32 mode */
600 typedef struct style_pair
{