1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/colour.h
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKCOLOURH__
11 #define __GTKCOLOURH__
14 #include "wx/object.h"
15 #include "wx/string.h"
16 #include "wx/gdiobj.h"
17 #include "wx/palette.h"
19 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxDC
;
24 class WXDLLIMPEXP_CORE wxPaintDC
;
25 class WXDLLIMPEXP_CORE wxBitmap
;
26 class WXDLLIMPEXP_CORE wxWindow
;
28 class WXDLLIMPEXP_CORE wxColour
;
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 class WXDLLIMPEXP_CORE wxColour
: public wxColourBase
42 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
43 wxColour(const GdkColor
& gdkColor
);
47 bool Ok() const { return m_refData
!= NULL
; }
49 bool operator == ( const wxColour
& col
) const;
50 bool operator != ( const wxColour
& col
) const { return !(*this == col
); }
52 unsigned char Red() const;
53 unsigned char Green() const;
54 unsigned char Blue() const;
56 // Implementation part
57 void CalcPixel( GdkColormap
*cmap
);
60 const GdkColor
*GetColor() const;
62 // GDK functions from old gtk2 versions take non-const color parameters,
63 // too many uses to deal with individually
64 GdkColor
*GetColor() const;
68 virtual bool FromString(const wxChar
*str
);
69 virtual void InitWith( unsigned char red
, unsigned char green
, unsigned char blue
);
72 DECLARE_DYNAMIC_CLASS(wxColour
)
75 #endif // __GTKCOLOURH__