3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/filetools.h"
36 #include "support/gettext.h"
37 #include "support/lstrings.h"
38 #include "support/os.h"
39 #include "support/userinfo.h"
45 using namespace lyx::support;
49 namespace os = support::os;
53 // when adding something to this array keep it sorted!
54 LexerKeyword lyxrcTags[] = {
55 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
56 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
57 { "\\alternate_language", LyXRC::RC_ALT_LANG },
58 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
59 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
60 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
61 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
62 { "\\autosave", LyXRC::RC_AUTOSAVE },
63 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
64 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
65 { "\\bind_file", LyXRC::RC_BINDFILE },
66 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
67 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
68 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
69 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
70 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
71 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
72 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
73 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
74 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
75 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
76 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
77 { "\\converter", LyXRC::RC_CONVERTER },
78 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
79 { "\\copier", LyXRC::RC_COPIER },
80 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
81 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
82 { "\\def_file", LyXRC::RC_DEFFILE },
83 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
84 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
85 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
86 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
87 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
88 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
89 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
90 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
91 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
92 { "\\format", LyXRC::RC_FORMAT },
93 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
94 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
95 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
96 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
97 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
98 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
99 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
100 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
101 { "\\input", LyXRC::RC_INPUT },
102 { "\\kbmap", LyXRC::RC_KBMAP },
103 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
104 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
105 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
106 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
107 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
108 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
109 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
110 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
111 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
112 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
113 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
114 { "\\load_session", LyXRC::RC_LOADSESSION },
115 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
116 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
117 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
118 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
119 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
120 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
121 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
122 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
123 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
124 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
125 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
126 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
127 { "\\preview", LyXRC::RC_PREVIEW },
128 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
129 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
130 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
131 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
132 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
133 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
134 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
135 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
136 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
137 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
138 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
139 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
140 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
141 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
142 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
143 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
144 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
145 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
146 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
147 { "\\printer", LyXRC::RC_PRINTER },
148 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
149 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
150 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
151 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
152 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
153 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
154 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
155 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
156 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
157 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
158 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
159 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
160 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
161 { "\\set_color", LyXRC::RC_SET_COLOR },
162 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
163 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
164 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
165 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
166 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
167 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
168 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
169 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
170 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
171 { "\\ui_file", LyXRC::RC_UIFILE },
172 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
173 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
174 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
175 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
176 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
177 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
178 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
179 // compatibility with versions older than 1.4.0 only
180 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
181 // compatibility with versions older than 1.4.0 only
182 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
183 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
184 { "\\user_email", LyXRC::RC_USER_EMAIL },
185 { "\\user_name", LyXRC::RC_USER_NAME },
186 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
187 // compatibility with versions older than 1.4.0 only
188 { "\\viewer", LyXRC::RC_VIEWER},
189 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
192 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
203 void LyXRC::setDefaults()
206 def_file = "default";
208 // Get printer from the environment. If fail, use default "",
209 // assuming that everything is set up correctly.
210 printer = getEnv("PRINTER");
211 print_adapt_output = false;
212 print_command = "dvips";
213 print_evenpage_flag = "-B";
214 print_oddpage_flag = "-A";
215 print_pagerange_flag = "-pp";
216 print_copies_flag = "-c";
217 print_collcopies_flag = "-C";
218 print_reverse_flag = "-r";
219 print_landscape_flag = "-t landscape";
220 print_to_printer = "-P";
221 print_to_file = "-o ";
222 print_file_extension = ".ps";
223 print_paper_flag = "-t";
224 print_paper_dimension_flag = "-T";
225 document_path.erase();
226 view_dvi_paper_option.erase();
227 default_papersize = PAPER_DEFAULT;
228 default_view_format = "pdf2";
229 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
230 bibtex_command = "bibtex";
232 index_command = "makeindex -c -q";
233 nomencl_command = "makeindex -s nomencl.ist";
235 // Because a screen typically is wider than a piece of paper:
237 allow_geometry_session = true;
238 // Default LaTeX font size:
239 font_sizes[FONT_SIZE_TINY] = "5.0";
240 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
241 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
242 font_sizes[FONT_SIZE_SMALL] = "9.0";
243 font_sizes[FONT_SIZE_NORMAL] = "10.0";
244 font_sizes[FONT_SIZE_LARGE] = "12.0";
245 font_sizes[FONT_SIZE_LARGER] = "14.4";
246 font_sizes[FONT_SIZE_LARGEST] = "17.26";
247 font_sizes[FONT_SIZE_HUGE] = "20.74";
248 font_sizes[FONT_SIZE_HUGER] = "24.88";
249 use_scalable_fonts = true;
250 roman_font_name = "";
252 typewriter_font_name = "";
254 auto_region_delete = true;
255 auto_reset_options = false;
256 plaintext_linelen = 65;
257 mouse_wheel_speed = 1.0;
258 num_lastfiles = maxlastfiles;
259 check_lastfiles = true;
260 use_lastfilepos = true;
261 load_session = false;
263 backupdir_path.erase();
264 display_graphics = true;
265 // Spellchecker settings:
266 spellchecker_accept_compound = false;
267 spellchecker_use_input_encoding = false;
268 spellchecker_use_alt_lang = false;
269 spellchecker_use_pers_dict = false;
270 spellchecker_use_esc_chars = false;
271 spellcheck_continuously = false;
274 visual_cursor = false;
276 mark_foreign_language = true;
277 language_auto_begin = true;
278 language_auto_end = true;
279 language_global_options = true;
280 language_use_babel = true;
281 language_package = "\\usepackage{babel}";
282 language_command_begin = "\\selectlanguage{$$lang}";
283 language_command_local = "\\foreignlanguage{$$lang}{";
284 sort_layouts = false;
285 group_layouts = true;
286 default_language = "english";
287 gui_language = "auto";
289 windows_style_tex_paths = false;
290 tex_allows_spaces = false;
291 date_insert_format = "%x";
292 cursor_follows_scrollbar = false;
293 scroll_below_document = false;
294 mac_like_word_movement = false;
295 macro_edit_style = MACRO_EDIT_INLINE_BOX;
296 dialogs_iconify_with_main = false;
297 label_init_length = 3;
298 preview = PREVIEW_OFF;
299 preview_hashed_labels = false;
300 preview_scale_factor = "0.9";
301 use_converter_cache = true;
303 use_pixmap_cache = false;
304 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
305 user_name = to_utf8(support::user_name());
306 user_email = to_utf8(support::user_email());
307 open_buffers_in_tabs = true;
309 // Fullscreen settings
310 full_screen_limit = false;
311 full_screen_toolbars = true;
312 full_screen_tabbar = true;
313 full_screen_scrollbar = true;
314 full_screen_width = 700;
316 completion_cursor_text = true;
317 completion_popup_math = true;
318 completion_popup_text = false;
319 completion_popup_delay = 2.0;
320 completion_popup_after_complete = true;
321 autocorrection_math = false;
322 completion_inline_math = true;
323 completion_inline_text = false;
324 completion_inline_dots = -1;
325 completion_inline_delay = 0.2;
331 void oldFontFormat(string & family, string & foundry)
333 if (family.empty() || family[0] != '-')
335 foundry = token(family, '-', 1);
336 family = token(family, '-', 2);
344 int LyXRC::read(FileName const & filename)
346 Lexer lexrc(lyxrcTags);
347 if (lyxerr.debugging(Debug::PARSER))
348 lexrc.printTable(lyxerr);
350 lexrc.setFile(filename);
354 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
360 int LyXRC::read(istream & is)
362 Lexer lexrc(lyxrcTags);
363 if (lyxerr.debugging(Debug::PARSER))
364 lexrc.printTable(lyxerr);
370 LYXERR(Debug::LYXRC, "Reading istream...");
376 int LyXRC::read(Lexer & lexrc)
381 while (lexrc.isOK()) {
382 // By using two switches we take advantage of the compiler
383 // telling us if we have missed a LyXRCTags element in
384 // the second switch.
385 // Note that this also shows a problem with Lexer since it
386 // helps us avoid taking advantage of the strictness of the
389 int le = lexrc.lex();
391 case Lexer::LEX_UNDEF:
392 lexrc.printError("Unknown tag `$$Token'");
394 case Lexer::LEX_FEOF:
399 switch (static_cast<LyXRCTags>(le)) {
400 case RC_INPUT: // Include file
403 libFileSearch(string(),
406 lexrc.printError("Error reading "
407 "included file: " + tmp.absFilename());
413 bind_file = os::internal_path(lexrc.getString());
418 def_file = os::internal_path(lexrc.getString());
423 ui_file = os::internal_path(lexrc.getString());
426 case RC_AUTORESET_OPTIONS:
427 lexrc >> auto_reset_options;
430 case RC_DISPLAY_GRAPHICS:
432 display_graphics = lexrc.getString() == "true";
435 case RC_TEX_EXPECTS_WINDOWS_PATHS:
436 lexrc >> windows_style_tex_paths;
439 case RC_TEX_ALLOWS_SPACES:
440 lexrc >> tex_allows_spaces;
447 case RC_KBMAP_PRIMARY:
449 string const kmap(os::internal_path(lexrc.getString()));
452 } else if (!libFileSearch("kbd", kmap,
454 primary_kbmap = kmap;
456 lexrc.printError("LyX: Keymap `$$Token' not found");
461 case RC_KBMAP_SECONDARY:
463 string const kmap(os::internal_path(lexrc.getString()));
466 } else if (!libFileSearch("kbd", kmap,
468 secondary_kbmap = kmap;
470 lexrc.printError("LyX: Keymap `$$Token' not found");
475 case RC_FONT_ENCODING:
483 case RC_PRINT_COMMAND:
484 if (lexrc.next(true)) {
485 print_command = lexrc.getString();
489 case RC_PRINTEVENPAGEFLAG:
490 lexrc >> print_evenpage_flag;
493 case RC_PRINTODDPAGEFLAG:
494 lexrc >> print_oddpage_flag;
497 case RC_PRINTPAGERANGEFLAG:
498 lexrc >> print_pagerange_flag;
501 case RC_PRINTCOPIESFLAG:
502 lexrc >> print_copies_flag;
505 case RC_PRINTCOLLCOPIESFLAG:
506 lexrc >> print_collcopies_flag;
509 case RC_PRINTREVERSEFLAG:
510 lexrc >> print_reverse_flag;
513 case RC_PRINTLANDSCAPEFLAG:
514 lexrc >> print_landscape_flag;
517 case RC_PRINTTOPRINTER:
518 lexrc >> print_to_printer;
521 case RC_PRINT_ADAPTOUTPUT:
522 lexrc >> print_adapt_output;
527 print_to_file = os::internal_path(lexrc.getString());
531 case RC_PRINTFILEEXTENSION:
532 lexrc >> print_file_extension;
535 case RC_PRINTEXSTRAOPTIONS:
536 lexrc >> print_extra_options;
539 case RC_PRINTSPOOL_COMMAND:
540 if (lexrc.next(true)) {
541 print_spool_command = lexrc.getString();
545 case RC_PRINTSPOOL_PRINTERPREFIX:
546 lexrc >> print_spool_printerprefix;
549 case RC_PRINTPAPERDIMENSIONFLAG:
550 lexrc >> print_paper_dimension_flag;
553 case RC_PRINTPAPERFLAG:
554 lexrc >> print_paper_flag;
557 case RC_DEFAULT_PAPERSIZE:
559 string const size = ascii_lowercase(lexrc.getString());
560 if (size == "usletter")
561 default_papersize = PAPER_USLETTER;
562 else if (size == "legal")
563 default_papersize = PAPER_USLEGAL;
564 else if (size == "executive")
565 default_papersize = PAPER_USEXECUTIVE;
566 else if (size == "a3")
567 default_papersize = PAPER_A3;
568 else if (size == "a4")
569 default_papersize = PAPER_A4;
570 else if (size == "a5")
571 default_papersize = PAPER_A5;
572 else if (size == "b5")
573 default_papersize = PAPER_B5;
574 else if (size == "default")
575 default_papersize = PAPER_DEFAULT;
579 case RC_VIEWDVI_PAPEROPTION:
581 view_dvi_paper_option = lexrc.getString();
583 view_dvi_paper_option.erase();
586 case RC_CHKTEX_COMMAND:
587 if (lexrc.next(true)) {
588 chktex_command = lexrc.getString();
592 case RC_BIBTEX_COMMAND:
593 if (lexrc.next(true)) {
594 bibtex_command = lexrc.getString();
598 case RC_INDEX_COMMAND:
599 if (lexrc.next(true)) {
600 index_command = lexrc.getString();
604 case RC_NOMENCL_COMMAND:
605 if (lexrc.next(true)) {
606 nomencl_command = lexrc.getString();
618 case RC_GEOMETRY_SESSION:
619 lexrc >> allow_geometry_session;
622 case RC_SCREEN_FONT_SIZES:
623 lexrc >> font_sizes[FONT_SIZE_TINY];
624 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
625 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
626 lexrc >> font_sizes[FONT_SIZE_SMALL];
627 lexrc >> font_sizes[FONT_SIZE_NORMAL];
628 lexrc >> font_sizes[FONT_SIZE_LARGE];
629 lexrc >> font_sizes[FONT_SIZE_LARGER];
630 lexrc >> font_sizes[FONT_SIZE_LARGEST];
631 lexrc >> font_sizes[FONT_SIZE_HUGE];
632 lexrc >> font_sizes[FONT_SIZE_HUGER];
635 case RC_SCREEN_FONT_SCALABLE:
636 lexrc >> use_scalable_fonts;
643 case RC_DOCUMENTPATH:
645 document_path = os::internal_path(lexrc.getString());
646 document_path = expandPath(document_path);
652 example_path = os::internal_path(lexrc.getString());
653 example_path = expandPath(example_path);
657 case RC_TEMPLATEPATH:
659 template_path = os::internal_path(lexrc.getString());
660 template_path = expandPath(template_path);
666 tempdir_path = os::internal_path(lexrc.getString());
667 tempdir_path = expandPath(tempdir_path);
671 case RC_THESAURUSDIRPATH:
673 thesaurusdir_path = os::internal_path(lexrc.getString());
674 thesaurusdir_path = expandPath(thesaurusdir_path);
680 LYXERR0("Ignoring obsolete use_tempdir flag.");
683 case RC_USELASTFILEPOS:
684 lexrc >> use_lastfilepos;
688 lexrc >> load_session;
691 case RC_MOUSE_WHEEL_SPEED:
692 lexrc >> mouse_wheel_speed;
695 case RC_COMPLETION_INLINE_DELAY:
696 lexrc >> completion_inline_delay;
699 case RC_COMPLETION_INLINE_MATH:
700 lexrc >> completion_inline_math;
703 case RC_COMPLETION_INLINE_TEXT:
704 lexrc >> completion_inline_text;
707 case RC_COMPLETION_INLINE_DOTS:
708 lexrc >> completion_inline_dots;
711 case RC_AUTOCORRECTION_MATH:
712 lexrc >> autocorrection_math;
715 case RC_COMPLETION_POPUP_DELAY:
716 lexrc >> completion_popup_delay;
719 case RC_COMPLETION_POPUP_MATH:
720 lexrc >> completion_popup_math;
723 case RC_COMPLETION_POPUP_TEXT:
724 lexrc >> completion_popup_text;
727 case RC_COMPLETION_CURSOR_TEXT:
728 lexrc >> completion_cursor_text;
731 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
732 lexrc >> completion_popup_after_complete;
735 case RC_NUMLASTFILES:
736 lexrc >> num_lastfiles;
739 case RC_CHECKLASTFILES:
740 lexrc >> check_lastfiles;
743 case RC_SCREEN_FONT_ROMAN:
745 roman_font_name = lexrc.getString();
746 oldFontFormat(roman_font_name,
751 case RC_SCREEN_FONT_SANS:
753 sans_font_name = lexrc.getString();
754 oldFontFormat(sans_font_name, sans_font_foundry);
758 case RC_SCREEN_FONT_TYPEWRITER:
760 typewriter_font_name = lexrc.getString();
761 oldFontFormat(typewriter_font_name,
762 typewriter_font_foundry);
766 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
767 lexrc >> roman_font_foundry;
770 case RC_SCREEN_FONT_SANS_FOUNDRY:
771 lexrc >> sans_font_foundry;
774 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
775 lexrc >> typewriter_font_foundry;
780 lexrc.printError("Missing color tag.");
783 string lyx_name = lexrc.getString();
786 lexrc.printError("Missing color name for color: `$$Token'");
789 string x11_name = lexrc.getString();
791 ColorCode const col =
792 lcolor.getFromLyXName(lyx_name);
793 if (col == Color_none ||
794 col == Color_inherit ||
798 if (!lcolor.setColor(col, x11_name))
799 LYXERR0("Bad lyxrc set_color for " << lyx_name);
803 case RC_AUTOREGIONDELETE:
804 // Auto region delete defaults to true
805 lexrc >> auto_region_delete;
810 lyxpipes = os::internal_path(lexrc.getString());
811 lyxpipes = expandPath(lyxpipes);
815 case RC_CURSOR_FOLLOWS_SCROLLBAR:
816 lexrc >> cursor_follows_scrollbar;
819 case RC_SCROLL_BELOW_DOCUMENT:
820 lexrc >> scroll_below_document;
823 case RC_MAC_LIKE_WORD_MOVEMENT:
824 lexrc >> mac_like_word_movement;
827 case RC_MACRO_EDIT_STYLE:
829 switch (lexrc.getInteger()) {
830 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
831 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
832 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
837 case RC_DIALOGS_ICONIFY_WITH_MAIN:
838 lexrc >> dialogs_iconify_with_main;
841 case RC_PLAINTEXT_ROFF_COMMAND:
842 (void) lexrc.getString(); // Obsoleted in 2.0
844 case RC_PLAINTEXT_LINELEN:
845 lexrc >> plaintext_linelen;
847 // Spellchecker settings:
848 case RC_ACCEPT_COMPOUND:
849 lexrc >> spellchecker_accept_compound;
852 lexrc >> spellchecker_use_input_encoding;
854 case RC_USE_ALT_LANG:
855 lexrc >> spellchecker_use_alt_lang;
857 case RC_USE_PERS_DICT:
858 lexrc >> spellchecker_use_pers_dict;
861 lexrc >> use_tooltip;
863 case RC_USE_PIXMAP_CACHE:
864 lexrc >> use_pixmap_cache;
866 case RC_USE_ESC_CHARS:
867 lexrc >> spellchecker_use_esc_chars;
870 lexrc >> spellchecker_alt_lang;
874 spellchecker_pers_dict = os::internal_path(lexrc.getString());
877 lexrc >> spellchecker_esc_chars;
879 case RC_SPELLCHECK_CONTINUOUSLY:
880 lexrc >> spellcheck_continuously;
883 lexrc >> make_backup;
885 case RC_BACKUPDIR_PATH:
887 backupdir_path = os::internal_path(lexrc.getString());
888 backupdir_path = expandPath(backupdir_path);
891 case RC_DATE_INSERT_FORMAT:
892 lexrc >> date_insert_format;
894 case RC_LANGUAGE_PACKAGE:
895 lexrc >> language_package;
897 case RC_LANGUAGE_AUTO_BEGIN:
898 lexrc >> language_auto_begin;
900 case RC_LANGUAGE_AUTO_END:
901 lexrc >> language_auto_end;
903 case RC_LANGUAGE_GLOBAL_OPTIONS:
904 lexrc >> language_global_options;
906 case RC_LANGUAGE_USE_BABEL:
907 lexrc >> language_use_babel;
909 case RC_LANGUAGE_COMMAND_BEGIN:
910 lexrc >> language_command_begin;
912 case RC_LANGUAGE_COMMAND_END:
913 lexrc >> language_command_end;
915 case RC_LANGUAGE_COMMAND_LOCAL:
916 lexrc >> language_command_local;
919 lexrc >> rtl_support;
921 case RC_VISUAL_CURSOR:
922 lexrc >> visual_cursor;
925 lexrc >> auto_number;
927 case RC_MARK_FOREIGN_LANGUAGE:
928 lexrc >> mark_foreign_language;
934 fmt = lexrc.getString();
935 if (lexrc.next(true))
936 command = lexrc.getString();
937 setMover(fmt, command);
942 string from, to, command, flags;
944 from = lexrc.getString();
946 to = lexrc.getString();
947 if (lexrc.next(true))
948 command = lexrc.getString();
950 flags = lexrc.getString();
952 theConverters().erase(from, to);
954 theConverters().add(from, to, command, flags);
957 // compatibility with versions older than 1.4.0 only
959 string format, command;
960 lexrc >> format >> command;
961 formats.setViewer(format, command);
965 string format, extension, prettyname, shortcut;
966 lexrc >> format >> extension >> prettyname >> shortcut;
967 string viewer, editor;
968 if (lexrc.next(true))
969 viewer = lexrc.getString();
970 if (lexrc.next(true))
971 editor = lexrc.getString();
973 // Hack to ensure compatibility with versions older
975 int le = lexrc.lex();
976 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
977 flags = lexrc.getString();
978 if (le != Lexer::LEX_DATA) {
979 // We have got a known token.
980 // Therefore this is an old style
981 // format definition without
983 lexrc.pushToken(flags);
987 int flgs = Format::none;
988 while (!flags.empty()) {
990 flags = split(flags, flag, ',');
991 if (flag == "document")
992 flgs |= Format::document;
993 else if (flag == "vector")
994 flgs |= Format::vector;
996 LYXERR0("Ignoring unknown flag `"
997 << flag << "' for format `"
1000 if (prettyname.empty()) {
1001 if (theConverters().formatIsUsed(format))
1002 LYXERR0("Can't delete format " << format);
1004 formats.erase(format);
1006 formats.add(format, extension, prettyname,
1007 shortcut, viewer, editor, flgs);
1011 case RC_DEFAULT_VIEW_FORMAT:
1012 lexrc >> default_view_format;
1015 case RC_DEFAULT_LANGUAGE:
1016 lexrc >> default_language;
1019 case RC_GUI_LANGUAGE:
1020 lexrc >> gui_language;
1023 case RC_LABEL_INIT_LENGTH:
1024 lexrc >> label_init_length;
1027 case RC_SHOW_BANNER:
1028 lexrc >> show_banner;
1033 string const tmp = lexrc.getString();
1034 if (tmp == "true" || tmp == "on")
1035 preview = PREVIEW_ON;
1036 else if (tmp == "no_math")
1037 preview = PREVIEW_NO_MATH;
1039 preview = PREVIEW_OFF;
1040 if (tmp != "false" && tmp != "off")
1041 LYXERR0("Unrecognized preview status \""
1047 case RC_PREVIEW_HASHED_LABELS:
1048 lexrc >> preview_hashed_labels;
1051 case RC_PREVIEW_SCALE_FACTOR:
1052 lexrc >> preview_scale_factor;
1059 lexrc >> user_email;
1062 case RC_PATH_PREFIX:
1063 lexrc >> path_prefix;
1066 case RC_USE_CONVERTER_CACHE:
1067 lexrc >> use_converter_cache;
1069 case RC_CONVERTER_CACHE_MAXAGE:
1070 lexrc >> converter_cache_maxage;
1073 case RC_SORT_LAYOUTS:
1074 lexrc >> sort_layouts;
1076 case RC_GROUP_LAYOUTS:
1077 lexrc >> group_layouts;
1079 case RC_FULL_SCREEN_LIMIT:
1080 lexrc >> full_screen_limit;
1082 case RC_FULL_SCREEN_TOOLBARS:
1083 lexrc >> full_screen_toolbars;
1085 case RC_FULL_SCREEN_SCROLLBAR:
1086 lexrc >> full_screen_scrollbar;
1088 case RC_FULL_SCREEN_TABBAR:
1089 lexrc >> full_screen_tabbar;
1091 case RC_FULL_SCREEN_WIDTH:
1092 lexrc >> full_screen_width;
1094 case RC_OPEN_BUFFERS_IN_TABS:
1095 lexrc >> open_buffers_in_tabs;
1099 case RC_SPELL_COMMAND:
1100 case RC_USE_SPELL_LIB:
1101 (void) lexrc.getString();
1105 break; // this is just a dummy
1109 /// Update converters data-structures
1110 theConverters().update(formats);
1111 theConverters().buildGraph();
1117 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1119 ofstream ofs(filename.toFilesystemEncoding().c_str());
1121 write(ofs, ignore_system_lyxrc);
1125 void LyXRC::print() const
1127 if (lyxerr.debugging())
1128 write(lyxerr, false);
1136 typedef pair<string, SpecialisedMover> Data;
1138 SameMover(Data const & comparison)
1139 : comparison_(comparison) {}
1141 bool operator()(Data const & data) const
1143 return data.first == comparison_.first &&
1144 data.second.command() == comparison_.second.command();
1154 // Escape \ and " so that LyXLex can read the string later
1155 string escapeCommand(string const & str) {
1156 return subst(subst(str , "\\", "\\\\"),
1163 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1165 LyXRCTags tag = RC_LAST;
1167 if (!name.empty()) {
1168 for (int i = 0; i != lyxrcCount; ++i)
1169 if ("\\" + name == lyxrcTags[i].tag)
1170 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1174 os << "# LyX " << lyx_version
1175 << " generated this file. If you want to make your own\n"
1176 << "# modifications you should do them from inside LyX and save.\n"
1179 // Why the switch you might ask. It is a trick to ensure that all
1180 // the elements in the LyXRCTags enum are handled. As you can see
1181 // there are no breaks at all. So it is just a huge fall-through.
1182 // The nice thing is that we will get a warning from the compiler
1183 // if we forget an element.
1187 // input/include files are not done here
1189 if (ignore_system_lyxrc ||
1190 bind_file != system_lyxrc.bind_file) {
1191 string const path = os::external_path(bind_file);
1192 os << "\\bind_file \"" << path << "\"\n";
1198 if (ignore_system_lyxrc ||
1199 def_file != system_lyxrc.def_file) {
1200 string const path = os::external_path(def_file);
1201 os << "\\def_file \"" << path << "\"\n";
1210 << "# MISC SECTION ######################################\n"
1212 // bind files are not done here.
1214 case RC_PATH_PREFIX:
1215 if (ignore_system_lyxrc ||
1216 path_prefix != system_lyxrc.path_prefix) {
1217 os << "\\path_prefix \"" << path_prefix << "\"\n";
1222 if (ignore_system_lyxrc ||
1223 ui_file != system_lyxrc.ui_file) {
1224 string const path = os::external_path(ui_file);
1225 os << "\\ui_file \"" << path << "\"\n";
1229 case RC_AUTOREGIONDELETE:
1230 if (ignore_system_lyxrc ||
1231 auto_region_delete != system_lyxrc.auto_region_delete) {
1232 os << "# Set to false to inhibit automatic replacement of\n"
1233 << "# the current selection.\n"
1234 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1239 case RC_AUTORESET_OPTIONS:
1240 if (ignore_system_lyxrc ||
1241 auto_reset_options != system_lyxrc.auto_reset_options) {
1242 os << "# Set to false to inhibit automatic reset of\n"
1243 << "# the class options to defaults on class change.\n"
1244 << "\\auto_reset_options "
1245 << convert<string>(auto_reset_options)
1251 if (ignore_system_lyxrc ||
1252 autosave != system_lyxrc.autosave) {
1253 os << "# The time interval between auto-saves in seconds.\n"
1254 << "\\autosave " << autosave << '\n';
1258 case RC_DISPLAY_GRAPHICS:
1259 if (ignore_system_lyxrc ||
1260 display_graphics != system_lyxrc.display_graphics) {
1261 os << "# Display graphics within LyX\n"
1263 << "\\display_graphics "
1264 << (display_graphics ? "true" : "false")
1269 case RC_SORT_LAYOUTS:
1270 if (ignore_system_lyxrc ||
1271 sort_layouts != system_lyxrc.sort_layouts) {
1272 os << "# Sort layouts alphabetically.\n"
1273 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1277 case RC_GROUP_LAYOUTS:
1278 if (ignore_system_lyxrc ||
1279 group_layouts != system_lyxrc.group_layouts) {
1280 os << "# Group layouts by their category.\n"
1281 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1285 case RC_VIEWDVI_PAPEROPTION:
1286 if (ignore_system_lyxrc ||
1287 view_dvi_paper_option
1288 != system_lyxrc.view_dvi_paper_option) {
1289 os << "# Options used to specify paper size to the\n"
1290 << "# view_dvi_command (e.g. -paper)\n"
1291 << "\\view_dvi_paper_option \""
1292 << view_dvi_paper_option << "\"\n";
1296 case RC_DEFAULT_PAPERSIZE:
1297 if (ignore_system_lyxrc ||
1298 default_papersize != system_lyxrc.default_papersize) {
1299 os << "# The default papersize to use.\n"
1300 << "\\default_papersize \"";
1301 switch (default_papersize) {
1303 os << "default"; break;
1304 case PAPER_USLETTER:
1305 os << "usletter"; break;
1307 os << "legal"; break;
1308 case PAPER_USEXECUTIVE:
1309 os << "executive"; break;
1320 case PAPER_B4: break;
1326 case RC_CHKTEX_COMMAND:
1327 if (ignore_system_lyxrc ||
1328 chktex_command != system_lyxrc.chktex_command) {
1329 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1333 case RC_BIBTEX_COMMAND:
1334 if (ignore_system_lyxrc ||
1335 bibtex_command != system_lyxrc.bibtex_command) {
1336 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1340 case RC_INDEX_COMMAND:
1341 if (ignore_system_lyxrc ||
1342 index_command != system_lyxrc.index_command) {
1343 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1347 case RC_NOMENCL_COMMAND:
1348 if (ignore_system_lyxrc ||
1349 nomencl_command != system_lyxrc.nomencl_command) {
1350 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1354 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1355 if (ignore_system_lyxrc ||
1356 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1357 os << "\\tex_expects_windows_paths "
1358 << convert<string>(windows_style_tex_paths) << '\n';
1362 case RC_TEX_ALLOWS_SPACES:
1363 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1364 os << "\\tex_allows_spaces "
1365 << convert<string>(tex_allows_spaces) << '\n';
1370 if (ignore_system_lyxrc ||
1371 use_kbmap != system_lyxrc.use_kbmap) {
1372 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1376 case RC_KBMAP_PRIMARY:
1377 if (ignore_system_lyxrc ||
1378 primary_kbmap != system_lyxrc.primary_kbmap) {
1379 string const path = os::external_path(primary_kbmap);
1380 os << "\\kbmap_primary \"" << path << "\"\n";
1384 case RC_KBMAP_SECONDARY:
1385 if (ignore_system_lyxrc ||
1386 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1387 string const path = os::external_path(secondary_kbmap);
1388 os << "\\kbmap_secondary \"" << path << "\"\n";
1393 if (ignore_system_lyxrc ||
1394 lyxpipes != system_lyxrc.lyxpipes) {
1395 string const path = os::external_path(lyxpipes);
1396 os << "\\serverpipe \"" << path << "\"\n";
1400 case RC_DATE_INSERT_FORMAT:
1401 if (ignore_system_lyxrc ||
1402 date_insert_format != system_lyxrc.date_insert_format) {
1403 os << "\\date_insert_format \"" << date_insert_format
1408 case RC_LABEL_INIT_LENGTH:
1409 if (ignore_system_lyxrc ||
1410 label_init_length != system_lyxrc.label_init_length) {
1411 os << "\\label_init_length " << label_init_length
1418 os << "\\user_name \"" << user_name << "\"\n";
1423 os << "\\user_email \"" << user_email << "\"\n";
1427 case RC_SHOW_BANNER:
1428 if (ignore_system_lyxrc ||
1429 show_banner != system_lyxrc.show_banner) {
1430 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1436 if (ignore_system_lyxrc ||
1437 preview != system_lyxrc.preview) {
1443 case PREVIEW_NO_MATH:
1450 os << "\\preview " << status << '\n';
1455 case RC_PREVIEW_HASHED_LABELS:
1456 if (ignore_system_lyxrc ||
1457 preview_hashed_labels !=
1458 system_lyxrc.preview_hashed_labels) {
1459 os << "\\preview_hashed_labels "
1460 << convert<string>(preview_hashed_labels) << '\n';
1465 case RC_PREVIEW_SCALE_FACTOR:
1466 if (ignore_system_lyxrc ||
1467 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1468 os << "\\preview_scale_factor "
1469 << preview_scale_factor << '\n';
1474 case RC_USE_CONVERTER_CACHE:
1475 if (ignore_system_lyxrc ||
1476 use_converter_cache != system_lyxrc.use_converter_cache) {
1477 os << "\\use_converter_cache "
1478 << convert<string>(use_converter_cache) << '\n';
1483 case RC_CONVERTER_CACHE_MAXAGE:
1484 if (ignore_system_lyxrc ||
1485 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1486 os << "\\converter_cache_maxage "
1487 << converter_cache_maxage << '\n';
1493 << "# SCREEN & FONTS SECTION ############################\n"
1497 if (ignore_system_lyxrc ||
1498 dpi != system_lyxrc.dpi) {
1499 os << "\\screen_dpi " << dpi << '\n';
1503 case RC_SCREEN_ZOOM:
1504 if (ignore_system_lyxrc ||
1505 zoom != system_lyxrc.zoom) {
1506 os << "\\screen_zoom " << zoom << '\n';
1510 case RC_GEOMETRY_SESSION:
1511 if (ignore_system_lyxrc ||
1512 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1513 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1518 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1519 if (ignore_system_lyxrc ||
1520 cursor_follows_scrollbar
1521 != system_lyxrc.cursor_follows_scrollbar) {
1522 os << "\\cursor_follows_scrollbar "
1523 << convert<string>(cursor_follows_scrollbar) << '\n';
1527 case RC_SCROLL_BELOW_DOCUMENT:
1528 if (ignore_system_lyxrc ||
1529 scroll_below_document
1530 != system_lyxrc.scroll_below_document) {
1531 os << "\\scroll_below_document "
1532 << convert<string>(scroll_below_document) << '\n';
1536 case RC_MAC_LIKE_WORD_MOVEMENT:
1537 if (ignore_system_lyxrc ||
1538 mac_like_word_movement
1539 != system_lyxrc.mac_like_word_movement) {
1540 os << "\\mac_like_word_movement "
1541 << convert<string>(mac_like_word_movement) << '\n';
1545 case RC_MACRO_EDIT_STYLE:
1546 if (ignore_system_lyxrc ||
1548 != system_lyxrc.macro_edit_style) {
1549 os << "\\macro_edit_style ";
1550 switch (macro_edit_style) {
1551 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1552 case MACRO_EDIT_INLINE: os << "1\n"; break;
1553 case MACRO_EDIT_LIST: os << "2\n"; break;
1558 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1559 if (ignore_system_lyxrc ||
1560 dialogs_iconify_with_main
1561 != system_lyxrc.dialogs_iconify_with_main) {
1562 os << "\\dialogs_iconify_with_main "
1563 << convert<string>(dialogs_iconify_with_main) << '\n';
1567 case RC_SCREEN_FONT_ROMAN:
1568 if (ignore_system_lyxrc ||
1569 roman_font_name != system_lyxrc.roman_font_name) {
1570 os << "\\screen_font_roman \"" << roman_font_name
1575 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1576 if (ignore_system_lyxrc ||
1577 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1578 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1583 case RC_SCREEN_FONT_SANS:
1584 if (ignore_system_lyxrc ||
1585 sans_font_name != system_lyxrc.sans_font_name) {
1586 os << "\\screen_font_sans \"" << sans_font_name
1591 case RC_SCREEN_FONT_SANS_FOUNDRY:
1592 if (ignore_system_lyxrc ||
1593 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1594 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1599 case RC_SCREEN_FONT_TYPEWRITER:
1600 if (ignore_system_lyxrc ||
1601 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1602 os << "\\screen_font_typewriter \""
1603 << typewriter_font_name << "\"\n";
1607 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1608 if (ignore_system_lyxrc ||
1609 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1610 os << "\\screen_font_typewriter_foundry \""
1611 << typewriter_font_foundry << "\"\n";
1616 case RC_SCREEN_FONT_SCALABLE:
1617 if (ignore_system_lyxrc ||
1618 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1619 os << "\\screen_font_scalable "
1620 << convert<string>(use_scalable_fonts)
1625 case RC_SCREEN_FONT_SIZES:
1626 if (ignore_system_lyxrc ||
1627 font_sizes[FONT_SIZE_TINY]
1628 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1629 font_sizes[FONT_SIZE_SCRIPT]
1630 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1631 font_sizes[FONT_SIZE_FOOTNOTE]
1632 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1633 font_sizes[FONT_SIZE_SMALL]
1634 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1635 font_sizes[FONT_SIZE_NORMAL]
1636 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1637 font_sizes[FONT_SIZE_LARGE]
1638 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1639 font_sizes[FONT_SIZE_LARGER]
1640 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1641 font_sizes[FONT_SIZE_LARGEST]
1642 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1643 font_sizes[FONT_SIZE_HUGE]
1644 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1645 font_sizes[FONT_SIZE_HUGER]
1646 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1647 os.setf(ios::fixed);
1649 os << "\\screen_font_sizes"
1650 << ' ' << font_sizes[FONT_SIZE_TINY]
1651 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1652 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1653 << ' ' << font_sizes[FONT_SIZE_SMALL]
1654 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1655 << ' ' << font_sizes[FONT_SIZE_LARGE]
1656 << ' ' << font_sizes[FONT_SIZE_LARGER]
1657 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1658 << ' ' << font_sizes[FONT_SIZE_HUGE]
1659 << ' ' << font_sizes[FONT_SIZE_HUGER]
1664 case RC_FULL_SCREEN_LIMIT:
1665 if (ignore_system_lyxrc ||
1666 full_screen_limit != system_lyxrc.full_screen_limit) {
1667 os << "\\fullscreen_limit "
1668 << convert<string>(full_screen_limit)
1673 case RC_FULL_SCREEN_TOOLBARS:
1674 if (ignore_system_lyxrc ||
1675 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1676 os << "\\fullscreen_toolbars "
1677 << convert<string>(full_screen_toolbars)
1682 case RC_FULL_SCREEN_SCROLLBAR:
1683 if (ignore_system_lyxrc ||
1684 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1685 os << "\\fullscreen_scrollbar "
1686 << convert<string>(full_screen_scrollbar)
1691 case RC_FULL_SCREEN_TABBAR:
1692 if (ignore_system_lyxrc ||
1693 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1694 os << "\\fullscreen_tabbar "
1695 << convert<string>(full_screen_tabbar)
1700 case RC_FULL_SCREEN_WIDTH:
1701 if (ignore_system_lyxrc ||
1702 full_screen_width != system_lyxrc.full_screen_width) {
1703 os << "\\fullscreen_width "
1704 << convert<string>(full_screen_width)
1709 case RC_OPEN_BUFFERS_IN_TABS:
1710 if (ignore_system_lyxrc ||
1711 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1712 os << "\\open_buffers_in_tabs "
1713 << convert<string>(open_buffers_in_tabs)
1720 << "# COLOR SECTION ###################################\n"
1724 for (int i = 0; i < Color_ignore; ++i) {
1725 ColorCode lc = static_cast<ColorCode>(i);
1726 string const col = lcolor.getX11Name(lc);
1727 if (ignore_system_lyxrc
1728 || col != system_lcolor.getX11Name(lc)) {
1729 os << "\\set_color \""
1730 << lcolor.getLyXName(lc) << "\" \""
1738 << "# PRINTER SECTION ###################################\n"
1742 if (ignore_system_lyxrc ||
1743 printer != system_lyxrc.printer) {
1744 os << "\\printer \"" << printer << "\"\n";
1748 case RC_PRINT_ADAPTOUTPUT:
1749 if (ignore_system_lyxrc ||
1750 print_adapt_output != system_lyxrc.print_adapt_output) {
1751 os << "\\print_adapt_output "
1752 << convert<string>(print_adapt_output)
1757 case RC_PRINT_COMMAND:
1758 if (ignore_system_lyxrc ||
1759 print_command != system_lyxrc.print_command) {
1760 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1764 case RC_PRINTEXSTRAOPTIONS:
1765 if (ignore_system_lyxrc ||
1766 print_extra_options != system_lyxrc.print_extra_options) {
1767 os << "\\print_extra_options \"" << print_extra_options
1772 case RC_PRINTSPOOL_COMMAND:
1773 if (ignore_system_lyxrc ||
1774 print_spool_command != system_lyxrc.print_spool_command) {
1775 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1780 case RC_PRINTSPOOL_PRINTERPREFIX:
1781 if (ignore_system_lyxrc ||
1782 print_spool_printerprefix
1783 != system_lyxrc.print_spool_printerprefix) {
1784 os << "\\print_spool_printerprefix \""
1785 << print_spool_printerprefix << "\"\n";
1789 case RC_PRINTEVENPAGEFLAG:
1790 if (ignore_system_lyxrc ||
1791 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1792 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1797 case RC_PRINTODDPAGEFLAG:
1798 if (ignore_system_lyxrc ||
1799 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1800 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1805 case RC_PRINTREVERSEFLAG:
1806 if (ignore_system_lyxrc ||
1807 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1808 os << "\\print_reverse_flag \"" << print_reverse_flag
1813 case RC_PRINTLANDSCAPEFLAG:
1814 if (ignore_system_lyxrc ||
1815 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1816 os << "\\print_landscape_flag \"" << print_landscape_flag
1821 case RC_PRINTPAGERANGEFLAG:
1822 if (ignore_system_lyxrc ||
1823 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1824 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1829 case RC_PRINTCOPIESFLAG:
1830 if (ignore_system_lyxrc ||
1831 print_copies_flag != system_lyxrc.print_copies_flag) {
1832 os << "\\print_copies_flag \"" << print_copies_flag
1837 case RC_PRINTCOLLCOPIESFLAG:
1838 if (ignore_system_lyxrc ||
1839 print_collcopies_flag
1840 != system_lyxrc.print_collcopies_flag) {
1841 os << "\\print_collcopies_flag \""
1842 << print_collcopies_flag
1847 case RC_PRINTPAPERFLAG:
1848 if (ignore_system_lyxrc ||
1849 print_paper_flag != system_lyxrc.print_paper_flag) {
1850 os << "\\print_paper_flag \"" << print_paper_flag
1855 case RC_PRINTPAPERDIMENSIONFLAG:
1856 if (ignore_system_lyxrc ||
1857 print_paper_dimension_flag
1858 != system_lyxrc.print_paper_dimension_flag) {
1859 os << "\\print_paper_dimension_flag \""
1860 << print_paper_dimension_flag << "\"\n";
1864 case RC_PRINTTOPRINTER:
1865 if (ignore_system_lyxrc ||
1866 print_to_printer != system_lyxrc.print_to_printer) {
1867 os << "\\print_to_printer \"" << print_to_printer
1872 case RC_PRINTTOFILE:
1873 if (ignore_system_lyxrc ||
1874 print_to_file != system_lyxrc.print_to_file) {
1875 string const path = os::external_path(print_to_file);
1876 os << "\\print_to_file \"" << path << "\"\n";
1880 case RC_PRINTFILEEXTENSION:
1881 if (ignore_system_lyxrc ||
1882 print_file_extension != system_lyxrc.print_file_extension) {
1883 os << "\\print_file_extension \""
1884 << print_file_extension
1891 << "# TEX SECTION #######################################\n"
1894 case RC_FONT_ENCODING:
1895 if (ignore_system_lyxrc ||
1896 fontenc != system_lyxrc.fontenc) {
1897 os << "\\font_encoding \"" << fontenc << "\"\n";
1903 << "# FILE SECTION ######################################\n"
1906 case RC_DOCUMENTPATH:
1907 if (ignore_system_lyxrc ||
1908 document_path != system_lyxrc.document_path) {
1909 string const path = os::external_path(document_path);
1910 os << "\\document_path \"" << path << "\"\n";
1914 case RC_USELASTFILEPOS:
1915 if (ignore_system_lyxrc ||
1916 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1917 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1922 case RC_LOADSESSION:
1923 if (ignore_system_lyxrc ||
1924 load_session != system_lyxrc.load_session) {
1925 os << "\\load_session " << convert<string>(load_session)
1930 case RC_MOUSE_WHEEL_SPEED:
1931 if (ignore_system_lyxrc ||
1932 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1933 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1937 case RC_COMPLETION_INLINE_DELAY:
1938 if (ignore_system_lyxrc ||
1939 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1940 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1944 case RC_COMPLETION_INLINE_MATH:
1945 if (ignore_system_lyxrc ||
1946 completion_inline_math != system_lyxrc.completion_inline_math) {
1947 os << "\\completion_inline_math "
1948 << convert<string>(completion_inline_math) << '\n';
1952 case RC_COMPLETION_INLINE_TEXT:
1953 if (ignore_system_lyxrc ||
1954 completion_inline_text != system_lyxrc.completion_inline_text) {
1955 os << "\\completion_inline_text "
1956 << convert<string>(completion_inline_text) << '\n';
1960 case RC_COMPLETION_INLINE_DOTS:
1961 if (ignore_system_lyxrc ||
1962 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1963 os << "\\completion_inline_dots "
1964 << convert<string>(completion_inline_dots) << '\n';
1968 case RC_AUTOCORRECTION_MATH:
1969 if (ignore_system_lyxrc ||
1970 autocorrection_math != system_lyxrc.autocorrection_math) {
1971 os << "\\autocorrection_math "
1972 << convert<string>(autocorrection_math) << '\n';
1976 case RC_COMPLETION_POPUP_DELAY:
1977 if (ignore_system_lyxrc ||
1978 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1979 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1983 case RC_COMPLETION_POPUP_MATH:
1984 if (ignore_system_lyxrc ||
1985 completion_popup_math != system_lyxrc.completion_popup_math) {
1986 os << "\\completion_popup_math "
1987 << convert<string>(completion_popup_math) << '\n';
1991 case RC_COMPLETION_POPUP_TEXT:
1992 if (ignore_system_lyxrc ||
1993 completion_popup_text != system_lyxrc.completion_popup_text) {
1994 os << "\\completion_popup_text "
1995 << convert<string>(completion_popup_text) << '\n';
1999 case RC_COMPLETION_CURSOR_TEXT:
2000 if (ignore_system_lyxrc ||
2001 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2002 os << "\\completion_cursor_text "
2003 << convert<string>(completion_cursor_text) << '\n';
2007 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2008 if (ignore_system_lyxrc ||
2009 completion_popup_after_complete
2010 != system_lyxrc.completion_popup_after_complete) {
2011 os << "\\completion_popup_after_complete "
2012 << convert<string>(completion_popup_after_complete) << '\n';
2016 case RC_NUMLASTFILES:
2017 if (ignore_system_lyxrc ||
2018 num_lastfiles != system_lyxrc.num_lastfiles) {
2019 os << "\\num_lastfiles " << num_lastfiles << '\n';
2023 case RC_CHECKLASTFILES:
2024 if (ignore_system_lyxrc ||
2025 check_lastfiles != system_lyxrc.check_lastfiles) {
2026 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2031 case RC_EXAMPLEPATH:
2032 if (ignore_system_lyxrc ||
2033 example_path != system_lyxrc.example_path) {
2034 string const path = os::external_path(example_path);
2035 os << "\\example_path \"" << path << "\"\n";
2039 case RC_TEMPLATEPATH:
2040 if (ignore_system_lyxrc ||
2041 template_path != system_lyxrc.template_path) {
2042 string const path = os::external_path(template_path);
2043 os << "\\template_path \"" << path << "\"\n";
2047 case RC_TEMPDIRPATH:
2048 if (ignore_system_lyxrc ||
2049 tempdir_path != system_lyxrc.tempdir_path) {
2050 string const path = os::external_path(tempdir_path);
2051 os << "\\tempdir_path \"" << path << "\"\n";
2055 case RC_THESAURUSDIRPATH:
2056 if (ignore_system_lyxrc ||
2057 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2058 string const path = os::external_path(thesaurusdir_path);
2059 os << "\\thesaurusdir_path \"" << path << "\"\n";
2067 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2070 case RC_PLAINTEXT_LINELEN:
2071 if (ignore_system_lyxrc ||
2072 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2073 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2077 case RC_MAKE_BACKUP:
2078 if (ignore_system_lyxrc ||
2079 make_backup != system_lyxrc.make_backup) {
2080 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2084 case RC_BACKUPDIR_PATH:
2085 if (ignore_system_lyxrc ||
2086 backupdir_path != system_lyxrc.backupdir_path) {
2087 string const path = os::external_path(backupdir_path);
2088 os << "\\backupdir_path \"" << path << "\"\n";
2094 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2098 << "# SPELLCHECKER SECTION ##############################\n"
2101 case RC_SPELL_COMMAND:
2102 case RC_USE_SPELL_LIB:
2106 case RC_ACCEPT_COMPOUND:
2107 if (ignore_system_lyxrc ||
2108 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2109 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2114 case RC_USE_ALT_LANG:
2115 if (ignore_system_lyxrc ||
2116 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2117 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2123 if (ignore_system_lyxrc ||
2124 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2125 os << "\\alternate_language \"" << spellchecker_alt_lang
2130 case RC_USE_ESC_CHARS:
2131 if (ignore_system_lyxrc ||
2132 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2133 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2139 if (ignore_system_lyxrc ||
2140 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2141 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2145 case RC_USE_PERS_DICT:
2146 if (ignore_system_lyxrc ||
2147 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2148 os << "\\use_personal_dictionary "
2149 << convert<string>(spellchecker_use_pers_dict)
2154 case RC_USE_TOOLTIP:
2155 if (ignore_system_lyxrc ||
2156 use_tooltip != system_lyxrc.use_tooltip) {
2157 os << "\\use_tooltip "
2158 << convert<string>(use_tooltip)
2161 case RC_USE_PIXMAP_CACHE:
2162 if (ignore_system_lyxrc ||
2163 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2164 os << "\\use_pixmap_cache "
2165 << convert<string>(use_pixmap_cache)
2169 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2170 string const path = os::external_path(spellchecker_pers_dict);
2171 os << "\\personal_dictionary \"" << path << "\"\n";
2175 case RC_USE_INP_ENC:
2176 if (ignore_system_lyxrc ||
2177 spellchecker_use_input_encoding
2178 != system_lyxrc.spellchecker_use_input_encoding) {
2179 os << "\\use_input_encoding "
2180 << convert<string>(spellchecker_use_input_encoding)
2187 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2190 case RC_SPELLCHECK_CONTINUOUSLY:
2191 if (ignore_system_lyxrc ||
2192 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2193 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2199 case RC_RTL_SUPPORT:
2200 if (ignore_system_lyxrc ||
2201 rtl_support != system_lyxrc.rtl_support) {
2202 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2206 case RC_VISUAL_CURSOR:
2207 if (ignore_system_lyxrc ||
2208 visual_cursor != system_lyxrc.visual_cursor) {
2209 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2213 case RC_LANGUAGE_PACKAGE:
2214 if (ignore_system_lyxrc ||
2215 language_package != system_lyxrc.language_package) {
2216 os << "\\language_package \"" << language_package
2221 case RC_LANGUAGE_GLOBAL_OPTIONS:
2222 if (ignore_system_lyxrc ||
2223 language_global_options
2224 != system_lyxrc.language_global_options) {
2225 os << "\\language_global_options \""
2226 << convert<string>(language_global_options)
2231 case RC_LANGUAGE_USE_BABEL:
2232 if (ignore_system_lyxrc ||
2233 language_use_babel != system_lyxrc.language_use_babel) {
2234 os << "\\language_use_babel \""
2235 << convert<string>(language_use_babel)
2240 case RC_LANGUAGE_COMMAND_BEGIN:
2241 if (ignore_system_lyxrc ||
2242 language_command_begin
2243 != system_lyxrc.language_command_begin) {
2244 os << "\\language_command_begin \""
2245 << language_command_begin
2250 case RC_LANGUAGE_COMMAND_END:
2251 if (ignore_system_lyxrc ||
2252 language_command_end
2253 != system_lyxrc.language_command_end) {
2254 os << "\\language_command_end \"" << language_command_end
2259 case RC_LANGUAGE_COMMAND_LOCAL:
2260 if (ignore_system_lyxrc ||
2261 language_command_local
2262 != system_lyxrc.language_command_local) {
2263 os << "\\language_command_local \""
2264 << language_command_local
2269 case RC_LANGUAGE_AUTO_BEGIN:
2270 if (ignore_system_lyxrc ||
2271 language_auto_begin != system_lyxrc.language_auto_begin) {
2272 os << "\\language_auto_begin "
2273 << convert<string>(language_auto_begin) << '\n';
2277 case RC_LANGUAGE_AUTO_END:
2278 if (ignore_system_lyxrc ||
2279 language_auto_end != system_lyxrc.language_auto_end) {
2280 os << "\\language_auto_end "
2281 << convert<string>(language_auto_end) << '\n';
2285 case RC_MARK_FOREIGN_LANGUAGE:
2286 if (ignore_system_lyxrc ||
2287 mark_foreign_language
2288 != system_lyxrc.mark_foreign_language) {
2289 os << "\\mark_foreign_language " <<
2290 convert<string>(mark_foreign_language) << '\n';
2296 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2299 case RC_AUTO_NUMBER:
2300 if (ignore_system_lyxrc ||
2301 auto_number != system_lyxrc.auto_number) {
2302 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2306 case RC_DEFAULT_LANGUAGE:
2307 if (ignore_system_lyxrc ||
2308 default_language != system_lyxrc.default_language) {
2309 os << "\\default_language " << default_language << '\n';
2313 case RC_GUI_LANGUAGE:
2314 if (ignore_system_lyxrc ||
2315 gui_language != system_lyxrc.gui_language) {
2316 os << "\\gui_language " << gui_language << '\n';
2322 << "# FORMATS SECTION ##########################\n"
2326 // New/modified formats
2327 for (Formats::const_iterator cit = formats.begin();
2328 cit != formats.end(); ++cit) {
2329 Format const * format =
2330 system_formats.getFormat(cit->name());
2332 format->extension() != cit->extension() ||
2333 format->prettyname() != cit->prettyname() ||
2334 format->shortcut() != cit->shortcut() ||
2335 format->viewer() != cit->viewer() ||
2336 format->editor() != cit->editor() ||
2337 format->documentFormat() != cit->documentFormat() ||
2338 format->vectorFormat() != cit->vectorFormat()) {
2339 os << "\\format \"" << cit->name() << "\" \""
2340 << cit->extension() << "\" \""
2341 << cit->prettyname() << "\" \""
2342 << cit->shortcut() << "\" \""
2343 << escapeCommand(cit->viewer()) << "\" \""
2344 << escapeCommand(cit->editor()) << "\" \"";
2345 vector<string> flags;
2346 if (cit->documentFormat())
2347 flags.push_back("document");
2348 if (cit->vectorFormat())
2349 flags.push_back("vector");
2350 os << getStringFromVector(flags);
2355 // Look for deleted formats
2356 for (Formats::const_iterator cit = system_formats.begin();
2357 cit != system_formats.end(); ++cit)
2358 if (!formats.getFormat(cit->name()))
2359 os << "\\format \"" << cit->name()
2360 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2363 case RC_DEFAULT_VIEW_FORMAT:
2364 if (ignore_system_lyxrc ||
2365 default_view_format != system_lyxrc.default_view_format) {
2366 os << "\\default_view_format " << default_view_format << '\n';
2376 << "# CONVERTERS SECTION ##########################\n"
2380 // Look for new converters
2381 for (Converters::const_iterator cit = theConverters().begin();
2382 cit != theConverters().end(); ++cit) {
2383 Converter const * converter =
2384 theSystemConverters().getConverter(cit->from,
2387 converter->command != cit->command ||
2388 converter->flags != cit->flags)
2389 os << "\\converter \"" << cit->from << "\" \""
2390 << cit->to << "\" \""
2391 << escapeCommand(cit->command) << "\" \""
2392 << cit->flags << "\"\n";
2395 // New/modifed converters
2396 for (Converters::const_iterator cit = theSystemConverters().begin();
2397 cit != theSystemConverters().end(); ++cit)
2398 if (!theConverters().getConverter(cit->from, cit->to))
2399 os << "\\converter \"" << cit->from
2400 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2407 << "# COPIERS SECTION ##########################\n"
2410 // Look for new movers
2411 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2412 Movers::const_iterator const sysend = theSystemMovers().end();
2413 Movers::const_iterator it = theMovers().begin();
2414 Movers::const_iterator end = theMovers().end();
2416 for (; it != end; ++it) {
2417 Movers::const_iterator const sysit =
2418 find_if(sysbegin, sysend, SameMover(*it));
2419 if (sysit == sysend) {
2420 string const & fmt = it->first;
2421 string const & command =
2422 it->second.command();
2424 os << "\\copier " << fmt
2425 << " \"" << escapeCommand(command) << "\"\n";
2431 // We don't actually delete SpecialisedMover(s) from the
2432 // map, just clear their 'command', so there's no need
2433 // to test for anything else.
2441 string const LyXRC::getDescription(LyXRCTags tag)
2446 case RC_ACCEPT_COMPOUND:
2447 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2451 case RC_USE_ALT_LANG:
2452 str = _("Specify an alternate language. The default is to use the language of the document.");
2455 case RC_PLAINTEXT_ROFF_COMMAND:
2456 str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
2459 case RC_PLAINTEXT_LINELEN:
2460 str = _("The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line.");
2463 case RC_AUTOREGIONDELETE:
2464 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2467 case RC_AUTORESET_OPTIONS:
2468 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2472 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2475 case RC_AUTO_NUMBER:
2478 case RC_BACKUPDIR_PATH:
2479 str = _("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.");
2482 case RC_BIBTEX_COMMAND:
2483 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2487 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2490 case RC_CHECKLASTFILES:
2491 str = _("Select to check whether the lastfiles still exist.");
2494 case RC_CHKTEX_COMMAND:
2495 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2504 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2505 str = _("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.");
2508 case RC_SCROLL_BELOW_DOCUMENT:
2509 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
2512 case RC_MAC_LIKE_WORD_MOVEMENT:
2513 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2516 case RC_SHOW_MACRO_LABEL:
2517 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2520 case RC_DATE_INSERT_FORMAT:
2521 //xgettext:no-c-format
2522 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2526 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2529 case RC_DEFAULT_VIEW_FORMAT:
2530 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2533 case RC_DEFAULT_LANGUAGE:
2534 str = _("New documents will be assigned this language.");
2537 case RC_DEFAULT_PAPERSIZE:
2538 str = _("Specify the default paper size.");
2541 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2542 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2545 case RC_DISPLAY_GRAPHICS:
2546 str = _("Select how LyX will display any graphics.");
2549 case RC_DOCUMENTPATH:
2550 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2554 case RC_USE_ESC_CHARS:
2555 str = _("Specify additional chars that can be part of a word.");
2558 case RC_EXAMPLEPATH:
2559 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2562 case RC_FONT_ENCODING:
2563 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2569 case RC_INDEX_COMMAND:
2570 str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\".");
2573 case RC_NOMENCL_COMMAND:
2574 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2581 case RC_KBMAP_PRIMARY:
2582 case RC_KBMAP_SECONDARY:
2583 str = _("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.");
2586 case RC_LABEL_INIT_LENGTH:
2587 str = _("Maximum number of words in the initialization string for a new label");
2590 case RC_LANGUAGE_AUTO_BEGIN:
2591 str = _("Select if a language switching command is needed at the beginning of the document.");
2594 case RC_LANGUAGE_AUTO_END:
2595 str = _("Select if a language switching command is needed at the end of the document.");
2598 case RC_LANGUAGE_COMMAND_BEGIN:
2599 str = _("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.");
2602 case RC_LANGUAGE_COMMAND_END:
2603 str = _("The LaTeX command for changing back to the language of the document.");
2606 case RC_LANGUAGE_COMMAND_LOCAL:
2607 str = _("The LaTeX command for local changing of the language.");
2610 case RC_LANGUAGE_GLOBAL_OPTIONS:
2611 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2614 case RC_LANGUAGE_PACKAGE:
2615 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2618 case RC_LANGUAGE_USE_BABEL:
2619 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2622 case RC_USELASTFILEPOS:
2623 str = _("De-select if you do not want LyX to scroll to saved position.");
2626 case RC_LOADSESSION:
2627 str = _("De-select to prevent loading files opened from the last LyX session.");
2630 case RC_MAKE_BACKUP:
2631 str = _("De-select if you don't want LyX to create backup files.");
2634 case RC_MARK_FOREIGN_LANGUAGE:
2635 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2638 case RC_MOUSE_WHEEL_SPEED:
2639 str = bformat(_("The scrolling speed of the mouse wheel."),
2643 case RC_COMPLETION_POPUP_DELAY:
2644 str = _("The completion popup delay.");
2647 case RC_COMPLETION_POPUP_MATH:
2648 str = _("Select to display the completion popup in math mode.");
2651 case RC_COMPLETION_POPUP_TEXT:
2652 str = _("Select to display the completion popup in text mode.");
2655 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2656 str = _("Show the completion popup without delay after non-unique completion attempt.");
2659 case RC_COMPLETION_POPUP_TEXT:
2660 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2663 case RC_COMPLETION_POPUP_DELAY:
2664 str = _("The inline completion delay.");
2667 case RC_COMPLETION_INLINE_MATH:
2668 str = _("Select to display the inline completion in math mode.");
2671 case RC_COMPLETION_INLINE_TEXT:
2672 str = _("Select to display the inline completion in text mode.");
2675 case RC_COMPLETION_INLINE_DOTS:
2676 str = _("Use \"...\" to shorten long completions.");
2679 case RC_AUTOCORRECTION_MATH:
2680 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2683 case RC_NUMLASTFILES:
2684 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2688 case RC_PATH_PREFIX:
2689 str = _("Specify those directories which should be "
2690 "prepended to the PATH environment variable. "
2691 "Use the OS native format.");
2695 case RC_USE_PERS_DICT:
2696 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2700 str = _("Shows a typeset preview of things such as math");
2703 case RC_PREVIEW_HASHED_LABELS:
2704 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2707 case RC_PREVIEW_SCALE_FACTOR:
2708 str = _("Scale the preview size to suit.");
2711 case RC_PRINTCOLLCOPIESFLAG:
2712 str = _("The option for specifying whether the copies should be collated.");
2715 case RC_PRINTCOPIESFLAG:
2716 str = _("The option for specifying the number of copies to print.");
2720 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2723 case RC_PRINTEVENPAGEFLAG:
2724 str = _("The option to print only even pages.");
2727 case RC_PRINTEXSTRAOPTIONS:
2728 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2731 case RC_PRINTFILEEXTENSION:
2732 str = _("Extension of printer program output file. Usually \".ps\".");
2735 case RC_PRINTLANDSCAPEFLAG:
2736 str = _("The option to print out in landscape.");
2739 case RC_PRINTODDPAGEFLAG:
2740 str = _("The option to print only odd pages.");
2743 case RC_PRINTPAGERANGEFLAG:
2744 str = _("The option for specifying a comma-separated list of pages to print.");
2747 case RC_PRINTPAPERDIMENSIONFLAG:
2748 str = _("Option to specify the dimensions of the print paper.");
2751 case RC_PRINTPAPERFLAG:
2752 str = _("The option to specify paper type.");
2755 case RC_PRINTREVERSEFLAG:
2756 str = _("The option to reverse the order of the pages printed.");
2759 case RC_PRINTSPOOL_COMMAND:
2760 str = _("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.");
2763 case RC_PRINTSPOOL_PRINTERPREFIX:
2764 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
2767 case RC_PRINTTOFILE:
2768 str = _("Option to pass to the print program to print to a file.");
2771 case RC_PRINTTOPRINTER:
2772 str = _("Option to pass to the print program to print on a specific printer.");
2775 case RC_PRINT_ADAPTOUTPUT:
2776 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2779 case RC_PRINT_COMMAND:
2780 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2783 case RC_RTL_SUPPORT:
2784 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2787 case RC_VISUAL_CURSOR:
2788 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2792 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2795 case RC_SCREEN_FONT_ROMAN:
2796 case RC_SCREEN_FONT_SANS:
2797 case RC_SCREEN_FONT_TYPEWRITER:
2798 str = _("The screen fonts used to display the text while editing.");
2801 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2802 case RC_SCREEN_FONT_SANS_FOUNDRY:
2803 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2806 case RC_SCREEN_FONT_SCALABLE:
2807 str = _("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.");
2810 case RC_SCREEN_FONT_SIZES:
2811 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2814 case RC_SCREEN_ZOOM:
2815 //xgettext:no-c-format
2816 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2819 case RC_GEOMETRY_SESSION:
2820 str = _("Allow session manager to save and restore windows geometry.");
2824 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2830 case RC_SHOW_BANNER:
2831 str = _("De-select if you don't want the startup banner.");
2834 case RC_TEMPDIRPATH:
2835 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2838 case RC_THESAURUSDIRPATH:
2839 str = _("This is the place where the files of the thesaurus library reside.");
2842 case RC_TEMPLATEPATH:
2843 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2846 case RC_TEX_ALLOWS_SPACES:
2849 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2853 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2865 case RC_USE_INP_ENC:
2866 str = _("Specify whether to pass the -T input encoding option to aspell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2869 case RC_USE_TOOLTIP:
2870 str = _("Enable the automatic appearance of tool tips in the work area.");
2873 case RC_USE_PIXMAP_CACHE:
2874 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2877 case RC_USE_SPELL_LIB:
2880 case RC_VIEWDVI_PAPEROPTION:
2881 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2896 // The global instance
2899 // The global copy of the system lyxrc entries (everything except preferences)