]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/motif/dataobj.cpp
wxWindow::Fit() infinite loop bug fixed
[wxWidgets.git] / src / motif / dataobj.cpp
... / ...
CommitLineData
1///////////////////////////////////////////////////////////////////////////////
2// Name: dataobj.cpp
3// Purpose: wxDataObject class
4// Author: Julian Smart
5// Id: $Id$
6// Copyright: (c) 1998 Julian Smart
7// Licence: wxWindows licence
8///////////////////////////////////////////////////////////////////////////////
9
10#ifdef __GNUG__
11#pragma implementation "dataobj.h"
12#endif
13
14#include "wx/dataobj.h"
15#include "wx/app.h"
16
17//-------------------------------------------------------------------------
18// wxDataObject
19//-------------------------------------------------------------------------
20
21IMPLEMENT_ABSTRACT_CLASS( wxDataObject, wxObject )
22
23// ----------------------------------------------------------------------------
24// wxTextDataObject
25// ----------------------------------------------------------------------------
26
27IMPLEMENT_DYNAMIC_CLASS( wxTextDataObject, wxDataObject )
28
29// ----------------------------------------------------------------------------
30// wxFileDataObject
31// ----------------------------------------------------------------------------
32
33IMPLEMENT_DYNAMIC_CLASS( wxFileDataObject, wxDataObject )
34
35// ----------------------------------------------------------------------------
36// wxBitmapDataObject
37// ----------------------------------------------------------------------------
38
39IMPLEMENT_DYNAMIC_CLASS( wxBitmapDataObject, wxDataObject )
40
41// ----------------------------------------------------------------------------
42// wxPrivateDataObject
43// ----------------------------------------------------------------------------
44
45IMPLEMENT_DYNAMIC_CLASS( wxPrivateDataObject, wxDataObject )
46
47wxPrivateDataObject::wxPrivateDataObject()
48{
49 m_size = 0;
50 m_data = (char*) NULL;
51 m_id = wxTheApp->GetAppName();
52}
53
54wxPrivateDataObject::~wxPrivateDataObject()
55{
56 if (m_data) delete[] m_data;
57}
58
59void wxPrivateDataObject::SetData( const char *data, size_t size )
60{
61 m_size = size;
62
63 if (m_data) delete[] m_data;
64
65 m_data = new char[size];
66
67 memcpy( m_data, data, size );
68}
69