replaced T() makro with wxT() due to namespace probs, _T() exists, too

fixed compilation problems, mainly in html code
compiles and links fine on Solaris, runs with samples and Mahogany


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1999-10-08 14:35:56 +00:00
parent b4a2ab728b
commit 223d09f6b5
336 changed files with 3755 additions and 3776 deletions

View File

@@ -21,7 +21,7 @@
*****************************************************************************/ *****************************************************************************/
// needed to resolve the conflict between global T and macro parameter T // needed to resolve the conflict between global T and macro parameter T
#define _WX_ERROR_REMOVE2(x) T("bad index in " #x "::Remove()") #define _WX_ERROR_REMOVE2(x) wxT("bad index in " #x "::Remove()")
// macro implements remaining (not inline) methods of template list // macro implements remaining (not inline) methods of template list
// (it's private to this file) // (it's private to this file)

View File

@@ -28,7 +28,7 @@ class wxCharBuffer
public: public:
wxCharBuffer(const char *str) wxCharBuffer(const char *str)
{ {
wxASSERT_MSG( str, T("NULL string in wxCharBuffer") ); wxASSERT_MSG( str, wxT("NULL string in wxCharBuffer") );
m_str = str ? strdup(str) : (char *)NULL; m_str = str ? strdup(str) : (char *)NULL;
} }
@@ -67,7 +67,7 @@ class wxWCharBuffer
public: public:
wxWCharBuffer(const wchar_t *wcs) wxWCharBuffer(const wchar_t *wcs)
{ {
wxASSERT_MSG( wcs, T("NULL string in wxWCharBuffer") ); wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") );
if (wcs) { if (wcs) {
size_t siz = (wcslen(wcs)+1)*sizeof(wchar_t); size_t siz = (wcslen(wcs)+1)*sizeof(wchar_t);

View File

@@ -26,7 +26,7 @@ class WXDLLEXPORT wxArrayString;
extern const wxChar *wxEmptyString; extern const wxChar *wxEmptyString;
#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST T("www.yahoo.com") #define WXDIALUP_MANAGER_DEFAULT_BEACONHOST wxT("www.yahoo.com")
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// A class which groups functions dealing with connecting to the network from a // A class which groups functions dealing with connecting to the network from a
@@ -148,8 +148,8 @@ public:
// Sets the commands to start up the network and to hang up again. Used by // Sets the commands to start up the network and to hang up again. Used by
// the Unix implementations only. // the Unix implementations only.
virtual void virtual void
SetConnectCommand(const wxString& commandDial = T("/usr/bin/pon"), SetConnectCommand(const wxString& commandDial = wxT("/usr/bin/pon"),
const wxString& commandHangup = T("/usr/bin/poff")) = 0; const wxString& commandHangup = wxT("/usr/bin/poff")) = 0;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -151,10 +151,10 @@ private:
// template classes // template classes
// ============================================================================ // ============================================================================
// resolves the name conflict between the T() macor and T typedef: we can't // resolves the name conflict between the wxT() macor and T typedef: we can't
// use T() inside WX_DEFINE_ARRAY! // use wxT() inside WX_DEFINE_ARRAY!
#define _WX_ERROR_SIZEOF T("illegal use of DEFINE_ARRAY") #define _WX_ERROR_SIZEOF wxT("illegal use of DEFINE_ARRAY")
#define _WX_ERROR_REMOVE T("removing inexisting element in wxArray::Remove") #define _WX_ERROR_REMOVE wxT("removing inexisting element in wxArray::Remove")
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// This macro generates a new array class. It is intended for storage of simple // This macro generates a new array class. It is intended for storage of simple

View File

@@ -897,7 +897,7 @@ public:
{ {
// GetVeto() will return FALSE anyhow... // GetVeto() will return FALSE anyhow...
wxCHECK_RET( m_canVeto, wxCHECK_RET( m_canVeto,
T("call to Veto() ignored (can't veto this event)") ); wxT("call to Veto() ignored (can't veto this event)") );
m_veto = veto; m_veto = veto;
} }
@@ -1319,7 +1319,7 @@ public:
virtual void OnCommand(wxWindow& WXUNUSED(win), virtual void OnCommand(wxWindow& WXUNUSED(win),
wxCommandEvent& WXUNUSED(event)) wxCommandEvent& WXUNUSED(event))
{ {
wxFAIL_MSG(T("shouldn't be called any more")); wxFAIL_MSG(wxT("shouldn't be called any more"));
} }
// Called if child control has no callback function // Called if child control has no callback function

View File

@@ -51,7 +51,7 @@ public:
bool Close(); bool Close();
// assign an existing file descriptor and get it back from wxFFile object // assign an existing file descriptor and get it back from wxFFile object
void Attach(FILE *fp, const wxString& name = T("")) void Attach(FILE *fp, const wxString& name = wxT(""))
{ Close(); m_fp = fp; m_name = name; } { Close(); m_fp = fp; m_name = name; }
void Detach() { m_fp = NULL; } void Detach() { m_fp = NULL; }
FILE *fp() const { return m_fp; } FILE *fp() const { return m_fp; }

View File

@@ -141,9 +141,9 @@ public:
// New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or // New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or
// wxCONFIG_USE_GLOBAL_FILE to say which files should be used. // wxCONFIG_USE_GLOBAL_FILE to say which files should be used.
wxFileConfig(const wxString& appName, wxFileConfig(const wxString& appName,
const wxString& vendorName = T(""), const wxString& vendorName = wxT(""),
const wxString& localFilename = T(""), const wxString& localFilename = wxT(""),
const wxString& globalFilename = T(""), const wxString& globalFilename = wxT(""),
long style = wxCONFIG_USE_LOCAL_FILE); long style = wxCONFIG_USE_LOCAL_FILE);
// dtor will save unsaved data // dtor will save unsaved data

View File

@@ -159,15 +159,15 @@ WXDLLEXPORT bool wxMkdir(const wxString& dir, int perm = 0777);
WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0); WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
// separators in file names // separators in file names
#define wxFILE_SEP_EXT T('.') #define wxFILE_SEP_EXT wxT('.')
#define wxFILE_SEP_DSK T(':') #define wxFILE_SEP_DSK wxT(':')
#define wxFILE_SEP_PATH_DOS T('\\') #define wxFILE_SEP_PATH_DOS wxT('\\')
#define wxFILE_SEP_PATH_UNIX T('/') #define wxFILE_SEP_PATH_UNIX wxT('/')
// separator in the path list (as in PATH environment variable) // separator in the path list (as in PATH environment variable)
// NB: these are strings and not characters on purpose! // NB: these are strings and not characters on purpose!
#define wxPATH_SEP_DOS T(";") #define wxPATH_SEP_DOS wxT(";")
#define wxPATH_SEP_UNIX T(":") #define wxPATH_SEP_UNIX wxT(":")
// platform independent versions // platform independent versions
#ifdef __UNIX__ #ifdef __UNIX__

View File

@@ -32,7 +32,7 @@ public:
// enumerate the different encodings either for given font family or for // enumerate the different encodings either for given font family or for
// all font families - will result in OnFontEncoding() being called for // all font families - will result in OnFontEncoding() being called for
// each available (family, encoding) couple // each available (family, encoding) couple
virtual bool EnumerateEncodings(const wxString& family = T("")); virtual bool EnumerateEncodings(const wxString& family = wxT(""));
// callbacks which are called after one of EnumerateXXX() functions from // callbacks which are called after one of EnumerateXXX() functions from
// above is invoked - all of them may return FALSE to stop enumeration or // above is invoked - all of them may return FALSE to stop enumeration or

View File

@@ -100,7 +100,7 @@ public:
const wxSize &size = wxDefaultSize, const wxSize &size = wxDefaultSize,
long style = wxLC_LIST, long style = wxLC_LIST,
const wxValidator &validator = wxDefaultValidator, const wxValidator &validator = wxDefaultValidator,
const wxString &name = T("filelist") ); const wxString &name = wxT("filelist") );
void ChangeToListMode(); void ChangeToListMode();
void ChangeToReportMode(); void ChangeToReportMode();
void ChangeToIconMode(); void ChangeToIconMode();

View File

@@ -54,7 +54,7 @@ public:
@param newmsg if used, new message to display @param newmsg if used, new message to display
@returns true if ABORT button has not been pressed @returns true if ABORT button has not been pressed
*/ */
bool Update(int value = -1, const wxString& newmsg = T("")); bool Update(int value = -1, const wxString& newmsg = wxT(""));
/* Can be called to continue after the cancel button has been pressed, but /* Can be called to continue after the cancel button has been pressed, but
the program decided to continue the operation (e.g., user didn't the program decided to continue the operation (e.g., user didn't

View File

@@ -64,7 +64,7 @@ public:
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
const wxString& name = T("statusBar")); const wxString& name = wxT("statusBar"));
virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id, virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
const wxString& name ); const wxString& name );
virtual wxStatusBar *GetStatusBar() const; virtual wxStatusBar *GetStatusBar() const;

View File

@@ -64,7 +64,7 @@ public:
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
const wxString& name = T("statusBar")); const wxString& name = wxT("statusBar"));
virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id, virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
const wxString& name ); const wxString& name );
virtual wxStatusBar *GetStatusBar() const; virtual wxStatusBar *GetStatusBar() const;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 519 B

View File

@@ -32,7 +32,7 @@
// gettext() style macro (notice that xgettext should be invoked with "-k_" // gettext() style macro (notice that xgettext should be invoked with "-k_"
// option to extract the strings inside _() from the sources) // option to extract the strings inside _() from the sources)
#ifndef WXINTL_NO_GETTEXT_MACRO #ifndef WXINTL_NO_GETTEXT_MACRO
#define _(str) wxGetTranslation(T(str)) #define _(str) wxGetTranslation(wxT(str))
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -480,12 +480,12 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
// will take us immediately to the place of the failed API // will take us immediately to the place of the failed API
#ifdef __VISUALC__ #ifdef __VISUALC__
#define wxLogApiError(api, rc) \ #define wxLogApiError(api, rc) \
wxLogDebug(T("%s(%d): '%s' failed with error 0x%08lx (%s)."), \ wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
__TFILE__, __LINE__, api, \ __TFILE__, __LINE__, api, \
rc, wxSysErrorMsg(rc)) rc, wxSysErrorMsg(rc))
#else // !VC++ #else // !VC++
#define wxLogApiError(api, rc) \ #define wxLogApiError(api, rc) \
wxLogDebug(T("In file %s at line %d: '%s' failed with " \ wxLogDebug(wxT("In file %s at line %d: '%s' failed with " \
"error 0x%08lx (%s)."), \ "error 0x%08lx (%s)."), \
__TFILE__, __LINE__, api, \ __TFILE__, __LINE__, api, \
rc, wxSysErrorMsg(rc)) rc, wxSysErrorMsg(rc))

View File

@@ -1056,4 +1056,3 @@ __END_DECLS
long nothing ; long nothing ;
} ; } ;
#endif /* !_GUSI_ */

View File

@@ -51,4 +51,3 @@ protected:
}; };
#endif #endif
// _WX_STATBAR_H_

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 7 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 5 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

View File

