]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: clipbrd.cpp | |
3 | // Purpose: Clipboard functionality | |
4 | // Author: William Osborne | |
5 | // Modified by: | |
6 | // Created: 10/13/04 | |
7 | // RCS-ID: $Id: | |
8 | // Copyright: (c) William Osborne | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // =========================================================================== | |
13 | // declarations | |
14 | // =========================================================================== | |
15 | ||
16 | // --------------------------------------------------------------------------- | |
17 | // headers | |
18 | // --------------------------------------------------------------------------- | |
19 | ||
20 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
21 | #pragma implementation "clipbrd.h" | |
22 | #endif | |
23 | ||
24 | // For compilers that support precompilation, includes "wx.h". | |
25 | #include "wx/wxprec.h" | |
26 | ||
27 | #ifdef __BORLANDC__ | |
28 | #pragma hdrstop | |
29 | #endif | |
30 | ||
31 | #ifndef WX_PRECOMP | |
32 | #include "wx/setup.h" | |
33 | #endif | |
34 | ||
35 | #if wxUSE_CLIPBOARD | |
36 | ||
37 | #ifndef WX_PRECOMP | |
38 | #include "wx/object.h" | |
39 | #include "wx/event.h" | |
40 | #include "wx/app.h" | |
41 | #include "wx/frame.h" | |
42 | #include "wx/bitmap.h" | |
43 | #include "wx/utils.h" | |
44 | #include "wx/intl.h" | |
45 | #endif | |
46 | ||
47 | #if wxUSE_METAFILE | |
48 | #include "wx/metafile.h" | |
49 | #endif | |
50 | ||
51 | #include "wx/log.h" | |
52 | #include "wx/clipbrd.h" | |
53 | ||
54 | #include <string.h> | |
55 | ||
56 | #include "wx/palmos/private.h" | |
57 | ||
58 | #if wxUSE_WXDIB | |
59 | #include "wx/palmos/dib.h" | |
60 | #endif | |
61 | ||
62 | #if wxUSE_DATAOBJ | |
63 | #include "wx/dataobj.h" | |
64 | #endif | |
65 | ||
66 | #if wxUSE_OLE && !defined(__WXWINCE__) | |
67 | // use OLE clipboard | |
68 | #define wxUSE_OLE_CLIPBOARD 1 | |
69 | #else // !wxUSE_DATAOBJ | |
70 | // use Win clipboard API | |
71 | #define wxUSE_OLE_CLIPBOARD 0 | |
72 | #endif | |
73 | ||
74 | #if wxUSE_OLE_CLIPBOARD | |
75 | #include <ole2.h> | |
76 | #endif // wxUSE_OLE_CLIPBOARD | |
77 | ||
78 | // =========================================================================== | |
79 | // implementation | |
80 | // =========================================================================== | |
81 | ||
82 | // --------------------------------------------------------------------------- | |
83 | // old-style clipboard functions | |
84 | // --------------------------------------------------------------------------- | |
85 | ||
86 | static bool gs_wxClipboardIsOpen = FALSE; | |
87 | ||
88 | bool wxOpenClipboard() | |
89 | { | |
90 | return false; | |
91 | } | |
92 | ||
93 | bool wxCloseClipboard() | |
94 | { | |
95 | return false; | |
96 | } | |
97 | ||
98 | bool wxEmptyClipboard() | |
99 | { | |
100 | return false; | |
101 | } | |
102 | ||
103 | bool wxIsClipboardOpened() | |
104 | { | |
105 | return false; | |
106 | } | |
107 | ||
108 | bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) | |
109 | { | |
110 | return false; | |
111 | } | |
112 | ||
113 | ||
114 | bool wxSetClipboardData(wxDataFormat dataFormat, | |
115 | const void *data, | |
116 | int width, int height) | |
117 | { | |
118 | return false; | |
119 | } | |
120 | ||
121 | void *wxGetClipboardData(wxDataFormat dataFormat, long *len) | |
122 | { | |
123 | void *retval = NULL; | |
124 | ||
125 | return retval; | |
126 | } | |
127 | ||
128 | wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat) | |
129 | { | |
130 | return (wxDataFormat::NativeFormat)::EnumClipboardFormats(dataFormat); | |
131 | } | |
132 | ||
133 | int wxRegisterClipboardFormat(wxChar *formatName) | |
134 | { | |
135 | return ::RegisterClipboardFormat(formatName); | |
136 | } | |
137 | ||
138 | bool wxGetClipboardFormatName(wxDataFormat dataFormat, | |
139 | wxChar *formatName, | |
140 | int maxCount) | |
141 | { | |
142 | return false; | |
143 | } | |
144 | ||
145 | // --------------------------------------------------------------------------- | |
146 | // wxClipboard | |
147 | // --------------------------------------------------------------------------- | |
148 | ||
149 | IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) | |
150 | ||
151 | wxClipboard::wxClipboard() | |
152 | { | |
153 | m_clearOnExit = FALSE; | |
154 | m_isOpened = FALSE; | |
155 | } | |
156 | ||
157 | wxClipboard::~wxClipboard() | |
158 | { | |
159 | if ( m_clearOnExit ) | |
160 | { | |
161 | Clear(); | |
162 | } | |
163 | } | |
164 | ||
165 | void wxClipboard::Clear() | |
166 | { | |
167 | } | |
168 | ||
169 | bool wxClipboard::Flush() | |
170 | { | |
171 | return false; | |
172 | } | |
173 | ||
174 | bool wxClipboard::Open() | |
175 | { | |
176 | return wxOpenClipboard(); | |
177 | } | |
178 | ||
179 | bool wxClipboard::IsOpened() const | |
180 | { | |
181 | return wxIsClipboardOpened(); | |
182 | } | |
183 | ||
184 | bool wxClipboard::SetData( wxDataObject *data ) | |
185 | { | |
186 | return false; | |
187 | } | |
188 | ||
189 | bool wxClipboard::AddData( wxDataObject *data ) | |
190 | { | |
191 | return false; | |
192 | } | |
193 | ||
194 | void wxClipboard::Close() | |
195 | { | |
196 | wxCloseClipboard(); | |
197 | } | |
198 | ||
199 | bool wxClipboard::IsSupported( wxDataFormat format ) | |
200 | { | |
201 | return wxIsClipboardFormatAvailable(format); | |
202 | } | |
203 | ||
204 | bool wxClipboard::GetData( wxDataObject& data ) | |
205 | { | |
206 | return false; | |
207 | } | |
208 | ||
209 | #endif // wxUSE_CLIPBOARD | |
210 |