X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/31528cd3cac75558beef4bce0ba21fd182a808ab..c8b4eea8f23cd90e8b8390f2a742f0f828c57461:/src/motif/bitmap.cpp?ds=sidebyside diff --git a/src/motif/bitmap.cpp b/src/motif/bitmap.cpp index 58bc1cc259..90c225d8ae 100644 --- a/src/motif/bitmap.cpp +++ b/src/motif/bitmap.cpp @@ -21,8 +21,15 @@ #include "wx/log.h" #include "wx/control.h" #include "wx/dcmemory.h" +#include "wx/image.h" +#ifdef __VMS__ +#pragma message disable nosimpint +#endif #include +#ifdef __VMS__ +#pragma message enable nosimpint +#endif #include "wx/motif/private.h" @@ -30,10 +37,8 @@ #include #endif -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) -#endif wxBitmapRefData::wxBitmapRefData() { @@ -197,9 +202,14 @@ bool wxBitmap::LoadFile(const wxString& filename, long type) wxBitmapHandler *handler = FindHandler(type); if ( handler == NULL ) { - wxLogWarning("%s: no bitmap handler for type %d defined.", (const char*) filename, type); - - return FALSE; + wxImage image; + if (!image.LoadFile( filename, type )) return FALSE; + if (image.Ok()) + { + *this = image.ConvertToBitmap(); + return TRUE; + } + else return FALSE; } return handler->LoadFile(this, filename, type, -1, -1); @@ -226,10 +236,10 @@ bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *pal { wxBitmapHandler *handler = FindHandler(type); - if ( handler == NULL ) { - wxLogWarning("no bitmap handler for type %d defined.", type); - - return FALSE; + if ( handler == NULL ) { // try wxImage + wxImage image( *this ); + if (image.Ok()) return image.SaveFile( filename, type ); + else return FALSE; } return handler->SaveFile(this, filename, type, palette); @@ -1010,7 +1020,7 @@ XCreateInsensitivePixmap( Display *display, Pixmap pixmap ) // Creates a bitmap with transparent areas drawn in // the given colour. -wxBitmap wxCreateMaskedBitmap(wxBitmap& bitmap, wxColour& colour) +wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour) { wxBitmap newBitmap(bitmap.GetWidth(), bitmap.GetHeight(),