- return m_id;
-}
-
-void wxDataFormat::SetId( const wxChar *id )
-{
- m_type = wxDF_PRIVATE;
- m_id = id;
- m_hasAtom = FALSE;
-}
-
-GdkAtom wxDataFormat::GetAtom()
-{
- if (!m_hasAtom)
- {
- m_hasAtom = TRUE;
-
- if (m_type == wxDF_TEXT)
- {
- m_atom = g_textAtom;
- }
- else
- if (m_type == wxDF_BITMAP)
- {
- m_atom = GDK_TARGET_BITMAP;
- }
- else
- if (m_type == wxDF_PRIVATE)
- {
- m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE );
- }
- else
- if (m_type == wxDF_FILENAME)
- {
- m_atom = gdk_atom_intern( "file:ALL", FALSE );
- }
- else
- {
- m_hasAtom = FALSE;
- m_atom = (GdkAtom) 0;
- }
- }
-
- return m_atom;
-}
-
-//-------------------------------------------------------------------------
-// wxDataBroker
-//-------------------------------------------------------------------------
-
-IMPLEMENT_CLASS(wxDataBroker,wxObject)
-
-wxDataBroker::wxDataBroker()
-{
- m_dataObjects.DeleteContents(TRUE);
- m_preferred = 0;
-}
-
-void wxDataBroker::Add( wxDataObject *dataObject, bool preferred )
-{
- if (preferred) m_preferred = m_dataObjects.GetCount();
- m_dataObjects.Append( dataObject );
-}
-
-size_t wxDataBroker::GetFormatCount() const
-{
- return m_dataObjects.GetCount();
-}
-
-wxDataFormatId wxDataBroker::GetPreferredFormat() const
-{
- wxNode *node = m_dataObjects.Nth( m_preferred );
-
- wxASSERT( node );
-
- wxDataObject* data_obj = (wxDataObject*)node->Data();
-
- return data_obj->GetFormat().GetType();