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 WXDLLEXPORT wxPalette
;
20 class WXDLLEXPORT wxPaletteRefData
: public wxGDIRefData
22 friend class WXDLLEXPORT wxPalette
;
27 WXHPALETTE m_hPalette
;
29 }; // end of CLASS wxPaletteRefData
31 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
33 class WXDLLEXPORT wxPalette
: public wxPaletteBase
35 DECLARE_DYNAMIC_CLASS(wxPalette
)
41 ,const unsigned char* pRed
42 ,const unsigned char* pGreen
43 ,const unsigned char* pBlue
48 ,const unsigned char* pRed
49 ,const unsigned char* pGreen
50 ,const unsigned char* pBlue
52 int GetPixel( unsigned char cRed
56 bool GetRGB( int nPixel
58 ,unsigned char* pGreen
62 virtual bool Ok(void) const { return (m_refData
!= NULL
) ; }
64 inline bool operator == (const wxPalette
& rPalette
) const
65 { return m_refData
== rPalette
.m_refData
; }
66 inline bool operator != (const wxPalette
& rPalette
) const
67 { return m_refData
!= rPalette
.m_refData
; }
69 virtual bool FreeResource(bool bForce
= false);
71 inline WXHPALETTE
GetHPALETTE(void) const { return (M_PALETTEDATA
? M_PALETTEDATA
->m_hPalette
: 0); }
72 void SetHPALETTE(WXHPALETTE hPalette
);
74 }; // end of CLASS wxPalette