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>

View File

@ -673,6 +673,52 @@ dnl Usage: LYX_ADD_INC_DIR(var-name,dir) Adds a -I directive to variable
dnl var-name.
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 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))
])
### BEGIN libtool.m4
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## 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" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${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])
# 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
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
#
# 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"
#
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
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
# libtool support.
case "$host" in
case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@ -1045,7 +1092,6 @@ else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AC_PROG_LD_GNU
])
@ -1091,14 +1137,13 @@ else
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$host" in
case "$lt_target" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
@ -1112,54 +1157,6 @@ case "$host" in
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
# the libltdl convenience library, adds --enable-ltdl-convenience to
# 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
ifelse([AC_DISABLE_FAST_INSTALL])dnl
### END libtool.m4
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#

View File

@ -53,7 +53,7 @@ fi
# Find the correct PATH separator. Usually this is `:', but
# 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`}
case X$UNAME in
*-DOS) PATH_SEPARATOR=';' ;;
@ -63,9 +63,9 @@ fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# 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
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, ...
@ -169,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
VERSION=1.3.3
TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
VERSION=1.3.4
TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
rm="rm -f"
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.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
if test -n "$cache_file" && test -r "$cache_file"; then
echo "loading cache $cache_file within ltconfig"
@ -462,7 +462,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@ -663,7 +663,7 @@ if test "$with_gcc" = yes; then
link_static_flag='-static'
case "$host_os" in
beos* | irix5* | irix6* | osf3* | osf4*)
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
aix*)
@ -718,7 +718,7 @@ else
# We can build DLLs from non-PIC.
;;
osf3* | osf4*)
osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
wl='-Wl,'
link_static_flag='-non_shared'
@ -1187,7 +1187,7 @@ EOF
;;
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_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@ -1196,7 +1196,7 @@ EOF
fi
;;
solaris*)
solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<EOF 1>&2
@ -1244,7 +1244,12 @@ EOF
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
fi
@ -1405,7 +1410,7 @@ else
old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
;;
osf3* | osf4*)
osf3*)
if test "$with_gcc" = yes; then
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'
@ -1417,6 +1422,18 @@ else
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*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_shlibpath_var=no
@ -1461,6 +1478,18 @@ else
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*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
@ -1474,16 +1503,30 @@ else
;;
sysv4*MP*)
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'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
if test -d /usr/nec; then
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
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
;;
@ -1589,11 +1632,11 @@ void nm_test_func(){}
main(){nm_test_var='a';nm_test_func();return(0);}
EOF
echo "$progname:1592: 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
echo "$progname:1635: checking if global_symbol_pipe works" >&5
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.
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.
if sort "$nlist" | uniq > "$nlist"T; then
@ -1645,7 +1688,7 @@ EOF
save_CFLAGS="$CFLAGS"
LIBS="conftstm.$objext"
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
else
echo "$progname: failed program was:" >&5
@ -1791,8 +1834,9 @@ beos*)
bsdi4*)
version_type=linux
library_names_spec='${libname}.so$major ${libname}.so'
soname_spec='${libname}.so'
need_version=no
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'
shlibpath_var=LD_LIBRARY_PATH
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
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"
export_dynamic_flag_spec=-rdynamic
# 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
# libtool to hard-code these into programs
@ -1845,10 +1890,9 @@ freebsd*)
need_version=yes
;;
esac
finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
case "$host_os" in
freebsd2* | freebsd3.[01]*)
freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes
;;
*) # from 3.2 on
@ -1900,8 +1944,6 @@ irix5* | irix6*)
*-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
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
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
@ -1976,7 +2018,7 @@ os2*)
shlibpath_var=LIBPATH
;;
osf3* | osf4*)
osf3* | osf4* | osf5*)
version_type=osf
need_version=no
soname_spec='${libname}${release}.so'
@ -2171,7 +2213,7 @@ else
if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
lt_cv_dlopen=no lt_cv_dlopen_libs=
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_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2179,17 +2221,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2178 "ltconfig"
#line 2220 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen();
int main() {
dlopen()
; return 0; }
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*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2208,18 +2253,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 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
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2212 "ltconfig"
#line 2257 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen();
int main() {
@ -2235,7 +2283,7 @@ dlopen();
; return 0; }
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*
eval "ac_cv_func_dlopen=yes"
else
@ -2252,7 +2300,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 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_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2260,17 +2308,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2259 "ltconfig"
#line 2307 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dld_link();
int main() {
dld_link()
; return 0; }
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*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2289,18 +2340,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 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
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2293 "ltconfig"
#line 2344 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load();
int main() {
@ -2316,7 +2370,7 @@ shl_load();
; return 0; }
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*
eval "ac_cv_func_shl_load=yes"
else
@ -2334,7 +2388,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
else
echo "$ac_t""no" 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_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2342,18 +2396,21 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2341 "ltconfig"
#line 2395 "ltconfig"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load();
int main() {
shl_load()
; return 0; }
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*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2396,17 +2453,17 @@ fi
for ac_hdr in dlfcn.h; do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
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
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2400 "ltconfig"
#line 2457 "ltconfig"
#include <$ac_hdr>
int fnord = 0;
EOF
ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_try="$ac_compile >/dev/null 2>conftest.out"
{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2434,7 +2491,7 @@ done
LIBS="$lt_cv_dlopen_libs $LIBS"
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
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2442,7 +2499,7 @@ else
lt_cv_dlopen_self=cross
else
cat > conftest.c <<EOF
#line 2441 "ltconfig"
#line 2498 "ltconfig"
#if HAVE_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); }
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
lt_cv_dlopen_self=yes
else
@ -2507,7 +2564,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "$lt_cv_dlopen_self" = yes; then
LDFLAGS="$LDFLAGS $link_static_flag"
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
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2515,7 +2572,7 @@ else
lt_cv_dlopen_self_static=cross
else
cat > conftest.c <<EOF
#line 2514 "ltconfig"
#line 2571 "ltconfig"
#if HAVE_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); }
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
lt_cv_dlopen_self_static=yes
else
@ -2653,7 +2710,7 @@ case "$ltmain" in
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
#
# 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
# 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
# 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
EOF
@ -2942,7 +2999,7 @@ case "$ltmain" in
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@ -2952,6 +3009,10 @@ EOF
# Append the ltmain.sh script.
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"
;;

View File

@ -54,8 +54,8 @@ modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.3.3
TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
VERSION=1.3.4
TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
default_mode=
help="Try \`$progname --help' for more information."
@ -435,7 +435,7 @@ compiler."
fbsd_hideous_sh_bug=$base_compile
# 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
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
@ -521,9 +521,17 @@ compiler."
exit $error
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
$show "$LN_S $obj $lo_libobj"
if $run $LN_S $obj $lo_libobj; then
$show "(cd $xdir && $LN_S $baseobj $libobj)"
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
exit 0
else
error=$?
@ -613,8 +621,6 @@ compiler."
# libtool link mode
link)
modename="$modename: link"
C_compiler="$CC" # save it, to compile generated C sources
CC="$nonopt"
case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2*)
# It is impossible to link a dll without this setting, and
@ -802,8 +808,8 @@ compiler."
allow_undefined=yes
;;
esac
compile_command="$CC"
finalize_command="$CC"
compile_command="$nonopt"
finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
@ -1851,7 +1857,7 @@ compiler."
int main() { return 0; }
EOF
$rm conftest
$C_compiler -o conftest conftest.c $deplibs
$CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
@ -1884,7 +1890,7 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" ; then
$rm conftest
$C_compiler -o conftest conftest.c $i
$CC -o conftest conftest.c $i
# Did it work?
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
@ -2047,12 +2053,19 @@ EOF
done
# 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
oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
if test ! -f $oldobj; then
$show "${LN_S} $obj $oldobj"
$run ${LN_S} $obj $oldobj || exit $?
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%^.*/%%'`
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
done
@ -2311,8 +2324,16 @@ EOF
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
$show "$LN_S $obj $libobj"
$run $LN_S $obj $libobj || exit $?
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
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
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
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*)
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) 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
# Now compile the dynamic symbol file.
$show "(cd $output_objdir && $C_compiler -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 $?
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$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
# 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\"
@ -2865,7 +2891,7 @@ else
fi"
else
echo >> $output "\
program='$outputname$exeext'
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
@ -2995,14 +3021,21 @@ fi\
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
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
# static libs even though --disable-static was passed!
for oldobj in $oldobjs; do
if test ! -f $oldobj; then
obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
$show "${LN_S} $obj $oldobj"
$run ${LN_S} $obj $oldobj || exit $?
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$oldobj"; then
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
done
@ -3672,8 +3705,10 @@ libdir='$install_libdir'\
done
if test -z "$run"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then
@ -3690,8 +3725,10 @@ libdir='$install_libdir'\
exit 1
else
# Display what would be done.
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
if test -n "$shlibpath_var"; then
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
$echo "$cmd$args"
exit 0
fi

