1 | #ifndef __OS2PALETTE_H__
|
---|
2 | #define __OS2PALETTE_H__
|
---|
3 |
|
---|
4 | #include "os2ddraw.h"
|
---|
5 | #include "divewrap.h"
|
---|
6 | #define FAR
|
---|
7 | #undef THIS
|
---|
8 | #define THIS IDirectDrawPalette*
|
---|
9 |
|
---|
10 | #pragma pack(1) /* pack on wordboundary */
|
---|
11 |
|
---|
12 | typedef struct _RGB2 /* rgb2 */
|
---|
13 | {
|
---|
14 | BYTE bBlue; /* Blue component of the color definition */
|
---|
15 | BYTE bGreen; /* Green component of the color definition*/
|
---|
16 | BYTE bRed; /* Red component of the color definition */
|
---|
17 | BYTE fcOptions; /* Reserved, must be zero */
|
---|
18 | } RGB2;
|
---|
19 | typedef RGB2 *PRGB2;
|
---|
20 | #pragma pack()
|
---|
21 |
|
---|
22 | class OS2IDirectDrawPalette
|
---|
23 | {
|
---|
24 | public:
|
---|
25 | //this one has to go first!
|
---|
26 | IDirectDrawPaletteVtbl *lpVtbl;
|
---|
27 | IDirectDrawPaletteVtbl Vtbl;
|
---|
28 |
|
---|
29 | OS2IDirectDrawPalette( OS2IDirectDraw *lpDirectDraw,
|
---|
30 | int palsize,
|
---|
31 | LPPALETTEENTRY lpColorTable,
|
---|
32 | DWORD dwPalFlags);
|
---|
33 | ~OS2IDirectDrawPalette();
|
---|
34 |
|
---|
35 | void SetPhysPalette();
|
---|
36 | void RestorePhysPalette();
|
---|
37 | void SetIsPrimary(BOOL newValue);
|
---|
38 | int Referenced;
|
---|
39 | inline HRESULT GetLastError() { return lastError; };
|
---|
40 | private:
|
---|
41 |
|
---|
42 | protected:
|
---|
43 | HDIVE hDive;
|
---|
44 | HRESULT lastError;
|
---|
45 | LPPALETTEENTRY os2pal;
|
---|
46 | OS2IDirectDraw *lpDraw;
|
---|
47 | DWORD dwCaps;
|
---|
48 | DWORD dwSize;
|
---|
49 | BOOL fAttachedToPrimary;
|
---|
50 | friend HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
|
---|
51 | friend ULONG __stdcall PalAddRef(THIS);
|
---|
52 | friend ULONG __stdcall PalRelease(THIS);
|
---|
53 | friend HRESULT __stdcall PalGetCaps(THIS, LPDWORD);
|
---|
54 | friend HRESULT __stdcall PalGetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
|
---|
55 | friend HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
|
---|
56 | friend HRESULT __stdcall PalSetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
|
---|
57 | };
|
---|
58 |
|
---|
59 |
|
---|
60 | HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
|
---|
61 | ULONG __stdcall PalAddRef(THIS);
|
---|
62 | ULONG __stdcall PalRelease(THIS);
|
---|
63 | HRESULT __stdcall PalGetCaps(THIS, LPDWORD);
|
---|
64 | HRESULT __stdcall PalGetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
|
---|
65 | HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
|
---|
66 | HRESULT __stdcall PalSetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
|
---|
67 |
|
---|
68 |
|
---|
69 | #endif
|
---|