]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/colour.h
One that got away
[wxWidgets.git] / include / wx / gtk1 / colour.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: colour.h
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#ifndef __GTKCOLOURH__
13#define __GTKCOLOURH__
14
15#ifdef __GNUG__
16#pragma interface
17#endif
18
19#include "wx/defs.h"
20#include "wx/object.h"
21#include "wx/string.h"
22#include "wx/gdiobj.h"
401ec7b6 23#include "wx/palette.h"
c801d85f
KB
24
25//-----------------------------------------------------------------------------
26// classes
27//-----------------------------------------------------------------------------
28
29class wxDC;
30class wxPaintDC;
31class wxBitmap;
32class wxWindow;
33
34class wxColour;
35
36//-----------------------------------------------------------------------------
37// wxColour
38//-----------------------------------------------------------------------------
39
40class wxColour: public wxGDIObject
41{
c801d85f
KB
42 public:
43
68dda785 44 wxColour();
c801d85f 45 wxColour( char red, char green, char blue );
68dda785
VZ
46 wxColour( const wxString &colourName ) { InitFromName(colourName); }
47 wxColour( const char *colourName ) { InitFromName(colourName); }
c801d85f
KB
48 wxColour( const wxColour& col );
49 wxColour( const wxColour* col );
68dda785 50 ~wxColour();
c801d85f
KB
51 wxColour& operator = ( const wxColour& col );
52 wxColour& operator = ( const wxString& colourName );
53 bool operator == ( const wxColour& col );
54 bool operator != ( const wxColour& col );
55 void Set( const unsigned char red, const unsigned char green, const unsigned char blue );
68dda785
VZ
56 unsigned char Red() const;
57 unsigned char Green() const;
58 unsigned char Blue() const;
59 bool Ok() const;
c801d85f
KB
60
61 private:
62 public:
63
64 friend wxDC;
65 friend wxPaintDC;
66 friend wxBitmap;
67 friend wxWindow;
68
69 void CalcPixel( GdkColormap *cmap );
68dda785
VZ
70 int GetPixel() const;
71 GdkColor *GetColor() const;
c801d85f 72
68dda785
VZ
73protected:
74 // helper functions
75 void InitFromName(const wxString& colourName);
76
77private:
78 DECLARE_DYNAMIC_CLASS(wxColour)
c801d85f
KB
79};
80
81#endif // __GTKCOLOURH__