]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/colour.h
uint to unsigned int
[wxWidgets.git] / include / wx / gtk / 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{
e4a81a2e
VZ
42public:
43 // ctors
44 // default
45 wxColour();
46 // from RGB
47 wxColour( char red, char green, char blue );
48 // implicit conversion from the colour name
49 wxColour( const wxString &colourName ) { InitFromName(colourName); }
50 wxColour( const char *colourName ) { InitFromName(colourName); }
51
52 // copy ctors and assignment operators
53 wxColour( const wxColour& col );
54 wxColour( const wxColour* col );
55 wxColour& operator = ( const wxColour& col );
56
57 // dtor
58 ~wxColour();
59
60 // comparison
61 bool operator == ( const wxColour& col );
62 bool operator != ( const wxColour& col );
63
64 // accessors
65 void Set( unsigned char red, unsigned char green, unsigned char blue );
66 unsigned char Red() const;
67 unsigned char Green() const;
68 unsigned char Blue() const;
69 bool Ok() const;
70
71 // implementation
72 void CalcPixel( GdkColormap *cmap );
73 int GetPixel() const;
74 GdkColor *GetColor() const;
c0ac1c32 75
68dda785 76protected:
e4a81a2e
VZ
77 // helper functions
78 void InitFromName(const wxString& colourName);
68dda785
VZ
79
80private:
e4a81a2e 81 DECLARE_DYNAMIC_CLASS(wxColour)
c801d85f 82};
c0ac1c32 83
c801d85f 84#endif // __GTKCOLOURH__