]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/dataobj2.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: gtk/dataobj2.h
3 // Purpose: declaration of standard wxDataObjectSimple-derived classes
4 // Author: Robert Roebling
5 // Created: 19.10.99 (extracted from gtk/dataobj.h)
7 // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling
8 // Licence: wxWindows license
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_DATAOBJ2_H_
12 #define _WX_GTK_DATAOBJ2_H_
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "dataobj.h"
18 // ----------------------------------------------------------------------------
19 // wxBitmapDataObject is a specialization of wxDataObject for bitmaps
20 // ----------------------------------------------------------------------------
22 class wxBitmapDataObject
: public wxBitmapDataObjectBase
27 wxBitmapDataObject(const wxBitmap
& bitmap
);
30 ~wxBitmapDataObject();
32 // override base class virtual to update PNG data too
33 virtual void SetBitmap(const wxBitmap
& bitmap
);
35 // implement base class pure virtuals
36 // ----------------------------------
38 virtual size_t GetDataSize() const { return m_pngSize
; }
39 virtual bool GetDataHere(void *buf
) const;
40 virtual bool SetData(size_t len
, const void *buf
);
43 void Init() { m_pngData
= (void *)NULL
; m_pngSize
= 0; }
44 void Clear() { free(m_pngData
); }
45 void ClearAll() { Clear(); Init(); }
50 void DoConvertToPng();
53 // virtual function hiding supression
54 size_t GetDataSize(const wxDataFormat
& format
) const
55 { return(wxDataObjectSimple::GetDataSize(format
)); }
56 bool GetDataHere(const wxDataFormat
& format
, void* pBuf
) const
57 { return(wxDataObjectSimple::GetDataHere(format
, pBuf
)); }
58 bool SetData(const wxDataFormat
& format
, size_t nLen
, const void* pBuf
)
59 { return(wxDataObjectSimple::SetData(format
, nLen
, pBuf
)); }
62 // ----------------------------------------------------------------------------
63 // wxFileDataObject is a specialization of wxDataObject for file names
64 // ----------------------------------------------------------------------------
66 class wxFileDataObject
: public wxFileDataObjectBase
69 // implement base class pure virtuals
70 // ----------------------------------
72 void AddFile( const wxString
&filename
);
74 virtual size_t GetDataSize() const;
75 virtual bool GetDataHere(void *buf
) const;
76 virtual bool SetData(size_t len
, const void *buf
);
79 // virtual function hiding supression
80 size_t GetDataSize(const wxDataFormat
& format
) const
81 { return(wxDataObjectSimple::GetDataSize(format
)); }
82 bool GetDataHere(const wxDataFormat
& format
, void* pBuf
) const
83 { return(wxDataObjectSimple::GetDataHere(format
, pBuf
)); }
84 bool SetData(const wxDataFormat
& format
, size_t nLen
, const void* pBuf
)
85 { return(wxDataObjectSimple::SetData(format
, nLen
, pBuf
)); }
88 #endif // _WX_GTK_DATAOBJ2_H_