]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/bitmap.cpp
substitute '@b NB:' with '@note'; first partial revision of e*h headers; replace...
[wxWidgets.git] / src / os2 / bitmap.cpp
index 068ccb02949f490423707f51a30af82aef130d21..73912fabc741072196b8495b3fe728af5a65d1a9 100644 (file)
@@ -27,6 +27,7 @@
     #include "wx/image.h"
 #endif
 
+#include "wx/os2/dc.h"
 #include "wx/os2/private.h"
 
 #include "wx/xpmdecod.h"
@@ -38,7 +39,6 @@
 IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
 IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
 
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
 
 // ============================================================================
 // implementation
@@ -94,12 +94,7 @@ void wxBitmapRefData::Free()
 // wxBitmap creation
 // ----------------------------------------------------------------------------
 
-wxObjectRefData* wxBitmap::CreateRefData() const
-{
-    return new wxBitmapRefData;
-}
-
-wxObjectRefData* wxBitmap::CloneRefData(const wxObjectRefData* data) const
+wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const
 {
     return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
 }
@@ -933,9 +928,12 @@ wxImage wxBitmap::ConvertToImage() const
     //
     // May already be selected into a PS
     //
-    if ((pDC = GetSelectedInto()) != NULL)
+    pDC = GetSelectedInto();
+    const wxPMDCImpl *impl; 
+    if (pDC != NULL &&
+        (impl = wxDynamicCast( pDC->GetImpl(), wxPMDCImpl )) != NULL)
     {
-        hPSMem = pDC->GetHPS();
+        hPSMem = impl->GetHPS();
     }
     else
     {
@@ -1458,7 +1456,7 @@ bool wxMask::Create(
 
 bool wxBitmapHandler::Create( wxGDIImage* pImage,
                               const void* pData,
-                              long        WXUNUSED(lFlags),
+                              wxBitmapType WXUNUSED(lFlags),
                               int         nWidth,
                               int         nHeight,
                               int         nDepth)
@@ -1478,7 +1476,7 @@ bool wxBitmapHandler::Create( wxGDIImage* pImage,
 bool wxBitmapHandler::Load(
   wxGDIImage*                       pImage
 , int                               nId
-, long                              lFlags
+, wxBitmapType                      lFlags
 , int                               nWidth
 , int                               nHeight
 )
@@ -1499,7 +1497,7 @@ bool wxBitmapHandler::Save(
   wxGDIImage*                       pImage
 , const wxString&                   rName
 , int                               lType
-)
+) const
 {
     wxBitmap*                       pBitmap = wxDynamicCast( pImage
                                                             ,wxBitmap
@@ -1514,7 +1512,7 @@ bool wxBitmapHandler::Save(
 bool wxBitmapHandler::Create(
   wxBitmap*                         WXUNUSED(pBitmap)
 , const void*                       WXUNUSED(pData)
-, long                              WXUNUSED(lType)
+, wxBitmapType                      WXUNUSED(lType)
 , int                               WXUNUSED(nWidth)
 , int                               WXUNUSED(nHeight)
 , int                               WXUNUSED(nDepth)
@@ -1526,7 +1524,7 @@ bool wxBitmapHandler::Create(
 bool wxBitmapHandler::LoadFile(
   wxBitmap*                         WXUNUSED(pBitmap)
 , int                               WXUNUSED(nId)
-, long                              WXUNUSED(lType)
+, wxBitmapType                      WXUNUSED(lType)
 , int                               WXUNUSED(nDesiredWidth)
 , int                               WXUNUSED(nDesiredHeight)
 )
@@ -1537,7 +1535,7 @@ bool wxBitmapHandler::LoadFile(
 bool wxBitmapHandler::LoadFile(
   wxBitmap*                         WXUNUSED(pBitmap)
 , const wxString&                   WXUNUSED(rName)
-, long                              WXUNUSED(lType)
+, wxBitmapType                      WXUNUSED(lType)
 , int                               WXUNUSED(nDesiredWidth)
 , int                               WXUNUSED(nDesiredHeight)
 )
@@ -1548,9 +1546,9 @@ bool wxBitmapHandler::LoadFile(
 bool wxBitmapHandler::SaveFile(
   wxBitmap*                         WXUNUSED(pBitmap)
 , const wxString&                   WXUNUSED(rName)
-, int                               WXUNUSED(nType)
+, wxBitmapType                      WXUNUSED(nType)
 , const wxPalette*                  WXUNUSED(pPalette)
-)
+) const
 {
     return false;
 }