X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f5d78250c6dd003e8d06fea9e04b710bffdb41f..6619edf0ea94b6623f1c7e7875d5ca8abac23382:/include/wx/colour.h diff --git a/include/wx/colour.h b/include/wx/colour.h index 18101e11de..ecce9a4943 100644 --- a/include/wx/colour.h +++ b/include/wx/colour.h @@ -16,7 +16,7 @@ #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 @@ -27,8 +27,9 @@ class WXDLLEXPORT wxColour; ChannelType alpha = wxALPHA_OPAQUE ) \ { Set(red, green, blue, alpha); } \ wxColour( unsigned long colRGB ) { Set(colRGB); } \ - wxColour(const wxString &colourName) { Set(colourName); } \ - wxColour(const wxChar *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) @@ -74,9 +75,6 @@ public: { InitRGBA(red,green,blue, alpha); } // implemented in colourcmn.cpp - bool Set(const wxChar *str) - { return FromString(str); } - bool Set(const wxString &str) { return FromString(str); } @@ -84,9 +82,9 @@ public: { // we don't need to know sizeof(long) here because we assume that the three // least significant bytes contain the R, G and B values - Set((ChannelType)colRGB, - (ChannelType)(colRGB >> 8), - (ChannelType)(colRGB >> 16)); + Set((ChannelType)(0xFF & colRGB), + (ChannelType)(0xFF & (colRGB >> 8)), + (ChannelType)(0xFF & (colRGB >> 16))); } @@ -94,7 +92,8 @@ public: // accessors // --------- - virtual bool Ok() const = 0; + virtual bool Ok() const { return IsOk(); } + virtual bool IsOk() const = 0; virtual ChannelType Red() const = 0; virtual ChannelType Green() const = 0; @@ -119,7 +118,7 @@ protected: virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0; - virtual bool FromString(const wxChar *s); + virtual bool FromString(const wxString& s); };