update libtool, try to make it work for std::streams (be VERY careful I have experienced DATACORRUPTION when trying this out (though I think it is a bug in the lib) some other code shuffling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@406 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-01-07 03:42:16 +00:00
parent 9e8edf5307
commit 7085256982
23 changed files with 628 additions and 499 deletions

View File

@ -1,3 +1,32 @@
2000-01-06 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/lyx_cb.C: began some work to remove the dependency a lot of
functions have on BufferView::text, even if not really needed.
(GetCurrentTextClass): removed this func, it only hid the
current_view.
* src/Makefile.am (lyx_DEPENDENCIES): use support/libsupport.la I
forgot this in last commit.
* src/Bullet.C (bulletEntry): use static char const *[] for the
tables, becuase of this the return arg had to change to string.
(bulletSize): ditto
(~Bullet): removed unneeded destructor
* src/BufferView.C (beforeChange): moved from lyx_cb.C
(insetSleep): moved from Buffer
(insetWakeup): moved from Buffer
(insetUnlock): moved from Buffer
* buffer.[Ch], BufferView.[Ch] + others: moved the_locking_inset
from Buffer to BufferView.
* acinclude.m4: include libtool.m4 from libtool 1.3.4.
* config/ltmain.sh: updated to version 1.3.4 of libtool
* config/ltconfig: updated to version 1.3.4 of libtool
2000-01-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2000-01-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>

View File

@ -673,6 +673,52 @@ dnl Usage: LYX_ADD_INC_DIR(var-name,dir) Adds a -I directive to variable
dnl var-name. dnl var-name.
AC_DEFUN(LYX_ADD_INC_DIR,[$1="${$1} -I$2 "]) AC_DEFUN(LYX_ADD_INC_DIR,[$1="${$1} -I$2 "])
### Check for a headers existence and location iff it exists
## This is supposed to be a generalised version of LYX_STL_STRING_FWD
## It almost works. I've tried a few variations but they give errors
## of one sort or other: bad substitution or file not found etc. The
## actual header _is_ found though and the cache variable is set however
## the reported setting (on screen) is equal to $ac_safe for some unknown
## reason.
AC_DEFUN(LYX_PATH_HEADER,
[ AC_CHECK_HEADER($1,[
ac_tr_safe=PATH_`echo $ac_safe | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
AC_CACHE_CHECK([path to $1],lyx_cv_path_$ac_safe,
[ cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
#include "confdefs.h"
#include <$1>
EOF
lyx_cv_path_$ac_safe=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep $1 2>/dev/null | \
sed -e 's/.*\(".*$1"\).*/\1/' -e "1q"`
rm -f conftest*])
AC_DEFINE_UNQUOTED(${ac_tr_safe},${lyx_cv_path_$ac_safe})])
])
### end of LYX_PATH_HEADER
### Check for stl_string_fwd.h existence and location if it exists
AC_DEFUN(LYX_STL_STRING_FWD,
[ AC_CHECK_HEADER(stl_string_fwd.h,[
AC_CACHE_CHECK([path to stl_string_fwd.h],lyx_cv_path_stl_string_fwd_h,
[ cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
#include "confdefs.h"
#include <stl_string_fwd.h>
EOF
lyx_cv_path_stl_string_fwd_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep 'stl_string_fwd.h' 2>/dev/null | \
sed -e 's/.*\(".*stl_string_fwd.h"\).*/\1/' -e "1q"`
rm -f conftest*])
AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h,
[define this to the location of stl_string_fwd.h to be used with #include,
NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
supplied version of the header.
e.g. <../include/stl_string_fwd.h> or better yet use an absolute path])])
])
dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)] dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
dnl if the cache file is inconsistent with the current host, dnl if the cache file is inconsistent with the current host,
@ -738,6 +784,7 @@ extern int select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func
AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5)) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5))
]) ])
### BEGIN libtool.m4
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1999 Free Software Foundation, Inc. ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
@ -774,7 +821,7 @@ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| AC_MSG_ERROR([libtool configure failed]) || AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig # Reload cache, that may have been modified by ltconfig
@ -806,13 +853,13 @@ AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_PROG_LN_S])dnl
dnl dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig. # Check for any special flags to pass to ltconfig.
# libtool_flags="--cache-file=$cache_file"
# the following will cause an existing older ltconfig to fail, so
# we ignore this at the expense of the cache file... Checking this
# will just take longer ... bummer!
#libtool_flags="--cache-file=$cache_file"
#
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
@ -829,7 +876,7 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good # Some flags need to be propagated to the compiler or linker for good
# libtool support. # libtool support.
case "$host" in case "$lt_target" in
*-*-irix6*) *-*-irix6*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@ -1045,7 +1092,6 @@ else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AC_PROG_LD_GNU AC_PROG_LD_GNU
]) ])
@ -1091,14 +1137,13 @@ else
fi]) fi])
NM="$ac_cv_path_NM" NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM]) AC_MSG_RESULT([$NM])
AC_SUBST(NM)
]) ])
# AC_CHECK_LIBM - check for math library # AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM, AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl [AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM= LIBM=
case "$host" in case "$lt_target" in
*-*-beos* | *-*-cygwin*) *-*-beos* | *-*-cygwin*)
# These system don't have libm # These system don't have libm
;; ;;
@ -1112,54 +1157,6 @@ case "$host" in
esac esac
]) ])
### Check for a headers existence and location iff it exists
## This is supposed to be a generalised version of LYX_STL_STRING_FWD
## It almost works. I've tried a few variations but they give errors
## of one sort or other: bad substitution or file not found etc. The
## actual header _is_ found though and the cache variable is set however
## the reported setting (on screen) is equal to $ac_safe for some unknown
## reason.
AC_DEFUN(LYX_PATH_HEADER,
[ AC_CHECK_HEADER($1,[
ac_tr_safe=PATH_`echo $ac_safe | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
AC_CACHE_CHECK([path to $1],lyx_cv_path_$ac_safe,
[ cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
#include "confdefs.h"
#include <$1>
EOF
lyx_cv_path_$ac_safe=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep $1 2>/dev/null | \
sed -e 's/.*\(".*$1"\).*/\1/' -e "1q"`
rm -f conftest*])
AC_DEFINE_UNQUOTED(${ac_tr_safe},${lyx_cv_path_$ac_safe})])
])
### end of LYX_PATH_HEADER
### Check for stl_string_fwd.h existence and location if it exists
AC_DEFUN(LYX_STL_STRING_FWD,
[ AC_CHECK_HEADER(stl_string_fwd.h,[
AC_CACHE_CHECK([path to stl_string_fwd.h],lyx_cv_path_stl_string_fwd_h,
[ cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
#include "confdefs.h"
#include <stl_string_fwd.h>
EOF
lyx_cv_path_stl_string_fwd_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep 'stl_string_fwd.h' 2>/dev/null | \
sed -e 's/.*\(".*stl_string_fwd.h"\).*/\1/' -e "1q"`
rm -f conftest*])
AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h,
[define this to the location of stl_string_fwd.h to be used with #include,
NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
supplied version of the header.
e.g. <../include/stl_string_fwd.h> or better yet use an absolute path])])
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to # the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
@ -1219,6 +1216,8 @@ AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl ifelse([AC_DISABLE_FAST_INSTALL])dnl
### END libtool.m4
# Macro to add for using GNU gettext. # Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995. # Ulrich Drepper <drepper@cygnus.com>, 1995.
# #

View File

@ -53,7 +53,7 @@ fi
# Find the correct PATH separator. Usually this is `:', but # Find the correct PATH separator. Usually this is `:', but
# DJGPP uses `;' like DOS. # DJGPP uses `;' like DOS.
if test "X${PATH_SEPARATOR+set}" != "Xset"; then if test "X${PATH_SEPARATOR+set}" != Xset; then
UNAME=${UNAME-`uname 2>/dev/null`} UNAME=${UNAME-`uname 2>/dev/null`}
case X$UNAME in case X$UNAME in
*-DOS) PATH_SEPARATOR=';' ;; *-DOS) PATH_SEPARATOR=';' ;;
@ -63,9 +63,9 @@ fi
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
if test "X${echo_test_string+set}" != "Xset"; then if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it # find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
@ -169,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants: # Constants:
PROGRAM=ltconfig PROGRAM=ltconfig
PACKAGE=libtool PACKAGE=libtool
VERSION=1.3.3 VERSION=1.3.4
TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
rm="rm -f" rm="rm -f"
help="Try \`$progname --help' for more information." help="Try \`$progname --help' for more information."
@ -369,8 +369,8 @@ exec 5>>./config.log
# Only set LANG and LC_ALL to C if already set. # Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand # These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO). # e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
if test -n "$cache_file" && test -r "$cache_file"; then if test -n "$cache_file" && test -r "$cache_file"; then
echo "loading cache $cache_file within ltconfig" echo "loading cache $cache_file within ltconfig"
@ -462,7 +462,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some # AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems # reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke. # vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES= COLLECT_NAMES=
export COLLECT_NAMES export COLLECT_NAMES
fi fi
@ -663,7 +663,7 @@ if test "$with_gcc" = yes; then
link_static_flag='-static' link_static_flag='-static'
case "$host_os" in case "$host_os" in
beos* | irix5* | irix6* | osf3* | osf4*) beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes. # PIC is the default for these OSes.
;; ;;
aix*) aix*)
@ -718,7 +718,7 @@ else
# We can build DLLs from non-PIC. # We can build DLLs from non-PIC.
;; ;;
osf3* | osf4*) osf3* | osf4* | osf5*)
# All OSF/1 code is PIC. # All OSF/1 code is PIC.
wl='-Wl,' wl='-Wl,'
link_static_flag='-non_shared' link_static_flag='-non_shared'
@ -1187,7 +1187,7 @@ EOF
;; ;;
netbsd*) netbsd*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else else
@ -1196,7 +1196,7 @@ EOF
fi fi
;; ;;
solaris*) solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no ld_shlibs=no
cat <<EOF 1>&2 cat <<EOF 1>&2
@ -1244,7 +1244,12 @@ EOF
whole_archive_flag_spec= whole_archive_flag_spec=
;; ;;
*) *)
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' # ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
whole_archive_flag_spec=
fi
;; ;;
esac esac
fi fi
@ -1405,7 +1410,7 @@ else
old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
;; ;;
osf3* | osf4*) osf3*)
if test "$with_gcc" = yes; then if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
@ -1417,6 +1422,18 @@ else
hardcode_libdir_separator=: hardcode_libdir_separator=:
;; ;;
osf4* | osf5*) # As osf3* with the addition of the -msym flag
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
sco3.2v5*) sco3.2v5*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_shlibpath_var=no hardcode_shlibpath_var=no
@ -1461,6 +1478,18 @@ else
export_dynamic_flag_spec='-Bexport' export_dynamic_flag_spec='-Bexport'
;; ;;
sysv5*)
no_undefined_flag=' -z text'
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
archive_expsym_cmds='$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 $linkopts~$rm $lib.exp'
hardcode_libdir_flag_spec=
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
;;
uts4*) uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_flag_spec='-L$libdir'
@ -1474,16 +1503,30 @@ else
;; ;;
sysv4*MP*) sysv4*MP*)
if test -d /usr/nec ;then if test -d /usr/nec; then
# archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' hardcode_shlibpath_var=no
hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH
runpath_var=LD_RUN_PATH hardcode_runpath_var=yes
hardcode_runpath_var=yes ld_shlibs=yes
ld_shlibs=yes
fi fi
;; ;;
sysv4.2uw2*)
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
hardcode_direct=yes
hardcode_minus_L=no
hardcode_shlibpath_var=no
hardcode_runpath_var=yes
runpath_var=LD_RUN_PATH
;;
unixware7*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
*) *)
ld_shlibs=no ld_shlibs=no
;; ;;
@ -1589,11 +1632,11 @@ void nm_test_func(){}
main(){nm_test_var='a';nm_test_func();return(0);} main(){nm_test_var='a';nm_test_func();return(0);}
EOF EOF
echo "$progname:1592: checking if global_symbol_pipe works" >&5 echo "$progname:1635: checking if global_symbol_pipe works" >&5
if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
# Now try to grab the symbols. # Now try to grab the symbols.
nlist=conftest.nm nlist=conftest.nm
if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
# Try sorting and uniquifying the output. # Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then if sort "$nlist" | uniq > "$nlist"T; then
@ -1645,7 +1688,7 @@ EOF
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
LIBS="conftstm.$objext" LIBS="conftstm.$objext"
CFLAGS="$CFLAGS$no_builtin_flag" CFLAGS="$CFLAGS$no_builtin_flag"
if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
pipe_works=yes pipe_works=yes
else else
echo "$progname: failed program was:" >&5 echo "$progname: failed program was:" >&5
@ -1791,8 +1834,9 @@ beos*)
bsdi4*) bsdi4*)
version_type=linux version_type=linux
library_names_spec='${libname}.so$major ${libname}.so' need_version=no
soname_spec='${libname}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
@ -1800,6 +1844,7 @@ bsdi4*)
file_magic_test_file=/shlib/libc.so file_magic_test_file=/shlib/libc.so
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
export_dynamic_flag_spec=-rdynamic
# the default ld.so.conf also contains /usr/contrib/lib and # the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs # libtool to hard-code these into programs
@ -1845,10 +1890,9 @@ freebsd*)
need_version=yes need_version=yes
;; ;;
esac esac
finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
case "$host_os" in case "$host_os" in
freebsd2* | freebsd3.[01]*) freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes shlibpath_overrides_runpath=yes
;; ;;
*) # from 3.2 on *) # from 3.2 on
@ -1900,8 +1944,6 @@ irix5* | irix6*)
*-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;; *) libsuff= shlibsuff= libmagic=never-match;;
esac esac
# this will be overridden with pass_all, but let us keep it just in case
deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
;; ;;
esac esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
@ -1976,7 +2018,7 @@ os2*)
shlibpath_var=LIBPATH shlibpath_var=LIBPATH
;; ;;
osf3* | osf4*) osf3* | osf4* | osf5*)
version_type=osf version_type=osf
need_version=no need_version=no
soname_spec='${libname}${release}.so' soname_spec='${libname}${release}.so'
@ -2171,7 +2213,7 @@ else
if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
lt_cv_dlopen=no lt_cv_dlopen_libs= lt_cv_dlopen=no lt_cv_dlopen_libs=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "$progname:2170: checking for dlopen in -ldl" >&5 echo "$progname:2212: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2179,17 +2221,20 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2178 "ltconfig" #line 2220 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen(); char dlopen();
int main() { int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo $progname:2188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo $progname:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2208,18 +2253,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "$progname:2207: checking for dlopen" >&5 echo "$progname:2252: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2212 "ltconfig" #line 2257 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */ which can conflict with char dlopen(); below. */
#include <assert.h> #include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen(); char dlopen();
int main() { int main() {
@ -2235,7 +2283,7 @@ dlopen();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_dlopen=yes" eval "ac_cv_func_dlopen=yes"
else else
@ -2252,7 +2300,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
echo "$progname:2251: checking for dld_link in -ldld" >&5 echo "$progname:2299: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2260,17 +2308,20 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS" LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2259 "ltconfig" #line 2307 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dld_link(); char dld_link();
int main() { int main() {
dld_link() dld_link()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo $progname:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2289,18 +2340,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
echo "$progname:2288: checking for shl_load" >&5 echo "$progname:2339: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2293 "ltconfig" #line 2344 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */ which can conflict with char shl_load(); below. */
#include <assert.h> #include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load(); char shl_load();
int main() { int main() {
@ -2316,7 +2370,7 @@ shl_load();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_shl_load=yes" eval "ac_cv_func_shl_load=yes"
else else
@ -2334,7 +2388,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
echo "$progname:2333: checking for shl_load in -ldld" >&5 echo "$progname:2387: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2342,18 +2396,21 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS" LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2341 "ltconfig" #line 2395 "ltconfig"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load(); char shl_load();
int main() { int main() {
shl_load() shl_load()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo $progname:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo $progname:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2396,17 +2453,17 @@ fi
for ac_hdr in dlfcn.h; do for ac_hdr in dlfcn.h; do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "$progname:2395: checking for $ac_hdr" >&5 echo "$progname:2452: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2400 "ltconfig" #line 2457 "ltconfig"
#include <$ac_hdr> #include <$ac_hdr>
int fnord = 0; int fnord = 0;
EOF EOF
ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_compile >/dev/null 2>conftest.out"
{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2434,7 +2491,7 @@ done
LIBS="$lt_cv_dlopen_libs $LIBS" LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
echo "$progname:2433: checking whether a program can dlopen itself" >&5 echo "$progname:2490: checking whether a program can dlopen itself" >&5
if test "${lt_cv_dlopen_self+set}" = set; then if test "${lt_cv_dlopen_self+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2442,7 +2499,7 @@ else
lt_cv_dlopen_self=cross lt_cv_dlopen_self=cross
else else
cat > conftest.c <<EOF cat > conftest.c <<EOF
#line 2441 "ltconfig" #line 2498 "ltconfig"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
#include <dlfcn.h> #include <dlfcn.h>
@ -2488,7 +2545,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF EOF
if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
lt_cv_dlopen_self=yes lt_cv_dlopen_self=yes
else else
@ -2507,7 +2564,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "$lt_cv_dlopen_self" = yes; then if test "$lt_cv_dlopen_self" = yes; then
LDFLAGS="$LDFLAGS $link_static_flag" LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5 echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5
if test "${lt_cv_dlopen_self_static+set}" = set; then if test "${lt_cv_dlopen_self_static+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2515,7 +2572,7 @@ else
lt_cv_dlopen_self_static=cross lt_cv_dlopen_self_static=cross
else else
cat > conftest.c <<EOF cat > conftest.c <<EOF
#line 2514 "ltconfig" #line 2571 "ltconfig"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
#include <dlfcn.h> #include <dlfcn.h>
@ -2561,7 +2618,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF EOF
if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
lt_cv_dlopen_self_static=yes lt_cv_dlopen_self_static=yes
else else
@ -2653,7 +2710,7 @@ case "$ltmain" in
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
# #
# Copyright (C) 1996-1999 Free Software Foundation, Inc. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -2679,7 +2736,7 @@ Xsed="sed -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
### BEGIN LIBTOOL CONFIG ### BEGIN LIBTOOL CONFIG
EOF EOF
@ -2942,7 +2999,7 @@ case "$ltmain" in
# AIX sometimes has problems with the GCC collect2 program. For some # AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems # reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke. # vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES= COLLECT_NAMES=
export COLLECT_NAMES export COLLECT_NAMES
fi fi
@ -2952,6 +3009,10 @@ EOF
# Append the ltmain.sh script. # Append the ltmain.sh script.
sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
chmod +x "$ofile" chmod +x "$ofile"
;; ;;

View File

@ -54,8 +54,8 @@ modename="$progname"
# Constants. # Constants.
PROGRAM=ltmain.sh PROGRAM=ltmain.sh
PACKAGE=libtool PACKAGE=libtool
VERSION=1.3.3 VERSION=1.3.4
TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
default_mode= default_mode=
help="Try \`$progname --help' for more information." help="Try \`$progname --help' for more information."
@ -435,7 +435,7 @@ compiler."
fbsd_hideous_sh_bug=$base_compile fbsd_hideous_sh_bug=$base_compile
# All platforms use -DPIC, to notify preprocessed assembler code. # All platforms use -DPIC, to notify preprocessed assembler code.
command="$base_compile $pic_flag -DPIC $srcfile" command="$base_compile $srcfile $pic_flag -DPIC"
if test "$build_old_libs" = yes; then if test "$build_old_libs" = yes; then
lo_libobj="$libobj" lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
@ -521,9 +521,17 @@ compiler."
exit $error exit $error
fi fi
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file # Now arrange that obj and lo_libobj become the same file
$show "$LN_S $obj $lo_libobj" $show "(cd $xdir && $LN_S $baseobj $libobj)"
if $run $LN_S $obj $lo_libobj; then if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
exit 0 exit 0
else else
error=$? error=$?
@ -613,8 +621,6 @@ compiler."
# libtool link mode # libtool link mode
link) link)
modename="$modename: link" modename="$modename: link"
C_compiler="$CC" # save it, to compile generated C sources
CC="$nonopt"
case "$host" in case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2*) *-*-cygwin* | *-*-mingw* | *-*-os2*)
# It is impossible to link a dll without this setting, and # It is impossible to link a dll without this setting, and
@ -802,8 +808,8 @@ compiler."
allow_undefined=yes allow_undefined=yes
;; ;;
esac esac
compile_command="$CC" compile_command="$nonopt"
finalize_command="$CC" finalize_command="$nonopt"
compile_rpath= compile_rpath=
finalize_rpath= finalize_rpath=
@ -1851,7 +1857,7 @@ compiler."
int main() { return 0; } int main() { return 0; }
EOF EOF
$rm conftest $rm conftest
$C_compiler -o conftest conftest.c $deplibs $CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then if test $? -eq 0 ; then
ldd_output=`ldd conftest` ldd_output=`ldd conftest`
for i in $deplibs; do for i in $deplibs; do
@ -1884,7 +1890,7 @@ EOF
# If $name is empty we are operating on a -L argument. # If $name is empty we are operating on a -L argument.
if test "$name" != "" ; then if test "$name" != "" ; then
$rm conftest $rm conftest
$C_compiler -o conftest conftest.c $i $CC -o conftest conftest.c $i
# Did it work? # Did it work?
if test $? -eq 0 ; then if test $? -eq 0 ; then
ldd_output=`ldd conftest` ldd_output=`ldd conftest`
@ -2047,12 +2053,19 @@ EOF
done done
# Ensure that we have .o objects for linkers which dislike .lo # Ensure that we have .o objects for linkers which dislike .lo
# (e.g. aix) incase we are running --disable-static # (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do for obj in $libobjs; do
oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test ! -f $oldobj; then if test "X$xdir" = "X$obj"; then
$show "${LN_S} $obj $oldobj" xdir="."
$run ${LN_S} $obj $oldobj || exit $? else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
if test ! -f $xdir/$oldobj; then
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
fi fi
done done
@ -2311,8 +2324,16 @@ EOF
# Just create a symlink. # Just create a symlink.
$show $rm $libobj $show $rm $libobj
$run $rm $libobj $run $rm $libobj
$show "$LN_S $obj $libobj" xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
$run $LN_S $obj $libobj || exit $? if test "X$xdir" = "X$libobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi fi
if test -n "$gentop"; then if test -n "$gentop"; then
@ -2598,16 +2619,21 @@ static const void *lt_preloaded_setup() {
# linked before any other PIC object. But we must not use # linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in # pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*) *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in case "$compile_command " in
*" -static "*) ;; *" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
esac;;
*-*-hpux*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
esac esac
esac esac
# Now compile the dynamic symbol file. # Now compile the dynamic symbol file.
$show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files. # Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
@ -2776,7 +2802,7 @@ sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout # The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set. # if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\" relink_command=\"$relink_command\"
@ -2865,7 +2891,7 @@ else
fi" fi"
else else
echo >> $output "\ echo >> $output "\
program='$outputname$exeext' program='$outputname'
progdir=\"\$thisdir/$objdir\" progdir=\"\$thisdir/$objdir\"
" "
fi fi
@ -2995,14 +3021,21 @@ fi\
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\" eval cmds=\"$old_archive_from_new_cmds\"
else else
# Ensure that we have .o objects in place incase we decided # Ensure that we have .o objects in place in case we decided
# not to build a shared library, and have fallen back to building # not to build a shared library, and have fallen back to building
# static libs even though --disable-static was passed! # static libs even though --disable-static was passed!
for oldobj in $oldobjs; do for oldobj in $oldobjs; do
if test ! -f $oldobj; then if test ! -f $oldobj; then
obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
$show "${LN_S} $obj $oldobj" if test "X$xdir" = "X$oldobj"; then
$run ${LN_S} $obj $oldobj || exit $? xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
fi fi
done done
@ -3672,8 +3705,10 @@ libdir='$install_libdir'\
done done
if test -z "$run"; then if test -z "$run"; then
# Export the shlibpath_var. if test -n "$shlibpath_var"; then
eval "export $shlibpath_var" # Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved enviroment variables # Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then if test "${save_LC_ALL+set}" = set; then
@ -3690,8 +3725,10 @@ libdir='$install_libdir'\
exit 1 exit 1
else else
# Display what would be done. # Display what would be done.
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" if test -n "$shlibpath_var"; then
$echo "export $shlibpath_var" eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
$echo "$cmd$args" $echo "$cmd$args"
exit 0 exit 0
fi fi

View File

@ -53,7 +53,6 @@ void sigchldhandler(pid_t pid, int * status);
extern void SetXtermCursor(Window win); extern void SetXtermCursor(Window win);
extern bool input_prohibited; extern bool input_prohibited;
extern bool selection_possible; extern bool selection_possible;
extern void BeforeChange();
extern char ascii_type; extern char ascii_type;
extern int UnlockInset(UpdatableInset * inset); extern int UnlockInset(UpdatableInset * inset);
extern void ToggleFloat(); extern void ToggleFloat();
@ -85,6 +84,8 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos,
fl_set_focus_object(owner_->getForm(), work_area); fl_set_focus_object(owner_->getForm(), work_area);
work_area_focus = true; work_area_focus = true;
lyx_focus = false; lyx_focus = false;
the_locking_inset = 0;
inset_slept = false;
} }
@ -208,7 +209,7 @@ void BufferView::buffer(Buffer * b)
{ {
lyxerr[Debug::INFO] << "Setting buffer in BufferView" << endl; lyxerr[Debug::INFO] << "Setting buffer in BufferView" << endl;
if (buffer_) { if (buffer_) {
buffer_->InsetSleep(); insetSleep();
buffer_->delUser(this); buffer_->delUser(this);
// Put the old text into the TextCache. // Put the old text into the TextCache.
textcache.push_back(text); textcache.push_back(text);
@ -247,7 +248,7 @@ void BufferView::buffer(Buffer * b)
screen->first = screen->TopCursorVisible(); screen->first = screen->TopCursorVisible();
redraw(); redraw();
updateAllVisibleBufferRelatedPopups(); updateAllVisibleBufferRelatedPopups();
buffer_->InsetWakeup(); insetWakeup();
} else { } else {
lyxerr[Debug::INFO] << " No Buffer!" << endl; lyxerr[Debug::INFO] << " No Buffer!" << endl;
owner_->getMenus()->hideMenus(); owner_->getMenus()->hideMenus();
@ -477,7 +478,7 @@ void BufferView::gotoError()
return; return;
screen->HideCursor(); screen->HideCursor();
BeforeChange(); beforeChange();
update(-2); update(-2);
LyXCursor tmp; LyXCursor tmp;
@ -928,7 +929,7 @@ int BufferView::work_area_handler(FL_OBJECT * ob, int event,
break; break;
case FL_DBLCLICK: case FL_DBLCLICK:
// select a word // select a word
if (view->buffer_ && !view->buffer_->the_locking_inset) { if (!view->the_locking_inset) {
if (view->screen && ev->xbutton.button == 1) { if (view->screen && ev->xbutton.button == 1) {
view->screen->HideCursor(); view->screen->HideCursor();
view->screen->ToggleSelection(); view->screen->ToggleSelection();
@ -972,9 +973,9 @@ int BufferView::WorkAreaMotionNotify(FL_OBJECT * ob, Window,
if (!screen) return 0; if (!screen) return 0;
// Check for inset locking // Check for inset locking
if (buffer_->the_locking_inset) { if (the_locking_inset) {
LyXCursor cursor = text->cursor; LyXCursor cursor = text->cursor;
buffer_->the_locking_inset-> the_locking_inset->
InsetMotionNotify(ev->xbutton.x - ob->x - cursor.x, InsetMotionNotify(ev->xbutton.x - ob->x - cursor.x,
ev->xbutton.y - ob->y - ev->xbutton.y - ob->y -
(cursor.y), (cursor.y),
@ -1035,19 +1036,18 @@ int BufferView::WorkAreaButtonPress(FL_OBJECT * ob, Window,
if (button == 4 || button == 5) goto wheel; if (button == 4 || button == 5) goto wheel;
{ {
if (the_locking_inset) {
if (buffer_->the_locking_inset) {
// We are in inset locking mode // We are in inset locking mode
/* Check whether the inset was hit. If not reset mode, /* Check whether the inset was hit. If not reset mode,
otherwise give the event to the inset */ otherwise give the event to the inset */
if (inset_hit != 0) { if (inset_hit != 0) {
buffer_->the_locking_inset-> the_locking_inset->
InsetButtonPress(inset_x, inset_y, InsetButtonPress(inset_x, inset_y,
button); button);
return 0; return 0;
} else { } else {
UnlockInset(buffer_->the_locking_inset); UnlockInset(the_locking_inset);
} }
} }
@ -1194,13 +1194,13 @@ int BufferView::WorkAreaButtonRelease(FL_OBJECT * ob, Window ,
int inset_y = y; int inset_y = y;
Inset * inset_hit = checkInsetHit(inset_x, inset_y); Inset * inset_hit = checkInsetHit(inset_x, inset_y);
if (buffer_->the_locking_inset) { if (the_locking_inset) {
// We are in inset locking mode. // We are in inset locking mode.
/* LyX does a kind of work-area grabbing for insets. /* LyX does a kind of work-area grabbing for insets.
Only a ButtonPress Event outside the inset will Only a ButtonPress Event outside the inset will
force a InsetUnlock. */ force a InsetUnlock. */
buffer_->the_locking_inset-> the_locking_inset->
InsetButtonRelease(inset_x, inset_y, InsetButtonRelease(inset_x, inset_y,
ev->xbutton.button); ev->xbutton.button);
return 0; return 0;
@ -1497,23 +1497,22 @@ void BufferView::CursorToggleCB(FL_OBJECT * ob, long)
} }
if (view->lyx_focus && view->work_area_focus) { if (view->lyx_focus && view->work_area_focus) {
if (!view->buffer_->the_locking_inset) { if (!view->the_locking_inset) {
view->screen->CursorToggle(); view->screen->CursorToggle();
} else { } else {
view->buffer_->the_locking_inset-> view->the_locking_inset->
ToggleInsetCursor(); ToggleInsetCursor();
} }
goto set_timer_and_return; goto set_timer_and_return;
} else { } else {
// Make sure that the cursor is visible. // Make sure that the cursor is visible.
if (!view->buffer_->the_locking_inset) { if (!view->the_locking_inset) {
view->screen->ShowCursor(); view->screen->ShowCursor();
} else { } else {
if (!view->buffer_->the_locking_inset->isCursorVisible()) if (!view->the_locking_inset->isCursorVisible())
view->buffer_->the_locking_inset-> view->the_locking_inset->
ToggleInsetCursor(); ToggleInsetCursor();
} }
// This is only run when work_area_focus or lyx_focus is false. // This is only run when work_area_focus or lyx_focus is false.
Window tmpwin; Window tmpwin;
int tmp; int tmp;
@ -1558,7 +1557,7 @@ int BufferView::WorkAreaSelectionNotify(FL_OBJECT *, Window win,
unsigned char * uc = 0; unsigned char * uc = 0;
int tmpint; int tmpint;
screen->HideCursor(); screen->HideCursor();
BeforeChange(); beforeChange();
if (event->xselection.type == XA_STRING if (event->xselection.type == XA_STRING
&& event->xselection.property) { && event->xselection.property) {
@ -1665,6 +1664,14 @@ bool BufferView::available() const
} }
void BufferView::beforeChange()
{
getScreen()->ToggleSelection();
text->ClearSelection();
FreeUpdateTimer();
}
void BufferView::savePosition() void BufferView::savePosition()
{ {
backstack.push(buffer()->fileName(), backstack.push(buffer()->fileName(),
@ -1680,7 +1687,7 @@ void BufferView::restorePosition()
int x, y; int x, y;
string fname = backstack.pop(&x, &y); string fname = backstack.pop(&x, &y);
BeforeChange(); beforeChange();
Buffer * b = bufferlist.exists(fname) ? Buffer * b = bufferlist.exists(fname) ?
bufferlist.getBuffer(fname) : bufferlist.getBuffer(fname) :
bufferlist.loadLyXFile(fname); // don't ask, just load it bufferlist.loadLyXFile(fname); // don't ask, just load it
@ -1742,3 +1749,33 @@ void BufferView::smallUpdate(signed char f)
} }
} }
} }
void BufferView::insetSleep()
{
if (the_locking_inset && !inset_slept) {
the_locking_inset->GetCursorPos(slx, sly);
the_locking_inset->InsetUnlock();
inset_slept = true;
}
}
void BufferView::insetWakeup()
{
if (the_locking_inset && inset_slept) {
the_locking_inset->Edit(slx, sly);
inset_slept = false;
}
}
void BufferView::insetUnlock()
{
if (the_locking_inset) {
if (!inset_slept) the_locking_inset->InsetUnlock();
the_locking_inset = 0;
text->FinishUndo();
inset_slept = false;
}
}

View File

@ -72,6 +72,8 @@ public:
fl_set_timer(timer_cursor, 0.4); fl_set_timer(timer_cursor, 0.4);
return screen; return screen;
} }
///
void beforeChange();
/// ///
void savePosition(); void savePosition();
/// ///
@ -80,6 +82,20 @@ public:
This should be private...but not yet. (Lgb) This should be private...but not yet. (Lgb)
*/ */
LyXText * text; LyXText * text;
///
UpdatableInset * the_locking_inset;
///
bool inset_slept;
///
int slx;
///
int sly;
///
void insetUnlock();
///
void insetSleep();
///
void insetWakeup();
private: private:
/// Update pixmap of screen /// Update pixmap of screen
void updateScreen(); void updateScreen();

View File

@ -101,14 +101,14 @@ void Bullet::generateText()
} }
string const & Bullet::bulletSize(const short & s) string Bullet::bulletSize(const short & s)
{ {
// use a parameter rather than hard code `size' in here // use a parameter rather than hard code `size' in here
// in case some future function may want to retrieve // in case some future function may want to retrieve
// an arbitrary entry. // an arbitrary entry.
// See additional comments in bulletEntry() below. // See additional comments in bulletEntry() below.
static string const BulletSize[SIZEMAX] = { static char const * BulletSize[SIZEMAX] = {
"\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
"\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge" "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"
}; };
@ -117,7 +117,7 @@ string const & Bullet::bulletSize(const short & s)
} }
string const & Bullet::bulletEntry(const short & f, const short & c) string Bullet::bulletEntry(const short & f, const short & c)
{ {
// Despite how this may at first appear the static local variables // Despite how this may at first appear the static local variables
// are only initialized once.. // are only initialized once..
@ -131,7 +131,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
// The single 2-dim array had to be changed to multiple 1-dim arrays // The single 2-dim array had to be changed to multiple 1-dim arrays
// to get around a compiler bug in an earler version of gcc (< 2.7.2.1) // to get around a compiler bug in an earler version of gcc (< 2.7.2.1)
// static string const BulletPanels[FONTMAX][CHARMAX] = { // static string const BulletPanels[FONTMAX][CHARMAX] = {
static string const BulletPanel0[CHARMAX] = { static char const * BulletPanel0[CHARMAX] = {
/* standard */ /* standard */
"\\normalfont\\bfseries{--}", "\\(\\vdash\\)", "\\normalfont\\bfseries{--}", "\\(\\vdash\\)",
"\\(\\dashv\\)", "\\(\\flat\\)", "\\(\\natural\\)", "\\(\\dashv\\)", "\\(\\flat\\)", "\\(\\natural\\)",
@ -148,7 +148,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\(\\rightharpoonup\\)", "\\(\\rightharpoondown\\)", "\\(\\rightharpoonup\\)", "\\(\\rightharpoondown\\)",
"\\(\\Rightarrow\\)", "\\(\\succ\\)" "\\(\\Rightarrow\\)", "\\(\\succ\\)"
}; };
static string const BulletPanel1[CHARMAX] = { static char const * BulletPanel1[CHARMAX] = {
/* amssymb */ /* amssymb */
"\\(\\Rrightarrow\\)", "\\(\\rightarrowtail\\)", "\\(\\Rrightarrow\\)", "\\(\\rightarrowtail\\)",
"\\(\\twoheadrightarrow\\)", "\\(\\rightsquigarrow\\)", "\\(\\twoheadrightarrow\\)", "\\(\\rightsquigarrow\\)",
@ -167,7 +167,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\(\\blacktriangledown\\)", "\\(\\blacklozenge\\)", "\\(\\blacktriangledown\\)", "\\(\\blacklozenge\\)",
"\\(\\blacksquare\\)" "\\(\\blacksquare\\)"
}; };
static string const BulletPanel2[CHARMAX] = { static char const * BulletPanel2[CHARMAX] = {
/* psnfss1 */ /* psnfss1 */
"\\ding{108}", "\\ding{109}", "\\ding{108}", "\\ding{109}",
"\\ding{119}", "\\Pisymbol{psy}{197}", "\\ding{119}", "\\Pisymbol{psy}{197}",
@ -188,7 +188,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{166}", "\\ding{167}", "\\ding{166}", "\\ding{167}",
"\\ding{226}", "\\ding{227}" "\\ding{226}", "\\ding{227}"
}; };
static string const BulletPanel3[CHARMAX] = { static char const * BulletPanel3[CHARMAX] = {
/* psnfss2 */ /* psnfss2 */
"\\ding{37}", "\\ding{38}", "\\ding{37}", "\\ding{38}",
"\\ding{34}", "\\ding{36}", "\\ding{34}", "\\ding{36}",
@ -209,7 +209,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{171}", "\\ding{168}", "\\ding{171}", "\\ding{168}",
"\\ding{169}", "\\ding{170}" "\\ding{169}", "\\ding{170}"
}; };
static string const BulletPanel4[CHARMAX] = { static char const * BulletPanel4[CHARMAX] = {
/* psnfss3 */ /* psnfss3 */
"\\ding{65}", "\\ding{76}", "\\ding{65}", "\\ding{76}",
"\\ding{75}", "\\ding{72}", "\\ding{75}", "\\ding{72}",
@ -230,7 +230,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{102}", "\\ding{96}", "\\ding{102}", "\\ding{96}",
"\\ding{95}", "\\ding{97}" "\\ding{95}", "\\ding{97}"
}; };
static string const BulletPanel5[CHARMAX] = { static char const * BulletPanel5[CHARMAX] = {
/* psnfss4 */ /* psnfss4 */
"\\ding{223}", "\\ding{224}", "\\ding{223}", "\\ding{224}",
"\\ding{225}", "\\ding{232}", "\\ding{225}", "\\ding{232}",
@ -252,7 +252,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{231}", "\\Pisymbol{psy}{45}" "\\ding{231}", "\\Pisymbol{psy}{45}"
}; /* string const BulletPanels[][] */ }; /* string const BulletPanels[][] */
static string const * BulletPanels[FONTMAX] = { static char const ** BulletPanels[FONTMAX] = {
BulletPanel0, BulletPanel1, BulletPanel0, BulletPanel1,
BulletPanel2, BulletPanel3, BulletPanel2, BulletPanel3,
BulletPanel4, BulletPanel5 BulletPanel4, BulletPanel5

View File

@ -32,9 +32,6 @@ public:
/// ///
Bullet(string const &); Bullet(string const &);
///
~Bullet();
/// ///
void setCharacter(const int); void setCharacter(const int);
/// ///
@ -116,9 +113,9 @@ private:
/// ///
void generateText(); void generateText();
/// ///
static string const & bulletSize(const short &); static string bulletSize(const short &);
/// ///
static string const & bulletEntry(const short &, const short &); static string bulletEntry(const short &, const short &);
/// ///
short font; short font;
@ -158,10 +155,6 @@ inline Bullet::Bullet(string const & t)
} }
inline Bullet::~Bullet()
{}
inline void Bullet::setCharacter(const int c) inline void Bullet::setCharacter(const int c)
{ {
if (c < MIN || c >= CHARMAX) { if (c < MIN || c >= CHARMAX) {

View File

@ -3,7 +3,7 @@ SUBDIRS = mathed insets support
DISTCLEANFILES = libintl.h config.h DISTCLEANFILES = libintl.h config.h
MAINTAINERCLEANFILES = Makefile.in config.h.in MAINTAINERCLEANFILES = Makefile.in config.h.in
bin_PROGRAMS = lyx bin_PROGRAMS = lyx
lyx_DEPENDENCIES = mathed/libmathed.o insets/libinsets.o support/libsupport.o lyx_DEPENDENCIES = mathed/libmathed.o insets/libinsets.o support/libsupport.la
lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS)
EXTRA_DIST = config.h.in stamp-h.in cheaders EXTRA_DIST = config.h.in stamp-h.in cheaders
ETAGS_ARGS = --c++ ETAGS_ARGS = --c++

View File

@ -16,7 +16,6 @@
extern FD_form_paragraph_extra * fd_form_paragraph_extra; extern FD_form_paragraph_extra * fd_form_paragraph_extra;
extern BufferView * current_view; extern BufferView * current_view;
extern void BeforeChange();
static bool CheckInputWidth(); static bool CheckInputWidth();
inline void DeactivateParagraphExtraButtons () inline void DeactivateParagraphExtraButtons ()

View File

@ -17,7 +17,6 @@
#include "lyxtext.h" #include "lyxtext.h"
#include "layout.h" #include "layout.h"
extern void BeforeChange();
// Prototypes // Prototypes
extern FD_form_table_options * fd_form_table_options; extern FD_form_table_options * fd_form_table_options;
@ -423,7 +422,7 @@ void TableOptionsCB(FL_OBJECT * ob, long)
if (current_view->available()) { if (current_view->available()) {
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
if (!current_view->text->selection){ if (!current_view->text->selection){
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
} }
if ((num == LyXTable::SET_SPECIAL_COLUMN) || if ((num == LyXTable::SET_SPECIAL_COLUMN) ||
@ -474,7 +473,7 @@ void SetPWidthCB(FL_OBJECT * ob, long)
if (current_view->available()){ if (current_view->available()){
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
if (!current_view->text->selection) { if (!current_view->text->selection) {
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
} }
current_view->text->TableFeatures(LyXTable::SET_PWIDTH, str); current_view->text->TableFeatures(LyXTable::SET_PWIDTH, str);

View File

@ -101,8 +101,6 @@ using std::setw;
// all these externs should eventually be removed. // all these externs should eventually be removed.
extern BufferList bufferlist; extern BufferList bufferlist;
extern unsigned char GetCurrentTextClass();
extern void BeforeChange();
extern void MenuExport(Buffer *, string const &); extern void MenuExport(Buffer *, string const &);
extern LyXAction lyxaction; extern LyXAction lyxaction;
@ -121,14 +119,12 @@ Buffer::Buffer(string const & file, LyXRC * lyxrc, bool ronly)
filename = file; filename = file;
filepath = OnlyPath(file); filepath = OnlyPath(file);
paragraph = 0; paragraph = 0;
the_locking_inset = 0;
lyx_clean = true; lyx_clean = true;
bak_clean = true; bak_clean = true;
dvi_clean_orgd = false; // Heinrich Bauer, 23/03/98 dvi_clean_orgd = false; // Heinrich Bauer, 23/03/98
dvi_clean_tmpd = false; // Heinrich Bauer, 23/03/98 dvi_clean_tmpd = false; // Heinrich Bauer, 23/03/98
dep_clean = 0; dep_clean = 0;
read_only = ronly; read_only = ronly;
inset_slept = false;
users = 0; users = 0;
lyxvc.buffer(this); lyxvc.buffer(this);
if (read_only || (lyxrc && lyxrc->use_tempdir)) { if (read_only || (lyxrc && lyxrc->use_tempdir)) {
@ -204,18 +200,6 @@ void Buffer::fileName(string const & newfile)
} }
// candidate for move to BufferView
void Buffer::InsetUnlock()
{
if (the_locking_inset) {
if (!inset_slept) the_locking_inset->InsetUnlock();
the_locking_inset = 0;
users->text->FinishUndo();
inset_slept = false;
}
}
// candidate for move to BufferView // candidate for move to BufferView
// Inserts a file into current document // Inserts a file into current document
bool Buffer::insertLyXFile(string const & filen) bool Buffer::insertLyXFile(string const & filen)
@ -241,7 +225,7 @@ bool Buffer::insertLyXFile(string const & filen)
return false; return false;
} }
BeforeChange(); users->beforeChange();
ifstream ifs(fname.c_str()); ifstream ifs(fname.c_str());
if (!ifs) { if (!ifs) {
@ -1577,7 +1561,10 @@ void Buffer::makeLaTeXFile(string const & fname,
bool nice, bool only_body) bool nice, bool only_body)
{ {
lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl; lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl;
params.textclass = GetCurrentTextClass();
// How the **** can this be needed?
//params.textclass = current_view->buffer()->params.textclass;
niceFile = nice; // this will be used by Insetincludes. niceFile = nice; // this will be used by Insetincludes.
tex_code_break_column = lyxrc->ascii_linelen; tex_code_break_column = lyxrc->ascii_linelen;
@ -2191,7 +2178,7 @@ void Buffer::makeLinuxDocFile(string const & fname, int column)
while (par) { while (par) {
int desc_on = 0; /* description mode*/ int desc_on = 0; /* description mode*/
LyXLayout const & style = LyXLayout const & style =
textclasslist.Style(GetCurrentTextClass(), textclasslist.Style(users->buffer()->params.textclass,
par->layout); par->layout);
par->AutoDeleteInsets(); par->AutoDeleteInsets();
@ -2774,7 +2761,7 @@ void Buffer::makeDocBookFile(string const & fname, int column)
while (par) { while (par) {
int desc_on= 0; /* description mode*/ int desc_on= 0; /* description mode*/
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(users->buffer()->params.textclass,
par->layout); par->layout);
par->AutoDeleteInsets(); par->AutoDeleteInsets();
@ -3766,7 +3753,7 @@ void Buffer::insertInset(Inset * inset, string const & lout,
users->text->SetCursorParUndo(); users->text->SetCursorParUndo();
users->text->FreezeUndo(); users->text->FreezeUndo();
BeforeChange(); users->beforeChange();
if (!lout.empty()) { if (!lout.empty()) {
users->update(-2); users->update(-2);
users->text->BreakParagraph(); users->text->BreakParagraph();
@ -3809,7 +3796,7 @@ void Buffer::insertInset(Inset * inset, string const & lout,
// candidate for move to BufferView // candidate for move to BufferView
void Buffer::open_new_inset(UpdatableInset * new_inset) void Buffer::open_new_inset(UpdatableInset * new_inset)
{ {
BeforeChange(); users->beforeChange();
users->text->FinishUndo(); users->text->FinishUndo();
insertInset(new_inset); insertInset(new_inset);
users->text->CursorLeft(); users->text->CursorLeft();
@ -3950,7 +3937,7 @@ bool Buffer::gotoLabel(string const & label)
while ((inset = par->ReturnNextInsetPointer(pos))){ while ((inset = par->ReturnNextInsetPointer(pos))){
for (int i = 0; i < inset->GetNumberOfLabels(); i++) { for (int i = 0; i < inset->GetNumberOfLabels(); i++) {
if (label == inset->getLabel(i)) { if (label == inset->getLabel(i)) {
BeforeChange(); users->beforeChange();
users->text->SetCursor(par, pos); users->text->SetCursor(par, pos);
users->text->sel_cursor = users->text->cursor; users->text->sel_cursor = users->text->cursor;
users->update(0); users->update(0);

View File

@ -333,9 +333,6 @@ public:
*/ */
LyXParagraph * paragraph; LyXParagraph * paragraph;
/// per view not per buffer?
UpdatableInset * the_locking_inset;
/// RCS object /// RCS object
LyXVC lyxvc; LyXVC lyxvc;
@ -349,22 +346,6 @@ public:
doing a 'nice' LaTeX file */ doing a 'nice' LaTeX file */
bool niceFile; bool niceFile;
///
void InsetUnlock();
///
inline void InsetSleep();
///
inline void InsetWakeup();
///
bool inset_slept;
///
int slx;
///
int sly;
private: private:
/// ///
void insertErrors(TeXErrors &); void insertErrors(TeXErrors &);
@ -449,27 +430,6 @@ private:
}; };
inline
void Buffer::InsetSleep()
{
if (the_locking_inset && !inset_slept) {
the_locking_inset->GetCursorPos(slx, sly);
the_locking_inset->InsetUnlock();
inset_slept = true;
}
}
inline
void Buffer::InsetWakeup()
{
if (the_locking_inset && inset_slept) {
the_locking_inset->Edit(slx, sly);
inset_slept = false;
}
}
inline inline
void Buffer::setParentName(string const & name) void Buffer::setParentName(string const & name)
{ {

View File

@ -41,7 +41,6 @@ using std::ios;
#include "LyXView.h" #include "LyXView.h"
extern BufferView * current_view; extern BufferView * current_view;
extern void BeforeChange();
extern int RunLinuxDoc(int, string const &); extern int RunLinuxDoc(int, string const &);
// //
@ -250,7 +249,7 @@ void BufferList::resize()
bool BufferList::close(Buffer * buf) bool BufferList::close(Buffer * buf)
{ {
buf->InsetUnlock(); buf->getUser()->insetUnlock();
if (buf->paragraph && !buf->isLyxClean() && !quitting) { if (buf->paragraph && !buf->isLyxClean() && !quitting) {
ProhibitInput(); ProhibitInput();
@ -326,8 +325,8 @@ int BufferList::unlockInset(UpdatableInset * inset)
if (!inset) return 1; if (!inset) return 1;
for(BufferStorage::iterator it = bstore.begin(); for(BufferStorage::iterator it = bstore.begin();
it != bstore.end(); ++it) { it != bstore.end(); ++it) {
if ((*it)->the_locking_inset == inset) { if ((*it)->getUser()->the_locking_inset == inset) {
(*it)->InsetUnlock(); (*it)->getUser()->insetUnlock();
return 0; return 0;
} }
} }

View File

@ -1389,8 +1389,8 @@ bool LyXTextClassList::Read ()
{ {
LyXLex lex(0, 0); LyXLex lex(0, 0);
string real_file = LibFileSearch("", "textclass.lst"); string real_file = LibFileSearch("", "textclass.lst");
lyxerr[Debug::TCLASS] << "Reading textclasses from " lyxerr[Debug::TCLASS] << "Reading textclasses from `"
<< real_file << endl; << real_file << "'" << endl;
if (real_file.empty()) { if (real_file.empty()) {
lyxerr << "LyXTextClassList::Read: unable to find " lyxerr << "LyXTextClassList::Read: unable to find "
@ -1424,7 +1424,9 @@ bool LyXTextClassList::Read ()
bool finished = false; bool finished = false;
string fname, clname, desc; string fname, clname, desc;
// Parse config-file // Parse config-file
lyxerr[Debug::TCLASS] << "Starting parsing of textclass.lst" << endl;
while (lex.IsOK() && !finished) { while (lex.IsOK() && !finished) {
lyxerr[Debug::TCLASS] << "\tline by line" << endl;
switch (lex.lex()) { switch (lex.lex()) {
case LyXLex::LEX_FEOF: case LyXLex::LEX_FEOF:
finished = true; finished = true;
@ -1454,9 +1456,10 @@ bool LyXTextClassList::Read ()
} }
} }
} }
lyxerr[Debug::TCLASS] << "End of parsing of textclass.lst" << endl;
if (classlist.size() == 0) { if (classlist.size() == 0) {
lyxerr << "LyXTextClassList::Read: no textclass found!" lyxerr << "LyXTextClassList::Read: no textclasses found!"
<< endl; << endl;
WriteAlert(_("LyX wasn't able to find any layout description!"), WriteAlert(_("LyX wasn't able to find any layout description!"),
_("Check the contents of the file \"textclass.lst\""), _("Check the contents of the file \"textclass.lst\""),

View File

@ -195,14 +195,6 @@ void MenuWriteAs(Buffer * buffer);
void MenuReload(Buffer * buf); void MenuReload(Buffer * buf);
void MenuLayoutSave(); void MenuLayoutSave();
unsigned char GetCurrentTextClass()
// Who are we asking?
// Shouldn't this question be directed to the buffer?
// Indeed it should. Asger.
{
return current_view->buffer()->params.textclass;
}
// How should this actually work? Should it prohibit input in all BufferViews, // How should this actually work? Should it prohibit input in all BufferViews,
// or just in the current one? If "just the current one", then it should be // or just in the current one? If "just the current one", then it should be
@ -294,15 +286,6 @@ void SetUpdateTimer(float time)
} }
// candidate for move to BufferView
void BeforeChange()
{
current_view->getScreen()->ToggleSelection();
current_view->text->ClearSelection();
FreeUpdateTimer();
}
// //
// Menu callbacks // Menu callbacks
// //
@ -312,27 +295,30 @@ void BeforeChange()
// //
// should be moved to lyxfunc.C // should be moved to lyxfunc.C
void MenuWrite(Buffer * buf) void MenuWrite(Buffer * buffer)
{ {
XFlush(fl_display); XFlush(fl_display);
if (!bufferlist.write(buf)) { if (!bufferlist.write(buffer)) {
string fname = buf->fileName(); string fname = buffer->fileName();
string s = MakeAbsPath(fname); string s = MakeAbsPath(fname);
if (AskQuestion(_("Save failed. Rename and try again?"), if (AskQuestion(_("Save failed. Rename and try again?"),
MakeDisplayPath(s, 50), MakeDisplayPath(s, 50),
_("(If not, document is not saved.)"))) { _("(If not, document is not saved.)"))) {
MenuWriteAs(buf); MenuWriteAs(buffer);
} }
} else { } else {
lastfiles->newFile(buf->fileName()); lastfiles->newFile(buffer->fileName());
} }
} }
// should be moved to BufferView.C // should be moved to BufferView.C
// Half of this func should be in LyXView, the rest in BufferView.
void MenuWriteAs(Buffer * buffer) void MenuWriteAs(Buffer * buffer)
{ {
if (!current_view->text) return; // Why do we require BufferView::text to be able to write a
// document? I see no point in that. (Lgb)
//if (!bv->text) return;
string fname = buffer->fileName(); string fname = buffer->fileName();
string oldname = fname; string oldname = fname;
@ -352,10 +338,12 @@ void MenuWriteAs(Buffer * buffer)
AllowInput(); AllowInput();
if (fname.empty()) { if (fname.empty()) {
current_view->owner()->getMiniBuffer()->Set(_("Canceled.")); // Can we do without this one?
#if 0
buffer->getUser()->owner()->getMiniBuffer()->Set(_("Canceled."));
#endif
return; return;
} }
// Make sure the absolute filename ends with appropriate suffix // Make sure the absolute filename ends with appropriate suffix
string s = MakeAbsPath(fname); string s = MakeAbsPath(fname);
if (!IsLyXFilename(s)) if (!IsLyXFilename(s))
@ -381,7 +369,7 @@ void MenuWriteAs(Buffer * buffer)
buffer->fileName(s); buffer->fileName(s);
buffer->markDirty(); buffer->markDirty();
current_view->owner()->getMiniBuffer()->Set(_("Document renamed to '"), buffer->getUser()->owner()->getMiniBuffer()->Set(_("Document renamed to '"),
MakeDisplayPath(s), MakeDisplayPath(s),
_("', but not saved...")); _("', but not saved..."));
} }
@ -498,8 +486,9 @@ int MenuRunChktex(Buffer * buffer)
int MakeDVIOutput(Buffer * buffer) int MakeDVIOutput(Buffer * buffer)
{ {
if (!(current_view->text)) // Who cares?
return 1; //if (!bv->text)
// return 1;
int ret = 0; int ret = 0;
@ -576,24 +565,25 @@ bool RunScript(Buffer * buffer, bool wait,
#ifdef WITH_WARNINGS #ifdef WITH_WARNINGS
#warning What should we do here? #warning What should we do here?
#endif #endif
current_view->owner()->getMiniBuffer()->Set( buffer->getUser()->owner()->getMiniBuffer()->Set(
_("Executing command:"), cmd); _("Executing command:"), cmd);
result = one.startscript(Systemcalls::System, cmd); result = one.startscript(Systemcalls::System, cmd);
} else { } else {
current_view->owner()->getMiniBuffer()->Set( buffer->getUser()->owner()->getMiniBuffer()->Set(
_("Executing command:"), cmd); _("Executing command:"), cmd);
result = one.startscript(wait ? Systemcalls::Wait result = one.startscript(wait ? Systemcalls::Wait
: Systemcalls::DontWait, cmd); : Systemcalls::DontWait, cmd);
} }
return (result == 0); return result == 0;
} }
// Returns false if we fail // Returns false if we fail
bool MenuRunDvips(Buffer * buffer, bool wait = false) bool MenuRunDvips(Buffer * buffer, bool wait = false)
{ {
if (!current_view->text) // Who cares?
return false; //if (!bv->text)
// return false;
ProhibitInput(); ProhibitInput();
@ -608,6 +598,7 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false)
string paper; string paper;
// Wrong type
char real_papersize = buffer->params.papersize; char real_papersize = buffer->params.papersize;
if (real_papersize == BufferParams::PAPER_DEFAULT) if (real_papersize == BufferParams::PAPER_DEFAULT)
real_papersize = lyxrc->default_papersize; real_papersize = lyxrc->default_papersize;
@ -678,8 +669,9 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false)
// Returns false if we fail // Returns false if we fail
bool MenuPreviewPS(Buffer * buffer) bool MenuPreviewPS(Buffer * buffer)
{ {
if (!current_view->text) // Who cares?
return false; //if (!bv->text)
// return false;
// Generate postscript file // Generate postscript file
if (!MenuRunDvips(buffer, true)) { if (!MenuRunDvips(buffer, true)) {
@ -704,8 +696,9 @@ bool MenuPreviewPS(Buffer * buffer)
void MenuFax(Buffer * buffer) void MenuFax(Buffer * buffer)
{ {
if (!current_view->text) // Who cares?
return; //if (!bv->text)
// return;
// Generate postscript file // Generate postscript file
if (!MenuRunDvips(buffer, true)) { if (!MenuRunDvips(buffer, true)) {
@ -731,11 +724,13 @@ void MenuFax(Buffer * buffer)
// Returns false if we fail // Returns false if we fail
bool MenuPreview(Buffer * buffer) bool MenuPreview(Buffer * buffer)
{ {
if (!current_view->text) // Who cares?
return false; //if (!bv->text)
// return false;
string paper; string paper;
// wrong type
char real_papersize = buffer->params.papersize; char real_papersize = buffer->params.papersize;
if (real_papersize == BufferParams::PAPER_DEFAULT) if (real_papersize == BufferParams::PAPER_DEFAULT)
real_papersize = lyxrc->default_papersize; real_papersize = lyxrc->default_papersize;
@ -792,8 +787,9 @@ bool MenuPreview(Buffer * buffer)
void MenuMakeLaTeX(Buffer * buffer) void MenuMakeLaTeX(Buffer * buffer)
{ {
if (!current_view->text) // Why care about this?
return; //if (!bv->text)
// return;
// Get LaTeX-Filename // Get LaTeX-Filename
string s = buffer->getLatexName(false); string s = buffer->getLatexName(false);
@ -803,19 +799,19 @@ void MenuMakeLaTeX(Buffer * buffer)
!AskQuestion(_("File already exists:"), !AskQuestion(_("File already exists:"),
MakeDisplayPath(s, 50), MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) { _("Do you want to overwrite the file?"))) {
current_view->owner()->getMiniBuffer()->Set(_("Canceled")); buffer->getUser()->owner()->getMiniBuffer()->Set(_("Canceled"));
return; return;
} }
if (buffer->isDocBook()) if (buffer->isDocBook())
current_view->owner()->getMiniBuffer()->Set( buffer->getUser()->owner()->getMiniBuffer()->Set(
_("DocBook does not have a latex backend")); _("DocBook does not have a latex backend"));
else { else {
if (buffer->isLinuxDoc()) if (buffer->isLinuxDoc())
RunLinuxDoc(0, buffer->fileName()); RunLinuxDoc(0, buffer->fileName());
else else
buffer->makeLaTeXFile(s, string(), true); buffer->makeLaTeXFile(s, string(), true);
current_view->owner()->getMiniBuffer()->Set( buffer->getUser()->owner()->getMiniBuffer()->Set(
_("Nice LaTeX file saved as"), MakeDisplayPath(s)); _("Nice LaTeX file saved as"), MakeDisplayPath(s));
buffer->markDviDirty(); buffer->markDviDirty();
} }
@ -824,7 +820,8 @@ void MenuMakeLaTeX(Buffer * buffer)
void MenuMakeLinuxDoc(Buffer * buffer) void MenuMakeLinuxDoc(Buffer * buffer)
{ {
if (!current_view->text) return; // Who cares?
//if (!bv->text) return;
if (!buffer->isLinuxDoc()) { if (!buffer->isLinuxDoc()) {
WriteAlert(_("Error!"), _("Document class must be linuxdoc.")); WriteAlert(_("Error!"), _("Document class must be linuxdoc."));
@ -832,31 +829,32 @@ void MenuMakeLinuxDoc(Buffer * buffer)
} }
// Get LinuxDoc-Filename // Get LinuxDoc-Filename
string s = ChangeExtension (buffer->fileName(), string s = ChangeExtension(buffer->fileName(),
".sgml", false); ".sgml", false);
FileInfo fi(s); FileInfo fi(s);
if (fi.readable() && if (fi.readable() &&
!AskQuestion(_("File already exists:"), !AskQuestion(_("File already exists:"),
MakeDisplayPath(s, 50), MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) { _("Do you want to overwrite the file?"))) {
current_view->owner()->getMiniBuffer()->Set(_("Canceled")); buffer->getUser()->owner()->getMiniBuffer()->Set(_("Canceled"));
return; return;
} }
current_view->owner()->getMiniBuffer()->Set( buffer->getUser()->owner()->getMiniBuffer()->Set(_("Building LinuxDoc SGML file `"),
_("Building LinuxDoc SGML file `"), MakeDisplayPath(s),"'..."); MakeDisplayPath(s),"'...");
buffer->makeLinuxDocFile(s, 65); buffer->makeLinuxDocFile(s, 65);
buffer->redraw(); buffer->redraw();
current_view->owner()->getMiniBuffer()->Set( buffer->getUser()->owner()->getMiniBuffer()->Set(_("LinuxDoc SGML file save as"),
_("LinuxDoc SGML file save as"), MakeDisplayPath(s)); MakeDisplayPath(s));
} }
void MenuMakeDocBook(Buffer * buffer) void MenuMakeDocBook(Buffer * buffer)
{ {
if (!current_view->text) return; // Who cares?
//if (!bv->text) return;
if (!buffer->isDocBook()) { if (!buffer->isDocBook()) {
WriteAlert(_("Error!"), WriteAlert(_("Error!"),
@ -865,31 +863,32 @@ void MenuMakeDocBook(Buffer * buffer)
} }
// Get DocBook-Filename // Get DocBook-Filename
string s = ChangeExtension (buffer->fileName(), string s = ChangeExtension(buffer->fileName(),
".sgml", false); ".sgml", false);
FileInfo fi(s); FileInfo fi(s);
if (fi.readable() && if (fi.readable() &&
!AskQuestion(_("File already exists:"), !AskQuestion(_("File already exists:"),
MakeDisplayPath(s, 50), MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) { _("Do you want to overwrite the file?"))) {
current_view->owner()->getMiniBuffer()->Set(_("Canceled")); buffer->getUser()->owner()->getMiniBuffer()->Set(_("Canceled"));
return; return;
} }
current_view->owner()->getMiniBuffer()->Set(_("Building DocBook SGML file `"), buffer->getUser()->owner()->getMiniBuffer()->Set(_("Building DocBook SGML file `"),
MakeDisplayPath(s), "'..."); MakeDisplayPath(s), "'...");
buffer->makeDocBookFile(s, 65); buffer->makeDocBookFile(s, 65);
buffer->redraw(); buffer->redraw();
current_view->owner()->getMiniBuffer()->Set(_("DocBook SGML file save as"), buffer->getUser()->owner()->getMiniBuffer()->Set(_("DocBook SGML file save as"),
MakeDisplayPath(s)); MakeDisplayPath(s));
} }
void MenuMakeAscii(Buffer * buffer) void MenuMakeAscii(Buffer * buffer)
{ {
if (!current_view->text) return; // Who cares?
//if (!bv->text) return;
/* get LaTeX-Filename */ /* get LaTeX-Filename */
string s = ChangeExtension (buffer->fileName(), string s = ChangeExtension (buffer->fileName(),
@ -900,20 +899,21 @@ void MenuMakeAscii(Buffer * buffer)
!AskQuestion(_("File already exists:"), !AskQuestion(_("File already exists:"),
MakeDisplayPath(s, 50), MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) { _("Do you want to overwrite the file?"))) {
current_view->owner()->getMiniBuffer()->Set(_("Canceled")); buffer->getUser()->owner()->getMiniBuffer()->Set(_("Canceled"));
return; return;
} }
buffer->writeFileAscii(s, lyxrc->ascii_linelen); buffer->writeFileAscii(s, lyxrc->ascii_linelen);
current_view->owner()->getMiniBuffer()->Set(_("Ascii file saved as"), MakeDisplayPath(s)); buffer->getUser()->owner()->getMiniBuffer()->Set(_("Ascii file saved as"), MakeDisplayPath(s));
} }
void MenuPrint(Buffer * buffer) void MenuPrint(Buffer * buffer)
{ {
if (!current_view->text) // Who cares?
return; //if (!bv->text)
// return;
string input_file = ChangeExtension(buffer->fileName(), string input_file = ChangeExtension(buffer->fileName(),
lyxrc->print_file_extension, lyxrc->print_file_extension,
@ -949,12 +949,12 @@ void MenuMakeHTML(Buffer * buffer)
Systemcalls one; Systemcalls one;
int res = one.startscript(Systemcalls::System, tmp); int res = one.startscript(Systemcalls::System, tmp);
if (res == 0) { if (res == 0) {
current_view->owner()->getMiniBuffer()->Set(_("Document exported as HTML to file `") buffer->getUser()->owner()->getMiniBuffer()->Set(_("Document exported as HTML to file `")
+ MakeDisplayPath(result) +'\''); + MakeDisplayPath(result) +'\'');
} else { } else {
current_view->owner()->getMiniBuffer()->Set(_("Unable to convert to HTML the file `") buffer->getUser()->owner()->getMiniBuffer()->Set(_("Unable to convert to HTML the file `")
+ MakeDisplayPath(infile) + MakeDisplayPath(infile)
+ '\''); + '\'');
} }
} }
@ -995,6 +995,7 @@ void MenuExport(Buffer * buffer, string const & extyp)
// Since the MenuPrint is a pop-up, we can't use // Since the MenuPrint is a pop-up, we can't use
// the same trick as above. (Asger) // the same trick as above. (Asger)
// MISSING: Move of ps-file :-( // MISSING: Move of ps-file :-(
// And MenuPrint should not be used for this at all...
} }
// ascii // ascii
else if (extyp == "ascii") { else if (extyp == "ascii") {
@ -1008,7 +1009,7 @@ void MenuExport(Buffer * buffer, string const & extyp)
MenuMakeHTML(buffer); MenuMakeHTML(buffer);
} }
else { else {
current_view->owner()->getMiniBuffer()->Set(_("Unknown export type: ")+ extyp); buffer->getUser()->owner()->getMiniBuffer()->Set(_("Unknown export type: ") + extyp);
} }
} }
@ -1184,7 +1185,7 @@ void InsertAsciiFile(string const & f, bool asParagraph)
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
// clear the selection // clear the selection
BeforeChange(); current_view->beforeChange();
if (!asParagraph) if (!asParagraph)
current_view->text->InsertStringA(tmppar->text); current_view->text->InsertStringA(tmppar->text);
else else
@ -1450,7 +1451,7 @@ void AllFloats(char flag, char figmar)
&& cursor.par->footnotekind != LyXParagraph::ALGORITHM))) && cursor.par->footnotekind != LyXParagraph::ALGORITHM)))
ToggleFloat(); ToggleFloat();
else else
BeforeChange(); current_view->beforeChange();
LyXCursor tmpcursor = cursor; LyXCursor tmpcursor = cursor;
cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos); cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos);
@ -2116,7 +2117,7 @@ void OpenStuff()
if (current_view->available()) { if (current_view->available()) {
current_view->owner()->getMiniBuffer()->Set(_("Open/Close...")); current_view->owner()->getMiniBuffer()->Set(_("Open/Close..."));
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
current_view->text->OpenStuff(); current_view->text->OpenStuff();
current_view->update(0); current_view->update(0);
@ -2130,7 +2131,7 @@ void ToggleFloat()
if (current_view->available()) { if (current_view->available()) {
current_view->owner()->getMiniBuffer()->Set(_("Open/Close...")); current_view->owner()->getMiniBuffer()->Set(_("Open/Close..."));
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
current_view->text->ToggleFootnote(); current_view->text->ToggleFootnote();
current_view->update(0); current_view->update(0);
@ -2149,7 +2150,7 @@ void MenuUndo()
if (current_view->available()) { if (current_view->available()) {
current_view->owner()->getMiniBuffer()->Set(_("Undo")); current_view->owner()->getMiniBuffer()->Set(_("Undo"));
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
if (!current_view->text->TextUndo()) if (!current_view->text->TextUndo())
current_view->owner()->getMiniBuffer()->Set(_("No further undo information")); current_view->owner()->getMiniBuffer()->Set(_("No further undo information"));
@ -2162,7 +2163,7 @@ void MenuUndo()
// candidate for move to BufferView // candidate for move to BufferView
void MenuRedo() void MenuRedo()
{ {
if (current_view->buffer()->the_locking_inset) { if (current_view->the_locking_inset) {
current_view->owner()->getMiniBuffer()->Set(_("Redo not yet supported in math mode")); current_view->owner()->getMiniBuffer()->Set(_("Redo not yet supported in math mode"));
return; return;
} }
@ -2170,7 +2171,7 @@ void MenuRedo()
if (current_view->available()) { if (current_view->available()) {
current_view->owner()->getMiniBuffer()->Set(_("Redo")); current_view->owner()->getMiniBuffer()->Set(_("Redo"));
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
if (!current_view->text->TextRedo()) if (!current_view->text->TextRedo())
current_view->owner()->getMiniBuffer()->Set(_("No further redo information")); current_view->owner()->getMiniBuffer()->Set(_("No further redo information"));
@ -2518,7 +2519,7 @@ extern "C" void MeltCB(FL_OBJECT *, long)
current_view->owner()->getMiniBuffer()->Set(_("Melt")); current_view->owner()->getMiniBuffer()->Set(_("Melt"));
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
current_view->text->MeltFootnoteEnvironment(); current_view->text->MeltFootnoteEnvironment();
current_view->update(1); current_view->update(1);
@ -2873,7 +2874,7 @@ extern "C" void ChoiceClassCB(FL_OBJECT * ob, long)
_("Unable to switch to new document class."), _("Unable to switch to new document class."),
_("Reverting to original document class.")); _("Reverting to original document class."));
fl_set_choice(fd_form_document->choice_class, fl_set_choice(fd_form_document->choice_class,
GetCurrentTextClass() + 1); current_view->buffer()->params.textclass + 1);
} }
AllowInput(); AllowInput();
} }
@ -3110,7 +3111,7 @@ void GotoNote()
return; return;
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
LyXCursor tmp; LyXCursor tmp;
@ -3258,7 +3259,7 @@ extern "C" void TableApplyCB(FL_OBJECT *, long)
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->update(-2); current_view->update(-2);
current_view->text->SetCursorParUndo(); current_view->text->SetCursorParUndo();
@ -3532,7 +3533,7 @@ extern "C" void FigureApplyCB(FL_OBJECT *, long)
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
current_view->update(-2); current_view->update(-2);
BeforeChange(); current_view->beforeChange();
current_view->text->SetCursorParUndo(); current_view->text->SetCursorParUndo();
current_view->text->FreezeUndo(); current_view->text->FreezeUndo();
@ -3682,7 +3683,7 @@ void SelectLastWord()
return; return;
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->text->SelectSelectedWord(); current_view->text->SelectSelectedWord();
current_view->getScreen()->ToggleSelection(false); current_view->getScreen()->ToggleSelection(false);
current_view->update(0); current_view->update(0);
@ -3696,7 +3697,7 @@ void EndOfSpellCheck()
return; return;
current_view->getScreen()->HideCursor(); current_view->getScreen()->HideCursor();
BeforeChange(); current_view->beforeChange();
current_view->text->SelectSelectedWord(); current_view->text->SelectSelectedWord();
current_view->text->ClearSelection(); current_view->text->ClearSelection();
current_view->update(0); current_view->update(0);
@ -3774,7 +3775,7 @@ extern "C" void TocSelectCB(FL_OBJECT * ob, long)
} }
if (par) { if (par) {
BeforeChange(); current_view->beforeChange();
current_view->text->SetCursor(par, 0); current_view->text->SetCursor(par, 0);
current_view->text->sel_cursor = current_view->text->sel_cursor =
current_view->text->cursor; current_view->text->cursor;
@ -4015,7 +4016,7 @@ void UpdateInset(Inset * inset, bool mark_dirty)
return; return;
/* very first check for locking insets*/ /* very first check for locking insets*/
if (current_view->buffer()->the_locking_inset == inset){ if (current_view->the_locking_inset == inset) {
if (current_view->text->UpdateInset(inset)){ if (current_view->text->UpdateInset(inset)){
current_view->update(); current_view->update();
if (mark_dirty){ if (mark_dirty){
@ -4052,8 +4053,8 @@ void UpdateInset(Inset * inset, bool mark_dirty)
otherwise 0 */ otherwise 0 */
int LockInset(UpdatableInset * inset) int LockInset(UpdatableInset * inset)
{ {
if (!current_view->buffer()->the_locking_inset && inset){ if (!current_view->the_locking_inset && inset){
current_view->buffer()->the_locking_inset = inset; current_view->the_locking_inset = inset;
return 0; return 0;
} }
return 1; return 1;
@ -4063,7 +4064,7 @@ int LockInset(UpdatableInset * inset)
// candidate for move to BufferView // candidate for move to BufferView
void ShowLockedInsetCursor(long x, long y, int asc, int desc) void ShowLockedInsetCursor(long x, long y, int asc, int desc)
{ {
if (current_view->buffer()->the_locking_inset && if (current_view->the_locking_inset &&
current_view->getScreen()){ current_view->getScreen()){
y += current_view->text->cursor.y; y += current_view->text->cursor.y;
current_view->getScreen()->ShowManualCursor(x, y, current_view->getScreen()->ShowManualCursor(x, y,
@ -4075,7 +4076,7 @@ void ShowLockedInsetCursor(long x, long y, int asc, int desc)
// candidate for move to BufferView // candidate for move to BufferView
void HideLockedInsetCursor(long x, long y, int asc, int desc) void HideLockedInsetCursor(long x, long y, int asc, int desc)
{ {
if (current_view->buffer()->the_locking_inset && if (current_view->the_locking_inset &&
current_view->getScreen()){ current_view->getScreen()){
y += current_view->text->cursor.y; y += current_view->text->cursor.y;
current_view->getScreen()->HideManualCursor(x, y, current_view->getScreen()->HideManualCursor(x, y,
@ -4087,7 +4088,7 @@ void HideLockedInsetCursor(long x, long y, int asc, int desc)
// candidate for move to BufferView // candidate for move to BufferView
void FitLockedInsetCursor(long x, long y, int asc, int desc) void FitLockedInsetCursor(long x, long y, int asc, int desc)
{ {
if (current_view->buffer()->the_locking_inset && if (current_view->the_locking_inset &&
current_view->getScreen()){ current_view->getScreen()){
y += current_view->text->cursor.y; y += current_view->text->cursor.y;
if (current_view->getScreen()->FitManualCursor(x, y, asc, desc)) if (current_view->getScreen()->FitManualCursor(x, y, asc, desc))
@ -4100,9 +4101,9 @@ void FitLockedInsetCursor(long x, long y, int asc, int desc)
int UnlockInset(UpdatableInset * inset) int UnlockInset(UpdatableInset * inset)
{ {
if (inset && if (inset &&
current_view->buffer()->the_locking_inset == inset){ current_view->the_locking_inset == inset){
inset->InsetUnlock(); inset->InsetUnlock();
current_view->buffer()->the_locking_inset = 0; current_view->the_locking_inset = 0;
current_view->text->FinishUndo(); current_view->text->FinishUndo();
return 0; return 0;
} }
@ -4113,7 +4114,7 @@ int UnlockInset(UpdatableInset * inset)
// candidate for move to BufferView // candidate for move to BufferView
void LockedInsetStoreUndo(Undo::undo_kind kind) void LockedInsetStoreUndo(Undo::undo_kind kind)
{ {
if (!current_view->buffer()->the_locking_inset) if (!current_view->the_locking_inset)
return; // shouldn't happen return; // shouldn't happen
if (kind == Undo::EDIT) // in this case insets would not be stored! if (kind == Undo::EDIT) // in this case insets would not be stored!
kind = Undo::FINISH; kind = Undo::FINISH;
@ -4127,12 +4128,11 @@ void LockedInsetStoreUndo(Undo::undo_kind kind)
void PutInsetIntoInsetUpdateList(Inset * inset) void PutInsetIntoInsetUpdateList(Inset * inset)
{ {
if (inset) { Assert(inset);
InsetUpdateStruct * tmp = new InsetUpdateStruct(); InsetUpdateStruct * tmp = new InsetUpdateStruct();
tmp->inset = inset; tmp->inset = inset;
tmp->next = InsetUpdateList; tmp->next = InsetUpdateList;
InsetUpdateList = tmp; InsetUpdateList = tmp;
}
} }

View File

@ -78,7 +78,6 @@ extern bool selection_possible;
extern kb_keymap * toplevel_keymap; extern kb_keymap * toplevel_keymap;
extern void BeforeChange();
extern void MenuWrite(Buffer *); extern void MenuWrite(Buffer *);
extern void MenuWriteAs(Buffer *); extern void MenuWriteAs(Buffer *);
extern int MenuRunLaTeX(Buffer *); extern int MenuRunLaTeX(Buffer *);
@ -89,7 +88,7 @@ extern void MenuPrint(Buffer *);
extern void MenuSendto(); extern void MenuSendto();
extern void QuitLyX(); extern void QuitLyX();
extern void MenuFax(Buffer *); extern void MenuFax(Buffer *);
extern void MenuExport(Buffer *,string const &); extern void MenuExport(Buffer *, string const &);
extern void MenuPasteSelection(char at); extern void MenuPasteSelection(char at);
extern LyXAction lyxaction; extern LyXAction lyxaction;
// (alkis) // (alkis)
@ -208,9 +207,9 @@ int LyXFunc::processKeyEvent(XEvent * ev)
// this function should be used always [asierra060396] // this function should be used always [asierra060396]
if (owner->view()->available() && if (owner->view()->available() &&
owner->buffer()->the_locking_inset && owner->view()->the_locking_inset &&
keysym_return == XK_Escape) { keysym_return == XK_Escape) {
UnlockInset(owner->buffer()->the_locking_inset); UnlockInset(owner->view()->the_locking_inset);
owner->view()->text->CursorRight(); owner->view()->text->CursorRight();
return 0; return 0;
} }
@ -521,7 +520,7 @@ string LyXFunc::Dispatch(int ac,
// If in math mode pass the control to // If in math mode pass the control to
// the math inset [asierra060396] // the math inset [asierra060396]
if (owner->view()->available() && if (owner->view()->available() &&
owner->buffer()->the_locking_inset) { owner->view()->the_locking_inset) {
if (action > 1 if (action > 1
|| (action == LFUN_UNKNOWN_ACTION || (action == LFUN_UNKNOWN_ACTION
&& keyseq.length >= -1)) { && keyseq.length >= -1)) {
@ -533,7 +532,7 @@ string LyXFunc::Dispatch(int ac,
if (action == LFUN_UNDO) { if (action == LFUN_UNDO) {
int slx, sly; int slx, sly;
UpdatableInset * inset = UpdatableInset * inset =
owner->buffer()->the_locking_inset; owner->view()->the_locking_inset;
inset->GetCursorPos(slx, sly); inset->GetCursorPos(slx, sly);
UnlockInset(inset); UnlockInset(inset);
MenuUndo(); MenuUndo();
@ -544,7 +543,7 @@ string LyXFunc::Dispatch(int ac,
} else } else
if (action == LFUN_REDO) { if (action == LFUN_REDO) {
int slx, sly; int slx, sly;
UpdatableInset * inset = owner->buffer()->the_locking_inset; UpdatableInset * inset = owner->view()->the_locking_inset;
inset->GetCursorPos(slx, sly); inset->GetCursorPos(slx, sly);
UnlockInset(inset); UnlockInset(inset);
MenuRedo(); MenuRedo();
@ -553,7 +552,7 @@ string LyXFunc::Dispatch(int ac,
inset->Edit(slx, sly); inset->Edit(slx, sly);
return string(); return string();
} else } else
if (owner->buffer()->the_locking_inset->LocalDispatch(action, argument.c_str())) if (owner->view()->the_locking_inset->LocalDispatch(action, argument.c_str()))
return string(); return string();
else { else {
setMessage(N_("Text mode")); setMessage(N_("Text mode"));
@ -658,7 +657,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_CENTER: // this is center and redraw. case LFUN_CENTER: // this is center and redraw.
BeforeChange(); owner->view()->beforeChange();
if (owner->view()->text->cursor.y > if (owner->view()->text->cursor.y >
owner->view()->getWorkArea()->h / 2) { owner->view()->getWorkArea()->h / 2) {
owner->view()->getScreen()-> owner->view()->getScreen()->
@ -1014,7 +1013,7 @@ string LyXFunc::Dispatch(int ac,
// it is the LyXView or the BufferView that should // it is the LyXView or the BufferView that should
// remember the previous buffer, not bufferlist. // remember the previous buffer, not bufferlist.
// if (owner->view()->available()){ // if (owner->view()->available()){
// BeforeChange(); // owner->view()->beforeChange();
// owner->buffer()->update(-2); // owner->buffer()->update(-2);
// } // }
// owner->view()->setBuffer(bufferlist.prev()); // owner->view()->setBuffer(bufferlist.prev());
@ -1275,7 +1274,7 @@ string LyXFunc::Dispatch(int ac,
{ {
LyXText * tmptext = owner->view()->text; LyXText * tmptext = owner->view()->text;
if(!tmptext->mark_set) if(!tmptext->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
if (tmptext->cursor.pos < tmptext->cursor.par->Last() if (tmptext->cursor.pos < tmptext->cursor.par->Last()
&& tmptext->cursor.par->GetChar(tmptext->cursor.pos) && tmptext->cursor.par->GetChar(tmptext->cursor.pos)
@ -1299,7 +1298,7 @@ string LyXFunc::Dispatch(int ac,
// This is soooo ugly. Isn`t it possible to make // This is soooo ugly. Isn`t it possible to make
// it simpler? (Lgb) // it simpler? (Lgb)
LyXText * txt = owner->view()->text; LyXText * txt = owner->view()->text;
if(!txt->mark_set) BeforeChange(); if(!txt->mark_set) owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
txt->CursorLeft(); txt->CursorLeft();
if (txt->cursor.pos < txt->cursor.par->Last() if (txt->cursor.pos < txt->cursor.par->Last()
@ -1320,7 +1319,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_UP: case LFUN_UP:
if(!owner->view()->text->mark_set) BeforeChange(); if(!owner->view()->text->mark_set) owner->view()->beforeChange();
owner->view()->update(-3); owner->view()->update(-3);
owner->view()->text->CursorUp(); owner->view()->text->CursorUp();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1330,7 +1329,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_DOWN: case LFUN_DOWN:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-3); owner->view()->update(-3);
owner->view()->text->CursorDown(); owner->view()->text->CursorDown();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1340,7 +1339,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_UP_PARAGRAPH: case LFUN_UP_PARAGRAPH:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-3); owner->view()->update(-3);
owner->view()->text->CursorUpParagraph(); owner->view()->text->CursorUpParagraph();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1350,7 +1349,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_DOWN_PARAGRAPH: case LFUN_DOWN_PARAGRAPH:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-3); owner->view()->update(-3);
owner->view()->text->CursorDownParagraph(); owner->view()->text->CursorDownParagraph();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1360,7 +1359,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_PRIOR: case LFUN_PRIOR:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-3); owner->view()->update(-3);
owner->view()->cursorPrevious(); owner->view()->cursorPrevious();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1370,7 +1369,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_NEXT: case LFUN_NEXT:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-3); owner->view()->update(-3);
owner->view()->cursorNext(); owner->view()->cursorNext();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1380,7 +1379,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_HOME: case LFUN_HOME:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorHome(); owner->view()->text->CursorHome();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1390,7 +1389,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_END: case LFUN_END:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorEnd(); owner->view()->text->CursorEnd();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1400,7 +1399,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_TAB: case LFUN_TAB:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorTab(); owner->view()->text->CursorTab();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1410,7 +1409,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_WORDRIGHT: case LFUN_WORDRIGHT:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorRightOneWord(); owner->view()->text->CursorRightOneWord();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1420,7 +1419,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_WORDLEFT: case LFUN_WORDLEFT:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorLeftOneWord(); owner->view()->text->CursorLeftOneWord();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1430,7 +1429,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_BEGINNINGBUF: case LFUN_BEGINNINGBUF:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorTop(); owner->view()->text->CursorTop();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1440,7 +1439,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_ENDBUF: case LFUN_ENDBUF:
if(!owner->view()->text->mark_set) if(!owner->view()->text->mark_set)
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(-2); owner->view()->update(-2);
owner->view()->text->CursorBottom(); owner->view()->text->CursorBottom();
owner->view()->text->FinishUndo(); owner->view()->text->FinishUndo();
@ -1564,7 +1563,7 @@ string LyXFunc::Dispatch(int ac,
// --- text changing commands ------------------------ // --- text changing commands ------------------------
case LFUN_BREAKLINE: case LFUN_BREAKLINE:
BeforeChange(); owner->view()->beforeChange();
owner->view()->text->InsertChar(LyXParagraph::META_NEWLINE); owner->view()->text->InsertChar(LyXParagraph::META_NEWLINE);
owner->view()->smallUpdate(1); owner->view()->smallUpdate(1);
SetUpdateTimer(0.01); SetUpdateTimer(0.01);
@ -1572,7 +1571,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_PROTECTEDSPACE: case LFUN_PROTECTEDSPACE:
BeforeChange(); owner->view()->beforeChange();
owner->view()->text-> owner->view()->text->
InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR); InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR);
owner->view()->smallUpdate(1); owner->view()->smallUpdate(1);
@ -1582,11 +1581,11 @@ string LyXFunc::Dispatch(int ac,
case LFUN_SETMARK: case LFUN_SETMARK:
if(owner->view()->text->mark_set) { if(owner->view()->text->mark_set) {
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(0); owner->view()->update(0);
setMessage(N_("Mark removed")); setMessage(N_("Mark removed"));
} else { } else {
BeforeChange(); owner->view()->beforeChange();
owner->view()->text->mark_set = 1; owner->view()->text->mark_set = 1;
owner->view()->update(0); owner->view()->update(0);
setMessage(N_("Mark set")); setMessage(N_("Mark set"));
@ -1688,7 +1687,7 @@ string LyXFunc::Dispatch(int ac,
/* -------> Set mark off. */ /* -------> Set mark off. */
case LFUN_MARK_OFF: case LFUN_MARK_OFF:
BeforeChange(); owner->view()->beforeChange();
owner->view()->update(0); owner->view()->update(0);
owner->view()->text->sel_cursor = owner->view()->text->sel_cursor =
owner->view()->text->cursor; owner->view()->text->cursor;
@ -1697,7 +1696,7 @@ string LyXFunc::Dispatch(int ac,
/* -------> Set mark on. */ /* -------> Set mark on. */
case LFUN_MARK_ON: case LFUN_MARK_ON:
BeforeChange(); owner->view()->beforeChange();
owner->view()->text->mark_set = 1; owner->view()->text->mark_set = 1;
owner->view()->update( 0 ); owner->view()->update( 0 );
owner->view()->text->sel_cursor = owner->view()->text->sel_cursor =
@ -1759,7 +1758,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_BREAKPARAGRAPH: case LFUN_BREAKPARAGRAPH:
{ {
BeforeChange(); owner->view()->beforeChange();
owner->view()->text->BreakParagraph(0); owner->view()->text->BreakParagraph(0);
owner->view()->smallUpdate(1); owner->view()->smallUpdate(1);
SetUpdateTimer(0.01); SetUpdateTimer(0.01);
@ -1770,7 +1769,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_BREAKPARAGRAPHKEEPLAYOUT: case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
{ {
BeforeChange(); owner->view()->beforeChange();
owner->view()->text->BreakParagraph(1); owner->view()->text->BreakParagraph(1);
owner->view()->smallUpdate(1); owner->view()->smallUpdate(1);
SetUpdateTimer(0.01); SetUpdateTimer(0.01);
@ -1787,7 +1786,7 @@ string LyXFunc::Dispatch(int ac,
LyXCursor cursor = owner->view()->text->cursor; LyXCursor cursor = owner->view()->text->cursor;
BeforeChange(); owner->view()->beforeChange();
if (cursor.pos == 0) { if (cursor.pos == 0) {
if (cursor.par->added_space_top == VSpace(VSpace::NONE)) { if (cursor.par->added_space_top == VSpace(VSpace::NONE)) {
owner->view()->text->SetParagraph owner->view()->text->SetParagraph
@ -1811,7 +1810,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_QUOTE: case LFUN_QUOTE:
BeforeChange(); owner->view()->beforeChange();
owner->view()->text->InsertChar('\"'); // This " matches the single quote in the code owner->view()->text->InsertChar('\"'); // This " matches the single quote in the code
owner->view()->smallUpdate(1); owner->view()->smallUpdate(1);
SetUpdateTimer(); SetUpdateTimer();
@ -1923,7 +1922,7 @@ string LyXFunc::Dispatch(int ac,
owner->buffer()->setCursorFromRow(row); owner->buffer()->setCursorFromRow(row);
// Recenter screen // Recenter screen
BeforeChange(); owner->view()->beforeChange();
if (owner->view()->text->cursor.y > if (owner->view()->text->cursor.y >
owner->view()->getWorkArea()->h / 2) { owner->view()->getWorkArea()->h / 2) {
owner->view()->getScreen()-> owner->view()->getScreen()->
@ -2069,7 +2068,7 @@ string LyXFunc::Dispatch(int ac,
if (owner->view()->available()) { if (owner->view()->available()) {
owner->buffer()-> owner->buffer()->
open_new_inset(new InsetFormula(false)); open_new_inset(new InsetFormula(false));
owner->buffer()-> owner->view()->
the_locking_inset->LocalDispatch(action, argument.c_str()); the_locking_inset->LocalDispatch(action, argument.c_str());
} }
} }
@ -2396,7 +2395,7 @@ string LyXFunc::Dispatch(int ac,
} }
} }
BeforeChange(); owner->view()->beforeChange();
for (string::size_type i = 0; for (string::size_type i = 0;
i < argument.length(); ++i) { i < argument.length(); ++i) {
if (greek_kb_flag) { if (greek_kb_flag) {

View File

@ -198,9 +198,12 @@ bool LyXLex::EatLine()
{ {
int i = 0; int i = 0;
unsigned char c = '\0'; unsigned char c = '\0';
char cc = 0;
while(is && c != '\n' && i != (LEX_MAX_BUFF - 1)) { while(is && c != '\n' && i != (LEX_MAX_BUFF - 1)) {
is.get(c); is.get(cc);
c = cc;
lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
<< c << "'" << endl;
if (c != '\r') if (c != '\r')
buff[i++] = c; buff[i++] = c;
} }
@ -250,15 +253,17 @@ int LyXLex::search_kw(char const * const tag) const
bool LyXLex::next(bool esc) bool LyXLex::next(bool esc)
{ {
if (!esc) { if (!esc) {
unsigned char c; // getc() returns an int unsigned char c = 0; // getc() returns an int
char cc = 0;
status = 0; status = 0;
while (is && !status) { while (is && !status) {
is.get(c); is.get(cc);
c = cc;
if (c == '#') { if (c == '#') {
// Read rest of line (fast :-) // Read rest of line (fast :-)
is.get(buff, sizeof(buff)); is.get(buff, sizeof(buff));
lyxerr[Debug::LYXLEX] << "Comment read: " << c << buff << endl; lyxerr[Debug::LYXLEX] << "Comment read: " << c
<< buff << endl;
++lineno; ++lineno;
continue; continue;
} }
@ -266,7 +271,8 @@ bool LyXLex::next(bool esc)
if (c == '\"') { if (c == '\"') {
int i = -1; int i = -1;
do { do {
is.get(c); is.get(cc);
c = cc;
if (c != '\r') if (c != '\r')
buff[++i] = c; buff[++i] = c;
} while (c != '\"' && c != '\n' && is && } while (c != '\"' && c != '\n' && is &&
@ -297,15 +303,12 @@ bool LyXLex::next(bool esc)
// the type _have_ to be unsigned. It usually a // the type _have_ to be unsigned. It usually a
// lot better to use the functions from cctype // lot better to use the functions from cctype
if (c > ' ' && is) { if (c > ' ' && is) {
#warning Verify this! (Lgb)
//if (isalnum(static_cast<unsigned char>(c)) && is) {
int i = 0; int i = 0;
do { do {
buff[i++] = c; buff[i++] = c;
is.get(c); is.get(cc);
c = cc;
} while (c > ' ' && c != ',' && is } while (c > ' ' && c != ',' && is
//} while (isalnum(static_cast<unsigned char>(c))
//&& c != ',' && is
&& (i != LEX_MAX_BUFF - 1) ); && (i != LEX_MAX_BUFF - 1) );
if (i == LEX_MAX_BUFF - 1) { if (i == LEX_MAX_BUFF - 1) {
printError("Line too long"); printError("Line too long");
@ -319,7 +322,8 @@ bool LyXLex::next(bool esc)
// possibility of "\r\n" at the end of // possibility of "\r\n" at the end of
// a line. This will stop LyX choking // a line. This will stop LyX choking
// when it expected to find a '\n' // when it expected to find a '\n'
is.get(c); is.get(cc);
c = cc;
} }
if (c == '\n') if (c == '\n')
@ -332,11 +336,13 @@ bool LyXLex::next(bool esc)
buff[0] = '\0'; buff[0] = '\0';
return false; return false;
} else { } else {
unsigned char c; // getc() returns an int unsigned char c = 0; // getc() returns an int
char cc = 0;
status = 0; status = 0;
while (is && !status) { while (is && !status) {
is.get(c); is.get(cc);
c = cc;
// skip ','s // skip ','s
if (c == ',') continue; if (c == ',') continue;
@ -347,13 +353,13 @@ bool LyXLex::next(bool esc)
do { do {
if (c == '\\') { if (c == '\\') {
// escape the next char // escape the next char
is.get(c); is.get(cc);
c = cc;
} }
buff[i++] = c; buff[i++] = c;
is.get(c); is.get(cc);
c = cc;
} while (c > ' ' && c != ',' && is } while (c > ' ' && c != ',' && is
//} while (isalnum(static_cast<unsigned char>(c))
//&& c != ',' && is
&& (i != LEX_MAX_BUFF - 1) ); && (i != LEX_MAX_BUFF - 1) );
if (i == LEX_MAX_BUFF - 1) { if (i == LEX_MAX_BUFF - 1) {
printError("Line too long"); printError("Line too long");
@ -366,7 +372,8 @@ bool LyXLex::next(bool esc)
if (c == '#') { if (c == '#') {
// Read rest of line (fast :-) // Read rest of line (fast :-)
is.get(buff, sizeof(buff)); is.get(buff, sizeof(buff));
lyxerr[Debug::LYXLEX] << "Comment read: " << c << buff << endl; lyxerr[Debug::LYXLEX] << "Comment read: " << c
<< buff << endl;
++lineno; ++lineno;
continue; continue;
} }
@ -377,11 +384,13 @@ bool LyXLex::next(bool esc)
bool escaped = false; bool escaped = false;
do { do {
escaped = false; escaped = false;
is.get(c); is.get(cc);
c = cc;
if (c == '\r') continue; if (c == '\r') continue;
if (c == '\\') { if (c == '\\') {
// escape the next char // escape the next char
is.get(c); is.get(cc);
c = cc;
escaped = true; escaped = true;
} }
buff[++i] = c; buff[++i] = c;
@ -408,19 +417,18 @@ bool LyXLex::next(bool esc)
} }
if (c > ' ' && is) { if (c > ' ' && is) {
//if (isalnum(static_cast<unsigned char>(c)) && is) {
int i = 0; int i = 0;
do { do {
if (c == '\\') { if (c == '\\') {
// escape the next char // escape the next char
is.get(c); is.get(cc);
c = cc;
//escaped = true; //escaped = true;
} }
buff[i++] = c; buff[i++] = c;
is.get(c); is.get(cc);
c = cc;
} while (c > ' ' && c != ',' && is } while (c > ' ' && c != ',' && is
//} while (isalnum(static_cast<unsigned char>(c))
//!= ',' && is
&& (i != LEX_MAX_BUFF-1) ); && (i != LEX_MAX_BUFF-1) );
if (i == LEX_MAX_BUFF-1) { if (i == LEX_MAX_BUFF-1) {
printError("Line too long"); printError("Line too long");
@ -446,27 +454,25 @@ bool LyXLex::nextToken()
{ {
status = 0; status = 0;
while (is && !status) { while (is && !status) {
unsigned char c; unsigned char c = 0;
is.get(c); char cc = 0;
is.get(cc);
c = cc;
if (c >= ' ' && is) { if (c >= ' ' && is) {
//if (isprint(static_cast<unsigned char>(c)) && is) {
int i = 0; int i = 0;
if (c == '\\') { // first char == '\\' if (c == '\\') { // first char == '\\'
do { do {
buff[i++] = c; buff[i++] = c;
is.get(c); is.get(cc);
c = cc;
} while (c > ' ' && c != '\\' && is } while (c > ' ' && c != '\\' && is
//} while (isalnum(static_cast<unsigned char>(c))
// && c != '\\' && is
&& i != (LEX_MAX_BUFF-1)); && i != (LEX_MAX_BUFF-1));
} else { } else {
do { do {
buff[i++] = c; buff[i++] = c;
is.get(c); is.get(cc);
c = cc;
} while (c >= ' ' && c != '\\' && is } while (c >= ' ' && c != '\\' && is
//} while (isprint(static_cast<unsigned char>(c))
// && c != '\\' && is
&& i != (LEX_MAX_BUFF-1)); && i != (LEX_MAX_BUFF-1));
} }

View File

@ -136,11 +136,14 @@ static void LexInitCodes()
static char LexGetArg(char lf, bool accept_spaces= false) static char LexGetArg(char lf, bool accept_spaces= false)
{ {
char rg, * p = &yytext[0]; char rg;
char * p = &yytext[0];
int bcnt = 1; int bcnt = 1;
unsigned char c; unsigned char c;
char cc;
while (yyis->good()) { while (yyis->good()) {
yyis->get(c); yyis->get(cc);
c = cc;
if (c > ' ') { if (c > ' ') {
if (!lf) lf = c; else if (!lf) lf = c; else
if (c != lf) if (c != lf)
@ -156,7 +159,8 @@ static char LexGetArg(char lf, bool accept_spaces= false)
return '\0'; return '\0';
} }
do { do {
yyis->get(c); yyis->get(cc);
c = cc;
if (c == lf) ++bcnt; if (c == lf) ++bcnt;
if (c == rg) --bcnt; if (c == rg) --bcnt;
if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt>0) *(p++) = c; if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt>0) *(p++) = c;
@ -170,11 +174,13 @@ static int yylex(void)
{ {
static int init_done = 0; static int init_done = 0;
unsigned char c; unsigned char c;
char cc;
if (!init_done) LexInitCodes(); if (!init_done) LexInitCodes();
while (yyis->good()) { while (yyis->good()) {
yyis->get(c); yyis->get(cc);
c = cc;
if (yy_mtextmode && c == ' ') { if (yy_mtextmode && c == ' ') {
yylval.i= ' '; yylval.i= ' ';
@ -187,15 +193,15 @@ static int yylex(void)
} }
if (lexcode[c] == LexComment) if (lexcode[c] == LexComment)
do yyis->get(c); while (c != '\n' % yyis->good()); // eat comments do { yyis->get(cc); c = cc; } while (c != '\n' % yyis->good()); // eat comments
if (lexcode[c] == LexDigit || lexcode[c] == LexOther || lexcode[c] == LexMathSpace) if (lexcode[c] == LexDigit || lexcode[c] == LexOther || lexcode[c] == LexMathSpace) { yylval.i = c; return LM_TK_STR; }
{ yylval.i= c; return LM_TK_STR; }
if (lexcode[c] == LexAlpha) { yylval.i= c; return LM_TK_ALPHA; } if (lexcode[c] == LexAlpha) { yylval.i= c; return LM_TK_ALPHA; }
if (lexcode[c] == LexBOP) { yylval.i= c; return LM_TK_BOP; } if (lexcode[c] == LexBOP) { yylval.i= c; return LM_TK_BOP; }
if (lexcode[c] == LexSelf) { return c; } if (lexcode[c] == LexSelf) { return c; }
if (lexcode[c] == LexArgument) { if (lexcode[c] == LexArgument) {
yyis->get(c); yyis->get(cc);
c = cc;
yylval.i = c - '0'; yylval.i = c - '0';
return LM_TK_ARGUMENT; return LM_TK_ARGUMENT;
} }
@ -203,7 +209,8 @@ static int yylex(void)
if (lexcode[c] == LexClose) { return LM_TK_CLOSE; } if (lexcode[c] == LexClose) { return LM_TK_CLOSE; }
if (lexcode[c] == LexESC) { if (lexcode[c] == LexESC) {
yyis->get(c); yyis->get(cc);
c = cc;
if (c == '\\') { return LM_TK_NEWLINE; } if (c == '\\') { return LM_TK_NEWLINE; }
if (c == '(') { yylval.i = LM_EN_INTEXT; return LM_TK_BEGIN; } if (c == '(') { yylval.i = LM_EN_INTEXT; return LM_TK_BEGIN; }
if (c == ')') { yylval.i = LM_EN_INTEXT; return LM_TK_END; } if (c == ')') { yylval.i = LM_EN_INTEXT; return LM_TK_END; }
@ -215,7 +222,7 @@ static int yylex(void)
} }
if (lexcode[c] == LexMathSpace) { if (lexcode[c] == LexMathSpace) {
int i; int i;
for (i = 0; i < 4 && c != latex_mathspace[i][0]; ++i); for (i = 0; i < 4 && static_cast<int>(c) != latex_mathspace[i][0]; ++i);
yylval.i = (i < 4) ? i: 0; yylval.i = (i < 4) ? i: 0;
return LM_TK_SPACE; return LM_TK_SPACE;
} }
@ -223,7 +230,8 @@ static int yylex(void)
char * p = &yytext[0]; char * p = &yytext[0];
while (lexcode[c] == LexAlpha || lexcode[c] == LexDigit) { while (lexcode[c] == LexAlpha || lexcode[c] == LexDigit) {
*p = c; *p = c;
yyis->get(c); yyis->get(cc);
c = cc;
p++; p++;
} }
*p = '\0'; *p = '\0';

View File

@ -39,7 +39,6 @@ using std::max;
#include "math_panel.h" #include "math_panel.h"
#include "math_parser.h" #include "math_parser.h"
extern void BeforeChange();
extern void Update(signed char); extern void Update(signed char);
extern int UnlockInset(UpdatableInset *); extern int UnlockInset(UpdatableInset *);
extern short greek_kb_flag; extern short greek_kb_flag;
@ -356,7 +355,7 @@ Bool math_insert_greek(char const c)
math_insert_symbol(s); math_insert_symbol(s);
if (greek_kb_flag<2) { if (greek_kb_flag<2) {
greek_kb_flag = 0; greek_kb_flag = 0;
UnlockInset(current_view->buffer()->the_locking_inset); UnlockInset(current_view->the_locking_inset);
} }
return True; return True;
} else } else
@ -366,16 +365,16 @@ Bool math_insert_greek(char const c)
void math_insert_symbol(char const* s) void math_insert_symbol(char const* s)
{ {
if (current_view->available()) { if (current_view->available()) {
if (!current_view->buffer()->the_locking_inset) { if (!current_view->the_locking_inset) {
InsetFormula * new_inset = new InsetFormula(); InsetFormula * new_inset = new InsetFormula();
BeforeChange(); current_view->beforeChange();
current_view->buffer()->insertInset(new_inset); current_view->buffer()->insertInset(new_inset);
// Update(1);//BUG // Update(1);//BUG
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
new_inset->InsertSymbol(s); new_inset->InsertSymbol(s);
} else } else
if (current_view->buffer()->the_locking_inset->LyxCode() == Inset::MATH_CODE) if (current_view->the_locking_inset->LyxCode() == Inset::MATH_CODE)
static_cast<InsetFormula*>(current_view->buffer()->the_locking_inset)->InsertSymbol(s); static_cast<InsetFormula*>(current_view->the_locking_inset)->InsertSymbol(s);
else else
lyxerr << "Math error: attempt to write on a wrong " lyxerr << "Math error: attempt to write on a wrong "
"class of inset." << endl; "class of inset." << endl;

View File

@ -57,7 +57,6 @@ extern void MenuLayoutSave();
extern void ShowCredits(); extern void ShowCredits();
extern void ShowCopyright(); extern void ShowCopyright();
extern void show_symbols_form(LyXFunc *); extern void show_symbols_form(LyXFunc *);
extern void BeforeChange();
extern void ProhibitInput(); extern void ProhibitInput();
extern void AllowInput(); extern void AllowInput();
extern void OpenStuff(); extern void OpenStuff();
@ -1087,7 +1086,7 @@ void Menus::ShowEditMenu(FL_OBJECT * ob, long)
if (men->currentView()->available()){ if (men->currentView()->available()){
men->currentView()->getScreen()->HideCursor(); men->currentView()->getScreen()->HideCursor();
if (!men->currentView()->text->selection){ if (!men->currentView()->text->selection){
BeforeChange(); men->currentView()->beforeChange();
men->currentView()->update(-2); men->currentView()->update(-2);
} }
men->currentView()->text-> men->currentView()->text->

View File

@ -35,7 +35,6 @@ using std::ios;
extern void addNewlineAndDepth(string & file, int const depth); // Jug 990923 extern void addNewlineAndDepth(string & file, int const depth); // Jug 990923
extern unsigned char GetCurrentTextClass(); // this should be fixed/removed
int tex_code_break_column = 72; // needs non-zero initialization. set later. int tex_code_break_column = 72; // needs non-zero initialization. set later.
// this is a bad idea, but how can LyXParagraph find its buffer to get // this is a bad idea, but how can LyXParagraph find its buffer to get
// parameters? (JMarc) // parameters? (JMarc)
@ -329,7 +328,7 @@ void LyXParagraph::writeFile(ostream & os, BufferParams & params,
void LyXParagraph::validate(LaTeXFeatures & features) void LyXParagraph::validate(LaTeXFeatures & features)
{ {
// this will be useful later // this will be useful later
LyXLayout const & layout = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & layout = textclasslist.Style(current_view->buffer()->params.textclass,
GetLayout()); GetLayout());
// check the params. // check the params.
@ -954,7 +953,7 @@ LyXFont LyXParagraph::GetFontSettings(LyXParagraph::size_type pos) const
LyXFont LyXParagraph::getFont(LyXParagraph::size_type pos) const LyXFont LyXParagraph::getFont(LyXParagraph::size_type pos) const
{ {
LyXFont tmpfont; LyXFont tmpfont;
LyXLayout const & layout = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & layout = textclasslist.Style(current_view->buffer()->params.textclass,
GetLayout()); GetLayout());
LyXParagraph::size_type main_body = 0; LyXParagraph::size_type main_body = 0;
if (layout.labeltype == LABEL_MANUAL) if (layout.labeltype == LABEL_MANUAL)
@ -983,13 +982,13 @@ LyXFont LyXParagraph::getFont(LyXParagraph::size_type pos) const
par = par->DepthHook(par_depth - 1); par = par->DepthHook(par_depth - 1);
if (par) { if (par) {
tmpfont.realize(textclasslist. tmpfont.realize(textclasslist.
Style(GetCurrentTextClass(), Style(current_view->buffer()->params.textclass,
par->GetLayout()).font); par->GetLayout()).font);
par_depth = par->GetDepth(); par_depth = par->GetDepth();
} }
} }
tmpfont.realize(textclasslist.TextClass(GetCurrentTextClass()).defaultfont()); tmpfont.realize(textclasslist.TextClass(current_view->buffer()->params.textclass).defaultfont());
return tmpfont; return tmpfont;
} }
@ -2243,7 +2242,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(string & file, TexRow & texrow,
{ {
lyxerr[Debug::LATEX] << "TeXOnePar... " << this << endl; lyxerr[Debug::LATEX] << "TeXOnePar... " << this << endl;
LyXParagraph * par = next; LyXParagraph * par = next;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass,
layout); layout);
bool further_blank_line = false; bool further_blank_line = false;
@ -2323,7 +2322,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(string & file, TexRow & texrow,
file += ' '; file += ' ';
} }
file += "\\par}"; file += "\\par}";
} else if (textclasslist.Style(GetCurrentTextClass(), } else if (textclasslist.Style(current_view->buffer()->params.textclass,
GetLayout()).isCommand()){ GetLayout()).isCommand()){
if (style.resfont.size() != font.size()) { if (style.resfont.size() != font.size()) {
file += '\\'; file += '\\';
@ -2412,7 +2411,7 @@ bool LyXParagraph::SimpleTeXOnePar(string & file, TexRow & texrow)
bool return_value = false; bool return_value = false;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), GetLayout()); LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass, GetLayout());
LyXFont basefont; LyXFont basefont;
/* maybe we have to create a optional argument */ /* maybe we have to create a optional argument */
@ -2591,7 +2590,7 @@ bool LyXParagraph::SimpleTeXOneTablePar(string & file, TexRow & texrow)
int current_cell_number = -1; int current_cell_number = -1;
LyXLayout const & style = LyXLayout const & style =
textclasslist.Style(GetCurrentTextClass(), GetLayout()); textclasslist.Style(current_view->buffer()->params.textclass, GetLayout());
LyXFont basefont = getFont(-1); // Get layout font LyXFont basefont = getFont(-1); // Get layout font
// Which font is currently active? // Which font is currently active?
LyXFont running_font = basefont; LyXFont running_font = basefont;
@ -2752,7 +2751,7 @@ bool LyXParagraph::TeXContTableRows(string & file,
char c; char c;
bool return_value = false; bool return_value = false;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass,
GetLayout()); GetLayout());
LyXFont basefont; LyXFont basefont;
@ -2927,7 +2926,7 @@ void LyXParagraph::SimpleDocBookOneTablePar(string & file, string & extra,
string emph = "emphasis"; string emph = "emphasis";
bool emph_flag = false; bool emph_flag = false;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass,
GetLayout()); GetLayout());
if (style.labeltype != LABEL_MANUAL) if (style.labeltype != LABEL_MANUAL)
@ -3099,7 +3098,7 @@ void LyXParagraph::DocBookContTableRows(string & file, string & extra,
bool emph_flag= false; bool emph_flag= false;
int char_line_count= 0; int char_line_count= 0;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass,
GetLayout()); GetLayout());
if (style.labeltype != LABEL_MANUAL) if (style.labeltype != LABEL_MANUAL)
@ -3599,7 +3598,7 @@ LyXParagraph * LyXParagraph::TeXDeeper(string & file, TexRow & texrow,
while (par && par->depth == depth) { while (par && par->depth == depth) {
if (par->IsDummy()) if (par->IsDummy())
lyxerr << "ERROR (LyXParagraph::TeXDeeper)" << endl; lyxerr << "ERROR (LyXParagraph::TeXDeeper)" << endl;
if (textclasslist.Style(GetCurrentTextClass(), if (textclasslist.Style(current_view->buffer()->params.textclass,
par->layout).isEnvironment() par->layout).isEnvironment()
|| par->pextra_type != PEXTRA_NONE) || par->pextra_type != PEXTRA_NONE)
{ {
@ -3633,7 +3632,7 @@ LyXParagraph * LyXParagraph::TeXEnvironment(string & file, TexRow & texrow,
if (IsDummy()) if (IsDummy())
lyxerr << "ERROR (LyXParagraph::TeXEnvironment)" << endl; lyxerr << "ERROR (LyXParagraph::TeXEnvironment)" << endl;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass,
layout); layout);
if (pextra_type == PEXTRA_INDENT) { if (pextra_type == PEXTRA_INDENT) {
@ -3771,7 +3770,7 @@ LyXParagraph * LyXParagraph::TeXEnvironment(string & file, TexRow & texrow,
minipage_open = false; minipage_open = false;
} }
if (par && par->depth > depth) { if (par && par->depth > depth) {
if (textclasslist.Style(GetCurrentTextClass(), if (textclasslist.Style(current_view->buffer()->params.textclass,
par->layout).isParagraph() par->layout).isParagraph()
&& !par->table && !par->table
&& !suffixIs(file, "\n\n")) { && !suffixIs(file, "\n\n")) {
@ -3905,7 +3904,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(string & file, TexRow & texrow,
"No footnote!" << endl; "No footnote!" << endl;
LyXParagraph * par = this; LyXParagraph * par = this;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), LyXLayout const & style = textclasslist.Style(current_view->buffer()->params.textclass,
previous->GetLayout()); previous->GetLayout());
if (style.needprotect && footnotekind != LyXParagraph::FOOTNOTE){ if (style.needprotect && footnotekind != LyXParagraph::FOOTNOTE){
@ -4022,7 +4021,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(string & file, TexRow & texrow,
// Process text for all floats except footnotes in body // Process text for all floats except footnotes in body
do { do {
LyXLayout const & style = LyXLayout const & style =
textclasslist.Style(GetCurrentTextClass(), textclasslist.Style(current_view->buffer()->params.textclass,
par->layout); par->layout);
if (par->IsDummy()) if (par->IsDummy())
lyxerr << "ERROR (LyXParagraph::TeXFootnote)" lyxerr << "ERROR (LyXParagraph::TeXFootnote)"
@ -4057,7 +4056,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(string & file, TexRow & texrow,
int dummy_count = 0; int dummy_count = 0;
do { do {
LyXLayout const & style = LyXLayout const & style =
textclasslist.Style(GetCurrentTextClass(), textclasslist.Style(current_view->buffer()->params.textclass,
par->layout); par->layout);
if (par->IsDummy()) if (par->IsDummy())
lyxerr << "ERROR (LyXParagraph::TeXFootnote)" lyxerr << "ERROR (LyXParagraph::TeXFootnote)"
@ -4148,7 +4147,7 @@ void LyXParagraph::SetPExtraType(int type, char const * width,
pextra_width = width; pextra_width = width;
pextra_widthp = widthp; pextra_widthp = widthp;
if (textclasslist.Style(GetCurrentTextClass(), if (textclasslist.Style(current_view->buffer()->params.textclass,
layout).isEnvironment()) { layout).isEnvironment()) {
LyXParagraph LyXParagraph
* par = this, * par = this,
@ -4191,7 +4190,7 @@ void LyXParagraph::UnsetPExtraType()
pextra_width.clear(); pextra_width.clear();
pextra_widthp.clear(); pextra_widthp.clear();
if (textclasslist.Style(GetCurrentTextClass(), if (textclasslist.Style(current_view->buffer()->params.textclass,
layout).isEnvironment()) { layout).isEnvironment()) {
LyXParagraph LyXParagraph
* par = this, * par = this,

View File

@ -1647,8 +1647,8 @@ void LyXText::TableFeatures(int feature)
return; return;
} }
case LyXTable::DELETE_ROW: case LyXTable::DELETE_ROW:
if (current_view->buffer()->the_locking_inset) if (current_view->the_locking_inset)
UnlockInset(current_view->buffer()->the_locking_inset); UnlockInset(current_view->the_locking_inset);
RemoveTableRow(&cursor); RemoveTableRow(&cursor);
RedoParagraph(); RedoParagraph();
return; return;
@ -1657,8 +1657,8 @@ void LyXText::TableFeatures(int feature)
LyXParagraph::size_type pos = 0; LyXParagraph::size_type pos = 0;
int cell_org = actCell; int cell_org = actCell;
int cell = 0; int cell = 0;
if (current_view->buffer()->the_locking_inset) if (current_view->the_locking_inset)
UnlockInset(current_view->buffer()->the_locking_inset); UnlockInset(current_view->the_locking_inset);
do { do {
if (!pos || (cursor.par->IsNewline(pos-1))){ if (!pos || (cursor.par->IsNewline(pos-1))){
if (cursor.par->table->DeleteCellIfColumnIsDeleted(cell, cell_org)){ if (cursor.par->table->DeleteCellIfColumnIsDeleted(cell, cell_org)){