Ticket #8272: filezilla.wx9.updated.3.diff

File filezilla.wx9.updated.3.diff, 66.3 KB (added by Tautvydas Andrikys, 11 years ago)
  • configure.in

    diff -r 0c89638d5302 -r c6f43e47a9eb configure.in
    a b  
    9595  AM_OPTIONS_WXCONFIG
    9696
    9797  MIN_WX_VERSION="2.8.12"
    98   AM_PATH_WXCONFIG($MIN_WX_VERSION, wxWin=1, , [aui,xrc,adv,core,xml,net,base], [--unicode=yes --universal=no])
     98  WX_CONFIG_CHECK($MIN_WX_VERSION, wxWin=1, , [aui,html,xrc,adv,core,xml,net,base], [--unicode=yes --universal=no])
    9999  if test "$wxWin" != 1; then
    100100    AC_MSG_ERROR([
    101101        wxWidgets must be installed on your system
     
    111111        equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
    112112    ])
    113113  fi
    114   if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then
    115     AC_MSG_ERROR([You need to use wxWidgets 2.8.x to compile this program.])
     114  if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "9"; then
     115    AC_MSG_ERROR([You need to use wxWidgets 2.9.x to compile this program.])
    116116  fi
    117117
    118118  # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here.
  • m4/wxwin.m4

    diff -r 0c89638d5302 -r c6f43e47a9eb m4/wxwin.m4
    a b  
     1dnl ---------------------------------------------------------------------------
     2dnl Author:          wxWidgets development team,
     3dnl                  Francesco Montorsi,
     4dnl                  Bob McCown (Mac-testing)
     5dnl Creation date:   24/11/2001
     6dnl RCS-ID:          $Id$
     7dnl ---------------------------------------------------------------------------
     8
     9dnl ===========================================================================
     10dnl Table of Contents of this macro file:
     11dnl -------------------------------------
     12dnl
     13dnl SECTION A: wxWidgets main macros
     14dnl  - WX_CONFIG_OPTIONS
     15dnl  - WX_CONFIG_CHECK
     16dnl  - WXRC_CHECK
     17dnl  - WX_STANDARD_OPTIONS
     18dnl  - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
     19dnl  - WX_DETECT_STANDARD_OPTION_VALUES
     20dnl
     21dnl SECTION B: wxWidgets-related utilities
     22dnl  - WX_LIKE_LIBNAME
     23dnl  - WX_ARG_ENABLE_YESNOAUTO
     24dnl  - WX_ARG_WITH_YESNOAUTO
     25dnl
     26dnl SECTION C: messages to the user
     27dnl  - WX_STANDARD_OPTIONS_SUMMARY_MSG
     28dnl  - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
     29dnl  - WX_STANDARD_OPTIONS_SUMMARY_MSG_END
     30dnl  - WX_BOOLOPT_SUMMARY
     31dnl
     32dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra
     33dnl debug output on stdout from these macros.
     34dnl ===========================================================================
     35
     36
    137dnl ---------------------------------------------------------------------------
    238dnl Macros for wxWidgets detection. Typically used in configure.in as:
    339dnl
    440dnl     AC_ARG_ENABLE(...)
    541dnl     AC_ARG_WITH(...)
    642dnl        ...
    7 dnl     AM_OPTIONS_WXCONFIG
     43dnl     WX_CONFIG_OPTIONS
    844dnl        ...
    945dnl        ...
    10 dnl     AM_PATH_WXCONFIG(2.6.0, wxWin=1)
     46dnl     WX_CONFIG_CHECK([2.6.0], [wxWin=1])
    1147dnl     if test "$wxWin" != 1; then
    1248dnl        AC_MSG_ERROR([
    1349dnl                wxWidgets must be installed on your system
     
    2460dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
    2561dnl
    2662dnl     LIBS="$LIBS $WX_LIBS"
     63dnl
     64dnl If you want to support standard --enable-debug/unicode/shared options, you
     65dnl may do the following:
     66dnl
     67dnl     ...
     68dnl     AC_CANONICAL_SYSTEM
     69dnl
     70dnl     # define configure options
     71dnl     WX_CONFIG_OPTIONS
     72dnl     WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
     73dnl
     74dnl     # basic configure checks
     75dnl     ...
     76dnl
     77dnl     # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
     78dnl     WX_DEBUG=$DEBUG
     79dnl     WX_UNICODE=$UNICODE
     80dnl
     81dnl     WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
     82dnl     WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS])
     83dnl     WX_DETECT_STANDARD_OPTION_VALUES
     84dnl
     85dnl     # write the output files
     86dnl     AC_CONFIG_FILES([Makefile ...])
     87dnl     AC_OUTPUT
     88dnl
     89dnl     # optional: just to show a message to the user
     90dnl     WX_STANDARD_OPTIONS_SUMMARY_MSG
     91dnl
    2792dnl ---------------------------------------------------------------------------
    2893
     94
    2995dnl ---------------------------------------------------------------------------
    30 dnl AM_OPTIONS_WXCONFIG
     96dnl WX_CONFIG_OPTIONS
    3197dnl
    3298dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
    3399dnl --wx-config command line options
    34100dnl ---------------------------------------------------------------------------
    35101
    36 AC_DEFUN([AM_OPTIONS_WXCONFIG],
     102AC_DEFUN([WX_CONFIG_OPTIONS],
    37103[
    38104    AC_ARG_WITH(wxdir,
    39105                [  --with-wxdir=PATH       Use uninstalled version of wxWidgets in PATH],
     
    76142])
    77143
    78144dnl ---------------------------------------------------------------------------
    79 dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
     145dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
    80146dnl                  [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
    81147dnl
    82148dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
     
    86152dnl case the macro won't even waste time on tests for its existence.
    87153dnl
    88154dnl Optional WX-LIBS argument contains comma- or space-separated list of
    89 dnl wxWidgets libraries to link against (it may include contrib libraries). If
    90 dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
    91 dnl link with all of the core wxWidgets libraries.
     155dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS
     156dnl and WX_LIBS_STATIC will contain flags to link with all of the core
     157dnl wxWidgets libraries.
    92158dnl
    93159dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
    94160dnl invocation command in present. It can be used to fine-tune lookup of
    95161dnl best wxWidgets build available.
    96162dnl
    97163dnl Example use:
    98 dnl   AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
     164dnl   WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
    99165dnl                    [--unicode --debug])
    100166dnl ---------------------------------------------------------------------------
    101167
    102168dnl
    103169dnl Get the cflags and libraries from the wx-config script
    104170dnl
    105 AC_DEFUN([AM_PATH_WXCONFIG],
     171AC_DEFUN([WX_CONFIG_CHECK],
    106172[
    107173  dnl do we have wx-config name: it can be wx-config or wxd-config or ...
    108174  if test x${WX_CONFIG_NAME+set} != xset ; then
     
    145211      AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
    146212    fi
    147213
    148     WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
     214    dnl don't add the libraries ($4) to this variable as this would result in
     215    dnl an error when it's used with --version below
     216    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5"
    149217
    150218    WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
    151219    wx_config_major_version=`echo $WX_VERSION | \
     
    167235                              [$wx_requested_micro_version])
    168236
    169237    if test -n "$wx_ver_ok"; then
    170 
    171238      AC_MSG_RESULT(yes (version $WX_VERSION))
    172       WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
     239      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4`
    173240
    174241      dnl is this even still appropriate?  --static is a real option now
    175242      dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
    176243      dnl what the user actually wants, making this redundant at best.
    177244      dnl For now keep it in case anyone actually used it in the past.
    178245      AC_MSG_CHECKING([for wxWidgets static library])
    179       WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
     246      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null`
    180247      if test "x$WX_LIBS_STATIC" = "x"; then
    181248        AC_MSG_RESULT(no)
    182249      else
     
    221288
    222289      if test "x$wx_has_cppflags" = x ; then
    223290         dnl no choice but to define all flags like CFLAGS
    224          WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
     291         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
    225292         WX_CPPFLAGS=$WX_CFLAGS
    226293         WX_CXXFLAGS=$WX_CFLAGS
    227294
     
    229296         WX_CXXFLAGS_ONLY=$WX_CFLAGS
    230297      else
    231298         dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
    232          WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
    233          WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
    234          WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
     299         WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4`
     300         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4`
     301         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
    235302
    236303         WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
    237304         WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
     
    254321       WX_LIBS=""
    255322       WX_LIBS_STATIC=""
    256323       WX_RESCOMP=""
    257        ifelse([$3], , :, [$3])
     324
     325       if test ! -z "$5"; then
     326
     327          wx_error_message="
     328    The configuration you asked for $PACKAGE_NAME requires a wxWidgets
     329    build with the following settings:
     330        $5
     331    but such build is not available.
     332
     333    To see the wxWidgets builds available on this system, please use
     334    'wx-config --list' command. To use the default build, returned by
     335    'wx-config --selected-config', use the options with their 'auto'
     336    default values."
     337
     338       fi
     339
     340       wx_error_message="
     341    The requested wxWidgets build couldn't be found.
     342    $wx_error_message
     343
     344    If you still get this error, then check that 'wx-config' is
     345    in path, the directory where wxWidgets libraries are installed
     346    (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
     347    or equivalent variable and wxWidgets version is $1 or above."
     348
     349       ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3])
    258350
    259351    fi
    260352  else
     
    279371  AC_SUBST(WX_LIBS_STATIC)
    280372  AC_SUBST(WX_VERSION)
    281373  AC_SUBST(WX_RESCOMP)
     374
     375  dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols
     376  dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness):
     377  WX_VERSION_MAJOR="$wx_config_major_version"
     378  WX_VERSION_MINOR="$wx_config_minor_version"
     379  WX_VERSION_MICRO="$wx_config_micro_version"
     380  AC_SUBST(WX_VERSION_MAJOR)
     381  AC_SUBST(WX_VERSION_MINOR)
     382  AC_SUBST(WX_VERSION_MICRO)
    282383])
    283384
    284385dnl ---------------------------------------------------------------------------
     
    288389dnl     AC_ARG_ENABLE(...)
    289390dnl     AC_ARG_WITH(...)
    290391dnl        ...
    291 dnl     AM_OPTIONS_WXCONFIG
     392dnl     WX_CONFIG_OPTIONS
    292393dnl        ...
    293 dnl     AM_PATH_WXCONFIG(2.6.0, wxWin=1)
     394dnl     WX_CONFIG_CHECK(2.6.0, wxWin=1)
    294395dnl     if test "$wxWin" != 1; then
    295396dnl        AC_MSG_ERROR([
    296397dnl                wxWidgets must be installed on your system
     
    303404dnl        ])
    304405dnl     fi
    305406dnl
    306 dnl     AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])
     407dnl     WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
    307408dnl     if test "x$HAVE_WXRC" != x1; then
    308409dnl         AC_MSG_ERROR([
    309410dnl                The wxrc program was not installed or not found.
     
    319420dnl     LDFLAGS="$LDFLAGS $WX_LIBS"
    320421dnl ---------------------------------------------------------------------------
    321422
    322 
    323 
    324423dnl ---------------------------------------------------------------------------
    325 dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
     424dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
    326425dnl
    327426dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
    328427dnl resources.  The variable WXRC will be set and substituted in the configure
    329428dnl script and Makefiles.
    330429dnl
    331430dnl Example use:
    332 dnl   AM_PATH_WXRC([wxrc=1], [wxrc=0])
     431dnl   WXRC_CHECK([wxrc=1], [wxrc=0])
    333432dnl ---------------------------------------------------------------------------
    334433
    335434dnl
    336435dnl wxrc program from the wx-config script
    337436dnl
    338 AC_DEFUN([AM_PATH_WXRC],
     437AC_DEFUN([WXRC_CHECK],
    339438[
    340439  AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
    341440
     
    364463    AC_SUBST(WXRC)
    365464  fi
    366465])
     466
     467dnl ---------------------------------------------------------------------------
     468dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
     469dnl
     470dnl Sets the "output-var" variable to the name of a library named with same
     471dnl wxWidgets rule.
     472dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets
     473dnl      the $lib variable to:
     474dnl          'mine_gtk2ud_test-2.8'
     475dnl      if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28
     476dnl ---------------------------------------------------------------------------
     477AC_DEFUN([WX_LIKE_LIBNAME],
     478    [
     479        wx_temp="$2""_""$WX_PORT"
     480
     481        dnl add the [u][d] string
     482        if test "$WX_UNICODE" = "1"; then
     483            wx_temp="$wx_temp""u"
     484        fi
     485        if test "$WX_DEBUG" = "1"; then
     486            wx_temp="$wx_temp""d"
     487        fi
     488
     489        dnl complete the name of the lib
     490        wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR"
     491
     492        dnl save it in the user's variable
     493        $1=$wx_temp
     494    ])
     495
     496dnl ---------------------------------------------------------------------------
     497dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
     498dnl
     499dnl Two little custom macros which define the ENABLE/WITH configure arguments.
     500dnl Macro arguments:
     501dnl $1 = the name of the --enable / --with  feature
     502dnl $2 = the name of the variable associated
     503dnl $3 = the description of that feature
     504dnl $4 = the default value for that feature
     505dnl $5 = additional action to do in case option is given with "yes" value
     506dnl ---------------------------------------------------------------------------
     507AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO],
     508         [AC_ARG_ENABLE($1,
     509            AC_HELP_STRING([--enable-$1], [$3 (default is $4)]),
     510            [], [enableval="$4"])
     511
     512            dnl Show a message to the user about this option
     513            AC_MSG_CHECKING([for the --enable-$1 option])
     514            if test "$enableval" = "yes" ; then
     515                AC_MSG_RESULT([yes])
     516                $2=1
     517                $5
     518            elif test "$enableval" = "no" ; then
     519                AC_MSG_RESULT([no])
     520                $2=0
     521            elif test "$enableval" = "auto" ; then
     522                AC_MSG_RESULT([will be automatically detected])
     523                $2="auto"
     524            else
     525                AC_MSG_ERROR([
     526    Unrecognized option value (allowed values: yes, no, auto)
     527                ])
     528            fi
     529         ])
     530
     531AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
     532         [AC_ARG_WITH($1,
     533            AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
     534            [], [withval="$4"])
     535
     536            dnl Show a message to the user about this option
     537            AC_MSG_CHECKING([for the --with-$1 option])
     538            if test "$withval" = "yes" ; then
     539                AC_MSG_RESULT([yes])
     540                $2=1
     541                $5
     542            dnl NB: by default we don't allow --with-$1=no option
     543            dnl     since it does not make much sense !
     544            elif test "$6" = "1" -a "$withval" = "no" ; then
     545                AC_MSG_RESULT([no])
     546                $2=0
     547            elif test "$withval" = "auto" ; then
     548                AC_MSG_RESULT([will be automatically detected])
     549                $2="auto"
     550            else
     551                AC_MSG_ERROR([
     552    Unrecognized option value (allowed values: yes, auto)
     553                ])
     554            fi
     555         ])
     556
     557
     558dnl ---------------------------------------------------------------------------
     559dnl WX_STANDARD_OPTIONS([options-to-add])
     560dnl
     561dnl Adds to the configure script one or more of the following options:
     562dnl   --enable-[debug|unicode|shared|wxshared|wxdebug]
     563dnl   --with-[gtk|msw|motif|x11|mac|dfb]
     564dnl   --with-wxversion
     565dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED,
     566dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values.
     567dnl
     568dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the
     569dnl --enable-unicode option (in boolean format) while the second indicates
     570dnl if wxWidgets was built in Unicode mode (and still is in boolean format).
     571dnl ---------------------------------------------------------------------------
     572AC_DEFUN([WX_STANDARD_OPTIONS],
     573        [
     574
     575        dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if
     576        dnl the $1 argument contains respectively the debug,unicode or shared options.
     577
     578        dnl be careful here not to set debug flag if only "wxdebug" was specified
     579        ifelse(regexp([$1], [\bdebug]), [-1],,
     580               [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])])
     581
     582        ifelse(index([$1], [unicode]), [-1],,
     583               [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])])
     584
     585        ifelse(regexp([$1], [\bshared]), [-1],,
     586               [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])])
     587
     588        dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option
     589        dnl which must be able to accept the auto|gtk1|gtk2|msw|... values
     590        ifelse(index([$1], [toolkit]), [-1],,
     591               [
     592                AC_ARG_WITH([toolkit],
     593                            AC_HELP_STRING([--with-toolkit],
     594                                           [Build against a specific wxWidgets toolkit (default is auto)]),
     595                            [], [withval="auto"])
     596
     597                dnl Show a message to the user about this option
     598                AC_MSG_CHECKING([for the --with-toolkit option])
     599                if test "$withval" = "auto" ; then
     600                    AC_MSG_RESULT([will be automatically detected])
     601                    TOOLKIT="auto"
     602                else
     603                    TOOLKIT="$withval"
     604
     605                    dnl PORT must be one of the allowed values
     606                    if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \
     607                            "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \
     608                            "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \
     609                            "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then
     610                        AC_MSG_ERROR([
     611    Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11)
     612                        ])
     613                    fi
     614
     615                    AC_MSG_RESULT([$TOOLKIT])
     616                fi
     617               ])
     618
     619        dnl ****** IMPORTANT *******
     620        dnl   Unlike for the UNICODE setting, you can build your program in
     621        dnl   shared mode against a static build of wxWidgets. Thus we have the
     622        dnl   following option which allows these mixtures. E.g.
     623        dnl
     624        dnl      ./configure --disable-shared --with-wxshared
     625        dnl
     626        dnl   will build your library in static mode against the first available
     627        dnl   shared build of wxWidgets.
     628        dnl
     629        dnl   Note that's not possible to do the viceversa:
     630        dnl
     631        dnl      ./configure --enable-shared --without-wxshared
     632        dnl
     633        dnl   Doing so you would try to build your library in shared mode against a static
     634        dnl   build of wxWidgets. This is not possible (you would mix PIC and non PIC code) !
     635        dnl   A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES
     636        dnl   (where we know what 'auto' should be expanded to).
     637        dnl
     638        dnl   If you try to build something in ANSI mode against a UNICODE build
     639        dnl   of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets,
     640        dnl   then at best you'll get ton of linking errors !
     641        dnl ************************
     642
     643        ifelse(index([$1], [wxshared]), [-1],,
     644               [
     645                WX_ARG_WITH_YESNOAUTO(
     646                    [wxshared], [WX_SHARED],
     647                    [Force building against a shared build of wxWidgets, even if --disable-shared is given],
     648                    [auto], [], [1])
     649               ])
     650
     651        dnl Just like for SHARED and WX_SHARED it may happen that some adventurous
     652        dnl peoples will want to mix a wxWidgets release build with a debug build of
     653        dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables.
     654        ifelse(index([$1], [wxdebug]), [-1],,
     655               [
     656                WX_ARG_WITH_YESNOAUTO(
     657                    [wxdebug], [WX_DEBUG],
     658                    [Force building against a debug build of wxWidgets, even if --disable-debug is given],
     659                    [auto], [], [1])
     660               ])
     661
     662        dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option
     663        dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values
     664        ifelse(index([$1], [wxversion]), [-1],,
     665               [
     666                AC_ARG_WITH([wxversion],
     667                            AC_HELP_STRING([--with-wxversion],
     668                                           [Build against a specific version of wxWidgets (default is auto)]),
     669                            [], [withval="auto"])
     670
     671                dnl Show a message to the user about this option
     672                AC_MSG_CHECKING([for the --with-wxversion option])
     673                if test "$withval" = "auto" ; then
     674                    AC_MSG_RESULT([will be automatically detected])
     675                    WX_RELEASE="auto"
     676                else
     677
     678                    wx_requested_major_version=`echo $withval | \
     679                        sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
     680                    wx_requested_minor_version=`echo $withval | \
     681                        sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
     682
     683                    dnl both vars above must be exactly 1 digit
     684                    if test "${#wx_requested_major_version}" != "1" -o \
     685                            "${#wx_requested_minor_version}" != "1" ; then
     686                        AC_MSG_ERROR([
     687    Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0)
     688                        ])
     689                    fi
     690
     691                    WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version"
     692                    AC_MSG_RESULT([$WX_RELEASE])
     693                fi
     694               ])
     695
     696        if test "$WX_DEBUG_CONFIGURE" = "1"; then
     697            echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG"
     698            echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE"
     699            echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED"
     700            echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT"
     701            echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE"
     702        fi
     703    ])
     704
     705
     706dnl ---------------------------------------------------------------------------
     707dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
     708dnl
     709dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values
     710dnl which are different from "auto".
     711dnl Thus this macro needs to be called only once all options have been set.
     712dnl ---------------------------------------------------------------------------
     713AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
     714        [
     715        if test "$WX_SHARED" = "1" ; then
     716            WXCONFIG_FLAGS="--static=no "
     717        elif test "$WX_SHARED" = "0" ; then
     718            WXCONFIG_FLAGS="--static=yes "
     719        fi
     720
     721        if test "$WX_DEBUG" = "1" ; then
     722            WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes "
     723        elif test "$WX_DEBUG" = "0" ; then
     724            WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no "
     725        fi
     726
     727        dnl The user should have set WX_UNICODE=UNICODE
     728        if test "$WX_UNICODE" = "1" ; then
     729            WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes "
     730        elif test "$WX_UNICODE" = "0" ; then
     731            WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no "
     732        fi
     733
     734        if test "$TOOLKIT" != "auto" ; then
     735            WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
     736        fi
     737
     738        if test "$WX_RELEASE" != "auto" ; then
     739            WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
     740        fi
     741
     742        dnl strip out the last space of the string
     743        WXCONFIG_FLAGS=${WXCONFIG_FLAGS% }
     744
     745        if test "$WX_DEBUG_CONFIGURE" = "1"; then
     746            echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS"
     747        fi
     748    ])
     749
     750
     751dnl ---------------------------------------------------------------------------
     752dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
     753dnl                             [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
     754dnl
     755dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets
     756dnl additional CPP flags and put the result of the search in WX_$RESULTVAR
     757dnl also adding the "yes" or "no" message result to MSG.
     758dnl ---------------------------------------------------------------------------
     759AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
     760        [
     761        if test "$$1" = "auto" ; then
     762
     763            dnl The user does not have particular preferences for this option;
     764            dnl so we will detect the wxWidgets relative build setting and use it
     765            AC_MSG_CHECKING([$3])
     766
     767            dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2
     768            dnl string or to 0 otherwise.
     769            dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it
     770            dnl       doesn't work; we use 'expr STRING : REGEXP' instead
     771            WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*")
     772
     773            if test "$WX_$1" != "0"; then
     774                WX_$1=1
     775                AC_MSG_RESULT([yes])
     776                ifelse([$4], , :, [$4])
     777            else
     778                WX_$1=0
     779                AC_MSG_RESULT([no])
     780                ifelse([$5], , :, [$5])
     781            fi
     782        else
     783
     784            dnl Use the setting given by the user
     785            WX_$1=$$1
     786        fi
     787    ])
     788
     789dnl ---------------------------------------------------------------------------
     790dnl WX_DETECT_STANDARD_OPTION_VALUES
     791dnl
     792dnl Detects the values of the following variables:
     793dnl 1) WX_RELEASE
     794dnl 2) WX_UNICODE
     795dnl 3) WX_DEBUG
     796dnl 4) WX_SHARED    (and also WX_STATIC)
     797dnl 5) WX_PORT
     798dnl from the previously selected wxWidgets build; this macro in fact must be
     799dnl called *after* calling the WX_CONFIG_CHECK macro.
     800dnl
     801dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set
     802dnl by WX_CONFIG_CHECK macro
     803dnl ---------------------------------------------------------------------------
     804AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
     805        [
     806        dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits,
     807        dnl            while WX_RELEASE only the major.minor ones.
     808        WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR"
     809        if test $WX_RELEASE -lt 26 ; then
     810
     811            AC_MSG_ERROR([
     812    Cannot detect the wxWidgets configuration for the selected wxWidgets build
     813    since its version is $WX_VERSION < 2.6.0; please install a newer
     814    version of wxWidgets.
     815                         ])
     816        fi
     817
     818        dnl The wx-config we are using understands the "--selected_config"
     819        dnl option which returns an easy-parseable string !
     820        WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config)
     821
     822        if test "$WX_DEBUG_CONFIGURE" = "1"; then
     823            echo "[[dbg]] Using wx-config --selected-config"
     824            echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
     825        fi
     826
     827
     828        dnl we could test directly for WX_SHARED with a line like:
     829        dnl    _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared],
     830        dnl                                [if wxWidgets was built in SHARED mode])
     831        dnl but wx-config --selected-config DOES NOT outputs the 'shared'
     832        dnl word when wx was built in shared mode; it rather outputs the
     833        dnl 'static' word when built in static mode.
     834        if test $WX_SHARED = "1"; then
     835            STATIC=0
     836        elif test $WX_SHARED = "0"; then
     837            STATIC=1
     838        elif test $WX_SHARED = "auto"; then
     839            STATIC="auto"
     840        fi
     841
     842        dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables
     843        _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode],
     844                                    [if wxWidgets was built with UNICODE enabled])
     845        _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug],
     846                                    [if wxWidgets was built in DEBUG mode])
     847        _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static],
     848                                    [if wxWidgets was built in STATIC mode])
     849
     850        dnl init WX_SHARED from WX_STATIC
     851        if test "$WX_STATIC" != "0"; then
     852            WX_SHARED=0
     853        else
     854            WX_SHARED=1
     855        fi
     856
     857        AC_SUBST(WX_UNICODE)
     858        AC_SUBST(WX_DEBUG)
     859        AC_SUBST(WX_SHARED)
     860
     861        dnl detect the WX_PORT to use
     862        if test "$TOOLKIT" = "auto" ; then
     863
     864            dnl The user does not have particular preferences for this option;
     865            dnl so we will detect the wxWidgets relative build setting and use it
     866            AC_MSG_CHECKING([which wxWidgets toolkit was selected])
     867
     868            WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*")
     869            WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*")
     870            WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*")
     871            WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*")
     872            WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*")
     873            WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*")
     874            WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*")
     875            WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*")
     876
     877            WX_PORT="unknown"
     878            if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi
     879            if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi
     880            if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi
     881            if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi
     882            if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi
     883            if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi
     884            if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi
     885            if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi
     886
     887            dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac
     888            dnl       ports are called 'osx_cocoa' and 'osx_carbon' (see above)
     889            WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*")
     890            if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi
     891
     892            dnl check at least one of the WX_*PORT has been set !
     893
     894            if test "$WX_PORT" = "unknown" ; then
     895                AC_MSG_ERROR([
     896        Cannot detect the currently installed wxWidgets port !
     897        Please check your 'wx-config --cxxflags'...
     898                            ])
     899            fi
     900
     901            AC_MSG_RESULT([$WX_PORT])
     902        else
     903
     904            dnl Use the setting given by the user
     905            if test -z "$TOOLKIT" ; then
     906                WX_PORT=$TOOLKIT
     907            else
     908                dnl try with PORT
     909                WX_PORT=$PORT
     910            fi
     911        fi
     912
     913        AC_SUBST(WX_PORT)
     914
     915        if test "$WX_DEBUG_CONFIGURE" = "1"; then
     916            echo "[[dbg]] Values of all WX_* options after final detection:"
     917            echo "[[dbg]] WX_DEBUG: $WX_DEBUG"
     918            echo "[[dbg]] WX_UNICODE: $WX_UNICODE"
     919            echo "[[dbg]] WX_SHARED: $WX_SHARED"
     920            echo "[[dbg]] WX_RELEASE: $WX_RELEASE"
     921            echo "[[dbg]] WX_PORT: $WX_PORT"
     922        fi
     923
     924        dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when
     925        dnl the user gives the options:
     926        dnl      ./configure --enable-shared --without-wxshared
     927        dnl or just do
     928        dnl      ./configure --enable-shared
     929        dnl but there is only a static build of wxWidgets available.
     930        if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then
     931            AC_MSG_ERROR([
     932    Cannot build shared library against a static build of wxWidgets !
     933    This error happens because the wxWidgets build which was selected
     934    has been detected as static while you asked to build $PACKAGE_NAME
     935    as shared library and this is not possible.
     936    Use the '--disable-shared' option to build $PACKAGE_NAME
     937    as static library or '--with-wxshared' to use wxWidgets as shared library.
     938                         ])
     939        fi
     940
     941        dnl now we can finally update the DEBUG,UNICODE,SHARED options
     942        dnl to their final values if they were set to 'auto'
     943        if test "$DEBUG" = "auto"; then
     944            DEBUG=$WX_DEBUG
     945        fi
     946        if test "$UNICODE" = "auto"; then
     947            UNICODE=$WX_UNICODE
     948        fi
     949        if test "$SHARED" = "auto"; then
     950            SHARED=$WX_SHARED
     951        fi
     952        if test "$TOOLKIT" = "auto"; then
     953            TOOLKIT=$WX_PORT
     954        fi
     955
     956        dnl in case the user needs a BUILD=debug/release var...
     957        if test "$DEBUG" = "1"; then
     958            BUILD="debug"
     959        elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then
     960            BUILD="release"
     961        fi
     962
     963        dnl respect the DEBUG variable adding the optimize/debug flags
     964        dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we
     965        dnl       don't need to set them, too
     966        if test "$DEBUG" = "1"; then
     967            CXXFLAGS="$CXXFLAGS -g -O0"
     968            CFLAGS="$CFLAGS -g -O0"
     969        else
     970            CXXFLAGS="$CXXFLAGS -O2"
     971            CFLAGS="$CFLAGS -O2"
     972        fi
     973    ])
     974
     975dnl ---------------------------------------------------------------------------
     976dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for],
     977dnl                   [what to print when var is 1],
     978dnl                   [what to print when var is 0])
     979dnl
     980dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0.
     981dnl This macro mainly exists just to make configure.ac scripts more readable.
     982dnl
     983dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments
     984dnl       if you want that m4 avoid to throw away the spaces prefixed to the
     985dnl       argument value.
     986dnl ---------------------------------------------------------------------------
     987AC_DEFUN([WX_BOOLOPT_SUMMARY],
     988        [
     989        if test "x$$1" = "x1" ; then
     990            echo $2
     991        elif test "x$$1" = "x0" ; then
     992            echo $3
     993        else
     994            echo "$1 is $$1"
     995        fi
     996    ])
     997
     998dnl ---------------------------------------------------------------------------
     999dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
     1000dnl
     1001dnl Shows a summary message to the user about the WX_* variable contents.
     1002dnl This macro is used typically at the end of the configure script.
     1003dnl ---------------------------------------------------------------------------
     1004AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG],
     1005        [
     1006        echo
     1007        echo "  The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION"
     1008        echo "  has the following settings:"
     1009        WX_BOOLOPT_SUMMARY([WX_DEBUG],   ["  - DEBUG build"],  ["  - RELEASE build"])
     1010        WX_BOOLOPT_SUMMARY([WX_UNICODE], ["  - UNICODE mode"], ["  - ANSI mode"])
     1011        WX_BOOLOPT_SUMMARY([WX_SHARED],  ["  - SHARED mode"],  ["  - STATIC mode"])
     1012        echo "  - VERSION: $WX_VERSION"
     1013        echo "  - PORT: $WX_PORT"
     1014    ])
     1015
     1016
     1017dnl ---------------------------------------------------------------------------
     1018dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
     1019dnl
     1020dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info
     1021dnl about the configuration of the package which used the wxpresets.
     1022dnl
     1023dnl Typical usage:
     1024dnl    WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
     1025dnl    echo "   - Package setting 1: $SETTING1"
     1026dnl    echo "   - Package setting 2: $SETTING1"
     1027dnl    ...
     1028dnl    WX_STANDARD_OPTIONS_SUMMARY_MSG_END
     1029dnl
     1030dnl ---------------------------------------------------------------------------
     1031AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
     1032        [
     1033        echo
     1034        echo " ----------------------------------------------------------------"
     1035        echo "  Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed."
     1036        echo "  Summary of main configuration settings for $PACKAGE_NAME:"
     1037        WX_BOOLOPT_SUMMARY([DEBUG], ["  - DEBUG build"], ["  - RELEASE build"])
     1038        WX_BOOLOPT_SUMMARY([UNICODE], ["  - UNICODE mode"], ["  - ANSI mode"])
     1039        WX_BOOLOPT_SUMMARY([SHARED], ["  - SHARED mode"], ["  - STATIC mode"])
     1040    ])
     1041
     1042AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
     1043        [
     1044        WX_STANDARD_OPTIONS_SUMMARY_MSG
     1045        echo
     1046        echo "  Now, just run make."
     1047        echo " ----------------------------------------------------------------"
     1048        echo
     1049    ])
     1050
     1051
     1052dnl ---------------------------------------------------------------------------
     1053dnl Deprecated macro wrappers
     1054dnl ---------------------------------------------------------------------------
     1055
     1056AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS])
     1057AC_DEFUN([AM_PATH_WXCONFIG], [
     1058    WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5])
     1059])
     1060AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])
  • src/engine/local_path.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/local_path.cpp
    a b  
    4848
    4949    wxChar* out;
    5050    wxChar* start;
     51    wxStringBuffer* buffer = 0;
    5152    if (*in == '\\')
    5253    {
    5354        // possibly UNC
     
    5960            return false;
    6061        }
    6162
    62         start = m_path.GetWriteBuf(path.Len() + 2);
     63        buffer = new wxStringBuffer(m_path, path.Len() + 2);
     64        start = *buffer;
    6365        out = start;
    6466        *out++ = '\\';
    6567        *out++ = '\\';
     
    7779        {
    7880            // not a valid UNC path
    7981            *start = 0;
    80             m_path.UngetWriteBuf( 0 );
     82            delete buffer;
    8183            return false;
    8284        }
    8385
     
    8789    {
    8890        // Regular path
    8991
    90         start = m_path.GetWriteBuf(path.Len() + 2);
     92        buffer = new wxStringBuffer(m_path, path.Len() + 2);
     93        start = *buffer;
    9194        out = start;
    9295        *out++ = *in++;
    9396
    9497        if (*in++ != ':')
    9598        {
    9699            *start = 0;
    97             m_path.UngetWriteBuf( 0 );
     100            delete buffer;
    98101            return false;
    99102        }
    100103        *out++ = ':';
    101104        if (*in != '/' && *in != '\\' && *in)
    102105        {
    103106            *start = 0;
    104             m_path.UngetWriteBuf( 0 );
     107            delete buffer;
    105108            return false;
    106109        }
    107110        *out++ = path_separator;
     
    120123        return false;
    121124    }
    122125
     126#if wxCHECK_VERSION(2, 9, 0)
     127    wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2);
     128    wxChar* out = *buffer;
     129#else
    123130    wxChar* start = m_path.GetWriteBuf(path.Len() + 2);
    124131    wxChar* out = start;
     132#endif
    125133
    126134    *out++ = '/';
    127135    segments.push_back(out);
     
    210218    }
    211219
    212220    *out = 0;
    213 
     221#if !wxCHECK_VERSION(2, 9, 0)
    214222    m_path.UngetWriteBuf( out - start );
    215 
     223#else
     224    if (buffer != 0) {
     225        delete buffer;
     226    }
     227#endif
    216228    ::Coalesce(m_path);
    217229
    218230    return true;
  • src/engine/logging.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/logging.cpp
    a b  
    5151    }
    5252}
    5353
     54#if wxCHECK_VERSION(2, 9, 0)
     55void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const
     56{
     57        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str());
     58}
     59
     60void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const
     61{
     62        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar());
     63}
     64
     65void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const
     66{
     67        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar(), value3.AsWChar());
     68}
     69
     70void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const
     71{
     72        LogMessage(nMessageType, msgFormat, value1.AsWChar());
     73}
     74
     75void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const
     76{
     77        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar());
     78}
     79
     80void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const
     81{
     82        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar(), value3.AsWChar(), value4.AsWChar());
     83}
     84#endif
     85
    5486void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const
    5587{
    5688    InitLogFile();
  • src/engine/logging_private.h

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/logging_private.h
    a b  
    66public:
    77    CLogging(CFileZillaEnginePrivate *pEngine);
    88    virtual ~CLogging();
     9   
     10#if wxCHECK_VERSION(2, 9, 0)
     11    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const;
     12    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const;
     13    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const;
     14    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const;
     15    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const;
     16    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const;
     17#endif
    918
    1019    void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const;
    1120    void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const;
  • src/engine/misc.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/misc.cpp
    a b  
    365365{
    366366    for (size_t i = 0; i < str.Len(); i++)
    367367    {
     368#if wxCHECK_VERSION(2, 9, 0)
     369        char c;
     370        str.GetChar(i).GetAsChar(&c);
     371        if (c >= 'A' && c <= 'Z')
     372        {
     373            c += 32;
     374            str.SetChar(i, wxUniChar(c));
     375        }
     376#else
    368377        wxChar& c = str[i];
    369378        if (c >= 'A' && c <= 'Z')
    370379            c += 32;
     380#endif
    371381    }
    372382}
    373383
  • src/engine/server.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/server.cpp
    a b  
    1212};
    1313
    1414static const t_protocolInfo protocolInfos[] = {
    15     { FTP,          _T("ftp"),    false, 21,  true,  wxTRANSLATE("FTP - File Transfer Protocol with optional encryption"),                 true  },
     15    { FTP,          _T("ftp"),    false, 21,  true,  _T("FTP - File Transfer Protocol with optional encryption"),                 true  },
    1616    { SFTP,         _T("sftp"),   true,  22,  false, _T("SFTP - SSH File Transfer Protocol"),                              false },
    1717    { HTTP,         _T("http"),   true,  80,  false, _T("HTTP - Hypertext Transfer Protocol"),                             true  },
    18     { HTTPS,        _T("https"),  true, 443,  true,  wxTRANSLATE("HTTPS - HTTP over TLS"),                                 true  },
    19     { FTPS,         _T("ftps"),   true, 990,  true,  wxTRANSLATE("FTPS - FTP over implicit TLS/SSL"),                      true  },
    20     { FTPES,        _T("ftpes"),  true,  21,  true,  wxTRANSLATE("FTPES - FTP over explicit TLS/SSL"),                     true  },
    21     { INSECURE_FTP, _T("ftp"),    false, 21,  true,  wxTRANSLATE("FTP - Insecure File Transfer Protocol"), true  },
     18    { HTTPS,        _T("https"),  true, 443,  true,  _T("HTTPS - HTTP over TLS"),                                 true  },
     19    { FTPS,         _T("ftps"),   true, 990,  true,  _T("FTPS - FTP over implicit TLS/SSL"),                      true  },
     20    { FTPES,        _T("ftpes"),  true,  21,  true,  _T("FTPES - FTP over explicit TLS/SSL"),                     true  },
     21    { INSECURE_FTP, _T("ftp"),    false, 21,  true,  _T("FTP - Insecure File Transfer Protocol"), true  },
    2222    { UNKNOWN,      _T(""),       false, 21,  false, _T("") }
    2323};
    2424
  • src/engine/serverpath.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/serverpath.cpp
    a b  
    276276        len += iter->Length() + 2 + INTLENGTH;
    277277
    278278    wxString safepath;
     279#if wxCHECK_VERSION(2, 9, 0)
     280    wxStringBuffer* buffer = new wxStringBuffer(safepath, len);
     281    wxChar* t = *buffer;
     282#else
    279283    wxChar* start = safepath.GetWriteBuf(len);
    280284    wxChar* t = start;
     285#endif
    281286
    282287    t = fast_sprint_number(t, m_type);
    283288    *(t++) = ' ';
     
    299304        t += iter->size();
    300305    }
    301306    *t = 0;
    302 
     307#if !wxCHECK_VERSION(2, 9, 0)
    303308    safepath.UngetWriteBuf( t - start );
     309#else
     310    delete buffer;
     311#endif
    304312    safepath.Shrink();
    305313
    306314    return safepath;
  • src/engine/socket.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/socket.cpp
    a b  
    12731273    }
    12741274}
    12751275
    1276 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },
     1276#define ERRORDECL(c, desc) { c, _T(#c), _T(desc) },
    12771277
    12781278struct Error_table
    12791279{
  • src/engine/string_coalescer.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/string_coalescer.cpp
    a b  
    6666    {
    6767        // wxString is CoW, yet it doesn't even do this fast pointer
    6868        // comparison in it's less and/or equal operator(s).
     69#if wxCHECK_VERSION(2, 9, 0)
     70        return lhs == rhs;
     71#else
    6972        return lhs.c_str() == rhs.c_str() || lhs == rhs;
     73#endif
    7074    }
    7175};
    7276
  • src/include/libfilezilla.h

    diff -r 0c89638d5302 -r c6f43e47a9eb src/include/libfilezilla.h
    a b  
    2121#include <wx/datetime.h>
    2222#include <wx/event.h>
    2323#include <wx/string.h>
     24#if wxCHECK_VERSION(2, 9, 0)
     25#include <wx/translation.h>
     26#include <wx/dcclient.h>
     27#endif
    2428
    2529#include <list>
    2630#include <vector>
  • src/interface/FileZilla.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/FileZilla.cpp
    a b  
    265265            COptions::Get()->SetOption(OPTION_LANGUAGE, _T(""));
    266266        }
    267267#else
    268         if (!pInfo || !SetLocale(pInfo->Language))
     268        if (pInfo && !pInfo->Description.IsEmpty())
    269269        {
    270             if (pInfo && pInfo->Description)
     270            if (pInfo && !pInfo->Description.IsEmpty())
    271271                wxMessageBox(wxString::Format(_("Failed to set language to %s (%s), using default system language"), pInfo->Description.c_str(), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
    272272            else
    273273                wxMessageBox(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
     
    803803    if (!found)
    804804    {
    805805        wxMessageBox(wxString::Format(_("%s could not be found. Without this component of FileZilla, SFTP will not work.\n\nPossible solutions:\n- Make sure %s is in a directory listed in your PATH environment variable.\n- Set the full path to %s in the FZ_FZSFTP environment variable."), program.c_str(), program.c_str(), program.c_str()),
    806             _("File not found"), wxICON_ERROR);
     806            _("File not found"), wxICON_ERROR | wxOK);
    807807        executable.clear();
    808808    }
    809809#endif
  • src/interface/Mainfrm.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/Mainfrm.cpp
    a b  
    754754            // Do a crude approach: Drop everything unexpected...
    755755            for (unsigned int i = 0; i < version.Len(); i++)
    756756            {
     757#if wxCHECK_VERSION(2, 9, 0)
     758                char c;
     759                version.GetChar(i).GetAsChar(&c);
     760#else
    757761                wxChar& c = version[i];
     762#endif
    758763                if ((version[i] >= '0' && version[i] <= '9') ||
    759764                    (version[i] >= 'a' && version[i] <= 'z') ||
    760765                    (version[i] >= 'A' && version[i] <= 'Z') ||
    761766                    version[i] == '-' || version[i] == '.' ||
    762767                    version[i] == '_')
    763768                {
    764                     url += c;
     769                    url.Append(c);
    765770                }
    766771            }
    767772        }
     
    779784            {
    780785                pStatusBar->Show(show);
    781786                wxSizeEvent evt;
     787#if wxCHECK_VERSION(2, 9, 0)
     788                controls->pLocalListViewPanel->ProcessWindowEvent(evt);
     789#else
    782790                controls->pLocalListViewPanel->ProcessEvent(evt);
     791#endif
    783792            }
    784793        }
    785794        if (controls && controls->pRemoteListViewPanel)
     
    789798            {
    790799                pStatusBar->Show(show);
    791800                wxSizeEvent evt;
     801#if wxCHECK_VERSION(2, 9, 0)
     802                controls->pRemoteListViewPanel->ProcessWindowEvent(evt);
     803#else
    792804                controls->pRemoteListViewPanel->ProcessEvent(evt);
     805#endif
    793806            }
    794807        }
    795808    }
  • src/interface/QueueView.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/QueueView.cpp
    a b  
    34193419    const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0];
    34203420
    34213421    wxString result;
    3422 
     3422#if wxCHECK_VERSION(2, 9, 0)
     3423    wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1);
     3424    wxChar* buf = *buffer;
     3425#else
    34233426    wxChar* start = result.GetWriteBuf(filename.Len() + 1);
    34243427    wxChar* buf = start;
     3428#endif
    34253429
    34263430    const wxChar* p = filename.c_str();
    34273431    while (*p)
     
    34563460        p++;
    34573461    }
    34583462    *buf = 0;
    3459 
     3463#if wxCHECK_VERSION(2, 9, 0)
     3464    delete buffer;
     3465#else
    34603466    result.UngetWriteBuf( buf - start );
    3461 
     3467#endif
    34623468    return result;
    34633469}
    34643470
  • src/interface/RemoteTreeView.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/RemoteTreeView.cpp
    a b  
    350350    SetItemImages(parent, false);
    351351
    352352#ifndef __WXMSW__
    353     m_freezeCount--;
     353    Thaw();
    354354#endif
    355355    if (!modified)
    356356        SafeSelectItem(parent);
  • src/interface/StatusView.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/StatusView.cpp
    a b  
    5858    {
    5959        wxWindow* parent = GetParent();
    6060        event.SetEventObject(parent);
    61         parent->ProcessEvent(event);
     61        parent->GetEventHandler()->ProcessEvent(event);
    6262    }
    6363#else
    6464    void OnKeyDown(wxKeyEvent& event)
     
    7676        navEvent.SetDirection(!event.ShiftDown());
    7777        navEvent.SetFromTab(true);
    7878        navEvent.ResumePropagation(1);
    79         parent->ProcessEvent(navEvent);
     79        parent->GetEventHandler()->ProcessEvent(navEvent);
    8080    }
    8181#endif
    8282};
  • src/interface/aui_notebook_ex.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/aui_notebook_ex.cpp
    a b  
    33#include "aui_notebook_ex.h"
    44#include <wx/dcmirror.h>
    55
     6#if wxCHECK_VERSION(2, 9, 0)
     7wxColor wxAuiStepColour(const wxColor& c, int ialpha)
     8{   
     9    wxColor* result = new wxColor(c);
     10    result->ChangeLightness(ialpha);
     11    return *result;
     12}
     13#else
    614wxColor wxAuiStepColour(const wxColor& c, int ialpha);
     15#endif
    716
    817#ifdef __WXMSW__
    918#define TABCOLOUR wxSYS_COLOUR_3DFACE
     
    184193        }
    185194    }
    186195
    187 #ifdef __WXGTK__
    188     virtual GdkWindow* GetGDKWindow() const { return m_original_dc->GetGDKWindow(); }
    189 #endif
    190196protected:
    191197    int m_gradient_called;
    192198    int m_rectangle_called;
     
    215221    virtual wxAuiTabArt* Clone()
    216222    {
    217223        wxAuiTabArtEx *art = new wxAuiTabArtEx(m_pNotebook, m_bottom, m_data);
     224#if wxCHECK_VERSION(2, 9, 0)
     225        art->SetNormalFont(m_normalFont);
     226        art->SetSelectedFont(m_selectedFont);
     227        art->SetMeasuringFont(m_measuringFont);
     228#else
    218229        art->SetNormalFont(m_normal_font);
    219230        art->SetSelectedFont(m_selected_font);
    220231        art->SetMeasuringFont(m_measuring_font);
     232#endif
    221233        return art;
    222234    }
    223235
     
    257269                         int* x_extent)
    258270    {
    259271#ifndef __WXMAC__
     272#if wxCHECK_VERSION(2, 9, 0)
     273        m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
     274#else
    260275        m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
    261276#endif
     277#endif
    262278        if (!pane.active)
    263279        {
     280#if wxCHECK_VERSION(2, 9, 0)
     281            if (m_baseColour.Red() + m_baseColour.Green() + m_baseColour.Blue() >= 384)
     282                m_baseColour = wxColour( m_baseColour.Red() * 0.95, m_baseColour.Green() * 0.95, m_baseColour.Blue() * 0.95 );
     283#else
    264284            if (m_base_colour.Red() + m_base_colour.Green() + m_base_colour.Blue() >= 384)
    265285                m_base_colour = wxColour( m_base_colour.Red() * 0.95, m_base_colour.Green() * 0.95, m_base_colour.Blue() * 0.95 );
     286#endif
    266287
    267288            dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
    268289            if (m_pNotebook->Highlighted(m_pNotebook->GetPageIndex(pane.window)))
     
    270291                if (!m_fonts_initialized)
    271292                {
    272293                    m_fonts_initialized = true;
     294#if wxCHECK_VERSION(2, 9, 0)
     295                    m_original_normal_font = m_normalFont;
     296                    m_highlighted_font = m_normalFont;
     297#else
    273298                    m_original_normal_font = m_normal_font;
    274299                    m_highlighted_font = m_normal_font;
     300#endif
    275301                    m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD);
    276302                    m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC);
    277303                }
     304#if wxCHECK_VERSION(2, 9, 0)
     305                m_normalFont = m_highlighted_font;
     306#else
    278307                m_normal_font = m_highlighted_font;
     308#endif
    279309            }
    280310            else if (m_fonts_initialized)
     311#if wxCHECK_VERSION(2, 9, 0)
     312                m_normalFont = m_original_normal_font;
     313#else
    281314                m_normal_font = m_original_normal_font;
     315#endif
    282316        }
    283 
     317#if wxCHECK_VERSION(2, 9, 0)
     318        CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tabCtrlHeight % 2) != 0, m_bottom);
     319        wxAuiGenericTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
     320        m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
     321#else
    284322        CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom);
    285323        wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
    286 
    287324        m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
     325#endif
    288326    }
    289327
    290328    virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
    291329    {
     330#if wxCHECK_VERSION(2, 9, 0)
     331        CFilterDC filter_dc(dc, 2, (m_tabCtrlHeight % 2) != 0, m_bottom);
     332        wxAuiGenericTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
     333#else
    292334        CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom);
    293335        wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
     336#endif
    294337    }
    295338protected:
    296339    wxAuiNotebookEx* m_pNotebook;
  • src/interface/commandqueue.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/commandqueue.cpp
    a b  
    289289
    290290    wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS);
    291291    evt.SetId(m_requestId);
    292     m_pMainFrame->GetQueue()->AddPendingEvent(evt);
     292    m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt);
    293293}
    294294
    295295CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId)
  • src/interface/filezilla.h

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/filezilla.h
    a b  
    7171#include <wx/toolbar.h>
    7272#include <wx/treectrl.h>
    7373#include <wx/xrc/xmlres.h>
     74#include <wx/xml/xml.h>
    7475
    7576#endif
  • src/interface/import.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/import.cpp
    a b  
    146146            return _T("");
    147147        int number = (pass[i] - '0') * 100 +
    148148                        (pass[i + 1] - '0') * 10 +
    149                         pass[i + 2] - '0';
     149                        (pass[i + 2] - '0');
    150150        wxChar c = number ^ key[(i / 3 + pos) % strlen(key)];
    151151        output += c;
    152152    }
  • src/interface/listctrlex.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/listctrlex.cpp
    a b  
    7373#ifndef __WXMSW__
    7474wxScrolledWindow* wxListCtrlEx::GetMainWindow() const
    7575{
    76 #ifdef __WXMAC__
     76#if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
    7777    return (wxScrolledWindow*)m_genericImpl->m_mainWin;
    7878#else
    7979    return (wxScrolledWindow*)m_mainWin;
  • src/interface/netconfwizard.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/netconfwizard.cpp
    a b  
    777777            wxString hexIP = ip;
    778778            for (unsigned int i = 0; i < hexIP.Length(); i++)
    779779            {
     780#if wxCHECK_VERSION(2, 9, 0)
     781                char c;
     782                hexIP.GetChar(i).GetAsChar(&c);
     783#else
    780784                wxChar& c = hexIP[i];
     785#endif
    781786                if (c == '.')
    782787                    c = '-';
    783788                else
  • src/interface/queue.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/queue.cpp
    a b  
    13101310    }
    13111311    else
    13121312    {
    1313         if (m_folderScanCount)
     1313        if (m_folderScanCount && m_fileCount > 0)
    13141314            str.Printf(m_title + _T(" (0+)"), m_fileCount);
    13151315        else
    13161316            str = m_title;
     
    14421442void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event)
    14431443{
    14441444    event.SetEventObject(m_pQueue);
     1445#if wxCHECK_VERSION(2, 9, 0)
     1446    m_pQueue->ProcessWindowEvent(event);
     1447#else
    14451448    m_pQueue->ProcessEvent(event);
     1449#endif
    14461450}
    14471451
    14481452void CQueueViewBase::OnChar(wxKeyEvent& event)
  • src/interface/queue_storage.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/queue_storage.cpp
    a b  
    135135    {
    136136        // wxString is CoW, yet it doesn't even do this fast pointer
    137137        // comparison in it's less and/or equal operator(s).
     138#if wxCHECK_VERSION(2, 9, 0)
     139        return (const char*)lhs.c_str() == (const char*)rhs.c_str() || lhs == rhs;
     140#else
    138141        return lhs.c_str() == rhs.c_str() || lhs == rhs;
     142#endif
    139143    }
    140144};
    141145
     
    544548extern "C" {
    545549static void custom_free(void* v)
    546550{
    547 #ifdef __WXMSW__
     551#if defined(__WXMSW__)
     552#if !wxCHECK_VERSION(2, 9, 0)
    548553    wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1;
    549554    data->Unlock();
     555#endif
    550556#else
    551557    char* s = reinterpret_cast<char*>(v);
    552558    delete [] s;
     
    557563bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value)
    558564{
    559565#ifdef __WXMSW__
     566#if wxCHECK_VERSION(2, 9, 0)
     567    char* data = value.char_str();
     568    return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK;
     569#else
    560570    // Increase string reference and pass the data to sqlite with a custom deallocator that
    561571    // reduces the reference once sqlite is done with it.
    562572    wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1;
    563573    data->Lock();
    564574    return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK;
     575#endif
    565576#else
    566577    char* out = new char[value.size() * 2];
    567578    size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size());
     
    814825    int len = sqlite3_column_bytes16(statement, index);
    815826    if (text)
    816827    {
     828#if wxCHECK_VERSION(2, 9, 0)
     829        wxStringBuffer* buffer = new wxStringBuffer(ret, len);
     830        wxChar* out = *buffer;
     831#else
    817832        wxChar* out = ret.GetWriteBuf( len );
     833#endif
    818834        int outlen = utf16_.ToWChar( out, len, text, len );
     835#if wxCHECK_VERSION(2, 9, 0)
     836        delete buffer;
     837#else
    819838        ret.UngetWriteBuf( outlen );
     839#endif
    820840        if (shrink)
    821841            ret.Shrink();
    822842    }
  • src/interface/quickconnectbar.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/quickconnectbar.cpp
    a b  
    222222    if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton))
    223223    {
    224224        event.SetEventObject(this);
    225         GetParent()->ProcessEvent(event);
     225        GetParent()->GetEventHandler()->ProcessEvent(event);
    226226    }
    227227    else if (!event.GetDirection() && event.GetEventObject() == m_pHost)
    228228    {
    229229        event.SetEventObject(this);
    230         GetParent()->ProcessEvent(event);
     230        GetParent()->GetEventHandler()->ProcessEvent(event);
    231231    }
    232232    else
    233233        event.Skip();
  • src/interface/resources/settings.xrc

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/resources/settings.xrc
    a b  
    427427              </object>
    428428              <cols>1</cols>
    429429              <vgap>3</vgap>
    430               <rows>2</rows>
     430              <rows>3</rows>
    431431            </object>
    432432            <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag>
    433433            <border>4</border>
     
    632632              <object class="sizeritem">
    633633                <object class="wxListCtrl" name="ID_KEYS">
    634634                  <style>wxLC_REPORT|wxSUNKEN_BORDER</style>
     635                                    <size>400,-1</size>
    635636                </object>
    636                 <option>1</option>
    637                 <flag>wxGROW</flag>
     637                <flag>wxSHAPED</flag>
    638638              </object>
    639639              <vgap>5</vgap>
    640640              <growablecols>0</growablecols>
     
    13631363          <object class="sizeritem">
    13641364            <object class="wxFlexGridSizer">
    13651365              <cols>2</cols>
    1366               <rows>2</rows>
     1366              <rows>3</rows>
    13671367              <object class="sizeritem">
    13681368                <object class="wxStaticText">
    13691369                  <label>&amp;Theme:</label>
     
    20762076                  </object>
    20772077                  <growablecols>1</growablecols>
    20782078                </object>
    2079                 <flag>wxGROW</flag>
    20802079                <minsize>400,0</minsize>
    20812080              </object>
    20822081              <growablecols>0</growablecols>
  • src/interface/settings/optionspage_dateformatting.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/settings/optionspage_dateformatting.cpp
    a b  
    1616    const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT);
    1717    if (dateFormat == _T("1"))
    1818        SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure);
    19     else if (dateFormat[0] == '2')
     19    else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
    2020    {
    2121        SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure);
    2222        SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure);
     
    2727    const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT);
    2828    if (timeFormat == _T("1"))
    2929        SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure);
    30     else if (timeFormat[0] == '2')
     30    else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
    3131    {
    3232        SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure);
    3333        SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure);
  • src/interface/sitemanager.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/sitemanager.cpp
    a b  
    516516
    517517bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks)
    518518{
     519    if (sitePath.IsEmpty())
     520        return false;
    519521    wxChar c = sitePath[0];
    520522    if (c != '0' && c != '1')
    521523        return false;
  • src/interface/statusbar.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/statusbar.cpp
    a b  
    153153void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/)
    154154{
    155155    // Basically identical to the wx one, but not calling Update
    156     wxString oldText = m_statusStrings[number];
     156    wxString oldText = GetStatusText(number);
    157157    if (oldText != text)
    158158    {
    159         m_statusStrings[number] = text;
     159        wxStatusBar::SetStatusText(text, number);
    160160
    161161        wxRect rect;
    162162        GetFieldRect(number, rect);
  • src/interface/timeformatting.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/timeformatting.cpp
    a b  
    2323
    2424        if (dateFormat == _T("1"))
    2525            m_dateFormat = _T("%Y-%m-%d");
    26         else if (dateFormat[0] == '2')
     26        else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
    2727            m_dateFormat = dateFormat.Mid(1);
    2828        else
    2929            m_dateFormat = _T("%x");
     
    3333
    3434        if (timeFormat == _T("1"))
    3535            m_dateTimeFormat += _T("%H:%M");
    36         else if (timeFormat[0] == '2')
     36        else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
    3737            m_dateTimeFormat += timeFormat.Mid(1);
    3838        else
    3939            m_dateTimeFormat += _T("%X");
  • src/interface/viewheader.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/viewheader.cpp
    a b  
    2424{
    2525public:
    2626    CComboBoxEx(CViewHeader* parent)
    27         : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER | wxCB_SORT)
     27        : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER
     28#if !defined(__WXMAC__) || !wxCHECK_VERSION(2, 9, 0)
     29            | wxCB_SORT
     30#endif
     31    )
    2832    {
    2933        m_parent = parent;
    3034    }
     
    6771        navEvent.SetDirection(!event.ShiftDown());
    6872        navEvent.SetFromTab(true);
    6973        navEvent.ResumePropagation(1);
    70         m_parent->ProcessEvent(navEvent);
     74        m_parent->GetEventHandler()->ProcessEvent(navEvent);
    7175    }
    7276
    7377    void OnChar(wxKeyEvent& event)
  • src/interface/wrapengine.cpp

    diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/wrapengine.cpp
    a b  
    234234    bool containsURL = false;
    235235    for (int i = 0; i <= strLen; i++)
    236236    {
    237         if ((text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
    238             (text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
     237        if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
     238            (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
    239239        {
    240240            url = true;
    241241            containsURL = true;
    242242        }
    243         if (text[i] != ' ' && text[i] != 0)
     243        if (i < strLen && text[i] != ' ')
    244244        {
    245245            // If url, wrap on slashes and ampersands, but not first slash of something://
    246246            if (!url ||
    247                  ((text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))
     247                 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?'))
    248248            continue;
    249249        }
    250250
    251251        wxString segment;
    252252        if (wrapAfter == -1)
    253253        {
    254             if (text[i] == '/' || text[i] == '?' || text[i] == '&')
     254            if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
    255255                segment = text.Mid(start, i - start + 1);
    256256            else
    257257                segment = text.Mid(start, i - start);
     
    259259        }
    260260        else
    261261        {
    262             if (text[i] == '/' || text[i] == '?' || text[i] == '&')
     262            if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
    263263                segment = text.Mid(wrapAfter + 1, i - wrapAfter);
    264264            else
    265265                segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1);
     
    274274            if (wrappedText != _T(""))
    275275                wrappedText += _T("\n");
    276276            wrappedText += text.Mid(start, wrapAfter - start);
    277             if (text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
     277            if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
    278278                wrappedText += text[wrapAfter];
    279279
    280280            if (width + spaceWidth >= (int)maxLength)
     
    304304            if (wrappedText != _T(""))
    305305                wrappedText += _T("\n");
    306306            wrappedText += text.Mid(start, i - start);
    307             if (text[i] != ' ' && text[i] != '\0')
     307            if (i < strLen && text[i] != ' ' && text[i] != '\0')
    308308                wrappedText += text[i];
    309309            start = i + 1;
    310310            wrapAfter = -1;
     
    318318            wrapAfter = i;
    319319        }
    320320
    321         if (text[i] == ' ')
     321        if (i < strLen && text[i] == ' ')
    322322            url = false;
    323323    }
    324324    if (start < strLen)