///////////////////////////////////////////////////////////////////////////////
-// 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
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
- #pragma implementation "dataobj.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
+#include "wx/dataobj.h"
#ifndef WX_PRECOMP
-#include "wx/intl.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/image.h"
#endif
-#include "wx/defs.h"
-#include "wx/log.h"
-#include "wx/dataobj.h"
#include "wx/mstream.h"
-#include "wx/image.h"
#include "wx/mac/private.h"
#include <Scrap.h>
// wxFileDataObject
// ----------------------------------------------------------------------------
-bool wxFileDataObject::GetDataHere(
- void* pBuf
-) const
+bool wxFileDataObject::GetDataHere( void* pBuf ) const
{
- wxString sFilenames;
+ wxString sFilenames;
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
sFilenames += (wxChar)0;
}
- memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1);
- return TRUE;
+ memcpy(pBuf, sFilenames.mbc_str(), sFilenames.length() + 1);
+ return true;
}
size_t wxFileDataObject::GetDataSize() const
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
- nRes += m_filenames[i].Len();
+ nRes += m_filenames[i].length();
nRes += 1;
}
AddFile(wxString::FromAscii((char*)pBuf));
- return TRUE;
+ return true;
}
void wxFileDataObject::AddFile(
}
}
-void wxBitmapDataObject::Init()
-{
+void wxBitmapDataObject::Init()
+{
m_pictHandle = NULL ;
m_pictCreated = false ;
-}
+}
-void wxBitmapDataObject::Clear()
+void wxBitmapDataObject::Clear()
{
if ( m_pictCreated && m_pictHandle )
{
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
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 ) ;