]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/classic/colour.h
simplify the client data/non standard images handling code by unconditionally using...
[wxWidgets.git] / include / wx / mac / classic / colour.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/classic/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 // copy ctors and assignment operators
30 wxColour( const wxColour& col );
31 wxColour( const wxColour* col );
32 wxColour& operator = ( const wxColour& col );
33
34 // dtor
35 ~wxColour();
36
37 // accessors
38 bool Ok() const {return m_isInit; }
39
40 unsigned char Red() const { return m_red; }
41 unsigned char Green() const { return m_green; }
42 unsigned char Blue() const { return m_blue; }
43
44 // comparison
45 bool operator == (const wxColour& colour) const
46 {
47 return (m_isInit == colour.m_isInit
48 && m_red == colour.m_red
49 && m_green == colour.m_green
50 && m_blue == colour.m_blue);
51 }
52 bool operator != (const wxColour& colour) const { return !(*this == colour); }
53
54 const WXCOLORREF& GetPixel() const { return m_pixel; };
55
56 protected:
57
58 // Helper function
59 void Init();
60
61 void InitWith( unsigned char red, unsigned char green, unsigned char blue );
62
63 private:
64 bool m_isInit;
65 unsigned char m_red;
66 unsigned char m_blue;
67 unsigned char m_green;
68
69 public:
70 WXCOLORREF m_pixel ;
71 void Set( const WXCOLORREF* color ) ;
72
73 private:
74 DECLARE_DYNAMIC_CLASS(wxColour)
75 };
76
77 #endif
78 // _WX_COLOUR_H_