X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..b4446c244775324631b8dd2b588ea35f32e71728:/src/mac/classic/dataobj.cpp diff --git a/src/mac/classic/dataobj.cpp b/src/mac/classic/dataobj.cpp index d2f130a23e..0c26a14a5b 100644 --- a/src/mac/classic/dataobj.cpp +++ b/src/mac/classic/dataobj.cpp @@ -1,14 +1,20 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataobj.cpp +// Name: src/mac/classic/dataobj.cpp // Purpose: implementation of wxDataObject class // Author: Stefan Csomor // Modified by: // Created: 10/21/99 // RCS-ID: $Id$ // Copyright: (c) 1999 Stefan Csomor -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + // ============================================================================ // declarations // ============================================================================ @@ -17,19 +23,11 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "dataobj.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - #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" @@ -170,9 +168,7 @@ bool wxDataObject::IsSupportedFormat( // wxFileDataObject // ---------------------------------------------------------------------------- -bool wxFileDataObject::GetDataHere( - void* pBuf -) const +bool wxFileDataObject::GetDataHere( void* pBuf ) const { wxString sFilenames; @@ -183,7 +179,7 @@ bool wxFileDataObject::GetDataHere( } memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1); - return TRUE; + return true; } size_t wxFileDataObject::GetDataSize() const @@ -208,7 +204,7 @@ bool wxFileDataObject::SetData( AddFile(wxString::FromAscii((char*)pBuf)); - return TRUE; + return true; } void wxFileDataObject::AddFile( @@ -256,13 +252,13 @@ void wxBitmapDataObject::SetBitmap( } } -void wxBitmapDataObject::Init() -{ +void wxBitmapDataObject::Init() +{ m_pictHandle = NULL ; m_pictCreated = false ; -} +} -void wxBitmapDataObject::Clear() +void wxBitmapDataObject::Clear() { if ( m_pictCreated && m_pictHandle ) { @@ -271,17 +267,15 @@ void wxBitmapDataObject::Clear() m_pictHandle = NULL ; } -bool wxBitmapDataObject::GetDataHere( - void* pBuf -) const +bool wxBitmapDataObject::GetDataHere( void* pBuf ) const { if (!m_pictHandle) { wxFAIL_MSG(wxT("attempt to copy empty bitmap failed")); - return FALSE; + return false; } memcpy(pBuf, *(Handle)m_pictHandle, GetHandleSize((Handle)m_pictHandle)); - return TRUE; + return true; } size_t wxBitmapDataObject::GetDataSize() const @@ -300,7 +294,7 @@ bool wxBitmapDataObject::SetData( m_pictHandle = picHandle ; m_pictCreated = false ; Rect frame = (**picHandle).picFrame ; - + m_bitmap.SetPict( picHandle ) ; m_bitmap.SetWidth( frame.right - frame.left ) ; m_bitmap.SetHeight( frame.bottom - frame.top ) ;