source: trunk/include/winres.h@ 341

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

* empty log message *

File size: 3.3 KB
RevLine 
[341]1/* $Id: winres.h,v 1.2 1999-07-20 07:41:23 sandervl Exp $ */
[337]2
3/*
4 * Win32 resource class
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
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);
[341]70 virtual ~Win32Resource();
[337]71
72 virtual PVOID lockResource(); //get original win32 resource
73 virtual PVOID lockOS2Resource(); //get converted OS/2 resource
74
75 ULONG sizeofResource() { return ressize; };
76
77 static void destroyAll(Win32Image *module);
78
79protected:
80
81private:
82 Win32Image *module;
83
84 HRSRC hres;
85 ULONG type;
86 ULONG orgos2type;
87 ULONG id;
88
89 PVOID os2resdata;
90 PVOID winresdata;
91
92 PVOID ConvertBitmap(void *bmpdata);
93
94 ULONG ressize;
95
96 // Linked list management
97 Win32Resource* next; // Next Resource in module
98
99 friend class Win32Image;
100};
101
102#endif // __cplusplus
103
104 #define NTRT_NEWRESOURCE 0x2000
105 #define NTRT_ERROR 0x7fff
106 #define NTRT_CURSOR 1
107 #define NTRT_BITMAP 2
108 #define NTRT_ICON 3
109 #define NTRT_MENU 4
110 #define NTRT_DIALOG 5
111 #define NTRT_STRING 6
112 #define NTRT_FONTDIR 7
113 #define NTRT_FONT 8
114 #define NTRT_ACCELERATORS 9
115 #define NTRT_RCDATA 10
116 #define NTRT_MESSAGETABLE 11
117 #define NTRT_GROUP_CURSOR 12
118 #define NTRT_GROUP_ICON 14
119 #define NTRT_VERSION 16
120 #define NTRT_NEWBITMAP (NTRT_BITMAP|NTRT_NEWRESOURCE)
121 #define NTRT_NEWMENU (NTRT_MENU|NTRT_NEWRESOURCE)
122 #define NTRT_NEWDIALOG (NTRT_DIALOG|NTRT_NEWRESOURCE)
123
124
125#endif
Note: See TracBrowser for help on using the repository browser.