ok, some more changes, this time I have gotten the fonttable and insettable in lyxparagra converted correctly to stl::containsers, added some tags for move to using pdflatex, search for pdflatex,dvips,pdf2ps,xpdf etx. in lib/configure.m4. A couple of name changes. Lets prepare for 1.1.4 now. Read the ChangeLog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@412 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-01-11 01:59:00 +00:00
parent 1fd5e5ed97
commit e656d12d0b
16 changed files with 686 additions and 439 deletions

View File

@ -1,3 +1,23 @@
2000-01-10 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/lyx_cb.C (MakeLaTeXOutput): name change from MakeDVIOutput
(CreatePostscript): name change from MenuRunDVIPS (or something)
(PreviewPostscript): name change from MenuPreviewPS
(PreviewDVI): name change from MenuPreviewDVI
* lib/lyxrc.example: added \pdflatex_command, \pdf_mode,
\view_pdf_command., \pdf_to_ps_command
* lib/configure.m4: added search for PDF viewer, and search for
PDF to PS converter.
(lyxrc.defaults output): add \pdflatex_command,
\view_pdf_command and \pdf_to_ps_command.
* src/lyx_cb.C (MenuPreviewDVI): renamed from MenuPreview.
* src/bufferlist.C (write): we don't use blocksize for anything so
I removed it.
2000-01-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/support/block.h: disable operator T* (), since it causes
@ -24,6 +44,15 @@
* src/lyxlex.h: include LIstream.h, for Sun CC this time.
* src/mathed/math_defs.h: ditto.
2000-01-09 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/lyxrc.[Ch]: New tag and variable "\make_backup". Defaults to
true, decides if we create a backup file or not when saving. New
tag and variable \pdf_mode, defaults to false. New tag and
variable \pdflatex_command, defaults to pdflatex. New tag and
variable \view_pdf_command, defaults to xpdf. New tag and variable
\pdf_to_ps_command, defaults to pdf2ps.
2000-01-08 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/bufferlist.C (close): don't call insetUnlock if the buffer

View File

@ -45,14 +45,6 @@ towards code quality:
o always try to use POSIX commands.
o switch to use POSIX signals
o rewrite LString to be a true subset of STL string
then it will be _very_ easy to switch to
multibyte characters later if we want to.
o use STL storage containers (or prepare for it)
code reuse. Very often faster and better tested
than what we make/do ourselves.
o use C++ iostreams
better interface and typesafe
o make as much as possible of the code reentreanant(?)
should make it easier to move to threads later.
o signal slot mechanism (borrowed from GTK-- project)
@ -70,7 +62,6 @@ towards code quality:
Some other things related to structure and services in the code:
o change pathpush and pathpop to be a class instead.
o class FileInfo does way too much, move the unneeded parts to
a super class or friends.
o a process manager class to handle execution of external
@ -81,23 +72,8 @@ Some other things related to structure and services in the code:
the same time.
- to setup file descriptors where communicating with
the processes can take place.
o make a liblyx for functions/classes delivering services to LyX
- lyxsum
- FileInfo
- syscall/syscontr/syssingleton
- strerror.C
o get rid of definitions.h
o pass an inforeceiver around in the object structure.
(this instead of passing minibuffers, and lyxerrors.)
o get a regexp package (GNU) and use it in filedialogs, search
and the like.
Some small things to do with the linker:
o link partially in the subdirs, should make linking faster.
PostgreSQL does this so we should be able to do it
too.
================
@ -245,15 +221,11 @@ some packages, I think these are the packages supported by 0.12:
======================
Wild thoughts:
o the internal text-encoding could be Cork (T1)
o always keep the output file (.tex) 7bit.
o use plugins for insets.
======================
If you have other wishes for features, or comments, please let us know.
Lgb
Interesting links:
http://freshmeat.net/appindex/1999/11/30/943979651.html
http://freshmeat.net/appindex/1999/12/09/944757708.html

112
lib/configure vendored
View File

