1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/palette.h
3 // Purpose: wxPalette class
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PALETTE_H_
12 #define _WX_PALETTE_H_
14 #include "wx/gdiobj.h"
15 #include "wx/os2/private.h"
17 class WXDLLIMPEXP_FWD_CORE wxPalette
;
19 class WXDLLIMPEXP_CORE wxPaletteRefData
: public wxGDIRefData
21 friend class WXDLLIMPEXP_FWD_CORE wxPalette
;
24 virtual ~wxPaletteRefData();
26 WXHPALETTE m_hPalette
;
28 }; // end of CLASS wxPaletteRefData
30 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
32 class WXDLLIMPEXP_CORE wxPalette
: public wxPaletteBase
38 ,const unsigned char* pRed
39 ,const unsigned char* pGreen
40 ,const unsigned char* pBlue
45 ,const unsigned char* pRed
46 ,const unsigned char* pGreen
47 ,const unsigned char* pBlue
49 int GetPixel( unsigned char cRed
53 bool GetRGB( int nPixel
55 ,unsigned char* pGreen
59 virtual bool FreeResource(bool bForce
= false);
61 inline WXHPALETTE
GetHPALETTE(void) const { return (M_PALETTEDATA
? M_PALETTEDATA
->m_hPalette
: 0); }
62 void SetHPALETTE(WXHPALETTE hPalette
);
66 virtual wxGDIRefData
*CreateGDIRefData() const;
67 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
70 DECLARE_DYNAMIC_CLASS(wxPalette
)
71 }; // end of CLASS wxPalette