]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/palette.cpp
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);
29 GdkColormap
*m_colormap
;
32 wxPaletteRefData::wxPaletteRefData()
34 m_colormap
= (GdkColormap
*) NULL
;
37 wxPaletteRefData::~wxPaletteRefData()
39 if (m_colormap
) gdk_colormap_unref( m_colormap
);
42 //-----------------------------------------------------------------------------
44 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
46 IMPLEMENT_DYNAMIC_CLASS(wxPalette
,wxGDIObject
)
48 wxPalette::wxPalette()
52 wxPalette::wxPalette( int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
)
54 m_refData
= new wxPaletteRefData();
55 Create( n
, red
, green
, blue
);
58 wxPalette::wxPalette( const wxPalette
& palette
)
63 wxPalette::~wxPalette()
67 wxPalette
& wxPalette::operator = ( const wxPalette
& palette
)
69 if (*this == palette
) return (*this);
74 bool wxPalette::operator == ( const wxPalette
& palette
)
76 return m_refData
== palette
.m_refData
;
79 bool wxPalette::operator != ( const wxPalette
& palette
)
81 return m_refData
!= palette
.m_refData
;
84 bool wxPalette::Ok(void) const
89 bool wxPalette::Create( int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
)
91 wxFAIL_MSG("not implemented");
96 int wxPalette::GetPixel( const unsigned char red
, const unsigned char green
, const unsigned char blue
) const
98 wxFAIL_MSG("not implemented");
103 bool wxPalette::GetRGB( int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const
105 wxFAIL_MSG("not implemented");