]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/palette.cpp
5256aa14ca2a96d324bfe9b64cafee57442ab1e6
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "palette.h"
16 #include "wx/palette.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class wxPaletteRefData
: public wxObjectRefData
26 wxPaletteRefData(void);
27 ~wxPaletteRefData(void);
31 wxPaletteRefData::wxPaletteRefData(void)
35 wxPaletteRefData::~wxPaletteRefData(void)
39 //-----------------------------------------------------------------------------
41 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
43 IMPLEMENT_DYNAMIC_CLASS(wxPalette
,wxGDIObject
)
45 wxPalette::wxPalette(void)
49 wxPalette::wxPalette( int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
)
51 m_refData
= new wxPaletteRefData();
52 Create( n
, red
, green
, blue
);
55 wxPalette::wxPalette( const wxPalette
& palette
)
60 wxPalette::wxPalette( const wxPalette
* palette
)
63 if (palette
) Ref( *palette
);
66 wxPalette::~wxPalette(void)
70 wxPalette
& wxPalette::operator = ( const wxPalette
& palette
)
72 if (*this == palette
) return (*this);
77 bool wxPalette::operator == ( const wxPalette
& palette
)
79 return m_refData
== palette
.m_refData
;
82 bool wxPalette::operator != ( const wxPalette
& palette
)
84 return m_refData
!= palette
.m_refData
;
87 bool wxPalette::Ok(void) const
92 bool wxPalette::Create( int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
)
96 int wxPalette::GetPixel( const unsigned char red
, const unsigned char green
, const unsigned char blue
) const
100 bool wxPalette::GetRGB( int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const