@ -331,6 +331,114 @@ if test -z "$GHOSTVIEW" ; then
fi
# Search for a program to preview pdf
echo $ac_n "checking for a PDF preview""... $ac_c"
echo "$ac_t""(xpdf acroread gv ghostview)"
PDFVIEWER=
for ac_prog in xpdf acroread gv ghostview
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog ; ac_word=$2
if test -n "$ac_word"; then
echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -x $ac_dir/$ac_word; then
PDFVIEWER="$ac_prog"
break
fi
done
IFS="$ac_save_ifs"
if test -n "$PDFVIEWER"; then
ac_result=yes
else
ac_result=no
fi
echo "$ac_t""$ac_result"
test -n "$PDFVIEWER" && break
fi
done
if test -z "$PDFVIEWER" ; then
PDFVIEWER=none
fi
# Search for a program to convert pdf to ps
echo $ac_n "checking for a PDF to PS converter""... $ac_c"
echo "$ac_t""(pdf2ps pdftops)"
PDFPS=
for ac_prog in pdf2ps pdftops
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog ; ac_word=$2
if test -n "$ac_word"; then
echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -x $ac_dir/$ac_word; then
PDFPS="$ac_prog"
break
fi
done
IFS="$ac_save_ifs"
if test -n "$PDFPS"; then
ac_result=yes
else
ac_result=no
fi
echo "$ac_t""$ac_result"
test -n "$PDFPS" && break
fi
done
if test -z "$PDFPS" ; then
PDFPS=none
fi
# Search for a program to convert dvi to ps
echo $ac_n "checking for a DVI to PS converter""... $ac_c"
echo "$ac_t""(dvips)"
DVIPS=
for ac_prog in dvips
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog ; ac_word=$2
if test -n "$ac_word"; then
echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -x $ac_dir/$ac_word; then
DVIPS="$ac_prog"
break
fi
done
IFS="$ac_save_ifs"
if test -n "$DVIPS"; then
ac_result=yes
else
ac_result=no
fi
echo "$ac_t""$ac_result"
test -n "$DVIPS" && break
fi
done
if test -z "$DVIPS" ; then
DVIPS=none
fi
# Search a *roff program (used to translate tables in ASCII export)
echo $ac_n "checking for a *roff formatter""... $ac_c"
echo "$ac_t""(groff nroff)"
@ -740,6 +848,10 @@ cat >lyxrc.defaults <<EOF
# ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
# override the values given here.
\\latex_command "$LATEX"
\\pdflatex_command "$PDFLATEX"
\\view_pdf_command "$PDFVIEWER"
\\pdf_to_ps_command "$PDFPS"
\\dvi_to_ps_command "$DVIPS"
\\relyx_command "$RELYX"
\\literate_command "$LITERATE"
\\literate_extension "$LITERATE_EXT"

View File

@ -194,6 +194,15 @@ SEARCH_PROG([for a Postscript interpreter],GS, gs)
# Search something to preview postscript
SEARCH_PROG([for a Postscript previewer],GHOSTVIEW,gv ghostview)
# Search for a program to preview pdf
SEARCH_PROG([for a PDF preview],PDFVIEWER,xpdf acroread gv ghostview)
# Search for a program to convert pdf to ps
SEARCH_PROG([for a PDF to PS converter],PDFPS,pdf2ps pdftops)
# Search for a program to convert dvi to ps
SEARCH_PROG([for a DVI to PS converter],DVIPS,dvips)
# Search a *roff program (used to translate tables in ASCII export)
SEARCH_PROG([for a *roff formatter],ROFF,groff nroff)
ascii_roff_command=$ROFF
@ -327,6 +336,10 @@ cat >lyxrc.defaults <<EOF
# ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
# override the values given here.
\\latex_command "$LATEX"
\\pdflatex_command "$PDFLATEX"
\\view_pdf_command "$PDFVIEWER"
\\pdf_to_ps_command "$PDFPS"
\\dvi_to_ps_command "$DVIPS"
\\relyx_command "$RELYX"
\\literate_command "$LITERATE"
\\literate_extension "$LITERATE_EXT"

View File

