many changes; major ones:

1. start of !wxUSE_GUI support
2. _T() macro renamed to T()
3. wxConvertWX2MB and MB2WX macro added


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-10-04 20:15:38 +00:00
parent 9841339c74
commit e90c1d2a19
298 changed files with 5153 additions and 4672 deletions

View File

@@ -1821,14 +1821,53 @@ JPEGOBJS = \
jquant2.o \ jquant2.o \
jdmerge.o jdmerge.o
BASE_OBJS = \
dynarray.o \
event.o \
hash.o \
intl.o \
init.o \
file.o \
filefn.o \
list.o \
log.o \
object.o \
string.o \
utilscmn.o \
utilsunx.o
OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(@UNIXOBJS@) $(HTMLOBJS) \ BASE_DEPS = \
$(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS) dynarray.d \
event.d \
hash.d \
intl.d \
init.d \
file.d \
filefn.d \
list.d \
log.d \
object.d \
string.d \
utilscmn.d \
utilsunx.d
DEPFILES = $(@GUIDEPS@) $(@COMMONDEPS@) $(@GENERICDEPS@) $(UNIXDEPS) $(HTMLDEPS) BASE_HEADERS =
HEADERS = $(@GUIHEADERS@) $(HTML_HEADERS) $(UNIX_HEADERS) $(PROTOCOL_HEADERS) \ GUIOBJS = @GUIOBJS@
$(GENERIC_HEADERS) $(WX_HEADERS) GUIDEPS = @GUIDEPS@
GUIHEADERS = @GUIHEADERS@
COMMONOBJS = @COMMONOBJS@
COMMONDEPS = @COMMONDEPS@
GENERICOBJS = @GENERICOBJS@
GENERICDEPS = @GENERICDEPS@
UNIXOBJS = @UNIXOBJS@
UNIXDEPS = @UNIXDEPS@
OBJECTS = @ALL_OBJECTS@
DEPFILES = @ALL_DEPFILES@
HEADERS = @ALL_HEADERS@
all: @WX_CREATE_LINKS@ all: @WX_CREATE_LINKS@

View File

@@ -64,8 +64,8 @@ main ()
if (gtk_minor_version == 1) return FALSE; if (gtk_minor_version == 1) return FALSE;
return !((gtk_major_version > major) || return !((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))); ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
} }
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
@@ -744,7 +744,7 @@ if test $DEBUG_CONFIGURE = 1; then
DEFAULT_wxUSE_UNICODE=no DEFAULT_wxUSE_UNICODE=no
DEFAULT_wxUSE_WCSRTOMBS=no DEFAULT_wxUSE_WCSRTOMBS=no
DEFAULT_wxUSE_GIF=no DEFAULT_wxUSE_GIF=no
DEFAULT_wxUSE_PCX=no DEFAULT_wxUSE_PCX=no
DEFAULT_wxUSE_PNM=no DEFAULT_wxUSE_PNM=no
@@ -855,7 +855,7 @@ else
DEFAULT_wxUSE_UNICODE=no DEFAULT_wxUSE_UNICODE=no
DEFAULT_wxUSE_WCSRTOMBS=no DEFAULT_wxUSE_WCSRTOMBS=no
DEFAULT_wxUSE_GIF=yes DEFAULT_wxUSE_GIF=yes
DEFAULT_wxUSE_PCX=yes DEFAULT_wxUSE_PCX=yes
DEFAULT_wxUSE_PNM=yes DEFAULT_wxUSE_PNM=yes
@@ -880,6 +880,85 @@ for toolkit in `echo $ALL_TOOLKITS`; do
fi fi
done done
dnl ---------------------------------------------------------------------------
dnl --disable-gui will build only non-GUI part of wxWindows: check for this
dnl first to disable many other switches if it's given
dnl
dnl NB: this is still in testing stage, don't use if you don't know what you're
dnl doing
dnl ---------------------------------------------------------------------------
WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
dnl disable everything GUI related then
if test "$wxUSE_GUI" = "no"; then
DEFAULT_wxUSE_ZLIB=no
DEFAULT_wxUSE_LIBPNG=no
DEFAULT_wxUSE_LIBJPEG=no
DEFAULT_wxUSE_SOCKETS=no
DEFAULT_wxUSE_JOYSTICK=no
DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
DEFAULT_wxUSE_POSTSCRIPT=no
DEFAULT_wxUSE_X_RESOURCES=no
DEFAULT_wxUSE_CLIPBOARD=no
DEFAULT_wxUSE_TOOLTIPS=no
DEFAULT_wxUSE_DRAG_AND_DROP=no
DEFAULT_wxUSE_SPLINES=no
DEFAULT_wxUSE_MDI_ARCHITECTURE=no
DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
DEFAULT_wxUSE_PROLOGIO=no
DEFAULT_wxUSE_RESOURCES=no
DEFAULT_wxUSE_CONSTRAINTS=no
DEFAULT_wxUSE_IPC=no
DEFAULT_wxUSE_HELP=no
DEFAULT_wxUSE_WXTREE=no
DEFAULT_wxUSE_METAFILE=no
DEFAULT_wxUSE_COMMONDLGS=no
DEFAULT_wxUSE_DIRDLG=no
DEFAULT_wxUSE_TEXTDLG=no
DEFAULT_wxUSE_STARTUP_TIPS=no
DEFAULT_wxUSE_PROGRESSDLG=no
DEFAULT_wxUSE_MINIFRAME=no
DEFAULT_wxUSE_HTML=no
DEFAULT_wxUSE_FS_INET=no
DEFAULT_wxUSE_FS_ZIP=no
DEFAULT_wxUSE_BUSYINFO=no
DEFAULT_wxUSE_ZIPSTREAM=no
DEFAULT_wxUSE_VALIDATORS=yes
DEFAULT_wxUSE_ACCEL=no
DEFAULT_wxUSE_CARET=no
DEFAULT_wxUSE_BMPBUTTON=no
DEFAULT_wxUSE_CHECKBOX=no
DEFAULT_wxUSE_CHECKLST=no
DEFAULT_wxUSE_CHOICE=yes
DEFAULT_wxUSE_COMBOBOX=no
DEFAULT_wxUSE_GAUGE=no
DEFAULT_wxUSE_GRID=no
DEFAULT_wxUSE_IMAGLIST=no
DEFAULT_wxUSE_LISTBOX=no
DEFAULT_wxUSE_LISTCTRL=no
DEFAULT_wxUSE_NOTEBOOK=no
DEFAULT_wxUSE_RADIOBOX=no
DEFAULT_wxUSE_RADIOBTN=no
DEFAULT_wxUSE_SASH=no
DEFAULT_wxUSE_SCROLLBAR=no
DEFAULT_wxUSE_SLIDER=no
DEFAULT_wxUSE_SPINBTN=no
DEFAULT_wxUSE_SPLITTER=no
DEFAULT_wxUSE_STATBMP=no
DEFAULT_wxUSE_STATBOX=no
DEFAULT_wxUSE_STATLINE=no
DEFAULT_wxUSE_STATUSBAR=yes
DEFAULT_wxUSE_TABDIALOG=no
DEFAULT_wxUSE_TOOLBAR=no
DEFAULT_wxUSE_TREECTRL=no
DEFAULT_wxUSE_GIF=no
DEFAULT_wxUSE_PCX=no
DEFAULT_wxUSE_PNM=no
fi
AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
@@ -929,15 +1008,6 @@ WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without exce
WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS) WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
dnl ---------------------------------------------------------------------------
dnl --disable-gui will build only non-GUI part of wxWindows
dnl
dnl NB: this is still in testing stage, don't use if you don't know what you're
dnl doing
dnl ---------------------------------------------------------------------------
WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl (small) optional non GUI classes dnl (small) optional non GUI classes
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
@@ -1139,6 +1209,8 @@ dnl we have a default one
AC_MSG_CHECKING(for toolkit) AC_MSG_CHECKING(for toolkit)
if test "$wxUSE_GUI" = "yes"; then
if test "$TOOLKIT_GIVEN" = 1; then if test "$TOOLKIT_GIVEN" = 1; then
dnl convert "yes" to 1 and "no" to 0 dnl convert "yes" to 1 and "no" to 0
for toolkit in `echo $ALL_TOOLKITS`; do for toolkit in `echo $ALL_TOOLKITS`; do
@@ -1187,6 +1259,11 @@ for toolkit in `echo $ALL_TOOLKITS`; do
fi fi
done done
dnl from "if wxUSE_GUI"
else
AC_MSG_RESULT(base only)
fi
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Checks for programs dnl Checks for programs
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
@@ -1390,6 +1467,8 @@ dnl ----------------------------------------------------------------
dnl search for toolkit (widget sets) dnl search for toolkit (widget sets)
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
if test "$wxUSE_GUI" = "yes"; then
TOOLKIT= TOOLKIT=
TOOLKIT_INCLUDE= TOOLKIT_INCLUDE=
@@ -1409,14 +1488,14 @@ PROGRAM_EXT=
if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
if test "$cross_compiling" = "yes" ; then if test "$cross_compiling" = "yes" ; then
AC_MSG_WARN(Cross compiling --- skipping windows.h check) AC_MSG_WARN(Cross compiling --- skipping windows.h check)
else else
AC_MSG_CHECKING(for Windows headers) AC_MSG_CHECKING(for Windows headers)
WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h) WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
if test "$ac_find_includes" != "" ; then if test "$ac_find_includes" != "" ; then
AC_MSG_RESULT(found $ac_find_includes) AC_MSG_RESULT(found $ac_find_includes)
TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes" TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h) AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
fi fi
@@ -1429,10 +1508,10 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
TOOLKIT=MSW TOOLKIT=MSW
GUIOBJS=MSW_GUIOBJS GUIOBJS="\$(MSW_GUIOBJS)"
GUIHEADERS=MSW_HEADERS GUIHEADERS="\$(MSW_HEADERS)"
COMMONOBJS=MSW_COMMONOBJS COMMONOBJS="\$(MSW_COMMONOBJS)"
GENERICOBJS=MSW_GENERICOBJS GENERICOBJS="\$(MSW_GENERICOBJS)"
UNIXOBJS= UNIXOBJS=
GUIDIST=MSW_DIST GUIDIST=MSW_DIST
PROGRAM_EXT=.exe PROGRAM_EXT=.exe
@@ -1450,14 +1529,14 @@ if test "$wxUSE_GTK" = 1; then
GUI_TK_LIBRARY="$GTK_LIBS" GUI_TK_LIBRARY="$GTK_LIBS"
TOOLKIT=GTK TOOLKIT=GTK
GUIHEADERS=GTK_HEADERS GUIOBJS="\$(GTK_GUIOBJS)"
GUIOBJS=GTK_GUIOBJS GUIHEADERS="\$(GTK_HEADERS)"
COMMONOBJS=GTK_COMMONOBJS COMMONOBJS="\$(GTK_COMMONOBJS)"
GENERICOBJS=GTK_GENERICOBJS GENERICOBJS="\$(GTK_GENERICOBJS)"
GUIDEPS=GTK_GUIDEPS GUIDEPS="\$(GTK_GUIDEPS)"
COMMONDEPS=GTK_COMMONDEPS COMMONDEPS="\$(GTK_COMMONDEPS)"
GENERICDEPS=GTK_GENERICDEPS GENERICDEPS="\$(GTK_GENERICDEPS)"
UNIXOBJS=UNIXOBJS UNIXOBJS="\$(UNIX_OBJS)"
GUIDIST=GTK_DIST GUIDIST=GTK_DIST
fi fi
@@ -1501,14 +1580,14 @@ if test "$wxUSE_WINE" = 1; then
WXWINE=1 WXWINE=1
TOOLKIT=MSW TOOLKIT=MSW
GUIHEADERS=MSW_HEADERS GUIHEADERS="\$(MSW_HEADERS)"
GUIOBJS=MSW_GUIOBJS GUIOBJS="\$(MSW_GUIOBJS)"
COMMONOBJS=MSW_COMMONOBJS COMMONOBJS="\$(MSW_COMMONOBJS)"
GENERICOBJS=MSW_GENERICOBJS GENERICOBJS="\$(MSW_GENERICOBJS)"
GUIDEPS=MSW_GUIDEPS GUIDEPS="\$(MSW_GUIDEPS)"
COMMONDEPS=MSW_COMMONDEPS COMMONDEPS="\$(MSW_COMMONDEPS)"
GENERICDEPS=MSW_GENERICDEPS GENERICDEPS="\$(MSW_GENERICDEPS)"
UNIXOBJS=UNIXOBJS UNIXOBJS="\$(UNIX_OBJS)"
GUIDIST=MSW_DIST GUIDIST=MSW_DIST
fi fi
@@ -1576,14 +1655,14 @@ if test "$wxUSE_MOTIF" = 1; then
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK" GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
TOOLKIT=MOTIF TOOLKIT=MOTIF
GUIHEADERS=MOTIF_HEADERS GUIHEADERS="\$(MOTIF_HEADERS)"
GUIOBJS=MOTIF_GUIOBJS GUIOBJS="\$(MOTIF_GUIOBJS)"
COMMONOBJS=MOTIF_COMMONOBJS COMMONOBJS="\$(MOTIF_COMMONOBJS)"
GENERICOBJS=MOTIF_GENERICOBJS GENERICOBJS="\$(MOTIF_GENERICOBJS)"
GUIDEPS=MOTIF_GUIDEPS GUIDEPS="\$(MOTIF_GUIDEPS)"
COMMONDEPS=MOTIF_COMMONDEPS COMMONDEPS="\$(MOTIF_COMMONDEPS)"
GENERICDEPS=MOTIF_GENERICDEPS GENERICDEPS="\$(MOTIF_GENERICDEPS)"
UNIXOBJS=UNIXOBJS UNIXOBJS="\$(UNIX_OBJS)"
GUIDIST=MOTIF_DIST GUIDIST=MOTIF_DIST
fi fi
@@ -1603,19 +1682,35 @@ TOOLKIT_DEF="-D__WX${TOOLKIT}__"
dnl the name of the (libtool) library dnl the name of the (libtool) library
WX_LIBRARY="wx_${TOOLKIT_DIR}" WX_LIBRARY="wx_${TOOLKIT_DIR}"
dnl the sources, their dependenices and the headers
ALL_OBJECTS="\$(GUIOBJS) \$(COMMONOBJS) \$(GENERICOBJS) \$(UNIXOBJS) \$(HTMLOBJS) \$(JPEGOBJS) \$(PNGOBJS) \$(ZLIBOBJS)"
ALL_DEPFILES="\$(GUIDEPS) \$(COMMONDEPS) \$(GENERICDEPS) \$(UNIXDEPS) \$(HTMLDEPS)"
ALL_HEADERS="\$(GUIHEADERS) \$(HTML_HEADERS) \$(UNIX_HEADERS) \$(PROTOCOL_HEADERS) \$(GENERIC_HEADERS) \$(WX_HEADERS)"
else
dnl leave all TOOLKIT_XXX vars empty
dnl the sources, their dependenices and the headers
ALL_OBJECTS="\$(BASE_OBJS)"
ALL_DEPFILES="\${BASE_DEPS}"
ALL_HEADERS="\${BASE_HEADERS}"
dnl building wxBase only
WX_LIBRARY="wxbase"
fi
dnl the name of the (libtool) library dnl the name of the (libtool) library
WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}.la" WX_LIBRARY_NAME="lib${WX_LIBRARY}.la"
dnl the name of the static library dnl the name of the static library
WX_LIBRARY_NAME_STATIC="libwx_${TOOLKIT_DIR}.a" WX_LIBRARY_NAME_STATIC="lib${WX_LIBRARY}.a"
dnl the name of the shared library dnl the name of the shared library
WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
dnl the name of the links to the shared library dnl the name of the links to the shared library
WX_LIBRARY_LINK1="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}" WX_LIBRARY_LINK1="lib${WX_LIBRARY}-${WX_RELEASE}.so.${WX_CURRENT}"
WX_LIBRARY_LINK2="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so" WX_LIBRARY_LINK2="lib${WX_LIBRARY}-${WX_RELEASE}.so"
WX_LIBRARY_LINK3="libwx_${TOOLKIT_DIR}.so" WX_LIBRARY_LINK3="lib${WX_LIBRARY}.so"
dnl shared library settings dnl shared library settings
SHARED_LD= SHARED_LD=
@@ -1725,8 +1820,11 @@ dnl defines HAVE_WCSTR_H
AC_CHECK_HEADERS(wcstr.h) AC_CHECK_HEADERS(wcstr.h)
dnl defines HAVE_FNMATCH_H dnl defines HAVE_FNMATCH_H
AC_CHECK_HEADERS(fnmatch.h) AC_CHECK_HEADERS(fnmatch.h)
dnl defines HAVE_X11_XKBLIB_H
AC_CHECK_HEADERS(X11/XKBlib.h) if test "$wxUSE_GUI" = "yes"; then
dnl defines HAVE_X11_XKBLIB_H
AC_CHECK_HEADERS(X11/XKBlib.h)
fi
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Checks for typedefs dnl Checks for typedefs
@@ -1863,6 +1961,9 @@ AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [
dnl check for uname (POSIX) and gethostname (BSD) dnl check for uname (POSIX) and gethostname (BSD)
AC_CHECK_FUNCS(uname gethostname, break) AC_CHECK_FUNCS(uname gethostname, break)
dnl check for MT-safe version of strtok
AC_CHECK_FUNCS(strtok_r)
dnl check for inet_addr, inet_aton, ... dnl check for inet_addr, inet_aton, ...
AC_CHECK_FUNCS(inet_addr) AC_CHECK_FUNCS(inet_addr)
AC_CHECK_FUNCS(inet_aton) AC_CHECK_FUNCS(inet_aton)
@@ -2051,10 +2152,10 @@ fi
DEP_INFO_FLAGS= DEP_INFO_FLAGS=
if test "$GCC" = yes ; then if test "$GCC" = yes ; then
if test "$wxUSE_NO_RTTI" = "yes" ; then if test "$wxUSE_NO_RTTI" = "yes" ; then
WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti" WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti"
fi fi
if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions" WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions"
fi fi
if test "$wxUSE_PERMISSIVE" = "yes" ; then if test "$wxUSE_PERMISSIVE" = "yes" ; then
CFLAGS="${CFLAGS} -fpermissive" CFLAGS="${CFLAGS} -fpermissive"
@@ -2312,9 +2413,9 @@ if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support") AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
wxUSE_ODBC=no wxUSE_ODBC=no
wxUSE_DYNLIB_CLASS=no wxUSE_DYNLIB_CLASS=no
else else
AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.") AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
fi fi
fi fi
fi fi
@@ -2429,13 +2530,13 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
if test "$wxUSE_GTK" = 1; then if test "$wxUSE_GTK" = 1; then
if test "$WXGTK12" != 1; then if test "$WXGTK12" != 1; then
AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2]) AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2])
wxUSE_DRAG_AND_DROP=no wxUSE_DRAG_AND_DROP=no
fi fi
fi fi
if test "$wxUSE_MOTIF" = 1; then if test "$wxUSE_MOTIF" = 1; then
AC_MSG_WARN([Drag and drop is not yet supported under Motif]) AC_MSG_WARN([Drag and drop is not yet supported under Motif])
wxUSE_DRAG_AND_DROP=no wxUSE_DRAG_AND_DROP=no
fi fi
if test "$wxUSE_DRAG_AND_DROP" = "yes"; then if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
@@ -2556,7 +2657,7 @@ if test "$wxUSE_STATLINE" = "yes"; then
if test "$wxUSE_WINE" = 1 ; then if test "$wxUSE_WINE" = 1 ; then
AC_MSG_WARN([wxStaticLine is not supported under WINE]) AC_MSG_WARN([wxStaticLine is not supported under WINE])
else else
AC_DEFINE(wxUSE_STATLINE) AC_DEFINE(wxUSE_STATLINE)
fi fi
fi fi
@@ -2672,16 +2773,13 @@ dnl ---------------------------------------------------------------------------
dnl Output the makefiles and such from the results found above dnl Output the makefiles and such from the results found above
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl if we add wxUSE_GUI in the future, it might be handy to separate the libs
dnl into GUI and non-GUI parts
GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK" GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK"
dnl all additional libraries (except wxWindows itself) we link with dnl all additional libraries (except wxWindows itself) we link with
EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $GUILIBS" EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK"
if test "$wxUSE_GUI" = "yes"; then
dnl all the libraries needed to link wxWindows programs (when the library is not EXTRA_LIBS="$EXTRA_LIBS $GUILIBS"
dnl yet installed) fi
LIBS="\${top_builddir}/src/${TOOLKIT_DIR}/${WX_LIBRARY_NAME} $EXTRA_LIBS"
dnl all the libraries needed to link wxWindows programs when using the dnl all the libraries needed to link wxWindows programs when using the
dnl makefile system without libtool dnl makefile system without libtool
@@ -2694,8 +2792,8 @@ dnl C/C++ compiler options used to compile wxWindows
if test "$GXX" = yes ; then if test "$GXX" = yes ; then
dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
CXXWARNINGS="-Wall" CXXWARNINGS="-Wall"
dnl there is one weird warning in docview.h:71 which prevents me from doing dnl FIXME: there is one weird warning in docview.h:71 which prevents me from
dnl this... dnl doing this... (VZ)
dnl CXXWARNINGS="-Wall -Werror" dnl CXXWARNINGS="-Wall -Werror"
fi fi
EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES" EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES"
@@ -2712,6 +2810,8 @@ if test "$wxUSE_GUI" = "yes"; then
dnl mfc, nativdlg, oleauto, ownerdrw, proplist dnl mfc, nativdlg, oleauto, ownerdrw, proplist
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \
forty fractal image wxpoem" forty fractal image wxpoem"
else
SAMPLES_SUBDIRS=""
fi fi
dnl for convenience, sort the samples in alphabetical order dnl for convenience, sort the samples in alphabetical order
@@ -2760,6 +2860,10 @@ AC_SUBST(GUIDEPS)
AC_SUBST(COMMONDEPS) AC_SUBST(COMMONDEPS)
AC_SUBST(GENERICDEPS) AC_SUBST(GENERICDEPS)
AC_SUBST(UNIXOBJS) AC_SUBST(UNIXOBJS)
AC_SUBST(UNIXDEPS)
AC_SUBST(ALL_OBJECTS)
AC_SUBST(ALL_DEPFILES)
AC_SUBST(ALL_HEADERS)
AC_SUBST(GUIDIST) AC_SUBST(GUIDIST)
dnl additional subdirectories where we will build dnl additional subdirectories where we will build
@@ -2797,9 +2901,9 @@ dnl (the original file name may be overriden by appending another name after a
dnl colon) dnl colon)
AC_OUTPUT([ AC_OUTPUT([
wx-config wx-config
src/make.env src/make.env
src/makeprog.env src/makeprog.env
src/makelib.env src/makelib.env
Makefile Makefile
samples/Makefile samples/Makefile
samples/bombs/Makefile samples/bombs/Makefile
@@ -2807,63 +2911,63 @@ AC_OUTPUT([
samples/checklst/Makefile samples/checklst/Makefile
samples/config/Makefile samples/config/Makefile
samples/controls/Makefile samples/controls/Makefile
samples/dialogs/Makefile samples/dialogs/Makefile
samples/docview/Makefile samples/docview/Makefile
samples/docvwmdi/Makefile samples/docvwmdi/Makefile
samples/dnd/Makefile samples/dnd/Makefile
samples/drawing/Makefile samples/drawing/Makefile
samples/dynamic/Makefile samples/dynamic/Makefile
samples/image/Makefile samples/image/Makefile
samples/internat/Makefile samples/internat/Makefile
samples/layout/Makefile samples/layout/Makefile
samples/listctrl/Makefile samples/listctrl/Makefile
samples/mdi/Makefile samples/mdi/Makefile
samples/minifram/Makefile samples/minifram/Makefile
samples/minimal/Makefile samples/minimal/Makefile
samples/notebook/Makefile samples/notebook/Makefile
samples/printing/Makefile samples/printing/Makefile
samples/proplist/Makefile samples/proplist/Makefile
samples/sashtest/Makefile samples/sashtest/Makefile
samples/scroll/Makefile samples/scroll/Makefile
samples/splitter/Makefile samples/splitter/Makefile
samples/text/Makefile samples/text/Makefile
samples/thread/Makefile samples/thread/Makefile
samples/toolbar/Makefile samples/toolbar/Makefile
samples/treectrl/Makefile samples/treectrl/Makefile
samples/typetest/Makefile samples/typetest/Makefile
samples/validate/Makefile samples/validate/Makefile
samples/wxpoem/Makefile samples/wxpoem/Makefile
samples/wxsocket/Makefile samples/wxsocket/Makefile
samples/wizard/Makefile samples/wizard/Makefile
samples/html/Makefile samples/html/Makefile
samples/html/about/Makefile samples/html/about/Makefile
samples/html/help/Makefile samples/html/help/Makefile
samples/html/printing/Makefile samples/html/printing/Makefile
samples/html/test/Makefile samples/html/test/Makefile
samples/html/zip/Makefile samples/html/zip/Makefile
samples/html/virtual/Makefile samples/html/virtual/Makefile
samples/html/widget/Makefile samples/html/widget/Makefile
utils/Makefile utils/Makefile
utils/wxMMedia2/Makefile utils/wxMMedia2/Makefile
utils/wxMMedia2/lib/Makefile utils/wxMMedia2/lib/Makefile
utils/wxMMedia2/sample/Makefile utils/wxMMedia2/sample/Makefile
utils/glcanvas/Makefile utils/glcanvas/Makefile
utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile
utils/ogl/Makefile utils/ogl/Makefile
utils/ogl/src/Makefile utils/ogl/src/Makefile
], ],
[ [
chmod +x wx-config chmod +x wx-config
if test ! -d include; then if test ! -d include; then
mkdir include mkdir include
fi fi
if test ! -d include/wx; then if test ! -d include/wx; then
mkdir include/wx mkdir include/wx
fi fi
if test ! -d include/wx/${TOOLKIT_DIR}; then if test ! -d include/wx/${TOOLKIT_DIR}; then
mkdir include/wx/${TOOLKIT_DIR} mkdir include/wx/${TOOLKIT_DIR}
fi fi
cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
], ],
[ [
LN_S="${ac_cv_prog_LN_S}" LN_S="${ac_cv_prog_LN_S}"

View File

@@ -28,6 +28,7 @@
# compiler, &c) # compiler, &c)
# #
# Known flags: # Known flags:
# B makes part of the base library too
# 16 a generic file implementing Win32 control for Win16 # 16 a generic file implementing Win32 control for Win16
# 32 only can be compiled under Win32 # 32 only can be compiled under Win32
# PS PostScript related file, normally not compiled under Windows # PS PostScript related file, normally not compiled under Windows
@@ -37,6 +38,7 @@
# S Socket file (currently doesn't compile under Win16 nor with GNU) # S Socket file (currently doesn't compile under Win16 nor with GNU)
# R Not required for the GTK port # R Not required for the GTK port
# X Not required for the Motif port # X Not required for the Motif port
#
# WX Base header # WX Base header
# GTK GTK header # GTK GTK header
# MSW MSW header # MSW MSW header
@@ -90,9 +92,9 @@ wizard.cpp G
choiccmn.cpp C R choiccmn.cpp C R
cmndata.cpp C cmndata.cpp C
config.cpp C config.cpp C B
ctrlcmn.cpp C R ctrlcmn.cpp C R
date.cpp C date.cpp C B
datstrm.cpp C datstrm.cpp C
db.cpp C db.cpp C
dbtable.cpp C dbtable.cpp C
@@ -100,15 +102,15 @@ dcbase.cpp C
dlgcmn.cpp C dlgcmn.cpp C
docmdi.cpp C docmdi.cpp C
docview.cpp C docview.cpp C
dynarray.cpp C dynarray.cpp C B
dynlib.cpp C dynlib.cpp C B
event.cpp C event.cpp C
extended.c C extended.c C B
ffile.cpp C ffile.cpp C B
file.cpp C file.cpp C B
fileconf.cpp C fileconf.cpp C B
filefn.cpp C filefn.cpp C B
filesys.cpp C filesys.cpp C B
fontcmn.cpp C fontcmn.cpp C
framecmn.cpp C framecmn.cpp C
fs_inet.cpp C fs_inet.cpp C
@@ -116,7 +118,7 @@ fs_zip.cpp C
ftp.cpp C S ftp.cpp C S
gdicmn.cpp C gdicmn.cpp C
gifdecod.cpp C gifdecod.cpp C
hash.cpp C hash.cpp C B
helpbase.cpp C helpbase.cpp C
http.cpp C S http.cpp C S
imagbmp.cpp C imagbmp.cpp C
@@ -127,21 +129,21 @@ imagjpeg.cpp C 32
imagpcx.cpp C 32 imagpcx.cpp C 32
imagpng.cpp C 32 imagpng.cpp C 32
imagpnm.cpp C 32 imagpnm.cpp C 32
intl.cpp C intl.cpp C B
ipcbase.cpp C ipcbase.cpp C
layout.cpp C layout.cpp C
list.cpp C list.cpp C B
log.cpp C log.cpp C B
memory.cpp C memory.cpp C
mimetype.cpp C 32 mimetype.cpp C 32,B
module.cpp C module.cpp C B
mstream.cpp C mstream.cpp C
object.cpp C object.cpp C B
objstrm.cpp C objstrm.cpp C
odbc.cpp C R odbc.cpp C R
paper.cpp C paper.cpp C
prntbase.cpp C prntbase.cpp C
process.cpp C 32 process.cpp C 32,B
protocol.cpp C S protocol.cpp C S
resource.cpp C resource.cpp C
sckaddr.cpp C S sckaddr.cpp C S
@@ -152,26 +154,26 @@ serbase.cpp C
sizer.cpp C sizer.cpp C
socket.cpp C S socket.cpp C S
stream.cpp C stream.cpp C
strconv.cpp C strconv.cpp C B
string.cpp C string.cpp C B
tbarbase.cpp C tbarbase.cpp C
tbarsmpl.cpp C tbarsmpl.cpp C
textcmn.cpp C textcmn.cpp C
textfile.cpp C textfile.cpp C B
time.cpp C time.cpp C B
timercmn.cpp C timercmn.cpp C B
tokenzr.cpp C tokenzr.cpp C B
txtstrm.cpp C txtstrm.cpp C
unzip.c C unzip.c C
url.cpp C S url.cpp C S
utilscmn.cpp C utilscmn.cpp C B
valgen.cpp C valgen.cpp C
validate.cpp C validate.cpp C
valtext.cpp C valtext.cpp C
variant.cpp C variant.cpp C B
wfstream.cpp C wfstream.cpp C
wincmn.cpp C wincmn.cpp C
wxchar.cpp C wxchar.cpp C B
wxexpr.cpp C wxexpr.cpp C
zipstrm.cpp C zipstrm.cpp C
zstream.cpp C zstream.cpp C
@@ -272,6 +274,7 @@ window.cpp M
xpmhand.cpp M xpmhand.cpp M
gsocket.c M S gsocket.c M S
dialup.cpp U
threadpsx.cpp U threadpsx.cpp U
utilsunx.cpp U utilsunx.cpp U
gsocket.c U gsocket.c U

View File

@@ -116,6 +116,7 @@ combined base/GUI library for GUI applications only.
<li>Release date: c. July 2nd, 2000 <li>Release date: c. July 2nd, 2000
<li>Unicode compilation working in wxGTK and wxMSW. <li>Unicode compilation working in wxGTK and wxMSW.
<li>wxDateTime class. <li>wxDateTime class.
<li>Regular expressions support.
</ul> </ul>
<P> <P>

View File

@@ -37,7 +37,9 @@
#include "wx/event.h" // for the base class #include "wx/event.h" // for the base class
#include "wx/window.h" // for wxTopLevelWindows #if wxUSE_GUI
#include "wx/window.h" // for wxTopLevelWindows
#endif // wxUSE_GUI
#if wxUSE_LOG #if wxUSE_LOG
#include "wx/log.h" #include "wx/log.h"
@@ -64,22 +66,33 @@ public:
// prevents the program from continuing - it's a good place to create // prevents the program from continuing - it's a good place to create
// the top level program window and return TRUE. // the top level program window and return TRUE.
// //
// Override: always. // Override: always in GUI application, rarely in console ones.
#if wxUSE_GUI
virtual bool OnInit() { return FALSE; }; virtual bool OnInit() { return FALSE; };
#else // !GUI
virtual bool OnInit() { return TRUE; };
#endif // wxUSE_GUI
#if wxUSE_GUI
// a platform-dependent version of OnInit(): the code here is likely to // a platform-dependent version of OnInit(): the code here is likely to
// depend on the toolkit. default version does nothing. // depend on the toolkit. default version does nothing.
// //
// Override: rarely. // Override: rarely.
virtual bool OnInitGui() { return TRUE; } virtual bool OnInitGui() { return TRUE; }
#endif // wxUSE_GUI
// called to start program execution - the default version just enters // called to start program execution - the default version just enters
// the main GUI loop in which events are received and processed until // the main GUI loop in which events are received and processed until
// the last window is not deleted (if GetExitOnFrameDelete) or // the last window is not deleted (if GetExitOnFrameDelete) or
// ExitMainLoop() is called. // ExitMainLoop() is called. In console mode programs, the execution
// of the program really starts here
// //
// Override: rarely. // Override: rarely in GUI applications, always in console ones.
#if wxUSE_GUI
virtual int OnRun() { return MainLoop(); }; virtual int OnRun() { return MainLoop(); };
#else // !GUI
virtual int OnRun() = 0;
#endif // wxUSE_GUI
// called after the main loop termination. This is a good place for // called after the main loop termination. This is a good place for
// cleaning up (it may be too late in dtor) and is also useful if you // cleaning up (it may be too late in dtor) and is also useful if you
@@ -102,6 +115,7 @@ public:
// the worker functions - usually not used directly by the user code // the worker functions - usually not used directly by the user code
// ----------------------------------------------------------------- // -----------------------------------------------------------------
#if wxUSE_GUI
// execute the main GUI loop, the function returns when the loop ends // execute the main GUI loop, the function returns when the loop ends
virtual int MainLoop() = 0; virtual int MainLoop() = 0;
@@ -118,6 +132,7 @@ public:
// process the first event in the event queue (blocks until an event // process the first event in the event queue (blocks until an event
// apperas if there are none currently) // apperas if there are none currently)
virtual void Dispatch() = 0; virtual void Dispatch() = 0;
#endif // wxUSE_GUI
// application info: name, description, vendor // application info: name, description, vendor
// ------------------------------------------- // -------------------------------------------
@@ -144,6 +159,7 @@ public:
const wxString& GetVendorName() const { return m_vendorName; } const wxString& GetVendorName() const { return m_vendorName; }
void SetVendorName(const wxString& name) { m_vendorName = name; } void SetVendorName(const wxString& name) { m_vendorName = name; }
#if wxUSE_GUI
// top level window functions // top level window functions
// -------------------------- // --------------------------
@@ -171,6 +187,8 @@ public:
void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; } void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; } bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
#endif // wxUSE_GUI
// miscellaneous customization functions // miscellaneous customization functions
// ------------------------------------- // -------------------------------------
@@ -179,10 +197,15 @@ public:
// user-defined class (default implementation creates a wxLogGui // user-defined class (default implementation creates a wxLogGui
// object) - this log object is used by default by all wxLogXXX() // object) - this log object is used by default by all wxLogXXX()
// functions. // functions.
virtual wxLog *CreateLogTarget() { return new wxLogGui; } virtual wxLog *CreateLogTarget()
#if wxUSE_GUI
{ return new wxLogGui; }
#else // !GUI
{ return new wxLogStderr; }
#endif // wxUSE_GUI
#endif // wxUSE_LOG #endif // wxUSE_LOG
#if wxUSE_GUI
// get the standard icon used by wxWin dialogs - this allows the user // get the standard icon used by wxWin dialogs - this allows the user
// to customize the standard dialogs. The 'which' parameter is one of // to customize the standard dialogs. The 'which' parameter is one of
// wxICON_XXX values // wxICON_XXX values
@@ -198,6 +221,7 @@ public:
// printing. // printing.
virtual void SetPrintMode(int WXUNUSED(mode)) { } virtual void SetPrintMode(int WXUNUSED(mode)) { }
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; } int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
#endif // wxUSE_GUI
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------
@@ -228,29 +252,35 @@ protected:
// TRUE if the application wants to get debug output // TRUE if the application wants to get debug output
bool m_wantDebugOutput; bool m_wantDebugOutput;
#if wxUSE_GUI
// the main top level window - may be NULL // the main top level window - may be NULL
wxWindow *m_topWindow; wxWindow *m_topWindow;
#endif // wxUSE_GUI
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// now include the declaration of the real class // now include the declaration of the real class
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if defined(__WXMSW__) #if wxUSE_GUI
#include "wx/msw/app.h" #if defined(__WXMSW__)
#elif defined(__WXMOTIF__) #include "wx/msw/app.h"
#include "wx/motif/app.h" #elif defined(__WXMOTIF__)
#elif defined(__WXQT__) #include "wx/motif/app.h"
#include "wx/qt/app.h" #elif defined(__WXQT__)
#elif defined(__WXGTK__) #include "wx/qt/app.h"
#include "wx/gtk/app.h" #elif defined(__WXGTK__)
#elif defined(__WXMAC__) #include "wx/gtk/app.h"
#include "wx/mac/app.h" #elif defined(__WXMAC__)
#elif defined(__WXPM__) #include "wx/mac/app.h"
#include "wx/os2/app.h" #elif defined(__WXPM__)
#elif defined(__WXSTUBS__) #include "wx/os2/app.h"
#include "wx/stubs/app.h" #elif defined(__WXSTUBS__)
#endif #include "wx/stubs/app.h"
#endif
#else // !GUI
typedef wxAppBase wxApp;
#endif // GUI/!GUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// the global data // the global data
@@ -266,11 +296,34 @@ WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
// global functions // global functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// event loop related functions only work in GUI programs
// ------------------------------------------------------
#if wxUSE_GUI
// Force an exit from main loop // Force an exit from main loop
void WXDLLEXPORT wxExit(); extern void WXDLLEXPORT wxExit();
// Yield to other apps/messages // Yield to other apps/messages
bool WXDLLEXPORT wxYield(); extern bool WXDLLEXPORT wxYield();
#endif // wxUSE_GUI
// console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros
// and call these functions instead at the program startup and termination
// -------------------------------------------------------------------------
#if wxUSE_NOGUI
// initialize the library (may be called as many times as needed, but each
// call to wxInitialize() must be matched by wxUninitialize())
extern bool WXDLLEXPORT wxInitialize();
// clean up - the library can't be used any more after the last call to
// wxUninitialize()
extern void WXDLLEXPORT wxUninitialize();
#endif // wxUSE_NOGUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// macros for dynamic creation of the application object // macros for dynamic creation of the application object

View File

@@ -2,7 +2,7 @@
// Name: listimpl.cpp // Name: listimpl.cpp
// Purpose: helper file for implementation of dynamic lists // Purpose: helper file for implementation of dynamic lists
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
// Created: 16.10.97 // Created: 16.10.97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> // Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
@@ -20,6 +20,9 @@
* 4) WX_DEFINE_OBJARRAY * * 4) WX_DEFINE_OBJARRAY *
*****************************************************************************/ *****************************************************************************/
// needed to resolve the conflict between global T and macro parameter T
#define _WX_ERROR_REMOVE2(x) T("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)
#undef _DEFINE_OBJARRAY #undef _DEFINE_OBJARRAY
@@ -58,7 +61,7 @@ void name::Empty() \
\ \
void name::Remove(size_t uiIndex) \ void name::Remove(size_t uiIndex) \
{ \ { \
wxCHECK_RET( uiIndex < Count(), _T("bad index in " #name "::Remove()") ); \ wxCHECK_RET( uiIndex < Count(), _WX_ERROR_REMOVE2(name) ); \
\ \
delete (T*)wxBaseArray::Item(uiIndex); \ delete (T*)wxBaseArray::Item(uiIndex); \
\ \
@@ -99,8 +102,8 @@ int name::Index(const T& Item, bool bFromEnd) const \
} \ } \
} \ } \
\ \
return wxNOT_FOUND; \ return wxNOT_FOUND; \
} }
// redefine the macro so that now it will generate the class implementation // redefine the macro so that now it will generate the class implementation
// old value would provoke a compile-time error if this file is not included // old value would provoke a compile-time error if this file is not included

