]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/xpmhand.cpp
added xpm
[wxWidgets.git] / src / msw / xpmhand.cpp
index 064e9fc34a6bf1c16e12d1efbf870f1c739af864..25b20662495eb8ca624461af022c3ad8bb2cf25b 100644 (file)
 
 #if wxUSE_XPM_IN_MSW
     #define FOR_MSW 1
-    #include "../xpm/xpm.h"
+
+    // allow the user to use the system-wide xpm.h by defining
+    // wxUSE_XPM_H_IN_PATH (and always use xpm.h in path if __WX_SETUP_H__ is
+    // defined which means that we use configure as it always add -I../xpm to
+    // the include path if needed)
+    #if !defined(__WX_SETUP_H__) && !defined(wxUSE_XPM_H_IN_PATH)
+        #include "../xpm/xpm.h"
+    #else
+        #include <xpm.h>
+    #endif
 #endif
 
 #include "wx/xpmhand.h"
@@ -55,7 +64,7 @@ static void XpmToBitmap(wxBitmap *bitmap,
     BITMAP bm;
     if ( !::GetObject(GetHbitmapOf(*bitmap), sizeof(bm), (LPSTR) & bm) )
     {
-        wxLogLastError("GetObject(bitmap)");
+        wxLogLastError(wxT("GetObject(bitmap)"));
     }
 
     refData->m_width     = bm.bmWidth;
@@ -67,7 +76,8 @@ static void XpmToBitmap(wxBitmap *bitmap,
     if (xmask)
     {
         wxMask *mask = new wxMask();
-        mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap));
+        mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap,
+                                                     bm.bmWidth, bm.bmHeight));
         bitmap->SetMask(mask);
     }
 }
@@ -78,8 +88,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
 
 bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap,
                                 const wxString& name,
-                                long flags,
-                                int desiredWidth, int desiredHeight)
+                                long WXUNUSED(flags),
+                                int WXUNUSED(desiredWidth),
+                                                               int WXUNUSED(desiredHeight))
 {
 #if wxUSE_XPM_IN_MSW
     XImage *ximage = NULL;
@@ -121,8 +132,8 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap,
 
 bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap,
                                 const wxString& name,
-                                int type,
-                                const wxPalette *palette)
+                                int WXUNUSED(type),
+                                const wxPalette *WXUNUSED(palette))
 {
 #if wxUSE_XPM_IN_MSW
     XImage ximage;
@@ -174,10 +185,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
 
 bool wxXPMDataHandler::Create(wxBitmap *bitmap,
                               void *data,
-                              long flags,
-                              int width,
-                              int height,
-                              int depth)
+                              long WXUNUSED(flags),
+                              int WXUNUSED(width),
+                              int WXUNUSED(height),
+                              int WXUNUSED(depth))
 {
 #if wxUSE_XPM_IN_MSW
   XImage *ximage = NULL;