]>
Commit | Line | Data |
---|---|---|
3f364be8 VZ |
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) | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 1998, 1999 Vadim Zeitlin, Robert Roebling | |
65571936 | 8 | // Licence: wxWindows licence |
3f364be8 VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_GTK_DATAOBJ2_H_ | |
12 | #define _WX_GTK_DATAOBJ2_H_ | |
13 | ||
3f364be8 VZ |
14 | // ---------------------------------------------------------------------------- |
15 | // wxBitmapDataObject is a specialization of wxDataObject for bitmaps | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
20123d49 | 18 | class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase |
3f364be8 VZ |
19 | { |
20 | public: | |
21 | // ctors | |
22 | wxBitmapDataObject(); | |
23 | wxBitmapDataObject(const wxBitmap& bitmap); | |
24 | ||
25 | // destr | |
26 | ~wxBitmapDataObject(); | |
27 | ||
28 | // override base class virtual to update PNG data too | |
29 | virtual void SetBitmap(const wxBitmap& bitmap); | |
30 | ||
3f364be8 VZ |
31 | // implement base class pure virtuals |
32 | // ---------------------------------- | |
33 | ||
34 | virtual size_t GetDataSize() const { return m_pngSize; } | |
35 | virtual bool GetDataHere(void *buf) const; | |
36 | virtual bool SetData(size_t len, const void *buf); | |
6f02a879 VZ |
37 | // Must provide overloads to avoid hiding them (and warnings about it) |
38 | virtual size_t GetDataSize(const wxDataFormat&) const | |
39 | { | |
40 | return GetDataSize(); | |
41 | } | |
42 | virtual bool GetDataHere(const wxDataFormat&, void *buf) const | |
43 | { | |
44 | return GetDataHere(buf); | |
45 | } | |
46 | virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) | |
47 | { | |
48 | return SetData(len, buf); | |
49 | } | |
3f364be8 VZ |
50 | |
51 | protected: | |
52 | void Init() { m_pngData = (void *)NULL; m_pngSize = 0; } | |
53 | void Clear() { free(m_pngData); } | |
54 | void ClearAll() { Clear(); Init(); } | |
55 | ||
3f364be8 VZ |
56 | size_t m_pngSize; |
57 | void *m_pngData; | |
58 | ||
59 | void DoConvertToPng(); | |
60 | }; | |
61 | ||
62 | // ---------------------------------------------------------------------------- | |
63 | // wxFileDataObject is a specialization of wxDataObject for file names | |
64 | // ---------------------------------------------------------------------------- | |
65 | ||
20123d49 | 66 | class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase |
3f364be8 VZ |
67 | { |
68 | public: | |
69 | // implement base class pure virtuals | |
70 | // ---------------------------------- | |
71 | ||
b068c4e8 RR |
72 | void AddFile( const wxString &filename ); |
73 | ||
3f364be8 VZ |
74 | virtual size_t GetDataSize() const; |
75 | virtual bool GetDataHere(void *buf) const; | |
76 | virtual bool SetData(size_t len, const void *buf); | |
6f02a879 VZ |
77 | // Must provide overloads to avoid hiding them (and warnings about it) |
78 | virtual size_t GetDataSize(const wxDataFormat&) const | |
79 | { | |
80 | return GetDataSize(); | |
81 | } | |
82 | virtual bool GetDataHere(const wxDataFormat&, void *buf) const | |
83 | { | |
84 | return GetDataHere(buf); | |
85 | } | |
86 | virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) | |
87 | { | |
88 | return SetData(len, buf); | |
89 | } | |
3f364be8 VZ |
90 | }; |
91 | ||
92 | #endif // _WX_GTK_DATAOBJ2_H_ | |
93 |