]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/gtk/palette.cpp
Prealpha, prebeta of new wxTreeCtrl for GTK. It is possible to AddRoot,
[wxWidgets.git] / src / gtk / palette.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: palette.cpp
3// Purpose:
4// Author: Robert Roebling
5// Created: 01/02/97
6// Id:
7// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11
12#ifdef __GNUG__
13#pragma implementation "palette.h"
14#endif
15
16#include "wx/palette.h"
17
18//-----------------------------------------------------------------------------
19// wxPalette
20//-----------------------------------------------------------------------------
21
22class wxPaletteRefData: public wxObjectRefData
23{
24 public:
25
26 wxPaletteRefData(void);
27 ~wxPaletteRefData(void);
28
29 GdkColormap *m_colormap;
30};
31
32wxPaletteRefData::wxPaletteRefData(void)
33{
34 m_colormap = (GdkColormap *) NULL;
35};
36
37wxPaletteRefData::~wxPaletteRefData(void)
38{
39 if (m_colormap) gdk_colormap_unref( m_colormap );
40};
41
42//-----------------------------------------------------------------------------
43
44#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
45
46IMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject)
47
48wxPalette::wxPalette(void)
49{
50};
51
52wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue )
53{
54 m_refData = new wxPaletteRefData();
55 Create( n, red, green, blue );
56};
57
58wxPalette::wxPalette( const wxPalette& palette )
59{
60 Ref( palette );
61};
62
63wxPalette::wxPalette( const wxPalette* palette )
64{
65 UnRef();
66 if (palette) Ref( *palette );
67};
68
69wxPalette::~wxPalette(void)
70{
71};
72
73wxPalette& wxPalette::operator = ( const wxPalette& palette )
74{
75 if (*this == palette) return (*this);
76 Ref( palette );
77 return *this;
78};
79
80bool wxPalette::operator == ( const wxPalette& palette )
81{
82 return m_refData == palette.m_refData;
83};
84
85bool wxPalette::operator != ( const wxPalette& palette )
86{
87 return m_refData != palette.m_refData;
88};
89
90bool wxPalette::Ok(void) const
91{
92 return (m_refData);
93};
94
95bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
96{
97 wxFAIL_MSG("not implemented");
98
99 return FALSE;
100};
101
102int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const
103{
104 wxFAIL_MSG("not implemented");
105
106 return 0;
107};
108
109bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const
110{
111 wxFAIL_MSG("not implemented");
112
113 return 0;
114};
115