]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/clipbrd.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/clipbrd.cpp
3 // Purpose: Clipboard functionality
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/clipbrd.h"
32 #include "wx/object.h"
36 #include "wx/bitmap.h"
40 #include "wx/dataobj.h"
44 #include "wx/metafile.h"
49 #include "wx/palmos/private.h"
52 #include "wx/palmos/dib.h"
55 #if wxUSE_OLE && !defined(__WXWINCE__)
57 #define wxUSE_OLE_CLIPBOARD 1
58 #else // !wxUSE_DATAOBJ
59 // use Win clipboard API
60 #define wxUSE_OLE_CLIPBOARD 0
63 #if wxUSE_OLE_CLIPBOARD
65 #endif // wxUSE_OLE_CLIPBOARD
67 // ===========================================================================
69 // ===========================================================================
71 // ---------------------------------------------------------------------------
72 // old-style clipboard functions
73 // ---------------------------------------------------------------------------
75 static bool gs_wxClipboardIsOpen
= false;
77 bool wxOpenClipboard()
82 bool wxCloseClipboard()
87 bool wxEmptyClipboard()
92 bool wxIsClipboardOpened()
97 bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
)
103 bool wxSetClipboardData(wxDataFormat dataFormat
,
105 int width
, int height
)
110 void *wxGetClipboardData(wxDataFormat dataFormat
, long *len
)
117 wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
)
119 return (wxDataFormat::NativeFormat
)::EnumClipboardFormats(dataFormat
);
122 int wxRegisterClipboardFormat(wxChar
*formatName
)
124 return ::RegisterClipboardFormat(formatName
);
127 bool wxGetClipboardFormatName(wxDataFormat dataFormat
,
134 // ---------------------------------------------------------------------------
136 // ---------------------------------------------------------------------------
138 IMPLEMENT_DYNAMIC_CLASS(wxClipboard
, wxObject
)
140 wxClipboard::wxClipboard()
142 m_clearOnExit
= false;
146 wxClipboard::~wxClipboard()
154 void wxClipboard::Clear()
158 bool wxClipboard::Flush()
163 bool wxClipboard::Open()
165 return wxOpenClipboard();
168 bool wxClipboard::IsOpened() const
170 return wxIsClipboardOpened();
173 bool wxClipboard::SetData( wxDataObject
*data
)
178 bool wxClipboard::AddData( wxDataObject
*data
)
183 void wxClipboard::Close()
188 bool wxClipboard::IsSupported( wxDataFormat format
)
190 return wxIsClipboardFormatAvailable(format
);
193 bool wxClipboard::GetData( wxDataObject
& data
)
198 #endif // wxUSE_CLIPBOARD