X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7266b6723573ce6317577226cb1e5d32826e24e8..e1983ab58804a0e32ab2d832ded0349af1cc0476:/src/x11/palette.cpp diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp index eb5cb7bdf1..c95becb4b9 100644 --- a/src/x11/palette.cpp +++ b/src/x11/palette.cpp @@ -34,7 +34,7 @@ recommended; only the window manager should do this... Also, it is not the functionality that wxPalette::Create() aims to provide. */ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "palette.h" #endif @@ -77,10 +77,10 @@ wxPaletteRefData::~wxPaletteRefData() { Display *display = (Display*) NULL; - wxNode *node, *next; + wxList::compatibility_iterator node, next; - for (node = m_palettes.First(); node; node = next) { - wxXPalette *c = (wxXPalette *)node->Data(); + for (node = m_palettes.GetFirst(); node; node = next) { + wxXPalette *c = (wxXPalette *)node->GetData(); unsigned long *pix_array = c->m_pix_array; Colormap cmap = (Colormap) c->m_cmap; bool destroyable = c->m_destroyable; @@ -89,6 +89,7 @@ wxPaletteRefData::~wxPaletteRefData() if (pix_array_n > 0) { +#if !wxUSE_NANOX // XFreeColors(display, cmap, pix_array, pix_array_n, 0); // Be careful not to free '0' pixels... int i, j; @@ -97,14 +98,15 @@ wxPaletteRefData::~wxPaletteRefData() if(j > i) XFreeColors(display, cmap, &pix_array[i], j-i, 0); while(jNext(); - m_palettes.DeleteNode(node); + next = node->GetNext(); + m_palettes.Erase(node); delete c; } } @@ -189,27 +191,27 @@ bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *W WXColormap wxPalette::GetXColormap(WXDisplay* display) const { - if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.Number() == 0)) + if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.GetCount() == 0)) return wxTheApp->GetMainColormap(display); - wxNode* node = M_PALETTEDATA->m_palettes.First(); + wxList::compatibility_iterator node = M_PALETTEDATA->m_palettes.GetFirst(); if (!display && node) { - wxXPalette* p = (wxXPalette*) node->Data(); + wxXPalette* p = (wxXPalette*) node->GetData(); return p->m_cmap; } while (node) { - wxXPalette* p = (wxXPalette*) node->Data(); + wxXPalette* p = (wxXPalette*) node->GetData(); if (p->m_display == display) return p->m_cmap; - node = node->Next(); + node = node->GetNext(); } /* Make a new one: */ wxXPalette *c = new wxXPalette; - wxXPalette *first = (wxXPalette *)M_PALETTEDATA->m_palettes.First()->Data(); + wxXPalette *first = (wxXPalette *)M_PALETTEDATA->m_palettes.GetFirst()->GetData(); XColor xcol; int pix_array_n = first->m_pix_array_n; @@ -317,11 +319,11 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n) { if (!M_PALETTEDATA) return (unsigned long*) 0; - wxNode *node; + wxList::compatibility_iterator node; - for (node = M_PALETTEDATA->m_palettes.First(); node; node = node->Next()) + for (node = M_PALETTEDATA->m_palettes.GetFirst(); node; node = node->GetNext()) { - wxXPalette *c = (wxXPalette *)node->Data(); + wxXPalette *c = (wxXPalette *)node->GetData(); if (c->m_display == display) { if (n)