some new (not extensive) changes, some fixes, will probably reverto to .la libs later .o libs is too much a hassle, please read the ChangeLog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@408 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-01-08 21:02:58 +00:00
parent 1c467c80d7
commit 53b464c5e9
35 changed files with 1435 additions and 799 deletions

View File

@ -137,7 +137,8 @@ Each translation team has its own mailing list, courtesy of Linux
International. You may reach your translation team at the address International. You may reach your translation team at the address
`LL@li.org', replacing LL by the two-letter ISO 639 code for your `LL@li.org', replacing LL by the two-letter ISO 639 code for your
language. Language codes are *not* the same as the country codes given language. Language codes are *not* the same as the country codes given
in ISO 3166. The following translation teams exist, as of August 1997: in ISO 3166. The following translation teams exist, as of December
1997:
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
@ -172,42 +173,42 @@ Available Packages
================== ==================
Languages are not equally supported in all packages. The following Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of August matrix shows the current state of internationalization, as of December
1997. The matrix shows, in regard of each package, for which languages 1997. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination. PO files have been submitted to translation coordination.
Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
.-------------------------------------------------. .----------------------------------------------------.
bash | [] [] [] | 3 bash | [] [] [] | 3
bison | [] [] [] | 3 bison | [] [] [] | 3
clisp | [] [] [] [] | 4 clisp | [] [] [] [] | 4
cpio | [] [] [] [] [] | 5 cpio | [] [] [] [] [] [] | 6
diffutils | [] [] [] [] [] | 5 diffutils | [] [] [] [] [] | 5
enscript | [] [] [] [] [] [] | 6 enscript | [] [] [] [] [] [] | 6
fileutils | [] [] [] [] [] [] [] [] [] [] | 10 fileutils | [] [] [] [] [] [] [] [] [] [] | 10
findutils | [] [] [] [] [] [] [] [] | 8 findutils | [] [] [] [] [] [] [] [] [] | 9
flex | [] [] [] [] | 4 flex | [] [] [] [] | 4
gcal | [] [] [] [] [] | 5 gcal | [] [] [] [] [] | 5
gettext | [] [] [] [] [] [] [] [] [] [] | 11 gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
grep | [] [] [] [] [] [] [] [] [] | 9 grep | [] [] [] [] [] [] [] [] [] [] | 10
hello | [] [] [] [] [] [] [] [] [] [] | 10 hello | [] [] [] [] [] [] [] [] [] [] [] | 11
id-utils | [] [] [] | 3 id-utils | [] [] [] | 3
indent | [] [] [] [] | 4 indent | [] [] [] [] [] | 5
libc | [] [] [] [] [] [] [] | 7 libc | [] [] [] [] [] [] [] | 7
m4 | [] [] [] [] [] | 5 m4 | [] [] [] [] [] [] | 6
make | [] [] [] [] [] [] | 6 make | [] [] [] [] [] [] | 6
music | [] [] | 2 music | [] [] | 2
ptx | [] [] [] [] [] [] [] [] | 8 ptx | [] [] [] [] [] [] [] [] | 8
recode | [] [] [] [] [] [] [] [] [] | 9 recode | [] [] [] [] [] [] [] [] [] | 9
sh-utils | [] [] [] [] [] [] [] | 7 sh-utils | [] [] [] [] [] [] [] [] | 8
sharutils | [] [] [] [] [] | 5 sharutils | [] [] [] [] [] [] | 6
tar | [] [] [] [] [] [] [] [] [] [] | 10 tar | [] [] [] [] [] [] [] [] [] [] [] | 11
texinfo | [] | 1 texinfo | [] [] [] | 3
textutils | [] [] [] [] [] [] [] [] [] | 9 textutils | [] [] [] [] [] [] [] [] [] | 9
wdiff | [] [] [] [] [] [] [] [] | 8 wdiff | [] [] [] [] [] [] [] [] | 8
`-------------------------------------------------' `----------------------------------------------------'
16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
Some counters in the preceding matrix are higher than the number of Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are visible blocks let us expect. This is because a few extra PO files are
@ -220,6 +221,6 @@ distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a lag between the mere existence a PO file and its wide availability in a
distribution. distribution.
If August 1997 seems to be old, you may fetch a more recent copy of If December 1997 seems to be old, you may fetch a more recent copy
this `ABOUT-NLS' file on most GNU archive sites. of this `ABOUT-NLS' file on most GNU archive sites.

View File

