]>
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 WXUNUSED(n
),
90 const unsigned char *WXUNUSED(red
),
91 const unsigned char *WXUNUSED(green
),
92 const unsigned char *WXUNUSED(blue
) )
94 wxFAIL_MSG("not implemented");
99 int wxPalette::GetPixel( const unsigned char WXUNUSED(red
),
100 const unsigned char WXUNUSED(green
),
101 const unsigned char WXUNUSED(blue
) ) const
103 wxFAIL_MSG("not implemented");
108 bool wxPalette::GetRGB( int WXUNUSED(pixel
),
109 unsigned char *WXUNUSED(red
),
110 unsigned char *WXUNUSED(green
),
111 unsigned char *WXUNUSED(blue
) ) const
113 wxFAIL_MSG("not implemented");