+bool wxClipboard::SetSelectionOwner(bool set)
+{
+ bool rc = gtk_selection_owner_set
+ (
+ set ? m_clipboardWidget : NULL,
+ GTKGetClipboardAtom(),
+ (guint32)GDK_CURRENT_TIME
+ );
+
+ if ( !rc )
+ {
+ wxLogTrace(TRACE_CLIPBOARD, _T("Failed to %sset selection owner"),
+ set ? _T("") : _T("un"));
+ }
+
+ return rc;
+}
+
+void wxClipboard::AddSupportedTarget(GdkAtom atom)
+{
+ gtk_selection_add_target
+ (
+ m_clipboardWidget,
+ GTKGetClipboardAtom(),
+ atom,
+ 0 // info (same as client data) unused
+ );
+}
+
+bool wxClipboard::DoIsSupported(const wxDataFormat& format)
+{
+ wxCHECK_MSG( format, false, wxT("invalid clipboard format") );
+
+ 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
+// ----------------------------------------------------------------------------
+