]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: colour.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
dbf858b5 | 5 | // Id: $Id$ |
01111366 | 6 | // Copyright: (c) 1998 Robert Roebling |
c801d85f KB |
7 | // Licence: wxWindows licence |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef __GTKCOLOURH__ | |
12 | #define __GTKCOLOURH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/object.h" | |
20 | #include "wx/string.h" | |
21 | #include "wx/gdiobj.h" | |
401ec7b6 | 22 | #include "wx/palette.h" |
c801d85f KB |
23 | |
24 | //----------------------------------------------------------------------------- | |
25 | // classes | |
26 | //----------------------------------------------------------------------------- | |
27 | ||
28 | class wxDC; | |
29 | class wxPaintDC; | |
30 | class wxBitmap; | |
31 | class wxWindow; | |
32 | ||
33 | class wxColour; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // wxColour | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | class wxColour: public wxGDIObject | |
40 | { | |
e4a81a2e VZ |
41 | public: |
42 | // ctors | |
43 | // default | |
44 | wxColour(); | |
45 | // from RGB | |
46 | wxColour( char red, char green, char blue ); | |
47 | // implicit conversion from the colour name | |
48 | wxColour( const wxString &colourName ) { InitFromName(colourName); } | |
49 | wxColour( const char *colourName ) { InitFromName(colourName); } | |
50 | ||
51 | // copy ctors and assignment operators | |
52 | wxColour( const wxColour& col ); | |
53 | wxColour( const wxColour* col ); | |
54 | wxColour& operator = ( const wxColour& col ); | |
55 | ||
56 | // dtor | |
57 | ~wxColour(); | |
58 | ||
59 | // comparison | |
60 | bool operator == ( const wxColour& col ); | |
61 | bool operator != ( const wxColour& col ); | |
62 | ||
63 | // accessors | |
64 | void Set( unsigned char red, unsigned char green, unsigned char blue ); | |
65 | unsigned char Red() const; | |
66 | unsigned char Green() const; | |
67 | unsigned char Blue() const; | |
68 | bool Ok() const; | |
69 | ||
70 | // implementation | |
71 | void CalcPixel( GdkColormap *cmap ); | |
72 | int GetPixel() const; | |
73 | GdkColor *GetColor() const; | |
c0ac1c32 | 74 | |
68dda785 | 75 | protected: |
e4a81a2e VZ |
76 | // helper functions |
77 | void InitFromName(const wxString& colourName); | |
68dda785 VZ |
78 | |
79 | private: | |
e4a81a2e | 80 | DECLARE_DYNAMIC_CLASS(wxColour) |
c801d85f | 81 | }; |
c0ac1c32 | 82 | |
c801d85f | 83 | #endif // __GTKCOLOURH__ |