1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/palette.h
3 // Purpose: wxPalette class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PALETTE_H_
13 #define _WX_PALETTE_H_
15 #include "wx/gdiobj.h"
16 #include "wx/os2/private.h"
18 class WXDLLIMPEXP_FWD_CORE wxPalette
;
20 class WXDLLIMPEXP_CORE wxPaletteRefData
: public wxGDIRefData
22 friend class WXDLLIMPEXP_FWD_CORE wxPalette
;
25 virtual ~wxPaletteRefData();
27 WXHPALETTE m_hPalette
;
29 }; // end of CLASS wxPaletteRefData
31 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
33 class WXDLLIMPEXP_CORE wxPalette
: public wxPaletteBase
39 ,const unsigned char* pRed
40 ,const unsigned char* pGreen
41 ,const unsigned char* pBlue
46 ,const unsigned char* pRed
47 ,const unsigned char* pGreen
48 ,const unsigned char* pBlue
50 int GetPixel( unsigned char cRed
54 bool GetRGB( int nPixel
56 ,unsigned char* pGreen
60 virtual bool FreeResource(bool bForce
= false);
62 inline WXHPALETTE
GetHPALETTE(void) const { return (M_PALETTEDATA
? M_PALETTEDATA
->m_hPalette
: 0); }
63 void SetHPALETTE(WXHPALETTE hPalette
);
67 virtual wxGDIRefData
*CreateGDIRefData() const;
68 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
71 DECLARE_DYNAMIC_CLASS(wxPalette
)
72 }; // end of CLASS wxPalette