@ -1,3 +1,73 @@
2000-01-08 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/bufferlist.C (close): don't call insetUnlock if the buffer
does not have a BufferView.
(unlockInset): ditto + don't access the_locking_inset if the
buffer does not have a BufferView.
* src/LyXView.C (KeyPressMask_raw_callback): add a XSync in
certain circumstances so that we don't continue a keyboard
operation long after the key was released. Try f.ex. to load a
large document, press PageDown for some seconds and then release
it. Before this change the document would contine to scroll for
some time, with this change it stops imidiatly.
* src/support/block.h: don't allocate more space than needed. As
long as we don't try to write to the arr[x] in a array_type arr[x]
it is perfectly ok. (if you write to it you might segfault).
added operator value_type*() so that is possible to pass the array
to functions expecting a C-pointer.
* lib/Makefile.am (dist-hook): don't fail completely if unable to
cvs.
* intl/*: updated to gettext 0.10.35, tried to add our own
required modifications. Please verify.
* po/*: updated to gettext 0.10.35, tried to add our own required
modifications. Please verify.
* src/support/lstrings.C (tostr): go at fixing the problem with
cxx and stringstream. When stringstream is used return
oss.str().c_str() so that problems with lyxstring and basic_string
are avoided. Note that the best solution would be for cxx to use
basic_string all the way, but it is not conformant yet. (it seems)
* src/lyx_cb.C + other files: moved several global functions to
class BufferView, some have been moved to BufferView.[Ch] others
are still located in lyx_cb.C. Code changes because of this. (part
of "get rid of current_view project".)
* src/buffer.C + other files: moved several Buffer functions to
class BufferView, the functions are still present in buffer.C.
Code changes because of this.
* config/lcmessage.m4: updated to most recent. used when creating
acinclude.m4.
* config/progtest.m4: updated to most recent. used when creating
acinclude.m4.
* config/gettext.m4: updated to most recent. applied patch for
tmplinguas.
* config/gettext.m4.patch: new file that shows what changes we
have done to the local copy of gettext.m4.
* config/libtool.m4: new file, used in creation of acinclude.m4
* config/lyxinclude.m4: new file, this is the lyx created m4
macros, used in making acinclude.m4.
* autogen.sh: GNU m4 discovered as a separate task not as part of
the lib/configure creation.
Generate acinlucde from files in config. Actually cat
lyxinclude.m4, libtool.m4 and gettext.m4 together. This makes it
easier to upgrade .m4 files that really are external.
* src/Spacing.h: moved using std::istringstream to right after
<sstream>. This should fix the problem seen with some compilers.
2000-01-06 Lars Gullik Bjønnes <larsbj@lyx.org> 2000-01-06 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/lyx_cb.C: began some work to remove the dependency a lot of * src/lyx_cb.C: began some work to remove the dependency a lot of

View File

@ -5,7 +5,7 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure \
SUBDIRS = intl po src lib SUBDIRS = intl po src lib
EXTRA_DIST = ANNOUNCE OLD-CHANGES INSTALL.OS2 INSTALL.autoconf README.OS2 \ EXTRA_DIST = ANNOUNCE OLD-CHANGES INSTALL.OS2 INSTALL.autoconf README.OS2 \
UPGRADING lyx.man \ UPGRADING lyx.man acconfig.h \
config development forms images config development forms images
ETAGS_ARGS = --c++ ETAGS_ARGS = --c++
man_MANS = lyx.1 man_MANS = lyx.1

View File

@ -185,7 +185,7 @@ dnl Check the version of g++
case $gxx_version in case $gxx_version in
2.7*) CXXFLAGS="$lyx_opt";; 2.7*) CXXFLAGS="$lyx_opt";;
2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti";; 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti";;
2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti";; 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
*) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti";; *) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti";;
esac esac
else else
@ -784,7 +784,6 @@ extern int select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func
AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5)) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5))
]) ])
### BEGIN libtool.m4
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1999 Free Software Foundation, Inc. ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
@ -1215,9 +1214,6 @@ AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl ifelse([AC_DISABLE_FAST_INSTALL])dnl
### END libtool.m4
# Macro to add for using GNU gettext. # Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995. # Ulrich Drepper <drepper@cygnus.com>, 1995.
# #
@ -1447,11 +1443,12 @@ strdup __argz_count __argz_stringify __argz_next])
else else
AC_MSG_CHECKING(for catalogs to be installed) AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS= NEW_LINGUAS=
dnl ============== Fix is here! ======================= dnl ============== Fix is here! ======================
dnl Some sh do not like substitution in bounds of for loops dnl Some sh do not like substitution in bounds of for loops
dnl for lang in ${LINGUAS=$ALL_LINGUAS}; do dnl for lang in ${LINGUAS=$ALL_LINGUAS}; do
tmplinguas=${LINGUAS=$ALL_LINGUAS} tmplinguas=${LINGUAS=$ALL_LINGUAS}
for lang in ${tmplinguas}; do for lang in ${tmplinguas}; do
dnl ==== end of fix
case "$ALL_LINGUAS" in case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac esac
@ -1537,3 +1534,69 @@ dnl for lang in ${LINGUAS=$ALL_LINGUAS}; do
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES < $srcdir/po/POTFILES.in > po/POTFILES
]) ])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])

View File

@ -4,73 +4,82 @@ ACLOCAL=aclocal
AUTOHEADER=autoheader AUTOHEADER=autoheader
AUTOMAKE="automake -a -c --foreign" AUTOMAKE="automake -a -c --foreign"
AUTOCONF=autoconf AUTOCONF=autoconf
GNUM4=
echo -n "Locating GNU m4..."
for prog in $M4 gm4 gnum4 m4 ; do
case `$prog --version 2>&1` in
*GNU*) ok=yes
GNUM4=`type -path $prog`
echo "found: $GNUM4"
break ;;
*) ;;
esac
done
if test x$ok = xno ; then
echo "not found."
fi
# Generate acinclude.m4
echo -n "Generate acinclude.m4..."
rm -rf acinclude.m4
touch acinclude.m4
for fil in config/lyxinclude.m4 config/libtool.m4 config/gettext.m4 config/lcmessage.m4 config/progtest.m4 ; do
cat $fil >> acinclude.m4
done
echo "done."
# Generate the Makefiles and configure files # Generate the Makefiles and configure files
if ( aclocal --version ) </dev/null > /dev/null 2>&1; then if ( aclocal --version ) </dev/null > /dev/null 2>&1; then
echo "Building macros." echo -n "Building macros..."
$ACLOCAL ; (cd lib/reLyX; $ACLOCAL ) $ACLOCAL ; (cd lib/reLyX; $ACLOCAL )
echo "done."
else else
echo "aclocal not found -- aborting" echo "aclocal not found -- aborting"
exit exit
fi fi
if ( autoheader --version ) </dev/null > /dev/null 2>&1; then if ( autoheader --version ) </dev/null > /dev/null 2>&1; then
echo "Building config header template" echo -n "Building config header template..."
$AUTOHEADER $AUTOHEADER
echo "done."
else else
echo "autoheader not found -- aborting" echo "autoheader not found -- aborting"
exit exit
fi fi
if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then
echo "Building Makefile templates" echo -n "Building Makefile templates..."
$AUTOMAKE ; (cd lib/reLyX ; $AUTOMAKE ) $AUTOMAKE ; (cd lib/reLyX ; $AUTOMAKE )
echo "done."
else else
echo "automake not found -- aborting" echo "automake not found -- aborting"
exit exit
fi fi
if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then
echo "Building configure" echo -n "Building configure..."
$AUTOCONF ; ( cd lib/reLyX ; $AUTOCONF ) $AUTOCONF ; ( cd lib/reLyX ; $AUTOCONF )
echo "done."
echo 'run "./configure ; make"' echo 'run "./configure ; make"'
else else
echo "autoconf not found -- aborting" echo "autoconf not found -- aborting"
exit exit
fi fi
# Autogenerate lib/configure.m4. We need GNU m4 for that and thus have # Autogenerate lib/configure.m4.
# to try several ones. if test x$GNUM4 != x ; then
ok=no echo -n "Building lib/configure ..."
#for prog in $M4 gm4 gnum4 m4 ; do rm -f lib/configure
# case `$prog --help < /dev/null 2>&1 | grep traditional` in $GNUM4 lib/configure.m4 > lib/configure
# *traditional*) echo "Building lib/configure" chmod a+x lib/configure
# rm -f lib/configure echo "done."
# $prog lib/configure.m4 >lib/configure else
# chmod a+x lib/configure echo "No GNU m4. Impossible to build lib/configure -- aborting"
# ok=yes
# break ;;
# *) ;;
# esac
#done
# Why not use --version ? (Lgb)
for prog in $M4 gm4 gnum4 m4 ; do
case `$prog --version 2>&1` in
*GNU*) echo "Building lib/configure"
rm -f lib/configure
$prog lib/configure.m4 >lib/configure
chmod a+x lib/configure
ok=yes
break ;;
*) ;;
esac
done
if test $ok = no ; then
echo "GNU m4 not found -- aborting"
exit exit
fi fi
echo "Creating POTFILES.in..." echo -n "Creating POTFILES.in..."
cat <<EOF > tmppot cat <<EOF > tmppot
# #
# This file is automatically generated by autogen.sh. This command was # This file is automatically generated by autogen.sh. This command was

358
config/config.guess vendored
View File

@ -1,6 +1,7 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
# Free Software Foundation, Inc.
# #
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -23,6 +24,7 @@
# Written by Per Bothner <bothner@cygnus.com>. # Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib. # The master version of this file is at the FSF in /home/gd/gnu/lib.
# Please send patches to <autoconf-patches@gnu.org>.
# #
# This script attempts to guess a canonical system name similar to # This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and # config.sub. If it succeeds, it prints the system name on stdout, and
@ -35,6 +37,20 @@
# (but try to keep the structure clean). # (but try to keep the structure clean).
# #
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
fi
# This is needed to find uname on a Pyramid OSx when run in the BSD universe. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.) # (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@ -46,7 +62,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive. # Note: order is significant - the case branches are not exclusive.
@ -59,7 +76,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version. # A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
cat <<EOF >dummy.s cat <<EOF >$dummy.s
.globl main .globl main
.ent main .ent main
main: main:
@ -76,9 +93,9 @@ main:
ret \$31,(\$26),1 ret \$31,(\$26),1
.end main .end main
EOF EOF
${CC-cc} dummy.s -o dummy 2>/dev/null $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then if test "$?" = 0 ; then
./dummy ./$dummy
case "$?" in case "$?" in
7) 7)
UNAME_MACHINE="alpha" UNAME_MACHINE="alpha"
@ -97,8 +114,14 @@ EOF
;; ;;
esac esac
fi fi
rm -f dummy.s dummy rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit 0 ;; exit 0 ;;
21064:Windows_NT:50:3) 21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5 echo alpha-dec-winnt3.5
@ -133,6 +156,9 @@ EOF
wgrisc:OpenBSD:*:*) wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE} echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE} echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;; exit 0;;
@ -142,7 +168,7 @@ EOF
SR2?01:HI-UX/MPP:*:*) SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp echo hppa1.1-hitachi-hiuxmpp
exit 0;; exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3 echo pyramid-pyramid-sysv3
@ -150,7 +176,7 @@ EOF
echo pyramid-pyramid-bsd echo pyramid-pyramid-bsd
fi fi
exit 0 ;; exit 0 ;;
NILE:*:*:dcosx) NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4 echo pyramid-pyramid-svr4
exit 0 ;; exit 0 ;;
sun4H:SunOS:5.*:*) sun4H:SunOS:5.*:*)
@ -201,6 +227,32 @@ EOF
atari*:OpenBSD:*:*) atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*) sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE} echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
@ -234,12 +286,16 @@ EOF
VAX*:ULTRIX*:*:*) VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE} echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
2020:CLIX:*:*) 2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE} echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos) mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c sed 's/^ //' << EOF >$dummy.c
int main (argc, argv) int argc; char **argv; { #ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB) #if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV) #if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@ -254,10 +310,10 @@ EOF
exit (-1); exit (-1);
} }
EOF EOF
${CC-cc} dummy.c -o dummy \ $CC_FOR_BUILD $dummy.c -o $dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0 && rm $dummy.c $dummy && exit 0
rm -f dummy.c dummy rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE} echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
Night_Hawk:Power_UNIX:*:*) Night_Hawk:Power_UNIX:*:*)
@ -275,15 +331,18 @@ EOF
AViiON:dgux:*:*) AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures # DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ then
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE} echo m88k-dg-dgux${UNAME_RELEASE}
else else
echo m88k-dg-dguxbcs${UNAME_RELEASE} echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;; exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3) M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3 echo m88k-dolphin-sysv3
@ -309,7 +368,7 @@ EOF
exit 0 ;; exit 0 ;;
*:AIX:2:3) *:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h> #include <sys/systemcfg.h>
main() main()
@ -320,8 +379,8 @@ EOF
exit(0); exit(0);
} }
EOF EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f dummy.c dummy rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5 echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4 echo rs6000-ibm-aix3.2.4
@ -368,25 +427,25 @@ EOF
case "${UNAME_MACHINE}" in case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;; 9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;; 9000/[34]?? ) HP_ARCH=m68k ;;
9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) 9000/[678][0-9][0-9])
sed 's/^ //' << EOF >dummy.c sed 's/^ //' << EOF >$dummy.c
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
int main () int main ()
{ {
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS); long bits = sysconf(_SC_KERNEL_BITS);
#endif #endif
long cpu = sysconf (_SC_CPU_VERSION); long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu) switch (cpu)
{ {
case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0: case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
switch (bits) switch (bits)
{ {
case 64: puts ("hppa2.0w"); break; case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break; case 32: puts ("hppa2.0n"); break;
@ -394,20 +453,20 @@ EOF
} break; } break;
#else /* !defined(_SC_KERNEL_BITS) */ #else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break; puts ("hppa2.0"); break;
#endif #endif
default: puts ("hppa1.0"); break; default: puts ("hppa1.0"); break;
} }
exit (0); exit (0);
} }
EOF EOF
(${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f dummy.c dummy rm -f $dummy.c $dummy
esac esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV} echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;; exit 0 ;;
3050*:HI-UX:*:*) 3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c sed 's/^ //' << EOF >$dummy.c
#include <unistd.h> #include <unistd.h>
int int
main () main ()
@ -432,8 +491,8 @@ EOF
exit (0); exit (0);
} }
EOF EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f dummy.c dummy rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2 echo unknown-hitachi-hiuxwe2
exit 0 ;; exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@ -442,6 +501,9 @@ EOF
9000/8??:4.3bsd:*:*) 9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd echo hppa1.0-hp-bsd
exit 0 ;; exit 0 ;;
*9??*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf echo hppa1.1-hp-osf
exit 0 ;; exit 0 ;;
@ -458,6 +520,9 @@ EOF
parisc*:Lites*:*:*) parisc*:Lites*:*:*)
echo hppa1.1-hp-lites echo hppa1.1-hp-lites
exit 0 ;; exit 0 ;;
hppa*:OpenBSD:*:*)
echo hppa-unknown-openbsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd echo c1-convex-bsd
exit 0 ;; exit 0 ;;
@ -490,11 +555,14 @@ EOF
CRAY*TS:*:*:*) CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
CRAY*T3E:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*) CRAY-2:*:*:*)
echo cray2-cray-unicos echo cray2-cray-unicos
exit 0 ;; exit 0 ;;
F300:UNIX_System_V:*:*) F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;; exit 0 ;;
@ -507,29 +575,47 @@ EOF
hp300:OpenBSD:*:*) hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE} echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*) sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE} echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*) *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0
fi
fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;; exit 0 ;;
*:NetBSD:*:*) *:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0 ;; exit 0 ;;
*:OpenBSD:*:*) *:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;; exit 0 ;;
i*:CYGWIN*:*) i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin32 echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;; exit 0 ;;
i*:MINGW*:*) i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;; exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*) p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32 echo powerpcle-unknown-cygwin
exit 0 ;; exit 0 ;;
prep*:SunOS:5.*:*) prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@ -538,15 +624,11 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;; exit 0 ;;
*:Linux:*:*) *:Linux:*:*)
# uname on the ARM produces all sorts of strangeness, and we need to
# filter it out.
case "$UNAME_MACHINE" in
arm* | sa110*) UNAME_MACHINE="arm" ;;
esac
# The BFD linker knows what the default object file format is, so # The BFD linker knows what the default object file format is, so
# first see if it will tell us. # first see if it will tell us. cd to the root directory to prevent
ld_help_string=`ld --help 2>&1` # problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \ ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d | sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g s/[ ][ ]*/ /g
@ -554,16 +636,74 @@ EOF
s/ .*// s/ .*//
p'` p'`
case "$ld_supported_emulations" in case "$ld_supported_emulations" in
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; *ia64)
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; echo "${UNAME_MACHINE}-unknown-linux"
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; exit 0
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; i?86linux)
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32ppc)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
extern char __libc_release[];
#endif
main(argc, argv)
int argc;
char *argv[];
{
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
esac esac
if test "${UNAME_MACHINE}" = "alpha" ; then if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >dummy.s sed 's/^ //' <<EOF >$dummy.s
.globl main .globl main
.ent main .ent main
main: main:
@ -581,9 +721,9 @@ EOF
.end main .end main
EOF EOF
LIBC="" LIBC=""
${CC-cc} dummy.s -o dummy 2>/dev/null $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then if test "$?" = 0 ; then
./dummy ./$dummy
case "$?" in case "$?" in
7) 7)
UNAME_MACHINE="alpha" UNAME_MACHINE="alpha"
@ -600,22 +740,23 @@ EOF
16) 16)
UNAME_MACHINE="alphaev6" UNAME_MACHINE="alphaev6"
;; ;;
esac esac
objdump --private-headers dummy | \ objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null grep ld.so.1 > /dev/null
if test "$?" = 0 ; then if test "$?" = 0 ; then
LIBC="libc1" LIBC="libc1"
fi fi
fi fi
rm -f dummy.s dummy rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF cat >$dummy.c <<EOF
main(argc, argv) #ifdef __cplusplus
int argc; int main (int argc, char *argv[]) {
char *argv[]; #else
{ int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__ #ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]); printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif #endif
@ -625,8 +766,8 @@ main(argc, argv)
return 0; return 0;
} }
EOF EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f dummy.c dummy rm -f $dummy.c $dummy
else else
# Either a pre-BFD a.out linker (linux-gnuoldld) # Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help. # or one that does not give us useful --help.
@ -645,12 +786,13 @@ EOF
;; ;;
esac esac
# Determine whether the default compiler is a.out or elf # Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF cat >$dummy.c <<EOF
#include <features.h> #include <features.h>
main(argc, argv) #ifdef __cplusplus
int argc; int main (int argc, char *argv[]) {
char *argv[]; #else
{ int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __ELF__ #ifdef __ELF__
# ifdef __GLIBC__ # ifdef __GLIBC__
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
@ -667,8 +809,8 @@ main(argc, argv)
return 0; return 0;
} }
EOF EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f dummy.c dummy rm -f $dummy.c $dummy
fi ;; fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename. # are messed up and put the nodename in both sysname and nodename.
@ -684,10 +826,20 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;; exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i?86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi fi
exit 0 ;; exit 0 ;;
i?86:*:3.2:*) i?86:*:3.2:*)
@ -699,18 +851,15 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586 && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else else
echo ${UNAME_MACHINE}-pc-sysv32 echo ${UNAME_MACHINE}-pc-sysv32
fi fi
exit 0 ;; exit 0 ;;
i?86:UnixWare:*:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
fi
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
exit 0 ;;
pc:*:*:*) pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386. # the processor, so we play safe by assuming i386.
@ -752,7 +901,7 @@ EOF
mc68030:UNIX_System_V:4.*:*) mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4 echo m68k-atari-sysv4
exit 0 ;; exit 0 ;;
i?86:LynxOS:2.*:*) i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE} echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
TSUNAMI:LynxOS:2.*:*) TSUNAMI:LynxOS:2.*:*)
@ -764,6 +913,9 @@ EOF
SM[BE]S:UNIX_SV:*:*) SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE} echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;; exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*) RM*:SINIX-*:*:*)
echo mips-sni-sysv4 echo mips-sni-sysv4
exit 0 ;; exit 0 ;;
@ -794,7 +946,7 @@ EOF
news*:NEWS-OS:*:6*) news*:NEWS-OS:*:6*)
echo mips-sony-newsos6 echo mips-sony-newsos6
exit 0 ;; exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE} echo mips-nec-sysv${UNAME_RELEASE}
else else
@ -810,12 +962,27 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos echo i586-pc-beos
exit 0 ;; exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-qnx-qnx${UNAME_VERSION}
exit 0 ;;
esac esac
#echo '(No uname command or uname output not recognized.)' 1>&2 #echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF cat >$dummy.c <<EOF
#ifdef _SEQUENT_ #ifdef _SEQUENT_
# include <sys/types.h> # include <sys/types.h>
# include <sys/utsname.h> # include <sys/utsname.h>
@ -853,7 +1020,10 @@ main ()
#endif #endif
int version; int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0); exit (0);
#endif #endif
@ -913,8 +1083,8 @@ main ()
} }
EOF EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f dummy.c dummy rm -f $dummy.c $dummy
# Apollos put the system type in the environment. # Apollos put the system type in the environment.

335
config/config.sub vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script, version 1.1. # Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. # Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can. # can handle that machine. It does not imply ALL GNU software can.
@ -98,11 +98,21 @@ case $os in
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
-sco5) -sco5)
os=sco3.2v5 os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco4) -sco4)
@ -121,6 +131,9 @@ case $os in
os=-sco3.2v2 os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc) -isc)
os=-isc2.2 os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@ -143,22 +156,33 @@ case $os in
-psos*) -psos*)
os=-psos os=-psos
;; ;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac esac
# Decode aliases for certain CPU-COMPANY combinations. # Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in case $basic_machine in
# Recognize the basic CPU types without company name. # Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below. # Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ | 580 | i960 | h8300 \
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \ | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| mipstx39 | mipstx39el | armv[34][lb] \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| sparc | sparclet | sparclite | sparc64 | v850) | mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users. # (2) the word "unknown" tends to confuse beginning users.
@ -171,27 +195,45 @@ case $basic_machine in
exit 1 exit 1
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ # FIXME: clean up the formatting here.
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ | xmp-* | ymp-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* | armv[34][lb]-*\ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| f301-*) | mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
;; ;;
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att basic_machine=m68000-att
;; ;;
3b*) 3b*)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80) alliant | fx80)
basic_machine=fx80-alliant basic_machine=fx80-alliant
;; ;;
@ -221,6 +263,10 @@ case $basic_machine in
basic_machine=m68k-apollo basic_machine=m68k-apollo
os=-sysv os=-sysv
;; ;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux) aux)
basic_machine=m68k-apple basic_machine=m68k-apple
os=-aux os=-aux
@ -297,6 +343,10 @@ case $basic_machine in
encore | umax | mmax) encore | umax | mmax)
basic_machine=ns32k-encore basic_machine=ns32k-encore
;; ;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800) fx2800)
basic_machine=i860-alliant basic_machine=i860-alliant
;; ;;
@ -315,6 +365,14 @@ case $basic_machine in
basic_machine=h8300-hitachi basic_machine=h8300-hitachi
os=-hms os=-hms
;; ;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris) harris)
basic_machine=m88k-harris basic_machine=m88k-harris
os=-sysv3 os=-sysv3
@ -330,13 +388,30 @@ case $basic_machine in
basic_machine=m68k-hp basic_machine=m68k-hp
os=-hpux os=-hpux
;; ;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9]) hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp basic_machine=m68000-hp
;; ;;
hp9k3[2-9][0-9]) hp9k3[2-9][0-9])
basic_machine=m68k-hp basic_machine=m68k-hp
;; ;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp basic_machine=hppa1.1-hp
;; ;;
hp9k8[0-9][0-9] | hp8[0-9][0-9]) hp9k8[0-9][0-9] | hp8[0-9][0-9])
@ -345,9 +420,16 @@ case $basic_machine in
hppa-next) hppa-next)
os=-nextstep3 os=-nextstep3
;; ;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*) i370-ibm* | ibm*)
basic_machine=i370-ibm basic_machine=i370-ibm
os=-mvs
;; ;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2? # I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32) i[34567]86v32)
@ -366,6 +448,25 @@ case $basic_machine in
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2 os=-solaris2
;; ;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
i386-qnx | qnx)
basic_machine=i386-qnx
;;
iris | iris4d) iris | iris4d)
basic_machine=mips-sgi basic_machine=mips-sgi
case $os in case $os in
@ -394,6 +495,10 @@ case $basic_machine in
miniframe) miniframe)
basic_machine=m68000-convergent basic_machine=m68000-convergent
;; ;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mipsel*-linux*) mipsel*-linux*)
basic_machine=mipsel-unknown basic_machine=mipsel-unknown
os=-linux-gnu os=-linux-gnu
@ -408,10 +513,30 @@ case $basic_machine in
mips3*) mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;; ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
msdos)
basic_machine=i386-unknown
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000) ncr3000)
basic_machine=i486-ncr basic_machine=i486-ncr
os=-sysv4 os=-sysv4
;; ;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900) news | news700 | news800 | news900)
basic_machine=m68k-sony basic_machine=m68k-sony
os=-newsos os=-newsos
@ -424,6 +549,10 @@ case $basic_machine in
basic_machine=mips-sony basic_machine=mips-sony
os=-newsos os=-newsos
;; ;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next ) next | m*-next )
basic_machine=m68k-next basic_machine=m68k-next
case $os in case $os in
@ -449,9 +578,25 @@ case $basic_machine in
basic_machine=i960-intel basic_machine=i960-intel
os=-nindy os=-nindy
;; ;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi) pa-hitachi)
basic_machine=hppa1.1-hitachi basic_machine=hppa1.1-hitachi
os=-hiuxwe2 os=-hiuxwe2
@ -469,19 +614,19 @@ case $basic_machine in
pc532 | pc532-*) pc532 | pc532-*)
basic_machine=ns32k-pc532 basic_machine=ns32k-pc532
;; ;;
pentium | p5 | k5 | nexen) pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | k6 | 6x86) pentiumpro | p6 | 6x86)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2)
basic_machine=i786-pc basic_machine=i786-pc
;; ;;
pentium-* | p5-* | k5-* | nexen-*) pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | k6-* | 6x86-*) pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-*) pentiumii-* | pentium2-*)
@ -505,12 +650,20 @@ case $basic_machine in
ps2) ps2)
basic_machine=i386-ibm basic_machine=i386-ibm
;; ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00) rm[46]00)
basic_machine=mips-siemens basic_machine=mips-siemens
;; ;;
rtpc | rtpc-*) rtpc | rtpc-*)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
@ -518,6 +671,10 @@ case $basic_machine in
basic_machine=sh-hitachi basic_machine=sh-hitachi
os=-hms os=-hms
;; ;;
sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7) sps7)
basic_machine=m68k-bull basic_machine=m68k-bull
os=-sysv2 os=-sysv2
@ -525,6 +682,13 @@ case $basic_machine in
spur) spur)
basic_machine=spur-unknown basic_machine=spur-unknown
;; ;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2) sun2)
basic_machine=m68000-sun basic_machine=m68000-sun
;; ;;
@ -569,6 +733,10 @@ case $basic_machine in
basic_machine=i386-sequent basic_machine=i386-sequent
os=-dynix os=-dynix
;; ;;
t3e)
basic_machine=t3e-cray
os=-unicos
;;
tx39) tx39)
basic_machine=mipstx39-unknown basic_machine=mipstx39-unknown
;; ;;
@ -586,6 +754,10 @@ case $basic_machine in
basic_machine=a29k-nyu basic_machine=a29k-nyu
os=-sym1 os=-sym1
;; ;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv) vaxv)
basic_machine=vax-dec basic_machine=vax-dec
os=-sysv os=-sysv
@ -609,6 +781,14 @@ case $basic_machine in
basic_machine=a29k-wrs basic_machine=a29k-wrs
os=-vxworks os=-vxworks
;; ;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xmp) xmp)
basic_machine=xmp-cray basic_machine=xmp-cray
os=-unicos os=-unicos
@ -616,6 +796,10 @@ case $basic_machine in
xps | xps100) xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none) none)
basic_machine=none-none basic_machine=none-none
os=-none os=-none
@ -623,6 +807,15 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in # Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular. # some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
mips) mips)
if [ x$os = x-linux-gnu ]; then if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown basic_machine=mips-unknown
@ -645,7 +838,7 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sparc) sparc | sparcv9)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
cydra) cydra)
@ -657,6 +850,16 @@ case $basic_machine in
orion105) orion105)
basic_machine=clipper-highlevel basic_machine=clipper-highlevel
;; ;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*) *)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1 exit 1
@ -710,13 +913,21 @@ case $os in
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos*) | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*) -linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'` os=`echo $os | sed -e 's|linux|linux-gnu|'`
;; ;;
@ -726,6 +937,9 @@ case $os in
-sunos6*) -sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'` os=`echo $os | sed -e 's|sunos6|solaris3|'`
;; ;;
-opened*)
os=-openedition
;;
-osfrose*) -osfrose*)
os=-osfrose os=-osfrose
;; ;;
@ -741,6 +955,9 @@ case $os in
-acis*) -acis*)
os=-aos os=-aos
;; ;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*) -ctix* | -uts*)
os=-sysv os=-sysv
;; ;;
@ -760,6 +977,9 @@ case $os in
-oss*) -oss*)
os=-sysv3 os=-sysv3
;; ;;
-qnx)
os=-qnx4
;;
-svr4) -svr4)
os=-sysv4 os=-sysv4
;; ;;
@ -772,9 +992,18 @@ case $os in
# This must come after -sysvr4. # This must come after -sysvr4.
-sysv*) -sysv*)
;; ;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix) -xenix)
os=-xenix os=-xenix
;; ;;
-*mint | -*MiNT)
os=-mint
;;
-none) -none)
;; ;;
*) *)
@ -800,6 +1029,9 @@ case $basic_machine in
*-acorn) *-acorn)
os=-riscix1.2 os=-riscix1.2
;; ;;
arm*-rebel)
os=-linux
;;
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
@ -821,6 +1053,15 @@ case $basic_machine in
# default. # default.
# os=-sunos4 # os=-sunos4
;; ;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
*-tti) # must be before sparc entry or we get the wrong os. *-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3 os=-sysv3
;; ;;
@ -833,6 +1074,15 @@ case $basic_machine in
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp) *-hp)
os=-hpux os=-hpux
;; ;;
@ -896,6 +1146,18 @@ case $basic_machine in
f301-fujitsu) f301-fujitsu)
os=-uxpv os=-uxpv
;; ;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*) *)
os=-none os=-none
;; ;;
@ -917,9 +1179,15 @@ case $basic_machine in
-aix*) -aix*)
vendor=ibm vendor=ibm
;; ;;
-beos*)
vendor=be
;;
-hpux*) -hpux*)
vendor=hp vendor=hp
;; ;;
-mpeix*)
vendor=hp
;;
-hiux*) -hiux*)
vendor=hitachi vendor=hitachi
;; ;;
@ -935,7 +1203,7 @@ case $basic_machine in
-genix*) -genix*)
vendor=ns vendor=ns
;; ;;
-mvs*) -mvs* | -opened*)
vendor=ibm vendor=ibm
;; ;;
-ptx*) -ptx*)
@ -947,6 +1215,15 @@ case $basic_machine in
-aux*) -aux*)
vendor=apple vendor=apple
;; ;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
vendor=atari
;;
esac esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;; ;;

