SetType( type );
}
+wxDataFormat::wxDataFormat( const wxChar *id )
+{
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
+ SetId( id );
+}
+
wxDataFormat::wxDataFormat( const wxString &id )
{
if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom );
- if (m_id == "file:ALL")
+ if (m_id == _T("file:ALL"))
{
m_type = wxDF_FILENAME;
}
if (m_type == wxDF_TEXT)
{
- m_id = "STRING";
+ m_id = _T("STRING");
}
else
if (m_type == wxDF_BITMAP)
{
- m_id = "BITMAP";
+ m_id = _T("BITMAP");
}
else
if (m_type == wxDF_FILENAME)
{
- m_id = "file:ALL";
+ m_id = _T("file:ALL");
}
else
{
- wxFAIL_MSG( "invalid dataformat" );
+ wxFAIL_MSG( _T("invalid dataformat") );
}
m_hasAtom = FALSE;
return m_id;
}
-void wxDataFormat::SetId( const wxString &id )
+void wxDataFormat::SetId( const wxChar *id )
{
m_type = wxDF_PRIVATE;
m_id = id;
else
if (m_type == wxDF_PRIVATE)
{
- m_atom = gdk_atom_intern( WXSTRINGCAST( m_id ), FALSE );
+ m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE );
}
else
if (m_type == wxDF_FILENAME)
void wxTextDataObject::WriteString( const wxString &str, void *dest ) const
{
- memcpy( dest, m_data.c_str(), GetSize() );
+ memcpy( dest, str.mb_str(), str.Len()+1 );
}
// ----------------------------------------------------------------------------
void wxFileDataObject::AddFile( const wxString &file )
{
m_files += file;
- m_files += (char)0;
+ m_files += (wxChar)0;
}
wxString wxFileDataObject::GetFiles() const
void wxFileDataObject::WriteData( void *dest ) const
{
- memcpy( dest, m_files.c_str(), GetSize() );
+ memcpy( dest, m_files.mbc_str(), GetSize() );
}
size_t wxFileDataObject::GetSize() const
wxPrivateDataObject::wxPrivateDataObject()
{
- m_id = "application/";
+ m_id = _T("application/");
m_id += wxTheApp->GetAppName();
m_format.SetId( m_id );