View File

@ -53,7 +53,6 @@ void sigchldhandler(pid_t pid, int * status);
extern void SetXtermCursor(Window win);
extern bool input_prohibited;
extern bool selection_possible;
extern void BeforeChange();
extern char ascii_type;
extern int UnlockInset(UpdatableInset * inset);
extern void ToggleFloat();
@ -85,6 +84,8 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos,
fl_set_focus_object(owner_->getForm(), work_area);
work_area_focus = true;
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;
if (buffer_) {
buffer_->InsetSleep();
insetSleep();
buffer_->delUser(this);
// Put the old text into the TextCache.
textcache.push_back(text);
@ -247,7 +248,7 @@ void BufferView::buffer(Buffer * b)
screen->first = screen->TopCursorVisible();
redraw();
updateAllVisibleBufferRelatedPopups();
buffer_->InsetWakeup();
insetWakeup();
} else {
lyxerr[Debug::INFO] << " No Buffer!" << endl;
owner_->getMenus()->hideMenus();
@ -477,7 +478,7 @@ void BufferView::gotoError()
return;
screen->HideCursor();
BeforeChange();
beforeChange();
update(-2);
LyXCursor tmp;
@ -928,7 +929,7 @@ int BufferView::work_area_handler(FL_OBJECT * ob, int event,
break;
case FL_DBLCLICK:
// select a word
if (view->buffer_ && !view->buffer_->the_locking_inset) {
if (!view->the_locking_inset) {
if (view->screen && ev->xbutton.button == 1) {
view->screen->HideCursor();
view->screen->ToggleSelection();
@ -972,9 +973,9 @@ int BufferView::WorkAreaMotionNotify(FL_OBJECT * ob, Window,
if (!screen) return 0;
// Check for inset locking
if (buffer_->the_locking_inset) {
if (the_locking_inset) {
LyXCursor cursor = text->cursor;
buffer_->the_locking_inset->
the_locking_inset->
InsetMotionNotify(ev->xbutton.x - ob->x - cursor.x,
ev->xbutton.y - ob->y -
(cursor.y),
@ -1035,19 +1036,18 @@ int BufferView::WorkAreaButtonPress(FL_OBJECT * ob, Window,
if (button == 4 || button == 5) goto wheel;
{
if (buffer_->the_locking_inset) {
if (the_locking_inset) {
// We are in inset locking mode
/* Check whether the inset was hit. If not reset mode,
otherwise give the event to the inset */
if (inset_hit != 0) {
buffer_->the_locking_inset->
the_locking_inset->
InsetButtonPress(inset_x, inset_y,
button);
return 0;
} 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;
Inset * inset_hit = checkInsetHit(inset_x, inset_y);
if (buffer_->the_locking_inset) {
if (the_locking_inset) {
// We are in inset locking mode.
/* LyX does a kind of work-area grabbing for insets.
Only a ButtonPress Event outside the inset will
force a InsetUnlock. */
buffer_->the_locking_inset->
the_locking_inset->
InsetButtonRelease(inset_x, inset_y,
ev->xbutton.button);
return 0;
@ -1497,23 +1497,22 @@ void BufferView::CursorToggleCB(FL_OBJECT * ob, long)
}
if (view->lyx_focus && view->work_area_focus) {
if (!view->buffer_->the_locking_inset) {
if (!view->the_locking_inset) {
view->screen->CursorToggle();
} else {
view->buffer_->the_locking_inset->
view->the_locking_inset->
ToggleInsetCursor();
}
goto set_timer_and_return;
} else {
// Make sure that the cursor is visible.
if (!view->buffer_->the_locking_inset) {
if (!view->the_locking_inset) {
view->screen->ShowCursor();
} else {
if (!view->buffer_->the_locking_inset->isCursorVisible())
view->buffer_->the_locking_inset->
if (!view->the_locking_inset->isCursorVisible())
view->the_locking_inset->
ToggleInsetCursor();
}
// This is only run when work_area_focus or lyx_focus is false.
Window tmpwin;
int tmp;
@ -1558,7 +1557,7 @@ int BufferView::WorkAreaSelectionNotify(FL_OBJECT *, Window win,
unsigned char * uc = 0;
int tmpint;
screen->HideCursor();
BeforeChange();
beforeChange();
if (event->xselection.type == XA_STRING
&& event->xselection.property) {
@ -1665,6 +1664,14 @@ bool BufferView::available() const
}
void BufferView::beforeChange()
{
getScreen()->ToggleSelection();
text->ClearSelection();
FreeUpdateTimer();
}
void BufferView::savePosition()
{
backstack.push(buffer()->fileName(),
@ -1680,7 +1687,7 @@ void BufferView::restorePosition()
int x, y;
string fname = backstack.pop(&x, &y);
BeforeChange();
beforeChange();
Buffer * b = bufferlist.exists(fname) ?
bufferlist.getBuffer(fname) :
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);
return screen;
}
///
void beforeChange();
///
void savePosition();
///
@ -80,6 +82,20 @@ public:
This should be private...but not yet. (Lgb)
*/
LyXText * text;
///
UpdatableInset * the_locking_inset;
///
bool inset_slept;
///
int slx;
///
int sly;
///
void insetUnlock();
///
void insetSleep();
///
void insetWakeup();
private:
/// Update pixmap of screen
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
// in case some future function may want to retrieve
// an arbitrary entry.
// See additional comments in bulletEntry() below.
static string const BulletSize[SIZEMAX] = {
static char const * BulletSize[SIZEMAX] = {
"\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
"\\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
// 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
// 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 BulletPanel0[CHARMAX] = {
static char const * BulletPanel0[CHARMAX] = {
/* standard */
"\\normalfont\\bfseries{--}", "\\(\\vdash\\)",
"\\(\\dashv\\)", "\\(\\flat\\)", "\\(\\natural\\)",
@ -148,7 +148,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\(\\rightharpoonup\\)", "\\(\\rightharpoondown\\)",
"\\(\\Rightarrow\\)", "\\(\\succ\\)"
};
static string const BulletPanel1[CHARMAX] = {
static char const * BulletPanel1[CHARMAX] = {
/* amssymb */
"\\(\\Rrightarrow\\)", "\\(\\rightarrowtail\\)",
"\\(\\twoheadrightarrow\\)", "\\(\\rightsquigarrow\\)",
@ -167,7 +167,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\(\\blacktriangledown\\)", "\\(\\blacklozenge\\)",
"\\(\\blacksquare\\)"
};
static string const BulletPanel2[CHARMAX] = {
static char const * BulletPanel2[CHARMAX] = {
/* psnfss1 */
"\\ding{108}", "\\ding{109}",
"\\ding{119}", "\\Pisymbol{psy}{197}",
@ -188,7 +188,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{166}", "\\ding{167}",
"\\ding{226}", "\\ding{227}"
};
static string const BulletPanel3[CHARMAX] = {
static char const * BulletPanel3[CHARMAX] = {
/* psnfss2 */
"\\ding{37}", "\\ding{38}",
"\\ding{34}", "\\ding{36}",
@ -209,7 +209,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{171}", "\\ding{168}",
"\\ding{169}", "\\ding{170}"
};
static string const BulletPanel4[CHARMAX] = {
static char const * BulletPanel4[CHARMAX] = {
/* psnfss3 */
"\\ding{65}", "\\ding{76}",
"\\ding{75}", "\\ding{72}",
@ -230,7 +230,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{102}", "\\ding{96}",
"\\ding{95}", "\\ding{97}"
};
static string const BulletPanel5[CHARMAX] = {
static char const * BulletPanel5[CHARMAX] = {
/* psnfss4 */
"\\ding{223}", "\\ding{224}",
"\\ding{225}", "\\ding{232}",
@ -252,7 +252,7 @@ string const & Bullet::bulletEntry(const short & f, const short & c)
"\\ding{231}", "\\Pisymbol{psy}{45}"
}; /* string const BulletPanels[][] */
static string const * BulletPanels[FONTMAX] = {
static char const ** BulletPanels[FONTMAX] = {
BulletPanel0, BulletPanel1,
BulletPanel2, BulletPanel3,
BulletPanel4, BulletPanel5

View File

@ -32,9 +32,6 @@ public:
///
Bullet(string const &);
///
~Bullet();
///
void setCharacter(const int);
///
@ -116,9 +113,9 @@ private:
///
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;
@ -158,10 +155,6 @@ inline Bullet::Bullet(string const & t)
}
inline Bullet::~Bullet()
{}
inline void Bullet::setCharacter(const int c)
{
if (c < MIN || c >= CHARMAX) {

View File

@ -3,7 +3,7 @@ SUBDIRS = mathed insets support
DISTCLEANFILES = libintl.h config.h
MAINTAINERCLEANFILES = Makefile.in config.h.in
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)
EXTRA_DIST = config.h.in stamp-h.in cheaders
ETAGS_ARGS = --c++

View File

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

View File

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

View File

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

View File

@ -333,9 +333,6 @@ public:
*/
LyXParagraph * paragraph;
/// per view not per buffer?
UpdatableInset * the_locking_inset;
/// RCS object
LyXVC lyxvc;
@ -349,22 +346,6 @@ public:
doing a 'nice' LaTeX file */
bool niceFile;
///
void InsetUnlock();
///
inline void InsetSleep();
///
inline void InsetWakeup();
///
bool inset_slept;
///
int slx;
///
int sly;
private:
///
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
void Buffer::setParentName(string const & name)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -136,11 +136,14 @@ static void LexInitCodes()
static char LexGetArg(char lf, bool accept_spaces= false)
{
char rg, * p = &yytext[0];
char rg;
char * p = &yytext[0];
int bcnt = 1;
unsigned char c;
char cc;
while (yyis->good()) {
yyis->get(c);
yyis->get(cc);
c = cc;
if (c > ' ') {
if (!lf) lf = c; else
if (c != lf)
@ -156,7 +159,8 @@ static char LexGetArg(char lf, bool accept_spaces= false)
return '\0';
}
do {
yyis->get(c);
yyis->get(cc);
c = cc;
if (c == lf) ++bcnt;
if (c == rg) --bcnt;
if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt>0) *(p++) = c;
@ -170,11 +174,13 @@ static int yylex(void)
{
static int init_done = 0;
unsigned char c;
char cc;
if (!init_done) LexInitCodes();
while (yyis->good()) {
yyis->get(c);
yyis->get(cc);
c = cc;
if (yy_mtextmode && c == ' ') {
yylval.i= ' ';
@ -187,15 +193,15 @@ static int yylex(void)
}
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)
{ yylval.i= c; return LM_TK_STR; }
if (lexcode[c] == LexDigit || lexcode[c] == LexOther || lexcode[c] == LexMathSpace) { yylval.i = c; return LM_TK_STR; }
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] == LexSelf) { return c; }
if (lexcode[c] == LexArgument) {
yyis->get(c);
if (lexcode[c] == LexArgument) {
yyis->get(cc);
c = cc;
yylval.i = c - '0';
return LM_TK_ARGUMENT;
}
@ -203,7 +209,8 @@ static int yylex(void)
if (lexcode[c] == LexClose) { return LM_TK_CLOSE; }
if (lexcode[c] == LexESC) {
yyis->get(c);
yyis->get(cc);
c = cc;
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_END; }
@ -215,7 +222,7 @@ static int yylex(void)
}
if (lexcode[c] == LexMathSpace) {
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;
return LM_TK_SPACE;
}
@ -223,7 +230,8 @@ static int yylex(void)
char * p = &yytext[0];
while (lexcode[c] == LexAlpha || lexcode[c] == LexDigit) {
*p = c;
yyis->get(c);
yyis->get(cc);
c = cc;
p++;
}
*p = '\0';

View File

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

View File

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

View File

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

View File

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