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"
17 class WXDLLEXPORT wxPalette
;
19 class WXDLLEXPORT wxPaletteRefData
: public wxGDIRefData
21 friend class WXDLLEXPORT wxPalette
;
26 WXHPALETTE m_hPalette
;
28 }; // end of CLASS wxPaletteRefData
30 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
32 class WXDLLEXPORT wxPalette
: public wxGDIObject
34 DECLARE_DYNAMIC_CLASS(wxPalette
)
38 inline wxPalette(const wxPalette
& rPalette
) { Ref(rPalette
); }
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( const unsigned char cRed
53 ,const unsigned char cGreen
54 ,const unsigned char cBlue
56 bool GetRGB( int nPixel
58 ,unsigned char* pGreen
62 virtual bool Ok(void) const { return (m_refData
!= NULL
) ; }
64 inline wxPalette
& operator = (const wxPalette
& rPalette
) { if (*this == rPalette
) return (*this); Ref(rPalette
); return *this; }
65 inline bool operator == (const wxPalette
& rPalette
) { return m_refData
== rPalette
.m_refData
; }
66 inline bool operator != (const wxPalette
& rPalette
) { return m_refData
!= rPalette
.m_refData
; }
68 virtual bool FreeResource(bool bForce
= FALSE
);
70 inline WXHPALETTE
GetHPALETTE(void) const { return (M_PALETTEDATA
? M_PALETTEDATA
->m_hPalette
: 0); }
71 void SetHPALETTE(WXHPALETTE hPalette
);
73 }; // end of CLASS wxPalette
75 #define wxColorMap wxPalette
76 #define wxColourMap wxPalette