]>
Commit | Line | Data |
---|---|---|
8cf73271 | 1 | ///////////////////////////////////////////////////////////////////////////// |
edc536d3 | 2 | // Name: wx/mac/carbon/colour.h |
8cf73271 SC |
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 | |
65571936 | 9 | // Licence: wxWindows licence |
8cf73271 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_COLOUR_H_ | |
13 | #define _WX_COLOUR_H_ | |
14 | ||
8cf73271 SC |
15 | #include "wx/object.h" |
16 | #include "wx/string.h" | |
17 | ||
18 | // Colour | |
ee19674c | 19 | class WXDLLEXPORT wxColour: public wxColourBase |
8cf73271 SC |
20 | { |
21 | public: | |
edc536d3 WS |
22 | // constructors |
23 | // ------------ | |
24 | ||
8cf73271 | 25 | // default |
edc536d3 | 26 | wxColour() { Init(); } |
ee19674c | 27 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
8cf73271 | 28 | |
8cf73271 | 29 | // dtor |
edc536d3 WS |
30 | ~wxColour(); |
31 | ||
edc536d3 WS |
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; }; | |
8cf73271 | 50 | |
8cf73271 SC |
51 | protected : |
52 | ||
53 | // Helper function | |
54 | void Init(); | |
55 | ||
ee19674c WS |
56 | void InitWith( unsigned char red, unsigned char green, unsigned char blue ); |
57 | ||
8cf73271 | 58 | private: |
edc536d3 WS |
59 | bool m_isInit; |
60 | unsigned char m_red; | |
61 | unsigned char m_blue; | |
62 | unsigned char m_green; | |
8cf73271 SC |
63 | |
64 | public: | |
edc536d3 | 65 | WXCOLORREF m_pixel ; |
f61ed7ee SC |
66 | void FromRGBColor( const WXCOLORREF* color ) ; |
67 | ||
8cf73271 SC |
68 | |
69 | private: | |
edc536d3 | 70 | DECLARE_DYNAMIC_CLASS(wxColour) |
8cf73271 SC |
71 | }; |
72 | ||
73 | #endif | |
74 | // _WX_COLOUR_H_ |