class WXDLLEXPORT wxGDIImageHandler;
class WXDLLEXPORT wxGDIImage;
+WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList);
+
// ----------------------------------------------------------------------------
// wxGDIImageRefData: common data fields for all derived classes
// ----------------------------------------------------------------------------
{
public:
// handlers list interface
- static wxList& GetHandlers() { return ms_handlers; }
+ static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; }
static void AddHandler(wxGDIImageHandler* hHandler);
static void InsertHandler(wxGDIImageHandler* hHandler);
// create the data for the derived class here
virtual wxGDIImageRefData* CreateData() const = 0;
- static wxList ms_handlers;
+ static wxGDIImageHandlerList ms_handlers;
};
#endif // _WX_MSW_GDIIMAGE_H_
#include "wx/app.h"
#include "wx/os2/gdiimage.h"
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxGDIImageHandlerList);
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
// implementation
// ============================================================================
-wxList wxGDIImage::ms_handlers;
+wxGDIImageHandlerList wxGDIImage::ms_handlers;
// ----------------------------------------------------------------------------
// wxGDIImage functions forwarded to wxGDIImageRefData
long lType
)
{
- wxNode* pNode = ms_handlers.First();
-
- while (pNode)
+ wxGDIImageHandlerList::compatibility_iterator node = ms_handlers.GetFirst();
+ while ( node )
{
- wxGDIImageHandler* pHandler = (wxGDIImageHandler *)pNode->Data();
+ wxGDIImageHandler *handler = node->GetData();
+ if ( handler->GetType() == type )
+ return handler;
- if (pHandler->GetType() == lType)
- return pHandler;
- pNode = pNode->Next();
+ node = node->GetNext();
}
- return(NULL);
+
+ return((wxGDIImageHandler*)NULL);
}
void wxGDIImage::CleanUpHandlers()
{
- wxNode* pNode = ms_handlers.First();
-
- while (pNode)
+ wxGDIImageHandlerList::compatibility_iterator node = ms_handlers.GetFirst();
+ while ( node )
{
- wxGDIImageHandler* pHandler = (wxGDIImageHandler *)pNode->Data();
- wxNode* pNext = pNode->Next();
-
- delete pHandler;
-#if (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
- delete pNode;
-#endif
- pNode = pNext;
+ wxGDIImageHandler *handler = node->GetData();
+ wxGDIImageHandlerList::compatibility_iterator next = node->GetNext();
+ delete handler;
+ ms_handlers.Erase( node );
+ node = next;
}
}