#include "wx/gdiobj.h"
-class WXDLLEXPORT wxColour;
+class WXDLLIMPEXP_FWD_CORE wxColour;
// the standard wxColour constructors;
// this macro avoids to repeat these lines across all colour.h files, since
ChannelType alpha = wxALPHA_OPAQUE ) \
{ Set(red, green, blue, alpha); } \
wxColour( unsigned long colRGB ) { Set(colRGB); } \
- wxColour(const wxString& colourName) { Set(colourName); }
+ wxColour(const wxString& colourName) { Set(colourName); } \
+ wxColour(const char *colourName) { Set(colourName); } \
+ wxColour(const wchar_t *colourName) { Set(colourName); }
// flags for wxColour -> wxString conversion (see wxColour::GetAsString)
// accessors
// ---------
- virtual bool Ok() const { return IsOk(); }
- virtual bool IsOk() const = 0;
-
virtual ChannelType Red() const = 0;
virtual ChannelType Green() const = 0;
virtual ChannelType Blue() const = 0;
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0;
virtual bool FromString(const wxString& s);
+
+ // wxColour doesn't use reference counted data (at least not in all ports)
+ // so provide stubs for the functions which need to be defined if we do use
+ // them
+ virtual wxGDIRefData *CreateGDIRefData() const
+ {
+ wxFAIL_MSG( "must be overridden if used" );
+
+ return NULL;
+ }
+
+ virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
+ {
+ wxFAIL_MSG( "must be overridden if used" );
+
+ return NULL;
+ }
};
+// wxColour <-> wxString utilities, used by wxConfig, defined in colourcmn.cpp
+WXDLLIMPEXP_CORE wxString wxToString(const wxColourBase& col);
+WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxColourBase* col);
+
+
#if defined(__WXPALMOS__)
#include "wx/generic/colour.h"