]>
git.saurik.com Git - wxWidgets.git/blob - src/common/clipcmn.cpp
09a62dc49664e49fb3dfef7d0cb7352f0d324e1a
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/clipcmn.cpp
3 // Purpose: common (to all ports) wxClipboard functions
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
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/dataobj.h"
33 #include "wx/module.h"
36 // ---------------------------------------------------------
38 // ---------------------------------------------------------
40 IMPLEMENT_DYNAMIC_CLASS(wxClipboardEvent
,wxEvent
)
42 DEFINE_EVENT_TYPE(wxEVT_CLIPBOARD_CHANGED
)
44 bool wxClipboardEvent::SupportsFormat( const wxDataFormat
&format
) const
46 wxVector
<wxDataFormat
>::size_type n
;
47 for (n
= 0; n
< m_formats
.size(); n
++)
48 { if (m_formats
[n
] == format
) return true; }
52 void wxClipboardEvent::AddFormat( const wxDataFormat
&format
)
54 m_formats
.push_back( format
);
57 // ---------------------------------------------------------
59 // ---------------------------------------------------------
61 static wxClipboard
*gs_clipboard
= NULL
;
63 /*static*/ wxClipboard
*wxClipboardBase::Get()
67 gs_clipboard
= new wxClipboard
;
72 // ----------------------------------------------------------------------------
73 // wxClipboardModule: module responsible for destroying the global clipboard
75 // ----------------------------------------------------------------------------
77 class wxClipboardModule
: public wxModule
80 bool OnInit() { return true; }
81 void OnExit() { wxDELETE(gs_clipboard
); }
84 DECLARE_DYNAMIC_CLASS(wxClipboardModule
)
87 IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule
, wxModule
)
89 #endif // wxUSE_CLIPBOARD