+ (const guchar*)buf.data(),
+ size );
+ }
+}
+}
+
+void wxClipboard::GTKOnSelectionReceived(const GtkSelectionData& sel)
+{
+ wxCHECK_RET( m_receivedData, wxT("should be inside GetData()") );
+
+ const wxDataFormat format(gtk_selection_data_get_target(const_cast<GtkSelectionData*>(&sel)));
+ wxLogTrace(TRACE_CLIPBOARD, wxT("Received selection %s"),
+ format.GetId().c_str());
+
+ if ( !m_receivedData->IsSupportedFormat(format) )
+ return;
+
+ m_receivedData->SetData(format,
+ gtk_selection_data_get_length(const_cast<GtkSelectionData*>(&sel)),
+ gtk_selection_data_get_data(const_cast<GtkSelectionData*>(&sel)));
+ m_formatSupported = true;
+}
+
+//-----------------------------------------------------------------------------
+// asynchronous "selection_received" for targets
+//-----------------------------------------------------------------------------
+
+extern "C" {
+static void
+async_targets_selection_received( GtkWidget *WXUNUSED(widget),
+ GtkSelectionData *selection_data,
+ guint32 WXUNUSED(time),
+ wxClipboard *clipboard )
+{
+ if ( !clipboard ) // Assert?
+ return;
+
+ if (!clipboard->m_sink)
+ return;