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 IsOk(); }
49 virtual bool IsOk() const { return (m_refData
!= NULL
) ; }
51 inline bool operator == (const wxPalette
& palette
) const { return m_refData
== palette
.m_refData
; }
52 inline bool operator != (const wxPalette
& palette
) const { return m_refData
!= palette
.m_refData
; }
54 /* TODO: implementation
55 inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
56 void SetHPALETTE(WXHPALETTE pal);