]>
Commit | Line | Data |
---|---|---|
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 | virtual ~wxColour(); | |
31 | ||
32 | // accessors | |
33 | bool Ok() const { return IsOk(); } | |
34 | bool IsOk() const; | |
35 | ||
36 | unsigned char Red() const { return m_red; } | |
37 | unsigned char Green() const { return m_green; } | |
38 | unsigned char Blue() const { return m_blue; } | |
39 | unsigned char Alpha() const { return m_alpha; } | |
40 | ||
41 | // comparison | |
42 | bool operator == (const wxColour& colour) const | |
43 | { | |
44 | return (m_isInit == colour.m_isInit | |
45 | && m_red == colour.m_red | |
46 | && m_green == colour.m_green | |
47 | && m_blue == colour.m_blue | |
48 | && m_alpha == colour.m_alpha); | |
49 | } | |
50 | bool operator != (const wxColour& colour) const { return !(*this == colour); } | |
51 | ||
52 | const WXCOLORREF& GetPixel() const { return m_pixel; }; | |
53 | ||
54 | protected : | |
55 | ||
56 | // Helper function | |
57 | void Init(); | |
58 | ||
59 | virtual void | |
60 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); | |
61 | ||
62 | private: | |
63 | bool m_isInit; | |
64 | unsigned char m_red; | |
65 | unsigned char m_blue; | |
66 | unsigned char m_green; | |
67 | unsigned char m_alpha; | |
68 | ||
69 | public: | |
70 | WXCOLORREF m_pixel ; | |
71 | void FromRGBColor( WXCOLORREF* color ) ; | |
72 | ||
73 | ||
74 | private: | |
75 | DECLARE_DYNAMIC_CLASS(wxColour) | |
76 | }; | |
77 | ||
78 | #endif | |
79 | // _WX_COLOUR_H_ |