1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/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
40 wxPalette(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
42 bool Create(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
44 int GetPixel(unsigned char red
, unsigned char green
, unsigned char blue
) const;
45 bool GetRGB(int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const;
47 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
49 inline bool operator == (const wxPalette
& palette
) const { return m_refData
== palette
.m_refData
; }
50 inline bool operator != (const wxPalette
& palette
) const { return m_refData
!= palette
.m_refData
; }
52 virtual int GetColoursCount() const;
55 DECLARE_DYNAMIC_CLASS(wxPalette
)