+ wxLogTrace(TRACE_CLIPBOARD, wxT("Checking if format %s is available"),
+ format.GetId().c_str());
+
+ // these variables will be used by our GTKOnTargetReceived()
+ m_targetRequested = format;
+ m_formatSupported = false;
+
+ // block until m_formatSupported is set from targets_selection_received
+ // callback
+ {
+ wxClipboardSync sync(*this);
+
+ gtk_selection_convert( m_targetsWidget,
+ GTKGetClipboardAtom(),
+ g_targetsAtom,
+ (guint32) GDK_CURRENT_TIME );
+ }
+
+ return m_formatSupported;
+}
+
+// ----------------------------------------------------------------------------
+// wxClipboard public API implementation
+// ----------------------------------------------------------------------------
+
+void wxClipboard::Clear()
+{
+ gtk_selection_clear_targets( m_clipboardWidget, GTKGetClipboardAtom() );
+
+ if ( gdk_selection_owner_get(GTKGetClipboardAtom()) ==
+ m_clipboardWidget->window )
+ {
+ wxClipboardSync sync(*this);
+
+ // this will result in selection_clear_clip callback being called and
+ // it will free our data
+ SetSelectionOwner(false);