1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/classic/palette.h
3 // Purpose: wxPalette class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PALETTE_H_
13 #define _WX_PALETTE_H_
15 #include "wx/colour.h"
16 #include "wx/gdiobj.h"
18 class WXDLLEXPORT wxPalette
;
20 class WXDLLEXPORT wxPaletteRefData
: public wxGDIRefData
22 DECLARE_NO_COPY_CLASS(wxPaletteRefData
)
24 friend class WXDLLEXPORT wxPalette
;
27 virtual ~wxPaletteRefData();
33 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
35 class WXDLLEXPORT wxPalette
: public wxPaletteBase
37 DECLARE_DYNAMIC_CLASS(wxPalette
)
42 wxPalette(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
44 bool Create(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
45 int GetPixel(unsigned char red
, unsigned char green
, unsigned char blue
) const;
46 bool GetRGB(int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const;
48 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
50 inline bool operator == (const wxPalette
& palette
) const { return m_refData
== palette
.m_refData
; }
51 inline bool operator != (const wxPalette
& palette
) const { return m_refData
!= palette
.m_refData
; }
53 /* TODO: implementation
54 inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
55 void SetHPALETTE(WXHPALETTE pal);