]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
edc536d3 | 2 | // Name: wx/gtk/colour.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
dbf858b5 | 5 | // Id: $Id$ |
01111366 | 6 | // Copyright: (c) 1998 Robert Roebling |
65571936 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKCOLOURH__ |
11 | #define __GTKCOLOURH__ | |
12 | ||
c801d85f KB |
13 | #include "wx/defs.h" |
14 | #include "wx/object.h" | |
15 | #include "wx/string.h" | |
16 | #include "wx/gdiobj.h" | |
401ec7b6 | 17 | #include "wx/palette.h" |
c801d85f KB |
18 | |
19 | //----------------------------------------------------------------------------- | |
20 | // classes | |
21 | //----------------------------------------------------------------------------- | |
22 | ||
20123d49 MW |
23 | class WXDLLIMPEXP_CORE wxDC; |
24 | class WXDLLIMPEXP_CORE wxPaintDC; | |
25 | class WXDLLIMPEXP_CORE wxBitmap; | |
26 | class WXDLLIMPEXP_CORE wxWindow; | |
c801d85f | 27 | |
20123d49 | 28 | class WXDLLIMPEXP_CORE wxColour; |
c801d85f KB |
29 | |
30 | //----------------------------------------------------------------------------- | |
31 | // wxColour | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
40989e46 | 34 | class WXDLLIMPEXP_CORE wxColour : public wxColourBase |
c801d85f | 35 | { |
e4a81a2e | 36 | public: |
edc536d3 WS |
37 | // constructors |
38 | // ------------ | |
39 | ||
40 | // default | |
40989e46 WS |
41 | wxColour() {} |
42 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS | |
c6685317 | 43 | wxColour(const GdkColor& gdkColor); |
401eb3de | 44 | |
c89f5c02 RR |
45 | ~wxColour(); |
46 | ||
47 | bool Ok() const { return m_refData != NULL; } | |
aad6765c | 48 | |
c89f5c02 RR |
49 | bool operator == ( const wxColour& col ) const; |
50 | bool operator != ( const wxColour& col ) const { return !(*this == col); } | |
51 | ||
c89f5c02 RR |
52 | unsigned char Red() const; |
53 | unsigned char Green() const; | |
54 | unsigned char Blue() const; | |
55 | ||
c89f5c02 RR |
56 | // Implementation part |
57 | void CalcPixel( GdkColormap *cmap ); | |
58 | int GetPixel() const; | |
4f558e23 | 59 | #ifdef __WXGTK24__ |
c6685317 | 60 | const GdkColor *GetColor() const; |
4f558e23 PC |
61 | #else |
62 | // GDK functions from old gtk2 versions take non-const color parameters, | |
63 | // too many uses to deal with individually | |
64 | GdkColor *GetColor() const; | |
65 | #endif | |
c0ac1c32 | 66 | |
68dda785 | 67 | protected: |
cb3db090 | 68 | virtual bool FromString(const wxChar *str); |
40989e46 | 69 | virtual void InitWith( unsigned char red, unsigned char green, unsigned char blue ); |
68dda785 VZ |
70 | |
71 | private: | |
c89f5c02 | 72 | DECLARE_DYNAMIC_CLASS(wxColour) |
c801d85f | 73 | }; |
c0ac1c32 | 74 | |
c801d85f | 75 | #endif // __GTKCOLOURH__ |