View File

@@ -15,6 +15,7 @@
#define _WX_BUFFER_H #define _WX_BUFFER_H
#include "wx/wxchar.h" #include "wx/wxchar.h"
#include <string.h> // strdup #include <string.h> // strdup
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -27,14 +28,14 @@ class wxCharBuffer
public: public:
wxCharBuffer(const char *str) wxCharBuffer(const char *str)
{ {
wxASSERT_MSG( str, _T("NULL string in wxCharBuffer") ); wxASSERT_MSG( str, T("NULL string in wxCharBuffer") );
m_str = str ? strdup(str) : (char *)NULL; m_str = str ? strdup(str) : (char *)NULL;
} }
wxCharBuffer(size_t len) wxCharBuffer(size_t len)
{ {
m_str = (char *)malloc(len+1); m_str = (char *)malloc(len+1);
m_str[len] = '\0'; m_str[len] = '\0';
} }
// no need to check for NULL, free() does it // no need to check for NULL, free() does it
~wxCharBuffer() { free(m_str); } ~wxCharBuffer() { free(m_str); }
@@ -66,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, T("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);
@@ -78,7 +79,7 @@ public:
wxWCharBuffer(size_t len) wxWCharBuffer(size_t len)
{ {
m_wcs = (wchar_t *)malloc((len+1)*sizeof(wchar_t)); m_wcs = (wchar_t *)malloc((len+1)*sizeof(wchar_t));
m_wcs[len] = L'\0'; m_wcs[len] = L'\0';
} }
// no need to check for NULL, free() does it // no need to check for NULL, free() does it
@@ -100,23 +101,23 @@ public:
operator const wchar_t *() const { return m_wcs; } operator const wchar_t *() const { return m_wcs; }
wchar_t operator[](size_t n) const { return m_wcs[n]; } wchar_t operator[](size_t n) const { return m_wcs[n]; }
private: private:
wchar_t *m_wcs; wchar_t *m_wcs;
}; };
#endif #endif
#if wxUSE_UNICODE #if wxUSE_UNICODE
#define wxMB2WXbuf wxWCharBuffer #define wxMB2WXbuf wxWCharBuffer
#define wxWX2MBbuf wxCharBuffer #define wxWX2MBbuf wxCharBuffer
#define wxWC2WXbuf wxChar* #define wxWC2WXbuf wxChar*
#define wxWX2WCbuf wxChar* #define wxWX2WCbuf wxChar*
#else #else // ANSI
#define wxMB2WXbuf wxChar* #define wxMB2WXbuf wxChar*
#define wxWX2MBbuf wxChar* #define wxWX2MBbuf wxChar*
#define wxWC2WXbuf wxCharBuffer #define wxWC2WXbuf wxCharBuffer
#define wxWX2WCbuf wxWCharBuffer #define wxWX2WCbuf wxWCharBuffer
#endif #endif // Unicode/ANSI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// template class for any kind of data // template class for any kind of data

View File

@@ -1,12 +1,12 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: debug.h // Name: wx/debug.h
// Purpose: Misc debug functions and macros // Purpose: Misc debug functions and macros
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
// Created: 29/01/98 // Created: 29/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DEBUG_H_ #ifndef _WX_DEBUG_H_
@@ -16,24 +16,19 @@
#include "wx/wxchar.h" #include "wx/wxchar.h"
#ifndef __TFILE__
#define __XFILE__(x) _T(x)
#define __TFILE__ __XFILE__(__FILE__)
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** /**
@name Debugging macros @name Debugging macros
All debugging macros rely on ASSERT() which in turn calls user-defined All debugging macros rely on ASSERT() which in turn calls user-defined
OnAssert() function. To keep things simple, it's called even when the OnAssert() function. To keep things simple, it's called even when the
expression is TRUE (i.e. everything is ok) and by default does nothing: just expression is TRUE (i.e. everything is ok) and by default does nothing: just
returns the same value back. But if you redefine it to do something more sexy returns the same value back. But if you redefine it to do something more sexy
(popping up a message box in your favourite GUI, sending you e-mail or (popping up a message box in your favourite GUI, sending you e-mail or
whatever) it will affect all ASSERTs, FAILs and CHECKs in your code. whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.
<BR> <BR>
<BR> <BR>
<b>Warning</b>: if you don't like advices on programming style, don't read <b>Warning</b>: if you don't like advices on programming style, don't read
further! ;-) further! ;-)
<BR> <BR>
<BR> <BR>
@@ -94,13 +89,13 @@
// NB: these macros work also in release mode! // NB: these macros work also in release mode!
/** /**
These macros must be used only in invalid situation: for example, an These macros must be used only in invalid situation: for example, an
invalid parameter (NULL pointer) is passed to a function. Instead of invalid parameter (NULL pointer) is passed to a function. Instead of
dereferencing it and causing core dump the function might try using dereferencing it and causing core dump the function might try using
CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") ) CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") )
@name Macros which remain even in 'release' mode @name Macros which remain even in 'release' mode
*/ */
//@{ //@{
/// check that expression is true, "return" if not (also FAILs in debug mode) /// check that expression is true, "return" if not (also FAILs in debug mode)

View File

@@ -115,13 +115,11 @@
# pragma suppress 571 // Virtual function hiding # pragma suppress 571 // Virtual function hiding
#endif // __SALFORDC__ #endif // __SALFORDC__
#ifdef __VISUALC__ #if defined(__VISUALC__) && !defined(WIN32)
#ifndef WIN32 // VC1.5 does not have LPTSTR type
// VC1.5 does not have LPTSTR type #define LPTSTR LPSTR
#define LPTSTR LPSTR #define LPCTSTR LPCSTR
#define LPCTSTR LPCSTR #endif // VC++ 1.5
#endif
#endif
// Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files, // Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
// so define it ourselves // so define it ourselves
@@ -190,8 +188,9 @@
// Make sure the environment is set correctly // Make sure the environment is set correctly
#if defined(__WXMSW__) && defined(__X__) #if defined(__WXMSW__) && defined(__X__)
#error "Target can't be both X and Windows" #error "Target can't be both X and Windows"
#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXPM__) && \ #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
!defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__) !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
!defined(__WXQT__) && !defined(__WXSTUBS__) && wxUSE_GUI
#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]" #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]"
#endif #endif
@@ -215,6 +214,17 @@
#include "wx/version.h" #include "wx/version.h"
// ----------------------------------------------------------------------------
// compatibility defines
// ----------------------------------------------------------------------------
// possibility to build non GUI apps is new, so don't burden ourselves with
// compatibility code
#if !wxUSE_GUI
#undef WXWIN_COMPATIBILITY_2
#define WXWIN_COMPATIBILITY_2 0
#endif // !GUI
// ============================================================================ // ============================================================================
// non portable C++ features // non portable C++ features
// ============================================================================ // ============================================================================
@@ -223,21 +233,14 @@
// check for native bool type and TRUE/FALSE constants // check for native bool type and TRUE/FALSE constants
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXPM__) || defined(__WXSTUBS__) // define boolean constants if not done yet
// Bool is now obsolete, use bool instead #ifndef TRUE
// typedef int Bool; #define TRUE 1
#endif
#ifndef TRUE #ifndef FALSE
#define TRUE 1 #define FALSE 0
#define FALSE 0 #endif
#define Bool_DEFINED
#endif
#elif defined(__WXMSW__)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#endif // TRUE/FALSE
// Add more tests here for Windows compilers that already define bool // Add more tests here for Windows compilers that already define bool
// (under Unix, configure tests for this) // (under Unix, configure tests for this)

View File

@@ -24,7 +24,7 @@
extern const wxChar *wxEmptyString; extern const wxChar *wxEmptyString;
#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST _T("www.yahoo.com") #define WXDIALUP_MANAGER_DEFAULT_BEACONHOST T("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
@@ -78,7 +78,7 @@ public:
bool async = TRUE) = 0; bool async = TRUE) = 0;
// returns TRUE if (async) dialing is in progress // returns TRUE if (async) dialing is in progress
virtual bool IsDialling() const = 0; virtual bool IsDialing() const = 0;
// cancel dialing the number initiated with Dial(async = TRUE) // cancel dialing the number initiated with Dial(async = TRUE)
// NB: this won't result in DISCONNECTED event being sent // NB: this won't result in DISCONNECTED event being sent
@@ -129,8 +129,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 = T("/usr/bin/pon"),
const wxString& commandHangup = _T("/usr/bin/poff")) = 0; const wxString& commandHangup = T("/usr/bin/poff")) = 0;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -151,6 +151,11 @@ private:
// template classes // template classes
// ============================================================================ // ============================================================================
// resolves the name conflict between the T() macor and T typedef: we can't
// use T() inside WX_DEFINE_ARRAY!
#define _WX_ERROR_SIZEOF T("illegal use of DEFINE_ARRAY")
#define _WX_ERROR_REMOVE T("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
// types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long) // types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
@@ -170,7 +175,7 @@ public: \
size_t type = sizeof(T); \ size_t type = sizeof(T); \
size_t sizelong = sizeof(long); \ size_t sizelong = sizeof(long); \
if ( type > sizelong ) \ if ( type > sizelong ) \
{ wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ { wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \
} \ } \
\ \
name& operator=(const name& src) \ name& operator=(const name& src) \
@@ -197,7 +202,7 @@ public: \
void Remove(T Item) \ void Remove(T Item) \
{ int iIndex = Index(Item); \ { int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \
_T("removing inexisting element in wxArray::Remove") ); \ _WX_ERROR_REMOVE); \
wxBaseArray::Remove((size_t)iIndex); } \ wxBaseArray::Remove((size_t)iIndex); } \
\ \
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
@@ -232,7 +237,7 @@ public: \
{ size_t type = sizeof(T); \ { size_t type = sizeof(T); \
size_t sizelong = sizeof(long); \ size_t sizelong = sizeof(long); \
if ( type > sizelong ) \ if ( type > sizelong ) \
{ wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ { wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \
m_fnCompare = fn; \ m_fnCompare = fn; \
} \ } \
\ \
@@ -259,7 +264,7 @@ public: \
void Remove(T Item) \ void Remove(T Item) \
{ int iIndex = Index(Item); \ { int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \
_T("removing inexisting element in wxArray::Remove") ); \ _WX_ERROR_REMOVE ); \
wxBaseArray::Remove((size_t)iIndex); } \ wxBaseArray::Remove((size_t)iIndex); } \
\ \
private: \ private: \

View File

@@ -18,16 +18,30 @@
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/object.h" #include "wx/object.h"
#include "wx/gdicmn.h"
#if wxUSE_GUI
#include "wx/gdicmn.h"
#endif
#if wxUSE_THREADS #if wxUSE_THREADS
#include "wx/thread.h" #include "wx/thread.h"
#endif #endif
/* // ----------------------------------------------------------------------------
* Event types // forward declarations
* // ----------------------------------------------------------------------------
*/
class WXDLLEXPORT wxList;
#if wxUSE_GUI
class WXDLLEXPORT wxClientData;
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMenu;
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// Event types
// ----------------------------------------------------------------------------
typedef int wxEventType; typedef int wxEventType;
@@ -336,6 +350,8 @@ public:
bool m_isCommandEvent; bool m_isCommandEvent;
}; };
#if wxUSE_GUI
// Item or menu event class // Item or menu event class
/* /*
wxEVT_COMMAND_BUTTON_CLICKED wxEVT_COMMAND_BUTTON_CLICKED
@@ -354,8 +370,6 @@ public:
wxEVT_COMMAND_COMBOBOX_SELECTED wxEVT_COMMAND_COMBOBOX_SELECTED
*/ */
class WXDLLEXPORT wxClientData;
class WXDLLEXPORT wxCommandEvent : public wxEvent class WXDLLEXPORT wxCommandEvent : public wxEvent
{ {
DECLARE_DYNAMIC_CLASS(wxCommandEvent) DECLARE_DYNAMIC_CLASS(wxCommandEvent)
@@ -523,7 +537,6 @@ public:
wxEVT_NC_RIGHT_DCLICK, wxEVT_NC_RIGHT_DCLICK,
*/ */
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMouseEvent : public wxEvent class WXDLLEXPORT wxMouseEvent : public wxEvent
{ {
DECLARE_DYNAMIC_CLASS(wxMouseEvent) DECLARE_DYNAMIC_CLASS(wxMouseEvent)
@@ -764,7 +777,6 @@ public:
wxEVT_ERASE_BACKGROUND wxEVT_ERASE_BACKGROUND
*/ */
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxEraseEvent : public wxEvent class WXDLLEXPORT wxEraseEvent : public wxEvent
{ {
DECLARE_DYNAMIC_CLASS(wxEraseEvent) DECLARE_DYNAMIC_CLASS(wxEraseEvent)
@@ -884,7 +896,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)") ); T("call to Veto() ignored (can't veto this event)") );
m_veto = veto; m_veto = veto;
} }
@@ -1069,36 +1081,11 @@ public:
void CopyObject(wxObject& obj) const; void CopyObject(wxObject& obj) const;
}; };
// Idle event
/*
wxEVT_IDLE
*/
class WXDLLEXPORT wxIdleEvent : public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxIdleEvent)
public:
wxIdleEvent()
{ m_eventType = wxEVT_IDLE; m_requestMore = FALSE; }
void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; }
bool MoreRequested() const { return m_requestMore; }
void CopyObject(wxObject& obj) const;
protected:
bool m_requestMore;
};
// Update UI event // Update UI event
/* /*
wxEVT_UPDATE_UI wxEVT_UPDATE_UI
*/ */
class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxUpdateUIEvent : public wxCommandEvent class WXDLLEXPORT wxUpdateUIEvent : public wxCommandEvent
{ {
DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent) DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent)
@@ -1256,6 +1243,30 @@ public:
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
}; };
#endif // wxUSE_GUI
// Idle event
/*
wxEVT_IDLE
*/
class WXDLLEXPORT wxIdleEvent : public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxIdleEvent)
public:
wxIdleEvent()
{ m_eventType = wxEVT_IDLE; m_requestMore = FALSE; }
void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; }
bool MoreRequested() const { return m_requestMore; }
void CopyObject(wxObject& obj) const;
protected:
bool m_requestMore;
};
/* TODO /* TODO
wxEVT_POWER, wxEVT_POWER,
wxEVT_MOUSE_CAPTURE_CHANGED, wxEVT_MOUSE_CAPTURE_CHANGED,
@@ -1267,11 +1278,6 @@ public:
wxEVT_COMPARE_ITEM wxEVT_COMPARE_ITEM
*/ */
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxControl;
// struct WXDLLEXPORT wxEventTableEntry;
typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); typedef void (wxObject::*wxObjectEventFunction)(wxEvent&);
struct WXDLLEXPORT wxEventTableEntry struct WXDLLEXPORT wxEventTableEntry
@@ -1312,7 +1318,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(T("shouldn't be called any more"));
} }
// Called if child control has no callback function // Called if child control has no callback function
@@ -1373,6 +1379,7 @@ protected:
}; };
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
#if wxUSE_GUI
typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&); typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&);
typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&); typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&);
typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&); typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&);
@@ -1398,6 +1405,7 @@ typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&);
typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&); typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&); typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&); typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
#endif // wxUSE_GUI
// N.B. In GNU-WIN32, you *have* to take the address of a member function // N.B. In GNU-WIN32, you *have* to take the address of a member function
// (use &) or the compiler crashes... // (use &) or the compiler crashes...
@@ -1603,13 +1611,17 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define EVT_UPDATE_UI(id, func) \ #define EVT_UPDATE_UI(id, func) \
{ wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\ { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
/* // ----------------------------------------------------------------------------
* Helper functions // Helper functions
*/ // ----------------------------------------------------------------------------
#if wxUSE_GUI
// Find a window with the focus, that is also a descendant of the given window. // Find a window with the focus, that is also a descendant of the given window.
// This is used to determine the window to initially send commands to. // This is used to determine the window to initially send commands to.
wxWindow* wxFindFocusDescendant(wxWindow* ancestor); wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
#endif // wxUSE_GUI
#endif #endif
// _WX_EVENTH__ // _WX_EVENTH__

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 = T(""))
{ 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 = T(""),
const wxString& localFilename = _T(""), const wxString& localFilename = T(""),
const wxString& globalFilename = _T(""), const wxString& globalFilename = T(""),
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 T('.')
#define wxFILE_SEP_DSK _T(':') #define wxFILE_SEP_DSK T(':')
#define wxFILE_SEP_PATH_DOS _T('\\') #define wxFILE_SEP_PATH_DOS T('\\')
#define wxFILE_SEP_PATH_UNIX _T('/') #define wxFILE_SEP_PATH_UNIX T('/')
// 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 T(";")
#define wxPATH_SEP_UNIX _T(":") #define wxPATH_SEP_UNIX T(":")
// 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 = T(""));
// 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 = T("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 = T(""));
/* 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 = T("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

@@ -121,8 +121,12 @@ class wxMDIChildFrame: public wxFrame
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
// no status bars // no status bars
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } long WXUNUSED(style) = 1,
wxWindowID WXUNUSED(id) = 1,
const wxString& WXUNUSED(name) = wxEmptyString)
{ return (wxStatusBar*)NULL; }
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}

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 = T("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

@@ -121,8 +121,12 @@ class wxMDIChildFrame: public wxFrame
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
// no status bars // no status bars
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } long WXUNUSED(style) = 1,
wxWindowID WXUNUSED(id) = 1,
const wxString& WXUNUSED(name) = wxEmptyString)
{ return (wxStatusBar*)NULL; }
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}

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(T(str))
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -53,8 +53,8 @@ class WXDLLEXPORT wxConnectionBase: public wxObject
inline ~wxConnectionBase(void) {} inline ~wxConnectionBase(void) {}
// Calls that CLIENT can make // Calls that CLIENT can make
virtual bool Execute(wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0; virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0;
virtual bool Execute(const wxString& str) { return Execute(WXSTRINGCAST str, -1, wxIPC_TEXT); } virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); }
virtual char *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0; virtual char *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0;
virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0; virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
virtual bool StartAdvise(const wxString& item) = 0; virtual bool StartAdvise(const wxString& item) = 0;

View File

@@ -245,7 +245,7 @@ protected:
// GUI part (andnot just the base one) of the library, they're implemented in // GUI part (andnot just the base one) of the library, they're implemented in
// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest) // src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest)
#ifndef wxUSE_NOGUI #if wxUSE_GUI
// log everything to a text window (GUI only of course) // log everything to a text window (GUI only of course)
class WXDLLEXPORT wxLogTextCtrl : public wxLog class WXDLLEXPORT wxLogTextCtrl : public wxLog
@@ -338,7 +338,7 @@ private:
wxLogFrame *m_pLogFrame; // the log frame wxLogFrame *m_pLogFrame; // the log frame
}; };
#endif // wxUSE_NOGUI #endif // wxUSE_GUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// /dev/null log target: suppress logging until this object goes out of scope // /dev/null log target: suppress logging until this object goes out of scope
@@ -464,7 +464,7 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef __TFILE__ #ifndef __TFILE__
#define __XFILE__(x) _T(x) #define __XFILE__(x) Tx)
#define __TFILE__ __XFILE__(__FILE__) #define __TFILE__ __XFILE__(__FILE__)
#endif #endif
@@ -473,12 +473,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(T("%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(T("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

@@ -110,7 +110,7 @@ class WXDLLEXPORT wxClipboardClient : public wxObject
public: public:
/* This list should be filled in with strings indicating the formats /* This list should be filled in with strings indicating the formats
this client can provide. Almost all clients will provide "TEXT". this client can provide. Almost all clients will provide "TEXT(".
Format names should be 4 characters long, so things will work Format names should be 4 characters long, so things will work
out on the Macintosh */ out on the Macintosh */
wxStringList formats; wxStringList formats;
@@ -147,7 +147,7 @@ class WXDLLEXPORT wxClipboard : public wxObject
/* Set the clipboard string; does not require a client. */ /* Set the clipboard string; does not require a client. */
void SetClipboardString(char *, long time); void SetClipboardString(char *, long time);
/* Get data from the clipboard in the format "TEXT". */ /* Get data from the clipboard in the format "TEXT(". */
char *GetClipboardString(long time); char *GetClipboardString(long time);
/* Get data from the clipboard */ /* Get data from the clipboard */

View File

@@ -92,7 +92,7 @@ public:
// the string ID identifies the format of clipboard or DnD data. a word // the string ID identifies the format of clipboard or DnD data. a word
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
// to the clipboard - the latter with the Id "WXWORD_FORMAT". // to the clipboard - the latter with the Id "WXWORD_FORMAT(".
void SetId( const wxString& id ) void SetId( const wxString& id )
{ m_id = id; } { m_id = id; }

View File

@@ -3,7 +3,7 @@
// Header signatures for various resources // Header signatures for various resources
#define BFT_ICON 0x4349 /* 'IC' */ #define BFT_ICON 0x4349 /* 'IC' */
#define BFT_BITMAP 0x4d42 /* 'BM' */ #define BFT_BITMAP 0x4d42 /* 'BM' */
#define BFT_CURSOR 0x5450 /* 'PT' */ #define BFT_CURSOR 0x5450 /* 'PT(' */
// This WIDTHBYTES macro determines the number of BYTES per scan line. // This WIDTHBYTES macro determines the number of BYTES per scan line.
#define WIDTHBYTES( i) ((i + 31) / 32 * 4) #define WIDTHBYTES( i) ((i + 31) / 32 * 4)

View File

@@ -54,8 +54,8 @@ public:
~wxDDEConnection(void); ~wxDDEConnection(void);
// Calls that CLIENT can make // Calls that CLIENT can make
virtual bool Execute(wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool Execute(const wxString& str) { return Execute(WXSTRINGCAST str, -1, wxIPC_TEXT); } virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); }
virtual char *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT); virtual char *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT);
virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item); virtual bool StartAdvise(const wxString& item);

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 T("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 T("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 T("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 T("BUTTON")
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE) #define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
/* /*

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 *) T(#name), (wxChar *) T(#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 *) T(#name), (wxChar *) T(#basename1), (wxChar *) T(#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 *) T(#name), (wxChar *) T(#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 *) T(#name), (wxChar *) T(#basename1), \
(wxChar *) _T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL); (wxChar *) T(#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

@@ -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 = T("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

@@ -63,9 +63,9 @@ protected:
friend class wxTCPServer; friend class wxTCPServer;
friend class wxTCPClient; friend class wxTCPClient;
friend void Client_OnRequest(wxSocketBase&, friend void Client_OnRequest(wxSocketBase&,
wxSocketNotify, char *); wxSocketNotify, char *);
friend void Server_OnRequest(wxSocketServer&, friend void Server_OnRequest(wxSocketServer&,
wxSocketNotify, char *); wxSocketNotify, char *);
public: public:
wxTCPConnection(char *buffer, int size); wxTCPConnection(char *buffer, int size);
@@ -73,7 +73,7 @@ public:
virtual ~wxTCPConnection(); virtual ~wxTCPConnection();
// Calls that CLIENT can make // Calls that CLIENT can make
bool Execute(wxChar *data, int size = -1, bool Execute(const wxChar *data, int size = -1,
wxIPCFormat format = wxIPC_TEXT); wxIPCFormat format = wxIPC_TEXT);
char *Request(const wxString& item, int *size = NULL, char *Request(const wxString& item, int *size = NULL,
wxIPCFormat format = wxIPC_TEXT); wxIPCFormat format = wxIPC_TEXT);

View File

@@ -24,159 +24,175 @@
#if wxUSE_WCHAR_T #if wxUSE_WCHAR_T
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMBConv (base class for conversions, using libc conversion itself) // wxMBConv (base class for conversions, using libc conversion itself)
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConv class WXDLLEXPORT wxMBConv
{ {
public: public:
// the actual conversion takes place here
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
// No longer inline since BC++ complains.
const wxWCharBuffer cMB2WC(const char *psz) const;
const wxCharBuffer cWC2MB(const wchar_t *psz) const;
// the actual conversion takes place here
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
// No longer inline since BC++ complains.
const wxWCharBuffer cMB2WC(const char *psz) const;
const wxCharBuffer cWC2MB(const wchar_t *psz) const;
#if wxUSE_UNICODE #if wxUSE_UNICODE
const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); } const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); }
const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); } const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); }
const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; } const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; }
const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; } const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; }
#else #else // ANSI
const char* cMB2WX(const char *psz) const { return psz; } const char* cMB2WX(const char *psz) const { return psz; }
const char* cWX2MB(const char *psz) const { return psz; } const char* cWX2MB(const char *psz) const { return psz; }
const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); } const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); }
const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); }
#endif #endif // Unicode/ANSI
}; };
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc; WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc;
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMBConvFile (for conversion to filenames) // wxMBConvFile (for conversion to filenames)
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConvFile: public wxMBConv class WXDLLEXPORT wxMBConvFile : public wxMBConv
{ {
public: public:
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
}; };
WXDLLEXPORT_DATA(extern wxMBConvFile) wxConvFile; WXDLLEXPORT_DATA(extern wxMBConvFile) wxConvFile;
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMBConvUTF7 (for conversion using UTF7 encoding) // wxMBConvUTF7 (for conversion using UTF7 encoding)
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConvUTF7: public wxMBConv class WXDLLEXPORT wxMBConvUTF7 : public wxMBConv
{ {
public: public:
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
}; };
WXDLLEXPORT_DATA(extern wxMBConvUTF7) wxConvUTF7; WXDLLEXPORT_DATA(extern wxMBConvUTF7) wxConvUTF7;
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMBConvUTF8 (for conversion using UTF8 encoding) // wxMBConvUTF8 (for conversion using UTF8 encoding)
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConvUTF8: public wxMBConv class WXDLLEXPORT wxMBConvUTF8 : public wxMBConv
{ {
public: public:
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
}; };
WXDLLEXPORT_DATA(extern wxMBConvUTF8) wxConvUTF8; WXDLLEXPORT_DATA(extern wxMBConvUTF8) wxConvUTF8;
#ifdef __WXGTK12__ #ifdef __WXGTK12__
//---------------------------------------------------------------------------
// wxMBConvUTF8 (for conversion using GDK's internal converions)
//---------------------------------------------------------------------------
class WXDLLEXPORT wxMBConvGdk: public wxMBConv // ----------------------------------------------------------------------------
// wxMBConvUTF8 (for conversion using GDK's internal converions)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConvGdk : public wxMBConv
{ {
public: public:
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
}; };
WXDLLEXPORT_DATA(extern wxMBConvGdk) wxConvGdk; WXDLLEXPORT_DATA(extern wxMBConvGdk) wxConvGdk;
#endif
//--------------------------------------------------------------------------- #endif // wxGTK 1.2
// wxCSConv (for conversion based on laodable char sets)
//---------------------------------------------------------------------------
class wxCharacterSet; // ----------------------------------------------------------------------------
// wxCSConv (for conversion based on loadable char sets)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCSConv: public wxMBConv class WXDLLEXPORT wxCharacterSet;
class WXDLLEXPORT wxCSConv : public wxMBConv
{ {
private:
wxChar *m_name;
wxCharacterSet *m_cset;
bool m_deferred;
void SetName(const wxChar *charset);
public: public:
wxCSConv(const wxChar *charset); wxCSConv(const wxChar *charset);
virtual ~wxCSConv(); virtual ~wxCSConv();
void LoadNow();
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; void LoadNow();
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
private:
void SetName(const wxChar *charset);
wxChar *m_name;
wxCharacterSet *m_cset;
bool m_deferred;
}; };
WXDLLEXPORT_DATA(extern wxCSConv) wxConvLocal; WXDLLEXPORT_DATA(extern wxCSConv) wxConvLocal;
#define wxConv_local wxConvLocal
WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent;
#define wxConv_current wxConvCurrent
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// filename conversion macros // filename conversion macros
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// filenames are multibyte on Unix and probably widechar on Windows? // filenames are multibyte on Unix and probably widechar on Windows?
#if defined(__UNIX__) || defined(__BORLANDC__) #if defined(__UNIX__) || defined(__BORLANDC__)
#define wxMBFILES 1 #define wxMBFILES 1
#else #else
#define wxMBFILES 0 #define wxMBFILES 0
#endif #endif
#if wxMBFILES #if wxMBFILES
#define wxFNCONV(name) wxConvFile.cWX2MB(name) #define wxFNCONV(name) wxConvFile.cWX2MB(name)
#define FNSTRINGCAST MBSTRINGCAST #define wxFNSTRINGCAST wxMBSTRINGCAST
#else #else
#define wxFNCONV(name) name #define wxFNCONV(name) name
#define FNSTRINGCAST WXSTRINGCAST #define wxFNSTRINGCAST WXSTRINGCAST
#endif #endif
#else #else
// !wxUSE_WCHAR_T // !wxUSE_WCHAR_T
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// stand-ins in absence of wchar_t // stand-ins in absence of wchar_t
//--------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConv class WXDLLEXPORT wxMBConv
{ {
public: public:
const char* cMB2WX(const char *psz) const { return psz; } const char* cMB2WX(const char *psz) const { return psz; }
const char* cWX2MB(const char *psz) const { return psz; } const char* cWX2MB(const char *psz) const { return psz; }
}; };
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile; WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile;
WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent;
#define wxFNCONV(name) name #define wxFNCONV(name) name
#define FNSTRINGCAST WXSTRINGCAST #define wxFNSTRINGCAST WXSTRINGCAST
#endif #endif
// wxUSE_WCHAR_T // wxUSE_WCHAR_T
#endif // ----------------------------------------------------------------------------
// macros for the most common conversions
// ----------------------------------------------------------------------------
#if wxUSE_UNICODE
#define wxConvertWX2MB(s) wxConvCurrent->cWX2MB(s)
#define wxConvertMB2WX(s) wxConvCurrent->cMB2WX(s)
#else // ANSI
// no conversions to do
#define wxConvertWX2MB(s) (s)
#define wxConvertMB2WX(s) (s)
#endif // Unicode/ANSI
#endif
// _WX_WXSTRCONVH__ // _WX_WXSTRCONVH__

View File

@@ -9,13 +9,35 @@
// Licence: wxWindows license // Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/*
Efficient string class [more or less] compatible with MFC CString,
wxWindows version 1 wxString and std::string and some handy functions
missing from string.h.
*/
#ifndef _WX_WXSTRINGH__ #ifndef _WX_WXSTRINGH__
#define _WX_WXSTRINGH__ #define _WX_WXSTRINGH__
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "string.h" #pragma interface "string.h"
#endif #endif
// ----------------------------------------------------------------------------
// conditinal compilation
// ----------------------------------------------------------------------------
// compile the std::string compatibility functions if defined
#define wxSTD_STRING_COMPATIBILITY
// define to derive wxString from wxObject (deprecated!)
#ifdef WXSTRING_IS_WXOBJECT
#undef WXSTRING_IS_WXOBJECT
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __WXMAC__ #ifdef __WXMAC__
#include <ctype.h> #include <ctype.h>
#endif #endif
@@ -34,57 +56,53 @@
#include <strings.h> // for strcasecmp() #include <strings.h> // for strcasecmp()
#endif // AIX #endif // AIX
#ifndef WX_PRECOMP #include "wx/defs.h" // everybody should include this
#include "wx/defs.h" #include "wx/debug.h" // for wxASSERT()
#include "wx/wxchar.h" // for wxChar
#include "wx/buffer.h" // for wxCharBuffer
#include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes
#ifndef WX_PRECOMP
#ifdef WXSTRING_IS_WXOBJECT #ifdef WXSTRING_IS_WXOBJECT
#include "wx/object.h" #include "wx/object.h" // base class
#endif #endif
#endif // !PCH #endif // !PCH
#include "wx/debug.h"
#include "wx/wxchar.h"
#include "wx/buffer.h"
/*
Efficient string class [more or less] compatible with MFC CString,
wxWindows version 1 wxString and std::string and some handy functions
missing from string.h.
*/
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// macros // macros
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// compile the std::string compatibility functions if defined
#define wxSTD_STRING_COMPATIBILITY
// define to derive wxString from wxObject
#ifdef WXSTRING_IS_WXOBJECT
#undef WXSTRING_IS_WXOBJECT
#endif
// maximum possible length for a string means "take all string" everywhere
// (as sizeof(StringData) is unknown here we substract 100)
const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100;
// 'naughty' cast // 'naughty' cast
#define WXSTRINGCAST (wxChar *)(const wxChar *) #define WXSTRINGCAST (wxChar *)(const wxChar *)
#define WXCSTRINGCAST (wxChar *)(const wxChar *) #define wxCSTRINGCAST (wxChar *)(const wxChar *)
#define MBSTRINGCAST (char *)(const char *) #define wxMBSTRINGCAST (char *)(const char *)
#define WCSTRINGCAST (wchar_t *)(const wchar_t *) #define wxWCSTRINGCAST (wchar_t *)(const wchar_t *)
// implementation only // implementation only
#define ASSERT_VALID_INDEX(i) wxASSERT( (unsigned)(i) <= Len() ) #define ASSERT_VALID_INDEX(i) wxASSERT( (unsigned)(i) <= Len() )
// include conversion classes // ----------------------------------------------------------------------------
#include "wx/strconv.h" // constants
// ----------------------------------------------------------------------------
// maximum possible length for a string means "take all string" everywhere
// (as sizeof(StringData) is unknown here, we substract 100)
const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100;
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
// global pointer to empty string
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Global functions complementing standard C string library replacements for // global functions complementing standard C string library replacements for
// strlen() and portable strcasecmp() // strlen() and portable strcasecmp()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// USE wx* FUNCTIONS IN wx/wxchar.h INSTEAD - THIS IS ONLY FOR BINARY COMPATIBILITY
// Use wxXXX() functions from wxchar.h instead! These functions are for
// backwards compatibility only.
// checks whether the passed in pointer is NULL and if the string is empty // checks whether the passed in pointer is NULL and if the string is empty
inline bool WXDLLEXPORT IsEmpty(const char *p) { return (!p || !*p); } inline bool WXDLLEXPORT IsEmpty(const char *p) { return (!p || !*p); }
@@ -138,23 +156,15 @@ inline int WXDLLEXPORT Stricmp(const char *psz1, const char *psz2)
#endif // OS/compiler #endif // OS/compiler
} }
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
// global pointer to empty string
WXDLLEXPORT_DATA(extern const wxChar*) g_szNul;
// return an empty wxString // return an empty wxString
class WXDLLEXPORT wxString; // not yet defined class WXDLLEXPORT wxString; // not yet defined
inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; } inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// string data prepended with some housekeeping info (used by wxString class), // string data prepended with some housekeeping info (used by wxString class),
// is never used directly (but had to be put here to allow inlining) // is never used directly (but had to be put here to allow inlining)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
struct WXDLLEXPORT wxStringData struct WXDLLEXPORT wxStringData
{ {
int nRefs; // reference count int nRefs; // reference count
@@ -225,7 +235,7 @@ private:
// string (re)initialization functions // string (re)initialization functions
// initializes the string to the empty value (must be called only from // initializes the string to the empty value (must be called only from
// ctors, use Reinit() otherwise) // ctors, use Reinit() otherwise)
void Init() { m_pchData = (wxChar *)g_szNul; } void Init() { m_pchData = (wxChar *)wxEmptyString; }
// initializaes the string with (a part of) C-string // initializaes the string with (a part of) C-string
void InitWith(const wxChar *psz, size_t nPos = 0, size_t nLen = wxSTRING_MAXLEN); void InitWith(const wxChar *psz, size_t nPos = 0, size_t nLen = wxSTRING_MAXLEN);
// as Init, but also frees old data // as Init, but also frees old data
@@ -278,6 +288,7 @@ public:
// (default value of wxSTRING_MAXLEN means take all the string) // (default value of wxSTRING_MAXLEN means take all the string)
wxString(const wxChar *psz, size_t nLength = wxSTRING_MAXLEN) wxString(const wxChar *psz, size_t nLength = wxSTRING_MAXLEN)
{ InitWith(psz, 0, nLength); } { InitWith(psz, 0, nLength); }
#if wxUSE_UNICODE #if wxUSE_UNICODE
// from multibyte string // from multibyte string
// (NB: nLength is right now number of Unicode characters, not // (NB: nLength is right now number of Unicode characters, not
@@ -286,21 +297,24 @@ public:
// from wxWCharBuffer (i.e. return from wxGetString) // from wxWCharBuffer (i.e. return from wxGetString)
wxString(const wxWCharBuffer& psz) wxString(const wxWCharBuffer& psz)
{ InitWith(psz, 0, wxSTRING_MAXLEN); } { InitWith(psz, 0, wxSTRING_MAXLEN); }
#else #else // ANSI
// from C string (for compilers using unsigned char) // from C string (for compilers using unsigned char)
wxString(const unsigned char* psz, size_t nLength = wxSTRING_MAXLEN) wxString(const unsigned char* psz, size_t nLength = wxSTRING_MAXLEN)
{ InitWith((const char*)psz, 0, nLength); } { InitWith((const char*)psz, 0, nLength); }
// from multibyte string // from multibyte string
wxString(const char *psz, wxMBConv& WXUNUSED(conv), size_t nLength = wxSTRING_MAXLEN) wxString(const char *psz, wxMBConv& WXUNUSED(conv), size_t nLength = wxSTRING_MAXLEN)
{ InitWith(psz, 0, nLength); } { InitWith(psz, 0, nLength); }
#if wxUSE_WCHAR_T #if wxUSE_WCHAR_T
// from wide (Unicode) string // from wide (Unicode) string
wxString(const wchar_t *pwz); wxString(const wchar_t *pwz);
#endif #endif // !wxUSE_WCHAR_T
// from wxCharBuffer // from wxCharBuffer
wxString(const wxCharBuffer& psz) wxString(const wxCharBuffer& psz)
{ InitWith(psz, 0, wxSTRING_MAXLEN); } { InitWith(psz, 0, wxSTRING_MAXLEN); }
#endif #endif // Unicode/ANSI
// dtor is not virtual, this class must not be inherited from! // dtor is not virtual, this class must not be inherited from!
~wxString() { GetStringData()->Unlock(); } ~wxString() { GetStringData()->Unlock(); }
@@ -378,25 +392,36 @@ public:
const wxChar* c_str() const { return m_pchData; } const wxChar* c_str() const { return m_pchData; }
// (and this with [wx]Printf()!) // (and this with [wx]Printf()!)
const wxChar* wx_str() const { return m_pchData; } const wxChar* wx_str() const { return m_pchData; }
// // identical to c_str()
const wxChar* GetData() const { return m_pchData; } const wxChar* GetData() const { return m_pchData; }
// conversions with (possible) format convertions: have to return a
// buffer with temporary data
#if wxUSE_UNICODE #if wxUSE_UNICODE
const wxCharBuffer mb_str(wxMBConv& conv = wxConvLibc) const { return conv.cWC2MB(m_pchData); } const wxCharBuffer mb_str(wxMBConv& conv = wxConvLibc) const { return conv.cWC2MB(m_pchData); }
const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); }
const wxChar* wc_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const { return m_pchData; } const wxChar* wc_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const { return m_pchData; }
#if wxMBFILES #if wxMBFILES
const wxCharBuffer fn_str() const { return mb_str(wxConvFile); } const wxCharBuffer fn_str() const { return mb_str(wxConvFile); }
#else #else // !wxMBFILES
const wxChar* fn_str() const { return m_pchData; } const wxChar* fn_str() const { return m_pchData; }
#endif #endif // wxMBFILES/!wxMBFILES
#else #else // ANSI
const wxChar* mb_str(wxMBConv& WXUNUSED(conv) = wxConvLibc ) const { return m_pchData; } #if wxUSE_MULTIBYTE
const wxChar* mb_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const
{ return m_pchData; }
const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); }
#else // !mmultibyte
const wxChar* mb_str() const { return m_pchData; }
const wxWX2MBbuf mbc_str() const { return mb_str(); }
#endif // multibyte/!multibyte
#if wxUSE_WCHAR_T #if wxUSE_WCHAR_T
const wxWCharBuffer wc_str(wxMBConv& conv) const { return conv.cMB2WC(m_pchData); } const wxWCharBuffer wc_str(wxMBConv& conv) const { return conv.cMB2WC(m_pchData); }
#endif #endif // wxUSE_WCHAR_T
const wxChar* fn_str() const { return m_pchData; } const wxChar* fn_str() const { return m_pchData; }
#endif #endif // Unicode/ANSI
// for convenience
const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); }
// overloaded assignment // overloaded assignment
// from another wxString // from another wxString
@@ -408,7 +433,7 @@ public:
#if wxUSE_UNICODE #if wxUSE_UNICODE
// from wxWCharBuffer // from wxWCharBuffer
wxString& operator=(const wxWCharBuffer& psz) { return operator=((const wchar_t *)psz); } wxString& operator=(const wxWCharBuffer& psz) { return operator=((const wchar_t *)psz); }
#else #else // ANSI
// from another kind of C string // from another kind of C string
wxString& operator=(const unsigned char* psz); wxString& operator=(const unsigned char* psz);
#if wxUSE_WCHAR_T #if wxUSE_WCHAR_T
@@ -417,7 +442,7 @@ public:
#endif #endif
// from wxCharBuffer // from wxCharBuffer
wxString& operator=(const wxCharBuffer& psz) { return operator=((const char *)psz); } wxString& operator=(const wxCharBuffer& psz) { return operator=((const char *)psz); }
#endif #endif // Unicode/ANSI
// string concatenation // string concatenation
// in place concatenation // in place concatenation
@@ -548,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 = T(' '), bool bFromRight = TRUE);
// truncate string to given length // truncate string to given length
wxString& Truncate(size_t uiLen); wxString& Truncate(size_t uiLen);
@@ -660,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 = T('\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
@@ -835,6 +860,7 @@ public:
// so the original string may be safely deleted. When a string is retrieved // so the original string may be safely deleted. When a string is retrieved
// from the array (operator[] or Item() method), a reference is returned. // from the array (operator[] or Item() method), a reference is returned.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLEXPORT wxArrayString class WXDLLEXPORT wxArrayString
{ {
public: public:
@@ -979,20 +1005,23 @@ wxString WXDLLEXPORT operator+(const wxString& string, const wxChar *psz);
wxString WXDLLEXPORT operator+(const wxChar *psz, const wxString& string); wxString WXDLLEXPORT operator+(const wxChar *psz, const wxString& string);
#if wxUSE_UNICODE #if wxUSE_UNICODE
inline wxString WXDLLEXPORT operator+(const wxString& string, const wxWCharBuffer& buf) inline wxString WXDLLEXPORT operator+(const wxString& string, const wxWCharBuffer& buf)
{ return string + (const wchar_t *)buf; } { return string + (const wchar_t *)buf; }
inline wxString WXDLLEXPORT operator+(const wxWCharBuffer& buf, const wxString& string) inline wxString WXDLLEXPORT operator+(const wxWCharBuffer& buf, const wxString& string)
{ return (const wchar_t *)buf + string; } { return (const wchar_t *)buf + string; }
#else #else
inline wxString WXDLLEXPORT operator+(const wxString& string, const wxCharBuffer& buf) inline wxString WXDLLEXPORT operator+(const wxString& string, const wxCharBuffer& buf)
{ return string + (const char *)buf; } { return string + (const char *)buf; }
inline wxString WXDLLEXPORT operator+(const wxCharBuffer& buf, const wxString& string) inline wxString WXDLLEXPORT operator+(const wxCharBuffer& buf, const wxString& string)
{ return (const char *)buf + string; } { return (const char *)buf + string; }
#endif #endif
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Implementation only from here until the end of file // Implementation only from here until the end of file
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// don't pollute the library user's name space
#undef ASSERT_VALID_INDEX
#if defined(wxSTD_STRING_COMPATIBILITY) && wxUSE_STD_IOSTREAM #if defined(wxSTD_STRING_COMPATIBILITY) && wxUSE_STD_IOSTREAM
#include "wx/ioswrap.h" #include "wx/ioswrap.h"

View File

@@ -74,7 +74,7 @@ WXDLLEXPORT bool StringMatch(wxChar *one, wxChar *two, bool subString = TRUE, bo
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Sound the bell // Sound the bell
WXDLLEXPORT void wxBell(void) ; WXDLLEXPORT void wxBell();
// Get OS version // Get OS version
WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ; WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
@@ -82,6 +82,7 @@ WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *
// Return a string with the current date/time // Return a string with the current date/time
WXDLLEXPORT wxString wxNow(); WXDLLEXPORT wxString wxNow();
#if wxUSE_GUI
// Don't synthesize KeyUp events holding down a key and producing // Don't synthesize KeyUp events holding down a key and producing
// KeyDown events with autorepeat. On by default and always on // KeyDown events with autorepeat. On by default and always on
// in wxMSW. // in wxMSW.
@@ -106,6 +107,8 @@ WXDLLEXPORT void wxRegisterId(long id);
// Return the current ID // Return the current ID
WXDLLEXPORT long wxGetCurrentId(); WXDLLEXPORT long wxGetCurrentId();
#endif // wxUSE_GUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Various conversions // Various conversions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -215,6 +218,8 @@ WXDLLEXPORT const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString)
WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString); WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
#endif #endif
#if wxUSE_GUI // GUI only things from now on
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Strip out any menu codes // Strip out any menu codes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -388,5 +393,7 @@ extern wxNativeFont wxLoadQueryNearestFont(int pointSize,
#endif // X || GTK #endif // X || GTK
#endif // wxUSE_GUI
#endif #endif
// _WX_UTILSH__ // _WX_UTILSH__

View File

@@ -81,22 +81,22 @@ public:
// Construction & destruction // Construction & destruction
wxVariant(); wxVariant();
wxVariant(double val, const wxString& name = g_szNul); wxVariant(double val, const wxString& name = wxEmptyString);
wxVariant(long val, const wxString& name = g_szNul); wxVariant(long val, const wxString& name = wxEmptyString);
#ifdef HAVE_BOOL #ifdef HAVE_BOOL
wxVariant(bool val, const wxString& name = g_szNul); wxVariant(bool val, const wxString& name = wxEmptyString);
#endif #endif
wxVariant(char val, const wxString& name = g_szNul); wxVariant(char val, const wxString& name = wxEmptyString);
wxVariant(const wxString& val, const wxString& name = g_szNul); wxVariant(const wxString& val, const wxString& name = wxEmptyString);
wxVariant(const wxChar* val, const wxString& name = g_szNul); // Necessary or VC++ assumes bool! wxVariant(const wxChar* val, const wxString& name = wxEmptyString); // Necessary or VC++ assumes bool!
wxVariant(const wxStringList& val, const wxString& name = g_szNul); wxVariant(const wxStringList& val, const wxString& name = wxEmptyString);
wxVariant(const wxList& val, const wxString& name = g_szNul); // List of variants wxVariant(const wxList& val, const wxString& name = wxEmptyString); // List of variants
#if wxUSE_TIMEDATE #if wxUSE_TIMEDATE
wxVariant(const wxTime& val, const wxString& name = g_szNul); // Time wxVariant(const wxTime& val, const wxString& name = wxEmptyString); // Time
wxVariant(const wxDate& val, const wxString& name = g_szNul); // Date wxVariant(const wxDate& val, const wxString& name = wxEmptyString); // Date
#endif #endif
wxVariant(void* ptr, const wxString& name = g_szNul); // void* (general purpose) wxVariant(void* ptr, const wxString& name = wxEmptyString); // void* (general purpose)
wxVariant(wxVariantData* data, const wxString& name = g_szNul); // User-defined data wxVariant(wxVariantData* data, const wxString& name = wxEmptyString); // User-defined data
wxVariant(const wxVariant& variant); wxVariant(const wxVariant& variant);
~wxVariant(); ~wxVariant();

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") ); T("NULL passed to wxWizardPageSimple::Chain") );
first->SetNext(second); first->SetNext(second);
second->SetPrev(first); second->SetPrev(first);

View File

@@ -6,16 +6,26 @@
// Created: 01/02/97 // Created: 01/02/97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) // Copyright: (c)
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXH__ #ifndef _WX_WXH__
#define _WX_WXH__ #define _WX_WXH__
#include "wx/setup.h" // Which features to include - user editable
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/object.h"
#include "wx/dynarray.h"
#include "wx/list.h"
#include "wx/hash.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/event.h"
#include "wx/app.h"
#include "wx/utils.h"
#if wxUSE_GUI
#include "wx/window.h" #include "wx/window.h"
#include "wx/panel.h" #include "wx/panel.h"
#include "wx/frame.h" #include "wx/frame.h"
@@ -26,8 +36,6 @@
#include "wx/dcscreen.h" #include "wx/dcscreen.h"
#include "wx/button.h" #include "wx/button.h"
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/app.h"
#include "wx/event.h"
#include "wx/list.h" #include "wx/list.h"
#include "wx/pen.h" #include "wx/pen.h"
#include "wx/brush.h" #include "wx/brush.h"
@@ -36,7 +44,6 @@
#include "wx/cursor.h" #include "wx/cursor.h"
#include "wx/dialog.h" #include "wx/dialog.h"
#include "wx/timer.h" #include "wx/timer.h"
#include "wx/utils.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/cmndata.h" #include "wx/cmndata.h"
@@ -67,10 +74,6 @@
#include "wx/filedlg.h" #include "wx/filedlg.h"
#include "wx/dirdlg.h" #include "wx/dirdlg.h"
#if wxUSE_INTL
#include "wx/intl.h"
#endif // wxUSE_INTL
#if wxUSE_VALIDATORS #if wxUSE_VALIDATORS
#include "wx/valtext.h" #include "wx/valtext.h"
#endif // wxUSE_VALIDATORS #endif // wxUSE_VALIDATORS
@@ -80,5 +83,7 @@
#include "wx/serbase.h" #include "wx/serbase.h"
#endif // wxUSE_SERIAL #endif // wxUSE_SERIAL
#endif // wxUSE_GUI
#endif #endif
// _WX_WXH__ // _WX_WXH__

View File

@@ -230,7 +230,7 @@ typedef __WCHAR_TYPE__ wxChar;
typedef signed __WCHAR_TYPE__ wxSChar; typedef signed __WCHAR_TYPE__ wxSChar;
typedef unsigned __WCHAR_TYPE__ wxUChar; typedef unsigned __WCHAR_TYPE__ wxUChar;
# define _T(x) L##x # define T(x) L##x
// ctype.h functions (wctype.h) // ctype.h functions (wctype.h)
# define wxIsalnum iswalnum # define wxIsalnum iswalnum
@@ -289,50 +289,54 @@ typedef unsigned __WCHAR_TYPE__ wxUChar;
# include <ctype.h> # include <ctype.h>
# include <string.h> # include <string.h>
# if 0 // temporary - preserve binary compatibilty # if 0 // temporary - preserve binary compatibilty
typedef char wxChar; typedef char wxChar;
typedef signed char wxSChar; typedef signed char wxSChar;
typedef unsigned char wxUChar; typedef unsigned char wxUChar;
# else # else
# define wxChar char # define wxChar char
# define wxSChar signed char # define wxSChar signed char
# define wxUChar unsigned char # define wxUChar unsigned char
# endif # endif
# ifdef __FreeBSD__ # ifdef __FreeBSD__
# undef _T # undef T
# endif # endif
# define _T(x) x # define T(x) x
// ctype.h functions // ctype.h functions
# define wxIsalnum isalnum # define wxIsalnum isalnum
# define wxIsalpha isalpha # define wxIsalpha isalpha
# define wxIsctrl isctrl # define wxIsctrl isctrl
# define wxIsdigit isdigit # define wxIsdigit isdigit
# define wxIsgraph isgraph # define wxIsgraph isgraph
# define wxIslower islower # define wxIslower islower
# define wxIsprint isprint # define wxIsprint isprint
# define wxIspunct ispunct # define wxIspunct ispunct
# define wxIsspace isspace # define wxIsspace isspace
# define wxIsupper isupper # define wxIsupper isupper
# define wxIsxdigit isxdigit # define wxIsxdigit isxdigit
# define wxTolower tolower # define wxTolower tolower
# define wxToupper toupper # define wxToupper toupper
// locale.h functons // locale.h functons
# define wxSetlocale setlocale # define wxSetlocale setlocale
// string.h functions // string.h functions
// #define wxStricmp strcasecmp // #define wxStricmp strcasecmp
// wxStricmp is defined below!! // wxStricmp is defined below!!
// #define wxStrtok strtok_r // this needs a configure check #ifdef HAVE_STRTOK_R
#define wxStrtok(str, sep, last) strtok_r(str, sep, last)
#else
#define wxStrtok(str, sep, last) strtok(str, sep)
#endif
// leave the rest to defaults below // leave the rest to defaults below
# define wxNEED_WX_STRING_H # define wxNEED_WX_STRING_H
# define wxNEED_WX_STDIO_H # define wxNEED_WX_STDIO_H
# define wxNEED_WX_STDLIB_H # define wxNEED_WX_STDLIB_H
# define wxNEED_WX_TIME_H # define wxNEED_WX_TIME_H
# endif//Unicode # endif//Unicode
#endif//TCHAR-aware compilers #endif//TCHAR-aware compilers
@@ -557,6 +561,12 @@ WXDLLEXPORT int wxSystem(const wxChar *psz);
WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm); WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm);
#endif #endif
// a Unicode-friendly __FILE__ analog
#ifndef __TFILE__
#define __XFILE__(x) T(x)
#define __TFILE__ __XFILE__(__FILE__)
#endif
#endif #endif
//_WX_WXCHAR_H_ //_WX_WXCHAR_H_

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(T(""));
} }
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(T(""));
} }
// Get nth arg of clause (starting from 1) // Get nth arg of clause (starting from 1)

