]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/colour.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / gtk1 / colour.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/colour.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 #ifndef __GTKCOLOURH__
10 #define __GTKCOLOURH__
11
12 #include "wx/defs.h"
13 #include "wx/object.h"
14 #include "wx/string.h"
15 #include "wx/gdiobj.h"
16 #include "wx/palette.h"
17
18 //-----------------------------------------------------------------------------
19 // classes
20 //-----------------------------------------------------------------------------
21
22 class WXDLLIMPEXP_FWD_CORE wxDC;
23 class WXDLLIMPEXP_FWD_CORE wxPaintDC;
24 class WXDLLIMPEXP_FWD_CORE wxBitmap;
25 class WXDLLIMPEXP_FWD_CORE wxWindow;
26
27 class WXDLLIMPEXP_FWD_CORE wxColour;
28
29 //-----------------------------------------------------------------------------
30 // wxColour
31 //-----------------------------------------------------------------------------
32
33 class WXDLLIMPEXP_CORE wxColour : public wxColourBase
34 {
35 public:
36 // constructors
37 // ------------
38 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
39
40 virtual ~wxColour();
41
42 virtual bool FromString(const wxString& str);
43
44 bool operator==(const wxColour& col) const;
45 bool operator!=(const wxColour& col) const { return !(*this == col); }
46
47 unsigned char Red() const;
48 unsigned char Green() const;
49 unsigned char Blue() const;
50
51
52 // Implementation part
53 void CalcPixel( GdkColormap *cmap );
54 int GetPixel() const;
55 GdkColor *GetColor() const;
56
57 protected:
58 // ref counting code
59 virtual wxGDIRefData *CreateGDIRefData() const;
60 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
61
62 virtual void
63 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
64
65 private:
66 DECLARE_DYNAMIC_CLASS(wxColour)
67 };
68
69 #endif // __GTKCOLOURH__