X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58c837a4e67c0996134cc0947691dc09c5f26687..f1d93f0beeec9d88f8a225aa35a9ccc163dcdb15:/src/gtk/colour.cpp?ds=sidebyside diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index db73e73343..60e62c4b3a 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -15,6 +15,7 @@ #include "wx/gdicmn.h" #include +#include #include //----------------------------------------------------------------------------- @@ -33,7 +34,7 @@ class wxColourRefData: public wxObjectRefData GdkColormap *m_colormap; bool m_hasPixel; - friend wxColour; + friend class wxColour; }; wxColourRefData::wxColourRefData() @@ -133,7 +134,7 @@ bool wxColour::operator == ( const wxColour& col ) const bool wxColour::operator != ( const wxColour& col) const { - return m_refData != col.m_refData; + return !(*this == col); } void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue ) @@ -180,9 +181,14 @@ void wxColour::CalcPixel( GdkColormap *cmap ) M_COLDATA->FreeColour(); +#ifdef __WXGTK20__ + if ((cmap->visual->type == GDK_VISUAL_GRAYSCALE) || + (cmap->visual->type == GDK_VISUAL_PSEUDO_COLOR)) +#else GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap; if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) || (private_colormap->visual->type == GDK_VISUAL_PSEUDO_COLOR)) +#endif { GdkColor *colors = cmap->colors; int max = 3 * (65536);