X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..69120ee48a66faa743b6e7c85a745806f53228ac:/src/msw/gdiimage.cpp?ds=inline diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 9ac518a065..f2e84134d0 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "gdiimage.h" #endif @@ -49,6 +49,8 @@ #include #endif +#include "wx/file.h" + #include "wx/listimpl.cpp" WX_DEFINE_LIST(wxGDIImageHandlerList); @@ -149,6 +151,7 @@ public: { } +protected: virtual bool LoadIcon(wxIcon *icon, const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); @@ -166,6 +169,7 @@ public: { } +protected: virtual bool LoadIcon(wxIcon *icon, const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); @@ -263,7 +267,7 @@ wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& extension, while ( node ) { wxGDIImageHandler *handler = node->GetData(); - if ( (handler->GetExtension() = extension) && + if ( (handler->GetExtension() == extension) && (type == -1 || handler->GetType() == type) ) { return handler; @@ -345,6 +349,9 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, bitmap->SetHeight(bm.bmHeight); bitmap->SetDepth(bm.bmBitsPixel); + // use 0xc0c0c0 as transparent colour by default + bitmap->SetMask(new wxMask(*bitmap, *wxLIGHT_GREY)); + return true; } @@ -360,7 +367,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, return dib.IsOk() && bitmap->CopyFromDIB(dib); #else - return FALSE; + return false; #endif } @@ -376,7 +383,7 @@ bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, return dib.Save(name); #else - return FALSE; + return false; #endif } @@ -565,7 +572,10 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, wxSize wxGetHiconSize(HICON hicon) { - wxSize size(32, 32); // default + // default icon size on this hardware + // usually 32x32 but can be other (smaller) on pocket devices + wxSize size(::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + #ifndef __WXWINCE__ if ( hicon && wxGetOsVersion() != wxWIN32S ) { @@ -591,6 +601,8 @@ wxSize wxGetHiconSize(HICON hicon) ::DeleteObject(info.hbmColor); } } +#else + wxUnusedVar(hicon); #endif return size; }