1999-09-27 18:44:28 +00:00
/* This file is part of
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*
* LyX , The Document Processor
*
1999-10-02 16:21:10 +00:00
* Copyright 1995 Matthias Ettrich
2001-05-30 13:53:44 +00:00
* Copyright 1995 - 2001 The LyX Team .
1999-09-27 18:44:28 +00:00
*
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
# include <config.h>
# ifdef __GNUG__
# pragma implementation "lyxrc.h"
# endif
1999-12-01 00:57:31 +00:00
# include <fstream>
# include <iomanip>
2000-03-16 04:29:22 +00:00
# include <iostream>
1999-10-07 18:44:17 +00:00
# include "debug.h"
1999-09-27 18:44:28 +00:00
# include "lyxrc.h"
2000-02-04 09:38:32 +00:00
# include "kbmap.h"
1999-09-27 18:44:28 +00:00
# include "LyXAction.h"
# include "lyx_main.h"
# include "intl.h"
1999-10-13 17:32:46 +00:00
# include "support/path.h"
1999-10-02 16:21:10 +00:00
# include "support/filetools.h"
1999-09-27 18:44:28 +00:00
# include "lyxtext.h"
2000-08-30 03:40:51 +00:00
# include "converter.h"
2001-04-05 12:26:41 +00:00
# include "gettext.h"
1999-09-27 18:44:28 +00:00
2000-04-04 00:19:15 +00:00
using std : : ostream ;
2000-03-28 02:18:55 +00:00
using std : : ofstream ;
using std : : cout ;
using std : : ios ;
using std : : endl ;
2000-11-06 11:20:22 +00:00
using std : : vector ;
2000-02-14 22:14:48 +00:00
1999-09-27 18:44:28 +00:00
extern LyXAction lyxaction ;
2001-03-07 16:18:05 +00:00
extern boost : : scoped_ptr < kb_keymap > toplevel_keymap ;
2000-03-12 10:35:05 +00:00
2001-03-20 01:22:46 +00:00
namespace {
1999-09-27 18:44:28 +00:00
2000-03-07 01:14:37 +00:00
keyword_item lyxrcTags [ ] = {
2000-10-30 21:53:29 +00:00
{ " \\ accept_compound " , LyXRC : : RC_ACCEPT_COMPOUND } ,
{ " \\ alternate_language " , LyXRC : : RC_ALT_LANG } ,
{ " \\ ascii_linelen " , LyXRC : : RC_ASCII_LINELEN } ,
{ " \\ ascii_roff_command " , LyXRC : : RC_ASCIIROFF_COMMAND } ,
{ " \\ auto_number " , LyXRC : : RC_AUTO_NUMBER } ,
{ " \\ auto_region_delete " , LyXRC : : RC_AUTOREGIONDELETE } ,
2001-09-21 10:41:09 +00:00
{ " \\ auto_reset_options " , LyXRC : : RC_AUTORESET_OPTIONS } ,
2000-10-30 21:53:29 +00:00
{ " \\ autosave " , LyXRC : : RC_AUTOSAVE } ,
{ " \\ backupdir_path " , LyXRC : : RC_BACKUPDIR_PATH } ,
{ " \\ bind " , LyXRC : : RC_BIND } ,
{ " \\ bind_file " , LyXRC : : RC_BINDFILE } ,
{ " \\ check_lastfiles " , LyXRC : : RC_CHECKLASTFILES } ,
{ " \\ chktex_command " , LyXRC : : RC_CHKTEX_COMMAND } ,
{ " \\ converter " , LyXRC : : RC_CONVERTER } ,
{ " \\ cursor_follows_scrollbar " , LyXRC : : RC_CURSOR_FOLLOWS_SCROLLBAR } ,
{ " \\ custom_export_command " , LyXRC : : RC_CUSTOM_EXPORT_COMMAND } ,
{ " \\ custom_export_format " , LyXRC : : RC_CUSTOM_EXPORT_FORMAT } ,
{ " \\ date_insert_format " , LyXRC : : RC_DATE_INSERT_FORMAT } ,
{ " \\ default_language " , LyXRC : : RC_DEFAULT_LANGUAGE } ,
{ " \\ default_papersize " , LyXRC : : RC_DEFAULT_PAPERSIZE } ,
2001-09-07 10:11:02 +00:00
{ " \\ dialogs_iconify_with_main " , LyXRC : : RC_DIALOGS_ICONIFY_WITH_MAIN } ,
2001-09-18 10:58:35 +00:00
{ " \\ display_graphics " , LyXRC : : RC_DISPLAY_GRAPHICS } ,
2000-10-30 21:53:29 +00:00
{ " \\ display_shortcuts " , LyXRC : : RC_DISPLAY_SHORTCUTS } ,
{ " \\ document_path " , LyXRC : : RC_DOCUMENTPATH } ,
{ " \\ escape_chars " , LyXRC : : RC_ESC_CHARS } ,
{ " \\ exit_confirmation " , LyXRC : : RC_EXIT_CONFIRMATION } ,
{ " \\ font_encoding " , LyXRC : : RC_FONT_ENCODING } ,
{ " \\ format " , LyXRC : : RC_FORMAT } ,
{ " \\ input " , LyXRC : : RC_INPUT } ,
{ " \\ kbmap " , LyXRC : : RC_KBMAP } ,
{ " \\ kbmap_primary " , LyXRC : : RC_KBMAP_PRIMARY } ,
{ " \\ kbmap_secondary " , LyXRC : : RC_KBMAP_SECONDARY } ,
2000-12-11 09:46:09 +00:00
{ " \\ label_init_length " , LyXRC : : RC_LABEL_INIT_LENGTH } ,
2000-10-30 21:53:29 +00:00
{ " \\ language_auto_begin " , LyXRC : : RC_LANGUAGE_AUTO_BEGIN } ,
{ " \\ language_auto_end " , LyXRC : : RC_LANGUAGE_AUTO_END } ,
{ " \\ language_command_begin " , LyXRC : : RC_LANGUAGE_COMMAND_BEGIN } ,
{ " \\ language_command_end " , LyXRC : : RC_LANGUAGE_COMMAND_END } ,
2001-02-25 10:22:54 +00:00
{ " \\ language_command_local " , LyXRC : : RC_LANGUAGE_COMMAND_LOCAL } ,
{ " \\ language_global_options " , LyXRC : : RC_LANGUAGE_GLOBAL_OPTIONS } ,
2000-10-30 21:53:29 +00:00
{ " \\ language_package " , LyXRC : : RC_LANGUAGE_PACKAGE } ,
2001-02-25 10:22:54 +00:00
{ " \\ language_use_babel " , LyXRC : : RC_LANGUAGE_USE_BABEL } ,
2000-10-30 21:53:29 +00:00
{ " \\ lastfiles " , LyXRC : : RC_LASTFILES } ,
{ " \\ make_backup " , LyXRC : : RC_MAKE_BACKUP } ,
{ " \\ mark_foreign_language " , LyXRC : : RC_MARK_FOREIGN_LANGUAGE } ,
{ " \\ new_ask_filename " , LyXRC : : RC_NEW_ASK_FILENAME } ,
{ " \\ num_lastfiles " , LyXRC : : RC_NUMLASTFILES } ,
{ " \\ override_x_deadkeys " , LyXRC : : RC_OVERRIDE_X_DEADKEYS } ,
{ " \\ personal_dictionary " , LyXRC : : RC_PERS_DICT } ,
2002-01-10 15:14:22 +00:00
{ " \\ popup_bold_font " , LyXRC : : RC_POPUP_BOLD_FONT } ,
{ " \\ popup_font_encoding " , LyXRC : : RC_POPUP_FONT_ENCODING } ,
{ " \\ popup_normal_font " , LyXRC : : RC_POPUP_NORMAL_FONT } ,
2000-10-30 21:53:29 +00:00
{ " \\ print_adapt_output " , LyXRC : : RC_PRINT_ADAPTOUTPUT } ,
{ " \\ print_collcopies_flag " , LyXRC : : RC_PRINTCOLLCOPIESFLAG } ,
{ " \\ print_command " , LyXRC : : RC_PRINT_COMMAND } ,
{ " \\ print_copies_flag " , LyXRC : : RC_PRINTCOPIESFLAG } ,
{ " \\ print_evenpage_flag " , LyXRC : : RC_PRINTEVENPAGEFLAG } ,
{ " \\ print_extra_options " , LyXRC : : RC_PRINTEXSTRAOPTIONS } ,
{ " \\ print_file_extension " , LyXRC : : RC_PRINTFILEEXTENSION } ,
{ " \\ print_landscape_flag " , LyXRC : : RC_PRINTLANDSCAPEFLAG } ,
{ " \\ print_oddpage_flag " , LyXRC : : RC_PRINTODDPAGEFLAG } ,
{ " \\ print_pagerange_flag " , LyXRC : : RC_PRINTPAGERANGEFLAG } ,
{ " \\ print_paper_dimension_flag " , LyXRC : : RC_PRINTPAPERDIMENSIONFLAG } ,
{ " \\ print_paper_flag " , LyXRC : : RC_PRINTPAPERFLAG } ,
{ " \\ print_reverse_flag " , LyXRC : : RC_PRINTREVERSEFLAG } ,
{ " \\ print_spool_command " , LyXRC : : RC_PRINTSPOOL_COMMAND } ,
{ " \\ print_spool_printerprefix " , LyXRC : : RC_PRINTSPOOL_PRINTERPREFIX } ,
{ " \\ print_to_file " , LyXRC : : RC_PRINTTOFILE } ,
{ " \\ print_to_printer " , LyXRC : : RC_PRINTTOPRINTER } ,
{ " \\ printer " , LyXRC : : RC_PRINTER } ,
{ " \\ ps_command " , LyXRC : : RC_PS_COMMAND } ,
{ " \\ rtl " , LyXRC : : RC_RTL_SUPPORT } ,
{ " \\ screen_dpi " , LyXRC : : RC_SCREEN_DPI } ,
{ " \\ screen_font_encoding " , LyXRC : : RC_SCREEN_FONT_ENCODING } ,
2002-01-10 15:14:22 +00:00
// compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
{ " \\ screen_font_encoding_menu " , LyXRC : : RC_POPUP_FONT_ENCODING } ,
// compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
{ " \\ screen_font_menu " , LyXRC : : RC_POPUP_BOLD_FONT } ,
// compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
{ " \\ screen_font_popup " , LyXRC : : RC_POPUP_NORMAL_FONT } ,
2000-10-30 21:53:29 +00:00
{ " \\ screen_font_roman " , LyXRC : : RC_SCREEN_FONT_ROMAN } ,
{ " \\ screen_font_sans " , LyXRC : : RC_SCREEN_FONT_SANS } ,
{ " \\ screen_font_scalable " , LyXRC : : RC_SCREEN_FONT_SCALABLE } ,
{ " \\ screen_font_sizes " , LyXRC : : RC_SCREEN_FONT_SIZES } ,
{ " \\ screen_font_typewriter " , LyXRC : : RC_SCREEN_FONT_TYPEWRITER } ,
{ " \\ screen_zoom " , LyXRC : : RC_SCREEN_ZOOM } ,
{ " \\ serverpipe " , LyXRC : : RC_SERVERPIPE } ,
{ " \\ set_color " , LyXRC : : RC_SET_COLOR } ,
{ " \\ show_banner " , LyXRC : : RC_SHOW_BANNER } ,
{ " \\ spell_command " , LyXRC : : RC_SPELL_COMMAND } ,
{ " \\ tempdir_path " , LyXRC : : RC_TEMPDIRPATH } ,
{ " \\ template_path " , LyXRC : : RC_TEMPLATEPATH } ,
{ " \\ ui_file " , LyXRC : : RC_UIFILE } ,
{ " \\ use_alt_language " , LyXRC : : RC_USE_ALT_LANG } ,
{ " \\ use_escape_chars " , LyXRC : : RC_USE_ESC_CHARS } ,
{ " \\ use_input_encoding " , LyXRC : : RC_USE_INP_ENC } ,
{ " \\ use_personal_dictionary " , LyXRC : : RC_USE_PERS_DICT } ,
2001-07-16 10:03:38 +00:00
# ifdef USE_PSPELL
{ " \\ use_pspell " , LyXRC : : RC_USE_PSPELL } ,
# endif
2000-10-30 21:53:29 +00:00
{ " \\ use_tempdir " , LyXRC : : RC_USETEMPDIR } ,
{ " \\ view_dvi_paper_option " , LyXRC : : RC_VIEWDVI_PAPEROPTION } ,
{ " \\ viewer " , LyXRC : : RC_VIEWER } ,
{ " \\ wheel_jump " , LyXRC : : RC_WHEEL_JUMP }
1999-09-27 18:44:28 +00:00
} ;
/* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
2001-03-20 01:22:46 +00:00
const int lyxrcCount = sizeof ( lyxrcTags ) / sizeof ( keyword_item ) ;
} // namespace anon
1999-09-27 18:44:28 +00:00
2000-03-12 10:35:05 +00:00
LyXRC : : LyXRC ( )
{
setDefaults ( ) ;
1999-09-27 18:44:28 +00:00
}
2000-03-12 10:35:05 +00:00
void LyXRC : : setDefaults ( ) {
2000-12-11 13:41:21 +00:00
bind_file = " cua " ;
hasBindFile = false ;
2000-07-24 13:53:19 +00:00
ui_file = " default " ;
1999-09-27 18:44:28 +00:00
// Get printer from the environment. If fail, use default "",
// assuming that everything is set up correctly.
1999-10-02 16:21:10 +00:00
printer = GetEnv ( " PRINTER " ) ;
2000-01-05 13:09:19 +00:00
print_adapt_output = false ;
1999-09-27 18:44:28 +00:00
print_command = " dvips " ;
print_evenpage_flag = " -B " ;
print_oddpage_flag = " -A " ;
print_pagerange_flag = " -pp " ;
print_copies_flag = " -c " ;
print_collcopies_flag = " -C " ;
print_reverse_flag = " -r " ;
print_landscape_flag = " -t landscape " ;
print_to_printer = " -P " ;
print_to_file = " -o " ;
print_file_extension = " .ps " ;
2000-03-20 16:37:50 +00:00
print_paper_flag = " -t " ;
1999-09-27 18:44:28 +00:00
print_paper_dimension_flag = " -T " ;
2002-01-13 19:19:05 +00:00
document_path . erase ( ) ;
1999-09-27 18:44:28 +00:00
tempdir_path = " /tmp " ;
use_tempdir = true ;
ps_command = " gs " ;
2002-01-13 19:19:05 +00:00
view_dvi_paper_option . erase ( ) ;
1999-11-15 12:01:38 +00:00
default_papersize = BufferParams : : PAPER_USLETTER ;
1999-09-27 18:44:28 +00:00
custom_export_format = " ps " ;
chktex_command = " chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38 " ;
fontenc = " default " ;
dpi = 75 ;
// Because a screen typically is wider than a piece of paper:
zoom = 150 ;
2000-07-04 20:32:37 +00:00
wheel_jump = 100 ;
1999-09-27 18:44:28 +00:00
// Default LaTeX font size:
font_sizes [ LyXFont : : SIZE_TINY ] = 5.0 ;
font_sizes [ LyXFont : : SIZE_SCRIPT ] = 7.0 ;
font_sizes [ LyXFont : : SIZE_FOOTNOTE ] = 8.0 ;
font_sizes [ LyXFont : : SIZE_SMALL ] = 9.0 ;
font_sizes [ LyXFont : : SIZE_NORMAL ] = 10.0 ;
font_sizes [ LyXFont : : SIZE_LARGE ] = 12.0 ;
font_sizes [ LyXFont : : SIZE_LARGER ] = 14.4 ;
font_sizes [ LyXFont : : SIZE_LARGEST ] = 17.26 ;
font_sizes [ LyXFont : : SIZE_HUGE ] = 20.74 ;
font_sizes [ LyXFont : : SIZE_HUGER ] = 24.88 ;
use_scalable_fonts = true ;
roman_font_name = " -*-times " ;
sans_font_name = " -*-helvetica " ;
typewriter_font_name = " -*-courier " ;
2002-01-10 15:14:22 +00:00
popup_bold_font = " -*-helvetica-bold-r " ;
popup_normal_font = " -*-helvetica-medium-r " ;
1999-09-27 18:44:28 +00:00
font_norm = " iso8859-1 " ;
2001-01-17 14:42:33 +00:00
font_norm_type = ISO_8859_1 ;
2002-01-13 19:19:05 +00:00
popup_font_encoding . erase ( ) ;
2000-05-10 11:50:11 +00:00
override_x_deadkeys = true ;
1999-09-27 18:44:28 +00:00
autosave = 300 ;
auto_region_delete = true ;
2001-09-21 15:20:17 +00:00
auto_reset_options = false ;
2000-07-04 19:16:35 +00:00
ascii_linelen = 65 ;
1999-09-27 18:44:28 +00:00
num_lastfiles = 4 ;
check_lastfiles = true ;
2000-01-11 01:59:00 +00:00
make_backup = true ;
2002-01-13 19:19:05 +00:00
backupdir_path . erase ( ) ;
1999-09-27 18:44:28 +00:00
exit_confirmation = true ;
2001-09-18 10:58:35 +00:00
display_graphics = " mono " ;
1999-09-27 18:44:28 +00:00
display_shortcuts = true ;
// Spellchecker settings:
2001-07-16 10:03:38 +00:00
# ifdef USE_PSPELL
use_pspell = true ;
# endif
1999-09-27 18:44:28 +00:00
isp_command = " ispell " ;
isp_accept_compound = false ;
isp_use_input_encoding = false ;
isp_use_alt_lang = false ;
isp_use_pers_dict = false ;
isp_use_esc_chars = false ;
use_kbmap = false ;
2000-02-03 19:51:27 +00:00
rtl_support = false ;
2000-04-10 21:40:13 +00:00
auto_number = true ;
2000-05-30 19:31:11 +00:00
mark_foreign_language = true ;
2000-03-17 10:14:46 +00:00
language_auto_begin = true ;
language_auto_end = true ;
2001-02-25 10:22:54 +00:00
language_global_options = true ;
language_use_babel = true ;
language_package = " \\ usepackage{babel} " ;
2000-03-17 10:14:46 +00:00
language_command_begin = " \\ selectlanguage{$$lang} " ;
2001-02-25 10:22:54 +00:00
language_command_local = " \\ foreignlanguage{$$lang}{ " ;
2000-09-27 15:23:24 +00:00
default_language = " english " ;
2000-10-10 14:17:33 +00:00
//
2000-08-08 11:08:07 +00:00
new_ask_filename = false ;
2000-03-12 10:35:05 +00:00
2000-10-10 14:17:33 +00:00
//
2000-02-10 17:06:12 +00:00
date_insert_format = " %A, %e %B %Y " ;
2000-03-06 02:42:40 +00:00
show_banner = true ;
2000-10-10 14:17:33 +00:00
cursor_follows_scrollbar = false ;
2001-09-07 10:11:02 +00:00
dialogs_iconify_with_main = false ;
2000-12-11 09:46:09 +00:00
label_init_length = 3 ;
2000-03-20 18:55:57 +00:00
2000-10-02 16:44:47 +00:00
/// These variables are not stored on disk (perhaps they
// should be moved from the LyXRC class).
use_gui = true ;
pdf_mode = false ;
1999-09-27 18:44:28 +00:00
}
1999-11-04 01:40:20 +00:00
int LyXRC : : ReadBindFile ( string const & name )
1999-09-27 18:44:28 +00:00
{
hasBindFile = true ;
2000-11-30 18:11:54 +00:00
string const tmp = i18nLibFileSearch ( " bind " , name , " bind " ) ;
1999-10-07 18:44:17 +00:00
lyxerr [ Debug : : LYXRC ] < < " Reading bindfile: " < < tmp < < endl ;
2000-11-30 18:11:54 +00:00
int const result = read ( tmp ) ;
1999-09-27 18:44:28 +00:00
if ( result ) {
1999-10-07 18:44:17 +00:00
lyxerr < < " Error reading bind file: " < < tmp < < endl ;
1999-09-27 18:44:28 +00:00
}
return result ;
}
2000-12-11 13:41:21 +00:00
void LyXRC : : readBindFileIfNeeded ( )
{
if ( ! hasBindFile )
ReadBindFile ( bind_file ) ;
}
2000-01-11 01:59:00 +00:00
2001-08-02 18:46:53 +00:00
1999-12-01 00:57:31 +00:00
int LyXRC : : read ( string const & filename )
2000-12-11 13:41:21 +00:00
{
1999-09-27 18:44:28 +00:00
LyXLex lexrc ( lyxrcTags , lyxrcCount ) ;
1999-10-07 18:44:17 +00:00
if ( lyxerr . debugging ( Debug : : PARSER ) )
2000-03-09 03:36:48 +00:00
lexrc . printTable ( lyxerr ) ;
1999-09-27 18:44:28 +00:00
lexrc . setFile ( filename ) ;
2001-08-06 19:12:46 +00:00
if ( ! lexrc . isOK ( ) ) return - 2 ;
1999-12-01 00:57:31 +00:00
2001-06-29 11:54:39 +00:00
lyxerr [ Debug : : LYXRC ] < < " Reading ' " < < filename < < " '... " < < endl ;
1999-09-27 18:44:28 +00:00
2001-08-06 19:12:46 +00:00
while ( lexrc . isOK ( ) ) {
1999-12-01 00:57:31 +00:00
// By using two switches we take advantage of the compiler
// telling us if we have missed a LyXRCTags element in
// the second switch.
// Note that this also shows a problem with LyXLex since it
// helps us avoid taking advantage of the strictness of the
// compiler.
int le = lexrc . lex ( ) ;
2000-11-04 10:00:12 +00:00
switch ( le ) {
1999-12-01 00:57:31 +00:00
case LyXLex : : LEX_UNDEF :
lexrc . printError ( " Unknown tag `$$Token' " ) ;
1999-12-01 14:41:31 +00:00
continue ;
1999-09-27 18:44:28 +00:00
case LyXLex : : LEX_FEOF :
1999-12-01 14:41:31 +00:00
continue ;
1999-12-01 00:57:31 +00:00
default : break ;
}
switch ( static_cast < LyXRCTags > ( le ) ) {
1999-09-27 18:44:28 +00:00
case RC_INPUT : // Include file
if ( lexrc . next ( ) ) {
2001-08-02 18:46:53 +00:00
string const tmp =
LibFileSearch ( string ( ) ,
2001-08-06 19:12:46 +00:00
lexrc . getString ( ) ) ;
1999-12-01 00:57:31 +00:00
if ( read ( tmp ) ) {
1999-09-27 18:44:28 +00:00
lexrc . printError ( " Error reading "
1999-12-01 00:57:31 +00:00
" included file: " + tmp ) ;
1999-09-27 18:44:28 +00:00
}
}
break ;
case RC_BINDFILE : // RVDK_PATCH_5
1999-12-01 00:57:31 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
string const tmp ( lexrc . getString ( ) ) ;
2000-12-11 13:41:21 +00:00
if ( hasBindFile )
// We are already in the
// "actually read bind file"
// mode.
ReadBindFile ( tmp ) ;
else
// We are still in the "just
// remember the name of the
// bind file" mode.
2000-06-12 11:27:15 +00:00
bind_file = tmp ;
1999-12-01 00:57:31 +00:00
}
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
2000-07-24 13:53:19 +00:00
case RC_UIFILE :
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
ui_file = lexrc . getString ( ) ;
2000-07-24 13:53:19 +00:00
}
1999-09-27 18:44:28 +00:00
break ;
case RC_EXIT_CONFIRMATION :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
exit_confirmation = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
2001-09-21 10:41:09 +00:00
case RC_AUTORESET_OPTIONS :
if ( lexrc . next ( ) )
auto_reset_options = lexrc . getBool ( ) ;
break ;
2001-09-18 10:58:35 +00:00
case RC_DISPLAY_GRAPHICS :
if ( lexrc . next ( ) )
display_graphics = lexrc . getString ( ) ;
break ;
2001-09-21 10:41:09 +00:00
1999-09-27 18:44:28 +00:00
case RC_DISPLAY_SHORTCUTS :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
display_shortcuts = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
2001-09-21 10:41:09 +00:00
2000-07-24 21:49:58 +00:00
case RC_KBMAP :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
use_kbmap = lexrc . getBool ( ) ;
2000-07-24 21:49:58 +00:00
break ;
1999-09-27 18:44:28 +00:00
case RC_KBMAP_PRIMARY :
2000-07-24 21:49:58 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
string const kmap ( lexrc . getString ( ) ) ;
2000-07-24 21:49:58 +00:00
if ( kmap . empty ( ) ) {
// nothing
} else if ( ! LibFileSearch ( " kbd " , kmap ,
" kmap " ) . empty ( ) )
primary_kbmap = kmap ;
2000-06-27 15:46:07 +00:00
else
lexrc . printError ( " LyX: Keymap `$$Token' not found " ) ;
2000-07-24 21:49:58 +00:00
}
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_KBMAP_SECONDARY :
2000-07-24 21:49:58 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
string const kmap ( lexrc . getString ( ) ) ;
2000-07-24 21:49:58 +00:00
if ( kmap . empty ( ) ) {
// nothing
} else if ( ! LibFileSearch ( " kbd " , kmap ,
" kmap " ) . empty ( ) )
secondary_kbmap = kmap ;
2000-06-27 15:46:07 +00:00
else
lexrc . printError ( " LyX: Keymap `$$Token' not found " ) ;
2000-07-24 21:49:58 +00:00
}
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_FONT_ENCODING :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
fontenc = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTER :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
printer = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINT_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTEVENPAGEFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_evenpage_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTODDPAGEFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_oddpage_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTPAGERANGEFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_pagerange_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_PRINTCOPIESFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_copies_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_PRINTCOLLCOPIESFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_collcopies_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTREVERSEFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_reverse_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTLANDSCAPEFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_landscape_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTTOPRINTER :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_to_printer = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINT_ADAPTOUTPUT :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_adapt_output = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTTOFILE :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_to_file = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTFILEEXTENSION :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_file_extension = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTEXSTRAOPTIONS :
1999-10-18 10:43:59 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_extra_options = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTSPOOL_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_spool_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PRINTSPOOL_PRINTERPREFIX :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_spool_printerprefix = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_PRINTPAPERDIMENSIONFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_paper_dimension_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_PRINTPAPERFLAG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
print_paper_flag = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_CUSTOM_EXPORT_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
custom_export_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_CUSTOM_EXPORT_FORMAT :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
custom_export_format = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
2000-01-11 01:59:00 +00:00
1999-09-27 18:44:28 +00:00
case RC_DEFAULT_PAPERSIZE :
if ( lexrc . next ( ) ) {
2001-08-02 18:46:53 +00:00
string const size =
2001-08-06 19:12:46 +00:00
lowercase ( lexrc . getString ( ) ) ;
1999-09-27 18:44:28 +00:00
if ( size = = " usletter " )
1999-12-01 00:57:31 +00:00
default_papersize =
BufferParams : : PAPER_USLETTER ;
1999-09-27 18:44:28 +00:00
else if ( size = = " legal " )
1999-12-01 00:57:31 +00:00
default_papersize =
BufferParams : : PAPER_LEGALPAPER ;
1999-09-27 18:44:28 +00:00
else if ( size = = " executive " )
1999-12-01 00:57:31 +00:00
default_papersize =
1999-12-16 06:43:25 +00:00
BufferParams : : PAPER_EXECUTIVEPAPER ;
1999-09-27 18:44:28 +00:00
else if ( size = = " a3 " )
1999-12-01 00:57:31 +00:00
default_papersize =
BufferParams : : PAPER_A3PAPER ;
1999-09-27 18:44:28 +00:00
else if ( size = = " a4 " )
1999-12-01 00:57:31 +00:00
default_papersize =
BufferParams : : PAPER_A4PAPER ;
1999-09-27 18:44:28 +00:00
else if ( size = = " a5 " )
1999-12-01 00:57:31 +00:00
default_papersize =
BufferParams : : PAPER_A5PAPER ;
1999-09-27 18:44:28 +00:00
else if ( size = = " b5 " )
1999-12-01 00:57:31 +00:00
default_papersize =
BufferParams : : PAPER_B5PAPER ;
1999-09-27 18:44:28 +00:00
}
break ;
2000-01-11 01:59:00 +00:00
2000-02-15 13:30:49 +00:00
case RC_VIEWDVI_PAPEROPTION :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
view_dvi_paper_option = lexrc . getString ( ) ;
2000-02-15 13:30:49 +00:00
else
2002-01-13 19:19:05 +00:00
view_dvi_paper_option . erase ( ) ;
2000-02-15 13:30:49 +00:00
break ;
1999-09-27 18:44:28 +00:00
case RC_PS_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
ps_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_CHKTEX_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
chktex_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_DPI :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
dpi = lexrc . getInteger ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_ZOOM :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
zoom = lexrc . getInteger ( ) ;
1999-09-27 18:44:28 +00:00
break ;
2000-07-04 20:32:37 +00:00
case RC_WHEEL_JUMP :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
wheel_jump = lexrc . getInteger ( ) ;
2000-07-04 20:32:37 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_FONT_SIZES :
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_TINY ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_SCRIPT ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_FOOTNOTE ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_SMALL ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_NORMAL ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_LARGE ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_LARGER ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_LARGEST ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_HUGE ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
if ( lexrc . next ( ) )
font_sizes [ LyXFont : : SIZE_HUGER ] =
2001-08-06 19:12:46 +00:00
lexrc . getFloat ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_FONT_SCALABLE :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
use_scalable_fonts = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_AUTOSAVE :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
autosave = lexrc . getInteger ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_DOCUMENTPATH :
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
document_path = ExpandPath ( lexrc . getString ( ) ) ;
1999-09-27 18:44:28 +00:00
}
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_TEMPLATEPATH :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
template_path = ExpandPath ( lexrc . getString ( ) ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_TEMPDIRPATH :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
tempdir_path = ExpandPath ( lexrc . getString ( ) ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_USETEMPDIR :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
use_tempdir = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_LASTFILES :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
lastfiles = ExpandPath ( lexrc . getString ( ) ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_NUMLASTFILES :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
num_lastfiles = lexrc . getInteger ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_CHECKLASTFILES :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
check_lastfiles = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_FONT_ROMAN :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
roman_font_name = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_FONT_SANS :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
sans_font_name = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
1999-09-27 18:44:28 +00:00
case RC_SCREEN_FONT_TYPEWRITER :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
typewriter_font_name = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_SCREEN_FONT_ENCODING :
2000-07-04 20:32:37 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
font_norm = lexrc . getString ( ) ;
2000-07-04 20:32:37 +00:00
set_font_norm_type ( ) ;
}
1999-09-27 18:44:28 +00:00
break ;
2000-03-10 13:22:20 +00:00
2002-01-10 15:14:22 +00:00
case RC_POPUP_BOLD_FONT :
if ( lexrc . next ( ) )
popup_bold_font = lexrc . getString ( ) ;
break ;
case RC_POPUP_NORMAL_FONT :
if ( lexrc . next ( ) )
popup_normal_font = lexrc . getString ( ) ;
break ;
case RC_POPUP_FONT_ENCODING :
2000-03-10 13:22:20 +00:00
if ( lexrc . next ( ) )
2002-01-10 15:14:22 +00:00
popup_font_encoding = lexrc . getString ( ) ;
2000-03-10 13:22:20 +00:00
break ;
2000-06-26 15:33:13 +00:00
case RC_SET_COLOR :
{
string lyx_name , x11_name ;
2000-07-25 12:44:07 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
lyx_name = lexrc . getString ( ) ;
2000-06-26 15:33:13 +00:00
} else {
2000-07-25 12:44:07 +00:00
lexrc . printError ( " Missing color tag. " ) ;
2000-06-26 15:33:13 +00:00
break ;
}
2000-07-25 12:44:07 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
x11_name = lexrc . getString ( ) ;
2000-06-26 15:33:13 +00:00
} else {
2000-07-25 12:44:07 +00:00
lexrc . printError ( " Missing color name for color : `$$Token' " ) ;
2000-06-26 15:33:13 +00:00
break ;
}
if ( ! lcolor . setColor ( lyx_name , x11_name ) )
lyxerr < < " Bad lyxrc set_color for "
< < lyx_name < < endl ;
break ;
}
1999-09-27 18:44:28 +00:00
case RC_AUTOREGIONDELETE :
// Auto region delete defaults to true
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
auto_region_delete = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_BIND :
{
// we should not do an explicit binding before
// loading a bind file. So, in this case, load
// the default bind file.
2000-12-11 13:41:21 +00:00
readBindFileIfNeeded ( ) ;
1999-09-27 18:44:28 +00:00
// !!!chb, dynamic key binding...
2001-10-01 15:31:59 +00:00
int action = 0 ;
string : : size_type res = 0 ;
1999-10-02 16:21:10 +00:00
string seq , cmd ;
1999-12-01 00:57:31 +00:00
2001-07-23 09:11:14 +00:00
if ( lexrc . next ( ) ) {
2001-08-06 19:12:46 +00:00
seq = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
} else {
2001-07-23 09:11:14 +00:00
lexrc . printError ( " RC_BIND: Missing key sequence " ) ;
1999-09-27 18:44:28 +00:00
break ;
}
1999-12-01 00:57:31 +00:00
2001-07-23 09:11:14 +00:00
if ( lexrc . next ( true ) ) {
2001-08-06 19:12:46 +00:00
cmd = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
} else {
2001-07-23 09:11:14 +00:00
lexrc . printError ( " RC_BIND: missing command " ) ;
1999-09-27 18:44:28 +00:00
break ;
}
1999-12-01 00:57:31 +00:00
2000-09-26 13:54:57 +00:00
if ( ( action = lyxaction . LookupFunc ( cmd ) ) > = 0 ) {
2001-06-29 11:54:39 +00:00
if ( lyxerr . debugging ( Debug : : LYXRC ) ) {
1999-10-07 18:44:17 +00:00
lyxerr < < " RC_BIND: Sequence ` "
< < seq < < " ' Command ` "
< < cmd < < " ' Action ` "
< < action < < ' \' ' < < endl ;
1999-09-27 18:44:28 +00:00
}
2001-11-30 13:25:38 +00:00
res = toplevel_keymap - > bind ( seq , kb_action ( action ) ) ;
2001-11-14 11:31:14 +00:00
if ( res ! = string : : npos
2001-06-29 11:54:39 +00:00
& & lyxerr . debugging ( Debug : : LYXRC ) ) {
1999-09-27 18:44:28 +00:00
lexrc . printError (
2001-05-16 10:36:06 +00:00
" RC_BIND: "
1999-12-01 00:57:31 +00:00
" Invalid key sequence ` "
+ seq + ' \' ' ) ;
1999-09-27 18:44:28 +00:00
}
} else { // cmd is the last token read.
lexrc . printError (
1999-12-01 00:57:31 +00:00
" Unknown LyX function `$$Token' " ) ;
1999-09-27 18:44:28 +00:00
}
break ;
}
2000-05-10 11:50:11 +00:00
case RC_OVERRIDE_X_DEADKEYS :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
override_x_deadkeys = lexrc . getBool ( ) ;
2000-05-10 11:50:11 +00:00
break ;
1999-09-27 18:44:28 +00:00
case RC_SERVERPIPE :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
lyxpipes = ExpandPath ( lexrc . getString ( ) ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_CURSOR_FOLLOWS_SCROLLBAR :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
cursor_follows_scrollbar = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
2000-01-13 16:28:54 +00:00
2001-09-07 10:11:02 +00:00
case RC_DIALOGS_ICONIFY_WITH_MAIN :
if ( lexrc . next ( ) )
dialogs_iconify_with_main = lexrc . getBool ( ) ;
break ;
1999-09-27 18:44:28 +00:00
case RC_ASCIIROFF_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
ascii_roff_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_ASCII_LINELEN :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
ascii_linelen = lexrc . getInteger ( ) ;
1999-09-27 18:44:28 +00:00
break ;
1999-12-01 00:57:31 +00:00
// Spellchecker settings:
2001-07-16 10:03:38 +00:00
# ifdef USE_PSPELL
case RC_USE_PSPELL :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
use_pspell = lexrc . getBool ( ) ;
2001-07-16 10:03:38 +00:00
break ;
# endif
1999-09-27 18:44:28 +00:00
case RC_SPELL_COMMAND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_command = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_ACCEPT_COMPOUND :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_accept_compound = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_USE_INP_ENC :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_use_input_encoding = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_USE_ALT_LANG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_use_alt_lang = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_USE_PERS_DICT :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_use_pers_dict = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_USE_ESC_CHARS :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_use_esc_chars = lexrc . getBool ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_ALT_LANG :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_alt_lang = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_PERS_DICT :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_pers_dict = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
case RC_ESC_CHARS :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
isp_esc_chars = lexrc . getString ( ) ;
1999-09-27 18:44:28 +00:00
break ;
2000-01-11 01:59:00 +00:00
case RC_MAKE_BACKUP :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
make_backup = lexrc . getBool ( ) ;
2000-01-11 01:59:00 +00:00
break ;
2000-03-20 14:49:54 +00:00
case RC_BACKUPDIR_PATH :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
backupdir_path = ExpandPath ( lexrc . getString ( ) ) ;
2000-03-20 14:49:54 +00:00
break ;
2000-02-01 13:58:06 +00:00
case RC_DATE_INSERT_FORMAT :
2000-02-01 11:32:33 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
date_insert_format = lexrc . getString ( ) ;
2000-02-01 11:32:33 +00:00
break ;
2000-03-10 13:22:20 +00:00
case RC_LANGUAGE_PACKAGE :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_package = lexrc . getString ( ) ;
2000-03-10 13:22:20 +00:00
break ;
2000-03-17 10:14:46 +00:00
case RC_LANGUAGE_AUTO_BEGIN :
2000-03-10 13:22:20 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_auto_begin = lexrc . getBool ( ) ;
2000-03-10 13:22:20 +00:00
break ;
2000-03-17 10:14:46 +00:00
case RC_LANGUAGE_AUTO_END :
2000-03-10 13:22:20 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_auto_end = lexrc . getBool ( ) ;
2000-03-10 13:22:20 +00:00
break ;
2001-02-25 10:22:54 +00:00
case RC_LANGUAGE_GLOBAL_OPTIONS :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_global_options = lexrc . getBool ( ) ;
2001-02-25 10:22:54 +00:00
break ;
case RC_LANGUAGE_USE_BABEL :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_use_babel = lexrc . getBool ( ) ;
2001-02-25 10:22:54 +00:00
break ;
2000-03-17 10:14:46 +00:00
case RC_LANGUAGE_COMMAND_BEGIN :
2000-03-10 13:22:20 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_command_begin = lexrc . getString ( ) ;
2000-03-10 13:22:20 +00:00
break ;
2000-03-17 10:14:46 +00:00
case RC_LANGUAGE_COMMAND_END :
2000-03-10 13:22:20 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_command_end = lexrc . getString ( ) ;
2000-03-10 13:22:20 +00:00
break ;
2001-02-25 10:22:54 +00:00
case RC_LANGUAGE_COMMAND_LOCAL :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
language_command_local = lexrc . getString ( ) ;
2001-02-25 10:22:54 +00:00
break ;
2000-02-03 19:51:27 +00:00
case RC_RTL_SUPPORT :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
rtl_support = lexrc . getBool ( ) ;
2000-02-03 19:51:27 +00:00
break ;
2000-04-10 21:40:13 +00:00
case RC_AUTO_NUMBER :
2000-03-17 10:14:46 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
auto_number = lexrc . getBool ( ) ;
2000-03-17 10:14:46 +00:00
break ;
2000-05-30 19:31:11 +00:00
case RC_MARK_FOREIGN_LANGUAGE :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
mark_foreign_language = lexrc . getBool ( ) ;
2000-05-31 08:47:26 +00:00
break ;
2000-03-06 02:42:40 +00:00
case RC_SHOW_BANNER :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
show_banner = lexrc . getBool ( ) ;
2000-03-06 02:42:40 +00:00
break ;
2000-08-08 11:08:07 +00:00
case RC_NEW_ASK_FILENAME :
2000-11-04 10:00:12 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
new_ask_filename = lexrc . getBool ( ) ;
2000-08-08 11:08:07 +00:00
break ;
2000-10-23 12:16:05 +00:00
case RC_CONVERTER : {
2000-08-30 03:40:51 +00:00
string from , to , command , flags ;
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
from = lexrc . getString ( ) ;
2000-08-30 03:40:51 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
to = lexrc . getString ( ) ;
2000-08-30 03:40:51 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
command = lexrc . getString ( ) ;
2000-08-30 03:40:51 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
flags = lexrc . getString ( ) ;
2000-11-13 10:35:02 +00:00
if ( command . empty ( ) | | command = = " none " )
2001-07-30 11:56:00 +00:00
converters . erase ( from , to ) ;
2000-11-13 10:35:02 +00:00
else
2001-07-30 11:56:00 +00:00
converters . add ( from , to , command , flags ) ;
2000-08-30 03:40:51 +00:00
break ;
}
2000-10-23 12:16:05 +00:00
case RC_VIEWER : {
2000-08-30 03:40:51 +00:00
string format , command ;
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
format = lexrc . getString ( ) ;
2000-08-30 03:40:51 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
command = lexrc . getString ( ) ;
2001-07-30 11:56:00 +00:00
formats . setViewer ( format , command ) ;
2000-08-30 03:40:51 +00:00
break ;
}
2000-10-23 12:16:05 +00:00
case RC_FORMAT : {
string format , extension , prettyname , shortcut ;
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
format = lexrc . getString ( ) ;
2000-10-23 12:16:05 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
extension = lexrc . getString ( ) ;
2000-10-23 12:16:05 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
prettyname = lexrc . getString ( ) ;
2000-10-23 12:16:05 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
shortcut = lexrc . getString ( ) ;
2000-11-13 10:35:02 +00:00
if ( prettyname . empty ( ) ) {
2001-07-30 11:56:00 +00:00
if ( converters . formatIsUsed ( format ) )
2000-11-13 10:35:02 +00:00
lyxerr < < " Can't delete format "
< < format < < endl ;
else
2001-07-30 11:56:00 +00:00
formats . erase ( format ) ;
2000-11-13 10:35:02 +00:00
} else
2001-07-30 11:56:00 +00:00
formats . add ( format , extension , prettyname ,
2000-11-13 10:35:02 +00:00
shortcut ) ;
2000-10-23 12:16:05 +00:00
break ;
}
2000-09-27 15:23:24 +00:00
case RC_DEFAULT_LANGUAGE :
2000-11-04 10:00:12 +00:00
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
default_language = lexrc . getString ( ) ;
2000-09-27 15:23:24 +00:00
break ;
2000-06-26 15:33:13 +00:00
2000-12-11 09:46:09 +00:00
case RC_LABEL_INIT_LENGTH :
if ( lexrc . next ( ) )
2001-08-06 19:12:46 +00:00
label_init_length = lexrc . getInteger ( ) ;
2000-12-11 09:46:09 +00:00
break ;
1999-12-01 00:57:31 +00:00
case RC_LAST : break ; // this is just a dummy
1999-09-27 18:44:28 +00:00
}
}
2001-02-07 15:26:33 +00:00
/// Update converters data-structures
2001-07-30 11:56:00 +00:00
converters . update ( formats ) ;
converters . buildGraph ( ) ;
2001-02-07 15:26:33 +00:00
1999-09-27 18:44:28 +00:00
return 0 ;
}
1999-12-01 00:57:31 +00:00
void LyXRC : : write ( string const & filename ) const
1999-09-27 18:44:28 +00:00
{
1999-12-01 00:57:31 +00:00
ofstream ofs ( filename . c_str ( ) ) ;
if ( ofs )
output ( ofs ) ;
}
void LyXRC : : print ( ) const
{
if ( lyxerr . debugging ( ) )
output ( lyxerr ) ;
else
output ( cout ) ;
}
void LyXRC : : output ( ostream & os ) const
{
os < < " ### This file is part of \n "
< < " ### ======================================================== \n "
< < " ### LyX, The Document Processor \n "
< < " ### \n "
< < " ### Copyright 1995 Matthias Ettrich \n "
2001-05-30 13:53:44 +00:00
< < " ### Copyright 1995-2001 The LyX Team. \n "
1999-12-01 00:57:31 +00:00
< < " ### \n "
< < " ### ======================================================== \n "
< < " \n "
< < " # This file is written by LyX, if you want to make your own \n "
< < " # modifications you should do them from inside LyX and save \n "
< < " \n " ;
// Why the switch you might ask. It is a trick to ensure that all
// the elements in the LyXRCTags enum is handled. As you can see
// there are no breaks at all. So it is just a huge fall-through.
// The nice thing is that we will get a warning from the compiler
// if we forget an element.
LyXRCTags tag = RC_LAST ;
2000-11-04 10:00:12 +00:00
switch ( tag ) {
1999-12-01 00:57:31 +00:00
case RC_LAST :
case RC_INPUT :
// input/include files are not done here
case RC_BIND :
// bindings is not written to the preferences file.
case RC_BINDFILE :
2000-10-10 14:17:33 +00:00
if ( bind_file ! = system_lyxrc . bind_file ) {
os < < " \\ bind_file " < < bind_file < < " \n " ;
}
2000-07-24 21:49:58 +00:00
//
// Misc Section
//
os < < " \n # \n "
< < " # MISC SECTION ###################################### \n "
< < " # \n \n " ;
case RC_SHOW_BANNER :
2000-10-10 14:17:33 +00:00
if ( show_banner ! = system_lyxrc . show_banner ) {
os < < " # Set to false to inhibit the startup banner. \n "
< < " \\ show_banner " < < tostr ( show_banner ) < < " \n " ;
}
1999-12-01 00:57:31 +00:00
// bind files are not done here.
2000-07-24 13:53:19 +00:00
case RC_UIFILE :
2000-10-10 14:17:33 +00:00
if ( ui_file ! = system_lyxrc . ui_file ) {
os < < " \\ ui_file \" " < < ui_file < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_AUTOREGIONDELETE :
2000-10-10 14:17:33 +00:00
if ( auto_region_delete ! = system_lyxrc . auto_region_delete ) {
os < < " # Set to false to inhibit automatic replacement of \n "
< < " # the current selection. \n "
< < " \\ auto_region_delete " < < tostr ( auto_region_delete )
< < " \n " ;
}
2001-09-21 10:41:09 +00:00
case RC_AUTORESET_OPTIONS :
if ( auto_reset_options ! = system_lyxrc . auto_reset_options ) {
os < < " # Set to false to inhibit automatic reset of \n "
< < " # the class options to defaults on class change. \n "
< < " \\ auto_reset_options " < < tostr ( auto_reset_options )
< < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_AUTOSAVE :
2000-10-10 14:17:33 +00:00
if ( autosave ! = system_lyxrc . autosave ) {
os < < " # The time interval between auto-saves in seconds. \n "
< < " \\ autosave " < < autosave < < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_EXIT_CONFIRMATION :
2000-10-10 14:17:33 +00:00
if ( exit_confirmation ! = system_lyxrc . exit_confirmation ) {
os < < " # Ask for confirmation before exit if there are \n "
< < " # unsaved changed documents. \n "
< < " \\ exit_confirmation " < < tostr ( exit_confirmation )
< < " \n " ;
}
2001-09-18 10:58:35 +00:00
case RC_DISPLAY_GRAPHICS :
if ( display_graphics ! = system_lyxrc . display_graphics ) {
os < < " # Display graphics within LyX \n "
< < " # no|mono|gray|color \n "
< < " \\ display_graphics " < < display_graphics
< < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_DISPLAY_SHORTCUTS :
2000-10-10 14:17:33 +00:00
if ( display_shortcuts ! = system_lyxrc . display_shortcuts ) {
os < < " # Display name of the last command executed, \n "
< < " # with a list of short-cuts in the minibuffer. \n "
< < " \\ display_shortcuts " < < tostr ( display_shortcuts )
< < " \n " ;
}
2000-02-15 13:30:49 +00:00
case RC_VIEWDVI_PAPEROPTION :
2000-10-10 14:17:33 +00:00
if ( view_dvi_paper_option
! = system_lyxrc . view_dvi_paper_option ) {
os < < " # Options used to specify paper size to the \n "
2001-09-02 11:46:00 +00:00
< < " # view_dvi_command (e.g. -paper) \n "
2000-10-10 14:17:33 +00:00
< < " \\ view_dvi_paper_option \" "
< < view_dvi_paper_option < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_DEFAULT_PAPERSIZE :
2000-10-10 14:17:33 +00:00
if ( default_papersize ! = system_lyxrc . default_papersize ) {
os < < " # The default papersize to use. \n "
< < " \\ default_papersize \" " ;
switch ( default_papersize ) {
case BufferParams : : PAPER_USLETTER :
os < < " usletter " ; break ;
case BufferParams : : PAPER_LEGALPAPER :
os < < " legal " ; break ;
case BufferParams : : PAPER_EXECUTIVEPAPER :
os < < " executive " ; break ;
case BufferParams : : PAPER_A3PAPER :
os < < " a3 " ; break ;
case BufferParams : : PAPER_A4PAPER :
os < < " a4 " ; break ;
case BufferParams : : PAPER_A5PAPER :
os < < " a5 " ; break ;
case BufferParams : : PAPER_B5PAPER :
os < < " b5 " ; break ;
case BufferParams : : PAPER_DEFAULT : break ;
}
os < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_PS_COMMAND :
2000-10-10 14:17:33 +00:00
if ( ps_command ! = system_lyxrc . ps_command ) {
os < < " # Program used for interpreting postscript. \n "
< < " \\ ps_command \" " < < ps_command < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_CHKTEX_COMMAND :
2000-10-10 14:17:33 +00:00
if ( chktex_command ! = system_lyxrc . chktex_command ) {
os < < " \\ chktex_command \" " < < chktex_command < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_KBMAP :
2000-10-10 14:17:33 +00:00
if ( use_kbmap ! = system_lyxrc . use_kbmap ) {
os < < " \\ kbmap " < < tostr ( use_kbmap ) < < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_KBMAP_PRIMARY :
2000-10-10 14:17:33 +00:00
if ( primary_kbmap ! = system_lyxrc . primary_kbmap ) {
os < < " \\ kbmap_primary \" " < < primary_kbmap < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_KBMAP_SECONDARY :
2000-10-10 14:17:33 +00:00
if ( secondary_kbmap ! = system_lyxrc . secondary_kbmap ) {
os < < " \\ kbmap_secondary \" " < < secondary_kbmap
< < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_SERVERPIPE :
2000-10-10 14:17:33 +00:00
if ( lyxpipes ! = system_lyxrc . lyxpipes ) {
os < < " \\ serverpipe \" " < < lyxpipes < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_DATE_INSERT_FORMAT :
2000-10-10 14:17:33 +00:00
if ( date_insert_format ! = system_lyxrc . date_insert_format ) {
os < < " \\ date_insert_format \" " < < date_insert_format
< < " \" \n " ;
}
2000-12-11 09:46:09 +00:00
case RC_LABEL_INIT_LENGTH :
if ( label_init_length ! = system_lyxrc . label_init_length ) {
os < < " \\ label_init_length " < < label_init_length
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
< < " # SCREEN & FONTS SECTION ############################ \n "
< < " # \n \n " ;
2002-01-10 15:14:22 +00:00
case RC_POPUP_NORMAL_FONT :
if ( popup_normal_font ! = system_lyxrc . popup_normal_font ) {
os < < " \\ popup_normal_font \" " < < popup_normal_font
< < " \" \n " ;
}
case RC_POPUP_BOLD_FONT :
if ( popup_bold_font ! = system_lyxrc . popup_bold_font ) {
os < < " \\ popup_bold_font \" " < < popup_bold_font
< < " \" \n " ;
}
case RC_POPUP_FONT_ENCODING :
if ( popup_font_encoding ! = system_lyxrc . popup_font_encoding ) {
os < < " \\ popup_font_encoding \" " < < popup_font_encoding
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_SCREEN_DPI :
2000-10-10 14:17:33 +00:00
if ( dpi ! = system_lyxrc . dpi ) {
os < < " \\ screen_dpi " < < dpi < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_SCREEN_ZOOM :
2000-10-10 14:17:33 +00:00
if ( zoom ! = system_lyxrc . zoom ) {
os < < " \\ screen_zoom " < < zoom < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_WHEEL_JUMP :
2000-10-10 14:17:33 +00:00
if ( wheel_jump ! = system_lyxrc . wheel_jump ) {
os < < " \\ wheel_jump " < < wheel_jump < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_CURSOR_FOLLOWS_SCROLLBAR :
2000-10-10 14:17:33 +00:00
if ( cursor_follows_scrollbar
! = system_lyxrc . cursor_follows_scrollbar ) {
os < < " \\ cursor_follows_scrollbar "
< < tostr ( cursor_follows_scrollbar ) < < " \n " ;
}
2001-09-07 10:11:02 +00:00
case RC_DIALOGS_ICONIFY_WITH_MAIN :
if ( dialogs_iconify_with_main
! = system_lyxrc . dialogs_iconify_with_main ) {
os < < " \\ dialogs_iconify_with_main "
< < tostr ( dialogs_iconify_with_main ) < < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_SCREEN_FONT_ROMAN :
2000-10-10 14:17:33 +00:00
if ( roman_font_name ! = system_lyxrc . roman_font_name ) {
os < < " \\ screen_font_roman \" " < < roman_font_name
< < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_SCREEN_FONT_SANS :
2000-10-10 14:17:33 +00:00
if ( sans_font_name ! = system_lyxrc . sans_font_name ) {
os < < " \\ screen_font_sans \" " < < sans_font_name
< < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_SCREEN_FONT_TYPEWRITER :
2000-10-10 14:17:33 +00:00
if ( typewriter_font_name ! = system_lyxrc . typewriter_font_name ) {
os < < " \\ screen_font_typewriter \" "
< < typewriter_font_name < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_SCREEN_FONT_SCALABLE :
2000-10-10 14:17:33 +00:00
if ( use_scalable_fonts ! = system_lyxrc . use_scalable_fonts ) {
os < < " \\ screen_font_scalable "
< < tostr ( use_scalable_fonts )
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_SCREEN_FONT_ENCODING :
2000-10-10 14:17:33 +00:00
if ( font_norm ! = system_lyxrc . font_norm ) {
os < < " \\ screen_font_encoding \" " < < font_norm
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_SCREEN_FONT_SIZES :
2000-10-10 14:17:33 +00:00
if ( font_sizes [ LyXFont : : SIZE_TINY ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_TINY ] | |
font_sizes [ LyXFont : : SIZE_SCRIPT ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_SCRIPT ] | |
font_sizes [ LyXFont : : SIZE_FOOTNOTE ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_FOOTNOTE ] | |
font_sizes [ LyXFont : : SIZE_SMALL ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_SMALL ] | |
font_sizes [ LyXFont : : SIZE_NORMAL ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_NORMAL ] | |
font_sizes [ LyXFont : : SIZE_LARGE ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_LARGE ] | |
font_sizes [ LyXFont : : SIZE_LARGER ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_LARGER ] | |
font_sizes [ LyXFont : : SIZE_LARGEST ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_LARGEST ] | |
font_sizes [ LyXFont : : SIZE_HUGE ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_HUGE ] | |
font_sizes [ LyXFont : : SIZE_HUGER ]
! = system_lyxrc . font_sizes [ LyXFont : : SIZE_HUGER ] ) {
os . setf ( ios : : fixed ) ;
os . precision ( 2 ) ;
2000-11-17 00:07:41 +00:00
os < < " \\ screen_font_sizes "
< < " " < < font_sizes [ LyXFont : : SIZE_TINY ]
< < " " < < font_sizes [ LyXFont : : SIZE_SCRIPT ]
< < " " < < font_sizes [ LyXFont : : SIZE_FOOTNOTE ]
< < " " < < font_sizes [ LyXFont : : SIZE_SMALL ]
< < " " < < font_sizes [ LyXFont : : SIZE_NORMAL ]
< < " " < < font_sizes [ LyXFont : : SIZE_LARGE ]
< < " " < < font_sizes [ LyXFont : : SIZE_LARGER ]
< < " " < < font_sizes [ LyXFont : : SIZE_LARGEST ]
< < " " < < font_sizes [ LyXFont : : SIZE_HUGE ]
< < " " < < font_sizes [ LyXFont : : SIZE_HUGER ]
< < " \n " ;
2000-10-10 14:17:33 +00:00
}
2000-11-15 18:02:45 +00:00
os < < " \n # \n "
< < " # COLOR SECTION ################################### \n "
< < " # \n \n " ;
case RC_SET_COLOR :
2000-11-17 00:07:41 +00:00
for ( int i = 0 ; i < LColor : : ignore ; + + i ) {
2000-11-15 18:02:45 +00:00
LColor : : color lc = static_cast < LColor : : color > ( i ) ;
2000-11-17 00:07:41 +00:00
string const col ( lcolor . getX11Name ( lc ) ) ;
if ( col ! = system_lcolor . getX11Name ( lc ) ) {
os < < " \\ set_color \" "
< < lcolor . getLyXName ( lc ) < < " \" \" "
< < col < < " \" \n " ;
2000-11-15 18:02:45 +00:00
}
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
< < " # PRINTER SECTION ################################### \n "
< < " # \n \n " ;
case RC_PRINTER :
2000-10-10 14:17:33 +00:00
if ( printer ! = system_lyxrc . printer ) {
os < < " \\ printer \" " < < printer < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINT_ADAPTOUTPUT :
2000-10-10 14:17:33 +00:00
if ( print_adapt_output ! = system_lyxrc . print_adapt_output ) {
os < < " \\ print_adapt_output "
< < tostr ( print_adapt_output )
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINT_COMMAND :
2000-10-10 14:17:33 +00:00
if ( print_command ! = system_lyxrc . print_command ) {
os < < " \\ print_command \" " < < print_command < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTEXSTRAOPTIONS :
2000-10-10 14:17:33 +00:00
if ( print_extra_options ! = system_lyxrc . print_extra_options ) {
os < < " \\ print_extra_options \" " < < print_extra_options
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTSPOOL_COMMAND :
2000-10-10 14:17:33 +00:00
if ( print_spool_command ! = system_lyxrc . print_spool_command ) {
os < < " \\ print_spool_command \" " < < print_spool_command
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTSPOOL_PRINTERPREFIX :
2000-10-10 14:17:33 +00:00
if ( print_spool_printerprefix
! = system_lyxrc . print_spool_printerprefix ) {
os < < " \\ print_spool_printerprefix \" "
< < print_spool_printerprefix < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTEVENPAGEFLAG :
2000-10-10 14:17:33 +00:00
if ( print_evenpage_flag ! = system_lyxrc . print_evenpage_flag ) {
os < < " \\ print_evenpage_flag \" " < < print_evenpage_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTODDPAGEFLAG :
2000-10-10 14:17:33 +00:00
if ( print_oddpage_flag ! = system_lyxrc . print_oddpage_flag ) {
os < < " \\ print_oddpage_flag \" " < < print_oddpage_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTREVERSEFLAG :
2000-10-10 14:17:33 +00:00
if ( print_reverse_flag ! = system_lyxrc . print_reverse_flag ) {
os < < " \\ print_reverse_flag \" " < < print_reverse_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTLANDSCAPEFLAG :
2000-10-10 14:17:33 +00:00
if ( print_landscape_flag ! = system_lyxrc . print_landscape_flag ) {
os < < " \\ print_landscape_flag \" " < < print_landscape_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTPAGERANGEFLAG :
2000-10-10 14:17:33 +00:00
if ( print_pagerange_flag ! = system_lyxrc . print_pagerange_flag ) {
os < < " \\ print_pagerange_flag \" " < < print_pagerange_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTCOPIESFLAG :
2000-10-10 14:17:33 +00:00
if ( print_copies_flag ! = system_lyxrc . print_copies_flag ) {
os < < " \\ print_copies_flag \" " < < print_copies_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTCOLLCOPIESFLAG :
2000-10-10 14:17:33 +00:00
if ( print_collcopies_flag
! = system_lyxrc . print_collcopies_flag ) {
os < < " \\ print_collcopies_flag \" "
< < print_collcopies_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTPAPERFLAG :
2000-10-10 14:17:33 +00:00
if ( print_paper_flag ! = system_lyxrc . print_paper_flag ) {
os < < " \\ print_paper_flag \" " < < print_paper_flag
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTPAPERDIMENSIONFLAG :
2000-10-10 14:17:33 +00:00
if ( print_paper_dimension_flag
! = system_lyxrc . print_paper_dimension_flag ) {
os < < " \\ print_paper_dimension_flag \" "
< < print_paper_dimension_flag < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTTOPRINTER :
2000-10-10 14:17:33 +00:00
if ( print_to_printer ! = system_lyxrc . print_to_printer ) {
os < < " \\ print_to_printer \" " < < print_to_printer
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTTOFILE :
2000-10-10 14:17:33 +00:00
if ( print_to_file ! = system_lyxrc . print_to_file ) {
os < < " \\ print_to_file \" " < < print_to_file < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PRINTFILEEXTENSION :
2000-10-10 14:17:33 +00:00
if ( print_file_extension ! = system_lyxrc . print_file_extension ) {
os < < " \\ print_file_extension \" "
< < print_file_extension
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
< < " # EXPORT SECTION #################################### \n "
< < " # \n \n " ;
case RC_CUSTOM_EXPORT_COMMAND :
2000-10-10 14:17:33 +00:00
if ( custom_export_command
! = system_lyxrc . custom_export_command ) {
os < < " \\ custom_export_command \" "
< < custom_export_command
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_CUSTOM_EXPORT_FORMAT :
2000-10-10 14:17:33 +00:00
if ( custom_export_format
! = system_lyxrc . custom_export_format ) {
os < < " \\ custom_export_format \" " < < custom_export_format
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
2000-10-10 14:17:33 +00:00
< < " # TEX SECTION ####################################### \n "
2000-07-24 21:49:58 +00:00
< < " # \n \n " ;
case RC_FONT_ENCODING :
2000-10-10 14:17:33 +00:00
if ( fontenc ! = system_lyxrc . fontenc ) {
os < < " \\ font_encoding \" " < < fontenc < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
2000-10-10 14:17:33 +00:00
< < " # FILE SECTION ###################################### \n "
2000-07-24 21:49:58 +00:00
< < " # \n \n " ;
case RC_DOCUMENTPATH :
2000-10-10 14:17:33 +00:00
if ( document_path ! = system_lyxrc . document_path ) {
os < < " \\ document_path \" " < < document_path < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_LASTFILES :
2000-10-10 14:17:33 +00:00
if ( lastfiles ! = system_lyxrc . lastfiles ) {
os < < " \\ lastfiles \" " < < lastfiles < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_NUMLASTFILES :
2000-10-10 14:17:33 +00:00
if ( num_lastfiles ! = system_lyxrc . num_lastfiles ) {
os < < " \\ num_lastfiles " < < num_lastfiles < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_CHECKLASTFILES :
2000-10-10 14:17:33 +00:00
if ( check_lastfiles ! = system_lyxrc . check_lastfiles ) {
os < < " \\ check_lastfiles " < < tostr ( check_lastfiles )
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_TEMPLATEPATH :
2000-10-10 14:17:33 +00:00
if ( template_path ! = system_lyxrc . template_path ) {
os < < " \\ template_path \" " < < template_path < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_TEMPDIRPATH :
2000-10-10 14:17:33 +00:00
if ( tempdir_path ! = system_lyxrc . tempdir_path ) {
os < < " \\ tempdir_path \" " < < tempdir_path < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_USETEMPDIR :
2000-10-10 14:17:33 +00:00
if ( use_tempdir ! = system_lyxrc . use_tempdir ) {
os < < " \\ use_tempdir " < < tostr ( use_tempdir ) < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_ASCII_LINELEN :
2000-10-10 14:17:33 +00:00
if ( ascii_linelen ! = system_lyxrc . ascii_linelen ) {
os < < " \\ ascii_linelen " < < ascii_linelen < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_MAKE_BACKUP :
2000-10-10 14:17:33 +00:00
if ( make_backup ! = system_lyxrc . make_backup ) {
os < < " \\ make_backup " < < tostr ( make_backup ) < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_BACKUPDIR_PATH :
2000-10-10 14:17:33 +00:00
if ( backupdir_path ! = system_lyxrc . backupdir_path ) {
os < < " \\ backupdir_path \" " < < backupdir_path < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
2000-10-10 14:17:33 +00:00
< < " # ASCII EXPORT SECTION ############################## \n "
2000-07-24 21:49:58 +00:00
< < " # \n \n " ;
1999-12-01 00:57:31 +00:00
case RC_ASCIIROFF_COMMAND :
2000-10-10 14:17:33 +00:00
if ( ascii_roff_command ! = system_lyxrc . ascii_roff_command ) {
os < < " \\ ascii_roff_command \" " < < ascii_roff_command
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
< < " # SPELLCHECKER SECTION ############################## \n "
< < " # \n \n " ;
2001-07-16 10:03:38 +00:00
# ifdef USE_PSPELL
case RC_USE_PSPELL :
if ( use_pspell ! = system_lyxrc . use_pspell ) {
2002-01-16 16:07:09 +00:00
os < < " \\ use_pspell " < < tostr ( use_pspell ) < < " \n " ;
2001-07-16 10:03:38 +00:00
}
# endif
1999-12-01 00:57:31 +00:00
case RC_SPELL_COMMAND :
2000-10-10 14:17:33 +00:00
if ( isp_command ! = system_lyxrc . isp_command ) {
os < < " \\ spell_command \" " < < isp_command < < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_ACCEPT_COMPOUND :
2000-10-10 14:17:33 +00:00
if ( isp_accept_compound ! = system_lyxrc . isp_accept_compound ) {
os < < " \\ accept_compound " < < tostr ( isp_accept_compound )
< < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_USE_ALT_LANG :
2000-10-10 14:17:33 +00:00
if ( isp_use_alt_lang ! = system_lyxrc . isp_use_alt_lang ) {
os < < " \\ use_alt_language " < < tostr ( isp_use_alt_lang )
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_ALT_LANG :
2000-10-10 14:17:33 +00:00
if ( isp_alt_lang ! = system_lyxrc . isp_alt_lang ) {
os < < " \\ alternate_language \" " < < isp_alt_lang
< < " \" \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_USE_ESC_CHARS :
2000-10-10 14:17:33 +00:00
if ( isp_use_esc_chars ! = system_lyxrc . isp_use_esc_chars ) {
os < < " \\ use_escape_chars " < < tostr ( isp_use_esc_chars )
< < " \n " ;
}
1999-12-01 00:57:31 +00:00
case RC_ESC_CHARS :
2000-10-10 14:17:33 +00:00
if ( isp_esc_chars ! = system_lyxrc . isp_esc_chars ) {
os < < " \\ escape_chars \" " < < isp_esc_chars < < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_USE_PERS_DICT :
2000-10-10 14:17:33 +00:00
if ( isp_use_pers_dict ! = system_lyxrc . isp_use_pers_dict ) {
os < < " \\ use_personal_dictionary "
< < tostr ( isp_use_pers_dict )
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_PERS_DICT :
2000-10-10 14:17:33 +00:00
if ( isp_pers_dict ! = system_lyxrc . isp_pers_dict ) {
os < < " \\ personal_dictionary \" " < < isp_pers_dict
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_USE_INP_ENC :
2000-10-10 14:17:33 +00:00
if ( isp_use_input_encoding
! = system_lyxrc . isp_use_input_encoding ) {
os < < " \\ use_input_encoding "
< < tostr ( isp_use_input_encoding )
< < " \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
2000-10-10 14:17:33 +00:00
< < " # LANGUAGE SUPPORT SECTION ########################## \n "
2000-07-24 21:49:58 +00:00
< < " # \n \n " ;
2000-02-03 19:51:27 +00:00
case RC_RTL_SUPPORT :
2000-10-10 14:17:33 +00:00
if ( rtl_support ! = system_lyxrc . rtl_support ) {
os < < " \\ rtl " < < tostr ( rtl_support ) < < " \n " ;
}
2000-03-10 13:22:20 +00:00
case RC_LANGUAGE_PACKAGE :
2000-10-10 14:17:33 +00:00
if ( language_package ! = system_lyxrc . language_package ) {
os < < " \\ language_package \" " < < language_package
< < " \" \n " ;
}
2001-02-25 10:22:54 +00:00
case RC_LANGUAGE_GLOBAL_OPTIONS :
if ( language_global_options
! = system_lyxrc . language_global_options ) {
os < < " \\ language_global_options \" "
< < tostr ( language_global_options )
< < " \" \n " ;
}
case RC_LANGUAGE_USE_BABEL :
if ( language_use_babel ! = system_lyxrc . language_use_babel ) {
os < < " \\ language_use_babel \" "
< < tostr ( language_use_babel )
< < " \" \n " ;
}
2000-03-17 10:14:46 +00:00
case RC_LANGUAGE_COMMAND_BEGIN :
2000-10-10 14:17:33 +00:00
if ( language_command_begin
! = system_lyxrc . language_command_begin ) {
os < < " \\ language_command_begin \" "
< < language_command_begin
< < " \" \n " ;
}
2000-03-17 10:14:46 +00:00
case RC_LANGUAGE_COMMAND_END :
2000-10-10 14:17:33 +00:00
if ( language_command_end
! = system_lyxrc . language_command_end ) {
os < < " \\ language_command_end \" " < < language_command_end
< < " \" \n " ;
}
2001-02-25 10:22:54 +00:00
case RC_LANGUAGE_COMMAND_LOCAL :
if ( language_command_local
! = system_lyxrc . language_command_local ) {
os < < " \\ language_command_local \" "
< < language_command_local
< < " \" \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_LANGUAGE_AUTO_BEGIN :
2000-10-10 14:17:33 +00:00
if ( language_auto_begin ! = system_lyxrc . language_auto_begin ) {
os < < " \\ language_auto_begin "
< < tostr ( language_auto_begin ) < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_LANGUAGE_AUTO_END :
2000-10-10 14:17:33 +00:00
if ( language_auto_end ! = system_lyxrc . language_auto_end ) {
os < < " \\ language_auto_end "
< < tostr ( language_auto_end ) < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_MARK_FOREIGN_LANGUAGE :
2000-10-10 14:17:33 +00:00
if ( mark_foreign_language
! = system_lyxrc . mark_foreign_language ) {
os < < " \\ mark_foreign_language " < <
tostr ( mark_foreign_language ) < < " \n " ;
}
2000-07-24 21:49:58 +00:00
os < < " \n # \n "
< < " # 2nd MISC SUPPORT SECTION ########################## \n "
< < " # \n \n " ;
case RC_OVERRIDE_X_DEADKEYS :
2000-10-10 14:17:33 +00:00
if ( override_x_deadkeys ! = system_lyxrc . override_x_deadkeys ) {
os < < " \\ override_x_deadkeys "
< < tostr ( override_x_deadkeys ) < < " \n " ;
}
2000-07-24 21:49:58 +00:00
case RC_AUTO_NUMBER :
2000-10-10 14:17:33 +00:00
if ( auto_number ! = system_lyxrc . auto_number ) {
os < < " \\ auto_number " < < tostr ( auto_number ) < < " \n " ;
}
2000-08-08 13:55:26 +00:00
case RC_NEW_ASK_FILENAME :
2000-10-10 14:17:33 +00:00
if ( new_ask_filename ! = system_lyxrc . new_ask_filename ) {
os < < " \\ new_ask_filename " < < tostr ( new_ask_filename )
< < " \n " ;
}
2000-09-27 15:23:24 +00:00
case RC_DEFAULT_LANGUAGE :
2000-10-10 14:17:33 +00:00
if ( default_language ! = system_lyxrc . default_language ) {
os < < " \\ default_language " < < default_language < < " \n " ;
}
2000-11-06 11:20:22 +00:00
os < < " \n # \n "
< < " # FORMATS SECTION ########################## \n "
< < " # \n \n " ;
2000-11-13 10:35:02 +00:00
case RC_FORMAT :
// Look for deleted formats
for ( Formats : : const_iterator cit = formats . begin ( ) ;
cit ! = formats . end ( ) ; + + cit ) {
Format const * format =
2001-07-30 11:56:00 +00:00
system_formats . getFormat ( cit - > name ( ) ) ;
2000-11-13 10:35:02 +00:00
if ( ! format | |
format - > extension ( ) ! = cit - > extension ( ) | |
format - > prettyname ( ) ! = cit - > prettyname ( ) | |
format - > shortcut ( ) ! = cit - > shortcut ( ) )
os < < " \\ format \" " < < cit - > name ( ) < < " \" \" "
< < cit - > extension ( ) < < " \" \" "
< < cit - > prettyname ( ) < < " \" \" "
< < cit - > shortcut ( ) < < " \" \n " ;
2000-11-06 11:20:22 +00:00
}
2000-11-13 10:35:02 +00:00
// New/modifed formats
for ( Formats : : const_iterator cit = system_formats . begin ( ) ;
cit ! = system_formats . end ( ) ; + + cit )
2001-07-30 11:56:00 +00:00
if ( ! formats . getFormat ( cit - > name ( ) ) )
2000-11-13 10:35:02 +00:00
os < < " \\ format \" " < < cit - > name ( )
2000-11-06 11:20:22 +00:00
< < " \" \" \" \" \" \" \" \n " ;
2000-11-13 10:35:02 +00:00
case RC_VIEWER :
for ( Formats : : const_iterator cit = formats . begin ( ) ;
cit ! = formats . end ( ) ; + + cit ) {
Format const * format =
2001-07-30 11:56:00 +00:00
system_formats . getFormat ( cit - > name ( ) ) ;
2000-11-13 10:35:02 +00:00
if ( ( ! format | | format - > viewer ( ) ! = cit - > viewer ( ) ) & &
( format | | ! cit - > viewer ( ) . empty ( ) ) )
os < < " \\ viewer \" " < < cit - > name ( ) < < " \" \" "
< < cit - > viewer ( ) < < " \" \n " ;
}
os < < " \n # \n "
< < " # CONVERTERS SECTION ########################## \n "
< < " # \n \n " ;
case RC_CONVERTER :
// Look for new converters
for ( Converters : : const_iterator cit = converters . begin ( ) ;
cit ! = converters . end ( ) ; + + cit ) {
Converter const * converter =
2001-07-30 11:56:00 +00:00
system_converters . getConverter ( cit - > from ,
2000-11-13 10:35:02 +00:00
cit - > to ) ;
if ( ! converter | |
converter - > command ! = cit - > command | |
converter - > flags ! = cit - > flags )
os < < " \\ converter \" " < < cit - > from < < " \" \" "
< < cit - > to < < " \" \" "
< < cit - > command < < " \" \" "
< < cit - > flags < < " \" \n " ;
2000-11-06 11:20:22 +00:00
}
2000-11-13 10:35:02 +00:00
// New/modifed converters
for ( Converters : : const_iterator cit = system_converters . begin ( ) ;
cit ! = system_converters . end ( ) ; + + cit )
2001-07-30 11:56:00 +00:00
if ( ! converters . getConverter ( cit - > from , cit - > to ) )
2000-11-13 10:35:02 +00:00
os < < " \\ converter \" " < < cit - > from
< < " \" \" " < < cit - > to < < " \" \" \" \" \" \n " ;
1999-12-01 00:57:31 +00:00
}
os . flush ( ) ;
1999-09-27 18:44:28 +00:00
}
2000-07-04 20:32:37 +00:00
void LyXRC : : set_font_norm_type ( )
{
if ( font_norm = = " iso10646-1 " )
font_norm_type = ISO_10646_1 ;
2000-10-30 21:53:29 +00:00
else if ( font_norm = = " iso8859-1 " )
font_norm_type = ISO_8859_1 ;
2001-10-05 16:25:34 +00:00
else if ( font_norm = = " iso8859-3 " )
font_norm_type = ISO_8859_3 ;
2001-10-08 14:50:16 +00:00
else if ( font_norm = = " iso8859-4 " )
font_norm_type = ISO_8859_4 ;
2000-07-04 20:32:37 +00:00
else if ( font_norm = = " iso8859-6.8x " )
font_norm_type = ISO_8859_6_8 ;
2000-10-30 21:53:29 +00:00
else if ( font_norm = = " iso8859-9 " )
font_norm_type = ISO_8859_9 ;
2001-07-18 16:33:26 +00:00
else if ( font_norm = = " iso8859-15 " )
font_norm_type = ISO_8859_15 ;
2000-07-04 20:32:37 +00:00
else
font_norm_type = OTHER_ENCODING ;
}
1999-09-27 18:44:28 +00:00
2000-11-17 00:07:41 +00:00
string const LyXRC : : getDescription ( LyXRCTags tag )
2000-10-30 21:53:29 +00:00
{
string str ;
2000-11-04 10:00:12 +00:00
switch ( tag ) {
2000-10-30 21:53:29 +00:00
case RC_FONT_ENCODING :
2000-11-02 14:47:47 +00:00
str = N_ ( " The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTER :
2000-11-02 14:47:47 +00:00
str = N_ ( " The default printer to print on. If none is specified, LyX will use the environment variable PRINTER. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINT_COMMAND :
2000-11-02 14:47:47 +00:00
str = N_ ( " Your favorite print program, e.g. \" dvips \" , \" dvilj4 \" . " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTEVENPAGEFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option to print only even pages. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTODDPAGEFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option to print only odd pages. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTPAGERANGEFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option for specifying a comma-separated list of pages to print. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTCOPIESFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option for specifying the number of copies to print. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTCOLLCOPIESFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option for specifying whether the copies should be collated. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTREVERSEFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option to reverse the order of the pages printed. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTLANDSCAPEFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option to print out in landscape. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTPAPERFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " The option to specify paper type. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_PRINTPAPERDIMENSIONFLAG :
2000-11-29 15:34:56 +00:00
str = N_ ( " Option to specify the dimensions of the print paper. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTTOPRINTER :
str = N_ ( " Option to pass to the print program to print on a specific printer. " ) ;
break ;
case RC_PRINT_ADAPTOUTPUT :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select for LyX to pass the name of the destination printer to your print command. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTTOFILE :
str = N_ ( " Option to pass to the print program to print to a file. " ) ;
break ;
case RC_PRINTFILEEXTENSION :
2000-11-02 14:47:47 +00:00
str = N_ ( " Extension of printer program output file. Usually \" .ps \" . " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTEXSTRAOPTIONS :
2000-11-02 14:47:47 +00:00
str = N_ ( " Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTSPOOL_COMMAND :
2000-11-02 14:47:47 +00:00
str = N_ ( " When set, this printer option automatically prints to a file and then calls a separate print spooling program on that file with the given name and arguments. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_PRINTSPOOL_PRINTERPREFIX :
2000-11-02 14:47:47 +00:00
str = N_ ( " If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SCREEN_DPI :
2000-11-02 14:47:47 +00:00
str = N_ ( " DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SCREEN_ZOOM :
2000-12-06 09:49:54 +00:00
//xgettext:no-c-format
2000-11-02 14:47:47 +00:00
str = N_ ( " The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SCREEN_FONT_SIZES :
str = N_ ( " The font sizes used for calculating the scaling of the screen fonts. " ) ;
break ;
case RC_SCREEN_FONT_ROMAN :
case RC_SCREEN_FONT_SANS :
case RC_SCREEN_FONT_TYPEWRITER :
str = N_ ( " The screen fonts used to display the text while editing. " ) ;
break ;
2002-01-10 15:14:22 +00:00
case RC_POPUP_BOLD_FONT :
str = N_ ( " The bold font in the dialogs. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2002-01-10 15:14:22 +00:00
case RC_POPUP_NORMAL_FONT :
str = N_ ( " The normal font in the dialogs. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SCREEN_FONT_ENCODING :
2000-11-09 15:28:42 +00:00
str = N_ ( " The encoding for the screen fonts. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2002-01-10 15:14:22 +00:00
case RC_POPUP_FONT_ENCODING :
2000-11-09 15:28:42 +00:00
str = N_ ( " The encoding for the menu/popups fonts. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SET_COLOR :
break ;
case RC_AUTOSAVE :
2000-11-02 14:47:47 +00:00
str = N_ ( " The time interval between auto-saves (in seconds). 0 means no auto-save. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_DOCUMENTPATH :
2002-01-10 10:05:45 +00:00
str = N_ ( " The default path for your documents. An empty value selects the directory LyX was started from. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_TEMPLATEPATH :
2002-01-10 10:05:45 +00:00
str = N_ ( " The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_TEMPDIRPATH :
2000-12-06 09:49:54 +00:00
str = N_ ( " LyX will place its temporary directories in this path. They will be deleted when you quit LyX. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_USETEMPDIR :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select if you wish to use a temporary directory structure to store temporary TeX output. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_LASTFILES :
str = N_ ( " The file where the last-files information should be stored. " ) ;
break ;
case RC_AUTOREGIONDELETE :
2000-11-21 21:51:25 +00:00
str = N_ ( " De-select if you don't want the current selection to be replaced automatically by what you type. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-09-21 10:41:09 +00:00
case RC_AUTORESET_OPTIONS :
str = N_ ( " De-select if you don't want the class options to be reset to defaults after class change. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_OVERRIDE_X_DEADKEYS :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select if LyX is to take over the handling of the dead keys (a.k.a. accent keys) that may be defined for your keyboard. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-09-21 10:41:09 +00:00
2000-10-30 21:53:29 +00:00
case RC_SERVERPIPE :
2000-11-02 14:47:47 +00:00
str = N_ ( " This starts the lyxserver. The pipes get an additional extension \" .in \" and \" .out \" . Only for advanced users. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-09-21 10:41:09 +00:00
2000-10-30 21:53:29 +00:00
case RC_BINDFILE :
2000-11-02 14:47:47 +00:00
str = N_ ( " Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-09-21 10:41:09 +00:00
2000-10-30 21:53:29 +00:00
case RC_UIFILE :
2000-11-02 14:47:47 +00:00
str = N_ ( " The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_KBMAP :
case RC_KBMAP_PRIMARY :
case RC_KBMAP_SECONDARY :
2000-11-02 14:47:47 +00:00
str = N_ ( " Use this to set the correct mapping file for your keyboard. You'll need this if you for instance want to type German documents on an American keyboard. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2000-11-02 04:48:34 +00:00
2000-10-30 21:53:29 +00:00
case RC_ASCIIROFF_COMMAND :
2000-11-02 14:47:47 +00:00
str = N_ ( " Use to define an external program to render tables in the ASCII output. E.g. \" groff -t -Tlatin1 $$FName \" where $$FName is the input file. If \" none \" is specified, an internal routine is used. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_ASCII_LINELEN :
2000-11-02 14:47:47 +00:00
str = N_ ( " This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text). " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_NUMLASTFILES :
str = N_ ( " Maximal number of lastfiles. Up to 9 can appear in the file menu. " ) ;
break ;
case RC_CHECKLASTFILES :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select to check whether the lastfiles still exist. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_VIEWDVI_PAPEROPTION :
2001-09-02 11:46:00 +00:00
str = N_ ( " Specify the paper command to DVI viewer (leave empty or use \" -paper \" ) " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_DEFAULT_PAPERSIZE :
str = N_ ( " Specify the default paper size. " ) ;
break ;
case RC_PS_COMMAND :
break ;
case RC_ACCEPT_COMPOUND :
2000-11-21 21:51:25 +00:00
str = N_ ( " Consider run-together words, such as \" diskdrive \" for \" disk drive \" , as legal words? " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SPELL_COMMAND :
str = N_ ( " What command runs the spell checker? " ) ;
break ;
case RC_USE_INP_ENC :
2000-11-02 14:47:47 +00:00
str = N_ ( " Specify whether to pass the -T input encoding option to ispell. Enable this if you can't spellcheck words with international letters in them. This may not work with all dictionaries. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_USE_ALT_LANG :
case RC_ALT_LANG :
2000-11-02 14:47:47 +00:00
str = N_ ( " Specify an alternate language. The default is to use the language of the document. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_USE_PERS_DICT :
case RC_PERS_DICT :
2000-11-02 14:47:47 +00:00
str = N_ ( " Specify an alternate personal dictionary file. E.g. \" .ispell_english \" . " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_USE_ESC_CHARS :
case RC_ESC_CHARS :
str = N_ ( " Specify additional chars that can be part of a word. " ) ;
break ;
case RC_SCREEN_FONT_SCALABLE :
2002-01-17 10:53:14 +00:00
str = N_ ( " Allow bitmap fonts to be resized. If you are using a bitmap font, selecting this option may make some fonts look blocky in LyX. Deselecting this option makes LyX use the nearest bitmap font size available, instead of scaling. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_CHKTEX_COMMAND :
2000-11-02 14:47:47 +00:00
str = N_ ( " Define how to run chktex. E.g. \" chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38 \" Refer to the ChkTeX documentation. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_CURSOR_FOLLOWS_SCROLLBAR :
2000-11-02 14:47:47 +00:00
str = N_ ( " LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen. " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-09-07 10:11:02 +00:00
case RC_DIALOGS_ICONIFY_WITH_MAIN :
str = N_ ( " Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.) " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_EXIT_CONFIRMATION :
2000-11-02 14:47:47 +00:00
str = N_ ( " Sets whether LyX asks for a second confirmation to exit when you have changed documents. (LyX will still ask to save changed documents.) " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-09-18 10:58:35 +00:00
case RC_DISPLAY_GRAPHICS :
str = N_ ( " Select how LyX will display any graphics. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_DISPLAY_SHORTCUTS :
2000-11-02 14:47:47 +00:00
str = N_ ( " LyX continously displays names of last command executed, along with a list of defined short-cuts for it in the minibuffer. Set to false if LyX seems slow. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_MAKE_BACKUP :
2000-11-21 21:51:25 +00:00
str = N_ ( " De-select if you don't want LyX to create backup files. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_BACKUPDIR_PATH :
2000-11-02 14:47:47 +00:00
str = N_ ( " The path for storing backup files. If it is an empty string, LyX will store the backup file in the same directory as the original file. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_RTL_SUPPORT :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select to enable support of right-to-left languages (e.g. Hebrew, Arabic). " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_MARK_FOREIGN_LANGUAGE :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select to control the highlighting of words with a language foreign to that of the document. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_LANGUAGE_PACKAGE :
2000-11-02 14:47:47 +00:00
str = N_ ( " The latex command for loading the language package. E.g. \" \\ usepackage{babel} \" , \" \\ usepackage{omega} \" . " ) ;
2000-10-30 21:53:29 +00:00
break ;
2001-02-25 10:22:54 +00:00
case RC_LANGUAGE_GLOBAL_OPTIONS :
str = N_ ( " De-select if you don't want the language(s) used as an argument to \\ documentclass. " ) ;
break ;
case RC_LANGUAGE_USE_BABEL :
str = N_ ( " De-select if you don't want babel to be used when the language of the document is the default language. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_LANGUAGE_AUTO_BEGIN :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select if a language switching command is needed at the beginning of the document. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_LANGUAGE_AUTO_END :
2000-11-21 21:51:25 +00:00
str = N_ ( " Select if a language switching command is needed at the end of the document. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_LANGUAGE_COMMAND_BEGIN :
2000-11-02 14:47:47 +00:00
str = N_ ( " The latex command for changing from the language of the document to another language. E.g. \\ selectlanguage{$$lang} where $$lang is substituted by the name of the second language. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_LANGUAGE_COMMAND_END :
str = N_ ( " The latex command for changing back to the language of the document. " ) ;
break ;
2001-02-25 10:22:54 +00:00
case RC_LANGUAGE_COMMAND_LOCAL :
str = N_ ( " The latex command for local changing of the language. " ) ;
break ;
2000-10-30 21:53:29 +00:00
case RC_DATE_INSERT_FORMAT :
2000-12-06 09:49:54 +00:00
//xgettext:no-c-format
2000-11-02 14:47:47 +00:00
str = N_ ( " This accepts the normal strftime formats; see man strftime for full details. E.g. \" %A, %e. %B %Y \" . " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_SHOW_BANNER :
2000-11-21 21:51:25 +00:00
str = N_ ( " De-select if you don't want the startup banner. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_WHEEL_JUMP :
2000-11-02 14:47:47 +00:00
str = N_ ( " The wheel movement factor (for mice with wheels or five button mice). " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_CONVERTER :
break ;
case RC_VIEWER :
break ;
case RC_FORMAT :
break ;
case RC_NEW_ASK_FILENAME :
2000-11-02 14:47:47 +00:00
str = N_ ( " This sets the behaviour if you want to be asked for a filename when creating a new document or wait until you save it and be asked then. " ) ;
2000-10-30 21:53:29 +00:00
break ;
case RC_DEFAULT_LANGUAGE :
str = N_ ( " New documents will be assigned this language. " ) ;
break ;
2000-12-11 09:46:09 +00:00
case RC_LABEL_INIT_LENGTH :
str = N_ ( " Maximum number of words in the initialization string for a new label " ) ;
break ;
2000-10-30 21:53:29 +00:00
default :
break ;
}
return str ;
}
2000-03-12 10:35:05 +00:00
// The global instance
LyXRC lyxrc ;
2000-08-14 05:24:35 +00:00
// The global copy of the system lyxrc entries (everything except preferences)
2000-10-10 14:17:33 +00:00
LyXRC system_lyxrc ;