From e359d16417b6240cd78499fd5f695fc60034ca63 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Wed, 24 Oct 2018 00:16:45 +0200 Subject: [PATCH 01/33] Some code formatting --- m4/libtool.m4 | 2522 ++++++++++++++++----------- m4/ltoptions.m4 | 127 +- m4/ltsugar.m4 | 7 +- m4/ltversion.m4 | 12 +- m4/lt~obsolete.m4 | 7 +- src/fapplication.cpp | 2 +- src/flistview.cpp | 4 +- src/fterm.cpp | 3 +- src/ftermdetection.cpp | 5 +- src/ftextview.cpp | 4 +- src/fwidget.cpp | 4 +- src/fwindow.cpp | 4 +- src/include/final/fbuttongroup.h | 2 +- src/include/final/fcheckbox.h | 2 +- src/include/final/fcheckmenuitem.h | 2 +- src/include/final/fcolorpalette.h | 2 +- src/include/final/fconfig.h | 3 +- src/include/final/fdialoglistmenu.h | 2 +- src/include/final/fkeyboard.h | 2 +- src/include/final/flabel.h | 2 +- src/include/final/flineedit.h | 2 +- src/include/final/flistbox.h | 3 +- src/include/final/flistview.h | 13 +- src/include/final/fmenu.h | 2 +- src/include/final/fmenuitem.h | 2 +- src/include/final/fmenulist.h | 2 +- src/include/final/foptiattr.h | 2 +- src/include/final/fradiobutton.h | 4 +- src/include/final/fradiomenuitem.h | 4 +- src/include/final/fscrollbar.h | 4 +- src/include/final/fscrollview.h | 4 +- src/include/final/fstring.h | 24 +- src/include/final/fswitch.h | 2 +- src/include/final/ftermbuffer.h | 2 +- src/include/final/ftermdata.h | 3 +- src/include/final/ftextview.h | 4 +- src/include/final/ftogglebutton.h | 2 +- src/include/final/ftypes.h | 6 +- src/include/final/fvterm.h | 13 +- src/include/final/fwidget.h | 10 +- src/include/final/fwindow.h | 190 +- 41 files changed, 1746 insertions(+), 1270 deletions(-) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index d7c043f4..ee80844b 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,8 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,36 +8,30 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# This file is part of GNU Libtool. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -67,7 +59,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -91,7 +83,7 @@ dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -111,26 +103,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,15 +186,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -198,7 +208,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -209,14 +219,14 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -269,14 +279,14 @@ no_glob_subst='s/\*/\\\*/g' # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN @@ -286,7 +296,7 @@ ltmain="$ac_aux_dir/ltmain.sh" # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' +# in macros and then make a single call at the end using the 'libtool' # label. @@ -421,8 +431,8 @@ m4_define([_lt_decl_all_varnames], # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) @@ -446,7 +456,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl +available_tags='_LT_TAGS'dnl ]) @@ -474,7 +484,7 @@ m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], @@ -500,8 +510,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], @@ -547,7 +557,7 @@ for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -560,7 +570,7 @@ for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -576,7 +586,7 @@ _LT_OUTPUT_LIBTOOL_INIT # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this +# '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). @@ -598,7 +608,7 @@ AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl +test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -621,7 +631,7 @@ exec AS_MESSAGE_LOG_FD>>config.log } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, +'$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -643,7 +653,7 @@ Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test $[#] != 0 +while test 0 != $[#] do case $[1] in --version | --v* | -V ) @@ -656,10 +666,10 @@ do lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; esac shift done @@ -685,7 +695,7 @@ chmod +x "$CONFIG_LT" # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: -test "$silent" = yes && +test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -705,32 +715,46 @@ m4_defun([_LT_CONFIG], _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -739,7 +763,7 @@ _LT_EOF # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -756,8 +780,6 @@ _LT_EOF sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -775,7 +797,6 @@ _LT_EOF [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -974,7 +995,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -992,7 +1013,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1010,7 +1031,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1032,7 +1053,7 @@ _LT_EOF _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1042,32 +1063,32 @@ _LT_EOF ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1087,29 +1108,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1129,7 +1150,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then +if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1147,7 +1168,7 @@ else _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1167,8 +1188,8 @@ m4_define([_LT_SHELL_INIT], # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1196,10 +1217,10 @@ fi # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case "$ECHO" in +case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1225,16 +1246,17 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1244,14 +1266,14 @@ case ${with_sysroot} in #( no|'') ;; #( *) - AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) +[dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1259,31 +1281,33 @@ m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1312,9 +1336,46 @@ ia64-*-hpux*) rm -rf conftest* ;; +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1333,10 +1394,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ;; esac ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1355,10 +1416,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1376,19 +1437,20 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1396,7 +1458,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1405,7 +1467,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -1421,7 +1483,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK @@ -1440,11 +1502,11 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -1452,7 +1514,7 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], ]) ]) -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1483,7 +1545,7 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1519,7 +1581,7 @@ AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1546,7 +1608,7 @@ AC_CACHE_CHECK([$1], [$2], $RM conftest* ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1568,7 +1630,7 @@ AC_DEFUN([_LT_LINKER_OPTION], m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -1587,10 +1649,10 @@ AC_CACHE_CHECK([$1], [$2], fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1611,7 +1673,7 @@ AC_DEFUN([LT_CMD_MAX_LEN], AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -1651,7 +1713,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1702,22 +1764,22 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1733,7 +1795,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; esac ]) -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1761,7 +1823,7 @@ m4_defun([_LT_HEADER_DLFCN], # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : +if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1808,9 +1870,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1836,7 +1898,7 @@ int main () return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in @@ -1857,7 +1919,7 @@ rm -fr conftest* # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then +if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1867,44 +1929,52 @@ else case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], + [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], + [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) @@ -1913,21 +1983,21 @@ else ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1937,7 +2007,7 @@ else lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1947,9 +2017,9 @@ else ]) fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -2041,8 +2111,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS], m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2052,8 +2122,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else @@ -2080,8 +2150,8 @@ objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2093,15 +2163,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH], _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2115,12 +2185,12 @@ else fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2144,7 +2214,7 @@ else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2162,6 +2232,47 @@ _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics @@ -2172,17 +2283,18 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -2198,28 +2310,35 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -2233,7 +2352,7 @@ BEGIN {RS=" "; FS="/|\n";} { # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2242,7 +2361,7 @@ fi]) library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2259,14 +2378,17 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) @@ -2274,41 +2396,91 @@ aix[[4-9]]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -2318,18 +2490,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2337,8 +2509,8 @@ beos*) bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -2350,7 +2522,7 @@ bsdi[[45]]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -2359,8 +2531,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -2376,17 +2548,17 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -2395,8 +2567,8 @@ m4_if([$1], [],[ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -2423,7 +2595,7 @@ m4_if([$1], [],[ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -2436,8 +2608,8 @@ m4_if([$1], [],[ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -2450,7 +2622,7 @@ m4_if([$1], [],[ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2463,8 +2635,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -2477,8 +2649,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2496,12 +2668,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -2531,10 +2704,10 @@ haiku*) need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2552,14 +2725,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -2567,8 +2741,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -2577,8 +2751,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -2591,8 +2765,8 @@ interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2603,7 +2777,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2611,8 +2785,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -2631,8 +2805,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -2641,13 +2815,33 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2672,7 +2866,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -2704,12 +2903,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2719,7 +2918,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -2728,58 +2927,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -2790,8 +2999,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2801,11 +3010,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -2813,8 +3022,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -2835,24 +3044,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2870,7 +3079,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2878,8 +3087,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2888,20 +3097,30 @@ uts4*) ;; esac AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -2934,39 +3153,41 @@ _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program which can recognize shared library +# find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -2989,11 +3210,11 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3011,7 +3232,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- -# find a file program which can recognize a shared library +# find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3038,16 +3259,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], + [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -3061,7 +3282,7 @@ if test "$GCC" = yes; then while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -3072,37 +3293,37 @@ if test "$GCC" = yes; then with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3188,13 +3446,13 @@ lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) @@ -3221,8 +3479,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3318,8 +3575,8 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3372,6 +3629,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -3412,33 +3672,38 @@ AC_DEFUN([LT_PATH_NM], AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3449,21 +3714,21 @@ else esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -3471,8 +3736,8 @@ else esac fi AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -3518,8 +3783,8 @@ lt_cv_sharedlib_from_linklib_cmd, case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3531,7 +3796,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) @@ -3558,13 +3823,28 @@ AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + # LT_LIB_M # -------- # check for math library @@ -3576,11 +3856,11 @@ case $host in # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM="-lm") + AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) @@ -3599,7 +3879,7 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3651,7 +3931,7 @@ cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; @@ -3684,14 +3964,44 @@ case `$NM -V 2>&1` in symcode='[[ABCDGIRSTW]]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3709,21 +4019,24 @@ for ac_symprfx in "" "_"; do # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3763,11 +4076,11 @@ _LT_EOF if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3793,7 +4106,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3813,9 +4126,9 @@ _LT_EOF mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3836,7 +4149,7 @@ _LT_EOF rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -3863,12 +4176,16 @@ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3884,17 +4201,18 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -3905,8 +4223,8 @@ m4_if([$1], [CXX], [ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -3922,6 +4240,11 @@ m4_if([$1], [CXX], [ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -3971,7 +4294,7 @@ m4_if([$1], [CXX], [ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4012,14 +4335,14 @@ m4_if([$1], [CXX], [ case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4056,7 +4379,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' @@ -4201,17 +4524,18 @@ m4_if([$1], [CXX], [ fi ], [ - if test "$GCC" = yes; then + if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4222,8 +4546,8 @@ m4_if([$1], [CXX], [ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4240,6 +4564,11 @@ m4_if([$1], [CXX], [ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4310,7 +4639,7 @@ m4_if([$1], [CXX], [ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4318,11 +4647,30 @@ m4_if([$1], [CXX], [ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -4338,7 +4686,7 @@ m4_if([$1], [CXX], [ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4349,7 +4697,7 @@ m4_if([$1], [CXX], [ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4374,6 +4722,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4471,7 +4825,7 @@ m4_if([$1], [CXX], [ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4500,7 +4854,7 @@ m4_if([$1], [CXX], [ fi ]) case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4566,17 +4920,21 @@ m4_if([$1], [CXX], [ case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4625,9 +4983,9 @@ m4_if([$1], [CXX], [ # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -4643,7 +5001,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -4651,7 +5009,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) @@ -4664,7 +5022,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4686,24 +5044,24 @@ dnl Note also adjust exclude_expsyms for C++ above. esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4716,7 +5074,7 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4735,7 +5093,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4751,7 +5109,7 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4761,7 +5119,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4769,61 +5127,89 @@ _LT_EOF _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4834,42 +5220,47 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4883,8 +5274,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4902,8 +5293,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4915,7 +5306,7 @@ _LT_EOF _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -4930,9 +5321,9 @@ _LT_EOF # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4949,15 +5340,15 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -4973,7 +5364,7 @@ _LT_EOF # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -4981,34 +5372,57 @@ _LT_EOF ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -5027,13 +5441,21 @@ _LT_EOF _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5052,62 +5474,80 @@ _LT_EOF ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -5116,7 +5556,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5146,16 +5586,17 @@ _LT_EOF # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5164,18 +5605,18 @@ _LT_EOF # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -5184,7 +5625,7 @@ _LT_EOF # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -5234,33 +5675,33 @@ _LT_EOF ;; hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5268,25 +5709,25 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5294,14 +5735,14 @@ _LT_EOF # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5312,7 +5753,7 @@ _LT_EOF *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -5323,16 +5764,16 @@ _LT_EOF ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], @@ -5345,21 +5786,32 @@ _LT_EOF end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -5374,7 +5826,7 @@ _LT_EOF newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5382,27 +5834,19 @@ _LT_EOF *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5413,33 +5857,53 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5450,24 +5914,24 @@ _LT_EOF solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5477,11 +5941,11 @@ _LT_EOF solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5491,10 +5955,10 @@ _LT_EOF ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -5543,43 +6007,43 @@ _LT_EOF ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -5594,17 +6058,17 @@ _LT_EOF ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5621,7 +6085,7 @@ x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5701,12 +6165,12 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the + "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -5747,10 +6211,10 @@ dnl [Compiler flag to generate thread safe objects]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" +lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5790,18 +6254,18 @@ if test -n "$compiler"; then LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report which library types will actually be built + # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5809,8 +6273,12 @@ if test -n "$compiler"; then ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -5818,13 +6286,13 @@ if test -n "$compiler"; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC="$lt_save_CC" +CC=$lt_save_CC ])# _LT_LANG_C_CONFIG @@ -5832,14 +6300,14 @@ CC="$lt_save_CC" # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5881,7 +6349,7 @@ _LT_TAGVAR(objext, $1)=$objext # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then +if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -5923,35 +6391,35 @@ if test "$_lt_caught_CXX_error" != yes; then if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test "$GXX" = yes; then + if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='${wl}' + wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -5987,18 +6455,30 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -6008,6 +6488,13 @@ if test "$_lt_caught_CXX_error" != yes; then ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -6026,13 +6513,21 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GXX" = yes; then + if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6050,64 +6545,84 @@ if test "$_lt_caught_CXX_error" != yes; then fi esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -6117,7 +6632,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6145,57 +6660,58 @@ if test "$_lt_caught_CXX_error" != yes; then # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6206,6 +6722,34 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_DARWIN_LINKER_FEATURES($1) ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -6241,14 +6785,14 @@ if test "$_lt_caught_CXX_error" != yes; then ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default @@ -6260,7 +6804,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6269,11 +6813,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6283,15 +6827,15 @@ if test "$_lt_caught_CXX_error" != yes; then ;; hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi @@ -6317,13 +6861,13 @@ if test "$_lt_caught_CXX_error" != yes; then aCC*) case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -6334,20 +6878,20 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6362,22 +6906,22 @@ if test "$_lt_caught_CXX_error" != yes; then interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6386,17 +6930,17 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; @@ -6409,8 +6953,8 @@ if test "$_lt_caught_CXX_error" != yes; then # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6419,10 +6963,10 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -6436,59 +6980,59 @@ if test "$_lt_caught_CXX_error" != yes; then # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6502,18 +7046,18 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6521,10 +7065,10 @@ if test "$_lt_caught_CXX_error" != yes; then *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on @@ -6582,22 +7126,17 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6613,9 +7152,9 @@ if test "$_lt_caught_CXX_error" != yes; then # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6633,17 +7172,17 @@ if test "$_lt_caught_CXX_error" != yes; then cxx*) case $host in osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac @@ -6658,21 +7197,21 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6718,9 +7257,9 @@ if test "$_lt_caught_CXX_error" != yes; then # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6728,7 +7267,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; @@ -6745,30 +7284,30 @@ if test "$_lt_caught_CXX_error" != yes; then ;; gcx*) # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require `-G' NOT `-shared' on this + # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6776,11 +7315,11 @@ if test "$_lt_caught_CXX_error" != yes; then output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi @@ -6789,52 +7328,52 @@ if test "$_lt_caught_CXX_error" != yes; then ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" + '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -6865,10 +7404,10 @@ if test "$_lt_caught_CXX_error" != yes; then esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6895,7 +7434,7 @@ if test "$_lt_caught_CXX_error" != yes; then lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes +fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -6917,13 +7456,14 @@ AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -7007,13 +7547,13 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test $p = "-L" || - test $p = "-R"; then + if test x-L = "$p" || + test x-R = "$p"; then prev=$p continue fi @@ -7029,16 +7569,16 @@ if AC_TRY_EVAL(ac_compile); then case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in + if test no = "$pre_test_object_deps_done"; then + case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being @@ -7046,9 +7586,9 @@ if AC_TRY_EVAL(ac_compile); then esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" + _LT_TAGVAR(postdeps, $1)=$prev$p else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= @@ -7063,15 +7603,15 @@ if AC_TRY_EVAL(ac_compile); then continue fi - if test "$pre_test_object_deps_done" = no; then + if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" + _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" + _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7102,51 +7642,6 @@ interix[[3-9]]*) _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac ]) @@ -7155,7 +7650,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) @@ -7175,10 +7670,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then +if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi @@ -7215,7 +7710,7 @@ _LT_TAGVAR(objext, $1)=$objext # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then +if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7237,7 +7732,7 @@ if test "$_lt_disable_F77" != yes; then _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7251,21 +7746,25 @@ if test "$_lt_disable_F77" != yes; then AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7273,11 +7772,11 @@ if test "$_lt_disable_F77" != yes; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7294,9 +7793,9 @@ if test "$_lt_disable_F77" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7306,11 +7805,11 @@ AC_LANG_POP # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) -if test -z "$FC" || test "X$FC" = "Xno"; then +if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi @@ -7347,7 +7846,7 @@ _LT_TAGVAR(objext, $1)=$objext # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then +if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7369,7 +7868,7 @@ if test "$_lt_disable_FC" != yes; then _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7385,21 +7884,25 @@ if test "$_lt_disable_FC" != yes; then AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7407,11 +7910,11 @@ if test "$_lt_disable_FC" != yes; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7431,7 +7934,7 @@ if test "$_lt_disable_FC" != yes; then GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes +fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7441,7 +7944,7 @@ AC_LANG_POP # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7475,7 +7978,7 @@ CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7512,7 +8015,7 @@ CFLAGS=$lt_save_CFLAGS # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7546,7 +8049,7 @@ CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7583,7 +8086,7 @@ CFLAGS=$lt_save_CFLAGS # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7599,7 +8102,7 @@ _LT_TAGVAR(objext, $1)=$objext lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -7609,7 +8112,7 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7638,7 +8141,7 @@ AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7749,7 +8252,7 @@ lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue + test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7766,9 +8269,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break + test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then + if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7792,27 +8295,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], []) # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7836,102 +8319,9 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- -# Determine which file name conversion functions should be used by +# Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 5d9acd8e..94b08297 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl + [m4_warning([Unknown $1 option '$2'])])[]dnl ]) @@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) +put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL], _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) +put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared], *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -226,14 +228,14 @@ AC_ARG_ENABLE([static], *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install], *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) +the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) +the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], @@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC], *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) +put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 index 9000a057..48bc9344 100644 --- a/m4/ltsugar.m4 +++ b/m4/ltsugar.m4 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ m4_define([_lt_join], # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index 07a8602d..fa04b52a 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index c573da90..c6b26f88 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 2a1e04f5..a6cd382a 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -63,7 +63,7 @@ FApplication::eventQueue* FApplication::event_queue = 0; FApplication::FApplication ( const int& _argc , char* _argv[] , bool disable_alt_screen ) - : FWidget(processParameters(_argc,_argv), disable_alt_screen) + : FWidget(processParameters(_argc, _argv), disable_alt_screen) , app_argc(_argc) , app_argv(_argv) , key_timeout(100000) // 100 ms diff --git a/src/flistview.cpp b/src/flistview.cpp index 7eb67cfb..d6a48897 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -693,7 +693,9 @@ fc::sorting_type FListView::getColumnSortType (int column) const } //---------------------------------------------------------------------- -void FListView::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust) +void FListView::setGeometry ( int x, int y + , std::size_t w, std::size_t h + , bool adjust ) { // Set the widget geometry diff --git a/src/fterm.cpp b/src/fterm.cpp index 246efefc..9dab87cc 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -471,7 +471,7 @@ void FTerm::detectTermSize() if ( ret != 0 || win_size.ws_col == 0 || win_size.ws_row == 0 ) { char* str; - term_geometry.setPos(1,1); + term_geometry.setPos (1, 1); // Use COLUMNS or fallback to the xterm default width of 80 characters str = std::getenv("COLUMNS"); term_geometry.setWidth(str ? std::size_t(std::atoi(str)) : 80); @@ -1681,7 +1681,6 @@ inline void FTerm::allocationValues() //---------------------------------------------------------------------- inline void FTerm::deallocationValues() { - #if defined(__NetBSD__) || defined(__OpenBSD__) if ( openbsd ) delete openbsd; diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp index 139efe94..55925af3 100644 --- a/src/ftermdetection.cpp +++ b/src/ftermdetection.cpp @@ -453,8 +453,9 @@ char* FTermDetection::termtype_256color_quirks() if ( color_env.string3 && std::strlen(color_env.string3) > 0 ) decscusr_support = true; - if ( (color_env.string1 && std::strncmp(color_env.string1, "gnome-terminal", 14) == 0) - || color_env.string2 ) + if ( color_env.string2 + || (color_env.string1 + && std::strncmp(color_env.string1, "gnome-terminal", 14) == 0) ) { terminal_type.gnome_terminal = true; // Each gnome-terminal should be able to use 256 colors diff --git a/src/ftextview.cpp b/src/ftextview.cpp index a4b46b57..b5e56473 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -93,7 +93,9 @@ const FString FTextView::getText() const } //---------------------------------------------------------------------- -void FTextView::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust) +void FTextView::setGeometry ( int x, int y + , std::size_t w, std::size_t h + , bool adjust ) { // Set the text view geometry diff --git a/src/fwidget.cpp b/src/fwidget.cpp index a0d3acdb..22a2bf64 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -604,7 +604,9 @@ void FWidget::setTermSize (std::size_t w, std::size_t h) } //---------------------------------------------------------------------- -void FWidget::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust) +void FWidget::setGeometry ( int x, int y + , std::size_t w, std::size_t h + , bool adjust ) { // Sets the geometry of the widget relative to its parent diff --git a/src/fwindow.cpp b/src/fwindow.cpp index e3a8e539..6238b6c8 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -408,7 +408,9 @@ void FWindow::setSize (std::size_t w, std::size_t h, bool adjust) } //---------------------------------------------------------------------- -void FWindow::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust) +void FWindow::setGeometry ( int x, int y + , std::size_t w, std::size_t h + , bool adjust ) { // Sets the geometry of the widget diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index 09017270..69672a80 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -73,7 +73,7 @@ class FButtonGroup : public FScrollView public: // Constructors explicit FButtonGroup (FWidget* = 0); - FButtonGroup (const FString&, FWidget* = 0); + explicit FButtonGroup (const FString&, FWidget* = 0); // Destructor virtual ~FButtonGroup(); diff --git a/src/include/final/fcheckbox.h b/src/include/final/fcheckbox.h index bc56cce2..85b4732a 100644 --- a/src/include/final/fcheckbox.h +++ b/src/include/final/fcheckbox.h @@ -74,7 +74,7 @@ class FCheckBox : public FToggleButton public: // Constructors explicit FCheckBox (FWidget* = 0); - FCheckBox (const FString&, FWidget* = 0); + explicit FCheckBox (const FString&, FWidget* = 0); // Destructor virtual ~FCheckBox(); diff --git a/src/include/final/fcheckmenuitem.h b/src/include/final/fcheckmenuitem.h index 6a53326b..9c54328b 100644 --- a/src/include/final/fcheckmenuitem.h +++ b/src/include/final/fcheckmenuitem.h @@ -74,7 +74,7 @@ class FCheckMenuItem : public FMenuItem public: // Constructors explicit FCheckMenuItem (FWidget* = 0); - FCheckMenuItem (const FString&, FWidget* = 0); + explicit FCheckMenuItem (const FString&, FWidget* = 0); // Destructor virtual ~FCheckMenuItem(); diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index 9701d662..4b2119a3 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -51,7 +51,7 @@ class FColorPalette { public: // Constructor - explicit FColorPalette(); + FColorPalette(); // Destructor virtual ~FColorPalette(); diff --git a/src/include/final/fconfig.h b/src/include/final/fconfig.h index deb57ce4..5e7043de 100644 --- a/src/include/final/fconfig.h +++ b/src/include/final/fconfig.h @@ -161,8 +161,7 @@ #define F_HAVE_VSNPRINTF 1 #endif -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #ifndef F_LT_OBJDIR #define F_LT_OBJDIR ".libs/" #endif diff --git a/src/include/final/fdialoglistmenu.h b/src/include/final/fdialoglistmenu.h index 61f465b4..82761924 100644 --- a/src/include/final/fdialoglistmenu.h +++ b/src/include/final/fdialoglistmenu.h @@ -80,7 +80,7 @@ class FDialogListMenu : public FMenu public: // Constructors explicit FDialogListMenu (FWidget* = 0); - FDialogListMenu (const FString&, FWidget* = 0); + explicit FDialogListMenu (const FString&, FWidget* = 0); // Destructor virtual ~FDialogListMenu(); diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 92c5f7ea..c4c69b50 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -60,7 +60,7 @@ class FKeyboardCommand { public: // Constructor - FKeyboardCommand (FApplication* = 0, void(FApplication::*)() = 0); + explicit FKeyboardCommand (FApplication* = 0, void(FApplication::*)() = 0); // Method void execute(); diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index e09379b8..b5bafeee 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -74,7 +74,7 @@ class FLabel : public FWidget // Constructor explicit FLabel (FWidget* = 0); - FLabel (const FString&, FWidget* = 0); + explicit FLabel (const FString&, FWidget* = 0); // Destructor virtual ~FLabel(); diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index e5cdb51e..ef71e174 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -77,7 +77,7 @@ class FLineEdit : public FWidget // Constructor explicit FLineEdit (FWidget* = 0); - FLineEdit (const FString&, FWidget* = 0); + explicit FLineEdit (const FString&, FWidget* = 0); // Destructor virtual ~FLineEdit(); diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index 37db0f41..9ffb9627 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -526,7 +526,8 @@ void FListBox::insert (Container container, LazyConverter convert) } //---------------------------------------------------------------------- -inline FListBox::listBoxItems::iterator FListBox::index2iterator (std::size_t index) +inline FListBox::listBoxItems::iterator \ + FListBox::index2iterator (std::size_t index) { listBoxItems::iterator iter = itemlist.begin(); std::advance (iter, index); diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 57a81ecb..e145b5f1 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -52,6 +52,7 @@ #error "Only can be included directly." #endif +#include #include #include @@ -179,7 +180,7 @@ class FListViewIterator typedef std::stack FObjectIteratorStack; // Constructor - explicit FListViewIterator (); + FListViewIterator (); FListViewIterator (FObjectIterator); // Overloaded operators @@ -269,11 +270,13 @@ class FListView : public FWidget FListViewItem* getCurrentItem(); // Mutators - virtual void setGeometry (int, int, std::size_t, std::size_t, bool = true); + virtual void setGeometry ( int, int + , std::size_t, std::size_t + , bool = true ); void setColumnAlignment (int, fc::text_alignment); void setColumnText (int, const FString&); - void setColumnSortType (int,fc::sorting_type \ - = fc::by_name); + void setColumnSortType (int, fc::sorting_type \ + = fc::by_name); void setColumnSort (int, fc::sorting_order \ = fc::ascending); template @@ -432,7 +435,7 @@ class FListView : public FWidget struct FListView::Header { public: - explicit Header() + Header() : name() , width (0) , fixed_width (false) diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 32d540af..d9c16509 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -79,7 +79,7 @@ class FMenu : public FWindow, public FMenuList public: // Constructor explicit FMenu (FWidget* = 0); - FMenu (const FString&, FWidget* = 0); + explicit FMenu (const FString&, FWidget* = 0); // Destructor virtual ~FMenu(); diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 7f5a891d..a6db4356 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -83,7 +83,7 @@ class FMenuItem : public FWidget // Constructor explicit FMenuItem (FWidget* = 0); - FMenuItem (const FString&, FWidget* = 0); + explicit FMenuItem (const FString&, FWidget* = 0); FMenuItem (int, const FString&, FWidget* = 0); // Destructor diff --git a/src/include/final/fmenulist.h b/src/include/final/fmenulist.h index 20a99b22..95cd2da8 100644 --- a/src/include/final/fmenulist.h +++ b/src/include/final/fmenulist.h @@ -62,7 +62,7 @@ class FMenuList { public: // Constructor - explicit FMenuList(); + FMenuList(); // Destructor virtual ~FMenuList(); diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 4524d5b9..8c08ad95 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -156,7 +156,7 @@ class FOptiAttr } termEnv; // Constructor - explicit FOptiAttr(); + FOptiAttr(); // Destructor virtual ~FOptiAttr(); diff --git a/src/include/final/fradiobutton.h b/src/include/final/fradiobutton.h index 68f56796..208d62fd 100644 --- a/src/include/final/fradiobutton.h +++ b/src/include/final/fradiobutton.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2017 Markus Gans * +* Copyright 2014-2018 Markus Gans * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -74,7 +74,7 @@ class FRadioButton : public FToggleButton public: // Constructors explicit FRadioButton (FWidget* = 0); - FRadioButton (const FString&, FWidget* = 0); + explicit FRadioButton (const FString&, FWidget* = 0); // Destructor virtual ~FRadioButton(); diff --git a/src/include/final/fradiomenuitem.h b/src/include/final/fradiomenuitem.h index 002835ce..32a5f5f0 100644 --- a/src/include/final/fradiomenuitem.h +++ b/src/include/final/fradiomenuitem.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 Markus Gans * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -74,7 +74,7 @@ class FRadioMenuItem : public FMenuItem public: // Constructors explicit FRadioMenuItem (FWidget* = 0); - FRadioMenuItem (const FString&, FWidget* = 0); + explicit FRadioMenuItem (const FString&, FWidget* = 0); // Destructor virtual ~FRadioMenuItem(); diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index c97741ee..6e500614 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -84,8 +84,8 @@ class FScrollbar : public FWidget }; // Constructors - explicit FScrollbar(FWidget* = 0); - FScrollbar (int = fc::vertical, FWidget* = 0); + explicit FScrollbar (FWidget* = 0); + explicit FScrollbar (int = fc::vertical, FWidget* = 0); // Destructor virtual ~FScrollbar(); diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index b9dd1ef5..62a8eb4c 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -100,7 +100,9 @@ class FScrollView : public FWidget virtual void setWidth (std::size_t, bool = true); virtual void setHeight (std::size_t, bool = true); virtual void setSize (std::size_t, std::size_t, bool = true); - virtual void setGeometry (int, int, std::size_t, std::size_t, bool = true); + virtual void setGeometry ( int, int + , std::size_t, std::size_t + , bool = true ); void setCursorPos (int, int); void setPrintPos (int, int); bool setViewportPrint (bool); diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index 9fd56227..5371fd0b 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -141,22 +141,22 @@ class FString bool operator < (const FString&) const; template - bool operator < (CharT&) const; + bool operator < (const CharT&) const; bool operator <= (const FString&) const; template - bool operator <= (CharT&) const; + bool operator <= (const CharT&) const; bool operator == (const FString&) const; template - bool operator == (CharT&) const; + bool operator == (const CharT&) const; bool operator != (const FString&) const; template - bool operator != (CharT&) const; + bool operator != (const CharT&) const; bool operator >= (const FString&) const; template - bool operator >= (CharT&) const; + bool operator >= (const CharT&) const; bool operator > (const FString&) const; template - bool operator > (CharT&) const; + bool operator > (const CharT&) const; operator const char* () const { return c_str(); } @@ -309,7 +309,7 @@ inline const wchar_t& FString::operator [] (IndexT pos) const //---------------------------------------------------------------------- template -inline bool FString::operator < (CharT& s) const +inline bool FString::operator < (const CharT& s) const { const FString tmp(s); return *this < tmp; @@ -317,7 +317,7 @@ inline bool FString::operator < (CharT& s) const //---------------------------------------------------------------------- template -inline bool FString::operator <= (CharT& s) const +inline bool FString::operator <= (const CharT& s) const { const FString tmp(s); return *this <= tmp; @@ -325,7 +325,7 @@ inline bool FString::operator <= (CharT& s) const //---------------------------------------------------------------------- template -inline bool FString::operator == (CharT& s) const +inline bool FString::operator == (const CharT& s) const { const FString tmp(s); return *this == tmp; @@ -333,7 +333,7 @@ inline bool FString::operator == (CharT& s) const //---------------------------------------------------------------------- template -inline bool FString::operator != (CharT& s) const +inline bool FString::operator != (const CharT& s) const { const FString tmp(s); return *this != tmp; @@ -341,7 +341,7 @@ inline bool FString::operator != (CharT& s) const //---------------------------------------------------------------------- template -inline bool FString::operator >= (CharT& s) const +inline bool FString::operator >= (const CharT& s) const { const FString tmp(s); return *this >= tmp; @@ -349,7 +349,7 @@ inline bool FString::operator >= (CharT& s) const //---------------------------------------------------------------------- template -inline bool FString::operator > (CharT& s) const +inline bool FString::operator > (const CharT& s) const { const FString tmp(s); return *this > tmp; diff --git a/src/include/final/fswitch.h b/src/include/final/fswitch.h index 4ea2e264..70d60a93 100644 --- a/src/include/final/fswitch.h +++ b/src/include/final/fswitch.h @@ -74,7 +74,7 @@ class FSwitch : public FToggleButton public: // Constructors explicit FSwitch (FWidget* = 0); - FSwitch (const FString&, FWidget* = 0); + explicit FSwitch (const FString&, FWidget* = 0); // Destructor virtual ~FSwitch(); diff --git a/src/include/final/ftermbuffer.h b/src/include/final/ftermbuffer.h index c2dd5618..43497159 100644 --- a/src/include/final/ftermbuffer.h +++ b/src/include/final/ftermbuffer.h @@ -59,7 +59,7 @@ class FTermBuffer typedef FOptiAttr::charData charData; // Constructor - explicit FTermBuffer(); + FTermBuffer(); // Destructor virtual ~FTermBuffer(); diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index 47ef2bf6..1efa370c 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -36,6 +36,7 @@ #endif #include +#include #include "final/fc.h" #include "final/frect.h" @@ -56,7 +57,7 @@ class FTermData { public: // Typedefs - typedef std::map encodingMap; + typedef std::map encodingMap; // Constructors FTermData(); diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index 72d28878..16b9cd1e 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -90,7 +90,9 @@ class FTextView : public FWidget const FStringList& getLines() const; // Mutators - virtual void setGeometry (int, int, std::size_t, std::size_t, bool = true); + virtual void setGeometry ( int, int + , std::size_t, std::size_t + , bool = true ); void setText (const FString&); void scrollToX (int); void scrollToY (int); diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index dbfea09a..ea934d06 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -75,7 +75,7 @@ class FToggleButton : public FWidget // Constructors explicit FToggleButton (FWidget* = 0); - FToggleButton (const FString&, FWidget* = 0); + explicit FToggleButton (const FString&, FWidget* = 0); // Destructor virtual ~FToggleButton(); diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index 01901437..dfec1be0 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -30,6 +30,8 @@ #include #include +#include + #define null NULL namespace @@ -52,7 +54,7 @@ typedef int64_t sInt64; typedef long double lDouble; -} // namespace +} // namespace namespace finalcut @@ -87,7 +89,7 @@ keyname; } // namespace fc -} // namespace finalcut +} // namespace finalcut #endif // FTYPES_H diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index a60612e3..5daec515 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -52,7 +52,10 @@ #include "final/fconfig.h" // includes _GNU_SOURCE for wcwidth() #endif +#include #include // std::stringstream +#include +#include #include "final/fterm.h" @@ -285,8 +288,11 @@ class FVTerm : public FTerm static void restoreVTerm (const FRect&); static void restoreVTerm (int, int, int, int); static void setTextToDefault (term_area*, int, int); - static bool reallocateTextArea (term_area*, std::size_t, std::size_t); - static bool reallocateTextArea (term_area*, std::size_t); + static bool reallocateTextArea ( term_area* + , std::size_t + , std::size_t ); + static bool reallocateTextArea ( term_area* + , std::size_t ); static covered_state isCovered ( const FPoint& , term_area* ); @@ -514,7 +520,8 @@ inline FVTerm& FVTerm::operator << (const type& s) } //---------------------------------------------------------------------- -inline FVTerm& FVTerm::operator << (const std::vector& termString) +inline FVTerm& FVTerm::operator << \ + (const std::vector& termString) { print (termString); return *this; diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 2dab5d76..03caf45e 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -236,7 +236,9 @@ class FWidget : public FVTerm, public FObject void setTermOffsetWithPadding(); void setTermSize (std::size_t, std::size_t); virtual void setGeometry (const FRect&, bool = true); - virtual void setGeometry (int, int, std::size_t, std::size_t, bool = true); + virtual void setGeometry ( int, int + , std::size_t, std::size_t + , bool = true ); virtual void setShadowSize (int, int); void setMinimumWidth (std::size_t); void setMinimumHeight (std::size_t); @@ -813,7 +815,8 @@ inline void FWidget::setMinimumHeight (std::size_t min_height) { size_hints.setMinimum (size_hints.min_width, min_height); } //---------------------------------------------------------------------- -inline void FWidget::setMinimumSize (std::size_t min_width, std::size_t min_height) +inline void FWidget::setMinimumSize ( std::size_t min_width + , std::size_t min_height ) { size_hints.setMinimum (min_width, min_height); } //---------------------------------------------------------------------- @@ -825,7 +828,8 @@ inline void FWidget::setMaximumHeight (std::size_t max_height) { size_hints.setMaximum (size_hints.max_width, max_height); } //---------------------------------------------------------------------- -inline void FWidget::setMaximumSize (std::size_t max_width, std::size_t max_height) +inline void FWidget::setMaximumSize ( std::size_t max_width + , std::size_t max_height ) { size_hints.setMaximum (max_width, max_height); } //---------------------------------------------------------------------- diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 2aa649b0..d82a836a 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -74,113 +74,115 @@ namespace finalcut class FWindow : public FWidget { - public: - // Using-declaration - using FWidget::drawBorder; - using FWidget::setPos; - using FWidget::setGeometry; - using FWidget::move; + public: + // Using-declaration + using FWidget::drawBorder; + using FWidget::setPos; + using FWidget::setGeometry; + using FWidget::move; - // Constructor - explicit FWindow (FWidget* = 0); + // Constructor + explicit FWindow (FWidget* = 0); - // Destructor - virtual ~FWindow (); + // Destructor + virtual ~FWindow (); - // Accessors - const char* getClassName() const; - static FWindow* getWindowWidget (const FWidget*); - static int getWindowLayer (const FWidget*); - FWidget* getWindowFocusWidget() const; + // Accessors + const char* getClassName() const; + static FWindow* getWindowWidget (const FWidget*); + static int getWindowLayer (const FWidget*); + FWidget* getWindowFocusWidget() const; - // Mutators - bool setWindowWidget (bool); - bool setWindowWidget(); - bool unsetWindowWidget(); - static void setActiveWindow (FWindow*); - void setWindowFocusWidget (const FWidget*); - bool activateWindow (bool); - bool activateWindow(); - void unsetActiveWindow(); - bool deactivateWindow(); - virtual bool setResizeable (bool); - virtual bool setResizeable(); - bool unsetResizeable(); - bool setTransparentShadow (bool); - bool setTransparentShadow(); - bool unsetTransparentShadow(); - bool setShadow (bool); - bool setShadow(); - bool unsetShadow(); - bool setAlwaysOnTop (bool); - bool setAlwaysOnTop(); - bool unsetAlwaysOnTop(); + // Mutators + bool setWindowWidget (bool); + bool setWindowWidget(); + bool unsetWindowWidget(); + static void setActiveWindow (FWindow*); + void setWindowFocusWidget (const FWidget*); + bool activateWindow (bool); + bool activateWindow(); + void unsetActiveWindow(); + bool deactivateWindow(); + virtual bool setResizeable (bool); + virtual bool setResizeable(); + bool unsetResizeable(); + bool setTransparentShadow (bool); + bool setTransparentShadow(); + bool unsetTransparentShadow(); + bool setShadow (bool); + bool setShadow(); + bool unsetShadow(); + bool setAlwaysOnTop (bool); + bool setAlwaysOnTop(); + bool unsetAlwaysOnTop(); - // Inquiries - bool isZoomed() const; - bool isWindowActive() const; - bool isWindowHidden() const; - bool isResizeable() const; - bool isAlwaysOnTop() const; - bool hasTransparentShadow() const; - bool hasShadow() const; + // Inquiries + bool isZoomed() const; + bool isWindowActive() const; + bool isWindowHidden() const; + bool isResizeable() const; + bool isAlwaysOnTop() const; + bool hasTransparentShadow() const; + bool hasShadow() const; - // Methods - virtual void drawBorder(); - virtual void show(); - virtual void hide(); - virtual void setX (int, bool = true); - virtual void setY (int, bool = true); - virtual void setPos (int, int, bool = true); - virtual void setWidth (std::size_t, bool = true); - virtual void setHeight (std::size_t, bool = true); - virtual void setSize (std::size_t, std::size_t, bool = true); - void setGeometry (int, int, std::size_t, std::size_t, bool = true); - virtual void move (int, int); - static FWindow* getWindowWidgetAt (const FPoint&); - static FWindow* getWindowWidgetAt (int, int); - static void addWindow (FWidget*); - static void delWindow (FWidget*); - static void swapWindow (FWidget*, FWidget*); - static bool raiseWindow (FWidget*); - bool raiseWindow (); - static bool lowerWindow (FWidget*); - bool lowerWindow (); - bool zoomWindow (); - static void switchToPrevWindow(); - static bool activatePrevWindow(); - virtual void setShadowSize (int, int); + // Methods + virtual void drawBorder(); + virtual void show(); + virtual void hide(); + virtual void setX (int, bool = true); + virtual void setY (int, bool = true); + virtual void setPos (int, int, bool = true); + virtual void setWidth (std::size_t, bool = true); + virtual void setHeight (std::size_t, bool = true); + virtual void setSize (std::size_t, std::size_t, bool = true); + void setGeometry ( int, int + , std::size_t, std::size_t + , bool = true ); + virtual void move (int, int); + static FWindow* getWindowWidgetAt (const FPoint&); + static FWindow* getWindowWidgetAt (int, int); + static void addWindow (FWidget*); + static void delWindow (FWidget*); + static void swapWindow (FWidget*, FWidget*); + static bool raiseWindow (FWidget*); + bool raiseWindow (); + static bool lowerWindow (FWidget*); + bool lowerWindow (); + bool zoomWindow (); + static void switchToPrevWindow(); + static bool activatePrevWindow(); + virtual void setShadowSize (int, int); - protected: - // Method - virtual void adjustSize(); + protected: + // Method + virtual void adjustSize(); - // Event handlers - virtual bool event (FEvent*); - virtual void onWindowActive (FEvent*); - virtual void onWindowInactive (FEvent*); - virtual void onWindowRaised (FEvent*); - virtual void onWindowLowered (FEvent*); + // Event handlers + virtual bool event (FEvent*); + virtual void onWindowActive (FEvent*); + virtual void onWindowInactive (FEvent*); + virtual void onWindowRaised (FEvent*); + virtual void onWindowLowered (FEvent*); - // Data Members - static FWindow* previous_window; + // Data Members + static FWindow* previous_window; - private: - // Disable copy constructor - FWindow (const FWindow&); + private: + // Disable copy constructor + FWindow (const FWindow&); - // Disable assignment operator (=) - FWindow& operator = (const FWindow&); + // Disable assignment operator (=) + FWindow& operator = (const FWindow&); - // Methods - static void deleteFromAlwaysOnTopList (FWidget*); - static void processAlwaysOnTop(); + // Methods + static void deleteFromAlwaysOnTopList (FWidget*); + static void processAlwaysOnTop(); - // Data Members - bool window_active; - bool zoomed; - FWidget* win_focus_widget; - FRect normalGeometry; + // Data Members + bool window_active; + bool zoomed; + FWidget* win_focus_widget; + FRect normalGeometry; }; #pragma pack(pop) From c4e333bc8b84d72a5bd5cb9ae07694405baa71a7 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Wed, 24 Oct 2018 08:51:38 +0200 Subject: [PATCH 02/33] Fix the build on CentOS 6 --- examples/opti-move.cpp | 2 +- src/fvterm.cpp | 2 +- test/ftermdetection-test.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index 810932a0..208c317c 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -75,7 +75,7 @@ void term_boundaries (int& x, int& y) if ( y < 0 ) y = 0; - if ( x >= term_width ) + if ( x >= term_width && term_width > 0 ) { y += x / term_width; x %= term_width; diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 565f7c1a..387737e7 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -113,7 +113,7 @@ void FVTerm::setTermXY (int x, int y) term_width = int(getColumnNumber()); term_height = int(getLineNumber()); - if ( x >= term_width ) + if ( x >= term_width && term_width > 0 ) { y += x / term_width; x %= term_width; diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 9d5187b7..b5edec56 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -28,10 +28,11 @@ #include #include -#include #include #include +#include + #define CPPUNIT_ASSERT_CSTRING(expected, actual) \ check_c_string (expected, actual, CPPUNIT_SOURCELINE()) From 96edb762c748102c2b20159868b4a6a3792af18b Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Fri, 26 Oct 2018 07:43:23 +0200 Subject: [PATCH 03/33] Building Fix for a negative value check for gcc < 4.8 --- ChangeLog | 3 +++ README.md | 2 +- build.sh | 2 +- debian/watch | 2 +- examples/Makefile.gcc | 2 +- finalcut.spec.in | 4 ++-- src/Makefile.clang | 2 +- src/fstring.cpp | 2 +- src/include/final/fstring.h | 15 ++++++++------- src/include/final/ftypes.h | 25 +++++++++++++++++++++++++ test/Makefile.clang | 2 +- test/Makefile.gcc | 2 +- 12 files changed, 46 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 646e374b..3ef8115a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2018-10-26 Markus Gans + * Building Fix for a negative value check (gcc < 4.8) + 2018-10-21 Markus Gans * Moving static attributes from FApplication to FWidget diff --git a/README.md b/README.md index f2e74145..d340f9ca 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ Class digramm License ------- -GNU Lesser General Public License Version 3 +GNU Lesser General Public License Version 3 Please send bug reports to -------------------------- diff --git a/build.sh b/build.sh index da7b8863..229e1bbe 100755 --- a/build.sh +++ b/build.sh @@ -20,7 +20,7 @@ if [ "$CPU_COUNT" -eq 0 ] then if command -v nproc >/dev/null 2>&1 then - CPU_COUNT="$(nproc 2>/dev/null)" || CPU_COUNT="0" + CPU_COUNT="$(nproc 2>/dev/null)" || CPU_COUNT="0" fi fi diff --git a/debian/watch b/debian/watch index 88ef7b52..f53c4bc0 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,2 @@ version=3 -opts=passive https://github.com/gansm/finalcut/archive/([\d.]+)\.tar.gz +opts=passive https://github.com/gansm/finalcut/archive/([\d.]+)\.tar.gz diff --git a/examples/Makefile.gcc b/examples/Makefile.gcc index ab5225fa..2b2bd5b9 100644 --- a/examples/Makefile.gcc +++ b/examples/Makefile.gcc @@ -34,7 +34,7 @@ debug: profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" -.PHONY: clean +.PHONY: clean clean: $(RM) $(SRCS:%.cpp=%) *.gcno *.gcda *~ diff --git a/finalcut.spec.in b/finalcut.spec.in index 6a31b675..9bd96885 100644 --- a/finalcut.spec.in +++ b/finalcut.spec.in @@ -11,7 +11,7 @@ Name: @PACKAGE@ Version: @VERSION@ Release: %{buildno} License: LGPL-3.0 -Summary: The Final Cut +Summary: The Final Cut Url: https://github.com/gansm/finalcut/ Group: System/Libraries Source: finalcut-%{version}.tar.gz @@ -111,7 +111,7 @@ make %{?_smp_mflags} V=1 make install libdir=${RPM_BUILD_ROOT}%{_libdir}/ \ includedir=${RPM_BUILD_ROOT}%{_includedir} \ bindir=${RPM_BUILD_ROOT}%{_bindir} \ - docdir=${RPM_BUILD_ROOT}/%{_docdir}/finalcut/ + docdir=${RPM_BUILD_ROOT}/%{_docdir}/finalcut/ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libfinal.la %post -n %{libsoname} -p /sbin/ldconfig diff --git a/src/Makefile.clang b/src/Makefile.clang index 4ee741bf..bf25e0e2 100644 --- a/src/Makefile.clang +++ b/src/Makefile.clang @@ -140,7 +140,7 @@ endif .cpp.o: $(CXX) -c $(CCXFLAGS) $(INCLUDES) -fpic -o $@ $< -all: dep $(OBJS) +all: dep $(OBJS) $(CXX) $(CCXFLAGS) $(INCLUDES) $(LDFLAGS) -shared -Wl,-soname,$(LIB).$(MAJOR) -o $(LIB).$(VERSION) $(OBJS) ln -s -f $(LIB).$(VERSION) libfinal.so.$(MAJOR) ln -s -f $(LIB).$(MAJOR) libfinal.so diff --git a/src/fstring.cpp b/src/fstring.cpp index bfff3f9d..e0118090 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -1192,7 +1192,7 @@ bool FString::operator > (const FString& s) const //---------------------------------------------------------------------- const FString& FString::insert (const FString& s, int pos) { - if ( pos < 0 || uInt(pos) > length ) + if ( isNegative(pos) || uInt(pos) > length ) throw std::out_of_range(""); _insert (uInt(pos), s.length, s.string); diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index 5371fd0b..f8aaac09 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -134,9 +135,9 @@ class FString const FString& operator >> (float&); template - wchar_t& operator [] (IndexT); + wchar_t& operator [] (const IndexT); template - const wchar_t& operator [] (IndexT) const; + const wchar_t& operator [] (const IndexT) const; const FString& operator () (); bool operator < (const FString&) const; @@ -289,9 +290,9 @@ inline const char* FString::getClassName() //---------------------------------------------------------------------- template -inline wchar_t& FString::operator [] (IndexT pos) +inline wchar_t& FString::operator [] (const IndexT pos) { - if ( pos < 0 || pos >= IndexT(length) ) + if ( isNegative(pos) || pos >= IndexT(length) ) throw std::out_of_range(""); // Invalid index position return string[std::size_t(pos)]; @@ -299,9 +300,9 @@ inline wchar_t& FString::operator [] (IndexT pos) //---------------------------------------------------------------------- template -inline const wchar_t& FString::operator [] (IndexT pos) const +inline const wchar_t& FString::operator [] (const IndexT pos) const { - if ( pos < 0 || pos >= IndexT(length) ) + if ( isNegative(pos) || pos >= IndexT(length) ) throw std::out_of_range(""); // Invalid index position return string[std::size_t(pos)]; @@ -378,7 +379,7 @@ inline FString::iterator FString::end() const //---------------------------------------------------------------------- inline wchar_t FString::front() const { - assert( ! isEmpty() ); + assert ( ! isEmpty() ); return string[0]; } diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index dfec1be0..12d7d880 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -30,6 +30,7 @@ #include #include +#include #include #define null NULL @@ -60,6 +61,30 @@ typedef long double lDouble; namespace finalcut { +template +struct is_negative +{ + inline bool operator () (const T& x) + { + return x < 0; + } +}; + +template +struct is_negative +{ + inline bool operator () (const T&) + { + return false; + } +}; + +template +inline bool isNegative (const T& x) +{ + return is_negative::is_signed>()(x); +} + namespace fc { #pragma pack(push) diff --git a/test/Makefile.clang b/test/Makefile.clang index f5a3d725..5eef4ebc 100644 --- a/test/Makefile.clang +++ b/test/Makefile.clang @@ -33,7 +33,7 @@ debug: check: test test: debug - $(OBJS) | sed -e "s/ OK/\x1b[32m OK\x1b[0m/g" -e "s/ failed/\x1b[31m failed\x1b[0m/g" + $(OBJS) | sed -e "s/ OK/\x1b[32m OK\x1b[0m/g" -e "s/ failed/\x1b[31m failed\x1b[0m/g" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" diff --git a/test/Makefile.gcc b/test/Makefile.gcc index b7730b9b..9b502e44 100644 --- a/test/Makefile.gcc +++ b/test/Makefile.gcc @@ -33,7 +33,7 @@ debug: check: test test: debug - $(OBJS) | sed -e "s/ OK/\x1b[32m OK\x1b[0m/g" -e "s/ failed/\x1b[31m failed\x1b[0m/g" + $(OBJS) | sed -e "s/ OK/\x1b[32m OK\x1b[0m/g" -e "s/ failed/\x1b[31m failed\x1b[0m/g" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" From 98bff1e45b505d9c753758c076adbf1d9ce7ca88 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 27 Oct 2018 00:13:31 +0200 Subject: [PATCH 04/33] Adding the capacity() method to the FString class --- ChangeLog | 1 + src/fstring.cpp | 10 +++++----- src/include/final/fstring.h | 5 +++++ test/fstring-test.cpp | 32 +++++++++++++++++++++++++++++++- 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ef8115a..f5c3eb3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2018-10-26 Markus Gans * Building Fix for a negative value check (gcc < 4.8) + * Adding the capacity() method to the FString class 2018-10-21 Markus Gans * Moving static attributes from FApplication to FWidget diff --git a/src/fstring.cpp b/src/fstring.cpp index e0118090..b9c8cbea 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -1474,7 +1474,7 @@ inline void FString::_assign (const wchar_t s[]) uInt new_length = uInt(std::wcslen(s)); - if ( ! string || new_length > bufsize - 1 ) + if ( ! string || new_length > capacity() ) { if ( string ) delete[](string); @@ -1493,8 +1493,8 @@ inline void FString::_assign (const wchar_t s[]) } std::wcsncpy (string, s, bufsize); - string[bufsize - 1] = L'\0'; length = new_length; + string[capacity()] = L'\0'; } //---------------------------------------------------------------------- @@ -1520,7 +1520,7 @@ inline void FString::_insert (std::size_t len, const wchar_t s[]) } std::wcsncpy (string, s, bufsize); - string[bufsize - 1] = L'\0'; + string[capacity()] = L'\0'; } //---------------------------------------------------------------------- @@ -1539,7 +1539,7 @@ inline void FString::_insert ( std::size_t pos { std::size_t x; - if ( (length + len + 1) <= bufsize ) + if ( length + len <= capacity() ) { // output string <= bufsize for (x = length; x + 1 > pos; x--) // shifting right side + '\0' @@ -1587,7 +1587,7 @@ inline void FString::_insert ( std::size_t pos //---------------------------------------------------------------------- inline void FString::_remove (std::size_t pos, std::size_t len) { - if ( (bufsize - length - 1 + len) <= FWDBUFFER ) + if ( capacity() - length + len <= FWDBUFFER ) { // shifting left side to pos for (std::size_t i = pos; i + len < length + 1; i++) diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index f8aaac09..8d3d9286 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -187,6 +187,7 @@ class FString // Methods std::size_t getLength() const; std::size_t getUTF8length() const; + std::size_t capacity() const; iterator begin() const; iterator end() const; @@ -368,6 +369,10 @@ inline bool FString::isEmpty() const inline std::size_t FString::getLength() const { return length; } +//---------------------------------------------------------------------- +inline std::size_t FString::capacity() const +{ return ( length > 0 ) ? bufsize - 1 : 0; } + //---------------------------------------------------------------------- inline FString::iterator FString::begin() const { return string; } diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index 451d61e9..11e46b01 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -162,6 +162,7 @@ void FStringTest::noArgumentTest() CPPUNIT_ASSERT ( empty.isNull() ); CPPUNIT_ASSERT ( empty.isEmpty() ); CPPUNIT_ASSERT ( empty.getLength() == 0 ); + CPPUNIT_ASSERT ( empty.capacity() == 0 ); CPPUNIT_ASSERT ( empty.getUTF8length() == 0 ); CPPUNIT_ASSERT ( empty.wc_str() == 0 ); CPPUNIT_ASSERT ( empty.c_str() == 0 ); @@ -177,6 +178,7 @@ void FStringTest::noArgumentTest() CPPUNIT_ASSERT ( wcstr == 0 ); std::string str = empty.toString(); CPPUNIT_ASSERT ( str.length() == 0 ); + CPPUNIT_ASSERT ( str.capacity() == 15 ); CPPUNIT_ASSERT ( str.size() == 0 ); CPPUNIT_ASSERT ( str.empty() ); const finalcut::FString fstr = str; @@ -217,6 +219,7 @@ void FStringTest::initLengthTest() { const finalcut::FString s1(0); CPPUNIT_ASSERT ( s1.getLength() == 0 ); + CPPUNIT_ASSERT ( s1.capacity() == 0 ); CPPUNIT_ASSERT ( s1.isNull() ); CPPUNIT_ASSERT ( s1.isEmpty() ); @@ -224,26 +227,31 @@ void FStringTest::initLengthTest() const std::size_t x2 = 10; const finalcut::FString s2(x1); CPPUNIT_ASSERT ( s2.getLength() == 10 ); + CPPUNIT_ASSERT ( s2.capacity() == 25 ); CPPUNIT_ASSERT ( ! s2.isNull() ); CPPUNIT_ASSERT ( s2.isEmpty() ); const finalcut::FString s3(x2); CPPUNIT_ASSERT ( s3.getLength() == 10 ); + CPPUNIT_ASSERT ( s3.capacity() == 25 ); CPPUNIT_ASSERT ( ! s3.isNull() ); CPPUNIT_ASSERT ( s3.isEmpty() ); const finalcut::FString s4(0, L'-'); CPPUNIT_ASSERT ( s4.getLength() == 0 ); + CPPUNIT_ASSERT ( s4.capacity() == 0 ); CPPUNIT_ASSERT ( s4.isNull() ); CPPUNIT_ASSERT ( s4.isEmpty() ); const finalcut::FString s5(0, '-'); CPPUNIT_ASSERT ( s5.getLength() == 0 ); + CPPUNIT_ASSERT ( s5.capacity() == 0 ); CPPUNIT_ASSERT ( s5.isNull() ); CPPUNIT_ASSERT ( s5.isEmpty() ); const finalcut::FString s6(0, char(0)); CPPUNIT_ASSERT ( s6.getLength() == 0 ); + CPPUNIT_ASSERT ( s6.capacity() == 0 ); CPPUNIT_ASSERT ( s6.isNull() ); CPPUNIT_ASSERT ( s6.isEmpty() ); @@ -254,21 +262,25 @@ void FStringTest::initLengthTest() const finalcut::FString s8(x2, '-'); CPPUNIT_ASSERT ( s8.getLength() == 10 ); + CPPUNIT_ASSERT ( s8.capacity() == 25 ); CPPUNIT_ASSERT ( ! s8.isNull() ); CPPUNIT_ASSERT ( ! s8.isEmpty() ); const finalcut::FString s9(x1, L'-'); CPPUNIT_ASSERT ( s9.getLength() == 10 ); + CPPUNIT_ASSERT ( s9.capacity() == 25 ); CPPUNIT_ASSERT ( ! s9.isNull() ); CPPUNIT_ASSERT ( ! s9.isEmpty() ); const finalcut::FString s10(x2, L'-'); CPPUNIT_ASSERT ( s10.getLength() == 10 ); + CPPUNIT_ASSERT ( s10.capacity() == 25 ); CPPUNIT_ASSERT ( ! s10.isNull() ); CPPUNIT_ASSERT ( ! s10.isEmpty() ); const finalcut::FString s11(x2, wchar_t(0)); CPPUNIT_ASSERT ( s11.getLength() == 10 ); + CPPUNIT_ASSERT ( s11.capacity() == 25 ); CPPUNIT_ASSERT ( ! s11.isNull() ); CPPUNIT_ASSERT ( s11.isEmpty() ); } @@ -280,6 +292,7 @@ void FStringTest::copyConstructorTest() const finalcut::FString s2(s1); CPPUNIT_ASSERT ( s2 == L"abc" ); CPPUNIT_ASSERT ( s2.getLength() == 3 ); + CPPUNIT_ASSERT ( s2.capacity() == 18 ); } //---------------------------------------------------------------------- @@ -326,42 +339,49 @@ void FStringTest::assignmentTest() CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"abc" ); CPPUNIT_ASSERT ( s1.getLength() == 3 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); const std::wstring s3(L"def"); s1 = s3; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"def" ); CPPUNIT_ASSERT ( s1.getLength() == 3 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); const std::string s4("ghi"); s1 = s4; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"ghi" ); CPPUNIT_ASSERT ( s1.getLength() == 3 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); const wchar_t s5[] = L"abc"; s1 = s5; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"abc" ); CPPUNIT_ASSERT ( s1.getLength() == 3 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); const char s6[] = "def"; s1 = s6; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"def" ); CPPUNIT_ASSERT ( s1.getLength() == 3 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); const wchar_t s7 = L'#'; s1 = s7; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"#" ); CPPUNIT_ASSERT ( s1.getLength() == 1 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); const char s8 = '%'; s1 = s8; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"%" ); CPPUNIT_ASSERT ( s1.getLength() == 1 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); s1.setString("A character string"); CPPUNIT_ASSERT ( s1 ); @@ -537,6 +557,7 @@ void FStringTest::equalTest() CPPUNIT_ASSERT ( one_char == ch ); CPPUNIT_ASSERT ( ch == one_char.c_str()[0] ); CPPUNIT_ASSERT ( one_char.getLength() == 1 ); + CPPUNIT_ASSERT ( one_char.capacity() == 16 ); const wchar_t wch = L'a'; CPPUNIT_ASSERT ( one_char == wch ); @@ -550,6 +571,7 @@ void FStringTest::equalTest() CPPUNIT_ASSERT ( str == cstr ); CPPUNIT_ASSERT ( str.getLength() == 3 ); CPPUNIT_ASSERT ( str.getUTF8length() == 3 ); + CPPUNIT_ASSERT ( str.capacity() == 18 ); CPPUNIT_ASSERT ( strncmp(cstr, str.c_str(), 3) == 0 ); const wchar_t wcstr[] = L"abc"; @@ -570,6 +592,7 @@ void FStringTest::equalTest() CPPUNIT_ASSERT ( s->c_str()[0] == 'c'); CPPUNIT_ASSERT ( s->getLength() == 1 ); + CPPUNIT_ASSERT ( s->capacity() == 16 ); } //---------------------------------------------------------------------- @@ -580,6 +603,7 @@ void FStringTest::notEqualTest() CPPUNIT_ASSERT ( one_char != ch ); CPPUNIT_ASSERT ( ch != one_char.c_str()[0] ); CPPUNIT_ASSERT ( one_char.getLength() == 1 ); + CPPUNIT_ASSERT ( one_char.capacity() == 16 ); const wchar_t wch = L'_'; CPPUNIT_ASSERT ( one_char != wch ); @@ -597,6 +621,8 @@ void FStringTest::notEqualTest() CPPUNIT_ASSERT ( strlen(s2.c_str()) == 6 ); CPPUNIT_ASSERT ( s1.getUTF8length() == 3 ); CPPUNIT_ASSERT ( s2.getUTF8length() == 3 ); + CPPUNIT_ASSERT ( s1.capacity() == 18 ); + CPPUNIT_ASSERT ( s2.capacity() == 18 ); CPPUNIT_ASSERT ( strncmp(cstr, s1.c_str(), 3) != 0 ); const wchar_t wcstr[] = L"abc"; @@ -1236,21 +1262,25 @@ void FStringTest::trimTest() CPPUNIT_ASSERT ( trim_str2.rtrim().isEmpty() ); CPPUNIT_ASSERT ( ! trim_str2.rtrim().isNull() ); CPPUNIT_ASSERT ( trim_str2.rtrim().getLength() == 0 ); - + CPPUNIT_ASSERT ( trim_str2.rtrim().capacity() == 0 ); CPPUNIT_ASSERT ( trim_str2.ltrim().isEmpty() ); CPPUNIT_ASSERT ( ! trim_str2.ltrim().isNull() ); CPPUNIT_ASSERT ( trim_str2.ltrim().getLength() == 0 ); + CPPUNIT_ASSERT ( trim_str2.ltrim().capacity() == 0 ); const finalcut::FString trim_str3; CPPUNIT_ASSERT ( trim_str3.ltrim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.ltrim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.ltrim().getLength() == 0 ); + CPPUNIT_ASSERT ( trim_str3.ltrim().capacity() == 0 ); CPPUNIT_ASSERT ( trim_str3.rtrim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.rtrim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.rtrim().getLength() == 0 ); + CPPUNIT_ASSERT ( trim_str3.rtrim().capacity() == 0 ); CPPUNIT_ASSERT ( trim_str3.trim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.trim().isNull() ); CPPUNIT_ASSERT ( trim_str3.trim().getLength() == 0 ); + CPPUNIT_ASSERT ( trim_str3.trim().capacity() == 0 ); } //---------------------------------------------------------------------- From 5d134793cf79a4df077b6350c87bcb9dc527e2b2 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 00:45:45 +0100 Subject: [PATCH 05/33] FTerm is now a data member of FVTerm --- .travis.yml | 1 + ChangeLog | 3 + README.md | 192 ++++----- doc/class-diagram.txt | 192 ++++----- examples/opti-move.cpp | 6 +- examples/term-attributes.cpp | 2 +- examples/termcap.cpp | 16 +- examples/ui.cpp | 14 +- src/fapplication.cpp | 32 +- src/fdialog.cpp | 2 +- src/fmenu.cpp | 4 +- src/fmenubar.cpp | 2 +- src/fterm.cpp | 11 + src/ftooltip.cpp | 2 +- src/fvterm.cpp | 47 ++- src/fwidget.cpp | 8 +- src/fwindow.cpp | 8 +- src/include/final/fapplication.h | 4 +- src/include/final/flabel.h | 4 +- src/include/final/fterm.h | 52 +-- src/include/final/fvterm.h | 667 +++++++++++++++++++++---------- src/include/final/fwindow.h | 2 +- 22 files changed, 764 insertions(+), 507 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3eebb1c2..f99cfd50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,6 +62,7 @@ matrix: - ./configure --prefix=/usr CPPFLAGS="-DDEBUG" CXXFLAGS="-g -O0 -DDEBUG" --with-unit-test - make V=1 -j10 - make check + - cat test/*.log # # Coveralls diff --git a/ChangeLog b/ChangeLog index f5c3eb3d..0fcca97d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2018-10-29 Markus Gans + * FTerm is now a data member of FVTerm + 2018-10-26 Markus Gans * Building Fix for a negative value check (gcc < 4.8) * Adding the capacity() method to the FString class diff --git a/README.md b/README.md index d340f9ca..35c47772 100644 --- a/README.md +++ b/README.md @@ -145,102 +145,102 @@ Class digramm 1┌──────────────┐ ┌-----------┤ FTermFreeBSD │ : └──────────────┘ - : 1┌──────────────┐ ┌───────────┐ - ┌-----------┤ FTermOpenBSD │ ┌────┤ FKeyEvent │ - : └──────────────┘ │ └───────────┘ - : 1┌────────────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermDetection │ ├────┤ FMouseEvent │ - : └────────────────┘ │ └─────────────┘ - : 1┌────────────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermcapQuirks │ ├────┤ FWheelEvent │ - : └────────────────┘ │ └─────────────┘ - : 1┌────────────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermXTerminal │ ├────┤ FFocusEvent │ - : └────────────────┘ │ └─────────────┘ - : 1┌──────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermcap │ ┌────────┐ ├────┤ FAccelEvent │ - : └──────────┘ │ FEvent │◄─┤ └─────────────┘ - : 1┌──────────┐ └───┬────┘ │ ┌──────────────┐ - ┌-----------┤ FTermios │ :1 ├────┤ FResizeEvent │ - : └──────────┘ : │ └──────────────┘ - : 1┌───────────────┐ : │ ┌────────────┐ - ┌-----------┤ FColorPalette │ : ├────┤ FShowEvent │ - : └───────────────┘ : │ └────────────┘ - : 1┌───────────┐ : │ ┌────────────┐ - ┌-----------┤ FOptiMove │ : ├────┤ FHideEvent │ - : └───────────┘ : │ └────────────┘ - : 1┌───────────┐ : │ ┌─────────────┐ - ┌-----------┤ FOptiAttr │ : ├────┤ FCloseEvent │ - : └───────────┘ : │ └─────────────┘ - : 1┌───────────┐ : │ ┌─────────────┐ - ┌-----------┤ FKeyboard │ : └────┤ FTimerEvent │ - : └───────────┘ : └─────────────┘ - : 1┌───────────────┐ : - ┌-----------┤ FMouseControl │ : ┌──────────────┐ - : └───────────────┘ : ┌────┤ FApplication │ - : *┌─────────┐ : │ └──────────────┘ - : ┌--------┤ FString │ : │ ┌─────────┐ - : : └─────────┘ : ├────┤ FButton │ - : : *┌────────┐ : │ └─────────┘ - : ┌--------┤ FPoint │ : │ ┌────────┐ - : : └────────┘ : ├────┤ FLabel │ - : : *┌───────┐ : │ └────────┘ - : ┌--------┤ FRect │ : │ ┌───────────┐ - : : └───────┘ : ├────┤ FLineEdit │ - :1 :1 : │ └───────────┘ - ┌─┴──┴──┐ ┌────────┐ : │ ┌──────────────┐ ┌──────────────┐ - │ FTerm │◄───┤ FVTerm │◄──┐ :1 ├────┤ FButtonGroup │ ┌──┤ FRadioButton │ - └───────┘ └────────┘ │ ┌────┴────┐ │ └──────────────┘ │ └──────────────┘ - ├──┤ FWidget │◄─┤ ┌───────────────┐ │ ┌───────────┐ - ┌─────────┐ │ └─────────┘ ├────┤ FToggleButton │◄─┼──┤ FCheckBox │ - │ FObject │◄──┘ │ └───────────────┘ │ └───────────┘ - └─────────┘ │ ┌──────────────┐ │ ┌─────────┐ - ├────┤ FProgressbar │ └──┤ FSwitch │ - │ └──────────────┘ └─────────┘ - │ ┌────────────┐ - ├────┤ FScrollbar │ - │ └────────────┘ - │ ┌───────────┐ - ├────┤ FTextView │ - │ └───────────┘ - │ ┌──────────┐1 *┌──────────────┐ - ├────┤ FListBox ├-------┤ FListBoxItem │ - │ └──────────┘ └──────────────┘ - ┌─────────────┐1 │ 1┌───────────┐1 *┌───────────────┐ - │ FTermBuffer ├---------------------------├────┤ FListView ├------┤ FListViewItem │ - └─────────────┘ │ └───────────┘ └───────────────┘ - │ ┌─────────────┐ - ├────┤ FScrollView │ - │ └─────────────┘ - │ ┌────────────┐1 *┌────────────┐ - │ ┌──┤ FStatusBar ├-----┤ FStatusKey │ - │ │ └────────────┘ └────────────┘ - │ │ - │ ▼ ┌─────────────┐ - ┌───┴─┴───┐ ┌─────────┐ ┌──┤ FFileDialog │ - │ FWindow │◄─┤ FDialog │◄──┤ └─────────────┘ - └──┬──┬───┘ └─────────┘ │ ┌─────────────┐ - ▲ ▲ └──┤ FMessageBox │ - │ │ └─────────────┘ - │ │ ┌──────────┐ - │ └──────┤ FToolTip │ - │ └──────────┘ - └───────────────┐ ┌──────────┐ - │ ┌───┤ FMenuBar │ - ┌───────────┐ └──────┤ └──────────┘ - │ FMenuList │◄──────────┤ ┌───────┐ - └────┬──────┘ └───┤ FMenu │◄──┐ - 1: └───────┘ │ - : ┌─────────────────┐ │ - : │ FDialogListMenu ├───┘ - : └─────────────────┘ - └--------------------------------┐ - :* ┌────────────────┐* : - ┌─────┴─────┐ ┌──┤ FCheckMenuItem ├---┘ - │ FMenuItem │◄─┤ └────────────────┘ : - └───────────┘ │ ┌────────────────┐* : - └──┤ FRadioMenuItem ├---┘ - └────────────────┘ + : 1┌──────────────┐ ┌───────────┐ + ┌-----------┤ FTermOpenBSD │ ┌────┤ FKeyEvent │ + : └──────────────┘ │ └───────────┘ + : 1┌────────────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermDetection │ ├────┤ FMouseEvent │ + : └────────────────┘ │ └─────────────┘ + : 1┌────────────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermcapQuirks │ ├────┤ FWheelEvent │ + : └────────────────┘ │ └─────────────┘ + : 1┌────────────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermXTerminal │ ├────┤ FFocusEvent │ + : └────────────────┘ │ └─────────────┘ + : 1┌──────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermcap │ ├────┤ FAccelEvent │ + : └──────────┘ │ └─────────────┘ + : 1┌──────────┐ │ ┌──────────────┐ + ┌-----------┤ FTermios │ ├────┤ FResizeEvent │ + : └──────────┘ │ └──────────────┘ + : 1┌───────────────┐ │ ┌────────────┐ + ┌-----------┤ FColorPalette │ ├────┤ FShowEvent │ + : └───────────────┘ │ └────────────┘ + : 1┌───────────┐ │ ┌────────────┐ + ┌-----------┤ FOptiMove │ ├────┤ FHideEvent │ + : └───────────┘ │ └────────────┘ + : 1┌───────────┐ │ ┌─────────────┐ + ┌-----------┤ FOptiAttr │ ├────┤ FCloseEvent │ + : └───────────┘ │ └─────────────┘ + : 1┌───────────┐ │ ┌─────────────┐ + ┌-----------┤ FKeyboard │ ├────┤ FTimerEvent │ + : └───────────┘ │ └─────────────┘ + : 1┌───────────────┐ │ + ┌-----------┤ FMouseControl │ │ ┌──────────────┐ + : └───────────────┘ │ ┌────┤ FApplication │ + : *┌─────────┐ │ │ └──────────────┘ + : ┌--------┤ FString │ │ │ ┌─────────┐ + : : └─────────┘ │ ├────┤ FButton │ + : : *┌────────┐ │ │ └─────────┘ + : ┌--------┤ FPoint │ │ │ ┌────────┐ + : : └────────┘ │ ├────┤ FLabel │ + : : *┌───────┐ │ │ └────────┘ + : ┌--------┤ FRect │ │ │ ┌───────────┐ + : : └───────┘ │ ├────┤ FLineEdit │ + :1 :1 │ │ └───────────┘ + ┌─┴──┴──┐ │ │ ┌──────────────┐ ┌──────────────┐ + │ FTerm │ │ ├────┤ FButtonGroup │ ┌──┤ FRadioButton │ + └───┬───┘ ┌────────┐ │ │ └──────────────┘ │ └──────────────┘ + :1 │ FEvent │◄─────┘ │ ┌───────────────┐ │ ┌───────────┐ + ┌───┴────┐ └────┬───┘ ├────┤ FToggleButton │◄─┼──┤ FCheckBox │ + │ FVTerm │◄──┐ :1 │ └───────────────┘ │ └───────────┘ + └────────┘ │ ┌────┴────┐ │ ┌──────────────┐ │ ┌─────────┐ + ├────┤ FWidget │◄───────┼────┤ FProgressbar │ └──┤ FSwitch │ +┌─────────┐ │ └─────────┘ │ └──────────────┘ └─────────┘ +│ FObject │◄──┘ │ ┌────────────┐ +└─────────┘ ├────┤ FScrollbar │ + │ └────────────┘ + │ ┌───────────┐ + ├────┤ FTextView │ + │ └───────────┘ + │ ┌──────────┐1 *┌──────────────┐ + ├────┤ FListBox ├-------┤ FListBoxItem │ + │ └──────────┘ └──────────────┘ + ┌─────────────┐1 │ 1┌───────────┐1 *┌───────────────┐ + │ FTermBuffer ├----------------------├────┤ FListView ├------┤ FListViewItem │ + └─────────────┘ │ └───────────┘ └───────────────┘ + │ ┌─────────────┐ + ├────┤ FScrollView │ + │ └─────────────┘ + │ ┌────────────┐1 *┌────────────┐ + │ ┌──┤ FStatusBar ├-----┤ FStatusKey │ + │ │ └────────────┘ └────────────┘ + │ │ + │ ▼ ┌─────────────┐ + ┌───┴─┴───┐ ┌─────────┐ ┌──┤ FFileDialog │ + │ FWindow │◄─┤ FDialog │◄──┤ └─────────────┘ + └──┬──┬───┘ └─────────┘ │ ┌─────────────┐ + ▲ ▲ └──┤ FMessageBox │ + │ │ └─────────────┘ + │ │ ┌──────────┐ + │ └──────┤ FToolTip │ + │ └──────────┘ + └───────────────┐ ┌──────────┐ + │ ┌───┤ FMenuBar │ + ┌───────────┐ └──────┤ └──────────┘ + │ FMenuList │◄──────────┤ ┌───────┐ + └────┬──────┘ └───┤ FMenu │◄──┐ + :1 └───────┘ │ + : ┌─────────────────┐ │ + : │ FDialogListMenu ├───┘ + : └─────────────────┘ + └--------------------------------┐ + :* ┌────────────────┐* : + ┌────┴─────┐ ┌──┤ FCheckMenuItem ├---┘ + │FMenuItem │◄─┤ └────────────────┘ : + └──────────┘ │ ┌────────────────┐* : + └──┤ FRadioMenuItem ├---┘ + └────────────────┘ License diff --git a/doc/class-diagram.txt b/doc/class-diagram.txt index ef38bfbe..200f4ace 100644 --- a/doc/class-diagram.txt +++ b/doc/class-diagram.txt @@ -4,100 +4,100 @@ 1┌──────────────┐ ┌-----------┤ FTermFreeBSD │ : └──────────────┘ - : 1┌──────────────┐ ┌───────────┐ - ┌-----------┤ FTermOpenBSD │ ┌────┤ FKeyEvent │ - : └──────────────┘ │ └───────────┘ - : 1┌────────────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermDetection │ ├────┤ FMouseEvent │ - : └────────────────┘ │ └─────────────┘ - : 1┌────────────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermcapQuirks │ ├────┤ FWheelEvent │ - : └────────────────┘ │ └─────────────┘ - : 1┌────────────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermXTerminal │ ├────┤ FFocusEvent │ - : └────────────────┘ │ └─────────────┘ - : 1┌──────────┐ │ ┌─────────────┐ - ┌-----------┤ FTermcap │ ┌────────┐ ├────┤ FAccelEvent │ - : └──────────┘ │ FEvent │◄─┤ └─────────────┘ - : 1┌──────────┐ └───┬────┘ │ ┌──────────────┐ - ┌-----------┤ FTermios │ :1 ├────┤ FResizeEvent │ - : └──────────┘ : │ └──────────────┘ - : 1┌───────────────┐ : │ ┌────────────┐ - ┌-----------┤ FColorPalette │ : ├────┤ FShowEvent │ - : └───────────────┘ : │ └────────────┘ - : 1┌───────────┐ : │ ┌────────────┐ - ┌-----------┤ FOptiMove │ : ├────┤ FHideEvent │ - : └───────────┘ : │ └────────────┘ - : 1┌───────────┐ : │ ┌─────────────┐ - ┌-----------┤ FOptiAttr │ : ├────┤ FCloseEvent │ - : └───────────┘ : │ └─────────────┘ - : 1┌───────────┐ : │ ┌─────────────┐ - ┌-----------┤ FKeyboard │ : └────┤ FTimerEvent │ - : └───────────┘ : └─────────────┘ - : 1┌───────────────┐ : - ┌-----------┤ FMouseControl │ : ┌──────────────┐ - : └───────────────┘ : ┌────┤ FApplication │ - : *┌─────────┐ : │ └──────────────┘ - : ┌--------┤ FString │ : │ ┌─────────┐ - : : └─────────┘ : ├────┤ FButton │ - : : *┌────────┐ : │ └─────────┘ - : ┌--------┤ FPoint │ : │ ┌────────┐ - : : └────────┘ : ├────┤ FLabel │ - : : *┌───────┐ : │ └────────┘ - : ┌--------┤ FRect │ : │ ┌───────────┐ - : : └───────┘ : ├────┤ FLineEdit │ - :1 :1 : │ └───────────┘ - ┌─┴──┴──┐ ┌────────┐ : │ ┌──────────────┐ ┌──────────────┐ - │ FTerm │◄───┤ FVTerm │◄──┐ :1 ├────┤ FButtonGroup │ ┌──┤ FRadioButton │ - └───────┘ └────────┘ │ ┌────┴────┐ │ └──────────────┘ │ └──────────────┘ - ├──┤ FWidget │◄─┤ ┌───────────────┐ │ ┌───────────┐ - ┌─────────┐ │ └─────────┘ ├────┤ FToggleButton │◄─┼──┤ FCheckBox │ - │ FObject │◄──┘ │ └───────────────┘ │ └───────────┘ - └─────────┘ │ ┌──────────────┐ │ ┌─────────┐ - ├────┤ FProgressbar │ └──┤ FSwitch │ - │ └──────────────┘ └─────────┘ - │ ┌────────────┐ - ├────┤ FScrollbar │ - │ └────────────┘ - │ ┌───────────┐ - ├────┤ FTextView │ - │ └───────────┘ - │ ┌──────────┐1 *┌──────────────┐ - ├────┤ FListBox ├-------┤ FListBoxItem │ - │ └──────────┘ └──────────────┘ - ┌─────────────┐1 │ 1┌───────────┐1 *┌───────────────┐ - │ FTermBuffer ├---------------------------├────┤ FListView ├------┤ FListViewItem │ - └─────────────┘ │ └───────────┘ └───────────────┘ - │ ┌─────────────┐ - ├────┤ FScrollView │ - │ └─────────────┘ - │ ┌────────────┐1 *┌────────────┐ - │ ┌──┤ FStatusBar ├-----┤ FStatusKey │ - │ │ └────────────┘ └────────────┘ - │ │ - │ ▼ ┌─────────────┐ - ┌───┴─┴───┐ ┌─────────┐ ┌──┤ FFileDialog │ - │ FWindow │◄─┤ FDialog │◄──┤ └─────────────┘ - └──┬──┬───┘ └─────────┘ │ ┌─────────────┐ - ▲ ▲ └──┤ FMessageBox │ - │ │ └─────────────┘ - │ │ ┌──────────┐ - │ └──────┤ FToolTip │ - │ └──────────┘ - └───────────────┐ ┌──────────┐ - │ ┌───┤ FMenuBar │ - ┌───────────┐ └──────┤ └──────────┘ - │ FMenuList │◄──────────┤ ┌───────┐ - └────┬──────┘ └───┤ FMenu │◄──┐ - :1 └───────┘ │ - : ┌─────────────────┐ │ - : │ FDialogListMenu ├───┘ - : └─────────────────┘ - └--------------------------------┐ - :* ┌────────────────┐* : - ┌─────┴─────┐ ┌──┤ FCheckMenuItem ├---┘ - │ FMenuItem │◄─┤ └────────────────┘ : - └───────────┘ │ ┌────────────────┐* : - └──┤ FRadioMenuItem ├---┘ - └────────────────┘ + : 1┌──────────────┐ ┌───────────┐ + ┌-----------┤ FTermOpenBSD │ ┌────┤ FKeyEvent │ + : └──────────────┘ │ └───────────┘ + : 1┌────────────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermDetection │ ├────┤ FMouseEvent │ + : └────────────────┘ │ └─────────────┘ + : 1┌────────────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermcapQuirks │ ├────┤ FWheelEvent │ + : └────────────────┘ │ └─────────────┘ + : 1┌────────────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermXTerminal │ ├────┤ FFocusEvent │ + : └────────────────┘ │ └─────────────┘ + : 1┌──────────┐ │ ┌─────────────┐ + ┌-----------┤ FTermcap │ ├────┤ FAccelEvent │ + : └──────────┘ │ └─────────────┘ + : 1┌──────────┐ │ ┌──────────────┐ + ┌-----------┤ FTermios │ ├────┤ FResizeEvent │ + : └──────────┘ │ └──────────────┘ + : 1┌───────────────┐ │ ┌────────────┐ + ┌-----------┤ FColorPalette │ ├────┤ FShowEvent │ + : └───────────────┘ │ └────────────┘ + : 1┌───────────┐ │ ┌────────────┐ + ┌-----------┤ FOptiMove │ ├────┤ FHideEvent │ + : └───────────┘ │ └────────────┘ + : 1┌───────────┐ │ ┌─────────────┐ + ┌-----------┤ FOptiAttr │ ├────┤ FCloseEvent │ + : └───────────┘ │ └─────────────┘ + : 1┌───────────┐ │ ┌─────────────┐ + ┌-----------┤ FKeyboard │ ├────┤ FTimerEvent │ + : └───────────┘ │ └─────────────┘ + : 1┌───────────────┐ │ + ┌-----------┤ FMouseControl │ │ ┌──────────────┐ + : └───────────────┘ │ ┌────┤ FApplication │ + : *┌─────────┐ │ │ └──────────────┘ + : ┌--------┤ FString │ │ │ ┌─────────┐ + : : └─────────┘ │ ├────┤ FButton │ + : : *┌────────┐ │ │ └─────────┘ + : ┌--------┤ FPoint │ │ │ ┌────────┐ + : : └────────┘ │ ├────┤ FLabel │ + : : *┌───────┐ │ │ └────────┘ + : ┌--------┤ FRect │ │ │ ┌───────────┐ + : : └───────┘ │ ├────┤ FLineEdit │ + :1 :1 │ │ └───────────┘ + ┌─┴──┴──┐ │ │ ┌──────────────┐ ┌──────────────┐ + │ FTerm │ │ ├────┤ FButtonGroup │ ┌──┤ FRadioButton │ + └───┬───┘ ┌────────┐ │ │ └──────────────┘ │ └──────────────┘ + :1 │ FEvent │◄─────┘ │ ┌───────────────┐ │ ┌───────────┐ + ┌───┴────┐ └────┬───┘ ├────┤ FToggleButton │◄─┼──┤ FCheckBox │ + │ FVTerm │◄──┐ :1 │ └───────────────┘ │ └───────────┘ + └────────┘ │ ┌────┴────┐ │ ┌──────────────┐ │ ┌─────────┐ + ├────┤ FWidget │◄───────┼────┤ FProgressbar │ └──┤ FSwitch │ +┌─────────┐ │ └─────────┘ │ └──────────────┘ └─────────┘ +│ FObject │◄──┘ │ ┌────────────┐ +└─────────┘ ├────┤ FScrollbar │ + │ └────────────┘ + │ ┌───────────┐ + ├────┤ FTextView │ + │ └───────────┘ + │ ┌──────────┐1 *┌──────────────┐ + ├────┤ FListBox ├-------┤ FListBoxItem │ + │ └──────────┘ └──────────────┘ + ┌─────────────┐1 │ 1┌───────────┐1 *┌───────────────┐ + │ FTermBuffer ├----------------------├────┤ FListView ├------┤ FListViewItem │ + └─────────────┘ │ └───────────┘ └───────────────┘ + │ ┌─────────────┐ + ├────┤ FScrollView │ + │ └─────────────┘ + │ ┌────────────┐1 *┌────────────┐ + │ ┌──┤ FStatusBar ├-----┤ FStatusKey │ + │ │ └────────────┘ └────────────┘ + │ │ + │ ▼ ┌─────────────┐ + ┌───┴─┴───┐ ┌─────────┐ ┌──┤ FFileDialog │ + │ FWindow │◄─┤ FDialog │◄──┤ └─────────────┘ + └──┬──┬───┘ └─────────┘ │ ┌─────────────┐ + ▲ ▲ └──┤ FMessageBox │ + │ │ └─────────────┘ + │ │ ┌──────────┐ + │ └──────┤ FToolTip │ + │ └──────────┘ + └───────────────┐ ┌──────────┐ + │ ┌───┤ FMenuBar │ + ┌───────────┐ └──────┤ └──────────┘ + │ FMenuList │◄──────────┤ ┌───────┐ + └────┬──────┘ └───┤ FMenu │◄──┐ + :1 └───────┘ │ + : ┌─────────────────┐ │ + : │ FDialogListMenu ├───┘ + : └─────────────────┘ + └--------------------------------┐ + :* ┌────────────────┐* : + ┌────┴─────┐ ┌──┤ FCheckMenuItem ├---┘ + │FMenuItem │◄─┤ └────────────────┘ : + └──────────┘ │ ┌────────────────┐* : + └──┤ FRadioMenuItem ├---┘ + └────────────────┘ diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index 208c317c..a0f72bf2 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -111,7 +111,7 @@ void move (int xold, int yold, int xnew, int ynew) << std::left << std::setw(10) << to << " "; // get the move string - buffer = terminal->moveCursor (xold, yold, xnew, ynew); + buffer = terminal->getFTerm().moveCursor (xold, yold, xnew, ynew); len = uInt(std::strlen(buffer)); for (uInt i = 0; i < len; i++) @@ -164,7 +164,7 @@ int main (int argc, char* argv[]) TermApp.clearArea(); // Show the determined terminal name and text resolution - std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; + std::cout << "Terminal: " << TermApp.getFTerm().getTermType() << "\r\n"; std::cout << " Columns: 0.." << xmax << "\r\n"; std::cout << " Lines: 0.." << ymax << "\r\n"; @@ -197,7 +197,7 @@ int main (int argc, char* argv[]) // Show terminal speed and milliseconds for all cursor movement sequence std::cout << "\r" << line; - TermApp.printMoveDurations(); + TermApp.getFTerm().printMoveDurations(); // Waiting for keypress keyPressed(); diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 2cd7b4cc..30a49f52 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -74,7 +74,7 @@ AttribDlg::AttribDlg (finalcut::FWidget* parent) , back_button("< &Back", this) { setText ( "A terminal attributes test (" - + finalcut::FString(getTermType()) + + finalcut::FString(getFTerm().getTermType()) + ")"); next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1); diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 85fb3e26..81b71ea7 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -225,20 +225,21 @@ void tcapString (const std::string& name, const char cap_str[]) #if DEBUG void debug (finalcut::FApplication& TermApp) { - const finalcut::FString& ab_s = TermApp.getAnswerbackString(); - const finalcut::FString& sec_da = TermApp.getSecDAString(); + finalcut::FTerm& fterm = TermApp.getFTerm(); + const finalcut::FString& ab_s = fterm.getAnswerbackString(); + const finalcut::FString& sec_da = fterm.getSecDAString(); std::cout << "\n.------------------- debug -------------------\r\n"; #if defined(__linux__) std::cout << "| Framebuffer bpp: " - << TermApp.getFramebufferBpp() << "\r\n"; + << fterm.getFramebufferBpp() << "\r\n"; #endif std::cout << "| after init_256colorTerminal(): " - << TermApp.getTermType_256color() << "\r\n"; + << fterm.getTermType_256color() << "\r\n"; std::cout << "| after parseAnswerbackMsg(): " - << TermApp.getTermType_Answerback() << "\r\n"; + << fterm.getTermType_Answerback() << "\r\n"; std::cout << "| after parseSecDA(): " - << TermApp.getTermType_SecDA() << "\r\n"; + << fterm.getTermType_SecDA() << "\r\n"; if ( ! ab_s.isEmpty() ) tcapString ("| The answerback String", ab_s); @@ -313,8 +314,9 @@ int main (int argc, char* argv[]) finalcut::FTermcap::tcap_map* tcap = 0; tcap = finalcut::FTermcap::getTermcapMap(); + finalcut::FTerm& fterm = TermApp.getFTerm(); std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; - std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; + std::cout << "Terminal: " << fterm.getTermType() << "\r\n"; debug (TermApp); diff --git a/examples/ui.cpp b/examples/ui.cpp index 1e527fc9..fad7bb6f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -836,8 +836,8 @@ void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr) ( "Environment" , finalcut::FString() - << " Type: " << getTermType() << "\n" - << " Name: " << getTermFileName() << "\n" + << " Type: " << getFTerm().getTermType() << "\n" + << " Name: " << getFTerm().getTermFileName() << "\n" << " Mode: " << getEncodingString() << "\n" << " Size: " << x << wchar_t(finalcut::fc::Times) << y << "\n" @@ -943,7 +943,7 @@ void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr) finalcut::FLineEdit* lineedit = static_cast(widget); finalcut::FString title; *lineedit >> title; - setTermTitle (title); + getFTerm().setTermTitle (title); setText (title); redraw(); } @@ -1048,17 +1048,17 @@ int main (int argc, char* argv[]) // Create the application object app finalcut::FApplication app(argc, argv); - app.redefineDefaultColors(true); - app.setTermTitle (title); + app.getFTerm().redefineDefaultColors(true); + app.getFTerm().setTermTitle (title); // Force vt100 encoding - //app.setEncoding("VT100"); + //app.getFTerm().setEncoding(finalcut::fc::VT100); // Sets the terminal size to 94×30 //app.setTermSize(94,30); // Enable the final cut graphical font - //app.setNewFont(); + //app.getFTerm().setNewFont(); // Create main dialog object d MyDialog d(&app); diff --git a/src/fapplication.cpp b/src/fapplication.cpp index a6cd382a..e9444cef 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -302,7 +302,7 @@ FWidget* FApplication::processParameters (const int& argc, char* argv[]) showParameterUsage(); } - init_values.setDefault(); + getInitValues().setDefault(); cmd_options (argc, argv); return 0; } @@ -449,13 +449,13 @@ void FApplication::cmd_options (const int& argc, char* argv[]) encoding = encoding.toLower(); if ( encoding.includes("utf8") ) - init_values.encoding = fc::UTF8; + getInitValues().encoding = fc::UTF8; else if ( encoding.includes("vt100") ) - init_values.encoding = fc::VT100; + getInitValues().encoding = fc::VT100; else if ( encoding.includes("pc") ) - init_values.encoding = fc::PC; + getInitValues().encoding = fc::PC; else if ( encoding.includes("ascii") ) - init_values.encoding = fc::ASCII; + getInitValues().encoding = fc::ASCII; else if ( encoding.includes("help") ) showParameterUsage(); else @@ -464,32 +464,32 @@ void FApplication::cmd_options (const int& argc, char* argv[]) } if ( std::strcmp(long_options[idx].name, "no-mouse") == 0 ) - init_values.mouse_support = false; + getInitValues().mouse_support = false; if ( std::strcmp(long_options[idx].name, "no-optimized-cursor") == 0 ) - init_values.cursor_optimisation = false; + getInitValues().cursor_optimisation = false; if ( std::strcmp(long_options[idx].name, "no-terminal-detection") == 0 ) - init_values.terminal_detection = false; + getInitValues().terminal_detection = false; if ( std::strcmp(long_options[idx].name, "no-color-change") == 0 ) - init_values.color_change = false; + getInitValues().color_change = false; if ( std::strcmp(long_options[idx].name, "vgafont") == 0 ) - init_values.vgafont = true; + getInitValues().vgafont = true; if ( std::strcmp(long_options[idx].name, "newfont") == 0 ) - init_values.newfont = true; + getInitValues().newfont = true; #if defined(__FreeBSD__) || defined(__DragonFly__) if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) - init_values.meta_sends_escape = false; + getInitValues().meta_sends_escape = false; if ( std::strcmp(long_options[idx].name, "no-cursorstyle-change") == 0 ) - init_values.change_cursorstyle = false; + getInitValues().change_cursorstyle = false; #elif defined(__NetBSD__) || defined(__OpenBSD__) if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) - init_values.meta_sends_escape = false; + getInitValues().meta_sends_escape = false; #endif } } @@ -853,7 +853,7 @@ void FApplication::closeOpenMenu() // No widget was been clicked and the menu is no dialog menu if ( ! (getClickedWidget() || is_window_menu) ) - FWindow::switchToPrevWindow(); + FWindow::switchToPrevWindow(this); if ( getStatusBar() ) getStatusBar()->drawMessage(); @@ -894,7 +894,7 @@ void FApplication::unselectMenubarItems() // No widget was been clicked if ( ! getClickedWidget() ) - FWindow::switchToPrevWindow(); + FWindow::switchToPrevWindow(this); if ( getStatusBar() ) getStatusBar()->drawMessage(); diff --git a/src/fdialog.cpp b/src/fdialog.cpp index bad4c777..b43780b2 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -87,7 +87,7 @@ FDialog::~FDialog() // destructor accelerator_list = 0; if ( ! is_quit ) - switchToPrevWindow(); + switchToPrevWindow(this); delDialog(this); diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 07c1b64d..cc75ae8b 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -71,7 +71,7 @@ FMenu::~FMenu() // destructor FApplication* fapp = static_cast(getRootWidget()); if ( ! fapp->isQuit() ) - switchToPrevWindow(); // Switch to previous window + switchToPrevWindow(this); // Switch to previous window } @@ -1664,7 +1664,7 @@ inline void FMenu::keyEscape() getStatusBar()->clearMessage(); if ( ! (super && isWindowsMenu(super)) ) - switchToPrevWindow(); + switchToPrevWindow(this); } if ( getStatusBar() ) diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 0564fd31..0d904cde 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -1042,7 +1042,7 @@ void FMenuBar::leaveMenuBar() if ( getStatusBar() ) getStatusBar()->clearMessage(); - switchToPrevWindow(); + switchToPrevWindow(this); if ( getStatusBar() ) getStatusBar()->drawMessage(); diff --git a/src/fterm.cpp b/src/fterm.cpp index 9dab87cc..8d534759 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -115,6 +115,17 @@ bool FTerm::isNormal (charData*& ch) return opti_attr->isNormal(ch); } +//---------------------------------------------------------------------- +bool FTerm::isCursorHideable() +{ + char* cursor_off_str = disableCursor(); + + if ( cursor_off_str && std::strlen(cursor_off_str) > 0 ) + return true; + + return false; +} + //---------------------------------------------------------------------- void FTerm::setTermType (const char term_name[]) { diff --git a/src/ftooltip.cpp b/src/ftooltip.cpp index 7cb88ef6..47af64b2 100644 --- a/src/ftooltip.cpp +++ b/src/ftooltip.cpp @@ -71,7 +71,7 @@ FToolTip::~FToolTip() // destructor if ( parent_win ) setActiveWindow (parent_win); else - switchToPrevWindow(); + switchToPrevWindow(this); } diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 387737e7..18db2cd1 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -25,6 +25,7 @@ #include #include "final/fapplication.h" +#include "final/fterm.h" #include "final/fvterm.h" #include "final/fwidget.h" #include "final/fwindow.h" @@ -48,6 +49,7 @@ uInt FVTerm::clr_eol_length; uInt FVTerm::cursor_address_length; std::queue* FVTerm::output_buffer = 0; FPoint* FVTerm::term_pos = 0; +FTerm* FVTerm::fterm = 0; FVTerm::term_area* FVTerm::vterm = 0; FVTerm::term_area* FVTerm::vdesktop = 0; FVTerm::term_area* FVTerm::active_area = 0; @@ -66,15 +68,14 @@ FVTerm::charData FVTerm::i_ch; // constructors and destructor //---------------------------------------------------------------------- FVTerm::FVTerm (bool initialize, bool disable_alt_screen) - : FTerm(disable_alt_screen) - , print_area(0) + : print_area(0) , child_print_area(0) , vwin(0) { terminal_update_complete = false; if ( initialize ) - init(); + init (disable_alt_screen); } //---------------------------------------------------------------------- @@ -128,7 +129,7 @@ void FVTerm::setTermXY (int x, int y) term_x = term_pos->getX(); term_y = term_pos->getY(); - move_str = moveCursor (term_x, term_y, x, y); + move_str = fterm->moveCursor (term_x, term_y, x, y); if ( move_str ) appendOutputBuffer(move_str); @@ -142,7 +143,7 @@ void FVTerm::hideCursor (bool on) { // Hides or shows the input cursor on the terminal - char* visibility_str = cursorsVisibility (on); + char* visibility_str = fterm->cursorsVisibility (on); if ( visibility_str ) appendOutputBuffer(visibility_str); @@ -1577,7 +1578,7 @@ void FVTerm::scrollAreaForward (term_area* area) if ( TCAP(fc::t_scroll_forward) ) { setTermXY (0, vdesktop->height); - scrollTermForward(); + fterm->scrollTermForward(); putArea (1, 1, vdesktop); // avoid update lines from 0 to (y_max - 1) @@ -1638,7 +1639,7 @@ void FVTerm::scrollAreaReverse (term_area* area) if ( TCAP(fc::t_scroll_reverse) ) { setTermXY (0, 0); - scrollTermReverse(); + fterm->scrollTermReverse(); putArea (1, 1, vdesktop); // avoid update lines from 1 to y_max @@ -1950,7 +1951,7 @@ void FVTerm::flush_out() { while ( ! output_buffer->empty() ) { - Fputchar (output_buffer->front()); + fterm->Fputchar (output_buffer->front()); output_buffer->pop(); } @@ -1960,7 +1961,7 @@ void FVTerm::flush_out() // private methods of FVTerm //---------------------------------------------------------------------- -void FVTerm::init() +void FVTerm::init (bool disable_alt_screen) { init_object = this; vterm = 0; @@ -1968,6 +1969,7 @@ void FVTerm::init() try { + fterm = new FTerm (disable_alt_screen); term_pos = new FPoint(-1, -1); output_buffer = new std::queue; } @@ -2007,13 +2009,13 @@ void FVTerm::init() active_area = vdesktop; // Initialize keyboard - keyboard = getKeyboard(); + keyboard = fterm->getKeyboard(); // Hide the input cursor hideCursor(); // Initialize character lengths - init_characterLengths (getFOptiMove()); + init_characterLengths (fterm->getFOptiMove()); } //---------------------------------------------------------------------- @@ -2046,7 +2048,7 @@ void FVTerm::finish() // Clear the terminal setNormal(); - if ( hasAlternateScreen() ) + if ( fterm->hasAlternateScreen() ) clearTerm(); flush_out(); @@ -2060,6 +2062,9 @@ void FVTerm::finish() if ( term_pos ) delete term_pos; + + if ( fterm ) + delete fterm; } //---------------------------------------------------------------------- @@ -2163,7 +2168,7 @@ bool FVTerm::clearTerm (int fillchar) char*& cb = TCAP(fc::t_clr_eol); bool ut = FTermcap::background_color_erase; charData* next = &next_attribute; - bool normal = isNormal(next); + bool normal = fterm->isNormal(next); appendAttributes(next); if ( ! ( (cl || cd || cb) && (normal || ut) ) @@ -2268,7 +2273,7 @@ bool FVTerm::canClearToEOL (uInt xmin, uInt y) if ( ce && min_char->code == ' ' ) { uInt beginning_whitespace = 1; - bool normal = isNormal(min_char); + bool normal = fterm->isNormal(min_char); bool& ut = FTermcap::background_color_erase; for (uInt x = xmin + 1; x < uInt(vt->width); x++) @@ -2303,7 +2308,7 @@ bool FVTerm::canClearLeadingWS (uInt& xmin, uInt y) if ( cb && first_char->code == ' ' ) { uInt leading_whitespace = 1; - bool normal = isNormal(first_char); + bool normal = fterm->isNormal(first_char); bool& ut = FTermcap::background_color_erase; for (uInt x = 1; x < uInt(vt->width); x++) @@ -2341,7 +2346,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y) if ( ce && last_char->code == ' ' ) { uInt trailing_whitespace = 1; - bool normal = isNormal(last_char); + bool normal = fterm->isNormal(last_char); bool& ut = FTermcap::background_color_erase; for (uInt x = uInt(vt->width) - 1; x > 0 ; x--) @@ -2452,7 +2457,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y return not_used; uInt whitespace = 1; - bool normal = isNormal(print_char); + bool normal = fterm->isNormal(print_char); for (uInt i = x + 1; i <= xmax; i++) { @@ -2776,14 +2781,14 @@ inline void FVTerm::charsetChanges (charData*& next_char) return; uInt code = uInt(next_char->code); - uInt ch_enc = charEncode(code); + uInt ch_enc = fterm->charEncode(code); if ( ch_enc == code ) return; if ( ch_enc == 0 ) { - next_char->code = int(charEncode(code, fc::ASCII)); + next_char->code = int(fterm->charEncode(code, fc::ASCII)); return; } @@ -2801,7 +2806,7 @@ inline void FVTerm::charsetChanges (charData*& next_char) if ( isXTerminal() && ch_enc < 0x20 ) // Character 0x00..0x1f { if ( hasUTF8() ) - next_char->code = int(charEncode(code, fc::ASCII)); + next_char->code = int(fterm->charEncode(code, fc::ASCII)); else { next_char->code += 0x5f; @@ -2843,7 +2848,7 @@ inline void FVTerm::appendAttributes (charData*& next_attr) charData* term_attr = &term_attribute; // generate attribute string for the next character - attr_str = changeAttribute (term_attr, next_attr); + attr_str = fterm->changeAttribute (term_attr, next_attr); if ( attr_str ) appendOutputBuffer (attr_str); diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 22a2bf64..a31e34a9 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -1976,13 +1976,7 @@ void FWidget::init() return; } - char* cursor_off_str = disableCursor(); - - if ( cursor_off_str && std::strlen(cursor_off_str) > 0 ) - hideable = true; - else - hideable = false; - + hideable = isCursorHideable(); visible_cursor = ! hideable; // Determine width and height of the terminal diff --git a/src/fwindow.cpp b/src/fwindow.cpp index 6238b6c8..2adcd7be 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -713,13 +713,14 @@ bool FWindow::zoomWindow() } //---------------------------------------------------------------------- -void FWindow::switchToPrevWindow() +void FWindow::switchToPrevWindow (FWidget* widget_object) { // switch to previous window // Disable terminal updates to avoid flickering // when redrawing the focused widget - updateTerminal (FVTerm::stop_refresh); + if ( widget_object ) + widget_object->updateTerminal (FVTerm::stop_refresh); bool is_activated = activatePrevWindow(); FWindow* active_window = static_cast(getActiveWindow()); @@ -769,7 +770,8 @@ void FWindow::switchToPrevWindow() } // Enable terminal updates again - updateTerminal (FVTerm::continue_refresh); + if ( widget_object ) + widget_object->updateTerminal (FVTerm::continue_refresh); } //---------------------------------------------------------------------- diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index fa22cbeb..c69c43fe 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -108,7 +108,7 @@ class FApplication : public FWidget static void sendQueuedEvents (); static bool eventInQueue(); static bool removeQueuedEvent (const FObject*); - static FWidget* processParameters (const int&, char*[]); + FWidget* processParameters (const int&, char*[]); static void showParameterUsage () #if defined(__clang__) || defined(__GNUC__) __attribute__((noreturn)) @@ -135,7 +135,7 @@ class FApplication : public FWidget // Methods void init (long, long); - static void cmd_options (const int&, char*[]); + void cmd_options (const int&, char*[]); void findKeyboardWidget(); bool isKeyPressed(); void keyPressed(); diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index b5bafeee..9a0cee23 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -94,7 +94,7 @@ class FLabel : public FWidget // Accessors const char* getClassName() const; - FTerm* getAccelWidget(); + FWidget* getAccelWidget(); fc::text_alignment getAlignment(); FString& getText(); @@ -172,7 +172,7 @@ inline const char* FLabel::getClassName() const { return "FLabel"; } //---------------------------------------------------------------------- -inline FTerm* FLabel::getAccelWidget () +inline FWidget* FLabel::getAccelWidget () { return accel_widget; } //---------------------------------------------------------------------- diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 29dd9cb1..91f0ba2e 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -156,6 +156,8 @@ class FTerm // Typedefs typedef FOptiAttr::charData charData; + struct initializationValues; // forward declaration + // Constructor explicit FTerm (bool = false); @@ -169,12 +171,14 @@ class FTerm static std::size_t getLineNumber(); static std::size_t getColumnNumber(); static const FString getKeyName (int); + static FOptiMove* getFOptiMove(); static int getTTYFileDescriptor(); static char* getTermType(); static char* getTermFileName(); static int getTabstop(); static int getMaxColor(); + initializationValues& getInitValues(); #if DEBUG static const FString& getAnswerbackString(); @@ -212,12 +216,15 @@ class FTerm static bool isScreenTerm(); static bool isTmuxTerm(); static bool isNewFont(); + static bool isCursorHideable(); + static bool hasChangedTermSize(); + static bool hasShadowCharacter(); + static bool hasHalfBlockCharacter(); + static bool hasAlternateScreen(); // Mutators static void setTermType (const char[]); static void setInsertCursor (bool on); - static void setInsertCursor(); - static void unsetInsertCursor(); static void redefineDefaultColors (bool); static void setDblclickInterval (const long); static bool setUTF8 (bool); @@ -237,7 +244,7 @@ class FTerm static char* disableCursor(); static void detectTermSize(); static void setTermSize (std::size_t, std::size_t); - static void setTermTitle(const FString&); + static void setTermTitle (const FString&); static void setKDECursor (fc::kdeKonsoleCursorShape); static void saveColorMap(); static void resetColorMap(); @@ -275,17 +282,6 @@ class FTerm static int putchar_ASCII (int); static int putchar_UTF8 (int); - protected: - // Inquiries - static bool hasChangedTermSize(); - static bool hasShadowCharacter(); - static bool hasHalfBlockCharacter(); - static bool hasAlternateScreen(); - - // Accessors - FOptiMove* getFOptiMove(); - - // Methods static void initScreenSettings(); static char* changeAttribute ( charData*& , charData*& ); @@ -451,6 +447,10 @@ inline int FTerm::getTabstop() inline int FTerm::getMaxColor() { return FTermcap::max_color; } +//---------------------------------------------------------------------- +inline FTerm::initializationValues& FTerm::getInitValues() +{ return init_values; } + #if DEBUG //---------------------------------------------------------------------- inline const FString& FTerm::getAnswerbackString() @@ -565,22 +565,6 @@ inline bool FTerm::isTmuxTerm() inline bool FTerm::isNewFont() { return data->isNewFont(); } -//---------------------------------------------------------------------- -inline void FTerm::setInsertCursor() -{ setInsertCursor(true); } - -//---------------------------------------------------------------------- -inline void FTerm::unsetInsertCursor() -{ setInsertCursor(false); } - -//---------------------------------------------------------------------- -inline bool FTerm::setUTF8() -{ return setUTF8(true); } - -//---------------------------------------------------------------------- -inline bool FTerm::unsetUTF8() -{ return setUTF8(false); } - //---------------------------------------------------------------------- inline bool FTerm::hasChangedTermSize() { return data->hasTermResized(); } @@ -597,6 +581,14 @@ inline bool FTerm::hasHalfBlockCharacter() inline bool FTerm::hasAlternateScreen() { return data->hasAlternateScreen(); } +//---------------------------------------------------------------------- +inline bool FTerm::setUTF8() +{ return setUTF8(true); } + +//---------------------------------------------------------------------- +inline bool FTerm::unsetUTF8() +{ return setUTF8(false); } + //---------------------------------------------------------------------- inline FOptiMove* FTerm::getFOptiMove() { return opti_move; } diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 5daec515..b1a006cf 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -78,7 +78,7 @@ class FWidget; #pragma pack(push) #pragma pack(1) -class FVTerm : public FTerm +class FVTerm { public: // Typedefs and Enumeration @@ -128,128 +128,159 @@ class FVTerm : public FTerm FVTerm& operator << (const std::vector&); // Accessors - virtual const char* getClassName() const; - static short getTermForegroundColor(); - static short getTermBackgroundColor(); - term_area* getVWin() const; - FPoint getPrintCursor(); - static charData getAttribute(); + virtual const char* getClassName() const; + static short getTermForegroundColor(); + static short getTermBackgroundColor(); + term_area* getVWin() const; + FPoint getPrintCursor(); + static charData getAttribute(); + static int getMaxColor(); + static int getTabstop(); + static fc::encoding getEncoding(); + static std::string getEncodingString(); + static const FString getKeyName (int); + FTerm& getFTerm(); // Mutators - static void setTermXY (int, int); - static void hideCursor (bool); - static void hideCursor(); - static void showCursor(); - void setPrintCursor (const FPoint&); - void setPrintCursor (int, int); - void setColor (short, short); - static void setNormal(); + void setTermXY (int, int); + static void hideCursor (bool); + static void hideCursor(); + static void showCursor(); + void setPrintCursor (const FPoint&); + void setPrintCursor (int, int); + void setColor (short, short); + static void setNormal(); - static bool setBold (bool); - static bool setBold(); - static bool unsetBold(); + static bool setBold (bool); + static bool setBold(); + static bool unsetBold(); - static bool setDim (bool); - static bool setDim(); - static bool unsetDim(); + static bool setDim (bool); + static bool setDim(); + static bool unsetDim(); - static bool setItalic (bool); - static bool setItalic(); - static bool unsetItalic(); + static bool setItalic (bool); + static bool setItalic(); + static bool unsetItalic(); - static bool setUnderline (bool); - static bool setUnderline(); - static bool unsetUnderline(); + static bool setUnderline (bool); + static bool setUnderline(); + static bool unsetUnderline(); - static bool setBlink (bool); - static bool setBlink(); - static bool unsetBlink(); + static bool setBlink (bool); + static bool setBlink(); + static bool unsetBlink(); - static bool setReverse (bool); - static bool setReverse(); - static bool unsetReverse(); + static bool setReverse (bool); + static bool setReverse(); + static bool unsetReverse(); - static bool setStandout (bool); - static bool setStandout(); - static bool unsetStandout(); + static bool setStandout (bool); + static bool setStandout(); + static bool unsetStandout(); - static bool setInvisible (bool); - static bool setInvisible(); - static bool unsetInvisible(); + static bool setInvisible (bool); + static bool setInvisible(); + static bool unsetInvisible(); - static bool setProtected (bool); - static bool setProtected(); - static bool unsetProtected(); + static bool setProtected (bool); + static bool setProtected(); + static bool unsetProtected(); - static bool setCrossedOut (bool); - static bool setCrossedOut(); - static bool unsetCrossedOut(); + static bool setCrossedOut (bool); + static bool setCrossedOut(); + static bool unsetCrossedOut(); - static bool setDoubleUnderline (bool); - static bool setDoubleUnderline(); - static bool unsetDoubleUnderline(); + static bool setDoubleUnderline (bool); + static bool setDoubleUnderline(); + static bool unsetDoubleUnderline(); - static bool setAltCharset (bool); - static bool setAltCharset(); - static bool unsetAltCharset(); + static bool setAltCharset (bool); + static bool setAltCharset(); + static bool unsetAltCharset(); - static bool setPCcharset (bool); - static bool setPCcharset(); - static bool unsetPCcharset(); + static bool setPCcharset (bool); + static bool setPCcharset(); + static bool unsetPCcharset(); - static bool setTransparent (bool); - static bool setTransparent(); - static bool unsetTransparent(); + static bool setTransparent (bool); + static bool setTransparent(); + static bool unsetTransparent(); - static bool setTransShadow (bool); - static bool setTransShadow(); - static bool unsetTransShadow(); + static bool setTransShadow (bool); + static bool setTransShadow(); + static bool unsetTransShadow(); - static bool setInheritBackground (bool); - static bool setInheritBackground(); - static bool unsetInheritBackground(); + static bool setInheritBackground (bool); + static bool setInheritBackground(); + static bool unsetInheritBackground(); // Inquiries - static bool isBold(); - static bool isDim(); - static bool isItalic(); - static bool isUnderline(); - static bool isBlink(); - static bool isReverse(); - static bool isStandout(); - static bool isInvisible(); - static bool isProtected(); - static bool isCrossedOut(); - static bool isDoubleUnderline(); - static bool isAltCharset(); - static bool isPCcharset(); - static bool isTransparent(); - static bool isTransShadow(); - static bool isInheritBackground(); + static bool isBold(); + static bool isDim(); + static bool isItalic(); + static bool isUnderline(); + static bool isBlink(); + static bool isReverse(); + static bool isStandout(); + static bool isInvisible(); + static bool isProtected(); + static bool isCrossedOut(); + static bool isDoubleUnderline(); + static bool isAltCharset(); + static bool isPCcharset(); + static bool isTransparent(); + static bool isTransShadow(); + static bool isInheritBackground(); + static bool isMonochron(); + static bool isXTerminal(); + static bool isAnsiTerminal(); + static bool isRxvtTerminal(); + static bool isUrxvtTerminal(); + static bool isMltermTerminal(); + static bool isPuttyTerminal(); + static bool isKdeTerminal(); + static bool isGnomeTerminal(); + static bool isKtermTerminal(); + static bool isTeraTerm(); + static bool isSunTerminal(); + static bool isCygwinTerminal(); + static bool isMinttyTerm(); + static bool isLinuxTerm(); + static bool isFreeBSDTerm(); + static bool isNetBSDTerm(); + static bool isOpenBSDTerm(); + static bool isScreenTerm(); + static bool isTmuxTerm(); + static bool isNewFont(); + static bool isCursorHideable(); + static bool hasChangedTermSize(); + static bool hasUTF8(); // Methods - virtual void clearArea (int = ' '); - void createVTerm (const FRect&); - void createVTerm (int, int); - static void resizeVTerm (const FRect&); - static void resizeVTerm (int, int); - static void putVTerm(); - static void updateTerminal (terminal_update); - static void updateTerminal(); - virtual void addPreprocessingHandler ( FVTerm* - , FPreprocessingHandler ); - virtual void delPreprocessingHandler (FVTerm*); + virtual void clearArea (int = ' '); + void createVTerm (const FRect&); + void createVTerm (int, int); + void resizeVTerm (const FRect&); + void resizeVTerm (int, int); + void putVTerm(); + void updateTerminal (terminal_update); + void updateTerminal(); + virtual void addPreprocessingHandler ( FVTerm* + , FPreprocessingHandler ); + virtual void delPreprocessingHandler (FVTerm*); - int printf (const FString, ...); - int print (const FString&); - int print (term_area*, const FString&); - int print (const std::vector&); - int print (term_area*, const std::vector&); - int print (int); - int print (term_area*, int); - int print (charData&); - int print (term_area*, charData&); - FVTerm& print(); + int printf (const FString, ...); + int print (const FString&); + int print (term_area*, const FString&); + int print (const std::vector&); + int print (term_area*, const std::vector&); + int print (int); + int print (term_area*, int); + int print (charData&); + int print (term_area*, charData&); + FVTerm& print(); + static void beep(); protected: // Enumeration @@ -260,98 +291,121 @@ class FVTerm : public FTerm }; // Accessor - virtual term_area* getPrintArea(); + virtual term_area* getPrintArea(); + std::size_t getLineNumber(); + std::size_t getColumnNumber(); + static bool charEncodable (uInt); + static FKeyboard* getKeyboard(); + static FMouseControl* getMouseControl(); + FTerm::initializationValues& getInitValues(); + + // Mutators + static void setInsertCursor (bool on); + static void setInsertCursor(); + static void unsetInsertCursor(); + static bool setUTF8 (bool); + static bool setUTF8(); + static bool unsetUTF8(); // Inquiries - bool hasPrintArea() const; - bool hasChildPrintArea() const; - bool isVirtualWindow() const; + bool hasPrintArea() const; + bool hasChildPrintArea() const; + bool isVirtualWindow() const; + static bool hasHalfBlockCharacter(); + static bool hasShadowCharacter(); // Methods - void createArea ( const FRect& - , const FPoint& - , term_area*& ); + void createArea ( const FRect& + , const FPoint& + , term_area*& ); - void createArea ( int, int, int, int - , int, int - , term_area*& ); + void createArea ( int, int, int, int + , int, int + , term_area*& ); - static void resizeArea ( const FRect& - , const FPoint& + void resizeArea ( const FRect& + , const FPoint& + , term_area* ); + + void resizeArea ( int, int, int, int + , int, int + , term_area* ); + + static void removeArea (term_area*&); + static void restoreVTerm (const FRect&); + static void restoreVTerm (int, int, int, int); + void setTextToDefault (term_area*, int, int); + static bool reallocateTextArea ( term_area* + , std::size_t + , std::size_t ); + static bool reallocateTextArea ( term_area* + , std::size_t ); + + static covered_state isCovered ( const FPoint& , term_area* ); - static void resizeArea ( int, int, int, int - , int, int + static covered_state isCovered ( int, int , term_area* ); - static void removeArea (term_area*&); - static void restoreVTerm (const FRect&); - static void restoreVTerm (int, int, int, int); - static void setTextToDefault (term_area*, int, int); - static bool reallocateTextArea ( term_area* - , std::size_t - , std::size_t ); - static bool reallocateTextArea ( term_area* - , std::size_t ); - - static covered_state isCovered ( const FPoint& - , term_area* ); - - static covered_state isCovered ( int, int - , term_area* ); - - static void updateOverlappedColor ( term_area* + static void updateOverlappedColor ( term_area* + , int, int, int, int ); + static void updateOverlappedCharacter (term_area*, int, int); + static void updateShadedCharacter ( term_area* + , int, int, int, int ); + static void updateInheritBackground ( term_area* + , int, int, int, int ); + static void updateCharacter ( term_area* + , int, int, int, int ); + static bool updateVTermCharacter ( term_area* , int, int, int, int ); - static void updateOverlappedCharacter (term_area*, int, int); - static void updateShadedCharacter ( term_area* - , int, int, int, int ); - static void updateInheritBackground ( term_area* - , int, int, int, int ); - static void updateCharacter ( term_area* - , int, int, int, int ); - static bool updateVTermCharacter ( term_area* - , int, int, int, int ); - static void callPreprocessingHandler (term_area*); - static void updateVTerm(); - static void updateVTerm (term_area*); - static bool updateVTermCursor (term_area*); - static bool isInsideArea (int, int, term_area*); + static void callPreprocessingHandler (term_area*); + void updateVTerm(); + void updateVTerm (term_area*); + bool updateVTermCursor (term_area*); + static bool isInsideArea (int, int, term_area*); - static void setAreaCursor ( const FPoint& - , bool, term_area* ); + static void setAreaCursor ( const FPoint& + , bool, term_area* ); - static void setAreaCursor ( int, int - , bool, term_area*); + static void setAreaCursor ( int, int + , bool, term_area*); - static void getArea (const FPoint&, term_area*); - static void getArea (int, int, term_area*); - static void getArea (const FRect&, term_area*); - static void getArea (int, int, int, int, term_area*); - static void putArea (const FPoint&, term_area*); - static void putArea (int, int, term_area*); - static void scrollAreaForward (term_area*); - static void scrollAreaReverse (term_area*); - static void clearArea (term_area*, int = ' '); + static void getArea (const FPoint&, term_area*); + static void getArea (int, int, term_area*); + static void getArea (const FRect&, term_area*); + static void getArea (int, int, int, int, term_area*); + static void putArea (const FPoint&, term_area*); + static void putArea (int, int, term_area*); + void scrollAreaForward (term_area*); + void scrollAreaReverse (term_area*); + void clearArea (term_area*, int = ' '); - static charData generateCharacter (const FPoint&); - static charData generateCharacter (int, int); + static charData generateCharacter (const FPoint&); + static charData generateCharacter (int, int); - static charData getCharacter ( character_type - , const FPoint& - , FVTerm* ); + static charData getCharacter ( character_type + , const FPoint& + , FVTerm* ); - static charData getCharacter ( character_type - , int - , int, FVTerm* ); + static charData getCharacter ( character_type + , int + , int, FVTerm* ); - static charData getCoveredCharacter (const FPoint&, FVTerm*); - static charData getCoveredCharacter (int, int, FVTerm*); - static charData getOverlappedCharacter (const FPoint&, FVTerm*); - static charData getOverlappedCharacter (int, int, FVTerm*); - static void processTerminalUpdate(); - static void startTerminalUpdate(); - static void finishTerminalUpdate(); - static void flush_out(); + static charData getCoveredCharacter (const FPoint&, FVTerm*); + static charData getCoveredCharacter (int, int, FVTerm*); + static charData getOverlappedCharacter (const FPoint&, FVTerm*); + static charData getOverlappedCharacter (int, int, FVTerm*); + void processTerminalUpdate(); + static void startTerminalUpdate(); + static void finishTerminalUpdate(); + static void flush_out(); + static void initScreenSettings(); + static void changeTermSizeFinished(); + static void exitWithMessage (const FString&) + #if defined(__clang__) || defined(__GNUC__) + __attribute__((noreturn)) + #endif + ; // Data Members static term_area* vterm; // virtual terminal @@ -383,49 +437,50 @@ class FVTerm : public FTerm FVTerm& operator = (const FVTerm&); // Mutators - void setPrintArea (term_area*); + void setPrintArea (term_area*); // Methods - void init(); - static void init_characterLengths (FOptiMove*); - void finish(); - static void putAreaLine (charData*, charData*, int); - static void putAreaCharacter ( int, int, FVTerm* - , charData*, charData* ); - static void getAreaCharacter ( int, int, term_area* - , charData*& ); - static bool clearTerm (int = ' '); - static bool clearFullArea (term_area*, charData&); - static void clearAreaWithShadow (term_area*, charData&); - static bool canClearToEOL (uInt, uInt); - static bool canClearLeadingWS (uInt&, uInt); - static bool canClearTrailingWS (uInt&, uInt); - static bool skipUnchangedCharacters (uInt&, uInt, uInt); - static void printRange (uInt, uInt, uInt, bool); - static exit_state eraseCharacters (uInt&, uInt, uInt, bool); - static exit_state repeatCharacter (uInt&, uInt, uInt); - static void cursorWrap(); - bool printWrap (term_area*); - static void updateTerminalLine (uInt); - static bool updateTerminalCursor(); - static bool isInsideTerminal (int, int); - static void markAsPrinted (uInt, uInt); - static void markAsPrinted (uInt, uInt, uInt); - static void newFontChanges (charData*&); - static void charsetChanges (charData*&); - static void appendCharacter (charData*&); - static void appendChar (charData*&); - static void appendAttributes (charData*&); - static int appendLowerRight (charData*&); - static void appendOutputBuffer (const std::string&); - static void appendOutputBuffer (const char[]); + void init (bool); + static void init_characterLengths (FOptiMove*); + void finish(); + static void putAreaLine (charData*, charData*, int); + static void putAreaCharacter ( int, int, FVTerm* + , charData*, charData* ); + static void getAreaCharacter ( int, int, term_area* + , charData*& ); + bool clearTerm (int = ' '); + bool clearFullArea (term_area*, charData&); + static void clearAreaWithShadow (term_area*, charData&); + static bool canClearToEOL (uInt, uInt); + static bool canClearLeadingWS (uInt&, uInt); + static bool canClearTrailingWS (uInt&, uInt); + bool skipUnchangedCharacters (uInt&, uInt, uInt); + void printRange (uInt, uInt, uInt, bool); + exit_state eraseCharacters (uInt&, uInt, uInt, bool); + exit_state repeatCharacter (uInt&, uInt, uInt); + static void cursorWrap(); + bool printWrap (term_area*); + void updateTerminalLine (uInt); + bool updateTerminalCursor(); + bool isInsideTerminal (int, int); + static void markAsPrinted (uInt, uInt); + static void markAsPrinted (uInt, uInt, uInt); + static void newFontChanges (charData*&); + static void charsetChanges (charData*&); + void appendCharacter (charData*&); + void appendChar (charData*&); + void appendAttributes (charData*&); + int appendLowerRight (charData*&); + static void appendOutputBuffer (const std::string&); + static void appendOutputBuffer (const char[]); #if defined(__sun) && defined(__SVR4) - static int appendOutputBuffer (char); + static int appendOutputBuffer (char); #endif - static int appendOutputBuffer (int); + static int appendOutputBuffer (int); // Data Members + static FTerm* fterm; static std::queue* output_buffer; static charData term_attribute; static charData next_attribute; @@ -547,6 +602,30 @@ inline FVTerm::term_area* FVTerm::getVWin() const inline FVTerm::charData FVTerm::getAttribute() { return next_attribute; } +//---------------------------------------------------------------------- +inline int FVTerm::getMaxColor() +{ return fterm->getMaxColor(); } + +//---------------------------------------------------------------------- +inline int FVTerm::getTabstop() +{ return fterm->getTabstop(); } + +//---------------------------------------------------------------------- +inline fc::encoding FVTerm::getEncoding() +{ return fterm->getEncoding(); } + +//---------------------------------------------------------------------- +inline std::string FVTerm::getEncodingString() +{ return fterm->getEncodingString(); } + +//---------------------------------------------------------------------- +inline const FString FVTerm::getKeyName (int keynum) +{ return fterm->getKeyName(keynum); } + +//---------------------------------------------------------------------- +inline FTerm& FVTerm::getFTerm() +{ return *fterm; } + //---------------------------------------------------------------------- inline void FVTerm::hideCursor() { return hideCursor(true); } @@ -834,10 +913,158 @@ inline bool FVTerm::isTransShadow() inline bool FVTerm::isInheritBackground() { return next_attribute.attr.bit.inherit_bg; } +//---------------------------------------------------------------------- +inline bool FVTerm::isMonochron() +{ return fterm->isMonochron(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isXTerminal() +{ return fterm->isXTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isAnsiTerminal() +{ return fterm->isAnsiTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isRxvtTerminal() +{ return fterm->isRxvtTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isUrxvtTerminal() +{ return fterm->isUrxvtTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isMltermTerminal() +{ return fterm->isMltermTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isPuttyTerminal() +{ return fterm->isPuttyTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isKdeTerminal() +{ return fterm->isKdeTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isGnomeTerminal() +{ return fterm->isGnomeTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isKtermTerminal() +{ return fterm->isKtermTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isTeraTerm() +{ return fterm->isTeraTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isSunTerminal() +{ return fterm->isSunTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isCygwinTerminal() +{ return fterm->isCygwinTerminal(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isMinttyTerm() +{ return fterm->isMinttyTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isLinuxTerm() +{ return fterm->isLinuxTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isFreeBSDTerm() +{ return fterm->isFreeBSDTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isNetBSDTerm() +{ return fterm->isNetBSDTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isOpenBSDTerm() +{ return fterm->isOpenBSDTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isScreenTerm() +{ return fterm->isScreenTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isTmuxTerm() +{ return fterm->isTmuxTerm(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isNewFont() +{ return fterm->isNewFont(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::isCursorHideable() +{ return fterm->isCursorHideable(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::hasChangedTermSize() +{ return fterm->hasChangedTermSize(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::hasUTF8() +{ return fterm->hasUTF8(); } + //---------------------------------------------------------------------- inline FVTerm& FVTerm::print() { return *this; } +//---------------------------------------------------------------------- +inline void FVTerm::beep() +{ return fterm->beep(); } + +//---------------------------------------------------------------------- +inline std::size_t FVTerm::getLineNumber() +{ return fterm->getLineNumber(); } + +//---------------------------------------------------------------------- +inline std::size_t FVTerm::getColumnNumber() +{ return fterm->getColumnNumber(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::charEncodable (uInt c) +{ return fterm->charEncodable(c); } + +//---------------------------------------------------------------------- +inline FKeyboard* FVTerm::getKeyboard() +{ return fterm->getKeyboard(); } + +//---------------------------------------------------------------------- +inline FMouseControl* FVTerm::getMouseControl() +{ return fterm->getMouseControl(); } + +//---------------------------------------------------------------------- +inline FTerm::initializationValues& FVTerm::getInitValues() +{ return fterm->getInitValues(); } + +//---------------------------------------------------------------------- +inline void FVTerm::setInsertCursor (bool on) +{ return fterm->setInsertCursor(on); } + +//---------------------------------------------------------------------- +inline void FVTerm::setInsertCursor() +{ return fterm->setInsertCursor(true); } + +//---------------------------------------------------------------------- +inline void FVTerm::unsetInsertCursor() +{ return fterm->setInsertCursor(false); } + +//---------------------------------------------------------------------- +inline bool FVTerm::setUTF8 (bool on) +{ return fterm->setUTF8(on); } + +//---------------------------------------------------------------------- +inline bool FVTerm::setUTF8() +{ return fterm->setUTF8(true); } + +//---------------------------------------------------------------------- +inline bool FVTerm::unsetUTF8() +{ return fterm->setUTF8(false); } + //---------------------------------------------------------------------- inline bool FVTerm::hasPrintArea() const { return print_area; } @@ -850,6 +1077,26 @@ inline bool FVTerm::hasChildPrintArea() const inline bool FVTerm::isVirtualWindow() const { return vwin; } +//---------------------------------------------------------------------- +inline bool FVTerm::hasHalfBlockCharacter() +{ return fterm->hasHalfBlockCharacter(); } + +//---------------------------------------------------------------------- +inline bool FVTerm::hasShadowCharacter() +{ return fterm->hasShadowCharacter(); } + +//---------------------------------------------------------------------- +inline void FVTerm::initScreenSettings() +{ fterm->initScreenSettings(); } + +//---------------------------------------------------------------------- +inline void FVTerm::changeTermSizeFinished() +{ fterm->changeTermSizeFinished(); } + +//---------------------------------------------------------------------- +inline void FVTerm::exitWithMessage (const FString& message) +{ fterm->exitWithMessage(message); } + //---------------------------------------------------------------------- inline void FVTerm::setPrintArea (term_area* area) { print_area = area; } diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index d82a836a..5639fc51 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -149,7 +149,7 @@ class FWindow : public FWidget static bool lowerWindow (FWidget*); bool lowerWindow (); bool zoomWindow (); - static void switchToPrevWindow(); + static void switchToPrevWindow (FWidget*); static bool activatePrevWindow(); virtual void setShadowSize (int, int); From c96af1d3a222c6e7d5ced8712bd559c768a230f6 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 01:06:11 +0100 Subject: [PATCH 06/33] Fix FString unit test --- test/fstring-test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index 11e46b01..a61f5ee4 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -178,12 +178,12 @@ void FStringTest::noArgumentTest() CPPUNIT_ASSERT ( wcstr == 0 ); std::string str = empty.toString(); CPPUNIT_ASSERT ( str.length() == 0 ); - CPPUNIT_ASSERT ( str.capacity() == 15 ); CPPUNIT_ASSERT ( str.size() == 0 ); CPPUNIT_ASSERT ( str.empty() ); const finalcut::FString fstr = str; CPPUNIT_ASSERT ( fstr.isNull() ); CPPUNIT_ASSERT ( fstr.isEmpty() ); + CPPUNIT_ASSERT ( fstr.capacity() == 0 ); cstr = 0; CPPUNIT_ASSERT ( empty == cstr ); From 7a2abc9421fab41c2cec31bbd2404928fe5575a3 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 02:59:41 +0100 Subject: [PATCH 07/33] Fix FListBox prevListItem() --- ChangeLog | 1 + src/flistbox.cpp | 6 +++--- src/fvterm.cpp | 4 +++- src/include/final/fvterm.h | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0fcca97d..e33d4065 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2018-10-29 Markus Gans * FTerm is now a data member of FVTerm + * Fix FListBox prevListItem() 2018-10-26 Markus Gans * Building Fix for a negative value check (gcc < 4.8) diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 9cca9f6d..3baa61c5 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -1532,10 +1532,10 @@ void FListBox::prevListItem (int distance) if ( current == 1 ) return; - current -= std::size_t(distance); - - if ( current < 1 ) + if ( current < std::size_t(distance) ) current = 1; + else + current -= std::size_t(distance); if ( current <= std::size_t(yoffset) ) { diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 18db2cd1..29fb80b8 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -1951,7 +1951,9 @@ void FVTerm::flush_out() { while ( ! output_buffer->empty() ) { - fterm->Fputchar (output_buffer->front()); + if ( fterm ) + fterm->Fputchar(output_buffer->front()); + output_buffer->pop(); } diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index b1a006cf..9f9ede2a 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -143,9 +143,9 @@ class FVTerm // Mutators void setTermXY (int, int); - static void hideCursor (bool); - static void hideCursor(); - static void showCursor(); + void hideCursor (bool); + void hideCursor(); + void showCursor(); void setPrintCursor (const FPoint&); void setPrintCursor (int, int); void setColor (short, short); From ce9d05ec7beb9ca4280b79e7252425cdb2f9c7f1 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 19:10:42 +0100 Subject: [PATCH 08/33] Fix FListBox prevListItem() + nextListItem() --- src/flistbox.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 3baa61c5..83bae776 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -1532,17 +1532,17 @@ void FListBox::prevListItem (int distance) if ( current == 1 ) return; - if ( current < std::size_t(distance) ) + if ( current <= std::size_t(distance) ) current = 1; else current -= std::size_t(distance); if ( current <= std::size_t(yoffset) ) { - yoffset -= distance; - - if ( yoffset < 0 ) + if ( yoffset < distance ) yoffset = 0; + else + yoffset -= distance; } } @@ -1555,17 +1555,17 @@ void FListBox::nextListItem (int distance) if ( current == element_count ) return; - current += std::size_t(distance); - - if ( current > element_count ) + if ( current + std::size_t(distance) > element_count ) current = element_count; + else + current += std::size_t(distance); if ( current - std::size_t(yoffset) > getClientHeight() ) { - yoffset += distance; - - if ( yoffset > yoffset_end ) + if ( yoffset > yoffset_end - distance ) yoffset = yoffset_end; + else + yoffset += distance; } } //---------------------------------------------------------------------- From d35c3c0cdc42d7f01522ec9fb76da111ece0719a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 21:12:03 +0100 Subject: [PATCH 09/33] Setting the value can_change_color_palette in FTermcapQuirks --- ChangeLog | 1 + examples/termcap.cpp | 2 ++ src/ftermcapquirks.cpp | 4 ++++ test/ftermcapquirks-test.cpp | 15 +++++++++++++++ 4 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index e33d4065..fa7ac580 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2018-10-29 Markus Gans * FTerm is now a data member of FVTerm * Fix FListBox prevListItem() + * Setting the value can_change_color_palette in FTermcapQuirks 2018-10-26 Markus Gans * Building Fix for a negative value check (gcc < 4.8) diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 81b71ea7..665a56d7 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -261,6 +261,8 @@ void booleans() std::cout << "\r\n[Booleans]\r\n"; tcapBoolean ( "background_color_erase" , finalcut::FTermcap::background_color_erase ); + tcapBoolean ( "can_change_color_palette" + , finalcut::FTermcap::can_change_color_palette ); tcapBoolean ( "automatic_left_margin" , finalcut::FTermcap::automatic_left_margin ); tcapBoolean ( "automatic_right_margin" diff --git a/src/ftermcapquirks.cpp b/src/ftermcapquirks.cpp index 7cba5aa1..5ea603f8 100644 --- a/src/ftermcapquirks.cpp +++ b/src/ftermcapquirks.cpp @@ -228,6 +228,7 @@ void FTermcapQuirks::xterm() // Fallback if "Ic" is not found if ( ! TCAP(fc::t_initialize_color) ) { + FTermcap::can_change_color_palette = true; TCAP(fc::t_initialize_color) = \ C_STR(OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" @@ -397,6 +398,8 @@ void FTermcapQuirks::screen() // Fallback if "Ic" is not found if ( ! TCAP(fc::t_initialize_color) ) { + FTermcap::can_change_color_palette = true; + if ( term_detection->isTmuxTerm() ) { TCAP(fc::t_initialize_color) = \ @@ -440,6 +443,7 @@ void FTermcapQuirks::general() // Fallback if "Ic" is not found if ( ! TCAP(fc::t_initialize_color) ) { + FTermcap::can_change_color_palette = true; TCAP(fc::t_initialize_color) = \ C_STR(OSC "P%p1%x" "%p2%{255}%*%{1000}%/%02x" diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp index b75e6bfb..090b7a84 100644 --- a/test/ftermcapquirks-test.cpp +++ b/test/ftermcapquirks-test.cpp @@ -236,6 +236,7 @@ void FTermcapQuirksTest::generalTest() finalcut::FTermData data; finalcut::FTermcap::tabstop = -1; finalcut::FTermcap::attr_without_color = -1; + finalcut::FTermcap::can_change_color_palette = false; finalcut::FTermcapQuirks quirks; finalcut::FTermDetection detect; quirks.setTermData(&data); @@ -244,6 +245,7 @@ void FTermcapQuirksTest::generalTest() CPPUNIT_ASSERT ( finalcut::FTermcap::tabstop == 8 ); CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); + CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "3%p1%dm") ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string @@ -301,12 +303,14 @@ void FTermcapQuirksTest::xtermTest() finalcut::FTermData data; finalcut::FTermcapQuirks quirks; finalcut::FTermDetection detect; + finalcut::FTermcap::can_change_color_palette = false; detect.setXTerminal (true); data.setTermType ("xterm"); quirks.setTermData(&data); quirks.setFTermDetection (&detect); quirks.terminalFixup(); + CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" @@ -540,6 +544,7 @@ void FTermcapQuirksTest::puttyTest() finalcut::FTermData data; finalcut::FTermcap::background_color_erase = false; + finalcut::FTermcap::can_change_color_palette = false; finalcut::FTermcap::osc_support = false; finalcut::FTermcap::attr_without_color = -1; finalcut::FTermcapQuirks quirks; @@ -553,6 +558,12 @@ void FTermcapQuirksTest::puttyTest() CPPUNIT_ASSERT ( finalcut::FTermcap::background_color_erase == true ); CPPUNIT_ASSERT ( finalcut::FTermcap::osc_support == true ); CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); + CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string + , C_STR(OSC "P%p1%x" + "%p2%{255}%*%{1000}%/%02x" + "%p3%{255}%*%{1000}%/%02x" + "%p4%{255}%*%{1000}%/%02x") ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "%?%p1%{8}%<" "%t3%p1%d" @@ -676,12 +687,14 @@ void FTermcapQuirksTest::screenTest() finalcut::FTermData data; finalcut::FTermcapQuirks quirks; finalcut::FTermDetection detect; + finalcut::FTermcap::can_change_color_palette = false; detect.setScreenTerm (true); data.setTermType ("screen-256color"); quirks.setTermData(&data); quirks.setFTermDetection (&detect); quirks.terminalFixup(); + CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(ESC "P" OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" @@ -690,8 +703,10 @@ void FTermcapQuirksTest::screenTest() detect.setTmuxTerm (true); caps[finalcut::fc::t_initialize_color].string = 0; + finalcut::FTermcap::can_change_color_palette = false; quirks.terminalFixup(); + CPPUNIT_ASSERT ( finalcut::FTermcap::can_change_color_palette ); CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(ESC "Ptmux;" ESC OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" From 4d428040591e879f0886260d91892389d986bb47 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 23:10:48 +0100 Subject: [PATCH 10/33] Don't print empty streams --- src/include/final/fvterm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 9f9ede2a..ea2ff053 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -570,7 +570,10 @@ inline FVTerm& FVTerm::operator << (const type& s) { std::wostringstream outstream; outstream << s; - print (outstream.str()); + + if ( ! outstream.str().empty() ) + print (outstream.str()); + return *this; } From c1b304e42907a4a919db57280f2b2c7a759d8f2a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 29 Oct 2018 23:57:35 +0100 Subject: [PATCH 11/33] Looser coupling between examples and FTerm --- examples/opti-move.cpp | 6 +- examples/ui.cpp | 4 +- src/fvterm.cpp | 36 ++++++----- src/include/final/fvterm.h | 120 ++++++++++++++++++++++--------------- 4 files changed, 95 insertions(+), 71 deletions(-) diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index a0f72bf2..208c317c 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -111,7 +111,7 @@ void move (int xold, int yold, int xnew, int ynew) << std::left << std::setw(10) << to << " "; // get the move string - buffer = terminal->getFTerm().moveCursor (xold, yold, xnew, ynew); + buffer = terminal->moveCursor (xold, yold, xnew, ynew); len = uInt(std::strlen(buffer)); for (uInt i = 0; i < len; i++) @@ -164,7 +164,7 @@ int main (int argc, char* argv[]) TermApp.clearArea(); // Show the determined terminal name and text resolution - std::cout << "Terminal: " << TermApp.getFTerm().getTermType() << "\r\n"; + std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; std::cout << " Columns: 0.." << xmax << "\r\n"; std::cout << " Lines: 0.." << ymax << "\r\n"; @@ -197,7 +197,7 @@ int main (int argc, char* argv[]) // Show terminal speed and milliseconds for all cursor movement sequence std::cout << "\r" << line; - TermApp.getFTerm().printMoveDurations(); + TermApp.printMoveDurations(); // Waiting for keypress keyPressed(); diff --git a/examples/ui.cpp b/examples/ui.cpp index fad7bb6f..73eae1e9 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -1048,8 +1048,8 @@ int main (int argc, char* argv[]) // Create the application object app finalcut::FApplication app(argc, argv); - app.getFTerm().redefineDefaultColors(true); - app.getFTerm().setTermTitle (title); + app.redefineDefaultColors(true); + app.setTermTitle (title); // Force vt100 encoding //app.getFTerm().setEncoding(finalcut::fc::VT100); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 29fb80b8..e75beb9b 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -129,7 +129,7 @@ void FVTerm::setTermXY (int x, int y) term_x = term_pos->getX(); term_y = term_pos->getY(); - move_str = fterm->moveCursor (term_x, term_y, x, y); + move_str = FTerm::moveCursor (term_x, term_y, x, y); if ( move_str ) appendOutputBuffer(move_str); @@ -143,7 +143,7 @@ void FVTerm::hideCursor (bool on) { // Hides or shows the input cursor on the terminal - char* visibility_str = fterm->cursorsVisibility (on); + char* visibility_str = FTerm::cursorsVisibility (on); if ( visibility_str ) appendOutputBuffer(visibility_str); @@ -1578,7 +1578,7 @@ void FVTerm::scrollAreaForward (term_area* area) if ( TCAP(fc::t_scroll_forward) ) { setTermXY (0, vdesktop->height); - fterm->scrollTermForward(); + FTerm::scrollTermForward(); putArea (1, 1, vdesktop); // avoid update lines from 0 to (y_max - 1) @@ -1639,7 +1639,7 @@ void FVTerm::scrollAreaReverse (term_area* area) if ( TCAP(fc::t_scroll_reverse) ) { setTermXY (0, 0); - fterm->scrollTermReverse(); + FTerm::scrollTermReverse(); putArea (1, 1, vdesktop); // avoid update lines from 1 to y_max @@ -1951,9 +1951,7 @@ void FVTerm::flush_out() { while ( ! output_buffer->empty() ) { - if ( fterm ) - fterm->Fputchar(output_buffer->front()); - + FTerm::Fputchar(output_buffer->front()); output_buffer->pop(); } @@ -2011,13 +2009,13 @@ void FVTerm::init (bool disable_alt_screen) active_area = vdesktop; // Initialize keyboard - keyboard = fterm->getKeyboard(); + keyboard = FTerm::getKeyboard(); // Hide the input cursor hideCursor(); // Initialize character lengths - init_characterLengths (fterm->getFOptiMove()); + init_characterLengths (FTerm::getFOptiMove()); } //---------------------------------------------------------------------- @@ -2050,7 +2048,7 @@ void FVTerm::finish() // Clear the terminal setNormal(); - if ( fterm->hasAlternateScreen() ) + if ( FTerm::hasAlternateScreen() ) clearTerm(); flush_out(); @@ -2170,7 +2168,7 @@ bool FVTerm::clearTerm (int fillchar) char*& cb = TCAP(fc::t_clr_eol); bool ut = FTermcap::background_color_erase; charData* next = &next_attribute; - bool normal = fterm->isNormal(next); + bool normal = FTerm::isNormal(next); appendAttributes(next); if ( ! ( (cl || cd || cb) && (normal || ut) ) @@ -2275,7 +2273,7 @@ bool FVTerm::canClearToEOL (uInt xmin, uInt y) if ( ce && min_char->code == ' ' ) { uInt beginning_whitespace = 1; - bool normal = fterm->isNormal(min_char); + bool normal = FTerm::isNormal(min_char); bool& ut = FTermcap::background_color_erase; for (uInt x = xmin + 1; x < uInt(vt->width); x++) @@ -2310,7 +2308,7 @@ bool FVTerm::canClearLeadingWS (uInt& xmin, uInt y) if ( cb && first_char->code == ' ' ) { uInt leading_whitespace = 1; - bool normal = fterm->isNormal(first_char); + bool normal = FTerm::isNormal(first_char); bool& ut = FTermcap::background_color_erase; for (uInt x = 1; x < uInt(vt->width); x++) @@ -2348,7 +2346,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y) if ( ce && last_char->code == ' ' ) { uInt trailing_whitespace = 1; - bool normal = fterm->isNormal(last_char); + bool normal = FTerm::isNormal(last_char); bool& ut = FTermcap::background_color_erase; for (uInt x = uInt(vt->width) - 1; x > 0 ; x--) @@ -2459,7 +2457,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y return not_used; uInt whitespace = 1; - bool normal = fterm->isNormal(print_char); + bool normal = FTerm::isNormal(print_char); for (uInt i = x + 1; i <= xmax; i++) { @@ -2783,14 +2781,14 @@ inline void FVTerm::charsetChanges (charData*& next_char) return; uInt code = uInt(next_char->code); - uInt ch_enc = fterm->charEncode(code); + uInt ch_enc = FTerm::charEncode(code); if ( ch_enc == code ) return; if ( ch_enc == 0 ) { - next_char->code = int(fterm->charEncode(code, fc::ASCII)); + next_char->code = int(FTerm::charEncode(code, fc::ASCII)); return; } @@ -2808,7 +2806,7 @@ inline void FVTerm::charsetChanges (charData*& next_char) if ( isXTerminal() && ch_enc < 0x20 ) // Character 0x00..0x1f { if ( hasUTF8() ) - next_char->code = int(fterm->charEncode(code, fc::ASCII)); + next_char->code = int(FTerm::charEncode(code, fc::ASCII)); else { next_char->code += 0x5f; @@ -2850,7 +2848,7 @@ inline void FVTerm::appendAttributes (charData*& next_attr) charData* term_attr = &term_attribute; // generate attribute string for the next character - attr_str = fterm->changeAttribute (term_attr, next_attr); + attr_str = FTerm::changeAttribute (term_attr, next_attr); if ( attr_str ) appendOutputBuffer (attr_str); diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index ea2ff053..75afa247 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -139,6 +139,7 @@ class FVTerm static fc::encoding getEncoding(); static std::string getEncodingString(); static const FString getKeyName (int); + static char* getTermType(); FTerm& getFTerm(); // Mutators @@ -215,6 +216,8 @@ class FVTerm static bool setInheritBackground(); static bool unsetInheritBackground(); + static void setTermTitle (const FString&); + // Inquiries static bool isBold(); static bool isDim(); @@ -281,6 +284,9 @@ class FVTerm int print (term_area*, charData&); FVTerm& print(); static void beep(); + static void redefineDefaultColors (bool); + static char* moveCursor (int, int, int, int); + static void printMoveDurations(); protected: // Enumeration @@ -607,23 +613,27 @@ inline FVTerm::charData FVTerm::getAttribute() //---------------------------------------------------------------------- inline int FVTerm::getMaxColor() -{ return fterm->getMaxColor(); } +{ return FTerm::getMaxColor(); } //---------------------------------------------------------------------- inline int FVTerm::getTabstop() -{ return fterm->getTabstop(); } +{ return FTerm::getTabstop(); } //---------------------------------------------------------------------- inline fc::encoding FVTerm::getEncoding() -{ return fterm->getEncoding(); } +{ return FTerm::getEncoding(); } //---------------------------------------------------------------------- inline std::string FVTerm::getEncodingString() -{ return fterm->getEncodingString(); } +{ return FTerm::getEncodingString(); } //---------------------------------------------------------------------- inline const FString FVTerm::getKeyName (int keynum) -{ return fterm->getKeyName(keynum); } +{ return FTerm::getKeyName(keynum); } + +//---------------------------------------------------------------------- +inline char* FVTerm::getTermType() +{ return FTerm::getTermType(); } //---------------------------------------------------------------------- inline FTerm& FVTerm::getFTerm() @@ -852,6 +862,10 @@ inline bool FVTerm::setInheritBackground() inline bool FVTerm::unsetInheritBackground() { return setInheritBackground(false); } +//---------------------------------------------------------------------- +inline void FVTerm::setTermTitle (const FString& title) +{ FTerm::setTermTitle(title); } + //---------------------------------------------------------------------- inline bool FVTerm::isBold() { return next_attribute.attr.bit.bold; } @@ -918,99 +932,99 @@ inline bool FVTerm::isInheritBackground() //---------------------------------------------------------------------- inline bool FVTerm::isMonochron() -{ return fterm->isMonochron(); } +{ return FTerm::isMonochron(); } //---------------------------------------------------------------------- inline bool FVTerm::isXTerminal() -{ return fterm->isXTerminal(); } +{ return FTerm::isXTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isAnsiTerminal() -{ return fterm->isAnsiTerminal(); } +{ return FTerm::isAnsiTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isRxvtTerminal() -{ return fterm->isRxvtTerminal(); } +{ return FTerm::isRxvtTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isUrxvtTerminal() -{ return fterm->isUrxvtTerminal(); } +{ return FTerm::isUrxvtTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isMltermTerminal() -{ return fterm->isMltermTerminal(); } +{ return FTerm::isMltermTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isPuttyTerminal() -{ return fterm->isPuttyTerminal(); } +{ return FTerm::isPuttyTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isKdeTerminal() -{ return fterm->isKdeTerminal(); } +{ return FTerm::isKdeTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isGnomeTerminal() -{ return fterm->isGnomeTerminal(); } +{ return FTerm::isGnomeTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isKtermTerminal() -{ return fterm->isKtermTerminal(); } +{ return FTerm::isKtermTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isTeraTerm() -{ return fterm->isTeraTerm(); } +{ return FTerm::isTeraTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isSunTerminal() -{ return fterm->isSunTerminal(); } +{ return FTerm::isSunTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isCygwinTerminal() -{ return fterm->isCygwinTerminal(); } +{ return FTerm::isCygwinTerminal(); } //---------------------------------------------------------------------- inline bool FVTerm::isMinttyTerm() -{ return fterm->isMinttyTerm(); } +{ return FTerm::isMinttyTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isLinuxTerm() -{ return fterm->isLinuxTerm(); } +{ return FTerm::isLinuxTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isFreeBSDTerm() -{ return fterm->isFreeBSDTerm(); } +{ return FTerm::isFreeBSDTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isNetBSDTerm() -{ return fterm->isNetBSDTerm(); } +{ return FTerm::isNetBSDTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isOpenBSDTerm() -{ return fterm->isOpenBSDTerm(); } +{ return FTerm::isOpenBSDTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isScreenTerm() -{ return fterm->isScreenTerm(); } +{ return FTerm::isScreenTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isTmuxTerm() -{ return fterm->isTmuxTerm(); } +{ return FTerm::isTmuxTerm(); } //---------------------------------------------------------------------- inline bool FVTerm::isNewFont() -{ return fterm->isNewFont(); } +{ return FTerm::isNewFont(); } //---------------------------------------------------------------------- inline bool FVTerm::isCursorHideable() -{ return fterm->isCursorHideable(); } +{ return FTerm::isCursorHideable(); } //---------------------------------------------------------------------- inline bool FVTerm::hasChangedTermSize() -{ return fterm->hasChangedTermSize(); } +{ return FTerm::hasChangedTermSize(); } //---------------------------------------------------------------------- inline bool FVTerm::hasUTF8() -{ return fterm->hasUTF8(); } +{ return FTerm::hasUTF8(); } //---------------------------------------------------------------------- inline FVTerm& FVTerm::print() @@ -1018,55 +1032,67 @@ inline FVTerm& FVTerm::print() //---------------------------------------------------------------------- inline void FVTerm::beep() -{ return fterm->beep(); } +{ FTerm::beep(); } + +//---------------------------------------------------------------------- +inline void FVTerm::redefineDefaultColors (bool on) +{ FTerm::redefineDefaultColors(on); } + +//---------------------------------------------------------------------- +inline char* FVTerm::moveCursor (int xold, int yold, int xnew, int ynew) +{ return FTerm::moveCursor (xold, yold, xnew, ynew); } + +//---------------------------------------------------------------------- +inline void FVTerm::printMoveDurations() +{ return FTerm::printMoveDurations(); } //---------------------------------------------------------------------- inline std::size_t FVTerm::getLineNumber() -{ return fterm->getLineNumber(); } +{ return FTerm::getLineNumber(); } //---------------------------------------------------------------------- inline std::size_t FVTerm::getColumnNumber() -{ return fterm->getColumnNumber(); } +{ return FTerm::getColumnNumber(); } //---------------------------------------------------------------------- inline bool FVTerm::charEncodable (uInt c) -{ return fterm->charEncodable(c); } +{ return FTerm::charEncodable(c); } //---------------------------------------------------------------------- inline FKeyboard* FVTerm::getKeyboard() -{ return fterm->getKeyboard(); } +{ return FTerm::getKeyboard(); } //---------------------------------------------------------------------- inline FMouseControl* FVTerm::getMouseControl() -{ return fterm->getMouseControl(); } +{ return FTerm::getMouseControl(); } //---------------------------------------------------------------------- inline FTerm::initializationValues& FVTerm::getInitValues() -{ return fterm->getInitValues(); } +{ return getFTerm().getInitValues(); } //---------------------------------------------------------------------- inline void FVTerm::setInsertCursor (bool on) -{ return fterm->setInsertCursor(on); } +{ return FTerm::setInsertCursor(on); } //---------------------------------------------------------------------- inline void FVTerm::setInsertCursor() -{ return fterm->setInsertCursor(true); } +{ return FTerm::setInsertCursor(true); } //---------------------------------------------------------------------- inline void FVTerm::unsetInsertCursor() -{ return fterm->setInsertCursor(false); } +{ return FTerm::setInsertCursor(false); } //---------------------------------------------------------------------- inline bool FVTerm::setUTF8 (bool on) -{ return fterm->setUTF8(on); } +{ return FTerm::setUTF8(on); } //---------------------------------------------------------------------- inline bool FVTerm::setUTF8() -{ return fterm->setUTF8(true); } +{ return FTerm::setUTF8(true); } //---------------------------------------------------------------------- inline bool FVTerm::unsetUTF8() -{ return fterm->setUTF8(false); } +{ return FTerm::setUTF8(false); } //---------------------------------------------------------------------- inline bool FVTerm::hasPrintArea() const @@ -1082,23 +1108,23 @@ inline bool FVTerm::isVirtualWindow() const //---------------------------------------------------------------------- inline bool FVTerm::hasHalfBlockCharacter() -{ return fterm->hasHalfBlockCharacter(); } +{ return FTerm::hasHalfBlockCharacter(); } //---------------------------------------------------------------------- inline bool FVTerm::hasShadowCharacter() -{ return fterm->hasShadowCharacter(); } +{ return FTerm::hasShadowCharacter(); } //---------------------------------------------------------------------- inline void FVTerm::initScreenSettings() -{ fterm->initScreenSettings(); } +{ FTerm::initScreenSettings(); } //---------------------------------------------------------------------- inline void FVTerm::changeTermSizeFinished() -{ fterm->changeTermSizeFinished(); } +{ FTerm::changeTermSizeFinished(); } //---------------------------------------------------------------------- inline void FVTerm::exitWithMessage (const FString& message) -{ fterm->exitWithMessage(message); } +{ FTerm::exitWithMessage(message); } //---------------------------------------------------------------------- inline void FVTerm::setPrintArea (term_area* area) From 77ad698c4528ee58c7a336ab48100ee2364f2d03 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Tue, 30 Oct 2018 01:13:32 +0100 Subject: [PATCH 12/33] Looser coupling between examples and FTerm --- examples/term-attributes.cpp | 2 +- examples/termcap.cpp | 3 +-- examples/ui.cpp | 6 +++--- src/include/final/fvterm.h | 5 +++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 30a49f52..2cd7b4cc 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -74,7 +74,7 @@ AttribDlg::AttribDlg (finalcut::FWidget* parent) , back_button("< &Back", this) { setText ( "A terminal attributes test (" - + finalcut::FString(getFTerm().getTermType()) + + finalcut::FString(getTermType()) + ")"); next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1); diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 665a56d7..f82fd3a1 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -316,9 +316,8 @@ int main (int argc, char* argv[]) finalcut::FTermcap::tcap_map* tcap = 0; tcap = finalcut::FTermcap::getTermcapMap(); - finalcut::FTerm& fterm = TermApp.getFTerm(); std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; - std::cout << "Terminal: " << fterm.getTermType() << "\r\n"; + std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; debug (TermApp); diff --git a/examples/ui.cpp b/examples/ui.cpp index 73eae1e9..7566c9dd 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -836,8 +836,8 @@ void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr) ( "Environment" , finalcut::FString() - << " Type: " << getFTerm().getTermType() << "\n" - << " Name: " << getFTerm().getTermFileName() << "\n" + << " Type: " << getTermType() << "\n" + << " Name: " << getTermFileName() << "\n" << " Mode: " << getEncodingString() << "\n" << " Size: " << x << wchar_t(finalcut::fc::Times) << y << "\n" @@ -943,7 +943,7 @@ void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr) finalcut::FLineEdit* lineedit = static_cast(widget); finalcut::FString title; *lineedit >> title; - getFTerm().setTermTitle (title); + setTermTitle (title); setText (title); redraw(); } diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 75afa247..b7ebce7e 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -140,6 +140,7 @@ class FVTerm static std::string getEncodingString(); static const FString getKeyName (int); static char* getTermType(); + static char* getTermFileName(); FTerm& getFTerm(); // Mutators @@ -635,6 +636,10 @@ inline const FString FVTerm::getKeyName (int keynum) inline char* FVTerm::getTermType() { return FTerm::getTermType(); } +//---------------------------------------------------------------------- +inline char* FVTerm::getTermFileName() +{ return FTerm::getTermFileName(); } + //---------------------------------------------------------------------- inline FTerm& FVTerm::getFTerm() { return *fterm; } From 4afa9882326274649f6506c82dbc27d5ea902a88 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Thu, 1 Nov 2018 00:49:13 +0100 Subject: [PATCH 13/33] Add the file faq.md --- README.md | 3 +- debian/control | 1 + doc/faq.md | 101 ++++++++++++++++++++++++++++++++++ doc/first-steps.md | 21 ++++--- src/foptimove.cpp | 41 -------------- src/fterm.cpp | 2 +- src/include/final/foptimove.h | 47 +++++++++++++++- 7 files changed, 161 insertions(+), 55 deletions(-) create mode 100644 doc/faq.md diff --git a/README.md b/README.md index 35c47772..d8857374 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ *Class Reference:*
     [![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html) -The Final Cut is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen. +The FINAL CUT is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen. The C++ class design was inspired by the Qt framework. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on. ### Installation @@ -141,6 +141,7 @@ printf(...) Class digramm ------------- +
               1┌──────────────┐
    ┌-----------┤ FTermFreeBSD │
diff --git a/debian/control b/debian/control
index 09f656d2..2f5f266a 100644
--- a/debian/control
+++ b/debian/control
@@ -23,6 +23,7 @@ Depends:
   , ${misc:Depends}
 Suggests:
     coreutils
+  , ncurses-term
   , grep
   , sed
   , vim-common
diff --git a/doc/faq.md b/doc/faq.md
new file mode 100644
index 00000000..9ebc3626
--- /dev/null
+++ b/doc/faq.md
@@ -0,0 +1,101 @@
+
+Frequently Asked Questions
+==========================
+
+
+What is FINAL CUT?
+------------------
+
+The Final Cut is a C++ class library and a widget toolkit with full mouse 
+support for creating a text-based user interface. It's based on the Termcap
+library and has its own cursor optimization and window management.
+
+
+Are Windows and DOS supported by FINAL CUT?
+-------------------------------------------
+
+You need an operating system environment that implements a POSIX system 
+call API. This can be realized in Windows with the Cygwin project.
+
+
+Is my platform supported?
+-------------------------
+
+The supported platforms are Linux, FreeBSD, NetBSD, OpenBSD, macOS, 
+Cygwin on Microsoft Windows and Oracle Solaris
+
+
+What do I need to write my own programs with FINAL CUT?
+-------------------------------------------------------
+
+You need a C++ compiler like GCC (g++) or Clang (clang++).
+
+
+What do I need to build this library?
+-------------------------------------
+
+You need three things:
+
+1. C++ compiler like GCC (g++) or Clang (clang++).
+
+2. The GNU building tools
+
+    *For example, in a Debian-based distribution it would be 
+    the following packages:*
+
+    * autotools-dev
+    * automake
+    * autoconf
+    * autoconf-archive
+    * libtool
+
+3. Development packages for following libraries:
+
+    * C standard library
+    * C++ standard library
+    * Termcap library *(mostly part of the curses library)*
+    * General Purpose Mouse library *(optional, only if you need 
+      mouse support on the Linux console)*
+
+    *For example, in a Debian-based distribution it would be the following 
+    packages:*
+
+    * libglib2.0-dev
+    * libstdc++-6-dev
+    * libtinfo-dev
+    * libncurses5-dev
+    * libgpm-dev
+
+
+How to compile FINAL CUT without gpm support?
+---------------------------------------------
+
+```bash
+  ./configure --without-gpm
+```
+
+
+What do I need to compile the unit tests?
+-----------------------------------------
+
+You need the unit testing framework CppUnit.
+
+
+How can I fix display problems?
+-------------------------------
+
+* Make sure that the environment variable TERM has the right 
+  terminal name.
+
+* With the command "`msgcat --color=test`" you can test whether 
+  the colors are displayed correctly in the terminal
+
+* If characters are not displayed in the right place on the screen, 
+  it may help to disable cursor optimization for your program with 
+  the parameter *--no-optimized-cursor*.
+
+* If terminal detection did not work, it is useful to turn off the terminal 
+  detection with the parameter *--no-terminal-detection*.
+
+* If the color palette redefinition causes problems, you can switch off 
+  the color mapping with the parameter *--no-color-change*.
diff --git a/doc/first-steps.md b/doc/first-steps.md
index 27f8b0a8..e3870ba7 100644
--- a/doc/first-steps.md
+++ b/doc/first-steps.md
@@ -9,7 +9,7 @@ How to use the library
 At the beginning of this introduction to the Final Cut
 we will start with a small example.
 
-It creates an empty 30×10 character dialog.
+The following example creates an empty 30×10 character dialog.
 
 **File:** *dialog.cpp*
 ```cpp
@@ -49,12 +49,11 @@ All final cut programs must include the *final.h* header.
 ```cpp
 finalcut::FApplication app(argc, argv);
 ```
-In this line creates the `finalcut::FApplication` object `app` with
+This line creates the `finalcut::FApplication` object `app` with
 the command line arguments `argc` and `argv`. This object manages
 the application main event loop. It receives keyboard and mouse events
-and sends them to the target widgets. Before widgets can be created,
-an application object must be created! Only one `finalcut::FApplication`
-object should be created.
+and sends them to the target widgets. You must create an application
+object before you can create a widgets object.
 
 The next line
 ```cpp
@@ -72,16 +71,16 @@ The title bar of the dialog box gets the text "A dialog".
 ```cpp
 dialog.setGeometry (25, 5, 30, 10);
 ```
-The dialog window geometry is set to a width of 30 characters and
-a height of 10 characters. The window in the terminal is positioned
-at the positions x=25 and y=5 (note: x=1 and y=1 represents the upper
-left corner).
+The dialog window gets a width of 30 and a height of 10 characters.
+The window in the terminal is located at the positions x=25 and
+y=5 (note: x=1 and y=1 represents the upper left corner).
 
 ```cpp
 app.setMainWidget(&dialog);
 ```
-The `dialog` object is selected as the main widget for the application.
-When the user closes a main widget, the application will be closed.
+The `dialog` object was now selected as the main widget for the application.
+When you close the main widget, the entire application quits.
+
 
 ```cpp
 dialog.show();
diff --git a/src/foptimove.cpp b/src/foptimove.cpp
index d20ff575..b190797c 100644
--- a/src/foptimove.cpp
+++ b/src/foptimove.cpp
@@ -560,47 +560,6 @@ char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
     return 0;
 }
 
-//----------------------------------------------------------------------
-void FOptiMove::printDurations()
-{
-  std::cout << "            speed: "
-            << baudrate << " baud\r\n";
-  std::cout << "    char_duration: "
-            << char_duration << " ms\r\n";
-  std::cout << "      cursor_home: "
-            << F_cursor_home.duration << " ms\r\n";
-  std::cout << "     cursor_to_ll: "
-            << F_cursor_to_ll.duration << " ms\r\n";
-  std::cout << "  carriage_return: "
-            << F_carriage_return.duration << " ms\r\n";
-  std::cout << "              tab: "
-            << F_tab.duration << " ms\r\n";
-  std::cout << "         back_tab: "
-            << F_back_tab.duration << " ms\r\n";
-  std::cout << "        cursor_up: "
-            << F_cursor_up.duration << " ms\r\n";
-  std::cout << "      cursor_down: "
-            << F_cursor_down.duration << " ms\r\n";
-  std::cout << "      cursor_left: "
-            << F_cursor_left.duration << " ms\r\n";
-  std::cout << "     cursor_right: "
-            << F_cursor_right.duration << " ms\r\n";
-  std::cout << "   cursor_address: "
-            << F_cursor_address.duration << " ms\r\n";
-  std::cout << "   column_address: "
-            << F_column_address.duration << " ms\r\n";
-  std::cout << "      row_address: "
-            << F_row_address.duration << " ms\r\n";
-  std::cout << "   parm_up_cursor: "
-            << F_parm_up_cursor.duration << " ms\r\n";
-  std::cout << " parm_down_cursor: "
-            << F_parm_down_cursor.duration << " ms\r\n";
-  std::cout << " parm_left_cursor: "
-            << F_parm_left_cursor.duration << " ms\r\n";
-  std::cout << "parm_right_cursor: "
-            << F_parm_right_cursor.duration << " ms\r\n";
-}
-
 
 // private methods of FApplication
 //----------------------------------------------------------------------
diff --git a/src/fterm.cpp b/src/fterm.cpp
index 8d534759..e00a4ac1 100644
--- a/src/fterm.cpp
+++ b/src/fterm.cpp
@@ -403,7 +403,7 @@ char* FTerm::cursorsVisibility (bool on)
 //----------------------------------------------------------------------
 void FTerm::printMoveDurations()
 {
-  opti_move->printDurations();
+  finalcut::printDurations(*opti_move);
 }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h
index 8681f509..70f38c74 100644
--- a/src/include/final/foptimove.h
+++ b/src/include/final/foptimove.h
@@ -166,7 +166,6 @@ class FOptiMove
     // Methods
     void  check_boundaries (int&, int&, int&, int&);
     char* moveCursor (int, int, int, int);
-    void  printDurations();
 
   private:
     // Constant
@@ -208,6 +207,9 @@ class FOptiMove
     bool isMethod5Faster (int&, int, int, int);
     void moveByMethod (int, int, int, int, int);
 
+    // Friend function
+    friend void printDurations (const FOptiMove&);
+
     // Data Members
     capability  F_cursor_home;
     capability  F_carriage_return;
@@ -336,6 +338,49 @@ inline void FOptiMove::set_auto_left_margin (const bool& bcap)
 inline void FOptiMove::set_eat_newline_glitch (const bool& bcap)
 { eat_nl_glitch = bcap; }
 
+
+// FOptiMove non-member function
+//----------------------------------------------------------------------
+inline void printDurations (const FOptiMove& om)
+{
+  std::cout << "            speed: "
+            << om.baudrate << " baud\r\n";
+  std::cout << "    char_duration: "
+            << om.char_duration << " ms\r\n";
+  std::cout << "      cursor_home: "
+            << om.F_cursor_home.duration << " ms\r\n";
+  std::cout << "     cursor_to_ll: "
+            << om.F_cursor_to_ll.duration << " ms\r\n";
+  std::cout << "  carriage_return: "
+            << om.F_carriage_return.duration << " ms\r\n";
+  std::cout << "              tab: "
+            << om.F_tab.duration << " ms\r\n";
+  std::cout << "         back_tab: "
+            << om.F_back_tab.duration << " ms\r\n";
+  std::cout << "        cursor_up: "
+            << om.F_cursor_up.duration << " ms\r\n";
+  std::cout << "      cursor_down: "
+            << om.F_cursor_down.duration << " ms\r\n";
+  std::cout << "      cursor_left: "
+            << om.F_cursor_left.duration << " ms\r\n";
+  std::cout << "     cursor_right: "
+            << om.F_cursor_right.duration << " ms\r\n";
+  std::cout << "   cursor_address: "
+            << om.F_cursor_address.duration << " ms\r\n";
+  std::cout << "   column_address: "
+            << om.F_column_address.duration << " ms\r\n";
+  std::cout << "      row_address: "
+            << om.F_row_address.duration << " ms\r\n";
+  std::cout << "   parm_up_cursor: "
+            << om.F_parm_up_cursor.duration << " ms\r\n";
+  std::cout << " parm_down_cursor: "
+            << om.F_parm_down_cursor.duration << " ms\r\n";
+  std::cout << " parm_left_cursor: "
+            << om.F_parm_left_cursor.duration << " ms\r\n";
+  std::cout << "parm_right_cursor: "
+            << om.F_parm_right_cursor.duration << " ms\r\n";
+}
+
 }  // namespace finalcut
 
 #endif  // FOPTIMOVE_H

From c2df8ac7d9ef75d8ac8c98461ab3c9e31ca2628f Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Thu, 1 Nov 2018 21:29:54 +0100
Subject: [PATCH 14/33] Moved FTerm debug access methods to FTermDebugData

---
 ChangeLog                          |   3 +
 README.md                          |   6 ++
 autogen.sh                         |   2 +-
 build.sh                           |   2 +-
 doc/console_codes-manual.sh        |   2 +-
 doc/console_ioctl-manual.sh        |   2 +-
 doc/terminfo-capabilities.sh       |   2 +-
 doc/terminfo-manual.sh             |   2 +-
 examples/termcap.cpp               |  16 ++---
 src/fterm.cpp                      |  24 ++++++-
 src/ftermcap.cpp                   |   2 +-
 src/ftermcapquirks.cpp             |   2 +-
 src/ftermdetection.cpp             |   2 +-
 src/include/final/fterm.h          | 102 +++++++++++++++++++++--------
 src/include/final/ftermcap.h       |   2 +-
 src/include/final/ftermcapquirks.h |   2 +-
 src/include/final/ftermdata.h      |   2 +-
 src/include/final/ftermdetection.h |   2 +-
 src/include/final/fvterm.h         |   9 +++
 19 files changed, 133 insertions(+), 53 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa7ac580..403ccae7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-01  Markus Gans  
+	* Moved FTerm debug access methods to FTermDebugData
+
 2018-10-29  Markus Gans  
 	* FTerm is now a data member of FVTerm
 	* Fix FListBox prevListItem()
diff --git a/README.md b/README.md
index d8857374..762234a7 100644
--- a/README.md
+++ b/README.md
@@ -248,6 +248,12 @@ License
 -------
 GNU Lesser General Public License Version 3
 
+Frequently Asked Questions
+--------------------------
+If you have any problems, please read the
+[FAQ](doc/faq.md#frequently-asked-questions)
+before you give up.
+
 Please send bug reports to
 --------------------------
 https://github.com/gansm/finalcut/issues
diff --git a/autogen.sh b/autogen.sh
index f47cec46..50027620 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,7 +3,7 @@
 if test "$1" = "update"
 then
   # Update generated configuration files
-  if which autoreconf >/dev/null
+  if command -v autoreconf >/dev/null
   then
     autoreconf --force --install --verbose --warnings=all
   else
diff --git a/build.sh b/build.sh
index 229e1bbe..ae0c9e42 100755
--- a/build.sh
+++ b/build.sh
@@ -30,7 +30,7 @@ if [ -n "$1" ]
 then
   if [ ! -f ./configure ]
   then
-    if which autoreconf >/dev/null
+    if command -v autoreconf >/dev/null
     then
       autoreconf --install --force
     else
diff --git a/doc/console_codes-manual.sh b/doc/console_codes-manual.sh
index da084d69..08d9c904 100755
--- a/doc/console_codes-manual.sh
+++ b/doc/console_codes-manual.sh
@@ -2,6 +2,6 @@
 
 # set the xterm window title
 TERMTITLE="man 4 console_codes"
-echo -ne "\033]0;${TERMTITLE}\007"
+echo -ne "\\033]0;${TERMTITLE}\\007"
 
 man 4 console_codes
diff --git a/doc/console_ioctl-manual.sh b/doc/console_ioctl-manual.sh
index 73d3141a..dae34282 100755
--- a/doc/console_ioctl-manual.sh
+++ b/doc/console_ioctl-manual.sh
@@ -2,6 +2,6 @@
 
 # set the xterm window title
 TERMTITLE="man 4 console_ioctl"
-echo -ne "\033]0;${TERMTITLE}\007"
+echo -ne "\\033]0;${TERMTITLE}\\007"
 
 man 4 console_ioctl
diff --git a/doc/terminfo-capabilities.sh b/doc/terminfo-capabilities.sh
index 09e455fe..2f19f964 100755
--- a/doc/terminfo-capabilities.sh
+++ b/doc/terminfo-capabilities.sh
@@ -2,6 +2,6 @@
 
 # set the xterm window title
 TERMTITLE="infocmp: $TERM"
-echo -ne "\033]0;${TERMTITLE}\007"
+echo -ne "\\033]0;${TERMTITLE}\\007"
 
 infocmp -x | less
diff --git a/doc/terminfo-manual.sh b/doc/terminfo-manual.sh
index 67547c33..e5e842df 100755
--- a/doc/terminfo-manual.sh
+++ b/doc/terminfo-manual.sh
@@ -2,7 +2,7 @@
 
 # set the xterm window title
 TERMTITLE="man 5 terminfo"
-echo -ne "\033]0;${TERMTITLE}\007"
+echo -ne "\\033]0;${TERMTITLE}\\007"
 
 man 5 terminfo
 
diff --git a/examples/termcap.cpp b/examples/termcap.cpp
index f82fd3a1..37b7452f 100644
--- a/examples/termcap.cpp
+++ b/examples/termcap.cpp
@@ -225,21 +225,22 @@ void tcapString (const std::string& name, const char cap_str[])
 #if DEBUG
 void debug (finalcut::FApplication& TermApp)
 {
-  finalcut::FTerm& fterm = TermApp.getFTerm();
-  const finalcut::FString& ab_s = fterm.getAnswerbackString();
-  const finalcut::FString& sec_da = fterm.getSecDAString();
+  finalcut::FTermDebugData& debug_data = TermApp.getFTermDebugData();
+  const finalcut::FString& ab_s = debug_data.getAnswerbackString();
+  const finalcut::FString& sec_da = debug_data.getSecDAString();
   std::cout << "\n.------------------- debug -------------------\r\n";
+
 #if defined(__linux__)
   std::cout << "|               Framebuffer bpp: "
-            << fterm.getFramebufferBpp() << "\r\n";
+            << debug_data.getFramebufferBpp() << "\r\n";
 #endif
 
   std::cout << "| after init_256colorTerminal(): "
-            << fterm.getTermType_256color() << "\r\n";
+            << debug_data.getTermType_256color() << "\r\n";
   std::cout << "|    after parseAnswerbackMsg(): "
-            << fterm.getTermType_Answerback() << "\r\n";
+            << debug_data.getTermType_Answerback() << "\r\n";
   std::cout << "|            after parseSecDA(): "
-            << fterm.getTermType_SecDA() << "\r\n";
+            << debug_data.getTermType_SecDA() << "\r\n";
 
   if ( ! ab_s.isEmpty() )
     tcapString ("|         The answerback String", ab_s);
@@ -248,7 +249,6 @@ void debug (finalcut::FApplication& TermApp)
     tcapString ("|              The SecDA String", sec_da);
 
   std::cout << "`------------------- debug -------------------\r\n";
-
 }
 #else
 void debug (finalcut::FApplication&)
diff --git a/src/fterm.cpp b/src/fterm.cpp
index e00a4ac1..75e6ecc3 100644
--- a/src/fterm.cpp
+++ b/src/fterm.cpp
@@ -59,6 +59,10 @@ FMouseControl*      FTerm::mouse            = 0;
   FTermOpenBSD* FTerm::openbsd = 0;
 #endif
 
+#if DEBUG
+  FTermDebugData* FTerm::debug_data = 0;
+#endif
+
 
 //----------------------------------------------------------------------
 // class FTerm
@@ -888,6 +892,11 @@ void FTerm::init_global_values (bool disable_alt_screen)
 
   if ( ! init_values.terminal_detection )
     term_detection->setTerminalDetection (false);
+
+#if DEBUG
+  debug_data->setFTermDetection(term_detection);
+  debug_data->setFTermData(data);
+#endif
 }
 
 //----------------------------------------------------------------------
@@ -1090,7 +1099,7 @@ void FTerm::init_termcap()
   // Initialize the terminal capabilities
 
   FTermcap termcap;
-  termcap.setTermData(data);
+  termcap.setFTermData(data);
   termcap.setFTermDetection(term_detection);
   termcap.init();
 
@@ -1104,7 +1113,7 @@ void FTerm::init_quirks()
   // Initialize terminal quirks
 
   FTermcapQuirks quirks;
-  quirks.setTermData (data);
+  quirks.setFTermData (data);
   quirks.setFTermDetection (term_detection);
   quirks.terminalFixup();  // Fix terminal quirks
 }
@@ -1681,6 +1690,10 @@ inline void FTerm::allocationValues()
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
     openbsd        = new FTermOpenBSD();
 #endif
+
+#if DEBUG
+    debug_data     = new FTermDebugData();
+#endif
   }
   catch (const std::bad_alloc& ex)
   {
@@ -1692,6 +1705,11 @@ inline void FTerm::allocationValues()
 //----------------------------------------------------------------------
 inline void FTerm::deallocationValues()
 {
+#if DEBUG
+  if ( debug_data )
+    delete debug_data;
+#endif
+
 #if defined(__NetBSD__) || defined(__OpenBSD__)
   if ( openbsd )
     delete openbsd;
@@ -1750,7 +1768,7 @@ void FTerm::init (bool disable_alt_screen)
   initBaudRate();
 
   // Terminal detection
-  term_detection->setTermData(data);
+  term_detection->setFTermData(data);
   term_detection->detect();
   setTermType (term_detection->getTermType());
 
diff --git a/src/ftermcap.cpp b/src/ftermcap.cpp
index e35b62b9..728222b3 100644
--- a/src/ftermcap.cpp
+++ b/src/ftermcap.cpp
@@ -65,7 +65,7 @@ FTermcap::~FTermcap()  // destructor
 
 // public methods of FTermcap
 //----------------------------------------------------------------------
-void FTermcap::setTermData (FTermData* data)
+void FTermcap::setFTermData (FTermData* data)
 {
   fterm_data = data;
 }
diff --git a/src/ftermcapquirks.cpp b/src/ftermcapquirks.cpp
index 5ea603f8..87d239e3 100644
--- a/src/ftermcapquirks.cpp
+++ b/src/ftermcapquirks.cpp
@@ -49,7 +49,7 @@ FTermcapQuirks::~FTermcapQuirks()  // destructor
 
 // public methods of FTermcapQuirks
 //----------------------------------------------------------------------
-void FTermcapQuirks::setTermData (FTermData* data)
+void FTermcapQuirks::setFTermData (FTermData* data)
 {
   fterm_data = data;
 }
diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp
index 55925af3..8ee741c8 100644
--- a/src/ftermdetection.cpp
+++ b/src/ftermdetection.cpp
@@ -89,7 +89,7 @@ FTermDetection::~FTermDetection()  // destructor
 
 // public methods of FTermDetection
 //----------------------------------------------------------------------
-void FTermDetection::setTermData (FTermData* data)
+void FTermDetection::setFTermData (FTermData* data)
 {
   fterm_data = data;
 }
diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h
index 91f0ba2e..023b8838 100644
--- a/src/include/final/fterm.h
+++ b/src/include/final/fterm.h
@@ -143,6 +143,9 @@
 namespace finalcut
 {
 
+// class forward declaration
+class FTermDebugData;
+
 //----------------------------------------------------------------------
 // class FTerm
 //----------------------------------------------------------------------
@@ -181,13 +184,8 @@ class FTerm
     initializationValues&  getInitValues();
 
 #if DEBUG
-    static const FString&  getAnswerbackString();
-    static const FString&  getSecDAString();
-    static const char*     getTermType_256color();
-    static const char*     getTermType_Answerback();
-    static const char*     getTermType_SecDA();
-    static int             getFramebufferBpp();
-#endif  // DEBUG
+    FTermDebugData&        getFTermDebugData();
+#endif
 
     // Inquiries
     static bool            isNormal (charData*&);
@@ -410,6 +408,10 @@ class FTerm
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
     static FTermOpenBSD*   openbsd;
 #endif
+
+#if DEBUG
+    static FTermDebugData* debug_data;
+#endif
 };
 
 #pragma pack(pop)
@@ -453,28 +455,8 @@ inline FTerm::initializationValues& FTerm::getInitValues()
 
 #if DEBUG
 //----------------------------------------------------------------------
-inline const FString& FTerm::getAnswerbackString()
-{ return term_detection->getAnswerbackString(); }
-
-//----------------------------------------------------------------------
-inline const FString& FTerm::getSecDAString()
-{ return term_detection->getSecDAString(); }
-
-//----------------------------------------------------------------------
-inline const char* FTerm::getTermType_256color()
-{ return term_detection->getTermType_256color(); }
-
-//----------------------------------------------------------------------
-inline const char* FTerm::getTermType_Answerback()
-{ return term_detection->getTermType_Answerback(); }
-
-//----------------------------------------------------------------------
-inline const char* FTerm::getTermType_SecDA()
-{ return term_detection->getTermType_SecDA(); }
-
-//----------------------------------------------------------------------
-inline int FTerm::getFramebufferBpp()
-{ return data->getFramebufferBpp(); }
+inline FTermDebugData& FTerm::getFTermDebugData()
+{ return *debug_data; }
 #endif  // DEBUG
 
 //----------------------------------------------------------------------
@@ -598,6 +580,68 @@ inline void FTerm::changeTermSizeFinished()
 { data->setTermResized(false); }
 
 
+#if DEBUG
+//----------------------------------------------------------------------
+// class FTermDebugData
+//----------------------------------------------------------------------
+
+class FTermDebugData
+{
+  public:
+    // Accessors
+    const FString& getAnswerbackString();
+    const FString& getSecDAString();
+    const char*    getTermType_256color();
+    const char*    getTermType_Answerback();
+    const char*    getTermType_SecDA();
+#if defined(__linux__)
+    int            getFramebufferBpp();
+#endif
+    // Mutators
+    void           setFTermDetection (FTermDetection*);
+    void           setFTermData (FTermData*);
+
+  private:
+    FTermDetection* term_detection;
+    FTermData*      data;
+};
+
+//----------------------------------------------------------------------
+inline void FTermDebugData::setFTermDetection (FTermDetection* obj)
+{ term_detection = obj; }
+
+//----------------------------------------------------------------------
+inline void FTermDebugData::setFTermData (FTermData* obj)
+{ data = obj; }
+
+//----------------------------------------------------------------------
+inline const FString& FTermDebugData::getAnswerbackString()
+{ return term_detection->getAnswerbackString(); }
+
+//----------------------------------------------------------------------
+inline const FString& FTermDebugData::getSecDAString()
+{ return term_detection->getSecDAString(); }
+
+//----------------------------------------------------------------------
+inline const char* FTermDebugData::getTermType_256color()
+{ return term_detection->getTermType_256color(); }
+
+//----------------------------------------------------------------------
+inline const char* FTermDebugData::getTermType_Answerback()
+{ return term_detection->getTermType_Answerback(); }
+
+//----------------------------------------------------------------------
+inline const char* FTermDebugData::getTermType_SecDA()
+{ return term_detection->getTermType_SecDA(); }
+
+//----------------------------------------------------------------------
+#if defined(__linux__)
+inline int FTermDebugData::getFramebufferBpp()
+{ return data->getFramebufferBpp(); }
+#endif  // defined(__linux__)
+
+#endif  // DEBUG
+
 }  // namespace finalcut
 
 #endif  // FTERM_H
diff --git a/src/include/final/ftermcap.h b/src/include/final/ftermcap.h
index 04f20a3a..1637f49c 100644
--- a/src/include/final/ftermcap.h
+++ b/src/include/final/ftermcap.h
@@ -101,7 +101,7 @@ class FTermcap
     }
 
     // Mutator
-    static void setTermData (FTermData*);
+    static void setFTermData (FTermData*);
     static void setFTermDetection (FTermDetection*);
 
     // Methods
diff --git a/src/include/final/ftermcapquirks.h b/src/include/final/ftermcapquirks.h
index 9d9b5e53..0870b26f 100644
--- a/src/include/final/ftermcapquirks.h
+++ b/src/include/final/ftermcapquirks.h
@@ -64,7 +64,7 @@ class FTermcapQuirks
     const char* getClassName() const;
 
     // Mutator
-    static void setTermData (FTermData*);
+    static void setFTermData (FTermData*);
     static void setFTermDetection (FTermDetection*);
 
     // Methods
diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h
index 1efa370c..aa050ed4 100644
--- a/src/include/final/ftermdata.h
+++ b/src/include/final/ftermdata.h
@@ -386,7 +386,7 @@ inline void FTermData::setXtermTitle (const FString& title)
 { xterm_title = title; }
 
 //----------------------------------------------------------------------
-#if DEBUG
+#if DEBUG && defined(__linux__)
 inline void FTermData::setFramebufferBpp (int bpp)
 { framebuffer_bpp = bpp; }
 #endif
diff --git a/src/include/final/ftermdetection.h b/src/include/final/ftermdetection.h
index 474ee08c..97cf6f54 100644
--- a/src/include/final/ftermdetection.h
+++ b/src/include/final/ftermdetection.h
@@ -153,7 +153,7 @@ class FTermDetection
     static void           setScreenTerm (bool);
     static void           setTmuxTerm (bool);
     static void           setTerminalDetection (bool);
-    static void           setTermData (FTermData*);
+    static void           setFTermData (FTermData*);
     static void           setTtyTypeFileName (char[]);
 
     // Methods
diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h
index b7ebce7e..5ccef524 100644
--- a/src/include/final/fvterm.h
+++ b/src/include/final/fvterm.h
@@ -142,6 +142,9 @@ class FVTerm
     static char*          getTermType();
     static char*          getTermFileName();
     FTerm&                getFTerm();
+#if DEBUG
+    FTermDebugData&       getFTermDebugData();
+#endif
 
     // Mutators
     void                  setTermXY (int, int);
@@ -644,6 +647,12 @@ inline char* FVTerm::getTermFileName()
 inline FTerm& FVTerm::getFTerm()
 { return *fterm; }
 
+//----------------------------------------------------------------------
+#if DEBUG
+inline FTermDebugData& FVTerm::getFTermDebugData()
+{ return getFTerm().getFTermDebugData(); }
+#endif
+
 //----------------------------------------------------------------------
 inline void FVTerm::hideCursor()
 { return hideCursor(true); }

From deb62c2914a1c16cd7624d91db7330833a4a4471 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Fri, 2 Nov 2018 01:17:57 +0100
Subject: [PATCH 15/33] Moved FTerm debug access methods to FTermDebugData

---
 examples/ui.cpp                    |   4 +-
 src/Makefile.am                    |   1 +
 src/include/final/fterm.h          |  67 +-----------------
 src/include/final/ftermdebugdata.h | 105 +++++++++++++++++++++++++++++
 src/include/final/fvterm.h         |  20 ++++++
 5 files changed, 129 insertions(+), 68 deletions(-)
 create mode 100644 src/include/final/ftermdebugdata.h

diff --git a/examples/ui.cpp b/examples/ui.cpp
index 7566c9dd..bd7cdb09 100644
--- a/examples/ui.cpp
+++ b/examples/ui.cpp
@@ -1052,13 +1052,13 @@ int main (int argc, char* argv[])
   app.setTermTitle (title);
 
   // Force vt100 encoding
-  //app.getFTerm().setEncoding(finalcut::fc::VT100);
+  //app.setEncoding(finalcut::fc::VT100);
 
   // Sets the terminal size to 94×30
   //app.setTermSize(94,30);
 
   // Enable the final cut graphical font
-  //app.getFTerm().setNewFont();
+  //app.setNewFont();
 
   // Create main dialog object d
   MyDialog d(&app);
diff --git a/src/Makefile.am b/src/Makefile.am
index ccb53641..cce0959f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -115,6 +115,7 @@ finalcutinclude_HEADERS = \
 	include/final/ftermfreebsd.h \
 	include/final/ftermopenbsd.h \
 	include/final/ftermlinux.h \
+	include/final/ftermdebugdata.h \
 	include/final/ftermdetection.h \
 	include/final/ftermios.h \
 	include/final/fterm.h \
diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h
index 023b8838..46ee898b 100644
--- a/src/include/final/fterm.h
+++ b/src/include/final/fterm.h
@@ -127,6 +127,7 @@
 #include "final/ftermcap.h"
 #include "final/ftermcapquirks.h"
 #include "final/ftermdata.h"
+#include "final/ftermdebugdata.h"
 #include "final/ftermdetection.h"
 
 #if defined(__linux__)
@@ -143,9 +144,6 @@
 namespace finalcut
 {
 
-// class forward declaration
-class FTermDebugData;
-
 //----------------------------------------------------------------------
 // class FTerm
 //----------------------------------------------------------------------
@@ -579,69 +577,6 @@ inline FOptiMove* FTerm::getFOptiMove()
 inline void FTerm::changeTermSizeFinished()
 { data->setTermResized(false); }
 
-
-#if DEBUG
-//----------------------------------------------------------------------
-// class FTermDebugData
-//----------------------------------------------------------------------
-
-class FTermDebugData
-{
-  public:
-    // Accessors
-    const FString& getAnswerbackString();
-    const FString& getSecDAString();
-    const char*    getTermType_256color();
-    const char*    getTermType_Answerback();
-    const char*    getTermType_SecDA();
-#if defined(__linux__)
-    int            getFramebufferBpp();
-#endif
-    // Mutators
-    void           setFTermDetection (FTermDetection*);
-    void           setFTermData (FTermData*);
-
-  private:
-    FTermDetection* term_detection;
-    FTermData*      data;
-};
-
-//----------------------------------------------------------------------
-inline void FTermDebugData::setFTermDetection (FTermDetection* obj)
-{ term_detection = obj; }
-
-//----------------------------------------------------------------------
-inline void FTermDebugData::setFTermData (FTermData* obj)
-{ data = obj; }
-
-//----------------------------------------------------------------------
-inline const FString& FTermDebugData::getAnswerbackString()
-{ return term_detection->getAnswerbackString(); }
-
-//----------------------------------------------------------------------
-inline const FString& FTermDebugData::getSecDAString()
-{ return term_detection->getSecDAString(); }
-
-//----------------------------------------------------------------------
-inline const char* FTermDebugData::getTermType_256color()
-{ return term_detection->getTermType_256color(); }
-
-//----------------------------------------------------------------------
-inline const char* FTermDebugData::getTermType_Answerback()
-{ return term_detection->getTermType_Answerback(); }
-
-//----------------------------------------------------------------------
-inline const char* FTermDebugData::getTermType_SecDA()
-{ return term_detection->getTermType_SecDA(); }
-
-//----------------------------------------------------------------------
-#if defined(__linux__)
-inline int FTermDebugData::getFramebufferBpp()
-{ return data->getFramebufferBpp(); }
-#endif  // defined(__linux__)
-
-#endif  // DEBUG
-
 }  // namespace finalcut
 
 #endif  // FTERM_H
diff --git a/src/include/final/ftermdebugdata.h b/src/include/final/ftermdebugdata.h
new file mode 100644
index 00000000..439e2ed6
--- /dev/null
+++ b/src/include/final/ftermdebugdata.h
@@ -0,0 +1,105 @@
+/***********************************************************************
+* ftermdebugdata.h - Debug data class for FTerm                        *
+*                                                                      *
+* This file is part of the Final Cut widget toolkit                    *
+*                                                                      *
+* Copyright 2018 Markus Gans                                           *
+*                                                                      *
+* The Final Cut is free software; you can redistribute it and/or       *
+* modify it under the terms of the GNU Lesser General Public License   *
+* as published by the Free Software Foundation; either version 3 of    *
+* the License, or (at your option) any later version.                  *
+*                                                                      *
+* The Final Cut is distributed in the hope that it will be useful,     *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+* GNU Lesser General Public License for more details.                  *
+*                                                                      *
+* You should have received a copy of the GNU Lesser General Public     *
+* License along with this program.  If not, see                        *
+* .                                      *
+***********************************************************************/
+
+/*  Standalone class
+ *  ════════════════
+ *
+ * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
+ * ▕ FTermDebugData ▏
+ * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
+ */
+
+#ifndef FTERMDEBUGDATA_H
+#define FTERMDEBUGDATA_H
+
+#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
+  #error "Only  can be included directly."
+#endif
+
+namespace finalcut
+{
+
+#if DEBUG
+//----------------------------------------------------------------------
+// class FTermDebugData
+//----------------------------------------------------------------------
+
+class FTermDebugData
+{
+  public:
+    // Accessors
+    const FString& getAnswerbackString();
+    const FString& getSecDAString();
+    const char*    getTermType_256color();
+    const char*    getTermType_Answerback();
+    const char*    getTermType_SecDA();
+#if defined(__linux__)
+    int            getFramebufferBpp();
+#endif
+    // Mutators
+    void           setFTermDetection (FTermDetection*);
+    void           setFTermData (FTermData*);
+
+  private:
+    FTermDetection* term_detection;
+    FTermData*      data;
+};
+
+//----------------------------------------------------------------------
+inline void FTermDebugData::setFTermDetection (FTermDetection* obj)
+{ term_detection = obj; }
+
+//----------------------------------------------------------------------
+inline void FTermDebugData::setFTermData (FTermData* obj)
+{ data = obj; }
+
+//----------------------------------------------------------------------
+inline const FString& FTermDebugData::getAnswerbackString()
+{ return term_detection->getAnswerbackString(); }
+
+//----------------------------------------------------------------------
+inline const FString& FTermDebugData::getSecDAString()
+{ return term_detection->getSecDAString(); }
+
+//----------------------------------------------------------------------
+inline const char* FTermDebugData::getTermType_256color()
+{ return term_detection->getTermType_256color(); }
+
+//----------------------------------------------------------------------
+inline const char* FTermDebugData::getTermType_Answerback()
+{ return term_detection->getTermType_Answerback(); }
+
+//----------------------------------------------------------------------
+inline const char* FTermDebugData::getTermType_SecDA()
+{ return term_detection->getTermType_SecDA(); }
+
+//----------------------------------------------------------------------
+#if defined(__linux__)
+inline int FTermDebugData::getFramebufferBpp()
+{ return data->getFramebufferBpp(); }
+#endif  // defined(__linux__)
+
+#endif  // DEBUG
+
+}  // namespace finalcut
+
+#endif  // FTERMDEBUGDATA_H
diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h
index 5ccef524..f31af555 100644
--- a/src/include/final/fvterm.h
+++ b/src/include/final/fvterm.h
@@ -221,6 +221,10 @@ class FVTerm
     static bool           unsetInheritBackground();
 
     static void           setTermTitle (const FString&);
+    static void           setEncoding (fc::encoding);
+    static bool           setVGAFont();
+    static bool           setNewFont();
+    static bool           setOldFont();
 
     // Inquiries
     static bool           isBold();
@@ -880,6 +884,22 @@ inline bool FVTerm::unsetInheritBackground()
 inline void FVTerm::setTermTitle (const FString& title)
 { FTerm::setTermTitle(title); }
 
+//----------------------------------------------------------------------
+inline void FVTerm::setEncoding (fc::encoding enc)
+{ FTerm::setEncoding(enc); }
+
+//----------------------------------------------------------------------
+inline bool FVTerm::setVGAFont()
+{ return FTerm::setVGAFont(); }
+
+//----------------------------------------------------------------------
+inline bool FVTerm::setNewFont()
+{ return FTerm::setNewFont(); }
+
+//----------------------------------------------------------------------
+inline bool FVTerm::setOldFont()
+{ return FTerm::setOldFont(); }
+
 //----------------------------------------------------------------------
 inline bool FVTerm::isBold()
 { return next_attribute.attr.bit.bold; }

From 70f3598b62d08c7ac624d1c5d651b67fab8d88dd Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Fri, 2 Nov 2018 01:28:33 +0100
Subject: [PATCH 16/33] Moved FTerm debug access methods to FTermDebugData

---
 test/ftermcapquirks-test.cpp | 22 +++++++++----------
 test/ftermdetection-test.cpp | 42 ++++++++++++++++++------------------
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp
index 090b7a84..5913c9b9 100644
--- a/test/ftermcapquirks-test.cpp
+++ b/test/ftermcapquirks-test.cpp
@@ -239,7 +239,7 @@ void FTermcapQuirksTest::generalTest()
   finalcut::FTermcap::can_change_color_palette = false;
   finalcut::FTermcapQuirks quirks;
   finalcut::FTermDetection detect;
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -306,7 +306,7 @@ void FTermcapQuirksTest::xtermTest()
   finalcut::FTermcap::can_change_color_palette = false;
   detect.setXTerminal (true);
   data.setTermType ("xterm");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -339,7 +339,7 @@ void FTermcapQuirksTest::freebsdTest()
   finalcut::FTermDetection detect;
   detect.setFreeBSDTerm (true);
   data.setTermType ("xterm-16color");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -378,7 +378,7 @@ void FTermcapQuirksTest::cygwinTest()
   finalcut::FTermDetection detect;
   detect.setCygwinTerminal (true);
   data.setTermType ("cygwin");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -406,7 +406,7 @@ void FTermcapQuirksTest::linuxTest()
   finalcut::FTermDetection detect;
   detect.setLinuxTerm (true);
   data.setTermType ("linux");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -478,7 +478,7 @@ void FTermcapQuirksTest::rxvtTest()
   finalcut::FTermDetection detect;
   detect.setRxvtTerminal (true);
   data.setTermType ("rxvt");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -522,7 +522,7 @@ void FTermcapQuirksTest::vteTest()
   finalcut::FTermDetection detect;
   detect.setGnomeTerminal (true);
   data.setTermType ("gnome-256color");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -551,7 +551,7 @@ void FTermcapQuirksTest::puttyTest()
   finalcut::FTermDetection detect;
   detect.setPuttyTerminal (true);
   data.setTermType ("putty");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -640,7 +640,7 @@ void FTermcapQuirksTest::teratermTest()
   finalcut::FTermDetection detect;
   detect.setTeraTerm (true);
   data.setTermType ("teraterm");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -666,7 +666,7 @@ void FTermcapQuirksTest::sunTest()
   finalcut::FTermDetection detect;
   detect.setSunTerminal (true);
   data.setTermType ("sun-color");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
@@ -690,7 +690,7 @@ void FTermcapQuirksTest::screenTest()
   finalcut::FTermcap::can_change_color_palette = false;
   detect.setScreenTerm (true);
   data.setTermType ("screen-256color");
-  quirks.setTermData(&data);
+  quirks.setFTermData(&data);
   quirks.setFTermDetection (&detect);
   quirks.terminalFixup();
 
diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp
index b5edec56..bf78ca1a 100644
--- a/test/ftermdetection-test.cpp
+++ b/test/ftermdetection-test.cpp
@@ -482,7 +482,7 @@ void FTermDetectionTest::ansiTest()
   finalcut::FTermDetection detect;
   setenv ("TERM", "ansi", 1);
   data.setTermFileName(C_STR("ansi"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
 
   pid_t pid = forkProcess();
 
@@ -551,7 +551,7 @@ void FTermDetectionTest::xtermTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -613,7 +613,7 @@ void FTermDetectionTest::rxvtTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("rxvt-cygwin-native"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -676,7 +676,7 @@ void FTermDetectionTest::urxvtTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("rxvt-unicode-256color"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -739,7 +739,7 @@ void FTermDetectionTest::mltermTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("mlterm"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -809,7 +809,7 @@ void FTermDetectionTest::puttyTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -872,7 +872,7 @@ void FTermDetectionTest::kdeKonsoleTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm-256color"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -934,7 +934,7 @@ void FTermDetectionTest::gnomeTerminalTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm-256color"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -997,7 +997,7 @@ void FTermDetectionTest::newerVteTerminalTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm-256color"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1060,7 +1060,7 @@ void FTermDetectionTest::ktermTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("kterm"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1130,7 +1130,7 @@ void FTermDetectionTest::teraTermTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1193,7 +1193,7 @@ void FTermDetectionTest::cygwinTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("cygwin"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1256,7 +1256,7 @@ void FTermDetectionTest::minttyTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm-256color"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1319,7 +1319,7 @@ void FTermDetectionTest::linuxTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("linux"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1389,7 +1389,7 @@ void FTermDetectionTest::freebsdTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("xterm"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1462,7 +1462,7 @@ void FTermDetectionTest::netbsdTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("wsvt25"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1533,7 +1533,7 @@ void FTermDetectionTest::openbsdTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("vt220"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1604,7 +1604,7 @@ void FTermDetectionTest::sunTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("sun-color"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
 
   pid_t pid = forkProcess();
 
@@ -1673,7 +1673,7 @@ void FTermDetectionTest::screenTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("screen"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1742,7 +1742,7 @@ void FTermDetectionTest::tmuxTest()
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
   data.setTermFileName(C_STR("screen"));
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
 
   pid_t pid = forkProcess();
@@ -1846,7 +1846,7 @@ void FTermDetectionTest::ttytypeTest()
 
   finalcut::FTermData data;
   finalcut::FTermDetection detect;
-  detect.setTermData(&data);
+  detect.setFTermData(&data);
   detect.setTerminalDetection(true);
   detect.setTtyTypeFileName(C_STR("new-root-dir/etc/ttytype"));
 

From 1f8d16791a7fddae69bd62161acfc6b16f58dcdc Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sat, 3 Nov 2018 01:32:51 +0100
Subject: [PATCH 17/33] New method rgb2ColorIndex() to converts a 24-bit RGB
 color to a 256-color compatible approximation

---
 ChangeLog                  |  4 ++++
 README.md                  |  2 +-
 doc/faq.md                 |  4 ++--
 doc/first-steps.md         |  8 ++++----
 src/fvterm.cpp             | 14 ++++++++++++++
 src/include/final/fvterm.h |  1 +
 6 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 403ccae7..afd69b0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-03  Markus Gans  
+	* New method rgb2ColorIndex() to converts a 24-bit RGB color 
+	  to a 256-color compatible approximation
+
 2018-11-01  Markus Gans  
 	* Moved FTerm debug access methods to FTermDebugData
 
diff --git a/README.md b/README.md
index 762234a7..2e804149 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@
      [![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html)
 
 The FINAL CUT is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen.
-The C++ class design was inspired by the Qt framework. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
+The structure of the Qt framework was originally the inspiration for the C++ class design of FINAL CUT. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
 
 ### Installation
 ```bash
diff --git a/doc/faq.md b/doc/faq.md
index 9ebc3626..b288744a 100644
--- a/doc/faq.md
+++ b/doc/faq.md
@@ -87,8 +87,8 @@ How can I fix display problems?
 * Make sure that the environment variable TERM has the right 
   terminal name.
 
-* With the command "`msgcat --color=test`" you can test whether 
-  the colors are displayed correctly in the terminal
+* Use the command "`msgcat --color=test`" to test whether the terminal 
+  displays colors correctly in the terminal.
 
 * If characters are not displayed in the right place on the screen, 
   it may help to disable cursor optimization for your program with 
diff --git a/doc/first-steps.md b/doc/first-steps.md
index e3870ba7..b84fcfaa 100644
--- a/doc/first-steps.md
+++ b/doc/first-steps.md
@@ -72,7 +72,7 @@ The title bar of the dialog box gets the text "A dialog".
 dialog.setGeometry (25, 5, 30, 10);
 ```
 The dialog window gets a width of 30 and a height of 10 characters.
-The window in the terminal is located at the positions x=25 and
+The position of the window in the terminal is at x=25 and
 y=5 (note: x=1 and y=1 represents the upper left corner).
 
 ```cpp
@@ -93,7 +93,7 @@ if available) visible.
 return app.exec();
 ```
 The last line calls `exec()` to start the application and return
-the result to the operating system. When the application starts,
-it enters the main event loop. This loop doesn't end until the
-window/application is closed.
+the result to the operating system. The started application enters
+the main event loop. This loop does not end until the window is
+not closed.
 
diff --git a/src/fvterm.cpp b/src/fvterm.cpp
index e75beb9b..943674ec 100644
--- a/src/fvterm.cpp
+++ b/src/fvterm.cpp
@@ -163,6 +163,20 @@ void FVTerm::setPrintCursor (int x, int y)
   }
 }
 
+//----------------------------------------------------------------------
+short FVTerm::rgb2ColorIndex (short r, short g, short b)
+{
+  // Converts a 24-bit RGB color to a 256-color compatible approximation
+
+  if ( r < 0 || g < 0 || b < 0 || r > 0xff || g > 0xff || b > 0xff )
+    return 0;
+
+  short ri = (((r * 5) + 127) / 255) * 36;
+  short gi = (((g * 5) + 127) / 255) * 6;
+  short bi = (((b * 5) + 127) / 255);
+  return 16 + ri + gi + bi;
+}
+
 //----------------------------------------------------------------------
 void FVTerm::clearArea (int fillchar)
 {
diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h
index f31af555..33f1f62c 100644
--- a/src/include/final/fvterm.h
+++ b/src/include/final/fvterm.h
@@ -153,6 +153,7 @@ class FVTerm
     void                  showCursor();
     void                  setPrintCursor (const FPoint&);
     void                  setPrintCursor (int, int);
+    short                 rgb2ColorIndex (short, short, short);
     void                  setColor (short, short);
     static void           setNormal();
 

From 5a356664b275722349124a569c1b7f3ea1a174ab Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sun, 4 Nov 2018 23:00:06 +0100
Subject: [PATCH 18/33] The widget flags are now stored in a bit field

---
 ChangeLog                        |  3 ++
 README.md                        |  1 +
 doc/readme.txt                   |  7 +++--
 src/fapplication.cpp             |  2 +-
 src/fbutton.cpp                  | 36 ++++++++++--------------
 src/fbuttongroup.cpp             | 12 ++------
 src/fdialog.cpp                  | 27 +++++-------------
 src/flabel.cpp                   |  9 ++----
 src/flineedit.cpp                | 17 ++++-------
 src/flistbox.cpp                 | 29 ++++++++-----------
 src/flistview.cpp                | 11 ++------
 src/fmenu.cpp                    |  9 ++----
 src/fmenubar.cpp                 |  2 +-
 src/fprogressbar.cpp             |  6 ++--
 src/ftogglebutton.cpp            | 22 ++++-----------
 src/fwidget.cpp                  | 47 ++++++++++++-------------------
 src/fwindow.cpp                  | 48 ++++++++++----------------------
 src/include/final/fbutton.h      |  4 +--
 src/include/final/fc.h           | 18 ------------
 src/include/final/fdialog.h      |  4 +--
 src/include/final/flineedit.h    |  2 +-
 src/include/final/fprogressbar.h |  2 +-
 src/include/final/fwidget.h      | 37 +++++++++++++++++-------
 src/include/final/fwindow.h      |  8 +++---
 24 files changed, 139 insertions(+), 224 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index afd69b0d..a1e7af99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-04  Markus Gans  
+	* Widget flags are now stored in a bit field
+
 2018-11-03  Markus Gans  
 	* New method rgb2ColorIndex() to converts a 24-bit RGB color 
 	  to a 256-color compatible approximation
diff --git a/README.md b/README.md
index 2e804149..1347b99e 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@
      [![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html)
 
 The FINAL CUT is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen.
+
 The structure of the Qt framework was originally the inspiration for the C++ class design of FINAL CUT. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
 
 ### Installation
diff --git a/doc/readme.txt b/doc/readme.txt
index 66ffe493..2f185b57 100644
--- a/doc/readme.txt
+++ b/doc/readme.txt
@@ -7,7 +7,8 @@ support for creating a text-based user interface. The library supports
 the programmer to develop an application for the text console. It allows
 the simultaneous handling of multiple text windows on the screen.
 
-The C++ class design was inspired by the Qt framework. It provides
-common controls like dialog boxes, push buttons, check boxes,
-radio buttons, input lines, list boxes, status bars and so on.
+The structure of the Qt framework was originally the inspiration for
+the C++ class design of FINAL CUT. It provides common controls like
+dialog boxes, push buttons, check boxes, radio buttons, input lines,
+list boxes, status bars and so on.
 
diff --git a/src/fapplication.cpp b/src/fapplication.cpp
index e9444cef..9dd5cacb 100644
--- a/src/fapplication.cpp
+++ b/src/fapplication.cpp
@@ -188,7 +188,7 @@ bool FApplication::sendEvent ( const FObject* receiver
 
     // block events for widgets in non modal windows
     if ( window
-      && (window->getFlags() & fc::modal) == 0
+      && ! window->getFlags().modal
       && ! window->isMenuWidget() )
     {
       switch ( event->type() )
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index d68266a0..abe5a607 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -157,12 +157,7 @@ void FButton::setInactiveBackgroundColor (short color)
 //----------------------------------------------------------------------
 bool FButton::setNoUnderline (bool on)
 {
-  if ( on )
-    flags |= fc::no_underline;
-  else
-    flags &= ~fc::no_underline;
-
-  return on;
+  return (flags.no_underline = on);
 }
 
 //----------------------------------------------------------------------
@@ -211,11 +206,7 @@ bool FButton::setFocus (bool on)
 //----------------------------------------------------------------------
 bool FButton::setFlat (bool on)
 {
-  if ( on )
-    flags |= fc::flat;
-  else
-    flags &= ~fc::flat;
-  return on;
+  return (flags.flat = on);
 }
 
 //----------------------------------------------------------------------
@@ -225,16 +216,16 @@ bool FButton::setShadow (bool on)
     && getEncoding() != fc::VT100
     && getEncoding() != fc::ASCII )
   {
-    flags |= fc::shadow;
+    flags.shadow = true;
     setShadowSize(1,1);
   }
   else
   {
-    flags &= ~fc::shadow;
+    flags.shadow = false;
     setShadowSize(0,0);
   }
 
-  return on;
+  return flags.shadow;
 }
 
 //----------------------------------------------------------------------
@@ -465,13 +456,12 @@ void FButton::init()
 //----------------------------------------------------------------------
 void FButton::getButtonState()
 {
-  int active_focus = fc::active + fc::focus;
-  is.active_focus = ((flags & active_focus) == active_focus);
-  is.active = ((flags & fc::active) != 0);
-  is.focus = ((flags & fc::focus) != 0);
+  is.active_focus = flags.active && flags.focus;
+  is.active = flags.active;
+  is.focus = flags.focus;
   is.flat = isFlat();
-  is.non_flat_shadow = ((flags & (fc::shadow + fc::flat)) == fc::shadow);
-  is.no_underline = ((flags & fc::no_underline) != 0);
+  is.non_flat_shadow = ! flags.flat && flags.shadow;
+  is.no_underline = flags.no_underline;
 }
 
 //----------------------------------------------------------------------
@@ -666,10 +656,14 @@ inline void FButton::drawTopBottomBackground()
 inline void FButton::drawButtonTextLine (wchar_t button_text[])
 {
   std::size_t pos;
-  center_offset = (getWidth() - txtlength - 1) / 2;
   setPrintPos (2 + int(indent), 1 + int(vcenter_offset));
   setColor (button_fg, button_bg);
 
+  if ( getWidth() < txtlength + 1 )
+    center_offset = 0;
+  else
+    center_offset = (getWidth() - txtlength - 1) / 2;
+
   // Print button text line --------
   for (pos = 0; pos < center_offset; pos++)
     print (space_char);  // █
diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp
index fcede4b7..c5cf8612 100644
--- a/src/fbuttongroup.cpp
+++ b/src/fbuttongroup.cpp
@@ -543,9 +543,6 @@ bool FButtonGroup::isRadioButton (FToggleButton* button) const
 //----------------------------------------------------------------------
 void FButtonGroup::init()
 {
-  if ( isEnabled() )
-    flags |= fc::active;
-
   setForegroundColor (wc.label_fg);
   setBackgroundColor (wc.label_bg);
   setMinimumSize (7, 4);
@@ -582,9 +579,6 @@ void FButtonGroup::drawText ( wchar_t LabelText[]
                             , std::size_t hotkeypos
                             , std::size_t length )
 {
-  bool isActive = ((flags & fc::active) != 0);
-  bool isNoUnderline = ((flags & fc::no_underline) != 0);
-
   if ( isMonochron() )
     setReverse(true);
 
@@ -595,16 +589,16 @@ void FButtonGroup::drawText ( wchar_t LabelText[]
 
   for (std::size_t z = 0; z < length; z++)
   {
-    if ( (z == hotkeypos) && isActive )
+    if ( (z == hotkeypos) && flags.active )
     {
       setColor (wc.label_hotkey_fg, wc.label_hotkey_bg);
 
-      if ( ! isNoUnderline )
+      if ( ! flags.no_underline )
         setUnderline();
 
       print (LabelText[z]);
 
-      if ( ! isNoUnderline )
+      if ( ! flags.no_underline )
         unsetUnderline();
 
       setColor (wc.label_emphasis_fg, wc.label_bg);
diff --git a/src/fdialog.cpp b/src/fdialog.cpp
index b43780b2..995f75e8 100644
--- a/src/fdialog.cpp
+++ b/src/fdialog.cpp
@@ -103,16 +103,12 @@ bool FDialog::setDialogWidget (bool on)
   if ( isDialogWidget() == on )
     return true;
 
+  flags.dialog_widget = on;
+
   if ( on )
-  {
-    flags |= fc::dialog_widget;
     setTermOffsetWithPadding();
-  }
   else
-  {
-    flags &= ~fc::dialog_widget;
     setParentOffset();
-  }
 
   return on;
 }
@@ -123,16 +119,12 @@ bool FDialog::setModal (bool on)
   if ( isModal() == on )
     return true;
 
+  flags.modal = on;
+
   if ( on )
-  {
-    flags |= fc::modal;
     modal_dialogs++;
-  }
   else
-  {
-    flags &= ~fc::modal;
     modal_dialogs--;
-  }
 
   return on;
 }
@@ -141,12 +133,7 @@ bool FDialog::setModal (bool on)
 //----------------------------------------------------------------------
 bool FDialog::setScrollable (bool on)
 {
-  if ( on )
-    flags |= fc::scrollable;
-  else
-    flags &= ~fc::scrollable;
-
-  return on;
+  return (flags.scrollable = on);
 }
 
 //----------------------------------------------------------------------
@@ -835,7 +822,7 @@ void FDialog::draw()
   drawTitleBar();
   setCursorPos(2, int(getHeight()) - 1);
 
-  if ( (flags & fc::shadow) != 0 )
+  if ( flags.shadow )
     drawDialogShadow();
 
   if ( isMonochron() )
@@ -845,7 +832,7 @@ void FDialog::draw()
 //----------------------------------------------------------------------
 void FDialog::drawDialogShadow()
 {
-  if ( isMonochron() && (flags & fc::trans_shadow) == 0 )
+  if ( isMonochron() && ! flags.trans_shadow )
     return;
 
   drawShadow();
diff --git a/src/flabel.cpp b/src/flabel.cpp
index c2b1baec..39985cbf 100644
--- a/src/flabel.cpp
+++ b/src/flabel.cpp
@@ -597,9 +597,6 @@ void FLabel::printLine ( wchar_t line[]
 {
   std::size_t to_char;
   std::size_t width = std::size_t(getWidth());
-  bool isActive, isNoUnderline;
-  isActive = ((flags & fc::active) != 0);
-  isNoUnderline = ((flags & fc::no_underline) != 0);
 
   if ( align_offset > 0 )
     print (FString(align_offset, ' '));  // leading spaces
@@ -623,16 +620,16 @@ void FLabel::printLine ( wchar_t line[]
       }
     }
 
-    if ( z == hotkeypos && isActive )
+    if ( z == hotkeypos && flags.active )
     {
       setColor (wc.label_hotkey_fg, wc.label_hotkey_bg);
 
-      if ( ! isNoUnderline )
+      if ( ! flags.no_underline )
         setUnderline();
 
       print (line[z]);
 
-      if ( ! isNoUnderline )
+      if ( ! flags.no_underline )
         unsetUnderline();
 
       if ( hasEmphasis() )
diff --git a/src/flineedit.cpp b/src/flineedit.cpp
index a1bef7b3..bdca4e7d 100644
--- a/src/flineedit.cpp
+++ b/src/flineedit.cpp
@@ -239,16 +239,16 @@ bool FLineEdit::setShadow (bool on)
     && getEncoding() != fc::VT100
     && getEncoding() != fc::ASCII )
   {
-    flags |= fc::shadow;
+    flags.shadow = true;
     setShadowSize(1,1);
   }
   else
   {
-    flags &= ~fc::shadow;
+    flags.shadow = false;
     setShadowSize(0,0);
   }
 
-  return on;
+  return flags.shadow;
 }
 
 //----------------------------------------------------------------------
@@ -698,11 +698,9 @@ bool FLineEdit::hasHotkey()
 //----------------------------------------------------------------------
 void FLineEdit::draw()
 {
-  bool isFocus;
   drawInputField();
-  isFocus = ((flags & fc::focus) != 0);
 
-  if ( isFocus && getStatusBar() )
+  if ( flags.focus && getStatusBar() )
   {
     const FString& msg = getStatusbarMessage();
     const FString& curMsg = getStatusBar()->getMessage();
@@ -718,12 +716,9 @@ void FLineEdit::draw()
 //----------------------------------------------------------------------
 void FLineEdit::drawInputField()
 {
-  bool isActiveFocus, isShadow;
   std::size_t x;
   FString show_text;
-  int active_focus = fc::active + fc::focus;
-  isActiveFocus = ((flags & active_focus) == active_focus);
-  isShadow = ((flags & fc::shadow) != 0 );
+  bool isActiveFocus = flags.active && flags.focus;
   setPrintPos (1, 1);
 
   if ( isMonochron() )
@@ -776,7 +771,7 @@ void FLineEdit::drawInputField()
     setUnderline(false);
   }
 
-  if ( isShadow )
+  if ( flags.shadow )
     drawShadow ();
 
   // set the cursor to the first pos.
diff --git a/src/flistbox.cpp b/src/flistbox.cpp
index 83bae776..c14162a2 100644
--- a/src/flistbox.cpp
+++ b/src/flistbox.cpp
@@ -872,8 +872,6 @@ void FListBox::init()
 //----------------------------------------------------------------------
 void FListBox::draw()
 {
-  bool isFocus;
-
   if ( current < 1 )
     current = 1;
 
@@ -910,9 +908,8 @@ void FListBox::draw()
     hbar->redraw();
 
   drawList();
-  isFocus = ((flags & fc::focus) != 0);
 
-  if ( isFocus && getStatusBar() )
+  if ( flags.focus && getStatusBar() )
   {
     const FString& msg = getStatusbarMessage();
     const FString& curMsg = getStatusBar()->getMessage();
@@ -1017,14 +1014,13 @@ inline void FListBox::drawListLine ( int y
   std::size_t i, len;
   std::size_t inc_len = inc_search.getLength();
   bool isCurrentLine = bool(y + yoffset + 1 == int(current));
-  bool isFocus = ((flags & fc::focus) != 0);
   FString element;
   element = getString(iter).mid ( std::size_t(1 + xoffset)
                                 , getWidth() - nf_offset - 4 );
   const wchar_t* const& element_str = element.wc_str();
   len = element.getLength();
 
-  if ( isMonochron() && isCurrentLine && isFocus )
+  if ( isMonochron() && isCurrentLine && flags.focus )
     print (fc::BlackRightPointingPointer);  // ►
   else
     print (' ');
@@ -1035,14 +1031,14 @@ inline void FListBox::drawListLine ( int y
 
   for (i = 0; i < len; i++)
   {
-    if ( serach_mark && i == inc_len && isFocus  )
+    if ( serach_mark && i == inc_len && flags.focus  )
       setColor ( wc.current_element_focus_fg
                , wc.current_element_focus_bg );
 
     print (element_str[i]);
   }
 
-  if ( isMonochron() && isCurrentLine  && isFocus )
+  if ( isMonochron() && isCurrentLine  && flags.focus )
   {
     print (fc::BlackLeftPointingPointer);   // ◄
     i++;
@@ -1116,9 +1112,8 @@ inline void FListBox::drawListBracketsLine ( int y
             , i = 0
             , b = 0;
   bool isCurrentLine = bool(y + yoffset + 1 == int(current));
-  bool isFocus = ((flags & fc::focus) != 0);
 
-  if ( isMonochron() && isCurrentLine && isFocus )
+  if ( isMonochron() && isCurrentLine && flags.focus )
     print (fc::BlackRightPointingPointer);  // ►
   else
     print (' ');
@@ -1164,7 +1159,7 @@ inline void FListBox::drawListBracketsLine ( int y
     i++;
   }
 
-  if ( isMonochron() && isCurrentLine && isFocus )
+  if ( isMonochron() && isCurrentLine && flags.focus )
   {
     print (fc::BlackLeftPointingPointer);   // ◄
     i++;
@@ -1180,10 +1175,8 @@ inline void FListBox::setLineAttributes ( int y
                                         , bool lineHasBrackets
                                         , bool& serach_mark )
 {
-  bool isFocus = ((flags & fc::focus) != 0)
-     , isCurrentLine = bool(y + yoffset + 1 == int(current));
+  bool isCurrentLine = bool(y + yoffset + 1 == int(current));
   std::size_t inc_len = inc_search.getLength();
-
   setPrintPos (2, 2 + int(y));
 
   if ( isLineSelected )
@@ -1203,14 +1196,14 @@ inline void FListBox::setLineAttributes ( int y
 
   if ( isCurrentLine )
   {
-    if ( isFocus && getMaxColor() < 16 )
+    if ( flags.focus && getMaxColor() < 16 )
       setBold();
 
     if ( isLineSelected )
     {
       if ( isMonochron() )
         setBold();
-      else if ( isFocus )
+      else if ( flags.focus )
         setColor ( wc.selected_current_element_focus_fg
                  , wc.selected_current_element_focus_bg );
       else
@@ -1224,7 +1217,7 @@ inline void FListBox::setLineAttributes ( int y
       if ( isMonochron() )
         unsetBold();
 
-      if ( isFocus )
+      if ( flags.focus )
       {
         setColor ( wc.current_element_focus_fg
                  , wc.current_element_focus_bg );
@@ -1251,7 +1244,7 @@ inline void FListBox::setLineAttributes ( int y
   {
     if ( isMonochron() )
       setReverse(true);
-    else if ( isFocus && getMaxColor() < 16 )
+    else if ( flags.focus && getMaxColor() < 16 )
       unsetBold();
   }
 }
diff --git a/src/flistview.cpp b/src/flistview.cpp
index d6a48897..dfa08d8a 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -1481,8 +1481,6 @@ std::size_t FListView::getAlignOffset ( fc::text_alignment align
 //----------------------------------------------------------------------
 void FListView::draw()
 {
-  bool isFocus;
-
   if ( current_iter.getPosition() < 1 )
     current_iter = itemlist.begin();
 
@@ -1519,9 +1517,8 @@ void FListView::draw()
     hbar->redraw();
 
   drawList();
-  isFocus = ((flags & fc::focus) != 0);
 
-  if ( isFocus && getStatusBar() )
+  if ( flags.focus && getStatusBar() )
   {
     const FString& msg = getStatusbarMessage();
     const FString& curMsg = getStatusBar()->getMessage();
@@ -1587,7 +1584,6 @@ void FListView::drawColumnLabels()
 void FListView::drawList()
 {
   uInt page_height, y;
-  bool is_focus;
   FListViewIterator iter;
 
   if ( itemlist.empty() || getHeight() <= 2 || getWidth() <= 4 )
@@ -1595,7 +1591,6 @@ void FListView::drawList()
 
   y           = 0;
   page_height = uInt(getHeight() - 2);
-  is_focus    = ((flags & fc::focus) != 0);
   iter        = first_visible_line;
 
   while ( iter != itemlist.end() && y < page_height )
@@ -1605,9 +1600,9 @@ void FListView::drawList()
     setPrintPos (2, 2 + int(y));
 
     // Draw one FListViewItem
-    drawListLine (item, is_focus, is_current_line);
+    drawListLine (item, flags.focus, is_current_line);
 
-    if ( is_focus && is_current_line )
+    if ( flags.focus && is_current_line )
       setCursorPos (3, 2 + int(y));  // first character
 
     last_visible_line = iter;
diff --git a/src/fmenu.cpp b/src/fmenu.cpp
index cc75ae8b..149db2d2 100644
--- a/src/fmenu.cpp
+++ b/src/fmenu.cpp
@@ -82,12 +82,7 @@ bool FMenu::setMenuWidget (bool on)
   if ( isMenuWidget() == on )
     return true;
 
-  if ( on )
-    flags |= fc::menu_widget;
-  else
-    flags &= ~fc::menu_widget;
-
-  return on;
+  return (flags.menu_widget = on);
 }
 
 //----------------------------------------------------------------------
@@ -1350,7 +1345,7 @@ inline void FMenu::drawMenuLine (FMenuItem* menuitem, int y)
     to_char--;
 
   txtdata.length = to_char;
-  txtdata.no_underline = ((menuitem->getFlags() & fc::no_underline) != 0);
+  txtdata.no_underline = menuitem->getFlags().no_underline;
   setCursorToHotkeyPosition (menuitem);
 
   if ( ! is_enabled || is_selected )
diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp
index 0d904cde..9f08939e 100644
--- a/src/fmenubar.cpp
+++ b/src/fmenubar.cpp
@@ -554,7 +554,7 @@ inline void FMenuBar::drawItem (FMenuItem* menuitem, std::size_t& x)
   bool is_selected = menuitem->isSelected();
 
   txtdata.startpos = x + 1;
-  txtdata.no_underline = ((menuitem->getFlags() & fc::no_underline) != 0);
+  txtdata.no_underline = menuitem->getFlags().no_underline;
 
   // Set screen attributes
   setLineAttributes (menuitem);
diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp
index 821ee5db..559ce6e0 100644
--- a/src/fprogressbar.cpp
+++ b/src/fprogressbar.cpp
@@ -83,12 +83,12 @@ bool FProgressbar::setShadow (bool on)
     && getEncoding() != fc::VT100
     && getEncoding() != fc::ASCII )
   {
-    flags |= fc::shadow;
+    flags.shadow = true;
     setShadowSize(1,1);
   }
   else
   {
-    flags &= ~fc::shadow;
+    flags.shadow = false;
     setShadowSize(0,0);
   }
 
@@ -157,7 +157,7 @@ void FProgressbar::draw()
   drawPercentage();
   drawBar();
 
-  if ( (flags & fc::shadow) != 0 )
+  if ( flags.shadow )
     drawShadow ();
 
   flush_out();
diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp
index b86bec1e..6ac83c9b 100644
--- a/src/ftogglebutton.cpp
+++ b/src/ftogglebutton.cpp
@@ -109,12 +109,7 @@ void FToggleButton::setGeometry (int x, int y, std::size_t w, std::size_t h, boo
 //----------------------------------------------------------------------
 bool FToggleButton::setNoUnderline (bool on)
 {
-  if ( on )
-    flags |= fc::no_underline;
-  else
-    flags &= ~fc::no_underline;
-
-  return on;
+  return (flags.no_underline = on);
 }
 
 //----------------------------------------------------------------------
@@ -464,9 +459,7 @@ bool FToggleButton::isCheckboxButton() const
 //----------------------------------------------------------------------
 void FToggleButton::draw()
 {
-  bool isFocus = ((flags & fc::focus) != 0);
-
-  if ( isFocus && getStatusBar() )
+  if ( flags.focus && getStatusBar() )
   {
     const FString& msg = getStatusbarMessage();
     const FString& curMsg = getStatusBar()->getMessage();
@@ -649,12 +642,9 @@ std::size_t  FToggleButton::getHotkeyPos ( wchar_t src[]
 
 //----------------------------------------------------------------------
 void FToggleButton::drawText ( wchar_t LabelText[]
-                             , std::size_t  hotkeypos
+                             , std::size_t hotkeypos
                              , std::size_t length )
 {
-  bool isActive = ((flags & fc::active) != 0);
-  bool isNoUnderline = ((flags & fc::no_underline) != 0);
-
   if ( isMonochron() )
     setReverse(true);
 
@@ -665,16 +655,16 @@ void FToggleButton::drawText ( wchar_t LabelText[]
 
   for (std::size_t z = 0; z < length; z++)
   {
-    if ( (z == hotkeypos) && isActive )
+    if ( (z == hotkeypos) && flags.active )
     {
       setColor (wc.label_hotkey_fg, wc.label_hotkey_bg);
 
-      if ( ! isNoUnderline )
+      if ( ! flags.no_underline )
         setUnderline();
 
       print ( LabelText[z] );
 
-      if ( ! isNoUnderline )
+      if ( ! flags.no_underline )
         unsetUnderline();
 
       setColor (wc.label_fg, wc.label_bg);
diff --git a/src/fwidget.cpp b/src/fwidget.cpp
index a31e34a9..ea385037 100644
--- a/src/fwidget.cpp
+++ b/src/fwidget.cpp
@@ -58,13 +58,11 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
   : FVTerm(bool(! parent), disable_alt_screen)
   , FObject(parent)
   , accelerator_list(0)
-  , flags(0)
+  , flags()
   , callback_objects()
   , member_callback_objects()
-  , enable(true)
   , visible(true)
   , shown(false)
-  , focus(false)
   , focusable(true)
   , visible_cursor(true)
   , widget_cursor_position(-1, -1)
@@ -84,8 +82,11 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
   , background_color(fc::Default)
   , statusbar_message()
 {
-  if ( isEnabled() )
-    flags |= fc::active;
+  // init bit field with 0
+  memset (&flags, 0, sizeof(flags));
+
+  // Enable widget by default
+  flags.active = true;
 
   widget_object = true;
 
@@ -124,7 +125,7 @@ FWidget::~FWidget()  // destructor
     setClickedWidget(0);
 
   // unset the local window widget focus
-  if ( focus )
+  if ( flags.focus )
   {
     if ( FWindow* window = FWindow::getWindowWidget(this) )
       window->setWindowFocusWidget(0);
@@ -276,12 +277,7 @@ void FWidget::setMainWidget (FWidget* obj)
 //----------------------------------------------------------------------
 bool FWidget::setEnable (bool on)
 {
-  if ( on )
-    flags |= fc::active;
-  else
-    flags &= ~fc::active;
-
-  return enable = on;
+  return (flags.active = on);
 }
 
 //----------------------------------------------------------------------
@@ -290,21 +286,16 @@ bool FWidget::setFocus (bool on)
   FWindow* window;
   FWidget* last_focus;
 
-  if ( ! enable )
+  if ( ! isEnabled() )
     return false;
 
-  if ( on )
-    flags |= fc::focus;
-  else
-    flags &= ~fc::focus;
-
-  if ( on == focus )
+  if ( flags.focus == on )
     return true;
 
   last_focus = FWidget::getFocusWidget();
 
   // set widget focus
-  if ( on && ! focus )
+  if ( on && ! flags.focus )
   {
     int focusable_children = numOfFocusableChildren();
 
@@ -334,7 +325,7 @@ bool FWidget::setFocus (bool on)
     window->setWindowFocusWidget(this);
   }
 
-  return focus = on;
+  return (flags.focus = on);
 }
 
 //----------------------------------------------------------------------
@@ -659,7 +650,7 @@ bool FWidget::setCursorPos (int x, int y)
 
   widget_cursor_position.setPoint(x, y);
 
-  if ( (flags & fc::focus) == 0 || isWindowWidget() )
+  if ( ! flags.focus || isWindowWidget() )
     return false;
 
   if ( ! FWindow::getWindowWidget(this) )
@@ -856,7 +847,7 @@ bool FWidget::close()
     {
       hide();
 
-      if ( (flags & fc::modal) == 0 )
+      if ( ! flags.modal )
         close_widget->push_back(this);
     }
     return true;
@@ -1266,13 +1257,11 @@ void FWidget::move (int dx, int dy)
 //----------------------------------------------------------------------
 void FWidget::drawShadow()
 {
-  bool trans_shadow = ((flags & fc::trans_shadow) != 0);
-
-  if ( isMonochron() && ! trans_shadow )
+  if ( isMonochron() && ! flags.trans_shadow )
     return;
 
-  if ( (getEncoding() == fc::VT100 && ! trans_shadow)
-    || (getEncoding() == fc::ASCII && ! trans_shadow) )
+  if ( (getEncoding() == fc::VT100 && ! flags.trans_shadow)
+    || (getEncoding() == fc::ASCII && ! flags.trans_shadow) )
   {
     clearShadow();
     return;
@@ -1283,7 +1272,7 @@ void FWidget::drawShadow()
     , y1 = 1
     , y2 = int(getHeight());
 
-  if ( trans_shadow )
+  if ( flags.trans_shadow )
   {
     // transparent shadow
     drawTransparentShadow (x1, y1, x2, y2);
diff --git a/src/fwindow.cpp b/src/fwindow.cpp
index 2adcd7be..09834c93 100644
--- a/src/fwindow.cpp
+++ b/src/fwindow.cpp
@@ -93,16 +93,12 @@ bool FWindow::setWindowWidget (bool on)
   if ( isWindowWidget() == on )
     return true;
 
+  flags.window_widget = on;
+
   if ( on )
-  {
-    flags |= fc::window_widget;
     setTermOffset();
-  }
   else
-  {
-    flags &= ~fc::window_widget;
     setParentOffset();
-  }
 
   return on;
 }
@@ -179,29 +175,18 @@ void FWindow::unsetActiveWindow()
 //----------------------------------------------------------------------
 bool FWindow::setResizeable (bool on)
 {
-  if ( on )
-    flags |= fc::resizeable;
-  else
-    flags &= ~fc::resizeable;
-
-  return on;
+  return (flags.resizeable = on);
 }
 
 //----------------------------------------------------------------------
 bool FWindow::setTransparentShadow (bool on)
 {
+  flags.shadow = flags.trans_shadow = on;
+
   if ( on )
-  {
-    flags |= fc::shadow;
-    flags |= fc::trans_shadow;
     setShadowSize (2,1);
-  }
   else
-  {
-    flags &= ~fc::shadow;
-    flags &= ~fc::trans_shadow;
     setShadowSize (0,0);
-  }
 
   return on;
 }
@@ -214,14 +199,14 @@ bool FWindow::setShadow (bool on)
 
   if ( on )
   {
-    flags |= fc::shadow;
-    flags &= ~fc::trans_shadow;
+    flags.shadow = true;
+    flags.trans_shadow = false;
     setShadowSize (1,1);
   }
   else
   {
-    flags &= ~fc::shadow;
-    flags &= ~fc::trans_shadow;
+    flags.shadow = false;
+    flags.trans_shadow = false;
     setShadowSize (0,0);
   }
 
@@ -234,10 +219,10 @@ bool FWindow::setAlwaysOnTop (bool on)
   if ( isAlwaysOnTop() == on )
     return true;
 
+  flags.always_on_top = on;
+
   if ( on )
   {
-    flags |= fc::always_on_top;
-
     if ( always_on_top_list )
     {
       deleteFromAlwaysOnTopList (this);
@@ -245,10 +230,7 @@ bool FWindow::setAlwaysOnTop (bool on)
     }
   }
   else
-  {
-    flags &= ~fc::always_on_top;
     deleteFromAlwaysOnTopList (this);
-  }
 
   return on;
 }
@@ -580,10 +562,10 @@ void FWindow::swapWindow (FWidget* obj1, FWidget* obj2)
   if ( window_list->empty() )
     return;
 
-  if ( (obj1->getFlags() & fc::modal) != 0 )
+  if ( obj1->getFlags().modal )
     return;
 
-  if ( (obj2->getFlags() & fc::modal) != 0 )
+  if ( obj2->getFlags().modal )
     return;
 
   iter  = window_list->begin();
@@ -623,7 +605,7 @@ bool FWindow::raiseWindow (FWidget* obj)
   if ( window_list->back() == obj )
     return false;
 
-  if ( (window_list->back()->getFlags() & fc::modal) != 0
+  if ( window_list->back()->getFlags().modal
     && ! obj->isMenuWidget() )
     return false;
 
@@ -665,7 +647,7 @@ bool FWindow::lowerWindow (FWidget* obj)
   if ( window_list->front() == obj )
     return false;
 
-  if ( (obj->getFlags() & fc::modal) != 0 )
+  if ( obj->getFlags().modal )
     return false;
 
   iter = window_list->begin();
diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h
index ca19690c..93814dde 100644
--- a/src/include/final/fbutton.h
+++ b/src/include/final/fbutton.h
@@ -265,7 +265,7 @@ inline bool FButton::unsetClickAnimation()
 
 //----------------------------------------------------------------------
 inline bool FButton::isFlat() const
-{ return ((flags & fc::flat) != 0); }
+{ return flags.flat; }
 
 //----------------------------------------------------------------------
 inline bool FButton::isDown() const
@@ -273,7 +273,7 @@ inline bool FButton::isDown() const
 
 //----------------------------------------------------------------------
 inline bool FButton::hasShadow() const
-{ return ((flags & fc::shadow) != 0); }
+{ return flags.shadow; }
 
 //----------------------------------------------------------------------
 inline bool FButton::hasClickAnimation()
diff --git a/src/include/final/fc.h b/src/include/final/fc.h
index 9613c1f8..2d8ca33e 100644
--- a/src/include/final/fc.h
+++ b/src/include/final/fc.h
@@ -79,24 +79,6 @@ enum events
   Timer_Event               // timer event occur
 };
 
-// Properties of a widget ⚑
-enum widget_flags
-{
-  shadow        = 0x00000001,
-  trans_shadow  = 0x00000002,
-  active        = 0x00000004,
-  focus         = 0x00000008,
-  scrollable    = 0x00000010,
-  resizeable    = 0x00000020,
-  modal         = 0x00000040,
-  window_widget = 0x00000080,
-  dialog_widget = 0x00000100,
-  menu_widget   = 0x00000200,
-  always_on_top = 0x00000400,
-  flat          = 0x00000800,
-  no_underline  = 0x00001000
-};
-
 // Internal character encoding
 enum encoding
 {
diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h
index a129c9f5..c1540a77 100644
--- a/src/include/final/fdialog.h
+++ b/src/include/final/fdialog.h
@@ -282,11 +282,11 @@ inline void FDialog::setText (const FString& txt)
 
 //----------------------------------------------------------------------
 inline bool FDialog::isModal()
-{ return ((flags & fc::modal) != 0); }
+{ return flags.modal; }
 
 //----------------------------------------------------------------------
 inline bool FDialog::isScrollable()
-{ return ((flags & fc::scrollable) != 0); }
+{ return flags.scrollable; }
 
 }  // namespace finalcut
 
diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h
index ef71e174..45c065c3 100644
--- a/src/include/final/flineedit.h
+++ b/src/include/final/flineedit.h
@@ -227,7 +227,7 @@ inline bool FLineEdit::unsetShadow()
 
 //----------------------------------------------------------------------
 inline bool FLineEdit::hasShadow()
-{ return ((flags & fc::shadow) != 0); }
+{ return flags.shadow; }
 
 }  // namespace finalcut
 
diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h
index c0861719..cc1bed21 100644
--- a/src/include/final/fprogressbar.h
+++ b/src/include/final/fprogressbar.h
@@ -129,7 +129,7 @@ inline bool FProgressbar::unsetShadow()
 
 //----------------------------------------------------------------------
 inline bool FProgressbar::hasShadow()
-{ return ((flags & fc::shadow) != 0); }
+{ return flags.shadow; }
 
 }  // namespace finalcut
 
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index 03caf45e..daa55ec2 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -142,6 +142,8 @@ class FWidget : public FVTerm, public FObject
     typedef void (FWidget::*FMemberCallback)(FWidget*, data_ptr);
     typedef std::vector Accelerators;
 
+    struct widget_flags;  // forward declaration
+
     // Constructor
     explicit FWidget (FWidget* = 0, bool = false);
 
@@ -188,7 +190,7 @@ class FWidget : public FVTerm, public FObject
     const FRect&       getTermGeometryWithShadow();
     std::size_t        getDesktopWidth();
     std::size_t        getDesktopHeight();
-    int                getFlags() const;
+    widget_flags       getFlags() const;
     FPoint             getCursorPos();
     FPoint             getPrintPos();
     std::vector& doubleFlatLine_ref (fc::sides);
@@ -373,7 +375,24 @@ class FWidget : public FVTerm, public FObject
     virtual void       onClose (FCloseEvent*);
 
     // Data Members
-    int                   flags;
+    struct widget_flags  // Properties of a widget ⚑
+    {
+      uInt32 shadow        : 1;
+      uInt32 trans_shadow  : 1;
+      uInt32 active        : 1;
+      uInt32 focus         : 1;
+      uInt32 scrollable    : 1;
+      uInt32 resizeable    : 1;
+      uInt32 modal         : 1;
+      uInt32 window_widget : 1;
+      uInt32 dialog_widget : 1;
+      uInt32 menu_widget   : 1;
+      uInt32 always_on_top : 1;
+      uInt32 flat          : 1;
+      uInt32 no_underline  : 1;
+      uInt32               : 19;  // padding bits
+    } flags;
+
     static uInt           modal_dialogs;
     static FWidgetColors  wc;
     static widgetList*    dialog_list;
@@ -407,10 +426,8 @@ class FWidget : public FVTerm, public FObject
     static void        setColorTheme();
 
     // Data Members
-    bool               enable;
     bool               visible;
     bool               shown;
-    bool               focus;
     bool               focusable;
     bool               visible_cursor;
     FPoint             widget_cursor_position;
@@ -685,7 +702,7 @@ inline std::size_t FWidget::getDesktopHeight()
 { return getLineNumber(); }
 
 //----------------------------------------------------------------------
-inline int FWidget::getFlags() const
+inline FWidget::widget_flags FWidget::getFlags() const
 { return flags; }
 
 //----------------------------------------------------------------------
@@ -873,19 +890,19 @@ inline bool FWidget::isShown() const
 
 //----------------------------------------------------------------------
 inline bool FWidget::isWindowWidget() const
-{ return ((flags & fc::window_widget) != 0); }
+{ return flags.window_widget; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::isDialogWidget() const
-{ return ((flags & fc::dialog_widget) != 0); }
+{ return flags.dialog_widget; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::isMenuWidget() const
-{ return ((flags & fc::menu_widget) != 0); }
+{ return flags.menu_widget; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::isEnabled() const
-{ return enable; }
+{ return flags.active; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::hasVisibleCursor() const
@@ -893,7 +910,7 @@ inline bool FWidget::hasVisibleCursor() const
 
 //----------------------------------------------------------------------
 inline bool FWidget::hasFocus() const
-{ return focus; }
+{ return flags.focus; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::acceptFocus() const  // is focusable
diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h
index 5639fc51..ecc4a6d1 100644
--- a/src/include/final/fwindow.h
+++ b/src/include/final/fwindow.h
@@ -250,19 +250,19 @@ inline bool FWindow::isWindowActive() const
 
 //----------------------------------------------------------------------
 inline bool FWindow::isResizeable() const
-{ return ((flags & fc::resizeable) != 0); }
+{ return flags.resizeable; }
 
 //----------------------------------------------------------------------
 inline bool FWindow::isAlwaysOnTop() const
-{ return ((flags & fc::always_on_top) != 0); }
+{ return flags.always_on_top; }
 
 //----------------------------------------------------------------------
 inline bool FWindow::hasTransparentShadow() const
-{ return ((flags & fc::trans_shadow) != 0); }
+{ return flags.trans_shadow; }
 
 //----------------------------------------------------------------------
 inline bool FWindow::hasShadow() const
-{ return ((flags & fc::shadow) != 0); }
+{ return flags.shadow; }
 
 //----------------------------------------------------------------------
 inline FWindow* FWindow::getWindowWidgetAt (const FPoint& pos)

From f7a75247efaa62414c7cf9019362b1be61c6641b Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sun, 4 Nov 2018 23:12:41 +0100
Subject: [PATCH 19/33] struct widget_flags is now a public type

---
 src/fwidget.cpp             |  6 +++---
 src/include/final/fwidget.h | 37 ++++++++++++++++++-------------------
 2 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/src/fwidget.cpp b/src/fwidget.cpp
index ea385037..0630b577 100644
--- a/src/fwidget.cpp
+++ b/src/fwidget.cpp
@@ -1023,7 +1023,7 @@ void FWidget::redraw()
     setColor (wc.term_fg, wc.term_bg);
     clearArea (vdesktop);
   }
-  else if ( ! visible )
+  else if ( ! isVisible() )
     return;
 
   draw();
@@ -1070,7 +1070,7 @@ void FWidget::resize()
 //----------------------------------------------------------------------
 void FWidget::show()
 {
-  if ( ! visible )
+  if ( ! isVisible() )
     return;
 
   if ( ! init_desktop )
@@ -1127,7 +1127,7 @@ void FWidget::show()
 //----------------------------------------------------------------------
 void FWidget::hide()
 {
-  if ( visible )
+  if ( isVisible() )
   {
     visible = false;
     shown = false;
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index daa55ec2..c801e59e 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -142,7 +142,23 @@ class FWidget : public FVTerm, public FObject
     typedef void (FWidget::*FMemberCallback)(FWidget*, data_ptr);
     typedef std::vector Accelerators;
 
-    struct widget_flags;  // forward declaration
+    struct widget_flags  // Properties of a widget ⚑
+    {
+      uInt32 shadow        : 1;
+      uInt32 trans_shadow  : 1;
+      uInt32 active        : 1;
+      uInt32 focus         : 1;
+      uInt32 scrollable    : 1;
+      uInt32 resizeable    : 1;
+      uInt32 modal         : 1;
+      uInt32 window_widget : 1;
+      uInt32 dialog_widget : 1;
+      uInt32 menu_widget   : 1;
+      uInt32 always_on_top : 1;
+      uInt32 flat          : 1;
+      uInt32 no_underline  : 1;
+      uInt32               : 19;  // padding bits
+    };
 
     // Constructor
     explicit FWidget (FWidget* = 0, bool = false);
@@ -375,24 +391,7 @@ class FWidget : public FVTerm, public FObject
     virtual void       onClose (FCloseEvent*);
 
     // Data Members
-    struct widget_flags  // Properties of a widget ⚑
-    {
-      uInt32 shadow        : 1;
-      uInt32 trans_shadow  : 1;
-      uInt32 active        : 1;
-      uInt32 focus         : 1;
-      uInt32 scrollable    : 1;
-      uInt32 resizeable    : 1;
-      uInt32 modal         : 1;
-      uInt32 window_widget : 1;
-      uInt32 dialog_widget : 1;
-      uInt32 menu_widget   : 1;
-      uInt32 always_on_top : 1;
-      uInt32 flat          : 1;
-      uInt32 no_underline  : 1;
-      uInt32               : 19;  // padding bits
-    } flags;
-
+    struct widget_flags   flags;
     static uInt           modal_dialogs;
     static FWidgetColors  wc;
     static widgetList*    dialog_list;

From baabf9546ea41c6d3584868ee148aacec61dd30b Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Mon, 5 Nov 2018 23:19:03 +0100
Subject: [PATCH 20/33] FButton now uses the widget flags directly

---
 ChangeLog                       |  3 ++
 examples/windows.cpp            |  2 +-
 src/fbutton.cpp                 | 51 +++++++++++----------------
 src/fscrollview.cpp             |  4 +--
 src/fstatusbar.cpp              |  2 +-
 src/fvterm.cpp                  | 52 ++++++++++++++--------------
 src/fwidget.cpp                 | 25 ++++++--------
 src/fwindow.cpp                 |  2 +-
 src/include/final/fbutton.h     | 15 ++------
 src/include/final/flistview.h   |  2 +-
 src/include/final/fmessagebox.h |  2 +-
 src/include/final/fwidget.h     | 61 +++++++++++++++++----------------
 12 files changed, 101 insertions(+), 120 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a1e7af99..d05b7fa1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-05  Markus Gans  
+	* FButton now uses the widget flags directly
+
 2018-11-04  Markus Gans  
 	* Widget flags are now stored in a bit field
 
diff --git a/examples/windows.cpp b/examples/windows.cpp
index 4e2005a0..cbd89f84 100644
--- a/examples/windows.cpp
+++ b/examples/windows.cpp
@@ -285,7 +285,7 @@ Window::Window (finalcut::FWidget* parent)
   for (int n = 1; n <= 6; n++)
   {
     win_data* win_dat = new win_data;
-    win_dat->title.sprintf("Window %d", n);
+    win_dat->title.sprintf("Window %1d", n);
     windows.push_back(win_dat);
   }
 }
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index abe5a607..144d88b2 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -37,6 +37,7 @@ FButton::FButton(FWidget* parent)
   : FWidget(parent)
   , text()
   , button_down(false)
+  , active_focus(false)
   , click_animation(true)
   , click_time(150)
   , space_char(int(' '))
@@ -52,7 +53,6 @@ FButton::FButton(FWidget* parent)
   , button_focus_bg(wc.button_active_focus_bg)
   , button_inactive_fg(wc.button_inactive_fg)
   , button_inactive_bg(wc.button_inactive_bg)
-  , is()
 {
   init();
 }
@@ -62,6 +62,7 @@ FButton::FButton (const FString& txt, FWidget* parent)
   : FWidget(parent)
   , text(txt)
   , button_down(false)
+  , active_focus(false)
   , click_animation(true)
   , click_time(150)
   , space_char(int(' '))
@@ -77,7 +78,6 @@ FButton::FButton (const FString& txt, FWidget* parent)
   , button_focus_bg(wc.button_active_focus_bg)
   , button_inactive_fg(wc.button_inactive_fg)
   , button_inactive_bg(wc.button_inactive_bg)
-  , is()
 {
   init();
   detectHotkey();
@@ -453,17 +453,6 @@ void FButton::init()
   setShadow();
 }
 
-//----------------------------------------------------------------------
-void FButton::getButtonState()
-{
-  is.active_focus = flags.active && flags.focus;
-  is.active = flags.active;
-  is.focus = flags.focus;
-  is.flat = isFlat();
-  is.non_flat_shadow = ! flags.flat && flags.shadow;
-  is.no_underline = flags.no_underline;
-}
-
 //----------------------------------------------------------------------
 uChar FButton::getHotkey()
 {
@@ -551,7 +540,7 @@ inline std::size_t FButton::clickAnimationIndent (FWidget* parent_widget)
     return 0;
 
   // noshadow + indent one character to the right
-  if ( is.flat )
+  if ( flags.flat )
     clearFlatBorder();
   else if ( hasShadow() )
     clearShadow();
@@ -588,7 +577,7 @@ inline void FButton::clearRightMargin (FWidget* parent_widget)
     setPrintPos (1 + int(getWidth()), y);
     print (' ');  // clear right
 
-    if ( is.active && isMonochron() )
+    if ( flags.active && isMonochron() )
       setReverse(false);  // Dark background
   }
 }
@@ -604,7 +593,7 @@ inline void FButton::drawMarginLeft()
   {
     setPrintPos (1 + int(indent), 1 + int(y));
 
-    if ( isMonochron() && is.active_focus && y == vcenter_offset )
+    if ( isMonochron() && active_focus && y == vcenter_offset )
       print (fc::BlackRightPointingPointer);  // ►
     else
       print (space_char);  // full block █
@@ -620,7 +609,7 @@ inline void FButton::drawMarginRight()
   {
     setPrintPos (int(getWidth() + indent), 1 + int(y));
 
-    if ( isMonochron() && is.active_focus && y == vcenter_offset )
+    if ( isMonochron() && active_focus && y == vcenter_offset )
       print (fc::BlackLeftPointingPointer);   // ◄
     else
       print (space_char);  // full block █
@@ -675,32 +664,32 @@ inline void FButton::drawButtonTextLine (wchar_t button_text[])
     setCursorPos ( 2 + int(center_offset + hotkeypos)
                  , 1 + int(vcenter_offset) );  // hotkey
 
-  if ( ! is.active && isMonochron() )
+  if ( ! flags.active && isMonochron() )
    setReverse(true);  // Light background
 
-  if ( is.active_focus && (isMonochron() || getMaxColor() < 16) )
+  if ( active_focus && (isMonochron() || getMaxColor() < 16) )
     setBold();
 
   for ( std::size_t z = 0
       ; pos < center_offset + txtlength && z < getWidth() - 2
       ; z++, pos++)
   {
-    if ( z == hotkeypos && is.active )
+    if ( z == hotkeypos && flags.active )
     {
       setColor (button_hotkey_fg, button_bg);
 
-      if ( ! is.active_focus && getMaxColor() < 16 )
+      if ( ! active_focus && getMaxColor() < 16 )
         setBold();
 
-      if ( ! is.no_underline )
+      if ( ! flags.no_underline )
         setUnderline();
 
       print (button_text[z]);
 
-      if ( ! is.active_focus && getMaxColor() < 16 )
+      if ( ! active_focus && getMaxColor() < 16 )
         unsetBold();
 
-      if ( ! is.no_underline )
+      if ( ! flags.no_underline )
         unsetUnderline();
 
       setColor (button_fg, button_bg);
@@ -718,7 +707,7 @@ inline void FButton::drawButtonTextLine (wchar_t button_text[])
     print (L"..");
   }
 
-  if ( is.active_focus && (isMonochron() || getMaxColor() < 16) )
+  if ( active_focus && (isMonochron() || getMaxColor() < 16) )
     unsetBold();
 
   for (pos = center_offset + txtlength; pos < getWidth() - 2; pos++)
@@ -732,7 +721,7 @@ void FButton::draw()
   FWidget* parent_widget = getParentWidget();
   txtlength = text.getLength();
   space_char = int(' ');
-  getButtonState();
+  active_focus = flags.active && flags.focus;
 
   try
   {
@@ -753,13 +742,13 @@ void FButton::draw()
   // Clear right margin after animation
   clearRightMargin (parent_widget);
 
-  if ( ! is.active && isMonochron() )
+  if ( ! flags.active && isMonochron() )
     space_char = fc::MediumShade;  // ▒ simulates greyed out at Monochron
 
-  if ( isMonochron() && (is.active || is.focus) )
+  if ( isMonochron() && (flags.active || flags.focus) )
     setReverse(false);  // Dark background
 
-  if ( is.flat && ! button_down )
+  if ( flags.flat && ! button_down )
     drawFlatBorder();
 
   hotkeypos = getHotkeyPos(text.wc_str(), button_text, uInt(txtlength));
@@ -785,7 +774,7 @@ void FButton::draw()
   drawTopBottomBackground();
 
   // Draw button shadow
-  if ( is.non_flat_shadow && ! button_down )
+  if ( ! flags.flat && flags.shadow && ! button_down )
     drawShadow();
 
   if ( isMonochron() )
@@ -798,7 +787,7 @@ void FButton::draw()
 //----------------------------------------------------------------------
 void FButton::updateStatusBar()
 {
-  if ( ! is.focus || ! getStatusBar() )
+  if ( ! flags.focus || ! getStatusBar() )
     return;
 
   const FString& msg = getStatusbarMessage();
diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp
index 1cc6e658..3ace1b1a 100644
--- a/src/fscrollview.cpp
+++ b/src/fscrollview.cpp
@@ -288,13 +288,13 @@ void FScrollView::setPrintPos (int x, int y)
 //----------------------------------------------------------------------
 bool FScrollView::setViewportPrint (bool on)
 {
-  return use_own_print_area = ! on;
+  return (use_own_print_area = ! on);
 }
 
 //----------------------------------------------------------------------
 bool FScrollView::setBorder (bool on)
 {
-  return border = on;
+  return (border = on);
 }
 
 //----------------------------------------------------------------------
diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp
index 8011a876..7b783782 100644
--- a/src/fstatusbar.cpp
+++ b/src/fstatusbar.cpp
@@ -99,7 +99,7 @@ bool FStatusKey::setMouseFocus(bool on)
   if ( on == mouse_focus )
     return true;
 
-  return mouse_focus = on;
+  return (mouse_focus = on);
 }
 
 
diff --git a/src/fvterm.cpp b/src/fvterm.cpp
index 943674ec..e91533fb 100644
--- a/src/fvterm.cpp
+++ b/src/fvterm.cpp
@@ -858,7 +858,7 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
       int xpos = x + tx;
       tc = &vterm->text[ypos * vterm->width + xpos];
       sc = generateCharacter(xpos, ypos);
-      std::memcpy (tc, &sc, sizeof(charData));
+      std::memcpy (tc, &sc, sizeof(sc));
     }
 
     if ( short(vterm->changes[ypos].xmin) > x )
@@ -959,7 +959,7 @@ void FVTerm::updateOverlappedColor ( term_area* area
   charData* tc = &vterm->text[ty * vterm->width + tx];
   // New character
   charData nc;
-  std::memcpy (&nc, ac, sizeof(charData));
+  std::memcpy (&nc, ac, sizeof(*ac));
   // Overlapped character
   charData oc = getOverlappedCharacter (tx + 1, ty + 1, area->widget);
   nc.fg_color = oc.fg_color;
@@ -976,7 +976,7 @@ void FVTerm::updateOverlappedColor ( term_area* area
     nc.code = ' ';
 
   nc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == nc);
-  std::memcpy (tc, &nc, sizeof(charData));
+  std::memcpy (tc, &nc, sizeof(nc));
 }
 
 //----------------------------------------------------------------------
@@ -989,7 +989,7 @@ void FVTerm::updateOverlappedCharacter (term_area* area, int tx, int ty)
   // Overlapped character
   charData oc = getCoveredCharacter (tx + 1, ty + 1, area->widget);
   oc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == oc);
-  std::memcpy (tc, &oc, sizeof(charData));
+  std::memcpy (tc, &oc, sizeof(oc));
 }
 
 //----------------------------------------------------------------------
@@ -1021,7 +1021,7 @@ void FVTerm::updateShadedCharacter ( term_area* area
     oc.code = ' ';
 
   oc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == oc);
-  std::memcpy (tc, &oc, sizeof(charData));
+  std::memcpy (tc, &oc, sizeof(oc));
 }
 
 //----------------------------------------------------------------------
@@ -1039,12 +1039,12 @@ void FVTerm::updateInheritBackground ( term_area* area
   charData* tc = &vterm->text[ty * vterm->width + tx];
   // New character
   charData nc;
-  std::memcpy (&nc, ac, sizeof(charData));
+  std::memcpy (&nc, ac, sizeof(*ac));
   // Covered character
   charData cc = getCoveredCharacter (tx + 1, ty + 1, area->widget);
   nc.bg_color = cc.bg_color;
   nc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == nc);
-  std::memcpy (tc, &nc, sizeof(charData));
+  std::memcpy (tc, &nc, sizeof(nc));
 }
 
 //----------------------------------------------------------------------
@@ -1060,7 +1060,7 @@ void FVTerm::updateCharacter ( term_area* area
   charData* ac = &area->text[y * line_len + x];
   // Terminal character
   charData* tc = &vterm->text[ty * vterm->width + tx];
-  std::memcpy (tc, ac, sizeof(charData));
+  std::memcpy (tc, ac, sizeof(*ac));
 
   if ( tc->attr.bit.printed && *tc == *ac )
     tc->attr.bit.no_changes = true;
@@ -1388,7 +1388,7 @@ void FVTerm::getArea (int ax, int ay, term_area* area)
     charData* ac;  // area character
     tc = &vterm->text[(ay + y) * vterm->width + ax];
     ac = &area->text[y * area->width];
-    std::memcpy (ac, tc, sizeof(charData) * unsigned(length));
+    std::memcpy (ac, tc, sizeof(*tc) * unsigned(length));
 
     if ( short(area->changes[y].xmin) > 0 )
       area->changes[y].xmin = 0;
@@ -1444,7 +1444,7 @@ void FVTerm::getArea (int x, int y, int w, int h, term_area* area)
     int line_len = area->width + area->right_shadow;
     tc = &vterm->text[(y + _y - 1) * vterm->width + x - 1];
     ac = &area->text[(dy + _y) * line_len + dx];
-    std::memcpy (ac, tc, sizeof(charData) * unsigned(length));
+    std::memcpy (ac, tc, sizeof(*tc) * unsigned(length));
 
     if ( short(area->changes[dy + _y].xmin) > dx )
       area->changes[dy + _y].xmin = uInt(dx);
@@ -1572,14 +1572,14 @@ void FVTerm::scrollAreaForward (term_area* area)
     int pos2 = (y + 1) * total_width;
     sc = &area->text[pos2];
     dc = &area->text[pos1];
-    std::memcpy (dc, sc, sizeof(charData) * unsigned(length));
+    std::memcpy (dc, sc, sizeof(*sc) * unsigned(length));
     area->changes[y].xmin = 0;
     area->changes[y].xmax = uInt(area->width - 1);
   }
 
   // insert a new line below
   lc = &area->text[(y_max * total_width) - area->right_shadow - 1];
-  std::memcpy (&nc, lc, sizeof(charData));
+  std::memcpy (&nc, lc, sizeof(*lc));
   nc.code = ' ';
   dc = &area->text[y_max * total_width];
   std::fill_n (dc, area->width, nc);
@@ -1633,14 +1633,14 @@ void FVTerm::scrollAreaReverse (term_area* area)
     int pos2 = y * total_width;
     sc = &area->text[pos1];
     dc = &area->text[pos2];
-    std::memcpy (dc, sc, sizeof(charData) * unsigned(length));
+    std::memcpy (dc, sc, sizeof(*sc) * unsigned(length));
     area->changes[y].xmin = 0;
     area->changes[y].xmax = uInt(area->width - 1);
   }
 
   // insert a new line above
   lc = &area->text[total_width];
-  std::memcpy (&nc, lc, sizeof(charData));
+  std::memcpy (&nc, lc, sizeof(*lc));
   nc.code = ' ';
   dc = &area->text[0];
   std::fill_n (dc, area->width, nc);
@@ -1675,7 +1675,7 @@ void FVTerm::clearArea (term_area* area, int fillchar)
   uInt w;
 
   // Current attributes with a space character
-  std::memcpy (&nc, &next_attribute, sizeof(charData));
+  std::memcpy (&nc, &next_attribute, sizeof(next_attribute));
   nc.code = fillchar;
 
   if ( ! (area && area->text) )
@@ -1770,7 +1770,7 @@ FVTerm::charData FVTerm::generateCharacter (int x, int y)
         if ( tmp->attr.bit.trans_shadow )  // Transparent shadow
         {
           // Keep the current vterm character
-          std::memcpy (&s_ch, sc, sizeof(charData));
+          std::memcpy (&s_ch, sc, sizeof(*sc));
           s_ch.fg_color = tmp->fg_color;
           s_ch.bg_color = tmp->bg_color;
           s_ch.attr.bit.reverse  = false;
@@ -1789,7 +1789,7 @@ FVTerm::charData FVTerm::generateCharacter (int x, int y)
         else if ( tmp->attr.bit.inherit_bg )
         {
           // Add the covered background to this character
-          std::memcpy (&i_ch, tmp, sizeof(charData));
+          std::memcpy (&i_ch, tmp, sizeof(*tmp));
           i_ch.bg_color = sc->bg_color;  // Last background color
           sc = &i_ch;
         }
@@ -2007,7 +2007,7 @@ void FVTerm::init (bool disable_alt_screen)
   term_attribute.attr.byte[0] = 0;
 
   // next_attribute contains the state of the next printed character
-  std::memcpy (&next_attribute, &term_attribute, sizeof(charData));
+  std::memcpy (&next_attribute, &term_attribute, sizeof(term_attribute));
 
   // Receive the terminal capabilities
   tcap = FTermcap::getTermcapMap();
@@ -2086,7 +2086,7 @@ void FVTerm::putAreaLine (charData* ac, charData* tc, int length)
 {
   // copy "length" characters from area to terminal
 
-  std::memcpy (tc, ac, sizeof(charData) * unsigned(length));
+  std::memcpy (tc, ac, sizeof(*ac) * unsigned(length));
 }
 
 //----------------------------------------------------------------------
@@ -2099,7 +2099,7 @@ void FVTerm::putAreaCharacter ( int x, int y, FVTerm* obj
     // Restore one character on vterm
     charData ch;
     ch = getCoveredCharacter (x, y, obj);
-    std::memcpy (tc, &ch, sizeof(charData));
+    std::memcpy (tc, &ch, sizeof(ch));
   }
   else  // Mot transparent
   {
@@ -2121,19 +2121,19 @@ void FVTerm::putAreaCharacter ( int x, int y, FVTerm* obj
         || ch.code == fc::FullBlock )
         ch.code = ' ';
 
-      std::memcpy (tc, &ch, sizeof(charData));
+      std::memcpy (tc, &ch, sizeof(ch));
     }
     else if ( ac->attr.bit.inherit_bg )
     {
       // Add the covered background to this character
       charData ch, cc;
-      std::memcpy (&ch, ac, sizeof(charData));
+      std::memcpy (&ch, ac, sizeof(*ac));
       cc = getCoveredCharacter (x, y, obj);
       ch.bg_color = cc.bg_color;
-      std::memcpy (tc, &ch, sizeof(charData));
+      std::memcpy (tc, &ch, sizeof(ch));
     }
     else  // Default
-      std::memcpy (tc, ac, sizeof(charData));
+      std::memcpy (tc, ac, sizeof(*ac));
   }
 }
 
@@ -2153,7 +2153,7 @@ void FVTerm::getAreaCharacter ( int x, int y, term_area* area
     if ( tmp->attr.bit.trans_shadow )  // transparent shadow
     {
       // Keep the current vterm character
-      std::memcpy (&s_ch, cc, sizeof(charData));
+      std::memcpy (&s_ch, cc, sizeof(*cc));
       s_ch.fg_color = tmp->fg_color;
       s_ch.bg_color = tmp->bg_color;
       s_ch.attr.bit.reverse  = false;
@@ -2163,7 +2163,7 @@ void FVTerm::getAreaCharacter ( int x, int y, term_area* area
     else if ( tmp->attr.bit.inherit_bg )
     {
       // Add the covered background to this character
-      std::memcpy (&i_ch, tmp, sizeof(charData));
+      std::memcpy (&i_ch, tmp, sizeof(*tmp));
       i_ch.bg_color = cc->bg_color;  // last background color
       cc = &i_ch;
     }
diff --git a/src/fwidget.cpp b/src/fwidget.cpp
index 0630b577..6eef3887 100644
--- a/src/fwidget.cpp
+++ b/src/fwidget.cpp
@@ -61,10 +61,6 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
   , flags()
   , callback_objects()
   , member_callback_objects()
-  , visible(true)
-  , shown(false)
-  , focusable(true)
-  , visible_cursor(true)
   , widget_cursor_position(-1, -1)
   , size_hints()
   , double_flatline_mask()
@@ -85,10 +81,11 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
   // init bit field with 0
   memset (&flags, 0, sizeof(flags));
 
-  // Enable widget by default
-  flags.active = true;
-
-  widget_object = true;
+  flags.active = true;          // Enable widget by default
+  flags.visible = true;         // A widget is visible by default
+  flags.focusable = true;       // A widget is focusable by default
+  flags.visible_cursor = true;  // A widget has a visible cursor by default
+  widget_object = true;         // This FObject is a widget
 
   if ( ! parent )
   {
@@ -104,7 +101,7 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
   }
   else
   {
-    visible_cursor = ! hideable;
+    flags.visible_cursor = ! hideable;
     offset = parent->client_offset;
     double_flatline_mask.top.resize (getWidth(), false);
     double_flatline_mask.right.resize (getHeight(), false);
@@ -671,7 +668,7 @@ bool FWidget::setCursorPos (int x, int y)
 
     setAreaCursor ( widget_offsetX + x
                   , widget_offsetY + y
-                  , visible_cursor
+                  , flags.visible_cursor
                   , area );
     return true;
   }
@@ -1092,7 +1089,7 @@ void FWidget::show()
   }
 
   draw();
-  shown = true;
+  flags.shown = true;
 
   if ( hasChildren() )
   {
@@ -1129,8 +1126,8 @@ void FWidget::hide()
 {
   if ( isVisible() )
   {
-    visible = false;
-    shown = false;
+    flags.visible = false;
+    flags.shown = false;
 
     if ( ! isDialogWidget()
       && FWidget::getFocusWidget() == this
@@ -1966,7 +1963,7 @@ void FWidget::init()
   }
 
   hideable = isCursorHideable();
-  visible_cursor = ! hideable;
+  flags.visible_cursor = ! hideable;
 
   // Determine width and height of the terminal
   detectTermSize();
diff --git a/src/fwindow.cpp b/src/fwindow.cpp
index 09834c93..679cd8c2 100644
--- a/src/fwindow.cpp
+++ b/src/fwindow.cpp
@@ -162,7 +162,7 @@ bool FWindow::activateWindow (bool on)
     active_area = getVWin();
   }
 
-  return window_active = on;
+  return (window_active = on);
 }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h
index 93814dde..3d65c06c 100644
--- a/src/include/final/fbutton.h
+++ b/src/include/final/fbutton.h
@@ -141,7 +141,6 @@ class FButton : public FWidget
 
     // Methods
     void         init();
-    void         getButtonState();
     uChar        getHotkey();
     void         setHotkeyAccelerator();
     void         detectHotkey();
@@ -160,6 +159,7 @@ class FButton : public FWidget
     // Data Members
     FString      text;
     bool         button_down;
+    bool         active_focus;
     bool         click_animation;
     int          click_time;
     int          space_char;
@@ -175,17 +175,6 @@ class FButton : public FWidget
     short        button_focus_bg;
     short        button_inactive_fg;
     short        button_inactive_bg;
-
-    struct state
-    {
-      uChar focus           : 1;
-      uChar active_focus    : 1;
-      uChar active          : 1;
-      uChar flat            : 1;
-      uChar non_flat_shadow : 1;
-      uChar no_underline    : 1;
-      uChar                 : 2;  // padding bits
-    } is;
 };
 #pragma pack(pop)
 
@@ -253,7 +242,7 @@ inline bool FButton::setUp()
 
 //----------------------------------------------------------------------
 inline bool FButton::setClickAnimation(bool on)
-{ return click_animation = on; }
+{ return (click_animation = on); }
 
 //----------------------------------------------------------------------
 inline bool FButton::setClickAnimation()
diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h
index e145b5f1..bcb209c5 100644
--- a/src/include/final/flistview.h
+++ b/src/include/final/flistview.h
@@ -479,7 +479,7 @@ inline void FListView::setUserDescendingCompare (Compare cmp)
 
 //----------------------------------------------------------------------
 inline bool FListView::setTreeView (bool on)
-{ return tree_view = on; }
+{ return (tree_view = on); }
 
 //----------------------------------------------------------------------
 inline bool FListView::setTreeView()
diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h
index a5cc497e..5d9dbc94 100644
--- a/src/include/final/fmessagebox.h
+++ b/src/include/final/fmessagebox.h
@@ -197,7 +197,7 @@ inline void FMessageBox::setTitlebarText (const FString& txt)
 
 //----------------------------------------------------------------------
 inline bool FMessageBox::setCenterText(bool on)
-{ return center_text = on; }
+{ return (center_text = on); }
 
 //----------------------------------------------------------------------
 inline bool FMessageBox::setCenterText()
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index c801e59e..63afd890 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -144,20 +144,24 @@ class FWidget : public FVTerm, public FObject
 
     struct widget_flags  // Properties of a widget ⚑
     {
-      uInt32 shadow        : 1;
-      uInt32 trans_shadow  : 1;
-      uInt32 active        : 1;
-      uInt32 focus         : 1;
-      uInt32 scrollable    : 1;
-      uInt32 resizeable    : 1;
-      uInt32 modal         : 1;
-      uInt32 window_widget : 1;
-      uInt32 dialog_widget : 1;
-      uInt32 menu_widget   : 1;
-      uInt32 always_on_top : 1;
-      uInt32 flat          : 1;
-      uInt32 no_underline  : 1;
-      uInt32               : 19;  // padding bits
+      uInt32 shadow         : 1;
+      uInt32 trans_shadow   : 1;
+      uInt32 active         : 1;
+      uInt32 visible        : 1;
+      uInt32 shown          : 1;
+      uInt32 focus          : 1;
+      uInt32 focusable      : 1;
+      uInt32 scrollable     : 1;
+      uInt32 resizeable     : 1;
+      uInt32 modal          : 1;
+      uInt32 visible_cursor : 1;
+      uInt32 window_widget  : 1;
+      uInt32 dialog_widget  : 1;
+      uInt32 menu_widget    : 1;
+      uInt32 always_on_top  : 1;
+      uInt32 flat           : 1;
+      uInt32 no_underline   : 1;
+      uInt32                : 15;  // padding bits
     };
 
     // Constructor
@@ -425,10 +429,6 @@ class FWidget : public FVTerm, public FObject
     static void        setColorTheme();
 
     // Data Members
-    bool               visible;
-    bool               shown;
-    bool               focusable;
-    bool               visible_cursor;
     FPoint             widget_cursor_position;
 
     struct widget_size_hints
@@ -734,7 +734,7 @@ inline void FWidget::setStatusbarMessage (const FString& msg)
 
 //----------------------------------------------------------------------
 inline bool FWidget::setVisible()
-{ return visible = true; }
+{ return (flags.visible = true); }
 
 //----------------------------------------------------------------------
 inline bool FWidget::setEnable()
@@ -750,7 +750,10 @@ inline bool FWidget::setDisable()
 
 //----------------------------------------------------------------------
 inline bool FWidget::setVisibleCursor (bool on)
-{ return visible_cursor = ( on ) ? true : (( hideable ) ? false : true); }
+{
+  flags.visible_cursor = ( on ) ? true : (( hideable ) ? false : true);
+  return flags.visible_cursor;
+}
 
 //----------------------------------------------------------------------
 inline bool FWidget::setVisibleCursor()
@@ -770,23 +773,23 @@ inline bool FWidget::unsetFocus()
 
 //----------------------------------------------------------------------
 inline void FWidget::setFocusable()
-{ focusable = true; }
+{ flags.focusable = true; }
 
 //----------------------------------------------------------------------
 inline void FWidget::unsetFocusable()
-{ focusable = false; }
+{ flags.focusable = false; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::ignorePadding (bool on)
-{ return ignore_padding = on; }
+{ return (ignore_padding = on); }
 
 //----------------------------------------------------------------------
 inline bool FWidget::ignorePadding()
-{ return ignore_padding = true; }
+{ return (ignore_padding = true); }
 
 //----------------------------------------------------------------------
 inline bool FWidget::acceptPadding()
-{ return ignore_padding = false; }
+{ return (ignore_padding = false); }
 
 //----------------------------------------------------------------------
 inline void FWidget::setForegroundColor (short color)
@@ -881,11 +884,11 @@ inline bool FWidget::isRootWidget() const
 
 //----------------------------------------------------------------------
 inline bool FWidget::isVisible() const
-{ return visible; }
+{ return flags.visible; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::isShown() const
-{ return shown; }
+{ return flags.shown; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::isWindowWidget() const
@@ -905,7 +908,7 @@ inline bool FWidget::isEnabled() const
 
 //----------------------------------------------------------------------
 inline bool FWidget::hasVisibleCursor() const
-{ return visible_cursor; }
+{ return flags.visible_cursor; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::hasFocus() const
@@ -913,7 +916,7 @@ inline bool FWidget::hasFocus() const
 
 //----------------------------------------------------------------------
 inline bool FWidget::acceptFocus() const  // is focusable
-{ return focusable; }
+{ return flags.focusable; }
 
 //----------------------------------------------------------------------
 inline bool FWidget::isPaddingIgnored()

From 9fc1910c18f0d5ce7b8deae3565ed35420085d7c Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Tue, 6 Nov 2018 01:27:08 +0100
Subject: [PATCH 21/33] strncpy boundary

---
 src/foptimove.cpp             | 6 +++---
 src/ftermdetection.cpp        | 6 +++---
 src/include/final/foptimove.h | 1 -
 src/include/final/ftermdata.h | 4 ++--
 test/fstring-test.cpp         | 2 +-
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/foptimove.cpp b/src/foptimove.cpp
index b190797c..571d8dcc 100644
--- a/src/foptimove.cpp
+++ b/src/foptimove.cpp
@@ -690,9 +690,9 @@ int FOptiMove::relativeMove ( char move[]
     if ( move )
     {
       if ( *move )
-        std::strncat (move, hmove, BUF_SIZE - std::strlen(move));
+        std::strncat (move, hmove, BUF_SIZE - std::strlen(move) - 1);
       else
-        std::strncpy (move, hmove, BUF_SIZE);
+        std::strncpy (move, hmove, BUF_SIZE - 1);
 
       move[BUF_SIZE - 1] = '\0';
     }
@@ -854,7 +854,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime
 
     if ( htime_r < htime )
     {
-      std::strncpy (hmove, str, BUF_SIZE);
+      std::strncpy (hmove, str, BUF_SIZE - 1);
       hmove[BUF_SIZE - 1] = '\0';
       htime = htime_r;
     }
diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp
index 8ee741c8..f9952421 100644
--- a/src/ftermdetection.cpp
+++ b/src/ftermdetection.cpp
@@ -145,7 +145,7 @@ void FTermDetection::getSystemTermType()
   }
 
   // 2nd fallback: use vt100 if not found
-  std::strncpy (termtype, C_STR("vt100"), 6);
+  std::strncpy (termtype, C_STR("vt100"), 5);
 }
 
 //----------------------------------------------------------------------
@@ -514,7 +514,7 @@ const FString FTermDetection::getXTermColorName (int color)
   int stdin_no = FTermios::getStdIn();
 
   char temp[512] = { };
-  std::fprintf (stdout, OSC "4;%d;?" BEL, color);  // get color
+  std::fprintf (stdout, OSC "4;%3d;?" BEL, color);  // get color
   std::fflush(stdout);
 
   FD_ZERO(&ifds);
@@ -579,7 +579,7 @@ char* FTermDetection::parseAnswerbackMsg (char current_termtype[])
   {
     std::strncpy ( termtype_Answerback
                  , new_termtype
-                 , sizeof(termtype_Answerback) );
+                 , sizeof(termtype_Answerback) - 1);
     termtype_Answerback[sizeof(termtype_Answerback) - 1] = '\0';
   }
 #endif  // DEBUG
diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h
index 70f38c74..4c946041 100644
--- a/src/include/final/foptimove.h
+++ b/src/include/final/foptimove.h
@@ -234,7 +234,6 @@ class FOptiMove
 
     bool        automatic_left_margin;
     bool        eat_nl_glitch;
-
     char        move_buf[BUF_SIZE];
     int         char_duration;
     int         baudrate;
diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h
index aa050ed4..6e09b686 100644
--- a/src/include/final/ftermdata.h
+++ b/src/include/final/ftermdata.h
@@ -363,7 +363,7 @@ inline void FTermData::setTermType (const char name[])
   if ( ! name )
     return;
 
-  std::strncpy (termtype, name, sizeof(termtype));
+  std::strncpy (termtype, name, sizeof(termtype) - 1);
   termtype[sizeof(termtype) - 1] = '\0';
 }
 
@@ -373,7 +373,7 @@ inline void FTermData::setTermFileName (const char file_name[])
   if ( ! file_name )
     return;
 
-  std::strncpy (termfilename, file_name, sizeof(termfilename));
+  std::strncpy (termfilename, file_name, sizeof(termfilename) - 1);
   termfilename[sizeof(termfilename) - 1] = '\0';
 }
 
diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp
index a61f5ee4..bbcf7d7b 100644
--- a/test/fstring-test.cpp
+++ b/test/fstring-test.cpp
@@ -1016,7 +1016,7 @@ void FStringTest::formatTest()
   str1.sprintf ("There are %d lions in the %s", num, location);
   CPPUNIT_ASSERT ( str1 == "There are 3 lions in the zoo" );
 
-  str1.sprintf (finalcut::FString("%d times"), 42);
+  str1.sprintf (finalcut::FString("%2d times"), 42);
   CPPUNIT_ASSERT ( str1 == "42 times" );
 
   finalcut::FString str2;

From cd8e4f78ae4c4472e80951746a5431c031ac6baf Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Wed, 7 Nov 2018 22:06:58 +0100
Subject: [PATCH 22/33] Use new type FColor for color values

---
 ChangeLog                         |   3 +
 examples/term-attributes.cpp      |  22 ++--
 src/fbutton.cpp                   |  14 +--
 src/foptiattr.cpp                 |  42 ++++----
 src/foptimove.cpp                 |  10 +-
 src/fterm.cpp                     |  11 +-
 src/ftermdetection.cpp            |   3 +-
 src/ftermlinux.cpp                |   4 +-
 src/fvterm.cpp                    |  56 +++++-----
 src/include/final/fbutton.h       |  14 +--
 src/include/final/fc.h            |   6 +-
 src/include/final/fcolorpalette.h |   2 +-
 src/include/final/foptiattr.h     |  20 ++--
 src/include/final/fterm.h         |   2 +-
 src/include/final/ftermlinux.h    |   4 +-
 src/include/final/ftypes.h        |   2 +
 src/include/final/fvterm.h        |   6 +-
 src/include/final/fwidget.h       |  12 +--
 src/include/final/fwidgetcolors.h | 168 +++++++++++++++---------------
 test/foptiattr-test.cpp           |   2 +-
 20 files changed, 210 insertions(+), 193 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d05b7fa1..3e5a9deb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-07  Markus Gans  
+	* Use new type FColor for color values
+
 2018-11-05  Markus Gans  
 	* FButton now uses the widget flags directly
 
diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp
index 2cd7b4cc..fd665e87 100644
--- a/examples/term-attributes.cpp
+++ b/examples/term-attributes.cpp
@@ -49,7 +49,7 @@ class AttribDlg : public finalcut::FDialog
     void cb_back (finalcut::FWidget* = 0, data_ptr = 0);
 
     // Data Members
-    short bgcolor;
+    FColor bgcolor;
 
   private:
     // Disable copy constructor
@@ -130,10 +130,12 @@ void AttribDlg::cb_next (finalcut::FWidget*, data_ptr)
   if ( isMonochron() )
     return;
 
-  bgcolor++;
-
-  if ( bgcolor >= getMaxColor() )
+  if ( bgcolor == FColor(getMaxColor() - 1) )
     bgcolor = finalcut::fc::Default;
+  else if ( bgcolor == finalcut::fc::Default )
+    bgcolor = 0;
+  else
+    bgcolor++;
 
   redraw();
 }
@@ -144,10 +146,12 @@ void AttribDlg::cb_back (finalcut::FWidget*, data_ptr)
   if ( isMonochron() )
     return;
 
-  bgcolor--;
-
-  if ( bgcolor < finalcut::fc::Default )
-    bgcolor = short(getMaxColor() - 1);
+  if ( bgcolor == 0 )
+    bgcolor = finalcut::fc::Default;
+  else if ( bgcolor == finalcut::fc::Default )
+    bgcolor = FColor(getMaxColor() - 1);
+  else
+    bgcolor--;
 
   redraw();
 }
@@ -466,7 +470,7 @@ void AttribDemo::draw()
     setColor(wc.label_fg, wc.label_bg);
 
   setPrintPos (1, 15);
-  short bg = static_cast(getParent())->bgcolor;
+  FColor bg = static_cast(getParent())->bgcolor;
   print (" Background color:");
 
   if ( bg == finalcut::fc::Default )
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index 144d88b2..e1412829 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -93,21 +93,21 @@ FButton::~FButton()  // destructor
 
 // public methods of FButton
 //----------------------------------------------------------------------
-void FButton::setForegroundColor (short color)
+void FButton::setForegroundColor (FColor color)
 {
   FWidget::setForegroundColor(color);
   updateButtonColor();
 }
 
 //----------------------------------------------------------------------
-void FButton::setBackgroundColor (short color)
+void FButton::setBackgroundColor (FColor color)
 {
   FWidget::setBackgroundColor(color);
   updateButtonColor();
 }
 
 //----------------------------------------------------------------------
-void FButton::setHotkeyForegroundColor (short color)
+void FButton::setHotkeyForegroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
@@ -115,7 +115,7 @@ void FButton::setHotkeyForegroundColor (short color)
 }
 
 //----------------------------------------------------------------------
-void FButton::setFocusForegroundColor (short color)
+void FButton::setFocusForegroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
@@ -125,7 +125,7 @@ void FButton::setFocusForegroundColor (short color)
 }
 
 //----------------------------------------------------------------------
-void FButton::setFocusBackgroundColor (short color)
+void FButton::setFocusBackgroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
@@ -135,7 +135,7 @@ void FButton::setFocusBackgroundColor (short color)
 }
 
 //----------------------------------------------------------------------
-void FButton::setInactiveForegroundColor (short color)
+void FButton::setInactiveForegroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
@@ -145,7 +145,7 @@ void FButton::setInactiveForegroundColor (short color)
 }
 
 //----------------------------------------------------------------------
-void FButton::setInactiveBackgroundColor (short color)
+void FButton::setInactiveBackgroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp
index 11f1dbf3..aa98d8d6 100644
--- a/src/foptiattr.cpp
+++ b/src/foptiattr.cpp
@@ -552,7 +552,7 @@ void FOptiAttr::initialize()
 }
 
 //----------------------------------------------------------------------
-short FOptiAttr::vga2ansi (short color)
+FColor FOptiAttr::vga2ansi (FColor color)
 {
   //   VGA   |  ANSI
   // i R G B | i B G R
@@ -574,7 +574,9 @@ short FOptiAttr::vga2ansi (short color)
   // 1 1 1 0 | 1 0 1 1
   // 1 1 1 1 | 1 1 1 1
 
-  if ( color >= 0 && color < 16 )
+  if ( color == fc::Default )
+    color = 0;
+  else if ( color < 16 )
   {
     static const short lookup_table[] =
     {
@@ -584,8 +586,6 @@ short FOptiAttr::vga2ansi (short color)
 
     color = lookup_table[color];
   }
-  else if ( color < 0 )
-    color = 0;
 
   return color;
 }
@@ -610,7 +610,7 @@ char* FOptiAttr::changeAttribute (charData*& term, charData*& next)
     next->code = ' ';
 
   // Look for no changes
-  if ( ! (switchOn() || switchOff() || colorChange(term, next)) )
+  if ( ! (switchOn() || switchOff() || hasColorChanged(term, next)) )
     return 0;
 
   if ( hasNoAttribute(next) )
@@ -1227,7 +1227,9 @@ void FOptiAttr::setAttributesOff (charData*& term)
 //----------------------------------------------------------------------
 bool FOptiAttr::hasColor (charData*& attr)
 {
-  if ( attr && attr->fg_color < 0 && attr->bg_color < 0 )
+  if ( attr
+    && attr->fg_color == fc::Default
+    && attr->bg_color == fc::Default )
     return false;
   else
     return true;
@@ -1263,7 +1265,7 @@ bool FOptiAttr::hasNoAttribute (charData*& attr)
 }
 
 //----------------------------------------------------------------------
-inline bool FOptiAttr::colorChange (charData*& term, charData*& next)
+inline bool FOptiAttr::hasColorChanged (charData*& term, charData*& next)
 {
   if ( term && next )
   {
@@ -1370,7 +1372,7 @@ inline void FOptiAttr::deactivateAttributes ( charData*& term
       setAttributesOff(term);
   }
 
-  if ( colorChange(term, next) )
+  if ( hasColorChanged(term, next) )
     change_color (term, next);
 }
 
@@ -1420,7 +1422,7 @@ inline void FOptiAttr::changeAttributeSGR ( charData*& term
     && pc_charset_usable )
     setTermPCcharset(term);
 
-  if ( colorChange(term, next) )
+  if ( hasColorChanged(term, next) )
     change_color(term, next);
 }
 
@@ -1430,7 +1432,7 @@ inline void FOptiAttr::changeAttributeSeparately ( charData*& term
 {
   setAttributesOff(term);
 
-  if ( colorChange(term, next) )
+  if ( hasColorChanged(term, next) )
     change_color (term, next);
 
   detectSwitchOn (term, next);  // After reset all attributes
@@ -1440,7 +1442,7 @@ inline void FOptiAttr::changeAttributeSeparately ( charData*& term
 //----------------------------------------------------------------------
 void FOptiAttr::change_color (charData*& term, charData*& next)
 {
-  short fg, bg;
+  FColor fg, bg;
 
   if ( ! (term && next) )
     return;
@@ -1452,15 +1454,19 @@ void FOptiAttr::change_color (charData*& term, charData*& next)
     return;
   }
 
-  next->fg_color %= max_color;
-  next->bg_color %= max_color;
+  if ( next->fg_color != fc::Default )
+    next->fg_color %= max_color;
+
+  if ( next->bg_color != fc::Default )
+    next->bg_color %= max_color;
+
   fg = next->fg_color;
   bg = next->bg_color;
 
   if ( fg == fc::Default || bg == fc::Default )
     change_to_default_color (term, next, fg, bg);
 
-  if ( fake_reverse && fg < 0 && bg < 0 )
+  if ( fake_reverse && fg == fc::Default && bg == fc::Default )
     return;
 
   if ( fake_reverse
@@ -1481,7 +1487,7 @@ void FOptiAttr::change_color (charData*& term, charData*& next)
 //----------------------------------------------------------------------
 inline void FOptiAttr::change_to_default_color ( charData*& term
                                                , charData*& next
-                                               , short& fg, short& bg )
+                                               , FColor& fg, FColor& bg )
 {
   if ( ansi_default_color )
   {
@@ -1520,7 +1526,7 @@ inline void FOptiAttr::change_to_default_color ( charData*& term
 
 //----------------------------------------------------------------------
 inline void FOptiAttr::change_current_color ( charData*& term
-                                            , short fg, short bg )
+                                            , FColor fg, FColor bg )
 {
   char* color_str;
   char* AF = F_set_a_foreground.cap;
@@ -1535,8 +1541,8 @@ inline void FOptiAttr::change_current_color ( charData*& term
 
   if ( AF && AB )
   {
-    short ansi_fg = vga2ansi(fg);
-    short ansi_bg = vga2ansi(bg);
+    FColor ansi_fg = vga2ansi(fg);
+    FColor ansi_bg = vga2ansi(bg);
 
     if ( (term->fg_color != fg || frev)
       && (color_str = tparm(AF, ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0)) )
diff --git a/src/foptimove.cpp b/src/foptimove.cpp
index 571d8dcc..41c236fc 100644
--- a/src/foptimove.cpp
+++ b/src/foptimove.cpp
@@ -690,9 +690,9 @@ int FOptiMove::relativeMove ( char move[]
     if ( move )
     {
       if ( *move )
-        std::strncat (move, hmove, BUF_SIZE - std::strlen(move) - 1);
+        std::strncat (move, hmove, BUF_SIZE - std::strlen(move));
       else
-        std::strncpy (move, hmove, BUF_SIZE - 1);
+        std::strncpy (move, hmove, BUF_SIZE);
 
       move[BUF_SIZE - 1] = '\0';
     }
@@ -816,7 +816,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime
   {
     std::strncpy ( hmove
                  , tparm(F_parm_right_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0)
-                 , BUF_SIZE - 1);
+                 , BUF_SIZE );
     hmove[BUF_SIZE - 1] = '\0';
     htime = F_parm_right_cursor.duration;
   }
@@ -854,7 +854,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime
 
     if ( htime_r < htime )
     {
-      std::strncpy (hmove, str, BUF_SIZE - 1);
+      std::strncpy (hmove, str, BUF_SIZE);
       hmove[BUF_SIZE - 1] = '\0';
       htime = htime_r;
     }
@@ -936,7 +936,7 @@ inline bool FOptiMove::isMethod0Faster ( int& move_time
   if ( move_xy )
   {
     char* move_ptr = move_buf;
-    std::strncpy (move_ptr, move_xy, BUF_SIZE - 1);
+    std::strncpy (move_ptr, move_xy, BUF_SIZE);
     move_ptr[BUF_SIZE - 1] = '\0';
     move_time = F_cursor_address.duration;
     return true;
diff --git a/src/fterm.cpp b/src/fterm.cpp
index 75e6ecc3..cc683e63 100644
--- a/src/fterm.cpp
+++ b/src/fterm.cpp
@@ -485,14 +485,13 @@ void FTerm::detectTermSize()
 
   if ( ret != 0 || win_size.ws_col == 0 || win_size.ws_row == 0 )
   {
-    char* str;
     term_geometry.setPos (1, 1);
     // Use COLUMNS or fallback to the xterm default width of 80 characters
-    str = std::getenv("COLUMNS");
-    term_geometry.setWidth(str ? std::size_t(std::atoi(str)) : 80);
+    char* Columns = std::getenv("COLUMNS");
+    term_geometry.setWidth(Columns ? std::size_t(std::atoi(Columns)) : 80);
     // Use LINES or fallback to the xterm default height of 24 characters
-    str = std::getenv("LINES");
-    term_geometry.setHeight(str ? std::size_t(std::atoi(str)) : 24);
+    char* Lines = std::getenv("LINES");
+    term_geometry.setHeight(Lines ? std::size_t(std::atoi(Lines)) : 24);
   }
   else
   {
@@ -565,7 +564,7 @@ void FTerm::resetColorMap()
 }
 
 //----------------------------------------------------------------------
-void FTerm::setPalette (short index, int r, int g, int b)
+void FTerm::setPalette (FColor index, int r, int g, int b)
 {
   // Redefine RGB color value for a palette entry
 
diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp
index f9952421..1b02a358 100644
--- a/src/ftermdetection.cpp
+++ b/src/ftermdetection.cpp
@@ -145,7 +145,8 @@ void FTermDetection::getSystemTermType()
   }
 
   // 2nd fallback: use vt100 if not found
-  std::strncpy (termtype, C_STR("vt100"), 5);
+  std::strncpy (termtype, C_STR("vt100"), sizeof(termtype));
+  termtype[sizeof(termtype) - 1] = '\0';
 }
 
 //----------------------------------------------------------------------
diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp
index e1b9e639..bc9e5b9f 100644
--- a/src/ftermlinux.cpp
+++ b/src/ftermlinux.cpp
@@ -118,7 +118,7 @@ void FTermLinux::setUTF8 (bool on)
 }
 
 //----------------------------------------------------------------------
-bool FTermLinux::setPalette (short index, int r, int g, int b)
+bool FTermLinux::setPalette (FColor index, int r, int g, int b)
 {
   if ( ! FTerm::isLinuxTerm() )
     return false;
@@ -838,7 +838,7 @@ int FTermLinux::setBlinkAsIntensity (bool on)
 }
 
 //----------------------------------------------------------------------
-bool FTermLinux::setVGAPalette (short index, int r, int g, int b)
+bool FTermLinux::setVGAPalette (FColor index, int r, int g, int b)
 {
   // Set the vga color map
 
diff --git a/src/fvterm.cpp b/src/fvterm.cpp
index e91533fb..68274f49 100644
--- a/src/fvterm.cpp
+++ b/src/fvterm.cpp
@@ -164,7 +164,7 @@ void FVTerm::setPrintCursor (int x, int y)
 }
 
 //----------------------------------------------------------------------
-short FVTerm::rgb2ColorIndex (short r, short g, short b)
+FColor FVTerm::rgb2ColorIndex (short r, short g, short b)
 {
   // Converts a 24-bit RGB color to a 256-color compatible approximation
 
@@ -550,7 +550,7 @@ int FVTerm::print (term_area* area, charData& term_char)
       }
 
       // copy character to area
-      std::memcpy (ac, &nc, sizeof(nc));
+      std::memcpy (ac, &nc, sizeof(*ac));
 
       if ( ax < short(area->changes[ay].xmin) )
         area->changes[ay].xmin = uInt(ax);
@@ -858,7 +858,7 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
       int xpos = x + tx;
       tc = &vterm->text[ypos * vterm->width + xpos];
       sc = generateCharacter(xpos, ypos);
-      std::memcpy (tc, &sc, sizeof(sc));
+      std::memcpy (tc, &sc, sizeof(*tc));
     }
 
     if ( short(vterm->changes[ypos].xmin) > x )
@@ -959,7 +959,7 @@ void FVTerm::updateOverlappedColor ( term_area* area
   charData* tc = &vterm->text[ty * vterm->width + tx];
   // New character
   charData nc;
-  std::memcpy (&nc, ac, sizeof(*ac));
+  std::memcpy (&nc, ac, sizeof(nc));
   // Overlapped character
   charData oc = getOverlappedCharacter (tx + 1, ty + 1, area->widget);
   nc.fg_color = oc.fg_color;
@@ -976,7 +976,7 @@ void FVTerm::updateOverlappedColor ( term_area* area
     nc.code = ' ';
 
   nc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == nc);
-  std::memcpy (tc, &nc, sizeof(nc));
+  std::memcpy (tc, &nc, sizeof(*tc));
 }
 
 //----------------------------------------------------------------------
@@ -989,7 +989,7 @@ void FVTerm::updateOverlappedCharacter (term_area* area, int tx, int ty)
   // Overlapped character
   charData oc = getCoveredCharacter (tx + 1, ty + 1, area->widget);
   oc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == oc);
-  std::memcpy (tc, &oc, sizeof(oc));
+  std::memcpy (tc, &oc, sizeof(*tc));
 }
 
 //----------------------------------------------------------------------
@@ -1021,7 +1021,7 @@ void FVTerm::updateShadedCharacter ( term_area* area
     oc.code = ' ';
 
   oc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == oc);
-  std::memcpy (tc, &oc, sizeof(oc));
+  std::memcpy (tc, &oc, sizeof(*tc));
 }
 
 //----------------------------------------------------------------------
@@ -1039,12 +1039,12 @@ void FVTerm::updateInheritBackground ( term_area* area
   charData* tc = &vterm->text[ty * vterm->width + tx];
   // New character
   charData nc;
-  std::memcpy (&nc, ac, sizeof(*ac));
+  std::memcpy (&nc, ac, sizeof(nc));
   // Covered character
   charData cc = getCoveredCharacter (tx + 1, ty + 1, area->widget);
   nc.bg_color = cc.bg_color;
   nc.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == nc);
-  std::memcpy (tc, &nc, sizeof(nc));
+  std::memcpy (tc, &nc, sizeof(*tc));
 }
 
 //----------------------------------------------------------------------
@@ -1060,7 +1060,7 @@ void FVTerm::updateCharacter ( term_area* area
   charData* ac = &area->text[y * line_len + x];
   // Terminal character
   charData* tc = &vterm->text[ty * vterm->width + tx];
-  std::memcpy (tc, ac, sizeof(*ac));
+  std::memcpy (tc, ac, sizeof(*tc));
 
   if ( tc->attr.bit.printed && *tc == *ac )
     tc->attr.bit.no_changes = true;
@@ -1388,7 +1388,7 @@ void FVTerm::getArea (int ax, int ay, term_area* area)
     charData* ac;  // area character
     tc = &vterm->text[(ay + y) * vterm->width + ax];
     ac = &area->text[y * area->width];
-    std::memcpy (ac, tc, sizeof(*tc) * unsigned(length));
+    std::memcpy (ac, tc, sizeof(*ac) * unsigned(length));
 
     if ( short(area->changes[y].xmin) > 0 )
       area->changes[y].xmin = 0;
@@ -1444,7 +1444,7 @@ void FVTerm::getArea (int x, int y, int w, int h, term_area* area)
     int line_len = area->width + area->right_shadow;
     tc = &vterm->text[(y + _y - 1) * vterm->width + x - 1];
     ac = &area->text[(dy + _y) * line_len + dx];
-    std::memcpy (ac, tc, sizeof(*tc) * unsigned(length));
+    std::memcpy (ac, tc, sizeof(*ac) * unsigned(length));
 
     if ( short(area->changes[dy + _y].xmin) > dx )
       area->changes[dy + _y].xmin = uInt(dx);
@@ -1572,14 +1572,14 @@ void FVTerm::scrollAreaForward (term_area* area)
     int pos2 = (y + 1) * total_width;
     sc = &area->text[pos2];
     dc = &area->text[pos1];
-    std::memcpy (dc, sc, sizeof(*sc) * unsigned(length));
+    std::memcpy (dc, sc, sizeof(*dc) * unsigned(length));
     area->changes[y].xmin = 0;
     area->changes[y].xmax = uInt(area->width - 1);
   }
 
   // insert a new line below
   lc = &area->text[(y_max * total_width) - area->right_shadow - 1];
-  std::memcpy (&nc, lc, sizeof(*lc));
+  std::memcpy (&nc, lc, sizeof(nc));
   nc.code = ' ';
   dc = &area->text[y_max * total_width];
   std::fill_n (dc, area->width, nc);
@@ -1633,14 +1633,14 @@ void FVTerm::scrollAreaReverse (term_area* area)
     int pos2 = y * total_width;
     sc = &area->text[pos1];
     dc = &area->text[pos2];
-    std::memcpy (dc, sc, sizeof(*sc) * unsigned(length));
+    std::memcpy (dc, sc, sizeof(*dc) * unsigned(length));
     area->changes[y].xmin = 0;
     area->changes[y].xmax = uInt(area->width - 1);
   }
 
   // insert a new line above
   lc = &area->text[total_width];
-  std::memcpy (&nc, lc, sizeof(*lc));
+  std::memcpy (&nc, lc, sizeof(nc));
   nc.code = ' ';
   dc = &area->text[0];
   std::fill_n (dc, area->width, nc);
@@ -1675,7 +1675,7 @@ void FVTerm::clearArea (term_area* area, int fillchar)
   uInt w;
 
   // Current attributes with a space character
-  std::memcpy (&nc, &next_attribute, sizeof(next_attribute));
+  std::memcpy (&nc, &next_attribute, sizeof(nc));
   nc.code = fillchar;
 
   if ( ! (area && area->text) )
@@ -1770,7 +1770,7 @@ FVTerm::charData FVTerm::generateCharacter (int x, int y)
         if ( tmp->attr.bit.trans_shadow )  // Transparent shadow
         {
           // Keep the current vterm character
-          std::memcpy (&s_ch, sc, sizeof(*sc));
+          std::memcpy (&s_ch, sc, sizeof(s_ch));
           s_ch.fg_color = tmp->fg_color;
           s_ch.bg_color = tmp->bg_color;
           s_ch.attr.bit.reverse  = false;
@@ -1789,7 +1789,7 @@ FVTerm::charData FVTerm::generateCharacter (int x, int y)
         else if ( tmp->attr.bit.inherit_bg )
         {
           // Add the covered background to this character
-          std::memcpy (&i_ch, tmp, sizeof(*tmp));
+          std::memcpy (&i_ch, tmp, sizeof(i_ch));
           i_ch.bg_color = sc->bg_color;  // Last background color
           sc = &i_ch;
         }
@@ -2007,7 +2007,7 @@ void FVTerm::init (bool disable_alt_screen)
   term_attribute.attr.byte[0] = 0;
 
   // next_attribute contains the state of the next printed character
-  std::memcpy (&next_attribute, &term_attribute, sizeof(term_attribute));
+  std::memcpy (&next_attribute, &term_attribute, sizeof(next_attribute));
 
   // Receive the terminal capabilities
   tcap = FTermcap::getTermcapMap();
@@ -2086,7 +2086,7 @@ void FVTerm::putAreaLine (charData* ac, charData* tc, int length)
 {
   // copy "length" characters from area to terminal
 
-  std::memcpy (tc, ac, sizeof(*ac) * unsigned(length));
+  std::memcpy (tc, ac, sizeof(*tc) * unsigned(length));
 }
 
 //----------------------------------------------------------------------
@@ -2099,7 +2099,7 @@ void FVTerm::putAreaCharacter ( int x, int y, FVTerm* obj
     // Restore one character on vterm
     charData ch;
     ch = getCoveredCharacter (x, y, obj);
-    std::memcpy (tc, &ch, sizeof(ch));
+    std::memcpy (tc, &ch, sizeof(*tc));
   }
   else  // Mot transparent
   {
@@ -2121,19 +2121,19 @@ void FVTerm::putAreaCharacter ( int x, int y, FVTerm* obj
         || ch.code == fc::FullBlock )
         ch.code = ' ';
 
-      std::memcpy (tc, &ch, sizeof(ch));
+      std::memcpy (tc, &ch, sizeof(*tc));
     }
     else if ( ac->attr.bit.inherit_bg )
     {
       // Add the covered background to this character
       charData ch, cc;
-      std::memcpy (&ch, ac, sizeof(*ac));
+      std::memcpy (&ch, ac, sizeof(ch));
       cc = getCoveredCharacter (x, y, obj);
       ch.bg_color = cc.bg_color;
-      std::memcpy (tc, &ch, sizeof(ch));
+      std::memcpy (tc, &ch, sizeof(*tc));
     }
     else  // Default
-      std::memcpy (tc, ac, sizeof(*ac));
+      std::memcpy (tc, ac, sizeof(*tc));
   }
 }
 
@@ -2153,7 +2153,7 @@ void FVTerm::getAreaCharacter ( int x, int y, term_area* area
     if ( tmp->attr.bit.trans_shadow )  // transparent shadow
     {
       // Keep the current vterm character
-      std::memcpy (&s_ch, cc, sizeof(*cc));
+      std::memcpy (&s_ch, cc, sizeof(s_ch));
       s_ch.fg_color = tmp->fg_color;
       s_ch.bg_color = tmp->bg_color;
       s_ch.attr.bit.reverse  = false;
@@ -2163,7 +2163,7 @@ void FVTerm::getAreaCharacter ( int x, int y, term_area* area
     else if ( tmp->attr.bit.inherit_bg )
     {
       // Add the covered background to this character
-      std::memcpy (&i_ch, tmp, sizeof(*tmp));
+      std::memcpy (&i_ch, tmp, sizeof(i_ch));
       i_ch.bg_color = cc->bg_color;  // last background color
       cc = &i_ch;
     }
diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h
index 3d65c06c..282076b2 100644
--- a/src/include/final/fbutton.h
+++ b/src/include/final/fbutton.h
@@ -79,13 +79,13 @@ class FButton : public FWidget
     FString&     getText();
 
     // Mutators
-    void         setForegroundColor (short);
-    void         setBackgroundColor (short);
-    void         setHotkeyForegroundColor (short);
-    void         setFocusForegroundColor (short);
-    void         setFocusBackgroundColor (short);
-    void         setInactiveForegroundColor (short);
-    void         setInactiveBackgroundColor (short);
+    void         setForegroundColor (FColor);
+    void         setBackgroundColor (FColor);
+    void         setHotkeyForegroundColor (FColor);
+    void         setFocusForegroundColor (FColor);
+    void         setFocusBackgroundColor (FColor);
+    void         setInactiveForegroundColor (FColor);
+    void         setInactiveBackgroundColor (FColor);
     bool         setNoUnderline(bool);
     bool         setNoUnderline();
     bool         unsetNoUnderline();
diff --git a/src/include/final/fc.h b/src/include/final/fc.h
index 2d8ca33e..e34b9372 100644
--- a/src/include/final/fc.h
+++ b/src/include/final/fc.h
@@ -27,6 +27,8 @@
   #error "Only  can be included directly."
 #endif
 
+#include 
+
 // Typecast to c-string
 #define C_STR const_cast
 
@@ -650,7 +652,6 @@ enum metakeys
 // Console color names
 enum colornames
 {
-  Default           = -1,
   Black             = 0,
   Blue              = 1,
   Green             = 2,
@@ -907,7 +908,8 @@ enum colornames
   Grey82            = 252,  // #d0d0d0
   Grey85            = 253,  // #dadada
   Grey89            = 254,  // #e4e4e4
-  Grey93            = 255   // #eeeeee
+  Grey93            = 255,  // #eeeeee
+  Default           = static_cast(-1)
 };
 
 // Mouse/keyboard state values
diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h
index 4b2119a3..83350414 100644
--- a/src/include/final/fcolorpalette.h
+++ b/src/include/final/fcolorpalette.h
@@ -57,7 +57,7 @@ class FColorPalette
     virtual ~FColorPalette();
 
     // Typedefs
-    typedef void (*funcp)(short, int, int, int);
+    typedef void (*funcp)(FColor, int, int, int);
 
     // Accessor
     virtual const char* getClassName() const;
diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h
index 8c08ad95..23ddcb90 100644
--- a/src/include/final/foptiattr.h
+++ b/src/include/final/foptiattr.h
@@ -77,9 +77,9 @@ class FOptiAttr
     // Typedefs
     typedef struct
     {
-      int   code;      // character code
-      short fg_color;  // foreground color
-      short bg_color;  // background color
+      int    code;      // character code
+      FColor fg_color;  // foreground color
+      FColor bg_color;  // background color
 
       union attribute
       {
@@ -211,12 +211,12 @@ class FOptiAttr
     void  set_orig_orig_colors (char[]);
 
     // Inquiry
-    static bool  isNormal (charData*&);
+    static bool   isNormal (charData*&);
 
     // Methods
-    void         initialize();
-    static short vga2ansi (short);
-    char*        changeAttribute (charData*&, charData*&);
+    void          initialize();
+    static FColor vga2ansi (FColor);
+    char*         changeAttribute (charData*&, charData*&);
 
   private:
     // Typedefs and Enumerations
@@ -306,15 +306,15 @@ class FOptiAttr
     static bool  hasNoAttribute (charData*&);
 
     // Methods
-    bool  colorChange (charData*&, charData*&);
+    bool  hasColorChanged (charData*&, charData*&);
     void  resetColor (charData*&);
     void  prevent_no_color_video_attributes (charData*&, bool = false);
     void  deactivateAttributes (charData*&, charData*&);
     void  changeAttributeSGR (charData*&, charData*&);
     void  changeAttributeSeparately (charData*&, charData*&);
     void  change_color (charData*&, charData*&);
-    void  change_to_default_color (charData*&, charData*&, short&, short&);
-    void  change_current_color (charData*&, short, short);
+    void  change_to_default_color (charData*&, charData*&, FColor&, FColor&);
+    void  change_current_color (charData*&, FColor, FColor);
     void  resetAttribute (charData*&);
     void  reset (charData*&);
     bool  caused_reset_attributes (char[], uChar = all_tests);
diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h
index 46ee898b..59673cd2 100644
--- a/src/include/final/fterm.h
+++ b/src/include/final/fterm.h
@@ -244,7 +244,7 @@ class FTerm
     static void            setKDECursor (fc::kdeKonsoleCursorShape);
     static void            saveColorMap();
     static void            resetColorMap();
-    static void            setPalette (short, int, int, int);
+    static void            setPalette (FColor, int, int, int);
     static void            setBeep (int, int);
     static void            resetBeep();
     static void            beep();
diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h
index 9378243e..32335625 100644
--- a/src/include/final/ftermlinux.h
+++ b/src/include/final/ftermlinux.h
@@ -83,7 +83,7 @@ class FTermLinux
     // Mutators
     static void          setFTermDetection (FTermDetection*);
     static char*         setCursorStyle (fc::linuxConsoleCursorStyle, bool);
-    static bool          setPalette (short, int, int, int);
+    static bool          setPalette (FColor, int, int, int);
     static void          setUTF8 (bool);
 
     // Inquiries
@@ -155,7 +155,7 @@ class FTermLinux
     static uChar         getAttributeMode();
     static void          setAttributeMode (uChar);
     static int           setBlinkAsIntensity (bool);
-    static bool          setVGAPalette (short, int, int, int);
+    static bool          setVGAPalette (FColor, int, int, int);
     static bool          saveVGAPalette();
     static bool          resetVGAPalette();
 #endif  // defined(__x86_64__) || defined(__i386) || defined(__arm__)
diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h
index 12d7d880..e88d6892 100644
--- a/src/include/final/ftypes.h
+++ b/src/include/final/ftypes.h
@@ -55,6 +55,8 @@ typedef int64_t        sInt64;
 
 typedef long double    lDouble;
 
+typedef uInt16         FColor;
+
 }  // namespace
 
 
diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h
index 33f1f62c..537a2a4b 100644
--- a/src/include/final/fvterm.h
+++ b/src/include/final/fvterm.h
@@ -153,8 +153,8 @@ class FVTerm
     void                  showCursor();
     void                  setPrintCursor (const FPoint&);
     void                  setPrintCursor (int, int);
-    short                 rgb2ColorIndex (short, short, short);
-    void                  setColor (short, short);
+    FColor                rgb2ColorIndex (short, short, short);
+    void                  setColor (FColor, FColor);
     static void           setNormal();
 
     static bool           setBold (bool);
@@ -671,7 +671,7 @@ inline void FVTerm::setPrintCursor (const FPoint& pos)
 { setPrintCursor (pos.getX(), pos.getY()); }
 
 //----------------------------------------------------------------------
-inline void FVTerm::setColor (short fg, short bg)
+inline void FVTerm::setColor (FColor fg, FColor bg)
 {
   // Changes colors
   next_attribute.fg_color = fg;
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index 63afd890..6d4eed17 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -239,8 +239,8 @@ class FWidget : public FVTerm, public FObject
     bool               ignorePadding (bool);    // ignore padding from
     bool               ignorePadding();         // the parent widget
     bool               acceptPadding();
-    void               setForegroundColor (short);
-    void               setBackgroundColor (short);
+    void               setForegroundColor (FColor);
+    void               setBackgroundColor (FColor);
     void               setColor();
     virtual void       setX (int, bool = true);  // positioning
     virtual void       setY (int, bool = true);
@@ -505,8 +505,8 @@ class FWidget : public FVTerm, public FObject
     FPoint             wshadow;
 
     // default widget foreground and background color
-    short              foreground_color;
-    short              background_color;
+    FColor             foreground_color;
+    FColor             background_color;
 
     FString            statusbar_message;
     static FStatusBar* statusbar;
@@ -792,7 +792,7 @@ inline bool FWidget::acceptPadding()
 { return (ignore_padding = false); }
 
 //----------------------------------------------------------------------
-inline void FWidget::setForegroundColor (short color)
+inline void FWidget::setForegroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
@@ -800,7 +800,7 @@ inline void FWidget::setForegroundColor (short color)
 }
 
 //----------------------------------------------------------------------
-inline void FWidget::setBackgroundColor (short color)
+inline void FWidget::setBackgroundColor (FColor color)
 {
   // valid colors -1..254
   if ( color == fc::Default || color >> 8 == 0 )
diff --git a/src/include/final/fwidgetcolors.h b/src/include/final/fwidgetcolors.h
index 139901ac..b55722f1 100644
--- a/src/include/final/fwidgetcolors.h
+++ b/src/include/final/fwidgetcolors.h
@@ -55,90 +55,90 @@ class FWidgetColors
     void set16ColorTheme();
 
     // Data Members
-    short term_fg;
-    short term_bg;
-    short list_fg;
-    short list_bg;
-    short selected_list_fg;
-    short selected_list_bg;
-    short current_element_focus_fg;
-    short current_element_focus_bg;
-    short current_element_fg;
-    short current_element_bg;
-    short current_inc_search_element_fg;
-    short selected_current_element_focus_fg;
-    short selected_current_element_focus_bg;
-    short selected_current_element_fg;
-    short selected_current_element_bg;
-    short label_fg;
-    short label_bg;
-    short label_inactive_fg;
-    short label_inactive_bg;
-    short label_hotkey_fg;
-    short label_hotkey_bg;
-    short label_emphasis_fg;
-    short label_ellipsis_fg;
-    short inputfield_active_focus_fg;
-    short inputfield_active_focus_bg;
-    short inputfield_active_fg;
-    short inputfield_active_bg;
-    short inputfield_inactive_fg;
-    short inputfield_inactive_bg;
-    short dialog_fg;
-    short dialog_resize_fg;
-    short dialog_emphasis_fg;
-    short dialog_bg;
-    short error_box_fg;
-    short error_box_emphasis_fg;
-    short error_box_bg;
-    short tooltip_fg;
-    short tooltip_bg;
-    short shadow_fg;
-    short shadow_bg;
-    short toggle_button_active_focus_fg;
-    short toggle_button_active_focus_bg;
-    short toggle_button_active_fg;
-    short toggle_button_active_bg;
-    short toggle_button_inactive_fg;
-    short toggle_button_inactive_bg;
-    short button_active_focus_fg;
-    short button_active_focus_bg;
-    short button_active_fg;
-    short button_active_bg;
-    short button_inactive_fg;
-    short button_inactive_bg;
-    short button_hotkey_fg;
-    short titlebar_active_fg;
-    short titlebar_active_bg;
-    short titlebar_inactive_fg;
-    short titlebar_inactive_bg;
-    short titlebar_button_fg;
-    short titlebar_button_bg;
-    short titlebar_button_focus_fg;
-    short titlebar_button_focus_bg;
-    short menu_active_focus_fg;
-    short menu_active_focus_bg;
-    short menu_active_fg;
-    short menu_active_bg;
-    short menu_inactive_fg;
-    short menu_inactive_bg;
-    short menu_hotkey_fg;
-    short menu_hotkey_bg;
-    short statusbar_fg;
-    short statusbar_bg;
-    short statusbar_hotkey_fg;
-    short statusbar_hotkey_bg;
-    short statusbar_separator_fg;
-    short statusbar_active_fg;
-    short statusbar_active_bg;
-    short statusbar_active_hotkey_fg;
-    short statusbar_active_hotkey_bg;
-    short scrollbar_fg;
-    short scrollbar_bg;
-    short scrollbar_button_fg;
-    short scrollbar_button_bg;
-    short progressbar_fg;
-    short progressbar_bg;
+    FColor term_fg;
+    FColor term_bg;
+    FColor list_fg;
+    FColor list_bg;
+    FColor selected_list_fg;
+    FColor selected_list_bg;
+    FColor current_element_focus_fg;
+    FColor current_element_focus_bg;
+    FColor current_element_fg;
+    FColor current_element_bg;
+    FColor current_inc_search_element_fg;
+    FColor selected_current_element_focus_fg;
+    FColor selected_current_element_focus_bg;
+    FColor selected_current_element_fg;
+    FColor selected_current_element_bg;
+    FColor label_fg;
+    FColor label_bg;
+    FColor label_inactive_fg;
+    FColor label_inactive_bg;
+    FColor label_hotkey_fg;
+    FColor label_hotkey_bg;
+    FColor label_emphasis_fg;
+    FColor label_ellipsis_fg;
+    FColor inputfield_active_focus_fg;
+    FColor inputfield_active_focus_bg;
+    FColor inputfield_active_fg;
+    FColor inputfield_active_bg;
+    FColor inputfield_inactive_fg;
+    FColor inputfield_inactive_bg;
+    FColor dialog_fg;
+    FColor dialog_resize_fg;
+    FColor dialog_emphasis_fg;
+    FColor dialog_bg;
+    FColor error_box_fg;
+    FColor error_box_emphasis_fg;
+    FColor error_box_bg;
+    FColor tooltip_fg;
+    FColor tooltip_bg;
+    FColor shadow_fg;
+    FColor shadow_bg;
+    FColor toggle_button_active_focus_fg;
+    FColor toggle_button_active_focus_bg;
+    FColor toggle_button_active_fg;
+    FColor toggle_button_active_bg;
+    FColor toggle_button_inactive_fg;
+    FColor toggle_button_inactive_bg;
+    FColor button_active_focus_fg;
+    FColor button_active_focus_bg;
+    FColor button_active_fg;
+    FColor button_active_bg;
+    FColor button_inactive_fg;
+    FColor button_inactive_bg;
+    FColor button_hotkey_fg;
+    FColor titlebar_active_fg;
+    FColor titlebar_active_bg;
+    FColor titlebar_inactive_fg;
+    FColor titlebar_inactive_bg;
+    FColor titlebar_button_fg;
+    FColor titlebar_button_bg;
+    FColor titlebar_button_focus_fg;
+    FColor titlebar_button_focus_bg;
+    FColor menu_active_focus_fg;
+    FColor menu_active_focus_bg;
+    FColor menu_active_fg;
+    FColor menu_active_bg;
+    FColor menu_inactive_fg;
+    FColor menu_inactive_bg;
+    FColor menu_hotkey_fg;
+    FColor menu_hotkey_bg;
+    FColor statusbar_fg;
+    FColor statusbar_bg;
+    FColor statusbar_hotkey_fg;
+    FColor statusbar_hotkey_bg;
+    FColor statusbar_separator_fg;
+    FColor statusbar_active_fg;
+    FColor statusbar_active_bg;
+    FColor statusbar_active_hotkey_fg;
+    FColor statusbar_active_hotkey_bg;
+    FColor scrollbar_fg;
+    FColor scrollbar_bg;
+    FColor scrollbar_button_fg;
+    FColor scrollbar_button_bg;
+    FColor progressbar_fg;
+    FColor progressbar_bg;
 };
 #pragma pack(pop)
 
diff --git a/test/foptiattr-test.cpp b/test/foptiattr-test.cpp
index 35a1c01c..50084c70 100644
--- a/test/foptiattr-test.cpp
+++ b/test/foptiattr-test.cpp
@@ -212,7 +212,7 @@ void FOptiAttrTest::fakeReverseTest()
   finalcut::FOptiAttr::charData* to = \
       new finalcut::FOptiAttr::charData();
   CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
-
+return;
   // Gray text on blue background
   to->fg_color = finalcut::fc::LightGray;
   to->bg_color = finalcut::fc::Blue;

From 3109189b1c98f0652673ce65f222973d27188ac7 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Wed, 7 Nov 2018 22:30:59 +0100
Subject: [PATCH 23/33] Remove testing line "return;"

---
 test/foptiattr-test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/foptiattr-test.cpp b/test/foptiattr-test.cpp
index 50084c70..35a1c01c 100644
--- a/test/foptiattr-test.cpp
+++ b/test/foptiattr-test.cpp
@@ -212,7 +212,7 @@ void FOptiAttrTest::fakeReverseTest()
   finalcut::FOptiAttr::charData* to = \
       new finalcut::FOptiAttr::charData();
   CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
-return;
+
   // Gray text on blue background
   to->fg_color = finalcut::fc::LightGray;
   to->bg_color = finalcut::fc::Blue;

From d39e85d4c5462de841871b88d17196a2483b570b Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sat, 10 Nov 2018 00:53:57 +0100
Subject: [PATCH 24/33] =?UTF-8?q?FListView=20now=20has=20a=20sort=20indica?=
 =?UTF-8?q?tor=20(=E2=96=BC/=E2=96=B2)=20to=20display=20the=20sort=20order?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .codedocs                     |  2 +-
 ChangeLog                     |  9 +++--
 examples/listview.cpp         |  5 ++-
 src/fdialog.cpp               |  3 +-
 src/flistview.cpp             | 63 +++++++++++++++++++++++++++++------
 src/include/final/flistview.h |  8 +++++
 src/include/final/fobject.h   |  4 +++
 7 files changed, 78 insertions(+), 16 deletions(-)

diff --git a/.codedocs b/.codedocs
index 5b2b06cb..94853e96 100644
--- a/.codedocs
+++ b/.codedocs
@@ -1,4 +1,4 @@
 PROJECT_NAME = "The Final Cut"
-EXCLUDE = debian, icon, logo, m4, scripts, examples
+EXCLUDE = debian, doc, icon, logo, m4, scripts, examples
 EXCLUDE_PATTERNS = */test/*
 
diff --git a/ChangeLog b/ChangeLog
index 3e5a9deb..49e4ccff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-10  Markus Gans  
+	* FListView now has a sort indicator to display the sort order
+
 2018-11-07  Markus Gans  
 	* Use new type FColor for color values
 
@@ -129,7 +132,7 @@
 
 2018-07-01  Markus Gans  
 	* All in FOptiMove required termcap values can now be passed 
-          with a single struct
+	  with a single struct
 
 2018-06-25  Markus Gans  
 	* All termcap values required in FOptiAttr can now be passed 
@@ -282,7 +285,7 @@
 
 2018-01-02  Markus Gans  
 	* Refactoring of secondary device attributes parsing
-        * Small menu improvements
+	* Small menu improvements
 
 2017-12-31  Markus Gans  
 	* Refactoring of the FListBox mouse event handler
@@ -504,7 +507,7 @@
 2017-07-18  Markus Gans  
 	* New Widget class FListView (filled with FListViewItem) 
 	  to allow a multi-column data view
-        * Add the listview example to demonstrate FListView
+	* Add the listview example to demonstrate FListView
 
 2017-07-11  Markus Gans  
 	* New class FTermBuffer to buffer terminal outputs
diff --git a/examples/listview.cpp b/examples/listview.cpp
index d353748a..062688e8 100644
--- a/examples/listview.cpp
+++ b/examples/listview.cpp
@@ -94,9 +94,12 @@ Listview::Listview (finalcut::FWidget* parent)
 
   // Sort in ascending order by the 1st column
   listView.setColumnSort (1, finalcut::fc::ascending);
-  // The sorting occurs later automatically at insert().
+  // Sorting follows later automatically on insert().
   // Otherwise you could start the sorting directly with sort()
 
+  // Allways show the sort indicator (▼/▲)
+  listView.hideSortIndicator(false);
+
   // Populate FListView with a list of items
   populate();
 
diff --git a/src/fdialog.cpp b/src/fdialog.cpp
index 995f75e8..bd6c4a77 100644
--- a/src/fdialog.cpp
+++ b/src/fdialog.cpp
@@ -1615,7 +1615,8 @@ void FDialog::resizeMouseUpMove (mouseStates& ms, bool mouse_up)
       else
         h = int(getMaxHeight()) - getTermY() + y2_offset + 1;
 
-      setSize (std::size_t(w), std::size_t(h));
+      setSize ( ( w >= 0) ? std::size_t(w) : 0
+              , ( h >= 0) ? std::size_t(h) : 0 );
     }
 
     if ( mouse_up )
diff --git a/src/flistview.cpp b/src/flistview.cpp
index dfa08d8a..73c7f9e4 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -610,6 +610,7 @@ FListView::FListView (FWidget* parent)
   , scroll_distance(1)
   , scroll_timer(false)
   , tree_view(false)
+  , hide_sort_indicator(false)
   , clicked_expander_pos(-1, -1)
   , xoffset(0)
   , nf_offset(0)
@@ -1766,37 +1767,79 @@ inline FString FListView::getLinePrefix ( const FListViewItem* item
   return line;
 }
 
+//----------------------------------------------------------------------
+inline void FListView::drawSortIndicator ( std::size_t& length
+                                         , std::size_t  column_width )
+{
+  if ( length >= column_width )
+    return;
+
+  setColor();
+  length++;
+
+  if ( sort_order == fc::ascending )
+    headerline << wchar_t(fc::BlackDownPointingTriangle);  // ▼
+  else if ( sort_order == fc::descending )
+    headerline << wchar_t(fc::BlackUpPointingTriangle);    // ▲
+
+  if ( length < column_width  )
+  {
+    length++;
+    headerline << ' ';
+  }
+}
+
+//----------------------------------------------------------------------
+inline void FListView::drawHeaderLine (std::size_t length)
+{
+  setColor();
+  const FString line (length, wchar_t(fc::BoxDrawingsHorizontal));
+  headerline << line;  // horizontal line
+}
+
 //----------------------------------------------------------------------
 void FListView::drawColumnText (headerItems::const_iterator& iter)
 {
   // Print lable text
   static const std::size_t leading_space = 1;
-  static const std::size_t trailing_space = 1;
   const FString& text = iter->name;
-  std::size_t width = std::size_t(iter->width);
   FString txt = " " + text;
+  std::size_t width = std::size_t(iter->width);
   std::size_t txt_length = txt.getLength();
+  std::size_t length = 0;
   std::size_t column_width = leading_space + width;
+  headerItems::const_iterator first = header.begin();
+  int column = std::distance(first, iter) + 1;
+  bool isSortIndicator = bool ( sort_column == column
+                             && ! hide_sort_indicator );
 
   if ( isEnabled() )
     setColor (wc.label_emphasis_fg, wc.label_bg);
   else
     setColor (wc.label_inactive_fg, wc.label_inactive_bg);
 
+  if ( isSortIndicator && txt_length >= column_width - 1 && txt_length > 1 )
+  {
+    txt_length = column_width - 2;
+    txt = txt.left(txt_length);
+  }
+
   if ( txt_length <= column_width )
   {
+    length = txt_length;
     headerline << txt;
 
-    if ( txt_length < column_width )
-      headerline << ' ';  // trailing space
-
-    if ( txt_length + trailing_space < column_width )
+    if ( length < column_width )
     {
-      setColor();
-      const FString line ( column_width - trailing_space - txt_length
-                         , wchar_t(fc::BoxDrawingsHorizontal) );
-      headerline << line;  // horizontal line
+      length++;
+      headerline << ' ';  // trailing space
     }
+
+    if ( isSortIndicator )
+      drawSortIndicator (length, column_width );
+
+    if ( length < column_width )
+      drawHeaderLine (column_width - length);
   }
   else
     drawColumnEllipsis (iter, text);  // Print ellipsis
diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h
index bcb209c5..be9cd05b 100644
--- a/src/include/final/flistview.h
+++ b/src/include/final/flistview.h
@@ -283,6 +283,7 @@ class FListView : public FWidget
     void                 setUserAscendingCompare (Compare);
     template 
     void                 setUserDescendingCompare (Compare);
+    void                 hideSortIndicator (bool);
     bool                 setTreeView (bool);
     bool                 setTreeView();
     bool                 unsetTreeView();
@@ -356,7 +357,9 @@ class FListView : public FWidget
     void                 drawListLine (const FListViewItem*, bool, bool);
     void                 setLineAttributes (bool, bool);
     FString              getLinePrefix (const FListViewItem*, std::size_t);
+    void                 drawSortIndicator (std::size_t&, std::size_t);
     void                 drawColumnText (headerItems::const_iterator&);
+    void                 drawHeaderLine (std::size_t);
     void                 drawColumnEllipsis ( headerItems::const_iterator&
                                             , const FString& );
     void                 updateDrawing (bool, bool);
@@ -410,6 +413,7 @@ class FListView : public FWidget
     int                  scroll_distance;
     bool                 scroll_timer;
     bool                 tree_view;
+    bool                 hide_sort_indicator;
     FPoint               clicked_expander_pos;
     int                  xoffset;
     int                  nf_offset;
@@ -477,6 +481,10 @@ template 
 inline void FListView::setUserDescendingCompare (Compare cmp)
 { user_defined_descending = cmp; }
 
+//----------------------------------------------------------------------
+inline void FListView::hideSortIndicator (bool hide)
+{ hide_sort_indicator = hide; }
+
 //----------------------------------------------------------------------
 inline bool FListView::setTreeView (bool on)
 { return (tree_view = on); }
diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h
index 3ebb31af..2be00ec5 100644
--- a/src/include/final/fobject.h
+++ b/src/include/final/fobject.h
@@ -35,6 +35,10 @@
   #error "Only  can be included directly."
 #endif
 
+#if __cplusplus < 199711L
+  #error "Your C++ compiler does not support the C++98 standard!"
+#endif
+
 #include   // need for gettimeofday
 #include 
 #include 

From b451f0047a6ff74d41741ca3ea2466f60465f9d5 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Mon, 12 Nov 2018 22:40:16 +0100
Subject: [PATCH 25/33] Clicking on the column header in FListView now changes
 the sort order

---
 ChangeLog                     |  3 ++
 src/flistview.cpp             | 82 +++++++++++++++++++++++++++++------
 src/include/final/flistview.h |  6 ++-
 3 files changed, 76 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 49e4ccff..05e887b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-12  Markus Gans  
+	* Clicking on the column header in FListView now changes the sort order
+
 2018-11-10  Markus Gans  
 	* FListView now has a sort indicator to display the sort order
 
diff --git a/src/flistview.cpp b/src/flistview.cpp
index 73c7f9e4..b478b956 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -612,6 +612,7 @@ FListView::FListView (FWidget* parent)
   , tree_view(false)
   , hide_sort_indicator(false)
   , clicked_expander_pos(-1, -1)
+  , clicked_column_pos(-1, -1)
   , xoffset(0)
   , nf_offset(0)
   , max_line_width(1)
@@ -1056,8 +1057,12 @@ void FListView::onMouseDown (FMouseEvent* ev)
     , mouse_x = ev->getX()
     , mouse_y = ev->getY();
 
-  if ( mouse_x > 1 && mouse_x < int(getWidth())
-    && mouse_y > 1 && mouse_y < int(getHeight()) )
+  if ( mouse_x > 1 && mouse_x < int(getWidth()) && mouse_y == 1 )
+  {
+    clicked_column_pos = ev->getPos();
+  }
+  else if ( mouse_x > 1 && mouse_x < int(getWidth())
+         && mouse_y > 1 && mouse_y < int(getHeight()) )
   {
     int new_pos = first_visible_line.getPosition() + mouse_y - 2;
 
@@ -1099,7 +1104,12 @@ void FListView::onMouseUp (FMouseEvent* ev)
     int mouse_y = ev->getY();
 
     if ( mouse_x > 1 && mouse_x < int(getWidth())
-      && mouse_y > 1 && mouse_y < int(getHeight()) )
+      && mouse_y == 1 && clicked_column_pos == ev->getPos() )
+    {
+      mouseColumnClicked();
+    }
+    else if ( mouse_x > 1 && mouse_x < int(getWidth())
+           && mouse_y > 1 && mouse_y < int(getHeight()) )
     {
       if ( tree_view )
       {
@@ -1590,9 +1600,9 @@ void FListView::drawList()
   if ( itemlist.empty() || getHeight() <= 2 || getWidth() <= 4 )
     return;
 
-  y           = 0;
+  y = 0;
   page_height = uInt(getHeight() - 2);
-  iter        = first_visible_line;
+  iter = first_visible_line;
 
   while ( iter != itemlist.end() && y < page_height )
   {
@@ -1790,7 +1800,7 @@ inline void FListView::drawSortIndicator ( std::size_t& length
 }
 
 //----------------------------------------------------------------------
-inline void FListView::drawHeaderLine (std::size_t length)
+inline void FListView::drawHeaderBorder (std::size_t length)
 {
   setColor();
   const FString line (length, wchar_t(fc::BoxDrawingsHorizontal));
@@ -1806,19 +1816,18 @@ void FListView::drawColumnText (headerItems::const_iterator& iter)
   FString txt = " " + text;
   std::size_t width = std::size_t(iter->width);
   std::size_t txt_length = txt.getLength();
-  std::size_t length = 0;
   std::size_t column_width = leading_space + width;
   headerItems::const_iterator first = header.begin();
   int column = std::distance(first, iter) + 1;
-  bool isSortIndicator = bool ( sort_column == column
-                             && ! hide_sort_indicator );
+  bool has_sort_indicator = bool ( sort_column == column
+                                && ! hide_sort_indicator );
 
   if ( isEnabled() )
     setColor (wc.label_emphasis_fg, wc.label_bg);
   else
     setColor (wc.label_inactive_fg, wc.label_inactive_bg);
 
-  if ( isSortIndicator && txt_length >= column_width - 1 && txt_length > 1 )
+  if ( has_sort_indicator && txt_length >= column_width - 1 && txt_length > 1 )
   {
     txt_length = column_width - 2;
     txt = txt.left(txt_length);
@@ -1826,7 +1835,7 @@ void FListView::drawColumnText (headerItems::const_iterator& iter)
 
   if ( txt_length <= column_width )
   {
-    length = txt_length;
+    std::size_t length = txt_length;
     headerline << txt;
 
     if ( length < column_width )
@@ -1835,11 +1844,11 @@ void FListView::drawColumnText (headerItems::const_iterator& iter)
       headerline << ' ';  // trailing space
     }
 
-    if ( isSortIndicator )
+    if ( has_sort_indicator )
       drawSortIndicator (length, column_width );
 
     if ( length < column_width )
-      drawHeaderLine (column_width - length);
+      drawHeaderBorder (column_width - length);
   }
   else
     drawColumnEllipsis (iter, text);  // Print ellipsis
@@ -1948,6 +1957,53 @@ void FListView::recalculateVerticalBar (int element_count)
     vbar->setVisible();
 }
 
+//----------------------------------------------------------------------
+void FListView::mouseColumnClicked()
+{
+  int column_start = 2;
+  int column = 1;
+  int column_pos = clicked_column_pos.getX() + xoffset;
+  headerItems::const_iterator iter;
+  iter = header.begin();
+
+  while ( iter != header.end() )
+  {
+    static const int leading_space = 1;
+    bool has_sort_indicator = bool( column == sort_column );
+    int click_width = int(iter->name.getLength());
+
+    if ( has_sort_indicator )
+      click_width += 2;
+
+    if ( click_width > iter->width )
+      click_width = iter->width;
+
+    if ( column_pos > column_start
+      && column_pos <= column_start + click_width )
+    {
+      if ( has_sort_indicator && sort_order == fc::ascending )
+        setColumnSort (column, fc::descending);
+      else
+        setColumnSort (column, fc::ascending);
+
+      sort();
+
+      if ( isVisible() )
+      {
+        drawColumnLabels();
+        drawList();
+        updateTerminal();
+        flush_out();
+      }
+      break;
+    }
+
+    column_start += leading_space + iter->width;
+    column++;
+    ++iter;
+  }
+}
+
 //----------------------------------------------------------------------
 void FListView::wheelUp (int pagesize)
 {
diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h
index be9cd05b..e63e6473 100644
--- a/src/include/final/flistview.h
+++ b/src/include/final/flistview.h
@@ -55,7 +55,7 @@
 #include 
 #include 
 #include 
-
+                          #include "final/fmessagebox.h"
 #include "final/fscrollbar.h"
 #include "final/fstring.h"
 #include "final/ftermbuffer.h"
@@ -359,13 +359,14 @@ class FListView : public FWidget
     FString              getLinePrefix (const FListViewItem*, std::size_t);
     void                 drawSortIndicator (std::size_t&, std::size_t);
     void                 drawColumnText (headerItems::const_iterator&);
-    void                 drawHeaderLine (std::size_t);
+    void                 drawHeaderBorder (std::size_t);
     void                 drawColumnEllipsis ( headerItems::const_iterator&
                                             , const FString& );
     void                 updateDrawing (bool, bool);
     int                  determineLineWidth (FListViewItem* item);
     void                 recalculateHorizontalBar (int);
     void                 recalculateVerticalBar (int);
+    void                 mouseColumnClicked();
     void                 wheelUp (int);
     void                 wheelDown (int);
     bool                 dragScrollUp (int);
@@ -415,6 +416,7 @@ class FListView : public FWidget
     bool                 tree_view;
     bool                 hide_sort_indicator;
     FPoint               clicked_expander_pos;
+    FPoint               clicked_column_pos;
     int                  xoffset;
     int                  nf_offset;
     int                  max_line_width;

From 9b3f30f0061ab43e51d088bafd03367b3dbe2a75 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Mon, 12 Nov 2018 23:22:45 +0100
Subject: [PATCH 26/33] Clicking on the column header in FListView now changes
 the sort order

---
 src/flistview.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/flistview.cpp b/src/flistview.cpp
index b478b956..c4f6dd7b 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -1134,6 +1134,7 @@ void FListView::onMouseUp (FMouseEvent* ev)
   }
 
   clicked_expander_pos.setPoint(-1, -1);
+  clicked_column_pos.setPoint(-1, -1);
 }
 
 //----------------------------------------------------------------------

From e40a233d6408bea6e62f587db5d58e9e249b4b86 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Tue, 13 Nov 2018 02:51:41 +0100
Subject: [PATCH 27/33] FColor fix

---
 examples/calculator.cpp         |   3 +-
 examples/mouse.cpp              |  38 ++++++------
 examples/term-attributes.cpp    |   2 +-
 examples/timer.cpp              |   2 +-
 examples/treeview.cpp           |  82 ++++++++++++++++++++++++
 src/fbutton.cpp                 |   2 +-
 src/fbuttongroup.cpp            |   2 +-
 src/flabel.cpp                  |   2 +-
 src/flineedit.cpp               |   2 +-
 src/flistbox.cpp                |   2 +-
 src/flistview.cpp               | 106 +++++++++++++++++---------------
 src/fmenubar.cpp                |   2 +-
 src/foptiattr.cpp               |   2 +-
 src/fprogressbar.cpp            |   2 +-
 src/fstatusbar.cpp              |   2 +-
 src/ftextview.cpp               |   2 +-
 src/ftogglebutton.cpp           |   2 +-
 src/fvterm.cpp                  |  11 ++--
 src/include/final/fbutton.h     |  14 ++---
 src/include/final/flabel.h      |   4 +-
 src/include/final/fmessagebox.h |   2 +-
 src/include/final/fvterm.h      |  10 +--
 src/include/final/fwidget.h     |   8 +--
 23 files changed, 193 insertions(+), 111 deletions(-)

diff --git a/examples/calculator.cpp b/examples/calculator.cpp
index 2bf1af22..7668cc49 100644
--- a/examples/calculator.cpp
+++ b/examples/calculator.cpp
@@ -316,8 +316,7 @@ Calc::Calc (FWidget* parent)
 
 //----------------------------------------------------------------------
 Calc::~Calc()
-{
-}
+{ }
 
 //----------------------------------------------------------------------
 void Calc::drawDispay()
diff --git a/examples/mouse.cpp b/examples/mouse.cpp
index 445d6d50..1892f333 100644
--- a/examples/mouse.cpp
+++ b/examples/mouse.cpp
@@ -40,8 +40,8 @@ class ColorChooser : public finalcut::FWidget
     ~ColorChooser();
 
     // Accessors
-    short getForeground();
-    short getBackground();
+    FColor getForeground();
+    FColor getBackground();
 
   private:
     // Disable copy constructor
@@ -56,8 +56,8 @@ class ColorChooser : public finalcut::FWidget
     virtual void onMouseDown (finalcut::FMouseEvent*);
 
     // Data Members
-    short fg_color;
-    short bg_color;
+    FColor fg_color;
+    FColor bg_color;
     finalcut::FLabel headline;
 };
 #pragma pack(pop)
@@ -75,8 +75,8 @@ ColorChooser::ColorChooser (finalcut::FWidget* parent)
 
   if ( parent )
   {
-    short fg = parent->getForegroundColor();
-    short bg = parent->getBackgroundColor();
+    FColor fg = parent->getForegroundColor();
+    FColor bg = parent->getBackgroundColor();
     setForegroundColor(fg);
     setBackgroundColor(bg);
     headline.setForegroundColor(fg);
@@ -112,9 +112,9 @@ void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev)
     if ( mouse_x >= xmin && mouse_x <= xmax && mouse_y == y )
     {
       if ( ev->getButton() == finalcut::fc::LeftButton )
-        bg_color = short(c);
+        bg_color = FColor(c);
       else if ( ev->getButton() == finalcut::fc::RightButton )
-        fg_color = short(c);
+        fg_color = FColor(c);
 
       redraw();
       emitCallback("clicked");
@@ -128,7 +128,7 @@ void ColorChooser::draw()
   setColor();
   finalcut::FWidget::drawBorder (1, 2, 8, 11);
 
-  for (short c = 0; c < 16; c++)
+  for (FColor c = 0; c < 16; c++)
   {
     setPrintPos (2 + (c / 8) * 3, 3 + c % 8);
 
@@ -151,13 +151,13 @@ void ColorChooser::draw()
 }
 
 //----------------------------------------------------------------------
-inline short ColorChooser::getForeground()
+inline FColor ColorChooser::getForeground()
 {
   return fg_color;
 }
 
 //----------------------------------------------------------------------
-inline short ColorChooser::getBackground()
+inline FColor ColorChooser::getBackground()
 {
   return bg_color;
 }
@@ -183,8 +183,8 @@ class Brushes : public finalcut::FWidget
     wchar_t getBrush();
 
     // Mutators
-    void setForeground (short);
-    void setBackground (short);
+    void setForeground (FColor);
+    void setBackground (FColor);
 
   private:
     // Disable copy constructor
@@ -200,8 +200,8 @@ class Brushes : public finalcut::FWidget
 
     // Data Members
     wchar_t brush;
-    short   fg_color;
-    short   bg_color;
+    FColor  fg_color;
+    FColor  bg_color;
     finalcut::FLabel headline;
 };
 #pragma pack(pop)
@@ -220,8 +220,8 @@ Brushes::Brushes (finalcut::FWidget* parent)
 
   if ( parent )
   {
-    short fg = parent->getForegroundColor();
-    short bg = parent->getBackgroundColor();
+    FColor fg = parent->getForegroundColor();
+    FColor bg = parent->getBackgroundColor();
     setForegroundColor(fg);
     setBackgroundColor(bg);
     headline.setForegroundColor(fg);
@@ -291,13 +291,13 @@ inline wchar_t Brushes::getBrush()
 }
 
 //----------------------------------------------------------------------
-inline void Brushes::setForeground (short color)
+inline void Brushes::setForeground (FColor color)
 {
   fg_color = color;
 }
 
 //----------------------------------------------------------------------
-inline void Brushes::setBackground (short color)
+inline void Brushes::setBackground (FColor color)
 {
   bg_color = color;
 }
diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp
index fd665e87..a66ceca2 100644
--- a/examples/term-attributes.cpp
+++ b/examples/term-attributes.cpp
@@ -243,7 +243,7 @@ void AttribDemo::printColorLine()
 {
   AttribDlg* parent = static_cast(getParent());
 
-  for (short color = 0; color < colors; color++)
+  for (FColor color = 0; color < colors; color++)
   {
     setColor (color, parent->bgcolor);
     print (" # ");
diff --git a/examples/timer.cpp b/examples/timer.cpp
index c189e2e9..8c3f5250 100644
--- a/examples/timer.cpp
+++ b/examples/timer.cpp
@@ -75,7 +75,7 @@ void Timer::onTimer (finalcut::FTimerEvent* ev)
   if ( getPrintPos().getY() == int(getDesktopHeight()) )
     is_last_line = true;
 
-  setColor (short(1 + timer_id), finalcut::fc::Default);
+  setColor (FColor(1 + timer_id), finalcut::fc::Default);
   print() << "Timer event, id " << timer_id << '\n';
 
   if ( is_last_line )
diff --git a/examples/treeview.cpp b/examples/treeview.cpp
index d2f5c045..6cc92274 100644
--- a/examples/treeview.cpp
+++ b/examples/treeview.cpp
@@ -28,6 +28,81 @@
 #include 
 
 
+// Function prototypes
+long StringToLong (const finalcut::FString&);
+bool sortAscending (const finalcut::FObject*, const finalcut::FObject*);
+bool sortDescending (const finalcut::FObject*, const finalcut::FObject*);
+
+
+// non-member functions
+//----------------------------------------------------------------------
+long StringToLong (const finalcut::FString& str)
+{
+  finalcut::FString NumString = str;
+  NumString = NumString.replace(",", "");
+  NumString = NumString.replace('.', "");
+  long number = NumString.toLong();
+  return number;
+}
+
+//----------------------------------------------------------------------
+bool sortAscending ( const finalcut::FObject* lhs
+                   , const finalcut::FObject* rhs )
+{
+  const finalcut::FListViewItem* l_item = static_cast(lhs);
+  const finalcut::FListViewItem* r_item = static_cast(rhs);
+  const int column = l_item->getSortColumn();
+
+  switch ( column )
+  {
+    case 2:
+    {
+      const long l_number = StringToLong(l_item->getText(column));
+      const long r_number = StringToLong(r_item->getText(column));
+      return bool( l_number < r_number );  // lhs < rhs
+    }
+    case 3:
+    {
+      std::setlocale(LC_NUMERIC, "C");
+      const double l_number = l_item->getText(column).toDouble();
+      const double r_number = r_item->getText(column).toDouble();
+      return bool( l_number < r_number );  // lhs < rhs
+    }
+  }
+
+  return false;
+}
+
+//----------------------------------------------------------------------
+bool sortDescending ( const finalcut::FObject* lhs
+                    , const finalcut::FObject* rhs )
+{
+  const finalcut::FListViewItem* l_item = static_cast(lhs);
+  const finalcut::FListViewItem* r_item = static_cast(rhs);
+  const int column = l_item->getSortColumn();
+
+  switch ( column )
+  {
+    case 2:
+    {
+      const long l_number = StringToLong(l_item->getText(column));
+      const long r_number = StringToLong(r_item->getText(column));
+      return bool( l_number > r_number );  // lhs > rhs
+    }
+
+    case 3:
+    {
+      std::setlocale(LC_NUMERIC, "C");
+      const double l_number = l_item->getText(column).toDouble();
+      const double r_number = r_item->getText(column).toDouble();
+      return bool( l_number > r_number );  // lhs > rhs
+    }
+  }
+
+  return false;
+}
+
+
 //----------------------------------------------------------------------
 // class Treeview
 //----------------------------------------------------------------------
@@ -239,6 +314,13 @@ Treeview::Treeview (finalcut::FWidget* parent)
   listView.setColumnAlignment (2, finalcut::fc::alignRight);
   listView.setColumnAlignment (3, finalcut::fc::alignRight);
 
+  // Set the type of sorting
+  listView.setColumnSortType (1, finalcut::fc::by_name);
+  listView.setColumnSortType (2, finalcut::fc::user_defined);
+  listView.setColumnSortType (3, finalcut::fc::user_defined);
+  listView.setUserAscendingCompare(sortAscending);
+  listView.setUserDescendingCompare(sortDescending);
+
   // Activate tree view
   listView.setTreeView();
 
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index e1412829..6f85e795 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -255,7 +255,7 @@ void FButton::setText (const FString& txt)
 void FButton::hide()
 {
   std::size_t s, f, size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget* parent_widget = getParentWidget();
   FWidget::hide();
 
diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp
index c5cf8612..47184fb1 100644
--- a/src/fbuttongroup.cpp
+++ b/src/fbuttongroup.cpp
@@ -190,7 +190,7 @@ bool FButtonGroup::hasCheckedButton() const
 void FButtonGroup::hide()
 {
   std::size_t size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget::hide();
   FWidget* parent_widget = getParentWidget();
 
diff --git a/src/flabel.cpp b/src/flabel.cpp
index 39985cbf..fd809cdf 100644
--- a/src/flabel.cpp
+++ b/src/flabel.cpp
@@ -241,7 +241,7 @@ void FLabel::setText (const FString& txt)
 //----------------------------------------------------------------------
 void FLabel::hide()
 {
-  short fg, bg;
+  FColor fg, bg;
   std::size_t size;
   FWidget* parent_widget = getParentWidget();
 
diff --git a/src/flineedit.cpp b/src/flineedit.cpp
index bdca4e7d..059186f5 100644
--- a/src/flineedit.cpp
+++ b/src/flineedit.cpp
@@ -282,7 +282,7 @@ void FLineEdit::setLabelOrientation(const label_o o)
 void FLineEdit::hide()
 {
   std::size_t s, size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget* parent_widget = getParentWidget();
 
   FWidget::hide();
diff --git a/src/flistbox.cpp b/src/flistbox.cpp
index c14162a2..02c733fe 100644
--- a/src/flistbox.cpp
+++ b/src/flistbox.cpp
@@ -241,7 +241,7 @@ void FListBox::setText (const FString& txt)
 void FListBox::hide()
 {
   std::size_t n, size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget* parent_widget = getParentWidget();
   FWidget::hide();
 
diff --git a/src/flistview.cpp b/src/flistview.cpp
index c4f6dd7b..1ece9806 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -1057,38 +1057,40 @@ void FListView::onMouseDown (FMouseEvent* ev)
     , mouse_x = ev->getX()
     , mouse_y = ev->getY();
 
-  if ( mouse_x > 1 && mouse_x < int(getWidth()) && mouse_y == 1 )
+  if ( mouse_x > 1 && mouse_x < int(getWidth()) )
   {
-    clicked_column_pos = ev->getPos();
-  }
-  else if ( mouse_x > 1 && mouse_x < int(getWidth())
-         && mouse_y > 1 && mouse_y < int(getHeight()) )
-  {
-    int new_pos = first_visible_line.getPosition() + mouse_y - 2;
-
-    if ( new_pos < int(getCount()) )
-      setRelativePosition (mouse_y - 2);
-
-    if ( tree_view )
+    if ( mouse_y == 1 )
     {
-      const FListViewItem* item = getCurrentItem();
-      int indent = int(item->getDepth() << 1);  // indent = 2 * depth
-
-      if ( item->isExpandable() && mouse_x - 2 == indent - xoffset )
-        clicked_expander_pos = ev->getPos();
+      clicked_column_pos = ev->getPos();
     }
+    else if ( mouse_y > 1 && mouse_y < int(getHeight()) )
+    {
+      int new_pos = first_visible_line.getPosition() + mouse_y - 2;
 
-    if ( isVisible() )
-      drawList();
+      if ( new_pos < int(getCount()) )
+        setRelativePosition (mouse_y - 2);
 
-    vbar->setValue (first_visible_line.getPosition());
+      if ( tree_view )
+      {
+        const FListViewItem* item = getCurrentItem();
+        int indent = int(item->getDepth() << 1);  // indent = 2 * depth
 
-    if ( vbar->isVisible()
-      && first_line_position_before != first_visible_line.getPosition() )
-      vbar->drawBar();
+        if ( item->isExpandable() && mouse_x - 2 == indent - xoffset )
+          clicked_expander_pos = ev->getPos();
+      }
 
-    updateTerminal();
-    flush_out();
+      if ( isVisible() )
+        drawList();
+
+      vbar->setValue (first_visible_line.getPosition());
+
+      if ( vbar->isVisible()
+        && first_line_position_before != first_visible_line.getPosition() )
+        vbar->drawBar();
+
+      updateTerminal();
+      flush_out();
+    }
   }
 }
 
@@ -1103,33 +1105,35 @@ void FListView::onMouseUp (FMouseEvent* ev)
     int mouse_x = ev->getX();
     int mouse_y = ev->getY();
 
-    if ( mouse_x > 1 && mouse_x < int(getWidth())
-      && mouse_y == 1 && clicked_column_pos == ev->getPos() )
+    if ( mouse_x > 1 && mouse_x < int(getWidth()) )
     {
-      mouseColumnClicked();
-    }
-    else if ( mouse_x > 1 && mouse_x < int(getWidth())
-           && mouse_y > 1 && mouse_y < int(getHeight()) )
-    {
-      if ( tree_view )
+      if ( mouse_y == 1 && clicked_column_pos == ev->getPos() )
       {
-        FListViewItem* item = getCurrentItem();
-
-        if ( item->isExpandable() && clicked_expander_pos == ev->getPos() )
-        {
-          if ( item->isExpand() )
-            item->collapse();
-          else
-            item->expand();
-
-          adjustSize();
-
-          if ( isVisible() )
-            draw();
-        }
+        mouseColumnClicked();
       }
+      else if ( mouse_y > 1 && mouse_y < int(getHeight()) )
+      {
+        if ( tree_view )
+        {
+          FListViewItem* item = getCurrentItem();
 
-      processChanged();
+          if ( item->isExpandable()
+            && clicked_expander_pos == ev->getPos() )
+          {
+            if ( item->isExpand() )
+              item->collapse();
+            else
+              item->expand();
+
+            adjustSize();
+
+            if ( isVisible() )
+              draw();
+          }
+        }
+
+        processChanged();
+      }
     }
   }
 
@@ -1789,9 +1793,9 @@ inline void FListView::drawSortIndicator ( std::size_t& length
   length++;
 
   if ( sort_order == fc::ascending )
-    headerline << wchar_t(fc::BlackDownPointingTriangle);  // ▼
-  else if ( sort_order == fc::descending )
     headerline << wchar_t(fc::BlackUpPointingTriangle);    // ▲
+  else if ( sort_order == fc::descending )
+    headerline << wchar_t(fc::BlackDownPointingTriangle);  // ▼
 
   if ( length < column_width  )
   {
@@ -1819,7 +1823,7 @@ void FListView::drawColumnText (headerItems::const_iterator& iter)
   std::size_t txt_length = txt.getLength();
   std::size_t column_width = leading_space + width;
   headerItems::const_iterator first = header.begin();
-  int column = std::distance(first, iter) + 1;
+  int column = int(std::distance(first, iter)) + 1;
   bool has_sort_indicator = bool ( sort_column == column
                                 && ! hide_sort_indicator );
 
diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp
index 9f08939e..16323b4a 100644
--- a/src/fmenubar.cpp
+++ b/src/fmenubar.cpp
@@ -63,7 +63,7 @@ void FMenuBar::resetMenu()
 //----------------------------------------------------------------------
 void FMenuBar::hide()
 {
-  short fg, bg;
+  FColor fg, bg;
   FWindow::hide();
   fg = wc.term_fg;
   bg = wc.term_bg;
diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp
index aa98d8d6..afcb5da1 100644
--- a/src/foptiattr.cpp
+++ b/src/foptiattr.cpp
@@ -578,7 +578,7 @@ FColor FOptiAttr::vga2ansi (FColor color)
     color = 0;
   else if ( color < 16 )
   {
-    static const short lookup_table[] =
+    static const FColor lookup_table[] =
     {
       0,  4,  2,  6,  1,  5,  3,  7,
       8, 12, 10, 14,  9, 13, 11, 15
diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp
index 559ce6e0..5f343833 100644
--- a/src/fprogressbar.cpp
+++ b/src/fprogressbar.cpp
@@ -99,7 +99,7 @@ bool FProgressbar::setShadow (bool on)
 void FProgressbar::hide()
 {
   std::size_t s, size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget* parent_widget = getParentWidget();
 
   FWidget::hide();
diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp
index 7b783782..9a982722 100644
--- a/src/fstatusbar.cpp
+++ b/src/fstatusbar.cpp
@@ -196,7 +196,7 @@ bool FStatusBar::hasActivatedKey()
 //----------------------------------------------------------------------
 void FStatusBar::hide()
 {
-  short fg, bg;
+  FColor fg, bg;
   FWindow::hide();
   fg = wc.term_fg;
   bg = wc.term_bg;
diff --git a/src/ftextview.cpp b/src/ftextview.cpp
index b5e56473..880bb1aa 100644
--- a/src/ftextview.cpp
+++ b/src/ftextview.cpp
@@ -196,7 +196,7 @@ void FTextView::scrollTo (int x, int y)
 void FTextView::hide()
 {
   std::size_t n, size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget* parent_widget = getParentWidget();
 
   FWidget::hide();
diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp
index 6ac83c9b..d812245d 100644
--- a/src/ftogglebutton.cpp
+++ b/src/ftogglebutton.cpp
@@ -213,7 +213,7 @@ void FToggleButton::setText (const FString& txt)
 void FToggleButton::hide()
 {
   std::size_t size;
-  short fg, bg;
+  FColor fg, bg;
   FWidget* parent_widget = getParentWidget();
   FWidget::hide();
 
diff --git a/src/fvterm.cpp b/src/fvterm.cpp
index 68274f49..f7938e9b 100644
--- a/src/fvterm.cpp
+++ b/src/fvterm.cpp
@@ -164,16 +164,13 @@ void FVTerm::setPrintCursor (int x, int y)
 }
 
 //----------------------------------------------------------------------
-FColor FVTerm::rgb2ColorIndex (short r, short g, short b)
+FColor FVTerm::rgb2ColorIndex (uInt8 r, uInt8 g, uInt8 b)
 {
   // Converts a 24-bit RGB color to a 256-color compatible approximation
 
-  if ( r < 0 || g < 0 || b < 0 || r > 0xff || g > 0xff || b > 0xff )
-    return 0;
-
-  short ri = (((r * 5) + 127) / 255) * 36;
-  short gi = (((g * 5) + 127) / 255) * 6;
-  short bi = (((b * 5) + 127) / 255);
+  FColor ri = (((r * 5) + 127) / 255) * 36;
+  FColor gi = (((g * 5) + 127) / 255) * 6;
+  FColor bi = (((b * 5) + 127) / 255);
   return 16 + ri + gi + bi;
 }
 
diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h
index 282076b2..ccdd7546 100644
--- a/src/include/final/fbutton.h
+++ b/src/include/final/fbutton.h
@@ -168,13 +168,13 @@ class FButton : public FWidget
     std::size_t  center_offset;
     std::size_t  vcenter_offset;
     std::size_t  txtlength;
-    short        button_fg;
-    short        button_bg;
-    short        button_hotkey_fg;
-    short        button_focus_fg;
-    short        button_focus_bg;
-    short        button_inactive_fg;
-    short        button_inactive_bg;
+    FColor       button_fg;
+    FColor       button_bg;
+    FColor       button_hotkey_fg;
+    FColor       button_focus_fg;
+    FColor       button_focus_bg;
+    FColor       button_inactive_fg;
+    FColor       button_inactive_bg;
 };
 #pragma pack(pop)
 
diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h
index 9a0cee23..1236e4a6 100644
--- a/src/include/final/flabel.h
+++ b/src/include/final/flabel.h
@@ -157,8 +157,8 @@ class FLabel : public FWidget
     bool               multiline;
     FString            text;
     fc::text_alignment alignment;
-    short              emphasis_color;
-    short              ellipsis_color;
+    FColor             emphasis_color;
+    FColor             ellipsis_color;
     bool               emphasis;
     bool               reverse_mode;
     FWidget*           accel_widget;
diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h
index 5d9dbc94..412d968a 100644
--- a/src/include/final/fmessagebox.h
+++ b/src/include/final/fmessagebox.h
@@ -165,7 +165,7 @@ class FMessageBox : public FDialog
     FStringList   text_split;
     std::size_t   max_line_width;
     bool          center_text;
-    short         emphasis_color;
+    FColor        emphasis_color;
     uInt          num_buttons;
     uInt          text_num_lines;
     int           button_digit[3];
diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h
index 537a2a4b..362dbf2d 100644
--- a/src/include/final/fvterm.h
+++ b/src/include/final/fvterm.h
@@ -129,8 +129,8 @@ class FVTerm
 
     // Accessors
     virtual const char*   getClassName() const;
-    static short          getTermForegroundColor();
-    static short          getTermBackgroundColor();
+    static FColor         getTermForegroundColor();
+    static FColor         getTermBackgroundColor();
     term_area*            getVWin() const;
     FPoint                getPrintCursor();
     static charData       getAttribute();
@@ -153,7 +153,7 @@ class FVTerm
     void                  showCursor();
     void                  setPrintCursor (const FPoint&);
     void                  setPrintCursor (int, int);
-    FColor                rgb2ColorIndex (short, short, short);
+    FColor                rgb2ColorIndex (uInt8, uInt8, uInt8);
     void                  setColor (FColor, FColor);
     static void           setNormal();
 
@@ -605,11 +605,11 @@ inline const char* FVTerm::getClassName() const
 { return "FVTerm"; }
 
 //----------------------------------------------------------------------
-inline short FVTerm::getTermForegroundColor()
+inline FColor FVTerm::getTermForegroundColor()
 { return next_attribute.fg_color; }
 
 //----------------------------------------------------------------------
-inline short FVTerm::getTermBackgroundColor()
+inline FColor FVTerm::getTermBackgroundColor()
 { return next_attribute.bg_color; }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index 6d4eed17..b76a5a59 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -185,8 +185,8 @@ class FWidget : public FVTerm, public FObject
     static FMenuBar*   getMenuBar();
     static FStatusBar* getStatusBar();
     FString            getStatusbarMessage() const;
-    short              getForegroundColor() const;  // get the primary
-    short              getBackgroundColor() const;  // widget colors
+    FColor             getForegroundColor() const;  // get the primary
+    FColor             getBackgroundColor() const;  // widget colors
     int                getX() const;  // positioning
     int                getY() const;
     const FPoint       getPos() const;
@@ -571,11 +571,11 @@ inline FString FWidget::getStatusbarMessage() const
 { return statusbar_message; }
 
 //----------------------------------------------------------------------
-inline short FWidget::getForegroundColor() const
+inline FColor FWidget::getForegroundColor() const
 { return foreground_color; }
 
 //----------------------------------------------------------------------
-inline short FWidget::getBackgroundColor() const
+inline FColor FWidget::getBackgroundColor() const
 { return background_color; }
 
 //----------------------------------------------------------------------

From 3953dc19fa672d203424a6c59c2f019a25a9eb0f Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sun, 18 Nov 2018 01:15:38 +0100
Subject: [PATCH 28/33] FListViewItem now provides checkable list view items

---
 .gitignore                    |   1 +
 ChangeLog                     |   4 +
 examples/Makefile.am          |   2 +
 examples/checklist.cpp        | 207 +++++++++++++++++++++++++++++++
 examples/listview.cpp         |   2 +-
 examples/treeview.cpp         |   4 +-
 src/flistbox.cpp              |   4 +-
 src/flistview.cpp             | 223 +++++++++++++++++++++++++---------
 src/include/final/flistbox.h  |   2 +-
 src/include/final/flistview.h |  41 ++++++-
 src/include/final/fobject.h   |   4 +-
 11 files changed, 425 insertions(+), 69 deletions(-)
 create mode 100644 examples/checklist.cpp

diff --git a/.gitignore b/.gitignore
index 1ed0f006..1be54131 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ examples/input-dialog
 examples/choice
 examples/listbox
 examples/listview
+examples/checklist
 examples/treeview
 examples/mandelbrot
 examples/keyboard
diff --git a/ChangeLog b/ChangeLog
index 05e887b0..4ea2195c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-18  Markus Gans  
+	* The FListViewItem class now provides checkable list view items
+	* Adding the checklist example to demonstrate the checkable FListViewItems
+
 2018-11-12  Markus Gans  
 	* Clicking on the column header in FListView now changes the sort order
 
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 931db97a..b6d75f86 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -14,6 +14,7 @@ noinst_PROGRAMS = \
 	choice \
 	listbox \
 	listview \
+	checklist \
 	treeview \
 	opti-move \
 	termcap \
@@ -37,6 +38,7 @@ input_dialog_SOURCES = input-dialog.cpp
 choice_SOURCES = choice.cpp
 listbox_SOURCES = listbox.cpp
 listview_SOURCES = listview.cpp
+checklist_SOURCES = checklist.cpp
 treeview_SOURCES = treeview.cpp
 opti_move_SOURCES = opti-move.cpp
 string_operations_SOURCES = string-operations.cpp
diff --git a/examples/checklist.cpp b/examples/checklist.cpp
new file mode 100644
index 00000000..45bd96e9
--- /dev/null
+++ b/examples/checklist.cpp
@@ -0,0 +1,207 @@
+/***********************************************************************
+* checklist.cpp - Example for FListView widget with checkboxes         *
+*                                                                      *
+* This file is part of the Final Cut widget toolkit                    *
+*                                                                      *
+* Copyright 2017-2018 Markus Gans                                      *
+*                                                                      *
+* The Final Cut is free software; you can redistribute it and/or       *
+* modify it under the terms of the GNU Lesser General Public License   *
+* as published by the Free Software Foundation; either version 3 of    *
+* the License, or (at your option) any later version.                  *
+*                                                                      *
+* The Final Cut is distributed in the hope that it will be useful,     *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+* GNU Lesser General Public License for more details.                  *
+*                                                                      *
+* You should have received a copy of the GNU Lesser General Public     *
+* License along with this program.  If not, see                        *
+* .                                      *
+***********************************************************************/
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+
+//----------------------------------------------------------------------
+// class CheckList
+//----------------------------------------------------------------------
+
+#pragma pack(push)
+#pragma pack(1)
+
+class CheckList : public finalcut::FDialog
+{
+  public:
+    // Constructor
+    explicit CheckList (finalcut::FWidget* = 0);
+    // Destructor
+    ~CheckList();
+
+  private:
+    // Disable copy constructor
+    CheckList (const CheckList&);
+    // Disable assignment operator (=)
+    CheckList& operator = (const CheckList&);
+
+    // Method
+    void populate();
+
+    // Event handlers
+    virtual void onKeyPress (finalcut::FKeyEvent*);
+    virtual void onClose (finalcut::FCloseEvent*);
+
+    // Callback method
+    void cb_showList (finalcut::FWidget*, data_ptr);
+
+    // Data Members
+    finalcut::FListView  listView;
+    finalcut::FStatusBar status_bar;
+};
+#pragma pack(pop)
+
+//----------------------------------------------------------------------
+CheckList::CheckList (finalcut::FWidget* parent)
+  : finalcut::FDialog(parent)
+  , listView(this)
+  , status_bar(this)
+{
+  setText (L"Shopping list");
+  setShadow();
+  setGeometry (int(1 + (parent->getWidth() - 30) / 2), 5, 30, 13);
+  listView.ignorePadding();
+  listView.setGeometry (1, 2, getWidth(), getHeight() - 1);
+
+  // Add columns to the view
+  listView.addColumn ("Item");
+  listView.addColumn ("Priority", 12);
+
+  // Set the type of sorting
+  listView.setColumnSortType (1, finalcut::fc::by_name);
+  listView.setColumnSortType (2, finalcut::fc::by_name);
+
+  // Statusbar at the bottom
+  finalcut::FString separator;
+  separator << ' ' << wchar_t(finalcut::fc::BoxDrawingsVertical) << ' ';
+  listView.setStatusbarMessage ( finalcut::FString()
+                                 << " exit" << separator
+                                 << " select an item" << separator
+                                 << " see your pick list");
+
+  // Populate FListView with a list of items
+  populate();
+
+  // Add callback method
+  listView.addCallback
+  (
+    "clicked",
+    F_METHOD_CALLBACK (this, &CheckList::cb_showList)
+  );
+}
+
+//----------------------------------------------------------------------
+CheckList::~CheckList()  // destructor
+{ }
+
+//----------------------------------------------------------------------
+void CheckList::populate()
+{
+  std::string list[][2] =
+  {
+    { "Milk", "Highest" },
+    { "Cheese", "High" },
+    { "Yoghurt", "Medium" },
+    { "Bread", "Low" },
+    { "Eggs", "High" },
+    { "Toothpaste", "Medium" },
+    { "Apples", "Lowest" },
+    { "Bananas", "Medium" },
+    { "Fish", "Medium" },
+    { "Lemons", "Low" }
+  };
+
+  const int lastItem = int(sizeof(list) / sizeof(list[0])) - 1;
+
+  for (int i = 0; i <= lastItem; i++)
+  {
+    const finalcut::FStringList line (&list[i][0], &list[i][0] + 2);
+    finalcut::FObject::FObjectIterator iter = listView.insert (line);
+    finalcut::FListViewItem* item = static_cast(*iter);
+    item->setCheckable(true);
+  }
+}
+
+//----------------------------------------------------------------------
+void CheckList::onKeyPress (finalcut::FKeyEvent* ev)
+{
+  if ( ! ev )
+    return;
+
+  if ( ev->key() == 'q'
+    || ev->key() == finalcut::fc::Fkey_escape
+    || ev->key() == finalcut::fc::Fkey_escape_mintty )
+  {
+    close();
+    ev->accept();
+  }
+  else
+    finalcut::FDialog::onKeyPress(ev);
+}
+
+//----------------------------------------------------------------------
+void CheckList::onClose (finalcut::FCloseEvent* ev)
+{
+  finalcut::FApplication::closeConfirmationDialog (this, ev);
+}
+
+//----------------------------------------------------------------------
+void CheckList::cb_showList (finalcut::FWidget*, data_ptr)
+{
+  finalcut::FListViewIterator iter = listView.beginOfList();
+  finalcut::FString shopping_list;
+
+  while ( iter != listView.endOfList() )
+  {
+    const finalcut::FListViewItem* item = static_cast(*iter);
+
+    if ( item->isChecked() )
+      shopping_list << wchar_t(finalcut::fc::Bullet) << ' ' << item->getText(1) << '\n';
+
+    ++iter;
+  }
+
+  if ( shopping_list.isEmpty() )
+    return;
+
+  // Create and show tooltip for two seconds
+  finalcut::FToolTip picklist(this);
+  picklist.setText (shopping_list);
+  picklist.show();
+  sleep(2);
+}
+
+
+//----------------------------------------------------------------------
+//                               main part
+//----------------------------------------------------------------------
+
+int main (int argc, char* argv[])
+{
+  // Create the application object
+  finalcut::FApplication app(argc, argv);
+
+  // Create main dialog object
+  CheckList d(&app);
+
+  // Set dialog d as main widget
+  app.setMainWidget(&d);
+
+  // Show and start the application
+  d.show();
+  return app.exec();
+}
diff --git a/examples/listview.cpp b/examples/listview.cpp
index 062688e8..46419709 100644
--- a/examples/listview.cpp
+++ b/examples/listview.cpp
@@ -70,7 +70,7 @@ Listview::Listview (finalcut::FWidget* parent)
   , listView(this)
   , Quit(this)
 {
-  // Create FListView object
+  // Set FListView geometry
   listView.setGeometry(2, 1, 33, 14);
 
   // Add columns to the view
diff --git a/examples/treeview.cpp b/examples/treeview.cpp
index 6cc92274..d2462aa4 100644
--- a/examples/treeview.cpp
+++ b/examples/treeview.cpp
@@ -130,7 +130,7 @@ class Treeview : public finalcut::FDialog
     // Methods
     virtual void adjustSize();
 
-    // Event handlers
+    // Event handler
     void onClose (finalcut::FCloseEvent*);
 
     // Data Members
@@ -302,7 +302,7 @@ Treeview::Treeview (finalcut::FWidget* parent)
   , listView(this)
   , Quit(this)
 {
-  // Create FListView object
+  // Set FListView geometry
   listView.setGeometry(2, 1, 53, 14);
 
   // Add columns to the view
diff --git a/src/flistbox.cpp b/src/flistbox.cpp
index 02c733fe..b9f238a2 100644
--- a/src/flistbox.cpp
+++ b/src/flistbox.cpp
@@ -896,7 +896,7 @@ void FListBox::draw()
     }
   }
 
-  drawLabel();
+  drawHeadline();
 
   if ( isMonochron() )
     setReverse(false);
@@ -923,7 +923,7 @@ void FListBox::draw()
 }
 
 //----------------------------------------------------------------------
-void FListBox::drawLabel()
+void FListBox::drawHeadline()
 {
   if ( text.isNull() || text.isEmpty() )
     return;
diff --git a/src/flistview.cpp b/src/flistview.cpp
index 1ece9806..103999dd 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -167,6 +167,8 @@ FListViewItem::FListViewItem (const FListViewItem& item)
   , visible_lines(1)
   , expandable(false)
   , is_expand(false)
+  , checkable(false)
+  , is_checked(false)
 {
   FObject* parent = getParent();
 
@@ -192,6 +194,8 @@ FListViewItem::FListViewItem (FObjectIterator parent_iter)
   , visible_lines(1)
   , expandable(false)
   , is_expand(false)
+  , checkable(false)
+  , is_checked(false)
 {
   insert (this, parent_iter);
 }
@@ -207,6 +211,8 @@ FListViewItem::FListViewItem ( const FStringList& cols
   , visible_lines(1)
   , expandable(false)
   , is_expand(false)
+  , checkable(false)
+  , is_checked(false)
 {
   if ( cols.empty() )
     return;
@@ -325,7 +331,7 @@ FObject::FObjectIterator FListViewItem::insert ( FListViewItem* child
 //----------------------------------------------------------------------
 void FListViewItem::expand()
 {
-  if ( is_expand || ! hasChildren() )
+  if ( isExpand() || ! hasChildren() )
     return;
 
   is_expand = true;
@@ -334,7 +340,7 @@ void FListViewItem::expand()
 //----------------------------------------------------------------------
 void FListViewItem::collapse()
 {
-  if ( ! is_expand )
+  if ( ! isExpand() )
     return;
 
   is_expand = false;
@@ -346,7 +352,7 @@ void FListViewItem::collapse()
 template 
 void FListViewItem::sort (Compare cmp)
 {
-  if ( ! expandable )
+  if ( ! isExpandable() )
     return;
 
   // Sort the top level
@@ -418,6 +424,20 @@ std::size_t FListViewItem::getVisibleLines()
   return visible_lines;
 }
 
+//----------------------------------------------------------------------
+void FListViewItem::setCheckable (bool on)
+{
+  checkable = on;
+
+  if ( *root )
+  {
+    FListView* root_obj = static_cast(*root);
+
+    if ( ! root_obj->hasCheckableItems() && isCheckable() )
+      root_obj->has_checkable_items = true;
+  }
+}
+
 //----------------------------------------------------------------------
 void FListViewItem::resetVisibleLineCounter()
 {
@@ -611,8 +631,10 @@ FListView::FListView (FWidget* parent)
   , scroll_timer(false)
   , tree_view(false)
   , hide_sort_indicator(false)
+  , has_checkable_items(false)
   , clicked_expander_pos(-1, -1)
-  , clicked_column_pos(-1, -1)
+  , clicked_header_pos(-1, -1)
+  , clicked_checkbox_item(0)
   , xoffset(0)
   , nf_offset(0)
   , max_line_width(1)
@@ -802,14 +824,11 @@ FObject::FObjectIterator FListView::insert ( FListViewItem* item
                                            , FObjectIterator parent_iter )
 {
   FObjectIterator item_iter;
-  int line_width;
-  int element_count;
 
   if ( parent_iter == FListView::null_iter )
     return FListView::null_iter;
 
-  line_width = determineLineWidth (item);
-  recalculateHorizontalBar (line_width);
+  beforeInsertion(item);  // preprocessing
 
   if  ( parent_iter == root )
   {
@@ -835,19 +854,7 @@ FObject::FObjectIterator FListView::insert ( FListViewItem* item
   else
     item_iter = FListView::null_iter;
 
-  if ( itemlist.size() == 1 )
-  {
-    // Select first item on insert
-    current_iter = itemlist.begin();
-    // The visible area of the list begins with the first element
-    first_visible_line = itemlist.begin();
-  }
-
-  // Sort list by a column (only if activated)
-  sort();
-
-  element_count = int(getCount());
-  recalculateVerticalBar (element_count);
+  afterInsertion();  // post-processing
   return item_iter;
 }
 
@@ -964,6 +971,11 @@ void FListView::onKeyPress (FKeyEvent* ev)
       ev->accept();
       break;
 
+    case fc::Fkey_space:
+      keySpace();
+      ev->accept();
+      break;
+
     case fc::Fkey_up:
       stepBackward();
       ev->accept();
@@ -1059,26 +1071,41 @@ void FListView::onMouseDown (FMouseEvent* ev)
 
   if ( mouse_x > 1 && mouse_x < int(getWidth()) )
   {
-    if ( mouse_y == 1 )
+    if ( mouse_y == 1 )  // Header
     {
-      clicked_column_pos = ev->getPos();
+      clicked_header_pos = ev->getPos();
     }
-    else if ( mouse_y > 1 && mouse_y < int(getHeight()) )
+    else if ( mouse_y > 1 && mouse_y < int(getHeight()) )  // List
     {
+      int indent = 0;
       int new_pos = first_visible_line.getPosition() + mouse_y - 2;
 
       if ( new_pos < int(getCount()) )
         setRelativePosition (mouse_y - 2);
 
+      const FListViewItem* item = getCurrentItem();
+
       if ( tree_view )
       {
-        const FListViewItem* item = getCurrentItem();
-        int indent = int(item->getDepth() << 1);  // indent = 2 * depth
+        indent = int(item->getDepth() << 1);  // indent = 2 * depth
 
         if ( item->isExpandable() && mouse_x - 2 == indent - xoffset )
           clicked_expander_pos = ev->getPos();
       }
 
+      if ( hasCheckableItems() )
+      {
+        if ( tree_view )
+          indent++;  // Plus one space
+
+        if ( mouse_x >= 3 + indent - xoffset
+          && mouse_x <= 5 + indent - xoffset
+          && item->isCheckable() )
+        {
+          clicked_checkbox_item = item;
+        }
+      }
+
       if ( isVisible() )
         drawList();
 
@@ -1107,15 +1134,18 @@ void FListView::onMouseUp (FMouseEvent* ev)
 
     if ( mouse_x > 1 && mouse_x < int(getWidth()) )
     {
-      if ( mouse_y == 1 && clicked_column_pos == ev->getPos() )
+      if ( mouse_y == 1 && clicked_header_pos == ev->getPos() )  // Header
       {
-        mouseColumnClicked();
+        mouseHeaderClicked();
       }
-      else if ( mouse_y > 1 && mouse_y < int(getHeight()) )
+      else if ( mouse_y > 1 && mouse_y < int(getHeight()) )  // List
       {
+        int indent = 0;
+        FListViewItem* item = getCurrentItem();
+
         if ( tree_view )
         {
-          FListViewItem* item = getCurrentItem();
+          indent = int(item->getDepth() << 1);  // indent = 2 * depth
 
           if ( item->isExpandable()
             && clicked_expander_pos == ev->getPos() )
@@ -1132,13 +1162,30 @@ void FListView::onMouseUp (FMouseEvent* ev)
           }
         }
 
+        if ( hasCheckableItems() )
+        {
+          if ( tree_view )
+            indent++;  // Plus one space
+
+          if ( mouse_x >= 3 + indent - xoffset
+            && mouse_x <= 5 + indent - xoffset
+            && clicked_checkbox_item == item )
+          {
+            item->setChecked(! item->isChecked());
+
+            if ( isVisible() )
+              draw();
+          }
+        }
+
         processChanged();
       }
     }
   }
 
   clicked_expander_pos.setPoint(-1, -1);
-  clicked_column_pos.setPoint(-1, -1);
+  clicked_header_pos.setPoint(-1, -1);
+  clicked_checkbox_item = 0;
 }
 
 //----------------------------------------------------------------------
@@ -1521,7 +1568,7 @@ void FListView::draw()
     }
   }
 
-  drawColumnLabels();
+  drawHeadlines();
 
   if ( isMonochron() )
     setReverse(false);
@@ -1548,7 +1595,7 @@ void FListView::draw()
 }
 
 //----------------------------------------------------------------------
-void FListView::drawColumnLabels()
+void FListView::drawHeadlines()
 {
   std::vector::const_iterator first, last;
   headerItems::const_iterator iter;
@@ -1562,6 +1609,9 @@ void FListView::drawColumnLabels()
   iter = header.begin();
   headerline.clear();
 
+  if ( hasCheckableItems() )
+    drawHeaderBorder(4);
+
   while ( iter != header.end() )
   {
     const FString& text = iter->name;
@@ -1572,7 +1622,7 @@ void FListView::drawColumnLabels()
       continue;
     }
 
-    drawColumnText(iter);
+    drawHeadlineLabel(iter);
     ++iter;
   }
 
@@ -1643,35 +1693,37 @@ void FListView::drawListLine ( const FListViewItem* item
                              , bool is_focus
                              , bool is_current )
 {
-  std::size_t indent = item->getDepth() << 1;  // indent = 2 * depth
-
   // Set line color and attributes
   setLineAttributes (is_current, is_focus);
 
   // Print the entry
+  std::size_t indent = item->getDepth() << 1;  // indent = 2 * depth
   FString line = getLinePrefix (item, indent);
 
   // Print columns
   if ( ! item->column_list.empty() )
   {
-    for (std::size_t i = 0; i < item->column_list.size(); )
+    for (std::size_t col = 0; col < item->column_list.size(); )
     {
       static const std::size_t leading_space = 1;
+      static const std::size_t checkbox_space = 4;
       static const std::size_t ellipsis_length = 2;
 
-      const FString& text = item->column_list[i];
-      std::size_t width = std::size_t(header[i].width);
+      const FString& text = item->column_list[col];
+      std::size_t width = std::size_t(header[col].width);
       std::size_t txt_length = text.getLength();
       // Increment the value of i for the column position
       // and the next iteration
-      i++;
-      fc::text_alignment align = getColumnAlignment(int(i));
+      col++;
+      fc::text_alignment align = getColumnAlignment(int(col));
       std::size_t align_offset = getAlignOffset (align, txt_length, width);
 
-      if ( tree_view && i == 1 )
+      if ( tree_view && col == 1 )
       {
-        width -= indent;
-        width--;
+        width -= (indent + 1);
+
+        if ( item->isCheckable() )
+          width -= checkbox_space;
       }
 
       // Insert alignment spaces
@@ -1749,20 +1801,41 @@ inline void FListView::setLineAttributes ( bool is_current
   }
 }
 
+//----------------------------------------------------------------------
+inline FString FListView::getCheckBox (const FListViewItem* item)
+{
+  FString checkbox;
+
+  if ( isNewFont() )
+  {
+    checkbox = ( item->isChecked() ) ? CHECKBOX_ON : CHECKBOX;
+    checkbox += L' ';
+  }
+  else
+  {
+    checkbox = L"[ ] ";
+
+    if ( item->isChecked() )
+      checkbox[1] = wchar_t(fc::Times);  // Times ×
+  }
+
+  return checkbox;
+}
+
 //----------------------------------------------------------------------
 inline FString FListView::getLinePrefix ( const FListViewItem* item
                                         , std::size_t indent )
 {
-  FString line = "";
+  FString line;
 
   if ( tree_view )
   {
     if ( indent > 0 )
       line = FString(indent, L' ');
 
-    if ( item->expandable  )
+    if ( item->isExpandable()  )
     {
-      if ( item->is_expand )
+      if ( item->isExpand() )
       {
         line += wchar_t(fc::BlackDownPointingTriangle);  // ▼
         line += L' ';
@@ -1779,6 +1852,9 @@ inline FString FListView::getLinePrefix ( const FListViewItem* item
   else
     line = L" ";
 
+  if ( item->isCheckable() )
+    line += getCheckBox(item);
+
   return line;
 }
 
@@ -1813,7 +1889,7 @@ inline void FListView::drawHeaderBorder (std::size_t length)
 }
 
 //----------------------------------------------------------------------
-void FListView::drawColumnText (headerItems::const_iterator& iter)
+void FListView::drawHeadlineLabel (headerItems::const_iterator& iter)
 {
   // Print lable text
   static const std::size_t leading_space = 1;
@@ -1932,6 +2008,31 @@ int FListView::determineLineWidth (FListViewItem* item)
   return line_width;
 }
 
+//----------------------------------------------------------------------
+inline void FListView::beforeInsertion (FListViewItem* item)
+{
+  int line_width = determineLineWidth (item);
+  recalculateHorizontalBar (line_width);
+}
+
+//----------------------------------------------------------------------
+inline void FListView::afterInsertion()
+{
+  if ( itemlist.size() == 1 )
+  {
+    // Select first item on insert
+    current_iter = itemlist.begin();
+    // The visible area of the list begins with the first element
+    first_visible_line = itemlist.begin();
+  }
+
+  // Sort list by a column (only if activated)
+  sort();
+
+  int element_count = int(getCount());
+  recalculateVerticalBar (element_count);
+}
+
 //----------------------------------------------------------------------
 void FListView::recalculateHorizontalBar (int len)
 {
@@ -1963,11 +2064,12 @@ void FListView::recalculateVerticalBar (int element_count)
 }
 
 //----------------------------------------------------------------------
-void FListView::mouseColumnClicked()
+void FListView::mouseHeaderClicked()
 {
-  int column_start = 2;
   int column = 1;
-  int column_pos = clicked_column_pos.getX() + xoffset;
+  int checkbox_offset = ( hasCheckableItems() ) ? 4 : 0;
+  int header_start = 2 + checkbox_offset;
+  int header_pos = clicked_header_pos.getX() + xoffset;
   headerItems::const_iterator iter;
   iter = header.begin();
 
@@ -1983,8 +2085,8 @@ void FListView::mouseColumnClicked()
     if ( click_width > iter->width )
       click_width = iter->width;
 
-    if ( column_pos > column_start
-      && column_pos <= column_start + click_width )
+    if ( header_pos > header_start
+      && header_pos <= header_start + click_width )
     {
       if ( has_sort_indicator && sort_order == fc::ascending )
         setColumnSort (column, fc::descending);
@@ -1995,7 +2097,7 @@ void FListView::mouseColumnClicked()
 
       if ( isVisible() )
       {
-        drawColumnLabels();
+        drawHeadlines();
         drawList();
         updateTerminal();
         flush_out();
@@ -2003,7 +2105,7 @@ void FListView::mouseColumnClicked()
       break;
     }
 
-    column_start += leading_space + iter->width;
+    header_start += leading_space + iter->width;
     column++;
     ++iter;
   }
@@ -2167,6 +2269,15 @@ void FListView::processChanged()
   emitCallback("row-changed");
 }
 
+//----------------------------------------------------------------------
+inline void FListView::keySpace()
+{
+  FListViewItem* item = getCurrentItem();
+
+  if ( item->isCheckable() )
+    item->setChecked(! item->isChecked());
+}
+
 //----------------------------------------------------------------------
 inline void FListView::keyLeft (int& first_line_position_before)
 {
@@ -2569,7 +2680,7 @@ void FListView::cb_HBarChange (FWidget*, data_ptr)
 
   if ( isVisible() )
   {
-    drawColumnLabels();
+    drawHeadlines();
     drawList();
     updateTerminal();
     flush_out();
diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h
index 9ffb9627..3e96ef56 100644
--- a/src/include/final/flistbox.h
+++ b/src/include/final/flistbox.h
@@ -245,7 +245,7 @@ class FListBox : public FWidget
     // Methods
     void         init();
     virtual void draw();
-    void         drawLabel();
+    void         drawHeadline();
     void         drawList();
     void         drawListLine (int, listBoxItems::iterator, bool);
     void         printLeftBracket (fc::brackets_type);
diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h
index e63e6473..2e1c3395 100644
--- a/src/include/final/flistview.h
+++ b/src/include/final/flistview.h
@@ -98,11 +98,14 @@ class FListViewItem : public FObject
     FWidget::data_ptr getData() const;
     uInt              getDepth() const;
 
-    // Mutator
+    // Mutators
     void              setText (int, const FString&);
     void              setData (FWidget::data_ptr);
+    void              setCheckable (bool);
+    void              setChecked (bool);
 
     // Inquiry
+    bool              isChecked() const;
     bool              isExpand() const;
 
     // Methods
@@ -114,6 +117,7 @@ class FListViewItem : public FObject
   private:
     // Inquiry
     bool              isExpandable() const;
+    bool              isCheckable() const;
 
     // Methods
     template 
@@ -130,6 +134,8 @@ class FListViewItem : public FObject
     std::size_t       visible_lines;
     bool              expandable;
     bool              is_expand;
+    bool              checkable;
+    bool              is_checked;
 
     // Friend class
     friend class FListView;
@@ -155,6 +161,14 @@ inline FWidget::data_ptr FListViewItem::getData() const
 inline void FListViewItem::setData (FWidget::data_ptr data)
 { data_pointer = data; }
 
+//----------------------------------------------------------------------
+inline void FListViewItem::setChecked (bool checked)
+{ is_checked = checked; }
+
+//----------------------------------------------------------------------
+inline bool FListViewItem::isChecked() const
+{ return is_checked; }
+
 //----------------------------------------------------------------------
 inline bool FListViewItem::isExpand() const
 { return is_expand; }
@@ -163,6 +177,10 @@ inline bool FListViewItem::isExpand() const
 inline bool FListViewItem::isExpandable() const
 { return expandable; }
 
+//----------------------------------------------------------------------
+inline bool FListViewItem::isCheckable() const
+{ return checkable; }
+
 
 //----------------------------------------------------------------------
 // class FListViewIterator
@@ -352,21 +370,24 @@ class FListView : public FWidget
                                         , std::size_t
                                         , std::size_t );
     virtual void         draw();
-    void                 drawColumnLabels();
+    void                 drawHeadlines();
     void                 drawList();
     void                 drawListLine (const FListViewItem*, bool, bool);
     void                 setLineAttributes (bool, bool);
+    FString              getCheckBox (const FListViewItem* item);
     FString              getLinePrefix (const FListViewItem*, std::size_t);
     void                 drawSortIndicator (std::size_t&, std::size_t);
-    void                 drawColumnText (headerItems::const_iterator&);
+    void                 drawHeadlineLabel (headerItems::const_iterator&);
     void                 drawHeaderBorder (std::size_t);
     void                 drawColumnEllipsis ( headerItems::const_iterator&
                                             , const FString& );
     void                 updateDrawing (bool, bool);
-    int                  determineLineWidth (FListViewItem* item);
+    int                  determineLineWidth (FListViewItem*);
+    void                 beforeInsertion (FListViewItem*);
+    void                 afterInsertion();
     void                 recalculateHorizontalBar (int);
     void                 recalculateVerticalBar (int);
-    void                 mouseColumnClicked();
+    void                 mouseHeaderClicked();
     void                 wheelUp (int);
     void                 wheelDown (int);
     bool                 dragScrollUp (int);
@@ -377,6 +398,7 @@ class FListView : public FWidget
     FObjectIterator      appendItem (FListViewItem*);
     void                 processClick();
     void                 processChanged();
+    void                 keySpace();
     void                 keyLeft (int&);
     void                 keyRight (int&);
     void                 keyHome();
@@ -393,6 +415,7 @@ class FListView : public FWidget
     void                 scrollTo (const FPoint &);
     void                 scrollTo (int, int);
     void                 scrollBy (int, int);
+    bool                 hasCheckableItems() const;
 
     // Callback methods
     void                 cb_VBarChange (FWidget*, data_ptr);
@@ -415,8 +438,10 @@ class FListView : public FWidget
     bool                 scroll_timer;
     bool                 tree_view;
     bool                 hide_sort_indicator;
+    bool                 has_checkable_items;
     FPoint               clicked_expander_pos;
-    FPoint               clicked_column_pos;
+    FPoint               clicked_header_pos;
+    const FListViewItem* clicked_checkbox_item;
     int                  xoffset;
     int                  nf_offset;
     int                  max_line_width;
@@ -537,6 +562,10 @@ inline FObject::FObjectIterator FListView::endOfList()
 inline void FListView::scrollTo (const FPoint& pos)
 { scrollTo(pos.getX(), pos.getY()); }
 
+//----------------------------------------------------------------------
+inline bool FListView::hasCheckableItems() const
+{ return has_checkable_items; }
+
 }  // namespace finalcut
 
 #endif  // FLISTVIEW_H
diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h
index 2be00ec5..cb40ff40 100644
--- a/src/include/final/fobject.h
+++ b/src/include/final/fobject.h
@@ -35,7 +35,9 @@
   #error "Only  can be included directly."
 #endif
 
-#if __cplusplus < 199711L
+#if !defined (__cplusplus)
+  #error "You need a C++ compiler like g++ or clang++"
+#elif __cplusplus > 1 && __cplusplus < 199711L
   #error "Your C++ compiler does not support the C++98 standard!"
 #endif
 

From 2cb08ce928bfe342913a9dad19b5e786999b11c0 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sun, 18 Nov 2018 22:48:55 +0100
Subject: [PATCH 29/33] checkable FListViewItem now shows the input cursor

---
 src/flistview.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/flistview.cpp b/src/flistview.cpp
index 103999dd..e2f2ce42 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -1663,13 +1663,19 @@ void FListView::drawList()
   {
     bool is_current_line = bool( iter == current_iter );
     const FListViewItem* item = static_cast(*iter);
+    int tree_offset = ( tree_view ) ? int(item->getDepth() << 1) + 1 : 0;
+    int checkbox_offset = ( item->isCheckable() ) ? 1 : 0;
     setPrintPos (2, 2 + int(y));
 
     // Draw one FListViewItem
     drawListLine (item, flags.focus, is_current_line);
 
     if ( flags.focus && is_current_line )
-      setCursorPos (3, 2 + int(y));  // first character
+    {
+      setVisibleCursor (item->isCheckable());
+      setCursorPos ( 3 + tree_offset + checkbox_offset - xoffset
+                   , 2 + int(y));  // first character
+    }
 
     last_visible_line = iter;
     y++;
@@ -1679,6 +1685,9 @@ void FListView::drawList()
   // Reset color
   setColor();
 
+  if ( isMonochron() )
+    setReverse(true);
+
   // Clean empty space after last element
   while ( y < uInt(getClientHeight()) )
   {

From 801147161dcdd74008055f090ac70704d3d1dcbe Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Sun, 18 Nov 2018 22:50:45 +0100
Subject: [PATCH 30/33] FAQ update

---
 ChangeLog           |  1 +
 doc/faq.md          | 43 ++++++++++++++++++++++++++++++++++++++++---
 doc/first-steps.md  |  4 ++--
 doc/framebuffer.txt |  4 ++--
 4 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4ea2195c..e9c90a61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2018-11-18  Markus Gans  
 	* The FListViewItem class now provides checkable list view items
 	* Adding the checklist example to demonstrate the checkable FListViewItems
+	* A checkable FListViewItem now shows the input cursor
 
 2018-11-12  Markus Gans  
 	* Clicking on the column header in FListView now changes the sort order
diff --git a/doc/faq.md b/doc/faq.md
index b288744a..3dc80443 100644
--- a/doc/faq.md
+++ b/doc/faq.md
@@ -6,9 +6,46 @@ Frequently Asked Questions
 What is FINAL CUT?
 ------------------
 
-The Final Cut is a C++ class library and a widget toolkit with full mouse 
-support for creating a text-based user interface. It's based on the Termcap
-library and has its own cursor optimization and window management.
+The Final Cut is a [C++](https://en.wikipedia.org/wiki/C%2B%2B) class library 
+and a widget toolkit with full mouse support for creating a text-based user 
+interface. It's based on the Termcap library and has its own cursor 
+optimization and window management.
+
+
+Why did you develop FINAL CUT?
+------------------------------
+
+Most Unix [TUIs](https://en.wikipedia.org/wiki/Text-based_user_interface) 
+are difficult to use or limited in their functionality. I developed 
+FINAL CUT to fix these problems. The main goals in FINAL CUT design were 
+to create a library that is easy to use, powerful, visually appealing and 
+easily expandable.
+
+
+Where does the name FINAL CUT come from?
+----------------------------------------
+From 1991 to 1996 I developed with 
+[Borland Pascal](https://en.wikipedia.org/wiki/Turbo_Pascal) 
+under [DOS](https://en.wikipedia.org/wiki/DOS) a text-based file manager 
+called “The Final Cut”, with the intention to be more visually appealing 
+than all other products. The calculator example is, among other things an 
+extract from this program.
+
+As I got to learn 
+[object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming) (OOP) 
+with [C++](https://en.wikipedia.org/wiki/C%2B%2B) at the end of 
+the 90s, I noticed significant design weaknesses in my program code. 
+I decided to re-implement the code cleanly in C++. This time I wanted to 
+avoid old mistakes and do everything right and open source. In the meanwhile, 
+I switched from [DOS](https://en.wikipedia.org/wiki/DOS) to 
+[Linux](https://en.wikipedia.org/wiki/Linux), so I started the implementing 
+of the first widgets (FDialog, FButton, FLineEdit, FScrollbar) and the 
+string class FString for the 
+[Linux console](https://en.wikipedia.org/wiki/Linux_console). 
+Unfortunately, the project lost my attention in 2000.
+
+In 2012, I needed an attractive terminal presentation for a textual data 
+structure. So I have started to develop FINAL CUT to a widget library.
 
 
 Are Windows and DOS supported by FINAL CUT?
diff --git a/doc/first-steps.md b/doc/first-steps.md
index b84fcfaa..111bca53 100644
--- a/doc/first-steps.md
+++ b/doc/first-steps.md
@@ -26,8 +26,8 @@ int main (int argc, char* argv[])
   return app.exec();
 }
 ```
-*(Note: Use mouse or Shift+F10 or
-Ctrl+^ to close the dialog)*
+*(Note: You can close the dialog with the mouse, 
+Shift+F10 or Ctrl+^.)*
 
 
 After entering the source code in *dialog.cpp* you can compile
diff --git a/doc/framebuffer.txt b/doc/framebuffer.txt
index b2095e9f..4e11667a 100644
--- a/doc/framebuffer.txt
+++ b/doc/framebuffer.txt
@@ -3,7 +3,7 @@ Framebuffer
 
 The Final Cut determines the used number of bits per pixel (bpp) 
 for Linux framebuffer console to determine whether 16 (or more) 
-different background colors can be displayed. Therefor your user
+different background colors can be displayed. Therefore your user
 needs read-access to the framebuffer device (/dev/fb0 or /dev/fb/0).
 You can check this with the following command:
 
@@ -14,7 +14,7 @@ the group "video". To do this, please enter the following command:
 
 > sudo usermod -a -G video USERNAME
 
-You can check the group membership with the id command:
+You can check the group members with the id command:
 
 > id
 

From 167b7c97bc60623b46385d958373f47cc58aa7ec Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Tue, 20 Nov 2018 21:11:04 +0100
Subject: [PATCH 31/33] install fix with final/ftermdata.h

---
 examples/calculator.cpp            | 15 ++++++++-------
 examples/checklist.cpp             |  9 ++++++---
 examples/choice.cpp                |  1 +
 examples/listbox.cpp               |  2 +-
 examples/mouse.cpp                 |  9 +++++----
 examples/opti-move.cpp             |  2 +-
 examples/scrollview.cpp            |  3 ++-
 examples/string-operations.cpp     |  3 ++-
 examples/term-attributes.cpp       |  8 +++++---
 examples/timer.cpp                 |  2 +-
 src/Makefile.am                    |  1 +
 src/Makefile.clang                 |  1 +
 src/Makefile.gcc                   |  1 +
 src/fbutton.cpp                    |  6 +++---
 src/fcheckbox.cpp                  |  2 +-
 src/fcheckmenuitem.cpp             |  2 +-
 src/fdialog.cpp                    |  8 ++++----
 src/ffiledialog.cpp                |  2 +-
 src/fkeyboard.cpp                  | 11 +++++------
 src/flineedit.cpp                  |  9 +++++----
 src/flistbox.cpp                   |  4 ++--
 src/flistview.cpp                  |  2 +-
 src/fmenubar.cpp                   |  2 +-
 src/fmouse.cpp                     |  8 ++++----
 src/foptiattr.cpp                  |  2 +-
 src/fprogressbar.cpp               | 10 ++++++----
 src/fradiobutton.cpp               |  2 +-
 src/fscrollbar.cpp                 | 10 +++++++---
 src/fscrollview.cpp                | 10 +++++-----
 src/ftermcap.cpp                   | 11 +++++++----
 src/ftermios.cpp                   |  2 ++
 src/ftogglebutton.cpp              | 12 +++++++-----
 src/fvterm.cpp                     | 12 ++++++------
 src/fwindow.cpp                    |  8 ++++----
 src/include/final/fbutton.h        |  2 +-
 src/include/final/fdialog.h        |  2 +-
 src/include/final/ftermdebugdata.h | 17 +++++++++++++++++
 src/include/final/ftooltip.h       |  2 +-
 src/include/final/fwidget.h        |  1 +
 39 files changed, 130 insertions(+), 86 deletions(-)

diff --git a/examples/calculator.cpp b/examples/calculator.cpp
index 7668cc49..7e5253bc 100644
--- a/examples/calculator.cpp
+++ b/examples/calculator.cpp
@@ -381,9 +381,9 @@ void Calc::drawDispay()
   }
   else
   {
-    wchar_t vertical_and_right = wchar_t(finalcut::fc::BoxDrawingsVerticalAndRight);
-    wchar_t horizontal         = wchar_t(finalcut::fc::BoxDrawingsHorizontal);
-    wchar_t vertical_and_left  = wchar_t(finalcut::fc::BoxDrawingsVerticalAndLeft);
+    wchar_t vertical_and_right  = wchar_t(finalcut::fc::BoxDrawingsVerticalAndRight);
+    wchar_t horizontal          = wchar_t(finalcut::fc::BoxDrawingsHorizontal);
+    wchar_t vertical_and_left   = wchar_t(finalcut::fc::BoxDrawingsVerticalAndLeft);
     finalcut::FString separator = finalcut::FString(vertical_and_right)
                                 + finalcut::FString(35, horizontal)
                                 + finalcut::FString(vertical_and_left);
@@ -416,7 +416,6 @@ void Calc::zero (lDouble&)
     input += '0';
   else
     input = '0';
-
 }
 
 //----------------------------------------------------------------------
@@ -550,8 +549,8 @@ void Calc::subtract (lDouble&)
 //----------------------------------------------------------------------
 void Calc::multiply (lDouble&)
 {
- if ( ! isOperatorKey(last_key) )
-   calcInfixOperator();
+  if ( ! isOperatorKey(last_key) )
+    calcInfixOperator();
 
   setDisplay(a);
   setInfixOperator('*');
@@ -734,7 +733,7 @@ void Calc::arcus (lDouble& x)
 //----------------------------------------------------------------------
 void Calc::sine (lDouble& x)
 {
- if ( hyperbolic_mode )
+  if ( hyperbolic_mode )
   {
     if ( arcus_mode )
     {
@@ -830,6 +829,7 @@ void Calc::tangent (lDouble& x)
     if ( arcus_mode )
       x = std::atan(x) * 180.0L / PI;
     else
+    {
       // Test if (x / 180) != 0 and x / 90 == 0
       if ( std::fabs(std::fmod(x, 180.0L)) > LDBL_EPSILON
         && std::fabs(std::fmod(x, 90.0L)) < LDBL_EPSILON )
@@ -838,6 +838,7 @@ void Calc::tangent (lDouble& x)
         x = 0.0L;
       else
         x = std::tan(x * PI / 180.0L);
+    }
   }
 
   if ( errno == EDOM )
diff --git a/examples/checklist.cpp b/examples/checklist.cpp
index 45bd96e9..b2581cc6 100644
--- a/examples/checklist.cpp
+++ b/examples/checklist.cpp
@@ -131,7 +131,8 @@ void CheckList::populate()
   {
     const finalcut::FStringList line (&list[i][0], &list[i][0] + 2);
     finalcut::FObject::FObjectIterator iter = listView.insert (line);
-    finalcut::FListViewItem* item = static_cast(*iter);
+    finalcut::FListViewItem* item = \
+        static_cast(*iter);
     item->setCheckable(true);
   }
 }
@@ -167,10 +168,12 @@ void CheckList::cb_showList (finalcut::FWidget*, data_ptr)
 
   while ( iter != listView.endOfList() )
   {
-    const finalcut::FListViewItem* item = static_cast(*iter);
+    const finalcut::FListViewItem* item = \
+        static_cast(*iter);
 
     if ( item->isChecked() )
-      shopping_list << wchar_t(finalcut::fc::Bullet) << ' ' << item->getText(1) << '\n';
+      shopping_list << wchar_t(finalcut::fc::Bullet) << ' '
+                    << item->getText(1) << '\n';
 
     ++iter;
   }
diff --git a/examples/choice.cpp b/examples/choice.cpp
index 53c08f7a..738ead13 100644
--- a/examples/choice.cpp
+++ b/examples/choice.cpp
@@ -20,6 +20,7 @@
 * .                                      *
 ***********************************************************************/
 
+#include 
 #include 
 
 
diff --git a/examples/listbox.cpp b/examples/listbox.cpp
index 4daaf2be..5543ecda 100644
--- a/examples/listbox.cpp
+++ b/examples/listbox.cpp
@@ -35,7 +35,7 @@ static finalcut::FString* temp_str = 0;
 // Function prototypes
 void doubleToItem ( finalcut::FListBoxItem&
                   , finalcut::FWidget::data_ptr container
-                  , int index) ;
+                  , int index);
 finalcut::FString& doubleToString (std::list::const_iterator iter);
 finalcut::FString& mapToString ( std::map::const_iterator iter );
diff --git a/examples/mouse.cpp b/examples/mouse.cpp
index 1892f333..e2f19958 100644
--- a/examples/mouse.cpp
+++ b/examples/mouse.cpp
@@ -372,7 +372,7 @@ MouseDraw::MouseDraw (finalcut::FWidget* parent)
 
   brush.setPos (1, 12);
 
-  finalcut::FPoint no_shadow(0,0);
+  finalcut::FPoint no_shadow(0, 0);
   finalcut::FRect scroll_geometry(0, 0, 1, 1);
   createArea (scroll_geometry, no_shadow, canvas);
 }
@@ -382,12 +382,13 @@ MouseDraw::~MouseDraw()
 { }
 
 //----------------------------------------------------------------------
-void MouseDraw::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust)
+void MouseDraw::setGeometry ( int x, int y
+                            , std::size_t w, std::size_t h
+                            , bool adjust )
 {
   int old_w, old_h;
   finalcut::FDialog::setGeometry (x, y, w, h, adjust);
-
-  finalcut::FPoint no_shadow(0,0);
+  finalcut::FPoint no_shadow(0, 0);
   finalcut::FRect scroll_geometry (0, 0, w - 11, h - 3);
   old_w = canvas->width;
   old_h = canvas->height;
diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp
index 208c317c..4e083225 100644
--- a/examples/opti-move.cpp
+++ b/examples/opti-move.cpp
@@ -157,7 +157,7 @@ int main (int argc, char* argv[])
   finalcut::FString line(std::size_t(xmax) + 1, '-');
 
   // Place the cursor in the upper left corner
-  TermApp.setTermXY(0,0);
+  TermApp.setTermXY(0, 0);
   // Reset all terminal attributes
   TermApp.setNormal();
   // Clear the screen
diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp
index 505f7a08..34cdefa3 100644
--- a/examples/scrollview.cpp
+++ b/examples/scrollview.cpp
@@ -84,7 +84,8 @@ Scrollview::Scrollview (finalcut::FWidget* parent)
   // Sets the navigation button geometry
   go_east.setGeometry (1, 1, 5, 1);
   go_south.setGeometry (int(getScrollWidth()) - 5, 1, 5, 1);
-  go_west.setGeometry (int(getScrollWidth()) - 5, int(getScrollHeight()) - 2, 5, 1);
+  go_west.setGeometry ( int(getScrollWidth()) - 5
+                      , int(getScrollHeight()) - 2, 5, 1);
   go_north.setGeometry (1, int(getScrollHeight()) - 2, 5, 1);
 
   // Add scroll function callbacks to the buttons
diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp
index 6708b460..5c4812ec 100644
--- a/examples/string-operations.cpp
+++ b/examples/string-operations.cpp
@@ -512,7 +512,8 @@ void convertToNumberExample()
 
   try
   {
-    const double double_num = finalcut::FString("2.7182818284590452353").toDouble();
+    const double double_num = \
+        finalcut::FString("2.7182818284590452353").toDouble();
     std::ios_base::fmtflags save_flags = std::cout.flags();
     std::cout << "  toDouble:  " << std::setprecision(11)
                                  << double_num << std::endl;
diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp
index a66ceca2..92a14cae 100644
--- a/examples/term-attributes.cpp
+++ b/examples/term-attributes.cpp
@@ -169,8 +169,10 @@ void AttribDlg::adjustSize()
     y = 1;
 
   setGeometry(x, y, 69, 21, false);
-  next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1, false);
-  back_button.setGeometry(int(getWidth()) - 25, int(getHeight()) - 4, 10, 1, false);
+  next_button.setGeometry ( int(getWidth()) - 13, int(getHeight()) - 4
+                          , 10, 1, false );
+  back_button.setGeometry ( int(getWidth()) - 25, int(getHeight()) - 4
+                          , 10, 1, false );
   finalcut::FDialog::adjustSize();
 }
 
@@ -258,7 +260,7 @@ void AttribDemo::printAltCharset()
   if ( ! isMonochron() )
     setColor (wc.label_fg, wc.label_bg);
 
-  setPrintPos (1,1);
+  setPrintPos (1, 1);
   print("alternate charset: ");
 
   if ( parent->bgcolor == finalcut::fc::Default )
diff --git a/examples/timer.cpp b/examples/timer.cpp
index 8c3f5250..47c7610c 100644
--- a/examples/timer.cpp
+++ b/examples/timer.cpp
@@ -59,7 +59,7 @@ Timer::Timer (finalcut::FWidget* parent)
 //----------------------------------------------------------------------
 void Timer::draw()
 {
-  setPrintPos (1,1);
+  setPrintPos (1, 1);
   print() << "---------------\n"
           << "Press Q to quit\n"
           << "---------------\n";
diff --git a/src/Makefile.am b/src/Makefile.am
index cce0959f..e1a89737 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -119,6 +119,7 @@ finalcutinclude_HEADERS = \
 	include/final/ftermdetection.h \
 	include/final/ftermios.h \
 	include/final/fterm.h \
+	include/final/ftermdata.h \
 	include/final/fvterm.h \
 	include/final/ftextview.h \
 	include/final/ftogglebutton.h \
diff --git a/src/Makefile.clang b/src/Makefile.clang
index bf25e0e2..e150ef3b 100644
--- a/src/Makefile.clang
+++ b/src/Makefile.clang
@@ -45,6 +45,7 @@ INCLUDE_HEADERS = \
 	fkeyboard.h \
 	ftermcap.h \
 	fterm.h \
+	ftermdata.h \
 	ftermios.h \
 	ftermdetection.h \
 	ftermcapquirks.h \
diff --git a/src/Makefile.gcc b/src/Makefile.gcc
index d0f3de3c..ac12f727 100644
--- a/src/Makefile.gcc
+++ b/src/Makefile.gcc
@@ -45,6 +45,7 @@ INCLUDE_HEADERS = \
 	fkeyboard.h \
 	ftermcap.h \
 	fterm.h \
+	ftermdata.h \
 	ftermios.h \
 	ftermdetection.h \
 	ftermcapquirks.h \
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index 6f85e795..adf3692c 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -217,12 +217,12 @@ bool FButton::setShadow (bool on)
     && getEncoding() != fc::ASCII )
   {
     flags.shadow = true;
-    setShadowSize(1,1);
+    setShadowSize(1, 1);
   }
   else
   {
     flags.shadow = false;
-    setShadowSize(0,0);
+    setShadowSize(0, 0);
   }
 
   return flags.shadow;
@@ -665,7 +665,7 @@ inline void FButton::drawButtonTextLine (wchar_t button_text[])
                  , 1 + int(vcenter_offset) );  // hotkey
 
   if ( ! flags.active && isMonochron() )
-   setReverse(true);  // Light background
+    setReverse(true);  // Light background
 
   if ( active_focus && (isMonochron() || getMaxColor() < 16) )
     setBold();
diff --git a/src/fcheckbox.cpp b/src/fcheckbox.cpp
index 2361391d..270a6667 100644
--- a/src/fcheckbox.cpp
+++ b/src/fcheckbox.cpp
@@ -72,7 +72,7 @@ void FCheckBox::drawCheckButton()
   if ( ! isVisible() )
     return;
 
-  setPrintPos (1,1);
+  setPrintPos (1, 1);
   setColor();
 
   if ( isMonochron() )
diff --git a/src/fcheckmenuitem.cpp b/src/fcheckmenuitem.cpp
index d508bb21..a0fd2bb4 100644
--- a/src/fcheckmenuitem.cpp
+++ b/src/fcheckmenuitem.cpp
@@ -75,7 +75,7 @@ void FCheckMenuItem::processToggle()
 //----------------------------------------------------------------------
 void FCheckMenuItem::processClicked()
 {
-  checked = not checked;
+  checked = ! checked;
   processToggle();
   emitCallback("clicked");
 }
diff --git a/src/fdialog.cpp b/src/fdialog.cpp
index bd6c4a77..672c2928 100644
--- a/src/fdialog.cpp
+++ b/src/fdialog.cpp
@@ -528,7 +528,7 @@ void FDialog::onMouseDown (FMouseEvent* ev)
       && ms.mouse_y == 1 )
       titlebar_click_pos.setPoint (ev->getTermX(), ev->getTermY());
     else
-      titlebar_click_pos.setPoint (0,0);
+      titlebar_click_pos.setPoint (0, 0);
 
     // Click on titlebar menu button
     if ( ms.mouse_x < 4 && ms.mouse_y == 1 )
@@ -1578,7 +1578,7 @@ void FDialog::resizeMouseDown (mouseStates& ms)
       drawBorder();
   }
   else
-    resize_click_pos.setPoint (0,0);
+    resize_click_pos.setPoint (0, 0);
 }
 
 //----------------------------------------------------------------------
@@ -1622,7 +1622,7 @@ void FDialog::resizeMouseUpMove (mouseStates& ms, bool mouse_up)
     if ( mouse_up )
     {
       // Reset the border color
-      resize_click_pos.setPoint (0,0);
+      resize_click_pos.setPoint (0, 0);
 
       // redraw() is required to draw the standard (black) border
       // and client objects with ignorePadding() option.
@@ -1639,7 +1639,7 @@ void FDialog::cancelMouseResize()
   if ( resize_click_pos.isNull() )
     return;
 
-  resize_click_pos.setPoint (0,0);
+  resize_click_pos.setPoint (0, 0);
   drawBorder();
   updateTerminal();
 }
diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp
index 02094097..54551339 100644
--- a/src/ffiledialog.cpp
+++ b/src/ffiledialog.cpp
@@ -912,7 +912,7 @@ void FFileDialog::cb_processOpen (FWidget*, data_ptr)
 //----------------------------------------------------------------------
 void FFileDialog::cb_processShowHidden (FWidget*, data_ptr)
 {
-  setShowHiddenFiles(not show_hidden);
+  setShowHiddenFiles(! show_hidden);
 }
 
 }  // namespace finalcut
diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp
index 4cf6008a..b42a08dd 100644
--- a/src/fkeyboard.cpp
+++ b/src/fkeyboard.cpp
@@ -234,10 +234,9 @@ inline int FKeyboard::getTermcapKey()
   if ( ! key_map )
     return -1;
 
-  fc::fkeymap* keymap = reinterpret_cast(key_map);
-  for (int i = 0; keymap[i].tname[0] != 0; i++)
+  for (int i = 0; key_map[i].tname[0] != 0; i++)
   {
-    char* k = keymap[i].string;
+    char* k = key_map[i].string;
     std::size_t len = ( k ) ? std::strlen(k) : 0;
 
     if ( k && std::strncmp(k, fifo_buf, len) == 0 )  // found
@@ -486,17 +485,17 @@ int FKeyboard::parseKeyString()
   {
     int keycode = getMouseProtocolKey();
 
-    if ( keycode > 0 )
+    if ( keycode != -1 )
       return keycode;
 
     keycode = getTermcapKey();
 
-    if ( keycode > 0 )
+    if ( keycode != -1 )
       return keycode;
 
     keycode = getMetaKey();
 
-    if ( keycode > 0 )
+    if ( keycode != -1 )
       return keycode;
 
     if ( ! isKeypressTimeout() )
diff --git a/src/flineedit.cpp b/src/flineedit.cpp
index 059186f5..f6193d8b 100644
--- a/src/flineedit.cpp
+++ b/src/flineedit.cpp
@@ -240,12 +240,12 @@ bool FLineEdit::setShadow (bool on)
     && getEncoding() != fc::ASCII )
   {
     flags.shadow = true;
-    setShadowSize(1,1);
+    setShadowSize(1, 1);
   }
   else
   {
     flags.shadow = false;
-    setShadowSize(0,0);
+    setShadowSize(0, 0);
   }
 
   return flags.shadow;
@@ -645,7 +645,8 @@ void FLineEdit::adjustLabel()
       break;
 
     case label_left:
-      label->setGeometry(getX() - int(label_length) - 1, getY(), label_length, 1);
+      label->setGeometry(getX() - int(label_length) - 1, getY()
+                        , label_length, 1);
       break;
   }
 }
@@ -853,7 +854,7 @@ inline void FLineEdit::keyBackspace()
 //----------------------------------------------------------------------
 inline void FLineEdit::keyInsert()
 {
-  insert_mode = not insert_mode;
+  insert_mode = ! insert_mode;
 
   if ( insert_mode )
     setInsertCursor();
diff --git a/src/flistbox.cpp b/src/flistbox.cpp
index b9f238a2..8b59e0b1 100644
--- a/src/flistbox.cpp
+++ b/src/flistbox.cpp
@@ -1564,7 +1564,7 @@ void FListBox::nextListItem (int distance)
 //----------------------------------------------------------------------
 void FListBox::scrollToX (int val)
 {
-  static const std::size_t padding_space = 2;  // 1 leading space + 1 trailing space
+  static const std::size_t padding_space = 2;  // 1 leading + 1 trailing space
   std::size_t xoffset_end = max_line_width - getClientWidth() + padding_space;
 
   if ( xoffset == val )
@@ -1621,7 +1621,7 @@ void FListBox::scrollLeft (int distance)
 //----------------------------------------------------------------------
 void FListBox::scrollRight (int distance)
 {
-  static const std::size_t padding_space = 2;  // 1 leading space + 1 trailing space
+  static const std::size_t padding_space = 2;  // 1 leading + 1 trailing space
   std::size_t xoffset_end = max_line_width - getClientWidth() + padding_space;
   xoffset += distance;
 
diff --git a/src/flistview.cpp b/src/flistview.cpp
index e2f2ce42..8b979149 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -2492,7 +2492,7 @@ void FListView::stepForward (int distance)
 void FListView::stepBackward (int distance)
 {
   if ( current_iter.getPosition() == 0 )
-   return;
+    return;
 
   if ( current_iter.getPosition() - distance >= 0 )
   {
diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp
index 16323b4a..1aa4540f 100644
--- a/src/fmenubar.cpp
+++ b/src/fmenubar.cpp
@@ -519,7 +519,7 @@ void FMenuBar::drawItems()
   if ( item_list.empty() )
     return;
 
-  setPrintPos (1,1);
+  setPrintPos (1, 1);
 
   if ( isMonochron() )
     setReverse(true);
diff --git a/src/fmouse.cpp b/src/fmouse.cpp
index efece03e..e2ef488c 100644
--- a/src/fmouse.cpp
+++ b/src/fmouse.cpp
@@ -47,8 +47,8 @@ FMouse::FMouse()
   , max_width(80)
   , max_height(25)
   , time_mousepressed()
-  , zero_point(0,0)            // zero point (x=0, y=0)
-  , mouse(0,0)                 // mouse click position
+  , zero_point(0, 0)           // zero point (x=0, y=0)
+  , mouse(0, 0)                // mouse click position
   , new_mouse_position()
 {
   time_mousepressed.tv_sec = 0;
@@ -1200,7 +1200,7 @@ void FMouseUrxvt::setButtonState (int btn, struct timeval* time)
 FMouseControl::FMouseControl()
   : mouse_protocol()
   , iter()
-  , zero_point(0,0)
+  , zero_point(0, 0)
   , use_gpm_mouse(false)
   , use_xterm_mouse(false)
 {
@@ -1575,7 +1575,7 @@ bool FMouseControl::getGpmKeyPressed (bool)
 
   if ( gpm_mouse )
     return gpm_mouse->getGpmKeyPressed(pending);
-#endif // F_HAVE_LIBGPM
+#endif  // F_HAVE_LIBGPM
 
   return false;
 }
diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp
index afcb5da1..12516e62 100644
--- a/src/foptiattr.cpp
+++ b/src/foptiattr.cpp
@@ -794,7 +794,7 @@ inline bool FOptiAttr::unsetTermBlink (charData*& term)
   if ( F_exit_blink_mode.caused_reset )
     reset(term);
   else
-   term->attr.bit.blink = false;
+    term->attr.bit.blink = false;
 
   if ( append_sequence(F_exit_blink_mode.cap) )
     return true;
diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp
index 5f343833..b68d14a0 100644
--- a/src/fprogressbar.cpp
+++ b/src/fprogressbar.cpp
@@ -68,7 +68,9 @@ void FProgressbar::setPercentage (std::size_t percentage_value)
 }
 
 //----------------------------------------------------------------------
-void FProgressbar::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust)
+void FProgressbar::setGeometry ( int x, int y
+                               , std::size_t w, std::size_t h
+                               , bool adjust )
 {
   // Set the progress bar geometry
 
@@ -84,12 +86,12 @@ bool FProgressbar::setShadow (bool on)
     && getEncoding() != fc::ASCII )
   {
     flags.shadow = true;
-    setShadowSize(1,1);
+    setShadowSize(1, 1);
   }
   else
   {
     flags.shadow = false;
-    setShadowSize(0,0);
+    setShadowSize(0, 0);
   }
 
   return on;
@@ -193,7 +195,7 @@ void FProgressbar::drawBar()
 {
   std::size_t i = 0;
   double length;
-  setPrintPos (1,1);
+  setPrintPos (1, 1);
   setColor ( wc.progressbar_bg
            , wc.progressbar_fg );
 
diff --git a/src/fradiobutton.cpp b/src/fradiobutton.cpp
index 0e1e4421..cde97b36 100644
--- a/src/fradiobutton.cpp
+++ b/src/fradiobutton.cpp
@@ -73,7 +73,7 @@ void FRadioButton::drawRadioButton()
   if ( ! isVisible() )
     return;
 
-  setPrintPos (1,1);
+  setPrintPos (1, 1);
   setColor();
 
   if ( isMonochron() )
diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp
index 21d4324f..e8c24d40 100644
--- a/src/fscrollbar.cpp
+++ b/src/fscrollbar.cpp
@@ -174,7 +174,9 @@ void FScrollbar::setOrientation (int o)
 }
 
 //----------------------------------------------------------------------
-void FScrollbar::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust)
+void FScrollbar::setGeometry ( int x, int y
+                             , std::size_t w, std::size_t h
+                             , bool adjust )
 {
   // Set the scrollbar geometry
 
@@ -419,10 +421,12 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
     if ( bar_orientation == fc::vertical )
       slider_click_stop_pos = mouse_y - 2;
     else
+    {
       if ( isNewFont() )
         slider_click_stop_pos = mouse_x - 3;
       else
         slider_click_stop_pos = mouse_x - 2;
+    }
   }
   else
     slider_click_stop_pos = -1;
@@ -605,7 +609,7 @@ void FScrollbar::drawButtons()
 
   if ( isNewFont() )
   {
-    setPrintPos (1,1);
+    setPrintPos (1, 1);
 
     if ( bar_orientation == fc::vertical )
     {
@@ -626,7 +630,7 @@ void FScrollbar::drawButtons()
   }
   else
   {
-    setPrintPos (1,1);
+    setPrintPos (1, 1);
 
     if ( isMonochron() )
       setReverse(true);
diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp
index 3ace1b1a..befa79cb 100644
--- a/src/fscrollview.cpp
+++ b/src/fscrollview.cpp
@@ -72,7 +72,7 @@ void FScrollView::setScrollWidth (std::size_t width)
 
   if ( viewport )
   {
-    FPoint no_shadow(0,0);
+    FPoint no_shadow(0, 0);
     scroll_geometry.setWidth (width);
     resizeArea (scroll_geometry, no_shadow, viewport);
 
@@ -100,7 +100,7 @@ void FScrollView::setScrollHeight (std::size_t height)
 
   if ( viewport )
   {
-    FPoint no_shadow(0,0);
+    FPoint no_shadow(0, 0);
     scroll_geometry.setHeight (height);
     resizeArea (scroll_geometry, no_shadow, viewport);
     addPreprocessingHandler
@@ -133,7 +133,7 @@ void FScrollView::setScrollSize (std::size_t width, std::size_t height)
 
   if ( viewport )
   {
-    FPoint no_shadow(0,0);
+    FPoint no_shadow(0, 0);
     scroll_geometry.setSize (width, height);
     resizeArea (scroll_geometry, no_shadow, viewport);
     addPreprocessingHandler
@@ -548,7 +548,7 @@ void FScrollView::onChildFocusIn (FFocusEvent*)
 
   widget_geometry = focus_widget->getGeometryWithShadow();
   vp_geometry = viewport_geometry;
-  vp_geometry.move(1,1);
+  vp_geometry.move(1, 1);
 
   if ( ! vp_geometry.contains(widget_geometry) )
   {
@@ -749,7 +749,7 @@ void FScrollView::init (FWidget* parent)
   setBottomPadding (1 - (yoffset_end - getScrollY()));
   setRightPadding (1 - (xoffset_end - getScrollX()) + nf_offset);
 
-  FPoint no_shadow(0,0);
+  FPoint no_shadow(0, 0);
   std::size_t w = getViewportWidth();
   std::size_t h = getViewportHeight();
 
diff --git a/src/ftermcap.cpp b/src/ftermcap.cpp
index 728222b3..f9a875ce 100644
--- a/src/ftermcap.cpp
+++ b/src/ftermcap.cpp
@@ -20,6 +20,9 @@
 * .                                      *
 ***********************************************************************/
 
+#include 
+#include 
+
 #include "final/ftermcap.h"
 
 namespace finalcut
@@ -336,10 +339,10 @@ void FTermcap::termcapKeysVt100 (char*& buffer)
 //----------------------------------------------------------------------
 FTermcap::tcap_map FTermcap::tcap[] =
 {
- // .------------- term string
- // |    .-------- Tcap-code
- // |    |      // variable name          -> description
- //-----------------------------------------------------------------------------
+//  .------------- term string
+//  |    .-------- Tcap-code
+//  |    |      // variable name          -> description
+//------------------------------------------------------------------------------
   { 0, "bl" },  // bell                   -> audible signal (bell) (P)
   { 0, "ec" },  // erase_chars            -> erase #1 characters (P)
   { 0, "cl" },  // clear_screen           -> clear screen and home cursor (P*)
diff --git a/src/ftermios.cpp b/src/ftermios.cpp
index ff0ca2ac..06dd6d5b 100644
--- a/src/ftermios.cpp
+++ b/src/ftermios.cpp
@@ -20,6 +20,8 @@
 * .                                      *
 ***********************************************************************/
 
+#include 
+
 #include "final/ftermios.h"
 #include "final/fterm.h"
 
diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp
index d812245d..e2064be0 100644
--- a/src/ftogglebutton.cpp
+++ b/src/ftogglebutton.cpp
@@ -88,7 +88,9 @@ FToggleButton::~FToggleButton()  // destructor
 
 // public methods of FToggleButton
 //----------------------------------------------------------------------
-void FToggleButton::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust)
+void FToggleButton::setGeometry ( int x, int y
+                                , std::size_t w, std::size_t h
+                                , bool adjust )
 {
   // Set the toggle button geometry
 
@@ -286,7 +288,7 @@ void FToggleButton::onMouseUp (FMouseEvent* ev)
   }
   else
   {
-    checked = not checked;
+    checked = ! checked;
     processToggle();
   }
 
@@ -332,7 +334,7 @@ void FToggleButton::onAccel (FAccelEvent* ev)
   }
   else
   {
-    checked = not checked;
+    checked = ! checked;
     processToggle();
   }
 
@@ -550,7 +552,7 @@ void FToggleButton::onKeyPress (FKeyEvent* ev)
       }
       else
       {
-        checked = not checked;
+        checked = ! checked;
         processToggle();
       }
       processClick();
@@ -674,7 +676,7 @@ void FToggleButton::drawText ( wchar_t LabelText[]
   }
 
   if ( isMonochron() )
-    setReverse(false);;
+    setReverse(false);
 }
 
 }  // namespace finalcut
diff --git a/src/fvterm.cpp b/src/fvterm.cpp
index f7938e9b..bfa74ed4 100644
--- a/src/fvterm.cpp
+++ b/src/fvterm.cpp
@@ -98,7 +98,7 @@ FPoint FVTerm::getPrintCursor()
     return FPoint ( win->offset_left + win->cursor_x
                   , win->offset_top + win->cursor_y );
 
-  return FPoint(0,0);
+  return FPoint(0, 0);
 }
 
 //----------------------------------------------------------------------
@@ -184,7 +184,7 @@ void FVTerm::clearArea (int fillchar)
 void FVTerm::createVTerm (const FRect& r)
 {
   // initialize virtual terminal
-  const FPoint shadow(0,0);
+  const FPoint shadow(0, 0);
   createArea (r, shadow, vterm);
 }
 
@@ -198,7 +198,7 @@ void FVTerm::createVTerm (int width, int height)
 //----------------------------------------------------------------------
 void FVTerm::resizeVTerm (const FRect& r)
 {
-  const FPoint shadow(0,0);
+  const FPoint shadow(0, 0);
   resizeArea (r, shadow, vterm);
 }
 
@@ -2014,7 +2014,7 @@ void FVTerm::init (bool disable_alt_screen)
   createVTerm (term_geometry);
 
   // Create virtual desktop area
-  FPoint shadow_size(0,0);
+  FPoint shadow_size(0, 0);
   createArea (term_geometry, shadow_size, vdesktop);
   vdesktop->visible = true;
   active_area = vdesktop;
@@ -2191,7 +2191,7 @@ bool FVTerm::clearTerm (int fillchar)
   if ( cl )  // Clear screen
   {
     appendOutputBuffer (cl);
-    term_pos->setPoint(0,0);
+    term_pos->setPoint(0, 0);
   }
   else if ( cd )  // Clear to end of screen
   {
@@ -2209,7 +2209,7 @@ bool FVTerm::clearTerm (int fillchar)
       appendOutputBuffer (cb);
     }
 
-    setTermXY (0,0);
+    setTermXY (0, 0);
   }
 
   flush_out();
diff --git a/src/fwindow.cpp b/src/fwindow.cpp
index 679cd8c2..274be106 100644
--- a/src/fwindow.cpp
+++ b/src/fwindow.cpp
@@ -184,9 +184,9 @@ bool FWindow::setTransparentShadow (bool on)
   flags.shadow = flags.trans_shadow = on;
 
   if ( on )
-    setShadowSize (2,1);
+    setShadowSize (2, 1);
   else
-    setShadowSize (0,0);
+    setShadowSize (0, 0);
 
   return on;
 }
@@ -201,13 +201,13 @@ bool FWindow::setShadow (bool on)
   {
     flags.shadow = true;
     flags.trans_shadow = false;
-    setShadowSize (1,1);
+    setShadowSize (1, 1);
   }
   else
   {
     flags.shadow = false;
     flags.trans_shadow = false;
-    setShadowSize (0,0);
+    setShadowSize (0, 0);
   }
 
   return on;
diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h
index ccdd7546..1f3c619a 100644
--- a/src/include/final/fbutton.h
+++ b/src/include/final/fbutton.h
@@ -69,7 +69,7 @@ class FButton : public FWidget
   public:
     // Constructors
     explicit FButton (FWidget* = 0);
-    FButton (const FString&, FWidget* = 0);
+    explicit FButton (const FString&, FWidget* = 0);
 
     // Destructor
     virtual ~FButton();
diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h
index c1540a77..5371434b 100644
--- a/src/include/final/fdialog.h
+++ b/src/include/final/fdialog.h
@@ -88,7 +88,7 @@ class FDialog : public FWindow
 
     // Constructors
     explicit FDialog (FWidget* = 0);
-    FDialog (const FString&, FWidget* = 0);
+    explicit FDialog (const FString&, FWidget* = 0);
 
     // Destructor
     virtual ~FDialog();
diff --git a/src/include/final/ftermdebugdata.h b/src/include/final/ftermdebugdata.h
index 439e2ed6..87f796b3 100644
--- a/src/include/final/ftermdebugdata.h
+++ b/src/include/final/ftermdebugdata.h
@@ -46,6 +46,12 @@ namespace finalcut
 class FTermDebugData
 {
   public:
+    // Constructors
+    FTermDebugData();
+
+    // Destructor
+    ~FTermDebugData();
+
     // Accessors
     const FString& getAnswerbackString();
     const FString& getSecDAString();
@@ -64,6 +70,17 @@ class FTermDebugData
     FTermData*      data;
 };
 
+// FTermDebugData inline functions
+//----------------------------------------------------------------------
+inline FTermDebugData::FTermDebugData()
+  : term_detection(0)
+  , data(0)
+{ }
+
+//----------------------------------------------------------------------
+inline FTermDebugData::~FTermDebugData()
+{ }
+
 //----------------------------------------------------------------------
 inline void FTermDebugData::setFTermDetection (FTermDetection* obj)
 { term_detection = obj; }
diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h
index 37c2f567..d5c65bb5 100644
--- a/src/include/final/ftooltip.h
+++ b/src/include/final/ftooltip.h
@@ -76,7 +76,7 @@ class FToolTip : public FWindow
   public:
     // Constructor
     explicit FToolTip (FWidget* = 0);
-    FToolTip (const FString&, FWidget* = 0);
+    explicit FToolTip (const FString&, FWidget* = 0);
 
     // Destructor
     virtual ~FToolTip ();
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index b76a5a59..1bdd9522 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -95,6 +95,7 @@
   #error "Only  can be included directly."
 #endif
 
+#include 
 #include 
 
 #include "final/fvterm.h"

From 1f64843fb615fb1a1137b7e16d31b0467db7a486 Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Wed, 21 Nov 2018 20:07:08 +0100
Subject: [PATCH 32/33] New type FKey for key inputs

---
 ChangeLog                          |   3 +
 examples/calculator.cpp            |   6 +-
 examples/keyboard.cpp              |   2 +-
 src/fapplication.cpp               |   6 +-
 src/fbutton.cpp                    |  12 +-
 src/fbuttongroup.cpp               |   8 +-
 src/fevent.cpp                     |   6 +-
 src/ffiledialog.cpp                |   2 +-
 src/fkeyboard.cpp                  |  56 +-
 src/flabel.cpp                     |   6 +-
 src/flineedit.cpp                  |   4 +-
 src/flistbox.cpp                   |   8 +-
 src/flistview.cpp                  |   4 +-
 src/fmenu.cpp                      |  13 +-
 src/fmenubar.cpp                   |   6 +-
 src/fmenuitem.cpp                  |  14 +-
 src/fstatusbar.cpp                 |   2 +-
 src/fterm.cpp                      |   2 +-
 src/ftermlinux.cpp                 |  16 +-
 src/ftogglebutton.cpp              |  16 +-
 src/fwidget.cpp                    |   2 +-
 src/include/final/fc.h             | 807 +++++++++++++++--------------
 src/include/final/fevent.h         |   6 +-
 src/include/final/fkeyboard.h      |  24 +-
 src/include/final/flineedit.h      |   2 +-
 src/include/final/flistbox.h       |   2 +-
 src/include/final/fmenu.h          |   2 +-
 src/include/final/fmenuitem.h      |  12 +-
 src/include/final/fstatusbar.h     |  12 +-
 src/include/final/fterm.h          |   2 +-
 src/include/final/ftermdebugdata.h |   7 +
 src/include/final/ftermlinux.h     |  16 +-
 src/include/final/ftypes.h         |   7 +-
 src/include/final/fvterm.h         |   4 +-
 src/include/final/fwidget.h        |   8 +-
 test/fkeyboard-test.cpp            |  10 +-
 36 files changed, 562 insertions(+), 553 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e9c90a61..3ad6c82f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-11-21  Markus Gans  
+	* New type FKey for key inputs
+
 2018-11-18  Markus Gans  
 	* The FListViewItem class now provides checkable list view items
 	* Adding the checklist example to demonstrate the checkable FListViewItems
diff --git a/examples/calculator.cpp b/examples/calculator.cpp
index 7e5253bc..78623724 100644
--- a/examples/calculator.cpp
+++ b/examples/calculator.cpp
@@ -90,7 +90,7 @@ void Button::setChecked (bool on)
 //----------------------------------------------------------------------
 void Button::onKeyPress (finalcut::FKeyEvent* ev)
 {
-  int key = ev->key();
+  FKey key = ev->key();
 
   // catch the enter key
   if ( key == finalcut::fc::Fkey_return
@@ -1007,8 +1007,8 @@ void Calc::calcInfixOperator()
 //----------------------------------------------------------------------
 void Calc::onKeyPress (finalcut::FKeyEvent* ev)
 {
-  int len = int(input.getLength());
-  int key = ev->key();
+  std::size_t len = input.getLength();
+  FKey key = ev->key();
 
   switch ( key )
   {
diff --git a/examples/keyboard.cpp b/examples/keyboard.cpp
index ba55db63..8d3141d0 100644
--- a/examples/keyboard.cpp
+++ b/examples/keyboard.cpp
@@ -53,7 +53,7 @@ Keyboard::Keyboard (finalcut::FWidget* parent)
 //----------------------------------------------------------------------
 void Keyboard::onKeyPress (finalcut::FKeyEvent* ev)
 {
-  int key_id = ev->key();
+  FKey key_id = ev->key();
   bool is_last_line = false;
 
   if ( getPrintPos().getY() == int(getDesktopHeight()) )
diff --git a/src/fapplication.cpp b/src/fapplication.cpp
index 9dd5cacb..b3280310 100644
--- a/src/fapplication.cpp
+++ b/src/fapplication.cpp
@@ -685,9 +685,9 @@ bool FApplication::processDialogSwitchAccelerator()
   if ( keyboard->getKey() >= fc::Fmkey_1
     && keyboard->getKey() <= fc::Fmkey_9 )
   {
-    int key = keyboard->getKey();
-    uLong n = uLong(key - fc::Fmkey_0);
-    uLong s = dialog_list->size();
+    FKey key = keyboard->getKey();
+    std::size_t n = key - fc::Fmkey_0;
+    std::size_t s = dialog_list->size();
 
     if ( s > 0 && s >= n )
     {
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index adf3692c..dc11b50c 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -292,12 +292,10 @@ void FButton::hide()
 //----------------------------------------------------------------------
 void FButton::onKeyPress (FKeyEvent* ev)
 {
-  int key;
-
   if ( ! isEnabled() )
     return;
 
-  key = ev->key();
+  FKey key = ev->key();
 
   switch ( key )
   {
@@ -480,16 +478,16 @@ uChar FButton::getHotkey()
 //----------------------------------------------------------------------
 void FButton::setHotkeyAccelerator()
 {
-  int hotkey = getHotkey();
+  uChar hotkey = getHotkey();
 
   if ( hotkey )
   {
     if ( std::isalpha(hotkey) || std::isdigit(hotkey) )
     {
-      addAccelerator (std::tolower(hotkey));
-      addAccelerator (std::toupper(hotkey));
+      addAccelerator (FKey(std::tolower(hotkey)));
+      addAccelerator (FKey(std::toupper(hotkey)));
       // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + std::tolower(hotkey));
+      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(hotkey)));
     }
     else
       addAccelerator (getHotkey());
diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp
index 47184fb1..256e5ce2 100644
--- a/src/fbuttongroup.cpp
+++ b/src/fbuttongroup.cpp
@@ -454,16 +454,16 @@ uChar FButtonGroup::getHotkey()
 //----------------------------------------------------------------------
 void FButtonGroup::setHotkeyAccelerator()
 {
-  int hotkey = getHotkey();
+  uChar hotkey = getHotkey();
 
   if ( hotkey )
   {
     if ( std::isalpha(hotkey) || std::isdigit(hotkey) )
     {
-      addAccelerator (std::tolower(hotkey));
-      addAccelerator (std::toupper(hotkey));
+      addAccelerator (FKey(std::tolower(hotkey)));
+      addAccelerator (FKey(std::toupper(hotkey)));
       // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + std::tolower(hotkey));
+      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(hotkey)));
     }
     else
       addAccelerator (getHotkey());
diff --git a/src/fevent.cpp b/src/fevent.cpp
index c9c58f80..9699fb3e 100644
--- a/src/fevent.cpp
+++ b/src/fevent.cpp
@@ -3,7 +3,7 @@
 *                                                                      *
 * This file is part of the Final Cut widget toolkit                    *
 *                                                                      *
-* Copyright 2014-2017 Markus Gans                                      *
+* Copyright 2014-2018 Markus Gans                                      *
 *                                                                      *
 * The Final Cut is free software; you can redistribute it and/or       *
 * modify it under the terms of the GNU Lesser General Public License   *
@@ -48,7 +48,7 @@ int FEvent::type() const
 // class FKeyEvent
 //----------------------------------------------------------------------
 
-FKeyEvent::FKeyEvent (int ev_type, int key_num)  // constructor
+FKeyEvent::FKeyEvent (int ev_type, FKey key_num)  // constructor
   : FEvent(ev_type)
   , k(key_num)
   , accpt(false)
@@ -59,7 +59,7 @@ FKeyEvent::~FKeyEvent()  // destructor
 { }
 
 //----------------------------------------------------------------------
-int FKeyEvent::key() const
+FKey FKeyEvent::key() const
 { return k; }
 
 //----------------------------------------------------------------------
diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp
index 54551339..69fabf46 100644
--- a/src/ffiledialog.cpp
+++ b/src/ffiledialog.cpp
@@ -231,7 +231,7 @@ void FFileDialog::onKeyPress (FKeyEvent* ev)
   if ( ! filebrowser.hasFocus() )
     return;
 
-  int key = ev->key();
+  FKey key = ev->key();
 
   switch ( key )
   {
diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp
index b42a08dd..7ef9c060 100644
--- a/src/fkeyboard.cpp
+++ b/src/fkeyboard.cpp
@@ -107,7 +107,7 @@ void FKeyboard::fetchKeyCode()
 }
 
 //----------------------------------------------------------------------
-const FString FKeyboard::getKeyName (int keynum)
+const FString FKeyboard::getKeyName (FKey keynum)
 {
   for (int i = 0; fc::FkeyName[i].string[0] != 0; i++)
     if ( fc::FkeyName[i].num && fc::FkeyName[i].num == keynum )
@@ -197,12 +197,12 @@ void FKeyboard::escapeKeyHandling()
 
 // private methods of FKeyboard
 //----------------------------------------------------------------------
-inline int FKeyboard::getMouseProtocolKey()
+inline FKey FKeyboard::getMouseProtocolKey()
 {
   // Looking for mouse string in the key buffer
 
   if ( ! mouse_support )
-    return -1;
+    return NOT_SET;
 
   std::size_t buf_len = std::strlen(fifo_buf);
 
@@ -221,18 +221,18 @@ inline int FKeyboard::getMouseProtocolKey()
     && fifo_buf[buf_len - 1] == 'M' )
     return fc::Fkey_urxvt_mouse;
 
-  return -1;
+  return NOT_SET;
 }
 
 //----------------------------------------------------------------------
-inline int FKeyboard::getTermcapKey()
+inline FKey FKeyboard::getTermcapKey()
 {
   // Looking for termcap key strings in the buffer
 
   assert ( FIFO_BUF_SIZE > 0 );
 
   if ( ! key_map )
-    return -1;
+    return NOT_SET;
 
   for (int i = 0; key_map[i].tname[0] != 0; i++)
   {
@@ -254,11 +254,11 @@ inline int FKeyboard::getTermcapKey()
     }
   }
 
-  return -1;
+  return NOT_SET;
 }
 
 //----------------------------------------------------------------------
-inline int FKeyboard::getMetaKey()
+inline FKey FKeyboard::getMetaKey()
 {
   // Looking for meta key strings in the buffer
 
@@ -278,7 +278,7 @@ inline int FKeyboard::getMetaKey()
                       || fifo_buf[1] == ']' ) )
       {
         if ( ! isKeypressTimeout() )
-          return NEED_MORE_DATA;
+          return fc::need_more_data;
       }
 
       for (n = len; n < FIFO_BUF_SIZE; n++)  // Remove founded entry
@@ -292,18 +292,18 @@ inline int FKeyboard::getMetaKey()
     }
   }
 
-  return -1;
+  return NOT_SET;
 }
 
 //----------------------------------------------------------------------
-inline int FKeyboard::getSingleKey()
+inline FKey FKeyboard::getSingleKey()
 {
   // Looking for single key code in the buffer
 
   uChar firstchar = uChar(fifo_buf[0]);
   std::size_t n;
   std::size_t len = 1;
-  int keycode;
+  FKey keycode;
 
   // Look for a utf-8 character
   if ( utf8_input && (firstchar & 0xc0) == 0xc0 )
@@ -336,7 +336,7 @@ inline int FKeyboard::getSingleKey()
   if ( keycode == 0 )  // Ctrl+Space or Ctrl+@
     keycode = fc::Fckey_space;
 
-  return int(keycode == 127 ? fc::Fkey_backspace : keycode);
+  return FKey(keycode == 127 ? fc::Fkey_backspace : keycode);
 }
 
 //----------------------------------------------------------------------
@@ -370,16 +370,16 @@ bool FKeyboard::isKeypressTimeout()
 }
 
 //----------------------------------------------------------------------
-int FKeyboard::UTF8decode (const char utf8[])
+FKey FKeyboard::UTF8decode (const char utf8[])
 {
-  int ucs = 0;
+  FKey ucs = 0;  // Universal coded character
   const int max = 4;
-  int len = int(std::strlen(utf8));
+  std::size_t len = std::strlen(utf8);
 
   if ( len > max )
     len = max;
 
-  for (int i = 0; i < len; ++i)
+  for (std::size_t i = 0; i < len; ++i)
   {
     uChar ch = uChar(utf8[i]);
 
@@ -411,7 +411,7 @@ int FKeyboard::UTF8decode (const char utf8[])
     else
     {
       // error
-      ucs = EOF;
+      ucs = NOT_SET;
     }
   }
 
@@ -450,12 +450,12 @@ void FKeyboard::parseKeyBuffer()
     // Read the rest from the fifo buffer
     while ( ! isKeypressTimeout()
          && fifo_offset > 0
-         && key != NEED_MORE_DATA )
+         && key != fc::need_more_data )
     {
       key = parseKeyString();
       key = keyCorrection(key);
 
-      if ( key != NEED_MORE_DATA )
+      if ( key != fc::need_more_data )
         keyPressed();
 
       fifo_offset = int(std::strlen(fifo_buf));
@@ -477,38 +477,38 @@ void FKeyboard::parseKeyBuffer()
 }
 
 //----------------------------------------------------------------------
-int FKeyboard::parseKeyString()
+FKey FKeyboard::parseKeyString()
 {
   uChar firstchar = uChar(fifo_buf[0]);
 
   if ( firstchar == ESC[0] )
   {
-    int keycode = getMouseProtocolKey();
+    FKey keycode = getMouseProtocolKey();
 
-    if ( keycode != -1 )
+    if ( keycode != NOT_SET )
       return keycode;
 
     keycode = getTermcapKey();
 
-    if ( keycode != -1 )
+    if ( keycode != NOT_SET )
       return keycode;
 
     keycode = getMetaKey();
 
-    if ( keycode != -1 )
+    if ( keycode != NOT_SET )
       return keycode;
 
     if ( ! isKeypressTimeout() )
-      return NEED_MORE_DATA;
+      return fc::need_more_data;
   }
 
   return getSingleKey();
 }
 
 //----------------------------------------------------------------------
-int FKeyboard::keyCorrection (const int& keycode)
+FKey FKeyboard::keyCorrection (const FKey& keycode)
 {
-  int key_correction;
+  FKey key_correction;
 
 #if defined(__linux__)
   if ( linux )
diff --git a/src/flabel.cpp b/src/flabel.cpp
index fd809cdf..9d9cd8bd 100644
--- a/src/flabel.cpp
+++ b/src/flabel.cpp
@@ -440,10 +440,10 @@ void FLabel::setHotkeyAccelerator()
   {
     if ( std::isalpha(hotkey) || std::isdigit(hotkey) )
     {
-      addAccelerator (std::tolower(hotkey));
-      addAccelerator (std::toupper(hotkey));
+      addAccelerator (FKey(std::tolower(hotkey)));
+      addAccelerator (FKey(std::toupper(hotkey)));
       // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + std::tolower(hotkey));
+      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(hotkey)));
     }
     else
       addAccelerator (getHotkey());
diff --git a/src/flineedit.cpp b/src/flineedit.cpp
index f6193d8b..099eb565 100644
--- a/src/flineedit.cpp
+++ b/src/flineedit.cpp
@@ -330,7 +330,7 @@ void FLineEdit::clear()
 //----------------------------------------------------------------------
 void FLineEdit::onKeyPress (FKeyEvent* ev)
 {
-  int key = ev->key();
+  FKey key = ev->key();
 
   switch ( key )
   {
@@ -869,7 +869,7 @@ inline void FLineEdit::keyEnter()
 }
 
 //----------------------------------------------------------------------
-inline bool FLineEdit::keyInput (int key)
+inline bool FLineEdit::keyInput (FKey key)
 {
   if ( key >= 0x20 && key <= 0x10fff )
   {
diff --git a/src/flistbox.cpp b/src/flistbox.cpp
index 8b59e0b1..bbf0e497 100644
--- a/src/flistbox.cpp
+++ b/src/flistbox.cpp
@@ -402,9 +402,9 @@ void FListBox::clear()
 void FListBox::onKeyPress (FKeyEvent* ev)
 {
   std::size_t current_before = current;
-  int xoffset_before = xoffset
-    , yoffset_before = yoffset
-    , key = ev->key();
+  int xoffset_before = xoffset;
+  int yoffset_before = yoffset;
+  FKey key = ev->key();
 
   switch ( key )
   {
@@ -1825,7 +1825,7 @@ inline bool FListBox::keyBackspace()
 }
 
 //----------------------------------------------------------------------
-inline bool FListBox::keyIncSearchInput (int key)
+inline bool FListBox::keyIncSearchInput (FKey key)
 {
   if ( key <= 0x20 || key > 0x10fff )
     return false;
diff --git a/src/flistview.cpp b/src/flistview.cpp
index 8b979149..154b09f7 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -959,8 +959,8 @@ void FListView::onKeyPress (FKeyEvent* ev)
   int position_before = current_iter.getPosition()
     , xoffset_before = xoffset
     , first_line_position_before = first_visible_line.getPosition()
-    , pagesize = int(getClientHeight()) - 1
-    , key = ev->key();
+    , pagesize = int(getClientHeight()) - 1;
+  FKey key = ev->key();
   clicked_expander_pos.setPoint(-1, -1);
 
   switch ( key )
diff --git a/src/fmenu.cpp b/src/fmenu.cpp
index 149db2d2..1dae568d 100644
--- a/src/fmenu.cpp
+++ b/src/fmenu.cpp
@@ -491,7 +491,7 @@ void FMenu::calculateDimensions()
   while ( iter != last )
   {
     std::size_t item_width = (*iter)->getTextLength() + 2;
-    int         accel_key  = (*iter)->accel_key;
+    FKey        accel_key  = (*iter)->accel_key;
     bool        has_menu   = (*iter)->hasMenu();
 
     if ( has_menu )
@@ -1171,12 +1171,13 @@ bool FMenu::hotkeyMenu (FKeyEvent* ev)
     if ( (*iter)->hasHotkey() )
     {
       bool found = false;
-      int hotkey = (*iter)->getHotkey();
-      int key = ev->key();
+      uChar hotkey = (*iter)->getHotkey();
+      FKey key = ev->key();
 
       if ( std::isalpha(hotkey) || std::isdigit(hotkey) )
       {
-        if ( std::tolower(hotkey) == key || std::toupper(hotkey) == key )
+        if ( FKey(std::tolower(hotkey)) == key
+          || FKey(std::toupper(hotkey)) == key )
           found = true;
       }
       else if ( hotkey == key )
@@ -1316,7 +1317,7 @@ inline void FMenu::drawMenuLine (FMenuItem* menuitem, int y)
   menuText txtdata;
   std::size_t txt_length = txt.getLength();
   std::size_t to_char = txt_length;
-  int  accel_key   = menuitem->accel_key;
+  FKey accel_key   = menuitem->accel_key;
   bool is_enabled  = menuitem->isEnabled();
   bool is_selected = menuitem->isSelected();
 
@@ -1469,7 +1470,7 @@ inline void FMenu::drawSubMenuIndicator (std::size_t& startpos)
 }
 
 //----------------------------------------------------------------------
-inline void FMenu::drawAcceleratorKey (std::size_t& startpos, int accel_key)
+inline void FMenu::drawAcceleratorKey (std::size_t& startpos, FKey accel_key)
 {
   FString accel_name (getKeyName(accel_key));
   std::size_t c = ( has_checkable_items ) ? 1 : 0;
diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp
index 1aa4540f..e53b6074 100644
--- a/src/fmenubar.cpp
+++ b/src/fmenubar.cpp
@@ -426,10 +426,10 @@ bool FMenuBar::hotkeyMenu (FKeyEvent*& ev)
   {
     if ( (*iter)->isEnabled() )
     {
-      int hotkey = (*iter)->getHotkey();
-      int key = ev->key();
+      uChar hotkey = (*iter)->getHotkey();
+      FKey key = ev->key();
 
-      if ( fc::Fmkey_meta + std::tolower(hotkey) == key )
+      if ( fc::Fmkey_meta + FKey(std::tolower(hotkey)) == key )
       {
         FMenuItem* sel_item = getSelectedItem();
 
diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp
index c856196a..84f4d4db 100644
--- a/src/fmenuitem.cpp
+++ b/src/fmenuitem.cpp
@@ -77,7 +77,7 @@ FMenuItem::FMenuItem (const FString& txt, FWidget* parent)
 }
 
 //----------------------------------------------------------------------
-FMenuItem::FMenuItem (int k, const FString& txt, FWidget* parent)
+FMenuItem::FMenuItem (FKey k, const FString& txt, FWidget* parent)
   : FWidget(parent)
   , text(txt)
   , selected(false)
@@ -127,7 +127,8 @@ bool FMenuItem::setEnable (bool on)
     if ( super && isMenuBar(super) )
     {
       // Meta + hotkey
-      super->addAccelerator (fc::Fmkey_meta + std::tolower(hotkey), this);
+      super->addAccelerator ( fc::Fmkey_meta + FKey(std::tolower(hotkey))
+                            , this );
     }
   }
   else
@@ -231,8 +232,7 @@ void FMenuItem::setText (const FString& txt)
 }
 
 //----------------------------------------------------------------------
-
-void FMenuItem::addAccelerator (int key, FWidget* obj)
+void FMenuItem::addAccelerator (FKey key, FWidget* obj)
 {
   FWidget* root = getRootWidget();
   accelerator accel = { key, obj };
@@ -596,7 +596,7 @@ void FMenuItem::init (FWidget* parent)
 
   setSuperMenu (parent);
 
-  if ( accel_key  )
+  if ( accel_key )
     addAccelerator (accel_key);
 
   FMenuList* menu_list = getFMenuList(*parent);
@@ -610,7 +610,7 @@ void FMenuItem::init (FWidget* parent)
     menubar_ptr->calculateDimensions();
 
     if ( hotkey )  // Meta + hotkey
-      menubar_ptr->addAccelerator ( fc::Fmkey_meta + std::tolower(hotkey)
+      menubar_ptr->addAccelerator ( fc::Fmkey_meta + FKey(std::tolower(hotkey))
                                   , this );
 
     addCallback  // for this element
@@ -681,7 +681,7 @@ void FMenuItem::createDialogList (FMenu* winmenu)
       if ( win )
       {
         FMenuItem* win_item;
-        int n = int(std::distance(first, iter));
+        uInt32 n = uInt32(std::distance(first, iter));
         // get the dialog title
         const FString& name = win->getText();
 
diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp
index 9a982722..cafca7b7 100644
--- a/src/fstatusbar.cpp
+++ b/src/fstatusbar.cpp
@@ -45,7 +45,7 @@ FStatusKey::FStatusKey(FWidget* parent)
 }
 
 //----------------------------------------------------------------------
-FStatusKey::FStatusKey (int k, const FString& txt, FWidget* parent)
+FStatusKey::FStatusKey (FKey k, const FString& txt, FWidget* parent)
   : FWidget(parent)
   , key(k)
   , text(txt)
diff --git a/src/fterm.cpp b/src/fterm.cpp
index cc683e63..842957e3 100644
--- a/src/fterm.cpp
+++ b/src/fterm.cpp
@@ -108,7 +108,7 @@ std::size_t FTerm::getColumnNumber()
 }
 
 //----------------------------------------------------------------------
-const FString FTerm::getKeyName (int keynum)
+const FString FTerm::getKeyName (FKey keynum)
 {
   return keyboard->getKeyName (keynum);
 }
diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp
index bc9e5b9f..77470bc1 100644
--- a/src/ftermlinux.cpp
+++ b/src/ftermlinux.cpp
@@ -436,7 +436,7 @@ char* FTermLinux::restoreCursorStyle()
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::modifierKeyCorrection (const int& key_id)
+FKey FTermLinux::modifierKeyCorrection (const FKey& key_id)
 {
   // Get the current modifier key state
   modifier_key& m = getModifierKey();
@@ -910,7 +910,7 @@ bool FTermLinux::resetVGAPalette()
 #endif  // defined(__x86_64__) || defined(__i386) || defined(__arm__)
 
 //----------------------------------------------------------------------
-int FTermLinux::shiftKeyCorrection (const int& key_id)
+FKey FTermLinux::shiftKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
@@ -950,7 +950,7 @@ int FTermLinux::shiftKeyCorrection (const int& key_id)
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::ctrlKeyCorrection (const int& key_id)
+FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
@@ -990,7 +990,7 @@ int FTermLinux::ctrlKeyCorrection (const int& key_id)
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::altKeyCorrection (const int& key_id)
+FKey FTermLinux::altKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
@@ -1030,7 +1030,7 @@ int FTermLinux::altKeyCorrection (const int& key_id)
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::shiftCtrlKeyCorrection (const int& key_id)
+FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
@@ -1070,7 +1070,7 @@ int FTermLinux::shiftCtrlKeyCorrection (const int& key_id)
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::shiftAltKeyCorrection (const int& key_id)
+FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
@@ -1110,7 +1110,7 @@ int FTermLinux::shiftAltKeyCorrection (const int& key_id)
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::ctrlAltKeyCorrection (const int& key_id)
+FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
@@ -1150,7 +1150,7 @@ int FTermLinux::ctrlAltKeyCorrection (const int& key_id)
 }
 
 //----------------------------------------------------------------------
-int FTermLinux::shiftCtrlAltKeyCorrection (const int& key_id)
+FKey FTermLinux::shiftCtrlAltKeyCorrection (const FKey& key_id)
 {
   switch ( key_id )
   {
diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp
index e2064be0..16fe9d27 100644
--- a/src/ftogglebutton.cpp
+++ b/src/ftogglebutton.cpp
@@ -428,16 +428,16 @@ uChar FToggleButton::getHotkey()
 //----------------------------------------------------------------------
 void FToggleButton::setHotkeyAccelerator()
 {
-  int hotkey = getHotkey();
+  uChar hotkey = getHotkey();
 
   if ( hotkey )
   {
     if ( std::isalpha(hotkey) || std::isdigit(hotkey) )
     {
-      addAccelerator (std::tolower(hotkey));
-      addAccelerator (std::toupper(hotkey));
+      addAccelerator (FKey(std::tolower(hotkey)));
+      addAccelerator (FKey(std::toupper(hotkey)));
       // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + std::tolower(hotkey));
+      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(hotkey)));
     }
     else
       addAccelerator (getHotkey());
@@ -530,12 +530,10 @@ void FToggleButton::processToggle()
 //----------------------------------------------------------------------
 void FToggleButton::onKeyPress (FKeyEvent* ev)
 {
-  int key;
-
   if ( ! isEnabled() )
     return;
 
-  key = ev->key();
+  FKey key = ev->key();
 
   switch ( key )
   {
@@ -619,8 +617,8 @@ void FToggleButton::init()
 
 //----------------------------------------------------------------------
 std::size_t  FToggleButton::getHotkeyPos ( wchar_t src[]
-                                , wchar_t dest[]
-                                , std::size_t length )
+                                         , wchar_t dest[]
+                                         , std::size_t length )
 {
   // find hotkey position in string
   // + generate a new string without the '&'-sign
diff --git a/src/fwidget.cpp b/src/fwidget.cpp
index 6eef3887..0dffe645 100644
--- a/src/fwidget.cpp
+++ b/src/fwidget.cpp
@@ -970,7 +970,7 @@ void FWidget::emitCallback (const FString& emit_signal)
 }
 
 //----------------------------------------------------------------------
-void FWidget::addAccelerator (int key, FWidget* obj)
+void FWidget::addAccelerator (FKey key, FWidget* obj)
 {
   FWidget* widget = FWindow::getWindowWidget(obj);
   accelerator accel = { key, obj };
diff --git a/src/include/final/fc.h b/src/include/final/fc.h
index e34b9372..3821e003 100644
--- a/src/include/final/fc.h
+++ b/src/include/final/fc.h
@@ -239,414 +239,415 @@ enum SpecialCharacter
 // keyboard - single keys
 enum keys
 {
-  Fckey_a                    = 0x0000001,  // control-a
-  Fckey_b                    = 0x0000002,  // control-b
-  Fckey_c                    = 0x0000003,  // control-c
-  Fckey_d                    = 0x0000004,  // control-d
-  Fckey_e                    = 0x0000005,  // control-e
-  Fckey_f                    = 0x0000006,  // control-f
-  Fckey_g                    = 0x0000007,  // control-g
-  Fkey_erase                 = 0x0000008,  // control-h
-  Fkey_tab                   = 0x0000009,  // control-i
-  Fckey_j                    = 0x000000a,  // control-j
-  Fckey_h                    = 0x000000b,  // control-k
-  Fckey_l                    = 0x000000c,  // control-l
-  Fkey_return                = 0x000000d,  // control-m
-  Fckey_n                    = 0x000000e,  // control-n
-  Fckey_o                    = 0x000000f,  // control-o
-  Fckey_p                    = 0x0000010,  // control-p
-  Fckey_q                    = 0x0000011,  // control-q
-  Fckey_r                    = 0x0000012,  // control-r
-  Fckey_s                    = 0x0000013,  // control-s
-  Fckey_t                    = 0x0000014,  // control-t
-  Fckey_u                    = 0x0000015,  // control-u
-  Fckey_v                    = 0x0000016,  // control-v
-  Fckey_w                    = 0x0000017,  // control-w
-  Fckey_x                    = 0x0000018,  // control-x
-  Fckey_y                    = 0x0000019,  // control-y
-  Fckey_z                    = 0x000001a,  // control-t
-  Fkey_escape                = 0x000001b,  // control-[
-  Fckey_backslash            = 0x000001c,  // control-'\'
-  Fckey_right_square_bracket = 0x000001d,  // control-]
-  Fckey_caret                = 0x000001e,  // control-^
-  Fckey_underscore           = 0x000001f,  // control-_
-  Fkey_space                 = 0x0000020,  // space
-  Fkey_exclamation_mark      = 0x0000021,  // !
-  Fkey_quotation_mark        = 0x0000022,  // "
-  Fkey_number_sign           = 0x0000023,  // #
-  Fkey_dollar_sign           = 0x0000024,  // $
-  Fkey_percent_sign          = 0x0000025,  // %
-  Fkey_ampersand             = 0x0000026,  // &
-  Fkey_apostrophe            = 0x0000027,  // '
-  Fkey_left_parentheses      = 0x0000028,  // (
-  Fkey_right_parentheses     = 0x0000029,  // )
-  Fkey_asterisk              = 0x000002a,  // *
-  Fkey_plus_sign             = 0x000002b,  // +
-  Fkey_comma                 = 0x000002c,  // ,
-  Fkey_minus_sign            = 0x000002d,  // -
-  Fkey_full_stop             = 0x000002e,  // .
-  Fkey_slash                 = 0x000002f,  // /
-  Fckey_space                = 0x1000020,  // control-space
-  Fkey_backspace             = 0x1000100,
-  Fkey_catab                 = 0x1000101,
-  Fkey_clear                 = 0x1000102,
-  Fkey_ctab                  = 0x1000103,
-  Fkey_dc                    = 0x1000104,
-  Fkey_dl                    = 0x1000105,
-  Fkey_down                  = 0x1000106,
-  Fkey_eic                   = 0x1000107,
-  Fkey_eol                   = 0x1000108,
-  Fkey_eos                   = 0x1000109,
-  Fkey_f0                    = 0x100010a,
-  Fkey_f1                    = 0x100010b,
-  Fkey_f2                    = 0x100010c,
-  Fkey_f3                    = 0x100010d,
-  Fkey_f4                    = 0x100010e,
-  Fkey_f5                    = 0x100010f,
-  Fkey_f6                    = 0x1000110,
-  Fkey_f7                    = 0x1000111,
-  Fkey_f8                    = 0x1000112,
-  Fkey_f9                    = 0x1000113,
-  Fkey_f10                   = 0x1000114,
-  Fkey_home                  = 0x1000115,
-  Fkey_ic                    = 0x1000116,  // insert key
-  Fkey_il                    = 0x1000117,
-  Fkey_left                  = 0x1000118,
-  Fkey_ll                    = 0x1000119,
-  Fkey_npage                 = 0x100011a,
-  Fkey_ppage                 = 0x100011b,
-  Fkey_right                 = 0x100011c,
-  Fkey_sf                    = 0x100011d,
-  Fkey_sr                    = 0x100011e,
-  Fkey_stab                  = 0x100011f,
-  Fkey_up                    = 0x1000120,
-  Fkey_a1                    = 0x1000121,
-  Fkey_a3                    = 0x1000122,
-  Fkey_b2                    = 0x1000123,
-  Fkey_c1                    = 0x1000124,
-  Fkey_c3                    = 0x1000125,
-  Fkey_btab                  = 0x1000126,
-  Fkey_beg                   = 0x1000127,
-  Fkey_cancel                = 0x1000128,
-  Fkey_close                 = 0x1000129,
-  Fkey_command               = 0x100012a,
-  Fkey_copy                  = 0x100012b,
-  Fkey_create                = 0x100012c,
-  Fkey_end                   = 0x100012d,
-  Fkey_enter                 = 0x100012e,
-  Fkey_exit                  = 0x100012f,
-  Fkey_find                  = 0x1000130,
-  Fkey_help                  = 0x1000131,
-  Fkey_mark                  = 0x1000132,
-  Fkey_message               = 0x1000133,
-  Fkey_move                  = 0x1000134,
-  Fkey_next                  = 0x1000135,
-  Fkey_open                  = 0x1000136,
-  Fkey_options               = 0x1000137,
-  Fkey_previous              = 0x1000138,
-  Fkey_print                 = 0x1000139,
-  Fkey_redo                  = 0x100013a,
-  Fkey_reference             = 0x100013b,
-  Fkey_refresh               = 0x100013c,
-  Fkey_replace               = 0x100013d,
-  Fkey_restart               = 0x100013e,
-  Fkey_resume                = 0x100013f,
-  Fkey_save                  = 0x1000140,
-  Fkey_suspend               = 0x1000141,
-  Fkey_undo                  = 0x1000142,
-  Fkey_sbeg                  = 0x1000143,
-  Fkey_scancel               = 0x1000144,
-  Fkey_scommand              = 0x1000145,
-  Fkey_scopy                 = 0x1000146,
-  Fkey_screate               = 0x1000147,
-  Fkey_sdc                   = 0x1000148,
-  Fkey_sdl                   = 0x1000149,
-  Fkey_select                = 0x100014a,
-  Fkey_send                  = 0x100014b,
-  Fkey_seol                  = 0x100014c,
-  Fkey_sexit                 = 0x100014d,
-  Fkey_sfind                 = 0x100014e,
-  Fkey_shelp                 = 0x100014f,
-  Fkey_shome                 = 0x1000150,
-  Fkey_sic                   = 0x1000151,
-  Fkey_sleft                 = 0x1000152,
-  Fkey_smessage              = 0x1000153,
-  Fkey_smove                 = 0x1000154,
-  Fkey_snext                 = 0x1000155,
-  Fkey_soptions              = 0x1000156,
-  Fkey_sprevious             = 0x1000157,
-  Fkey_sprint                = 0x1000158,
-  Fkey_sredo                 = 0x1000159,
-  Fkey_sreplace              = 0x100015a,
-  Fkey_sright                = 0x100015b,
-  Fkey_srsume                = 0x100015c,
-  Fkey_ssave                 = 0x100015d,
-  Fkey_ssuspend              = 0x100015e,
-  Fkey_sundo                 = 0x100015f,
-  Fkey_f11                   = 0x1000160,
-  Fkey_f12                   = 0x1000161,
-  Fkey_f13                   = 0x1000162,
-  Fkey_f14                   = 0x1000163,
-  Fkey_f15                   = 0x1000164,
-  Fkey_f16                   = 0x1000165,
-  Fkey_f17                   = 0x1000166,
-  Fkey_f18                   = 0x1000167,
-  Fkey_f19                   = 0x1000168,
-  Fkey_f20                   = 0x1000169,
-  Fkey_f21                   = 0x100016a,
-  Fkey_f22                   = 0x100016b,
-  Fkey_f23                   = 0x100016c,
-  Fkey_f24                   = 0x100016d,
-  Fkey_f25                   = 0x100016e,
-  Fkey_f26                   = 0x100016f,
-  Fkey_f27                   = 0x1000170,
-  Fkey_f28                   = 0x1000171,
-  Fkey_f29                   = 0x1000172,
-  Fkey_f30                   = 0x1000173,
-  Fkey_f31                   = 0x1000174,
-  Fkey_f32                   = 0x1000175,
-  Fkey_f33                   = 0x1000176,
-  Fkey_f34                   = 0x1000177,
-  Fkey_f35                   = 0x1000178,
-  Fkey_f36                   = 0x1000179,
-  Fkey_f37                   = 0x100017a,
-  Fkey_f38                   = 0x100017b,
-  Fkey_f39                   = 0x100017c,
-  Fkey_f40                   = 0x100017d,
-  Fkey_f41                   = 0x100017e,
-  Fkey_f42                   = 0x100017f,
-  Fkey_f43                   = 0x1000180,
-  Fkey_f44                   = 0x1000181,
-  Fkey_f45                   = 0x1000182,
-  Fkey_f46                   = 0x1000183,
-  Fkey_f47                   = 0x1000184,
-  Fkey_f48                   = 0x1000185,
-  Fkey_f49                   = 0x1000186,
-  Fkey_f50                   = 0x1000187,
-  Fkey_f51                   = 0x1000188,
-  Fkey_f52                   = 0x1000189,
-  Fkey_f53                   = 0x100018a,
-  Fkey_f54                   = 0x100018b,
-  Fkey_f55                   = 0x100018c,
-  Fkey_f56                   = 0x100018d,
-  Fkey_f57                   = 0x100018e,
-  Fkey_f58                   = 0x100018f,
-  Fkey_f59                   = 0x1000190,
-  Fkey_f60                   = 0x1000191,
-  Fkey_f61                   = 0x1000192,
-  Fkey_f62                   = 0x1000193,
-  Fkey_f63                   = 0x1000194
+  Fckey_a                    = 0x00000001,  // control-a
+  Fckey_b                    = 0x00000002,  // control-b
+  Fckey_c                    = 0x00000003,  // control-c
+  Fckey_d                    = 0x00000004,  // control-d
+  Fckey_e                    = 0x00000005,  // control-e
+  Fckey_f                    = 0x00000006,  // control-f
+  Fckey_g                    = 0x00000007,  // control-g
+  Fkey_erase                 = 0x00000008,  // control-h
+  Fkey_tab                   = 0x00000009,  // control-i
+  Fckey_j                    = 0x0000000a,  // control-j
+  Fckey_h                    = 0x0000000b,  // control-k
+  Fckey_l                    = 0x0000000c,  // control-l
+  Fkey_return                = 0x0000000d,  // control-m
+  Fckey_n                    = 0x0000000e,  // control-n
+  Fckey_o                    = 0x0000000f,  // control-o
+  Fckey_p                    = 0x00000010,  // control-p
+  Fckey_q                    = 0x00000011,  // control-q
+  Fckey_r                    = 0x00000012,  // control-r
+  Fckey_s                    = 0x00000013,  // control-s
+  Fckey_t                    = 0x00000014,  // control-t
+  Fckey_u                    = 0x00000015,  // control-u
+  Fckey_v                    = 0x00000016,  // control-v
+  Fckey_w                    = 0x00000017,  // control-w
+  Fckey_x                    = 0x00000018,  // control-x
+  Fckey_y                    = 0x00000019,  // control-y
+  Fckey_z                    = 0x0000001a,  // control-t
+  Fkey_escape                = 0x0000001b,  // control-[
+  Fckey_backslash            = 0x0000001c,  // control-'\'
+  Fckey_right_square_bracket = 0x0000001d,  // control-]
+  Fckey_caret                = 0x0000001e,  // control-^
+  Fckey_underscore           = 0x0000001f,  // control-_
+  Fkey_space                 = 0x00000020,  // space
+  Fkey_exclamation_mark      = 0x00000021,  // !
+  Fkey_quotation_mark        = 0x00000022,  // "
+  Fkey_number_sign           = 0x00000023,  // #
+  Fkey_dollar_sign           = 0x00000024,  // $
+  Fkey_percent_sign          = 0x00000025,  // %
+  Fkey_ampersand             = 0x00000026,  // &
+  Fkey_apostrophe            = 0x00000027,  // '
+  Fkey_left_parentheses      = 0x00000028,  // (
+  Fkey_right_parentheses     = 0x00000029,  // )
+  Fkey_asterisk              = 0x0000002a,  // *
+  Fkey_plus_sign             = 0x0000002b,  // +
+  Fkey_comma                 = 0x0000002c,  // ,
+  Fkey_minus_sign            = 0x0000002d,  // -
+  Fkey_full_stop             = 0x0000002e,  // .
+  Fkey_slash                 = 0x0000002f,  // /
+  Fckey_space                = 0x01000020,  // control-space
+  Fkey_backspace             = 0x01000100,
+  Fkey_catab                 = 0x01000101,
+  Fkey_clear                 = 0x01000102,
+  Fkey_ctab                  = 0x01000103,
+  Fkey_dc                    = 0x01000104,
+  Fkey_dl                    = 0x01000105,
+  Fkey_down                  = 0x01000106,
+  Fkey_eic                   = 0x01000107,
+  Fkey_eol                   = 0x01000108,
+  Fkey_eos                   = 0x01000109,
+  Fkey_f0                    = 0x0100010a,
+  Fkey_f1                    = 0x0100010b,
+  Fkey_f2                    = 0x0100010c,
+  Fkey_f3                    = 0x0100010d,
+  Fkey_f4                    = 0x0100010e,
+  Fkey_f5                    = 0x0100010f,
+  Fkey_f6                    = 0x01000110,
+  Fkey_f7                    = 0x01000111,
+  Fkey_f8                    = 0x01000112,
+  Fkey_f9                    = 0x01000113,
+  Fkey_f10                   = 0x01000114,
+  Fkey_home                  = 0x01000115,
+  Fkey_ic                    = 0x01000116,  // insert key
+  Fkey_il                    = 0x01000117,
+  Fkey_left                  = 0x01000118,
+  Fkey_ll                    = 0x01000119,
+  Fkey_npage                 = 0x0100011a,
+  Fkey_ppage                 = 0x0100011b,
+  Fkey_right                 = 0x0100011c,
+  Fkey_sf                    = 0x0100011d,
+  Fkey_sr                    = 0x0100011e,
+  Fkey_stab                  = 0x0100011f,
+  Fkey_up                    = 0x01000120,
+  Fkey_a1                    = 0x01000121,
+  Fkey_a3                    = 0x01000122,
+  Fkey_b2                    = 0x01000123,
+  Fkey_c1                    = 0x01000124,
+  Fkey_c3                    = 0x01000125,
+  Fkey_btab                  = 0x01000126,
+  Fkey_beg                   = 0x01000127,
+  Fkey_cancel                = 0x01000128,
+  Fkey_close                 = 0x01000129,
+  Fkey_command               = 0x0100012a,
+  Fkey_copy                  = 0x0100012b,
+  Fkey_create                = 0x0100012c,
+  Fkey_end                   = 0x0100012d,
+  Fkey_enter                 = 0x0100012e,
+  Fkey_exit                  = 0x0100012f,
+  Fkey_find                  = 0x01000130,
+  Fkey_help                  = 0x01000131,
+  Fkey_mark                  = 0x01000132,
+  Fkey_message               = 0x01000133,
+  Fkey_move                  = 0x01000134,
+  Fkey_next                  = 0x01000135,
+  Fkey_open                  = 0x01000136,
+  Fkey_options               = 0x01000137,
+  Fkey_previous              = 0x01000138,
+  Fkey_print                 = 0x01000139,
+  Fkey_redo                  = 0x0100013a,
+  Fkey_reference             = 0x0100013b,
+  Fkey_refresh               = 0x0100013c,
+  Fkey_replace               = 0x0100013d,
+  Fkey_restart               = 0x0100013e,
+  Fkey_resume                = 0x0100013f,
+  Fkey_save                  = 0x01000140,
+  Fkey_suspend               = 0x01000141,
+  Fkey_undo                  = 0x01000142,
+  Fkey_sbeg                  = 0x01000143,
+  Fkey_scancel               = 0x01000144,
+  Fkey_scommand              = 0x01000145,
+  Fkey_scopy                 = 0x01000146,
+  Fkey_screate               = 0x01000147,
+  Fkey_sdc                   = 0x01000148,
+  Fkey_sdl                   = 0x01000149,
+  Fkey_select                = 0x0100014a,
+  Fkey_send                  = 0x0100014b,
+  Fkey_seol                  = 0x0100014c,
+  Fkey_sexit                 = 0x0100014d,
+  Fkey_sfind                 = 0x0100014e,
+  Fkey_shelp                 = 0x0100014f,
+  Fkey_shome                 = 0x01000150,
+  Fkey_sic                   = 0x01000151,
+  Fkey_sleft                 = 0x01000152,
+  Fkey_smessage              = 0x01000153,
+  Fkey_smove                 = 0x01000154,
+  Fkey_snext                 = 0x01000155,
+  Fkey_soptions              = 0x01000156,
+  Fkey_sprevious             = 0x01000157,
+  Fkey_sprint                = 0x01000158,
+  Fkey_sredo                 = 0x01000159,
+  Fkey_sreplace              = 0x0100015a,
+  Fkey_sright                = 0x0100015b,
+  Fkey_srsume                = 0x0100015c,
+  Fkey_ssave                 = 0x0100015d,
+  Fkey_ssuspend              = 0x0100015e,
+  Fkey_sundo                 = 0x0100015f,
+  Fkey_f11                   = 0x01000160,
+  Fkey_f12                   = 0x01000161,
+  Fkey_f13                   = 0x01000162,
+  Fkey_f14                   = 0x01000163,
+  Fkey_f15                   = 0x01000164,
+  Fkey_f16                   = 0x01000165,
+  Fkey_f17                   = 0x01000166,
+  Fkey_f18                   = 0x01000167,
+  Fkey_f19                   = 0x01000168,
+  Fkey_f20                   = 0x01000169,
+  Fkey_f21                   = 0x0100016a,
+  Fkey_f22                   = 0x0100016b,
+  Fkey_f23                   = 0x0100016c,
+  Fkey_f24                   = 0x0100016d,
+  Fkey_f25                   = 0x0100016e,
+  Fkey_f26                   = 0x0100016f,
+  Fkey_f27                   = 0x01000170,
+  Fkey_f28                   = 0x01000171,
+  Fkey_f29                   = 0x01000172,
+  Fkey_f30                   = 0x01000173,
+  Fkey_f31                   = 0x01000174,
+  Fkey_f32                   = 0x01000175,
+  Fkey_f33                   = 0x01000176,
+  Fkey_f34                   = 0x01000177,
+  Fkey_f35                   = 0x01000178,
+  Fkey_f36                   = 0x01000179,
+  Fkey_f37                   = 0x0100017a,
+  Fkey_f38                   = 0x0100017b,
+  Fkey_f39                   = 0x0100017c,
+  Fkey_f40                   = 0x0100017d,
+  Fkey_f41                   = 0x0100017e,
+  Fkey_f42                   = 0x0100017f,
+  Fkey_f43                   = 0x01000180,
+  Fkey_f44                   = 0x01000181,
+  Fkey_f45                   = 0x01000182,
+  Fkey_f46                   = 0x01000183,
+  Fkey_f47                   = 0x01000184,
+  Fkey_f48                   = 0x01000185,
+  Fkey_f49                   = 0x01000186,
+  Fkey_f50                   = 0x01000187,
+  Fkey_f51                   = 0x01000188,
+  Fkey_f52                   = 0x01000189,
+  Fkey_f53                   = 0x0100018a,
+  Fkey_f54                   = 0x0100018b,
+  Fkey_f55                   = 0x0100018c,
+  Fkey_f56                   = 0x0100018d,
+  Fkey_f57                   = 0x0100018e,
+  Fkey_f58                   = 0x0100018f,
+  Fkey_f59                   = 0x01000190,
+  Fkey_f60                   = 0x01000191,
+  Fkey_f61                   = 0x01000192,
+  Fkey_f62                   = 0x01000193,
+  Fkey_f63                   = 0x01000194,
+  need_more_data             = 0x80000000
 };
 
 // Keyboard - modifier key combinations
 enum metakeys
 {
-  Fmkey_ic                   = 0x1500100,  // M-insert
-  Fmkey_dc                   = 0x1500101,  // M-delete
-  Fmkey_home                 = 0x1500102,  // M-home
-  Fmkey_end                  = 0x1500103,  // M-end
-  Fmkey_ppage                = 0x1500104,  // M-prev-page
-  Fmkey_npage                = 0x1500105,  // M-next-page
-  Fmkey_f1                   = 0x1500106,  // M-f1
-  Fmkey_f2                   = 0x1500107,  // M-f2
-  Fmkey_f3                   = 0x1500108,  // M-f3
-  Fmkey_f4                   = 0x1500109,  // M-f4
-  Fmkey_f5                   = 0x150010a,  // M-f5
-  Fmkey_f6                   = 0x150010b,  // M-F6
-  Fmkey_f7                   = 0x150010c,  // M-f7
-  Fmkey_f8                   = 0x150010d,  // M-f8
-  Fmkey_f9                   = 0x150010e,  // M-f9
-  Fmkey_f10                  = 0x150010f,  // M-f10
-  Fmkey_f11                  = 0x1500110,  // M-f11
-  Fmkey_f12                  = 0x1500111,  // M-f12
-  Fmkey_up                   = 0x1500112,  // M-up
-  Fmkey_down                 = 0x1500113,  // M-down
-  Fmkey_right                = 0x1500114,  // M-right
-  Fmkey_left                 = 0x1500115,  // M-left
-  Fmkey_sic                  = 0x1500116,  // shifted M-Insert
-  Fmkey_sdc                  = 0x1500117,  // shifted M-Delete
-  Fmkey_shome                = 0x1500118,  // shifted M-Home
-  Fmkey_send                 = 0x1500119,  // shifted M-End
-  Fmkey_sppage               = 0x150011a,  // shifted M-Page_Up
-  Fmkey_snpage               = 0x150011b,  // shifted M-Page_Down
-  Fmkey_sf1                  = 0x150011c,  // shifted M-F1
-  Fmkey_sf2                  = 0x150011d,  // shifted M-F2
-  Fmkey_sf3                  = 0x150011e,  // shifted M-F3
-  Fmkey_sf4                  = 0x150011f,  // shifted M-F4
-  Fmkey_sf5                  = 0x1500120,  // shifted M-F5
-  Fmkey_sf6                  = 0x1500121,  // shifted M-F6
-  Fmkey_sf7                  = 0x1500122,  // shifted M-F7
-  Fmkey_sf8                  = 0x1500123,  // shifted M-F8
-  Fmkey_sf9                  = 0x1500124,  // shifted M-F9
-  Fmkey_sf10                 = 0x1500125,  // shifted M-F10
-  Fmkey_sf11                 = 0x1500126,  // shifted M-F11
-  Fmkey_sf12                 = 0x1500127,  // shifted M-F12
-  Fmkey_sup                  = 0x1500128,  // shifted M-Up
-  Fmkey_sdown                = 0x1500129,  // shifted M-Down
-  Fmkey_sright               = 0x150012a,  // shifted M-Right
-  Fmkey_sleft                = 0x150012b,  // shifted M-Left
-  Fckey_ic                   = 0x150012c,  // control-Insert
-  Fckey_dc                   = 0x150012d,  // control-Delete
-  Fckey_home                 = 0x150012e,  // control-Home
-  Fckey_end                  = 0x150012f,  // control-End
-  Fckey_ppage                = 0x1500130,  // control-Page_Up
-  Fckey_npage                = 0x1500131,  // control-Page_Down
-  Fckey_up                   = 0x1500132,  // control-Up
-  Fckey_down                 = 0x1500133,  // control-Down
-  Fckey_right                = 0x1500134,  // control-Right
-  Fckey_left                 = 0x1500135,  // control-Left
-  Fckey_sic                  = 0x1500136,  // shifted control-M-Insert
-  Fckey_sdc                  = 0x1500137,  // shifted control-M-Delete
-  Fckey_shome                = 0x1500138,  // shifted control-M-Home
-  Fckey_send                 = 0x1500139,  // shifted control-M-End
-  Fckey_sppage               = 0x150013a,  // shifted control-M-Page_Up
-  Fckey_snpage               = 0x150013b,  // shifted control-M-Page_Down
-  Fckey_sup                  = 0x150013c,  // shifted control-M-Up
-  Fckey_sdown                = 0x150013d,  // shifted control-M-Down
-  Fckey_sright               = 0x150013e,  // shifted control-M-Right
-  Fckey_sleft                = 0x150013f,  // shifted control-M-Left
-  Fcmkey_ic                  = 0x1500140,  // control-M-Insert
-  Fcmkey_dc                  = 0x1500141,  // control-M-Delete
-  Fcmkey_home                = 0x1500142,  // control-M-Home
-  Fcmkey_end                 = 0x1500143,  // control-M-End
-  Fcmkey_ppage               = 0x1500144,  // control-M-Page_Up
-  Fcmkey_npage               = 0x1500145,  // control-M-Page_Down
-  Fcmkey_up                  = 0x1500146,  // control-M-Up
-  Fcmkey_down                = 0x1500147,  // control-M-Down
-  Fcmkey_right               = 0x1500148,  // control-M-Right
-  Fcmkey_left                = 0x1500149,  // control-M-Left
-  Fcmkey_sic                 = 0x150014a,  // shifted control-M-Insert
-  Fcmkey_sdc                 = 0x150014b,  // shifted control-M-Delete
-  Fcmkey_shome               = 0x150014c,  // shifted control-M-Home
-  Fcmkey_send                = 0x150014d,  // shifted control-M-End
-  Fcmkey_sppage              = 0x150014e,  // shifted control-M-Page_Up
-  Fcmkey_snpage              = 0x150014f,  // shifted control-M-Page_Down
-  Fcmkey_sf1                 = 0x1500150,  // shifted control-M-F1
-  Fcmkey_sf2                 = 0x1500151,  // shifted control-M-F2
-  Fcmkey_sf3                 = 0x1500152,  // shifted control-M-F3
-  Fcmkey_sf4                 = 0x1500153,  // shifted control-M-F4
-  Fcmkey_sf5                 = 0x1500154,  // shifted control-M-F5
-  Fcmkey_sf6                 = 0x1500155,  // shifted control-M-F6
-  Fcmkey_sf7                 = 0x1500156,  // shifted control-M-F7
-  Fcmkey_sf8                 = 0x1500157,  // shifted control-M-F8
-  Fcmkey_sf9                 = 0x1500158,  // shifted control-M-F9
-  Fcmkey_sf10                = 0x1500159,  // shifted control-M-F10
-  Fcmkey_sf11                = 0x150015a,  // shifted control-M-F11
-  Fcmkey_sf12                = 0x150015b,  // shifted control-M-F12
-  Fcmkey_sup                 = 0x150015c,  // shifted control-M-Up
-  Fcmkey_sdown               = 0x150015d,  // shifted control-M-Down
-  Fcmkey_sright              = 0x150015e,  // shifted control-M-Right
-  Fcmkey_sleft               = 0x150015f,  // shifted control-M-Left
-  Fkey_menu                  = 0x1600000,  // menu
-  Fkey_smenu                 = 0x1600001,  // shifted menu
-  Fckey_menu                 = 0x1600002,  // control-menu
-  Fckey_smenu                = 0x1600003,  // shifted control-menu
-  Fmkey_menu                 = 0x1600004,  // M-menu
-  Fmkey_smenu                = 0x1600005,  // shifted M-menu
-  Fcmkey_menu                = 0x1600006,  // control-M-menu
-  Fcmkey_smenu               = 0x1600007,  // shifted control-M-menu
-  Fkey_escape_mintty         = 0x200001b,  // mintty Esc
-  Fkey_mouse                 = 0x2000020,  // xterm mouse
-  Fkey_extended_mouse        = 0x2000021,  // SGR extended mouse
-  Fkey_urxvt_mouse           = 0x2000022,  // urxvt mouse extension
-  Fmkey_meta                 = 0x20000e0,  // meta key offset
-  Fmkey_tab                  = 0x20000e9,  // M-tab
-  Fmkey_enter                = 0x20000ea,  // M-enter
-  Fmkey_space                = 0x2000100,  // M-' '
-  Fmkey_bang                 = 0x2000101,  // M-!
-  Fmkey_quotes               = 0x2000102,  // M-"
-  Fmkey_hash                 = 0x2000103,  // M-#
-  Fmkey_dollar               = 0x2000104,  // M-$
-  Fmkey_percent              = 0x2000105,  // M-%
-  Fmkey_ampersand            = 0x2000106,  // M-&
-  Fmkey_apostrophe           = 0x2000107,  // M-'
-  Fmkey_left_parenthesis     = 0x2000108,  // M-(
-  Fmkey_right_parenthesis    = 0x2000109,  // M-)
-  Fmkey_asterisk             = 0x200010a,  // M-*
-  Fmkey_plus                 = 0x200010b,  // M-+
-  Fmkey_comma                = 0x200010c,  // M-,
-  Fmkey_minus                = 0x200010d,  // M-'-'
-  Fmkey_full_stop            = 0x200010e,  // M-.
-  Fmkey_slash                = 0x200010f,  // M-/
-  Fmkey_0                    = 0x2000110,  // M-0
-  Fmkey_1                    = 0x2000111,  // M-1
-  Fmkey_2                    = 0x2000112,  // M-2
-  Fmkey_3                    = 0x2000113,  // M-3
-  Fmkey_4                    = 0x2000114,  // M-4
-  Fmkey_5                    = 0x2000115,  // M-5
-  Fmkey_6                    = 0x2000116,  // M-6
-  Fmkey_7                    = 0x2000117,  // M-7
-  Fmkey_8                    = 0x2000118,  // M-8
-  Fmkey_9                    = 0x2000119,  // M-9
-  Fmkey_colon                = 0x200011a,  // M-:
-  Fmkey_semicolon            = 0x200011b,  // M-;
-  Fmkey_less_than            = 0x200011c,  // M-<
-  Fmkey_equals               = 0x200011d,  // M-=
-  Fmkey_greater_than         = 0x200011e,  // M->
-  Fmkey_question_mark        = 0x200011f,  // M-?
-  Fmkey_at                   = 0x2000120,  // M-@
-  Fmkey_A                    = 0x2000121,  // M-A
-  Fmkey_B                    = 0x2000122,  // M-B
-  Fmkey_C                    = 0x2000123,  // M-C
-  Fmkey_D                    = 0x2000124,  // M-D
-  Fmkey_E                    = 0x2000125,  // M-E
-  Fmkey_F                    = 0x2000126,  // M-F
-  Fmkey_G                    = 0x2000127,  // M-G
-  Fmkey_H                    = 0x2000128,  // M-H
-  Fmkey_I                    = 0x2000129,  // M-I
-  Fmkey_J                    = 0x200012a,  // M-J
-  Fmkey_K                    = 0x200012b,  // M-K
-  Fmkey_L                    = 0x200012c,  // M-L
-  Fmkey_M                    = 0x200012d,  // M-M
-  Fmkey_N                    = 0x200012e,  // M-N
-  Fmkey_O                    = 0x200012f,  // M-O
-  Fmkey_P                    = 0x2000130,  // M-P
-  Fmkey_Q                    = 0x2000131,  // M-Q
-  Fmkey_R                    = 0x2000132,  // M-R
-  Fmkey_S                    = 0x2000133,  // M-S
-  Fmkey_T                    = 0x2000134,  // M-T
-  Fmkey_U                    = 0x2000135,  // M-U
-  Fmkey_V                    = 0x2000136,  // M-V
-  Fmkey_W                    = 0x2000137,  // M-W
-  Fmkey_X                    = 0x2000138,  // M-X
-  Fmkey_Y                    = 0x2000139,  // M-Y
-  Fmkey_Z                    = 0x200013a,  // M-Z
-  Fmkey_left_square_bracket  = 0x200013b,  // M-[
-  Fmkey_backslash            = 0x200013c,  // M-'\'
-  Fmkey_right_square_bracket = 0x200013d,  // M-]
-  Fmkey_caret                = 0x200013e,  // M-^
-  Fmkey_underscore           = 0x200013f,  // M-_
-  Fmkey_grave_accent         = 0x2000140,  // M-`
-  Fmkey_a                    = 0x2000141,  // M-a
-  Fmkey_b                    = 0x2000142,  // M-b
-  Fmkey_c                    = 0x2000143,  // M-c
-  Fmkey_d                    = 0x2000144,  // M-d
-  Fmkey_e                    = 0x2000145,  // M-e
-  Fmkey_f                    = 0x2000146,  // M-f
-  Fmkey_g                    = 0x2000147,  // M-g
-  Fmkey_h                    = 0x2000148,  // M-h
-  Fmkey_i                    = 0x2000149,  // M-i
-  Fmkey_j                    = 0x200014a,  // M-j
-  Fmkey_k                    = 0x200014b,  // M-k
-  Fmkey_l                    = 0x200014c,  // M-l
-  Fmkey_m                    = 0x200014d,  // M-m
-  Fmkey_n                    = 0x200014e,  // M-n
-  Fmkey_o                    = 0x200014f,  // M-o
-  Fmkey_p                    = 0x2000150,  // M-p
-  Fmkey_q                    = 0x2000151,  // M-q
-  Fmkey_r                    = 0x2000152,  // M-r
-  Fmkey_s                    = 0x2000153,  // M-s
-  Fmkey_t                    = 0x2000154,  // M-t
-  Fmkey_u                    = 0x2000155,  // M-u
-  Fmkey_v                    = 0x2000156,  // M-v
-  Fmkey_w                    = 0x2000157,  // M-w
-  Fmkey_x                    = 0x2000158,  // M-x
-  Fmkey_y                    = 0x2000159,  // M-y
-  Fmkey_z                    = 0x200015a,  // M-z
-  Fmkey_left_curly_bracket   = 0x200015b,  // M-{
-  Fmkey_vertical_bar         = 0x200015c,  // M-|
-  Fmkey_right_curly_bracket  = 0x200015d,  // M-}
-  Fmkey_tilde                = 0x200015e   // M-~
+  Fmkey_ic                   = 0x01500100,  // M-insert
+  Fmkey_dc                   = 0x01500101,  // M-delete
+  Fmkey_home                 = 0x01500102,  // M-home
+  Fmkey_end                  = 0x01500103,  // M-end
+  Fmkey_ppage                = 0x01500104,  // M-prev-page
+  Fmkey_npage                = 0x01500105,  // M-next-page
+  Fmkey_f1                   = 0x01500106,  // M-f1
+  Fmkey_f2                   = 0x01500107,  // M-f2
+  Fmkey_f3                   = 0x01500108,  // M-f3
+  Fmkey_f4                   = 0x01500109,  // M-f4
+  Fmkey_f5                   = 0x0150010a,  // M-f5
+  Fmkey_f6                   = 0x0150010b,  // M-F6
+  Fmkey_f7                   = 0x0150010c,  // M-f7
+  Fmkey_f8                   = 0x0150010d,  // M-f8
+  Fmkey_f9                   = 0x0150010e,  // M-f9
+  Fmkey_f10                  = 0x0150010f,  // M-f10
+  Fmkey_f11                  = 0x01500110,  // M-f11
+  Fmkey_f12                  = 0x01500111,  // M-f12
+  Fmkey_up                   = 0x01500112,  // M-up
+  Fmkey_down                 = 0x01500113,  // M-down
+  Fmkey_right                = 0x01500114,  // M-right
+  Fmkey_left                 = 0x01500115,  // M-left
+  Fmkey_sic                  = 0x01500116,  // shifted M-Insert
+  Fmkey_sdc                  = 0x01500117,  // shifted M-Delete
+  Fmkey_shome                = 0x01500118,  // shifted M-Home
+  Fmkey_send                 = 0x01500119,  // shifted M-End
+  Fmkey_sppage               = 0x0150011a,  // shifted M-Page_Up
+  Fmkey_snpage               = 0x0150011b,  // shifted M-Page_Down
+  Fmkey_sf1                  = 0x0150011c,  // shifted M-F1
+  Fmkey_sf2                  = 0x0150011d,  // shifted M-F2
+  Fmkey_sf3                  = 0x0150011e,  // shifted M-F3
+  Fmkey_sf4                  = 0x0150011f,  // shifted M-F4
+  Fmkey_sf5                  = 0x01500120,  // shifted M-F5
+  Fmkey_sf6                  = 0x01500121,  // shifted M-F6
+  Fmkey_sf7                  = 0x01500122,  // shifted M-F7
+  Fmkey_sf8                  = 0x01500123,  // shifted M-F8
+  Fmkey_sf9                  = 0x01500124,  // shifted M-F9
+  Fmkey_sf10                 = 0x01500125,  // shifted M-F10
+  Fmkey_sf11                 = 0x01500126,  // shifted M-F11
+  Fmkey_sf12                 = 0x01500127,  // shifted M-F12
+  Fmkey_sup                  = 0x01500128,  // shifted M-Up
+  Fmkey_sdown                = 0x01500129,  // shifted M-Down
+  Fmkey_sright               = 0x0150012a,  // shifted M-Right
+  Fmkey_sleft                = 0x0150012b,  // shifted M-Left
+  Fckey_ic                   = 0x0150012c,  // control-Insert
+  Fckey_dc                   = 0x0150012d,  // control-Delete
+  Fckey_home                 = 0x0150012e,  // control-Home
+  Fckey_end                  = 0x0150012f,  // control-End
+  Fckey_ppage                = 0x01500130,  // control-Page_Up
+  Fckey_npage                = 0x01500131,  // control-Page_Down
+  Fckey_up                   = 0x01500132,  // control-Up
+  Fckey_down                 = 0x01500133,  // control-Down
+  Fckey_right                = 0x01500134,  // control-Right
+  Fckey_left                 = 0x01500135,  // control-Left
+  Fckey_sic                  = 0x01500136,  // shifted control-M-Insert
+  Fckey_sdc                  = 0x01500137,  // shifted control-M-Delete
+  Fckey_shome                = 0x01500138,  // shifted control-M-Home
+  Fckey_send                 = 0x01500139,  // shifted control-M-End
+  Fckey_sppage               = 0x0150013a,  // shifted control-M-Page_Up
+  Fckey_snpage               = 0x0150013b,  // shifted control-M-Page_Down
+  Fckey_sup                  = 0x0150013c,  // shifted control-M-Up
+  Fckey_sdown                = 0x0150013d,  // shifted control-M-Down
+  Fckey_sright               = 0x0150013e,  // shifted control-M-Right
+  Fckey_sleft                = 0x0150013f,  // shifted control-M-Left
+  Fcmkey_ic                  = 0x01500140,  // control-M-Insert
+  Fcmkey_dc                  = 0x01500141,  // control-M-Delete
+  Fcmkey_home                = 0x01500142,  // control-M-Home
+  Fcmkey_end                 = 0x01500143,  // control-M-End
+  Fcmkey_ppage               = 0x01500144,  // control-M-Page_Up
+  Fcmkey_npage               = 0x01500145,  // control-M-Page_Down
+  Fcmkey_up                  = 0x01500146,  // control-M-Up
+  Fcmkey_down                = 0x01500147,  // control-M-Down
+  Fcmkey_right               = 0x01500148,  // control-M-Right
+  Fcmkey_left                = 0x01500149,  // control-M-Left
+  Fcmkey_sic                 = 0x0150014a,  // shifted control-M-Insert
+  Fcmkey_sdc                 = 0x0150014b,  // shifted control-M-Delete
+  Fcmkey_shome               = 0x0150014c,  // shifted control-M-Home
+  Fcmkey_send                = 0x0150014d,  // shifted control-M-End
+  Fcmkey_sppage              = 0x0150014e,  // shifted control-M-Page_Up
+  Fcmkey_snpage              = 0x0150014f,  // shifted control-M-Page_Down
+  Fcmkey_sf1                 = 0x01500150,  // shifted control-M-F1
+  Fcmkey_sf2                 = 0x01500151,  // shifted control-M-F2
+  Fcmkey_sf3                 = 0x01500152,  // shifted control-M-F3
+  Fcmkey_sf4                 = 0x01500153,  // shifted control-M-F4
+  Fcmkey_sf5                 = 0x01500154,  // shifted control-M-F5
+  Fcmkey_sf6                 = 0x01500155,  // shifted control-M-F6
+  Fcmkey_sf7                 = 0x01500156,  // shifted control-M-F7
+  Fcmkey_sf8                 = 0x01500157,  // shifted control-M-F8
+  Fcmkey_sf9                 = 0x01500158,  // shifted control-M-F9
+  Fcmkey_sf10                = 0x01500159,  // shifted control-M-F10
+  Fcmkey_sf11                = 0x0150015a,  // shifted control-M-F11
+  Fcmkey_sf12                = 0x0150015b,  // shifted control-M-F12
+  Fcmkey_sup                 = 0x0150015c,  // shifted control-M-Up
+  Fcmkey_sdown               = 0x0150015d,  // shifted control-M-Down
+  Fcmkey_sright              = 0x0150015e,  // shifted control-M-Right
+  Fcmkey_sleft               = 0x0150015f,  // shifted control-M-Left
+  Fkey_menu                  = 0x01600000,  // menu
+  Fkey_smenu                 = 0x01600001,  // shifted menu
+  Fckey_menu                 = 0x01600002,  // control-menu
+  Fckey_smenu                = 0x01600003,  // shifted control-menu
+  Fmkey_menu                 = 0x01600004,  // M-menu
+  Fmkey_smenu                = 0x01600005,  // shifted M-menu
+  Fcmkey_menu                = 0x01600006,  // control-M-menu
+  Fcmkey_smenu               = 0x01600007,  // shifted control-M-menu
+  Fkey_escape_mintty         = 0x0200001b,  // mintty Esc
+  Fkey_mouse                 = 0x02000020,  // xterm mouse
+  Fkey_extended_mouse        = 0x02000021,  // SGR extended mouse
+  Fkey_urxvt_mouse           = 0x02000022,  // urxvt mouse extension
+  Fmkey_meta                 = 0x020000e0,  // meta key offset
+  Fmkey_tab                  = 0x020000e9,  // M-tab
+  Fmkey_enter                = 0x020000ea,  // M-enter
+  Fmkey_space                = 0x02000100,  // M-' '
+  Fmkey_bang                 = 0x02000101,  // M-!
+  Fmkey_quotes               = 0x02000102,  // M-"
+  Fmkey_hash                 = 0x02000103,  // M-#
+  Fmkey_dollar               = 0x02000104,  // M-$
+  Fmkey_percent              = 0x02000105,  // M-%
+  Fmkey_ampersand            = 0x02000106,  // M-&
+  Fmkey_apostrophe           = 0x02000107,  // M-'
+  Fmkey_left_parenthesis     = 0x02000108,  // M-(
+  Fmkey_right_parenthesis    = 0x02000109,  // M-)
+  Fmkey_asterisk             = 0x0200010a,  // M-*
+  Fmkey_plus                 = 0x0200010b,  // M-+
+  Fmkey_comma                = 0x0200010c,  // M-,
+  Fmkey_minus                = 0x0200010d,  // M-'-'
+  Fmkey_full_stop            = 0x0200010e,  // M-.
+  Fmkey_slash                = 0x0200010f,  // M-/
+  Fmkey_0                    = 0x02000110,  // M-0
+  Fmkey_1                    = 0x02000111,  // M-1
+  Fmkey_2                    = 0x02000112,  // M-2
+  Fmkey_3                    = 0x02000113,  // M-3
+  Fmkey_4                    = 0x02000114,  // M-4
+  Fmkey_5                    = 0x02000115,  // M-5
+  Fmkey_6                    = 0x02000116,  // M-6
+  Fmkey_7                    = 0x02000117,  // M-7
+  Fmkey_8                    = 0x02000118,  // M-8
+  Fmkey_9                    = 0x02000119,  // M-9
+  Fmkey_colon                = 0x0200011a,  // M-:
+  Fmkey_semicolon            = 0x0200011b,  // M-;
+  Fmkey_less_than            = 0x0200011c,  // M-<
+  Fmkey_equals               = 0x0200011d,  // M-=
+  Fmkey_greater_than         = 0x0200011e,  // M->
+  Fmkey_question_mark        = 0x0200011f,  // M-?
+  Fmkey_at                   = 0x02000120,  // M-@
+  Fmkey_A                    = 0x02000121,  // M-A
+  Fmkey_B                    = 0x02000122,  // M-B
+  Fmkey_C                    = 0x02000123,  // M-C
+  Fmkey_D                    = 0x02000124,  // M-D
+  Fmkey_E                    = 0x02000125,  // M-E
+  Fmkey_F                    = 0x02000126,  // M-F
+  Fmkey_G                    = 0x02000127,  // M-G
+  Fmkey_H                    = 0x02000128,  // M-H
+  Fmkey_I                    = 0x02000129,  // M-I
+  Fmkey_J                    = 0x0200012a,  // M-J
+  Fmkey_K                    = 0x0200012b,  // M-K
+  Fmkey_L                    = 0x0200012c,  // M-L
+  Fmkey_M                    = 0x0200012d,  // M-M
+  Fmkey_N                    = 0x0200012e,  // M-N
+  Fmkey_O                    = 0x0200012f,  // M-O
+  Fmkey_P                    = 0x02000130,  // M-P
+  Fmkey_Q                    = 0x02000131,  // M-Q
+  Fmkey_R                    = 0x02000132,  // M-R
+  Fmkey_S                    = 0x02000133,  // M-S
+  Fmkey_T                    = 0x02000134,  // M-T
+  Fmkey_U                    = 0x02000135,  // M-U
+  Fmkey_V                    = 0x02000136,  // M-V
+  Fmkey_W                    = 0x02000137,  // M-W
+  Fmkey_X                    = 0x02000138,  // M-X
+  Fmkey_Y                    = 0x02000139,  // M-Y
+  Fmkey_Z                    = 0x0200013a,  // M-Z
+  Fmkey_left_square_bracket  = 0x0200013b,  // M-[
+  Fmkey_backslash            = 0x0200013c,  // M-'\'
+  Fmkey_right_square_bracket = 0x0200013d,  // M-]
+  Fmkey_caret                = 0x0200013e,  // M-^
+  Fmkey_underscore           = 0x0200013f,  // M-_
+  Fmkey_grave_accent         = 0x02000140,  // M-`
+  Fmkey_a                    = 0x02000141,  // M-a
+  Fmkey_b                    = 0x02000142,  // M-b
+  Fmkey_c                    = 0x02000143,  // M-c
+  Fmkey_d                    = 0x02000144,  // M-d
+  Fmkey_e                    = 0x02000145,  // M-e
+  Fmkey_f                    = 0x02000146,  // M-f
+  Fmkey_g                    = 0x02000147,  // M-g
+  Fmkey_h                    = 0x02000148,  // M-h
+  Fmkey_i                    = 0x02000149,  // M-i
+  Fmkey_j                    = 0x0200014a,  // M-j
+  Fmkey_k                    = 0x0200014b,  // M-k
+  Fmkey_l                    = 0x0200014c,  // M-l
+  Fmkey_m                    = 0x0200014d,  // M-m
+  Fmkey_n                    = 0x0200014e,  // M-n
+  Fmkey_o                    = 0x0200014f,  // M-o
+  Fmkey_p                    = 0x02000150,  // M-p
+  Fmkey_q                    = 0x02000151,  // M-q
+  Fmkey_r                    = 0x02000152,  // M-r
+  Fmkey_s                    = 0x02000153,  // M-s
+  Fmkey_t                    = 0x02000154,  // M-t
+  Fmkey_u                    = 0x02000155,  // M-u
+  Fmkey_v                    = 0x02000156,  // M-v
+  Fmkey_w                    = 0x02000157,  // M-w
+  Fmkey_x                    = 0x02000158,  // M-x
+  Fmkey_y                    = 0x02000159,  // M-y
+  Fmkey_z                    = 0x0200015a,  // M-z
+  Fmkey_left_curly_bracket   = 0x0200015b,  // M-{
+  Fmkey_vertical_bar         = 0x0200015c,  // M-|
+  Fmkey_right_curly_bracket  = 0x0200015d,  // M-}
+  Fmkey_tilde                = 0x0200015e   // M-~
 };
 
 // Console color names
diff --git a/src/include/final/fevent.h b/src/include/final/fevent.h
index ed2ca040..fc884a9f 100644
--- a/src/include/final/fevent.h
+++ b/src/include/final/fevent.h
@@ -113,16 +113,16 @@ class FEvent  // event base class
 class FKeyEvent : public FEvent  // keyboard event
 {
   public:
-    FKeyEvent (int, int);
+    FKeyEvent (int, FKey);
     ~FKeyEvent();
 
-    int  key() const;
+    FKey key() const;
     bool isAccepted() const;
     void accept();
     void ignore();
 
   protected:
-    int  k;
+    FKey  k;
     bool accpt;
 };
 
diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h
index c4c69b50..274070c9 100644
--- a/src/include/final/fkeyboard.h
+++ b/src/include/final/fkeyboard.h
@@ -97,8 +97,8 @@ class FKeyboard
 
     // Accessors
     virtual const char* getClassName() const;
-    int                 getKey();
-    const FString       getKeyName (int);
+    FKey                getKey();
+    const FString       getKeyName (FKey);
     keybuffer&          getKeyBuffer();
     timeval*            getKeyPressedTime();
 
@@ -131,8 +131,8 @@ class FKeyboard
 
   private:
     // Constants
-    static const int NEED_MORE_DATA = -1;
     static const std::size_t READ_BUF_SIZE = 1024;
+    static const FKey NOT_SET = static_cast(-1);
 
     // Disable copy constructor
     FKeyboard (const FKeyboard&);
@@ -141,10 +141,10 @@ class FKeyboard
     FKeyboard& operator = (const FKeyboard&);
 
     // Accessors
-    int                 getMouseProtocolKey();
-    int                 getTermcapKey();
-    int                 getMetaKey();
-    int                 getSingleKey();
+    FKey                getMouseProtocolKey();
+    FKey                getTermcapKey();
+    FKey                getMetaKey();
+    FKey                getSingleKey();
 
     // Mutators
     bool                setNonBlockingInput (bool);
@@ -155,18 +155,18 @@ class FKeyboard
     static bool         isKeypressTimeout();
 
     // Methods
-    int                 UTF8decode (const char[]);
+    FKey                UTF8decode (const char[]);
     ssize_t             readKey();
     void                parseKeyBuffer();
-    int                 parseKeyString();
-    int                 keyCorrection (const int&);
+    FKey                parseKeyString();
+    FKey                keyCorrection (const FKey&);
     void                substringKeyHandling();
     void                keyPressed();
     void                keyReleased();
     void                escapeKeyPressed();
 
     // Data Members
-    int                 key;
+    FKey                key;
     char                read_buf[READ_BUF_SIZE];
     char                fifo_buf[FIFO_BUF_SIZE];
     int                 fifo_offset;
@@ -197,7 +197,7 @@ inline const char* FKeyboard::getClassName() const
 { return "FKeyboard"; }
 
 //----------------------------------------------------------------------
-inline int FKeyboard::getKey()
+inline FKey FKeyboard::getKey()
 { return key; }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h
index 45c065c3..5d6b9f63 100644
--- a/src/include/final/flineedit.h
+++ b/src/include/final/flineedit.h
@@ -165,7 +165,7 @@ class FLineEdit : public FWidget
     void         keyBackspace();
     void         keyInsert();
     void         keyEnter();
-    bool         keyInput (int);
+    bool         keyInput (FKey);
     void         processActivate();
     void         processChanged();
 
diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h
index 3e96ef56..28796011 100644
--- a/src/include/final/flistbox.h
+++ b/src/include/final/flistbox.h
@@ -285,7 +285,7 @@ class FListBox : public FWidget
     bool         keySpace();
     bool         keyInsert();
     bool         keyBackspace();
-    bool         keyIncSearchInput (int);
+    bool         keyIncSearchInput (FKey);
     void         processClick();
     void         processSelect();
     void         processChanged();
diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h
index d9c16509..4c65ea58 100644
--- a/src/include/final/fmenu.h
+++ b/src/include/final/fmenu.h
@@ -210,7 +210,7 @@ class FMenu : public FWindow, public FMenuList
     void         drawCheckMarkPrefix (FMenuItem*);
     void         drawMenuText (menuText&);
     void         drawSubMenuIndicator (std::size_t&);
-    void         drawAcceleratorKey (std::size_t&, int);
+    void         drawAcceleratorKey (std::size_t&, FKey);
     void         drawTrailingSpaces (std::size_t);
     void         setLineAttributes (FMenuItem*, int);
     void         setCursorToHotkeyPosition (FMenuItem*);
diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h
index a6db4356..2c03fcbd 100644
--- a/src/include/final/fmenuitem.h
+++ b/src/include/final/fmenuitem.h
@@ -84,14 +84,14 @@ class FMenuItem : public FWidget
     // Constructor
     explicit FMenuItem (FWidget* = 0);
     explicit FMenuItem (const FString&, FWidget* = 0);
-    FMenuItem (int, const FString&, FWidget* = 0);
+    FMenuItem (FKey, const FString&, FWidget* = 0);
 
     // Destructor
     virtual ~FMenuItem();
 
     // Accessors
     const char*  getClassName() const;
-    int          getHotkey() const;
+    uChar        getHotkey() const;
     FMenu*       getMenu() const;
     std::size_t  getTextLength() const;
     FString      getText() const;
@@ -118,7 +118,7 @@ class FMenuItem : public FWidget
     bool         hasMenu() const;
 
     // Methods
-    virtual void addAccelerator (int, FWidget*);
+    virtual void addAccelerator (FKey, FWidget*);
     virtual void delAccelerator (FWidget*);
     void         openMenu();
 
@@ -153,8 +153,8 @@ class FMenuItem : public FWidget
     bool         radio_button;
     bool         dialog_index;
     std::size_t  text_length;
-    int          hotkey;
-    int          accel_key;
+    uChar        hotkey;
+    FKey         accel_key;
     FMenu*       menu;
     FWidget*     super_menu;
     FDialog*     associated_window;
@@ -199,7 +199,7 @@ inline const char* FMenuItem::getClassName() const
 { return "FMenuItem"; }
 
 //----------------------------------------------------------------------
-inline int FMenuItem::getHotkey() const
+inline uChar FMenuItem::getHotkey() const
 { return hotkey; }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h
index aa4416a5..3e7a080d 100644
--- a/src/include/final/fstatusbar.h
+++ b/src/include/final/fstatusbar.h
@@ -81,18 +81,18 @@ class FStatusKey : public FWidget
   public:
     // Constructors
     explicit FStatusKey (FWidget* = 0);
-    FStatusKey (int, const FString&, FWidget* = 0);
+    FStatusKey (FKey, const FString&, FWidget* = 0);
 
     // Destructor
     virtual ~FStatusKey();
 
     // Accessors
     virtual const char* getClassName() const;
-    virtual int         getKey() const;
+    virtual FKey        getKey() const;
     virtual FString     getText() const;
 
     // Mutators
-    void                setKey (int);
+    void                setKey (FKey);
     void                setText (const FString&);
     void                setActive();
     void                unsetActive();
@@ -124,7 +124,7 @@ class FStatusKey : public FWidget
     friend class FStatusBar;
 
     // Data Members
-    int         key;
+    FKey        key;
     FString     text;
     bool        active;
     bool        mouse_focus;
@@ -139,7 +139,7 @@ inline const char* FStatusKey::getClassName() const
 { return "FStatusKey"; }
 
 //----------------------------------------------------------------------
-inline int FStatusKey::getKey() const
+inline FKey FStatusKey::getKey() const
 { return key; }
 
 //----------------------------------------------------------------------
@@ -147,7 +147,7 @@ inline FString FStatusKey::getText() const
 { return text; }
 
 //----------------------------------------------------------------------
-inline void FStatusKey::setKey (int k)
+inline void FStatusKey::setKey (FKey k)
 { key = k; }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h
index 59673cd2..bfa4699e 100644
--- a/src/include/final/fterm.h
+++ b/src/include/final/fterm.h
@@ -171,7 +171,7 @@ class FTerm
     static FMouseControl*  getMouseControl();
     static std::size_t     getLineNumber();
     static std::size_t     getColumnNumber();
-    static const FString   getKeyName (int);
+    static const FString   getKeyName (FKey);
     static FOptiMove*      getFOptiMove();
 
     static int             getTTYFileDescriptor();
diff --git a/src/include/final/ftermdebugdata.h b/src/include/final/ftermdebugdata.h
index 87f796b3..0d80e76a 100644
--- a/src/include/final/ftermdebugdata.h
+++ b/src/include/final/ftermdebugdata.h
@@ -66,6 +66,13 @@ class FTermDebugData
     void           setFTermData (FTermData*);
 
   private:
+    // Disable copy constructor
+    FTermDebugData (const FTermDebugData&);
+
+    // Disable assignment operator (=)
+    FTermDebugData& operator = (const FTermDebugData&);
+
+    // Data Members
     FTermDetection* term_detection;
     FTermData*      data;
 };
diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h
index 32335625..1dc49936 100644
--- a/src/include/final/ftermlinux.h
+++ b/src/include/final/ftermlinux.h
@@ -105,7 +105,7 @@ class FTermLinux
     static void          setBeep (int, int);
     static void          resetBeep();
     static char*         restoreCursorStyle();
-    static int           modifierKeyCorrection (const int&);
+    static FKey          modifierKeyCorrection (const FKey&);
 
   private:
     // Typedef
@@ -159,13 +159,13 @@ class FTermLinux
     static bool          saveVGAPalette();
     static bool          resetVGAPalette();
 #endif  // defined(__x86_64__) || defined(__i386) || defined(__arm__)
-    static int           shiftKeyCorrection (const int&);
-    static int           ctrlKeyCorrection (const int&);
-    static int           altKeyCorrection (const int&);
-    static int           shiftCtrlKeyCorrection (const int&);
-    static int           shiftAltKeyCorrection (const int&);
-    static int           ctrlAltKeyCorrection (const int&);
-    static int           shiftCtrlAltKeyCorrection (const int&);
+    static FKey          shiftKeyCorrection (const FKey&);
+    static FKey          ctrlKeyCorrection (const FKey&);
+    static FKey          altKeyCorrection (const FKey&);
+    static FKey          shiftCtrlKeyCorrection (const FKey&);
+    static FKey          shiftAltKeyCorrection (const FKey&);
+    static FKey          ctrlAltKeyCorrection (const FKey&);
+    static FKey          shiftCtrlAltKeyCorrection (const FKey&);
 
     // Data Members
 #if defined(__linux__)
diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h
index e88d6892..c0d17f8e 100644
--- a/src/include/final/ftypes.h
+++ b/src/include/final/ftypes.h
@@ -56,6 +56,7 @@ typedef int64_t        sInt64;
 typedef long double    lDouble;
 
 typedef uInt16         FColor;
+typedef uInt32         FKey;
 
 }  // namespace
 
@@ -93,7 +94,7 @@ namespace fc
 #pragma pack(1)
 typedef struct
 {
-  int   num;
+  FKey  num;
   char* string;
   char  tname[4];
 }
@@ -101,14 +102,14 @@ fkeymap;
 
 typedef struct
 {
-  int  num;
+  FKey num;
   char string[8];
 }
 fmetakeymap;
 
 typedef struct
 {
-  int  num;
+  FKey num;
   char string[25];
 }
 keyname;
diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h
index 362dbf2d..7ae1f914 100644
--- a/src/include/final/fvterm.h
+++ b/src/include/final/fvterm.h
@@ -138,7 +138,7 @@ class FVTerm
     static int            getTabstop();
     static fc::encoding   getEncoding();
     static std::string    getEncodingString();
-    static const FString  getKeyName (int);
+    static const FString  getKeyName (FKey);
     static char*          getTermType();
     static char*          getTermFileName();
     FTerm&                getFTerm();
@@ -637,7 +637,7 @@ inline std::string FVTerm::getEncodingString()
 { return FTerm::getEncodingString(); }
 
 //----------------------------------------------------------------------
-inline const FString FVTerm::getKeyName (int keynum)
+inline const FString FVTerm::getKeyName (FKey keynum)
 { return FTerm::getKeyName(keynum); }
 
 //----------------------------------------------------------------------
diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h
index 1bdd9522..2d030453 100644
--- a/src/include/final/fwidget.h
+++ b/src/include/final/fwidget.h
@@ -132,7 +132,7 @@ class FWidget : public FVTerm, public FObject
 
     struct accelerator
     {
-      int key;
+      FKey key;
       FWidget* object;
     };
 
@@ -310,8 +310,8 @@ class FWidget : public FVTerm, public FObject
     void               delCallback (FWidget*);
     void               delCallbacks();
     void               emitCallback (const FString&);
-    void               addAccelerator (int);
-    virtual void       addAccelerator (int, FWidget*);
+    void               addAccelerator (FKey);
+    virtual void       addAccelerator (FKey, FWidget*);
     void               delAccelerator ();
     virtual void       delAccelerator (FWidget*);
     virtual void       redraw();
@@ -932,7 +932,7 @@ inline void FWidget::clearStatusbarMessage()
 { statusbar_message.clear(); }
 
 //----------------------------------------------------------------------
-inline void FWidget::addAccelerator (int key)
+inline void FWidget::addAccelerator (FKey key)
 { addAccelerator (key, this); }
 
 //----------------------------------------------------------------------
diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp
index e919c384..7d76cb1a 100644
--- a/test/fkeyboard-test.cpp
+++ b/test/fkeyboard-test.cpp
@@ -275,9 +275,9 @@ class FKeyboardTest : public CPPUNIT_NS::TestFixture
     void escapeKeyPressed();
 
     // Data Members
-    int key_pressed;
-    int key_released;
-    int number_of_keys;
+    FKey key_pressed;
+    FKey key_released;
+    int  number_of_keys;
     finalcut::FKeyboard* keyboard;
 };
 #pragma pack(pop)
@@ -2754,10 +2754,10 @@ void FKeyboardTest::utf8Test()
   CPPUNIT_ASSERT ( key_pressed == 0x0040 );
 
   // Invalid UTF-8
-  key_pressed = -5;
+  key_pressed = 0xffffffff;
   input("\377");
   processInput();
-  CPPUNIT_ASSERT ( key_pressed == -5 );
+  CPPUNIT_ASSERT ( key_pressed == 0xffffffff );
 
   // Without UTF-8 support
   keyboard->disableUTF8();

From f6df9585f5df930229f6a4e0bc5e11db3e17dfea Mon Sep 17 00:00:00 2001
From: Markus Gans 
Date: Wed, 21 Nov 2018 22:15:14 +0100
Subject: [PATCH 33/33] The integer type of FPoint and FRect changed from short
 to int

---
 ChangeLog                  |   1 +
 src/fpoint.cpp             |  18 +++----
 src/frect.cpp              | 104 ++++++++++++++++++-------------------
 src/fscrollview.cpp        |  48 ++++++++---------
 src/include/final/fpoint.h |  17 +++---
 src/include/final/frect.h  |  36 ++++++-------
 test/fpoint-test.cpp       |  47 ++++++++++-------
 test/frect-test.cpp        |   8 +--
 8 files changed, 144 insertions(+), 135 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3ad6c82f..0d720c41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2018-11-21  Markus Gans  
 	* New type FKey for key inputs
+	* The integer type of FPoint and FRect changed from short to int
 
 2018-11-18  Markus Gans  
 	* The FListViewItem class now provides checkable list view items
diff --git a/src/fpoint.cpp b/src/fpoint.cpp
index d28c0a08..51d93d4e 100644
--- a/src/fpoint.cpp
+++ b/src/fpoint.cpp
@@ -44,36 +44,36 @@ FPoint& FPoint::operator = (const FPoint& p)
 //----------------------------------------------------------------------
 FPoint& FPoint::operator += (const FPoint& p)
 {
-  xpos = short(xpos + p.xpos);
-  ypos = short(ypos + p.ypos);
+  xpos = xpos + p.xpos;
+  ypos = ypos + p.ypos;
   return *this;
 }
 
 //----------------------------------------------------------------------
 FPoint& FPoint::operator -= (const FPoint& p)
 {
-  xpos = short(xpos - p.xpos);
-  ypos = short(ypos - p.ypos);
+  xpos = xpos - p.xpos;
+  ypos = ypos - p.ypos;
   return *this;
 }
 
 //----------------------------------------------------------------------
 void FPoint::setX (int x)
 {
-  xpos = short(x);
+  xpos = x;
 }
 
 //----------------------------------------------------------------------
 void FPoint::setY (int y)
 {
-  ypos = short(y);
+  ypos = y;
 }
 
 //----------------------------------------------------------------------
 void FPoint::setPoint (int x, int y)
 {
-  xpos = short(x);
-  ypos = short(y);
+  xpos = x;
+  ypos = y;
 }
 
 //----------------------------------------------------------------------
@@ -92,7 +92,7 @@ std::ostream& operator << (std::ostream& outstr, const FPoint& p)
 //----------------------------------------------------------------------
 std::istream& operator >> (std::istream& instr, FPoint& p)
 {
-  short x, y;
+  int x, y;
   instr >> x;
   instr >> y;
   p.setPoint (x, y);
diff --git a/src/frect.cpp b/src/frect.cpp
index 7c4a0b35..1233b595 100644
--- a/src/frect.cpp
+++ b/src/frect.cpp
@@ -34,10 +34,10 @@ namespace finalcut
 // constructor and destructor
 //----------------------------------------------------------------------
 FRect::FRect (const FPoint& p1, const FPoint& p2)
-  : X1(short(p1.getX()))
-  , Y1(short(p1.getY()))
-  , X2(short(p2.getX()))
-  , Y2(short(p2.getY()))
+  : X1(p1.getX())
+  , Y1(p1.getY())
+  , X2(p2.getX())
+  , Y2(p2.getY())
 { }
 
 //----------------------------------------------------------------------
@@ -55,82 +55,82 @@ bool FRect::isNull() const
 //----------------------------------------------------------------------
 void FRect::setX1 (int n)
 {
-  X1 = short(n);
+  X1 = n;
 }
 
 //----------------------------------------------------------------------
 void FRect::setY1 (int n)
 {
-  Y1 = short(n);
+  Y1 = n;
 }
 
 //----------------------------------------------------------------------
 void FRect::setX2 (int n)
 {
-  X2 = short(n);
+  X2 = n;
 }
 
 //----------------------------------------------------------------------
 void FRect::setY2 (int n)
 {
-  Y2 = short(n);
+  Y2 = n;
 }
 
 //----------------------------------------------------------------------
 void FRect::setX (int n)
 {
-  short dX = short(X2 - X1);
-  X1 = short(n);
-  X2 = short(X1 + dX);
+  int dX = X2 - X1;
+  X1 = n;
+  X2 = X1 + dX;
 }
 
 //----------------------------------------------------------------------
 void FRect::setY (int n)
 {
-  short dY = short(Y2 - Y1);
-  Y1 = short(n);
-  Y2 = short(Y1 + dY);
+  int dY = Y2 - Y1;
+  Y1 = n;
+  Y2 = Y1 + dY;
 }
 
 //----------------------------------------------------------------------
 void FRect::setPos (int x, int y)
 {
-  short dX = short(X2 - X1);
-  short dY = short(Y2 - Y1);
-  X1 = short(x);
-  Y1 = short(y);
-  X2 = short(X1 + dX);
-  Y2 = short(Y1 + dY);
+  int dX = X2 - X1;
+  int dY = Y2 - Y1;
+  X1 = x;
+  Y1 = y;
+  X2 = X1 + dX;
+  Y2 = Y1 + dY;
 }
 
 //----------------------------------------------------------------------
 void FRect::setPos (const FPoint& p)
 {
-  short dX = short(X2 - X1);
-  short dY = short(Y2 - Y1);
-  X1 = short(p.getX());
-  Y1 = short(p.getY());
-  X2 = short(X1 + dX);
-  Y2 = short(Y1 + dY);
+  int dX = X2 - X1;
+  int dY = Y2 - Y1;
+  X1 = p.getX();
+  Y1 = p.getY();
+  X2 = X1 + dX;
+  Y2 = Y1 + dY;
 }
 
 //----------------------------------------------------------------------
 void FRect::setWidth (std::size_t w)
 {
-  X2 = short(X1 + short(w) - 1);
+  X2 = X1 + int(w) - 1;
 }
 
 //----------------------------------------------------------------------
 void FRect::setHeight (std::size_t h)
 {
-  Y2 = short(Y1 + short(h) - 1);
+  Y2 = Y1 + int(h) - 1;
 }
 
 //----------------------------------------------------------------------
 void FRect::setSize (std::size_t w, std::size_t h)
 {
-  X2 = short(X1 + short(w) - 1);
-  Y2 = short(Y1 + short(h) - 1);
+  X2 = X1 + int(w) - 1;
+  Y2 = Y1 + int(h) - 1;
 }
 
 //----------------------------------------------------------------------
@@ -145,10 +145,10 @@ void FRect::setRect (const FRect& r)
 //----------------------------------------------------------------------
 void FRect::setRect (int x, int y, std::size_t width, std::size_t height)
 {
-  X1 = short(x);
-  Y1 = short(y);
-  X2 = short(x + int(width) - 1);
-  Y2 = short(y + int(height) - 1);
+  X1 = x;
+  Y1 = y;
+  X2 = x + int(width) - 1;
+  Y2 = y + int(height) - 1;
 }
 
 //----------------------------------------------------------------------
@@ -160,28 +160,28 @@ void FRect::setCoordinates (const FPoint& p1, const FPoint& p2)
 //----------------------------------------------------------------------
 void FRect::setCoordinates (int x1, int y1, int x2, int y2)
 {
-  X1 = short(x1);
-  Y1 = short(y1);
-  X2 = short(x2);
-  Y2 = short(y2);
+  X1 = x1;
+  Y1 = y1;
+  X2 = x2;
+  Y2 = y2;
 }
 
 //----------------------------------------------------------------------
 void FRect::move (int dx, int dy)
 {
-  X1 = short(X1 + dx);
-  Y1 = short(Y1 + dy);
-  X2 = short(X2 + dx);
-  Y2 = short(Y2 + dy);
+  X1 = X1 + dx;
+  Y1 = Y1 + dy;
+  X2 = X2 + dx;
+  Y2 = Y2 + dy;
 }
 
 //----------------------------------------------------------------------
-void FRect::move  (const FPoint& d)
+void FRect::move (const FPoint& d)
 {
-  X1 = short(X1 + d.getX());
-  Y1 = short(Y1 + d.getY());
-  X2 = short(X2 + d.getX());
-  Y2 = short(Y2 + d.getY());
+  X1 = X1 + d.getX();
+  Y1 = Y1 + d.getY();
+  X2 = X2 + d.getX();
+  Y2 = Y2 + d.getY();
 }
 
 //----------------------------------------------------------------------
@@ -239,10 +239,10 @@ FRect FRect::combined (const FRect& r) const
 //----------------------------------------------------------------------
 FRect& FRect::operator = (const FRect& r)
 {
-  X1 = short(r.getX1());
-  Y1 = short(r.getY1());
-  X2 = short(r.getX2());
-  Y2 = short(r.getY2());
+  X1 = r.getX1();
+  Y1 = r.getY1();
+  X2 = r.getX2();
+  Y2 = r.getY2();
   return *this;
 }
 
@@ -295,7 +295,7 @@ std::ostream& operator << (std::ostream& outstr, const FRect& r)
 //----------------------------------------------------------------------
 std::istream& operator >> (std::istream& instr, FRect& r)
 {
-  short x1, y1, x2, y2;
+  int x1, y1, x2, y2;
   instr >> x1;
   instr >> y1;
   instr >> x2;
diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp
index befa79cb..b238e47b 100644
--- a/src/fscrollview.cpp
+++ b/src/fscrollview.cpp
@@ -333,12 +333,12 @@ void FScrollView::scrollToY (int y)
 //----------------------------------------------------------------------
 void FScrollView::scrollTo (int x, int y)
 {
-  short& xoffset = viewport_geometry.x1_ref();
-  short& yoffset = viewport_geometry.y1_ref();
-  short  xoffset_before = xoffset;
-  short  yoffset_before = yoffset;
-  short  xoffset_end = short(getScrollWidth() - getViewportWidth());
-  short  yoffset_end = short(getScrollHeight() - getViewportHeight());
+  int& xoffset = viewport_geometry.x1_ref();
+  int& yoffset = viewport_geometry.y1_ref();
+  int  xoffset_before = xoffset;
+  int  yoffset_before = yoffset;
+  int  xoffset_end = int(getScrollWidth() - getViewportWidth());
+  int  yoffset_end = int(getScrollHeight() - getViewportHeight());
   std::size_t save_width = viewport_geometry.getWidth();
   std::size_t save_height = viewport_geometry.getHeight();
   bool changeX = false;
@@ -346,11 +346,11 @@ void FScrollView::scrollTo (int x, int y)
   x--;
   y--;
 
-  if ( xoffset == short(x) && yoffset == short(y) )
+  if ( xoffset == x && yoffset == y )
     return;
 
-  xoffset = short(x);
-  yoffset = short(y);
+  xoffset = x;
+  yoffset = y;
 
   if ( yoffset < 0 )
     yoffset = 0;
@@ -374,7 +374,7 @@ void FScrollView::scrollTo (int x, int y)
   {
     viewport_geometry.setWidth(save_width);
     setLeftPadding (1 - xoffset);
-    setRightPadding (1 - (xoffset_end - xoffset) + short(nf_offset));
+    setRightPadding (1 - (xoffset_end - xoffset) + int(nf_offset));
 
     if ( update_scrollbar )
     {
@@ -440,7 +440,7 @@ void FScrollView::draw()
 //----------------------------------------------------------------------
 void FScrollView::onKeyPress (FKeyEvent* ev)
 {
-  short yoffset_end = short(getScrollHeight() - getViewportHeight());
+  int yoffset_end = int(getScrollHeight() - getViewportHeight());
 
   switch ( ev->key() )
   {
@@ -492,7 +492,7 @@ void FScrollView::onKeyPress (FKeyEvent* ev)
 //----------------------------------------------------------------------
 void FScrollView::onWheel (FWheelEvent* ev)
 {
-  short distance = 4;
+  int distance = 4;
 
   switch ( ev->getWheel() )
   {
@@ -694,10 +694,10 @@ void FScrollView::copy2area()
     ac = &print_area->text[(ay + y) * a_line_len + ax];
     std::memcpy (ac, vc, sizeof(charData) * unsigned(x_end));
 
-    if ( short(print_area->changes[ay + y].xmin) > ax )
+    if ( int(print_area->changes[ay + y].xmin) > ax )
       print_area->changes[ay + y].xmin = uInt(ax);
 
-    if ( short(print_area->changes[ay + y].xmax) < ax + x_end - 1 )
+    if ( int(print_area->changes[ay + y].xmax) < ax + x_end - 1 )
       print_area->changes[ay + y].xmax = uInt(ax + x_end - 1);
   }
 
@@ -892,8 +892,8 @@ void FScrollView::setViewportCursor()
 void FScrollView::cb_VBarChange (FWidget*, data_ptr)
 {
   FScrollbar::sType scrollType = vbar->getScrollType();
-  short distance = 1;
-  short wheel_distance = 4;
+  int distance = 1;
+  int wheel_distance = 4;
 
   if ( scrollType >= FScrollbar::scrollStepBackward
     && scrollType <= FScrollbar::scrollWheelDown )
@@ -911,21 +911,21 @@ void FScrollView::cb_VBarChange (FWidget*, data_ptr)
       break;
 
     case FScrollbar::scrollPageBackward:
-      distance = short(getViewportHeight());
+      distance = int(getViewportHeight());
       // fall through
     case FScrollbar::scrollStepBackward:
       scrollBy (0, -distance);
       break;
 
     case FScrollbar::scrollPageForward:
-      distance = short(getViewportHeight());
+      distance = int(getViewportHeight());
       // fall through
     case FScrollbar::scrollStepForward:
       scrollBy (0, distance);
       break;
 
     case FScrollbar::scrollJump:
-      scrollToY (1 + short(vbar->getValue()));
+      scrollToY (1 + int(vbar->getValue()));
       break;
 
     case FScrollbar::scrollWheelUp:
@@ -944,8 +944,8 @@ void FScrollView::cb_VBarChange (FWidget*, data_ptr)
 void FScrollView::cb_HBarChange (FWidget*, data_ptr)
 {
   FScrollbar::sType scrollType = hbar->getScrollType();
-  short distance = 1;
-  short wheel_distance = 4;
+  int distance = 1;
+  int wheel_distance = 4;
 
   if ( scrollType >= FScrollbar::scrollStepBackward
     && scrollType <= FScrollbar::scrollWheelDown )
@@ -963,21 +963,21 @@ void FScrollView::cb_HBarChange (FWidget*, data_ptr)
       break;
 
     case FScrollbar::scrollPageBackward:
-      distance = short(getViewportWidth());
+      distance = int(getViewportWidth());
       // fall through
     case FScrollbar::scrollStepBackward:
       scrollBy (-distance, 0);
       break;
 
     case FScrollbar::scrollPageForward:
-      distance = short(getViewportWidth());
+      distance = int(getViewportWidth());
       // fall through
     case FScrollbar::scrollStepForward:
       scrollBy (distance, 0);
       break;
 
     case FScrollbar::scrollJump:
-      scrollToX (1 + short(hbar->getValue()));
+      scrollToX (1 + int(hbar->getValue()));
       break;
 
     case FScrollbar::scrollWheelUp:
diff --git a/src/include/final/fpoint.h b/src/include/final/fpoint.h
index 44c68172..6e15b407 100644
--- a/src/include/final/fpoint.h
+++ b/src/include/final/fpoint.h
@@ -36,6 +36,7 @@
 #endif
 
 #include 
+#include "final/ftypes.h"
 
 namespace finalcut
 {
@@ -83,13 +84,13 @@ class FPoint
     bool    isNull() const;
 
     // Point references
-    short&  x_ref();
-    short&  y_ref();
+    int& x_ref();
+    int& y_ref();
 
   private:
     // Data Members
-    short xpos;
-    short ypos;
+    int xpos;
+    int ypos;
 };
 #pragma pack(pop)
 
@@ -109,8 +110,8 @@ inline FPoint::FPoint (const FPoint& p)  // copy constructor
 
 //----------------------------------------------------------------------
 inline FPoint::FPoint (int x, int y)
-  : xpos(short(x))
-  , ypos(short(y))
+  : xpos(x)
+  , ypos(y)
 { }
 
 //----------------------------------------------------------------------
@@ -146,11 +147,11 @@ inline int FPoint::getY() const
 { return ypos; }
 
 //----------------------------------------------------------------------
-inline short& FPoint::x_ref()
+inline int& FPoint::x_ref()
 { return xpos; }
 
 //----------------------------------------------------------------------
-inline short& FPoint::y_ref()
+inline int& FPoint::y_ref()
 { return ypos; }
 
 }  // namespace finalcut
diff --git a/src/include/final/frect.h b/src/include/final/frect.h
index 760f0db0..ea38f539 100644
--- a/src/include/final/frect.h
+++ b/src/include/final/frect.h
@@ -107,10 +107,10 @@ class FRect
     bool        isNull() const;
 
     // Coordinate references
-    short&      x1_ref();
-    short&      y1_ref();
-    short&      x2_ref();
-    short&      y2_ref();
+    int&        x1_ref();
+    int&        y1_ref();
+    int&        x2_ref();
+    int&        y2_ref();
 
     // Methods
     void        move (int, int);
@@ -124,10 +124,10 @@ class FRect
 
   private:
     // Data Members
-    short X1;
-    short Y1;
-    short X2;
-    short Y2;
+    int X1;
+    int Y1;
+    int X2;
+    int Y2;
 };
 #pragma pack(pop)
 
@@ -151,10 +151,10 @@ inline FRect::FRect (const FRect& r)  // copy constructor
 
 //----------------------------------------------------------------------
 inline FRect::FRect (int x, int y, std::size_t width, std::size_t height)
-  : X1(short(x))
-  , Y1(short(y))
-  , X2(short(x + short(width) - 1))
-  , Y2(short(y + short(height) - 1))
+  : X1(x)
+  , Y1(y)
+  , X2(x + int(width) - 1)
+  , Y2(y + int(height) - 1)
 { }
 
 //----------------------------------------------------------------------
@@ -208,31 +208,31 @@ inline FPoint FRect::getLowerRightPos() const
 //----------------------------------------------------------------------
 inline std::size_t FRect::getWidth() const
 {
-  short w = X2 - X1 + 1;
+  int w = X2 - X1 + 1;
   return ( w < 0 ) ? 0 : std::size_t(w);
 }
 
 //----------------------------------------------------------------------
 inline std::size_t FRect::getHeight() const
 {
-  short h = Y2 - Y1 + 1;
+  int h = Y2 - Y1 + 1;
   return ( h < 0 ) ? 0 : std::size_t(h);
 }
 
 //----------------------------------------------------------------------
-inline short& FRect::x1_ref()
+inline int& FRect::x1_ref()
 { return X1; }
 
 //----------------------------------------------------------------------
-inline short& FRect::y1_ref()
+inline int& FRect::y1_ref()
 { return Y1; }
 
 //----------------------------------------------------------------------
-inline short& FRect::x2_ref()
+inline int& FRect::x2_ref()
 { return X2; }
 
 //----------------------------------------------------------------------
-inline short& FRect::y2_ref()
+inline int& FRect::y2_ref()
 { return Y2; }
 
 }  // namespace finalcut
diff --git a/test/fpoint-test.cpp b/test/fpoint-test.cpp
index 771031ea..6b0bc154 100644
--- a/test/fpoint-test.cpp
+++ b/test/fpoint-test.cpp
@@ -20,6 +20,8 @@
 * .                                      *
 ***********************************************************************/
 
+#include 
+
 #include 
 #include 
 #include 
@@ -136,10 +138,11 @@ void FPointTest::assignmentTest()
   CPPUNIT_ASSERT ( p2.getX() == 40 );
   CPPUNIT_ASSERT ( p2.getY() == 12 );
 
-  // Value limit exceeded
-  const finalcut::FPoint p3 (-999999,1000000);
-  CPPUNIT_ASSERT ( p3.getX() != -999999 );
-  CPPUNIT_ASSERT ( p3.getY() != 1000000 );
+  // Value limit
+  const finalcut::FPoint p3 ( std::numeric_limits::min()
+                            , std::numeric_limits::max() );
+  CPPUNIT_ASSERT ( p3.getX() == std::numeric_limits::min() );
+  CPPUNIT_ASSERT ( p3.getY() == std::numeric_limits::max() );
 }
 
 //----------------------------------------------------------------------
@@ -155,13 +158,15 @@ void FPointTest::additionAssignmentTest()
   CPPUNIT_ASSERT ( p1.getY() == 0 );
   CPPUNIT_ASSERT ( p1.isNull() );
 
-  // Value limit exceeded
-  finalcut::FPoint p2 (18000,-18000);
-  CPPUNIT_ASSERT ( p2.getX() == 18000 );
-  CPPUNIT_ASSERT ( p2.getY() == -18000 );
-  p2 += finalcut::FPoint (18000,-18000);
-  CPPUNIT_ASSERT ( p2.getX() != 36000 );
-  CPPUNIT_ASSERT ( p2.getY() != -36000 );
+  // Value limit
+  finalcut::FPoint p2 ( std::numeric_limits::max()
+                      , std::numeric_limits::min() );
+  CPPUNIT_ASSERT ( p2.getX() == std::numeric_limits::max() );
+  CPPUNIT_ASSERT ( p2.getY() == std::numeric_limits::min() );
+  p2 += finalcut::FPoint ( -std::numeric_limits::max()
+                         , -std::numeric_limits::min() );
+  CPPUNIT_ASSERT ( p2.getX() == 0 );
+  CPPUNIT_ASSERT ( p2.getY() == 0 );
 }
 
 //----------------------------------------------------------------------
@@ -202,13 +207,15 @@ void FPointTest::subtractionAssignmentTest()
   CPPUNIT_ASSERT ( p1.getY() == 0 );
   CPPUNIT_ASSERT ( p1.isNull() );
 
-  // Value limit exceeded
-  finalcut::FPoint p2 (18000,-18000);
-  CPPUNIT_ASSERT ( p2.getX() == 18000 );
-  CPPUNIT_ASSERT ( p2.getY() == -18000 );
-  p2 += finalcut::FPoint (18000,-18000);
-  CPPUNIT_ASSERT ( p2.getX() != 36000 );
-  CPPUNIT_ASSERT ( p2.getY() != -36000 );
+  // Value limit
+  finalcut::FPoint p2 ( std::numeric_limits::max()
+                      , std::numeric_limits::min() );
+  CPPUNIT_ASSERT ( p2.getX() == std::numeric_limits::max() );
+  CPPUNIT_ASSERT ( p2.getY() == std::numeric_limits::min() );
+  p2 -= finalcut::FPoint ( std::numeric_limits::max(),
+                           std::numeric_limits::min() );
+  CPPUNIT_ASSERT ( p2.getX() == 0 );
+  CPPUNIT_ASSERT ( p2.getY() == 0 );
 }
 
 //----------------------------------------------------------------------
@@ -276,8 +283,8 @@ void FPointTest::referenceTest()
   CPPUNIT_ASSERT ( p1.getX() == 2 );
   CPPUNIT_ASSERT ( p1.getY() == 2 );
 
-  short& x = p1.x_ref();
-  short& y = p1.y_ref();
+  int& x = p1.x_ref();
+  int& y = p1.y_ref();
   x += 4;
   y += 2;
   CPPUNIT_ASSERT ( p1.getX() == 6 );
diff --git a/test/frect-test.cpp b/test/frect-test.cpp
index fe3c024d..091222a4 100644
--- a/test/frect-test.cpp
+++ b/test/frect-test.cpp
@@ -363,10 +363,10 @@ void FRectTest::referenceTest()
   CPPUNIT_ASSERT ( r1.getX2() == 9 );
   CPPUNIT_ASSERT ( r1.getY2() == 19 );
 
-  short& x1 = r1.x1_ref();
-  short& y1 = r1.y1_ref();
-  short& x2 = r1.x2_ref();
-  short& y2 = r1.y2_ref();
+  int& x1 = r1.x1_ref();
+  int& y1 = r1.y1_ref();
+  int& x2 = r1.x2_ref();
+  int& y2 = r1.y2_ref();
   x1 += 2;
   y1 -= 2;
   x2 -= 3;