*
* LyX, The Document Processor
*
- * Copyright (C) 1995 Matthias Ettrich
- * Copyright (C) 1995-1998 The LyX Team.
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-1999 The LyX Team.
*
* ====================================================== */
#pragma implementation "lyxrc.h"
#endif
-#include "error.h"
+#include "debug.h"
#include "lyxrc.h"
#include "LyXAction.h"
#include "lyx_main.h"
#include "intl.h"
#include "tex-strings.h"
-#include "pathstack.h"
-#include "filetools.h"
+#include "support/path.h"
+#include "support/filetools.h"
#include "lyxtext.h"
-// $Id: lyxrc.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $
-
-#if !defined(lint) && !defined(WITH_WARNINGS)
-static char vcid[] = "$Id: lyxrc.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $";
-#endif /* lint */
-
// this is crappy... why are those colors command line arguments and
// not in lyxrc?? (Matthias)
// Because nobody put them there. (Asger)
extern int fast_selection;
-extern LString background_color;
+extern string background_color;
extern char selection_color[];
extern bool cursor_follows_scrollbar;
extern kb_keymap *toplevel_keymap;
RC_EXIT_CONFIRMATION,
RC_DISPLAY_SHORTCUTS,
RC_RELYX_COMMAND,
+ RC_TTH_COMMAND,
RC_LAST
};
{ "\\spell_command", RC_SPELL_COMMAND },
{ "\\tempdir_path", RC_TEMPDIRPATH },
{ "\\template_path", RC_TEMPLATEPATH },
+ { "\\tth_command", RC_TTH_COMMAND },
{ "\\use_alt_language", RC_USE_ALT_LANG },
{ "\\use_escape_chars", RC_USE_ESC_CHARS },
{ "\\use_input_encoding", RC_USE_INP_ENC },
{
// Get printer from the environment. If fail, use default "",
// assuming that everything is set up correctly.
- printer = getenv("PRINTER");
+ printer = GetEnv("PRINTER");
print_command = "dvips";
print_evenpage_flag = "-B";
print_oddpage_flag = "-A";
print_file_extension = ".ps";
print_paper_flag = "-t";
print_paper_dimension_flag = "-T";
- document_path = getEnvPath("HOME");
+ document_path = GetEnvPath("HOME");
tempdir_path = "/tmp";
use_tempdir = true;
latex_command = "latex";
default_papersize = PAPER_USLETTER;
custom_export_format = "ps";
chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
+ tth_command = "tth -t";
fontenc = "default";
dpi = 75;
// Because a screen typically is wider than a piece of paper:
{
}
-int LyXRC::ReadBindFile(LString name)
+int LyXRC::ReadBindFile(string name)
{
hasBindFile = true;
- LString tmp = i18nLibFileSearch("bind",name,"bind");
- lyxerr.debug("Reading bindfile:" + tmp, Error::LYXRC);
+ string tmp = i18nLibFileSearch("bind",name,"bind");
+ lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
int result = Read(tmp);
if (result) {
- lyxerr.print("Error reading bind file: " + tmp);
+ lyxerr << "Error reading bind file: " << tmp << endl;
}
return result;
}
-int LyXRC::Read(LString const &filename)
+int LyXRC::Read(string const &filename)
{
// Default bindfile.
- LString bindFile = "cua";
+ string bindFile = "cua";
LyXLex lexrc(lyxrcTags, lyxrcCount);
- if (lyxerr.debugging(Error::LEX_PARSER))
+ if (lyxerr.debugging(Debug::PARSER))
lexrc.printTable();
lexrc.setFile(filename);
if (!lexrc.IsOK()) return -2;
- lyxerr.debug("Reading '" + filename + "'...", Error::INIT);
+ lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
while (lexrc.IsOK()) {
break;
case RC_INPUT: // Include file
if (lexrc.next()) {
- LString tmp = LibFileSearch(LString(),
+ string tmp = LibFileSearch(string(),
lexrc.GetString());
if (Read(tmp)) {
lexrc.printError("Error reading "
break;
case RC_PRINTEXSTRAOPTIONS:
- if (lexrc.EatLine())
+ if (lexrc.next())
print_extra_options = lexrc.GetString();
break;
case RC_DEFAULT_PAPERSIZE:
if (lexrc.next()) {
- LString size = lexrc.GetString();
- size.lowercase();
+ string size = lowercase(lexrc.GetString());
if (size == "usletter")
default_papersize = PAPER_USLETTER;
else if (size == "legal")
chktex_command = lexrc.GetString();
break;
+ case RC_TTH_COMMAND:
+ if (lexrc.next())
+ tth_command = lexrc.GetString();
+ break;
+
case RC_SCREEN_DPI:
if (lexrc.next())
dpi = lexrc.GetInteger();
// !!!chb, dynamic key binding...
int action, res=0;
- LString seq, cmd;
+ string seq, cmd;
if (lexrc.lex()==LyXLex::LEX_DATA) {
seq = lexrc.GetString();
}
if ((action = lyxaction.LookupFunc(cmd.c_str()))>=0) {
- if (lyxerr.debugging(Error::KEY)) {
- lyxerr.print("RC_BIND: Sequence `"
- + seq + "' Command `"
- + cmd + "' Action `"
- + (int) action + '\'');
+ if (lyxerr.debugging(Debug::KEY)) {
+ lyxerr << "RC_BIND: Sequence `"
+ << seq << "' Command `"
+ << cmd << "' Action `"
+ << action << '\'' << endl;
}
res = bindKey(seq.c_str(), action);
if (res != 0) {
break;
case RC_PHONEBOOK:
if (lexrc.next()) {
- LString s = lexrc.GetString();
+ string s = lexrc.GetString();
if (AbsolutePath(s))
phone_book = s;
else
void LyXRC::Print()
{
- lyxerr.print("The current internal LyXRC:");
+ lyxerr << "The current internal LyXRC:" << endl;
}