]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/colour.h
renamed RGBColor setter to avoid former overload being an override
[wxWidgets.git] / include / wx / mac / carbon / colour.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/colour.h
3 // Purpose: wxColour class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COLOUR_H_
13 #define _WX_COLOUR_H_
14
15 #include "wx/object.h"
16 #include "wx/string.h"
17
18 // Colour
19 class WXDLLEXPORT wxColour: public wxColourBase
20 {
21 public:
22 // constructors
23 // ------------
24
25 // default
26 wxColour() { Init(); }
27 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
28
29 // dtor
30 ~wxColour();
31
32 // accessors
33 bool Ok() const {return m_isInit; }
34
35 unsigned char Red() const { return m_red; }
36 unsigned char Green() const { return m_green; }
37 unsigned char Blue() const { return m_blue; }
38
39 // comparison
40 bool operator == (const wxColour& colour) const
41 {
42 return (m_isInit == colour.m_isInit
43 && m_red == colour.m_red
44 && m_green == colour.m_green
45 && m_blue == colour.m_blue);
46 }
47 bool operator != (const wxColour& colour) const { return !(*this == colour); }
48
49 const WXCOLORREF& GetPixel() const { return m_pixel; };
50
51 protected :
52
53 // Helper function
54 void Init();
55
56 void InitWith( unsigned char red, unsigned char green, unsigned char blue );
57
58 private:
59 bool m_isInit;
60 unsigned char m_red;
61 unsigned char m_blue;
62 unsigned char m_green;
63
64 public:
65 WXCOLORREF m_pixel ;
66 void FromRGBColor( const WXCOLORREF* color ) ;
67
68
69 private:
70 DECLARE_DYNAMIC_CLASS(wxColour)
71 };
72
73 #endif
74 // _WX_COLOUR_H_