]>
git.saurik.com Git - wxWidgets.git/blob - src/common/clipcmn.cpp
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/module.h"
35 // ---------------------------------------------------------
37 // ---------------------------------------------------------
39 IMPLEMENT_DYNAMIC_CLASS(wxClipboardEvent
,wxEvent
)
41 DEFINE_EVENT_TYPE(wxEVT_CLIPBOARD_CHANGED
)
43 bool wxClipboardEvent::SupportsFormat( const wxDataFormat
&format
) const
45 wxVector
<wxDataFormat
>::size_type n
;
46 for (n
= 0; n
< m_formats
.size(); n
++)
47 { if (m_formats
[n
] == format
) return true; }
51 void wxClipboardEvent::AddFormat( const wxDataFormat
&format
)
53 m_formats
.push_back( format
);
56 // ---------------------------------------------------------
58 // ---------------------------------------------------------
60 static wxClipboard
*gs_clipboard
= NULL
;
62 /*static*/ wxClipboard
*wxClipboardBase::Get()
66 gs_clipboard
= new wxClipboard
;
71 // ----------------------------------------------------------------------------
72 // wxClipboardModule: module responsible for destroying the global clipboard
74 // ----------------------------------------------------------------------------
76 class wxClipboardModule
: public wxModule
79 bool OnInit() { return true; }
80 void OnExit() { wxDELETE(gs_clipboard
); }
83 DECLARE_DYNAMIC_CLASS(wxClipboardModule
)
86 IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule
, wxModule
)
88 #endif // wxUSE_CLIPBOARD