View File

@@ -35,7 +35,7 @@
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#include "wx/net.h" #include "wx/dialup.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
@@ -208,9 +208,6 @@ void MyApp::OnConnected(wxDialUpEvent& event)
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size) : wxFrame((wxFrame *)NULL, -1, title, pos, size)
{ {
// set the frame icon
SetIcon(wxICON(mondrian));
// create a menu bar // create a menu bar
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;

View File

@@ -131,11 +131,11 @@
/* /*
* Use GUI * Use GUI
*/ */
#define wxUSE_GUI 1 #define wxUSE_GUI 0
/* /*
* Defined if !wxUSE_GUI * Don't use GUI (defined to 1 when compiling/using base only)
*/ */
#undef wxUSE_NOGUI #define wxUSE_NOGUI 0
/* /*
* Use constraints mechanism * Use constraints mechanism
@@ -367,10 +367,20 @@
#define wxUSE_POSTSCRIPT 0 #define wxUSE_POSTSCRIPT 0
/* /*
* Compile wxString with wide character (Unicode) support? * Compile wxString with some Unicode support?
*/
#define wxUSE_WCHAR_T 0
/*
* Compile wxString in wide character (Unicode) mode?
*/ */
#define wxUSE_UNICODE 0 #define wxUSE_UNICODE 0
/*
* Compile wxString with (limited) multibyte char support?
*/
#define wxUSE_MULTIBYTE 0
/* /*
* Work around a bug in GNU libc 5.x wcstombs() implementation. * Work around a bug in GNU libc 5.x wcstombs() implementation.
* *
@@ -644,6 +654,9 @@
/* Define if you have the shl_load function. */ /* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD #undef HAVE_SHL_LOAD
/* Define if you have strtok_r function. */
#undef HAVE_STRTOK_R
/* Define if you have the uname function. */ /* Define if you have the uname function. */
#undef HAVE_UNAME #undef HAVE_UNAME

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, T("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") ); T("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") ); T("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") ); T("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") ); T("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") ); T("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 = T("Unknown");
switch (err) switch (err)
{ {
case CDERR_FINDRESFAILURE: msg = _T("CDERR_FINDRESFAILURE"); break; case CDERR_FINDRESFAILURE: msg = T("CDERR_FINDRESFAILURE"); break;
case CDERR_INITIALIZATION: msg = _T("CDERR_INITIALIZATION"); break; case CDERR_INITIALIZATION: msg = T("CDERR_INITIALIZATION"); break;
case CDERR_LOADRESFAILURE: msg = _T("CDERR_LOADRESFAILURE"); break; case CDERR_LOADRESFAILURE: msg = T("CDERR_LOADRESFAILURE"); break;
case CDERR_LOADSTRFAILURE: msg = _T("CDERR_LOADSTRFAILURE"); break; case CDERR_LOADSTRFAILURE: msg = T("CDERR_LOADSTRFAILURE"); break;
case CDERR_LOCKRESFAILURE: msg = _T("CDERR_LOCKRESFAILURE"); break; case CDERR_LOCKRESFAILURE: msg = T("CDERR_LOCKRESFAILURE"); break;
case CDERR_MEMALLOCFAILURE: msg = _T("CDERR_MEMALLOCFAILURE"); break; case CDERR_MEMALLOCFAILURE: msg = T("CDERR_MEMALLOCFAILURE"); break;
case CDERR_MEMLOCKFAILURE: msg = _T("CDERR_MEMLOCKFAILURE"); break; case CDERR_MEMLOCKFAILURE: msg = T("CDERR_MEMLOCKFAILURE"); break;
case CDERR_NOHINSTANCE: msg = _T("CDERR_NOHINSTANCE"); break; case CDERR_NOHINSTANCE: msg = T("CDERR_NOHINSTANCE"); break;
case CDERR_NOHOOK: msg = _T("CDERR_NOHOOK"); break; case CDERR_NOHOOK: msg = T("CDERR_NOHOOK"); break;
case CDERR_NOTEMPLATE: msg = _T("CDERR_NOTEMPLATE"); break; case CDERR_NOTEMPLATE: msg = T("CDERR_NOTEMPLATE"); break;
case CDERR_STRUCTSIZE: msg = _T("CDERR_STRUCTSIZE"); break; case CDERR_STRUCTSIZE: msg = T("CDERR_STRUCTSIZE"); break;
case PDERR_RETDEFFAILURE: msg = _T("PDERR_RETDEFFAILURE"); break; case PDERR_RETDEFFAILURE: msg = T("PDERR_RETDEFFAILURE"); break;
case PDERR_PRINTERNOTFOUND: msg = _T("PDERR_PRINTERNOTFOUND"); break; case PDERR_PRINTERNOTFOUND: msg = T("PDERR_PRINTERNOTFOUND"); break;
case PDERR_PARSEFAILURE: msg = _T("PDERR_PARSEFAILURE"); break; case PDERR_PARSEFAILURE: msg = T("PDERR_PARSEFAILURE"); break;
case PDERR_NODEVICES: msg = _T("PDERR_NODEVICES"); break; case PDERR_NODEVICES: msg = T("PDERR_NODEVICES"); break;
case PDERR_NODEFAULTPRN: msg = _T("PDERR_NODEFAULTPRN"); break; case PDERR_NODEFAULTPRN: msg = T("PDERR_NODEFAULTPRN"); break;
case PDERR_LOADDRVFAILURE: msg = _T("PDERR_LOADDRVFAILURE"); break; case PDERR_LOADDRVFAILURE: msg = T("PDERR_LOADDRVFAILURE"); break;
case PDERR_INITFAILURE: msg = _T("PDERR_INITFAILURE"); break; case PDERR_INITFAILURE: msg = T("PDERR_INITFAILURE"); break;
case PDERR_GETDEVMODEFAIL: msg = _T("PDERR_GETDEVMODEFAIL"); break; case PDERR_GETDEVMODEFAIL: msg = T("PDERR_GETDEVMODEFAIL"); break;
case PDERR_DNDMMISMATCH: msg = _T("PDERR_DNDMMISMATCH"); break; case PDERR_DNDMMISMATCH: msg = T("PDERR_DNDMMISMATCH"); break;
case PDERR_DEFAULTDIFFERENT: msg = _T("PDERR_DEFAULTDIFFERENT"); break; case PDERR_DEFAULTDIFFERENT: msg = T("PDERR_DEFAULTDIFFERENT("); break;
case PDERR_CREATEICFAILURE: msg = _T("PDERR_CREATEICFAILURE"); break; case PDERR_CREATEICFAILURE: msg = T("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(T("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 != T(""))
{ {
// 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(T("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(T("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(T("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), T("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), T("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. " T("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. " T("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(T("%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 == T('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
if ( strCurrent == _T(".") ) { if ( strCurrent == T(".") ) {
// ignore // ignore
} }
else if ( strCurrent == _T("..") ) { else if ( strCurrent == T("..") ) {
// 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 == T('\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, T("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"), T("Sunday"), T("Monday"), T("Tuesday"), T("Wednesday"),
_T("Thursday"), _T("Friday"), _T("Saturday") T("Thursday"), T("Friday"), T("Saturday")
}; };
static const wxChar *mname[] = { static const wxChar *mname[] = {
_T("January"), _T("February"), _T("March"), _T("April"), _T("May"), _T("June"), T("January"), T("February"), T("March"), T("April"), T("May"), T("June"),
_T("July"), _T("August"), _T("September"), _T("October"), _T("November"), _T("December") T("July"), T("August"), T("September"), T("October"), T("November"), T("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, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0)
{ {
// Sets the current date // Sets the current date
Set(); Set();
@@ -96,12 +96,12 @@ wxDate::wxDate (const wxString& dat)
else else
{ {
wxChar buf[100]; wxChar buf[100];
wxStrcpy(buf, WXSTRINGCAST dat); wxStrcpy(buf, dat);
wxChar *save_ptr, *token = wxStrtok(buf,_T("/-"),&save_ptr); wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr);
month = wxAtoi(token); month = wxAtoi(token);
day = wxAtoi(wxStrtok((wxChar *) NULL,_T("/-"),&save_ptr)); day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr));
year = wxAtoi(wxStrtok((wxChar *) NULL,_T(" "),&save_ptr)); year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&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, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0)
{ {
// Sets the current date // Sets the current date
Set(); Set();
@@ -139,12 +139,12 @@ void wxDate::operator = (const wxString& dat)
else else
{ {
wxChar buf[100]; wxChar buf[100];
wxStrcpy(buf, WXSTRINGCAST dat); wxStrcpy(buf, dat);
wxChar *save_ptr, *token = wxStrtok(buf,_T("/-"),&save_ptr); wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr);
month = wxAtoi(token); month = wxAtoi(token);
day = wxAtoi(wxStrtok((wxChar *) NULL,_T("/-"),&save_ptr)); day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr));
year = wxAtoi(wxStrtok((wxChar *) NULL,_T(" "),&save_ptr)); year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&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, T(", "));
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, T(" "));
wxSprintf( buf+wxStrlen(buf), _T("%d, %d"), day, abs(year) ); wxSprintf( buf+wxStrlen(buf), T("%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,T("%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), T(" %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), T("%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(T(""));
} }
void wxDate::SetFormat( int format ) void wxDate::SetFormat( int format )

View File

@@ -193,7 +193,7 @@ bool wxDB::Open(char *Dsn, char *Uid, char *AuthStr)
// ===================================================================== // =====================================================================
// Results from a Microsoft Access 7.0 db, using a driver from Microsoft // Results from a Microsoft Access 7.0 db, using a driver from Microsoft
// //
// SQL_VARCHAR type name = 'TEXT', Precision = 255 // SQL_VARCHAR type name = 'TEXT(', Precision = 255
// SQL_TIMESTAMP type name = 'DATETIME' // SQL_TIMESTAMP type name = 'DATETIME'
// SQL_DECIMAL SQL_NO_DATA_FOUND // SQL_DECIMAL SQL_NO_DATA_FOUND
// SQL_NUMERIC type name = 'CURRENCY', Precision = 19 // SQL_NUMERIC type name = 'CURRENCY', Precision = 19
@@ -979,14 +979,14 @@ bool wxDB::Grant(int privileges, char *tableName, char *userList)
int c = 0; int c = 0;
if (privileges & DB_GRANT_SELECT) if (privileges & DB_GRANT_SELECT)
{ {
strcat(sqlStmt, "SELECT"); strcat(sqlStmt, "SELECT(");
c++; c++;
} }
if (privileges & DB_GRANT_INSERT) if (privileges & DB_GRANT_INSERT)
{ {
if (c++) if (c++)
strcat(sqlStmt, ", "); strcat(sqlStmt, ", ");
strcat(sqlStmt, "INSERT"); strcat(sqlStmt, "INSERT(");
} }
if (privileges & DB_GRANT_UPDATE) if (privileges & DB_GRANT_UPDATE)
{ {

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] == T('\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 = T("");
} }
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 != T(""))
(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 = T("&%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 == T("") || !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 == T(""))
{ {
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() != T(""))
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() != T(""))
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 != T(""))
{ {
buf = m_documentTitle; buf = m_documentTitle;
return TRUE; return TRUE;
} }
else if (m_documentFile != _T("")) else if (m_documentFile != T(""))
{ {
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() != T(""))
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(T(""));
if (path != _T("")) if (path != T(""))
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 << T('|');
descrBuf << templates[i]->GetDescription() descrBuf << templates[i]->GetDescription()
<< _T(" (") << templates[i]->GetFileFilter() << _T(") |") << T(" (") << templates[i]->GetFileFilter() << T(") |")
<< templates[i]->GetFileFilter(); << templates[i]->GetFileFilter();
} }
} }
#else #else
wxString descrBuf = _T("*.*"); wxString descrBuf = T("*.*");
#endif #endif
int FilterIndex = 0; int FilterIndex = 0;
wxString pathTmp = wxFileSelectorEx(_("Select a file"), wxString pathTmp = wxFileSelectorEx(_("Select a file"),
_T(""), T(""),
_T(""), T(""),
&FilterIndex, &FilterIndex,
descrBuf, descrBuf,
0, 0,
@@ -1250,7 +1250,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
} }
else else
{ {
path = _T(""); path = T("");
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"), T(""), T(""),
temp->GetDefaultExtension(), temp->GetDefaultExtension(),
temp->GetFileFilter(), temp->GetFileFilter(),
0, wxTheApp->GetTopWindow()); 0, wxTheApp->GetTopWindow());
@@ -1279,7 +1279,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
int noTemplates) int noTemplates)
{ {
wxChar **strings = new wxChar *[noTemplates]; const wxChar **strings = new wxChar *[noTemplates];
wxChar **data = new wxChar *[noTemplates]; wxChar **data = new wxChar *[noTemplates];
int i; int i;
int n = 0; int n = 0;
@@ -1287,7 +1287,7 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
{ {
if (templates[i]->IsVisible()) if (templates[i]->IsVisible())
{ {
strings[n] = WXSTRINGCAST templates[i]->m_description; strings[n] = templates[i]->m_description;
data[n] = (wxChar *)templates[i]; data[n] = (wxChar *)templates[i];
n ++; n ++;
} }
@@ -1316,15 +1316,15 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates, wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
int noTemplates) int noTemplates)
{ {
wxChar **strings = new wxChar *[noTemplates]; const wxChar **strings = new wxChar *[noTemplates];
wxChar **data = new wxChar *[noTemplates]; wxChar **data = new wxChar *[noTemplates];
int i; int i;
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() != T("")))
{ {
strings[n] = WXSTRINGCAST templates[i]->m_viewTypeName; strings[n] = templates[i]->m_viewTypeName;
data[n] = (wxChar *)templates[i]; data[n] = (wxChar *)templates[i];
n ++; n ++;
} }
@@ -1543,7 +1543,7 @@ void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
#if wxUSE_PRINTING_ARCHITECTURE #if wxUSE_PRINTING_ARCHITECTURE
wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title) wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title)
: wxPrintout(WXSTRINGCAST title) : wxPrintout(title)
{ {
m_printoutView = view; m_printoutView = view;
} }
@@ -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 == T("")) 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 == T("")) 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 == T("")) 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") ); T("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, T(""));
#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(T("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 != T("")))
{ {
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(T("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(T("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, T("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, T("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") ); T("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, T(':'));
while ( tokenizer.HasMoreToken() ) while ( tokenizer.HasMoreToken() )
{ {
wxString fullname(tokenizer.NextToken()); wxString fullname(tokenizer.NextToken());

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97 // Created: 01/02/97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem // Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -22,46 +22,56 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/control.h"
#include "wx/utils.h"
#include "wx/app.h" #include "wx/app.h"
#include "wx/dc.h" #include "wx/list.h"
#if wxUSE_GUI
#include "wx/control.h"
#include "wx/utils.h"
#include "wx/dc.h"
#endif // wxUSE_GUI
#endif #endif
#include "wx/event.h" #include "wx/event.h"
#include "wx/validate.h"
#if wxUSE_GUI
#include "wx/validate.h"
#endif // wxUSE_GUI
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject) IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent) #if wxUSE_GUI
IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent)
IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent)
#endif // wxUSE_GUI
const wxEventTable *wxEvtHandler::GetEventTable() const const wxEventTable *wxEvtHandler::GetEventTable() const
{ return &wxEvtHandler::sm_eventTable; } { return &wxEvtHandler::sm_eventTable; }
@@ -102,7 +112,7 @@ wxEvent::wxEvent(int theId)
void wxEvent::CopyObject(wxObject& object_dest) const void wxEvent::CopyObject(wxObject& object_dest) const
{ {
wxEvent *obj = (wxEvent *)&object_dest; wxEvent *obj = (wxEvent *)&object_dest;
wxObject::CopyObject(object_dest); wxObject::CopyObject(object_dest);
obj->m_eventType = m_eventType; obj->m_eventType = m_eventType;
@@ -114,6 +124,8 @@ void wxEvent::CopyObject(wxObject& object_dest) const
obj->m_isCommandEvent = m_isCommandEvent; obj->m_isCommandEvent = m_isCommandEvent;
} }
#if wxUSE_GUI
/* /*
* Command events * Command events
* *
@@ -133,7 +145,7 @@ wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
void wxCommandEvent::CopyObject(wxObject& obj_d) const void wxCommandEvent::CopyObject(wxObject& obj_d) const
{ {
wxCommandEvent *obj = (wxCommandEvent *)&obj_d; wxCommandEvent *obj = (wxCommandEvent *)&obj_d;
wxEvent::CopyObject(obj_d); wxEvent::CopyObject(obj_d);
@@ -172,7 +184,7 @@ wxScrollWinEvent::wxScrollWinEvent(wxEventType commandType,
void wxScrollWinEvent::CopyObject(wxObject& obj_d) const void wxScrollWinEvent::CopyObject(wxObject& obj_d) const
{ {
wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d; wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d;
wxEvent::CopyObject(obj_d); wxEvent::CopyObject(obj_d);
@@ -231,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(T("invalid parameter in wxMouseEvent::ButtonDClick"));
} }
return FALSE; return FALSE;
@@ -252,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(T("invalid parameter in wxMouseEvent::ButtonDown"));
} }
return FALSE; return FALSE;
@@ -272,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(T("invalid parameter in wxMouseEvent::ButtonUp"));
} }
return FALSE; return FALSE;
@@ -291,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(T("invalid parameter in wxMouseEvent::Button"));
} }
return FALSE; return FALSE;
@@ -309,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(T("invalid parameter in wxMouseEvent::ButtonIsDown"));
} }
return FALSE; return FALSE;
@@ -408,7 +420,7 @@ void wxCloseEvent::CopyObject(wxObject& obj_d) const
#endif #endif
obj->m_canVeto = m_canVeto; obj->m_canVeto = m_canVeto;
} }
void wxShowEvent::CopyObject(wxObject& obj_d) const void wxShowEvent::CopyObject(wxObject& obj_d) const
{ {
wxShowEvent *obj = (wxShowEvent *)&obj_d; wxShowEvent *obj = (wxShowEvent *)&obj_d;
@@ -427,7 +439,7 @@ void wxJoystickEvent::CopyObject(wxObject& obj_d) const
obj->m_buttonChange = m_buttonChange; obj->m_buttonChange = m_buttonChange;
obj->m_buttonState = m_buttonState; obj->m_buttonState = m_buttonState;
obj->m_joyStick = m_joyStick; obj->m_joyStick = m_joyStick;
} }
void wxDropFilesEvent::CopyObject(wxObject& obj_d) const void wxDropFilesEvent::CopyObject(wxObject& obj_d) const
{ {
@@ -437,15 +449,7 @@ void wxDropFilesEvent::CopyObject(wxObject& obj_d) const
obj->m_noFiles = m_noFiles; obj->m_noFiles = m_noFiles;
obj->m_pos = m_pos; obj->m_pos = m_pos;
// TODO: Problem with obj->m_files. It should be deallocated by the // TODO: Problem with obj->m_files. It should be deallocated by the
// destructor of the event. // destructor of the event.
}
void wxIdleEvent::CopyObject(wxObject& obj_d) const
{
wxIdleEvent *obj = (wxIdleEvent *)&obj_d;
wxEvent::CopyObject(obj_d);
obj->m_requestMore = m_requestMore;
} }
void wxUpdateUIEvent::CopyObject(wxObject &obj_d) const void wxUpdateUIEvent::CopyObject(wxObject &obj_d) const
@@ -489,6 +493,16 @@ wxWindowDestroyEvent::wxWindowDestroyEvent(wxWindow *win)
SetEventObject(win); SetEventObject(win);
} }
#endif // wxUSE_GUI
void wxIdleEvent::CopyObject(wxObject& obj_d) const
{
wxIdleEvent *obj = (wxIdleEvent *)&obj_d;
wxEvent::CopyObject(obj_d);
obj->m_requestMore = m_requestMore;
}
/* /*
* Event handler * Event handler
*/ */
@@ -564,7 +578,7 @@ bool wxEvtHandler::ProcessThreadEvent(wxEvent& event)
// TODO: Wake up idle handler for the other platforms. // TODO: Wake up idle handler for the other platforms.
#ifdef __WXGTK__ #ifdef __WXGTK__
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
#endif #endif
@@ -592,14 +606,16 @@ void wxEvtHandler::ProcessPendingEvents()
bool wxEvtHandler::ProcessEvent(wxEvent& event) bool wxEvtHandler::ProcessEvent(wxEvent& event)
{ {
#if wxUSE_GUI
/* check that our flag corresponds to reality */ /* check that our flag corresponds to reality */
wxASSERT( m_isWindow == IsKindOf(CLASSINFO(wxWindow)) ); wxASSERT( m_isWindow == IsKindOf(CLASSINFO(wxWindow)) );
#endif // wxUSE_GUI
/* An event handler can be enabled or disabled */ /* An event handler can be enabled or disabled */
if ( GetEvtHandlerEnabled() ) if ( GetEvtHandlerEnabled() )
{ {
#if wxUSE_THREADS #if wxUSE_THREADS
/* Check whether we are in a child thread. */ /* Check whether we are in a child thread. */
if (!wxThread::IsMain()) if (!wxThread::IsMain())
return ProcessThreadEvent(event); return ProcessThreadEvent(event);
#endif #endif
@@ -612,7 +628,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
const wxEventTable *table = GetEventTable(); const wxEventTable *table = GetEventTable();
#if wxUSE_VALIDATORS #if wxUSE_GUI && wxUSE_VALIDATORS
// Try the associated validator first, if this is a window. // Try the associated validator first, if this is a window.
// Problem: if the event handler of the window has been replaced, // Problem: if the event handler of the window has been replaced,
// this wxEvtHandler may no longer be a window. // this wxEvtHandler may no longer be a window.
@@ -654,6 +670,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
return TRUE; return TRUE;
} }
#if wxUSE_GUI
// Carry on up the parent-child hierarchy, // Carry on up the parent-child hierarchy,
// but only if event is a command event: it wouldn't // but only if event is a command event: it wouldn't
// make sense for a parent to receive a child's size event, for example // make sense for a parent to receive a child's size event, for example
@@ -664,6 +681,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
if (parent && !parent->IsBeingDeleted()) if (parent && !parent->IsBeingDeleted())
return parent->GetEventHandler()->ProcessEvent(event); return parent->GetEventHandler()->ProcessEvent(event);
} }
#endif // wxUSE_GUI
// Last try - application object. // Last try - application object.
if ( wxTheApp && (this != wxTheApp) ) if ( wxTheApp && (this != wxTheApp) )
@@ -735,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") ); T("caller should check that we have dynamic events") );
int commandId = event.GetId(); int commandId = event.GetId();
@@ -779,6 +797,8 @@ bool wxEvtHandler::OnClose()
} }
#endif // WXWIN_COMPATIBILITY #endif // WXWIN_COMPATIBILITY
#if wxUSE_GUI
// Find a window with the focus, that is also a descendant of the given window. // Find a window with the focus, that is also a descendant of the given window.
// This is used to determine the window to initially send commands to. // This is used to determine the window to initially send commands to.
wxWindow* wxFindFocusDescendant(wxWindow* ancestor) wxWindow* wxFindFocusDescendant(wxWindow* ancestor)
@@ -802,3 +822,4 @@ wxWindow* wxFindFocusDescendant(wxWindow* ancestor)
return focusWin; return focusWin;
} }
#endif // wxUSE_GUI

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, T("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, T("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") ); wxCHECK_MSG( IsOpened(), FALSE, T("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, T("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") ); wxCHECK_MSG( IsOpened(), FALSE, T("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, T("invalid parameter") );
wxCHECK_MSG( IsOpened(), FALSE, _T("can't write to closed file") ); wxCHECK_MSG( IsOpened(), FALSE, T("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, T("can't seek on closed file") );
int origin; int origin;
switch ( mode ) switch ( mode )
{ {
default: default:
wxFAIL_MSG(_T("unknown seek mode")); wxFAIL_MSG(T("unknown seek mode"));
// still fall through // still fall through
case wxFromStart: case wxFromStart:

View File

@@ -169,7 +169,7 @@ bool wxFile::Exists(const wxChar *name)
wxCharBuffer fname = wxConvFile.cWC2MB(name); wxCharBuffer fname = wxConvFile.cWC2MB(name);
return !access(fname, 0) && return !access(fname, 0) &&
!stat(MBSTRINGCAST fname, &st) && !stat(wxMBSTRINGCAST fname, &st) &&
(st.st_mode & S_IFREG); (st.st_mode & S_IFREG);
#else #else
return !access(name, 0) && return !access(name, 0) &&
@@ -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(T("bad wxFile::Access mode parameter."));
} }
return access(wxFNCONV(name), how) == 0; return access(wxFNCONV(name), how) == 0;
@@ -481,28 +481,29 @@ 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 = T("XXXXXX");
m_strTemp << strName << szMktempSuffix; m_strTemp << strName << szMktempSuffix;
mktemp(MBSTRINGCAST m_strTemp.mb_str()); // will do because length doesn't change // can use the cast because length doesn't change
mktemp(wxMBSTRINGCAST m_strTemp.mb_str());
#elif defined(__WXPM__) #elif defined(__WXPM__)
// 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 = T("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 = T('.'); // 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, T("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, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#endif #endif
wxLogLastError(_T("GetTempFileName")); wxLogLastError(T("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 = T("/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, T("TODO") ) ;
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
wxASSERT_MSG( FALSE, _T("TODO") ) ; wxASSERT_MSG( FALSE, T("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 << T('\\');
#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() != T('/')) strDir << T('/');
#else #else
if (strDir.Last() != _T('\\')) strDir << _T('\\'); if (strDir.Last() != T('\\')) strDir << T('\\');
#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, T('.')) == NULL )
#ifdef __UNIX__ #ifdef __UNIX__
str << _T(".conf"); str << T(".conf");
#else // Windows #else // Windows
str << _T(".ini"); str << T(".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 << T('.');
#endif #endif
str << szFile; str << szFile;
#ifdef __WXMSW__ #ifdef __WXMSW__
if ( wxStrchr(szFile, _T('.')) == NULL ) if ( wxStrchr(szFile, T('.')) == NULL )
str << _T(".ini"); str << T(".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 == T('\0')|| *pStart == T(';') || *pStart == T('#') )
continue; continue;
if ( *pStart == _T('[') ) { // a new group if ( *pStart == T('[') ) { // a new group
pEnd = pStart; pEnd = pStart;
while ( *++pEnd != _T(']') ) { while ( *++pEnd != T(']') ) {
if ( *pEnd == _T('\n') || *pEnd == _T('\0') ) if ( *pEnd == T('\n') || *pEnd == T('\0') )
break; break;
} }
if ( *pEnd != _T(']') ) { if ( *pEnd != T(']') ) {
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 != T('\0') && bCont ) {
switch ( *pEnd ) { switch ( *pEnd ) {
case _T('#'): case T('#'):
case _T(';'): case T(';'):
bCont = FALSE; bCont = FALSE;
break; break;
case _T(' '): case T(' '):
case _T('\t'): case T('\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 != T('=') && !wxIsspace(*pEnd) ) {
if ( *pEnd == _T('\\') ) { if ( *pEnd == T('\\') ) {
// 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++ != T('=') ) {
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), T("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(T("%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(T("..")); // 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 = T("");
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 << T("[")
// +1: no '/' // +1: no '/'
<< FilterOutEntryName(GetFullName().c_str() + 1) << FilterOutEntryName(GetFullName().c_str() + 1)
<< _T("]"); << T("]");
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 << T("[") << (GetFullName().c_str() + 1) << T("]"); // +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 T("");
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -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) << T('=') << 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] == T('\\') ) {
switch ( str[++n] ) { switch ( str[++n] ) {
case _T('n'): case T('n'):
strResult += _T('\n'); strResult += T('\n');
break; break;
case _T('r'): case T('r'):
strResult += _T('\r'); strResult += T('\r');
break; break;
case _T('t'): case T('t'):
strResult += _T('\t'); strResult += T('\t');
break; break;
case _T('\\'): case T('\\'):
strResult += _T('\\'); strResult += T('\\');
break; break;
case _T('"'): case T('"'):
strResult += _T('"'); strResult += T('"');
break; break;
} }
} }
else { else {
if ( str[n] != _T('"') || !bQuoted ) if ( str[n] != T('"') || !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] == T('"');
if ( bQuote ) if ( bQuote )
strResult += _T('"'); strResult += T('"');
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 T('\n'):
c = _T('n'); c = T('n');
break; break;
case _T('\r'): case T('\r'):
c = _T('r'); c = T('r');
break; break;
case _T('\t'): case T('\t'):
c = _T('t'); c = T('t');
break; break;
case _T('\\'): case T('\\'):
c = _T('\\'); c = T('\\');
break; break;
case _T('"'): case T('"'):
if ( bQuote ) { if ( bQuote ) {
c = _T('"'); c = T('"');
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 << T('\\') << c;
} }
if ( bQuote ) if ( bQuote )
strResult += _T('"'); strResult += T('"');
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 == T('\\') )
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 != T('\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(T("@_/-!.*%"), c) && ((c & 0x80) == 0) )
strResult += _T('\\'); strResult += T('\\');
strResult += c; strResult += c;
} }

View File

@@ -9,6 +9,14 @@
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "filefn.h" #pragma implementation "filefn.h"
#endif #endif
@@ -100,9 +108,12 @@
#include "windows.h" #include "windows.h"
#endif #endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
#define _MAXPATHLEN 500 #define _MAXPATHLEN 500
extern wxChar *wxBuffer;
#ifdef __WXMAC__ #ifdef __WXMAC__
extern wxChar gwxMacFileName[] ; extern wxChar gwxMacFileName[] ;
extern wxChar gwxMacFileName2[] ; extern wxChar gwxMacFileName2[] ;
@@ -113,6 +124,16 @@ extern wxChar *wxBuffer;
IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList) IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList)
#endif #endif
// ----------------------------------------------------------------------------
// private globals
// ----------------------------------------------------------------------------
static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN];
// ============================================================================
// implementation
// ============================================================================
void wxPathList::Add (const wxString& path) void wxPathList::Add (const wxString& path)
{ {
wxStringList::Add (WXSTRINGCAST path); wxStringList::Add (WXSTRINGCAST path);
@@ -123,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) T(" ;"); // Don't seperate with colon in DOS (used for drive)
#else #else
_T(" :;"); T(" :;");
#endif #endif
wxChar *val = wxGetenv (WXSTRINGCAST envVariable); wxChar *val = wxGetenv (WXSTRINGCAST envVariable);
@@ -181,11 +202,11 @@ bool wxPathList::Member (const wxString& path)
wxString wxPathList::FindValidPath (const wxString& file) wxString wxPathList::FindValidPath (const wxString& file)
{ {
if (wxFileExists (wxExpandPath(wxBuffer, file))) if (wxFileExists (wxExpandPath(wxFileFunctionsBuffer, file)))
return wxString(wxBuffer); return wxString(wxFileFunctionsBuffer);
wxChar buf[_MAXPATHLEN]; wxChar buf[_MAXPATHLEN];
wxStrcpy(buf, wxBuffer); wxStrcpy(buf, wxFileFunctionsBuffer);
wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */ wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf; filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
@@ -193,48 +214,39 @@ wxString wxPathList::FindValidPath (const wxString& file)
for (wxNode * node = First (); node; node = node->Next ()) for (wxNode * node = First (); node; node = node->Next ())
{ {
wxChar *path = (wxChar *) node->Data (); wxChar *path = (wxChar *) node->Data ();
wxStrcpy (wxBuffer, path); wxStrcpy (wxFileFunctionsBuffer, path);
wxChar ch = wxBuffer[wxStrlen(wxBuffer)-1]; wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1];
if (ch != _T('\\') && ch != _T('/')) if (ch != T('\\') && ch != T('/'))
wxStrcat (wxBuffer, _T("/")); wxStrcat (wxFileFunctionsBuffer, T("/"));
wxStrcat (wxBuffer, filename); wxStrcat (wxFileFunctionsBuffer, filename);
#ifdef __WINDOWS__ #ifdef __WINDOWS__
Unix2DosFilename (wxBuffer); Unix2DosFilename (wxFileFunctionsBuffer);
#endif #endif
if (wxFileExists (wxBuffer)) if (wxFileExists (wxFileFunctionsBuffer))
{ {
return wxString(wxBuffer); // Found! return wxString(wxFileFunctionsBuffer); // Found!
} }
} // for() } // for()
return wxString(_T("")); // Not found return wxString(T("")); // Not found
} }
wxString wxPathList::FindAbsoluteValidPath (const wxString& file) wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
{ {
wxString f = FindValidPath(file); wxString f = FindValidPath(file);
if (wxIsAbsolutePath(f)) if ( wxIsAbsolutePath(f) )
return f; return f;
else
{ wxString buf;
wxChar buf[500]; wxGetWorkingDirectory(buf.GetWriteBuf(_MAXPATHLEN), _MAXPATHLEN - 1);
wxGetWorkingDirectory(buf, 499); buf.UngetWriteBuf();
int len = (int)wxStrlen(buf); if ( !wxEndsWithPathSeparator(buf) )
wxChar lastCh = 0;
if (len > 0)
lastCh = buf[len-1];
if (lastCh != _T('/') && lastCh != _T('\\'))
{ {
#ifdef __WINDOWS__ buf += wxFILE_SEP_PATH;
wxStrcat(buf, _T("\\"));
#else
wxStrcat(buf, _T("/"));
#endif
} }
wxStrcat(buf, (const wxChar *)f); buf += f;
wxStrcpy(wxBuffer, buf);
return wxString(wxBuffer); return buf;
}
} }
bool bool
@@ -260,7 +272,7 @@ wxFileExists (const wxString& filename)
struct stat stbuf; struct stat stbuf;
#endif #endif
if ((filename != _T("")) && stat (FNSTRINGCAST filename.fn_str(), &stbuf) == 0) if ((filename != T("")) && stat (wxFNSTRINGCAST filename.fn_str(), &stbuf) == 0)
return TRUE; return TRUE;
return FALSE; return FALSE;
#endif #endif
@@ -281,15 +293,15 @@ bool wxFileExists(const char *pszFileName)
bool bool
wxIsAbsolutePath (const wxString& filename) wxIsAbsolutePath (const wxString& filename)
{ {
if (filename != _T("")) if (filename != T(""))
{ {
if (filename[0] == _T('/') if (filename[0] == T('/')
#ifdef __VMS__ #ifdef __VMS__
|| (filename[0] == _T('[') && filename[1] != _T('.')) || (filename[0] == T('[') && filename[1] != T('.'))
#endif #endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
/* MSDOS */ /* MSDOS */
|| filename[0] == _T('\\') || (wxIsalpha (filename[0]) && filename[1] == _T(':')) || filename[0] == T('\\') || (wxIsalpha (filename[0]) && filename[1] == T(':'))
#endif #endif
) )
return TRUE; return TRUE;
@@ -309,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] == T('.'))
{ {
buffer[i] = 0; buffer[i] = 0;
break; break;
@@ -324,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) == T('.'))
{ {
buffer = buffer.Left(i); buffer = buffer.Left(i);
break; break;
@@ -337,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 = T('\\');
Unix2DosFilename(path); Unix2DosFilename(path);
#else #else
static const wxChar SEP = _T('/'); static const wxChar SEP = T('/');
#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] == T('.'))
p = &path[0]; p = &path[0];
else else
p = &path[2]; p = &path[2];
@@ -353,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] == T('.') && p[2] == T('.') && (p[3] == SEP || p[3] == T('\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] != T('.') || q[2] != T('.') || 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] == T('\0'))
{ {
path[0] = SEP; path[0] = SEP;
path[1] = _T('\0'); path[1] = T('\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] == T(':') && !path[2])
{ {
path[2] = SEP; path[2] = SEP;
path[3] = _T('\0'); path[3] = T('\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] == T('.') && (p[2] == SEP || p[2] == T('\0')))
wxStrcpy (p, p + 2); wxStrcpy (p, p + 2);
} }
} }
@@ -388,25 +400,25 @@ 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 == T(""))
return (wxChar *) NULL; return (wxChar *) NULL;
if (! IsAbsolutePath(wxExpandPath(wxBuffer, filename))) { if (! IsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) {
wxChar buf[_MAXPATHLEN]; wxChar buf[_MAXPATHLEN];
buf[0] = _T('\0'); buf[0] = T('\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 != T('\\') && ch != T('/'))
wxStrcat(buf, _T("\\")); wxStrcat(buf, T("\\"));
#else #else
if (ch != _T('/')) if (ch != T('/'))
wxStrcat(buf, _T("/")); wxStrcat(buf, T("/"));
#endif #endif
wxStrcat(buf, wxBuffer); wxStrcat(buf, wxFileFunctionsBuffer);
return copystring( wxRealPath(buf) ); return copystring( wxRealPath(buf) );
} }
return copystring( wxBuffer ); return copystring( wxFileFunctionsBuffer );
} }
/*- /*-
@@ -439,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[] = T("\n \t");
wxChar trimchars[4]; wxChar trimchars[4];
trimchars[0] = _T('\n'); trimchars[0] = T('\n');
trimchars[1] = _T(' '); trimchars[1] = T(' ');
trimchars[2] = _T('\t'); trimchars[2] = T('\t');
trimchars[3] = 0; trimchars[3] = 0;
#ifdef __WXMSW__ #ifdef __WXMSW__
const wxChar SEP = _T('\\'); const wxChar SEP = T('\\');
#else #else
const wxChar SEP = _T('/'); const wxChar SEP = T('/');
#endif #endif
buf[0] = _T('\0'); buf[0] = T('\0');
if (name == NULL || *name == _T('\0')) if (name == NULL || *name == T('\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;
@@ -464,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 = T('\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] == T('\\') && nm[1] == T('~');
#endif #endif
/* Expand inline environment variables */ /* Expand inline environment variables */
@@ -479,7 +491,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
while (*d) while (*d)
{ {
*d++ = *s; *d++ = *s;
if(*s == _T('\\')) if(*s == T('\\'))
{ {
*(d - 1) = *++s; *(d - 1) = *++s;
if (*d) if (*d)
@@ -494,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 == T('\\')) {
if ((*(d - 1) = *++s)) { if ((*(d - 1) = *++s)) {
s++; s++;
continue; continue;
@@ -504,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++ == T('$') && (*s == T('{') || *s == T(')')))
#else #else
if (*s++ == _T('$')) if (*s++ == T('$'))
#endif #endif
{ {
register wxChar *start = d; register wxChar *start = d;
register int braces = (*s == _T('{') || *s == _T('(')); register int braces = (*s == T('{') || *s == T('('));
register wxChar *value; register wxChar *value;
#ifdef __VISAGECPP__ #ifdef __VISAGECPP__
// VA gives assignment in logical expr warning // VA gives assignment in logical expr warning
@@ -519,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 == T('}') || *s == T(')')) : !(wxIsalnum(*s) || *s == T('_')) )
break; break;
else else
s++; s++;
@@ -541,14 +553,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
/* Expand ~ and ~user */ /* Expand ~ and ~user */
nm = lnm; nm = lnm;
s = _T(""); s = T("");
if (nm[0] == _T('~') && !q) if (nm[0] == T('~') && !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(T(""))) != NULL) {
if (*++nm) if (*++nm)
nm++; nm++;
} }
@@ -565,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 = T("");
} else { } else {
nm = nnm; nm = nnm;
s = home; s = home;
@@ -576,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 (T('\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)
@@ -608,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 == T(""))
return (wxChar *) NULL; return (wxChar *) NULL;
wxStrcpy (dest, WXSTRINGCAST filename); wxStrcpy (dest, WXSTRINGCAST filename);
@@ -622,12 +634,12 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL) (tcp = wxStrstr (dest, val)) != NULL)
{ {
wxStrcpy (wxBuffer, tcp + wxStrlen (val)); wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val));
*tcp++ = _T('$'); *tcp++ = T('$');
*tcp++ = _T('{'); *tcp++ = T('{');
wxStrcpy (tcp, WXSTRINGCAST envname); wxStrcpy (tcp, WXSTRINGCAST envname);
wxStrcat (tcp, _T("}")); wxStrcat (tcp, T("}"));
wxStrcat (tcp, wxBuffer); wxStrcat (tcp, wxFileFunctionsBuffer);
} }
// Handle User's home (ignore root homes!) // Handle User's home (ignore root homes!)
@@ -636,16 +648,16 @@ 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(wxBuffer, _T("~")); wxStrcpy(wxFileFunctionsBuffer, T("~"));
if (user != _T("")) if (user != T(""))
wxStrcat(wxBuffer, (const wxChar*) user); wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
#ifdef __WXMSW__ #ifdef __WXMSW__
// strcat(wxBuffer, "\\"); // strcat(wxFileFunctionsBuffer, "\\");
#else #else
// strcat(wxBuffer, "/"); // strcat(wxFileFunctionsBuffer, "/");
#endif #endif
wxStrcat(wxBuffer, dest + len); wxStrcat(wxFileFunctionsBuffer, dest + len);
wxStrcpy (dest, wxBuffer); wxStrcpy (dest, wxFileFunctionsBuffer);
} }
return dest; return dest;
@@ -662,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 == T('/') || *tcp == T('\\')
#ifdef __VMS__ #ifdef __VMS__
|| *tcp == _T(':') || *tcp == _T(']')) || *tcp == T(':') || *tcp == T(']'))
#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) == T(':'))
return path + 2; return path + 2;
#endif #endif
} }
@@ -680,7 +692,7 @@ wxChar *wxFileNameFromPath (wxChar *path)
wxString wxFileNameFromPath (const wxString& path1) wxString wxFileNameFromPath (const wxString& path1)
{ {
if (path1 != _T("")) if (path1 != T(""))
{ {
wxChar *path = WXSTRINGCAST path1 ; wxChar *path = WXSTRINGCAST path1 ;
@@ -689,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 == T('/') || *tcp == T('\\')
#ifdef __VMS__ #ifdef __VMS__
|| *tcp == _T(':') || *tcp == _T(']')) || *tcp == T(':') || *tcp == T(']'))
#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) == T(':'))
return wxString(path + 2); return wxString(path + 2);
#endif #endif
} }
@@ -727,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] == T('/') || path[i] == T('\\') || path[i] == T(']'))
{ {
done = TRUE; done = TRUE;
#ifdef __VMS__ #ifdef __VMS__
@@ -743,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] == T(':'))
{ {
// A:junk --> A:. (since A:.\junk Not A:\junk) // A:junk --> A:. (since A:.\junk Not A:\junk)
buf[2] = _T('.'); buf[2] = T('.');
buf[3] = _T('\0'); buf[3] = T('\0');
return buf; return buf;
} }
#endif #endif
@@ -759,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 != T(""))
{ {
wxChar buf[_MAXPATHLEN]; wxChar buf[_MAXPATHLEN];
@@ -775,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] == T('/') || path[i] == T('\\') || path[i] == T(']'))
{ {
done = TRUE; done = TRUE;
#ifdef __VMS__ #ifdef __VMS__
@@ -791,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] == T(':'))
{ {
// A:junk --> A:. (since A:.\junk Not A:\junk) // A:junk --> A:. (since A:.\junk Not A:\junk)
buf[2] = _T('.'); buf[2] = T('.');
buf[3] = _T('\0'); buf[3] = T('\0');
return wxString(buf); return wxString(buf);
} }
#endif #endif
} }
return wxString(_T("")); return wxString(T(""));
} }
// Utility for converting delimiters in DOS filenames to UNIX style // Utility for converting delimiters in DOS filenames to UNIX style
@@ -815,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 == T(':') )
*s = _T('.') ; *s = T('.') ;
else else
*s = _T('/') ; *s = T('/') ;
while (*s) while (*s)
{ {
if (*s == _T(':')) if (*s == T(':'))
*s = _T('/'); *s = T('/');
else else
*s = wxTolower(*s); // Case INDEPENDENT *s = wxTolower(*s); // Case INDEPENDENT
s++; s++;
@@ -836,24 +848,24 @@ wxUnix2MacFilename (wxChar *s)
{ {
if (s) if (s)
{ {
if ( *s == _T('.') ) if ( *s == T('.') )
{ {
// 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 == T('/') )
{ {
// 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 , T("unknown path beginning") ) ;
} }
while (*s) while (*s)
{ {
if (*s == _T('/') || *s == _T('\\')) if (*s == T('/') || *s == T('\\'))
*s = _T(':'); *s = T(':');
s++ ; s++ ;
} }
@@ -866,8 +878,8 @@ wxDos2UnixFilename (wxChar *s)
if (s) if (s)
while (*s) while (*s)
{ {
if (*s == _T('\\')) if (*s == T('\\'))
*s = _T('/'); *s = T('/');
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
else else
*s = wxTolower(*s); // Case INDEPENDENT *s = wxTolower(*s); // Case INDEPENDENT
@@ -888,8 +900,8 @@ wxUnix2DosFilename (wxChar *WXUNUSED(s))
if (s) if (s)
while (*s) while (*s)
{ {
if (*s == _T('/')) if (*s == T('/'))
*s = _T('\\'); *s = T('\\');
s++; s++;
} }
#endif #endif
@@ -917,8 +929,8 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
(fp2 = fopen (gwxMacFileName2, "rb")) == NULL || (fp2 = fopen (gwxMacFileName2, "rb")) == NULL ||
(fp3 = fopen (gwxMacFileName3, "wb")) == NULL) (fp3 = fopen (gwxMacFileName3, "wb")) == NULL)
#else #else
if ((fp1 = fopen (FNSTRINGCAST file1.fn_str(), "rb")) == NULL || if ((fp1 = fopen (wxFNSTRINGCAST file1.fn_str(), "rb")) == NULL ||
(fp2 = fopen (FNSTRINGCAST file2.fn_str(), "rb")) == NULL || (fp2 = fopen (wxFNSTRINGCAST file2.fn_str(), "rb")) == NULL ||
(fp3 = fopen (wxFNCONV(outfile), "wb")) == NULL) (fp3 = fopen (wxFNCONV(outfile), "wb")) == NULL)
#endif #endif
{ {
@@ -964,9 +976,9 @@ wxCopyFile (const wxString& file1, const wxString& file2)
return FALSE; return FALSE;
if ((fd2 = fopen (gwxMacFileName2, "wb")) == NULL) if ((fd2 = fopen (gwxMacFileName2, "wb")) == NULL)
#else #else
if ((fd1 = fopen (FNSTRINGCAST file1.fn_str(), "rb")) == NULL) if ((fd1 = fopen (wxFNSTRINGCAST file1.fn_str(), "rb")) == NULL)
return FALSE; return FALSE;
if ((fd2 = fopen (FNSTRINGCAST file2.fn_str(), "wb")) == NULL) if ((fd2 = fopen (wxFNSTRINGCAST file2.fn_str(), "wb")) == NULL)
#endif #endif
{ {
fclose (fd1); fclose (fd1);
@@ -994,7 +1006,7 @@ wxRenameFile (const wxString& file1, const wxString& file2)
return TRUE; return TRUE;
#else #else
// Normal system call // Normal system call
if (0 == rename (FNSTRINGCAST file1.fn_str(), FNSTRINGCAST file2.fn_str())) if (0 == rename (wxFNSTRINGCAST file1.fn_str(), wxFNSTRINGCAST file2.fn_str()))
return TRUE; return TRUE;
#endif #endif
// Try to copy // Try to copy
@@ -1009,13 +1021,13 @@ wxRenameFile (const wxString& file1, const wxString& file2)
bool wxRemoveFile(const wxString& file) bool wxRemoveFile(const wxString& file)
{ {
#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__) #if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
int flag = remove(FNSTRINGCAST file.fn_str()); int flag = remove(wxFNSTRINGCAST file.fn_str());
#elif defined( __WXMAC__ ) #elif defined( __WXMAC__ )
wxStrcpy( gwxMacFileName , file ) ; wxStrcpy( gwxMacFileName , file ) ;
wxUnix2MacFilename( gwxMacFileName ) ; wxUnix2MacFilename( gwxMacFileName ) ;
int flag = unlink(gwxMacFileName); int flag = unlink(gwxMacFileName);
#else #else
int flag = unlink(FNSTRINGCAST file.fn_str()); int flag = unlink(wxFNSTRINGCAST file.fn_str());
#endif #endif
return (flag == 0) ; return (flag == 0) ;
} }
@@ -1035,7 +1047,7 @@ bool wxMkdir(const wxString& dir, int perm)
#if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__) #if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__)
if ( mkdir(wxFNCONV(dirname), perm) != 0 ) if ( mkdir(wxFNCONV(dirname), perm) != 0 )
#else // MSW and OS/2 #else // MSW and OS/2
if ( mkdir(FNSTRINGCAST wxFNCONV(dirname)) != 0 ) if ( mkdir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
#endif // !MSW/MSW #endif // !MSW/MSW
{ {
wxLogSysError(_("Directory '%s' couldn't be created"), dirname); wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
@@ -1059,7 +1071,7 @@ bool wxRmdir(const wxString& dir, int WXUNUSED(flags))
#ifdef __SALFORDC__ #ifdef __SALFORDC__
return FALSE; // What to do? return FALSE; // What to do?
#else #else
return (rmdir(FNSTRINGCAST dir.fn_str()) == 0); return (rmdir(wxFNSTRINGCAST dir.fn_str()) == 0);
#endif #endif
#endif #endif
@@ -1117,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] != T('\0') )
strPath.Last() = _T('\0'); strPath.Last() = T('\0');
#ifdef __SALFORDC__ #ifdef __SALFORDC__
struct _stat st; struct _stat st;
@@ -1126,7 +1138,7 @@ bool wxPathExists(const wxChar *pszPathName)
struct stat st; struct stat st;
#endif #endif
return stat(FNSTRINGCAST strPath.fn_str(), &st) == 0 && (st.st_mode & S_IFDIR); return stat(wxFNSTRINGCAST strPath.fn_str(), &st) == 0 && (st.st_mode & S_IFDIR);
} }
// Get a temporary filename, opening and closing the file. // Get a temporary filename, opening and closing the file.
@@ -1154,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, T("/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)
@@ -1205,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] == T('/') )
path = _T('/'); path = T('/');
// path is empty => Local directory // path is empty => Local directory
if ( !path ) if ( !path )
path = _T('.'); path = T('.');
gs_dirStream = opendir(path.fn_str()); gs_dirStream = opendir(path.fn_str());
if ( !gs_dirStream ) if ( !gs_dirStream )
@@ -1231,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, T("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
@@ -1239,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] == T('/'))
path = _T('/'); path = T('/');
// Do the reading // Do the reading
struct dirent *nextDir; struct dirent *nextDir;
@@ -1254,8 +1266,8 @@ wxString wxFindNextFile()
if ( !path.IsEmpty() ) if ( !path.IsEmpty() )
{ {
result = path; result = path;
if ( path != _T('/') ) if ( path != T('/') )
result += _T('/'); result += T('/');
} }
result += nextDir->d_name; result += nextDir->d_name;
@@ -1318,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 << T('\\');
#ifdef __WIN32__ #ifdef __WIN32__
if ( gs_hFileStruct != INVALID_HANDLE_VALUE ) if ( gs_hFileStruct != INVALID_HANDLE_VALUE )
@@ -1411,7 +1423,7 @@ try_again:
goto try_again; goto try_again;
if ( !path.IsEmpty() ) if ( !path.IsEmpty() )
result << path << _T('\\'); result << path << T('\\');
result << gs_findDataStruct.cFileName; result << gs_findDataStruct.cFileName;
} }
@@ -1477,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] = T('.');
buf[1] = _T('\0'); buf[1] = T('\0');
} }
#if wxUSE_UNICODE #if wxUSE_UNICODE
else { else {
@@ -1503,7 +1515,7 @@ wxString wxGetCwd()
bool wxSetWorkingDirectory(const wxString& d) bool wxSetWorkingDirectory(const wxString& d)
{ {
#if defined( __UNIX__ ) || defined( __WXMAC__ ) || defined(__WXPM__) #if defined( __UNIX__ ) || defined( __WXMAC__ ) || defined(__WXPM__)
return (chdir(FNSTRINGCAST d.fn_str()) == 0); return (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
#elif defined(__WINDOWS__) #elif defined(__WINDOWS__)
#ifdef __WIN32__ #ifdef __WIN32__
@@ -1601,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, T("NULL file name in wxSplitPath") );
const wxChar *pDot = wxStrrchr(pszFileName, wxFILE_SEP_EXT); const wxChar *pDot = wxStrrchr(pszFileName, wxFILE_SEP_EXT);
@@ -1661,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 T('?'): case T('*'): case T('['): case T('{'):
return TRUE; return TRUE;
case _T('\\'): case T('\\'):
if (!*pat++) if (!*pat++)
return FALSE; return FALSE;
} }
@@ -1697,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 = T('{'), CB = T('}');
// dot_special means '.' only matches '.' // dot_special means '.' only matches '.'
if (dot_special && *str == _T('.') && *pattern != *str) if (dot_special && *str == T('.') && *pattern != *str)
return FALSE; return FALSE;
while ((*pattern != _T('\0')) && (!done) while ((*pattern != T('\0')) && (!done)
&& (((*str==_T('\0'))&&((*pattern==OB)||(*pattern==_T('*'))))||(*str!=_T('\0')))) { && (((*str==T('\0'))&&((*pattern==OB)||(*pattern==T('*'))))||(*str!=T('\0')))) {
switch (*pattern) { switch (*pattern) {
case _T('\\'): case T('\\'):
pattern++; pattern++;
if (*pattern != _T('\0')) if (*pattern != T('\0'))
pattern++; pattern++;
break; break;
case _T('*'): case T('*'):
pattern++; pattern++;
ret_code = FALSE; ret_code = FALSE;
while ((*str!=_T('\0')) while ((*str!=T('\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 != T('\0'))
str++; str++;
while (*pattern != _T('\0')) while (*pattern != T('\0'))
pattern++; pattern++;
} }
break; break;
case _T('['): case T('['):
pattern++; pattern++;
repeat: repeat:
if ((*pattern == _T('\0')) || (*pattern == _T(']'))) { if ((*pattern == T('\0')) || (*pattern == T(']'))) {
done = TRUE; done = TRUE;
break; break;
} }
if (*pattern == _T('\\')) { if (*pattern == T('\\')) {
pattern++; pattern++;
if (*pattern == _T('\0')) { if (*pattern == T('\0')) {
done = TRUE; done = TRUE;
break; break;
} }
} }
if (*(pattern + 1) == _T('-')) { if (*(pattern + 1) == T('-')) {
c = *pattern; c = *pattern;
pattern += 2; pattern += 2;
if (*pattern == _T(']')) { if (*pattern == T(']')) {
done = TRUE; done = TRUE;
break; break;
} }
if (*pattern == _T('\\')) { if (*pattern == T('\\')) {
pattern++; pattern++;
if (*pattern == _T('\0')) { if (*pattern == T('\0')) {
done = TRUE; done = TRUE;
break; break;
} }
@@ -1761,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 != T(']')) && (*pattern != T('\0'))) {
if ((*pattern == _T('\\')) && (*(pattern + 1) != _T('\0'))) if ((*pattern == T('\\')) && (*(pattern + 1) != T('\0')))
pattern++; pattern++;
pattern++; pattern++;
} }
if (*pattern != _T('\0')) { if (*pattern != T('\0')) {
pattern++, str++; pattern++, str++;
} }
break; break;
case _T('?'): case T('?'):
pattern++; pattern++;
str++; str++;
break; break;
case OB: case OB:
pattern++; pattern++;
while ((*pattern != CB) && (*pattern != _T('\0'))) { while ((*pattern != CB) && (*pattern != T('\0'))) {
cp = str; cp = str;
ok = TRUE; ok = TRUE;
while (ok && (*cp != _T('\0')) && (*pattern != _T('\0')) while (ok && (*cp != T('\0')) && (*pattern != T('\0'))
&& (*pattern != _T(',')) && (*pattern != CB)) { && (*pattern != T(',')) && (*pattern != CB)) {
if (*pattern == _T('\\')) if (*pattern == T('\\'))
pattern++; pattern++;
ok = (*pattern++ == *cp++); ok = (*pattern++ == *cp++);
} }
if (*pattern == _T('\0')) { if (*pattern == T('\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 != T('\0'))) {
if (*++pattern == _T('\\')) { if (*++pattern == T('\\')) {
if (*++pattern == CB) if (*++pattern == CB)
pattern++; pattern++;
} }
} }
} else { } else {
while (*pattern!=CB && *pattern!=_T(',') && *pattern!=_T('\0')) { while (*pattern!=CB && *pattern!=T(',') && *pattern!=T('\0')) {
if (*++pattern == _T('\\')) { if (*++pattern == T('\\')) {
if (*++pattern == CB || *pattern == _T(',')) if (*++pattern == CB || *pattern == T(','))
pattern++; pattern++;
} }
} }
} }
if (*pattern != _T('\0')) if (*pattern != T('\0'))
pattern++; pattern++;
} }
break; break;
@@ -1817,9 +1829,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
} }
} }
} }
while (*pattern == _T('*')) while (*pattern == T('*'))
pattern++; pattern++;
return ((*str == _T('\0')) && (*pattern == _T('\0'))); return ((*str == T('\0')) && (*pattern == T('\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 == T('#')) l2 = i + 1;
if (c == _T('.')) {ext = loc.Right(l2-i-1); break;} if (c == T('.')) {ext = loc.Right(l2-i-1); break;}
if ((c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) {return wxEmptyString;} if ((c == T('/')) || (c == T('\\')) || (c == T(':'))) {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] != T('#')) || (!fnd)); i--) {
if ((location[i] == _T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
} }
if (!fnd) return _T("file"); if (!fnd) return T("file");
for (++i; (i < l) && (location[i] != _T(':')); i++) s << location[i]; for (++i; (i < l) && (location[i] != T(':')); 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] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
else if (fnd && (location[i] == _T('#'))) return location.Left(i); else if (fnd && (location[i] == T('#'))) 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] != T(':')) || (i == 1) || (location[i-2] == T(':'))); i--) {if (location[i] == T('#')) 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 == T('#')) return location.Right(l-i-1);
else if ((c == _T('.')) || (c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) return wxEmptyString; else if ((c == T('.')) || (c == T('/')) || (c == T('\\')) || (c == T(':'))) 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) == T("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] == T('\\')) m_Path.GetWritableChar(i) = T('/'); // 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] == T('/'))
{ {
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)] == T('/')) && (m_Path[(unsigned int) (i-2)] == T(':')))
{ {
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] == T(':')) {
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] == T(':'))
{ {
//m_Path << _T('/'); //m_Path << T('/');
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] != T('/'))
m_Path << _T('/'); m_Path << T('/');
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] == T('\\')) loc.GetWritableChar(i) = T('/'); // 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 T('/') : case T(':') : case T('#') : meta = loc[(unsigned int) i];
} }
} }
m_LastName = wxEmptyString; m_LastName = wxEmptyString;
// try relative paths first : // try relative paths first :
if (meta != _T(':')) if (meta != T(':'))
{ {
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(), T("wxDEFAULT("), T("invalid font") );
switch ( GetFamily() ) switch ( GetFamily() )
{ {
case wxDECORATIVE: return _T("wxDECORATIVE"); case wxDECORATIVE: return T("wxDECORATIVE");
case wxROMAN: return _T("wxROMAN"); case wxROMAN: return T("wxROMAN");
case wxSCRIPT: return _T("wxSCRIPT"); case wxSCRIPT: return T("wxSCRIPT(");
case wxSWISS: return _T("wxSWISS"); case wxSWISS: return T("wxSWISS");
case wxMODERN: return _T("wxMODERN"); case wxMODERN: return T("wxMODERN");
case wxTELETYPE: return _T("wxTELETYPE"); case wxTELETYPE: return T("wxTELETYPE");
default: return _T("wxDEFAULT"); default: return T("wxDEFAULT(");
} }
} }
wxString wxFontBase::GetStyleString() const wxString wxFontBase::GetStyleString() const
{ {
wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") ); wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") );
switch ( GetStyle() ) switch ( GetStyle() )
{ {
case wxNORMAL: return _T("wxNORMAL"); case wxNORMAL: return T("wxNORMAL");
case wxSLANT: return _T("wxSLANT"); case wxSLANT: return T("wxSLANT(");
case wxITALIC: return _T("wxITALIC"); case wxITALIC: return T("wxITALIC");
default: return _T("wxDEFAULT"); default: return T("wxDEFAULT(");
} }
} }
wxString wxFontBase::GetWeightString() const wxString wxFontBase::GetWeightString() const
{ {
wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") ); wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") );
switch ( GetWeight() ) switch ( GetWeight() )
{ {
case wxNORMAL: return _T("wxNORMAL"); case wxNORMAL: return T("wxNORMAL");
case wxBOLD: return _T("wxBOLD"); case wxBOLD: return T("wxBOLD");
case wxLIGHT: return _T("wxLIGHT"); case wxLIGHT: return T("wxLIGHT(");
default: return _T("wxDEFAULT"); default: return T("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 == T("http")) || (p == T("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) + T(":") + 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( T("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, T("ftp"), T("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 = T("anonymous");
m_passwd = wxGetUserId(); m_passwd = wxGetUserId();
m_passwd += '@'; m_passwd += '@';
m_passwd += wxGetHostName(); m_passwd += wxGetHostName();
@@ -74,7 +74,7 @@ wxFTP::wxFTP()
wxFTP::~wxFTP() wxFTP::~wxFTP()
{ {
SendCommand("QUIT", '2'); SendCommand("QUIT(", '2');
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
@@ -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(T("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(T("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(T("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(T("QUIT(")), '2');
return wxSocketClient::Close(); return wxSocketClient::Close();
} }
@@ -147,9 +147,9 @@ 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 + T("\r\n");
const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); const wxWX2MBbuf tmp_buf = tmp_str.mb_str();
if (Write(MBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) { if (Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) {
m_lastError = wxPROTO_NETERR; m_lastError = wxPROTO_NETERR;
return FALSE; return FALSE;
} }
@@ -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 += T(' ');
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(T("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(T("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(T("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(T("PWD"), '2'))
return wxString((char *)NULL); return wxString((char *)NULL);
beg = m_lastResult.Find(_T('\"'),FALSE); beg = m_lastResult.Find(T('\"'),FALSE);
end = m_lastResult.Find(_T('\"'),TRUE); end = m_lastResult.Find(T('\"'),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 = T("RNFR ") + src;
if (!SendCommand(str, '3')) if (!SendCommand(str, '3'))
return FALSE; return FALSE;
str = _T("RNTO ") + dst; str = T("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 = T("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(T("PASV"), '2'))
return NULL; return NULL;
addr_pos = m_lastResult.Find(_T('(')); addr_pos = m_lastResult.Find(T('('));
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,T("%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(T("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(T("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 = T("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(T('('));
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(T(')'))-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(T("TYPE I"), '2'))
return NULL; return NULL;
wxSocketClient *sock = GetPort(); wxSocketClient *sock = GetPort();
tmp_str = _T("STOR ") + path; tmp_str = T("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 = T("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}, {T("AQUAMARINE"),112, 219, 147},
{_T("BLACK"),0, 0, 0}, {T("BLACK"),0, 0, 0},
{_T("BLUE"), 0, 0, 255}, {T("BLUE"), 0, 0, 255},
{_T("BLUE VIOLET"), 159, 95, 159}, {T("BLUE VIOLET("), 159, 95, 159},
{_T("BROWN"), 165, 42, 42}, {T("BROWN"), 165, 42, 42},
{_T("CADET BLUE"), 95, 159, 159}, {T("CADET BLUE"), 95, 159, 159},
{_T("CORAL"), 255, 127, 0}, {T("CORAL"), 255, 127, 0},
{_T("CORNFLOWER BLUE"), 66, 66, 111}, {T("CORNFLOWER BLUE"), 66, 66, 111},
{_T("CYAN"), 0, 255, 255}, {T("CYAN"), 0, 255, 255},
{_T("DARK GREY"), 47, 47, 47}, // ? {T("DARK GREY"), 47, 47, 47}, // ?
{_T("DARK GREEN"), 47, 79, 47}, {T("DARK GREEN"), 47, 79, 47},
{_T("DARK OLIVE GREEN"), 79, 79, 47}, {T("DARK OLIVE GREEN"), 79, 79, 47},
{_T("DARK ORCHID"), 153, 50, 204}, {T("DARK ORCHID"), 153, 50, 204},
{_T("DARK SLATE BLUE"), 107, 35, 142}, {T("DARK SLATE BLUE"), 107, 35, 142},
{_T("DARK SLATE GREY"), 47, 79, 79}, {T("DARK SLATE GREY"), 47, 79, 79},
{_T("DARK TURQUOISE"), 112, 147, 219}, {T("DARK TURQUOISE"), 112, 147, 219},
{_T("DIM GREY"), 84, 84, 84}, {T("DIM GREY"), 84, 84, 84},
{_T("FIREBRICK"), 142, 35, 35}, {T("FIREBRICK"), 142, 35, 35},
{_T("FOREST GREEN"), 35, 142, 35}, {T("FOREST GREEN"), 35, 142, 35},
{_T("GOLD"), 204, 127, 50}, {T("GOLD"), 204, 127, 50},
{_T("GOLDENROD"), 219, 219, 112}, {T("GOLDENROD"), 219, 219, 112},
{_T("GREY"), 128, 128, 128}, {T("GREY"), 128, 128, 128},
{_T("GREEN"), 0, 255, 0}, {T("GREEN"), 0, 255, 0},
{_T("GREEN YELLOW"), 147, 219, 112}, {T("GREEN YELLOW"), 147, 219, 112},
{_T("INDIAN RED"), 79, 47, 47}, {T("INDIAN RED"), 79, 47, 47},
{_T("KHAKI"), 159, 159, 95}, {T("KHAKI"), 159, 159, 95},
{_T("LIGHT BLUE"), 191, 216, 216}, {T("LIGHT BLUE"), 191, 216, 216},
{_T("LIGHT GREY"), 192, 192, 192}, {T("LIGHT GREY"), 192, 192, 192},
{_T("LIGHT STEEL BLUE"), 143, 143, 188}, {T("LIGHT STEEL BLUE"), 143, 143, 188},
{_T("LIME GREEN"), 50, 204, 50}, {T("LIME GREEN"), 50, 204, 50},
{_T("LIGHT MAGENTA"), 255, 0, 255}, {T("LIGHT MAGENTA"), 255, 0, 255},
{_T("MAGENTA"), 255, 0, 255}, {T("MAGENTA"), 255, 0, 255},
{_T("MAROON"), 142, 35, 107}, {T("MAROON"), 142, 35, 107},
{_T("MEDIUM AQUAMARINE"), 50, 204, 153}, {T("MEDIUM AQUAMARINE"), 50, 204, 153},
{_T("MEDIUM GREY"), 100, 100, 100}, {T("MEDIUM GREY"), 100, 100, 100},
{_T("MEDIUM BLUE"), 50, 50, 204}, {T("MEDIUM BLUE"), 50, 50, 204},
{_T("MEDIUM FOREST GREEN"), 107, 142, 35}, {T("MEDIUM FOREST GREEN"), 107, 142, 35},
{_T("MEDIUM GOLDENROD"), 234, 234, 173}, {T("MEDIUM GOLDENROD"), 234, 234, 173},
{_T("MEDIUM ORCHID"), 147, 112, 219}, {T("MEDIUM ORCHID"), 147, 112, 219},
{_T("MEDIUM SEA GREEN"), 66, 111, 66}, {T("MEDIUM SEA GREEN"), 66, 111, 66},
{_T("MEDIUM SLATE BLUE"), 127, 0, 255}, {T("MEDIUM SLATE BLUE"), 127, 0, 255},
{_T("MEDIUM SPRING GREEN"), 127, 255, 0}, {T("MEDIUM SPRING GREEN"), 127, 255, 0},
{_T("MEDIUM TURQUOISE"), 112, 219, 219}, {T("MEDIUM TURQUOISE"), 112, 219, 219},
{_T("MEDIUM VIOLET RED"), 219, 112, 147}, {T("MEDIUM VIOLET RED"), 219, 112, 147},
{_T("MIDNIGHT BLUE"), 47, 47, 79}, {T("MIDNIGHT BLUE"), 47, 47, 79},
{_T("NAVY"), 35, 35, 142}, {T("NAVY"), 35, 35, 142},
{_T("ORANGE"), 204, 50, 50}, {T("ORANGE"), 204, 50, 50},
{_T("ORANGE RED"), 255, 0, 127}, {T("ORANGE RED"), 255, 0, 127},
{_T("ORCHID"), 219, 112, 219}, {T("ORCHID"), 219, 112, 219},
{_T("PALE GREEN"), 143, 188, 143}, {T("PALE GREEN"), 143, 188, 143},
{_T("PINK"), 188, 143, 234}, {T("PINK"), 188, 143, 234},
{_T("PLUM"), 234, 173, 234}, {T("PLUM"), 234, 173, 234},
{_T("PURPLE"), 176, 0, 255}, {T("PURPLE"), 176, 0, 255},
{_T("RED"), 255, 0, 0}, {T("RED"), 255, 0, 0},
{_T("SALMON"), 111, 66, 66}, {T("SALMON"), 111, 66, 66},
{_T("SEA GREEN"), 35, 142, 107}, {T("SEA GREEN"), 35, 142, 107},
{_T("SIENNA"), 142, 107, 35}, {T("SIENNA"), 142, 107, 35},
{_T("SKY BLUE"), 50, 153, 204}, {T("SKY BLUE"), 50, 153, 204},
{_T("SLATE BLUE"), 0, 127, 255}, {T("SLATE BLUE"), 0, 127, 255},
{_T("SPRING GREEN"), 0, 255, 127}, {T("SPRING GREEN"), 0, 255, 127},
{_T("STEEL BLUE"), 35, 107, 142}, {T("STEEL BLUE"), 35, 107, 142},
{_T("TAN"), 219, 147, 112}, {T("TAN"), 219, 147, 112},
{_T("THISTLE"), 216, 191, 216}, {T("THISTLE"), 216, 191, 216},
{_T("TURQUOISE"), 173, 234, 234}, {T("TURQUOISE"), 173, 234, 234},
{_T("VIOLET"), 79, 47, 79}, {T("VIOLET("), 79, 47, 79},
{_T("VIOLET RED"), 204, 50, 153}, {T("VIOLET RED"), 204, 50, 153},
{_T("WHEAT"), 216, 216, 191}, {T("WHEAT("), 216, 216, 191},
{_T("WHITE"), 255, 255, 255}, {T("WHITE"), 255, 255, 255},
{_T("YELLOW"), 255, 255, 0}, {T("YELLOW"), 255, 255, 0},
{_T("YELLOW GREEN"), 153, 204, 50}, {T("YELLOW GREEN"), 153, 204, 50},
// #endif // #endif
#if defined(__WXGTK__) || defined(__X__) #if defined(__WXGTK__) || defined(__X__)
{_T("MEDIUM GOLDENROD"), 234, 234, 173}, {T("MEDIUM GOLDENROD"), 234, 234, 173},
{_T("MEDIUM FOREST GREEN"), 107, 142, 35}, {T("MEDIUM FOREST GREEN"), 107, 142, 35},
{_T("LIGHT MAGENTA"), 255, 0, 255}, {T("LIGHT MAGENTA"), 255, 0, 255},
{_T("MEDIUM GREY"), 100, 100, 100}, {T("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() == T("")) || 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, T("http"), T("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(T("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(T("%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(T("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(T("User-Agent")).IsNull())
SetHeader(_T("User-Agent"), _T("wxWindows 2.x")); SetHeader(T("User-Agent"), T("wxWindows 2.x"));
switch (req) { switch (req) {
case wxHTTP_GET: case wxHTTP_GET:
tmp_buf = _T("GET"); tmp_buf = T("GET(");
break; break;
default: default:
return FALSE; return FALSE;
@@ -211,9 +211,9 @@ 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, T("%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(MBSTRINGCAST pathbuf)); Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf));
SendHeaders(); SendHeaders();
Write("\n\r", 2); Write("\n\r", 2);
@@ -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(T("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(T("Content-Length"), T("-1"));
SetHeader(_T("Content-Type"), _T("none/none")); SetHeader(T("Content-Type"), T("none/none"));
RestoreState(); RestoreState();
return TRUE; return TRUE;
} }
wxStringTokenizer token(tmp_str,_T(' ')); wxStringTokenizer token(tmp_str,T(' '));
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 T('1'):
/* INFORMATION / SUCCESS */ /* INFORMATION / SUCCESS */
break; break;
case _T('2'): case T('2'):
/* SUCCESS */ /* SUCCESS */
break; break;
case _T('3'): case T('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(T("Content-Length")).IsEmpty())
inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(_T("Content-Length"))); inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(T("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( T("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( T("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( T("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( T("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( T("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( T("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( T("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( T("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, T("invalid image") );
wxCHECK_MSG( (width > 0) && (height > 0), image, _T("invalid image size") ); wxCHECK_MSG( (width > 0) && (height > 0), image, T("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, T("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, T("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, T("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, T("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(), T("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), T("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, T("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, T("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, T("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, T("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, T("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, T("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, T("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(), T("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(), T("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, T("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, T("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, T("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(), T("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, T("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, T("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, T("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( T("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( T("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( T("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( T("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( T("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, T("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( T("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, T("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( T("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( T("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, T("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, T("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( T("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( T("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( T("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( T("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( T("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, T("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(), T("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, T("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( T("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, T("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, T("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(), T("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, T("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( T("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, T("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(T("wxGIFHandler: error in image format")); break;
case E_MEMORIA: wxLogError(_T("wxGIFHandler: couldn't allocate memory")); break; case E_MEMORIA: wxLogError(T("wxGIFHandler: couldn't allocate memory")); break;
default: wxLogError(_T("wxGIFHandler: unknown error !!!")); default: wxLogError(T("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(T("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(T("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(T("wxPCXHandler: image format unsupported")); break;
case E_MEMORIA: wxLogError(_T("wxPCXHandler: couldn't allocate memory")); break; case E_MEMORIA: wxLogError(T("wxPCXHandler: couldn't allocate memory")); break;
case E_VERSION: wxLogError(_T("wxPCXHandler: version number too low")); break; case E_VERSION: wxLogError(T("wxPCXHandler: version number too low")); break;
default: wxLogError(_T("wxPCXHandler: unknown error !!!")); default: wxLogError(T("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(T("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()==T('#'))
{ {
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()==T('P')) c=buf_stream.GetC();
switch (c) switch (c)
{ {
case _T('2'): case T('2'):
wxLogError(_T("Loading Grey Ascii PNM image is not yet implemented.")); wxLogError(T("Loading Grey Ascii PNM image is not yet implemented."));
return FALSE; return FALSE;
case _T('5'): case T('5'):
wxLogError(_T("Loading Grey Raw PNM image is not yet implemented.")); wxLogError(T("Loading Grey Raw PNM image is not yet implemented."));
return FALSE; return FALSE;
case _T('3'): case _T('6'): break; case T('3'): case T('6'): break;
default : default :
wxLogError(_T("Loading PNM image : file not recognized.")); wxLogError(T("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( T("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(T("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()==T('P'))
switch (stream.GetC()) switch (stream.GetC())
{ {
case _T('3'): case _T('6'): case T('3'): case T('6'):
stream.SeekI(pos); stream.SeekI(pos);
return TRUE; return TRUE;
} }

80
src/common/init.cpp Normal file
View File

@@ -0,0 +1,80 @@
/////////////////////////////////////////////////////////////////////////////
// Name: common/init.cpp
// Purpose: initialisation for the library
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.10.99
// RCS-ID: $Id$
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma implementation "appbase.h"
#endif
#include "wx/app.h"
#include "wx/debug.h"
// ----------------------------------------------------------------------------
// global vars
// ----------------------------------------------------------------------------
wxApp * WXDLLEXPORT wxTheApp = NULL;
wxAppInitializerFunction
wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL;
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp
{
public:
virtual int OnRun() { wxFAIL_MSG(T("unreachable")); return 0; }
};
// ----------------------------------------------------------------------------
// private vars
// ----------------------------------------------------------------------------
static size_t gs_nInitCount = 0;
// ============================================================================
// implementation
// ============================================================================
bool WXDLLEXPORT wxInitialize()
{
if ( gs_nInitCount++ )
{
// already initialized
return TRUE;
}
wxASSERT_MSG( !wxTheApp,
T("either call wxInitialize or create app, not both!") );
wxTheApp = new wxConsoleApp;
return wxTheApp != NULL;
}
void WXDLLEXPORT wxUninitialize()
{
if ( !--gs_nInitCount )
{
// delete the application object
delete wxTheApp;
wxTheApp = (wxApp *)NULL;
}
}

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 << T("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(T("."), 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(T("/usr/share/locale"), lang) << wxPATH_SEP
<< GetAllMsgCatalogSubdirs(_T("/usr/lib/locale"), lang) << wxPATH_SEP << GetAllMsgCatalogSubdirs(T("/usr/lib/locale"), lang) << wxPATH_SEP
<< GetAllMsgCatalogSubdirs(_T("/usr/local/share/locale"), lang); << GetAllMsgCatalogSubdirs(T("/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, T('_'));
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,9 +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;
// Then why do you translate at all? Just use _T() and not _(). RR. wxLogVerbose(T("looking for catalog '%s' in path '%s'."),
wxLogVerbose(_("looking for catalog '%s' in path '%s'."),
szName.c_str(), searchPath.c_str()); szName.c_str(), searchPath.c_str());
wxString strFullName; wxString strFullName;
@@ -498,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(T("wxstd"));
return bOk; return bOk;
} }
@@ -530,13 +528,17 @@ wxLocale::~wxLocale()
// get the translation of given string in current locale // get the translation of given string in current locale
const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString, const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString,
const wxChar *szDomain) const const wxChar *szDomain) const
{ {
if ( wxIsEmpty(szOrigString) ) if ( wxIsEmpty(szOrigString) )
return szDomain; return szDomain;
const char *pszTrans = NULL; const char *pszTrans = NULL;
#if wxUSE_UNICODE
const wxWX2MBbuf szOrgString = wxConvCurrent->cWX2MB(szOrigString); const wxWX2MBbuf szOrgString = wxConvCurrent->cWX2MB(szOrigString);
#else // ANSI
#define szOrgString szOrigString
#endif // Unicode/ANSI
wxMsgCatalog *pMsgCat; wxMsgCatalog *pMsgCat;
if ( szDomain != NULL ) { if ( szDomain != NULL ) {
@@ -583,7 +585,16 @@ const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString,
return (wxMB2WXbuf)(szOrigString); return (wxMB2WXbuf)(szOrigString);
} }
else else
return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans)); {
// FIXME it was
// return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans));
// before, but we don't want to use wxConvCurrent explicitly to
// avoid linking unnecessary code in ANSI programs without MB
// support
return (wxMB2WXbuf)(pszTrans);
}
#undef szOrgString
} }
// find catalog by name in a linked list, return NULL if !found // find catalog by name in a linked list, return NULL if !found

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(T("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(T("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, T("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") ); T("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") ); T("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") ); T("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") ); T("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") ); T("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") ); T("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( T("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") ); T("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, T("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") ); T("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

@@ -30,17 +30,17 @@
// wxWindows // wxWindows
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/window.h" #include "wx/string.h"
#ifdef __WXMSW__ #include "wx/intl.h"
#include "wx/msw/private.h" #include "wx/app.h"
#endif
#include "wx/event.h" #if wxUSE_GUI
#include "wx/app.h" #include "wx/window.h"
#include "wx/string.h" #ifdef __WXMSW__
#include "wx/intl.h" #include "wx/msw/private.h"
#ifndef wxUSE_NOGUI #endif
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#endif #endif
#endif //WX_PRECOMP #endif //WX_PRECOMP
#include "wx/file.h" #include "wx/file.h"
@@ -249,15 +249,11 @@ wxLog *wxLog::GetActiveTarget()
if ( !s_bInGetActiveTarget ) { if ( !s_bInGetActiveTarget ) {
s_bInGetActiveTarget = TRUE; s_bInGetActiveTarget = TRUE;
#ifdef wxUSE_NOGUI
ms_pLogger = new wxLogStderr;
#else // GUI
// ask the application to create a log target for us // ask the application to create a log target for us
if ( wxTheApp != NULL ) if ( wxTheApp != NULL )
ms_pLogger = wxTheApp->CreateLogTarget(); ms_pLogger = wxTheApp->CreateLogTarget();
else else
ms_pLogger = new wxLogStderr; ms_pLogger = new wxLogStderr;
#endif // !GUI/GUI
s_bInGetActiveTarget = FALSE; s_bInGetActiveTarget = FALSE;
@@ -299,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 << T(": ");
} }
} }
@@ -343,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(T("DoLogString must be overriden if it's called."));
} }
void wxLog::Flush() void wxLog::Flush()
@@ -367,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 << T('\n');
fputs(str.mb_str(), m_fp); fputs(str.mb_str(), m_fp);
fflush(m_fp); fflush(m_fp);
@@ -375,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 + T('\r'));
#endif // MSW #endif // MSW
} }
@@ -394,7 +390,7 @@ wxLogStream::wxLogStream(ostream *ostr)
void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{ {
(*m_ostr) << wxConvCurrent->cWX2MB(szString) << endl << flush; (*m_ostr) << wxConvertWX2MB(szString) << endl;
} }
#endif // wxUSE_STD_IOSTREAM #endif // wxUSE_STD_IOSTREAM
@@ -410,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 = T("%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;
@@ -491,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] = T('\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
@@ -499,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] == T('\r') )
s_szBuf[len - 2] = _T('\0'); s_szBuf[len - 2] = T('\0');
} }
return s_szBuf; return s_szBuf;
@@ -566,30 +562,28 @@ 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, T("%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, T("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, T(": "));
wxStrcat(szBuf, szMsg); wxStrcat(szBuf, szMsg);
} }
else { else {
wxStrcat(szBuf, _T(".")); wxStrcat(szBuf, T("."));
} }
if ( !s_bNoAsserts ) { if ( !s_bNoAsserts ) {
// send it to the normal log destination // send it to the normal log destination
wxLogDebug(szBuf); wxLogDebug(szBuf);
#if wxUSE_NOGUI #if wxUSE_GUI
Trap();
#else // 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, T("\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."));
@@ -605,7 +599,9 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg)
//case wxNO: nothing to do //case wxNO: nothing to do
} }
#endif // !GUI/GUI #else // !GUI
Trap();
#endif // GUI/!GUI
} }
s_bInAssert = FALSE; s_bInAssert = FALSE;

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(T("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(T("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(T(""));
if (m_fileName) if (m_fileName)
msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(T("%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 += T("object");
wxString msg2; wxString msg2;
msg2.Printf(_T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); msg2.Printf(T(" 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(T("%s(%d): "), m_fileName, (int)m_lineNum);
msg += _T("non-object data"); msg += T("non-object data");
wxString msg2; wxString msg2;
msg2.Printf(_T(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize()); msg2.Printf(T(" 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(T(""));
if (m_fileName) if (m_fileName)
msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(T("%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 += T("unknown object class");
wxString msg2(""); wxString msg2("");
msg2.Printf(_T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
msg += msg2; msg += msg2;
wxLogDebug(msg); wxLogDebug(msg);
} }
else else
{ {
wxString msg(_T("")); wxString msg(T(""));
if (m_fileName) if (m_fileName)
msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); msg.Printf(T("%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(T("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(T("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 = T("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(T("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
} }
else else
{ {
wxLogDebug( _T("----- Memory dump -----") ); wxLogDebug( T("----- 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( T("") );
wxLogDebug( _T("") ); wxLogDebug( T("") );
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 = T("application");
wxString appNameStr(_T("")); wxString appNameStr(T(""));
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(T("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
} }
else else
{ {
wxLogDebug( _T("----- Memory statistics -----") ); wxLogDebug( T("----- 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 = T("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(T("%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(T(""));
} }
SetDebugMode(currentMode); SetDebugMode(currentMode);
wxLogDebug(_T("Number of object items: %ld"), noObjectNodes); wxLogDebug(T("Number of object items: %ld"), noObjectNodes);
wxLogDebug(_T("Number of non-object items: %ld"), noNonObjectNodes); wxLogDebug(T("Number of non-object items: %ld"), noNonObjectNodes);
wxLogDebug(_T("Total allocated size: %ld"), totalSize); wxLogDebug(T("Total allocated size: %ld"), totalSize);
wxLogDebug(_T("")); wxLogDebug(T(""));
wxLogDebug(_T("")); wxLogDebug(T(""));
return TRUE; return TRUE;
#else #else
@@ -822,13 +822,13 @@ bool wxDebugContext::PrintClasses(void)
// if (TRUE) // if (TRUE)
{ {
wxChar* appName = _T("application"); wxChar* appName = T("application");
wxString appNameStr(_T("")); wxString appNameStr(T(""));
if (wxTheApp) if (wxTheApp)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr; appName = WXSTRINGCAST appNameStr;
wxLogDebug(_T("----- Classes in %s -----"), appName); wxLogDebug(T("----- 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 += T(" ");
if (info->GetBaseClassName1() && !info->GetBaseClassName2()) if (info->GetBaseClassName1() && !info->GetBaseClassName2())
{ {
msg += _T("is a "); msg += T("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 += T("is a ");
msg += info->GetBaseClassName1() ; msg += info->GetBaseClassName1() ;
msg += _T(", "); msg += T(", ");
msg += info->GetBaseClassName2() ; msg += info->GetBaseClassName2() ;
} }
if (info->GetConstructor()) if (info->GetConstructor())
msg += _T(": dynamic"); msg += T(": dynamic");
wxLogDebug(msg); wxLogDebug(msg);
} }
node = wxClassInfo::sm_classTable->Next(); node = wxClassInfo::sm_classTable->Next();
n ++; n ++;
} }
wxLogDebug(_T("")); wxLogDebug(T(""));
wxLogDebug(_T("There are %d classes derived from wxObject."), n); wxLogDebug(T("There are %d classes derived from wxObject."), n);
wxLogDebug(_T("")); wxLogDebug(T(""));
wxLogDebug(_T("")); wxLogDebug(T(""));
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(T("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, T("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, T("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, T("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 != T('\0'); pc++ ) {
if ( *pc == _T('%') ) { if ( *pc == T('%') ) {
switch ( *++pc ) { switch ( *++pc ) {
case _T('s'): case T('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) == T('"') )
str << params.GetFileName(); str << params.GetFileName();
else else
str << _T('"') << params.GetFileName() << _T('"'); str << T('"') << params.GetFileName() << T('"');
#endif #endif
str << params.GetFileName(); str << params.GetFileName();
hasFilename = TRUE; hasFilename = TRUE;
break; break;
case _T('t'): case T('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 << T('\'') << params.GetMimeType() << T('\'');
break; break;
case _T('{'): case T('{'):
{ {
const wxChar *pEnd = wxStrchr(pc, _T('}')); const wxChar *pEnd = wxStrchr(pc, T('}'));
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 << T("%{");
} }
else { else {
wxString param(pc + 1, pEnd - pc - 1); wxString param(pc + 1, pEnd - pc - 1);
str << _T('\'') << params.GetParamValue(param) << _T('\''); str << T('\'') << params.GetParamValue(param) << T('\'');
pc = pEnd; pc = pEnd;
} }
} }
break; break;
case _T('n'): case T('n'):
case _T('F'): case T('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(T("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 << T(" < '") << params.GetFileName() << T('\'');
} }
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(T('*')) == wxNOT_FOUND,
_T("first MIME type can't contain wildcards") ); T("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(T('/')).IsSameAs(mimeType.BeforeFirst(T('/')), FALSE) )
{ {
wxString strSubtype = wildcard.AfterFirst(_T('/')); wxString strSubtype = wildcard.AfterFirst(T('/'));
if ( strSubtype == _T("*") || if ( strSubtype == T("*") ||
strSubtype.IsSameAs(mimeType.AfterFirst(_T('/')), FALSE) ) strSubtype.IsSameAs(mimeType.AfterFirst(T('/')), 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 << T("\\shell\\") << verb << T("\\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(T(""), 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] == T('%') &&
(n + 1 < len) && command[n + 1] == _T('1') ) { (n + 1 < len) && command[n + 1] == T('1') ) {
// replace it with '%s' // replace it with '%s'
command[n + 1] = _T('s'); command[n + 1] = T('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 << T(" %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(T("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(T("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*/ T(".") + m_ext);
if ( key.Open() && key.QueryValue(_T("Content Type"), *mimeType) ) { if ( key.Open() && key.QueryValue(T("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 << T("\\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(T(""), 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(T(',')),
strIndex = strIcon.AfterLast(_T(',')); strIndex = strIcon.AfterLast(T(','));
// 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 = T("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(T("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(T(""), *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] != T('.') ) {
str = _T('.'); str = T('.');
} }
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(T(""), 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 = T("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(T("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(T("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(T("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 == T(' ') || *p == T(',') || *p == T('\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 == T('\0') )
break; break;
} }
else if ( *p == _T('.') ) { else if ( *p == T('.') ) {
// 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 += T('.');
} }
//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"), T("/etc"),
_T("/usr/etc"), T("/usr/etc"),
_T("/usr/local/etc"), T("/usr/local/etc"),
_T("/etc/mail"), T("/etc/mail"),
_T("/usr/public/lib") T("/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 + T("/mailcap");
if ( wxFile::Exists(file) ) { if ( wxFile::Exists(file) ) {
ReadMailcap(file); ReadMailcap(file);
} }
file = dir + _T("/mime.types"); file = dir + T("/mime.types");
if ( wxFile::Exists(file) ) { if ( wxFile::Exists(file) ) {
ReadMimeTypes(file); ReadMimeTypes(file);
} }
} }
wxString strHome = wxGetenv(_T("HOME")); wxString strHome = wxGetenv(T("HOME"));
// and now the users mailcap // and now the users mailcap
wxString strUserMailcap = strHome + _T("/.mailcap"); wxString strUserMailcap = strHome + T("/.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 + T("/.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(T(' '));
extensions = extensions.AfterFirst(_T(' ')); extensions = extensions.AfterFirst(T(' '));
// 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(T('/'));
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(T('/')) == strCategory ) &&
m_aTypes[n].AfterFirst(_T('/')) == _T("*") ) { m_aTypes[n].AfterFirst(T('/')) == T("*") ) {
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 += T(' ');
} }
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(""), T(""),
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(T(""));
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(T("--- 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 == T('#') ) {
// 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, T('='));
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 != T('\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 == T('"') ) {
// 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, T('"'));
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 == T('"') ) {
// 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 == T('\0'),
nextFieldOnSameLine = FALSE; nextFieldOnSameLine = FALSE;
if ( !entryEnded ) { if ( !entryEnded ) {
nextFieldOnSameLine = ((*pc != _T('\\')) || (pc[1] != _T('\0'))); nextFieldOnSameLine = ((*pc != T('\\')) || (pc[1] != T('\0')));
} }
// now see what we got // now see what we got
if ( strLHS == _T("type") ) { if ( strLHS == T("type") ) {
strMimeType = strRHS; strMimeType = strRHS;
} }
else if ( strLHS == _T("desc") ) { else if ( strLHS == T("desc") ) {
strDesc = strRHS; strDesc = strRHS;
} }
else if ( strLHS == _T("exts") ) { else if ( strLHS == T("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(T(","), T(" "));
// also deal with the leading dot // also deal with the leading dot
if ( !strExtensions.IsEmpty() && strExtensions[0] == _T('.') ) { if ( !strExtensions.IsEmpty() && strExtensions[0] == T('.') ) {
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(T("--- 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 == T('#') || *pc == T('\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 T('\\'):
// 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 == T('\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 T('\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 T(';'):
// 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(T('/')) == wxNOT_FOUND ) {
// we interpret "type" as "type/*" // we interpret "type" as "type/*"
strType += _T("/*"); strType += T("/*");
} }
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, T('='));
if ( pEq != NULL ) { if ( pEq != NULL ) {
wxString lhs = curField.BeforeFirst(_T('=')), wxString lhs = curField.BeforeFirst(T('=')),
rhs = curField.AfterFirst(_T('=')); rhs = curField.AfterFirst(T('='));
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 == T("print") )
strPrintCmd = rhs; strPrintCmd = rhs;
else if ( lhs == _T("test") ) else if ( lhs == T("test") )
strTest = rhs; strTest = rhs;
else if ( lhs == _T("description") ) { else if ( lhs == T("description") ) {
// it might be quoted // it might be quoted
if ( rhs[0u] == _T('"') && if ( rhs[0u] == T('"') &&
rhs.Last() == _T('"') ) { rhs.Last() == T('"') ) {
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 == T("compose") ||
lhs == _T("composetyped") || lhs == T("composetyped") ||
lhs == _T("notes") || lhs == T("notes") ||
lhs == _T("edit") ) lhs == T("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 == T("needsterminal") )
needsterminal = TRUE; needsterminal = TRUE;
else if ( curField == _T("copiousoutput") ) else if ( curField == T("copiousoutput") )
copiousoutput = TRUE; copiousoutput = TRUE;
else if ( curField == _T("textualnewlines") ) else if ( curField == T("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 " T("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(T("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(T(""));
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 *) T("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(T("%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(T("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(T("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(T("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() != T("")))
{ {
wxStrcpy(buf, m_zoomControl->GetStringSelection()); wxStrcpy(buf, m_zoomControl->GetStringSelection());
buf[wxStrlen(buf) - 1] = 0; buf[wxStrlen(buf) - 1] = 0;

View File

@@ -422,7 +422,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxLB_EXTENDED", wxLB_EXTENDED }, { "wxLB_EXTENDED", wxLB_EXTENDED },
{ "wxLB_NEEDED_SB", wxLB_NEEDED_SB }, { "wxLB_NEEDED_SB", wxLB_NEEDED_SB },
{ "wxLB_ALWAYS_SB", wxLB_ALWAYS_SB }, { "wxLB_ALWAYS_SB", wxLB_ALWAYS_SB },
{ "wxLB_SORT", wxLB_SORT }, { "wxLB_SORT(", wxLB_SORT },
{ "wxLB_OWNERDRAW", wxLB_OWNERDRAW }, { "wxLB_OWNERDRAW", wxLB_OWNERDRAW },
{ "wxLB_HSCROLL", wxLB_HSCROLL }, { "wxLB_HSCROLL", wxLB_HSCROLL },
@@ -430,7 +430,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxCB_SIMPLE", wxCB_SIMPLE }, { "wxCB_SIMPLE", wxCB_SIMPLE },
{ "wxCB_DROPDOWN", wxCB_DROPDOWN }, { "wxCB_DROPDOWN", wxCB_DROPDOWN },
{ "wxCB_READONLY", wxCB_READONLY }, { "wxCB_READONLY", wxCB_READONLY },
{ "wxCB_SORT", wxCB_SORT }, { "wxCB_SORT(", wxCB_SORT },
/* wxGauge */ /* wxGauge */
{ "wxGA_PROGRESSBAR", wxGA_PROGRESSBAR }, { "wxGA_PROGRESSBAR", wxGA_PROGRESSBAR },
@@ -457,9 +457,9 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxSL_VERTICAL", wxSL_VERTICAL }, { "wxSL_VERTICAL", wxSL_VERTICAL },
{ "wxSL_AUTOTICKS", wxSL_AUTOTICKS }, { "wxSL_AUTOTICKS", wxSL_AUTOTICKS },
{ "wxSL_LABELS", wxSL_LABELS }, { "wxSL_LABELS", wxSL_LABELS },
{ "wxSL_LEFT", wxSL_LEFT }, { "wxSL_LEFT(", wxSL_LEFT },
{ "wxSL_TOP", wxSL_TOP }, { "wxSL_TOP", wxSL_TOP },
{ "wxSL_RIGHT", wxSL_RIGHT }, { "wxSL_RIGHT(", wxSL_RIGHT },
{ "wxSL_BOTTOM", wxSL_BOTTOM }, { "wxSL_BOTTOM", wxSL_BOTTOM },
{ "wxSL_BOTH", wxSL_BOTH }, { "wxSL_BOTH", wxSL_BOTH },
{ "wxSL_SELRANGE", wxSL_SELRANGE }, { "wxSL_SELRANGE", wxSL_SELRANGE },
@@ -475,17 +475,17 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
/* wxTreeCtrl */ /* wxTreeCtrl */
{ "wxTR_HAS_BUTTONS", wxTR_HAS_BUTTONS }, { "wxTR_HAS_BUTTONS", wxTR_HAS_BUTTONS },
{ "wxTR_EDIT_LABELS", wxTR_EDIT_LABELS }, { "wxTR_EDIT_LABELS", wxTR_EDIT_LABELS },
{ "wxTR_LINES_AT_ROOT", wxTR_LINES_AT_ROOT }, { "wxTR_LINES_AT_ROOT(", wxTR_LINES_AT_ROOT },
/* wxListCtrl */ /* wxListCtrl */
{ "wxLC_ICON", wxLC_ICON }, { "wxLC_ICON", wxLC_ICON },
{ "wxLC_SMALL_ICON", wxLC_SMALL_ICON }, { "wxLC_SMALL_ICON", wxLC_SMALL_ICON },
{ "wxLC_LIST", wxLC_LIST }, { "wxLC_LIST(", wxLC_LIST },
{ "wxLC_REPORT", wxLC_REPORT }, { "wxLC_REPORT(", wxLC_REPORT },
{ "wxLC_ALIGN_TOP", wxLC_ALIGN_TOP }, { "wxLC_ALIGN_TOP", wxLC_ALIGN_TOP },
{ "wxLC_ALIGN_LEFT", wxLC_ALIGN_LEFT }, { "wxLC_ALIGN_LEFT(", wxLC_ALIGN_LEFT },
{ "wxLC_AUTOARRANGE", wxLC_AUTOARRANGE }, { "wxLC_AUTOARRANGE", wxLC_AUTOARRANGE },
{ "wxLC_USER_TEXT", wxLC_USER_TEXT }, { "wxLC_USER_TEXT(", wxLC_USER_TEXT },
{ "wxLC_EDIT_LABELS", wxLC_EDIT_LABELS }, { "wxLC_EDIT_LABELS", wxLC_EDIT_LABELS },
{ "wxLC_NO_HEADER", wxLC_NO_HEADER }, { "wxLC_NO_HEADER", wxLC_NO_HEADER },
{ "wxLC_NO_SORT_HEADER", wxLC_NO_SORT_HEADER }, { "wxLC_NO_SORT_HEADER", wxLC_NO_SORT_HEADER },
@@ -515,17 +515,17 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
/* wxControl */ /* wxControl */
{ "wxFIXED_LENGTH", wxFIXED_LENGTH}, { "wxFIXED_LENGTH", wxFIXED_LENGTH},
{ "wxALIGN_LEFT", wxALIGN_LEFT}, { "wxALIGN_LEFT(", wxALIGN_LEFT},
{ "wxALIGN_CENTER", wxALIGN_CENTER}, { "wxALIGN_CENTER", wxALIGN_CENTER},
{ "wxALIGN_CENTRE", wxALIGN_CENTRE}, { "wxALIGN_CENTRE", wxALIGN_CENTRE},
{ "wxALIGN_RIGHT", wxALIGN_RIGHT}, { "wxALIGN_RIGHT(", wxALIGN_RIGHT},
{ "wxCOLOURED", wxCOLOURED}, { "wxCOLOURED", wxCOLOURED},
/* wxToolBar */ /* wxToolBar */
{ "wxTB_3DBUTTONS", wxTB_3DBUTTONS}, { "wxTB_3DBUTTONS", wxTB_3DBUTTONS},
{ "wxTB_HORIZONTAL", wxTB_HORIZONTAL}, { "wxTB_HORIZONTAL", wxTB_HORIZONTAL},
{ "wxTB_VERTICAL", wxTB_VERTICAL}, { "wxTB_VERTICAL", wxTB_VERTICAL},
{ "wxTB_FLAT", wxTB_FLAT}, { "wxTB_FLAT(", wxTB_FLAT},
/* Generic */ /* Generic */
{ "wxVSCROLL", wxVSCROLL }, { "wxVSCROLL", wxVSCROLL },
@@ -536,7 +536,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxMINIMIZE", wxICONIZE}, { "wxMINIMIZE", wxICONIZE},
{ "wxMAXIMIZE", wxMAXIMIZE}, { "wxMAXIMIZE", wxMAXIMIZE},
{ "wxSDI", 0}, { "wxSDI", 0},
{ "wxMDI_PARENT", 0}, { "wxMDI_PARENT(", 0},
{ "wxMDI_CHILD", 0}, { "wxMDI_CHILD", 0},
{ "wxTHICK_FRAME", wxTHICK_FRAME}, { "wxTHICK_FRAME", wxTHICK_FRAME},
{ "wxRESIZE_BORDER", wxRESIZE_BORDER}, { "wxRESIZE_BORDER", wxRESIZE_BORDER},
@@ -552,7 +552,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxNATIVE_IMPL", 0}, { "wxNATIVE_IMPL", 0},
{ "wxEXTENDED_IMPL", 0}, { "wxEXTENDED_IMPL", 0},
{ "wxBACKINGSTORE", wxBACKINGSTORE}, { "wxBACKINGSTORE", wxBACKINGSTORE},
// { "wxFLAT", wxFLAT}, // { "wxFLAT(", wxFLAT},
// { "wxMOTIF_RESIZE", wxMOTIF_RESIZE}, // { "wxMOTIF_RESIZE", wxMOTIF_RESIZE},
{ "wxFIXED_LENGTH", 0}, { "wxFIXED_LENGTH", 0},
{ "wxDOUBLE_BORDER", wxDOUBLE_BORDER}, { "wxDOUBLE_BORDER", wxDOUBLE_BORDER},
@@ -565,30 +565,30 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxCLIP_CHILDREN", wxCLIP_CHILDREN}, { "wxCLIP_CHILDREN", wxCLIP_CHILDREN},
{ "wxTINY_CAPTION_HORIZ", wxTINY_CAPTION_HORIZ}, { "wxTINY_CAPTION_HORIZ", wxTINY_CAPTION_HORIZ},
{ "wxTINY_CAPTION_VERT", wxTINY_CAPTION_VERT}, { "wxTINY_CAPTION_VERT(", wxTINY_CAPTION_VERT},
// Text font families // Text font families
{ "wxDEFAULT", wxDEFAULT}, { "wxDEFAULT(", wxDEFAULT},
{ "wxDECORATIVE", wxDECORATIVE}, { "wxDECORATIVE", wxDECORATIVE},
{ "wxROMAN", wxROMAN}, { "wxROMAN", wxROMAN},
{ "wxSCRIPT", wxSCRIPT}, { "wxSCRIPT(", wxSCRIPT},
{ "wxSWISS", wxSWISS}, { "wxSWISS", wxSWISS},
{ "wxMODERN", wxMODERN}, { "wxMODERN", wxMODERN},
{ "wxTELETYPE", wxTELETYPE}, { "wxTELETYPE", wxTELETYPE},
{ "wxVARIABLE", wxVARIABLE}, { "wxVARIABLE", wxVARIABLE},
{ "wxFIXED", wxFIXED}, { "wxFIXED", wxFIXED},
{ "wxNORMAL", wxNORMAL}, { "wxNORMAL", wxNORMAL},
{ "wxLIGHT", wxLIGHT}, { "wxLIGHT(", wxLIGHT},
{ "wxBOLD", wxBOLD}, { "wxBOLD", wxBOLD},
{ "wxITALIC", wxITALIC}, { "wxITALIC", wxITALIC},
{ "wxSLANT", wxSLANT}, { "wxSLANT(", wxSLANT},
{ "wxSOLID", wxSOLID}, { "wxSOLID", wxSOLID},
{ "wxDOT", wxDOT}, { "wxDOT(", wxDOT},
{ "wxLONG_DASH", wxLONG_DASH}, { "wxLONG_DASH", wxLONG_DASH},
{ "wxSHORT_DASH", wxSHORT_DASH}, { "wxSHORT_DASH", wxSHORT_DASH},
{ "wxDOT_DASH", wxDOT_DASH}, { "wxDOT_DASH", wxDOT_DASH},
{ "wxUSER_DASH", wxUSER_DASH}, { "wxUSER_DASH", wxUSER_DASH},
{ "wxTRANSPARENT", wxTRANSPARENT}, { "wxTRANSPARENT(", wxTRANSPARENT},
{ "wxSTIPPLE", wxSTIPPLE}, { "wxSTIPPLE", wxSTIPPLE},
{ "wxBDIAGONAL_HATCH", wxBDIAGONAL_HATCH}, { "wxBDIAGONAL_HATCH", wxBDIAGONAL_HATCH},
{ "wxCROSSDIAG_HATCH", wxCROSSDIAG_HATCH}, { "wxCROSSDIAG_HATCH", wxCROSSDIAG_HATCH},
@@ -601,25 +601,25 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxJOIN_ROUND", wxJOIN_ROUND}, { "wxJOIN_ROUND", wxJOIN_ROUND},
{ "wxCAP_ROUND", wxCAP_ROUND}, { "wxCAP_ROUND", wxCAP_ROUND},
{ "wxCAP_PROJECTING", wxCAP_PROJECTING}, { "wxCAP_PROJECTING", wxCAP_PROJECTING},
{ "wxCAP_BUTT", wxCAP_BUTT}, { "wxCAP_BUTT(", wxCAP_BUTT},
// Logical ops // Logical ops
{ "wxCLEAR", wxCLEAR}, { "wxCLEAR", wxCLEAR},
{ "wxXOR", wxXOR}, { "wxXOR", wxXOR},
{ "wxINVERT", wxINVERT}, { "wxINVERT(", wxINVERT},
{ "wxOR_REVERSE", wxOR_REVERSE}, { "wxOR_REVERSE", wxOR_REVERSE},
{ "wxAND_REVERSE", wxAND_REVERSE}, { "wxAND_REVERSE", wxAND_REVERSE},
{ "wxCOPY", wxCOPY}, { "wxCOPY", wxCOPY},
{ "wxAND", wxAND}, { "wxAND", wxAND},
{ "wxAND_INVERT", wxAND_INVERT}, { "wxAND_INVERT(", wxAND_INVERT},
{ "wxNO_OP", wxNO_OP}, { "wxNO_OP", wxNO_OP},
{ "wxNOR", wxNOR}, { "wxNOR", wxNOR},
{ "wxEQUIV", wxEQUIV}, { "wxEQUIV", wxEQUIV},
{ "wxSRC_INVERT", wxSRC_INVERT}, { "wxSRC_INVERT(", wxSRC_INVERT},
{ "wxOR_INVERT", wxOR_INVERT}, { "wxOR_INVERT(", wxOR_INVERT},
{ "wxNAND", wxNAND}, { "wxNAND", wxNAND},
{ "wxOR", wxOR}, { "wxOR", wxOR},
{ "wxSET", wxSET}, { "wxSET(", wxSET},
{ "wxFLOOD_SURFACE", wxFLOOD_SURFACE}, { "wxFLOOD_SURFACE", wxFLOOD_SURFACE},
{ "wxFLOOD_BORDER", wxFLOOD_BORDER}, { "wxFLOOD_BORDER", wxFLOOD_BORDER},

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 == T("")) {
wxLogWarning( _T("Trying to solve a NULL hostname: giving up") ); wxLogWarning( T("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, T("file"), NULL, FALSE)
#endif #endif
wxFileProto::wxFileProto() wxFileProto::wxFileProto()

View File

@@ -215,7 +215,7 @@ bool wxTCPConnection::Disconnect ()
return TRUE; return TRUE;
} }
bool wxTCPConnection::Execute (wxChar *data, int size, wxIPCFormat format) bool wxTCPConnection::Execute (const wxChar *data, int size, wxIPCFormat format)
{ {
if (!m_sock->IsConnected()) if (!m_sock->IsConnected())
return FALSE; return FALSE;

View File

@@ -473,7 +473,7 @@ wxSize wxBoxSizer::CalcMin()
wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient ) wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient )
: wxBoxSizer( orient ) : wxBoxSizer( orient )
{ {
wxASSERT_MSG( box, _T("wxStaticBoxSizer needs a static box") ); wxASSERT_MSG( box, T("wxStaticBoxSizer needs a static box") );
m_staticBox = box; m_staticBox = box;
} }

View File

@@ -316,7 +316,7 @@ wxSocketBase& wxSocketBase::ReadMsg(char* buffer, wxUint32 nbytes)
if (sig != 0xfeeddead) if (sig != 0xfeeddead)
{ {
wxLogMessage(_T("Warning: invalid signature returned to ReadMsg")); wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
goto exit; goto exit;
} }
@@ -374,7 +374,7 @@ wxSocketBase& wxSocketBase::ReadMsg(char* buffer, wxUint32 nbytes)
if (sig != 0xdeadfeed) if (sig != 0xdeadfeed)
{ {
//wxLogMessage(_T("Warning: invalid signature returned to ReadMsg")); //wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
goto exit; goto exit;
} }

View File

@@ -280,7 +280,7 @@ static void wxLoadCharacterSets(void)
#if defined(__UNIX__) && wxUSE_TEXTFILE #if defined(__UNIX__) && wxUSE_TEXTFILE
// search through files in /usr/share/i18n/charmaps // search through files in /usr/share/i18n/charmaps
wxString fname; wxString fname;
for (fname = ::wxFindFirstFile(_T("/usr/share/i18n/charmaps/*")); for (fname = ::wxFindFirstFile(T("/usr/share/i18n/charmaps/*"));
!fname.IsEmpty(); !fname.IsEmpty();
fname = ::wxFindNextFile()) { fname = ::wxFindNextFile()) {
wxTextFile cmap(fname); wxTextFile cmap(fname);
@@ -289,36 +289,36 @@ static void wxLoadCharacterSets(void)
wxString comchar,escchar; wxString comchar,escchar;
bool in_charset = FALSE; bool in_charset = FALSE;
// wxFprintf(stderr,_T("Loaded: %s\n"),fname.c_str()); // wxFprintf(stderr,T("Loaded: %s\n"),fname.c_str());
wxString line; wxString line;
for (line = cmap.GetFirstLine(); for (line = cmap.GetFirstLine();
!cmap.Eof(); !cmap.Eof();
line = cmap.GetNextLine()) { line = cmap.GetNextLine()) {
// wxFprintf(stderr,_T("line contents: %s\n"),line.c_str()); // wxFprintf(stderr,T("line contents: %s\n"),line.c_str());
wxStringTokenizer token(line); wxStringTokenizer token(line);
wxString cmd = token.GetNextToken(); wxString cmd = token.GetNextToken();
if (cmd == comchar) { if (cmd == comchar) {
if (token.GetNextToken() == _T("alias")) if (token.GetNextToken() == T("alias"))
cset->names.Add(token.GetNextToken()); cset->names.Add(token.GetNextToken());
} }
else if (cmd == _T("<code_set_name>")) else if (cmd == T("<code_set_name>"))
cset->names.Add(token.GetNextToken()); cset->names.Add(token.GetNextToken());
else if (cmd == _T("<comment_char>")) else if (cmd == T("<comment_char>"))
comchar = token.GetNextToken(); comchar = token.GetNextToken();
else if (cmd == _T("<escape_char>")) else if (cmd == T("<escape_char>"))
escchar = token.GetNextToken(); escchar = token.GetNextToken();
else if (cmd == _T("<mb_cur_min>")) { else if (cmd == T("<mb_cur_min>")) {
delete cset; delete cset;
cset = (wxCharacterSet *) NULL; cset = (wxCharacterSet *) NULL;
break; // we don't support multibyte charsets ourselves (yet) break; // we don't support multibyte charsets ourselves (yet)
} }
else if (cmd == _T("CHARMAP")) { else if (cmd == T("CHARMAP")) {
cset->data = (wchar_t *)calloc(256, sizeof(wchar_t)); cset->data = (wchar_t *)calloc(256, sizeof(wchar_t));
in_charset = TRUE; in_charset = TRUE;
} }
else if (cmd == _T("END")) { else if (cmd == T("END")) {
if (token.GetNextToken() == _T("CHARMAP")) if (token.GetNextToken() == T("CHARMAP"))
in_charset = FALSE; in_charset = FALSE;
} }
else if (in_charset) { else if (in_charset) {
@@ -330,15 +330,15 @@ static void wxLoadCharacterSets(void)
wxString uni = token.GetNextToken(); wxString uni = token.GetNextToken();
// skip whitespace again // skip whitespace again
while (wxIsEmpty(uni) && token.HasMoreTokens()) uni = token.GetNextToken(); while (wxIsEmpty(uni) && token.HasMoreTokens()) uni = token.GetNextToken();
if ((hex.Len() > 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == _T('x')) && if ((hex.Len() > 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == T('x')) &&
(uni.Left(2) == _T("<U"))) { (uni.Left(2) == T("<U"))) {
hex.MakeUpper(); uni.MakeUpper(); hex.MakeUpper(); uni.MakeUpper();
int pos = ::wxHexToDec(hex.Mid(2,2)); int pos = ::wxHexToDec(hex.Mid(2,2));
if (pos>=0) { if (pos>=0) {
unsigned long uni1 = ::wxHexToDec(uni.Mid(2,2)); unsigned long uni1 = ::wxHexToDec(uni.Mid(2,2));
unsigned long uni2 = ::wxHexToDec(uni.Mid(4,2)); unsigned long uni2 = ::wxHexToDec(uni.Mid(4,2));
cset->data[pos] = (uni1 << 16) | uni2; cset->data[pos] = (uni1 << 16) | uni2;
// wxFprintf(stderr,_T("char %02x mapped to %04x (%c)\n"),pos,cset->data[pos],cset->data[pos]); // wxFprintf(stderr,T("char %02x mapped to %04x (%c)\n"),pos,cset->data[pos],cset->data[pos]);
} }
} }
} }
@@ -384,15 +384,15 @@ void wxCSConv::SetName(const wxChar *charset)
#ifdef __UNIX__ #ifdef __UNIX__
// first, convert the character set name to standard form // first, convert the character set name to standard form
wxString codeset; wxString codeset;
if (wxString(charset,3).CmpNoCase(_T("ISO")) == 0) { if (wxString(charset,3).CmpNoCase(T("ISO")) == 0) {
// make sure it's represented in the standard form: ISO_8859-1 // make sure it's represented in the standard form: ISO_8859-1
codeset = _T("ISO_"); codeset = T("ISO_");
charset += 3; charset += 3;
if ((*charset == _T('-')) || (*charset == _T('_'))) charset++; if ((*charset == T('-')) || (*charset == T('_'))) charset++;
if (wxStrlen(charset)>4) { if (wxStrlen(charset)>4) {
if (wxString(charset,4) == _T("8859")) { if (wxString(charset,4) == T("8859")) {
codeset << _T("8859-"); codeset << T("8859-");
if (*charset == _T('-')) charset++; if (*charset == T('-')) charset++;
} }
} }
} }
@@ -406,12 +406,12 @@ void wxCSConv::SetName(const wxChar *charset)
void wxCSConv::LoadNow() void wxCSConv::LoadNow()
{ {
// wxPrintf(_T("Conversion request\n")); // wxPrintf(T("Conversion request\n"));
if (m_deferred) { if (m_deferred) {
if (!m_name) { if (!m_name) {
#ifdef __UNIX__ #ifdef __UNIX__
wxChar *lang = wxGetenv(_T("LANG")); wxChar *lang = wxGetenv(T("LANG"));
wxChar *dot = lang ? wxStrchr(lang, _T('.')) : (wxChar *)NULL; wxChar *dot = lang ? wxStrchr(lang, T('.')) : (wxChar *)NULL;
if (dot) SetName(dot+1); if (dot) SetName(dot+1);
#endif #endif
} }

View File

@@ -85,10 +85,10 @@ static const struct
{ {
wxStringData data; wxStringData data;
wxChar dummy; wxChar dummy;
} g_strEmpty = { {-1, 0, 0}, _T('\0') }; } g_strEmpty = { {-1, 0, 0}, T('\0') };
// empty C style string: points to 'string data' byte of g_strEmpty // empty C style string: points to 'string data' byte of g_strEmpty
extern const wxChar WXDLLEXPORT *g_szNul = &g_strEmpty.dummy; extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// conditional compilation // conditional compilation
@@ -284,7 +284,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
} }
} }
#else #else // ANSI
#if wxUSE_WCHAR_T #if wxUSE_WCHAR_T
// from wide string // from wide string
@@ -302,9 +302,9 @@ wxString::wxString(const wchar_t *pwz)
Init(); Init();
} }
} }
#endif #endif // wxUSE_WCHAR_T
#endif #endif // Unicode/ANSI
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// memory allocation // memory allocation
@@ -327,7 +327,7 @@ void wxString::AllocBuffer(size_t nLen)
pData->nDataLength = nLen; pData->nDataLength = nLen;
pData->nAllocLength = nLen + EXTRA_ALLOC; pData->nAllocLength = nLen + EXTRA_ALLOC;
m_pchData = pData->data(); // data starts after wxStringData m_pchData = pData->data(); // data starts after wxStringData
m_pchData[nLen] = _T('\0'); m_pchData[nLen] = T('\0');
} }
// must be called before changing this string // must be called before changing this string
@@ -379,7 +379,7 @@ void wxString::Alloc(size_t nLen)
pData->nDataLength = 0; pData->nDataLength = 0;
pData->nAllocLength = nLen; pData->nAllocLength = nLen;
m_pchData = pData->data(); // data starts after wxStringData m_pchData = pData->data(); // data starts after wxStringData
m_pchData[0u] = _T('\0'); m_pchData[0u] = T('\0');
} }
else if ( pData->IsShared() ) { else if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared pData->Unlock(); // memory not freed because shared
@@ -461,7 +461,7 @@ void wxString::AssignCopy(size_t nSrcLen, const wxChar *pszSrcData)
AllocBeforeWrite(nSrcLen); AllocBeforeWrite(nSrcLen);
memcpy(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar)); memcpy(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar));
GetStringData()->nDataLength = nSrcLen; GetStringData()->nDataLength = nSrcLen;
m_pchData[nSrcLen] = _T('\0'); m_pchData[nSrcLen] = T('\0');
} }
} }
@@ -563,7 +563,7 @@ void wxString::ConcatSelf(int nSrcLen, const wxChar *pszSrcData)
// fast concatenation - all is done in our buffer // fast concatenation - all is done in our buffer
memcpy(m_pchData + nLen, pszSrcData, nSrcLen*sizeof(wxChar)); memcpy(m_pchData + nLen, pszSrcData, nSrcLen*sizeof(wxChar));
m_pchData[nNewLen] = _T('\0'); // put terminating '\0' m_pchData[nNewLen] = T('\0'); // put terminating '\0'
GetStringData()->nDataLength = nNewLen; // and fix the length GetStringData()->nDataLength = nNewLen; // and fix the length
} }
//else: the string to append was empty //else: the string to append was empty
@@ -722,7 +722,7 @@ wxString wxString::Left(size_t nCount) const
wxString wxString::BeforeFirst(wxChar ch) const wxString wxString::BeforeFirst(wxChar ch) const
{ {
wxString str; wxString str;
for ( const wxChar *pc = m_pchData; *pc != _T('\0') && *pc != ch; pc++ ) for ( const wxChar *pc = m_pchData; *pc != T('\0') && *pc != ch; pc++ )
str += *pc; str += *pc;
return str; return str;
@@ -762,7 +762,7 @@ size_t wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplace
wxString strTemp; wxString strTemp;
const wxChar *pCurrent = m_pchData; const wxChar *pCurrent = m_pchData;
const wxChar *pSubstr; const wxChar *pSubstr;
while ( *pCurrent != _T('\0') ) { while ( *pCurrent != T('\0') ) {
pSubstr = wxStrstr(pCurrent, szOld); pSubstr = wxStrstr(pCurrent, szOld);
if ( pSubstr == NULL ) { if ( pSubstr == NULL ) {
// strTemp is unused if no replacements were made, so avoid the copy // strTemp is unused if no replacements were made, so avoid the copy
@@ -882,7 +882,7 @@ wxString& wxString::Trim(bool bFromRight)
psz--; psz--;
// truncate at trailing space start // truncate at trailing space start
*++psz = _T('\0'); *++psz = T('\0');
GetStringData()->nDataLength = psz - m_pchData; GetStringData()->nDataLength = psz - m_pchData;
} }
else else
@@ -924,7 +924,7 @@ wxString& wxString::Truncate(size_t uiLen)
if ( uiLen < Len() ) { if ( uiLen < Len() ) {
CopyBeforeWrite(); CopyBeforeWrite();
*(m_pchData + uiLen) = _T('\0'); *(m_pchData + uiLen) = T('\0');
GetStringData()->nDataLength = uiLen; GetStringData()->nDataLength = uiLen;
} }
//else: nothing to do, string is already short enough //else: nothing to do, string is already short enough
@@ -958,7 +958,7 @@ int wxString::Find(const wxChar *pszSub) const
wxString& wxString::operator<<(int i) wxString& wxString::operator<<(int i)
{ {
wxString res; wxString res;
res.Printf(_T("%d"), i); res.Printf(T("%d"), i);
return (*this) << res; return (*this) << res;
} }
@@ -966,7 +966,7 @@ wxString& wxString::operator<<(int i)
wxString& wxString::operator<<(float f) wxString& wxString::operator<<(float f)
{ {
wxString res; wxString res;
res.Printf(_T("%f"), f); res.Printf(T("%f"), f);
return (*this) << res; return (*this) << res;
} }
@@ -974,7 +974,7 @@ wxString& wxString::operator<<(float f)
wxString& wxString::operator<<(double d) wxString& wxString::operator<<(double d)
{ {
wxString res; wxString res;
res.Printf(_T("%g"), d); res.Printf(T("%g"), d);
return (*this) << res; return (*this) << res;
} }
@@ -1011,7 +1011,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
Reinit(); Reinit();
for (size_t n = 0; pszFormat[n]; n++) for (size_t n = 0; pszFormat[n]; n++)
if (pszFormat[n] == _T('%')) { if (pszFormat[n] == T('%')) {
static char s_szFlags[256] = "%"; static char s_szFlags[256] = "%";
size_t flagofs = 1; size_t flagofs = 1;
bool adj_left = FALSE, in_prec = FALSE, bool adj_left = FALSE, in_prec = FALSE,
@@ -1021,55 +1021,55 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
do { do {
#define CHECK_PREC if (in_prec && !prec_dot) { s_szFlags[flagofs++] = '.'; prec_dot = TRUE; } #define CHECK_PREC if (in_prec && !prec_dot) { s_szFlags[flagofs++] = '.'; prec_dot = TRUE; }
switch (pszFormat[++n]) { switch (pszFormat[++n]) {
case _T('\0'): case T('\0'):
done = TRUE; done = TRUE;
break; break;
case _T('%'): case T('%'):
*this += _T('%'); *this += T('%');
done = TRUE; done = TRUE;
break; break;
case _T('#'): case T('#'):
case _T('0'): case T('0'):
case _T(' '): case T(' '):
case _T('+'): case T('+'):
case _T('\''): case T('\''):
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
break; break;
case _T('-'): case T('-'):
CHECK_PREC CHECK_PREC
adj_left = TRUE; adj_left = TRUE;
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
break; break;
case _T('.'): case T('.'):
CHECK_PREC CHECK_PREC
in_prec = TRUE; in_prec = TRUE;
prec_dot = FALSE; prec_dot = FALSE;
max_width = 0; max_width = 0;
// dot will be auto-added to s_szFlags if non-negative number follows // dot will be auto-added to s_szFlags if non-negative number follows
break; break;
case _T('h'): case T('h'):
ilen = -1; ilen = -1;
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
break; break;
case _T('l'): case T('l'):
ilen = 1; ilen = 1;
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
break; break;
case _T('q'): case T('q'):
case _T('L'): case T('L'):
ilen = 2; ilen = 2;
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
break; break;
case _T('Z'): case T('Z'):
ilen = 3; ilen = 3;
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
break; break;
case _T('*'): case T('*'):
{ {
int len = va_arg(argptr, int); int len = va_arg(argptr, int);
if (in_prec) { if (in_prec) {
@@ -1087,15 +1087,15 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
flagofs += ::sprintf(s_szFlags+flagofs,"%d",len); flagofs += ::sprintf(s_szFlags+flagofs,"%d",len);
} }
break; break;
case _T('1'): case _T('2'): case _T('3'): case T('1'): case T('2'): case T('3'):
case _T('4'): case _T('5'): case _T('6'): case T('4'): case T('5'): case T('6'):
case _T('7'): case _T('8'): case _T('9'): case T('7'): case T('8'): case T('9'):
{ {
int len = 0; int len = 0;
CHECK_PREC CHECK_PREC
while ((pszFormat[n]>=_T('0')) && (pszFormat[n]<=_T('9'))) { while ((pszFormat[n]>=T('0')) && (pszFormat[n]<=T('9'))) {
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
len = len*10 + (pszFormat[n] - _T('0')); len = len*10 + (pszFormat[n] - T('0'));
n++; n++;
} }
if (in_prec) max_width = len; if (in_prec) max_width = len;
@@ -1103,12 +1103,12 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
n--; // the main loop pre-increments n again n--; // the main loop pre-increments n again
} }
break; break;
case _T('d'): case T('d'):
case _T('i'): case T('i'):
case _T('o'): case T('o'):
case _T('u'): case T('u'):
case _T('x'): case T('x'):
case _T('X'): case T('X'):
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
s_szFlags[flagofs] = '\0'; s_szFlags[flagofs] = '\0';
@@ -1140,11 +1140,11 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
*this += wxString(s_szScratch); *this += wxString(s_szScratch);
done = TRUE; done = TRUE;
break; break;
case _T('e'): case T('e'):
case _T('E'): case T('E'):
case _T('f'): case T('f'):
case _T('g'): case T('g'):
case _T('G'): case T('G'):
CHECK_PREC CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
s_szFlags[flagofs] = '\0'; s_szFlags[flagofs] = '\0';
@@ -1158,7 +1158,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
*this += wxString(s_szScratch); *this += wxString(s_szScratch);
done = TRUE; done = TRUE;
break; break;
case _T('p'): case T('p'):
{ {
void *val = va_arg(argptr, void *); void *val = va_arg(argptr, void *);
CHECK_PREC CHECK_PREC
@@ -1169,7 +1169,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
done = TRUE; done = TRUE;
} }
break; break;
case _T('c'): case T('c'):
{ {
wxChar val = va_arg(argptr, int); wxChar val = va_arg(argptr, int);
// we don't need to honor padding here, do we? // we don't need to honor padding here, do we?
@@ -1177,7 +1177,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
done = TRUE; done = TRUE;
} }
break; break;
case _T('s'): case T('s'):
if (ilen == -1) { if (ilen == -1) {
// wx extension: we'll let %hs mean non-Unicode strings // wx extension: we'll let %hs mean non-Unicode strings
char *val = va_arg(argptr, char *); char *val = va_arg(argptr, char *);
@@ -1188,26 +1188,26 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
size_t len = wxSTRING_MAXLEN; size_t len = wxSTRING_MAXLEN;
if (val) { if (val) {
for (len = 0; val[len] && (len<max_width); len++); for (len = 0; val[len] && (len<max_width); len++);
} else val = _T("(null)"); } else val = T("(null)");
wxString s(val, len); wxString s(val, len);
#endif #endif
if (s.Len() < min_width) if (s.Len() < min_width)
s.Pad(min_width - s.Len(), _T(' '), adj_left); s.Pad(min_width - s.Len(), T(' '), adj_left);
*this += s; *this += s;
} else { } else {
wxChar *val = va_arg(argptr, wxChar *); wxChar *val = va_arg(argptr, wxChar *);
size_t len = wxSTRING_MAXLEN; size_t len = wxSTRING_MAXLEN;
if (val) { if (val) {
for (len = 0; val[len] && (len<max_width); len++); for (len = 0; val[len] && (len<max_width); len++);
} else val = _T("(null)"); } else val = T("(null)");
wxString s(val, len); wxString s(val, len);
if (s.Len() < min_width) if (s.Len() < min_width)
s.Pad(min_width - s.Len(), _T(' '), adj_left); s.Pad(min_width - s.Len(), T(' '), adj_left);
*this += s; *this += s;
} }
done = TRUE; done = TRUE;
break; break;
case _T('n'): case T('n'):
if (ilen == 0) { if (ilen == 0) {
int *val = va_arg(argptr, int *); int *val = va_arg(argptr, int *);
*val = Len(); *val = Len();
@@ -1228,7 +1228,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs++] = pszFormat[n];
else { else {
// bad format // bad format
*this += _T('%'); // just to pass the glibc tst-printf.c *this += T('%'); // just to pass the glibc tst-printf.c
n--; n--;
done = TRUE; done = TRUE;
} }
@@ -1287,29 +1287,29 @@ bool wxString::Matches(const wxChar *pszMask) const
{ {
// check char by char // check char by char
const wxChar *pszTxt; const wxChar *pszTxt;
for ( pszTxt = c_str(); *pszMask != _T('\0'); pszMask++, pszTxt++ ) { for ( pszTxt = c_str(); *pszMask != T('\0'); pszMask++, pszTxt++ ) {
switch ( *pszMask ) { switch ( *pszMask ) {
case _T('?'): case T('?'):
if ( *pszTxt == _T('\0') ) if ( *pszTxt == T('\0') )
return FALSE; return FALSE;
// pszText and pszMask will be incremented in the loop statement // pszText and pszMask will be incremented in the loop statement
break; break;
case _T('*'): case T('*'):
{ {
// ignore special chars immediately following this one // ignore special chars immediately following this one
while ( *pszMask == _T('*') || *pszMask == _T('?') ) while ( *pszMask == T('*') || *pszMask == T('?') )
pszMask++; pszMask++;
// if there is nothing more, match // if there is nothing more, match
if ( *pszMask == _T('\0') ) if ( *pszMask == T('\0') )
return TRUE; return TRUE;
// are there any other metacharacters in the mask? // are there any other metacharacters in the mask?
size_t uiLenMask; size_t uiLenMask;
const wxChar *pEndMask = wxStrpbrk(pszMask, _T("*?")); const wxChar *pEndMask = wxStrpbrk(pszMask, T("*?"));
if ( pEndMask != NULL ) { if ( pEndMask != NULL ) {
// we have to match the string between two metachars // we have to match the string between two metachars
@@ -1339,7 +1339,7 @@ bool wxString::Matches(const wxChar *pszMask) const
} }
// match only if nothing left // match only if nothing left
return *pszTxt == _T('\0'); return *pszTxt == T('\0');
} }
// Count the number of chars // Count the number of chars

View File

@@ -88,7 +88,7 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
if ( !filenameToUse ) if ( !filenameToUse )
{ {
// what kind of message to give? is it an error or a program bug? // what kind of message to give? is it an error or a program bug?
wxLogDebug(_T("Can't save textctrl to file without filename.")); wxLogDebug(T("Can't save textctrl to file without filename."));
return FALSE; return FALSE;
} }
@@ -122,7 +122,7 @@ wxTextCtrl& wxTextCtrlBase::operator<<(const wxString& s)
wxTextCtrl& wxTextCtrlBase::operator<<(float f) wxTextCtrl& wxTextCtrlBase::operator<<(float f)
{ {
wxString str; wxString str;
str.Printf(_T("%.2f"), f); str.Printf(T("%.2f"), f);
AppendText(str); AppendText(str);
return *TEXTCTRL(this); return *TEXTCTRL(this);
} }
@@ -130,7 +130,7 @@ wxTextCtrl& wxTextCtrlBase::operator<<(float f)
wxTextCtrl& wxTextCtrlBase::operator<<(double d) wxTextCtrl& wxTextCtrlBase::operator<<(double d)
{ {
wxString str; wxString str;
str.Printf(_T("%.2f"), d); str.Printf(T("%.2f"), d);
AppendText(str); AppendText(str);
return *TEXTCTRL(this); return *TEXTCTRL(this);
} }
@@ -138,7 +138,7 @@ wxTextCtrl& wxTextCtrlBase::operator<<(double d)
wxTextCtrl& wxTextCtrlBase::operator<<(int i) wxTextCtrl& wxTextCtrlBase::operator<<(int i)
{ {
wxString str; wxString str;
str.Printf(_T("%d"), i); str.Printf(T("%d"), i);
AppendText(str); AppendText(str);
return *TEXTCTRL(this); return *TEXTCTRL(this);
} }
@@ -146,7 +146,7 @@ wxTextCtrl& wxTextCtrlBase::operator<<(int i)
wxTextCtrl& wxTextCtrlBase::operator<<(long i) wxTextCtrl& wxTextCtrlBase::operator<<(long i)
{ {
wxString str; wxString str;
str.Printf(_T("%ld"), i); str.Printf(T("%ld"), i);
AppendText(str); AppendText(str);
return *TEXTCTRL(this); return *TEXTCTRL(this);
} }

View File

@@ -64,13 +64,13 @@ const wxChar *wxTextFile::GetEOL(wxTextFileType type)
{ {
switch ( type ) { switch ( type ) {
default: default:
wxFAIL_MSG(_T("bad file type in wxTextFile::GetEOL.")); wxFAIL_MSG(T("bad file type in wxTextFile::GetEOL."));
// fall through nevertheless - we must return something... // fall through nevertheless - we must return something...
case wxTextFileType_None: return _T(""); case wxTextFileType_None: return T("");
case wxTextFileType_Unix: return _T("\n"); case wxTextFileType_Unix: return T("\n");
case wxTextFileType_Dos: return _T("\r\n"); case wxTextFileType_Dos: return T("\r\n");
case wxTextFileType_Mac: return _T("\r"); case wxTextFileType_Mac: return T("\r");
} }
} }

View File

@@ -147,7 +147,7 @@ wxTime::wxTime(const wxDate& date, hourTy h, minuteTy m, secondTy s, bool dst)
/* /*
if (IsDST()) setError(NIHCL_BADTIME,DEFAULT, if (IsDST()) setError(NIHCL_BADTIME,DEFAULT,
date.dayOfMonth(),date.nameOfMonth(),date.year(), date.dayOfMonth(),date.nameOfMonth(),date.year(),
h,m,s,(dst?_("DST"):"")); h,m,s,(dst?_("DST("):""));
*/ */
} }
sec += TIME_ZONE; // adjust to GMT sec += TIME_ZONE; // adjust to GMT
@@ -346,10 +346,10 @@ wxChar *wxTime::FormatTime() const {
switch (Precision) { switch (Precision) {
case wxStdMinSec: case wxStdMinSec:
wxSprintf(timeBuf,_T("%2d:%02d:%02d"),hh,GetMinute(),GetSecond()); wxSprintf(timeBuf,T("%2d:%02d:%02d"),hh,GetMinute(),GetSecond());
break; break;
case wxStdMin: case wxStdMin:
wxSprintf(timeBuf,_T("%2d:%02d"),hh,GetMinute()); wxSprintf(timeBuf,T("%2d:%02d"),hh,GetMinute());
break; break;
} }

View File

@@ -55,10 +55,10 @@ wxChar wxTextInputStream::NextNonWhiteSpace()
c = m_input->GetC(); c = m_input->GetC();
if (!m_input) return (wxChar) 0; if (!m_input) return (wxChar) 0;
if (c != _T('\n') && if (c != T('\n') &&
c != _T('\r') && c != T('\r') &&
c != _T('\t') && c != T('\t') &&
c != _T(' ')) c != T(' '))
{ {
return c; return c;
} }
@@ -70,20 +70,20 @@ wxChar wxTextInputStream::NextNonWhiteSpace()
void wxTextInputStream::SkipIfEndOfLine( wxChar c ) void wxTextInputStream::SkipIfEndOfLine( wxChar c )
{ {
if (c == _T('\n')) if (c == T('\n'))
{ {
// eat on UNIX // eat on UNIX
return; return;
} }
if (c == _T('\r')) if (c == T('\r'))
{ {
// eat on both Mac and DOS // eat on both Mac and DOS
wxChar c2 = m_input->GetC(); wxChar c2 = m_input->GetC();
if (!m_input) return; if (!m_input) return;
if (c2 == _T('\n')) if (c2 == T('\n'))
{ {
// eat on DOS // eat on DOS
return; return;
@@ -111,18 +111,18 @@ wxUint32 wxTextInputStream::Read32()
if (!m_input) return 0; if (!m_input) return 0;
i = 0; i = 0;
if (! (c == _T('-') || c == _T('+') || isdigit(c)) ) if (! (c == T('-') || c == T('+') || isdigit(c)) )
{ {
m_input->Ungetch(c); m_input->Ungetch(c);
return 0; return 0;
} }
if (c == _T('-')) if (c == T('-'))
{ {
sign = -1; sign = -1;
c = m_input->GetC(); c = m_input->GetC();
} else } else
if (c == _T('+')) if (c == T('+'))
{ {
sign = 1; sign = 1;
c = m_input->GetC(); c = m_input->GetC();
@@ -133,7 +133,7 @@ wxUint32 wxTextInputStream::Read32()
while (isdigit(c)) while (isdigit(c))
{ {
i = i*10 + (c - (int)_T('0')); i = i*10 + (c - (int)T('0'));
c = m_input->GetC(); c = m_input->GetC();
} }
@@ -164,18 +164,18 @@ double wxTextInputStream::ReadDouble()
if (!m_input) return 0.0; if (!m_input) return 0.0;
f = 0.0; f = 0.0;
if (! (c == _T('.') || c == _T('-') || c == _T('+') || isdigit(c)) ) if (! (c == T('.') || c == T('-') || c == T('+') || isdigit(c)) )
{ {
m_input->Ungetch(c); m_input->Ungetch(c);
return 0.0; return 0.0;
} }
if (c == _T('-')) if (c == T('-'))
{ {
sign = -1; sign = -1;
c = m_input->GetC(); c = m_input->GetC();
} else } else
if (c == _T('+')) if (c == T('+'))
{ {
sign = 1; sign = 1;
c = m_input->GetC(); c = m_input->GetC();
@@ -187,11 +187,11 @@ double wxTextInputStream::ReadDouble()
while (isdigit(c)) while (isdigit(c))
{ {
f = f*10 + (c - _T('0')); f = f*10 + (c - T('0'));
c = m_input->GetC(); c = m_input->GetC();
} }
if (c == _T('.')) if (c == T('.'))
{ {
double f_multiplicator = (double) 0.1; double f_multiplicator = (double) 0.1;
@@ -199,12 +199,12 @@ double wxTextInputStream::ReadDouble()
while (isdigit(c)) while (isdigit(c))
{ {
f += (c-_T('0'))*f_multiplicator; f += (c-T('0'))*f_multiplicator;
f_multiplicator /= 10; f_multiplicator /= 10;
c = m_input->GetC(); c = m_input->GetC();
} }
if (c == _T('e')) if (c == T('e'))
{ {
double f_multiplicator = 0.0; double f_multiplicator = 0.0;
int i, e; int i, e;
@@ -213,8 +213,8 @@ double wxTextInputStream::ReadDouble()
switch (c) switch (c)
{ {
case _T('-'): f_multiplicator = 0.1; break; case T('-'): f_multiplicator = 0.1; break;
case _T('+'): f_multiplicator = 10.0; break; case T('+'): f_multiplicator = 10.0; break;
} }
e = Read8(); // why only max 256 ? e = Read8(); // why only max 256 ?
@@ -245,20 +245,20 @@ wxString wxTextInputStream::ReadString()
c = m_input->GetC(); c = m_input->GetC();
if (!m_input) break; if (!m_input) break;
if (c == _T('\n')) if (c == T('\n'))
{ {
// eat on UNIX // eat on UNIX
break; break;
} }
if (c == _T('\r')) if (c == T('\r'))
{ {
// eat on both Mac and DOS // eat on both Mac and DOS
wxChar c2 = m_input->GetC(); wxChar c2 = m_input->GetC();
if (!m_input) break; if (!m_input) break;
if (c2 == _T('\n')) if (c2 == T('\n'))
{ {
// eat on DOS // eat on DOS
break; break;
@@ -292,13 +292,13 @@ wxTextInputStream& wxTextInputStream::operator>>(wxChar& c)
return *this; return *this;
} }
if (c1 == _T('\r')) if (c1 == T('\r'))
{ {
c = _T('\n'); c = T('\n');
wxChar c2 = m_input->GetC(); wxChar c2 = m_input->GetC();
if (!m_input) return *this; if (!m_input) return *this;
if (c2 != _T('\n')) if (c2 != T('\n'))
{ {
// we are on a Mac // we are on a Mac
m_input->Ungetch( c2 ); m_input->Ungetch( c2 );
@@ -360,7 +360,7 @@ wxTextOutputStream::~wxTextOutputStream()
void wxTextOutputStream::Write32(wxUint32 i) void wxTextOutputStream::Write32(wxUint32 i)
{ {
wxString str; wxString str;
str.Printf(_T("%u"), i); str.Printf(T("%u"), i);
WriteString(str); WriteString(str);
} }
@@ -368,7 +368,7 @@ void wxTextOutputStream::Write32(wxUint32 i)
void wxTextOutputStream::Write16(wxUint16 i) void wxTextOutputStream::Write16(wxUint16 i)
{ {
wxString str; wxString str;
str.Printf(_T("%u"), i); str.Printf(T("%u"), i);
WriteString(str); WriteString(str);
} }
@@ -376,7 +376,7 @@ void wxTextOutputStream::Write16(wxUint16 i)
void wxTextOutputStream::Write8(wxUint8 i) void wxTextOutputStream::Write8(wxUint8 i)
{ {
wxString str; wxString str;
str.Printf(_T("%u"), i); str.Printf(T("%u"), i);
WriteString(str); WriteString(str);
} }
@@ -385,7 +385,7 @@ void wxTextOutputStream::WriteDouble(double d)
{ {
wxString str; wxString str;
str.Printf(_T("%f"), d); str.Printf(T("%f"), d);
WriteString(str); WriteString(str);
} }
@@ -394,23 +394,23 @@ void wxTextOutputStream::WriteString(const wxString& string)
for (size_t i = 0; i < string.Len(); i++) for (size_t i = 0; i < string.Len(); i++)
{ {
wxChar c = string[i]; wxChar c = string[i];
if (c == _T('\n')) if (c == T('\n'))
{ {
#if defined(__WINDOWS__) #if defined(__WINDOWS__)
c = _T('\r'); c = T('\r');
m_output->Write( (const void*)(&c), sizeof(wxChar) ); m_output->Write( (const void*)(&c), sizeof(wxChar) );
c = _T('\n'); c = T('\n');
m_output->Write( (const void*)(&c), sizeof(wxChar) ); m_output->Write( (const void*)(&c), sizeof(wxChar) );
#elif defined(__UNIX__) #elif defined(__UNIX__)
c = _T('\n'); c = T('\n');
m_output->Write( (const void*)(&c), sizeof(wxChar) ); m_output->Write( (const void*)(&c), sizeof(wxChar) );
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
c = _T('\r'); c = T('\r');
m_output->Write( (const void*)(&c), sizeof(wxChar) ); m_output->Write( (const void*)(&c), sizeof(wxChar) );
#elif defined(__OS2__) #elif defined(__OS2__)
c = _T('\r'); c = T('\r');
m_output->Write( (const void*)(&c), sizeof(wxChar) ); m_output->Write( (const void*)(&c), sizeof(wxChar) );
c = _T('\n'); c = T('\n');
m_output->Write( (const void*)(&c), sizeof(wxChar) ); m_output->Write( (const void*)(&c), sizeof(wxChar) );
#else #else
#error "wxTextOutputStream: unsupported platform." #error "wxTextOutputStream: unsupported platform."
@@ -479,7 +479,7 @@ wxTextOutputStream& wxTextOutputStream::operator<<(float f)
wxTextOutputStream &endl( wxTextOutputStream &stream ) wxTextOutputStream &endl( wxTextOutputStream &stream )
{ {
return stream << _T('\n'); return stream << T('\n');
} }
#endif #endif

View File

@@ -105,9 +105,9 @@ bool wxURL::ParseURL()
CleanData(); CleanData();
// Third, we rebuild the URL. // Third, we rebuild the URL.
m_url = m_protoname + _T(":"); m_url = m_protoname + T(":");
if (m_protoinfo->m_needhost) if (m_protoinfo->m_needhost)
m_url = m_url + _T("//") + m_hostname; m_url = m_url + T("//") + m_hostname;
m_url += m_path; m_url += m_path;
@@ -146,7 +146,7 @@ bool wxURL::PrepProto(wxString& url)
int pos; int pos;
// Find end // Find end
pos = url.Find(_T(':')); pos = url.Find(T(':'));
if (pos == -1) if (pos == -1)
return FALSE; return FALSE;
@@ -167,7 +167,7 @@ bool wxURL::PrepHost(wxString& url)
url = url(2, url.Length()); url = url(2, url.Length());
pos = url.Find(_T('/')); pos = url.Find(T('/'));
if (pos == -1) if (pos == -1)
pos = url.Length(); pos = url.Length();
@@ -175,10 +175,10 @@ bool wxURL::PrepHost(wxString& url)
return FALSE; return FALSE;
temp_url = url(0, pos); temp_url = url(0, pos);
url = url(url.Find(_T('/')), url.Length()); url = url(url.Find(T('/')), url.Length());
// Retrieve service number // Retrieve service number
pos2 = temp_url.Find(_T(':'), TRUE); pos2 = temp_url.Find(T(':'), TRUE);
if (pos2 != -1 && pos2 < pos) { if (pos2 != -1 && pos2 < pos) {
m_servname = temp_url(pos2+1, pos); m_servname = temp_url(pos2+1, pos);
if (!m_servname.IsNumber()) if (!m_servname.IsNumber())
@@ -187,18 +187,18 @@ bool wxURL::PrepHost(wxString& url)
} }
// Retrieve user and password. // Retrieve user and password.
pos2 = temp_url.Find(_T('@')); pos2 = temp_url.Find(T('@'));
// Even if pos2 equals -1, this code is right. // Even if pos2 equals -1, this code is right.
m_hostname = temp_url(pos2+1, temp_url.Length()); m_hostname = temp_url(pos2+1, temp_url.Length());
m_user = _T(""); m_user = T("");
m_password = _T(""); m_password = T("");
if (pos2 == -1) if (pos2 == -1)
return TRUE; return TRUE;
temp_url = temp_url(0, pos2); temp_url = temp_url(0, pos2);
pos2 = temp_url.Find(_T(':')); pos2 = temp_url.Find(T(':'));
if (pos2 == -1) if (pos2 == -1)
return FALSE; return FALSE;
@@ -214,7 +214,7 @@ bool wxURL::PrepPath(wxString& url)
if (url.Length() != 0) if (url.Length() != 0)
m_path = ConvertToValidURI(url); m_path = ConvertToValidURI(url);
else else
m_path = _T("/"); m_path = T("/");
return TRUE; return TRUE;
} }
@@ -250,7 +250,7 @@ wxInputStream *wxURL::GetInputStream(void)
} }
m_error = wxURL_NOERR; m_error = wxURL_NOERR;
if (m_user != _T("")) { if (m_user != T("")) {
m_protocol->SetUser(m_user); m_protocol->SetUser(m_user);
m_protocol->SetPassword(m_password); m_protocol->SetPassword(m_password);
} }
@@ -300,7 +300,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
} }
wxString tmp_str = url_proxy; wxString tmp_str = url_proxy;
int pos = tmp_str.Find(_T(':')); int pos = tmp_str.Find(T(':'));
if (pos == -1) if (pos == -1)
return; return;
@@ -338,7 +338,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
wxIPV4address addr; wxIPV4address addr;
tmp_str = url_proxy; tmp_str = url_proxy;
pos = tmp_str.Find(_T(':')); pos = tmp_str.Find(T(':'));
// This is an invalid proxy name. // This is an invalid proxy name.
if (pos == -1) if (pos == -1)
return; return;
@@ -371,11 +371,11 @@ wxString wxURL::ConvertToValidURI(const wxString& uri)
for (i=0;i<uri.Len();i++) { for (i=0;i<uri.Len();i++) {
wxChar c = uri.GetChar(i); wxChar c = uri.GetChar(i);
if (c == _T(' ')) if (c == T(' '))
out_str += _T('+'); out_str += T('+');
else { else {
if (!isalpha(c) && c != _T('.') && c != _T('+') && c != _T('/')) { if (!isalpha(c) && c != T('.') && c != T('+') && c != T('/')) {
hexa_code.Printf(_T("%%%02X"), c); hexa_code.Printf(T("%%%02X"), c);
out_str += hexa_code; out_str += hexa_code;
} else } else
out_str += c; out_str += c;
@@ -392,17 +392,17 @@ wxString wxURL::ConvertFromURI(const wxString& uri)
size_t i = 0; size_t i = 0;
while (i<uri.Len()) { while (i<uri.Len()) {
int code; int code;
if (uri[i] == _T('%')) { if (uri[i] == T('%')) {
i++; i++;
if (uri[i] >= _T('A') && uri[i] <= _T('F')) if (uri[i] >= T('A') && uri[i] <= T('F'))
code = (uri[i] - _T('A') + 10) * 16; code = (uri[i] - T('A') + 10) * 16;
else else
code = (uri[i] - _T('0')) * 16; code = (uri[i] - T('0')) * 16;
i++; i++;
if (uri[i] >= _T('A') && uri[i] <= _T('F')) if (uri[i] >= T('A') && uri[i] <= T('F'))
code += (uri[i] - _T('A')) + 10; code += (uri[i] - T('A')) + 10;
else else
code += (uri[i] - _T('0')); code += (uri[i] - T('0'));
i++; i++;
new_uri += (wxChar)code; new_uri += (wxChar)code;
continue; continue;

View File

@@ -9,47 +9,62 @@
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "utils.h" #pragma implementation "utils.h"
#endif #endif
// For compilers that support precompilation, includes "wx.h". // For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif #endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/utils.h" #include "wx/string.h"
#include "wx/window.h" #include "wx/utils.h"
#include "wx/menu.h"
#include "wx/frame.h" #if wxUSE_GUI
#include "wx/msgdlg.h" #include "wx/window.h"
#include "wx/textdlg.h" #include "wx/menu.h"
#endif #include "wx/frame.h"
#include "wx/msgdlg.h"
#include "wx/textdlg.h"
#endif // wxUSE_GUI
#endif // WX_PRECOMP
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if !defined(__WATCOMC__) #if !defined(__WATCOMC__)
#if !(defined(_MSC_VER) && (_MSC_VER > 800)) #if !(defined(_MSC_VER) && (_MSC_VER > 800))
#include <errno.h> #include <errno.h>
#endif #endif
#endif #endif
#include <time.h> #include <time.h>
#ifndef __MWERKS__ #ifndef __MWERKS__
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#ifdef __SALFORDC__ #ifdef __SALFORDC__
#include <clib.h> #include <clib.h>
#endif #endif
// Pattern matching code. // Pattern matching code. (FIXME)
// Yes, this path is deliberate (for Borland compilation) // Yes, this path is deliberate (for Borland compilation)
#ifdef wx_mac /* MATTHEW: [5] Mac doesn't like paths with "/" */ #ifdef wx_mac /* MATTHEW: [5] Mac doesn't like paths with "/" */
#include "glob.inc" #include "glob.inc"
@@ -58,19 +73,25 @@
#endif #endif
#ifdef __WXMSW__ #ifdef __WXMSW__
#include "windows.h" #include "windows.h"
#endif #endif
#define _MAXPATHLEN 500
extern wxChar *wxBuffer;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private functions // function protoypes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static wxWindow *wxFindWindowByLabel1(const wxString& title, wxWindow * parent); #if wxUSE_GUI
static wxWindow *wxFindWindowByName1 (const wxString& title, wxWindow * parent); static wxWindow *wxFindWindowByLabel1(const wxString& title, wxWindow *parent);
static wxWindow *wxFindWindowByName1 (const wxString& title, wxWindow *parent);
#endif // wxUSE_GUI
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// string functions
// ----------------------------------------------------------------------------
#ifdef __WXMAC__ #ifdef __WXMAC__
int strcasecmp(const char *str_1, const char *str_2) int strcasecmp(const char *str_1, const char *str_2)
@@ -101,7 +122,8 @@ int strncasecmp(const char *str_1, const char *str_2, size_t maxchar)
return 0 ; return 0 ;
} }
#endif #endif // wxMAC
#ifdef __VMS__ #ifdef __VMS__
// we have no strI functions under VMS, therefore I have implemented // we have no strI functions under VMS, therefore I have implemented
// an inefficient but portable version: convert copies of strings to lowercase // an inefficient but portable version: convert copies of strings to lowercase
@@ -145,7 +167,7 @@ int strncasecmp(const char *str_1, const char *str_2, size_t maxchar)
return(result); return(result);
} }
#endif #endif // __VMS__
#ifdef __WINDOWS__ #ifdef __WINDOWS__
@@ -185,7 +207,7 @@ extern "C"
wxChar * wxChar *
copystring (const wxChar *s) copystring (const wxChar *s)
{ {
if (s == NULL) s = _T(""); if (s == NULL) s = T("");
size_t len = wxStrlen (s) + 1; size_t len = wxStrlen (s) + 1;
wxChar *news = new wxChar[len]; wxChar *news = new wxChar[len];
@@ -265,7 +287,7 @@ IntToString (int number)
{ {
static wxChar buf[20]; static wxChar buf[20];
wxSprintf (buf, _T("%d"), number); wxSprintf (buf, T("%d"), number);
return buf; return buf;
} }
@@ -274,27 +296,27 @@ LongToString (long number)
{ {
static wxChar buf[20]; static wxChar buf[20];
wxSprintf (buf, _T("%ld"), number); wxSprintf (buf, T("%ld"), number);
return buf; return buf;
} }
// Array used in DecToHex conversion routine. // Array used in DecToHex conversion routine.
static wxChar hexArray[] = _T("0123456789ABCDEF"); static wxChar hexArray[] = T("0123456789ABCDEF");
// Convert 2-digit hex number to decimal // Convert 2-digit hex number to decimal
int wxHexToDec(const wxString& buf) int wxHexToDec(const wxString& buf)
{ {
int firstDigit, secondDigit; int firstDigit, secondDigit;
if (buf.GetChar(0) >= _T('A')) if (buf.GetChar(0) >= T('A'))
firstDigit = buf.GetChar(0) - _T('A') + 10; firstDigit = buf.GetChar(0) - T('A') + 10;
else else
firstDigit = buf.GetChar(0) - _T('0'); firstDigit = buf.GetChar(0) - T('0');
if (buf.GetChar(1) >= _T('A')) if (buf.GetChar(1) >= T('A'))
secondDigit = buf.GetChar(1) - _T('A') + 10; secondDigit = buf.GetChar(1) - T('A') + 10;
else else
secondDigit = buf.GetChar(1) - _T('0'); secondDigit = buf.GetChar(1) - T('0');
return firstDigit * 16 + secondDigit; return firstDigit * 16 + secondDigit;
} }
@@ -357,19 +379,9 @@ StringMatch (char *str1, char *str2, bool subString, bool exact)
return FALSE; return FALSE;
} }
// Don't synthesize KeyUp events holding down a key and producing
// KeyDown events with autorepeat. On by default and always on
// on in wxMSW. wxGTK version in utilsgtk.cpp.
#ifndef __WXGTK__
bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
{
return TRUE; // detectable auto-repeat is the only mode MSW supports
}
#endif
// Return the current date/time // Return the current date/time
// [volatile] // [volatile]
wxString wxNow( void ) wxString wxNow()
{ {
time_t now = time((time_t *) NULL); time_t now = time((time_t *) NULL);
char *date = ctime(&now); char *date = ctime(&now);
@@ -377,9 +389,11 @@ wxString wxNow( void )
return wxString(date); return wxString(date);
} }
/* #if wxUSE_GUI
* Strip out any menu codes
*/ // ----------------------------------------------------------------------------
// Strip out any menu codes
// ----------------------------------------------------------------------------
wxChar *wxStripMenuCodes (wxChar *in, wxChar *out) wxChar *wxStripMenuCodes (wxChar *in, wxChar *out)
{ {
@@ -393,13 +407,13 @@ wxChar *wxStripMenuCodes (wxChar *in, wxChar *out)
while (*in) while (*in)
{ {
if (*in == _T('&')) if (*in == T('&'))
{ {
// Check && -> &, &x -> x // Check && -> &, &x -> x
if (*++in == _T('&')) if (*++in == T('&'))
*out++ = *in++; *out++ = *in++;
} }
else if (*in == _T('\t')) else if (*in == T('\t'))
{ {
// Remove all stuff after \t in X mode, and let the stuff as is // Remove all stuff after \t in X mode, and let the stuff as is
// in Windows mode. // in Windows mode.
@@ -411,7 +425,7 @@ wxChar *wxStripMenuCodes (wxChar *in, wxChar *out)
*out++ = *in++; *out++ = *in++;
} // while } // while
*out = _T('\0'); *out = T('\0');
return tmpOut; return tmpOut;
} }
@@ -425,10 +439,9 @@ wxString wxStripMenuCodes(const wxString& str)
return str1; return str1;
} }
/* // ----------------------------------------------------------------------------
* Window search functions // Window search functions
* // ----------------------------------------------------------------------------
*/
/* /*
* If parent is non-NULL, look through children for a label or title * If parent is non-NULL, look through children for a label or title
@@ -553,6 +566,8 @@ wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& i
return menuBar->FindMenuItem (menuString, itemString); return menuBar->FindMenuItem (menuString, itemString);
} }
#endif // wxUSE_GUI
/* /*
On Fri, 21 Jul 1995, Paul Craven wrote: On Fri, 21 Jul 1995, Paul Craven wrote:
@@ -745,24 +760,12 @@ whereami(name)
} }
#endif #endif
void wxEnableTopLevelWindows(bool enable)
{
wxWindowList::Node *node;
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
node->GetData()->Enable(enable);
}
// Yield to other apps/messages and disable user input #if wxUSE_GUI
bool wxSafeYield(wxWindow *win)
{ // ----------------------------------------------------------------------------
wxEnableTopLevelWindows(FALSE); // GUI helpers
// always enable ourselves // ----------------------------------------------------------------------------
if ( win )
win->Enable(TRUE);
bool rc = wxYield();
wxEnableTopLevelWindows(TRUE);
return rc;
}
/* /*
* N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
@@ -817,7 +820,42 @@ int isascii( int c )
{ {
return ( c >= 0 && c < 128 ) ; return ( c >= 0 && c < 128 ) ;
} }
#endif #endif // __MWERKS__
// ----------------------------------------------------------------------------
// misc functions
// ----------------------------------------------------------------------------
void wxEnableTopLevelWindows(bool enable)
{
wxWindowList::Node *node;
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
node->GetData()->Enable(enable);
}
// Yield to other apps/messages and disable user input
bool wxSafeYield(wxWindow *win)
{
wxEnableTopLevelWindows(FALSE);
// always enable ourselves
if ( win )
win->Enable(TRUE);
bool rc = wxYield();
wxEnableTopLevelWindows(TRUE);
return rc;
}
// Don't synthesize KeyUp events holding down a key and producing KeyDown
// events with autorepeat. On by default and always on in wxMSW. wxGTK version
// in utilsgtk.cpp.
#ifndef __WXGTK__
bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
{
return TRUE; // detectable auto-repeat is the only mode MSW supports
}
#endif // !wxGTK
#endif // wxUSE_GUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// network and user id functions // network and user id functions
@@ -831,7 +869,7 @@ bool wxGetEmailAddress(wxChar *address, int maxSize)
return FALSE; return FALSE;
wxStrncpy(address, email, maxSize - 1); wxStrncpy(address, email, maxSize - 1);
address[maxSize - 1] = _T('\0'); address[maxSize - 1] = T('\0');
return TRUE; return TRUE;
} }
@@ -847,7 +885,7 @@ wxString wxGetEmailAddress()
if ( !!user ) if ( !!user )
{ {
wxString email(user); wxString email(user);
email << _T('@') << host; email << T('@') << host;
} }
} }

View File

@@ -63,7 +63,7 @@ public:
virtual bool Read(istream& str); virtual bool Read(istream& str);
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("list"); }; virtual wxString GetType() const { return T("list"); };
void Clear(); void Clear();
@@ -109,7 +109,7 @@ void wxVariantDataList::Clear()
void wxVariantDataList::Copy(wxVariantData& data) void wxVariantDataList::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("list")), _T("wxVariantDataList::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("list")), T("wxVariantDataList::Copy: Can't copy to this type of data") );
wxVariantDataList& listData = (wxVariantDataList&) data; wxVariantDataList& listData = (wxVariantDataList&) data;
@@ -125,7 +125,7 @@ void wxVariantDataList::Copy(wxVariantData& data)
bool wxVariantDataList::Eq(wxVariantData& data) const bool wxVariantDataList::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("list")), _T("wxVariantDataList::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("list")), T("wxVariantDataList::Eq: argument mismatch") );
wxVariantDataList& listData = (wxVariantDataList&) data; wxVariantDataList& listData = (wxVariantDataList&) data;
wxNode* node1 = m_value.First(); wxNode* node1 = m_value.First();
@@ -155,13 +155,13 @@ bool wxVariantDataList::Write(ostream& str) const
bool wxVariantDataList::Write(wxString& str) const bool wxVariantDataList::Write(wxString& str) const
{ {
str = _T(""); str = T("");
wxNode* node = m_value.First(); wxNode* node = m_value.First();
while (node) while (node)
{ {
wxVariant* var = (wxVariant*) node->Data(); wxVariant* var = (wxVariant*) node->Data();
if (node != m_value.First()) if (node != m_value.First())
str += _T(" "); str += T(" ");
wxString str1; wxString str1;
str += var->MakeString(); str += var->MakeString();
node = node->Next(); node = node->Next();
@@ -173,7 +173,7 @@ bool wxVariantDataList::Write(wxString& str) const
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataList::Read(istream& WXUNUSED(str)) bool wxVariantDataList::Read(istream& WXUNUSED(str))
{ {
wxFAIL_MSG(_T("Unimplemented")); wxFAIL_MSG(T("Unimplemented"));
// TODO // TODO
return FALSE; return FALSE;
} }
@@ -181,7 +181,7 @@ bool wxVariantDataList::Read(istream& WXUNUSED(str))
bool wxVariantDataList::Read(wxString& WXUNUSED(str)) bool wxVariantDataList::Read(wxString& WXUNUSED(str))
{ {
wxFAIL_MSG(_T("Unimplemented")); wxFAIL_MSG(T("Unimplemented"));
// TODO // TODO
return FALSE; return FALSE;
} }
@@ -210,7 +210,7 @@ public:
virtual bool Read(istream& str); virtual bool Read(istream& str);
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("stringlist"); }; virtual wxString GetType() const { return T("stringlist"); };
protected: protected:
wxStringList m_value; wxStringList m_value;
@@ -225,7 +225,7 @@ void wxVariantDataStringList::SetValue(const wxStringList& value)
void wxVariantDataStringList::Copy(wxVariantData& data) void wxVariantDataStringList::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("stringlist")), _T("wxVariantDataStringList::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("stringlist")), T("wxVariantDataStringList::Copy: Can't copy to this type of data") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data; wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
@@ -234,7 +234,7 @@ void wxVariantDataStringList::Copy(wxVariantData& data)
bool wxVariantDataStringList::Eq(wxVariantData& data) const bool wxVariantDataStringList::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("stringlist")), _T("wxVariantDataStringList::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("stringlist")), T("wxVariantDataStringList::Eq: argument mismatch") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data; wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
wxNode* node1 = m_value.First(); wxNode* node1 = m_value.First();
@@ -264,13 +264,13 @@ bool wxVariantDataStringList::Write(ostream& str) const
bool wxVariantDataStringList::Write(wxString& str) const bool wxVariantDataStringList::Write(wxString& str) const
{ {
str = _T(""); str = T("");
wxNode* node = m_value.First(); wxNode* node = m_value.First();
while (node) while (node)
{ {
wxChar* s = (wxChar*) node->Data(); wxChar* s = (wxChar*) node->Data();
if (node != m_value.First()) if (node != m_value.First())
str += _T(" "); str += T(" ");
str += s; str += s;
node = node->Next(); node = node->Next();
} }
@@ -281,7 +281,7 @@ bool wxVariantDataStringList::Write(wxString& str) const
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataStringList::Read(istream& WXUNUSED(str)) bool wxVariantDataStringList::Read(istream& WXUNUSED(str))
{ {
wxFAIL_MSG(_T("Unimplemented")); wxFAIL_MSG(T("Unimplemented"));
// TODO // TODO
return FALSE; return FALSE;
} }
@@ -289,7 +289,7 @@ bool wxVariantDataStringList::Read(istream& WXUNUSED(str))
bool wxVariantDataStringList::Read(wxString& WXUNUSED(str)) bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
{ {
wxFAIL_MSG(_T("Unimplemented")); wxFAIL_MSG(T("Unimplemented"));
// TODO // TODO
return FALSE; return FALSE;
} }
@@ -322,7 +322,7 @@ public:
virtual bool Write(wxOutputStream &str) const; virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
virtual wxString GetType() const { return _T("long"); }; virtual wxString GetType() const { return T("long"); };
protected: protected:
long m_value; long m_value;
@@ -332,7 +332,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataLong, wxVariantData)
void wxVariantDataLong::Copy(wxVariantData& data) void wxVariantDataLong::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("long")), _T("wxVariantDataLong::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("long")), T("wxVariantDataLong::Copy: Can't copy to this type of data") );
wxVariantDataLong& otherData = (wxVariantDataLong&) data; wxVariantDataLong& otherData = (wxVariantDataLong&) data;
@@ -341,7 +341,7 @@ void wxVariantDataLong::Copy(wxVariantData& data)
bool wxVariantDataLong::Eq(wxVariantData& data) const bool wxVariantDataLong::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("long")), _T("wxVariantDataLong::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("long")), T("wxVariantDataLong::Eq: argument mismatch") );
wxVariantDataLong& otherData = (wxVariantDataLong&) data; wxVariantDataLong& otherData = (wxVariantDataLong&) data;
@@ -360,7 +360,7 @@ bool wxVariantDataLong::Write(ostream& str) const
bool wxVariantDataLong::Write(wxString& str) const bool wxVariantDataLong::Write(wxString& str) const
{ {
str.Printf(_T("%ld"), m_value); str.Printf(T("%ld"), m_value);
return TRUE; return TRUE;
} }
@@ -423,7 +423,7 @@ public:
virtual bool Read(wxInputStream& str); virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const; virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
virtual wxString GetType() const { return _T("double"); }; virtual wxString GetType() const { return T("double"); };
protected: protected:
double m_value; double m_value;
@@ -433,7 +433,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataReal, wxVariantData)
void wxVariantDataReal::Copy(wxVariantData& data) void wxVariantDataReal::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("double")), _T("wxVariantDataReal::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("double")), T("wxVariantDataReal::Copy: Can't copy to this type of data") );
wxVariantDataReal& otherData = (wxVariantDataReal&) data; wxVariantDataReal& otherData = (wxVariantDataReal&) data;
@@ -442,7 +442,7 @@ void wxVariantDataReal::Copy(wxVariantData& data)
bool wxVariantDataReal::Eq(wxVariantData& data) const bool wxVariantDataReal::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("double")), _T("wxVariantDataReal::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("double")), T("wxVariantDataReal::Eq: argument mismatch") );
wxVariantDataReal& otherData = (wxVariantDataReal&) data; wxVariantDataReal& otherData = (wxVariantDataReal&) data;
@@ -461,7 +461,7 @@ bool wxVariantDataReal::Write(ostream& str) const
bool wxVariantDataReal::Write(wxString& str) const bool wxVariantDataReal::Write(wxString& str) const
{ {
str.Printf(_T("%.4f"), m_value); str.Printf(T("%.4f"), m_value);
return TRUE; return TRUE;
} }
@@ -524,7 +524,7 @@ public:
virtual bool Read(wxInputStream& str); virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const; virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
virtual wxString GetType() const { return _T("bool"); }; virtual wxString GetType() const { return T("bool"); };
protected: protected:
bool m_value; bool m_value;
@@ -534,7 +534,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataBool, wxVariantData)
void wxVariantDataBool::Copy(wxVariantData& data) void wxVariantDataBool::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("bool")), _T("wxVariantDataBool::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("bool")), T("wxVariantDataBool::Copy: Can't copy to this type of data") );
wxVariantDataBool& otherData = (wxVariantDataBool&) data; wxVariantDataBool& otherData = (wxVariantDataBool&) data;
@@ -543,7 +543,7 @@ void wxVariantDataBool::Copy(wxVariantData& data)
bool wxVariantDataBool::Eq(wxVariantData& data) const bool wxVariantDataBool::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("bool")), _T("wxVariantDataBool::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("bool")), T("wxVariantDataBool::Eq: argument mismatch") );
wxVariantDataBool& otherData = (wxVariantDataBool&) data; wxVariantDataBool& otherData = (wxVariantDataBool&) data;
@@ -562,14 +562,14 @@ bool wxVariantDataBool::Write(ostream& str) const
bool wxVariantDataBool::Write(wxString& str) const bool wxVariantDataBool::Write(wxString& str) const
{ {
str.Printf(_T("%d"), (int) m_value); str.Printf(T("%d"), (int) m_value);
return TRUE; return TRUE;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataBool::Read(istream& WXUNUSED(str)) bool wxVariantDataBool::Read(istream& WXUNUSED(str))
{ {
wxFAIL_MSG(_T("Unimplemented")); wxFAIL_MSG(T("Unimplemented"));
// str >> (long) m_value; // str >> (long) m_value;
return FALSE; return FALSE;
} }
@@ -626,7 +626,7 @@ public:
virtual bool Read(wxInputStream& str); virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const; virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
virtual wxString GetType() const { return _T("char"); }; virtual wxString GetType() const { return T("char"); };
protected: protected:
char m_value; char m_value;
@@ -636,7 +636,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataChar, wxVariantData)
void wxVariantDataChar::Copy(wxVariantData& data) void wxVariantDataChar::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("char")), _T("wxVariantDataChar::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("char")), T("wxVariantDataChar::Copy: Can't copy to this type of data") );
wxVariantDataChar& otherData = (wxVariantDataChar&) data; wxVariantDataChar& otherData = (wxVariantDataChar&) data;
@@ -645,7 +645,7 @@ void wxVariantDataChar::Copy(wxVariantData& data)
bool wxVariantDataChar::Eq(wxVariantData& data) const bool wxVariantDataChar::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("char")), _T("wxVariantDataChar::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("char")), T("wxVariantDataChar::Eq: argument mismatch") );
wxVariantDataChar& otherData = (wxVariantDataChar&) data; wxVariantDataChar& otherData = (wxVariantDataChar&) data;
@@ -664,14 +664,14 @@ bool wxVariantDataChar::Write(ostream& str) const
bool wxVariantDataChar::Write(wxString& str) const bool wxVariantDataChar::Write(wxString& str) const
{ {
str.Printf(_T("%c"), m_value); str.Printf(T("%c"), m_value);
return TRUE; return TRUE;
} }
#if wxUSE_STD_IOSTREAM #if wxUSE_STD_IOSTREAM
bool wxVariantDataChar::Read(istream& WXUNUSED(str)) bool wxVariantDataChar::Read(istream& WXUNUSED(str))
{ {
wxFAIL_MSG(_T("Unimplemented")); wxFAIL_MSG(T("Unimplemented"));
// str >> m_value; // str >> m_value;
return FALSE; return FALSE;
} }
@@ -738,7 +738,7 @@ public:
virtual bool Read(wxInputStream& str); virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const; virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
virtual wxString GetType() const { return _T("string"); }; virtual wxString GetType() const { return T("string"); };
protected: protected:
wxString m_value; wxString m_value;
@@ -746,7 +746,7 @@ protected:
void wxVariantDataString::Copy(wxVariantData& data) void wxVariantDataString::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("string")), _T("wxVariantDataString::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("string")), T("wxVariantDataString::Copy: Can't copy to this type of data") );
wxVariantDataString& otherData = (wxVariantDataString&) data; wxVariantDataString& otherData = (wxVariantDataString&) data;
@@ -755,7 +755,7 @@ void wxVariantDataString::Copy(wxVariantData& data)
bool wxVariantDataString::Eq(wxVariantData& data) const bool wxVariantDataString::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("string")), _T("wxVariantDataString::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("string")), T("wxVariantDataString::Eq: argument mismatch") );
wxVariantDataString& otherData = (wxVariantDataString&) data; wxVariantDataString& otherData = (wxVariantDataString&) data;
@@ -840,7 +840,7 @@ public:
virtual bool Read(istream& str); virtual bool Read(istream& str);
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("time"); }; virtual wxString GetType() const { return T("time"); };
virtual wxVariantData* Clone() { return new wxVariantDataTime; } virtual wxVariantData* Clone() { return new wxVariantDataTime; }
protected: protected:
@@ -851,7 +851,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataTime, wxVariantData)
void wxVariantDataTime::Copy(wxVariantData& data) void wxVariantDataTime::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("time")), _T("wxVariantDataTime::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("time")), T("wxVariantDataTime::Copy: Can't copy to this type of data") );
wxVariantDataTime& otherData = (wxVariantDataTime&) data; wxVariantDataTime& otherData = (wxVariantDataTime&) data;
@@ -860,7 +860,7 @@ void wxVariantDataTime::Copy(wxVariantData& data)
bool wxVariantDataTime::Eq(wxVariantData& data) const bool wxVariantDataTime::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("time")), _T("wxVariantDataTime::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("time")), T("wxVariantDataTime::Eq: argument mismatch") );
wxVariantDataTime& otherData = (wxVariantDataTime&) data; wxVariantDataTime& otherData = (wxVariantDataTime&) data;
@@ -922,7 +922,7 @@ public:
virtual bool Read(istream& str); virtual bool Read(istream& str);
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("date"); }; virtual wxString GetType() const { return T("date"); };
virtual wxVariantData* Clone() { return new wxVariantDataDate; } virtual wxVariantData* Clone() { return new wxVariantDataDate; }
protected: protected:
@@ -933,7 +933,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataDate, wxVariantData)
void wxVariantDataDate::Copy(wxVariantData& data) void wxVariantDataDate::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("date")), _T("wxVariantDataDate::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("date")), T("wxVariantDataDate::Copy: Can't copy to this type of data") );
wxVariantDataDate& otherData = (wxVariantDataDate&) data; wxVariantDataDate& otherData = (wxVariantDataDate&) data;
@@ -942,7 +942,7 @@ void wxVariantDataDate::Copy(wxVariantData& data)
bool wxVariantDataDate::Eq(wxVariantData& data) const bool wxVariantDataDate::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("date")), _T("wxVariantDataDate::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("date")), T("wxVariantDataDate::Eq: argument mismatch") );
wxVariantDataDate& otherData = (wxVariantDataDate&) data; wxVariantDataDate& otherData = (wxVariantDataDate&) data;
@@ -1005,7 +1005,7 @@ public:
virtual bool Read(istream& str); virtual bool Read(istream& str);
#endif #endif
virtual bool Read(wxString& str); virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("void*"); }; virtual wxString GetType() const { return T("void*"); };
virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; } virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
protected: protected:
@@ -1016,7 +1016,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataVoidPtr, wxVariantData)
void wxVariantDataVoidPtr::Copy(wxVariantData& data) void wxVariantDataVoidPtr::Copy(wxVariantData& data)
{ {
wxASSERT_MSG( (data.GetType() == _T("void*")), _T("wxVariantDataVoidPtr::Copy: Can't copy to this type of data") ); wxASSERT_MSG( (data.GetType() == T("void*")), T("wxVariantDataVoidPtr::Copy: Can't copy to this type of data") );
wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data; wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data;
@@ -1025,7 +1025,7 @@ void wxVariantDataVoidPtr::Copy(wxVariantData& data)
bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const
{ {
wxASSERT_MSG( (data.GetType() == _T("void*")), _T("wxVariantDataVoidPtr::Eq: argument mismatch") ); wxASSERT_MSG( (data.GetType() == T("void*")), T("wxVariantDataVoidPtr::Eq: argument mismatch") );
wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data; wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data;
@@ -1044,7 +1044,7 @@ bool wxVariantDataVoidPtr::Write(ostream& str) const
bool wxVariantDataVoidPtr::Write(wxString& str) const bool wxVariantDataVoidPtr::Write(wxString& str) const
{ {
str.Printf(_T("%ld"), (long) m_value); str.Printf(T("%ld"), (long) m_value);
return TRUE; return TRUE;
} }
@@ -1235,7 +1235,7 @@ bool wxVariant::operator!= (double value) const
void wxVariant::operator= (double value) void wxVariant::operator= (double value)
{ {
if (GetType() == _T("double")) if (GetType() == T("double"))
{ {
((wxVariantDataReal*)GetData())->SetValue(value); ((wxVariantDataReal*)GetData())->SetValue(value);
} }
@@ -1263,7 +1263,7 @@ bool wxVariant::operator!= (long value) const
void wxVariant::operator= (long value) void wxVariant::operator= (long value)
{ {
if (GetType() == _T("long")) if (GetType() == T("long"))
{ {
((wxVariantDataLong*)GetData())->SetValue(value); ((wxVariantDataLong*)GetData())->SetValue(value);
} }
@@ -1291,7 +1291,7 @@ bool wxVariant::operator!= (char value) const
void wxVariant::operator= (char value) void wxVariant::operator= (char value)
{ {
if (GetType() == _T("char")) if (GetType() == T("char"))
{ {
((wxVariantDataChar*)GetData())->SetValue(value); ((wxVariantDataChar*)GetData())->SetValue(value);
} }
@@ -1320,7 +1320,7 @@ bool wxVariant::operator!= (bool value) const
void wxVariant::operator= (bool value) void wxVariant::operator= (bool value)
{ {
if (GetType() == _T("bool")) if (GetType() == T("bool"))
{ {
((wxVariantDataBool*)GetData())->SetValue(value); ((wxVariantDataBool*)GetData())->SetValue(value);
} }
@@ -1349,7 +1349,7 @@ bool wxVariant::operator!= (const wxString& value) const
void wxVariant::operator= (const wxString& value) void wxVariant::operator= (const wxString& value)
{ {
if (GetType() == _T("string")) if (GetType() == T("string"))
{ {
((wxVariantDataString*)GetData())->SetValue(value); ((wxVariantDataString*)GetData())->SetValue(value);
} }
@@ -1363,7 +1363,7 @@ void wxVariant::operator= (const wxString& value)
void wxVariant::operator= (const wxChar* value) void wxVariant::operator= (const wxChar* value)
{ {
if (GetType() == _T("string")) if (GetType() == T("string"))
{ {
((wxVariantDataString*)GetData())->SetValue(wxString(value)); ((wxVariantDataString*)GetData())->SetValue(wxString(value));
} }
@@ -1377,7 +1377,7 @@ void wxVariant::operator= (const wxChar* value)
bool wxVariant::operator== (const wxStringList& value) const bool wxVariant::operator== (const wxStringList& value) const
{ {
wxASSERT_MSG( (GetType() == _T("stringlist")), _T("Invalid type for == operator") ); wxASSERT_MSG( (GetType() == T("stringlist")), T("Invalid type for == operator") );
wxVariantDataStringList other(value); wxVariantDataStringList other(value);
return (m_data->Eq(other)); return (m_data->Eq(other));
@@ -1390,7 +1390,7 @@ bool wxVariant::operator!= (const wxStringList& value) const
void wxVariant::operator= (const wxStringList& value) void wxVariant::operator= (const wxStringList& value)
{ {
if (GetType() == _T("stringlist")) if (GetType() == T("stringlist"))
{ {
((wxVariantDataStringList*)GetData())->SetValue(value); ((wxVariantDataStringList*)GetData())->SetValue(value);
} }
@@ -1404,7 +1404,7 @@ void wxVariant::operator= (const wxStringList& value)
bool wxVariant::operator== (const wxList& value) const bool wxVariant::operator== (const wxList& value) const
{ {
wxASSERT_MSG( (GetType() == _T("list")), _T("Invalid type for == operator") ); wxASSERT_MSG( (GetType() == T("list")), T("Invalid type for == operator") );
wxVariantDataList other(value); wxVariantDataList other(value);
return (m_data->Eq(other)); return (m_data->Eq(other));
@@ -1417,7 +1417,7 @@ bool wxVariant::operator!= (const wxList& value) const
void wxVariant::operator= (const wxList& value) void wxVariant::operator= (const wxList& value)
{ {
if (GetType() == _T("list")) if (GetType() == T("list"))
{ {
((wxVariantDataList*)GetData())->SetValue(value); ((wxVariantDataList*)GetData())->SetValue(value);
} }
@@ -1446,7 +1446,7 @@ bool wxVariant::operator!= (const wxTime& value) const
void wxVariant::operator= (const wxTime& value) void wxVariant::operator= (const wxTime& value)
{ {
if (GetType() == _T("time")) if (GetType() == T("time"))
{ {
((wxVariantDataTime*)GetData())->SetValue(value); ((wxVariantDataTime*)GetData())->SetValue(value);
} }
@@ -1474,7 +1474,7 @@ bool wxVariant::operator!= (const wxDate& value) const
void wxVariant::operator= (const wxDate& value) void wxVariant::operator= (const wxDate& value)
{ {
if (GetType() == _T("date")) if (GetType() == T("date"))
{ {
((wxVariantDataTime*)GetData())->SetValue(value); ((wxVariantDataTime*)GetData())->SetValue(value);
} }
@@ -1499,7 +1499,7 @@ bool wxVariant::operator!= (void* value) const
void wxVariant::operator= (void* value) void wxVariant::operator= (void* value)
{ {
if (GetType() == _T("void*")) if (GetType() == T("void*"))
{ {
((wxVariantDataVoidPtr*)GetData())->SetValue(value); ((wxVariantDataVoidPtr*)GetData())->SetValue(value);
} }
@@ -1514,18 +1514,18 @@ void wxVariant::operator= (void* value)
// Treat a list variant as an array // Treat a list variant as an array
wxVariant wxVariant::operator[] (size_t idx) const wxVariant wxVariant::operator[] (size_t idx) const
{ {
wxASSERT_MSG( (GetType() == _T("list") || GetType() == _T("stringlist")), _T("Invalid type for array operator") ); wxASSERT_MSG( (GetType() == T("list") || GetType() == T("stringlist")), T("Invalid type for array operator") );
if (GetType() == _T("list")) if (GetType() == T("list"))
{ {
wxVariantDataList* data = (wxVariantDataList*) m_data; wxVariantDataList* data = (wxVariantDataList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") ); wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Nth(idx)->Data()); return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
} }
else if (GetType() == _T("stringlist")) else if (GetType() == T("stringlist"))
{ {
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") ); wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") );
wxVariant variant( wxString( (wxChar*) (data->GetValue().Nth(idx)->Data()) )); wxVariant variant( wxString( (wxChar*) (data->GetValue().Nth(idx)->Data()) ));
return variant; return variant;
@@ -1538,10 +1538,10 @@ wxVariant& wxVariant::operator[] (size_t idx)
// We can't return a reference to a variant for a string list, since the string // We can't return a reference to a variant for a string list, since the string
// is actually stored as a char*, not a variant. // is actually stored as a char*, not a variant.
wxASSERT_MSG( (GetType() == _T("list")), _T("Invalid type for array operator") ); wxASSERT_MSG( (GetType() == T("list")), T("Invalid type for array operator") );
wxVariantDataList* data = (wxVariantDataList*) m_data; wxVariantDataList* data = (wxVariantDataList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") ); wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Nth(idx)->Data()); return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
} }
@@ -1549,14 +1549,14 @@ wxVariant& wxVariant::operator[] (size_t idx)
// Return the number of elements in a list // Return the number of elements in a list
int wxVariant::GetCount() const int wxVariant::GetCount() const
{ {
wxASSERT_MSG( (GetType() == _T("list") || GetType() == _T("stringlist")), _T("Invalid type for GetCount()") ); wxASSERT_MSG( (GetType() == T("list") || GetType() == T("stringlist")), T("Invalid type for GetCount()") );
if (GetType() == _T("list")) if (GetType() == T("list"))
{ {
wxVariantDataList* data = (wxVariantDataList*) m_data; wxVariantDataList* data = (wxVariantDataList*) m_data;
return data->GetValue().Number(); return data->GetValue().Number();
} }
else if (GetType() == _T("stringlist")) else if (GetType() == T("stringlist"))
{ {
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
return data->GetValue().Number(); return data->GetValue().Number();
@@ -1572,7 +1572,7 @@ wxString wxVariant::MakeString() const
if (GetData()->Write(str)) if (GetData()->Write(str))
return str; return str;
} }
return wxString(_T("")); return wxString(T(""));
} }
// Accessors // Accessors
@@ -1589,7 +1589,7 @@ void wxVariant::SetData(wxVariantData* data)
wxString wxVariant::GetType() const wxString wxVariant::GetType() const
{ {
if (IsNull()) if (IsNull())
return wxString(_T("null")); return wxString(T("null"));
else else
return m_data->GetType(); return m_data->GetType();
} }
@@ -1609,7 +1609,7 @@ double wxVariant::GetReal() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to a real number")); wxFAIL_MSG(T("Could not convert to a real number"));
return 0.0; return 0.0;
} }
} }
@@ -1621,7 +1621,7 @@ long wxVariant::GetInteger() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to an integer")); wxFAIL_MSG(T("Could not convert to an integer"));
return 0; return 0;
} }
} }
@@ -1633,7 +1633,7 @@ char wxVariant::GetChar() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to a char")); wxFAIL_MSG(T("Could not convert to a char"));
return 0; return 0;
} }
} }
@@ -1645,7 +1645,7 @@ bool wxVariant::GetBool() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to a bool")); wxFAIL_MSG(T("Could not convert to a bool"));
return 0; return 0;
} }
} }
@@ -1657,7 +1657,7 @@ wxString wxVariant::GetString() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to a string")); wxFAIL_MSG(T("Could not convert to a string"));
return wxString(""); return wxString("");
} }
} }
@@ -1670,7 +1670,7 @@ wxTime wxVariant::GetTime() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to a time")); wxFAIL_MSG(T("Could not convert to a time"));
return wxTime(); return wxTime();
} }
} }
@@ -1682,7 +1682,7 @@ wxDate wxVariant::GetDate() const
return value; return value;
else else
{ {
wxFAIL_MSG(_T("Could not convert to a date")); wxFAIL_MSG(T("Could not convert to a date"));
return wxDate(); return wxDate();
} }
} }
@@ -1690,21 +1690,21 @@ wxDate wxVariant::GetDate() const
void* wxVariant::GetVoidPtr() const void* wxVariant::GetVoidPtr() const
{ {
wxASSERT( (GetType() == _T("void*")) ); wxASSERT( (GetType() == T("void*")) );
return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue(); return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue();
} }
wxList& wxVariant::GetList() const wxList& wxVariant::GetList() const
{ {
wxASSERT( (GetType() == _T("list")) ); wxASSERT( (GetType() == T("list")) );
return (wxList&) ((wxVariantDataList*) m_data)->GetValue(); return (wxList&) ((wxVariantDataList*) m_data)->GetValue();
} }
wxStringList& wxVariant::GetStringList() const wxStringList& wxVariant::GetStringList() const
{ {
wxASSERT( (GetType() == _T("stringlist")) ); wxASSERT( (GetType() == T("stringlist")) );
return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue(); return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue();
} }
@@ -1746,7 +1746,7 @@ bool wxVariant::Delete(int item)
{ {
wxList& list = GetList(); wxList& list = GetList();
wxASSERT_MSG( (item < list.Number()), _T("Invalid index to Delete") ); wxASSERT_MSG( (item < list.Number()), T("Invalid index to Delete") );
wxNode* node = list.Nth(item); wxNode* node = list.Nth(item);
wxVariant* variant = (wxVariant*) node->Data(); wxVariant* variant = (wxVariant*) node->Data();
delete variant; delete variant;
@@ -1757,13 +1757,13 @@ bool wxVariant::Delete(int item)
// Clear list // Clear list
void wxVariant::ClearList() void wxVariant::ClearList()
{ {
if (!IsNull() && (GetType() == _T("list"))) if (!IsNull() && (GetType() == T("list")))
{ {
((wxVariantDataList*) m_data)->Clear(); ((wxVariantDataList*) m_data)->Clear();
} }
else else
{ {
if (GetType() != _T("list")) if (GetType() != T("list"))
{ {
delete m_data; delete m_data;
m_data = NULL; m_data = NULL;
@@ -1776,15 +1776,15 @@ void wxVariant::ClearList()
bool wxVariant::Convert(long* value) const bool wxVariant::Convert(long* value) const
{ {
wxString type(GetType()); wxString type(GetType());
if (type == _T("double")) if (type == T("double"))
*value = (long) (((wxVariantDataReal*)GetData())->GetValue()); *value = (long) (((wxVariantDataReal*)GetData())->GetValue());
else if (type == _T("long")) else if (type == T("long"))
*value = ((wxVariantDataLong*)GetData())->GetValue(); *value = ((wxVariantDataLong*)GetData())->GetValue();
#ifdef HAVE_BOOL #ifdef HAVE_BOOL
else if (type == _T("bool")) else if (type == T("bool"))
*value = (long) (((wxVariantDataBool*)GetData())->GetValue()); *value = (long) (((wxVariantDataBool*)GetData())->GetValue());
#endif #endif
else if (type == _T("string")) else if (type == T("string"))
*value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); *value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else else
return FALSE; return FALSE;
@@ -1795,21 +1795,21 @@ bool wxVariant::Convert(long* value) const
bool wxVariant::Convert(bool* value) const bool wxVariant::Convert(bool* value) const
{ {
wxString type(GetType()); wxString type(GetType());
if (type == _T("double")) if (type == T("double"))
*value = ((int) (((wxVariantDataReal*)GetData())->GetValue()) != 0); *value = ((int) (((wxVariantDataReal*)GetData())->GetValue()) != 0);
else if (type == _T("long")) else if (type == T("long"))
*value = (((wxVariantDataLong*)GetData())->GetValue() != 0); *value = (((wxVariantDataLong*)GetData())->GetValue() != 0);
#ifdef HAVE_BOOL #ifdef HAVE_BOOL
else if (type == _T("bool")) else if (type == T("bool"))
*value = ((wxVariantDataBool*)GetData())->GetValue(); *value = ((wxVariantDataBool*)GetData())->GetValue();
#endif #endif
else if (type == _T("string")) else if (type == T("string"))
{ {
wxString val(((wxVariantDataString*)GetData())->GetValue()); wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower(); val.MakeLower();
if (val == _T("true") || val == _T("yes")) if (val == T("true") || val == T("yes"))
*value = TRUE; *value = TRUE;
else if (val == _T("false") || val == _T("no")) else if (val == T("false") || val == T("no"))
*value = FALSE; *value = FALSE;
else else
return FALSE; return FALSE;
@@ -1823,15 +1823,15 @@ bool wxVariant::Convert(bool* value) const
bool wxVariant::Convert(double* value) const bool wxVariant::Convert(double* value) const
{ {
wxString type(GetType()); wxString type(GetType());
if (type == _T("double")) if (type == T("double"))
*value = ((wxVariantDataReal*)GetData())->GetValue(); *value = ((wxVariantDataReal*)GetData())->GetValue();
else if (type == _T("long")) else if (type == T("long"))
*value = (double) (((wxVariantDataLong*)GetData())->GetValue()); *value = (double) (((wxVariantDataLong*)GetData())->GetValue());
#ifdef HAVE_BOOL #ifdef HAVE_BOOL
else if (type == _T("bool")) else if (type == T("bool"))
*value = (double) (((wxVariantDataBool*)GetData())->GetValue()); *value = (double) (((wxVariantDataBool*)GetData())->GetValue());
#endif #endif
else if (type == _T("string")) else if (type == T("string"))
*value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); *value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else else
return FALSE; return FALSE;
@@ -1842,12 +1842,12 @@ bool wxVariant::Convert(double* value) const
bool wxVariant::Convert(char* value) const bool wxVariant::Convert(char* value) const
{ {
wxString type(GetType()); wxString type(GetType());
if (type == _T("char")) if (type == T("char"))
*value = ((wxVariantDataChar*)GetData())->GetValue(); *value = ((wxVariantDataChar*)GetData())->GetValue();
else if (type == _T("long")) else if (type == T("long"))
*value = (char) (((wxVariantDataLong*)GetData())->GetValue()); *value = (char) (((wxVariantDataLong*)GetData())->GetValue());
#ifdef HAVE_BOOL #ifdef HAVE_BOOL
else if (type == _T("bool")) else if (type == T("bool"))
*value = (char) (((wxVariantDataBool*)GetData())->GetValue()); *value = (char) (((wxVariantDataBool*)GetData())->GetValue());
#endif #endif
else else
@@ -1866,9 +1866,9 @@ bool wxVariant::Convert(wxString* value) const
bool wxVariant::Convert(wxTime* value) const bool wxVariant::Convert(wxTime* value) const
{ {
wxString type(GetType()); wxString type(GetType());
if (type == _T("time")) if (type == T("time"))
*value = ((wxVariantDataTime*)GetData())->GetValue(); *value = ((wxVariantDataTime*)GetData())->GetValue();
else if (type == _T("date")) else if (type == T("date"))
*value = wxTime(((wxVariantDataDate*)GetData())->GetValue()); *value = wxTime(((wxVariantDataDate*)GetData())->GetValue());
else else
return FALSE; return FALSE;
@@ -1879,7 +1879,7 @@ bool wxVariant::Convert(wxTime* value) const
bool wxVariant::Convert(wxDate* value) const bool wxVariant::Convert(wxDate* value) const
{ {
wxString type(GetType()); wxString type(GetType());
if (type == _T("date")) if (type == T("date"))
*value = ((wxVariantDataDate*)GetData())->GetValue(); *value = ((wxVariantDataDate*)GetData())->GetValue();
else else
return FALSE; return FALSE;

View File

@@ -160,7 +160,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
// m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other // m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other
// member variables - check that it has been called (will catch the case // member variables - check that it has been called (will catch the case
// when a new ctor is added which doesn't call InitWindow) // when a new ctor is added which doesn't call InitWindow)
wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") ); wxASSERT_MSG( m_isWindow, T("Init() must have been called before!") );
// generate a new id if the user doesn't care about it // generate a new id if the user doesn't care about it
m_windowId = id == -1 ? NewControlId() : id; m_windowId = id == -1 ? NewControlId() : id;
@@ -191,7 +191,7 @@ wxWindowBase::~wxWindowBase()
// we weren't a dialog class // we weren't a dialog class
wxTopLevelWindows.DeleteObject(this); wxTopLevelWindows.DeleteObject(this);
wxASSERT_MSG( GetChildren().GetCount() == 0, _T("children not destroyed") ); wxASSERT_MSG( GetChildren().GetCount() == 0, T("children not destroyed") );
// make sure that there are no dangling pointers left pointing to us // make sure that there are no dangling pointers left pointing to us
wxPanel *panel = wxDynamicCast(GetParent(), wxPanel); wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
@@ -280,12 +280,12 @@ bool wxWindowBase::DestroyChildren()
wxWindow *child = node->GetData(); wxWindow *child = node->GetData();
wxASSERT_MSG( child, _T("children list contains empty nodes") ); wxASSERT_MSG( child, T("children list contains empty nodes") );
delete child; delete child;
wxASSERT_MSG( !GetChildren().Find(child), wxASSERT_MSG( !GetChildren().Find(child),
_T("child didn't remove itself using RemoveChild()") ); T("child didn't remove itself using RemoveChild()") );
} }
return TRUE; return TRUE;
@@ -335,7 +335,7 @@ void wxWindowBase::Centre(int direction)
if ( !(direction & wxCENTRE_ON_SCREEN) || wxDynamicCast(this, wxControl) ) if ( !(direction & wxCENTRE_ON_SCREEN) || wxDynamicCast(this, wxControl) )
{ {
// theo nly chance to get this is to have a wxControl without parent // theo nly chance to get this is to have a wxControl without parent
wxCHECK_RET( parent, _T("a control must have a parent") ); wxCHECK_RET( parent, T("a control must have a parent") );
// adjust to the parents client area origin // adjust to the parents client area origin
wxPoint posParent = parent->ClientToScreen(wxPoint(0, 0)); wxPoint posParent = parent->ClientToScreen(wxPoint(0, 0));
@@ -436,7 +436,7 @@ bool wxWindowBase::IsTopLevel() const
void wxWindowBase::AddChild(wxWindowBase *child) void wxWindowBase::AddChild(wxWindowBase *child)
{ {
wxCHECK_RET( child, _T("can't add a NULL child") ); wxCHECK_RET( child, T("can't add a NULL child") );
GetChildren().Append(child); GetChildren().Append(child);
child->SetParent(this); child->SetParent(this);
@@ -444,7 +444,7 @@ void wxWindowBase::AddChild(wxWindowBase *child)
void wxWindowBase::RemoveChild(wxWindowBase *child) void wxWindowBase::RemoveChild(wxWindowBase *child)
{ {
wxCHECK_RET( child, _T("can't remove a NULL child") ); wxCHECK_RET( child, T("can't remove a NULL child") );
GetChildren().DeleteObject(child); GetChildren().DeleteObject(child);
child->SetParent((wxWindow *)NULL); child->SetParent((wxWindow *)NULL);
@@ -579,7 +579,7 @@ void wxWindowBase::SetCaret(wxCaret *caret)
if ( m_caret ) if ( m_caret )
{ {
wxASSERT_MSG( m_caret->GetWindow() == this, wxASSERT_MSG( m_caret->GetWindow() == this,
_T("caret should be created associated to this window") ); T("caret should be created associated to this window") );
} }
} }
#endif // wxUSE_CARET #endif // wxUSE_CARET
@@ -1038,18 +1038,18 @@ void wxWindowBase::SetConstraintSizes(bool recurse)
wxChar *windowClass = GetClassInfo()->GetClassName(); wxChar *windowClass = GetClassInfo()->GetClassName();
wxString winName; wxString winName;
if ( GetName() == _T("") ) if ( GetName() == T("") )
winName = _T("unnamed"); winName = T("unnamed");
else else
winName = GetName(); winName = GetName();
wxLogDebug( _T("Constraint(s) not satisfied for window of type %s, name %s:\n"), wxLogDebug( T("Constraint(s) not satisfied for window of type %s, name %s:\n"),
(const wxChar *)windowClass, (const wxChar *)windowClass,
(const wxChar *)winName); (const wxChar *)winName);
if ( !constr->left.GetDone()) wxLogDebug( _T(" unsatisfied 'left' constraint.\n") ); if ( !constr->left.GetDone()) wxLogDebug( T(" unsatisfied 'left' constraint.\n") );
if ( !constr->right.GetDone()) wxLogDebug( _T(" unsatisfied 'right' constraint.\n") ); if ( !constr->right.GetDone()) wxLogDebug( T(" unsatisfied 'right' constraint.\n") );
if ( !constr->width.GetDone()) wxLogDebug( _T(" unsatisfied 'width' constraint.\n") ); if ( !constr->width.GetDone()) wxLogDebug( T(" unsatisfied 'width' constraint.\n") );
if ( !constr->height.GetDone()) wxLogDebug( _T(" unsatisfied 'height' constraint.\n") ); if ( !constr->height.GetDone()) wxLogDebug( T(" unsatisfied 'height' constraint.\n") );
wxLogDebug( _T("Please check constraints: try adding AsIs() constraints.\n") ); wxLogDebug( T("Please check constraints: try adding AsIs() constraints.\n") );
} }
if ( recurse ) if ( recurse )
@@ -1236,7 +1236,7 @@ wxPoint wxWindowBase::ConvertDialogToPixels(const wxPoint& pt)
void wxWindowBase::DoSetClientObject( wxClientData *data ) void wxWindowBase::DoSetClientObject( wxClientData *data )
{ {
wxASSERT_MSG( m_clientDataType != ClientData_Void, wxASSERT_MSG( m_clientDataType != ClientData_Void,
_T("can't have both object and void client data") ); T("can't have both object and void client data") );
if ( m_clientObject ) if ( m_clientObject )
delete m_clientObject; delete m_clientObject;
@@ -1248,7 +1248,7 @@ void wxWindowBase::DoSetClientObject( wxClientData *data )
wxClientData *wxWindowBase::DoGetClientObject() const wxClientData *wxWindowBase::DoGetClientObject() const
{ {
wxASSERT_MSG( m_clientDataType == ClientData_Object, wxASSERT_MSG( m_clientDataType == ClientData_Object,
_T("this window doesn't have object client data") ); T("this window doesn't have object client data") );
return m_clientObject; return m_clientObject;
} }
@@ -1256,7 +1256,7 @@ wxClientData *wxWindowBase::DoGetClientObject() const
void wxWindowBase::DoSetClientData( void *data ) void wxWindowBase::DoSetClientData( void *data )
{ {
wxASSERT_MSG( m_clientDataType != ClientData_Object, wxASSERT_MSG( m_clientDataType != ClientData_Object,
_T("can't have both object and void client data") ); T("can't have both object and void client data") );
m_clientData = data; m_clientData = data;
m_clientDataType = ClientData_Void; m_clientDataType = ClientData_Void;
@@ -1265,7 +1265,7 @@ void wxWindowBase::DoSetClientData( void *data )
void *wxWindowBase::DoGetClientData() const void *wxWindowBase::DoGetClientData() const
{ {
wxASSERT_MSG( m_clientDataType == ClientData_Void, wxASSERT_MSG( m_clientDataType == ClientData_Void,
_T("this window doesn't have void client data") ); T("this window doesn't have void client data") );
return m_clientData; return m_clientData;
} }

View File

@@ -52,7 +52,7 @@ size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n)
{ {
if (buf) { if (buf) {
if (!n || !*psz) { if (!n || !*psz) {
if (n) *buf = _T('\0'); if (n) *buf = T('\0');
return 0; return 0;
} }
return mbstowcs(buf, psz, n); return mbstowcs(buf, psz, n);
@@ -181,7 +181,7 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt
psz = wxStrpbrk(psz, delim); psz = wxStrpbrk(psz, delim);
if (!psz) *save_ptr = (wxChar*)NULL; if (!psz) *save_ptr = (wxChar*)NULL;
else { else {
*psz = _T('\0'); *psz = T('\0');
*save_ptr = psz + 1; *save_ptr = psz + 1;
} }
return ret; return ret;
@@ -292,21 +292,21 @@ WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr)
// FIXME: only correct for C locale // FIXME: only correct for C locale
while (wxIsspace(*nptr)) nptr++; while (wxIsspace(*nptr)) nptr++;
if (*nptr == _T('+') || *nptr == _T('-')) nptr++; if (*nptr == T('+') || *nptr == T('-')) nptr++;
while (wxIsdigit(*nptr)) nptr++; while (wxIsdigit(*nptr)) nptr++;
if (*nptr == _T('.')) { if (*nptr == T('.')) {
nptr++; nptr++;
while (wxIsdigit(*nptr)) nptr++; while (wxIsdigit(*nptr)) nptr++;
} }
if (*nptr == _T('E') || *nptr == _T('e')) { if (*nptr == T('E') || *nptr == T('e')) {
nptr++; nptr++;
if (*nptr == _T('+') || *nptr == _T('-')) nptr++; if (*nptr == T('+') || *nptr == T('-')) nptr++;
while (wxIsdigit(*nptr)) nptr++; while (wxIsdigit(*nptr)) nptr++;
} }
wxString data(nptr, nptr-start); wxString data(nptr, nptr-start);
wxWX2MBbuf dat = data.mb_str(wxConvLibc); wxWX2MBbuf dat = data.mb_str(wxConvLibc);
char *rdat = MBSTRINGCAST dat; char *rdat = wxMBSTRINGCAST dat;
double ret = strtod(dat, &rdat); double ret = strtod(dat, &rdat);
if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat)); if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat));
@@ -320,21 +320,21 @@ WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base)
// FIXME: only correct for C locale // FIXME: only correct for C locale
while (wxIsspace(*nptr)) nptr++; while (wxIsspace(*nptr)) nptr++;
if (*nptr == _T('+') || *nptr == _T('-')) nptr++; if (*nptr == T('+') || *nptr == T('-')) nptr++;
if (((base == 0) || (base == 16)) && if (((base == 0) || (base == 16)) &&
(nptr[0] == _T('0') && nptr[1] == _T('x'))) { (nptr[0] == T('0') && nptr[1] == T('x'))) {
nptr += 2; nptr += 2;
base = 16; base = 16;
} }
else if ((base == 0) && (nptr[0] == _T('0'))) base = 8; else if ((base == 0) && (nptr[0] == T('0'))) base = 8;
else if (base == 0) base = 10; else if (base == 0) base = 10;
while ((wxIsdigit(*nptr) && (*nptr - _T('0') < base)) || while ((wxIsdigit(*nptr) && (*nptr - T('0') < base)) ||
(wxIsalpha(*nptr) && (wxToupper(*nptr) - _T('A') + 10 < base))) nptr++; (wxIsalpha(*nptr) && (wxToupper(*nptr) - T('A') + 10 < base))) nptr++;
wxString data(nptr, nptr-start); wxString data(nptr, nptr-start);
wxWX2MBbuf dat = data.mb_str(wxConvLibc); wxWX2MBbuf dat = data.mb_str(wxConvLibc);
char *rdat = MBSTRINGCAST dat; char *rdat = wxMBSTRINGCAST dat;
long int ret = strtol(dat, &rdat, base); long int ret = strtol(dat, &rdat, base);
if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat)); if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat));

View File

@@ -275,12 +275,12 @@ wxExpr *wxExpr::AttributeValue(const wxString& word) const // Use only for a cla
wxString wxExpr::Functor(void) const // Use only for a clause wxString wxExpr::Functor(void) const // Use only for a clause
{ {
if ((type != wxExprList) || !value.first) if ((type != wxExprList) || !value.first)
return wxString(_T("")); return wxString(T(""));
if (value.first->type == wxExprWord) if (value.first->type == wxExprWord)
return wxString(value.first->value.word); return wxString(value.first->value.word);
else else
return wxString(_T("")); return wxString(T(""));
} }
bool wxExpr::IsFunctor(const wxString& f) const // Use only for a clause bool wxExpr::IsFunctor(const wxString& f) const // Use only for a clause
@@ -390,7 +390,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, wxExpr *val)
// DeleteAttributeValue(attribute); // DeleteAttributeValue(attribute);
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList); wxExpr *listExpr = new wxExpr(wxExprList);
@@ -414,7 +414,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, long val)
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(val); wxExpr *pval = new wxExpr(val);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList); wxExpr *listExpr = new wxExpr(wxExprList);
@@ -436,7 +436,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, double val)
// DeleteAttributeValue(attribute); // DeleteAttributeValue(attribute);
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(val); wxExpr *pval = new wxExpr(val);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList); wxExpr *listExpr = new wxExpr(wxExprList);
@@ -459,7 +459,7 @@ void wxExpr::AddAttributeValueString(const wxString& attribute, const wxString&
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(wxExprString, val); wxExpr *pval = new wxExpr(wxExprString, val);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList); wxExpr *listExpr = new wxExpr(wxExprList);
@@ -482,7 +482,7 @@ void wxExpr::AddAttributeValueWord(const wxString& attribute, const wxString& va
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(wxExprWord, val); wxExpr *pval = new wxExpr(wxExprWord, val);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList); wxExpr *listExpr = new wxExpr(wxExprList);
@@ -507,7 +507,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, wxList *val)
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(val); wxExpr *pval = new wxExpr(val);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList); wxExpr *listExpr = new wxExpr(wxExprList);
@@ -543,7 +543,7 @@ void wxExpr::AddAttributeValueStringList(const wxString& attribute, wxList *stri
// Now make an (=, Att, Value) triple // Now make an (=, Att, Value) triple
wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr2 = new wxExpr(wxExprList); wxExpr *listExpr2 = new wxExpr(wxExprList);
@@ -769,7 +769,7 @@ void wxExpr::WriteExpr(FILE* stream) // Write as any other subexpression
{ {
wxExpr *expr = value.first; wxExpr *expr = value.first;
if ((expr->Type() == wxExprWord) && (wxStrcmp(expr->WordValue(), _T("=")) == 0)) if ((expr->Type() == wxExprWord) && (wxStrcmp(expr->WordValue(), T("=")) == 0))
{ {
wxExpr *arg1 = expr->next; wxExpr *arg1 = expr->next;
wxExpr *arg2 = arg1->next; wxExpr *arg2 = arg1->next;
@@ -1018,7 +1018,7 @@ bool wxExprDatabase::ReadFromString(const wxString& buffer)
thewxExprDatabase = this; thewxExprDatabase = this;
const wxWX2MBbuf buf = buffer.mb_str(); const wxWX2MBbuf buf = buffer.mb_str();
LexFromString(MBSTRINGCAST buf); LexFromString(wxMBSTRINGCAST buf);
yyparse(); yyparse();
wxExprCleanUp(); wxExprCleanUp();
return (noErrors == 0); return (noErrors == 0);
@@ -1143,21 +1143,21 @@ char *wxmake_string(char *str)
t = s; t = s;
for(i=1; i<len; i++) // 1 since we want to skip leading quote for(i=1; i<len; i++) // 1 since we want to skip leading quote
{ {
if (sbuf[i] == _T('\\') && sbuf[i+1] == _T('"')) if (sbuf[i] == T('\\') && sbuf[i+1] == T('"'))
{ {
*t++ = _T('"'); *t++ = T('"');
i ++; i ++;
} }
else if (sbuf[i] == _T('\\') && sbuf[i+1] == _T('\\')) else if (sbuf[i] == T('\\') && sbuf[i+1] == T('\\'))
{ {
*t++ = _T('\\'); *t++ = T('\\');
i ++; i ++;
} }
else else
*t++ = sbuf[i]; *t++ = sbuf[i];
} }
*t = _T('\0'); *t = T('\0');
wxExpr *x = new wxExpr(wxExprString, s, FALSE); wxExpr *x = new wxExpr(wxExprString, s, FALSE);
return (char *)x; return (char *)x;

View File

@@ -17,7 +17,7 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB #if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
#include "wx/log.h" #include "wx/log.h"
#include "wx/intl.h" #include "wx/intl.h"
@@ -39,21 +39,21 @@ wxZipInputStream::wxZipInputStream(const wxString& archive, const wxString& file
m_Pos = 0; m_Pos = 0;
m_Size = 0; m_Size = 0;
m_Archive = (void*) unzOpen(archive.mb_str(wxConvFile)); m_Archive = (void*) unzOpen(archive.fn_str());
if (m_Archive == NULL) if (m_Archive == NULL)
{ {
m_lasterror = wxStream_READ_ERR; m_lasterror = wxStream_READ_ERR;
return; return;
} }
if (unzLocateFile((unzFile)m_Archive, file.mb_str(wxConvFile), 0) != UNZ_OK) if (unzLocateFile((unzFile)m_Archive, file.fn_str(), 0) != UNZ_OK)
{ {
m_lasterror = wxStream_READ_ERR; m_lasterror = wxStream_READ_ERR;
return; return;
} }
unzGetCurrentFileInfo((unzFile)m_Archive, &zinfo, (char*) NULL, 0, (void*) NULL, 0, (char*) NULL, 0); unzGetCurrentFileInfo((unzFile)m_Archive, &zinfo, (char*) NULL, 0, (void*) NULL, 0, (char*) NULL, 0);
if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK) if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK)
{ {
m_lasterror = wxStream_READ_ERR; m_lasterror = wxStream_READ_ERR;
return; return;
@@ -65,7 +65,7 @@ wxZipInputStream::wxZipInputStream(const wxString& archive, const wxString& file
wxZipInputStream::~wxZipInputStream() wxZipInputStream::~wxZipInputStream()
{ {
if (m_Archive) if (m_Archive)
{ {
if (m_Size != 0) if (m_Size != 0)
unzCloseCurrentFile((unzFile)m_Archive); unzCloseCurrentFile((unzFile)m_Archive);
@@ -90,7 +90,7 @@ off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode)
off_t nextpos; off_t nextpos;
void *buf; void *buf;
switch (mode) switch (mode)
{ {
case wxFromCurrent : nextpos = seek + m_Pos; break; case wxFromCurrent : nextpos = seek + m_Pos; break;
case wxFromStart : nextpos = seek; break; case wxFromStart : nextpos = seek; break;
@@ -99,7 +99,7 @@ off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode)
} }
// cheated seeking : // cheated seeking :
if (nextpos > m_Pos) if (nextpos > m_Pos)
{ {
buf = malloc(nextpos - m_Pos); buf = malloc(nextpos - m_Pos);
unzReadCurrentFile((unzFile)m_Archive, buf, nextpos - m_Pos); unzReadCurrentFile((unzFile)m_Archive, buf, nextpos - m_Pos);
@@ -107,8 +107,8 @@ off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode)
} }
else if (nextpos < m_Pos) { else if (nextpos < m_Pos) {
unzCloseCurrentFile((unzFile)m_Archive); unzCloseCurrentFile((unzFile)m_Archive);
if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK) if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK)
{ {
m_lasterror = wxStream_READ_ERR; m_lasterror = wxStream_READ_ERR;
return m_Pos; return m_Pos;
} }
@@ -122,4 +122,4 @@ off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode)
} }
#endif #endif
// wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB // wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB

View File

@@ -138,7 +138,7 @@ wxZlibOutputStream::~wxZlibOutputStream()
err = deflate(m_deflate, Z_FINISH); err = deflate(m_deflate, Z_FINISH);
if (err != Z_STREAM_END) if (err != Z_STREAM_END)
{ {
wxLogDebug( _T("wxZlibOutputStream: an error occured while closing the stream.\n") ); wxLogDebug( T("wxZlibOutputStream: an error occured while closing the stream.\n") );
return; return;
} }

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