projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add demonstration of a few more wxRenderer methods.
[wxWidgets.git]
/
src
/
gtk1
/
dataobj.cpp
diff --git
a/src/gtk1/dataobj.cpp
b/src/gtk1/dataobj.cpp
index fc029b856552cd6872003222d5c5133f89620de8..7fc4bb83dc4aaeb944363705714609d50287d266 100644
(file)
--- a/
src/gtk1/dataobj.cpp
+++ b/
src/gtk1/dataobj.cpp
@@
-17,10
+17,10
@@
#ifndef WX_PRECOMP
#include "wx/log.h"
#include "wx/app.h"
#ifndef WX_PRECOMP
#include "wx/log.h"
#include "wx/app.h"
+ #include "wx/image.h"
#endif
#include "wx/mstream.h"
#endif
#include "wx/mstream.h"
-#include "wx/image.h"
#include "wx/uri.h"
#include <gdk/gdk.h>
#include "wx/uri.h"
#include <gdk/gdk.h>
@@
-58,13
+58,7
@@
wxDataFormat::wxDataFormat( wxDataFormatId type )
SetType( type );
}
SetType( type );
}
-wxDataFormat::wxDataFormat( const wxChar *id )
-{
- PrepareFormats();
- SetId( id );
-}
-
-wxDataFormat::wxDataFormat( const wxString &id )
+void wxDataFormat::InitFromString( const wxString &id )
{
PrepareFormats();
SetId( id );
{
PrepareFormats();
SetId( id );
@@
-140,12
+134,11
@@
void wxDataFormat::SetId( NativeFormat format )
m_type = wxDF_PRIVATE;
}
m_type = wxDF_PRIVATE;
}
-void wxDataFormat::SetId( const wx
Char *
id )
+void wxDataFormat::SetId( const wx
String&
id )
{
PrepareFormats();
m_type = wxDF_PRIVATE;
{
PrepareFormats();
m_type = wxDF_PRIVATE;
- wxString tmp( id );
- m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
+ m_format = gdk_atom_intern( id.ToAscii(), FALSE );
}
void wxDataFormat::PrepareFormats()
}
void wxDataFormat::PrepareFormats()
@@
-224,7
+217,7
@@
bool wxFileDataObject::GetDataHere(void *buf) const
filenames += wxT("\r\n");
}
filenames += wxT("\r\n");
}
- memcpy( buf, filenames.mbc_str(), filenames.
Len
() + 1 );
+ memcpy( buf, filenames.mbc_str(), filenames.
length
() + 1 );
return true;
}
return true;
}
@@
-236,7
+229,7
@@
size_t wxFileDataObject::GetDataSize() const
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
// This is junk in UTF-8
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
// This is junk in UTF-8
- res += m_filenames[i].
Len
();
+ res += m_filenames[i].
length
();
res += 5 + 2; // "file:" (5) + "\r\n" (2)
}
res += 5 + 2; // "file:" (5) + "\r\n" (2)
}
@@
-258,12
+251,12
@@
bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf)
if ( (*p == '\r' && *(p+1) == '\n') || !*p )
{
size_t lenPrefix = 5; // strlen("file:")
if ( (*p == '\r' && *(p+1) == '\n') || !*p )
{
size_t lenPrefix = 5; // strlen("file:")
- if ( filename.Left(lenPrefix).MakeLower() ==
_
T("file:") )
+ if ( filename.Left(lenPrefix).MakeLower() ==
wx
T("file:") )
{
// sometimes the syntax is "file:filename", sometimes it's
// URL-like: "file://filename" - deal with both
{
// sometimes the syntax is "file:filename", sometimes it's
// URL-like: "file://filename" - deal with both
- if ( filename[lenPrefix] ==
_
T('/') &&
- filename[lenPrefix + 1] ==
_
T('/') )
+ if ( filename[lenPrefix] ==
wx
T('/') &&
+ filename[lenPrefix + 1] ==
wx
T('/') )
{
// skip the slashes
lenPrefix += 2;
{
// skip the slashes
lenPrefix += 2;
@@
-274,7
+267,7
@@
bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf)
}
else
{
}
else
{
- wxLogDebug(
_
T("Unsupported URI '%s' in wxFileDataObject"),
+ wxLogDebug(
wx
T("Unsupported URI '%s' in wxFileDataObject"),
filename.c_str());
}
filename.c_str());
}