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 typedef unsigned int language_t
;
106 typedef unsigned int characts_t
;
107 typedef unsigned int version_t
;
115 typedef struct font_id
{
123 typedef struct style
{
124 unsigned int or_mask
;
125 unsigned int and_mask
;
129 /* These are in the same order (and ordinal) as the RT_xxx
130 * defines. This is _required_.
131 * I rolled my own numbers for the win32 extension that are
132 * documented, but generate either old RT_xxx numbers, or
133 * don't have an ordinal associated (user type).
134 * I don't know any specs for those noted such, for that matter,
135 * I don't even know whether they can be generated other than by
136 * using a user-type resource.
152 res_13
, /* Hm, wonder why it's not used... */
156 res_dlginc
, /* Not implemented, no layout available */
158 res_pnp
, /* Not implemented, no layout available */
159 res_vxd
, /* Not implemented, no layout available */
162 res_html
, /* Not implemented, no layout available */
164 res_dlginit
= WRC_RT_DLGINIT
, /* 240 */
165 res_toolbar
= WRC_RT_TOOLBAR
, /* 241 */
170 /* Raw bytes in a row... */
171 typedef struct raw_data
{
174 lvc_t lvc
; /* Localized data */
177 /* Dialog structures */
178 typedef struct control
{
179 struct control
*next
; /* List of controls */
180 struct control
*prev
;
181 name_id_t
*ctlclass
; /* ControlClass */
182 name_id_t
*title
; /* Title of control */
184 int x
; /* Position */
186 int width
; /* Size */
188 style_t
*style
; /* Style */
190 unsigned int helpid
; /* EX: */
191 int gotstyle
; /* Used to determine whether the default */
192 int gotexstyle
; /* styles must be set */
194 raw_data_t
*extra
; /* EX: number of extra bytes in resource */
197 typedef struct dialog
{
199 int x
; /* Position */
201 int width
; /* Size */
203 style_t
*style
; /* Style */
205 unsigned int helpid
; /* EX: */
206 int gotstyle
; /* Used to determine whether the default */
207 int gotexstyle
; /* styles must be set */
218 /* Menu structures */
219 typedef struct menu_item
{
220 struct menu_item
*next
;
221 struct menu_item
*prev
;
222 struct menu_item
*popup
;
234 typedef struct menu
{
241 typedef struct itemex_opt
256 typedef struct font
{
261 typedef struct fontdir
{
269 typedef struct icon_header
{
270 unsigned short reserved
; /* Don't know, should be 0 I guess */
271 unsigned short type
; /* Always 1 for icons */
272 unsigned short count
; /* Number of packed icons in resource */
275 typedef struct icon_dir_entry
{
276 unsigned char width
; /* From the SDK doc. */
277 unsigned char height
;
279 unsigned char reserved
;
280 unsigned short planes
;
282 unsigned int ressize
;
286 typedef struct icon
{
290 int id
; /* Unique icon id within resource file */
291 int width
; /* Field from the IconDirEntry */
299 typedef struct icon_group
{
309 typedef struct cursor_header
{
310 unsigned short reserved
; /* Don't know, should be 0 I guess */
311 unsigned short type
; /* Always 2 for cursors */
312 unsigned short count
; /* Number of packed cursors in resource */
315 typedef struct cursor_dir_entry
{
316 unsigned char width
; /* From the SDK doc. */
317 unsigned char height
;
319 unsigned char reserved
;
322 unsigned int ressize
;
324 } cursor_dir_entry_t
;
326 typedef struct cursor
{
330 int id
; /* Unique icon id within resource file */
331 int width
; /* Field from the CursorDirEntry */
341 typedef struct cursor_group
{
344 cursor_t
*cursorlist
;
349 * Animated cursors and icons
351 typedef struct aniheader
{
352 unsigned int structsize
; /* Header size (36 bytes) */
353 unsigned int frames
; /* Number of unique icons in this cursor */
354 unsigned int steps
; /* Number of blits before the animation cycles */
355 unsigned int cx
; /* reserved, must be 0? */
356 unsigned int cy
; /* reserved, must be 0? */
357 unsigned int bitcount
; /* reserved, must be 0? */
358 unsigned int planes
; /* reserved, must be 0? */
359 unsigned int rate
; /* Default rate (1/60th of a second) if "rate" not present */
360 unsigned int flags
; /* Animation flag (1==AF_ICON, although both icons and cursors set this) */
363 typedef struct riff_tag
{
364 unsigned char tag
[4];
368 typedef struct ani_curico
{
373 typedef struct ani_any
{
377 cursor_group_t
*curg
;
385 typedef struct bitmap
{
390 typedef struct html
{
395 typedef struct rcdata
{
409 typedef struct msgtab_block
{
410 unsigned int idlo
; /* Lowest id in the set */
411 unsigned int idhi
; /* Highest is in the set */
412 unsigned int offset
; /* Offset from resource start to first entry */
415 typedef struct msgtab_entry
{
416 unsigned short length
; /* Length of the data in bytes */
417 unsigned short flags
; /* 0 for char, 1 for WCHAR */
418 /* {char}|{WCHAR} data[...]; */
421 typedef struct messagetable
{
426 /* StringTable structures */
427 typedef struct stt_entry
{
435 typedef struct stringtable
{
436 struct stringtable
*next
;
437 struct stringtable
*prev
;
442 stt_entry_t
*entries
;
445 /* VersionInfo structures */
446 enum ver_val_e
{val_str
, val_words
, val_block
};
448 struct ver_block
; /* Forward ref */
450 typedef struct ver_words
{
451 unsigned short *words
;
455 typedef struct ver_value
{
456 struct ver_value
*next
;
457 struct ver_value
*prev
;
462 struct ver_block
*block
;
467 typedef struct ver_block
{
468 struct ver_block
*next
;
469 struct ver_block
*prev
;
474 typedef struct versioninfo
{
502 /* Accelerator structures */
503 #define WRC_AF_VIRTKEY 0x0001
504 #define WRC_AF_NOINVERT 0x0002
505 #define WRC_AF_SHIFT 0x0004
506 #define WRC_AF_CONTROL 0x0008
507 #define WRC_AF_ALT 0x0010
508 #define WRC_AF_ASCII 0x4000
510 typedef struct event
{
519 typedef struct accelerator
{
525 /* Toolbar structures */
526 typedef struct toolbar_item
{
527 struct toolbar_item
*next
;
528 struct toolbar_item
*prev
;
532 typedef struct toolbar
{
538 toolbar_item_t
*items
;
541 typedef struct dlginit
{
547 /* A top-level resource node */
548 typedef struct resource
{
549 struct resource
*next
;
550 struct resource
*prev
;
552 name_id_t
*name
; /* resource's name */
553 language_t lan
; /* Only used as a sorting key and c-name creation*/
559 cursor_group_t
*curg
;
574 void *overlay
; /* To catch all types at once... */
580 typedef struct res32_count
{
585 typedef struct res_count
{
587 int count
; /* win16 mode */
588 resource_t
**rscarray
;
590 res32_count_t
*rsc32array
; /* win32 mode */
595 typedef struct style_pair
{