View File

@ -1,7 +1,12 @@
# Macro to add for using GNU gettext. # Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995. # Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 3 # serial 5
AC_DEFUN(AM_WITH_NLS, AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested]) [AC_MSG_CHECKING([whether NLS is requested])
@ -41,12 +46,12 @@ AC_DEFUN(AM_WITH_NLS,
if test "$gt_cv_func_gettext_libc" != "yes"; then if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain, AC_CHECK_LIB(intl, bindtextdomain,
[LIBS="-lintl $LIBS" [AC_CACHE_CHECK([for gettext in libintl],
AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl, gt_cv_func_gettext_libintl,
[AC_TRY_LINK([], [return (int) gettext ("")], [AC_CHECK_LIB(intl, gettext,
gt_cv_func_gettext_libintl=yes, gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])]) gt_cv_func_gettext_libintl=no)],
gt_cv_func_gettext_libintl=no)])
fi fi
if test "$gt_cv_func_gettext_libc" = "yes" \ if test "$gt_cv_func_gettext_libc" = "yes" \
@ -140,7 +145,7 @@ AC_DEFUN(AM_WITH_NLS,
: ; : ;
else else
AC_MSG_RESULT( AC_MSG_RESULT(
[found xgettext programs is not GNU xgettext; ignore it]) [found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":" XGETTEXT=":"
fi fi
fi fi
@ -152,6 +157,12 @@ AC_DEFUN(AM_WITH_NLS,
nls_cv_header_intl=intl/libintl.h nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h nls_cv_header_libgt=intl/libgettext.h
fi fi
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac])
# If this is used in GNU gettext we have to set USE_NLS to `yes' # If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal. # because some of the sources are only built for this goal.
@ -196,9 +207,9 @@ AC_DEFUN(AM_GNU_GETTEXT,
AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h values.h sys/param.h]) unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next]) strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy) AC_CHECK_FUNCS(stpcpy)
@ -216,7 +227,12 @@ __argz_count __argz_stringify __argz_next])
else else
AC_MSG_CHECKING(for catalogs to be installed) AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS= NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do dnl ============== Fix is here! ======================
dnl Some sh do not like substitution in bounds of for loops
dnl for lang in ${LINGUAS=$ALL_LINGUAS}; do
tmplinguas=${LINGUAS=$ALL_LINGUAS}
for lang in ${tmplinguas}; do
dnl ==== end of fix
case "$ALL_LINGUAS" in case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac esac
@ -231,6 +247,17 @@ __argz_count __argz_stringify __argz_next])
fi fi
fi fi
dnl The reference to <locale.h> in the installed <libintl.h> file
dnl must be resolved because we cannot expect the users of this
dnl to define HAVE_LOCALE_H.
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
AC_SUBST(INCLUDE_LOCALE_H)
dnl Determine which catalog format we have (if any is needed) dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats: dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format dnl Linux libc-5 and the normal X/Open format

View File

@ -1,5 +1,10 @@
# Check whether LC_MESSAGES is available in <locale.h>. # Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995. # Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1 # serial 1

View File

@ -1758,11 +1758,7 @@ reload_flag=
reload_cmds='$LD$reload_flag -o $output$reload_objs' reload_cmds='$LD$reload_flag -o $output$reload_objs'
echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
# PORTME Some linkers may need a different reload flag. # PORTME Some linkers may need a different reload flag.
if [ x$with_gnu_ld = xyes ] ; then
reload_flag='-Ur'
else
reload_flag='-r' reload_flag='-r'
fi
echo "$ac_t$reload_flag" 1>&6 echo "$ac_t$reload_flag" 1>&6
test -n "$reload_flag" && reload_flag=" $reload_flag" test -n "$reload_flag" && reload_flag=" $reload_flag"

View File

@ -1,5 +1,10 @@
# Search path for a program which passes the given test. # Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996. # Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1 # serial 1

View File

@ -44,4 +44,5 @@ install-data-local: libinstalldirs
dist-hook: dist-hook:
cd ${distdir} ; rm -rf `find . -name \*CVS\*` ; \ cd ${distdir} ; rm -rf `find . -name \*CVS\*` ; \
rm -rf doc/BUGS.lyx ; \ rm -rf doc/BUGS.lyx ; \
cvs -Q export -r HEAD -d doc lyxdoc { cvs -Q export -r HEAD -d doc lyxdoc || \
echo "WARNING: Unable to get LyX Documentation from CVS!" ; true ; }

View File

@ -1,19 +1,10 @@
# Makefile for program source directory in GNU NLS utilities package. # Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
# #
# This program is free software; you can redistribute it and/or modify # This file file be copied and used freely without restrictions. It can
# it under the terms of the GNU General Public License as published by # be used in projects which are not available under the GNU Public License
# the Free Software Foundation; either version 2, or (at your option) # but which still want to provide support for the GNU gettext functionality.
# any later version. # Please note that the actual code is *not* freely available.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
VERSION = @VERSION@ VERSION = @VERSION@
@ -48,7 +39,7 @@ DEFS = @DEFS@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
INCLUDES = -I../src -I$(top_srcdir)/intl INCLUDES = -I.. -I$(top_srcdir)/intl
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
@ -91,18 +82,19 @@ INSTOBJEXT = @INSTOBJEXT@
all: all-@USE_NLS@ all: all-@USE_NLS@
all-yes: $(srcdir)/cat-id-tbl.c $(CATALOGS) all-yes: cat-id-tbl.c $(CATALOGS)
all-no: all-no:
$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/$(PACKAGE).pot: $(POTFILES)
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \ --add-comments --keyword=_ --keyword=N_ \
--files-from=$(srcdir)/POTFILES.in --files-from=$(srcdir)/POTFILES.in \
rm -f $(srcdir)/$(PACKAGE).pot && test ! -f $(PACKAGE).po \
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot || ( rm -f $(srcdir)/$(PACKAGE).pot \
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
$(srcdir)/cat-id-tbl.c: $(srcdir)/stamp-cat-id; @: $(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
$(srcdir)/stamp-cat-id: $(srcdir)/$(PACKAGE).pot $(srcdir)/stamp-cat-id: $(PACKAGE).pot
rm -f cat-id-tbl.tmp rm -f cat-id-tbl.tmp
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
@ -121,10 +113,10 @@ install-exec:
install-data: install-data-@USE_NLS@ install-data: install-data-@USE_NLS@
install-data-no: all install-data-no: all
install-data-yes: all install-data-yes: all
if test -r $(MKINSTALLDIRS); then \ if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $(datadir); \ $(MKINSTALLDIRS) $(datadir); \
else \ else \
$(top_srcdir)/mkinstalldirs $(datadir); \ $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
fi fi
@catalogs='$(CATALOGS)'; \ @catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \ for cat in $$catalogs; do \
@ -135,10 +127,10 @@ install-data-yes: all
esac; \ esac; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \ dir=$$destdir/$$lang/LC_MESSAGES; \
if test -r $(MKINSTALLDIRS); then \ if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $$dir; \ $(MKINSTALLDIRS) $$dir; \
else \ else \
$(top_srcdir)/mkinstalldirs $$dir; \ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
fi; \ fi; \
if test -r $$cat; then \ if test -r $$cat; then \
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
@ -163,10 +155,10 @@ install-data-yes: all
fi; \ fi; \
done done
if test "$(PACKAGE)" = "gettext"; then \ if test "$(PACKAGE)" = "gettext"; then \
if test -r $(MKINSTALLDIRS); then \ if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $(gettextsrcdir); \ $(MKINSTALLDIRS) $(gettextsrcdir); \
else \ else \
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
fi; \ fi; \
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
$(gettextsrcdir)/Makefile.in.in; \ $(gettextsrcdir)/Makefile.in.in; \

View File

@ -54,8 +54,7 @@ extern void SetXtermCursor(Window win);
extern bool input_prohibited; extern bool input_prohibited;
extern bool selection_possible; extern bool selection_possible;
extern char ascii_type; extern char ascii_type;
extern int UnlockInset(UpdatableInset * inset); //extern int UnlockInset(UpdatableInset * inset);
extern void ToggleFloat();
extern void MenuPasteSelection(char at); extern void MenuPasteSelection(char at);
extern InsetUpdateStruct * InsetUpdateList; extern InsetUpdateStruct * InsetUpdateList;
extern void UpdateInsetUpdateList(); extern void UpdateInsetUpdateList();
@ -1047,7 +1046,7 @@ int BufferView::WorkAreaButtonPress(FL_OBJECT * ob, Window,
button); button);
return 0; return 0;
} else { } else {
UnlockInset(the_locking_inset); unlockInset(the_locking_inset);
} }
} }
@ -1290,7 +1289,7 @@ int BufferView::WorkAreaButtonRelease(FL_OBJECT * ob, Window ,
} }
} }
if (hit == true) { if (hit == true) {
ToggleFloat(); toggleFloat();
selection_possible = false; selection_possible = false;
return 0; return 0;
} }
@ -1317,7 +1316,7 @@ int BufferView::WorkAreaButtonRelease(FL_OBJECT * ob, Window ,
&& y + screen_first < text->cursor.y - && y + screen_first < text->cursor.y -
text->cursor.row->baseline text->cursor.row->baseline
+ font.maxAscent() * 1.2 + font.maxDescent() * 1.2) { + font.maxAscent() * 1.2 + font.maxDescent() * 1.2) {
ToggleFloat(); toggleFloat();
selection_possible = false; selection_possible = false;
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#include "BackStack.h" #include "BackStack.h"
#include "lyxtext.h" #include "lyxtext.h"
#include "LaTeX.h"
class LyXView; class LyXView;
class Buffer; class Buffer;
@ -96,6 +96,83 @@ public:
void insetSleep(); void insetSleep();
/// ///
void insetWakeup(); void insetWakeup();
///
void replaceWord(string const & replacestring);
///
void endOfSpellCheck();
///
void selectLastWord();
///
char * nextWord(float & value);
///
void insertCorrectQuote();
///
void gotoNote();
///
bool gotoLabel(string const & label);
///
void paste();
///
void cut();
///
void copy();
///
void pasteEnvironment();
///
void copyEnvironment();
///
void hfill();
///
void protectedBlank();
///
void newline();
///
void menuSeparator();
///
void endOfSentenceDot();
///
void ldots();
///
void hyphenationPoint();
///
void menuUndo();
///
void menuRedo();
///
void toggleFloat();
///
void openStuff();
///
void insertNote();
///
void allFloats(char flag, char figmar);
/// removes all autodeletable insets
bool removeAutoInsets();
///
void insertErrors(TeXErrors & terr);
///
void setCursorFromRow(int row);
/** Insert an inset into the buffer
Insert inset into buffer, placing it in a layout of lout,
if no_table make sure that it doesn't end up in a table. */
void insertInset(Inset * inset, string const & lout = string(),
bool no_table = false);
/// open and lock an updatable inset
void open_new_inset(UpdatableInset * new_inset);
/// Inserts a lyx file at cursor position. Returns false if it fails.
bool insertLyXFile(string const & file);
///
int lockInset(UpdatableInset * inset);
///
void showLockedInsetCursor(long x, long y, int asc, int desc);
///
void hideLockedInsetCursor(long x, long y, int asc, int desc);
///
void fitLockedInsetCursor(long x, long y, int asc, int desc);
///
int unlockInset(UpdatableInset * inset);
///
void lockedInsetStoreUndo(Undo::undo_kind kind);
private: private:
/// Update pixmap of screen /// Update pixmap of screen
void updateScreen(); void updateScreen();

View File

@ -15,6 +15,9 @@
#pragma implementation #pragma implementation
#endif #endif
#include <sys/time.h>
#include <unistd.h>
#include "LyXView.h" #include "LyXView.h"
#include "lyx_main.h" #include "lyx_main.h"
#include "lyxlookup.h" #include "lyxlookup.h"
@ -334,14 +337,54 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM * fl, void * xev)
LyXView * view = static_cast<LyXView*>(fl->u_vdata); LyXView * view = static_cast<LyXView*>(fl->u_vdata);
int retval = 0; // 0 means XForms should have a look at this event int retval = 0; // 0 means XForms should have a look at this event
#define USE_XSYNC 1
#ifdef USE_XSYNC
XKeyEvent * xke = static_cast<XKeyEvent*>(xev);
static Time last_time_pressed = 0;
static Time last_time_released = 0;
static unsigned int last_key_pressed = 0;
static unsigned int last_key_released = 0;
static unsigned int last_state_pressed = 0;
static unsigned int last_state_released = 0;
#endif
// funny. Even though the raw_callback is registered with KeyPressMask, // funny. Even though the raw_callback is registered with KeyPressMask,
// also KeyRelease-events are passed through:-( // also KeyRelease-events are passed through:-(
// [It seems that XForms puts them in pairs... (JMarc)] // [It seems that XForms puts them in pairs... (JMarc)]
if (static_cast<XEvent*>(xev)->type == KeyPress if (static_cast<XEvent*>(xev)->type == KeyPress
&& view->bufferview->getWorkArea()->focus && view->bufferview->getWorkArea()->focus
&& view->bufferview->getWorkArea()->active) && view->bufferview->getWorkArea()->active) {
#ifdef USE_XSYNC
last_time_pressed = xke->time;
last_key_pressed = xke->keycode;
last_state_pressed = xke->state;
#endif
retval = view->getLyXFunc() retval = view->getLyXFunc()
->processKeyEvent(static_cast<XEvent*>(xev)); ->processKeyEvent(static_cast<XEvent*>(xev));
}
#ifdef USE_XSYNC
else if (static_cast<XEvent*>(xev)->type == KeyRelease
&& view->bufferview->getWorkArea()->focus
&& view->bufferview->getWorkArea()->active) {
last_time_released = xke->time;
last_key_released = xke->keycode;
last_state_released = xke->state;
}
if (last_key_released == last_key_pressed
&& last_state_released == last_state_pressed
&& last_time_released == last_time_pressed) {
// When the diff between last_time_released and
// last_time_pressed is 0, that sinifies an autoreapeat
// at least on my system. It like some feedback from
// others, especially from user running LyX remote.
//lyxerr << "Syncing - purging X events." << endl;
XSync(fl_get_display(), 1);
// This purge make f.ex. scrolling stop imidiatly when
// releaseing the PageDown button. The question is if this
// purging of XEvents can cause any harm...after some testing
// I can see no problems, but I'd like other reports too.
}
#endif
return retval; return retval;
} }

