]>
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 | ||
055de350 VZ |
18 | struct RGBColor; |
19 | ||
8cf73271 | 20 | // Colour |
ee19674c | 21 | class WXDLLEXPORT wxColour: public wxColourBase |
8cf73271 SC |
22 | { |
23 | public: | |
edc536d3 WS |
24 | // constructors |
25 | // ------------ | |
26 | ||
8cf73271 | 27 | // default |
edc536d3 | 28 | wxColour() { Init(); } |
ee19674c | 29 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
8cf73271 | 30 | |
8cf73271 | 31 | // dtor |
d3c7fc99 | 32 | virtual ~wxColour(); |
edc536d3 | 33 | |
edc536d3 | 34 | // accessors |
b7cacb43 | 35 | bool Ok() const { return IsOk(); } |
f84a986c | 36 | bool IsOk() const; |
edc536d3 WS |
37 | |
38 | unsigned char Red() const { return m_red; } | |
39 | unsigned char Green() const { return m_green; } | |
40 | unsigned char Blue() const { return m_blue; } | |
fa8bc37b | 41 | unsigned char Alpha() const { return m_alpha; } |
edc536d3 WS |
42 | |
43 | // comparison | |
44 | bool operator == (const wxColour& colour) const | |
45 | { | |
46 | return (m_isInit == colour.m_isInit | |
47 | && m_red == colour.m_red | |
48 | && m_green == colour.m_green | |
fa8bc37b SC |
49 | && m_blue == colour.m_blue |
50 | && m_alpha == colour.m_alpha); | |
edc536d3 WS |
51 | } |
52 | bool operator != (const wxColour& colour) const { return !(*this == colour); } | |
53 | ||
54 | const WXCOLORREF& GetPixel() const { return m_pixel; }; | |
8cf73271 | 55 | |
055de350 VZ |
56 | // Mac-specific ctor and assignment operator from the native colour |
57 | wxColour(const RGBColor& col); | |
58 | wxColour& operator=(const RGBColor& col); | |
59 | ||
8cf73271 SC |
60 | protected : |
61 | ||
62 | // Helper function | |
63 | void Init(); | |
64 | ||
aea95b1c VZ |
65 | virtual void |
66 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); | |
ee19674c | 67 | |
8cf73271 | 68 | private: |
edc536d3 WS |
69 | bool m_isInit; |
70 | unsigned char m_red; | |
71 | unsigned char m_blue; | |
72 | unsigned char m_green; | |
fa8bc37b | 73 | unsigned char m_alpha; |
8cf73271 SC |
74 | |
75 | public: | |
edc536d3 | 76 | WXCOLORREF m_pixel ; |
e0908860 | 77 | void FromRGBColor( WXCOLORREF* color ) ; |
aea95b1c | 78 | |
8cf73271 SC |
79 | |
80 | private: | |
edc536d3 | 81 | DECLARE_DYNAMIC_CLASS(wxColour) |
8cf73271 SC |
82 | }; |
83 | ||
84 | #endif | |
85 | // _WX_COLOUR_H_ |