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