#include "wx/msw/gdiimage.h"
#include "wx/bitmap.h"
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxGDIImageHandlerList);
+
+
#ifdef __WIN16__
# include "wx/msw/curico.h"
#endif // __WIN16__
int WXUNUSED(height),
int WXUNUSED(depth) = 1)
{
- return FALSE;
+ return false;
}
virtual bool Save(wxGDIImage *WXUNUSED(image),
const wxString& WXUNUSED(name),
int WXUNUSED(type))
{
- return FALSE;
+ return false;
}
virtual bool Load(wxGDIImage *image,
int desiredWidth, int desiredHeight)
{
wxIcon *icon = wxDynamicCast(image, wxIcon);
- wxCHECK_MSG( icon, FALSE, _T("wxIconHandler only works with icons") );
+ wxCHECK_MSG( icon, false, _T("wxIconHandler only works with icons") );
return LoadIcon(icon, name, flags, desiredWidth, desiredHeight);
}
// implementation
// ============================================================================
-wxList wxGDIImage::ms_handlers;
+wxGDIImageHandlerList wxGDIImage::ms_handlers;
// ----------------------------------------------------------------------------
// wxGDIImage functions forwarded to wxGDIImageRefData
GetGDIImageData()->m_handle = 0;
}
- return TRUE;
+ return true;
}
WXHANDLE wxGDIImage::GetResourceHandle() const
if ( handler )
{
ms_handlers.DeleteObject(handler);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& name)
{
- wxNode *node = ms_handlers.First();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->Data();
+ wxGDIImageHandler *handler = node->GetData();
if ( handler->GetName() == name )
return handler;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& extension,
long type)
{
- wxNode *node = ms_handlers.First();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->Data();
+ wxGDIImageHandler *handler = node->GetData();
if ( (handler->GetExtension() = extension) &&
(type == -1 || handler->GetType() == type) )
{
return handler;
}
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
wxGDIImageHandler *wxGDIImage::FindHandler(long type)
{
- wxNode *node = ms_handlers.First();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->Data();
+ wxGDIImageHandler *handler = node->GetData();
if ( handler->GetType() == type )
return handler;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
void wxGDIImage::CleanUpHandlers()
{
- wxNode *node = ms_handlers.First();
+ wxGDIImageHandlerList::Node *node = ms_handlers.GetFirst();
while ( node )
{
- wxGDIImageHandler *handler = (wxGDIImageHandler *)node->Data();
- wxNode *next = node->Next();
+ wxGDIImageHandler *handler = node->GetData();
+ wxGDIImageHandlerList::Node *next = node->GetNext();
delete handler;
delete node;
node = next;
wxLogError(wxT("Can't load bitmap '%s' from resources! Check .rc file."),
name.c_str());
- return FALSE;
+ return false;
}
BITMAP bm;
bitmap->SetHeight(bm.bmHeight);
bitmap->SetDepth(bm.bmBitsPixel);
- return TRUE;
+ return true;
}
bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap,
return success;
#else
- return FALSE;
+ return false;
#endif
}
return wxSaveBitmap(WXSTRINGCAST name, bitmap, actualPalette) != 0;
#else
- return FALSE;
+ return false;
#endif
}
wxLogSysError(_T("Failed to load icon from the file '%s'"),
name.c_str());
- return FALSE;
+ return false;
}
size = wxGetHiconSize(hicon);
(desiredHeight != -1 && desiredHeight != size.y) )
{
wxLogTrace(_T("iconload"),
- _T("Returning FALSE from wxICOFileHandler::Load because of the size mismatch: actual (%d, %d), requested (%d, %d)"),
+ _T("Returning false from wxICOFileHandler::Load because of the size mismatch: actual (%d, %d), requested (%d, %d)"),
size.x, size.y,
desiredWidth, desiredHeight);
::DestroyIcon(hicon);
- return FALSE;
+ return false;
}
icon->SetHICON((WXHICON)hicon);
return icon->Ok();
#else
- return FALSE;
+ return false;
#endif
}