X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..1e9bafca0f56de34638d4c3fef8cf74fe9351193:/src/msw/gdiimage.cpp?ds=sidebyside diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 2e6ae1b7f5..a8355e703a 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "gdiimage.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -49,8 +45,10 @@ #include #endif +#include "wx/file.h" + #include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxGDIImageHandlerList); +WX_DEFINE_LIST(wxGDIImageHandlerList) // ---------------------------------------------------------------------------- // private classes @@ -149,6 +147,7 @@ public: { } +protected: virtual bool LoadIcon(wxIcon *icon, const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); @@ -166,6 +165,7 @@ public: { } +protected: virtual bool LoadIcon(wxIcon *icon, const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); @@ -263,7 +263,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 +345,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 +363,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, return dib.IsOk() && bitmap->CopyFromDIB(dib); #else - return FALSE; + return false; #endif } @@ -376,7 +379,7 @@ bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, return dib.Save(name); #else - return FALSE; + return false; #endif } @@ -563,9 +566,12 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, // private functions // ---------------------------------------------------------------------------- -wxSize wxGetHiconSize(HICON hicon) +wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(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 ) { @@ -592,6 +598,7 @@ wxSize wxGetHiconSize(HICON hicon) } } #endif + return size; }