X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrc.C;h=c05bf9ea66236d7e6259ff2c9efe810dece44813;hb=a858be7332e331e0244e4dba7b0931b6072ffd3d;hp=0fb6fb740273c268d1f2a4536112964ee0aa6e84;hpb=27de1486ca34aaad446adb798d71a77d6f6304da;p=lyx.git diff --git a/src/lyxrc.C b/src/lyxrc.C index 0fb6fb7402..c05bf9ea66 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -3,8 +3,8 @@ * * 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. * * ====================================================== */ @@ -14,7 +14,7 @@ #pragma implementation "lyxrc.h" #endif -#include "error.h" +#include "debug.h" #include "lyxrc.h" #include "LyXAction.h" @@ -22,21 +22,15 @@ #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; @@ -126,6 +120,7 @@ enum _LyXRCTags { RC_EXIT_CONFIRMATION, RC_DISPLAY_SHORTCUTS, RC_RELYX_COMMAND, + RC_TTH_COMMAND, RC_LAST }; @@ -204,6 +199,7 @@ static keyword_item lyxrcTags[] = { { "\\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 }, @@ -229,7 +225,7 @@ LyXRC::LyXRC() { // 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"; @@ -243,7 +239,7 @@ LyXRC::LyXRC() 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"; @@ -260,6 +256,7 @@ LyXRC::LyXRC() 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: @@ -306,31 +303,31 @@ LyXRC::~LyXRC() { } -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()) { @@ -339,7 +336,7 @@ int LyXRC::Read(LString const &filename) 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 " @@ -454,7 +451,7 @@ int LyXRC::Read(LString const &filename) break; case RC_PRINTEXSTRAOPTIONS: - if (lexrc.EatLine()) + if (lexrc.next()) print_extra_options = lexrc.GetString(); break; @@ -525,8 +522,7 @@ int LyXRC::Read(LString const &filename) 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") @@ -568,6 +564,11 @@ int LyXRC::Read(LString const &filename) 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(); @@ -708,7 +709,7 @@ int LyXRC::Read(LString const &filename) // !!!chb, dynamic key binding... int action, res=0; - LString seq, cmd; + string seq, cmd; if (lexrc.lex()==LyXLex::LEX_DATA) { seq = lexrc.GetString(); @@ -725,11 +726,11 @@ int LyXRC::Read(LString const &filename) } 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) { @@ -775,7 +776,7 @@ int LyXRC::Read(LString const &filename) break; case RC_PHONEBOOK: if (lexrc.next()) { - LString s = lexrc.GetString(); + string s = lexrc.GetString(); if (AbsolutePath(s)) phone_book = s; else @@ -840,7 +841,7 @@ int LyXRC::Read(LString const &filename) void LyXRC::Print() { - lyxerr.print("The current internal LyXRC:"); + lyxerr << "The current internal LyXRC:" << endl; }