X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62ad3cb358891240142cbf33259758bbe79be53f..ee146bca1b2d76b3e486c66a2d5ad15e44f2cbd0:/src/common/bmpbase.cpp diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp index 6e007f98f4..7868b0b775 100644 --- a/src/common/bmpbase.cpp +++ b/src/common/bmpbase.cpp @@ -8,10 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "bitmapbase.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -19,8 +15,11 @@ #pragma hdrstop #endif -#if defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXCOCOA__) \ - || defined(__WXMOTIF__) || defined(__WXX11__) +#if defined(__WXMGL__) || \ + defined(__WXMAC__) || \ + defined(__WXGTK__) || \ + defined(__WXMOTIF__) || \ + defined(__WXX11__) #include "wx/setup.h" #include "wx/utils.h" @@ -52,15 +51,15 @@ bool wxBitmapBase::RemoveHandler(const wxString& name) if ( handler ) { sm_handlers.DeleteObject(handler); - return TRUE; + return true; } else - return FALSE; + return false; } wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name) { - wxList::Node *node = sm_handlers.GetFirst(); + wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); @@ -73,12 +72,12 @@ wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name) wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapType bitmapType) { - wxList::Node *node = sm_handlers.GetFirst(); + wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); if ( handler->GetExtension() == extension && - (bitmapType == -1 || handler->GetType() == bitmapType) ) + (bitmapType == wxBITMAP_TYPE_ANY || handler->GetType() == bitmapType) ) return handler; node = node->GetNext(); } @@ -87,7 +86,7 @@ wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapTy wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType) { - wxList::Node *node = sm_handlers.GetFirst(); + wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); @@ -100,13 +99,13 @@ wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType) void wxBitmapBase::CleanUpHandlers() { - wxList::Node *node = sm_handlers.GetFirst(); + wxList::compatibility_iterator node = sm_handlers.GetFirst(); while ( node ) { wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); - wxList::Node *next = node->GetNext(); + wxList::compatibility_iterator next = node->GetNext(); delete handler; - delete node; + sm_handlers.Erase(node); node = next; } } @@ -116,11 +115,10 @@ class wxBitmapBaseModule: public wxModule DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule) public: wxBitmapBaseModule() {} - bool OnInit() { wxBitmap::InitStandardHandlers(); return TRUE; }; + bool OnInit() { wxBitmap::InitStandardHandlers(); return true; }; void OnExit() { wxBitmap::CleanUpHandlers(); }; }; IMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule) -#endif // defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXCOCOA__) || defined(__WXMOTIF__) || defined(__WXX11__) - +#endif // __WXMGL__ || __WXMAC__ || __WXCOCOA__ || __WXMOTIF__ || __WXX11__