wxWidgets/include/wx/osx/core/colour.h
Vadim Zeitlin 3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00

88 lines
2.5 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/core/colour.h
// Purpose: wxColour class
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_
#define _WX_COLOUR_H_
#include "wx/object.h"
#include "wx/string.h"
#include "wx/osx/core/cfref.h"
struct RGBColor;
// Colour
class WXDLLIMPEXP_CORE wxColour: public wxColourBase
{
public:
// constructors
// ------------
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
// default copy ctor and dtor are ok
// accessors
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; }
virtual WXDLLIMPEXP_INLINE_CORE ChannelType Blue() const { return m_blue; }
virtual WXDLLIMPEXP_INLINE_CORE ChannelType Alpha() const { return m_alpha; }
// comparison
bool operator == (const wxColour& colour) const;
bool operator != (const wxColour& colour) const { return !(*this == colour); }
CGColorRef GetPixel() const { return 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;
#endif
// Mac-specific ctor and assignment operator from the native colour
// assumes ownership of CGColorRef
wxColour( CGColorRef col );
#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);
protected :
virtual void
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a);
#if wxOSX_USE_COCOA_OR_CARBON
void InitRGBColor( const RGBColor& col );
#endif
void InitCGColorRef( CGColorRef col );
void InitFromComponents(const CGFloat* components, size_t numComponents );
private:
wxCFRef<CGColorRef> m_cgColour;
ChannelType m_red;
ChannelType m_blue;
ChannelType m_green;
ChannelType m_alpha;
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif
// _WX_COLOUR_H_