View File

@ -14,10 +14,10 @@
#ifdef HAVE_SSTREAM #ifdef HAVE_SSTREAM
#include <sstream> #include <sstream>
using std::istringstream;
#else #else
#include <strstream> #include <strstream>
#endif #endif
using std::istringstream;
#include "support/LOstream.h" #include "support/LOstream.h"

View File

@ -200,9 +200,8 @@ void Buffer::fileName(string const & newfile)
} }
// candidate for move to BufferView
// Inserts a file into current document // Inserts a file into current document
bool Buffer::insertLyXFile(string const & filen) bool BufferView::insertLyXFile(string const & filen)
// //
// (c) CHT Software Service GmbH // (c) CHT Software Service GmbH
// Uwe C. Schroeder // Uwe C. Schroeder
@ -225,7 +224,7 @@ bool Buffer::insertLyXFile(string const & filen)
return false; return false;
} }
users->beforeChange(); beforeChange();
ifstream ifs(fname.c_str()); ifstream ifs(fname.c_str());
if (!ifs) { if (!ifs) {
@ -243,10 +242,10 @@ bool Buffer::insertLyXFile(string const & filen)
if (c == '#') { if (c == '#') {
lyxerr.debug() << "Will insert file with header" << endl; lyxerr.debug() << "Will insert file with header" << endl;
res = readFile(lex, users->text->cursor.par); res = buffer()->readFile(lex, text->cursor.par);
} else { } else {
lyxerr.debug() << "Will insert file without header" << endl; lyxerr.debug() << "Will insert file without header" << endl;
res = readLyXformat2(lex, users->text->cursor.par); res = buffer()->readLyXformat2(lex, text->cursor.par);
} }
resize(); resize();
@ -2108,14 +2107,6 @@ bool Buffer::isSGML() const
void Buffer::sgmlOpenTag(ostream & os, int depth, void Buffer::sgmlOpenTag(ostream & os, int depth,
string const & latexname) const string const & latexname) const
{ {
#if 0
static char const * space[] = {
" "," ", " ", " ", " ", " ",
" ",
" ", " ", " ",
" "};
os << space[depth] << "<" << latexname << ">\n";
#endif
os << string(depth, ' ') << "<" << latexname << ">\n"; os << string(depth, ' ') << "<" << latexname << ">\n";
} }
@ -2123,13 +2114,6 @@ void Buffer::sgmlOpenTag(ostream & os, int depth,
void Buffer::sgmlCloseTag(ostream & os, int depth, void Buffer::sgmlCloseTag(ostream & os, int depth,
string const & latexname) const string const & latexname) const
{ {
#if 0
static char * space[] = {" ", " ", " ", " ", " ",
" ", " ", " ",
" ", " ", " "};
os << space[depth] << "</" << latexname << ">\n";
#endif
os << string(depth, ' ') << "</" << latexname << ">\n"; os << string(depth, ' ') << "</" << latexname << ">\n";
} }
@ -2196,13 +2180,13 @@ void Buffer::makeLinuxDocFile(string const & fname, int column)
} }
} }
/* environment tag closing */ // environment tag closing
for( ; depth > par->depth; --depth) { for( ; depth > par->depth; --depth) {
sgmlCloseTag(ofs, depth, environment_stack[depth]); sgmlCloseTag(ofs, depth, environment_stack[depth]);
environment_stack[depth].clear(); environment_stack[depth].clear();
} }
/* write opening SGML tags */ // write opening SGML tags
switch(style.latextype) { switch(style.latextype) {
case LATEX_PARAGRAPH: case LATEX_PARAGRAPH:
if(depth == par->depth if(depth == par->depth
@ -3122,12 +3106,11 @@ void Buffer::SimpleDocBookOnePar(string & file, string & extra,
} }
// candidate for move to BufferView bool BufferView::removeAutoInsets()
bool Buffer::removeAutoInsets()
{ {
LyXParagraph * par = paragraph; LyXParagraph * par = buffer()->paragraph;
LyXCursor cursor = users->text->cursor; LyXCursor cursor = text->cursor;
LyXCursor tmpcursor = cursor; LyXCursor tmpcursor = cursor;
cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos); cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos);
cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos); cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos);
@ -3137,19 +3120,20 @@ bool Buffer::removeAutoInsets()
if (par->AutoDeleteInsets()){ if (par->AutoDeleteInsets()){
a = true; a = true;
if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){ if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){
/* this is possible now, since SetCursor takes // this is possible now, since SetCursor takes
care about footnotes */ // care about footnotes
users->text->SetCursorIntern(par, 0); text->SetCursorIntern(par, 0);
users->text->RedoParagraphs(users->text->cursor, users->text->cursor.par->Next()); text->RedoParagraphs(text->cursor,
users->text->FullRebreak(); text->cursor.par->Next());
text->FullRebreak();
} }
} }
par = par->next; par = par->next;
} }
/* avoid forbidden cursor positions caused by error removing */ // avoid forbidden cursor positions caused by error removing
if (cursor.pos > cursor.par->Last()) if (cursor.pos > cursor.par->Last())
cursor.pos = cursor.par->Last(); cursor.pos = cursor.par->Last();
users->text->SetCursorIntern(cursor.par, cursor.pos); text->SetCursorIntern(cursor.par, cursor.pos);
return a; return a;
} }
@ -3175,7 +3159,7 @@ int Buffer::runLaTeX()
users->owner()->getMiniBuffer()->Set(_("Running LaTeX...")); users->owner()->getMiniBuffer()->Set(_("Running LaTeX..."));
// Remove all error insets // Remove all error insets
bool a = removeAutoInsets(); bool a = users->removeAutoInsets();
// Always generate the LaTeX file // Always generate the LaTeX file
makeLaTeXFile(name, org_path, false); makeLaTeXFile(name, org_path, false);
@ -3194,7 +3178,7 @@ int Buffer::runLaTeX()
} else if ((res & LaTeX::ERRORS)) { } else if ((res & LaTeX::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done")); users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes // Insert all errors as errors boxes
insertErrors(terr); users->insertErrors(terr);
// Dvi should also be kept dirty if the latex run // Dvi should also be kept dirty if the latex run
// ends up with errors. However it should be possible // ends up with errors. However it should be possible
@ -3241,7 +3225,7 @@ int Buffer::runLiterate()
users->owner()->getMiniBuffer()->Set(_("Running Literate...")); users->owner()->getMiniBuffer()->Set(_("Running Literate..."));
// Remove all error insets // Remove all error insets
bool a = removeAutoInsets(); bool a = users->removeAutoInsets();
// generate the Literate file if necessary // generate the Literate file if necessary
if (!isDviClean() || a) { if (!isDviClean() || a) {
@ -3263,7 +3247,7 @@ int Buffer::runLiterate()
} else if ((res & Literate::ERRORS)) { } else if ((res & Literate::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done")); users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes // Insert all errors as errors boxes
insertErrors(terr); users->insertErrors(terr);
// Dvi should also be kept dirty if the latex run // Dvi should also be kept dirty if the latex run
// ends up with errors. However it should be possible // ends up with errors. However it should be possible
@ -3310,7 +3294,7 @@ int Buffer::buildProgram()
users->owner()->getMiniBuffer()->Set(_("Building Program...")); users->owner()->getMiniBuffer()->Set(_("Building Program..."));
// Remove all error insets // Remove all error insets
bool a = removeAutoInsets(); bool a = users->removeAutoInsets();
// generate the LaTeX file if necessary // generate the LaTeX file if necessary
if (!isNwClean() || a) { if (!isNwClean() || a) {
@ -3332,7 +3316,7 @@ int Buffer::buildProgram()
} else if ((res & Literate::ERRORS)) { } else if ((res & Literate::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done")); users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes // Insert all errors as errors boxes
insertErrors(terr); users->insertErrors(terr);
// Literate files should also be kept dirty if the literate // Literate files should also be kept dirty if the literate
// command run ends up with errors. // command run ends up with errors.
@ -3377,7 +3361,7 @@ int Buffer::runChktex()
users->owner()->getMiniBuffer()->Set(_("Running chktex...")); users->owner()->getMiniBuffer()->Set(_("Running chktex..."));
// Remove all error insets // Remove all error insets
bool a = removeAutoInsets(); bool a = users->removeAutoInsets();
// Generate the LaTeX file if neccessary // Generate the LaTeX file if neccessary
if (!isDviClean() || a) { if (!isDviClean() || a) {
@ -3394,7 +3378,7 @@ int Buffer::runChktex()
_("Could not run with file:"), name); _("Could not run with file:"), name);
} else if (res > 0) { } else if (res > 0) {
// Insert all errors as errors boxes // Insert all errors as errors boxes
insertErrors(terr); users->insertErrors(terr);
} }
// if we removed error insets before we ran chktex or if we inserted // if we removed error insets before we ran chktex or if we inserted
@ -3410,18 +3394,14 @@ int Buffer::runChktex()
} }
extern void AllFloats(char, char); void BufferView::insertErrors(TeXErrors & terr)
// candidate for move to BufferView
void Buffer::insertErrors(TeXErrors & terr)
{ {
// Save the cursor position // Save the cursor position
LyXCursor cursor = users->text->cursor; LyXCursor cursor = text->cursor;
// This is drastic, but it's the only fix, I could find. (Asger) // This is drastic, but it's the only fix, I could find. (Asger)
AllFloats(1, 0); allFloats(1, 0);
AllFloats(1, 1); allFloats(1, 1);
for (TeXErrors::Errors::const_iterator cit = terr.begin(); for (TeXErrors::Errors::const_iterator cit = terr.begin();
cit != terr.end(); cit != terr.end();
@ -3435,47 +3415,46 @@ void Buffer::insertErrors(TeXErrors & terr)
int tmpid = -1; int tmpid = -1;
int tmppos = -1; int tmppos = -1;
texrow.getIdFromRow(errorrow, tmpid, tmppos); buffer()->texrow.getIdFromRow(errorrow, tmpid, tmppos);
LyXParagraph * texrowpar = 0; LyXParagraph * texrowpar = 0;
if (tmpid == -1) { if (tmpid == -1) {
texrowpar = users->text->FirstParagraph(); texrowpar = text->FirstParagraph();
tmppos = 0; tmppos = 0;
} else { } else {
texrowpar = users->text->GetParFromID(tmpid); texrowpar = text->GetParFromID(tmpid);
} }
if (texrowpar == 0) if (texrowpar == 0)
continue; continue;
InsetError * new_inset = new InsetError(msgtxt); InsetError * new_inset = new InsetError(msgtxt);
users->text->SetCursorIntern(texrowpar, tmppos); text->SetCursorIntern(texrowpar, tmppos);
users->text->InsertInset(new_inset); text->InsertInset(new_inset);
users->text->FullRebreak(); text->FullRebreak();
} }
// Restore the cursor position // Restore the cursor position
users->text->SetCursorIntern(cursor.par, cursor.pos); text->SetCursorIntern(cursor.par, cursor.pos);
} }
// candidate for move to BufferView void BufferView::setCursorFromRow(int row)
void Buffer::setCursorFromRow (int row)
{ {
int tmpid = -1; int tmpid = -1;
int tmppos = -1; int tmppos = -1;
texrow.getIdFromRow(row, tmpid, tmppos); buffer()->texrow.getIdFromRow(row, tmpid, tmppos);
LyXParagraph * texrowpar; LyXParagraph * texrowpar;
if (tmpid == -1) { if (tmpid == -1) {
texrowpar = users->text->FirstParagraph(); texrowpar = text->FirstParagraph();
tmppos = 0; tmppos = 0;
} else { } else {
texrowpar = users->text->GetParFromID(tmpid); texrowpar = text->GetParFromID(tmpid);
} }
users->text->SetCursor(texrowpar, tmppos); text->SetCursor(texrowpar, tmppos);
} }
@ -3738,74 +3717,72 @@ void Buffer::setOldPaperStuff()
#endif #endif
// candidate for move to BufferView void BufferView::insertInset(Inset * inset, string const & lout,
void Buffer::insertInset(Inset * inset, string const & lout,
bool no_table) bool no_table)
{ {
// check for table/list in tables // check for table/list in tables
if (no_table && users->text->cursor.par->table){ if (no_table && text->cursor.par->table){
WriteAlert(_("Impossible Operation!"), WriteAlert(_("Impossible Operation!"),
_("Cannot insert table/list in table."), _("Cannot insert table/list in table."),
_("Sorry.")); _("Sorry."));
return; return;
} }
// not quite sure if we want this... // not quite sure if we want this...
users->text->SetCursorParUndo(); text->SetCursorParUndo();
users->text->FreezeUndo(); text->FreezeUndo();
users->beforeChange(); beforeChange();
if (!lout.empty()) { if (!lout.empty()) {
users->update(-2); update(-2);
users->text->BreakParagraph(); text->BreakParagraph();
users->update(-1); update(-1);
if (users->text->cursor.par->Last()) { if (text->cursor.par->Last()) {
users->text->CursorLeft(); text->CursorLeft();
users->text->BreakParagraph(); text->BreakParagraph();
users->update(-1); update(-1);
} }
int lay = textclasslist.NumberOfLayout(params.textclass, int lay = textclasslist.NumberOfLayout(buffer()->params.textclass,
lout).second; lout).second;
if (lay == -1) // layout not found if (lay == -1) // layout not found
// use default layout "Standard" (0) // use default layout "Standard" (0)
lay = 0; lay = 0;
users->text->SetLayout(lay); text->SetLayout(lay);
users->text->SetParagraph(0, 0, text->SetParagraph(0, 0,
0, 0, 0, 0,
VSpace(VSpace::NONE), VSpace(VSpace::NONE), VSpace(VSpace::NONE), VSpace(VSpace::NONE),
LYX_ALIGN_LAYOUT, LYX_ALIGN_LAYOUT,
string(), string(),
0); 0);
users->update(-1); update(-1);
users->text->current_font.setLatex(LyXFont::OFF); text->current_font.setLatex(LyXFont::OFF);
} }
users->text->InsertInset(inset); text->InsertInset(inset);
users->update(-1); update(-1);
users->text->UnFreezeUndo(); text->UnFreezeUndo();
} }
// Open and lock an updatable inset // Open and lock an updatable inset
// candidate for move to BufferView void BufferView::open_new_inset(UpdatableInset * new_inset)
void Buffer::open_new_inset(UpdatableInset * new_inset)
{ {
users->beforeChange(); beforeChange();
users->text->FinishUndo(); text->FinishUndo();
insertInset(new_inset); insertInset(new_inset);
users->text->CursorLeft(); text->CursorLeft();
users->update(1); update(1);
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
} }
/* This function should be in Buffer because it's a buffer's property (ale) */ // This function should be in Buffer because it's a buffer's property (ale)
string Buffer::getIncludeonlyList(char delim) string Buffer::getIncludeonlyList(char delim)
{ {
string lst; string lst;
@ -3834,7 +3811,7 @@ string Buffer::getIncludeonlyList(char delim)
} }
/* This is also a buffer property (ale) */ // This is also a buffer property (ale)
string Buffer::getReferenceList(char delim) string Buffer::getReferenceList(char delim)
{ {
/// if this is a child document and the parent is already loaded /// if this is a child document and the parent is already loaded
@ -3866,7 +3843,7 @@ string Buffer::getReferenceList(char delim)
} }
/* This is also a buffer property (ale) */ // This is also a buffer property (ale)
string Buffer::getBibkeyList(char delim) string Buffer::getBibkeyList(char delim)
{ {
/// if this is a child document and the parent is already loaded /// if this is a child document and the parent is already loaded
@ -3920,16 +3897,15 @@ string Buffer::getBibkeyList(char delim)
} }
// candidate for move to BufferView
/* This is also a buffer property (ale) */ /* This is also a buffer property (ale) */
// Not so sure about that. a goto Label function can not be buffer local, just // Not so sure about that. a goto Label function can not be buffer local, just
// think how this will work in a multiwindo/buffer environment, all the // think how this will work in a multiwindo/buffer environment, all the
// cursors in all the views showing this buffer will move. (Lgb) // cursors in all the views showing this buffer will move. (Lgb)
// OK, then no cursor action should be allowed in buffer. (ale) // OK, then no cursor action should be allowed in buffer. (ale)
bool Buffer::gotoLabel(string const & label) bool BufferView::gotoLabel(string const & label)
{ {
LyXParagraph * par = paragraph; LyXParagraph * par = buffer()->paragraph;
LyXParagraph::size_type pos; LyXParagraph::size_type pos;
Inset * inset; Inset * inset;
while (par) { while (par) {
@ -3937,10 +3913,10 @@ bool Buffer::gotoLabel(string const & label)
while ((inset = par->ReturnNextInsetPointer(pos))){ while ((inset = par->ReturnNextInsetPointer(pos))){
for (int i = 0; i < inset->GetNumberOfLabels(); i++) { for (int i = 0; i < inset->GetNumberOfLabels(); i++) {
if (label == inset->getLabel(i)) { if (label == inset->getLabel(i)) {
users->beforeChange(); beforeChange();
users->text->SetCursor(par, pos); text->SetCursor(par, pos);
users->text->sel_cursor = users->text->cursor; text->sel_cursor = text->cursor;
users->update(0); update(0);
return true; return true;
} }
} }
@ -3984,7 +3960,8 @@ void Buffer::markDepClean(string const & name)
} }
} }
void Buffer::Dispatch(const string & command)
void Buffer::Dispatch(string const & command)
{ {
// Split command string into command and argument // Split command string into command and argument
string cmd, line = frontStrip(command); string cmd, line = frontStrip(command);
@ -3993,7 +3970,8 @@ void Buffer::Dispatch(const string & command)
Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg.c_str()); Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg.c_str());
} }
void Buffer::Dispatch(int action, const string & argument)
void Buffer::Dispatch(int action, string const & argument)
{ {
switch (action) { switch (action) {
case LFUN_EXPORT: case LFUN_EXPORT:
@ -4005,5 +3983,4 @@ void Buffer::Dispatch(int action, const string & argument)
break; break;
} // end of switch } // end of switch
} }

View File

@ -120,7 +120,7 @@ public:
} }
/// Open and lock an updatable inset /// Open and lock an updatable inset
void open_new_inset(UpdatableInset *); //void open_new_inset(UpdatableInset *);
/// ///
void loadAutoSaveFile(); void loadAutoSaveFile();
@ -136,7 +136,7 @@ public:
bool readLyXformat2(LyXLex &, LyXParagraph * par = 0); bool readLyXformat2(LyXLex &, LyXParagraph * par = 0);
/// Inserts a lyx file at cursor position. Returns false if it fails. /// Inserts a lyx file at cursor position. Returns false if it fails.
bool insertLyXFile(string const & filename); //bool insertLyXFile(string const & filename);
/// Write file. Returns false if unsuccesful. /// Write file. Returns false if unsuccesful.
bool writeFile(string const &, bool); bool writeFile(string const &, bool);
@ -296,11 +296,11 @@ public:
/** Insert an inset into the buffer /** Insert an inset into the buffer
Insert inset into buffer, placing it in a layout of lout, Insert inset into buffer, placing it in a layout of lout,
if no_table make sure that it doesn't end up in a table. */ if no_table make sure that it doesn't end up in a table. */
void insertInset(Inset *, string const & lout = string(), //void insertInset(Inset *, string const & lout = string(),
bool no_table = false); // bool no_table = false);
/// ///
void setCursorFromRow (int); //void setCursorFromRow (int);
/// ///
string getIncludeonlyList(char delim = ','); string getIncludeonlyList(char delim = ',');
@ -309,10 +309,10 @@ public:
/// ///
string getBibkeyList(char delim = '|'); string getBibkeyList(char delim = '|');
/// ///
bool gotoLabel(string const &); //bool gotoLabel(string const &);
/// removes all autodeletable insets /// removes all autodeletable insets
bool removeAutoInsets(); //bool removeAutoInsets();
/** This will clearly have to change later. Later we can have more /** This will clearly have to change later. Later we can have more
than one user per buffer. */ than one user per buffer. */
@ -346,9 +346,11 @@ public:
doing a 'nice' LaTeX file */ doing a 'nice' LaTeX file */
bool niceFile; bool niceFile;
/// Used when typesetting to place errorboxes.
TexRow texrow;
private: private:
/// ///
void insertErrors(TeXErrors &); //void insertErrors(TeXErrors &);
/// ///
void linuxDocHandleFootnote(ostream & os, void linuxDocHandleFootnote(ostream & os,
@ -425,8 +427,6 @@ private:
*/ */
BufferView * users; BufferView * users;
/// Used when typesetting to place errorboxes.
TexRow texrow;
}; };

View File

@ -249,7 +249,7 @@ void BufferList::resize()
bool BufferList::close(Buffer * buf) bool BufferList::close(Buffer * buf)
{ {
buf->getUser()->insetUnlock(); if (buf->getUser()) buf->getUser()->insetUnlock();
if (buf->paragraph && !buf->isLyxClean() && !quitting) { if (buf->paragraph && !buf->isLyxClean() && !quitting) {
ProhibitInput(); ProhibitInput();
@ -325,7 +325,8 @@ int BufferList::unlockInset(UpdatableInset * inset)
if (!inset) return 1; if (!inset) return 1;
for(BufferStorage::iterator it = bstore.begin(); for(BufferStorage::iterator it = bstore.begin();
it != bstore.end(); ++it) { it != bstore.end(); ++it) {
if ((*it)->getUser()->the_locking_inset == inset) { if ((*it)->getUser()
&& (*it)->getUser()->the_locking_inset == inset) {
(*it)->getUser()->insetUnlock(); (*it)->getUser()->insetUnlock();
return 0; return 0;
} }

View File

@ -82,7 +82,7 @@ inline
void InsetRef::gotoLabel() void InsetRef::gotoLabel()
{ {
if (master) { if (master) {
master->gotoLabel(getContents()); master->getUser()->gotoLabel(getContents());
} }
} }
#endif #endif

View File

@ -114,9 +114,6 @@ bool selection_possible = false;
// away. Definitely not the best solution, but I think it sorta works. // away. Definitely not the best solution, but I think it sorta works.
bool toggleall = true; bool toggleall = true;
void InsertCorrectQuote();
/* /*
This is the inset locking stuff needed for mathed -------------------- This is the inset locking stuff needed for mathed --------------------
@ -157,11 +154,11 @@ void UpdateInset(Inset * inset, bool mark_dirty = true);
/* these functions return 1 if an error occured, /* these functions return 1 if an error occured,
otherwise 0 */ otherwise 0 */
// Now they work only for updatable insets. [Alejandro 080596] // Now they work only for updatable insets. [Alejandro 080596]
int LockInset(UpdatableInset * inset); //int LockInset(UpdatableInset * inset);
void ToggleLockedInsetCursor(long x, long y, int asc, int desc); void ToggleLockedInsetCursor(long x, long y, int asc, int desc);
void FitLockedInsetCursor(long x, long y, int asc, int desc); //void FitLockedInsetCursor(long x, long y, int asc, int desc);
int UnlockInset(UpdatableInset * inset); //int UnlockInset(UpdatableInset * inset);
void LockedInsetStoreUndo(Undo::undo_kind kind); //void LockedInsetStoreUndo(Undo::undo_kind kind);
/* this is for asyncron updating. UpdateInsetUpdateList will be called /* this is for asyncron updating. UpdateInsetUpdateList will be called
automatically from LyX. Just insert the Inset into the Updatelist */ automatically from LyX. Just insert the Inset into the Updatelist */
@ -177,17 +174,6 @@ InsetUpdateStruct * InsetUpdateList = 0;
/* some function prototypes */ /* some function prototypes */
void GotoNote();
void OpenStuff();
void ToggleFloat();
void MenuUndo();
void MenuRedo();
void HyphenationPoint();
void MenuSeparator();
void HFill();
void Newline();
void ProtectedBlank();
void CopyCB();
int RunLinuxDoc(int, string const &); int RunLinuxDoc(int, string const &);
int RunDocBook(int, string const &); int RunDocBook(int, string const &);
void MenuWrite(Buffer * buf); void MenuWrite(Buffer * buf);
@ -1229,7 +1215,7 @@ void MenuInsertLabel(char const * arg)
if (!label.empty()) { if (!label.empty()) {
InsetLabel * new_inset = new InsetLabel; InsetLabel * new_inset = new InsetLabel;
new_inset->setContents(label); new_inset->setContents(label);
current_view->buffer()->insertInset(new_inset); current_view->insertInset(new_inset);
} }
AllowInput(); AllowInput();
} }
@ -1431,13 +1417,11 @@ int RunDocBook(int flag, string const & filename)
} }
// candidate for move to BufferView void BufferView::allFloats(char flag, char figmar)
void AllFloats(char flag, char figmar)
{ {
if (!current_view->available()) if (!available()) return;
return;
LyXCursor cursor = current_view->text->cursor; LyXCursor cursor = text->cursor;
if (!flag && cursor.par->footnoteflag != LyXParagraph::NO_FOOTNOTE if (!flag && cursor.par->footnoteflag != LyXParagraph::NO_FOOTNOTE
&& ((figmar && ((figmar
@ -1449,15 +1433,15 @@ void AllFloats(char flag, char figmar)
&& cursor.par->footnotekind != LyXParagraph::WIDE_FIG && cursor.par->footnotekind != LyXParagraph::WIDE_FIG
&& cursor.par->footnotekind != LyXParagraph::WIDE_TAB && cursor.par->footnotekind != LyXParagraph::WIDE_TAB
&& cursor.par->footnotekind != LyXParagraph::ALGORITHM))) && cursor.par->footnotekind != LyXParagraph::ALGORITHM)))
ToggleFloat(); toggleFloat();
else else
current_view->beforeChange(); beforeChange();
LyXCursor tmpcursor = cursor; LyXCursor tmpcursor = cursor;
cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos); cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos);
cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos); cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos);
LyXParagraph *par = current_view->buffer()->paragraph; LyXParagraph *par = buffer()->paragraph;
while (par) { while (par) {
if (flag) { if (flag) {
if (par->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE if (par->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE
@ -1476,11 +1460,9 @@ void AllFloats(char flag, char figmar)
if (par->previous if (par->previous
&& par->previous->footnoteflag != && par->previous->footnoteflag !=
LyXParagraph::CLOSED_FOOTNOTE){ /* should be */ LyXParagraph::CLOSED_FOOTNOTE){ /* should be */
current_view->text text->SetCursorIntern(par->previous,
->SetCursorIntern(par 0);
->previous, text->OpenFootnote();
0);
current_view->text->OpenFootnote();
} }
} }
} }
@ -1508,17 +1490,17 @@ void AllFloats(char flag, char figmar)
) )
) )
) { ) {
current_view->text->SetCursorIntern(par, 0); text->SetCursorIntern(par, 0);
current_view->text->CloseFootnote(); text->CloseFootnote();
} }
} }
par = par->next; par = par->next;
} }
current_view->text->SetCursorIntern(cursor.par, cursor.pos); text->SetCursorIntern(cursor.par, cursor.pos);
current_view->redraw(); redraw();
current_view->fitCursor(); fitCursor();
current_view->updateScrollbar(); updateScrollbar();
} }
@ -2102,169 +2084,152 @@ void MenuLayoutSave()
} }
// candidate for move to BufferView void BufferView::insertNote()
void NoteCB()
{ {
InsetInfo * new_inset = new InsetInfo(); InsetInfo * new_inset = new InsetInfo();
current_view->buffer()->insertInset(new_inset); insertInset(new_inset);
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
} }
// candidate for move to BufferView void BufferView::openStuff()
void OpenStuff()
{ {
if (current_view->available()) { if (available()) {
current_view->owner()->getMiniBuffer()->Set(_("Open/Close...")); owner()->getMiniBuffer()->Set(_("Open/Close..."));
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->beforeChange(); beforeChange();
current_view->update(-2); update(-2);
current_view->text->OpenStuff(); text->OpenStuff();
current_view->update(0); update(0);
} }
} }
// candidate for move to BufferView void BufferView::toggleFloat()
void ToggleFloat()
{ {
if (current_view->available()) { if (available()) {
current_view->owner()->getMiniBuffer()->Set(_("Open/Close...")); owner()->getMiniBuffer()->Set(_("Open/Close..."));
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->beforeChange(); beforeChange();
current_view->update(-2); update(-2);
current_view->text->ToggleFootnote(); text->ToggleFootnote();
current_view->update(0); update(0);
} }
} }
// candidate for move to BufferView void BufferView::menuUndo()
void MenuUndo()
{ {
/* if (current_view->buffer()->the_locking_inset) { if (available()) {
current_view->owner()->getMiniBuffer()->Set(_("Undo not yet supported in math mode")); owner()->getMiniBuffer()->Set(_("Undo"));
return; getScreen()->HideCursor();
}*/ beforeChange();
update(-2);
if (current_view->available()) { if (!text->TextUndo())
current_view->owner()->getMiniBuffer()->Set(_("Undo")); owner()->getMiniBuffer()->Set(_("No further undo information"));
current_view->getScreen()->HideCursor();
current_view->beforeChange();
current_view->update(-2);
if (!current_view->text->TextUndo())
current_view->owner()->getMiniBuffer()->Set(_("No further undo information"));
else else
current_view->update(-1); update(-1);
} }
} }
// candidate for move to BufferView void BufferView::menuRedo()
void MenuRedo()
{ {
if (current_view->the_locking_inset) { if (the_locking_inset) {
current_view->owner()->getMiniBuffer()->Set(_("Redo not yet supported in math mode")); owner()->getMiniBuffer()->Set(_("Redo not yet supported in math mode"));
return; return;
} }
if (current_view->available()) { if (available()) {
current_view->owner()->getMiniBuffer()->Set(_("Redo")); owner()->getMiniBuffer()->Set(_("Redo"));
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->beforeChange(); beforeChange();
current_view->update(-2); update(-2);
if (!current_view->text->TextRedo()) if (!text->TextRedo())
current_view->owner()->getMiniBuffer()->Set(_("No further redo information")); owner()->getMiniBuffer()->Set(_("No further redo information"));
else else
current_view->update(-1); update(-1);
} }
} }
// candidate for move to BufferView void BufferView::hyphenationPoint()
void HyphenationPoint()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
InsetSpecialChar * new_inset = InsetSpecialChar * new_inset =
new InsetSpecialChar(InsetSpecialChar::HYPHENATION); new InsetSpecialChar(InsetSpecialChar::HYPHENATION);
current_view->buffer()->insertInset(new_inset); insertInset(new_inset);
} }
} }
// candidate for move to BufferView void BufferView::ldots()
void Ldots()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
InsetSpecialChar * new_inset = InsetSpecialChar * new_inset =
new InsetSpecialChar(InsetSpecialChar::LDOTS); new InsetSpecialChar(InsetSpecialChar::LDOTS);
current_view->buffer()->insertInset(new_inset); insertInset(new_inset);
} }
} }
// candidate for move to BufferView void BufferView::endOfSentenceDot()
void EndOfSentenceDot()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
InsetSpecialChar * new_inset = InsetSpecialChar * new_inset =
new InsetSpecialChar(InsetSpecialChar::END_OF_SENTENCE); new InsetSpecialChar(InsetSpecialChar::END_OF_SENTENCE);
current_view->buffer()->insertInset(new_inset); insertInset(new_inset);
} }
} }
// candidate for move to BufferView void BufferView::menuSeparator()
void MenuSeparator()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
InsetSpecialChar * new_inset = InsetSpecialChar * new_inset =
new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR); new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR);
current_view->buffer()->insertInset(new_inset); insertInset(new_inset);
} }
} }
// candidate for move to BufferView void BufferView::newline()
void Newline()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
current_view->text->InsertChar(LyXParagraph::META_NEWLINE); text->InsertChar(LyXParagraph::META_NEWLINE);
current_view->update(-1); update(-1);
} }
} }
// candidate for move to BufferView void BufferView::protectedBlank()
void ProtectedBlank()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
current_view->text->InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR); text->InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR);
current_view->update(-1); update(-1);
} }
} }
// candidate for move to BufferView void BufferView::hfill()
void HFill()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
current_view->text->InsertChar(LyXParagraph::META_HFILL); text->InsertChar(LyXParagraph::META_HFILL);
current_view->update(-1); update(-1);
} }
} }
@ -2393,10 +2358,6 @@ void ToggleAndShow(LyXFont const & font)
current_view->text->ToggleFree(font, toggleall); current_view->text->ToggleFree(font, toggleall);
current_view->update(1); current_view->update(1);
} }
// removed since it overrides the ToggleFree Message about the style
// Since Styles are more "High Level" than raw fonts I think the user
// prefers it like this Matthias
// FontStateShowCB( 0, 0 );
} }
@ -2437,78 +2398,73 @@ extern "C" void TableCB(FL_OBJECT *, long)
} }
// candidate for move to BufferView void BufferView::copyEnvironment()
void CopyEnvironmentCB()
{ {
if (current_view->available()) { if (available()) {
current_view->text->copyEnvironmentType(); text->copyEnvironmentType();
/* clear the selection, even if mark_set */ // clear the selection, even if mark_set
current_view->getScreen()->ToggleSelection(); getScreen()->ToggleSelection();
current_view->text->ClearSelection(); text->ClearSelection();
current_view->update(-2); update(-2);
current_view->owner()->getMiniBuffer()->Set(_("Paragraph environment type copied")); owner()->getMiniBuffer()->Set(_("Paragraph environment type copied"));
} }
} }
// candidate for move to BufferView void BufferView::pasteEnvironment()
void PasteEnvironmentCB()
{ {
if (current_view->available()) { if (available()) {
current_view->text->pasteEnvironmentType(); text->pasteEnvironmentType();
current_view->owner()->getMiniBuffer()->Set(_("Paragraph environment type set")); owner()->getMiniBuffer()->Set(_("Paragraph environment type set"));
current_view->update(1); update(1);
} }
} }
// candidate for move to BufferView void BufferView::copy()
void CopyCB()
{ {
if (current_view->available()) { if (available()) {
current_view->text->CopySelection(); text->CopySelection();
/* clear the selection, even if mark_set */ // clear the selection, even if mark_set
current_view->getScreen()->ToggleSelection(); getScreen()->ToggleSelection();
current_view->text->ClearSelection(); text->ClearSelection();
current_view->update(-2); update(-2);
current_view->owner()->getMiniBuffer()->Set(_("Copy")); owner()->getMiniBuffer()->Set(_("Copy"));
} }
} }
// candidate for move to BufferView void BufferView::cut()
void CutCB()
{ {
if (current_view->available()) { if (available()) {
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
current_view->text->CutSelection(); text->CutSelection();
current_view->update(1); update(1);
current_view->owner()->getMiniBuffer()->Set(_("Cut")); owner()->getMiniBuffer()->Set(_("Cut"));
} }
} }
// candidate for move to BufferView void BufferView::paste()
void PasteCB()
{ {
if (!current_view->available()) return; if (!available()) return;
current_view->owner()->getMiniBuffer()->Set(_("Paste")); owner()->getMiniBuffer()->Set(_("Paste"));
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
/* clear the selection */ // clear the selection
current_view->getScreen()->ToggleSelection(); getScreen()->ToggleSelection();
current_view->text->ClearSelection(); text->ClearSelection();
current_view->update(-2); update(-2);
/* paste */ // paste
current_view->text->PasteSelection(); text->PasteSelection();
current_view->update(1); update(1);
/* clear the selection */ // clear the selection
current_view->getScreen()->ToggleSelection(); getScreen()->ToggleSelection();
current_view->text->ClearSelection(); text->ClearSelection();
current_view->update(-2); update(-2);
} }
@ -3104,54 +3060,46 @@ extern "C" void DocumentBulletsCB(FL_OBJECT *, long)
} }
// candidate for move to BufferView void BufferView::gotoNote()
void GotoNote()
{ {
if (!current_view->getScreen()) if (!getScreen()) return;
return;
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->beforeChange(); beforeChange();
current_view->update(-2); update(-2);
LyXCursor tmp; LyXCursor tmp;
if (!current_view->text->GotoNextNote()) { if (!text->GotoNextNote()) {
if (current_view->text->cursor.pos if (text->cursor.pos
|| current_view->text->cursor.par != || text->cursor.par != text->FirstParagraph()) {
current_view->text->FirstParagraph()) tmp = text->cursor;
{ text->cursor.par = text->FirstParagraph();
tmp = current_view->text->cursor; text->cursor.pos = 0;
current_view->text->cursor.par = if (!text->GotoNextNote()) {
current_view->text->FirstParagraph(); text->cursor = tmp;
current_view->text->cursor.pos = 0; owner()->getMiniBuffer()->Set(_("No more notes"));
if (!current_view->text->GotoNextNote()) {
current_view->text->cursor = tmp;
current_view->owner()->getMiniBuffer()->Set(_("No more notes"));
LyXBell(); LyXBell();
} }
} else { } else {
current_view->owner()->getMiniBuffer()->Set(_("No more notes")); owner()->getMiniBuffer()->Set(_("No more notes"));
LyXBell(); LyXBell();
} }
} }
current_view->update(0); update(0);
current_view->text->sel_cursor = text->sel_cursor = text->cursor;
current_view->text->cursor;
} }
// candidate for move to BufferView void BufferView::insertCorrectQuote()
void InsertCorrectQuote()
{ {
Buffer * cbuffer = current_view->buffer();
char c; char c;
if (current_view->text->cursor.pos ) if (text->cursor.pos)
c = current_view->text->cursor.par->GetChar(current_view->text->cursor.pos - 1); c = text->cursor.par->GetChar(text->cursor.pos - 1);
else else
c = ' '; c = ' ';
cbuffer->insertInset(new InsetQuotes(c, cbuffer->params)); insertInset(new InsetQuotes(c, buffer()->params));
} }
@ -3525,7 +3473,7 @@ extern "C" void FigureApplyCB(FL_OBJECT *, long)
if (fl_get_button(fd_form_figure->radio_inline) if (fl_get_button(fd_form_figure->radio_inline)
|| current_view->text->cursor.par->table) { || current_view->text->cursor.par->table) {
InsetFig * new_inset = new InsetFig(100, 20, buffer); InsetFig * new_inset = new InsetFig(100, 20, buffer);
buffer->insertInset(new_inset); current_view->insertInset(new_inset);
current_view->owner()->getMiniBuffer()->Set(_("Figure inserted")); current_view->owner()->getMiniBuffer()->Set(_("Figure inserted"));
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
return; return;
@ -3574,7 +3522,7 @@ extern "C" void FigureApplyCB(FL_OBJECT *, long)
current_view->update(-1); current_view->update(-1);
Inset * new_inset = new InsetFig(100, 100, buffer); Inset * new_inset = new InsetFig(100, 100, buffer);
buffer->insertInset(new_inset); current_view->insertInset(new_inset);
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
current_view->update(0); current_view->update(0);
current_view->owner()->getMiniBuffer()->Set(_("Figure inserted")); current_view->owner()->getMiniBuffer()->Set(_("Figure inserted"));
@ -3661,74 +3609,66 @@ void Reconfigure()
} }
// candidate for move to BufferView
/* these functions are for the spellchecker */ /* these functions are for the spellchecker */
char * NextWord(float & value) char * BufferView::nextWord(float & value)
{ {
if (!current_view->available()){ if (!available()) {
value = 1; value = 1;
return 0; return 0;
} }
char * string = current_view->text->SelectNextWord(value); char * string = text->SelectNextWord(value);
return string; return string;
} }
// candidate for move to BufferView void BufferView::selectLastWord()
void SelectLastWord()
{ {
if (!current_view->available()) if (!available()) return;
return;
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->beforeChange(); beforeChange();
current_view->text->SelectSelectedWord(); text->SelectSelectedWord();
current_view->getScreen()->ToggleSelection(false); getScreen()->ToggleSelection(false);
current_view->update(0); update(0);
} }
// candidate for move to BufferView void BufferView::endOfSpellCheck()
void EndOfSpellCheck()
{ {
if (!current_view->available()) if (!available()) return;
return;
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->beforeChange(); beforeChange();
current_view->text->SelectSelectedWord(); text->SelectSelectedWord();
current_view->text->ClearSelection(); text->ClearSelection();
current_view->update(0); update(0);
} }
// candidate for move to BufferView void BufferView::replaceWord(string const & replacestring)
void ReplaceWord(string const & replacestring)
{ {
if (!current_view->getScreen()) if (!getScreen()) return;
return;
current_view->getScreen()->HideCursor(); getScreen()->HideCursor();
current_view->update(-2); update(-2);
/* clear the selection (if there is any) */ /* clear the selection (if there is any) */
current_view->getScreen()->ToggleSelection(false); getScreen()->ToggleSelection(false);
current_view->update(-2); update(-2);
/* clear the selection (if there is any) */ /* clear the selection (if there is any) */
current_view->getScreen()->ToggleSelection(false); getScreen()->ToggleSelection(false);
current_view->text-> text->ReplaceSelectionWithString(replacestring.c_str());
ReplaceSelectionWithString(replacestring.c_str());
current_view->text->SetSelectionOverString(replacestring.c_str()); text->SetSelectionOverString(replacestring.c_str());
// Go back so that replacement string is also spellchecked // Go back so that replacement string is also spellchecked
for (string::size_type i = 0; i < replacestring.length() + 1; ++i) { for (string::size_type i = 0; i < replacestring.length() + 1; ++i) {
current_view->text->CursorLeftIntern(); text->CursorLeftIntern();
} }
current_view->update(1); update(1);
} }
// End of spellchecker stuff // End of spellchecker stuff
@ -3932,7 +3872,7 @@ extern "C" void RefSelectCB(FL_OBJECT *, long data)
Inset * new_inset = Inset * new_inset =
new InsetRef(t, current_view->buffer()); new InsetRef(t, current_view->buffer());
current_view->buffer()->insertInset(new_inset); current_view->insertInset(new_inset);
} }
@ -4048,81 +3988,71 @@ void UpdateInset(Inset * inset, bool mark_dirty)
} }
// candidate for move to BufferView
/* these functions return 1 if an error occured, /* these functions return 1 if an error occured,
otherwise 0 */ otherwise 0 */
int LockInset(UpdatableInset * inset) int BufferView::lockInset(UpdatableInset * inset)
{ {
if (!current_view->the_locking_inset && inset){ if (!the_locking_inset && inset){
current_view->the_locking_inset = inset; the_locking_inset = inset;
return 0; return 0;
} }
return 1; return 1;
} }
// candidate for move to BufferView void BufferView::showLockedInsetCursor(long x, long y, int asc, int desc)
void ShowLockedInsetCursor(long x, long y, int asc, int desc)
{ {
if (current_view->the_locking_inset && if (the_locking_inset && getScreen()) {
current_view->getScreen()){ y += text->cursor.y;
y += current_view->text->cursor.y; getScreen()->ShowManualCursor(x, y,
current_view->getScreen()->ShowManualCursor(x, y, asc, desc);
asc, desc);
} }
} }
// candidate for move to BufferView void BufferView::hideLockedInsetCursor(long x, long y, int asc, int desc)
void HideLockedInsetCursor(long x, long y, int asc, int desc)
{ {
if (current_view->the_locking_inset && if (the_locking_inset && getScreen()) {
current_view->getScreen()){ y += text->cursor.y;
y += current_view->text->cursor.y; getScreen()->HideManualCursor(x, y,
current_view->getScreen()->HideManualCursor(x, y, asc, desc);
asc, desc);
} }
} }
// candidate for move to BufferView void BufferView::fitLockedInsetCursor(long x, long y, int asc, int desc)
void FitLockedInsetCursor(long x, long y, int asc, int desc)
{ {
if (current_view->the_locking_inset && if (the_locking_inset && getScreen()){
current_view->getScreen()){ y += text->cursor.y;
y += current_view->text->cursor.y; if (getScreen()->FitManualCursor(x, y, asc, desc))
if (current_view->getScreen()->FitManualCursor(x, y, asc, desc)) updateScrollbar();
current_view->updateScrollbar();
} }
} }
// candidate for move to BufferView int BufferView::unlockInset(UpdatableInset * inset)
int UnlockInset(UpdatableInset * inset)
{ {
if (inset && if (inset && the_locking_inset == inset) {
current_view->the_locking_inset == inset){
inset->InsetUnlock(); inset->InsetUnlock();
current_view->the_locking_inset = 0; the_locking_inset = 0;
current_view->text->FinishUndo(); text->FinishUndo();
return 0; return 0;
} }
return bufferlist.unlockInset(inset); return bufferlist.unlockInset(inset);
} }
// candidate for move to BufferView void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
void LockedInsetStoreUndo(Undo::undo_kind kind)
{ {
if (!current_view->the_locking_inset) if (!the_locking_inset)
return; // shouldn't happen return; // shouldn't happen
if (kind == Undo::EDIT) // in this case insets would not be stored! if (kind == Undo::EDIT) // in this case insets would not be stored!
kind = Undo::FINISH; kind = Undo::FINISH;
current_view->text->SetUndo(kind, text->SetUndo(kind,
current_view->text->cursor.par-> text->cursor.par->
ParFromPos(current_view->text->cursor.pos)->previous, ParFromPos(text->cursor.pos)->previous,
current_view->text->cursor.par-> text->cursor.par->
ParFromPos(current_view->text->cursor.pos)->next); ParFromPos(text->cursor.pos)->next);
} }

