// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#include "wx/gdicmn.h"
#include "wx/colour.h"
+#include "wx/gdicmn.h"
#include "wx/gtk/private.h"
#include <gdk/gdk.h>
m_color.blue = 0;
m_color.pixel = 0;
m_colormap = (GdkColormap *) NULL;
- m_hasPixel = FALSE;
+ m_hasPixel = false;
}
wxColourRefData(const wxColourRefData& data)
colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] - 1;
if (colMapAllocCounter[ idx ] == 0)
- gdk_colormap_free_colors( m_colormap, &m_color, 1 );
+ gdk_colormap_free_colors( m_colormap, &m_color, 1 );
}
}
}
#ifdef __WXGTK20__
if ( (cmap->visual->type == GDK_VISUAL_GRAYSCALE) ||
- (cmap->visual->type == GDK_VISUAL_PSEUDO_COLOR) )
+ (cmap->visual->type == GDK_VISUAL_PSEUDO_COLOR) )
#else
GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap;
if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
#define M_COLDATA ((wxColourRefData *)m_refData)
-#define SHIFT (8*(sizeof(short int)-sizeof(char)))
+// GDK's values are in 0..65535 range, our are in 0..255
+#define SHIFT 8
IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
bool wxColour::operator == ( const wxColour& col ) const
{
if (m_refData == col.m_refData)
- return TRUE;
+ return true;
if (!m_refData || !col.m_refData)
- return FALSE;
+ return false;
GdkColor *own = &(((wxColourRefData*)m_refData)->m_color);
GdkColor *other = &(((wxColourRefData*)col.m_refData)->m_color);
M_COLDATA->m_color.pixel = 0;
M_COLDATA->m_colormap = (GdkColormap*) NULL;
- M_COLDATA->m_hasPixel = FALSE;
+ M_COLDATA->m_hasPixel = false;
}
unsigned char wxColour::Red() const
return &M_COLDATA->m_color;
}
-
-