@@ -139,17 +139,17 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
* for this combination of CTl3D/FAFA settings * for this combination of CTl3D/FAFA settings
*/ */
#define STATIC_CLASS T("STATIC") #define STATIC_CLASS wxT("STATIC")
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE) #define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
#define CHECK_CLASS T("BUTTON") #define CHECK_CLASS wxT("BUTTON")
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD) #define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
#define CHECK_IS_FAFA FALSE #define CHECK_IS_FAFA FALSE
#define RADIO_CLASS T("BUTTON") #define RADIO_CLASS wxT("BUTTON")
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE) #define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
#define RADIO_SIZE 20 #define RADIO_SIZE 20
#define RADIO_IS_FAFA FALSE #define RADIO_IS_FAFA FALSE
#define PURE_WINDOWS #define PURE_WINDOWS
#define GROUP_CLASS T("BUTTON") #define GROUP_CLASS wxT("BUTTON")
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE) #define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
/* /*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

View File

@@ -52,4 +52,3 @@ protected:
#endif // wxUSE_NATIVE_STATUSBAR #endif // wxUSE_NATIVE_STATUSBAR
#endif //_STATBR95_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 7 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 0 B

View File

@@ -117,13 +117,13 @@ WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream );
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \ #define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
{ return new name; }\ { return new name; }\
wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name); wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
// Multiple inheritance with two base classes // Multiple inheritance with two base classes
#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \ #define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
{ return new name; }\ { return new name; }\
wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename1), (wxChar *) T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name); wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename1), (wxChar *) wxT(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
////// //////
////// for abstract classes ////// for abstract classes
@@ -131,13 +131,13 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
// Single inheritance with one base class // Single inheritance with one base class
#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \ #define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename), \ wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename), \
(wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL); (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL);
// Multiple inheritance with two base classes // Multiple inheritance with two base classes
#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \ #define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename1), \ wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename1), \
(wxChar *) T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL); (wxChar *) wxT(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL);
#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS #define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2 #define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2

View File

@@ -51,4 +51,3 @@ protected:
}; };
#endif #endif
// _WX_STATBAR_H_

View File

@@ -552,7 +552,7 @@ class WXDLLEXPORT wxListOfStringsListValidator: public wxPropertyListValidator
// Called when the property is double clicked. // Called when the property is double clicked.
bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = T("String List Editor")); bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = wxT("String List Editor"));
// Called when the edit (...) button is pressed. // Called when the edit (...) button is pressed.
void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);

View File

@@ -573,7 +573,7 @@ public:
// remove spaces from left or from right (default) side // remove spaces from left or from right (default) side
wxString& Trim(bool bFromRight = TRUE); wxString& Trim(bool bFromRight = TRUE);
// add nCount copies chPad in the beginning or at the end (default) // add nCount copies chPad in the beginning or at the end (default)
wxString& Pad(size_t nCount, wxChar chPad = T(' '), bool bFromRight = TRUE); wxString& Pad(size_t nCount, wxChar chPad = wxT(' '), bool bFromRight = TRUE);
// truncate string to given length // truncate string to given length
wxString& Truncate(size_t uiLen); wxString& Truncate(size_t uiLen);
@@ -685,7 +685,7 @@ public:
// return the maximum size of the string // return the maximum size of the string
size_t max_size() const { return wxSTRING_MAXLEN; } size_t max_size() const { return wxSTRING_MAXLEN; }
// resize the string, filling the space with c if c != 0 // resize the string, filling the space with c if c != 0
void resize(size_t nSize, wxChar ch = T('\0')); void resize(size_t nSize, wxChar ch = wxT('\0'));
// delete the contents of the string // delete the contents of the string
void clear() { Empty(); } void clear() { Empty(); }
// returns true if the string is empty // returns true if the string is empty

View File

@@ -51,4 +51,3 @@ protected:
}; };
#endif #endif
// _WX_STATBAR_H_

View File

@@ -81,7 +81,7 @@ public:
static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second) static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second)
{ {
wxCHECK_RET( first && second, wxCHECK_RET( first && second,
T("NULL passed to wxWizardPageSimple::Chain") ); wxT("NULL passed to wxWizardPageSimple::Chain") );
first->SetNext(second); first->SetNext(second);
second->SetPrev(first); second->SetPrev(first);

View File

@@ -565,11 +565,11 @@ WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const
// although global macros with such names are really bad, we want to have // although global macros with such names are really bad, we want to have
// another name for _T() which should be used to avoid confusion between _T() // another name for _T() which should be used to avoid confusion between _T()
// and _() in wxWindows sources // and _() in wxWindows sources
#define T(x) _T(x) #define wxT(x) _T(x)
// a Unicode-friendly __FILE__ analog // a Unicode-friendly __FILE__ analog
#ifndef __TFILE__ #ifndef __TFILE__
#define __XFILE__(x) T(x) #define __XFILE__(x) wxT(x)
#define __TFILE__ __XFILE__(__FILE__) #define __TFILE__ __XFILE__(__FILE__)
#endif #endif

View File

@@ -112,7 +112,7 @@ class WXDLLEXPORT wxExpr
return value.word; return value.word;
else if (type == wxExprString) else if (type == wxExprString)
return wxString(value.string); return wxString(value.string);
else return wxString(T("")); else return wxString(wxT(""));
} }
inline wxString StringValue(void) const { inline wxString StringValue(void) const {
@@ -120,7 +120,7 @@ class WXDLLEXPORT wxExpr
return wxString(value.string); return wxString(value.string);
else if (type == wxExprWord) else if (type == wxExprWord)
return wxString(value.word); return wxString(value.word);
else return wxString(T("")); else return wxString(wxT(""));
} }
// Get nth arg of clause (starting from 1) // Get nth arg of clause (starting from 1)

View File

@@ -16,4 +16,3 @@
#pragma once on #pragma once on
#define WX_PRECOMP #define WX_PRECOMP
#include "wx/wx_cw_cm.h" #include "wx/wx_cw_cm.h"
#include "wx/wxprec.h"

View File

@@ -17,4 +17,3 @@
#define WX_PRECOMP #define WX_PRECOMP
#define __WXDEBUG__ #define __WXDEBUG__
#include "wx/wx_cw_cm.h" #include "wx/wx_cw_cm.h"
#include "wx/wxprec.h"

View File

@@ -1,2 +1 @@
y_tab.c y_tab.c
lex_yy.c

View File

@@ -55,7 +55,7 @@ wxString wxChoiceBase::GetStringSelection() const
{ {
int sel = GetSelection(); int sel = GetSelection();
wxString str; wxString str;
wxCHECK_MSG( sel != wxNOT_FOUND, str, T("no selection, hence no string") ); wxCHECK_MSG( sel != wxNOT_FOUND, str, wxT("no selection, hence no string") );
str = GetString(sel); str = GetString(sel);
return str; return str;
@@ -65,7 +65,7 @@ bool wxChoiceBase::SetStringSelection(const wxString& sel)
{ {
int selIndex = FindString(sel); int selIndex = FindString(sel);
wxCHECK_MSG( selIndex != wxNOT_FOUND, FALSE, wxCHECK_MSG( selIndex != wxNOT_FOUND, FALSE,
T("can't set selection to string not in the control") ); wxT("can't set selection to string not in the control") );
SetSelection(selIndex); SetSelection(selIndex);
@@ -79,7 +79,7 @@ bool wxChoiceBase::SetStringSelection(const wxString& sel)
void wxChoiceBase::SetClientObject(int n, wxClientData *data) void wxChoiceBase::SetClientObject(int n, wxClientData *data)
{ {
wxASSERT_MSG( m_clientDataItemsType != ClientData_Void, wxASSERT_MSG( m_clientDataItemsType != ClientData_Void,
T("can't have both object and void client data") ); wxT("can't have both object and void client data") );
wxClientData *clientDataOld = DoGetClientObject(n); wxClientData *clientDataOld = DoGetClientObject(n);
if ( clientDataOld ) if ( clientDataOld )
@@ -92,7 +92,7 @@ void wxChoiceBase::SetClientObject(int n, wxClientData *data)
wxClientData *wxChoiceBase::GetClientObject(int n) const wxClientData *wxChoiceBase::GetClientObject(int n) const
{ {
wxASSERT_MSG( m_clientDataItemsType == ClientData_Object, wxASSERT_MSG( m_clientDataItemsType == ClientData_Object,
T("this window doesn't have object client data") ); wxT("this window doesn't have object client data") );
return DoGetClientObject(n); return DoGetClientObject(n);
} }
@@ -100,7 +100,7 @@ wxClientData *wxChoiceBase::GetClientObject(int n) const
void wxChoiceBase::SetClientData(int n, void *data) void wxChoiceBase::SetClientData(int n, void *data)
{ {
wxASSERT_MSG( m_clientDataItemsType != ClientData_Object, wxASSERT_MSG( m_clientDataItemsType != ClientData_Object,
T("can't have both object and void client data") ); wxT("can't have both object and void client data") );
DoSetClientData(n, data); DoSetClientData(n, data);
m_clientDataItemsType = ClientData_Void; m_clientDataItemsType = ClientData_Void;
@@ -109,7 +109,7 @@ void wxChoiceBase::SetClientData(int n, void *data)
void *wxChoiceBase::GetClientData(int n) const void *wxChoiceBase::GetClientData(int n) const
{ {
wxASSERT_MSG( m_clientDataItemsType == ClientData_Void, wxASSERT_MSG( m_clientDataItemsType == ClientData_Void,
T("this window doesn't have void client data") ); wxT("this window doesn't have void client data") );
return DoGetClientData(n); return DoGetClientData(n);
} }

View File

@@ -231,31 +231,31 @@ wxPrintData::~wxPrintData()
static wxString wxGetPrintDlgError() static wxString wxGetPrintDlgError()
{ {
DWORD err = CommDlgExtendedError(); DWORD err = CommDlgExtendedError();
wxString msg = T("Unknown"); wxString msg = wxT("Unknown");
switch (err) switch (err)
{ {
case CDERR_FINDRESFAILURE: msg = T("CDERR_FINDRESFAILURE"); break; case CDERR_FINDRESFAILURE: msg = wxT("CDERR_FINDRESFAILURE"); break;
case CDERR_INITIALIZATION: msg = T("CDERR_INITIALIZATION"); break; case CDERR_INITIALIZATION: msg = wxT("CDERR_INITIALIZATION"); break;
case CDERR_LOADRESFAILURE: msg = T("CDERR_LOADRESFAILURE"); break; case CDERR_LOADRESFAILURE: msg = wxT("CDERR_LOADRESFAILURE"); break;
case CDERR_LOADSTRFAILURE: msg = T("CDERR_LOADSTRFAILURE"); break; case CDERR_LOADSTRFAILURE: msg = wxT("CDERR_LOADSTRFAILURE"); break;
case CDERR_LOCKRESFAILURE: msg = T("CDERR_LOCKRESFAILURE"); break; case CDERR_LOCKRESFAILURE: msg = wxT("CDERR_LOCKRESFAILURE"); break;
case CDERR_MEMALLOCFAILURE: msg = T("CDERR_MEMALLOCFAILURE"); break; case CDERR_MEMALLOCFAILURE: msg = wxT("CDERR_MEMALLOCFAILURE"); break;
case CDERR_MEMLOCKFAILURE: msg = T("CDERR_MEMLOCKFAILURE"); break; case CDERR_MEMLOCKFAILURE: msg = wxT("CDERR_MEMLOCKFAILURE"); break;
case CDERR_NOHINSTANCE: msg = T("CDERR_NOHINSTANCE"); break; case CDERR_NOHINSTANCE: msg = wxT("CDERR_NOHINSTANCE"); break;
case CDERR_NOHOOK: msg = T("CDERR_NOHOOK"); break; case CDERR_NOHOOK: msg = wxT("CDERR_NOHOOK"); break;
case CDERR_NOTEMPLATE: msg = T("CDERR_NOTEMPLATE"); break; case CDERR_NOTEMPLATE: msg = wxT("CDERR_NOTEMPLATE"); break;
case CDERR_STRUCTSIZE: msg = T("CDERR_STRUCTSIZE"); break; case CDERR_STRUCTSIZE: msg = wxT("CDERR_STRUCTSIZE"); break;
case PDERR_RETDEFFAILURE: msg = T("PDERR_RETDEFFAILURE"); break; case PDERR_RETDEFFAILURE: msg = wxT("PDERR_RETDEFFAILURE"); break;
case PDERR_PRINTERNOTFOUND: msg = T("PDERR_PRINTERNOTFOUND"); break; case PDERR_PRINTERNOTFOUND: msg = wxT("PDERR_PRINTERNOTFOUND"); break;
case PDERR_PARSEFAILURE: msg = T("PDERR_PARSEFAILURE"); break; case PDERR_PARSEFAILURE: msg = wxT("PDERR_PARSEFAILURE"); break;
case PDERR_NODEVICES: msg = T("PDERR_NODEVICES"); break; case PDERR_NODEVICES: msg = wxT("PDERR_NODEVICES"); break;
case PDERR_NODEFAULTPRN: msg = T("PDERR_NODEFAULTPRN"); break; case PDERR_NODEFAULTPRN: msg = wxT("PDERR_NODEFAULTPRN"); break;
case PDERR_LOADDRVFAILURE: msg = T("PDERR_LOADDRVFAILURE"); break; case PDERR_LOADDRVFAILURE: msg = wxT("PDERR_LOADDRVFAILURE"); break;
case PDERR_INITFAILURE: msg = T("PDERR_INITFAILURE"); break; case PDERR_INITFAILURE: msg = wxT("PDERR_INITFAILURE"); break;
case PDERR_GETDEVMODEFAIL: msg = T("PDERR_GETDEVMODEFAIL"); break; case PDERR_GETDEVMODEFAIL: msg = wxT("PDERR_GETDEVMODEFAIL"); break;
case PDERR_DNDMMISMATCH: msg = T("PDERR_DNDMMISMATCH"); break; case PDERR_DNDMMISMATCH: msg = wxT("PDERR_DNDMMISMATCH"); break;
case PDERR_DEFAULTDIFFERENT: msg = T("PDERR_DEFAULTDIFFERENT"); break; case PDERR_DEFAULTDIFFERENT: msg = wxT("PDERR_DEFAULTDIFFERENT"); break;
case PDERR_CREATEICFAILURE: msg = T("PDERR_CREATEICFAILURE"); break; case PDERR_CREATEICFAILURE: msg = wxT("PDERR_CREATEICFAILURE"); break;
default: break; default: break;
} }
return msg; return msg;
@@ -299,7 +299,7 @@ void wxPrintData::ConvertToNative()
pd->hDevNames = NULL; pd->hDevNames = NULL;
#if defined(__WXDEBUG__) && defined(__WIN32__) #if defined(__WXDEBUG__) && defined(__WIN32__)
wxString str(T("Printing error: ")); wxString str(wxT("Printing error: "));
str += wxGetPrintDlgError(); str += wxGetPrintDlgError();
wxLogDebug(str); wxLogDebug(str);
#endif #endif
@@ -343,7 +343,7 @@ void wxPrintData::ConvertToNative()
//// Printer name //// Printer name
if (m_printerName != T("")) if (m_printerName != wxT(""))
{ {
// TODO: make this Unicode compatible // TODO: make this Unicode compatible
int len = wxMin(31, m_printerName.Len()); int len = wxMin(31, m_printerName.Len());
@@ -516,7 +516,7 @@ void wxPrintData::ConvertFromNative()
else else
{ {
// Shouldn't really get here // Shouldn't really get here
wxFAIL_MSG(T("Couldn't find paper size in paper database.")); wxFAIL_MSG(wxT("Couldn't find paper size in paper database."));
m_paperId = wxPAPER_NONE; m_paperId = wxPAPER_NONE;
m_paperSize.x = 0; m_paperSize.x = 0;
@@ -526,7 +526,7 @@ void wxPrintData::ConvertFromNative()
else else
{ {
// Shouldn't really get here // Shouldn't really get here
wxFAIL_MSG(T("Paper database wasn't initialized in wxPrintData::ConvertFromNative.")); wxFAIL_MSG(wxT("Paper database wasn't initialized in wxPrintData::ConvertFromNative."));
m_paperId = wxPAPER_NONE; m_paperId = wxPAPER_NONE;
m_paperSize.x = 0; m_paperSize.x = 0;
@@ -542,7 +542,7 @@ void wxPrintData::ConvertFromNative()
else else
{ {
// Shouldn't really get here // Shouldn't really get here
wxFAIL_MSG(T("Couldn't find paper size from DEVMODE.")); wxFAIL_MSG(wxT("Couldn't find paper size from DEVMODE."));
m_paperSize.x = 0; m_paperSize.x = 0;
m_paperSize.y = 0; m_paperSize.y = 0;
@@ -761,7 +761,7 @@ void wxPrintDialogData::ConvertToNative()
m_printData.SetNativeData((void*) NULL); m_printData.SetNativeData((void*) NULL);
wxASSERT_MSG( (pd->hDevMode), T("hDevMode must be non-NULL in ConvertToNative!")); wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
pd->hDC = (HDC) NULL; pd->hDC = (HDC) NULL;
pd->nFromPage = (UINT)m_printFromPage; pd->nFromPage = (UINT)m_printFromPage;
@@ -1023,7 +1023,7 @@ void wxPageSetupDialogData::ConvertToNative()
m_printData.SetNativeData((void*) NULL); m_printData.SetNativeData((void*) NULL);
wxASSERT_MSG( (pd->hDevMode), T("hDevMode must be non-NULL in ConvertToNative!")); wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
// pd->hDevMode = GlobalAlloc(GMEM_MOVEABLE, sizeof(DEVMODE)); // pd->hDevMode = GlobalAlloc(GMEM_MOVEABLE, sizeof(DEVMODE));
@@ -1163,7 +1163,7 @@ void wxPageSetupDialogData::SetPaperSize(wxPaperSize id)
void wxPageSetupDialogData::CalculateIdFromPaperSize() void wxPageSetupDialogData::CalculateIdFromPaperSize()
{ {
wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL),
T("wxThePrintPaperDatabase should not be NULL. " wxT("wxThePrintPaperDatabase should not be NULL. "
"Do not create global print dialog data objects.") ); "Do not create global print dialog data objects.") );
wxSize sz = GetPaperSize(); wxSize sz = GetPaperSize();
@@ -1179,7 +1179,7 @@ void wxPageSetupDialogData::CalculateIdFromPaperSize()
void wxPageSetupDialogData::CalculatePaperSizeFromId() void wxPageSetupDialogData::CalculatePaperSizeFromId()
{ {
wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL),
T("wxThePrintPaperDatabase should not be NULL. " wxT("wxThePrintPaperDatabase should not be NULL. "
"Do not create global print dialog data objects.") ); "Do not create global print dialog data objects.") );
wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId()); wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId());

View File

@@ -186,7 +186,7 @@ bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const
bool wxConfigBase::Write(const wxString& key, double val) bool wxConfigBase::Write(const wxString& key, double val)
{ {
wxString str; wxString str;
str.Printf(T("%f"), val); str.Printf(wxT("%f"), val);
return Write(key, str); return Write(key, str);
} }
@@ -371,11 +371,11 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
wxString strCurrent; wxString strCurrent;
const wxChar *pc = sz; const wxChar *pc = sz;
for ( ;; ) { for ( ;; ) {
if ( *pc == T('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) { if ( *pc == wxT('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
if ( strCurrent == T(".") ) { if ( strCurrent == wxT(".") ) {
// ignore // ignore
} }
else if ( strCurrent == T("..") ) { else if ( strCurrent == wxT("..") ) {
// go up one level // go up one level
if ( aParts.IsEmpty() ) if ( aParts.IsEmpty() )
wxLogWarning(_("'%s' has extra '..', ignored."), sz); wxLogWarning(_("'%s' has extra '..', ignored."), sz);
@@ -391,7 +391,7 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
//else: //else:
// could log an error here, but we prefer to ignore extra '/' // could log an error here, but we prefer to ignore extra '/'
if ( *pc == T('\0') ) if ( *pc == wxT('\0') )
return; return;
} }
else else

View File

@@ -48,7 +48,7 @@ bool wxControlBase::CreateControl(wxWindowBase *parent,
// even if it's possible to create controls without parents in some port, // even if it's possible to create controls without parents in some port,
// it should surely be discouraged because it doesn't work at all under // it should surely be discouraged because it doesn't work at all under
// Windows // Windows
wxCHECK_MSG( parent, FALSE, T("all controls must have parents") ); wxCHECK_MSG( parent, FALSE, wxT("all controls must have parents") );
if ( !CreateBase(parent, id, pos, size, style, validator, name) ) if ( !CreateBase(parent, id, pos, size, style, validator, name) )
return FALSE; return FALSE;

View File

@@ -43,13 +43,13 @@
#define ABBR_LENGTH 3 #define ABBR_LENGTH 3
static const wxChar *dayname[] = { static const wxChar *dayname[] = {
T("Sunday"), T("Monday"), T("Tuesday"), T("Wednesday"), wxT("Sunday"), wxT("Monday"), wxT("Tuesday"), wxT("Wednesday"),
T("Thursday"), T("Friday"), T("Saturday") wxT("Thursday"), wxT("Friday"), wxT("Saturday")
}; };
static const wxChar *mname[] = { static const wxChar *mname[] = {
T("January"), T("February"), T("March"), T("April"), T("May"), T("June"), wxT("January"), wxT("February"), wxT("March"), wxT("April"), wxT("May"), wxT("June"),
T("July"), T("August"), T("September"), T("October"), T("November"), T("December") wxT("July"), wxT("August"), wxT("September"), wxT("October"), wxT("November"), wxT("December")
}; };
static int GauDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int GauDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
@@ -88,7 +88,7 @@ wxDate::wxDate (const wxString& dat)
{ {
DisplayFormat=wxMDY; DisplayFormat=wxMDY;
DisplayOptions='\0'; DisplayOptions='\0';
if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0) if (wxStrcmp(dat, wxT("TODAY")) == 0 || wxStrcmp(dat, wxT("today")) == 0)
{ {
// Sets the current date // Sets the current date
Set(); Set();
@@ -98,10 +98,10 @@ wxDate::wxDate (const wxString& dat)
wxChar buf[100]; wxChar buf[100];
wxStrcpy(buf, dat); wxStrcpy(buf, dat);
wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr); wxChar *save_ptr, *token = wxStrtok(buf,wxT("/-"),&save_ptr);
month = wxAtoi(token); month = wxAtoi(token);
day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr)); day = wxAtoi(wxStrtok((wxChar *) NULL,wxT("/-"),&save_ptr));
year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr)); year = wxAtoi(wxStrtok((wxChar *) NULL,wxT(" "),&save_ptr));
} }
mdy_to_julian (); mdy_to_julian ();
@@ -131,7 +131,7 @@ void wxDate::operator = (const wxString& dat)
{ {
DisplayFormat=wxMDY; DisplayFormat=wxMDY;
DisplayOptions='\0'; DisplayOptions='\0';
if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0) if (wxStrcmp(dat, wxT("TODAY")) == 0 || wxStrcmp(dat, wxT("today")) == 0)
{ {
// Sets the current date // Sets the current date
Set(); Set();
@@ -141,10 +141,10 @@ void wxDate::operator = (const wxString& dat)
wxChar buf[100]; wxChar buf[100];
wxStrcpy(buf, dat); wxStrcpy(buf, dat);
wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr); wxChar *save_ptr, *token = wxStrtok(buf,wxT("/-"),&save_ptr);
month = wxAtoi(token); month = wxAtoi(token);
day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr)); day = wxAtoi(wxStrtok((wxChar *) NULL,wxT("/-"),&save_ptr));
year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr)); year = wxAtoi(wxStrtok((wxChar *) NULL,wxT(" "),&save_ptr));
} }
mdy_to_julian (); mdy_to_julian ();
@@ -379,11 +379,11 @@ wxString wxDate::FormatDate (int type) const
} }
wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]), wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9); (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
wxStrcat( buf, T(", ")); wxStrcat( buf, wxT(", "));
wxStrncat( buf, wxGetTranslation(mname[month-1]), wxStrncat( buf, wxGetTranslation(mname[month-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9); (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
wxStrcat( buf, T(" ")); wxStrcat( buf, wxT(" "));
wxSprintf( buf+wxStrlen(buf), T("%d, %d"), day, abs(year) ); wxSprintf( buf+wxStrlen(buf), wxT("%d, %d"), day, abs(year) );
if (year < 0) if (year < 0)
wxStrcat(buf,_(" B.C.")); wxStrcat(buf,_(" B.C."));
return wxString(buf); return wxString(buf);
@@ -395,10 +395,10 @@ wxString wxDate::FormatDate (int type) const
wxStrcpy(buf, _("invalid date")); wxStrcpy(buf, _("invalid date"));
return wxString(buf); return wxString(buf);
} }
wxSprintf(buf,T("%d "), day); wxSprintf(buf,wxT("%d "), day);
wxStrncat(buf, wxGetTranslation(mname[month-1]), wxStrncat(buf, wxGetTranslation(mname[month-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9); (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
wxSprintf( buf+wxStrlen(buf), T(" %d"), abs(year) ); wxSprintf( buf+wxStrlen(buf), wxT(" %d"), abs(year) );
if (year < 0) if (year < 0)
wxStrcat(buf, _(" B.C.")); wxStrcat(buf, _(" B.C."));
return wxString(buf); return wxString(buf);
@@ -408,13 +408,13 @@ wxString wxDate::FormatDate (int type) const
if (day==0 || month==0 || year==0) if (day==0 || month==0 || year==0)
wxStrcpy(buf, _("invalid date")); wxStrcpy(buf, _("invalid date"));
else else
wxSprintf( buf+wxStrlen(buf), T("%1d/%1d/%02d"), month, day, wxSprintf( buf+wxStrlen(buf), wxT("%1d/%1d/%02d"), month, day,
(DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899) (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
? (abs(year) - (abs(year) / 100 * 100)) ? (abs(year) - (abs(year) / 100 * 100))
: (abs(year)) ); : (abs(year)) );
return wxString(buf); return wxString(buf);
} }
return wxString(T("")); return wxString(wxT(""));
} }
void wxDate::SetFormat( int format ) void wxDate::SetFormat( int format )

View File

@@ -56,13 +56,13 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString &message )
wxString line; wxString line;
for (size_t pos = 0; pos < message.Len(); pos++) for (size_t pos = 0; pos < message.Len(); pos++)
{ {
if (message[pos] == T('\n')) if (message[pos] == wxT('\n'))
{ {
if (!line.IsEmpty()) if (!line.IsEmpty())
{ {
wxStaticText *s1 = new wxStaticText( this, -1, line ); wxStaticText *s1 = new wxStaticText( this, -1, line );
box->Add( s1 ); box->Add( s1 );
line = T(""); line = wxT("");
} }
else else
{ {

View File

@@ -51,7 +51,7 @@ void wxDocMDIParentFrame::OnExit(wxCommandEvent& WXUNUSED(event))
void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event) void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event)
{ {
wxString f(m_docManager->GetHistoryFile(event.GetSelection() - wxID_FILE1)); wxString f(m_docManager->GetHistoryFile(event.GetSelection() - wxID_FILE1));
if (f != T("")) if (f != wxT(""))
(void)m_docManager->CreateDocument(f, wxDOC_SILENT); (void)m_docManager->CreateDocument(f, wxDOC_SILENT);
} }

View File

@@ -103,7 +103,7 @@ static inline wxString FindExtension(const wxChar *path);
// local constants // local constants
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static const char *s_MRUEntryFormat = T("&%d %s"); static const char *s_MRUEntryFormat = wxT("&%d %s");
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -224,7 +224,7 @@ bool wxDocument::Save()
bool ret = FALSE; bool ret = FALSE;
if (!IsModified()) return TRUE; if (!IsModified()) return TRUE;
if (m_documentFile == T("") || !m_savedYet) if (m_documentFile == wxT("") || !m_savedYet)
ret = SaveAs(); ret = SaveAs();
else else
ret = OnSaveDocument(m_documentFile); ret = OnSaveDocument(m_documentFile);
@@ -254,7 +254,7 @@ bool wxDocument::SaveAs()
wxString path, name, ext; wxString path, name, ext;
wxSplitPath(fileName, & path, & name, & ext); wxSplitPath(fileName, & path, & name, & ext);
if (ext.IsEmpty() || ext == T("")) if (ext.IsEmpty() || ext == wxT(""))
{ {
fileName += "."; fileName += ".";
fileName += docTemplate->GetDefaultExtension(); fileName += docTemplate->GetDefaultExtension();
@@ -283,7 +283,7 @@ bool wxDocument::OnSaveDocument(const wxString& file)
return FALSE; return FALSE;
wxString msgTitle; wxString msgTitle;
if (wxTheApp->GetAppName() != T("")) if (wxTheApp->GetAppName() != wxT(""))
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("File error")); msgTitle = wxString(_("File error"));
@@ -319,7 +319,7 @@ bool wxDocument::OnOpenDocument(const wxString& file)
return FALSE; return FALSE;
wxString msgTitle; wxString msgTitle;
if (wxTheApp->GetAppName() != T("")) if (wxTheApp->GetAppName() != wxT(""))
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("File error")); msgTitle = wxString(_("File error"));
@@ -378,12 +378,12 @@ bool wxDocument::Revert()
// Get title, or filename if no title, else unnamed // Get title, or filename if no title, else unnamed
bool wxDocument::GetPrintableName(wxString& buf) const bool wxDocument::GetPrintableName(wxString& buf) const
{ {
if (m_documentTitle != T("")) if (m_documentTitle != wxT(""))
{ {
buf = m_documentTitle; buf = m_documentTitle;
return TRUE; return TRUE;
} }
else if (m_documentFile != T("")) else if (m_documentFile != wxT(""))
{ {
buf = wxFileNameFromPath(m_documentFile); buf = wxFileNameFromPath(m_documentFile);
return TRUE; return TRUE;
@@ -418,7 +418,7 @@ bool wxDocument::OnSaveModified()
GetPrintableName(title); GetPrintableName(title);
wxString msgTitle; wxString msgTitle;
if (wxTheApp->GetAppName() != T("")) if (wxTheApp->GetAppName() != wxT(""))
msgTitle = wxTheApp->GetAppName(); msgTitle = wxTheApp->GetAppName();
else else
msgTitle = wxString(_("Warning")); msgTitle = wxString(_("Warning"));
@@ -985,8 +985,8 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
// Existing document // Existing document
wxDocTemplate *temp = (wxDocTemplate *) NULL; wxDocTemplate *temp = (wxDocTemplate *) NULL;
wxString path2(T("")); wxString path2(wxT(""));
if (path != T("")) if (path != wxT(""))
path2 = path; path2 = path;
if (flags & wxDOC_SILENT) if (flags & wxDOC_SILENT)
@@ -1211,21 +1211,21 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
{ {
// add a '|' to separate this filter from the previous one // add a '|' to separate this filter from the previous one
if ( !descrBuf.IsEmpty() ) if ( !descrBuf.IsEmpty() )
descrBuf << T('|'); descrBuf << wxT('|');
descrBuf << templates[i]->GetDescription() descrBuf << templates[i]->GetDescription()
<< T(" (") << templates[i]->GetFileFilter() << T(") |") << wxT(" (") << templates[i]->GetFileFilter() << wxT(") |")
<< templates[i]->GetFileFilter(); << templates[i]->GetFileFilter();
} }
} }
#else #else
wxString descrBuf = T("*.*"); wxString descrBuf = wxT("*.*");
#endif #endif
int FilterIndex = 0; int FilterIndex = 0;
wxString pathTmp = wxFileSelectorEx(_("Select a file"), wxString pathTmp = wxFileSelectorEx(_("Select a file"),
T(""), wxT(""),
T(""), wxT(""),
&FilterIndex, &FilterIndex,
descrBuf, descrBuf,
0, 0,
@@ -1250,7 +1250,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
} }
else else
{ {
path = T(""); path = wxT("");
return (wxDocTemplate *) NULL; return (wxDocTemplate *) NULL;
} }
#if 0 #if 0
@@ -1261,7 +1261,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
if (!temp) if (!temp)
return (wxDocTemplate *) NULL; return (wxDocTemplate *) NULL;
wxChar *pathTmp = wxFileSelector(_("Select a file"), T(""), T(""), wxChar *pathTmp = wxFileSelector(_("Select a file"), wxT(""), wxT(""),
temp->GetDefaultExtension(), temp->GetDefaultExtension(),
temp->GetFileFilter(), temp->GetFileFilter(),
0, wxTheApp->GetTopWindow()); 0, wxTheApp->GetTopWindow());
@@ -1322,7 +1322,7 @@ wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
int n = 0; int n = 0;
for (i = 0; i < noTemplates; i++) for (i = 0; i < noTemplates; i++)
{ {
if (templates[i]->IsVisible() && (templates[i]->GetViewName() != T(""))) if (templates[i]->IsVisible() && (templates[i]->GetViewName() != wxT("")))
{ {
strings[n] = (wxChar *)templates[i]->m_viewTypeName.c_str(); strings[n] = (wxChar *)templates[i]->m_viewTypeName.c_str();
data[n] = (wxChar *)templates[i]; data[n] = (wxChar *)templates[i];
@@ -1759,7 +1759,7 @@ void wxCommandProcessor::SetMenuStrings()
{ {
wxCommand *command = (wxCommand *)m_currentCommand->Data(); wxCommand *command = (wxCommand *)m_currentCommand->Data();
wxString commandName(command->GetName()); wxString commandName(command->GetName());
if (commandName == T("")) commandName = _("Unnamed command"); if (commandName == wxT("")) commandName = _("Unnamed command");
bool canUndo = command->CanUndo(); bool canUndo = command->CanUndo();
if (canUndo) if (canUndo)
buf = wxString(_("&Undo ")) + commandName; buf = wxString(_("&Undo ")) + commandName;
@@ -1774,7 +1774,7 @@ void wxCommandProcessor::SetMenuStrings()
{ {
wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data(); wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
wxString redoCommandName(redoCommand->GetName()); wxString redoCommandName(redoCommand->GetName());
if (redoCommandName == T("")) redoCommandName = _("Unnamed command"); if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName; buf = wxString(_("&Redo ")) + redoCommandName;
m_commandEditMenu->SetLabel(wxID_REDO, buf); m_commandEditMenu->SetLabel(wxID_REDO, buf);
m_commandEditMenu->Enable(wxID_REDO, TRUE); m_commandEditMenu->Enable(wxID_REDO, TRUE);
@@ -1801,7 +1801,7 @@ void wxCommandProcessor::SetMenuStrings()
// we've undone to the start of the list, but can redo the first. // we've undone to the start of the list, but can redo the first.
wxCommand *redoCommand = (wxCommand *)m_commands.First()->Data(); wxCommand *redoCommand = (wxCommand *)m_commands.First()->Data();
wxString redoCommandName(redoCommand->GetName()); wxString redoCommandName(redoCommand->GetName());
if (redoCommandName == T("")) redoCommandName = _("Unnamed command"); if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName; buf = wxString(_("&Redo ")) + redoCommandName;
m_commandEditMenu->SetLabel(wxID_REDO, buf); m_commandEditMenu->SetLabel(wxID_REDO, buf);
m_commandEditMenu->Enable(wxID_REDO, TRUE); m_commandEditMenu->Enable(wxID_REDO, TRUE);
@@ -1900,7 +1900,7 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
void wxFileHistory::RemoveFileFromHistory(int i) void wxFileHistory::RemoveFileFromHistory(int i)
{ {
wxCHECK_RET( i < m_fileHistoryN, wxCHECK_RET( i < m_fileHistoryN,
T("invalid index in wxFileHistory::RemoveFileFromHistory") ); wxT("invalid index in wxFileHistory::RemoveFileFromHistory") );
wxNode* node = m_fileMenus.First(); wxNode* node = m_fileMenus.First();
while ( node ) while ( node )
@@ -1932,7 +1932,7 @@ void wxFileHistory::RemoveFileFromHistory(int i)
// to be removed as soon as wxMenu::Delete() is implemented // to be removed as soon as wxMenu::Delete() is implemented
#if 1 #if 1
menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, T("")); menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, wxT(""));
#endif #endif
node = node->Next(); node = node->Next();
@@ -1964,13 +1964,13 @@ void wxFileHistory::Load(wxConfigBase& config)
{ {
m_fileHistoryN = 0; m_fileHistoryN = 0;
wxString buf; wxString buf;
buf.Printf(T("file%d"), m_fileHistoryN+1); buf.Printf(wxT("file%d"), m_fileHistoryN+1);
wxString historyFile; wxString historyFile;
while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != T(""))) while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != wxT("")))
{ {
m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile); m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile);
m_fileHistoryN ++; m_fileHistoryN ++;
buf.Printf(T("file%d"), m_fileHistoryN+1); buf.Printf(wxT("file%d"), m_fileHistoryN+1);
historyFile = ""; historyFile = "";
} }
AddFilesToMenu(); AddFilesToMenu();
@@ -1982,7 +1982,7 @@ void wxFileHistory::Save(wxConfigBase& config)
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistoryN; i++)
{ {
wxString buf; wxString buf;
buf.Printf(T("file%d"), i+1); buf.Printf(wxT("file%d"), i+1);
config.Write(buf, wxString(m_fileHistory[i])); config.Write(buf, wxString(m_fileHistory[i]));
} }
} }

View File

@@ -250,7 +250,7 @@ void wxBaseArray::Add(long lItem, CMPFUNC fnCompare)
// add item at the given position // add item at the given position
void wxBaseArray::Insert(long lItem, size_t nIndex) void wxBaseArray::Insert(long lItem, size_t nIndex)
{ {
wxCHECK_RET( nIndex <= m_nCount, T("bad index in wxArray::Insert") ); wxCHECK_RET( nIndex <= m_nCount, wxT("bad index in wxArray::Insert") );
Grow(); Grow();
@@ -263,7 +263,7 @@ void wxBaseArray::Insert(long lItem, size_t nIndex)
// removes item from array (by index) // removes item from array (by index)
void wxBaseArray::Remove(size_t nIndex) void wxBaseArray::Remove(size_t nIndex)
{ {
wxCHECK_RET( nIndex <= m_nCount, T("bad index in wxArray::Remove") ); wxCHECK_RET( nIndex <= m_nCount, wxT("bad index in wxArray::Remove") );
memmove(&m_pItems[nIndex], &m_pItems[nIndex + 1], memmove(&m_pItems[nIndex], &m_pItems[nIndex + 1],
(m_nCount - nIndex - 1)*sizeof(long)); (m_nCount - nIndex - 1)*sizeof(long));
@@ -276,7 +276,7 @@ void wxBaseArray::Remove(long lItem)
int iIndex = Index(lItem); int iIndex = Index(lItem);
wxCHECK_RET( iIndex != wxNOT_FOUND, wxCHECK_RET( iIndex != wxNOT_FOUND,
T("removing inexistent item in wxArray::Remove") ); wxT("removing inexistent item in wxArray::Remove") );
Remove((size_t)iIndex); Remove((size_t)iIndex);
} }

View File

@@ -322,7 +322,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
const char *envLibPath = getenv("LD_LIBRARY_PATH"); const char *envLibPath = getenv("LD_LIBRARY_PATH");
if ( envLibPath ) if ( envLibPath )
libPath << ':' << envLibPath; libPath << ':' << envLibPath;
wxStringTokenizer tokenizer(libPath, T(':')); wxStringTokenizer tokenizer(libPath, wxT(':'));
while ( tokenizer.HasMoreToken() ) while ( tokenizer.HasMoreToken() )
{ {
wxString fullname(tokenizer.NextToken()); wxString fullname(tokenizer.NextToken());

View File

@@ -243,7 +243,7 @@ bool wxMouseEvent::ButtonDClick(int but) const
case 3: case 3:
return RightDClick(); return RightDClick();
default: default:
wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonDClick")); wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonDClick"));
} }
return FALSE; return FALSE;
@@ -264,7 +264,7 @@ bool wxMouseEvent::ButtonDown(int but) const
case 3: case 3:
return RightDown(); return RightDown();
default: default:
wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonDown")); wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonDown"));
} }
return FALSE; return FALSE;
@@ -284,7 +284,7 @@ bool wxMouseEvent::ButtonUp(int but) const
case 3: case 3:
return RightUp(); return RightUp();
default: default:
wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonUp")); wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonUp"));
} }
return FALSE; return FALSE;
@@ -303,7 +303,7 @@ bool wxMouseEvent::Button(int but) const
case 3: case 3:
return (RightDown() || RightUp() || RightDClick()); return (RightDown() || RightUp() || RightDClick());
default: default:
wxFAIL_MSG(T("invalid parameter in wxMouseEvent::Button")); wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::Button"));
} }
return FALSE; return FALSE;
@@ -321,7 +321,7 @@ bool wxMouseEvent::ButtonIsDown(int but) const
case 3: case 3:
return RightIsDown(); return RightIsDown();
default: default:
wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonIsDown")); wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonIsDown"));
} }
return FALSE; return FALSE;
@@ -753,7 +753,7 @@ void wxEvtHandler::Connect( int id, int lastId,
bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
{ {
wxCHECK_MSG( m_dynamicEvents, FALSE, wxCHECK_MSG( m_dynamicEvents, FALSE,
T("caller should check that we have dynamic events") ); wxT("caller should check that we have dynamic events") );
int commandId = event.GetId(); int commandId = event.GetId();

View File

@@ -54,7 +54,7 @@ wxFFile::wxFFile(const wxChar *filename, const char *mode)
bool wxFFile::Open(const wxChar *filename, const char *mode) bool wxFFile::Open(const wxChar *filename, const char *mode)
{ {
wxASSERT_MSG( !m_fp, T("should close or detach the old file first") ); wxASSERT_MSG( !m_fp, wxT("should close or detach the old file first") );
#if wxUSE_UNICODE #if wxUSE_UNICODE
char *tmp_fname; char *tmp_fname;
@@ -107,8 +107,8 @@ bool wxFFile::Close()
bool wxFFile::ReadAll(wxString *str) bool wxFFile::ReadAll(wxString *str)
{ {
wxCHECK_MSG( str, FALSE, T("invalid parameter") ); wxCHECK_MSG( str, FALSE, wxT("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, T("can't read from closed file") ); wxCHECK_MSG( IsOpened(), FALSE, wxT("can't read from closed file") );
clearerr(m_fp); clearerr(m_fp);
@@ -137,8 +137,8 @@ bool wxFFile::ReadAll(wxString *str)
size_t wxFFile::Read(void *pBuf, size_t nCount) size_t wxFFile::Read(void *pBuf, size_t nCount)
{ {
wxCHECK_MSG( pBuf, FALSE, T("invalid parameter") ); wxCHECK_MSG( pBuf, FALSE, wxT("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, T("can't read from closed file") ); wxCHECK_MSG( IsOpened(), FALSE, wxT("can't read from closed file") );
size_t nRead = fread(pBuf, 1, nCount, m_fp); size_t nRead = fread(pBuf, 1, nCount, m_fp);
if ( (nRead < nCount) && Error() ) if ( (nRead < nCount) && Error() )
@@ -151,8 +151,8 @@ size_t wxFFile::Read(void *pBuf, size_t nCount)
size_t wxFFile::Write(const void *pBuf, size_t nCount) size_t wxFFile::Write(const void *pBuf, size_t nCount)
{ {
wxCHECK_MSG( pBuf, FALSE, T("invalid parameter") ); wxCHECK_MSG( pBuf, FALSE, wxT("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, T("can't write to closed file") ); wxCHECK_MSG( IsOpened(), FALSE, wxT("can't write to closed file") );
size_t nWritten = fwrite(pBuf, 1, nCount, m_fp); size_t nWritten = fwrite(pBuf, 1, nCount, m_fp);
if ( nWritten < nCount ) if ( nWritten < nCount )
@@ -186,13 +186,13 @@ bool wxFFile::Flush()
bool wxFFile::Seek(long ofs, wxSeekMode mode) bool wxFFile::Seek(long ofs, wxSeekMode mode)
{ {
wxCHECK_MSG( IsOpened(), FALSE, T("can't seek on closed file") ); wxCHECK_MSG( IsOpened(), FALSE, wxT("can't seek on closed file") );
int origin; int origin;
switch ( mode ) switch ( mode )
{ {
default: default:
wxFAIL_MSG(T("unknown seek mode")); wxFAIL_MSG(wxT("unknown seek mode"));
// still fall through // still fall through
case wxFromStart: case wxFromStart:

View File

@@ -192,7 +192,7 @@ bool wxFile::Access(const wxChar *name, OpenMode mode)
break; break;
default: default:
wxFAIL_MSG(T("bad wxFile::Access mode parameter.")); wxFAIL_MSG(wxT("bad wxFile::Access mode parameter."));
} }
return access(wxFNCONV(name), how) == 0; return access(wxFNCONV(name), how) == 0;
@@ -481,7 +481,7 @@ bool wxTempFile::Open(const wxString& strName)
// different partitions for example). Unfortunately, the only standard // different partitions for example). Unfortunately, the only standard
// (POSIX) temp file creation function tmpnam() can't do it. // (POSIX) temp file creation function tmpnam() can't do it.
#if defined(__UNIX__) || defined(__WXSTUBS__)|| defined( __WXMAC__ ) #if defined(__UNIX__) || defined(__WXSTUBS__)|| defined( __WXMAC__ )
static const wxChar *szMktempSuffix = T("XXXXXX"); static const wxChar *szMktempSuffix = wxT("XXXXXX");
m_strTemp << strName << szMktempSuffix; m_strTemp << strName << szMktempSuffix;
// can use the cast because length doesn't change // can use the cast because length doesn't change
mktemp(wxMBSTRINGCAST m_strTemp.mb_str()); mktemp(wxMBSTRINGCAST m_strTemp.mb_str());
@@ -489,21 +489,21 @@ bool wxTempFile::Open(const wxString& strName)
// for now just create a file // for now just create a file
// future enhancements can be to set some extended attributes for file systems // future enhancements can be to set some extended attributes for file systems
// OS/2 supports that have them (HPFS, FAT32) and security (HPFS386) // OS/2 supports that have them (HPFS, FAT32) and security (HPFS386)
static const wxChar *szMktempSuffix = T("XXX"); static const wxChar *szMktempSuffix = wxT("XXX");
m_strTemp << strName << szMktempSuffix; m_strTemp << strName << szMktempSuffix;
mkdir(m_strTemp.GetWriteBuf(MAX_PATH)); mkdir(m_strTemp.GetWriteBuf(MAX_PATH));
#else // Windows #else // Windows
wxString strPath; wxString strPath;
wxSplitPath(strName, &strPath, NULL, NULL); wxSplitPath(strName, &strPath, NULL, NULL);
if ( strPath.IsEmpty() ) if ( strPath.IsEmpty() )
strPath = T('.'); // GetTempFileName will fail if we give it empty string strPath = wxT('.'); // GetTempFileName will fail if we give it empty string
#ifdef __WIN32__ #ifdef __WIN32__
if ( !GetTempFileName(strPath, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) ) if ( !GetTempFileName(strPath, wxT("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#else #else
// Not sure why MSVC++ 1.5 header defines first param as BYTE - bug? // Not sure why MSVC++ 1.5 header defines first param as BYTE - bug?
if ( !GetTempFileName((BYTE) (DWORD)(const wxChar*) strPath, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) ) if ( !GetTempFileName((BYTE) (DWORD)(const wxChar*) strPath, wxT("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#endif #endif
wxLogLastError(T("GetTempFileName")); wxLogLastError(wxT("GetTempFileName"));
m_strTemp.UngetWriteBuf(); m_strTemp.UngetWriteBuf();
#endif // Windows/Unix #endif // Windows/Unix

View File

@@ -99,7 +99,7 @@ wxString wxFileConfig::GetGlobalDir()
wxString strDir; wxString strDir;
#ifdef __UNIX__ #ifdef __UNIX__
strDir = T("/etc/"); strDir = wxT("/etc/");
#elif defined(__WXPM__) #elif defined(__WXPM__)
ULONG aulSysInfo[QSV_MAX] = {0}; ULONG aulSysInfo[QSV_MAX] = {0};
UINT drive; UINT drive;
@@ -192,15 +192,15 @@ wxString wxFileConfig::GetGlobalDir()
} }
} }
#elif defined(__WXSTUBS__) #elif defined(__WXSTUBS__)
wxASSERT_MSG( FALSE, T("TODO") ) ; wxASSERT_MSG( FALSE, wxT("TODO") ) ;
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
wxASSERT_MSG( FALSE, T("TODO") ) ; wxASSERT_MSG( FALSE, wxT("TODO") ) ;
#else // Windows #else // Windows
wxChar szWinDir[MAX_PATH]; wxChar szWinDir[MAX_PATH];
::GetWindowsDirectory(szWinDir, MAX_PATH); ::GetWindowsDirectory(szWinDir, MAX_PATH);
strDir = szWinDir; strDir = szWinDir;
strDir << T('\\'); strDir << wxT('\\');
#endif // Unix/Windows #endif // Unix/Windows
return strDir; return strDir;
@@ -213,9 +213,9 @@ wxString wxFileConfig::GetLocalDir()
wxGetHomeDir(&strDir); wxGetHomeDir(&strDir);
#ifdef __UNIX__ #ifdef __UNIX__
if (strDir.Last() != T('/')) strDir << T('/'); if (strDir.Last() != wxT('/')) strDir << wxT('/');
#else #else
if (strDir.Last() != T('\\')) strDir << T('\\'); if (strDir.Last() != wxT('\\')) strDir << wxT('\\');
#endif #endif
return strDir; return strDir;
@@ -226,11 +226,11 @@ wxString wxFileConfig::GetGlobalFileName(const wxChar *szFile)
wxString str = GetGlobalDir(); wxString str = GetGlobalDir();
str << szFile; str << szFile;
if ( wxStrchr(szFile, T('.')) == NULL ) if ( wxStrchr(szFile, wxT('.')) == NULL )
#ifdef __UNIX__ #ifdef __UNIX__
str << T(".conf"); str << wxT(".conf");
#else // Windows #else // Windows
str << T(".ini"); str << wxT(".ini");
#endif // UNIX/Win #endif // UNIX/Win
return str; return str;
@@ -241,14 +241,14 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile)
wxString str = GetLocalDir(); wxString str = GetLocalDir();
#ifdef __UNIX__ #ifdef __UNIX__
str << T('.'); str << wxT('.');
#endif #endif
str << szFile; str << szFile;
#ifdef __WXMSW__ #ifdef __WXMSW__
if ( wxStrchr(szFile, T('.')) == NULL ) if ( wxStrchr(szFile, wxT('.')) == NULL )
str << T(".ini"); str << wxT(".ini");
#endif #endif
return str; return str;
@@ -385,18 +385,18 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal)
; ;
// skip blank/comment lines // skip blank/comment lines
if ( *pStart == T('\0')|| *pStart == T(';') || *pStart == T('#') ) if ( *pStart == wxT('\0')|| *pStart == wxT(';') || *pStart == wxT('#') )
continue; continue;
if ( *pStart == T('[') ) { // a new group if ( *pStart == wxT('[') ) { // a new group
pEnd = pStart; pEnd = pStart;
while ( *++pEnd != T(']') ) { while ( *++pEnd != wxT(']') ) {
if ( *pEnd == T('\n') || *pEnd == T('\0') ) if ( *pEnd == wxT('\n') || *pEnd == wxT('\0') )
break; break;
} }
if ( *pEnd != T(']') ) { if ( *pEnd != wxT(']') ) {
wxLogError(_("file '%s': unexpected character %c at line %d."), wxLogError(_("file '%s': unexpected character %c at line %d."),
file.GetName(), *pEnd, n + 1); file.GetName(), *pEnd, n + 1);
continue; // skip this line continue; // skip this line
@@ -416,15 +416,15 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal)
// check that there is nothing except comments left on this line // check that there is nothing except comments left on this line
bool bCont = TRUE; bool bCont = TRUE;
while ( *++pEnd != T('\0') && bCont ) { while ( *++pEnd != wxT('\0') && bCont ) {
switch ( *pEnd ) { switch ( *pEnd ) {
case T('#'): case wxT('#'):
case T(';'): case wxT(';'):
bCont = FALSE; bCont = FALSE;
break; break;
case T(' '): case wxT(' '):
case T('\t'): case wxT('\t'):
// ignore whitespace ('\n' impossible here) // ignore whitespace ('\n' impossible here)
break; break;
@@ -438,8 +438,8 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal)
} }
else { // a key else { // a key
const wxChar *pEnd = pStart; const wxChar *pEnd = pStart;
while ( *pEnd != T('=') && !wxIsspace(*pEnd) ) { while ( *pEnd != wxT('=') && !wxIsspace(*pEnd) ) {
if ( *pEnd == T('\\') ) { if ( *pEnd == wxT('\\') ) {
// next character may be space or not - still take it because it's // next character may be space or not - still take it because it's
// quoted // quoted
pEnd++; pEnd++;
@@ -454,7 +454,7 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal)
while ( isspace(*pEnd) ) while ( isspace(*pEnd) )
pEnd++; pEnd++;
if ( *pEnd++ != T('=') ) { if ( *pEnd++ != wxT('=') ) {
wxLogError(_("file '%s', line %d: '=' expected."), wxLogError(_("file '%s', line %d: '=' expected."),
file.GetName(), n + 1); file.GetName(), n + 1);
} }
@@ -692,7 +692,7 @@ bool wxFileConfig::Write(const wxString& key, const wxString& szValue)
wxString strName = path.Name(); wxString strName = path.Name();
if ( strName.IsEmpty() ) { if ( strName.IsEmpty() ) {
// setting the value of a group is an error // setting the value of a group is an error
wxASSERT_MSG( wxIsEmpty(szValue), T("can't set value of a group!") ); wxASSERT_MSG( wxIsEmpty(szValue), wxT("can't set value of a group!") );
// ... except if it's empty in which case it's a way to force it's creation // ... except if it's empty in which case it's a way to force it's creation
m_pCurrentGroup->SetDirty(); m_pCurrentGroup->SetDirty();
@@ -724,7 +724,7 @@ bool wxFileConfig::Write(const wxString& key, long lValue)
{ {
// ltoa() is not ANSI :-( // ltoa() is not ANSI :-(
wxString buf; wxString buf;
buf.Printf(T("%ld"), lValue); buf.Printf(wxT("%ld"), lValue);
return Write(key, buf); return Write(key, buf);
} }
@@ -809,7 +809,7 @@ bool wxFileConfig::DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso)
if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) { if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) {
if ( m_pCurrentGroup != m_pRootGroup ) { if ( m_pCurrentGroup != m_pRootGroup ) {
ConfigGroup *pGroup = m_pCurrentGroup; ConfigGroup *pGroup = m_pCurrentGroup;
SetPath(T("..")); // changes m_pCurrentGroup! SetPath(wxT("..")); // changes m_pCurrentGroup!
m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name()); m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name());
} }
//else: never delete the root group //else: never delete the root group
@@ -832,7 +832,7 @@ bool wxFileConfig::DeleteAll()
if ( remove(m_strLocalFile.fn_str()) == -1 ) if ( remove(m_strLocalFile.fn_str()) == -1 )
wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str()); wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str());
m_strLocalFile = m_strGlobalFile = T(""); m_strLocalFile = m_strGlobalFile = wxT("");
Init(); Init();
return TRUE; return TRUE;
@@ -1004,10 +1004,10 @@ LineList *ConfigGroup::GetGroupLine()
// this group wasn't present in local config file, add it now // this group wasn't present in local config file, add it now
if ( pParent != NULL ) { if ( pParent != NULL ) {
wxString strFullName; wxString strFullName;
strFullName << T("[") strFullName << wxT("[")
// +1: no '/' // +1: no '/'
<< FilterOutEntryName(GetFullName().c_str() + 1) << FilterOutEntryName(GetFullName().c_str() + 1)
<< T("]"); << wxT("]");
m_pLine = m_pConfig->LineListInsert(strFullName, m_pLine = m_pConfig->LineListInsert(strFullName,
pParent->GetLastGroupLine()); pParent->GetLastGroupLine());
pParent->SetLastGroup(this); // we're surely after all the others pParent->SetLastGroup(this); // we're surely after all the others
@@ -1065,7 +1065,7 @@ void ConfigGroup::Rename(const wxString& newName)
LineList *line = GetGroupLine(); LineList *line = GetGroupLine();
wxString strFullName; wxString strFullName;
strFullName << T("[") << (GetFullName().c_str() + 1) << T("]"); // +1: no '/' strFullName << wxT("[") << (GetFullName().c_str() + 1) << wxT("]"); // +1: no '/'
line->SetText(strFullName); line->SetText(strFullName);
SetDirty(); SetDirty();
@@ -1076,7 +1076,7 @@ wxString ConfigGroup::GetFullName() const
if ( Parent() ) if ( Parent() )
return Parent()->GetFullName() + wxCONFIG_PATH_SEPARATOR + Name(); return Parent()->GetFullName() + wxCONFIG_PATH_SEPARATOR + Name();
else else
return T(""); return wxT("");
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1374,7 +1374,7 @@ void ConfigEntry::SetValue(const wxString& strValue, bool bUser)
if ( bUser ) { if ( bUser ) {
wxString strVal = FilterOutValue(strValue); wxString strVal = FilterOutValue(strValue);
wxString strLine; wxString strLine;
strLine << FilterOutEntryName(m_strName) << T('=') << strVal; strLine << FilterOutEntryName(m_strName) << wxT('=') << strVal;
if ( m_pLine != NULL ) { if ( m_pLine != NULL ) {
// entry was read from the local config file, just modify the line // entry was read from the local config file, just modify the line
@@ -1440,31 +1440,31 @@ static wxString FilterInValue(const wxString& str)
bool bQuoted = !str.IsEmpty() && str[0] == '"'; bool bQuoted = !str.IsEmpty() && str[0] == '"';
for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) { for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
if ( str[n] == T('\\') ) { if ( str[n] == wxT('\\') ) {
switch ( str[++n] ) { switch ( str[++n] ) {
case T('n'): case wxT('n'):
strResult += T('\n'); strResult += wxT('\n');
break; break;
case T('r'): case wxT('r'):
strResult += T('\r'); strResult += wxT('\r');
break; break;
case T('t'): case wxT('t'):
strResult += T('\t'); strResult += wxT('\t');
break; break;
case T('\\'): case wxT('\\'):
strResult += T('\\'); strResult += wxT('\\');
break; break;
case T('"'): case wxT('"'):
strResult += T('"'); strResult += wxT('"');
break; break;
} }
} }
else { else {
if ( str[n] != T('"') || !bQuoted ) if ( str[n] != wxT('"') || !bQuoted )
strResult += str[n]; strResult += str[n];
else if ( n != str.Len() - 1 ) { else if ( n != str.Len() - 1 ) {
wxLogWarning(_("unexpected \" at position %d in '%s'."), wxLogWarning(_("unexpected \" at position %d in '%s'."),
@@ -1487,33 +1487,33 @@ static wxString FilterOutValue(const wxString& str)
strResult.Alloc(str.Len()); strResult.Alloc(str.Len());
// quoting is necessary to preserve spaces in the beginning of the string // quoting is necessary to preserve spaces in the beginning of the string
bool bQuote = wxIsspace(str[0]) || str[0] == T('"'); bool bQuote = wxIsspace(str[0]) || str[0] == wxT('"');
if ( bQuote ) if ( bQuote )
strResult += T('"'); strResult += wxT('"');
wxChar c; wxChar c;
for ( size_t n = 0; n < str.Len(); n++ ) { for ( size_t n = 0; n < str.Len(); n++ ) {
switch ( str[n] ) { switch ( str[n] ) {
case T('\n'): case wxT('\n'):
c = T('n'); c = wxT('n');
break; break;
case T('\r'): case wxT('\r'):
c = T('r'); c = wxT('r');
break; break;
case T('\t'): case wxT('\t'):
c = T('t'); c = wxT('t');
break; break;
case T('\\'): case wxT('\\'):
c = T('\\'); c = wxT('\\');
break; break;
case T('"'): case wxT('"'):
if ( bQuote ) { if ( bQuote ) {
c = T('"'); c = wxT('"');
break; break;
} }
//else: fall through //else: fall through
@@ -1524,11 +1524,11 @@ static wxString FilterOutValue(const wxString& str)
} }
// we get here only for special characters // we get here only for special characters
strResult << T('\\') << c; strResult << wxT('\\') << c;
} }
if ( bQuote ) if ( bQuote )
strResult += T('"'); strResult += wxT('"');
return strResult; return strResult;
} }
@@ -1540,7 +1540,7 @@ static wxString FilterInEntryName(const wxString& str)
strResult.Alloc(str.Len()); strResult.Alloc(str.Len());
for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) { for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) {
if ( *pc == T('\\') ) if ( *pc == wxT('\\') )
pc++; pc++;
strResult += *pc; strResult += *pc;
@@ -1555,15 +1555,15 @@ static wxString FilterOutEntryName(const wxString& str)
wxString strResult; wxString strResult;
strResult.Alloc(str.Len()); strResult.Alloc(str.Len());
for ( const wxChar *pc = str.c_str(); *pc != T('\0'); pc++ ) { for ( const wxChar *pc = str.c_str(); *pc != wxT('\0'); pc++ ) {
wxChar c = *pc; wxChar c = *pc;
// we explicitly allow some of "safe" chars and 8bit ASCII characters // we explicitly allow some of "safe" chars and 8bit ASCII characters
// which will probably never have special meaning // which will probably never have special meaning
// NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR // NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR
// should *not* be quoted // should *not* be quoted
if ( !wxIsalnum(c) && !wxStrchr(T("@_/-!.*%"), c) && ((c & 0x80) == 0) ) if ( !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%"), c) && ((c & 0x80) == 0) )
strResult += T('\\'); strResult += wxT('\\');
strResult += c; strResult += c;
} }

View File

@@ -144,9 +144,9 @@ void wxPathList::AddEnvList (const wxString& envVariable)
{ {
static const wxChar PATH_TOKS[] = static const wxChar PATH_TOKS[] =
#ifdef __WINDOWS__ #ifdef __WINDOWS__
T(" ;"); // Don't seperate with colon in DOS (used for drive) wxT(" ;"); // Don't seperate with colon in DOS (used for drive)
#else #else
T(" :;"); wxT(" :;");
#endif #endif
wxChar *val = wxGetenv (WXSTRINGCAST envVariable); wxChar *val = wxGetenv (WXSTRINGCAST envVariable);
@@ -216,8 +216,8 @@ wxString wxPathList::FindValidPath (const wxString& file)
wxChar *path = (wxChar *) node->Data (); wxChar *path = (wxChar *) node->Data ();
wxStrcpy (wxFileFunctionsBuffer, path); wxStrcpy (wxFileFunctionsBuffer, path);
wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1]; wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1];
if (ch != T('\\') && ch != T('/')) if (ch != wxT('\\') && ch != wxT('/'))
wxStrcat (wxFileFunctionsBuffer, T("/")); wxStrcat (wxFileFunctionsBuffer, wxT("/"));
wxStrcat (wxFileFunctionsBuffer, filename); wxStrcat (wxFileFunctionsBuffer, filename);
#ifdef __WINDOWS__ #ifdef __WINDOWS__
Unix2DosFilename (wxFileFunctionsBuffer); Unix2DosFilename (wxFileFunctionsBuffer);
@@ -228,7 +228,7 @@ wxString wxPathList::FindValidPath (const wxString& file)
} }
} // for() } // for()
return wxString(T("")); // Not found return wxString(wxT("")); // Not found
} }
wxString wxPathList::FindAbsoluteValidPath (const wxString& file) wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
@@ -272,7 +272,7 @@ wxFileExists (const wxString& filename)
struct stat stbuf; struct stat stbuf;
#endif #endif
if ((filename != T("")) && stat (wxFNSTRINGCAST filename.fn_str(), &stbuf) == 0) if ((filename != wxT("")) && stat (wxFNSTRINGCAST filename.fn_str(), &stbuf) == 0)
return TRUE; return TRUE;
return FALSE; return FALSE;
#endif #endif
@@ -293,15 +293,15 @@ bool wxFileExists(const char *pszFileName)
bool bool
wxIsAbsolutePath (const wxString& filename) wxIsAbsolutePath (const wxString& filename)
{ {
if (filename != T("")) if (filename != wxT(""))
{ {
if (filename[0] == T('/') if (filename[0] == wxT('/')
#ifdef __VMS__ #ifdef __VMS__
|| (filename[0] == T('[') && filename[1] != T('.')) || (filename[0] == wxT('[') && filename[1] != wxT('.'))
#endif #endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
/* MSDOS */ /* MSDOS */
|| filename[0] == T('\\') || (wxIsalpha (filename[0]) && filename[1] == T(':')) || filename[0] == wxT('\\') || (wxIsalpha (filename[0]) && filename[1] == wxT(':'))
#endif #endif
) )
return TRUE; return TRUE;
@@ -321,7 +321,7 @@ void wxStripExtension(wxChar *buffer)
int i = len-1; int i = len-1;
while (i > 0) while (i > 0)
{ {
if (buffer[i] == T('.')) if (buffer[i] == wxT('.'))
{ {
buffer[i] = 0; buffer[i] = 0;
break; break;
@@ -336,7 +336,7 @@ void wxStripExtension(wxString& buffer)
size_t i = len-1; size_t i = len-1;
while (i > 0) while (i > 0)
{ {
if (buffer.GetChar(i) == T('.')) if (buffer.GetChar(i) == wxT('.'))
{ {
buffer = buffer.Left(i); buffer = buffer.Left(i);
break; break;
@@ -349,15 +349,15 @@ void wxStripExtension(wxString& buffer)
wxChar *wxRealPath (wxChar *path) wxChar *wxRealPath (wxChar *path)
{ {
#ifdef __WXMSW__ #ifdef __WXMSW__
static const wxChar SEP = T('\\'); static const wxChar SEP = wxT('\\');
Unix2DosFilename(path); Unix2DosFilename(path);
#else #else
static const wxChar SEP = T('/'); static const wxChar SEP = wxT('/');
#endif #endif
if (path[0] && path[1]) { if (path[0] && path[1]) {
/* MATTHEW: special case "/./x" */ /* MATTHEW: special case "/./x" */
wxChar *p; wxChar *p;
if (path[2] == SEP && path[1] == T('.')) if (path[2] == SEP && path[1] == wxT('.'))
p = &path[0]; p = &path[0];
else else
p = &path[2]; p = &path[2];
@@ -365,31 +365,31 @@ wxChar *wxRealPath (wxChar *path)
{ {
if (*p == SEP) if (*p == SEP)
{ {
if (p[1] == T('.') && p[2] == T('.') && (p[3] == SEP || p[3] == T('\0'))) if (p[1] == wxT('.') && p[2] == wxT('.') && (p[3] == SEP || p[3] == wxT('\0')))
{ {
wxChar *q; wxChar *q;
for (q = p - 1; q >= path && *q != SEP; q--); for (q = p - 1; q >= path && *q != SEP; q--);
if (q[0] == SEP && (q[1] != T('.') || q[2] != T('.') || q[3] != SEP) if (q[0] == SEP && (q[1] != wxT('.') || q[2] != wxT('.') || q[3] != SEP)
&& (q - 1 <= path || q[-1] != SEP)) && (q - 1 <= path || q[-1] != SEP))
{ {
wxStrcpy (q, p + 3); wxStrcpy (q, p + 3);
if (path[0] == T('\0')) if (path[0] == wxT('\0'))
{ {
path[0] = SEP; path[0] = SEP;
path[1] = T('\0'); path[1] = wxT('\0');
} }
#ifdef __WXMSW__ #ifdef __WXMSW__
/* Check that path[2] is NULL! */ /* Check that path[2] is NULL! */
else if (path[1] == T(':') && !path[2]) else if (path[1] == wxT(':') && !path[2])
{ {
path[2] = SEP; path[2] = SEP;
path[3] = T('\0'); path[3] = wxT('\0');
} }
#endif #endif
p = q - 1; p = q - 1;
} }
} }
else if (p[1] == T('.') && (p[2] == SEP || p[2] == T('\0'))) else if (p[1] == wxT('.') && (p[2] == SEP || p[2] == wxT('\0')))
wxStrcpy (p, p + 2); wxStrcpy (p, p + 2);
} }
} }
@@ -400,20 +400,20 @@ wxChar *wxRealPath (wxChar *path)
// Must be destroyed // Must be destroyed
wxChar *wxCopyAbsolutePath(const wxString& filename) wxChar *wxCopyAbsolutePath(const wxString& filename)
{ {
if (filename == T("")) if (filename == wxT(""))
return (wxChar *) NULL; return (wxChar *) NULL;
if (! IsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) { if (! IsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) {
wxChar buf[_MAXPATHLEN]; wxChar buf[_MAXPATHLEN];
buf[0] = T('\0'); buf[0] = wxT('\0');
wxGetWorkingDirectory(buf, WXSIZEOF(buf)); wxGetWorkingDirectory(buf, WXSIZEOF(buf));
wxChar ch = buf[wxStrlen(buf) - 1]; wxChar ch = buf[wxStrlen(buf) - 1];
#ifdef __WXMSW__ #ifdef __WXMSW__
if (ch != T('\\') && ch != T('/')) if (ch != wxT('\\') && ch != wxT('/'))
wxStrcat(buf, T("\\")); wxStrcat(buf, wxT("\\"));
#else #else
if (ch != T('/')) if (ch != wxT('/'))
wxStrcat(buf, T("/")); wxStrcat(buf, wxT("/"));
#endif #endif
wxStrcat(buf, wxFileFunctionsBuffer); wxStrcat(buf, wxFileFunctionsBuffer);
return copystring( wxRealPath(buf) ); return copystring( wxRealPath(buf) );
@@ -451,21 +451,21 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
int q; int q;
// Some compilers don't like this line. // Some compilers don't like this line.
// const wxChar trimchars[] = T("\n \t"); // const wxChar trimchars[] = wxT("\n \t");
wxChar trimchars[4]; wxChar trimchars[4];
trimchars[0] = T('\n'); trimchars[0] = wxT('\n');
trimchars[1] = T(' '); trimchars[1] = wxT(' ');
trimchars[2] = T('\t'); trimchars[2] = wxT('\t');
trimchars[3] = 0; trimchars[3] = 0;
#ifdef __WXMSW__ #ifdef __WXMSW__
const wxChar SEP = T('\\'); const wxChar SEP = wxT('\\');
#else #else
const wxChar SEP = T('/'); const wxChar SEP = wxT('/');
#endif #endif
buf[0] = T('\0'); buf[0] = wxT('\0');
if (name == NULL || *name == T('\0')) if (name == NULL || *name == wxT('\0'))
return buf; return buf;
nm = copystring(name); // Make a scratch copy nm = copystring(name); // Make a scratch copy
wxChar *nm_tmp = nm; wxChar *nm_tmp = nm;
@@ -476,14 +476,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
/* And strip off trailing whitespace and cr */ /* And strip off trailing whitespace and cr */
s = nm + (q = wxStrlen(nm)) - 1; s = nm + (q = wxStrlen(nm)) - 1;
while (q-- && wxStrchr((wxChar *)trimchars, *s) != NULL) while (q-- && wxStrchr((wxChar *)trimchars, *s) != NULL)
*s = T('\0'); *s = wxT('\0');
s = nm; s = nm;
d = lnm; d = lnm;
#ifdef __WXMSW__ #ifdef __WXMSW__
q = FALSE; q = FALSE;
#else #else
q = nm[0] == T('\\') && nm[1] == T('~'); q = nm[0] == wxT('\\') && nm[1] == wxT('~');
#endif #endif
/* Expand inline environment variables */ /* Expand inline environment variables */
@@ -491,7 +491,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
while (*d) while (*d)
{ {
*d++ = *s; *d++ = *s;
if(*s == T('\\')) if(*s == wxT('\\'))
{ {
*(d - 1) = *++s; *(d - 1) = *++s;
if (*d) if (*d)
@@ -506,7 +506,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
#else #else
while ((*d++ = *s)) { while ((*d++ = *s)) {
# ifndef __WXMSW__ # ifndef __WXMSW__
if (*s == T('\\')) { if (*s == wxT('\\')) {
if ((*(d - 1) = *++s)) { if ((*(d - 1) = *++s)) {
s++; s++;
continue; continue;
@@ -516,13 +516,13 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
# endif # endif
#endif #endif
#ifdef __WXMSW__ #ifdef __WXMSW__
if (*s++ == T('$') && (*s == T('{') || *s == T(')'))) if (*s++ == wxT('$') && (*s == wxT('{') || *s == wxT(')')))
#else #else
if (*s++ == T('$')) if (*s++ == wxT('$'))
#endif #endif
{ {
register wxChar *start = d; register wxChar *start = d;
register int braces = (*s == T('{') || *s == T('(')); register int braces = (*s == wxT('{') || *s == wxT('('));
register wxChar *value; register wxChar *value;
#ifdef __VISAGECPP__ #ifdef __VISAGECPP__
// VA gives assignment in logical expr warning // VA gives assignment in logical expr warning
@@ -531,7 +531,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
#else #else
while ((*d++ = *s)) while ((*d++ = *s))
#endif #endif
if (braces ? (*s == T('}') || *s == T(')')) : !(wxIsalnum(*s) || *s == T('_')) ) if (braces ? (*s == wxT('}') || *s == wxT(')')) : !(wxIsalnum(*s) || *s == wxT('_')) )
break; break;
else else
s++; s++;
@@ -553,14 +553,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
/* Expand ~ and ~user */ /* Expand ~ and ~user */
nm = lnm; nm = lnm;
s = T(""); s = wxT("");
if (nm[0] == T('~') && !q) if (nm[0] == wxT('~') && !q)
{ {
/* prefix ~ */ /* prefix ~ */
if (nm[1] == SEP || nm[1] == 0) if (nm[1] == SEP || nm[1] == 0)
{ /* ~/filename */ { /* ~/filename */
// FIXME: wxGetUserHome could return temporary storage in Unicode mode // FIXME: wxGetUserHome could return temporary storage in Unicode mode
if ((s = WXSTRINGCAST wxGetUserHome(T(""))) != NULL) { if ((s = WXSTRINGCAST wxGetUserHome(wxT(""))) != NULL) {
if (*++nm) if (*++nm)
nm++; nm++;
} }
@@ -577,7 +577,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) { if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
if (was_sep) /* replace only if it was there: */ if (was_sep) /* replace only if it was there: */
*s = SEP; *s = SEP;
s = T(""); s = wxT("");
} else { } else {
nm = nnm; nm = nnm;
s = home; s = home;
@@ -588,7 +588,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
d = buf; d = buf;
if (s && *s) { /* MATTHEW: s could be NULL if user '~' didn't exist */ if (s && *s) { /* MATTHEW: s could be NULL if user '~' didn't exist */
/* Copy home dir */ /* Copy home dir */
while (T('\0') != (*d++ = *s++)) while (wxT('\0') != (*d++ = *s++))
/* loop */; /* loop */;
// Handle root home // Handle root home
if (d - 1 > buf && *(d - 2) != SEP) if (d - 1 > buf && *(d - 2) != SEP)
@@ -620,7 +620,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
{ {
static wxChar dest[_MAXPATHLEN]; static wxChar dest[_MAXPATHLEN];
if (filename == T("")) if (filename == wxT(""))
return (wxChar *) NULL; return (wxChar *) NULL;
wxStrcpy (dest, WXSTRINGCAST filename); wxStrcpy (dest, WXSTRINGCAST filename);
@@ -635,10 +635,10 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
(tcp = wxStrstr (dest, val)) != NULL) (tcp = wxStrstr (dest, val)) != NULL)
{ {
wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val)); wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val));
*tcp++ = T('$'); *tcp++ = wxT('$');
*tcp++ = T('{'); *tcp++ = wxT('{');
wxStrcpy (tcp, WXSTRINGCAST envname); wxStrcpy (tcp, WXSTRINGCAST envname);
wxStrcat (tcp, T("}")); wxStrcat (tcp, wxT("}"));
wxStrcat (tcp, wxFileFunctionsBuffer); wxStrcat (tcp, wxFileFunctionsBuffer);
} }
@@ -648,8 +648,8 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
(len = wxStrlen(val)) > 2 && (len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0) wxStrncmp(dest, val, len) == 0)
{ {
wxStrcpy(wxFileFunctionsBuffer, T("~")); wxStrcpy(wxFileFunctionsBuffer, wxT("~"));
if (user != T("")) if (user != wxT(""))
wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user); wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
#ifdef __WXMSW__ #ifdef __WXMSW__
// strcat(wxFileFunctionsBuffer, "\\"); // strcat(wxFileFunctionsBuffer, "\\");
@@ -674,16 +674,16 @@ wxChar *wxFileNameFromPath (wxChar *path)
tcp = path + wxStrlen (path); tcp = path + wxStrlen (path);
while (--tcp >= path) while (--tcp >= path)
{ {
if (*tcp == T('/') || *tcp == T('\\') if (*tcp == wxT('/') || *tcp == wxT('\\')
#ifdef __VMS__ #ifdef __VMS__
|| *tcp == T(':') || *tcp == T(']')) || *tcp == wxT(':') || *tcp == wxT(']'))
#else #else
) )
#endif #endif
return tcp + 1; return tcp + 1;
} /* while */ } /* while */
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
if (wxIsalpha (*path) && *(path + 1) == T(':')) if (wxIsalpha (*path) && *(path + 1) == wxT(':'))
return path + 2; return path + 2;
#endif #endif
} }
@@ -692,7 +692,7 @@ wxChar *wxFileNameFromPath (wxChar *path)
wxString wxFileNameFromPath (const wxString& path1) wxString wxFileNameFromPath (const wxString& path1)
{ {
if (path1 != T("")) if (path1 != wxT(""))
{ {
wxChar *path = WXSTRINGCAST path1 ; wxChar *path = WXSTRINGCAST path1 ;
@@ -701,16 +701,16 @@ wxString wxFileNameFromPath (const wxString& path1)
tcp = path + wxStrlen (path); tcp = path + wxStrlen (path);
while (--tcp >= path) while (--tcp >= path)
{ {
if (*tcp == T('/') || *tcp == T('\\') if (*tcp == wxT('/') || *tcp == wxT('\\')
#ifdef __VMS__ #ifdef __VMS__
|| *tcp == T(':') || *tcp == T(']')) || *tcp == wxT(':') || *tcp == wxT(']'))
#else #else
) )
#endif #endif
return wxString(tcp + 1); return wxString(tcp + 1);
} /* while */ } /* while */
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
if (wxIsalpha (*path) && *(path + 1) == T(':')) if (wxIsalpha (*path) && *(path + 1) == wxT(':'))
return wxString(path + 2); return wxString(path + 2);
#endif #endif
} }
@@ -739,7 +739,7 @@ wxPathOnly (wxChar *path)
while (!done && i > -1) while (!done && i > -1)
{ {
// ] is for VMS // ] is for VMS
if (path[i] == T('/') || path[i] == T('\\') || path[i] == T(']')) if (path[i] == wxT('/') || path[i] == wxT('\\') || path[i] == wxT(']'))
{ {
done = TRUE; done = TRUE;
#ifdef __VMS__ #ifdef __VMS__
@@ -755,11 +755,11 @@ wxPathOnly (wxChar *path)
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
// Try Drive specifier // Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == T(':')) if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{ {
// A:junk --> A:. (since A:.\junk Not A:\junk) // A:junk --> A:. (since A:.\junk Not A:\junk)
buf[2] = T('.'); buf[2] = wxT('.');
buf[3] = T('\0'); buf[3] = wxT('\0');
return buf; return buf;
} }
#endif #endif
@@ -771,7 +771,7 @@ wxPathOnly (wxChar *path)
// Return just the directory, or NULL if no directory // Return just the directory, or NULL if no directory
wxString wxPathOnly (const wxString& path) wxString wxPathOnly (const wxString& path)
{ {
if (path != T("")) if (path != wxT(""))
{ {
wxChar buf[_MAXPATHLEN]; wxChar buf[_MAXPATHLEN];
@@ -787,7 +787,7 @@ wxString wxPathOnly (const wxString& path)
while (!done && i > -1) while (!done && i > -1)
{ {
// ] is for VMS // ] is for VMS
if (path[i] == T('/') || path[i] == T('\\') || path[i] == T(']')) if (path[i] == wxT('/') || path[i] == wxT('\\') || path[i] == wxT(']'))
{ {
done = TRUE; done = TRUE;
#ifdef __VMS__ #ifdef __VMS__
@@ -803,17 +803,17 @@ wxString wxPathOnly (const wxString& path)
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
// Try Drive specifier // Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == T(':')) if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{ {
// A:junk --> A:. (since A:.\junk Not A:\junk) // A:junk --> A:. (since A:.\junk Not A:\junk)
buf[2] = T('.'); buf[2] = wxT('.');
buf[3] = T('\0'); buf[3] = wxT('\0');
return wxString(buf); return wxString(buf);
} }
#endif #endif
} }
return wxString(T("")); return wxString(wxT(""));
} }
// Utility for converting delimiters in DOS filenames to UNIX style // Utility for converting delimiters in DOS filenames to UNIX style
@@ -827,15 +827,15 @@ wxMac2UnixFilename (wxChar *s)
if (s) if (s)
{ {
memmove( s+1 , s ,(strlen( s ) + 1)*sizeof(wxChar)) ; memmove( s+1 , s ,(strlen( s ) + 1)*sizeof(wxChar)) ;
if ( *s == T(':') ) if ( *s == wxT(':') )
*s = T('.') ; *s = wxT('.') ;
else else
*s = T('/') ; *s = wxT('/') ;
while (*s) while (*s)
{ {
if (*s == T(':')) if (*s == wxT(':'))
*s = T('/'); *s = wxT('/');
else else
*s = wxTolower(*s); // Case INDEPENDENT *s = wxTolower(*s); // Case INDEPENDENT
s++; s++;
@@ -848,24 +848,24 @@ wxUnix2MacFilename (wxChar *s)
{ {
if (s) if (s)
{ {
if ( *s == T('.') ) if ( *s == wxT('.') )
{ {
// relative path , since it goes on with slash which is translated to a : // relative path , since it goes on with slash which is translated to a :
memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ; memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ;
} }
else if ( *s == T('/') ) else if ( *s == wxT('/') )
{ {
// absolute path -> on mac just start with the drive name // absolute path -> on mac just start with the drive name
memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ; memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ;
} }
else else
{ {
wxASSERT_MSG( 1 , T("unknown path beginning") ) ; wxASSERT_MSG( 1 , wxT("unknown path beginning") ) ;
} }
while (*s) while (*s)
{ {
if (*s == T('/') || *s == T('\\')) if (*s == wxT('/') || *s == wxT('\\'))
*s = T(':'); *s = wxT(':');
s++ ; s++ ;
} }
@@ -878,8 +878,8 @@ wxDos2UnixFilename (wxChar *s)
if (s) if (s)
while (*s) while (*s)
{ {
if (*s == T('\\')) if (*s == wxT('\\'))
*s = T('/'); *s = wxT('/');
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
else else
*s = wxTolower(*s); // Case INDEPENDENT *s = wxTolower(*s); // Case INDEPENDENT
@@ -900,8 +900,8 @@ wxUnix2DosFilename (wxChar *WXUNUSED(s))
if (s) if (s)
while (*s) while (*s)
{ {
if (*s == T('/')) if (*s == wxT('/'))
*s = T('\\'); *s = wxT('\\');
s++; s++;
} }
#endif #endif
@@ -1129,8 +1129,8 @@ bool wxPathExists(const wxChar *pszPathName)
/* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists /* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists
* OTOH, we should change "d:" to "d:\" and leave "\" as is. */ * OTOH, we should change "d:" to "d:\" and leave "\" as is. */
wxString strPath(pszPathName); wxString strPath(pszPathName);
if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != T('\0') ) if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != wxT('\0') )
strPath.Last() = T('\0'); strPath.Last() = wxT('\0');
#ifdef __SALFORDC__ #ifdef __SALFORDC__
struct _stat st; struct _stat st;
@@ -1166,7 +1166,7 @@ wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf)
for (short suffix = last_temp + 1; suffix != last_temp; ++suffix %= 1000) for (short suffix = last_temp + 1; suffix != last_temp; ++suffix %= 1000)
{ {
wxSprintf (tmp, T("/tmp/%s%d.%03x"), WXSTRINGCAST prefix, (int) getpid (), (int) suffix); wxSprintf (tmp, wxT("/tmp/%s%d.%03x"), WXSTRINGCAST prefix, (int) getpid (), (int) suffix);
if (!wxFileExists( tmp )) if (!wxFileExists( tmp ))
{ {
// Touch the file to create it (reserve name) // Touch the file to create it (reserve name)
@@ -1217,11 +1217,11 @@ wxString wxFindFirstFile(const wxChar *spec, int flags)
wxString path(wxPathOnly(gs_strFileSpec)); wxString path(wxPathOnly(gs_strFileSpec));
// special case: path is really "/" // special case: path is really "/"
if ( !path && gs_strFileSpec[0u] == T('/') ) if ( !path && gs_strFileSpec[0u] == wxT('/') )
path = T('/'); path = wxT('/');
// path is empty => Local directory // path is empty => Local directory
if ( !path ) if ( !path )
path = T('.'); path = wxT('.');
gs_dirStream = opendir(path.fn_str()); gs_dirStream = opendir(path.fn_str());
if ( !gs_dirStream ) if ( !gs_dirStream )
@@ -1243,7 +1243,7 @@ wxString wxFindNextFile()
wxString result; wxString result;
#ifndef __VMS__ #ifndef __VMS__
wxCHECK_MSG( gs_dirStream, result, T("must call wxFindFirstFile first") ); wxCHECK_MSG( gs_dirStream, result, wxT("must call wxFindFirstFile first") );
// Find path only so we can concatenate // Find path only so we can concatenate
// found file onto path // found file onto path
@@ -1251,8 +1251,8 @@ wxString wxFindNextFile()
wxString name(wxFileNameFromPath(gs_strFileSpec)); wxString name(wxFileNameFromPath(gs_strFileSpec));
/* MATTHEW: special case: path is really "/" */ /* MATTHEW: special case: path is really "/" */
if ( !path && gs_strFileSpec[0u] == T('/')) if ( !path && gs_strFileSpec[0u] == wxT('/'))
path = T('/'); path = wxT('/');
// Do the reading // Do the reading
struct dirent *nextDir; struct dirent *nextDir;
@@ -1266,8 +1266,8 @@ wxString wxFindNextFile()
if ( !path.IsEmpty() ) if ( !path.IsEmpty() )
{ {
result = path; result = path;
if ( path != T('/') ) if ( path != wxT('/') )
result += T('/'); result += wxT('/');
} }
result += nextDir->d_name; result += nextDir->d_name;
@@ -1330,7 +1330,7 @@ wxString wxFindFirstFile(const wxChar *spec, int flags)
// Find path only so we can concatenate found file onto path // Find path only so we can concatenate found file onto path
wxString path(wxPathOnly(gs_strFileSpec)); wxString path(wxPathOnly(gs_strFileSpec));
if ( !path.IsEmpty() ) if ( !path.IsEmpty() )
result << path << T('\\'); result << path << wxT('\\');
#ifdef __WIN32__ #ifdef __WIN32__
if ( gs_hFileStruct != INVALID_HANDLE_VALUE ) if ( gs_hFileStruct != INVALID_HANDLE_VALUE )
@@ -1423,7 +1423,7 @@ try_again:
goto try_again; goto try_again;
if ( !path.IsEmpty() ) if ( !path.IsEmpty() )
result << path << T('\\'); result << path << wxT('\\');
result << gs_findDataStruct.cFileName; result << gs_findDataStruct.cFileName;
} }
@@ -1489,8 +1489,8 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
if (getcwd(buf, sz) == NULL) { if (getcwd(buf, sz) == NULL) {
#endif #endif
#endif #endif
buf[0] = T('.'); buf[0] = wxT('.');
buf[1] = T('\0'); buf[1] = wxT('\0');
} }
#if wxUSE_UNICODE #if wxUSE_UNICODE
else { else {
@@ -1613,7 +1613,7 @@ void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName,
wxString *pstrExt) wxString *pstrExt)
{ {
// it can be empty, but it shouldn't be NULL // it can be empty, but it shouldn't be NULL
wxCHECK_RET( pszFileName, T("NULL file name in wxSplitPath") ); wxCHECK_RET( pszFileName, wxT("NULL file name in wxSplitPath") );
const wxChar *pDot = wxStrrchr(pszFileName, wxFILE_SEP_EXT); const wxChar *pDot = wxStrrchr(pszFileName, wxFILE_SEP_EXT);
@@ -1673,9 +1673,9 @@ bool wxIsWild( const wxString& pattern )
wxChar *pat = WXSTRINGCAST(tmp); wxChar *pat = WXSTRINGCAST(tmp);
while (*pat) { while (*pat) {
switch (*pat++) { switch (*pat++) {
case T('?'): case T('*'): case T('['): case T('{'): case wxT('?'): case wxT('*'): case wxT('['): case wxT('{'):
return TRUE; return TRUE;
case T('\\'): case wxT('\\'):
if (!*pat++) if (!*pat++)
return FALSE; return FALSE;
} }
@@ -1709,57 +1709,57 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
wxChar *cp; wxChar *cp;
bool done = FALSE, ret_code, ok; bool done = FALSE, ret_code, ok;
// Below is for vi fans // Below is for vi fans
const wxChar OB = T('{'), CB = T('}'); const wxChar OB = wxT('{'), CB = wxT('}');
// dot_special means '.' only matches '.' // dot_special means '.' only matches '.'
if (dot_special && *str == T('.') && *pattern != *str) if (dot_special && *str == wxT('.') && *pattern != *str)
return FALSE; return FALSE;
while ((*pattern != T('\0')) && (!done) while ((*pattern != wxT('\0')) && (!done)
&& (((*str==T('\0'))&&((*pattern==OB)||(*pattern==T('*'))))||(*str!=T('\0')))) { && (((*str==wxT('\0'))&&((*pattern==OB)||(*pattern==wxT('*'))))||(*str!=wxT('\0')))) {
switch (*pattern) { switch (*pattern) {
case T('\\'): case wxT('\\'):
pattern++; pattern++;
if (*pattern != T('\0')) if (*pattern != wxT('\0'))
pattern++; pattern++;
break; break;
case T('*'): case wxT('*'):
pattern++; pattern++;
ret_code = FALSE; ret_code = FALSE;
while ((*str!=T('\0')) while ((*str!=wxT('\0'))
&& (!(ret_code=wxMatchWild(pattern, str++, FALSE)))) && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
/*loop*/; /*loop*/;
if (ret_code) { if (ret_code) {
while (*str != T('\0')) while (*str != wxT('\0'))
str++; str++;
while (*pattern != T('\0')) while (*pattern != wxT('\0'))
pattern++; pattern++;
} }
break; break;
case T('['): case wxT('['):
pattern++; pattern++;
repeat: repeat:
if ((*pattern == T('\0')) || (*pattern == T(']'))) { if ((*pattern == wxT('\0')) || (*pattern == wxT(']'))) {
done = TRUE; done = TRUE;
break; break;
} }
if (*pattern == T('\\')) { if (*pattern == wxT('\\')) {
pattern++; pattern++;
if (*pattern == T('\0')) { if (*pattern == wxT('\0')) {
done = TRUE; done = TRUE;
break; break;
} }
} }
if (*(pattern + 1) == T('-')) { if (*(pattern + 1) == wxT('-')) {
c = *pattern; c = *pattern;
pattern += 2; pattern += 2;
if (*pattern == T(']')) { if (*pattern == wxT(']')) {
done = TRUE; done = TRUE;
break; break;
} }
if (*pattern == T('\\')) { if (*pattern == wxT('\\')) {
pattern++; pattern++;
if (*pattern == T('\0')) { if (*pattern == wxT('\0')) {
done = TRUE; done = TRUE;
break; break;
} }
@@ -1773,51 +1773,51 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
goto repeat; goto repeat;
} }
pattern++; pattern++;
while ((*pattern != T(']')) && (*pattern != T('\0'))) { while ((*pattern != wxT(']')) && (*pattern != wxT('\0'))) {
if ((*pattern == T('\\')) && (*(pattern + 1) != T('\0'))) if ((*pattern == wxT('\\')) && (*(pattern + 1) != wxT('\0')))
pattern++; pattern++;
pattern++; pattern++;
} }
if (*pattern != T('\0')) { if (*pattern != wxT('\0')) {
pattern++, str++; pattern++, str++;
} }
break; break;
case T('?'): case wxT('?'):
pattern++; pattern++;
str++; str++;
break; break;
case OB: case OB:
pattern++; pattern++;
while ((*pattern != CB) && (*pattern != T('\0'))) { while ((*pattern != CB) && (*pattern != wxT('\0'))) {
cp = str; cp = str;
ok = TRUE; ok = TRUE;
while (ok && (*cp != T('\0')) && (*pattern != T('\0')) while (ok && (*cp != wxT('\0')) && (*pattern != wxT('\0'))
&& (*pattern != T(',')) && (*pattern != CB)) { && (*pattern != wxT(',')) && (*pattern != CB)) {
if (*pattern == T('\\')) if (*pattern == wxT('\\'))
pattern++; pattern++;
ok = (*pattern++ == *cp++); ok = (*pattern++ == *cp++);
} }
if (*pattern == T('\0')) { if (*pattern == wxT('\0')) {
ok = FALSE; ok = FALSE;
done = TRUE; done = TRUE;
break; break;
} else if (ok) { } else if (ok) {
str = cp; str = cp;
while ((*pattern != CB) && (*pattern != T('\0'))) { while ((*pattern != CB) && (*pattern != wxT('\0'))) {
if (*++pattern == T('\\')) { if (*++pattern == wxT('\\')) {
if (*++pattern == CB) if (*++pattern == CB)
pattern++; pattern++;
} }
} }
} else { } else {
while (*pattern!=CB && *pattern!=T(',') && *pattern!=T('\0')) { while (*pattern!=CB && *pattern!=wxT(',') && *pattern!=wxT('\0')) {
if (*++pattern == T('\\')) { if (*++pattern == wxT('\\')) {
if (*++pattern == CB || *pattern == T(',')) if (*++pattern == CB || *pattern == wxT(','))
pattern++; pattern++;
} }
} }
} }
if (*pattern != T('\0')) if (*pattern != wxT('\0'))
pattern++; pattern++;
} }
break; break;
@@ -1829,9 +1829,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
} }
} }
} }
while (*pattern == T('*')) while (*pattern == wxT('*'))
pattern++; pattern++;
return ((*str == T('\0')) && (*pattern == T('\0'))); return ((*str == wxT('\0')) && (*pattern == wxT('\0')));
}; };
#endif #endif

View File

@@ -53,9 +53,9 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
l2 = l; l2 = l;
for (int i = l-1; i >= 0; i--) { for (int i = l-1; i >= 0; i--) {
c = loc[(unsigned int) i]; c = loc[(unsigned int) i];
if (c == T('#')) l2 = i + 1; if (c == wxT('#')) l2 = i + 1;
if (c == T('.')) {ext = loc.Right(l2-i-1); break;} if (c == wxT('.')) {ext = loc.Right(l2-i-1); break;}
if ((c == T('/')) || (c == T('\\')) || (c == T(':'))) {return wxEmptyString;} if ((c == wxT('/')) || (c == wxT('\\')) || (c == wxT(':'))) {return wxEmptyString;}
} }
if (m_MimeMng == NULL) { if (m_MimeMng == NULL) {
@@ -110,11 +110,11 @@ wxString wxFileSystemHandler::GetProtocol(const wxString& location) const
bool fnd; bool fnd;
fnd = FALSE; fnd = FALSE;
for (i = l-1; (i >= 0) && ((location[i] != T('#')) || (!fnd)); i--) { for (i = l-1; (i >= 0) && ((location[i] != wxT('#')) || (!fnd)); i--) {
if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
} }
if (!fnd) return T("file"); if (!fnd) return wxT("file");
for (++i; (i < l) && (location[i] != T(':')); i++) s << location[i]; for (++i; (i < l) && (location[i] != wxT(':')); i++) s << location[i];
return s; return s;
} }
@@ -126,8 +126,8 @@ wxString wxFileSystemHandler::GetLeftLocation(const wxString& location) const
fnd = FALSE; fnd = FALSE;
for (i = location.Length()-1; i >= 0; i--) { for (i = location.Length()-1; i >= 0; i--) {
if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
else if (fnd && (location[i] == T('#'))) return location.Left(i); else if (fnd && (location[i] == wxT('#'))) return location.Left(i);
} }
return wxEmptyString; return wxEmptyString;
} }
@@ -136,7 +136,7 @@ wxString wxFileSystemHandler::GetRightLocation(const wxString& location) const
{ {
int i, l = location.Length(); int i, l = location.Length();
int l2 = l + 1; int l2 = l + 1;
for (i = l-1; (i >= 0) && ((location[i] != T(':')) || (i == 1) || (location[i-2] == T(':'))); i--) {if (location[i] == T('#')) l2 = i + 1;} for (i = l-1; (i >= 0) && ((location[i] != wxT(':')) || (i == 1) || (location[i-2] == wxT(':'))); i--) {if (location[i] == wxT('#')) l2 = i + 1;}
if (i == 0) return wxEmptyString; if (i == 0) return wxEmptyString;
else return location.Mid(i + 1, l2 - i - 2); else return location.Mid(i + 1, l2 - i - 2);
} }
@@ -148,8 +148,8 @@ wxString wxFileSystemHandler::GetAnchor(const wxString& location) const
for (int i = l-1; i >= 0; i--) { for (int i = l-1; i >= 0; i--) {
c = location[i]; c = location[i];
if (c == T('#')) return location.Right(l-i-1); if (c == wxT('#')) return location.Right(l-i-1);
else if ((c == T('.')) || (c == T('/')) || (c == T('\\')) || (c == T(':'))) return wxEmptyString; else if ((c == wxT('.')) || (c == wxT('/')) || (c == wxT('\\')) || (c == wxT(':'))) return wxEmptyString;
} }
return wxEmptyString; return wxEmptyString;
} }
@@ -168,7 +168,7 @@ class wxLocalFSHandler : public wxFileSystemHandler
bool wxLocalFSHandler::CanOpen(const wxString& location) bool wxLocalFSHandler::CanOpen(const wxString& location)
{ {
return GetProtocol(location) == T("file"); return GetProtocol(location) == wxT("file");
} }
wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
@@ -199,15 +199,15 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir)
m_Path = location; m_Path = location;
for (i = m_Path.Length()-1; i >= 0; i--) for (i = m_Path.Length()-1; i >= 0; i--)
if (m_Path[(unsigned int) i] == T('\\')) m_Path.GetWritableChar(i) = T('/'); // wanna be windows-safe if (m_Path[(unsigned int) i] == wxT('\\')) m_Path.GetWritableChar(i) = wxT('/'); // wanna be windows-safe
if (is_dir == FALSE) if (is_dir == FALSE)
{ {
for (i = m_Path.Length()-1; i >= 0; i--) for (i = m_Path.Length()-1; i >= 0; i--)
{ {
if (m_Path[(unsigned int) i] == T('/')) if (m_Path[(unsigned int) i] == wxT('/'))
{ {
if ((i > 1) && (m_Path[(unsigned int) (i-1)] == T('/')) && (m_Path[(unsigned int) (i-2)] == T(':'))) if ((i > 1) && (m_Path[(unsigned int) (i-1)] == wxT('/')) && (m_Path[(unsigned int) (i-2)] == wxT(':')))
{ {
i -= 2; i -= 2;
continue; continue;
@@ -218,7 +218,7 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir)
break; break;
} }
} }
else if (m_Path[(unsigned int) i] == T(':')) { else if (m_Path[(unsigned int) i] == wxT(':')) {
pathpos = i; pathpos = i;
break; break;
} }
@@ -227,9 +227,9 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir)
{ {
for (i = 0; i < (int) m_Path.Length(); i++) for (i = 0; i < (int) m_Path.Length(); i++)
{ {
if (m_Path[(unsigned int) i] == T(':')) if (m_Path[(unsigned int) i] == wxT(':'))
{ {
//m_Path << T('/'); //m_Path << wxT('/');
m_Path.Remove(i+1); m_Path.Remove(i+1);
break; break;
} }
@@ -239,8 +239,8 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir)
} }
else else
{ {
if (m_Path[m_Path.Length()-1] != T('/')) if (m_Path[m_Path.Length()-1] != wxT('/'))
m_Path << T('/'); m_Path << wxT('/');
m_Path.Remove(pathpos+1); m_Path.Remove(pathpos+1);
} }
} }
@@ -260,16 +260,16 @@ wxFSFile* wxFileSystem::OpenFile(const wxString& location)
meta = 0; meta = 0;
for (i = 0; i < ln; i++) for (i = 0; i < ln; i++)
{ {
if (loc[(unsigned int) i] == T('\\')) loc.GetWritableChar(i) = T('/'); // wanna be windows-safe if (loc[(unsigned int) i] == wxT('\\')) loc.GetWritableChar(i) = wxT('/'); // wanna be windows-safe
if (!meta) switch (loc[(unsigned int) i]) if (!meta) switch (loc[(unsigned int) i])
{ {
case T('/') : case T(':') : case T('#') : meta = loc[(unsigned int) i]; case wxT('/') : case wxT(':') : case wxT('#') : meta = loc[(unsigned int) i];
} }
} }
m_LastName = wxEmptyString; m_LastName = wxEmptyString;
// try relative paths first : // try relative paths first :
if (meta != T(':')) if (meta != wxT(':'))
{ {
node = m_Handlers.GetFirst(); node = m_Handlers.GetFirst();
while (node) while (node)

View File

@@ -70,43 +70,43 @@ bool wxFontBase::operator!=(const wxFont& font) const
wxString wxFontBase::GetFamilyString() const wxString wxFontBase::GetFamilyString() const
{ {
wxCHECK_MSG( Ok(), T("wxDEFAULT"), T("invalid font") ); wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") );
switch ( GetFamily() ) switch ( GetFamily() )
{ {
case wxDECORATIVE: return T("wxDECORATIVE"); case wxDECORATIVE: return wxT("wxDECORATIVE");
case wxROMAN: return T("wxROMAN"); case wxROMAN: return wxT("wxROMAN");
case wxSCRIPT: return T("wxSCRIPT"); case wxSCRIPT: return wxT("wxSCRIPT");
case wxSWISS: return T("wxSWISS"); case wxSWISS: return wxT("wxSWISS");
case wxMODERN: return T("wxMODERN"); case wxMODERN: return wxT("wxMODERN");
case wxTELETYPE: return T("wxTELETYPE"); case wxTELETYPE: return wxT("wxTELETYPE");
default: return T("wxDEFAULT"); default: return wxT("wxDEFAULT");
} }
} }
wxString wxFontBase::GetStyleString() const wxString wxFontBase::GetStyleString() const
{ {
wxCHECK_MSG( Ok(), T("wxDEFAULT"), T("invalid font") ); wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") );
switch ( GetStyle() ) switch ( GetStyle() )
{ {
case wxNORMAL: return T("wxNORMAL"); case wxNORMAL: return wxT("wxNORMAL");
case wxSLANT: return T("wxSLANT"); case wxSLANT: return wxT("wxSLANT");
case wxITALIC: return T("wxITALIC"); case wxITALIC: return wxT("wxITALIC");
default: return T("wxDEFAULT"); default: return wxT("wxDEFAULT");
} }
} }
wxString wxFontBase::GetWeightString() const wxString wxFontBase::GetWeightString() const
{ {
wxCHECK_MSG( Ok(), T("wxDEFAULT"), T("invalid font") ); wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") );
switch ( GetWeight() ) switch ( GetWeight() )
{ {
case wxNORMAL: return T("wxNORMAL"); case wxNORMAL: return wxT("wxNORMAL");
case wxBOLD: return T("wxBOLD"); case wxBOLD: return wxT("wxBOLD");
case wxLIGHT: return T("wxLIGHT"); case wxLIGHT: return wxT("wxLIGHT");
default: return T("wxDEFAULT"); default: return wxT("wxDEFAULT");
} }
} }

View File

@@ -69,13 +69,13 @@ class wxInetCacheNode : public wxObject
bool wxInternetFSHandler::CanOpen(const wxString& location) bool wxInternetFSHandler::CanOpen(const wxString& location)
{ {
wxString p = GetProtocol(location); wxString p = GetProtocol(location);
return (p == T("http")) || (p == T("ftp")); return (p == wxT("http")) || (p == wxT("ftp"));
} }
wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
{ {
wxString right = GetProtocol(location) + T(":") + GetRightLocation(location); wxString right = GetProtocol(location) + wxT(":") + GetRightLocation(location);
wxInputStream *s; wxInputStream *s;
wxString content; wxString content;
wxInetCacheNode *info; wxInetCacheNode *info;
@@ -93,7 +93,7 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri
{ {
wxChar buf[256]; wxChar buf[256];
wxGetTempFileName( T("wxhtml"), buf); wxGetTempFileName( wxT("wxhtml"), buf);
info = new wxInetCacheNode(buf, content); info = new wxInetCacheNode(buf, content);
m_Cache.Put(right, info); m_Cache.Put(right, info);

View File

@@ -50,7 +50,7 @@
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol) IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol)
IMPLEMENT_PROTOCOL(wxFTP, T("ftp"), T("ftp"), TRUE) IMPLEMENT_PROTOCOL(wxFTP, wxT("ftp"), wxT("ftp"), TRUE)
#endif #endif
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@@ -63,7 +63,7 @@ wxFTP::wxFTP()
m_lastError = wxPROTO_NOERR; m_lastError = wxPROTO_NOERR;
m_streaming = FALSE; m_streaming = FALSE;
m_user = T("anonymous"); m_user = wxT("anonymous");
m_passwd = wxGetUserId(); m_passwd = wxGetUserId();
m_passwd += '@'; m_passwd += '@';
m_passwd += wxGetHostName(); m_passwd += wxGetHostName();
@@ -99,13 +99,13 @@ bool wxFTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
return FALSE; return FALSE;
} }
command.sprintf(T("USER %s"), (const wxChar *)m_user); command.sprintf(wxT("USER %s"), (const wxChar *)m_user);
if (!SendCommand(command, '3')) { if (!SendCommand(command, '3')) {
Close(); Close();
return FALSE; return FALSE;
} }
command.sprintf(T("PASS %s"), (const wxChar *)m_passwd); command.sprintf(wxT("PASS %s"), (const wxChar *)m_passwd);
if (!SendCommand(command, '2')) { if (!SendCommand(command, '2')) {
Close(); Close();
return FALSE; return FALSE;
@@ -120,7 +120,7 @@ bool wxFTP::Connect(const wxString& host)
wxString my_host = host; wxString my_host = host;
addr.Hostname(my_host); addr.Hostname(my_host);
addr.Service(T("ftp")); addr.Service(wxT("ftp"));
return Connect(addr); return Connect(addr);
} }
@@ -132,7 +132,7 @@ bool wxFTP::Close()
return FALSE; return FALSE;
} }
if (m_connected) if (m_connected)
SendCommand(wxString(T("QUIT")), '2'); SendCommand(wxString(wxT("QUIT")), '2');
return wxSocketClient::Close(); return wxSocketClient::Close();
} }
@@ -147,7 +147,7 @@ bool wxFTP::SendCommand(const wxString& command, char exp_ret)
m_lastError = wxPROTO_STREAMING; m_lastError = wxPROTO_STREAMING;
return FALSE; return FALSE;
} }
tmp_str = command + T("\r\n"); tmp_str = command + wxT("\r\n");
const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); const wxWX2MBbuf tmp_buf = tmp_str.mb_str();
if (Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) { if (Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) {
m_lastError = wxPROTO_NETERR; m_lastError = wxPROTO_NETERR;
@@ -169,7 +169,7 @@ bool wxFTP::GetResult(char exp)
if (m_lastResult.GetChar(3) == '-') { if (m_lastResult.GetChar(3) == '-') {
wxString key = m_lastResult.Left((size_t)3); wxString key = m_lastResult.Left((size_t)3);
key += T(' '); key += wxT(' ');
while (m_lastResult.Index(key) != 0) { while (m_lastResult.Index(key) != 0) {
m_lastError = GetLine(this, m_lastResult); m_lastError = GetLine(this, m_lastResult);
@@ -187,14 +187,14 @@ bool wxFTP::ChDir(const wxString& dir)
{ {
wxString str = dir; wxString str = dir;
str.Prepend(T("CWD ")); str.Prepend(wxT("CWD "));
return SendCommand(str, '2'); return SendCommand(str, '2');
} }
bool wxFTP::MkDir(const wxString& dir) bool wxFTP::MkDir(const wxString& dir)
{ {
wxString str = dir; wxString str = dir;
str.Prepend(T("MKD ")); str.Prepend(wxT("MKD "));
return SendCommand(str, '2'); return SendCommand(str, '2');
} }
@@ -202,7 +202,7 @@ bool wxFTP::RmDir(const wxString& dir)
{ {
wxString str = dir; wxString str = dir;
str.Prepend(T("PWD ")); str.Prepend(wxT("PWD "));
return SendCommand(str, '2'); return SendCommand(str, '2');
} }
@@ -210,11 +210,11 @@ wxString wxFTP::Pwd()
{ {
int beg, end; int beg, end;
if (!SendCommand(T("PWD"), '2')) if (!SendCommand(wxT("PWD"), '2'))
return wxString((char *)NULL); return wxString((char *)NULL);
beg = m_lastResult.Find(T('\"'),FALSE); beg = m_lastResult.Find(wxT('\"'),FALSE);
end = m_lastResult.Find(T('\"'),TRUE); end = m_lastResult.Find(wxT('\"'),TRUE);
return wxString(beg+1, end); return wxString(beg+1, end);
} }
@@ -223,11 +223,11 @@ bool wxFTP::Rename(const wxString& src, const wxString& dst)
{ {
wxString str; wxString str;
str = T("RNFR ") + src; str = wxT("RNFR ") + src;
if (!SendCommand(str, '3')) if (!SendCommand(str, '3'))
return FALSE; return FALSE;
str = T("RNTO ") + dst; str = wxT("RNTO ") + dst;
return SendCommand(str, '2'); return SendCommand(str, '2');
} }
@@ -235,7 +235,7 @@ bool wxFTP::RmFile(const wxString& path)
{ {
wxString str; wxString str;
str = T("DELE "); str = wxT("DELE ");
str += path; str += path;
return SendCommand(str, '2'); return SendCommand(str, '2');
} }
@@ -288,16 +288,16 @@ wxSocketClient *wxFTP::GetPort()
wxUint16 port; wxUint16 port;
wxUint32 hostaddr; wxUint32 hostaddr;
if (!SendCommand(T("PASV"), '2')) if (!SendCommand(wxT("PASV"), '2'))
return NULL; return NULL;
addr_pos = m_lastResult.Find(T('(')); addr_pos = m_lastResult.Find(wxT('('));
if (addr_pos == -1) { if (addr_pos == -1) {
m_lastError = wxPROTO_PROTERR; m_lastError = wxPROTO_PROTERR;
return NULL; return NULL;
} }
straddr = m_lastResult(addr_pos+1, m_lastResult.Length()); straddr = m_lastResult(addr_pos+1, m_lastResult.Length());
wxSscanf((const wxChar *)straddr,T("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]); wxSscanf((const wxChar *)straddr,wxT("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
hostaddr = (wxUint16)a[5] << 24 | (wxUint16)a[4] << 16 | hostaddr = (wxUint16)a[5] << 24 | (wxUint16)a[4] << 16 |
(wxUint16)a[3] << 8 | a[2]; (wxUint16)a[3] << 8 | a[2];
@@ -319,7 +319,7 @@ wxSocketClient *wxFTP::GetPort()
bool wxFTP::Abort(void) bool wxFTP::Abort(void)
{ {
m_streaming = FALSE; m_streaming = FALSE;
if (!SendCommand(T("ABOR"), '4')) if (!SendCommand(wxT("ABOR"), '4'))
return FALSE; return FALSE;
return GetResult('2'); return GetResult('2');
} }
@@ -330,7 +330,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
int pos_size; int pos_size;
wxInputFTPStream *in_stream; wxInputFTPStream *in_stream;
if (!SendCommand(T("TYPE I"), '2')) if (!SendCommand(wxT("TYPE I"), '2'))
return NULL; return NULL;
wxSocketClient *sock = GetPort(); wxSocketClient *sock = GetPort();
@@ -340,15 +340,15 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
return NULL; return NULL;
} }
tmp_str = T("RETR ") + wxURL::ConvertFromURI(path); tmp_str = wxT("RETR ") + wxURL::ConvertFromURI(path);
if (!SendCommand(tmp_str, '1')) if (!SendCommand(tmp_str, '1'))
return NULL; return NULL;
in_stream = new wxInputFTPStream(this, sock); in_stream = new wxInputFTPStream(this, sock);
pos_size = m_lastResult.Index(T('(')); pos_size = m_lastResult.Index(wxT('('));
if (pos_size != wxNOT_FOUND) { if (pos_size != wxNOT_FOUND) {
wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(T(')'))-1); wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(wxT(')'))-1);
in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size); in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size);
} }
@@ -361,12 +361,12 @@ wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
{ {
wxString tmp_str; wxString tmp_str;
if (!SendCommand(T("TYPE I"), '2')) if (!SendCommand(wxT("TYPE I"), '2'))
return NULL; return NULL;
wxSocketClient *sock = GetPort(); wxSocketClient *sock = GetPort();
tmp_str = T("STOR ") + path; tmp_str = wxT("STOR ") + path;
if (!SendCommand(tmp_str, '1')) if (!SendCommand(tmp_str, '1'))
return FALSE; return FALSE;
@@ -377,7 +377,7 @@ wxList *wxFTP::GetList(const wxString& wildcard)
{ {
wxList *file_list = new wxList; wxList *file_list = new wxList;
wxSocketBase *sock = GetPort(); wxSocketBase *sock = GetPort();
wxString tmp_str = T("NLST"); wxString tmp_str = wxT("NLST");
if (!wildcard.IsNull()) if (!wildcard.IsNull())
tmp_str += wildcard; tmp_str += wildcard;

View File

@@ -144,84 +144,84 @@ void wxColourDatabase::Initialize ()
static cdef table[]={ static cdef table[]={
// #ifdef __WXMSW__ // #ifdef __WXMSW__
{T("AQUAMARINE"),112, 219, 147}, {wxT("AQUAMARINE"),112, 219, 147},
{T("BLACK"),0, 0, 0}, {wxT("BLACK"),0, 0, 0},
{T("BLUE"), 0, 0, 255}, {wxT("BLUE"), 0, 0, 255},
{T("BLUE VIOLET"), 159, 95, 159}, {wxT("BLUE VIOLET"), 159, 95, 159},
{T("BROWN"), 165, 42, 42}, {wxT("BROWN"), 165, 42, 42},
{T("CADET BLUE"), 95, 159, 159}, {wxT("CADET BLUE"), 95, 159, 159},
{T("CORAL"), 255, 127, 0}, {wxT("CORAL"), 255, 127, 0},
{T("CORNFLOWER BLUE"), 66, 66, 111}, {wxT("CORNFLOWER BLUE"), 66, 66, 111},
{T("CYAN"), 0, 255, 255}, {wxT("CYAN"), 0, 255, 255},
{T("DARK GREY"), 47, 47, 47}, // ? {wxT("DARK GREY"), 47, 47, 47}, // ?
{T("DARK GREEN"), 47, 79, 47}, {wxT("DARK GREEN"), 47, 79, 47},
{T("DARK OLIVE GREEN"), 79, 79, 47}, {wxT("DARK OLIVE GREEN"), 79, 79, 47},
{T("DARK ORCHID"), 153, 50, 204}, {wxT("DARK ORCHID"), 153, 50, 204},
{T("DARK SLATE BLUE"), 107, 35, 142}, {wxT("DARK SLATE BLUE"), 107, 35, 142},
{T("DARK SLATE GREY"), 47, 79, 79}, {wxT("DARK SLATE GREY"), 47, 79, 79},
{T("DARK TURQUOISE"), 112, 147, 219}, {wxT("DARK TURQUOISE"), 112, 147, 219},
{T("DIM GREY"), 84, 84, 84}, {wxT("DIM GREY"), 84, 84, 84},
{T("FIREBRICK"), 142, 35, 35}, {wxT("FIREBRICK"), 142, 35, 35},
{T("FOREST GREEN"), 35, 142, 35}, {wxT("FOREST GREEN"), 35, 142, 35},
{T("GOLD"), 204, 127, 50}, {wxT("GOLD"), 204, 127, 50},
{T("GOLDENROD"), 219, 219, 112}, {wxT("GOLDENROD"), 219, 219, 112},
{T("GREY"), 128, 128, 128}, {wxT("GREY"), 128, 128, 128},
{T("GREEN"), 0, 255, 0}, {wxT("GREEN"), 0, 255, 0},
{T("GREEN YELLOW"), 147, 219, 112}, {wxT("GREEN YELLOW"), 147, 219, 112},
{T("INDIAN RED"), 79, 47, 47}, {wxT("INDIAN RED"), 79, 47, 47},
{T("KHAKI"), 159, 159, 95}, {wxT("KHAKI"), 159, 159, 95},
{T("LIGHT BLUE"), 191, 216, 216}, {wxT("LIGHT BLUE"), 191, 216, 216},
{T("LIGHT GREY"), 192, 192, 192}, {wxT("LIGHT GREY"), 192, 192, 192},
{T("LIGHT STEEL BLUE"), 143, 143, 188}, {wxT("LIGHT STEEL BLUE"), 143, 143, 188},
{T("LIME GREEN"), 50, 204, 50}, {wxT("LIME GREEN"), 50, 204, 50},
{T("LIGHT MAGENTA"), 255, 0, 255}, {wxT("LIGHT MAGENTA"), 255, 0, 255},
{T("MAGENTA"), 255, 0, 255}, {wxT("MAGENTA"), 255, 0, 255},
{T("MAROON"), 142, 35, 107}, {wxT("MAROON"), 142, 35, 107},
{T("MEDIUM AQUAMARINE"), 50, 204, 153}, {wxT("MEDIUM AQUAMARINE"), 50, 204, 153},
{T("MEDIUM GREY"), 100, 100, 100}, {wxT("MEDIUM GREY"), 100, 100, 100},
{T("MEDIUM BLUE"), 50, 50, 204}, {wxT("MEDIUM BLUE"), 50, 50, 204},
{T("MEDIUM FOREST GREEN"), 107, 142, 35}, {wxT("MEDIUM FOREST GREEN"), 107, 142, 35},
{T("MEDIUM GOLDENROD"), 234, 234, 173}, {wxT("MEDIUM GOLDENROD"), 234, 234, 173},
{T("MEDIUM ORCHID"), 147, 112, 219}, {wxT("MEDIUM ORCHID"), 147, 112, 219},
{T("MEDIUM SEA GREEN"), 66, 111, 66}, {wxT("MEDIUM SEA GREEN"), 66, 111, 66},
{T("MEDIUM SLATE BLUE"), 127, 0, 255}, {wxT("MEDIUM SLATE BLUE"), 127, 0, 255},
{T("MEDIUM SPRING GREEN"), 127, 255, 0}, {wxT("MEDIUM SPRING GREEN"), 127, 255, 0},
{T("MEDIUM TURQUOISE"), 112, 219, 219}, {wxT("MEDIUM TURQUOISE"), 112, 219, 219},
{T("MEDIUM VIOLET RED"), 219, 112, 147}, {wxT("MEDIUM VIOLET RED"), 219, 112, 147},
{T("MIDNIGHT BLUE"), 47, 47, 79}, {wxT("MIDNIGHT BLUE"), 47, 47, 79},
{T("NAVY"), 35, 35, 142}, {wxT("NAVY"), 35, 35, 142},
{T("ORANGE"), 204, 50, 50}, {wxT("ORANGE"), 204, 50, 50},
{T("ORANGE RED"), 255, 0, 127}, {wxT("ORANGE RED"), 255, 0, 127},
{T("ORCHID"), 219, 112, 219}, {wxT("ORCHID"), 219, 112, 219},
{T("PALE GREEN"), 143, 188, 143}, {wxT("PALE GREEN"), 143, 188, 143},
{T("PINK"), 188, 143, 234}, {wxT("PINK"), 188, 143, 234},
{T("PLUM"), 234, 173, 234}, {wxT("PLUM"), 234, 173, 234},
{T("PURPLE"), 176, 0, 255}, {wxT("PURPLE"), 176, 0, 255},
{T("RED"), 255, 0, 0}, {wxT("RED"), 255, 0, 0},
{T("SALMON"), 111, 66, 66}, {wxT("SALMON"), 111, 66, 66},
{T("SEA GREEN"), 35, 142, 107}, {wxT("SEA GREEN"), 35, 142, 107},
{T("SIENNA"), 142, 107, 35}, {wxT("SIENNA"), 142, 107, 35},
{T("SKY BLUE"), 50, 153, 204}, {wxT("SKY BLUE"), 50, 153, 204},
{T("SLATE BLUE"), 0, 127, 255}, {wxT("SLATE BLUE"), 0, 127, 255},
{T("SPRING GREEN"), 0, 255, 127}, {wxT("SPRING GREEN"), 0, 255, 127},
{T("STEEL BLUE"), 35, 107, 142}, {wxT("STEEL BLUE"), 35, 107, 142},
{T("TAN"), 219, 147, 112}, {wxT("TAN"), 219, 147, 112},
{T("THISTLE"), 216, 191, 216}, {wxT("THISTLE"), 216, 191, 216},
{T("TURQUOISE"), 173, 234, 234}, {wxT("TURQUOISE"), 173, 234, 234},
{T("VIOLET"), 79, 47, 79}, {wxT("VIOLET"), 79, 47, 79},
{T("VIOLET RED"), 204, 50, 153}, {wxT("VIOLET RED"), 204, 50, 153},
{T("WHEAT"), 216, 216, 191}, {wxT("WHEAT"), 216, 216, 191},
{T("WHITE"), 255, 255, 255}, {wxT("WHITE"), 255, 255, 255},
{T("YELLOW"), 255, 255, 0}, {wxT("YELLOW"), 255, 255, 0},
{T("YELLOW GREEN"), 153, 204, 50}, {wxT("YELLOW GREEN"), 153, 204, 50},
// #endif // #endif
#if defined(__WXGTK__) || defined(__X__) #if defined(__WXGTK__) || defined(__X__)
{T("MEDIUM GOLDENROD"), 234, 234, 173}, {wxT("MEDIUM GOLDENROD"), 234, 234, 173},
{T("MEDIUM FOREST GREEN"), 107, 142, 35}, {wxT("MEDIUM FOREST GREEN"), 107, 142, 35},
{T("LIGHT MAGENTA"), 255, 0, 255}, {wxT("LIGHT MAGENTA"), 255, 0, 255},
{T("MEDIUM GREY"), 100, 100, 100}, {wxT("MEDIUM GREY"), 100, 100, 100},
#endif #endif
{0,0,0,0} {0,0,0,0}
@@ -604,7 +604,7 @@ wxFont *wxFontList::
#else #else
each_font->GetFamily() == FamilyOrFontId && each_font->GetFamily() == FamilyOrFontId &&
#endif #endif
((each_font->GetFaceName() == T("")) || each_font->GetFaceName() == Face)) ((each_font->GetFaceName() == wxT("")) || each_font->GetFaceName() == Face))
//#endif //#endif
return each_font; return each_font;
} }

View File

@@ -34,7 +34,7 @@
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol) IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol)
IMPLEMENT_PROTOCOL(wxHTTP, T("http"), T("80"), TRUE) IMPLEMENT_PROTOCOL(wxHTTP, wxT("http"), wxT("80"), TRUE)
#endif #endif
#define HTTP_BSIZE 2048 #define HTTP_BSIZE 2048
@@ -65,7 +65,7 @@ wxHTTP::~wxHTTP()
wxString wxHTTP::GetContentType() wxString wxHTTP::GetContentType()
{ {
return GetHeader(T("Content-Type")); return GetHeader(wxT("Content-Type"));
} }
void wxHTTP::SetProxyMode(bool on) void wxHTTP::SetProxyMode(bool on)
@@ -113,7 +113,7 @@ void wxHTTP::SendHeaders()
wxString *str = (wxString *)head->Data(); wxString *str = (wxString *)head->Data();
wxString buf; wxString buf;
buf.Printf(T("%s: %s\n\r"), head->GetKeyString(), str->GetData()); buf.Printf(wxT("%s: %s\n\r"), head->GetKeyString(), str->GetData());
const wxWX2MBbuf cbuf = buf.mb_str(); const wxWX2MBbuf cbuf = buf.mb_str();
Write(cbuf, strlen(cbuf)); Write(cbuf, strlen(cbuf));
@@ -171,7 +171,7 @@ bool wxHTTP::Connect(const wxString& host)
return FALSE; return FALSE;
} }
if (!addr->Service(T("http"))) if (!addr->Service(wxT("http")))
addr->Service(80); addr->Service(80);
return TRUE; return TRUE;
@@ -196,12 +196,12 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
wxString tmp_str = path; wxString tmp_str = path;
// If there is no User-Agent defined, define it. // If there is no User-Agent defined, define it.
if (GetHeader(T("User-Agent")).IsNull()) if (GetHeader(wxT("User-Agent")).IsNull())
SetHeader(T("User-Agent"), T("wxWindows 2.x")); SetHeader(wxT("User-Agent"), wxT("wxWindows 2.x"));
switch (req) { switch (req) {
case wxHTTP_GET: case wxHTTP_GET:
tmp_buf = T("GET"); tmp_buf = wxT("GET");
break; break;
default: default:
return FALSE; return FALSE;
@@ -211,7 +211,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
SetFlags(NONE); SetFlags(NONE);
Notify(FALSE); Notify(FALSE);
wxSprintf(buf, T("%s %s HTTP/1.0\n\r"), tmp_buf, tmp_str.GetData()); wxSprintf(buf, wxT("%s %s HTTP/1.0\n\r"), tmp_buf, tmp_str.GetData());
const wxWX2MBbuf pathbuf = wxConvLibc.cWX2MB(buf); const wxWX2MBbuf pathbuf = wxConvLibc.cWX2MB(buf);
Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf)); Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf));
SendHeaders(); SendHeaders();
@@ -223,16 +223,16 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
return FALSE; return FALSE;
} }
if (!tmp_str.Contains(T("HTTP/"))) { if (!tmp_str.Contains(wxT("HTTP/"))) {
// TODO: support HTTP v0.9 which can have no header. // TODO: support HTTP v0.9 which can have no header.
// FIXME: tmp_str is not put back in the in-queue of the socket. // FIXME: tmp_str is not put back in the in-queue of the socket.
SetHeader(T("Content-Length"), T("-1")); SetHeader(wxT("Content-Length"), wxT("-1"));
SetHeader(T("Content-Type"), T("none/none")); SetHeader(wxT("Content-Type"), wxT("none/none"));
RestoreState(); RestoreState();
return TRUE; return TRUE;
} }
wxStringTokenizer token(tmp_str,T(' ')); wxStringTokenizer token(tmp_str,wxT(' '));
wxString tmp_str2; wxString tmp_str2;
bool ret_value; bool ret_value;
@@ -240,13 +240,13 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
tmp_str2 = token.NextToken(); tmp_str2 = token.NextToken();
switch (tmp_str2[(unsigned int) 0]) { switch (tmp_str2[(unsigned int) 0]) {
case T('1'): case wxT('1'):
/* INFORMATION / SUCCESS */ /* INFORMATION / SUCCESS */
break; break;
case T('2'): case wxT('2'):
/* SUCCESS */ /* SUCCESS */
break; break;
case T('3'): case wxT('3'):
/* REDIRECTION */ /* REDIRECTION */
break; break;
default: default:
@@ -312,8 +312,8 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path)
if (!BuildRequest(path, wxHTTP_GET)) if (!BuildRequest(path, wxHTTP_GET))
return NULL; return NULL;
if (!GetHeader(T("Content-Length")).IsEmpty()) if (!GetHeader(wxT("Content-Length")).IsEmpty())
inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(T("Content-Length"))); inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
else else
inp_stream->m_httpsize = (size_t)-1; inp_stream->m_httpsize = (size_t)-1;

View File

@@ -97,12 +97,12 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
int height = (int)wxINT32_SWAP_ON_BE( dbuf[1] ); int height = (int)wxINT32_SWAP_ON_BE( dbuf[1] );
if (width > 32767) if (width > 32767)
{ {
wxLogError( T("Image width > 32767 pixels for file.") ); wxLogError( wxT("Image width > 32767 pixels for file.") );
return FALSE; return FALSE;
} }
if (height > 32767) if (height > 32767)
{ {
wxLogError( T("Image height > 32767 pixels for file.") ); wxLogError( wxT("Image height > 32767 pixels for file.") );
return FALSE; return FALSE;
} }
@@ -115,7 +115,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
int bpp = (int)wxUINT16_SWAP_ON_BE( aWord ); int bpp = (int)wxUINT16_SWAP_ON_BE( aWord );
if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32) if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)
{ {
wxLogError( T("unknown bitdepth in file.") ); wxLogError( wxT("unknown bitdepth in file.") );
return FALSE; return FALSE;
} }
@@ -123,7 +123,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
int comp = (int)wxINT32_SWAP_ON_BE( dbuf[0] ); int comp = (int)wxINT32_SWAP_ON_BE( dbuf[0] );
if (comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && comp != BI_BITFIELDS) if (comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && comp != BI_BITFIELDS)
{ {
wxLogError( T("unknown encoding in Windows BMP file.") ); wxLogError( wxT("unknown encoding in Windows BMP file.") );
return FALSE; return FALSE;
} }
@@ -136,7 +136,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
((comp == BI_RLE8) && (bpp != 8)) || ((comp == BI_RLE8) && (bpp != 8)) ||
((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32))) ((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32)))
{ {
wxLogError( T("encoding of BMP doesn't match bitdepth.") ); wxLogError( wxT("encoding of BMP doesn't match bitdepth.") );
return FALSE; return FALSE;
} }
if (bpp < 16) if (bpp < 16)
@@ -144,7 +144,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
cmap = (struct _cmap *)malloc(sizeof(struct _cmap) * ncolors); cmap = (struct _cmap *)malloc(sizeof(struct _cmap) * ncolors);
if (!cmap) if (!cmap)
{ {
wxLogError( T("Cannot allocate RAM for color map in BMP file.") ); wxLogError( wxT("Cannot allocate RAM for color map in BMP file.") );
return FALSE; return FALSE;
} }
} }
@@ -155,7 +155,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
unsigned char *ptr = image->GetData(); unsigned char *ptr = image->GetData();
if (!ptr) if (!ptr)
{ {
wxLogError( T("Cannot allocate RAM for RGB data in file.") ); wxLogError( wxT("Cannot allocate RAM for RGB data in file.") );
if (cmap) if (cmap)
free(cmap); free(cmap);
return FALSE; return FALSE;
@@ -263,7 +263,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
{ {
if (comp == BI_RLE4) if (comp == BI_RLE4)
{ {
wxLogError( T("Can't deal with 4bit encoded yet.") ); wxLogError( wxT("Can't deal with 4bit encoded yet.") );
image->Destroy(); image->Destroy();
free(cmap); free(cmap);
return FALSE; return FALSE;

View File

@@ -154,15 +154,15 @@ wxImage wxImage::Scale( int width, int height ) const
{ {
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, T("invalid image") ); wxCHECK_MSG( Ok(), image, wxT("invalid image") );
wxCHECK_MSG( (width > 0) && (height > 0), image, T("invalid image size") ); wxCHECK_MSG( (width > 0) && (height > 0), image, wxT("invalid image size") );
image.Create( width, height ); image.Create( width, height );
char unsigned *data = image.GetData(); char unsigned *data = image.GetData();
wxCHECK_MSG( data, image, T("unable to create image") ); wxCHECK_MSG( data, image, wxT("unable to create image") );
if (M_IMGDATA->m_hasMask) if (M_IMGDATA->m_hasMask)
image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue );
@@ -193,10 +193,10 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const
{ {
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, T("invalid image") ); wxCHECK_MSG( Ok(), image, wxT("invalid image") );
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()) wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight())
, image, T("invalid subimage size") ); , image, wxT("invalid subimage size") );
int subwidth=rect.GetWidth(); int subwidth=rect.GetWidth();
const int subheight=rect.GetHeight(); const int subheight=rect.GetHeight();
@@ -205,7 +205,7 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const
char unsigned *subdata = image.GetData(), *data=GetData(); char unsigned *subdata = image.GetData(), *data=GetData();
wxCHECK_MSG( subdata, image, T("unable to create image") ); wxCHECK_MSG( subdata, image, wxT("unable to create image") );
if (M_IMGDATA->m_hasMask) if (M_IMGDATA->m_hasMask)
image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue );
@@ -228,12 +228,12 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const
void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ) void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b )
{ {
wxCHECK_RET( Ok(), T("invalid image") ); wxCHECK_RET( Ok(), wxT("invalid image") );
int w = M_IMGDATA->m_width; int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height; int h = M_IMGDATA->m_height;
wxCHECK_RET( (x>=0) && (y>=0) && (x<w) && (y<h), T("invalid image index") ); wxCHECK_RET( (x>=0) && (y>=0) && (x<w) && (y<h), wxT("invalid image index") );
long pos = (y * w + x) * 3; long pos = (y * w + x) * 3;
@@ -244,12 +244,12 @@ void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned c
unsigned char wxImage::GetRed( int x, int y ) unsigned char wxImage::GetRed( int x, int y )
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
int w = M_IMGDATA->m_width; int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height; int h = M_IMGDATA->m_height;
wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, T("invalid image index") ); wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, wxT("invalid image index") );
long pos = (y * w + x) * 3; long pos = (y * w + x) * 3;
@@ -258,12 +258,12 @@ unsigned char wxImage::GetRed( int x, int y )
unsigned char wxImage::GetGreen( int x, int y ) unsigned char wxImage::GetGreen( int x, int y )
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
int w = M_IMGDATA->m_width; int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height; int h = M_IMGDATA->m_height;
wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, T("invalid image index") ); wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, wxT("invalid image index") );
long pos = (y * w + x) * 3; long pos = (y * w + x) * 3;
@@ -272,12 +272,12 @@ unsigned char wxImage::GetGreen( int x, int y )
unsigned char wxImage::GetBlue( int x, int y ) unsigned char wxImage::GetBlue( int x, int y )
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
int w = M_IMGDATA->m_width; int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height; int h = M_IMGDATA->m_height;
wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, T("invalid image index") ); wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, wxT("invalid image index") );
long pos = (y * w + x) * 3; long pos = (y * w + x) * 3;
@@ -291,14 +291,14 @@ bool wxImage::Ok() const
char unsigned *wxImage::GetData() const char unsigned *wxImage::GetData() const
{ {
wxCHECK_MSG( Ok(), (char unsigned *)NULL, T("invalid image") ); wxCHECK_MSG( Ok(), (char unsigned *)NULL, wxT("invalid image") );
return M_IMGDATA->m_data; return M_IMGDATA->m_data;
} }
void wxImage::SetData( char unsigned *data ) void wxImage::SetData( char unsigned *data )
{ {
wxCHECK_RET( Ok(), T("invalid image") ); wxCHECK_RET( Ok(), wxT("invalid image") );
wxImageRefData *newRefData = new wxImageRefData(); wxImageRefData *newRefData = new wxImageRefData();
@@ -318,7 +318,7 @@ void wxImage::SetData( char unsigned *data )
void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
{ {
wxCHECK_RET( Ok(), T("invalid image") ); wxCHECK_RET( Ok(), wxT("invalid image") );
M_IMGDATA->m_maskRed = r; M_IMGDATA->m_maskRed = r;
M_IMGDATA->m_maskGreen = g; M_IMGDATA->m_maskGreen = g;
@@ -328,49 +328,49 @@ void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
unsigned char wxImage::GetMaskRed() const unsigned char wxImage::GetMaskRed() const
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
return M_IMGDATA->m_maskRed; return M_IMGDATA->m_maskRed;
} }
unsigned char wxImage::GetMaskGreen() const unsigned char wxImage::GetMaskGreen() const
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
return M_IMGDATA->m_maskGreen; return M_IMGDATA->m_maskGreen;
} }
unsigned char wxImage::GetMaskBlue() const unsigned char wxImage::GetMaskBlue() const
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
return M_IMGDATA->m_maskBlue; return M_IMGDATA->m_maskBlue;
} }
void wxImage::SetMask( bool mask ) void wxImage::SetMask( bool mask )
{ {
wxCHECK_RET( Ok(), T("invalid image") ); wxCHECK_RET( Ok(), wxT("invalid image") );
M_IMGDATA->m_hasMask = mask; M_IMGDATA->m_hasMask = mask;
} }
bool wxImage::HasMask() const bool wxImage::HasMask() const
{ {
wxCHECK_MSG( Ok(), FALSE, T("invalid image") ); wxCHECK_MSG( Ok(), FALSE, wxT("invalid image") );
return M_IMGDATA->m_hasMask; return M_IMGDATA->m_hasMask;
} }
int wxImage::GetWidth() const int wxImage::GetWidth() const
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
return M_IMGDATA->m_width; return M_IMGDATA->m_width;
} }
int wxImage::GetHeight() const int wxImage::GetHeight() const
{ {
wxCHECK_MSG( Ok(), 0, T("invalid image") ); wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
return M_IMGDATA->m_height; return M_IMGDATA->m_height;
} }
@@ -385,7 +385,7 @@ bool wxImage::LoadFile( const wxString& filename, long type )
} }
else { else {
wxLogError( T("Can't load image from file '%s': file does not exist."), filename.c_str() ); wxLogError( wxT("Can't load image from file '%s': file does not exist."), filename.c_str() );
return FALSE; return FALSE;
} }
@@ -404,7 +404,7 @@ bool wxImage::LoadFile( const wxString& filename, const wxString& mimetype )
} }
else { else {
wxLogError( T("Can't load image from file '%s': file does not exist."), filename.c_str() ); wxLogError( wxT("Can't load image from file '%s': file does not exist."), filename.c_str() );
return FALSE; return FALSE;
} }
@@ -459,7 +459,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type )
} }
wxLogWarning( T("No handler found for this image.") ); wxLogWarning( wxT("No handler found for this image.") );
return FALSE; return FALSE;
} }
@@ -467,7 +467,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type )
if (handler == NULL) if (handler == NULL)
{ {
wxLogWarning( T("No image handler for type %d defined."), type ); wxLogWarning( wxT("No image handler for type %d defined."), type );
return FALSE; return FALSE;
} }
@@ -485,7 +485,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype )
if (handler == NULL) if (handler == NULL)
{ {
wxLogWarning( T("No image handler for type %s defined."), mimetype.GetData() ); wxLogWarning( wxT("No image handler for type %s defined."), mimetype.GetData() );
return FALSE; return FALSE;
} }
@@ -495,13 +495,13 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype )
bool wxImage::SaveFile( wxOutputStream& stream, int type ) bool wxImage::SaveFile( wxOutputStream& stream, int type )
{ {
wxCHECK_MSG( Ok(), FALSE, T("invalid image") ); wxCHECK_MSG( Ok(), FALSE, wxT("invalid image") );
wxImageHandler *handler = FindHandler(type); wxImageHandler *handler = FindHandler(type);
if (handler == NULL) if (handler == NULL)
{ {
wxLogWarning( T("No image handler for type %d defined."), type ); wxLogWarning( wxT("No image handler for type %d defined."), type );
return FALSE; return FALSE;
} }
@@ -511,13 +511,13 @@ bool wxImage::SaveFile( wxOutputStream& stream, int type )
bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype ) bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype )
{ {
wxCHECK_MSG( Ok(), FALSE, T("invalid image") ); wxCHECK_MSG( Ok(), FALSE, wxT("invalid image") );
wxImageHandler *handler = FindHandlerMime(mimetype); wxImageHandler *handler = FindHandlerMime(mimetype);
if (handler == NULL) if (handler == NULL)
{ {
wxLogWarning( T("No image handler for type %s defined."), mimetype.GetData() ); wxLogWarning( wxT("No image handler for type %s defined."), mimetype.GetData() );
return FALSE; return FALSE;
} }
@@ -657,7 +657,7 @@ bool wxImageHandler::CanRead( const wxString& name )
} }
else { else {
wxLogError( T("Can't check image format of file '%s': file does not exist."), name.c_str() ); wxLogError( wxT("Can't check image format of file '%s': file does not exist."), name.c_str() );
return FALSE; return FALSE;
} }
@@ -717,7 +717,7 @@ wxBitmap wxImage::ConvertToBitmap() const
// set bitmap parameters // set bitmap parameters
wxBitmap bitmap; wxBitmap bitmap;
wxCHECK_MSG( Ok(), bitmap, T("invalid image") ); wxCHECK_MSG( Ok(), bitmap, wxT("invalid image") );
bitmap.SetWidth( width ); bitmap.SetWidth( width );
bitmap.SetHeight( bmpHeight ); bitmap.SetHeight( bmpHeight );
bitmap.SetDepth( wxDisplayDepth() ); bitmap.SetDepth( wxDisplayDepth() );
@@ -725,7 +725,7 @@ wxBitmap wxImage::ConvertToBitmap() const
// create a DIB header // create a DIB header
int headersize = sizeof(BITMAPINFOHEADER); int headersize = sizeof(BITMAPINFOHEADER);
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize );
wxCHECK_MSG( lpDIBh, bitmap, T("could not allocate memory for DIB header") ); wxCHECK_MSG( lpDIBh, bitmap, wxT("could not allocate memory for DIB header") );
// Fill in the DIB header // Fill in the DIB header
lpDIBh->bmiHeader.biSize = headersize; lpDIBh->bmiHeader.biSize = headersize;
lpDIBh->bmiHeader.biWidth = (DWORD)width; lpDIBh->bmiHeader.biWidth = (DWORD)width;
@@ -746,7 +746,7 @@ wxBitmap wxImage::ConvertToBitmap() const
lpBits = (unsigned char *)malloc( lpDIBh->bmiHeader.biSizeImage ); lpBits = (unsigned char *)malloc( lpDIBh->bmiHeader.biSizeImage );
if( !lpBits ) if( !lpBits )
{ {
wxFAIL_MSG( T("could not allocate memory for DIB") ); wxFAIL_MSG( wxT("could not allocate memory for DIB") );
free( lpDIBh ); free( lpDIBh );
return bitmap; return bitmap;
} }
@@ -889,7 +889,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
// check the bitmap // check the bitmap
if( !bitmap.Ok() ) if( !bitmap.Ok() )
{ {
wxFAIL_MSG( T("invalid bitmap") ); wxFAIL_MSG( wxT("invalid bitmap") );
return; return;
} }
@@ -900,7 +900,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
unsigned char *data = GetData(); unsigned char *data = GetData();
if( !data ) if( !data )
{ {
wxFAIL_MSG( T("could not allocate data for image") ); wxFAIL_MSG( wxT("could not allocate data for image") );
return; return;
} }
@@ -920,7 +920,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize );
if( !lpDIBh ) if( !lpDIBh )
{ {
wxFAIL_MSG( T("could not allocate data for DIB header") ); wxFAIL_MSG( wxT("could not allocate data for DIB header") );
free( data ); free( data );
return; return;
} }
@@ -942,7 +942,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
lpBits = (unsigned char *) malloc( lpDIBh->bmiHeader.biSizeImage ); lpBits = (unsigned char *) malloc( lpDIBh->bmiHeader.biSizeImage );
if( !lpBits ) if( !lpBits )
{ {
wxFAIL_MSG( T("could not allocate data for DIB") ); wxFAIL_MSG( wxT("could not allocate data for DIB") );
free( data ); free( data );
free( lpDIBh ); free( lpDIBh );
return; return;
@@ -1033,7 +1033,7 @@ wxBitmap wxImage::ConvertToBitmap() const
{ {
wxBitmap bitmap; wxBitmap bitmap;
wxCHECK_MSG( Ok(), bitmap, T("invalid image") ); wxCHECK_MSG( Ok(), bitmap, wxT("invalid image") );
int width = GetWidth(); int width = GetWidth();
int height = GetHeight(); int height = GetHeight();
@@ -1241,13 +1241,13 @@ wxBitmap wxImage::ConvertToBitmap() const
wxImage::wxImage( const wxBitmap &bitmap ) wxImage::wxImage( const wxBitmap &bitmap )
{ {
wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") ); wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
GdkImage *gdk_image = gdk_image_get( bitmap.GetPixmap(), GdkImage *gdk_image = gdk_image_get( bitmap.GetPixmap(),
0, 0, 0, 0,
bitmap.GetWidth(), bitmap.GetHeight() ); bitmap.GetWidth(), bitmap.GetHeight() );
wxCHECK_RET( gdk_image, T("couldn't create image") ); wxCHECK_RET( gdk_image, wxT("couldn't create image") );
Create( bitmap.GetWidth(), bitmap.GetHeight() ); Create( bitmap.GetWidth(), bitmap.GetHeight() );
char unsigned *data = GetData(); char unsigned *data = GetData();
@@ -1255,7 +1255,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
if (!data) if (!data)
{ {
gdk_image_destroy( gdk_image ); gdk_image_destroy( gdk_image );
wxFAIL_MSG( T("couldn't create image") ); wxFAIL_MSG( wxT("couldn't create image") );
return; return;
} }
@@ -1340,7 +1340,7 @@ wxBitmap wxImage::ConvertToBitmap() const
{ {
wxBitmap bitmap; wxBitmap bitmap;
wxCHECK_MSG( Ok(), bitmap, T("invalid image") ); wxCHECK_MSG( Ok(), bitmap, wxT("invalid image") );
int width = GetWidth(); int width = GetWidth();
int height = GetHeight(); int height = GetHeight();
@@ -1389,7 +1389,7 @@ wxBitmap wxImage::ConvertToBitmap() const
vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem ); vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem );
wxCHECK_MSG( vi, wxNullBitmap, T("no visual") ); wxCHECK_MSG( vi, wxNullBitmap, wxT("no visual") );
XFree( vi ); XFree( vi );
@@ -1540,7 +1540,7 @@ wxBitmap wxImage::ConvertToBitmap() const
wxImage::wxImage( const wxBitmap &bitmap ) wxImage::wxImage( const wxBitmap &bitmap )
{ {
wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") ); wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
Display *dpy = (Display*) wxGetDisplay(); Display *dpy = (Display*) wxGetDisplay();
Visual* vis = DefaultVisual( dpy, DefaultScreen( dpy ) ); Visual* vis = DefaultVisual( dpy, DefaultScreen( dpy ) );
@@ -1552,7 +1552,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
bitmap.GetWidth(), bitmap.GetHeight(), bitmap.GetWidth(), bitmap.GetHeight(),
AllPlanes, ZPixmap ); AllPlanes, ZPixmap );
wxCHECK_RET( ximage, T("couldn't create image") ); wxCHECK_RET( ximage, wxT("couldn't create image") );
Create( bitmap.GetWidth(), bitmap.GetHeight() ); Create( bitmap.GetWidth(), bitmap.GetHeight() );
char unsigned *data = GetData(); char unsigned *data = GetData();
@@ -1560,7 +1560,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
if (!data) if (!data)
{ {
XDestroyImage( ximage ); XDestroyImage( ximage );
wxFAIL_MSG( T("couldn't create image") ); wxFAIL_MSG( wxT("couldn't create image") );
return; return;
} }
@@ -1588,7 +1588,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem ); vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem );
wxCHECK_RET( vi, T("no visual") ); wxCHECK_RET( vi, wxT("no visual") );
if ((bpp == 16) && (vi->red_mask != 0xf800)) bpp = 15; if ((bpp == 16) && (vi->red_mask != 0xf800)) bpp = 15;

View File

@@ -54,9 +54,9 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
{ {
switch (error) switch (error)
{ {
case E_FORMATO: wxLogError(T("wxGIFHandler: error in image format")); break; case E_FORMATO: wxLogError(wxT("wxGIFHandler: error in image format")); break;
case E_MEMORIA: wxLogError(T("wxGIFHandler: couldn't allocate memory")); break; case E_MEMORIA: wxLogError(wxT("wxGIFHandler: couldn't allocate memory")); break;
default: wxLogError(T("wxGIFHandler: unknown error !!!")); default: wxLogError(wxT("wxGIFHandler: unknown error !!!"));
} }
} }
delete decod; delete decod;
@@ -74,7 +74,7 @@ bool wxGIFHandler::SaveFile( wxImage * WXUNUSED(image),
wxOutputStream& WXUNUSED(stream), bool verbose ) wxOutputStream& WXUNUSED(stream), bool verbose )
{ {
if (verbose) if (verbose)
wxLogDebug(T("wxGIFHandler is read-only!!")); wxLogDebug(wxT("wxGIFHandler is read-only!!"));
return FALSE; return FALSE;
} }

View File

@@ -229,7 +229,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
if (!CanRead(stream)) if (!CanRead(stream))
{ {
if (verbose) if (verbose)
wxLogError(T("wxPCXHandler: this is not a PCX file")); wxLogError(wxT("wxPCXHandler: this is not a PCX file"));
return FALSE; return FALSE;
} }
@@ -242,10 +242,10 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
{ {
switch (error) switch (error)
{ {
case E_FORMATO: wxLogError(T("wxPCXHandler: image format unsupported")); break; case E_FORMATO: wxLogError(wxT("wxPCXHandler: image format unsupported")); break;
case E_MEMORIA: wxLogError(T("wxPCXHandler: couldn't allocate memory")); break; case E_MEMORIA: wxLogError(wxT("wxPCXHandler: couldn't allocate memory")); break;
case E_VERSION: wxLogError(T("wxPCXHandler: version number too low")); break; case E_VERSION: wxLogError(wxT("wxPCXHandler: version number too low")); break;
default: wxLogError(T("wxPCXHandler: unknown error !!!")); default: wxLogError(wxT("wxPCXHandler: unknown error !!!"));
} }
} }
image->Destroy(); image->Destroy();
@@ -258,7 +258,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose ) bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose )
{ {
if (verbose) if (verbose)
wxLogError(T("wxPCXHandler::SaveFile still not implemented")); wxLogError(wxT("wxPCXHandler::SaveFile still not implemented"));
return FALSE; return FALSE;
} }

View File

@@ -44,7 +44,7 @@ void Skip_Comment(wxInputStream &stream)
wxString line; wxString line;
wxTextInputStream text_stream(stream); wxTextInputStream text_stream(stream);
if (stream.Peek()==T('#')) if (stream.Peek()==wxT('#'))
{ {
text_stream >> line; text_stream >> line;
Skip_Comment(stream); Skip_Comment(stream);
@@ -68,19 +68,19 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
wxTextInputStream text_stream(buf_stream); wxTextInputStream text_stream(buf_stream);
Skip_Comment(buf_stream); Skip_Comment(buf_stream);
if (buf_stream.GetC()==T('P')) c=buf_stream.GetC(); if (buf_stream.GetC()==wxT('P')) c=buf_stream.GetC();
switch (c) switch (c)
{ {
case T('2'): case wxT('2'):
wxLogError(T("Loading Grey Ascii PNM image is not yet implemented.")); wxLogError(wxT("Loading Grey Ascii PNM image is not yet implemented."));
return FALSE; return FALSE;
case T('5'): case wxT('5'):
wxLogError(T("Loading Grey Raw PNM image is not yet implemented.")); wxLogError(wxT("Loading Grey Raw PNM image is not yet implemented."));
return FALSE; return FALSE;
case T('3'): case T('6'): break; case wxT('3'): case wxT('6'): break;
default : default :
wxLogError(T("Loading PNM image : file not recognized.")); wxLogError(wxT("Loading PNM image : file not recognized."));
return FALSE; return FALSE;
} }
@@ -95,7 +95,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
unsigned char *ptr = image->GetData(); unsigned char *ptr = image->GetData();
if (!ptr) if (!ptr)
{ {
wxLogError( T("Cannot allocate RAM for RGB data in PNM file.") ); wxLogError( wxT("Cannot allocate RAM for RGB data in PNM file.") );
return FALSE; return FALSE;
} }
@@ -111,7 +111,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
if (buf_stream.LastError()!=wxSTREAM_NOERROR) if (buf_stream.LastError()!=wxSTREAM_NOERROR)
{ {
wxLogError(T("Loading PNM image : file seems truncated.")); wxLogError(wxT("Loading PNM image : file seems truncated."));
return FALSE; return FALSE;
} }
} }
@@ -143,10 +143,10 @@ bool wxPNMHandler::CanRead( wxInputStream& stream )
Skip_Comment(stream); Skip_Comment(stream);
if (stream.GetC()==T('P')) if (stream.GetC()==wxT('P'))
switch (stream.GetC()) switch (stream.GetC())
{ {
case T('3'): case T('6'): case wxT('3'): case wxT('6'):
stream.SeekI(pos); stream.SeekI(pos);
return TRUE; return TRUE;
} }

View File

@@ -46,7 +46,7 @@ wxAppInitializerFunction
class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp
{ {
public: public:
virtual int OnRun() { wxFAIL_MSG(T("unreachable")); return 0; } virtual int OnRun() { wxFAIL_MSG(wxT("unreachable")); return 0; }
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -68,7 +68,7 @@ bool WXDLLEXPORT wxInitialize()
} }
wxASSERT_MSG( !wxTheApp, wxASSERT_MSG( !wxTheApp,
T("either call wxInitialize or create app, not both!") ); wxT("either call wxInitialize or create app, not both!") );
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();

View File

@@ -267,7 +267,7 @@ static wxString GetAllMsgCatalogSubdirs(const wxChar *prefix,
// search first in prefix/fr/LC_MESSAGES, then in prefix/fr and finally in // search first in prefix/fr/LC_MESSAGES, then in prefix/fr and finally in
// prefix (assuming the language is 'fr') // prefix (assuming the language is 'fr')
searchPath << prefix << wxFILE_SEP_PATH << lang << wxFILE_SEP_PATH searchPath << prefix << wxFILE_SEP_PATH << lang << wxFILE_SEP_PATH
<< T("LC_MESSAGES") << wxPATH_SEP << wxT("LC_MESSAGES") << wxPATH_SEP
<< prefix << wxFILE_SEP_PATH << lang << wxPATH_SEP << prefix << wxFILE_SEP_PATH << lang << wxPATH_SEP
<< prefix << wxPATH_SEP; << prefix << wxPATH_SEP;
@@ -289,13 +289,13 @@ static wxString GetFullSearchPath(const wxChar *lang)
// then take the current directory // then take the current directory
// FIXME it should be the directory of the executable // FIXME it should be the directory of the executable
searchPath << GetAllMsgCatalogSubdirs(T("."), lang) << wxPATH_SEP; searchPath << GetAllMsgCatalogSubdirs(wxT("."), lang) << wxPATH_SEP;
// and finally add some standard ones // and finally add some standard ones
searchPath searchPath
<< GetAllMsgCatalogSubdirs(T("/usr/share/locale"), lang) << wxPATH_SEP << GetAllMsgCatalogSubdirs(wxT("/usr/share/locale"), lang) << wxPATH_SEP
<< GetAllMsgCatalogSubdirs(T("/usr/lib/locale"), lang) << wxPATH_SEP << GetAllMsgCatalogSubdirs(wxT("/usr/lib/locale"), lang) << wxPATH_SEP
<< GetAllMsgCatalogSubdirs(T("/usr/local/share/locale"), lang); << GetAllMsgCatalogSubdirs(wxT("/usr/local/share/locale"), lang);
return searchPath; return searchPath;
} }
@@ -320,7 +320,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName0)
#endif // 0 #endif // 0
wxString searchPath = GetFullSearchPath(szDirPrefix); wxString searchPath = GetFullSearchPath(szDirPrefix);
const wxChar *sublocale = wxStrchr(szDirPrefix, T('_')); const wxChar *sublocale = wxStrchr(szDirPrefix, wxT('_'));
if ( sublocale ) if ( sublocale )
{ {
// also add just base locale name: for things like "fr_BE" (belgium // also add just base locale name: for things like "fr_BE" (belgium
@@ -340,7 +340,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName0)
// (we're using an object because we have several return paths) // (we're using an object because we have several return paths)
NoTransErr noTransErr; NoTransErr noTransErr;
wxLogVerbose(T("looking for catalog '%s' in path '%s'."), wxLogVerbose(wxT("looking for catalog '%s' in path '%s'."),
szName.c_str(), searchPath.c_str()); szName.c_str(), searchPath.c_str());
wxString strFullName; wxString strFullName;
@@ -496,7 +496,7 @@ bool wxLocale::Init(const wxChar *szName,
m_pMsgCat = NULL; m_pMsgCat = NULL;
bool bOk = TRUE; bool bOk = TRUE;
if ( bLoadDefault ) if ( bLoadDefault )
bOk = AddCatalog(T("wxstd")); bOk = AddCatalog(wxT("wxstd"));
return bOk; return bOk;
} }