View File

@ -38,14 +38,6 @@ extern "C" void DepthCB(FL_OBJECT *, long);
/// ///
extern void FreeCB(); extern void FreeCB();
/// ///
extern void CutCB();
///
extern void PasteCB();
///
extern void CopyCB();
///
extern void NoteCB();
///
extern void HtmlUrlCB(); extern void HtmlUrlCB();
/// ///
extern void UrlCB(); extern void UrlCB();
@ -71,9 +63,9 @@ extern void AllowInput();
/// ///
struct InsetUpdateStruct { struct InsetUpdateStruct {
/// ///
Inset* inset; Inset * inset;
/// ///
InsetUpdateStruct* next; InsetUpdateStruct * next;
}; };
#endif #endif

View File

@ -96,19 +96,6 @@ extern tex_accent_struct get_accent(kb_action action);
extern void AutoSave(); extern void AutoSave();
extern void MenuSearch(); extern void MenuSearch();
extern void CopyCB();
extern void CopyEnvironmentCB();
extern void PasteEnvironmentCB();
extern void GotoNote();
extern void NoteCB();
extern void OpenStuff();
extern void HyphenationPoint();
extern void Ldots();
extern void EndOfSentenceDot();
extern void MenuSeparator();
extern void HFill();
extern void MenuUndo();
extern void MenuRedo();
extern void SetUpdateTimer(float timer = 0.3); extern void SetUpdateTimer(float timer = 0.3);
extern void FreeUpdateTimer(); extern void FreeUpdateTimer();
extern bool MenuPreview(Buffer *); extern bool MenuPreview(Buffer *);
@ -132,7 +119,7 @@ extern void Reconfigure();
extern int current_layout; extern int current_layout;
extern int getISOCodeFromLaTeX(char *); extern int getISOCodeFromLaTeX(char *);
extern int UnlockInset(UpdatableInset *); //extern int UnlockInset(UpdatableInset *);
extern void ShowLatexLog(); extern void ShowLatexLog();
@ -209,7 +196,7 @@ int LyXFunc::processKeyEvent(XEvent * ev)
if (owner->view()->available() && if (owner->view()->available() &&
owner->view()->the_locking_inset && owner->view()->the_locking_inset &&
keysym_return == XK_Escape) { keysym_return == XK_Escape) {
UnlockInset(owner->view()->the_locking_inset); owner->view()->unlockInset(owner->view()->the_locking_inset);
owner->view()->text->CursorRight(); owner->view()->text->CursorRight();
return 0; return 0;
} }
@ -534,8 +521,8 @@ string LyXFunc::Dispatch(int ac,
UpdatableInset * inset = UpdatableInset * inset =
owner->view()->the_locking_inset; owner->view()->the_locking_inset;
inset->GetCursorPos(slx, sly); inset->GetCursorPos(slx, sly);
UnlockInset(inset); owner->view()->unlockInset(inset);
MenuUndo(); owner->view()->menuUndo();
inset = static_cast<UpdatableInset*>(owner->view()->text->cursor.par->GetInset(owner->view()->text->cursor.pos)); inset = static_cast<UpdatableInset*>(owner->view()->text->cursor.par->GetInset(owner->view()->text->cursor.pos));
if (inset) if (inset)
inset->Edit(slx, sly); inset->Edit(slx, sly);
@ -545,8 +532,8 @@ string LyXFunc::Dispatch(int ac,
int slx, sly; int slx, sly;
UpdatableInset * inset = owner->view()->the_locking_inset; UpdatableInset * inset = owner->view()->the_locking_inset;
inset->GetCursorPos(slx, sly); inset->GetCursorPos(slx, sly);
UnlockInset(inset); owner->view()->unlockInset(inset);
MenuRedo(); owner->view()->menuRedo();
inset = static_cast<UpdatableInset*>(owner->view()->text->cursor.par->GetInset(owner->view()->text->cursor.pos)); inset = static_cast<UpdatableInset*>(owner->view()->text->cursor.par->GetInset(owner->view()->text->cursor.pos));
if (inset) if (inset)
inset->Edit(slx, sly); inset->Edit(slx, sly);
@ -792,28 +779,28 @@ string LyXFunc::Dispatch(int ac,
case LFUN_TOC_INSERT: case LFUN_TOC_INSERT:
{ {
Inset * new_inset = new InsetTOC(owner->buffer()); Inset * new_inset = new InsetTOC(owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
break; break;
} }
case LFUN_LOF_INSERT: case LFUN_LOF_INSERT:
{ {
Inset * new_inset = new InsetLOF(owner->buffer()); Inset * new_inset = new InsetLOF(owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
break; break;
} }
case LFUN_LOA_INSERT: case LFUN_LOA_INSERT:
{ {
Inset * new_inset = new InsetLOA(owner->buffer()); Inset * new_inset = new InsetLOA(owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
break; break;
} }
case LFUN_LOT_INSERT: case LFUN_LOT_INSERT:
{ {
Inset * new_inset = new InsetLOT(owner->buffer()); Inset * new_inset = new InsetLOT(owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
break; break;
} }
@ -830,11 +817,11 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_UNDO: case LFUN_UNDO:
MenuUndo(); owner->view()->menuUndo();
break; break;
case LFUN_REDO: case LFUN_REDO:
MenuRedo(); owner->view()->menuRedo();
break; break;
case LFUN_MENUSEARCH: case LFUN_MENUSEARCH:
@ -842,7 +829,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_PASTE: case LFUN_PASTE:
PasteCB(); owner->view()->paste();
break; break;
case LFUN_PASTESELECTION: case LFUN_PASTESELECTION:
@ -854,19 +841,19 @@ string LyXFunc::Dispatch(int ac,
} }
case LFUN_CUT: case LFUN_CUT:
CutCB(); owner->view()->cut();
break; break;
case LFUN_COPY: case LFUN_COPY:
CopyCB(); owner->view()->copy();
break; break;
case LFUN_LAYOUT_COPY: case LFUN_LAYOUT_COPY:
CopyEnvironmentCB(); owner->view()->copyEnvironment();
break; break;
case LFUN_LAYOUT_PASTE: case LFUN_LAYOUT_PASTE:
PasteEnvironmentCB(); owner->view()->pasteEnvironment();
break; break;
case LFUN_GOTOERROR: case LFUN_GOTOERROR:
@ -874,7 +861,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_REMOVEERRORS: case LFUN_REMOVEERRORS:
if (owner->buffer()->removeAutoInsets()) { if (owner->view()->removeAutoInsets()) {
owner->view()->redraw(); owner->view()->redraw();
owner->view()->fitCursor(); owner->view()->fitCursor();
owner->view()->updateScrollbar(); owner->view()->updateScrollbar();
@ -882,31 +869,31 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_GOTONOTE: case LFUN_GOTONOTE:
GotoNote(); owner->view()->gotoNote();
break; break;
case LFUN_OPENSTUFF: case LFUN_OPENSTUFF:
OpenStuff(); owner->view()->openStuff();
break; break;
case LFUN_HYPHENATION: case LFUN_HYPHENATION:
HyphenationPoint(); owner->view()->hyphenationPoint();
break; break;
case LFUN_LDOTS: case LFUN_LDOTS:
Ldots(); owner->view()->ldots();
break; break;
case LFUN_END_OF_SENTENCE: case LFUN_END_OF_SENTENCE:
EndOfSentenceDot(); owner->view()->endOfSentenceDot();
break; break;
case LFUN_MENU_SEPARATOR: case LFUN_MENU_SEPARATOR:
MenuSeparator(); owner->view()->menuSeparator();
break; break;
case LFUN_HFILL: case LFUN_HFILL:
HFill(); owner->view()->hfill();
break; break;
case LFUN_DEPTH: case LFUN_DEPTH:
@ -1255,7 +1242,7 @@ string LyXFunc::Dispatch(int ac,
if (!label.empty()) { if (!label.empty()) {
owner->view()->savePosition(); owner->view()->savePosition();
owner->buffer()->gotoLabel(label.c_str()); owner->view()->gotoLabel(label.c_str());
} }
} }
break; break;
@ -1605,7 +1592,7 @@ string LyXFunc::Dispatch(int ac,
// just comment out the lone below... // just comment out the lone below...
owner->view()->getScreen()->ShowCursor(); owner->view()->getScreen()->ShowCursor();
} else { } else {
CutCB(); owner->view()->cut();
} }
SetUpdateTimer(); SetUpdateTimer();
break; break;
@ -1649,7 +1636,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->smallUpdate(1); owner->view()->smallUpdate(1);
} }
} else { } else {
CutCB(); owner->view()->cut();
} }
SetUpdateTimer(); SetUpdateTimer();
} }
@ -1718,7 +1705,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->getScreen()->ShowCursor(); owner->view()->getScreen()->ShowCursor();
} }
} else { } else {
CutCB(); owner->view()->cut();
} }
SetUpdateTimer(); SetUpdateTimer();
} }
@ -1751,7 +1738,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->smallUpdate (1); owner->view()->smallUpdate (1);
} }
} else } else
CutCB(); owner->view()->cut();
SetUpdateTimer(); SetUpdateTimer();
} }
break; break;
@ -1825,7 +1812,7 @@ string LyXFunc::Dispatch(int ac,
new_inset = new InsetUrl("htmlurl", "", ""); new_inset = new InsetUrl("htmlurl", "", "");
else else
new_inset = new InsetUrl("url", "", ""); new_inset = new InsetUrl("url", "", "");
owner->buffer()->insertInset(new_inset); owner->view()->insertInset(new_inset);
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
} }
break; break;
@ -1919,7 +1906,7 @@ string LyXFunc::Dispatch(int ac,
owner->view()->buffer(bufferlist.loadLyXFile(s)); owner->view()->buffer(bufferlist.loadLyXFile(s));
// Set the cursor // Set the cursor
owner->buffer()->setCursorFromRow(row); owner->view()->setCursorFromRow(row);
// Recenter screen // Recenter screen
owner->view()->beforeChange(); owner->view()->beforeChange();
@ -2066,7 +2053,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_INSERT_MATRIX: case LFUN_INSERT_MATRIX:
{ {
if (owner->view()->available()) { if (owner->view()->available()) {
owner->buffer()-> owner->view()->
open_new_inset(new InsetFormula(false)); open_new_inset(new InsetFormula(false));
owner->view()-> owner->view()->
the_locking_inset->LocalDispatch(action, argument.c_str()); the_locking_inset->LocalDispatch(action, argument.c_str());
@ -2083,7 +2070,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_MATH_DISPLAY: case LFUN_MATH_DISPLAY:
{ {
if (owner->view()->available()) if (owner->view()->available())
owner->buffer()->open_new_inset(new InsetFormula(true)); owner->view()->open_new_inset(new InsetFormula(true));
break; break;
} }
@ -2096,7 +2083,7 @@ string LyXFunc::Dispatch(int ac,
else { else {
string s1 = token(s, ' ', 1); string s1 = token(s, ' ', 1);
int na = s1.empty() ? 0: atoi(s1.c_str()); int na = s1.empty() ? 0: atoi(s1.c_str());
owner->buffer()-> owner->view()->
open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na)); open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na));
} }
} }
@ -2107,7 +2094,7 @@ string LyXFunc::Dispatch(int ac,
{ {
if (owner->view()->available()) if (owner->view()->available())
owner->buffer()->open_new_inset(new InsetFormula); owner->view()->open_new_inset(new InsetFormula);
setMessage(N_("Math editor mode")); setMessage(N_("Math editor mode"));
} }
break; break;
@ -2132,9 +2119,9 @@ string LyXFunc::Dispatch(int ac,
new_inset->setOptions(token(lsarg, '|', 1)); new_inset->setOptions(token(lsarg, '|', 1));
} else } else
new_inset->setContents(lsarg); new_inset->setContents(lsarg);
owner->buffer()->insertInset(new_inset); owner->view()->insertInset(new_inset);
} else { } else {
owner->buffer()->insertInset(new_inset); owner->view()->insertInset(new_inset);
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
} }
} }
@ -2154,7 +2141,7 @@ string LyXFunc::Dispatch(int ac,
bibstyle, bibstyle,
owner->buffer()); owner->buffer());
owner->buffer()->insertInset(new_inset); owner->view()->insertInset(new_inset);
if (lsarg.empty()) { if (lsarg.empty()) {
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
} }
@ -2203,7 +2190,7 @@ string LyXFunc::Dispatch(int ac,
if (!argument.empty()) { if (!argument.empty()) {
string lsarg(argument); string lsarg(argument);
new_inset->setContents(lsarg); new_inset->setContents(lsarg);
owner->buffer()->insertInset(new_inset); owner->view()->insertInset(new_inset);
} else { } else {
//reh 98/09/21 //reh 98/09/21
//get the current word for an argument //get the current word for an argument
@ -2235,7 +2222,7 @@ string LyXFunc::Dispatch(int ac,
//put the new inset into the buffer. //put the new inset into the buffer.
// there should be some way of knowing the user // there should be some way of knowing the user
//cancelled & avoiding this, but i don't know how //cancelled & avoiding this, but i don't know how
owner->buffer()->insertInset(new_inset); owner->view()->insertInset(new_inset);
} }
} }
break; break;
@ -2243,7 +2230,7 @@ string LyXFunc::Dispatch(int ac,
case LFUN_INDEX_PRINT: case LFUN_INDEX_PRINT:
{ {
Inset * new_inset = new InsetPrintIndex(owner->buffer()); Inset * new_inset = new InsetPrintIndex(owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
} }
break; break;
@ -2251,7 +2238,7 @@ string LyXFunc::Dispatch(int ac,
{ {
lyxerr << "arg " << argument << endl; lyxerr << "arg " << argument << endl;
Inset * new_inset = new InsetParent(argument, owner->buffer()); Inset * new_inset = new InsetParent(argument, owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
} }
break; break;
@ -2259,7 +2246,7 @@ string LyXFunc::Dispatch(int ac,
{ {
Inset * new_inset = new InsetInclude(argument, Inset * new_inset = new InsetInclude(argument,
owner->buffer()); owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true); owner->view()->insertInset(new_inset, "Standard", true);
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
} }
break; break;
@ -2280,7 +2267,7 @@ string LyXFunc::Dispatch(int ac,
break; break;
case LFUN_INSERT_NOTE: case LFUN_INSERT_NOTE:
NoteCB(); owner->view()->insertNote();
break; break;
case LFUN_INSERTFOOTNOTE: case LFUN_INSERTFOOTNOTE:
@ -2803,7 +2790,7 @@ void LyXFunc::MenuInsertLyXFile(string const & filen)
// Inserts document // Inserts document
owner->getMiniBuffer()->Set(_("Inserting document"), owner->getMiniBuffer()->Set(_("Inserting document"),
MakeDisplayPath(filename), "..."); MakeDisplayPath(filename), "...");
bool res = owner->buffer()->insertLyXFile(filename); bool res = owner->view()->insertLyXFile(filename);
if (res) { if (res) {
owner->getMiniBuffer()->Set(_("Document"), owner->getMiniBuffer()->Set(_("Document"),
MakeDisplayPath(filename), MakeDisplayPath(filename),

View File

@ -42,12 +42,12 @@
#include "LyXView.h" #include "LyXView.h"
extern void UpdateInset(Inset * inset, bool mark_dirty = true); extern void UpdateInset(Inset * inset, bool mark_dirty = true);
extern void LockedInsetStoreUndo(Undo::undo_kind); //extern void LockedInsetStoreUndo(Undo::undo_kind);
extern void ShowLockedInsetCursor(long, long, int, int); //extern void ShowLockedInsetCursor(long, long, int, int);
extern void HideLockedInsetCursor(long, long, int, int); //extern void HideLockedInsetCursor(long, long, int, int);
extern void FitLockedInsetCursor(long, long, int, int); //extern void FitLockedInsetCursor(long, long, int, int);
extern int LockInset(UpdatableInset *); //extern int LockInset(UpdatableInset *);
extern int UnlockInset(UpdatableInset *); //extern int UnlockInset(UpdatableInset *);
extern GC canvasGC, mathGC, mathLineGC, latexGC, cursorGC, mathFrameGC; extern GC canvasGC, mathGC, mathLineGC, latexGC, cursorGC, mathFrameGC;
@ -483,7 +483,7 @@ void InsetFormula::Draw(LyXFont f, LyXScreen & scr, int baseline, float & x)
void InsetFormula::Edit(int x, int y) void InsetFormula::Edit(int x, int y)
{ {
mathcursor = new MathedCursor(par); mathcursor = new MathedCursor(par);
LockInset(this); current_view->lockInset(this);
par->Metrics(); par->Metrics();
UpdateInset(this, false); UpdateInset(this, false);
x += par->xo; x += par->xo;
@ -538,9 +538,9 @@ void InsetFormula::ToggleInsetCursor()
desc = font.maxDescent(); desc = font.maxDescent();
if (cursor_visible) if (cursor_visible)
HideLockedInsetCursor(x, y, asc, desc); current_view->hideLockedInsetCursor(x, y, asc, desc);
else else
ShowLockedInsetCursor(x, y, asc, desc); current_view->showLockedInsetCursor(x, y, asc, desc);
cursor_visible = !cursor_visible; cursor_visible = !cursor_visible;
} }
@ -556,7 +556,7 @@ void InsetFormula::ShowInsetCursor()
LyXFont font = WhichFont(LM_TC_TEXTRM, LM_ST_TEXT); LyXFont font = WhichFont(LM_TC_TEXTRM, LM_ST_TEXT);
asc = font.maxAscent(); asc = font.maxAscent();
desc = font.maxDescent(); desc = font.maxDescent();
FitLockedInsetCursor(x, y, asc, desc); current_view->fitLockedInsetCursor(x, y, asc, desc);
} }
ToggleInsetCursor(); ToggleInsetCursor();
} }
@ -786,24 +786,24 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
mathcursor->End(); mathcursor->End();
break; break;
case LFUN_DELETE_LINE_FORWARD: case LFUN_DELETE_LINE_FORWARD:
//LockedInsetStoreUndo(Undo::INSERT); //current_view->lockedInsetStoreUndo(Undo::INSERT);
LockedInsetStoreUndo(Undo::DELETE); current_view->lockedInsetStoreUndo(Undo::DELETE);
mathcursor->DelLine(); mathcursor->DelLine();
UpdateLocal(); UpdateLocal();
break; break;
case LFUN_BREAKLINE: case LFUN_BREAKLINE:
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
mathcursor->Insert(' ', LM_TC_CR); mathcursor->Insert(' ', LM_TC_CR);
par = mathcursor->GetPar(); par = mathcursor->GetPar();
UpdateLocal(); UpdateLocal();
break; break;
case LFUN_TAB: case LFUN_TAB:
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
mathcursor->Insert(0, LM_TC_TAB); mathcursor->Insert(0, LM_TC_TAB);
//UpdateInset(this); //UpdateInset(this);
break; break;
case LFUN_TABINSERT: case LFUN_TABINSERT:
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
mathcursor->Insert('T', LM_TC_TAB); mathcursor->Insert('T', LM_TC_TAB);
UpdateLocal(); UpdateLocal();
break; break;
@ -817,8 +817,8 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
} }
case LFUN_DELETE: case LFUN_DELETE:
//LockedInsetStoreUndo(Undo::INSERT); //current_view->lockedInsetStoreUndo(Undo::INSERT);
LockedInsetStoreUndo(Undo::DELETE); current_view->lockedInsetStoreUndo(Undo::DELETE);
mathcursor->Delete(); mathcursor->Delete();
UpdateInset(this); UpdateInset(this);
break; break;
@ -840,10 +840,10 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_PASTE: case LFUN_PASTE:
if (was_macro) if (was_macro)
mathcursor->MacroModeClose(); mathcursor->MacroModeClose();
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
mathcursor->SelPaste(); UpdateLocal(); break; mathcursor->SelPaste(); UpdateLocal(); break;
case LFUN_CUT: case LFUN_CUT:
LockedInsetStoreUndo(Undo::DELETE); current_view->lockedInsetStoreUndo(Undo::DELETE);
mathcursor->SelCut(); UpdateLocal(); break; mathcursor->SelCut(); UpdateLocal(); break;
case LFUN_COPY: mathcursor->SelCopy(); break; case LFUN_COPY: mathcursor->SelCopy(); break;
case LFUN_HOMESEL: case LFUN_HOMESEL:
@ -904,7 +904,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_MATH_NUMBER: case LFUN_MATH_NUMBER:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
if (disp_flag) { if (disp_flag) {
short type = par->GetType(); short type = par->GetType();
bool oldf = (type == LM_OT_PARN || type == LM_OT_MPARN); bool oldf = (type == LM_OT_PARN || type == LM_OT_MPARN);
@ -939,7 +939,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_MATH_LIMITS: case LFUN_MATH_LIMITS:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
if (mathcursor->Limits()) if (mathcursor->Limits())
UpdateLocal(); UpdateLocal();
} }
@ -955,14 +955,14 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_INSERT_MATH: case LFUN_INSERT_MATH:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
InsertSymbol(arg); InsertSymbol(arg);
break; break;
} }
case LFUN_INSERT_MATRIX: case LFUN_INSERT_MATRIX:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
int k, m, n; int k, m, n;
char s[80], arg2[80]; char s[80], arg2[80];
// This is just so that too long args won't ooze out of s. // This is just so that too long args won't ooze out of s.
@ -988,7 +988,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_MATH_DELIM: case LFUN_MATH_DELIM:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
char lf[40], rg[40], arg2[40]; char lf[40], rg[40], arg2[40];
int ilf = '(', irg = '.'; int ilf = '(', irg = '.';
latexkeys * l; latexkeys * l;
@ -1032,7 +1032,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_PROTECTEDSPACE: case LFUN_PROTECTEDSPACE:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
sp = new MathSpaceInset(1); sp = new MathSpaceInset(1);
mathcursor->Insert(sp); mathcursor->Insert(sp);
space_on = true; space_on = true;
@ -1042,7 +1042,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
case LFUN_INSERT_LABEL: case LFUN_INSERT_LABEL:
{ {
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
if (par->GetType() < LM_OT_PAR) break; if (par->GetType() < LM_OT_PAR) break;
string lb = arg; string lb = arg;
if (lb.empty()) { if (lb.empty()) {
@ -1069,8 +1069,8 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
} }
case LFUN_MATH_DISPLAY: case LFUN_MATH_DISPLAY:
//LockedInsetStoreUndo(Undo::INSERT); //current_view->lockedInsetStoreUndo(Undo::INSERT);
LockedInsetStoreUndo(Undo::EDIT); current_view->lockedInsetStoreUndo(Undo::EDIT);
display(!disp_flag); display(!disp_flag);
UpdateLocal(); UpdateLocal();
break; break;
@ -1099,7 +1099,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
default: default:
if ((action == -1 || action == LFUN_SELFINSERT) && arg) { if ((action == -1 || action == LFUN_SELFINSERT) && arg) {
unsigned char c = arg[0]; unsigned char c = arg[0];
LockedInsetStoreUndo(Undo::INSERT); current_view->lockedInsetStoreUndo(Undo::INSERT);
if (c == ' ' && mathcursor->getAccent() == LM_hat) { if (c == ' ' && mathcursor->getAccent() == LM_hat) {
c = '^'; c = '^';
@ -1214,7 +1214,7 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
if (result) if (result)
ShowInsetCursor(); ShowInsetCursor();
else else
UnlockInset(this); current_view->unlockInset(this);
return result; return result;
} }

View File

@ -39,8 +39,8 @@ using std::max;
#include "math_panel.h" #include "math_panel.h"
#include "math_parser.h" #include "math_parser.h"
extern void Update(signed char); //extern void Update(signed char);
extern int UnlockInset(UpdatableInset *); //extern int UnlockInset(UpdatableInset *);
extern short greek_kb_flag; extern short greek_kb_flag;
extern BufferView * current_view; extern BufferView * current_view;
@ -355,20 +355,21 @@ Bool math_insert_greek(char const c)
math_insert_symbol(s); math_insert_symbol(s);
if (greek_kb_flag<2) { if (greek_kb_flag<2) {
greek_kb_flag = 0; greek_kb_flag = 0;
UnlockInset(current_view->the_locking_inset); current_view->unlockInset(current_view->the_locking_inset);
} }
return True; return True;
} else } else
return False; return False;
} }
void math_insert_symbol(char const* s)
void math_insert_symbol(char const * s)
{ {
if (current_view->available()) { if (current_view->available()) {
if (!current_view->the_locking_inset) { if (!current_view->the_locking_inset) {
InsetFormula * new_inset = new InsetFormula(); InsetFormula * new_inset = new InsetFormula();
current_view->beforeChange(); current_view->beforeChange();
current_view->buffer()->insertInset(new_inset); current_view->insertInset(new_inset);
// Update(1);//BUG // Update(1);//BUG
new_inset->Edit(0, 0); new_inset->Edit(0, 0);
new_inset->InsertSymbol(s); new_inset->InsertSymbol(s);
@ -381,6 +382,7 @@ void math_insert_symbol(char const* s)
} }
} }
BitmapMenu * sym_menu= 0; BitmapMenu * sym_menu= 0;
void create_symbol_menues(FD_panel * symb_form) void create_symbol_menues(FD_panel * symb_form)

View File

@ -59,9 +59,6 @@ extern void ShowCopyright();
extern void show_symbols_form(LyXFunc *); extern void show_symbols_form(LyXFunc *);
extern void ProhibitInput(); extern void ProhibitInput();
extern void AllowInput(); extern void AllowInput();
extern void OpenStuff();
extern void ToggleFloat();
extern void AllFloats(char flag, char figmar);
extern void LaTeXOptions(); extern void LaTeXOptions();
// A bunch of wrappers // A bunch of wrappers
@ -1067,12 +1064,12 @@ void Menus::ShowEditMenu(FL_OBJECT * ob, long)
case 17: tmpfunc->Dispatch(LFUN_PASTESELECTION, "paragraph"); break; case 17: tmpfunc->Dispatch(LFUN_PASTESELECTION, "paragraph"); break;
// floats & insets sub-menu // floats & insets sub-menu
case 21: ToggleFloat(); break; case 21: men->currentView()->toggleFloat(); break;
case 22: tmpfunc->Dispatch(LFUN_MELT); break; case 22: tmpfunc->Dispatch(LFUN_MELT); break;
case 23: AllFloats(1, 0); break; case 23: men->currentView()->allFloats(1, 0); break;
case 24: AllFloats(0, 0); break; case 24: men->currentView()->allFloats(0, 0); break;
case 25: AllFloats(1, 1); break; case 25: men->currentView()->allFloats(1, 1); break;
case 26: AllFloats(0, 1); break; case 26: men->currentView()->allFloats(0, 1); break;
case 27: tmpfunc->Dispatch(LFUN_REMOVEERRORS); break; case 27: tmpfunc->Dispatch(LFUN_REMOVEERRORS); break;
case 31: tmpfunc->Dispatch(LFUN_TABLE); break; case 31: tmpfunc->Dispatch(LFUN_TABLE); break;

View File

@ -626,7 +626,7 @@ void ShowSpellChecker()
if (obj == fd_form_spell_check->done) break; if (obj == fd_form_spell_check->done) break;
} }
fl_hide_form(fd_form_spell_check->form_spell_check); fl_hide_form(fd_form_spell_check->form_spell_check);
EndOfSpellCheck(); current_view->endOfSpellCheck();
return; return;
} }
@ -666,7 +666,7 @@ bool RunSpellChecker(string const & lang)
ispell_terse_mode(); ispell_terse_mode();
while (true) { while (true) {
word = NextWord(newval); word = current_view->nextWord(newval);
if (word == 0) break; if (word == 0) break;
word_count++; word_count++;
@ -700,7 +700,7 @@ bool RunSpellChecker(string const & lang)
switch (result->flag) { switch (result->flag) {
case ISP_UNKNOWN: case ISP_UNKNOWN:
case ISP_MISSED: case ISP_MISSED:
SelectLastWord(); current_view->selectLastWord();
fl_set_object_label(fd_form_spell_check->text, word); fl_set_object_label(fd_form_spell_check->text, word);
fl_set_input(fd_form_spell_check->input, word); fl_set_input(fd_form_spell_check->input, word);
fl_clear_browser(fd_form_spell_check->browser); fl_clear_browser(fd_form_spell_check->browser);
@ -725,7 +725,7 @@ bool RunSpellChecker(string const & lang)
if (obj == fd_form_spell_check->replace || if (obj == fd_form_spell_check->replace ||
obj == fd_form_spell_check->input) { obj == fd_form_spell_check->input) {
ispell_store_replacement(word, fl_get_input(fd_form_spell_check->input)); ispell_store_replacement(word, fl_get_input(fd_form_spell_check->input));
ReplaceWord(fl_get_input(fd_form_spell_check->input)); current_view->replaceWord(fl_get_input(fd_form_spell_check->input));
break; break;
} }
if (obj == fd_form_spell_check->browser) { if (obj == fd_form_spell_check->browser) {
@ -734,7 +734,7 @@ bool RunSpellChecker(string const & lang)
if (clickline == if (clickline ==
fl_get_browser(fd_form_spell_check->browser)) { fl_get_browser(fd_form_spell_check->browser)) {
ispell_store_replacement(word, fl_get_input(fd_form_spell_check->input)); ispell_store_replacement(word, fl_get_input(fd_form_spell_check->input));
ReplaceWord(fl_get_input(fd_form_spell_check->input)); current_view->replaceWord(fl_get_input(fd_form_spell_check->input));
break; break;
} }
clickline = fl_get_browser(fd_form_spell_check->browser); clickline = fl_get_browser(fd_form_spell_check->browser);

View File

@ -4,21 +4,14 @@
/* These functions are defined in lyx_cb.C */ /* These functions are defined in lyx_cb.C */
/** The returned word has to be deleted manually
*/
char * NextWord(float & value);
/** MarkLastWord should only be used immidiately after NextWord(). /** MarkLastWord should only be used immidiately after NextWord().
If you give control back to the user, you _have_ to call EndOfSpellCheck() If you give control back to the user, you _have_ to call EndOfSpellCheck()
or SelectLastWord(), otherwise segfaults should appear. or SelectLastWord(), otherwise segfaults should appear.
*/ */
void EndOfSpellCheck(); //void EndOfSpellCheck();
/// ///
void SelectLastWord(); //void SelectLastWord();
///
void ReplaceWord(string const & replacestringstring);
/** This function has to be implemented by the spell checker. /** This function has to be implemented by the spell checker.
It will show the spellcheker form*/ It will show the spellcheker form*/

View File

@ -10,13 +10,22 @@ class block {
public: public:
typedef T value_type; typedef T value_type;
typedef size_t size_type; typedef size_t size_type;
typedef value_type * pointer; typedef T * pointer;
typedef value_type const * const_pointer; typedef T const * const_pointer;
typedef value_type & reference; typedef T & reference;
typedef value_type const & const_reference; typedef T const & const_reference;
typedef value_type * iterator; typedef T * iterator;
typedef value_type const * const_iterator; typedef T const * const_iterator;
size_type size() const { return s; } size_type size() const { return s; }
operator T* () { return arr; }
reference at(int i) {
Assert(i >= 0 && i < s);
return arr[i];
}
const_reference at(int i) const {
Assert(i >= 0 && i < s);
return arr[i];
}
reference operator[](int i) { return arr[i]; } reference operator[](int i) { return arr[i]; }
const_reference operator[](int i) const { return arr[i]; } const_reference operator[](int i) const { return arr[i]; }
void operator=(block const & b) { void operator=(block const & b) {
@ -37,7 +46,7 @@ public:
const_iterator begin() const { return arr[0]; } const_iterator begin() const { return arr[0]; }
const_iterator end() const { return arr[s]; } const_iterator end() const { return arr[s]; }
private: private:
value_type arr[s + 1]; T arr[s];
}; };
#endif // BLOCK_H_ #endif // BLOCK_H_

View File

@ -324,9 +324,21 @@ bool PutEnv(string const & envstr)
// Is doing a getenv() and a free() of the older value // Is doing a getenv() and a free() of the older value
// a good idea? (JMarc) // a good idea? (JMarc)
// Actually we don't have to leak...calling putenv like this // Actually we don't have to leak...calling putenv like this
// should be enough: // should be enough: ... and this is obviously not enough if putenv
// does not make a copy of the string. It is also not very wise to
// put a string on the free store. If we have to leak we should do it
// like this:
/*
char * leaker = new char[envstr.length() + 1];
envstr.copy(leaker, envstr.length());
leaker[envstr.length()] = '\0';
int retval = putenv(const_cast<PUTENV_TYPE_ARG>(leaker));
*/
// If putenv does not make a copy of the char const * this
// is very dangerous. OTOH if it does take a copy this is the
// best solution.
int retval = putenv(const_cast<PUTENV_TYPE_ARG>(envstr.c_str())); int retval = putenv(const_cast<PUTENV_TYPE_ARG>(envstr.c_str()));
//int retval = putenv(const_cast<PUTENV_TYPE_ARG>((new string(envstr))->c_str()));
#else #else
#ifdef HAVE_SETENV #ifdef HAVE_SETENV
string varname; string varname;

View File

@ -146,11 +146,12 @@ string tostr(long i)
char str[30]; char str[30];
ostrstream oss(str, 30); ostrstream oss(str, 30);
oss << i << '\0'; oss << i << '\0';
return oss.str();
#else #else
ostringstream oss; ostringstream oss;
oss << i; oss << i;
return oss.str().c_str();
#endif #endif
return oss.str();
} }
@ -160,11 +161,12 @@ string tostr(unsigned long i)
char str[30]; char str[30];
ostrstream oss(str, 30); ostrstream oss(str, 30);
oss << i << '\0'; oss << i << '\0';
return oss.str();
#else #else
ostringstream oss; ostringstream oss;
oss << i; oss << i;
return oss.str().c_str();
#endif #endif
return oss.str();
} }
@ -204,11 +206,12 @@ string tostr(double d)
char tmp[40]; char tmp[40];
ostrstream oss(tmp, 40); ostrstream oss(tmp, 40);
oss << d << '\0'; oss << d << '\0';
return oss.str();
#else #else
ostringstream oss; ostringstream oss;
oss << d; oss << d;
return oss.str().c_str();
#endif #endif
return oss.str();
} }

View File

@ -36,7 +36,7 @@ extern int mono_video;
extern int reverse_video; extern int reverse_video;
extern int fast_selection; extern int fast_selection;
extern BufferView * current_view; extern BufferView * current_view;
extern int UnlockInset(UpdatableInset * inset); //extern int UnlockInset(UpdatableInset * inset);
// ale070405 // ale070405
extern int bibitemMaxWidth(LyXFont const &); extern int bibitemMaxWidth(LyXFont const &);
@ -1648,7 +1648,7 @@ void LyXText::TableFeatures(int feature)
} }
case LyXTable::DELETE_ROW: case LyXTable::DELETE_ROW:
if (current_view->the_locking_inset) if (current_view->the_locking_inset)
UnlockInset(current_view->the_locking_inset); current_view->unlockInset(current_view->the_locking_inset);
RemoveTableRow(&cursor); RemoveTableRow(&cursor);
RedoParagraph(); RedoParagraph();
return; return;
@ -1658,7 +1658,7 @@ void LyXText::TableFeatures(int feature)
int cell_org = actCell; int cell_org = actCell;
int cell = 0; int cell = 0;
if (current_view->the_locking_inset) if (current_view->the_locking_inset)
UnlockInset(current_view->the_locking_inset); current_view->unlockInset(current_view->the_locking_inset);
do { do {
if (!pos || (cursor.par->IsNewline(pos-1))){ if (!pos || (cursor.par->IsNewline(pos-1))){
if (cursor.par->table->DeleteCellIfColumnIsDeleted(cell, cell_org)){ if (cursor.par->table->DeleteCellIfColumnIsDeleted(cell, cell_org)){

View File

@ -1059,7 +1059,6 @@ void LyXText::ToggleFree(LyXFont font, bool toggleall)
// Set font // Set font
SetFont(font, toggleall); SetFont(font, toggleall);
//current_view->owner()->getMiniBuffer()->Set(_("Font style changed"));
/* Implicit selections are cleared afterwards and cursor is set to the /* Implicit selections are cleared afterwards and cursor is set to the
original position. */ original position. */

View File

@ -18,7 +18,6 @@
extern LyXRC * lyxrc; extern LyXRC * lyxrc;
extern string DoAccent(string const &, tex_accent); extern string DoAccent(string const &, tex_accent);
extern void InsertCorrectQuote();
extern string DoAccent(char, tex_accent); extern string DoAccent(char, tex_accent);
extern BufferView * current_view; extern BufferView * current_view;
@ -290,7 +289,7 @@ void TransManager::insertVerbatim(string const & str, LyXText * text)
if (str[i] == '\"' if (str[i] == '\"'
&& text->GetFont(text->cursor.par, && text->GetFont(text->cursor.par,
text->cursor.pos).latex() == LyXFont::OFF) text->cursor.pos).latex() == LyXFont::OFF)
InsertCorrectQuote(); current_view->insertCorrectQuote();
else else
text->InsertChar(str[i]); text->InsertChar(str[i]);
} }