2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2008-03-08 09:43:31 -05:00
|
|
|
// Name: chartype.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of global functions
|
2008-03-08 09:43:31 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 09:43:31 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_string */
|
2008-03-08 09:43:31 -05:00
|
|
|
//@{
|
2008-03-25 03:36:12 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-03-25 03:36:12 -04:00
|
|
|
This macro can be used with character and string literals (in other words,
|
2008-12-01 17:20:39 -05:00
|
|
|
@c 'x' or @c "foo") to automatically convert them to wide strings in Unicode
|
|
|
|
builds of wxWidgets. This macro simply returns the value passed to it
|
2008-03-25 03:36:12 -04:00
|
|
|
without changes in ASCII build. In fact, its definition is:
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2009-01-31 08:57:05 -05:00
|
|
|
@code
|
|
|
|
#ifdef UNICODE
|
|
|
|
# define wxT(x) L##x
|
|
|
|
#else // !Unicode
|
|
|
|
# define wxT(x) x
|
|
|
|
#endif
|
|
|
|
@endcode
|
2008-03-25 03:36:12 -04:00
|
|
|
|
2008-12-04 19:57:05 -05:00
|
|
|
Note that since wxWidgets 2.9.0 you shouldn't use wxT() anymore in your
|
2009-01-31 08:57:05 -05:00
|
|
|
program sources (it was previously required if you wanted to support Unicode).
|
2008-12-04 19:57:05 -05:00
|
|
|
|
2008-12-01 17:20:39 -05:00
|
|
|
@see @ref overview_unicode, wxS()
|
2008-03-25 03:36:12 -04:00
|
|
|
|
|
|
|
@header{wx/chartype.h}
|
|
|
|
*/
|
|
|
|
#define wxT(string)
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-12-01 17:20:39 -05:00
|
|
|
wxS is macro which can be used with character and string literals (in other words,
|
|
|
|
@c 'x' or @c "foo") to either convert them to wide characters or wide strings
|
|
|
|
in @c wchar_t-based (UTF-16) builds or keep them unchanged in @c char-based
|
|
|
|
(UTF-8) builds.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-12-04 19:57:05 -05:00
|
|
|
Basically this macro produces characters or strings of type wxStringCharType.
|
|
|
|
|
2008-12-01 17:20:39 -05:00
|
|
|
The use of this macro is optional as the translation will always be done at
|
|
|
|
run-time even if there is a mismatch between the kind of the literal used
|
|
|
|
and the string or character type used in the current build.
|
|
|
|
However using it can be beneficial in <b>performance-sensitive code</b> to
|
|
|
|
do the conversion at compile-time instead.
|
|
|
|
|
|
|
|
@see @ref overview_unicode, wxT()
|
2008-03-25 03:36:12 -04:00
|
|
|
|
|
|
|
@header{wx/chartype.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-25 03:36:12 -04:00
|
|
|
#define wxS(string)
|
|
|
|
|
|
|
|
/**
|
|
|
|
This macro is exactly the same as wxT() and is defined in wxWidgets simply
|
|
|
|
because it may be more intuitive for Windows programmers as the standard
|
|
|
|
Win32 headers also define it (as well as yet another name for the same
|
|
|
|
macro which is _TEXT()).
|
|
|
|
|
|
|
|
Don't confuse this macro with _()!
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2009-07-23 16:30:22 -04:00
|
|
|
Note that since wxWidgets 2.9.0 the use of _T() is discouraged just like
|
|
|
|
for wxT() and also that this macro may conflict with identifiers defined in
|
|
|
|
standard headers of some compilers (such as Sun CC) so its use should
|
|
|
|
really be avoided.
|
2009-01-31 08:57:05 -05:00
|
|
|
|
2008-03-25 03:36:12 -04:00
|
|
|
@header{wx/chartype.h}
|
|
|
|
*/
|
|
|
|
#define _T(string)
|
|
|
|
|
2008-12-01 17:20:39 -05:00
|
|
|
/**
|
|
|
|
wxChar is defined to be
|
|
|
|
- @c char when <tt>wxUSE_UNICODE==0</tt>
|
|
|
|
- @c wchar_t when <tt>wxUSE_UNICODE==1</tt> (the default).
|
|
|
|
*/
|
|
|
|
typedef wxUSE_UNICODE_dependent wxChar;
|
|
|
|
|
|
|
|
/**
|
|
|
|
wxSChar is defined to be
|
|
|
|
- <tt>signed char</tt> when <tt>wxUSE_UNICODE==0</tt>
|
|
|
|
- @c wchar_t when <tt>wxUSE_UNICODE==1</tt> (the default).
|
|
|
|
*/
|
|
|
|
typedef wxUSE_UNICODE_dependent wxSChar;
|
|
|
|
|
|
|
|
/**
|
|
|
|
wxUChar is defined to be
|
|
|
|
- <tt>unsigned char</tt> when <tt>wxUSE_UNICODE==0</tt>
|
|
|
|
- @c wchar_t when <tt>wxUSE_UNICODE==1</tt> (the default).
|
|
|
|
*/
|
|
|
|
typedef wxUSE_UNICODE_dependent wxUChar;
|
|
|
|
|
|
|
|
/**
|
|
|
|
wxStringCharType is defined to be:
|
|
|
|
- @c char when <tt>wxUSE_UNICODE==0</tt>
|
|
|
|
- @c char when <tt>wxUSE_UNICODE_WCHAR==0</tt> and <tt>wxUSE_UNICODE==1</tt>
|
|
|
|
- @c wchar_t when <tt>wxUSE_UNICODE_WCHAR==1</tt> and <tt>wxUSE_UNICODE==1</tt>
|
|
|
|
|
|
|
|
The @c wxUSE_UNICODE_WCHAR symbol is defined to @c 1 when building on
|
|
|
|
Windows while it's defined to @c 0 when building on Unix, Linux or OS X.
|
2008-12-04 19:57:05 -05:00
|
|
|
(Note that @c wxUSE_UNICODE_UTF8 symbol is defined as the opposite of
|
|
|
|
@c wxUSE_UNICODE_WCHAR.)
|
2008-12-01 17:20:39 -05:00
|
|
|
|
2008-12-04 19:57:05 -05:00
|
|
|
Note that wxStringCharType (as the name says) is the type used by wxString
|
|
|
|
for internal storage of the characters.
|
2008-12-01 17:20:39 -05:00
|
|
|
*/
|
|
|
|
typedef wxUSE_UNICODE_WCHAR_dependent wxStringCharType;
|
|
|
|
|
2008-03-25 03:36:12 -04:00
|
|
|
//@}
|