View File

@@ -52,7 +52,7 @@ bool wxListKey::operator==(wxListKeyValue value) const
switch ( m_keyType ) switch ( m_keyType )
{ {
default: default:
wxFAIL_MSG(T("bad key type.")); wxFAIL_MSG(wxT("bad key type."));
// let compiler optimize the line above away in release build // let compiler optimize the line above away in release build
// by not putting return here... // by not putting return here...
@@ -92,7 +92,7 @@ wxNodeBase::wxNodeBase(wxListBase *list,
break; break;
default: default:
wxFAIL_MSG(T("invalid key type")); wxFAIL_MSG(wxT("invalid key type"));
} }
if ( previous ) if ( previous )
@@ -120,7 +120,7 @@ wxNodeBase::~wxNodeBase()
int wxNodeBase::IndexOf() const int wxNodeBase::IndexOf() const
{ {
wxCHECK_MSG( m_list, wxNOT_FOUND, T("node doesn't belong to a list in IndexOf")); wxCHECK_MSG( m_list, wxNOT_FOUND, wxT("node doesn't belong to a list in IndexOf"));
// It would be more efficient to implement IndexOf() completely inside // It would be more efficient to implement IndexOf() completely inside
// wxListBase (only traverse the list once), but this is probably a more // wxListBase (only traverse the list once), but this is probably a more
@@ -163,7 +163,7 @@ wxListBase::wxListBase(size_t count, void *elements[])
void wxListBase::DoCopy(const wxListBase& list) void wxListBase::DoCopy(const wxListBase& list)
{ {
wxASSERT_MSG( !list.m_destroy, wxASSERT_MSG( !list.m_destroy,
T("copying list which owns it's elements is a bad idea") ); wxT("copying list which owns it's elements is a bad idea") );
m_count = list.m_count; m_count = list.m_count;
m_destroy = list.m_destroy; m_destroy = list.m_destroy;
@@ -210,7 +210,7 @@ wxNodeBase *wxListBase::Append(void *object)
{ {
// all objects in a keyed list should have a key // all objects in a keyed list should have a key
wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL, wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL,
T("need a key for the object to append") ); wxT("need a key for the object to append") );
wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object); wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object);
@@ -222,7 +222,7 @@ wxNodeBase *wxListBase::Append(long key, void *object)
wxCHECK_MSG( (m_keyType == wxKEY_INTEGER) || wxCHECK_MSG( (m_keyType == wxKEY_INTEGER) ||
(m_keyType == wxKEY_NONE && m_count == 0), (m_keyType == wxKEY_NONE && m_count == 0),
(wxNodeBase *)NULL, (wxNodeBase *)NULL,
T("can't append object with numeric key to this list") ); wxT("can't append object with numeric key to this list") );
wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key); wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key);
return AppendCommon(node); return AppendCommon(node);
@@ -233,7 +233,7 @@ wxNodeBase *wxListBase::Append (const wxChar *key, void *object)
wxCHECK_MSG( (m_keyType == wxKEY_STRING) || wxCHECK_MSG( (m_keyType == wxKEY_STRING) ||
(m_keyType == wxKEY_NONE && m_count == 0), (m_keyType == wxKEY_NONE && m_count == 0),
(wxNodeBase *)NULL, (wxNodeBase *)NULL,
T("can't append object with string key to this list") ); wxT("can't append object with string key to this list") );
wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key); wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key);
return AppendCommon(node); return AppendCommon(node);
@@ -243,10 +243,10 @@ wxNodeBase *wxListBase::Insert(wxNodeBase *position, void *object)
{ {
// all objects in a keyed list should have a key // all objects in a keyed list should have a key
wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL, wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL,
T("need a key for the object to insert") ); wxT("need a key for the object to insert") );
wxCHECK_MSG( !position || position->m_list == this, (wxNodeBase *)NULL, wxCHECK_MSG( !position || position->m_list == this, (wxNodeBase *)NULL,
T("can't insert before a node from another list") ); wxT("can't insert before a node from another list") );
// previous and next node for the node being inserted // previous and next node for the node being inserted
wxNodeBase *prev, *next; wxNodeBase *prev, *next;
@@ -288,7 +288,7 @@ wxNodeBase *wxListBase::Item(size_t n) const
} }
} }
wxFAIL_MSG( T("invalid index in wxListBase::Item") ); wxFAIL_MSG( wxT("invalid index in wxListBase::Item") );
return (wxNodeBase *)NULL; return (wxNodeBase *)NULL;
} }
@@ -296,7 +296,7 @@ wxNodeBase *wxListBase::Item(size_t n) const
wxNodeBase *wxListBase::Find(const wxListKey& key) const wxNodeBase *wxListBase::Find(const wxListKey& key) const
{ {
wxASSERT_MSG( m_keyType == key.GetKeyType(), wxASSERT_MSG( m_keyType == key.GetKeyType(),
T("this list is not keyed on the type of this key") ); wxT("this list is not keyed on the type of this key") );
for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() )
{ {
@@ -349,9 +349,9 @@ void wxListBase::DoDeleteNode(wxNodeBase *node)
wxNodeBase *wxListBase::DetachNode(wxNodeBase *node) wxNodeBase *wxListBase::DetachNode(wxNodeBase *node)
{ {
wxCHECK_MSG( node, NULL, T("detaching NULL wxNodeBase") ); wxCHECK_MSG( node, NULL, wxT("detaching NULL wxNodeBase") );
wxCHECK_MSG( node->m_list == this, NULL, wxCHECK_MSG( node->m_list == this, NULL,
T("detaching node which is not from this list") ); wxT("detaching node which is not from this list") );
// update the list // update the list
wxNodeBase **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next wxNodeBase **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next

View File

@@ -295,7 +295,7 @@ void wxLog::TimeStamp(wxString *str)
wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow)); wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow));
str->Empty(); str->Empty();
*str << buf << T(": "); *str << buf << wxT(": ");
} }
} }
@@ -339,7 +339,7 @@ void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t)) void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t))
{ {
wxFAIL_MSG(T("DoLogString must be overriden if it's called.")); wxFAIL_MSG(wxT("DoLogString must be overriden if it's called."));
} }
void wxLog::Flush() void wxLog::Flush()
@@ -363,7 +363,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{ {
wxString str; wxString str;
TimeStamp(&str); TimeStamp(&str);
str << szString << T('\n'); str << szString << wxT('\n');
fputs(str.mb_str(), m_fp); fputs(str.mb_str(), m_fp);
fflush(m_fp); fflush(m_fp);
@@ -371,7 +371,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
// under Windows, programs usually don't have stderr at all, so make show the // under Windows, programs usually don't have stderr at all, so make show the
// messages also under debugger // messages also under debugger
#ifdef __WXMSW__ #ifdef __WXMSW__
OutputDebugString(str + T('\r')); OutputDebugString(str + wxT('\r'));
#endif // MSW #endif // MSW
} }
@@ -406,7 +406,7 @@ wxLog *wxLog::ms_pLogger = (wxLog *)NULL;
bool wxLog::ms_doLog = TRUE; bool wxLog::ms_doLog = TRUE;
bool wxLog::ms_bAutoCreate = TRUE; bool wxLog::ms_bAutoCreate = TRUE;
const wxChar *wxLog::ms_timestamp = T("%X"); // time only, no date const wxChar *wxLog::ms_timestamp = wxT("%X"); // time only, no date
wxTraceMask wxLog::ms_ulTraceMask = (wxTraceMask)0; wxTraceMask wxLog::ms_ulTraceMask = (wxTraceMask)0;
wxArrayString wxLog::ms_aTraceMasks; wxArrayString wxLog::ms_aTraceMasks;
@@ -487,7 +487,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
// copy it to our buffer and free memory // copy it to our buffer and free memory
wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1); wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
s_szBuf[WXSIZEOF(s_szBuf) - 1] = T('\0'); s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);
// returned string is capitalized and ended with '\r\n' - bad // returned string is capitalized and ended with '\r\n' - bad
@@ -495,8 +495,8 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
size_t len = wxStrlen(s_szBuf); size_t len = wxStrlen(s_szBuf);
if ( len > 0 ) { if ( len > 0 ) {
// truncate string // truncate string
if ( s_szBuf[len - 2] == T('\r') ) if ( s_szBuf[len - 2] == wxT('\r') )
s_szBuf[len - 2] = T('\0'); s_szBuf[len - 2] = wxT('\0');
} }
return s_szBuf; return s_szBuf;
@@ -562,18 +562,18 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
// make life easier for people using VC++ IDE: clicking on the message // make life easier for people using VC++ IDE: clicking on the message
// will take us immediately to the place of the failed assert // will take us immediately to the place of the failed assert
#ifdef __VISUALC__ #ifdef __VISUALC__
wxSprintf(szBuf, T("%s(%d): assert failed"), szFile, nLine); wxSprintf(szBuf, wxT("%s(%d): assert failed"), szFile, nLine);
#else // !VC++ #else // !VC++
// make the error message more clear for all the others // make the error message more clear for all the others
wxSprintf(szBuf, T("Assert failed in file %s at line %d"), szFile, nLine); wxSprintf(szBuf, wxT("Assert failed in file %s at line %d"), szFile, nLine);
#endif // VC/!VC #endif // VC/!VC
if ( szMsg != NULL ) { if ( szMsg != NULL ) {
wxStrcat(szBuf, T(": ")); wxStrcat(szBuf, wxT(": "));
wxStrcat(szBuf, szMsg); wxStrcat(szBuf, szMsg);
} }
else { else {
wxStrcat(szBuf, T(".")); wxStrcat(szBuf, wxT("."));
} }
if ( !s_bNoAsserts ) { if ( !s_bNoAsserts ) {
@@ -583,7 +583,7 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
#if wxUSE_GUI #if wxUSE_GUI
// this message is intentionally not translated - it is for // this message is intentionally not translated - it is for
// developpers only // developpers only
wxStrcat(szBuf, T("\nDo you want to stop the program?" wxStrcat(szBuf, wxT("\nDo you want to stop the program?"
"\nYou can also choose [Cancel] to suppress " "\nYou can also choose [Cancel] to suppress "
"further warnings.")); "further warnings."));

View File

@@ -110,7 +110,7 @@
*/ */
void wxMemStruct::ErrorMsg (const char * mesg) void wxMemStruct::ErrorMsg (const char * mesg)
{ {
wxLogDebug(T("wxWindows memory checking error: %s"), mesg); wxLogDebug(wxT("wxWindows memory checking error: %s"), mesg);
PrintNode (); PrintNode ();
// << m_fileName << ' ' << m_lineNum << endl; // << m_fileName << ' ' << m_lineNum << endl;
@@ -121,7 +121,7 @@ void wxMemStruct::ErrorMsg (const char * mesg)
*/ */
void wxMemStruct::ErrorMsg () void wxMemStruct::ErrorMsg ()
{ {
wxLogDebug(T("wxWindows over/underwrite memory error:")); wxLogDebug(wxT("wxWindows over/underwrite memory error:"));
PrintNode (); PrintNode ();
// cerr << m_fileName << ' ' << m_lineNum << endl; // cerr << m_fileName << ' ' << m_lineNum << endl;
@@ -329,18 +329,18 @@ void wxMemStruct::PrintNode ()
// Let's put this in standard form so IDEs can load the file at the appropriate // Let's put this in standard form so IDEs can load the file at the appropriate
// line // line
wxString msg(T("")); wxString msg(wxT(""));
if (m_fileName) if (m_fileName)
msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum);
if (info && info->GetClassName()) if (info && info->GetClassName())
msg += info->GetClassName(); msg += info->GetClassName();
else else
msg += T("object"); msg += wxT("object");
wxString msg2; wxString msg2;
msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); msg2.Printf(wxT(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
msg += msg2; msg += msg2;
wxLogDebug(msg); wxLogDebug(msg);
@@ -350,10 +350,10 @@ void wxMemStruct::PrintNode ()
wxString msg(""); wxString msg("");
if (m_fileName) if (m_fileName)
msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum);
msg += T("non-object data"); msg += wxT("non-object data");
wxString msg2; wxString msg2;
msg2.Printf(T(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize()); msg2.Printf(wxT(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize());
msg += msg2; msg += msg2;
wxLogDebug(msg); wxLogDebug(msg);
@@ -368,9 +368,9 @@ void wxMemStruct::Dump ()
{ {
wxObject *obj = (wxObject *)m_actualData; wxObject *obj = (wxObject *)m_actualData;
wxString msg(T("")); wxString msg(wxT(""));
if (m_fileName) if (m_fileName)
msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum);
/* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it. /* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it.
@@ -383,22 +383,22 @@ void wxMemStruct::Dump ()
if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName())
msg += obj->GetClassInfo()->GetClassName(); msg += obj->GetClassInfo()->GetClassName();
else else
msg += T("unknown object class"); msg += wxT("unknown object class");
wxString msg2(""); wxString msg2("");
msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); msg2.Printf(wxT(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
msg += msg2; msg += msg2;
wxLogDebug(msg); wxLogDebug(msg);
} }
else else
{ {
wxString msg(T("")); wxString msg(wxT(""));
if (m_fileName) if (m_fileName)
msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum);
wxString msg2(""); wxString msg2("");
msg2.Printf(T("non-object data at $%lX, size %d"), (long)GetActualData(), (int)RequestSize() ); msg2.Printf(wxT("non-object data at $%lX, size %d"), (long)GetActualData(), (int)RequestSize() );
msg += msg2; msg += msg2;
wxLogDebug(msg); wxLogDebug(msg);
} }
@@ -418,7 +418,7 @@ int wxMemStruct::ValidateNode ()
else { else {
// Can't use the error routines as we have no recognisable object. // Can't use the error routines as we have no recognisable object.
#ifndef __WXGTK__ #ifndef __WXGTK__
wxLogDebug(T("Can't verify memory struct - all bets are off!")); wxLogDebug(wxT("Can't verify memory struct - all bets are off!"));
#endif #endif
} }
return 0; return 0;
@@ -666,23 +666,23 @@ bool wxDebugContext::Dump(void)
// if (TRUE) // if (TRUE)
{ {
wxChar* appName = T("application"); wxChar* appName = wxT("application");
wxString appNameStr(""); wxString appNameStr("");
if (wxTheApp) if (wxTheApp)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr; appName = WXSTRINGCAST appNameStr;
wxLogDebug(T("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); wxLogDebug(wxT("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
} }
else else
{ {
wxLogDebug( T("----- Memory dump -----") ); wxLogDebug( wxT("----- Memory dump -----") );
} }
} }
TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
wxLogDebug( T("") ); wxLogDebug( wxT("") );
wxLogDebug( T("") ); wxLogDebug( wxT("") );
return TRUE; return TRUE;
#else #else
@@ -723,17 +723,17 @@ bool wxDebugContext::PrintStatistics(bool detailed)
// if (TRUE) // if (TRUE)
{ {
wxChar* appName = T("application"); wxChar* appName = wxT("application");
wxString appNameStr(T("")); wxString appNameStr(wxT(""));
if (wxTheApp) if (wxTheApp)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr; appName = WXSTRINGCAST appNameStr;
wxLogDebug(T("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); wxLogDebug(wxT("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
} }
else else
{ {
wxLogDebug( T("----- Memory statistics -----") ); wxLogDebug( wxT("----- Memory statistics -----") );
} }
} }
@@ -757,7 +757,7 @@ bool wxDebugContext::PrintStatistics(bool detailed)
// if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) // if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
if (detailed && (data != (void*) wxLog::GetActiveTarget())) if (detailed && (data != (void*) wxLog::GetActiveTarget()))
{ {
wxChar *className = T("nonobject"); wxChar *className = wxT("nonobject");
if (st->m_isObject && st->GetActualData()) if (st->m_isObject && st->GetActualData())
{ {
wxObject *obj = (wxObject *)st->GetActualData(); wxObject *obj = (wxObject *)st->GetActualData();
@@ -792,22 +792,22 @@ bool wxDebugContext::PrintStatistics(bool detailed)
{ {
while (list) while (list)
{ {
wxLogDebug(T("%ld objects of class %s, total size %ld"), wxLogDebug(wxT("%ld objects of class %s, total size %ld"),
list->instanceCount, list->instanceClass, list->totalSize); list->instanceCount, list->instanceClass, list->totalSize);
wxDebugStatsStruct *old = list; wxDebugStatsStruct *old = list;
list = old->next; list = old->next;
free((char *)old); free((char *)old);
} }
wxLogDebug(T("")); wxLogDebug(wxT(""));
} }
SetDebugMode(currentMode); SetDebugMode(currentMode);
wxLogDebug(T("Number of object items: %ld"), noObjectNodes); wxLogDebug(wxT("Number of object items: %ld"), noObjectNodes);
wxLogDebug(T("Number of non-object items: %ld"), noNonObjectNodes); wxLogDebug(wxT("Number of non-object items: %ld"), noNonObjectNodes);
wxLogDebug(T("Total allocated size: %ld"), totalSize); wxLogDebug(wxT("Total allocated size: %ld"), totalSize);
wxLogDebug(T("")); wxLogDebug(wxT(""));
wxLogDebug(T("")); wxLogDebug(wxT(""));
return TRUE; return TRUE;
#else #else
@@ -822,13 +822,13 @@ bool wxDebugContext::PrintClasses(void)
// if (TRUE) // if (TRUE)
{ {
wxChar* appName = T("application"); wxChar* appName = wxT("application");
wxString appNameStr(T("")); wxString appNameStr(wxT(""));
if (wxTheApp) if (wxTheApp)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr; appName = WXSTRINGCAST appNameStr;
wxLogDebug(T("----- Classes in %s -----"), appName); wxLogDebug(wxT("----- Classes in %s -----"), appName);
} }
} }
@@ -844,32 +844,32 @@ bool wxDebugContext::PrintClasses(void)
if (info->GetClassName()) if (info->GetClassName())
{ {
wxString msg(info->GetClassName()); wxString msg(info->GetClassName());
msg += T(" "); msg += wxT(" ");
if (info->GetBaseClassName1() && !info->GetBaseClassName2()) if (info->GetBaseClassName1() && !info->GetBaseClassName2())
{ {
msg += T("is a "); msg += wxT("is a ");
msg += info->GetBaseClassName1(); msg += info->GetBaseClassName1();
} }
else if (info->GetBaseClassName1() && info->GetBaseClassName2()) else if (info->GetBaseClassName1() && info->GetBaseClassName2())
{ {
msg += T("is a "); msg += wxT("is a ");
msg += info->GetBaseClassName1() ; msg += info->GetBaseClassName1() ;
msg += T(", "); msg += wxT(", ");
msg += info->GetBaseClassName2() ; msg += info->GetBaseClassName2() ;
} }
if (info->GetConstructor()) if (info->GetConstructor())
msg += T(": dynamic"); msg += wxT(": dynamic");
wxLogDebug(msg); wxLogDebug(msg);
} }
node = wxClassInfo::sm_classTable->Next(); node = wxClassInfo::sm_classTable->Next();
n ++; n ++;
} }
wxLogDebug(T("")); wxLogDebug(wxT(""));
wxLogDebug(T("There are %d classes derived from wxObject."), n); wxLogDebug(wxT("There are %d classes derived from wxObject."), n);
wxLogDebug(T("")); wxLogDebug(wxT(""));
wxLogDebug(T("")); wxLogDebug(wxT(""));
return TRUE; return TRUE;
} }
@@ -1040,7 +1040,7 @@ void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject,
int totSize = wxDebugContext::TotSize (size); int totSize = wxDebugContext::TotSize (size);
char * buf = (char *) malloc(totSize); char * buf = (char *) malloc(totSize);
if (!buf) { if (!buf) {
wxLogDebug(T("Call to malloc (%ld) failed."), (long)size); wxLogDebug(wxT("Call to malloc (%ld) failed."), (long)size);
return 0; return 0;
} }
wxMemStruct * st = (wxMemStruct *)buf; wxMemStruct * st = (wxMemStruct *)buf;

View File

@@ -249,7 +249,7 @@ public:
break; break;
} }
wxASSERT_MSG( n == pos, T("invalid position in MailCapEntry::Insert") ); wxASSERT_MSG( n == pos, wxT("invalid position in MailCapEntry::Insert") );
m_next = cur->m_next; m_next = cur->m_next;
cur->m_next = this; cur->m_next = this;
@@ -257,7 +257,7 @@ public:
// append this element to the list // append this element to the list
void Append(MailCapEntry *next) void Append(MailCapEntry *next)
{ {
wxCHECK_RET( next != NULL, T("Append()ing to what?") ); wxCHECK_RET( next != NULL, wxT("Append()ing to what?") );
// FIXME slooow... // FIXME slooow...
MailCapEntry *cur; MailCapEntry *cur;
@@ -266,7 +266,7 @@ public:
cur->m_next = this; cur->m_next = this;
wxASSERT_MSG( !m_next, T("Append()ing element already in the list?") ); wxASSERT_MSG( !m_next, wxT("Append()ing element already in the list?") );
} }
private: private:
@@ -413,57 +413,57 @@ wxString wxFileType::ExpandCommand(const wxString& command,
bool hasFilename = FALSE; bool hasFilename = FALSE;
wxString str; wxString str;
for ( const wxChar *pc = command.c_str(); *pc != T('\0'); pc++ ) { for ( const wxChar *pc = command.c_str(); *pc != wxT('\0'); pc++ ) {
if ( *pc == T('%') ) { if ( *pc == wxT('%') ) {
switch ( *++pc ) { switch ( *++pc ) {
case T('s'): case wxT('s'):
// '%s' expands into file name (quoted because it might // '%s' expands into file name (quoted because it might
// contain spaces) - except if there are already quotes // contain spaces) - except if there are already quotes
// there because otherwise some programs may get confused // there because otherwise some programs may get confused
// by double double quotes // by double double quotes
#if 0 #if 0
if ( *(pc - 2) == T('"') ) if ( *(pc - 2) == wxT('"') )
str << params.GetFileName(); str << params.GetFileName();
else else
str << T('"') << params.GetFileName() << T('"'); str << wxT('"') << params.GetFileName() << wxT('"');
#endif #endif
str << params.GetFileName(); str << params.GetFileName();
hasFilename = TRUE; hasFilename = TRUE;
break; break;
case T('t'): case wxT('t'):
// '%t' expands into MIME type (quote it too just to be // '%t' expands into MIME type (quote it too just to be
// consistent) // consistent)
str << T('\'') << params.GetMimeType() << T('\''); str << wxT('\'') << params.GetMimeType() << wxT('\'');
break; break;
case T('{'): case wxT('{'):
{ {
const wxChar *pEnd = wxStrchr(pc, T('}')); const wxChar *pEnd = wxStrchr(pc, wxT('}'));
if ( pEnd == NULL ) { if ( pEnd == NULL ) {
wxString mimetype; wxString mimetype;
wxLogWarning(_("Unmatched '{' in an entry for " wxLogWarning(_("Unmatched '{' in an entry for "
"mime type %s."), "mime type %s."),
params.GetMimeType().c_str()); params.GetMimeType().c_str());
str << T("%{"); str << wxT("%{");
} }
else { else {
wxString param(pc + 1, pEnd - pc - 1); wxString param(pc + 1, pEnd - pc - 1);
str << T('\'') << params.GetParamValue(param) << T('\''); str << wxT('\'') << params.GetParamValue(param) << wxT('\'');
pc = pEnd; pc = pEnd;
} }
} }
break; break;
case T('n'): case wxT('n'):
case T('F'): case wxT('F'):
// TODO %n is the number of parts, %F is an array containing // TODO %n is the number of parts, %F is an array containing
// the names of temp files these parts were written to // the names of temp files these parts were written to
// and their mime types. // and their mime types.
break; break;
default: default:
wxLogDebug(T("Unknown field %%%c in command '%s'."), wxLogDebug(wxT("Unknown field %%%c in command '%s'."),
*pc, command.c_str()); *pc, command.c_str());
str << *pc; str << *pc;
} }
@@ -476,7 +476,7 @@ wxString wxFileType::ExpandCommand(const wxString& command,
// metamail(1) man page states that if the mailcap entry doesn't have '%s' // metamail(1) man page states that if the mailcap entry doesn't have '%s'
// the program will accept the data on stdin: so give it to it! // the program will accept the data on stdin: so give it to it!
if ( !hasFilename && !str.IsEmpty() ) { if ( !hasFilename && !str.IsEmpty() ) {
str << T(" < '") << params.GetFileName() << T('\''); str << wxT(" < '") << params.GetFileName() << wxT('\'');
} }
return str; return str;
@@ -533,16 +533,16 @@ wxFileType::GetPrintCommand(wxString *printCmd,
bool wxMimeTypesManager::IsOfType(const wxString& mimeType, bool wxMimeTypesManager::IsOfType(const wxString& mimeType,
const wxString& wildcard) const wxString& wildcard)
{ {
wxASSERT_MSG( mimeType.Find(T('*')) == wxNOT_FOUND, wxASSERT_MSG( mimeType.Find(wxT('*')) == wxNOT_FOUND,
T("first MIME type can't contain wildcards") ); wxT("first MIME type can't contain wildcards") );
// all comparaisons are case insensitive (2nd arg of IsSameAs() is FALSE) // all comparaisons are case insensitive (2nd arg of IsSameAs() is FALSE)
if ( wildcard.BeforeFirst(T('/')).IsSameAs(mimeType.BeforeFirst(T('/')), FALSE) ) if ( wildcard.BeforeFirst(wxT('/')).IsSameAs(mimeType.BeforeFirst(wxT('/')), FALSE) )
{ {
wxString strSubtype = wildcard.AfterFirst(T('/')); wxString strSubtype = wildcard.AfterFirst(wxT('/'));
if ( strSubtype == T("*") || if ( strSubtype == wxT("*") ||
strSubtype.IsSameAs(mimeType.AfterFirst(T('/')), FALSE) ) strSubtype.IsSameAs(mimeType.AfterFirst(wxT('/')), FALSE) )
{ {
// matches (either exactly or it's a wildcard) // matches (either exactly or it's a wildcard)
return TRUE; return TRUE;
@@ -602,13 +602,13 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
// suppress possible error messages // suppress possible error messages
wxLogNull nolog; wxLogNull nolog;
wxString strKey; wxString strKey;
strKey << m_strFileType << T("\\shell\\") << verb << T("\\command"); strKey << m_strFileType << wxT("\\shell\\") << verb << wxT("\\command");
wxRegKey key(wxRegKey::HKCR, strKey); wxRegKey key(wxRegKey::HKCR, strKey);
wxString command; wxString command;
if ( key.Open() ) { if ( key.Open() ) {
// it's the default value of the key // it's the default value of the key
if ( key.QueryValue(T(""), command) ) { if ( key.QueryValue(wxT(""), command) ) {
// transform it from '%1' to '%s' style format string // transform it from '%1' to '%s' style format string
// NB: we don't make any attempt to verify that the string is valid, // NB: we don't make any attempt to verify that the string is valid,
@@ -617,10 +617,10 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
bool foundFilename = FALSE; bool foundFilename = FALSE;
size_t len = command.Len(); size_t len = command.Len();
for ( size_t n = 0; (n < len) && !foundFilename; n++ ) { for ( size_t n = 0; (n < len) && !foundFilename; n++ ) {
if ( command[n] == T('%') && if ( command[n] == wxT('%') &&
(n + 1 < len) && command[n + 1] == T('1') ) { (n + 1 < len) && command[n + 1] == wxT('1') ) {
// replace it with '%s' // replace it with '%s'
command[n + 1] = T('s'); command[n + 1] = wxT('s');
foundFilename = TRUE; foundFilename = TRUE;
} }
@@ -629,7 +629,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
if ( !foundFilename ) { if ( !foundFilename ) {
// we didn't find any '%1'! // we didn't find any '%1'!
// HACK: append the filename at the end, hope that it will do // HACK: append the filename at the end, hope that it will do
command << T(" %s"); command << wxT(" %s");
} }
} }
} }
@@ -648,7 +648,7 @@ wxFileTypeImpl::GetOpenCommand(wxString *openCmd,
cmd = m_info->GetOpenCommand(); cmd = m_info->GetOpenCommand();
} }
else { else {
cmd = GetCommand(T("open")); cmd = GetCommand(wxT("open"));
} }
*openCmd = wxFileType::ExpandCommand(cmd, params); *openCmd = wxFileType::ExpandCommand(cmd, params);
@@ -666,7 +666,7 @@ wxFileTypeImpl::GetPrintCommand(wxString *printCmd,
cmd = m_info->GetPrintCommand(); cmd = m_info->GetPrintCommand();
} }
else { else {
cmd = GetCommand(T("print")); cmd = GetCommand(wxT("print"));
} }
*printCmd = wxFileType::ExpandCommand(cmd, params); *printCmd = wxFileType::ExpandCommand(cmd, params);
@@ -707,8 +707,8 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
// suppress possible error messages // suppress possible error messages
wxLogNull nolog; wxLogNull nolog;
wxRegKey key(wxRegKey::HKCR, /*m_strFileType*/ T(".") + m_ext); wxRegKey key(wxRegKey::HKCR, /*m_strFileType*/ wxT(".") + m_ext);
if ( key.Open() && key.QueryValue(T("Content Type"), *mimeType) ) { if ( key.Open() && key.QueryValue(wxT("Content Type"), *mimeType) ) {
return TRUE; return TRUE;
} }
else { else {
@@ -724,7 +724,7 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const
} }
wxString strIconKey; wxString strIconKey;
strIconKey << m_strFileType << T("\\DefaultIcon"); strIconKey << m_strFileType << wxT("\\DefaultIcon");
// suppress possible error messages // suppress possible error messages
wxLogNull nolog; wxLogNull nolog;
@@ -733,18 +733,18 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const
if ( key.Open() ) { if ( key.Open() ) {
wxString strIcon; wxString strIcon;
// it's the default value of the key // it's the default value of the key
if ( key.QueryValue(T(""), strIcon) ) { if ( key.QueryValue(wxT(""), strIcon) ) {
// the format is the following: <full path to file>, <icon index> // the format is the following: <full path to file>, <icon index>
// NB: icon index may be negative as well as positive and the full // NB: icon index may be negative as well as positive and the full
// path may contain the environment variables inside '%' // path may contain the environment variables inside '%'
wxString strFullPath = strIcon.BeforeLast(T(',')), wxString strFullPath = strIcon.BeforeLast(wxT(',')),
strIndex = strIcon.AfterLast(T(',')); strIndex = strIcon.AfterLast(wxT(','));
// index may be omitted, in which case BeforeLast(',') is empty and // index may be omitted, in which case BeforeLast(',') is empty and
// AfterLast(',') is the whole string // AfterLast(',') is the whole string
if ( strFullPath.IsEmpty() ) { if ( strFullPath.IsEmpty() ) {
strFullPath = strIndex; strFullPath = strIndex;
strIndex = T("0"); strIndex = wxT("0");
} }
wxString strExpPath = wxExpandEnvVars(strFullPath); wxString strExpPath = wxExpandEnvVars(strFullPath);
@@ -754,7 +754,7 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const
switch ( (int)hIcon ) { switch ( (int)hIcon ) {
case 0: // means no icons were found case 0: // means no icons were found
case 1: // means no such file or it wasn't a DLL/EXE/OCX/ICO/... case 1: // means no such file or it wasn't a DLL/EXE/OCX/ICO/...
wxLogDebug(T("incorrect registry entry '%s': no such icon."), wxLogDebug(wxT("incorrect registry entry '%s': no such icon."),
key.GetName().c_str()); key.GetName().c_str());
break; break;
@@ -784,7 +784,7 @@ bool wxFileTypeImpl::GetDescription(wxString *desc) const
if ( key.Open() ) { if ( key.Open() ) {
// it's the default value of the key // it's the default value of the key
if ( key.QueryValue(T(""), *desc) ) { if ( key.QueryValue(wxT(""), *desc) ) {
return TRUE; return TRUE;
} }
} }
@@ -798,8 +798,8 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
{ {
// add the leading point if necessary // add the leading point if necessary
wxString str; wxString str;
if ( ext[0u] != T('.') ) { if ( ext[0u] != wxT('.') ) {
str = T('.'); str = wxT('.');
} }
str << ext; str << ext;
@@ -810,7 +810,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
wxRegKey key(wxRegKey::HKCR, str); wxRegKey key(wxRegKey::HKCR, str);
if ( key.Open() ) { if ( key.Open() ) {
// it's the default value of the key // it's the default value of the key
if ( key.QueryValue(T(""), strFileType) ) { if ( key.QueryValue(wxT(""), strFileType) ) {
// create the new wxFileType object // create the new wxFileType object
wxFileType *fileType = new wxFileType; wxFileType *fileType = new wxFileType;
fileType->m_impl->Init(strFileType, ext); fileType->m_impl->Init(strFileType, ext);
@@ -842,7 +842,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType)
{ {
// HACK I don't know of any official documentation which mentions this // HACK I don't know of any official documentation which mentions this
// location, but as a matter of fact IE uses it, so why not we? // location, but as a matter of fact IE uses it, so why not we?
static const wxChar *szMimeDbase = T("MIME\\Database\\Content Type\\"); static const wxChar *szMimeDbase = wxT("MIME\\Database\\Content Type\\");
wxString strKey = szMimeDbase; wxString strKey = szMimeDbase;
strKey << mimeType; strKey << mimeType;
@@ -853,7 +853,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType)
wxString ext; wxString ext;
wxRegKey key(wxRegKey::HKCR, strKey); wxRegKey key(wxRegKey::HKCR, strKey);
if ( key.Open() ) { if ( key.Open() ) {
if ( key.QueryValue(T("Extension"), ext) ) { if ( key.QueryValue(wxT("Extension"), ext) ) {
return GetFileTypeFromExtension(ext); return GetFileTypeFromExtension(ext);
} }
} }
@@ -889,12 +889,12 @@ wxFileTypeImpl::GetEntry(const wxFileType::MessageParameters& params) const
if ( command.IsEmpty() || (wxSystem(command) == 0) ) { if ( command.IsEmpty() || (wxSystem(command) == 0) ) {
// ok, passed // ok, passed
wxLogTrace(T("Test '%s' for mime type '%s' succeeded."), wxLogTrace(wxT("Test '%s' for mime type '%s' succeeded."),
command.c_str(), params.GetMimeType().c_str()); command.c_str(), params.GetMimeType().c_str());
break; break;
} }
else { else {
wxLogTrace(T("Test '%s' for mime type '%s' failed."), wxLogTrace(wxT("Test '%s' for mime type '%s' failed."),
command.c_str(), params.GetMimeType().c_str()); command.c_str(), params.GetMimeType().c_str());
} }
@@ -933,7 +933,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
// one extension in the space or comma delimitid list // one extension in the space or comma delimitid list
wxString strExt; wxString strExt;
for ( const wxChar *p = strExtensions; ; p++ ) { for ( const wxChar *p = strExtensions; ; p++ ) {
if ( *p == T(' ') || *p == T(',') || *p == T('\0') ) { if ( *p == wxT(' ') || *p == wxT(',') || *p == wxT('\0') ) {
if ( !strExt.IsEmpty() ) { if ( !strExt.IsEmpty() ) {
extensions.Add(strExt); extensions.Add(strExt);
strExt.Empty(); strExt.Empty();
@@ -941,13 +941,13 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
//else: repeated spaces (shouldn't happen, but it's not that //else: repeated spaces (shouldn't happen, but it's not that
// important if it does happen) // important if it does happen)
if ( *p == T('\0') ) if ( *p == wxT('\0') )
break; break;
} }
else if ( *p == T('.') ) { else if ( *p == wxT('.') ) {
// remove the dot from extension (but only if it's the first char) // remove the dot from extension (but only if it's the first char)
if ( !strExt.IsEmpty() ) { if ( !strExt.IsEmpty() ) {
strExt += T('.'); strExt += wxT('.');
} }
//else: no, don't append it //else: no, don't append it
} }
@@ -966,38 +966,38 @@ wxMimeTypesManagerImpl::wxMimeTypesManagerImpl()
// (taken from metamail(1) sources) // (taken from metamail(1) sources)
static const wxChar *aStandardLocations[] = static const wxChar *aStandardLocations[] =
{ {
T("/etc"), wxT("/etc"),
T("/usr/etc"), wxT("/usr/etc"),
T("/usr/local/etc"), wxT("/usr/local/etc"),
T("/etc/mail"), wxT("/etc/mail"),
T("/usr/public/lib") wxT("/usr/public/lib")
}; };
// first read the system wide file(s) // first read the system wide file(s)
for ( size_t n = 0; n < WXSIZEOF(aStandardLocations); n++ ) { for ( size_t n = 0; n < WXSIZEOF(aStandardLocations); n++ ) {
wxString dir = aStandardLocations[n]; wxString dir = aStandardLocations[n];
wxString file = dir + T("/mailcap"); wxString file = dir + wxT("/mailcap");
if ( wxFile::Exists(file) ) { if ( wxFile::Exists(file) ) {
ReadMailcap(file); ReadMailcap(file);
} }
file = dir + T("/mime.types"); file = dir + wxT("/mime.types");
if ( wxFile::Exists(file) ) { if ( wxFile::Exists(file) ) {
ReadMimeTypes(file); ReadMimeTypes(file);
} }
} }
wxString strHome = wxGetenv(T("HOME")); wxString strHome = wxGetenv(wxT("HOME"));
// and now the users mailcap // and now the users mailcap
wxString strUserMailcap = strHome + T("/.mailcap"); wxString strUserMailcap = strHome + wxT("/.mailcap");
if ( wxFile::Exists(strUserMailcap) ) { if ( wxFile::Exists(strUserMailcap) ) {
ReadMailcap(strUserMailcap); ReadMailcap(strUserMailcap);
} }
// read the users mime.types // read the users mime.types
wxString strUserMimeTypes = strHome + T("/.mime.types"); wxString strUserMimeTypes = strHome + wxT("/.mime.types");
if ( wxFile::Exists(strUserMimeTypes) ) { if ( wxFile::Exists(strUserMimeTypes) ) {
ReadMimeTypes(strUserMimeTypes); ReadMimeTypes(strUserMimeTypes);
} }
@@ -1010,8 +1010,8 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
for ( size_t n = 0; n < count; n++ ) { for ( size_t n = 0; n < count; n++ ) {
wxString extensions = m_aExtensions[n]; wxString extensions = m_aExtensions[n];
while ( !extensions.IsEmpty() ) { while ( !extensions.IsEmpty() ) {
wxString field = extensions.BeforeFirst(T(' ')); wxString field = extensions.BeforeFirst(wxT(' '));
extensions = extensions.AfterFirst(T(' ')); extensions = extensions.AfterFirst(wxT(' '));
// consider extensions as not being case-sensitive // consider extensions as not being case-sensitive
if ( field.IsSameAs(ext, FALSE /* no case */) ) { if ( field.IsSameAs(ext, FALSE /* no case */) ) {
@@ -1041,12 +1041,12 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType)
// then try to find "text/*" as match for "text/plain" (for example) // then try to find "text/*" as match for "text/plain" (for example)
// NB: if mimeType doesn't contain '/' at all, BeforeFirst() will return // NB: if mimeType doesn't contain '/' at all, BeforeFirst() will return
// the whole string - ok. // the whole string - ok.
wxString strCategory = mimetype.BeforeFirst(T('/')); wxString strCategory = mimetype.BeforeFirst(wxT('/'));
size_t nCount = m_aTypes.Count(); size_t nCount = m_aTypes.Count();
for ( size_t n = 0; n < nCount; n++ ) { for ( size_t n = 0; n < nCount; n++ ) {
if ( (m_aTypes[n].BeforeFirst(T('/')) == strCategory ) && if ( (m_aTypes[n].BeforeFirst(wxT('/')) == strCategory ) &&
m_aTypes[n].AfterFirst(T('/')) == T("*") ) { m_aTypes[n].AfterFirst(wxT('/')) == wxT("*") ) {
index = n; index = n;
break; break;
} }
@@ -1072,7 +1072,7 @@ void wxMimeTypesManagerImpl::AddFallback(const wxFileTypeInfo& filetype)
size_t nExts = exts.GetCount(); size_t nExts = exts.GetCount();
for ( size_t nExt = 0; nExt < nExts; nExt++ ) { for ( size_t nExt = 0; nExt < nExts; nExt++ ) {
if ( nExt > 0 ) { if ( nExt > 0 ) {
extensions += T(' '); extensions += wxT(' ');
} }
extensions += exts[nExt]; extensions += exts[nExt];
} }
@@ -1084,7 +1084,7 @@ void wxMimeTypesManagerImpl::AddFallback(const wxFileTypeInfo& filetype)
AddMailcapInfo(filetype.GetMimeType(), AddMailcapInfo(filetype.GetMimeType(),
filetype.GetOpenCommand(), filetype.GetOpenCommand(),
filetype.GetPrintCommand(), filetype.GetPrintCommand(),
T(""), wxT(""),
filetype.GetDescription()); filetype.GetDescription());
} }
@@ -1123,7 +1123,7 @@ void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType,
m_aTypes.Add(strType); m_aTypes.Add(strType);
m_aEntries.Add(entry); m_aEntries.Add(entry);
m_aExtensions.Add(T("")); m_aExtensions.Add(wxT(""));
m_aDescriptions.Add(strDesc); m_aDescriptions.Add(strDesc);
} }
else { else {
@@ -1139,7 +1139,7 @@ void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType,
bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
{ {
wxLogTrace(T("--- Parsing mime.types file '%s' ---"), strFileName.c_str()); wxLogTrace(wxT("--- Parsing mime.types file '%s' ---"), strFileName.c_str());
wxTextFile file(strFileName); wxTextFile file(strFileName);
if ( !file.Open() ) if ( !file.Open() )
@@ -1165,20 +1165,20 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
pc++; pc++;
// comment? // comment?
if ( *pc == T('#') ) { if ( *pc == wxT('#') ) {
// skip the whole line // skip the whole line
pc = NULL; pc = NULL;
continue; continue;
} }
// detect file format // detect file format
const wxChar *pEqualSign = wxStrchr(pc, T('=')); const wxChar *pEqualSign = wxStrchr(pc, wxT('='));
if ( pEqualSign == NULL ) { if ( pEqualSign == NULL ) {
// brief format // brief format
// ------------ // ------------
// first field is mime type // first field is mime type
for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != T('\0'); pc++ ) { for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != wxT('\0'); pc++ ) {
strMimeType += *pc; strMimeType += *pc;
} }
@@ -1204,9 +1204,9 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
; ;
const wxChar *pEnd; const wxChar *pEnd;
if ( *pc == T('"') ) { if ( *pc == wxT('"') ) {
// the string is quoted and ends at the matching quote // the string is quoted and ends at the matching quote
pEnd = wxStrchr(++pc, T('"')); pEnd = wxStrchr(++pc, wxT('"'));
if ( pEnd == NULL ) { if ( pEnd == NULL ) {
wxLogWarning(_("Mime.types file %s, line %d: unterminated " wxLogWarning(_("Mime.types file %s, line %d: unterminated "
"quoted string."), "quoted string."),
@@ -1223,7 +1223,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
wxString strRHS(pc, pEnd - pc); wxString strRHS(pc, pEnd - pc);
// check what follows this entry // check what follows this entry
if ( *pEnd == T('"') ) { if ( *pEnd == wxT('"') ) {
// skip this quote // skip this quote
pEnd++; pEnd++;
} }
@@ -1233,20 +1233,20 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
// if there is something left, it may be either a '\\' to continue // if there is something left, it may be either a '\\' to continue
// the line or the next field of the same entry // the line or the next field of the same entry
bool entryEnded = *pc == T('\0'), bool entryEnded = *pc == wxT('\0'),
nextFieldOnSameLine = FALSE; nextFieldOnSameLine = FALSE;
if ( !entryEnded ) { if ( !entryEnded ) {
nextFieldOnSameLine = ((*pc != T('\\')) || (pc[1] != T('\0'))); nextFieldOnSameLine = ((*pc != wxT('\\')) || (pc[1] != wxT('\0')));
} }
// now see what we got // now see what we got
if ( strLHS == T("type") ) { if ( strLHS == wxT("type") ) {
strMimeType = strRHS; strMimeType = strRHS;
} }
else if ( strLHS == T("desc") ) { else if ( strLHS == wxT("desc") ) {
strDesc = strRHS; strDesc = strRHS;
} }
else if ( strLHS == T("exts") ) { else if ( strLHS == wxT("exts") ) {
strExtensions = strRHS; strExtensions = strRHS;
} }
else { else {
@@ -1269,10 +1269,10 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
// although it doesn't seem to be covered by RFCs, some programs // although it doesn't seem to be covered by RFCs, some programs
// (notably Netscape) create their entries with several comma // (notably Netscape) create their entries with several comma
// separated extensions (RFC mention the spaces only) // separated extensions (RFC mention the spaces only)
strExtensions.Replace(T(","), T(" ")); strExtensions.Replace(wxT(","), wxT(" "));
// also deal with the leading dot // also deal with the leading dot
if ( !strExtensions.IsEmpty() && strExtensions[0] == T('.') ) { if ( !strExtensions.IsEmpty() && strExtensions[0] == wxT('.') ) {
strExtensions.erase(0, 1); strExtensions.erase(0, 1);
} }
@@ -1293,7 +1293,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
bool fallback) bool fallback)
{ {
wxLogTrace(T("--- Parsing mailcap file '%s' ---"), strFileName.c_str()); wxLogTrace(wxT("--- Parsing mailcap file '%s' ---"), strFileName.c_str());
wxTextFile file(strFileName); wxTextFile file(strFileName);
if ( !file.Open() ) if ( !file.Open() )
@@ -1317,7 +1317,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
pc++; pc++;
// comment or empty string? // comment or empty string?
if ( *pc == T('#') || *pc == T('\0') ) if ( *pc == wxT('#') || *pc == wxT('\0') )
continue; continue;
// no, do parse // no, do parse
@@ -1343,10 +1343,10 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
curField; // accumulator curField; // accumulator
for ( bool cont = TRUE; cont; pc++ ) { for ( bool cont = TRUE; cont; pc++ ) {
switch ( *pc ) { switch ( *pc ) {
case T('\\'): case wxT('\\'):
// interpret the next character literally (notice that // interpret the next character literally (notice that
// backslash can be used for line continuation) // backslash can be used for line continuation)
if ( *++pc == T('\0') ) { if ( *++pc == wxT('\0') ) {
// fetch the next line. // fetch the next line.
// pc currently points to nowhere, but after the next // pc currently points to nowhere, but after the next
@@ -1360,12 +1360,12 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
} }
break; break;
case T('\0'): case wxT('\0'):
cont = FALSE; // end of line reached, exit the loop cont = FALSE; // end of line reached, exit the loop
// fall through // fall through
case T(';'): case wxT(';'):
// store this field and start looking for the next one // store this field and start looking for the next one
// trim whitespaces from both sides // trim whitespaces from both sides
@@ -1374,9 +1374,9 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
switch ( currentToken ) { switch ( currentToken ) {
case Field_Type: case Field_Type:
strType = curField; strType = curField;
if ( strType.Find(T('/')) == wxNOT_FOUND ) { if ( strType.Find(wxT('/')) == wxNOT_FOUND ) {
// we interpret "type" as "type/*" // we interpret "type" as "type/*"
strType += T("/*"); strType += wxT("/*");
} }
currentToken = Field_OpenCmd; currentToken = Field_OpenCmd;
@@ -1394,22 +1394,22 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
bool ok = TRUE; bool ok = TRUE;
// is this something of the form foo=bar? // is this something of the form foo=bar?
const wxChar *pEq = wxStrchr(curField, T('=')); const wxChar *pEq = wxStrchr(curField, wxT('='));
if ( pEq != NULL ) { if ( pEq != NULL ) {
wxString lhs = curField.BeforeFirst(T('=')), wxString lhs = curField.BeforeFirst(wxT('=')),
rhs = curField.AfterFirst(T('=')); rhs = curField.AfterFirst(wxT('='));
lhs.Trim(TRUE); // from right lhs.Trim(TRUE); // from right
rhs.Trim(FALSE); // from left rhs.Trim(FALSE); // from left
if ( lhs == T("print") ) if ( lhs == wxT("print") )
strPrintCmd = rhs; strPrintCmd = rhs;
else if ( lhs == T("test") ) else if ( lhs == wxT("test") )
strTest = rhs; strTest = rhs;
else if ( lhs == T("description") ) { else if ( lhs == wxT("description") ) {
// it might be quoted // it might be quoted
if ( rhs[0u] == T('"') && if ( rhs[0u] == wxT('"') &&
rhs.Last() == T('"') ) { rhs.Last() == wxT('"') ) {
strDesc = wxString(rhs.c_str() + 1, strDesc = wxString(rhs.c_str() + 1,
rhs.Len() - 2); rhs.Len() - 2);
} }
@@ -1417,10 +1417,10 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
strDesc = rhs; strDesc = rhs;
} }
} }
else if ( lhs == T("compose") || else if ( lhs == wxT("compose") ||
lhs == T("composetyped") || lhs == wxT("composetyped") ||
lhs == T("notes") || lhs == wxT("notes") ||
lhs == T("edit") ) lhs == wxT("edit") )
; // ignore ; // ignore
else else
ok = FALSE; ok = FALSE;
@@ -1431,11 +1431,11 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
// TODO support the flags: // TODO support the flags:
// 1. create an xterm for 'needsterminal' // 1. create an xterm for 'needsterminal'
// 2. append "| $PAGER" for 'copiousoutput' // 2. append "| $PAGER" for 'copiousoutput'
if ( curField == T("needsterminal") ) if ( curField == wxT("needsterminal") )
needsterminal = TRUE; needsterminal = TRUE;
else if ( curField == T("copiousoutput") ) else if ( curField == wxT("copiousoutput") )
copiousoutput = TRUE; copiousoutput = TRUE;
else if ( curField == T("textualnewlines") ) else if ( curField == wxT("textualnewlines") )
; // ignore ; // ignore
else else
ok = FALSE; ok = FALSE;
@@ -1450,7 +1450,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
// programmer // programmer
wxLogDebug wxLogDebug
( (
T("Mailcap file %s, line %d: unknown " wxT("Mailcap file %s, line %d: unknown "
"field '%s' for the MIME type " "field '%s' for the MIME type "
"'%s' ignored."), "'%s' ignored."),
strFileName.c_str(), strFileName.c_str(),
@@ -1466,7 +1466,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
break; break;
default: default:
wxFAIL_MSG(T("unknown field type in mailcap")); wxFAIL_MSG(wxT("unknown field type in mailcap"));
} }
// next token starts immediately after ';' // next token starts immediately after ';'
@@ -1498,7 +1498,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
m_aTypes.Add(strType); m_aTypes.Add(strType);
m_aEntries.Add(entry); m_aEntries.Add(entry);
m_aExtensions.Add(T("")); m_aExtensions.Add(wxT(""));
m_aDescriptions.Add(strDesc); m_aDescriptions.Add(strDesc);
} }
else { else {

View File

@@ -45,7 +45,7 @@
#endif #endif
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
wxClassInfo wxObject::sm_classwxObject((wxChar *) T("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL); wxClassInfo wxObject::sm_classwxObject((wxChar *) wxT("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL; wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL;
wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL; wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
#endif #endif

View File

@@ -45,7 +45,7 @@ wxString wxObjectOutputStream::GetObjectName(wxObject *obj)
{ {
wxString name; wxString name;
name.Printf(T("%x"), (unsigned long)obj); name.Printf(wxT("%x"), (unsigned long)obj);
return name; return name;
} }
@@ -58,16 +58,16 @@ void wxObjectOutputStream::WriteObjectDef(wxObjectStreamInfo& info)
if (info.duplicate) { if (info.duplicate) {
data_s.WriteString(TAG_DUPLICATE_OBJECT); data_s.WriteString(TAG_DUPLICATE_OBJECT);
data_s.WriteString(GetObjectName(info.object)); data_s.WriteString(GetObjectName(info.object));
wxPrintf(T("info.object (dup %s)\n"), info.object->GetClassInfo()->GetClassName()); wxPrintf(wxT("info.object (dup %s)\n"), info.object->GetClassInfo()->GetClassName());
return; return;
} }
if (info.object) { if (info.object) {
data_s.WriteString(info.object->GetClassInfo()->GetClassName()); data_s.WriteString(info.object->GetClassInfo()->GetClassName());
wxPrintf(T("info.object (%s)\n"), info.object->GetClassInfo()->GetClassName()); wxPrintf(wxT("info.object (%s)\n"), info.object->GetClassInfo()->GetClassName());
} else { } else {
data_s.WriteString(TAG_EMPTY_OBJECT); data_s.WriteString(TAG_EMPTY_OBJECT);
wxPrintf(T("info.object (NULL)\n")); wxPrintf(wxT("info.object (NULL)\n"));
return; return;
} }

View File

@@ -409,7 +409,7 @@ void wxPreviewControlBar::SetZoomControl(int zoom)
int wxPreviewControlBar::GetZoomControl() int wxPreviewControlBar::GetZoomControl()
{ {
wxChar buf[20]; wxChar buf[20];
if (m_zoomControl && (m_zoomControl->GetStringSelection() != T(""))) if (m_zoomControl && (m_zoomControl->GetStringSelection() != wxT("")))
{ {
wxStrcpy(buf, m_zoomControl->GetStringSelection()); wxStrcpy(buf, m_zoomControl->GetStringSelection());
buf[wxStrlen(buf) - 1] = 0; buf[wxStrlen(buf) - 1] = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -103,8 +103,8 @@ wxIPV4address::~wxIPV4address()
bool wxIPV4address::Hostname(const wxString& name) bool wxIPV4address::Hostname(const wxString& name)
{ {
// Some people are sometimes fool. // Some people are sometimes fool.
if (name == T("")) { if (name == wxT("")) {
wxLogWarning( T("Trying to solve a NULL hostname: giving up") ); wxLogWarning( wxT("Trying to solve a NULL hostname: giving up") );
return FALSE; return FALSE;
} }

View File

@@ -29,7 +29,7 @@
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol) IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
IMPLEMENT_PROTOCOL(wxFileProto, T("file"), NULL, FALSE) IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, FALSE)
#endif #endif
wxFileProto::wxFileProto() wxFileProto::wxFileProto()

Some files were not shown because too many files have changed in this diff Show More