]>
Commit | Line | Data |
---|---|---|
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 | ||
29 | class wxDC; | |
30 | class wxPaintDC; | |
31 | class wxBitmap; | |
32 | class wxWindow; | |
33 | ||
34 | class wxColour; | |
35 | ||
36 | //----------------------------------------------------------------------------- | |
37 | // wxColour | |
38 | //----------------------------------------------------------------------------- | |
39 | ||
40 | class wxColour: public wxGDIObject | |
41 | { | |
e4a81a2e VZ |
42 | public: |
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 | 76 | protected: |
e4a81a2e VZ |
77 | // helper functions |
78 | void InitFromName(const wxString& colourName); | |
68dda785 VZ |
79 | |
80 | private: | |
e4a81a2e | 81 | DECLARE_DYNAMIC_CLASS(wxColour) |
c801d85f | 82 | }; |
c0ac1c32 | 83 | |
c801d85f | 84 | #endif // __GTKCOLOURH__ |