@ -94,6 +94,12 @@
# executive, a3, a4, a5, or b5 as the default papersize.
#\default_papersize "a4"
# Define which program to use to view pdf files here.
# You can include any options you need by "quoting" the entire command
# The default is auto-detected, but you might want to override it.
# Usual values are: xpdf, acroread, gv, ghostscript.
#\view_pdf_command "xpdf"
# Define which program to use to view postscript files here.
# You can include any options you need by "quoting" the entire command
# The default is auto-detected, but you might want to override it.
@ -418,6 +424,17 @@
# here:
#\latex_command latex2e
# The command used to generate pdf files directly from a latex file.
# A program that works in anyother way is not guarantied to work.
#\pdflatex_command pdflatex
# The command used to generate postscript files from pdf files.
#\pdf_to_ps_command pdf2ps
# If to use pdf as native export format instead of dvi. This makes LyX use
# pdflatex, pdf2ps and other utility programs. Default is false.
#\pdf_mode false
# The font encoding used for the LaTeX2e fontenc package.
# T1 is highly recommended for non-English languages. LyX uses T1 as a
# default if you have the ec fonts installed on your system.

View File

@ -15,8 +15,8 @@
extern FD_form_sendto * fd_form_sendto;
extern BufferView * current_view;
extern int MakeDVIOutput(Buffer * buffer);
extern bool MenuRunDvips(Buffer * buffer, bool wait);
extern int MakeLaTeXOutput(Buffer * buffer);
extern bool CreatePostscript(Buffer * buffer, bool wait);
// Whereas this feature is under the menu item File->Export->Custom,
// I kept the old name sendto in the code because I am lazy (JMarc)
@ -57,7 +57,7 @@ void SendtoApplyCB(FL_OBJECT *, long)
fl_get_button(fd_form_sendto->radio_ftype_ps)) {
ProhibitInput();
// Generate dvi file and check if there are errors in the .lyx file
if (MakeDVIOutput(buffer) > 0) {
if (MakeLaTeXOutput(buffer) > 0) {
AllowInput();
return;
}
@ -74,7 +74,7 @@ void SendtoApplyCB(FL_OBJECT *, long)
ftypeext = ".txt";
else {
ftypeext = ".ps_tmp";
if (!MenuRunDvips(buffer, true)) {
if (!CreatePostscript(buffer, true)) {
return;
}
}
@ -94,7 +94,7 @@ void SendtoApplyCB(FL_OBJECT *, long)
if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
buffer->writeFile(fname, true);
// if the .tex file is requested save it to the tempdir
// as now we don't do the MakeDVIOutput anymore
// as now we don't do the MakeLaTeXOutput anymore
if (fl_get_button(fd_form_sendto->radio_ftype_latex))
buffer->makeLaTeXFile(fname, path, false);
// create the .txt file in tmp_dir if this filetype is requested

View File

@ -3167,7 +3167,9 @@ int Buffer::runLaTeX()
// do the LaTex run(s)
TeXErrors terr;
LaTeX latex(lyxrc->latex_command, name, filepath);
string latex_command = lyxrc->pdf_mode ?
lyxrc->pdflatex_command : lyxrc->latex_command;
LaTeX latex(latex_command, name, filepath);
int res = latex.run(terr,
users->owner()->getMiniBuffer()); // running latex
@ -3233,7 +3235,9 @@ int Buffer::runLiterate()
markDviDirty();
}
Literate literate(lyxrc->latex_command, name, filepath,
string latex_command = lyxrc->pdf_mode ?
lyxrc->pdflatex_command : lyxrc->latex_command;
Literate literate(latex_command, name, filepath,
lit_name,
lyxrc->literate_command, lyxrc->literate_error_filter,
lyxrc->build_command, lyxrc->build_error_filter);
@ -3301,8 +3305,10 @@ int Buffer::buildProgram()
makeLaTeXFile(lit_name, org_path, false);
markNwDirty();
}
Literate literate(lyxrc->latex_command, name, filepath,
string latex_command = lyxrc->pdf_mode ?
lyxrc->pdflatex_command : lyxrc->latex_command;
Literate literate(latex_command, name, filepath,
lit_name,
lyxrc->literate_command, lyxrc->literate_error_filter,
lyxrc->build_command, lyxrc->build_error_filter);

View File

@ -19,12 +19,9 @@
#include <config.h>
#include <fstream>
using std::ifstream;
using std::ofstream;
using std::ios;
#include <sys/types.h>
#include <utime.h>
#include "bufferlist.h"
#include "lyx_main.h"
#include "minibuffer.h"
@ -43,6 +40,10 @@ using std::ios;
extern BufferView * current_view;
extern int RunLinuxDoc(int, string const &);
using std::ifstream;
using std::ofstream;
using std::ios;
//
// Class BufferStorage
//
@ -131,8 +132,12 @@ bool BufferList::QwriteAll()
// Should probably be moved to somewhere else: BufferView? LyXView?
bool BufferList::write(Buffer * buf, bool makeBackup)
{
current_view->owner()->getMiniBuffer()->Set(_("Saving document"),
MakeDisplayPath(buf->fileName()), "...");
if (buf->getUser())
buf->getUser()
->owner()
->getMiniBuffer()
->Set(_("Saving document"),
MakeDisplayPath(buf->fileName()), "...");
// We don't need autosaves in the immediate future. (Asger)
buf->resetAutosaveTimers();
@ -171,15 +176,13 @@ bool BufferList::write(Buffer * buf, bool makeBackup)
times->actime = finfo.getAccessTime();
times->modtime = finfo.getModificationTime();
long blksize = finfo.getBlockSize();
lyxerr.debug() << "BlockSize: " << blksize << endl;
ifstream ifs(buf->fileName().c_str());
ofstream ofs(s.c_str(), ios::out|ios::trunc);
if (ifs && ofs) {
char c = 0;
while (ifs.get(c)) {
ofs.put(c);
};
}
ifs.close();
ofs.close();
chmod(s.c_str(), fmode);
@ -257,7 +260,7 @@ bool BufferList::close(Buffer * buf)
MakeDisplayPath(buf->fileName(), 50),
_("Save document?"))){
case 1: // Yes
if (write(buf)) {
if (write(buf, lyxrc->make_backup)) {
lastfiles->newFile(buf->fileName());
} else {
AllowInput();

View File

@ -90,7 +90,7 @@ public:
bool empty();
/// Saves buffer. Returns false if unsuccesful.
bool write(Buffer *, bool makeBackup = true);
bool write(Buffer *, bool makeBackup);
///
bool QwriteAll();

View File

@ -284,7 +284,7 @@ void SetUpdateTimer(float time)
void MenuWrite(Buffer * buffer)
{
XFlush(fl_display);
if (!bufferlist.write(buffer)) {
if (!bufferlist.write(buffer, lyxrc->make_backup)) {
string fname = buffer->fileName();
string s = MakeAbsPath(fname);
if (AskQuestion(_("Save failed. Rename and try again?"),
@ -470,14 +470,12 @@ int MenuRunChktex(Buffer * buffer)
}
int MakeDVIOutput(Buffer * buffer)
int MakeLaTeXOutput(Buffer * buffer)
{
// Who cares?
//if (!bv->text)
// return 1;
int ret = 0;
string path = OnlyPath(buffer->fileName());
if (lyxrc->use_tempdir || (IsDirWriteable(path) < 1)) {
path = buffer->tmppath;
@ -504,7 +502,7 @@ bool RunScript(Buffer * buffer, bool wait,
string name = orgname;
int result = 0;
if (MakeDVIOutput(buffer) > 0)
if (MakeLaTeXOutput(buffer) > 0)
return false;
/* get DVI-Filename */
if (name.empty())
@ -565,7 +563,7 @@ bool RunScript(Buffer * buffer, bool wait,
// Returns false if we fail
bool MenuRunDvips(Buffer * buffer, bool wait = false)
bool CreatePostscript(Buffer * buffer, bool wait = false)
{
// Who cares?
//if (!bv->text)
@ -574,7 +572,7 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false)
ProhibitInput();
// Generate dvi file
if (MakeDVIOutput(buffer) > 0) {
if (MakeLaTeXOutput(buffer) > 0) {
AllowInput();
return false;
}
@ -616,7 +614,7 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false)
}
// Make postscript file.
string command = "dvips " + lyxrc->print_to_file + ' ';
string command = lyxrc->dvi_to_ps_command + ' ' + lyxrc->print_to_file + ' ';
command += QuoteName(psname);
if (buffer->params.use_geometry
&& buffer->params.papersize2 == BufferParams::VM_PAPER_CUSTOM
@ -653,14 +651,15 @@ bool MenuRunDvips(Buffer * buffer, bool wait = false)
// Returns false if we fail
bool MenuPreviewPS(Buffer * buffer)
//bool MenuPreviewPS(Buffer * buffer)
bool PreviewPostscript(Buffer * buffer)
{
// Who cares?
//if (!bv->text)
// return false;
// Generate postscript file
if (!MenuRunDvips(buffer, true)) {
if (!CreatePostscript(buffer, true)) {
return false;
}
@ -687,7 +686,7 @@ void MenuFax(Buffer * buffer)
// return;
// Generate postscript file
if (!MenuRunDvips(buffer, true)) {
if (!CreatePostscript(buffer, true)) {
return;
}
@ -708,7 +707,7 @@ void MenuFax(Buffer * buffer)
// Returns false if we fail
bool MenuPreview(Buffer * buffer)
bool PreviewDVI(Buffer * buffer)
{
// Who cares?
//if (!bv->text)

View File

@ -83,7 +83,7 @@ extern void MenuWriteAs(Buffer *);
extern int MenuRunLaTeX(Buffer *);
extern int MenuBuildProg(Buffer *);
extern int MenuRunChktex(Buffer *);
extern bool MenuRunDvips(Buffer *, bool);
extern bool CreatePostscript(Buffer *, bool);
extern void MenuPrint(Buffer *);
extern void MenuSendto();
extern void QuitLyX();
@ -98,8 +98,8 @@ extern void AutoSave();
extern void MenuSearch();
extern void SetUpdateTimer(float timer = 0.3);
extern void FreeUpdateTimer();
extern bool MenuPreview(Buffer *);
extern bool MenuPreviewPS(Buffer *);
extern bool PreviewDVI(Buffer *);
extern bool PreviewPostscript(Buffer *);
extern void MenuInsertLabel(char const *);
extern void MenuInsertRef();
extern void MenuLayoutCharacter();
@ -695,11 +695,11 @@ string LyXFunc::Dispatch(int ac,
break;
case LFUN_PREVIEW:
MenuPreview(owner->buffer());
PreviewDVI(owner->buffer());
break;
case LFUN_PREVIEWPS:
MenuPreviewPS(owner->buffer());
PreviewPostscript(owner->buffer());
break;
case LFUN_RUNLATEX:
@ -715,7 +715,7 @@ string LyXFunc::Dispatch(int ac,
break;
case LFUN_RUNDVIPS:
MenuRunDvips(owner->buffer(), false);
CreatePostscript(owner->buffer(), false);
break;
case LFUN_MENUPRINT:

View File

@ -16,6 +16,9 @@
#pragma interface
#endif
#include <vector>
#include <list>
#include "insets/lyxinset.h"
#include "insets/insetbib.h"
#include "table.h"
@ -23,13 +26,9 @@
#include "layout.h"
#include "support/block.h"
//#define NEW_TABLE 1
#ifdef NEW_TABLE
#include <list>
#endif
#include <vector>
#define NEW_INSETTABLE 1
#define NEW_FONTTABLE 1
class BufferParams;
class LyXBuffer;
@ -492,7 +491,7 @@ private:
allowed in these font tables.
*/
LyXFont font;
#ifndef NEW_TABLE
#ifndef NEW_FONTTABLE
/// Pointer to next font entry
FontTable * next;
#endif
@ -503,23 +502,26 @@ private:
size_type pos;
///
Inset * inset;
#ifndef NEW_TABLE
#ifndef NEW_INSETTABLE
///
InsetTable * next;
#endif
};
#ifdef NEW_TABLE
#ifdef NEW_FONTTABLE
///
typedef list<FontTable> FontList;
///
typedef list<InsetTable> InsetList;
///
FontList fontlist;
///
InsetList insetlist;
#else
///
FontTable * fonttable;
#endif
#ifdef NEW_INSETTABLE
///
typedef list<InsetTable> InsetList;
///
InsetList insetlist;
#else
///
InsetTable * insettable;
#endif

View File

@ -127,7 +127,13 @@ enum LyXRCTags {
RC_DISPLAY_SHORTCUTS,
RC_RELYX_COMMAND,
RC_HTML_COMMAND,
RC_LAST
RC_MAKE_BACKUP,
RC_PDFLATEX_COMMAND,
RC_PDF_MODE,
RC_VIEWPDF_COMMAND,
RC_PDF_TO_PS_COMMAND,
RC_DVI_TO_PS_COMMAND,
RC_LAST
};
@ -152,6 +158,7 @@ static keyword_item lyxrcTags[] = {
{ "\\default_papersize", RC_DEFAULT_PAPERSIZE },
{ "\\display_shortcuts", RC_DISPLAY_SHORTCUTS },
{ "\\document_path", RC_DOCUMENTPATH },
{ "\\dvi_to_ps_command", RC_DVI_TO_PS_COMMAND },
{ "\\escape_chars", RC_ESC_CHARS },
{ "\\exit_confirmation", RC_EXIT_CONFIRMATION },
{ "\\fast_selection", RC_FAST_SELECTION },
@ -168,7 +175,11 @@ static keyword_item lyxrcTags[] = {
{ "\\literate_command", RC_LITERATE_COMMAND },
{ "\\literate_error_filter", RC_LITERATE_ERROR_FILTER },
{ "\\literate_extension", RC_LITERATE_EXTENSION },
{ "\\make_backup", RC_MAKE_BACKUP },
{ "\\num_lastfiles", RC_NUMLASTFILES },
{ "\\pdf_mode", RC_PDF_MODE },
{ "\\pdf_to_ps_command", RC_PDF_TO_PS_COMMAND },
{ "\\pdflatex_command", RC_PDFLATEX_COMMAND },
{ "\\personal_dictionary", RC_PERS_DICT },
{ "\\phone_book", RC_PHONEBOOK },
{ "\\print_adapt_output", RC_PRINT_ADAPTOUTPUT },
@ -213,6 +224,7 @@ static keyword_item lyxrcTags[] = {
{ "\\use_personal_dictionary", RC_USE_PERS_DICT },
{ "\\use_tempdir", RC_USETEMPDIR },
{ "\\view_dvi_command", RC_VIEWDVI_COMMAND },
{ "\\view_pdf_command", RC_VIEWPDF_COMMAND },
{ "\\view_ps_command", RC_VIEWPS_COMMAND },
{ "\\view_pspic_command", RC_VIEWPSPIC_COMMAND }
};
@ -250,7 +262,11 @@ LyXRC::LyXRC()
document_path = GetEnvPath("HOME");
tempdir_path = "/tmp";
use_tempdir = true;
pdf_mode = false;
latex_command = "latex";
pdflatex_command = "pdflatex";
pdf_to_ps_command = "pdf2ps";
dvi_to_ps_command = "dvips";
literate_command = "none";
literate_extension = "none";
literate_error_filter = "cat";
@ -261,6 +277,7 @@ LyXRC::LyXRC()
view_ps_command = "ghostview -swap";
view_pspic_command = "ghostview";
view_dvi_command = "xdvi";
view_pdf_command = "xpdf";
default_papersize = BufferParams::PAPER_USLETTER;
custom_export_format = "ps";
chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
@ -292,6 +309,7 @@ LyXRC::LyXRC()
ascii_linelen = 75;
num_lastfiles = 4;
check_lastfiles = true;
make_backup = true;
exit_confirmation = true;
display_shortcuts = true;
// Spellchecker settings:
@ -319,6 +337,7 @@ int LyXRC::ReadBindFile(string const & name)
return result;
}
int LyXRC::read(string const & filename)
{
// Default bindfile.
@ -502,11 +521,31 @@ int LyXRC::read(string const & filename)
if (lexrc.next())
custom_export_format = lexrc.GetString();
break;
case RC_PDF_MODE:
if (lexrc.next())
pdf_mode = lexrc.GetBool();
break;
case RC_LATEX_COMMAND:
if (lexrc.next())
latex_command = lexrc.GetString();
break;
case RC_PDFLATEX_COMMAND:
if (lexrc.next())
pdflatex_command = lexrc.GetString();
break;
case RC_PDF_TO_PS_COMMAND:
if (lexrc.next())
pdf_to_ps_command = lexrc.GetString();
break;
case RC_DVI_TO_PS_COMMAND:
if (lexrc.next())
dvi_to_ps_command = lexrc.GetString();
break;
case RC_LITERATE_COMMAND:
if (lexrc.next())
@ -568,6 +607,11 @@ int LyXRC::read(string const & filename)
if (lexrc.next())
view_dvi_command = lexrc.GetString();
break;
case RC_VIEWPDF_COMMAND:
if (lexrc.next())
view_pdf_command = lexrc.GetString();
break;
case RC_PS_COMMAND:
if (lexrc.next())
@ -853,6 +897,10 @@ int LyXRC::read(string const & filename)
if (lexrc.next())
isp_esc_chars = lexrc.GetString();
break;
case RC_MAKE_BACKUP:
if (lexrc.next())
make_backup = lexrc.GetBool();
break;
case RC_LAST: break; // this is just a dummy
}
}
@ -967,8 +1015,16 @@ void LyXRC::output(ostream & os) const
case RC_CUSTOM_EXPORT_FORMAT:
os << "\\custom_export_format \"" << custom_export_format
<< "\"\n";
case RC_PDF_MODE:
os << "\\pdf_mode " << tostr(pdf_mode) << "\n";
case RC_LATEX_COMMAND:
os << "\\latex_command \"" << latex_command << "\"\n";
case RC_PDFLATEX_COMMAND:
os << "\\pdflatex_command \"" << pdflatex_command << "\"\n";
case RC_PDF_TO_PS_COMMAND:
os << "\\pdf_to_ps_command \"" << pdf_to_ps_command << "\"\n";
case RC_DVI_TO_PS_COMMAND:
os << "\\dvi_to_ps_command \"" << dvi_to_ps_command << "\"\n";
case RC_LITERATE_COMMAND:
os << "\\literate_command \"" << literate_command << "\"\n";
case RC_LITERATE_EXTENSION:
@ -1014,6 +1070,8 @@ void LyXRC::output(ostream & os) const
<< "\n";
case RC_VIEWDVI_COMMAND:
os << "\\view_dvi_command \"" << view_dvi_command << "\"\n";
case RC_VIEWPDF_COMMAND:
os << "\\view_pdf_command \"" << view_pdf_command << "\"\n";
case RC_DEFAULT_PAPERSIZE:
os << "\\default_papersize \"";
switch (default_papersize) {
@ -1131,6 +1189,8 @@ void LyXRC::output(ostream & os) const
os << "\\personal_dictionary \"" << isp_pers_dict << "\"\n";
case RC_ESC_CHARS:
os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
case RC_MAKE_BACKUP:
os << "\\make_backup " << tostr(make_backup) << "\n";
}
os.flush();
}

View File

@ -78,8 +78,16 @@ public:
string custom_export_command;
///
string custom_export_format;
///
bool pdf_mode;
/// program for running latex
string latex_command;
///
string pdflatex_command;
///
string pdf_to_ps_command;
///
string dvi_to_ps_command;
/// program for performing literate programming
string literate_command;
string literate_extension;
@ -97,6 +105,8 @@ public:
string view_pspic_command;
/// program for viewing dvi output (default "xdvi")
string view_dvi_command;
/// program for viewing pdf output (default "xpdf")
string view_pdf_command;
/// default paper size for local xdvi/dvips/ghostview/whatever
BufferParams::PAPER_SIZE default_papersize;
/// command to run chktex incl. options
@ -121,6 +131,8 @@ public:
string lastfiles;
/// maximal number of lastfiles
unsigned int num_lastfiles;
/// shall a backup file be created
bool make_backup;
/// Zoom factor for screen fonts
unsigned int zoom;
/// Screen font sizes in points for each font size

File diff suppressed because it is too large Load Diff

View File

@ -17,11 +17,6 @@ public:
typedef T * iterator;
typedef T const * const_iterator;
size_type size() const { return s; }
#warning I disabled this to be able to compile... (JMarc)
// I think that, sor the same reason that string->char* is not
// automatic, we should have a c_array() method to do that. However,
// Lars, it is your choice...
// operator T* () { return arr; }
reference at(int i) {
Assert(i >= 0 && i < s);
return arr[i];