]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/dataobj.cpp
wxWinCE power build fixes.
[wxWidgets.git] / src / os2 / dataobj.cpp
index e0941f626816903b2a1bc69470d28aa81084dd46..3dfd2b17e5a1ebc14580f2d1752cde35f246a743 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        os2/dataobj.cpp
+// Name:        src/os2/dataobj.cpp
 // Purpose:     implementation of wx[I]DataObject class
 // Author:      David Webster
 // Modified by:
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
-  #pragma implementation "dataobj.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_DATAOBJ
+
 #ifndef WX_PRECOMP
-#include "wx/intl.h"
+    #include "wx/intl.h"
+    #include "wx/log.h"
 #endif
-#include "wx/defs.h"
 
-#include "wx/log.h"
 #include "wx/dataobj.h"
 #include "wx/mstream.h"
 #include "wx/image.h"
 
-#define INCL_DOS
-#include <os2.h>
+#include "wx/os2/private.h"
 
 // ----------------------------------------------------------------------------
 // functions
@@ -94,15 +90,13 @@ private:
     DRAGITEM                        m_vDragItem;
 }; // end of CLASS CIDataObject
 
-bool CIDataObject::GetData (
-  const wxDataFormat&               rFormat
-, char*                             pzBuffer
-, ULONG                             ulLen
-)
+bool CIDataObject::GetData ( const wxDataFormat& rFormat,
+                             char* pzBuffer,
+                             ULONG ulLen )
 {
     QueryGetData(rFormat);
     if (rFormat.GetType() == wxDF_INVALID)
-        return FALSE;
+        return false;
 
     ULONG                           ulSize = m_pDataObject->GetDataSize(rFormat);
 
@@ -111,7 +105,7 @@ bool CIDataObject::GetData (
         //
         // It probably means that the method is just not implemented
         //
-        return FALSE;
+        return false;
     }
     if (rFormat.GetType() == wxDF_PRIVATE)
     {
@@ -123,7 +117,7 @@ bool CIDataObject::GetData (
     }
 
     if (ulSize > ulLen) // not enough room to copy
-        return FALSE;
+        return false;
 
     //
     // Copy the data
@@ -132,7 +126,7 @@ bool CIDataObject::GetData (
                 ,pzBuffer
                 ,ulSize
                );
-    return TRUE;
+    return true;
 } // end of CIDataObject::GetData
 
 void CIDataObject::GetDataHere(
@@ -225,9 +219,7 @@ wxDataObject::~wxDataObject ()
 // wxFileDataObject
 // ----------------------------------------------------------------------------
 
-bool wxFileDataObject::GetDataHere(
-  void*                             pBuf
-) const
+bool wxFileDataObject::GetDataHere( void* pBuf ) const
 {
     wxString                        sFilenames;
 
@@ -238,7 +230,7 @@ bool wxFileDataObject::GetDataHere(
     }
 
     memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1);
-    return TRUE;
+    return true;
 }
 
 size_t wxFileDataObject::GetDataSize() const
@@ -254,18 +246,16 @@ size_t wxFileDataObject::GetDataSize() const
     return nRes + 1;
 }
 
-bool wxFileDataObject::SetData(
-  size_t                            WXUNUSED(nSize)
-, const void*                       pBuf
-)
+bool wxFileDataObject::SetData( size_t WXUNUSED(nSize),
+                                const void* pBuf )
 {
     /* TODO */
 
-    wxString                        sFile((const wxChar *)pBuf);  /* char, not wxChar */
+    wxString sFile((const wxChar *)pBuf);  /* char, not wxChar */
 
     AddFile(sFile);
 
-    return TRUE;
+    return true;
 }
 
 void wxFileDataObject::AddFile(
@@ -299,32 +289,25 @@ wxBitmapDataObject::~wxBitmapDataObject()
     Clear();
 }
 
-void wxBitmapDataObject::SetBitmap(
-  const wxBitmap&                   rBitmap
-)
+void wxBitmapDataObject::SetBitmap( const wxBitmap& rBitmap )
 {
     ClearAll();
     wxBitmapDataObjectBase::SetBitmap(rBitmap);
     DoConvertToPng();
 }
 
-bool wxBitmapDataObject::GetDataHere(
-  void*                             pBuf
-) const
+bool wxBitmapDataObject::GetDataHere( void* pBuf ) const
 {
     if (!m_pngSize)
     {
         wxFAIL_MSG(wxT("attempt to copy empty bitmap failed"));
-        return FALSE;
+        return false;
     }
     memcpy(pBuf, m_pngData, m_pngSize);
-    return TRUE;
+    return true;
 }
 
-bool wxBitmapDataObject::SetData(
-  size_t                            nSize
-, const void*                       pBuf
-)
+bool wxBitmapDataObject::SetData( size_t nSize, const void* pBuf)
 {
     Clear();
     m_pngSize = nSize;
@@ -339,7 +322,7 @@ bool wxBitmapDataObject::SetData(
 
     if (!vHandler.LoadFile(&vImage, vMstream))
     {
-        return FALSE;
+        return false;
     }
 
     m_bitmap = wxBitmap(vImage);
@@ -369,3 +352,4 @@ void wxBitmapDataObject::DoConvertToPng()
 #endif
 }
 
+#endif // wxUSE_DATAOBJ