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