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