1 /////////////////////////////////////////////////////////////////////////////
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 wxGDIObject
35 DECLARE_DYNAMIC_CLASS(wxPalette
)
39 inline wxPalette(const wxPalette
& rPalette
) { Ref(rPalette
); }
42 ,const unsigned char* pRed
43 ,const unsigned char* pGreen
44 ,const unsigned char* pBlue
49 ,const unsigned char* pRed
50 ,const unsigned char* pGreen
51 ,const unsigned char* pBlue
53 int GetPixel( const unsigned char cRed
54 ,const unsigned char cGreen
55 ,const unsigned char cBlue
57 bool GetRGB( int nPixel
59 ,unsigned char* pGreen
63 virtual bool Ok(void) const { return (m_refData
!= NULL
) ; }
65 inline wxPalette
& operator = (const wxPalette
& rPalette
) { if (*this == rPalette
) return (*this); Ref(rPalette
); return *this; }
66 inline bool operator == (const wxPalette
& rPalette
) const
67 { return m_refData
== rPalette
.m_refData
; }
68 inline bool operator != (const wxPalette
& rPalette
) const
69 { return m_refData
!= rPalette
.m_refData
; }
71 virtual bool FreeResource(bool bForce
= FALSE
);
73 inline WXHPALETTE
GetHPALETTE(void) const { return (M_PALETTEDATA
? M_PALETTEDATA
->m_hPalette
: 0); }
74 void SetHPALETTE(WXHPALETTE hPalette
);
76 }; // end of CLASS wxPalette
78 #define wxColorMap wxPalette
79 #define wxColourMap wxPalette