/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "colour.h"
#endif
{
if (!m_colormap)
return;
-
- if ((wxTheApp->m_visualType == GrayScale) ||
- (wxTheApp->m_visualType == PseudoColor))
+#if !wxUSE_NANOX
+ if ((wxTheApp->m_visualInfo->m_visualType == GrayScale) ||
+ (wxTheApp->m_visualInfo->m_visualType == PseudoColor))
{
int idx = m_color.pixel;
colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] - 1;
XFreeColors( wxGlobalDisplay(), (Colormap) m_colormap, &pixel, 1, 0 );
}
}
+#endif
}
void wxColourRefData::AllocColour( WXColormap cmap )
FreeColour();
- if ((wxTheApp->m_visualType == GrayScale) ||
- (wxTheApp->m_visualType == PseudoColor))
+#if !wxUSE_NANOX
+ if ((wxTheApp->m_visualInfo->m_visualType == GrayScale) ||
+ (wxTheApp->m_visualInfo->m_visualType == PseudoColor))
{
m_hasPixel = XAllocColor( wxGlobalDisplay(), (Colormap) cmap, &m_color );
int idx = m_color.pixel;
colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] + 1;
}
else
+#endif
{
m_hasPixel = XAllocColor( wxGlobalDisplay(), (Colormap) cmap, &m_color );
}
void wxColour::InitFromName( const wxString &colourName )
{
- wxNode *node = (wxNode *) NULL;
- if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
+ wxColour* col;
+ if ( (wxTheColourDatabase) && (col = wxTheColourDatabase->FindColourNoAdd(colourName)) )
{
- wxColour *col = (wxColour*)node->Data();
UnRef();
if (col) Ref( *col );
}