#endif
#include "wx/motif/private.h"
-#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxXPalette, wxObject)
-#endif
/*
* Palette
{
Display *display = (Display*) NULL;
- wxNode *node, *next;
+ wxList::Node *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;
if (destroyable)
XFreeColormap(display, cmap);
- next = node->Next();
+ next = node->GetNext();
m_palettes.DeleteNode(node);
delete c;
}
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::Node* 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;
for (i = 0; i < pix_array_n; i++)
{
xcol.pixel = first->m_pix_array[i];
- XQueryColor((Display*) first->m_display, (Colormap) first->m_cmap, &xcol);
+ XQueryColor((Display*) first->m_display,
+ (Colormap) first->m_cmap, &xcol);
c->m_pix_array[i] =
- (XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0) ? 0 : xcol.pixel;
+ (XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0)
+ ? 0 : xcol.pixel;
}
// wxPalette* nonConstThis = (wxPalette*) this;
{
if (!M_PALETTEDATA)
return (unsigned long*) 0;
- wxNode *node;
+ wxList::Node *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)