]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/xpmhand.cpp
Added event Clone functions
[wxWidgets.git] / src / os2 / xpmhand.cpp
index 71eac3afa4f7e548e0f393210446c5cc3c3e6935..494bcf600886abbf9cd790c799c96705440e7c0c 100644 (file)
@@ -36,7 +36,7 @@
 
 #if wxUSE_XPM_IN_OS2
     #define FOR_MSW 1
 
 #if wxUSE_XPM_IN_OS2
     #define FOR_MSW 1
-    #include "../xpm/xpm.h"
+    #include "xpm.h"
 #endif
 
 #include  "wx/xpmhand.h"
 #endif
 
 #include  "wx/xpmhand.h"
@@ -69,7 +69,7 @@ static void XpmToBitmap(
     pRefData->m_nHeight    = vBm.cy;
     pRefData->m_nDepth     = vBm.cPlanes * vBm.cBitCount;
     pRefData->m_nNumColors = rXpmAttr.npixels;
     pRefData->m_nHeight    = vBm.cy;
     pRefData->m_nDepth     = vBm.cPlanes * vBm.cBitCount;
     pRefData->m_nNumColors = rXpmAttr.npixels;
-#if 0
+
     if (pXmask)
     {
         wxMask*                     pMask = new wxMask();
     if (pXmask)
     {
         wxMask*                     pMask = new wxMask();
@@ -80,7 +80,6 @@ static void XpmToBitmap(
                                                      ));
         pBitmap->SetMask(pMask);
     }
                                                      ));
         pBitmap->SetMask(pMask);
     }
-#endif
 } // end of XpmToBitmap
 
 IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
 } // end of XpmToBitmap
 
 IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
@@ -114,6 +113,7 @@ bool wxXPMFileHandler::LoadFile(
                                                                       ,&vXpmAttr
                                                                      );
         ::GpiDestroyPS(hPS);
                                                                       ,&vXpmAttr
                                                                      );
         ::GpiDestroyPS(hPS);
+        ::DevCloseDC(hDC);
         if (nErrorStatus == XpmSuccess)
         {
             XpmToBitmap( pBitmap
         if (nErrorStatus == XpmSuccess)
         {
             XpmToBitmap( pBitmap
@@ -181,6 +181,7 @@ bool wxXPMFileHandler::SaveFile(
                                                                          ,(XpmAttributes *) NULL
                                                                         );
         ::GpiDestroyPS(hPS);
                                                                          ,(XpmAttributes *) NULL
                                                                         );
         ::GpiDestroyPS(hPS);
+        ::DevCloseDC(hDC);
         return (nErrorStatus == XpmSuccess);
     }
     return FALSE;
         return (nErrorStatus == XpmSuccess);
     }
     return FALSE;
@@ -210,13 +211,15 @@ bool wxXPMDataHandler::Create(
     if (hPS)
     {
         vXpmAttr.valuemask = XpmReturnInfos | XpmColorTable;
     if (hPS)
     {
         vXpmAttr.valuemask = XpmReturnInfos | XpmColorTable;
+
         int                         nErrorStatus = XpmCreateImageFromData( &hPS
                                                                           ,(char **)pData
                                                                           ,&pXimage
                                                                           ,&pXmask
                                                                           ,&vXpmAttr
                                                                          );
         int                         nErrorStatus = XpmCreateImageFromData( &hPS
                                                                           ,(char **)pData
                                                                           ,&pXimage
                                                                           ,&pXmask
                                                                           ,&vXpmAttr
                                                                          );
-        GpiDestroyPS(hPS);
+        ::GpiDestroyPS(hPS);
+        ::DevCloseDC(hDC);
         if (nErrorStatus == XpmSuccess)
         {
             XpmToBitmap( pBitmap
         if (nErrorStatus == XpmSuccess)
         {
             XpmToBitmap( pBitmap