X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74cc3ec18e117a6ea6bc1c23a9b70ff960f4c0ae..e10972f6c1436a6dcd5427b4e3913bb0f398e045:/include/wx/osx/core/colour.h diff --git a/include/wx/osx/core/colour.h b/include/wx/osx/core/colour.h index 3c6674c589..cefae9a881 100644 --- a/include/wx/osx/core/colour.h +++ b/include/wx/osx/core/colour.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/carbon/colour.h +// Name: wx/osx/core/colour.h // Purpose: wxColour class // Author: Stefan Csomor // Modified by: @@ -30,7 +30,7 @@ public: // default copy ctor and dtor are ok // accessors - virtual bool IsOk() const { return m_cgColour; } + virtual bool IsOk() const { return m_cgColour != NULL; } virtual WXDLLIMPEXP_INLINE_CORE ChannelType Red() const { return m_red; } virtual WXDLLIMPEXP_INLINE_CORE ChannelType Green() const { return m_green; } @@ -42,10 +42,10 @@ public: bool operator != (const wxColour& colour) const { return !(*this == colour); } - CGColorRef GetPixel() const { return m_cgColour; }; + CGColorRef GetPixel() const { return m_cgColour; } - CGColorRef GetCGColor() const { return m_cgColour; }; - CGColorRef CreateCGColor() const { return wxCFRetain( (CGColorRef)m_cgColour ); }; + CGColorRef GetCGColor() const { return m_cgColour; } + CGColorRef CreateCGColor() const { return wxCFRetain( (CGColorRef)m_cgColour ); } #if wxOSX_USE_COCOA_OR_CARBON void GetRGBColor( RGBColor *col ) const; @@ -57,6 +57,10 @@ public: #if wxOSX_USE_COCOA_OR_CARBON wxColour(const RGBColor& col); wxColour& operator=(const RGBColor& col); +#endif +#if wxOSX_USE_COCOA + wxColour(WX_NSColor color); + WX_NSColor OSXGetNSColor() const; #endif wxColour& operator=(CGColorRef col); wxColour& operator=(const wxColour& col); @@ -68,6 +72,7 @@ protected : void InitRGBColor( const RGBColor& col ); #endif void InitCGColorRef( CGColorRef col ); + void InitFromComponents(const CGFloat* components, size_t numComponents ); private: wxCFRef m_cgColour;