1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/colour.h
3 // Purpose: wxColour class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/object.h"
16 #include "wx/string.h"
18 #include "wx/mac/corefoundation/cfref.h"
23 class WXDLLIMPEXP_CORE wxColour
: public wxColourBase
28 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
30 // default copy ctor and dtor are ok
33 virtual bool IsOk() const { return m_cgColour
; }
35 ChannelType
Red() const { return m_red
; }
36 ChannelType
Green() const { return m_green
; }
37 ChannelType
Blue() const { return m_blue
; }
38 ChannelType
Alpha() const { return m_alpha
; }
41 bool operator == (const wxColour
& colour
) const;
43 bool operator != (const wxColour
& colour
) const { return !(*this == colour
); }
45 CGColorRef
GetPixel() const { return m_cgColour
; };
47 CGColorRef
GetCGColor() const { return m_cgColour
; };
48 CGColorRef
CreateCGColor() const { return wxCFRetain( (CGColorRef
)m_cgColour
); };
50 void GetRGBColor( RGBColor
*col
) const;
52 // Mac-specific ctor and assignment operator from the native colour
53 // assumes ownership of CGColorRef
54 wxColour( CGColorRef col
);
55 wxColour(const RGBColor
& col
);
56 wxColour
& operator=(const RGBColor
& col
);
57 wxColour
& operator=(CGColorRef col
);
58 wxColour
& operator=(const wxColour
& col
);
62 InitRGBA(ChannelType r
, ChannelType g
, ChannelType b
, ChannelType a
);
63 void InitRGBColor( const RGBColor
& col
);
64 void InitCGColorRef( CGColorRef col
);
66 wxCFRef
<CGColorRef
> m_cgColour
;
73 DECLARE_DYNAMIC_CLASS(wxColour
)