source: trunk/src/kernel32/winres.h@ 91

Last change on this file since 91 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 3.1 KB
Line 
1/*
2 *
3 * Project Odin Software License can be found in LICENSE.TXT
4 *
5 */
6/*
7 * Win32 resource class
8 *
9 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
10 *
11 */
12#ifndef __WINRES_H__
13#define __WINRES_H__
14
15#ifdef INCL_WINRES
16
17 typedef struct tagWINBITMAPINFOHEADER{
18 DWORD biSize;
19 LONG biWidth;
20 LONG biHeight;
21 WORD biPlanes;
22 WORD biBitCount;
23 DWORD biCompression;
24 DWORD biSizeImage;
25 LONG biXPelsPerMeter;
26 LONG biYPelsPerMeter;
27 DWORD biClrUsed;
28 DWORD biClrImportant;
29 } WINBITMAPINFOHEADER;
30
31 typedef struct
32 {
33 BYTE blue;
34 BYTE green;
35 BYTE red;
36 BYTE res;
37 } RGBQUAD;
38
39 /*
40 * Defines for the fVirt field of the Accelerator table structure.
41 */
42 #define FVIRTKEY TRUE /* Assumed to be == TRUE */
43 #define FNOINVERT 0x02
44 #define FSHIFT 0x04
45 #define FCONTROL 0x08
46 #define FALT 0x10
47
48 //TODO: Aligned at 8 byte boundary or not??
49 #pragma pack(1)
50 typedef struct tagWINACCEL {
51 BYTE fVirt; /* Also called the flags field */
52 WORD key;
53 WORD cmd;
54 BYTE align[3];
55 } WINACCEL, *LPWINACCEL;
56 #pragma pack()
57
58#endif
59
60#ifdef __cplusplus
61class Win32Image;
62
63class Win32Resource
64{
65public:
66 // Constructors and destructors
67 Win32Resource(Win32Image *module, HRSRC hRes, ULONG id, ULONG type);
68 Win32Resource(Win32Image *module, ULONG id, ULONG type,
69 ULONG size, char *resdata);
70 ~Win32Resource();
71
72 PVOID lockResource();
73 ULONG sizeofResource() { return ressize; };
74
75 static void destroyAll(Win32Image *module);
76
77protected:
78
79private:
80 Win32Image *module;
81
82 HRSRC hres;
83 ULONG type;
84 ULONG id;
85
86 PVOID os2resdata;
87 PVOID winresdata;
88
89 PVOID ConvertBitmap(void *bmpdata);
90
91 ULONG ressize;
92
93 // Linked list management
94 Win32Resource* next; // Next Resource in module
95
96 friend class Win32Image;
97};
98
99#endif // __cplusplus
100
101 #define NTRT_NEWRESOURCE 0x2000
102 #define NTRT_ERROR 0x7fff
103 #define NTRT_CURSOR 1
104 #define NTRT_BITMAP 2
105 #define NTRT_ICON 3
106 #define NTRT_MENU 4
107 #define NTRT_DIALOG 5
108 #define NTRT_STRING 6
109 #define NTRT_FONTDIR 7
110 #define NTRT_FONT 8
111 #define NTRT_ACCELERATORS 9
112 #define NTRT_RCDATA 10
113 #define NTRT_MESSAGETABLE 11
114 #define NTRT_GROUP_CURSOR 12
115 #define NTRT_GROUP_ICON 14
116 #define NTRT_VERSION 16
117 #define NTRT_NEWBITMAP (NTRT_BITMAP|NTRT_NEWRESOURCE)
118 #define NTRT_NEWMENU (NTRT_MENU|NTRT_NEWRESOURCE)
119 #define NTRT_NEWDIALOG (NTRT_DIALOG|NTRT_NEWRESOURCE)
120
121
122#endif
Note: See TracBrowser for help on using the repository browser.