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 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
103 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
104 { "\\kbmap", LyXRC::RC_KBMAP },
105 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
106 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
107 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
108 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
109 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
110 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
111 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
112 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
113 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
114 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
115 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
116 { "\\load_session", LyXRC::RC_LOADSESSION },
117 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
118 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
119 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
120 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
121 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
122 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
123 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
124 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
125 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
126 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
127 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
128 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
129 { "\\preview", LyXRC::RC_PREVIEW },
130 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
131 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
132 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
133 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
134 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
135 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
136 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
137 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
138 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
139 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
140 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
141 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
142 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
143 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
144 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
145 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
146 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
147 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
148 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
149 { "\\printer", LyXRC::RC_PRINTER },
150 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
151 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
152 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
153 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
154 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
155 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
156 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
157 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
158 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
159 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
160 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
161 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
162 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
163 { "\\set_color", LyXRC::RC_SET_COLOR },
164 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
165 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
166 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
167 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
168 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
169 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
170 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
171 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
172 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
173 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
174 { "\\ui_file", LyXRC::RC_UIFILE },
175 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
176 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
177 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
178 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
179 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
180 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
181 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
182 // compatibility with versions older than 1.4.0 only
183 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
184 // compatibility with versions older than 1.4.0 only
185 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
186 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
187 { "\\user_email", LyXRC::RC_USER_EMAIL },
188 { "\\user_name", LyXRC::RC_USER_NAME },
189 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
190 // compatibility with versions older than 1.4.0 only
191 { "\\viewer", LyXRC::RC_VIEWER},
192 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
195 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
206 void LyXRC::setDefaults()
209 def_file = "default";
211 // Get printer from the environment. If fail, use default "",
212 // assuming that everything is set up correctly.
213 printer = getEnv("PRINTER");
214 print_adapt_output = false;
215 print_command = "dvips";
216 print_evenpage_flag = "-B";
217 print_oddpage_flag = "-A";
218 print_pagerange_flag = "-pp";
219 print_copies_flag = "-c";
220 print_collcopies_flag = "-C";
221 print_reverse_flag = "-r";
222 print_landscape_flag = "-t landscape";
223 print_to_printer = "-P";
224 print_to_file = "-o ";
225 print_file_extension = ".ps";
226 print_paper_flag = "-t";
227 print_paper_dimension_flag = "-T";
228 document_path.erase();
229 view_dvi_paper_option.erase();
230 default_papersize = PAPER_DEFAULT;
231 default_view_format = "pdf2";
232 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
233 bibtex_command = "bibtex";
235 index_command = "makeindex -c -q";
236 nomencl_command = "makeindex -s nomencl.ist";
238 // Because a screen typically is wider than a piece of paper:
240 allow_geometry_session = true;
241 // Default LaTeX font size:
242 font_sizes[FONT_SIZE_TINY] = "5.0";
243 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
244 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
245 font_sizes[FONT_SIZE_SMALL] = "9.0";
246 font_sizes[FONT_SIZE_NORMAL] = "10.0";
247 font_sizes[FONT_SIZE_LARGE] = "12.0";
248 font_sizes[FONT_SIZE_LARGER] = "14.4";
249 font_sizes[FONT_SIZE_LARGEST] = "17.26";
250 font_sizes[FONT_SIZE_HUGE] = "20.74";
251 font_sizes[FONT_SIZE_HUGER] = "24.88";
252 use_scalable_fonts = true;
253 roman_font_name = "";
255 typewriter_font_name = "";
257 auto_region_delete = true;
258 auto_reset_options = false;
259 plaintext_linelen = 65;
260 mouse_wheel_speed = 1.0;
261 num_lastfiles = maxlastfiles;
262 check_lastfiles = true;
263 use_lastfilepos = true;
264 load_session = false;
266 backupdir_path.erase();
267 display_graphics = true;
268 // Spellchecker settings:
269 spellchecker_accept_compound = false;
270 spellchecker_use_input_encoding = false;
271 spellchecker_use_alt_lang = false;
272 spellchecker_use_pers_dict = false;
273 spellchecker_use_esc_chars = false;
274 spellcheck_continuously = false;
277 visual_cursor = false;
279 mark_foreign_language = true;
280 language_auto_begin = true;
281 language_auto_end = true;
282 language_global_options = true;
283 language_use_babel = true;
284 language_package = "\\usepackage{babel}";
285 language_command_begin = "\\selectlanguage{$$lang}";
286 language_command_local = "\\foreignlanguage{$$lang}{";
287 sort_layouts = false;
288 group_layouts = true;
289 default_language = "english";
290 gui_language = "auto";
292 windows_style_tex_paths = false;
293 tex_allows_spaces = false;
294 date_insert_format = "%x";
295 cursor_follows_scrollbar = false;
296 scroll_below_document = false;
297 mac_like_word_movement = false;
298 macro_edit_style = MACRO_EDIT_INLINE_BOX;
299 dialogs_iconify_with_main = false;
300 label_init_length = 3;
301 preview = PREVIEW_OFF;
302 preview_hashed_labels = false;
303 preview_scale_factor = "0.9";
304 use_converter_cache = true;
306 use_pixmap_cache = false;
307 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
308 user_name = to_utf8(support::user_name());
309 user_email = to_utf8(support::user_email());
310 open_buffers_in_tabs = true;
312 // Fullscreen settings
313 full_screen_limit = false;
314 full_screen_toolbars = true;
315 full_screen_tabbar = true;
316 full_screen_scrollbar = true;
317 full_screen_width = 700;
319 completion_cursor_text = true;
320 completion_popup_math = true;
321 completion_popup_text = false;
322 completion_popup_delay = 2.0;
323 completion_popup_after_complete = true;
324 autocorrection_math = false;
325 completion_inline_math = true;
326 completion_inline_text = false;
327 completion_inline_dots = -1;
328 completion_inline_delay = 0.2;
334 void oldFontFormat(string & family, string & foundry)
336 if (family.empty() || family[0] != '-')
338 foundry = token(family, '-', 1);
339 family = token(family, '-', 2);
347 int LyXRC::read(FileName const & filename)
349 Lexer lexrc(lyxrcTags);
350 if (lyxerr.debugging(Debug::PARSER))
351 lexrc.printTable(lyxerr);
353 lexrc.setFile(filename);
357 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
363 int LyXRC::read(istream & is)
365 Lexer lexrc(lyxrcTags);
366 if (lyxerr.debugging(Debug::PARSER))
367 lexrc.printTable(lyxerr);
373 LYXERR(Debug::LYXRC, "Reading istream...");
379 int LyXRC::read(Lexer & lexrc)
384 while (lexrc.isOK()) {
385 // By using two switches we take advantage of the compiler
386 // telling us if we have missed a LyXRCTags element in
387 // the second switch.
388 // Note that this also shows a problem with Lexer since it
389 // helps us avoid taking advantage of the strictness of the
392 int le = lexrc.lex();
394 case Lexer::LEX_UNDEF:
395 lexrc.printError("Unknown tag `$$Token'");
397 case Lexer::LEX_FEOF:
402 switch (static_cast<LyXRCTags>(le)) {
403 case RC_INPUT: // Include file
406 libFileSearch(string(),
409 lexrc.printError("Error reading "
410 "included file: " + tmp.absFilename());
416 bind_file = os::internal_path(lexrc.getString());
421 def_file = os::internal_path(lexrc.getString());
426 ui_file = os::internal_path(lexrc.getString());
429 case RC_AUTORESET_OPTIONS:
430 lexrc >> auto_reset_options;
433 case RC_DISPLAY_GRAPHICS:
435 display_graphics = lexrc.getString() == "true";
438 case RC_TEX_EXPECTS_WINDOWS_PATHS:
439 lexrc >> windows_style_tex_paths;
442 case RC_TEX_ALLOWS_SPACES:
443 lexrc >> tex_allows_spaces;
450 case RC_KBMAP_PRIMARY:
452 string const kmap(os::internal_path(lexrc.getString()));
455 } else if (!libFileSearch("kbd", kmap,
457 primary_kbmap = kmap;
459 lexrc.printError("LyX: Keymap `$$Token' not found");
464 case RC_KBMAP_SECONDARY:
466 string const kmap(os::internal_path(lexrc.getString()));
469 } else if (!libFileSearch("kbd", kmap,
471 secondary_kbmap = kmap;
473 lexrc.printError("LyX: Keymap `$$Token' not found");
478 case RC_FONT_ENCODING:
486 case RC_PRINT_COMMAND:
487 if (lexrc.next(true)) {
488 print_command = lexrc.getString();
492 case RC_PRINTEVENPAGEFLAG:
493 lexrc >> print_evenpage_flag;
496 case RC_PRINTODDPAGEFLAG:
497 lexrc >> print_oddpage_flag;
500 case RC_PRINTPAGERANGEFLAG:
501 lexrc >> print_pagerange_flag;
504 case RC_PRINTCOPIESFLAG:
505 lexrc >> print_copies_flag;
508 case RC_PRINTCOLLCOPIESFLAG:
509 lexrc >> print_collcopies_flag;
512 case RC_PRINTREVERSEFLAG:
513 lexrc >> print_reverse_flag;
516 case RC_PRINTLANDSCAPEFLAG:
517 lexrc >> print_landscape_flag;
520 case RC_PRINTTOPRINTER:
521 lexrc >> print_to_printer;
524 case RC_PRINT_ADAPTOUTPUT:
525 lexrc >> print_adapt_output;
530 print_to_file = os::internal_path(lexrc.getString());
534 case RC_PRINTFILEEXTENSION:
535 lexrc >> print_file_extension;
538 case RC_PRINTEXSTRAOPTIONS:
539 lexrc >> print_extra_options;
542 case RC_PRINTSPOOL_COMMAND:
543 if (lexrc.next(true)) {
544 print_spool_command = lexrc.getString();
548 case RC_PRINTSPOOL_PRINTERPREFIX:
549 lexrc >> print_spool_printerprefix;
552 case RC_PRINTPAPERDIMENSIONFLAG:
553 lexrc >> print_paper_dimension_flag;
556 case RC_PRINTPAPERFLAG:
557 lexrc >> print_paper_flag;
560 case RC_DEFAULT_PAPERSIZE:
562 string const size = ascii_lowercase(lexrc.getString());
563 if (size == "usletter")
564 default_papersize = PAPER_USLETTER;
565 else if (size == "legal")
566 default_papersize = PAPER_USLEGAL;
567 else if (size == "executive")
568 default_papersize = PAPER_USEXECUTIVE;
569 else if (size == "a3")
570 default_papersize = PAPER_A3;
571 else if (size == "a4")
572 default_papersize = PAPER_A4;
573 else if (size == "a5")
574 default_papersize = PAPER_A5;
575 else if (size == "b5")
576 default_papersize = PAPER_B5;
577 else if (size == "default")
578 default_papersize = PAPER_DEFAULT;
582 case RC_VIEWDVI_PAPEROPTION:
584 view_dvi_paper_option = lexrc.getString();
586 view_dvi_paper_option.erase();
589 case RC_CHKTEX_COMMAND:
590 if (lexrc.next(true)) {
591 chktex_command = lexrc.getString();
595 case RC_BIBTEX_COMMAND:
596 if (lexrc.next(true)) {
597 bibtex_command = lexrc.getString();
601 case RC_JBIBTEX_COMMAND:
602 if (lexrc.next(true)) {
603 jbibtex_command = lexrc.getString();
607 case RC_INDEX_COMMAND:
608 if (lexrc.next(true)) {
609 index_command = lexrc.getString();
613 case RC_JINDEX_COMMAND:
614 if (lexrc.next(true)) {
615 jindex_command = lexrc.getString();
619 case RC_SPLITINDEX_COMMAND:
620 if (lexrc.next(true)) {
621 splitindex_command = lexrc.getString();
625 case RC_NOMENCL_COMMAND:
626 if (lexrc.next(true)) {
627 nomencl_command = lexrc.getString();
639 case RC_GEOMETRY_SESSION:
640 lexrc >> allow_geometry_session;
643 case RC_SCREEN_FONT_SIZES:
644 lexrc >> font_sizes[FONT_SIZE_TINY];
645 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
646 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
647 lexrc >> font_sizes[FONT_SIZE_SMALL];
648 lexrc >> font_sizes[FONT_SIZE_NORMAL];
649 lexrc >> font_sizes[FONT_SIZE_LARGE];
650 lexrc >> font_sizes[FONT_SIZE_LARGER];
651 lexrc >> font_sizes[FONT_SIZE_LARGEST];
652 lexrc >> font_sizes[FONT_SIZE_HUGE];
653 lexrc >> font_sizes[FONT_SIZE_HUGER];
656 case RC_SCREEN_FONT_SCALABLE:
657 lexrc >> use_scalable_fonts;
664 case RC_DOCUMENTPATH:
666 document_path = os::internal_path(lexrc.getString());
667 document_path = expandPath(document_path);
673 example_path = os::internal_path(lexrc.getString());
674 example_path = expandPath(example_path);
678 case RC_TEMPLATEPATH:
680 template_path = os::internal_path(lexrc.getString());
681 template_path = expandPath(template_path);
687 tempdir_path = os::internal_path(lexrc.getString());
688 tempdir_path = expandPath(tempdir_path);
692 case RC_THESAURUSDIRPATH:
694 thesaurusdir_path = os::internal_path(lexrc.getString());
695 thesaurusdir_path = expandPath(thesaurusdir_path);
701 LYXERR0("Ignoring obsolete use_tempdir flag.");
704 case RC_USELASTFILEPOS:
705 lexrc >> use_lastfilepos;
709 lexrc >> load_session;
712 case RC_MOUSE_WHEEL_SPEED:
713 lexrc >> mouse_wheel_speed;
716 case RC_COMPLETION_INLINE_DELAY:
717 lexrc >> completion_inline_delay;
720 case RC_COMPLETION_INLINE_MATH:
721 lexrc >> completion_inline_math;
724 case RC_COMPLETION_INLINE_TEXT:
725 lexrc >> completion_inline_text;
728 case RC_COMPLETION_INLINE_DOTS:
729 lexrc >> completion_inline_dots;
732 case RC_AUTOCORRECTION_MATH:
733 lexrc >> autocorrection_math;
736 case RC_COMPLETION_POPUP_DELAY:
737 lexrc >> completion_popup_delay;
740 case RC_COMPLETION_POPUP_MATH:
741 lexrc >> completion_popup_math;
744 case RC_COMPLETION_POPUP_TEXT:
745 lexrc >> completion_popup_text;
748 case RC_COMPLETION_CURSOR_TEXT:
749 lexrc >> completion_cursor_text;
752 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
753 lexrc >> completion_popup_after_complete;
756 case RC_NUMLASTFILES:
757 lexrc >> num_lastfiles;
760 case RC_CHECKLASTFILES:
761 lexrc >> check_lastfiles;
764 case RC_SCREEN_FONT_ROMAN:
766 roman_font_name = lexrc.getString();
767 oldFontFormat(roman_font_name,
772 case RC_SCREEN_FONT_SANS:
774 sans_font_name = lexrc.getString();
775 oldFontFormat(sans_font_name, sans_font_foundry);
779 case RC_SCREEN_FONT_TYPEWRITER:
781 typewriter_font_name = lexrc.getString();
782 oldFontFormat(typewriter_font_name,
783 typewriter_font_foundry);
787 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
788 lexrc >> roman_font_foundry;
791 case RC_SCREEN_FONT_SANS_FOUNDRY:
792 lexrc >> sans_font_foundry;
795 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
796 lexrc >> typewriter_font_foundry;
801 lexrc.printError("Missing color tag.");
804 string lyx_name = lexrc.getString();
807 lexrc.printError("Missing color name for color: `$$Token'");
810 string x11_name = lexrc.getString();
812 ColorCode const col =
813 lcolor.getFromLyXName(lyx_name);
814 if (col == Color_none ||
815 col == Color_inherit ||
819 if (!lcolor.setColor(col, x11_name))
820 LYXERR0("Bad lyxrc set_color for " << lyx_name);
824 case RC_AUTOREGIONDELETE:
825 // Auto region delete defaults to true
826 lexrc >> auto_region_delete;
831 lyxpipes = os::internal_path(lexrc.getString());
832 lyxpipes = expandPath(lyxpipes);
836 case RC_CURSOR_FOLLOWS_SCROLLBAR:
837 lexrc >> cursor_follows_scrollbar;
840 case RC_SCROLL_BELOW_DOCUMENT:
841 lexrc >> scroll_below_document;
844 case RC_MAC_LIKE_WORD_MOVEMENT:
845 lexrc >> mac_like_word_movement;
848 case RC_MACRO_EDIT_STYLE:
850 switch (lexrc.getInteger()) {
851 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
852 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
853 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
858 case RC_DIALOGS_ICONIFY_WITH_MAIN:
859 lexrc >> dialogs_iconify_with_main;
862 case RC_PLAINTEXT_ROFF_COMMAND:
863 (void) lexrc.getString(); // Obsoleted in 2.0
865 case RC_PLAINTEXT_LINELEN:
866 lexrc >> plaintext_linelen;
868 // Spellchecker settings:
869 case RC_ACCEPT_COMPOUND:
870 lexrc >> spellchecker_accept_compound;
873 lexrc >> spellchecker_use_input_encoding;
875 case RC_USE_ALT_LANG:
876 lexrc >> spellchecker_use_alt_lang;
878 case RC_USE_PERS_DICT:
879 lexrc >> spellchecker_use_pers_dict;
882 lexrc >> use_tooltip;
884 case RC_USE_PIXMAP_CACHE:
885 lexrc >> use_pixmap_cache;
887 case RC_USE_ESC_CHARS:
888 lexrc >> spellchecker_use_esc_chars;
891 lexrc >> spellchecker_alt_lang;
895 spellchecker_pers_dict = os::internal_path(lexrc.getString());
898 lexrc >> spellchecker_esc_chars;
900 case RC_SPELLCHECK_CONTINUOUSLY:
901 lexrc >> spellcheck_continuously;
904 lexrc >> make_backup;
906 case RC_BACKUPDIR_PATH:
908 backupdir_path = os::internal_path(lexrc.getString());
909 backupdir_path = expandPath(backupdir_path);
912 case RC_DATE_INSERT_FORMAT:
913 lexrc >> date_insert_format;
915 case RC_LANGUAGE_PACKAGE:
916 lexrc >> language_package;
918 case RC_LANGUAGE_AUTO_BEGIN:
919 lexrc >> language_auto_begin;
921 case RC_LANGUAGE_AUTO_END:
922 lexrc >> language_auto_end;
924 case RC_LANGUAGE_GLOBAL_OPTIONS:
925 lexrc >> language_global_options;
927 case RC_LANGUAGE_USE_BABEL:
928 lexrc >> language_use_babel;
930 case RC_LANGUAGE_COMMAND_BEGIN:
931 lexrc >> language_command_begin;
933 case RC_LANGUAGE_COMMAND_END:
934 lexrc >> language_command_end;
936 case RC_LANGUAGE_COMMAND_LOCAL:
937 lexrc >> language_command_local;
940 lexrc >> rtl_support;
942 case RC_VISUAL_CURSOR:
943 lexrc >> visual_cursor;
946 lexrc >> auto_number;
948 case RC_MARK_FOREIGN_LANGUAGE:
949 lexrc >> mark_foreign_language;
955 fmt = lexrc.getString();
956 if (lexrc.next(true))
957 command = lexrc.getString();
958 setMover(fmt, command);
963 string from, to, command, flags;
965 from = lexrc.getString();
967 to = lexrc.getString();
968 if (lexrc.next(true))
969 command = lexrc.getString();
971 flags = lexrc.getString();
973 theConverters().erase(from, to);
975 theConverters().add(from, to, command, flags);
978 // compatibility with versions older than 1.4.0 only
980 string format, command;
981 lexrc >> format >> command;
982 formats.setViewer(format, command);
986 string format, extension, prettyname, shortcut;
987 lexrc >> format >> extension >> prettyname >> shortcut;
988 string viewer, editor;
989 if (lexrc.next(true))
990 viewer = lexrc.getString();
991 if (lexrc.next(true))
992 editor = lexrc.getString();
994 // Hack to ensure compatibility with versions older
996 int le = lexrc.lex();
997 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
998 flags = lexrc.getString();
999 if (le != Lexer::LEX_DATA) {
1000 // We have got a known token.
1001 // Therefore this is an old style
1002 // format definition without
1004 lexrc.pushToken(flags);
1008 int flgs = Format::none;
1009 while (!flags.empty()) {
1011 flags = split(flags, flag, ',');
1012 if (flag == "document")
1013 flgs |= Format::document;
1014 else if (flag == "vector")
1015 flgs |= Format::vector;
1017 LYXERR0("Ignoring unknown flag `"
1018 << flag << "' for format `"
1021 if (prettyname.empty()) {
1022 if (theConverters().formatIsUsed(format))
1023 LYXERR0("Can't delete format " << format);
1025 formats.erase(format);
1027 formats.add(format, extension, prettyname,
1028 shortcut, viewer, editor, flgs);
1032 case RC_DEFAULT_VIEW_FORMAT:
1033 lexrc >> default_view_format;
1036 case RC_DEFAULT_LANGUAGE:
1037 lexrc >> default_language;
1040 case RC_GUI_LANGUAGE:
1041 lexrc >> gui_language;
1044 case RC_LABEL_INIT_LENGTH:
1045 lexrc >> label_init_length;
1048 case RC_SHOW_BANNER:
1049 lexrc >> show_banner;
1054 string const tmp = lexrc.getString();
1055 if (tmp == "true" || tmp == "on")
1056 preview = PREVIEW_ON;
1057 else if (tmp == "no_math")
1058 preview = PREVIEW_NO_MATH;
1060 preview = PREVIEW_OFF;
1061 if (tmp != "false" && tmp != "off")
1062 LYXERR0("Unrecognized preview status \""
1068 case RC_PREVIEW_HASHED_LABELS:
1069 lexrc >> preview_hashed_labels;
1072 case RC_PREVIEW_SCALE_FACTOR:
1073 lexrc >> preview_scale_factor;
1080 lexrc >> user_email;
1083 case RC_PATH_PREFIX:
1084 lexrc >> path_prefix;
1087 case RC_USE_CONVERTER_CACHE:
1088 lexrc >> use_converter_cache;
1090 case RC_CONVERTER_CACHE_MAXAGE:
1091 lexrc >> converter_cache_maxage;
1094 case RC_SORT_LAYOUTS:
1095 lexrc >> sort_layouts;
1097 case RC_GROUP_LAYOUTS:
1098 lexrc >> group_layouts;
1100 case RC_FULL_SCREEN_LIMIT:
1101 lexrc >> full_screen_limit;
1103 case RC_FULL_SCREEN_TOOLBARS:
1104 lexrc >> full_screen_toolbars;
1106 case RC_FULL_SCREEN_SCROLLBAR:
1107 lexrc >> full_screen_scrollbar;
1109 case RC_FULL_SCREEN_TABBAR:
1110 lexrc >> full_screen_tabbar;
1112 case RC_FULL_SCREEN_WIDTH:
1113 lexrc >> full_screen_width;
1115 case RC_OPEN_BUFFERS_IN_TABS:
1116 lexrc >> open_buffers_in_tabs;
1120 case RC_SPELL_COMMAND:
1121 case RC_USE_SPELL_LIB:
1122 (void) lexrc.getString();
1126 break; // this is just a dummy
1130 /// Update converters data-structures
1131 theConverters().update(formats);
1132 theConverters().buildGraph();
1138 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1140 ofstream ofs(filename.toFilesystemEncoding().c_str());
1142 write(ofs, ignore_system_lyxrc);
1146 void LyXRC::print() const
1148 if (lyxerr.debugging())
1149 write(lyxerr, false);
1157 typedef pair<string, SpecialisedMover> Data;
1159 SameMover(Data const & comparison)
1160 : comparison_(comparison) {}
1162 bool operator()(Data const & data) const
1164 return data.first == comparison_.first &&
1165 data.second.command() == comparison_.second.command();
1175 // Escape \ and " so that LyXLex can read the string later
1176 string escapeCommand(string const & str) {
1177 return subst(subst(str , "\\", "\\\\"),
1184 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1186 LyXRCTags tag = RC_LAST;
1188 if (!name.empty()) {
1189 for (int i = 0; i != lyxrcCount; ++i)
1190 if ("\\" + name == lyxrcTags[i].tag)
1191 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1195 os << "# LyX " << lyx_version
1196 << " generated this file. If you want to make your own\n"
1197 << "# modifications you should do them from inside LyX and save.\n"
1200 // Why the switch you might ask. It is a trick to ensure that all
1201 // the elements in the LyXRCTags enum are handled. As you can see
1202 // there are no breaks at all. So it is just a huge fall-through.
1203 // The nice thing is that we will get a warning from the compiler
1204 // if we forget an element.
1208 // input/include files are not done here
1210 if (ignore_system_lyxrc ||
1211 bind_file != system_lyxrc.bind_file) {
1212 string const path = os::external_path(bind_file);
1213 os << "\\bind_file \"" << path << "\"\n";
1219 if (ignore_system_lyxrc ||
1220 def_file != system_lyxrc.def_file) {
1221 string const path = os::external_path(def_file);
1222 os << "\\def_file \"" << path << "\"\n";
1231 << "# MISC SECTION ######################################\n"
1233 // bind files are not done here.
1235 case RC_PATH_PREFIX:
1236 if (ignore_system_lyxrc ||
1237 path_prefix != system_lyxrc.path_prefix) {
1238 os << "\\path_prefix \"" << path_prefix << "\"\n";
1243 if (ignore_system_lyxrc ||
1244 ui_file != system_lyxrc.ui_file) {
1245 string const path = os::external_path(ui_file);
1246 os << "\\ui_file \"" << path << "\"\n";
1250 case RC_AUTOREGIONDELETE:
1251 if (ignore_system_lyxrc ||
1252 auto_region_delete != system_lyxrc.auto_region_delete) {
1253 os << "# Set to false to inhibit automatic replacement of\n"
1254 << "# the current selection.\n"
1255 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1260 case RC_AUTORESET_OPTIONS:
1261 if (ignore_system_lyxrc ||
1262 auto_reset_options != system_lyxrc.auto_reset_options) {
1263 os << "# Set to false to inhibit automatic reset of\n"
1264 << "# the class options to defaults on class change.\n"
1265 << "\\auto_reset_options "
1266 << convert<string>(auto_reset_options)
1272 if (ignore_system_lyxrc ||
1273 autosave != system_lyxrc.autosave) {
1274 os << "# The time interval between auto-saves in seconds.\n"
1275 << "\\autosave " << autosave << '\n';
1279 case RC_DISPLAY_GRAPHICS:
1280 if (ignore_system_lyxrc ||
1281 display_graphics != system_lyxrc.display_graphics) {
1282 os << "# Display graphics within LyX\n"
1284 << "\\display_graphics "
1285 << (display_graphics ? "true" : "false")
1290 case RC_SORT_LAYOUTS:
1291 if (ignore_system_lyxrc ||
1292 sort_layouts != system_lyxrc.sort_layouts) {
1293 os << "# Sort layouts alphabetically.\n"
1294 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1298 case RC_GROUP_LAYOUTS:
1299 if (ignore_system_lyxrc ||
1300 group_layouts != system_lyxrc.group_layouts) {
1301 os << "# Group layouts by their category.\n"
1302 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1306 case RC_VIEWDVI_PAPEROPTION:
1307 if (ignore_system_lyxrc ||
1308 view_dvi_paper_option
1309 != system_lyxrc.view_dvi_paper_option) {
1310 os << "# Options used to specify paper size to the\n"
1311 << "# view_dvi_command (e.g. -paper)\n"
1312 << "\\view_dvi_paper_option \""
1313 << view_dvi_paper_option << "\"\n";
1317 case RC_DEFAULT_PAPERSIZE:
1318 if (ignore_system_lyxrc ||
1319 default_papersize != system_lyxrc.default_papersize) {
1320 os << "# The default papersize to use.\n"
1321 << "\\default_papersize \"";
1322 switch (default_papersize) {
1324 os << "default"; break;
1325 case PAPER_USLETTER:
1326 os << "usletter"; break;
1328 os << "legal"; break;
1329 case PAPER_USEXECUTIVE:
1330 os << "executive"; break;
1341 case PAPER_B4: break;
1347 case RC_CHKTEX_COMMAND:
1348 if (ignore_system_lyxrc ||
1349 chktex_command != system_lyxrc.chktex_command) {
1350 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1354 case RC_BIBTEX_COMMAND:
1355 if (ignore_system_lyxrc ||
1356 bibtex_command != system_lyxrc.bibtex_command) {
1357 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1361 case RC_JBIBTEX_COMMAND:
1362 if (ignore_system_lyxrc ||
1363 jbibtex_command != system_lyxrc.jbibtex_command) {
1364 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1368 case RC_INDEX_COMMAND:
1369 if (ignore_system_lyxrc ||
1370 index_command != system_lyxrc.index_command) {
1371 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1375 case RC_JINDEX_COMMAND:
1376 if (ignore_system_lyxrc ||
1377 jindex_command != system_lyxrc.jindex_command) {
1378 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1382 case RC_SPLITINDEX_COMMAND:
1383 if (ignore_system_lyxrc ||
1384 splitindex_command != system_lyxrc.splitindex_command) {
1385 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1389 case RC_NOMENCL_COMMAND:
1390 if (ignore_system_lyxrc ||
1391 nomencl_command != system_lyxrc.nomencl_command) {
1392 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1396 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1397 if (ignore_system_lyxrc ||
1398 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1399 os << "\\tex_expects_windows_paths "
1400 << convert<string>(windows_style_tex_paths) << '\n';
1404 case RC_TEX_ALLOWS_SPACES:
1405 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1406 os << "\\tex_allows_spaces "
1407 << convert<string>(tex_allows_spaces) << '\n';
1412 if (ignore_system_lyxrc ||
1413 use_kbmap != system_lyxrc.use_kbmap) {
1414 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1418 case RC_KBMAP_PRIMARY:
1419 if (ignore_system_lyxrc ||
1420 primary_kbmap != system_lyxrc.primary_kbmap) {
1421 string const path = os::external_path(primary_kbmap);
1422 os << "\\kbmap_primary \"" << path << "\"\n";
1426 case RC_KBMAP_SECONDARY:
1427 if (ignore_system_lyxrc ||
1428 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1429 string const path = os::external_path(secondary_kbmap);
1430 os << "\\kbmap_secondary \"" << path << "\"\n";
1435 if (ignore_system_lyxrc ||
1436 lyxpipes != system_lyxrc.lyxpipes) {
1437 string const path = os::external_path(lyxpipes);
1438 os << "\\serverpipe \"" << path << "\"\n";
1442 case RC_DATE_INSERT_FORMAT:
1443 if (ignore_system_lyxrc ||
1444 date_insert_format != system_lyxrc.date_insert_format) {
1445 os << "\\date_insert_format \"" << date_insert_format
1450 case RC_LABEL_INIT_LENGTH:
1451 if (ignore_system_lyxrc ||
1452 label_init_length != system_lyxrc.label_init_length) {
1453 os << "\\label_init_length " << label_init_length
1460 os << "\\user_name \"" << user_name << "\"\n";
1465 os << "\\user_email \"" << user_email << "\"\n";
1469 case RC_SHOW_BANNER:
1470 if (ignore_system_lyxrc ||
1471 show_banner != system_lyxrc.show_banner) {
1472 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1478 if (ignore_system_lyxrc ||
1479 preview != system_lyxrc.preview) {
1485 case PREVIEW_NO_MATH:
1492 os << "\\preview " << status << '\n';
1497 case RC_PREVIEW_HASHED_LABELS:
1498 if (ignore_system_lyxrc ||
1499 preview_hashed_labels !=
1500 system_lyxrc.preview_hashed_labels) {
1501 os << "\\preview_hashed_labels "
1502 << convert<string>(preview_hashed_labels) << '\n';
1507 case RC_PREVIEW_SCALE_FACTOR:
1508 if (ignore_system_lyxrc ||
1509 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1510 os << "\\preview_scale_factor "
1511 << preview_scale_factor << '\n';
1516 case RC_USE_CONVERTER_CACHE:
1517 if (ignore_system_lyxrc ||
1518 use_converter_cache != system_lyxrc.use_converter_cache) {
1519 os << "\\use_converter_cache "
1520 << convert<string>(use_converter_cache) << '\n';
1525 case RC_CONVERTER_CACHE_MAXAGE:
1526 if (ignore_system_lyxrc ||
1527 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1528 os << "\\converter_cache_maxage "
1529 << converter_cache_maxage << '\n';
1535 << "# SCREEN & FONTS SECTION ############################\n"
1539 if (ignore_system_lyxrc ||
1540 dpi != system_lyxrc.dpi) {
1541 os << "\\screen_dpi " << dpi << '\n';
1545 case RC_SCREEN_ZOOM:
1546 if (ignore_system_lyxrc ||
1547 zoom != system_lyxrc.zoom) {
1548 os << "\\screen_zoom " << zoom << '\n';
1552 case RC_GEOMETRY_SESSION:
1553 if (ignore_system_lyxrc ||
1554 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1555 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1560 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1561 if (ignore_system_lyxrc ||
1562 cursor_follows_scrollbar
1563 != system_lyxrc.cursor_follows_scrollbar) {
1564 os << "\\cursor_follows_scrollbar "
1565 << convert<string>(cursor_follows_scrollbar) << '\n';
1569 case RC_SCROLL_BELOW_DOCUMENT:
1570 if (ignore_system_lyxrc ||
1571 scroll_below_document
1572 != system_lyxrc.scroll_below_document) {
1573 os << "\\scroll_below_document "
1574 << convert<string>(scroll_below_document) << '\n';
1578 case RC_MAC_LIKE_WORD_MOVEMENT:
1579 if (ignore_system_lyxrc ||
1580 mac_like_word_movement
1581 != system_lyxrc.mac_like_word_movement) {
1582 os << "\\mac_like_word_movement "
1583 << convert<string>(mac_like_word_movement) << '\n';
1587 case RC_MACRO_EDIT_STYLE:
1588 if (ignore_system_lyxrc ||
1590 != system_lyxrc.macro_edit_style) {
1591 os << "\\macro_edit_style ";
1592 switch (macro_edit_style) {
1593 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1594 case MACRO_EDIT_INLINE: os << "1\n"; break;
1595 case MACRO_EDIT_LIST: os << "2\n"; break;
1600 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1601 if (ignore_system_lyxrc ||
1602 dialogs_iconify_with_main
1603 != system_lyxrc.dialogs_iconify_with_main) {
1604 os << "\\dialogs_iconify_with_main "
1605 << convert<string>(dialogs_iconify_with_main) << '\n';
1609 case RC_SCREEN_FONT_ROMAN:
1610 if (ignore_system_lyxrc ||
1611 roman_font_name != system_lyxrc.roman_font_name) {
1612 os << "\\screen_font_roman \"" << roman_font_name
1617 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1618 if (ignore_system_lyxrc ||
1619 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1620 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1625 case RC_SCREEN_FONT_SANS:
1626 if (ignore_system_lyxrc ||
1627 sans_font_name != system_lyxrc.sans_font_name) {
1628 os << "\\screen_font_sans \"" << sans_font_name
1633 case RC_SCREEN_FONT_SANS_FOUNDRY:
1634 if (ignore_system_lyxrc ||
1635 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1636 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1641 case RC_SCREEN_FONT_TYPEWRITER:
1642 if (ignore_system_lyxrc ||
1643 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1644 os << "\\screen_font_typewriter \""
1645 << typewriter_font_name << "\"\n";
1649 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1650 if (ignore_system_lyxrc ||
1651 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1652 os << "\\screen_font_typewriter_foundry \""
1653 << typewriter_font_foundry << "\"\n";
1658 case RC_SCREEN_FONT_SCALABLE:
1659 if (ignore_system_lyxrc ||
1660 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1661 os << "\\screen_font_scalable "
1662 << convert<string>(use_scalable_fonts)
1667 case RC_SCREEN_FONT_SIZES:
1668 if (ignore_system_lyxrc ||
1669 font_sizes[FONT_SIZE_TINY]
1670 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1671 font_sizes[FONT_SIZE_SCRIPT]
1672 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1673 font_sizes[FONT_SIZE_FOOTNOTE]
1674 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1675 font_sizes[FONT_SIZE_SMALL]
1676 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1677 font_sizes[FONT_SIZE_NORMAL]
1678 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1679 font_sizes[FONT_SIZE_LARGE]
1680 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1681 font_sizes[FONT_SIZE_LARGER]
1682 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1683 font_sizes[FONT_SIZE_LARGEST]
1684 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1685 font_sizes[FONT_SIZE_HUGE]
1686 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1687 font_sizes[FONT_SIZE_HUGER]
1688 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1689 os.setf(ios::fixed);
1691 os << "\\screen_font_sizes"
1692 << ' ' << font_sizes[FONT_SIZE_TINY]
1693 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1694 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1695 << ' ' << font_sizes[FONT_SIZE_SMALL]
1696 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1697 << ' ' << font_sizes[FONT_SIZE_LARGE]
1698 << ' ' << font_sizes[FONT_SIZE_LARGER]
1699 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1700 << ' ' << font_sizes[FONT_SIZE_HUGE]
1701 << ' ' << font_sizes[FONT_SIZE_HUGER]
1706 case RC_FULL_SCREEN_LIMIT:
1707 if (ignore_system_lyxrc ||
1708 full_screen_limit != system_lyxrc.full_screen_limit) {
1709 os << "\\fullscreen_limit "
1710 << convert<string>(full_screen_limit)
1715 case RC_FULL_SCREEN_TOOLBARS:
1716 if (ignore_system_lyxrc ||
1717 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1718 os << "\\fullscreen_toolbars "
1719 << convert<string>(full_screen_toolbars)
1724 case RC_FULL_SCREEN_SCROLLBAR:
1725 if (ignore_system_lyxrc ||
1726 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1727 os << "\\fullscreen_scrollbar "
1728 << convert<string>(full_screen_scrollbar)
1733 case RC_FULL_SCREEN_TABBAR:
1734 if (ignore_system_lyxrc ||
1735 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1736 os << "\\fullscreen_tabbar "
1737 << convert<string>(full_screen_tabbar)
1742 case RC_FULL_SCREEN_WIDTH:
1743 if (ignore_system_lyxrc ||
1744 full_screen_width != system_lyxrc.full_screen_width) {
1745 os << "\\fullscreen_width "
1746 << convert<string>(full_screen_width)
1751 case RC_OPEN_BUFFERS_IN_TABS:
1752 if (ignore_system_lyxrc ||
1753 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1754 os << "\\open_buffers_in_tabs "
1755 << convert<string>(open_buffers_in_tabs)
1762 << "# COLOR SECTION ###################################\n"
1766 for (int i = 0; i < Color_ignore; ++i) {
1767 ColorCode lc = static_cast<ColorCode>(i);
1768 string const col = lcolor.getX11Name(lc);
1769 if (ignore_system_lyxrc
1770 || col != system_lcolor.getX11Name(lc)) {
1771 os << "\\set_color \""
1772 << lcolor.getLyXName(lc) << "\" \""
1780 << "# PRINTER SECTION ###################################\n"
1784 if (ignore_system_lyxrc ||
1785 printer != system_lyxrc.printer) {
1786 os << "\\printer \"" << printer << "\"\n";
1790 case RC_PRINT_ADAPTOUTPUT:
1791 if (ignore_system_lyxrc ||
1792 print_adapt_output != system_lyxrc.print_adapt_output) {
1793 os << "\\print_adapt_output "
1794 << convert<string>(print_adapt_output)
1799 case RC_PRINT_COMMAND:
1800 if (ignore_system_lyxrc ||
1801 print_command != system_lyxrc.print_command) {
1802 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1806 case RC_PRINTEXSTRAOPTIONS:
1807 if (ignore_system_lyxrc ||
1808 print_extra_options != system_lyxrc.print_extra_options) {
1809 os << "\\print_extra_options \"" << print_extra_options
1814 case RC_PRINTSPOOL_COMMAND:
1815 if (ignore_system_lyxrc ||
1816 print_spool_command != system_lyxrc.print_spool_command) {
1817 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1822 case RC_PRINTSPOOL_PRINTERPREFIX:
1823 if (ignore_system_lyxrc ||
1824 print_spool_printerprefix
1825 != system_lyxrc.print_spool_printerprefix) {
1826 os << "\\print_spool_printerprefix \""
1827 << print_spool_printerprefix << "\"\n";
1831 case RC_PRINTEVENPAGEFLAG:
1832 if (ignore_system_lyxrc ||
1833 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1834 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1839 case RC_PRINTODDPAGEFLAG:
1840 if (ignore_system_lyxrc ||
1841 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1842 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1847 case RC_PRINTREVERSEFLAG:
1848 if (ignore_system_lyxrc ||
1849 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1850 os << "\\print_reverse_flag \"" << print_reverse_flag
1855 case RC_PRINTLANDSCAPEFLAG:
1856 if (ignore_system_lyxrc ||
1857 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1858 os << "\\print_landscape_flag \"" << print_landscape_flag
1863 case RC_PRINTPAGERANGEFLAG:
1864 if (ignore_system_lyxrc ||
1865 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1866 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1871 case RC_PRINTCOPIESFLAG:
1872 if (ignore_system_lyxrc ||
1873 print_copies_flag != system_lyxrc.print_copies_flag) {
1874 os << "\\print_copies_flag \"" << print_copies_flag
1879 case RC_PRINTCOLLCOPIESFLAG:
1880 if (ignore_system_lyxrc ||
1881 print_collcopies_flag
1882 != system_lyxrc.print_collcopies_flag) {
1883 os << "\\print_collcopies_flag \""
1884 << print_collcopies_flag
1889 case RC_PRINTPAPERFLAG:
1890 if (ignore_system_lyxrc ||
1891 print_paper_flag != system_lyxrc.print_paper_flag) {
1892 os << "\\print_paper_flag \"" << print_paper_flag
1897 case RC_PRINTPAPERDIMENSIONFLAG:
1898 if (ignore_system_lyxrc ||
1899 print_paper_dimension_flag
1900 != system_lyxrc.print_paper_dimension_flag) {
1901 os << "\\print_paper_dimension_flag \""
1902 << print_paper_dimension_flag << "\"\n";
1906 case RC_PRINTTOPRINTER:
1907 if (ignore_system_lyxrc ||
1908 print_to_printer != system_lyxrc.print_to_printer) {
1909 os << "\\print_to_printer \"" << print_to_printer
1914 case RC_PRINTTOFILE:
1915 if (ignore_system_lyxrc ||
1916 print_to_file != system_lyxrc.print_to_file) {
1917 string const path = os::external_path(print_to_file);
1918 os << "\\print_to_file \"" << path << "\"\n";
1922 case RC_PRINTFILEEXTENSION:
1923 if (ignore_system_lyxrc ||
1924 print_file_extension != system_lyxrc.print_file_extension) {
1925 os << "\\print_file_extension \""
1926 << print_file_extension
1933 << "# TEX SECTION #######################################\n"
1936 case RC_FONT_ENCODING:
1937 if (ignore_system_lyxrc ||
1938 fontenc != system_lyxrc.fontenc) {
1939 os << "\\font_encoding \"" << fontenc << "\"\n";
1945 << "# FILE SECTION ######################################\n"
1948 case RC_DOCUMENTPATH:
1949 if (ignore_system_lyxrc ||
1950 document_path != system_lyxrc.document_path) {
1951 string const path = os::external_path(document_path);
1952 os << "\\document_path \"" << path << "\"\n";
1956 case RC_USELASTFILEPOS:
1957 if (ignore_system_lyxrc ||
1958 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1959 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1964 case RC_LOADSESSION:
1965 if (ignore_system_lyxrc ||
1966 load_session != system_lyxrc.load_session) {
1967 os << "\\load_session " << convert<string>(load_session)
1972 case RC_MOUSE_WHEEL_SPEED:
1973 if (ignore_system_lyxrc ||
1974 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1975 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1979 case RC_COMPLETION_INLINE_DELAY:
1980 if (ignore_system_lyxrc ||
1981 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1982 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1986 case RC_COMPLETION_INLINE_MATH:
1987 if (ignore_system_lyxrc ||
1988 completion_inline_math != system_lyxrc.completion_inline_math) {
1989 os << "\\completion_inline_math "
1990 << convert<string>(completion_inline_math) << '\n';
1994 case RC_COMPLETION_INLINE_TEXT:
1995 if (ignore_system_lyxrc ||
1996 completion_inline_text != system_lyxrc.completion_inline_text) {
1997 os << "\\completion_inline_text "
1998 << convert<string>(completion_inline_text) << '\n';
2002 case RC_COMPLETION_INLINE_DOTS:
2003 if (ignore_system_lyxrc ||
2004 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2005 os << "\\completion_inline_dots "
2006 << convert<string>(completion_inline_dots) << '\n';
2010 case RC_AUTOCORRECTION_MATH:
2011 if (ignore_system_lyxrc ||
2012 autocorrection_math != system_lyxrc.autocorrection_math) {
2013 os << "\\autocorrection_math "
2014 << convert<string>(autocorrection_math) << '\n';
2018 case RC_COMPLETION_POPUP_DELAY:
2019 if (ignore_system_lyxrc ||
2020 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2021 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2025 case RC_COMPLETION_POPUP_MATH:
2026 if (ignore_system_lyxrc ||
2027 completion_popup_math != system_lyxrc.completion_popup_math) {
2028 os << "\\completion_popup_math "
2029 << convert<string>(completion_popup_math) << '\n';
2033 case RC_COMPLETION_POPUP_TEXT:
2034 if (ignore_system_lyxrc ||
2035 completion_popup_text != system_lyxrc.completion_popup_text) {
2036 os << "\\completion_popup_text "
2037 << convert<string>(completion_popup_text) << '\n';
2041 case RC_COMPLETION_CURSOR_TEXT:
2042 if (ignore_system_lyxrc ||
2043 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2044 os << "\\completion_cursor_text "
2045 << convert<string>(completion_cursor_text) << '\n';
2049 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2050 if (ignore_system_lyxrc ||
2051 completion_popup_after_complete
2052 != system_lyxrc.completion_popup_after_complete) {
2053 os << "\\completion_popup_after_complete "
2054 << convert<string>(completion_popup_after_complete) << '\n';
2058 case RC_NUMLASTFILES:
2059 if (ignore_system_lyxrc ||
2060 num_lastfiles != system_lyxrc.num_lastfiles) {
2061 os << "\\num_lastfiles " << num_lastfiles << '\n';
2065 case RC_CHECKLASTFILES:
2066 if (ignore_system_lyxrc ||
2067 check_lastfiles != system_lyxrc.check_lastfiles) {
2068 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2073 case RC_EXAMPLEPATH:
2074 if (ignore_system_lyxrc ||
2075 example_path != system_lyxrc.example_path) {
2076 string const path = os::external_path(example_path);
2077 os << "\\example_path \"" << path << "\"\n";
2081 case RC_TEMPLATEPATH:
2082 if (ignore_system_lyxrc ||
2083 template_path != system_lyxrc.template_path) {
2084 string const path = os::external_path(template_path);
2085 os << "\\template_path \"" << path << "\"\n";
2089 case RC_TEMPDIRPATH:
2090 if (ignore_system_lyxrc ||
2091 tempdir_path != system_lyxrc.tempdir_path) {
2092 string const path = os::external_path(tempdir_path);
2093 os << "\\tempdir_path \"" << path << "\"\n";
2097 case RC_THESAURUSDIRPATH:
2098 if (ignore_system_lyxrc ||
2099 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2100 string const path = os::external_path(thesaurusdir_path);
2101 os << "\\thesaurusdir_path \"" << path << "\"\n";
2109 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2112 case RC_PLAINTEXT_LINELEN:
2113 if (ignore_system_lyxrc ||
2114 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2115 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2119 case RC_MAKE_BACKUP:
2120 if (ignore_system_lyxrc ||
2121 make_backup != system_lyxrc.make_backup) {
2122 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2126 case RC_BACKUPDIR_PATH:
2127 if (ignore_system_lyxrc ||
2128 backupdir_path != system_lyxrc.backupdir_path) {
2129 string const path = os::external_path(backupdir_path);
2130 os << "\\backupdir_path \"" << path << "\"\n";
2136 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2140 << "# SPELLCHECKER SECTION ##############################\n"
2143 case RC_SPELL_COMMAND:
2144 case RC_USE_SPELL_LIB:
2148 case RC_ACCEPT_COMPOUND:
2149 if (ignore_system_lyxrc ||
2150 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2151 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2156 case RC_USE_ALT_LANG:
2157 if (ignore_system_lyxrc ||
2158 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2159 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2165 if (ignore_system_lyxrc ||
2166 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2167 os << "\\alternate_language \"" << spellchecker_alt_lang
2172 case RC_USE_ESC_CHARS:
2173 if (ignore_system_lyxrc ||
2174 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2175 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2181 if (ignore_system_lyxrc ||
2182 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2183 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2187 case RC_USE_PERS_DICT:
2188 if (ignore_system_lyxrc ||
2189 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2190 os << "\\use_personal_dictionary "
2191 << convert<string>(spellchecker_use_pers_dict)
2196 case RC_USE_TOOLTIP:
2197 if (ignore_system_lyxrc ||
2198 use_tooltip != system_lyxrc.use_tooltip) {
2199 os << "\\use_tooltip "
2200 << convert<string>(use_tooltip)
2203 case RC_USE_PIXMAP_CACHE:
2204 if (ignore_system_lyxrc ||
2205 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2206 os << "\\use_pixmap_cache "
2207 << convert<string>(use_pixmap_cache)
2211 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2212 string const path = os::external_path(spellchecker_pers_dict);
2213 os << "\\personal_dictionary \"" << path << "\"\n";
2217 case RC_USE_INP_ENC:
2218 if (ignore_system_lyxrc ||
2219 spellchecker_use_input_encoding
2220 != system_lyxrc.spellchecker_use_input_encoding) {
2221 os << "\\use_input_encoding "
2222 << convert<string>(spellchecker_use_input_encoding)
2229 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2232 case RC_SPELLCHECK_CONTINUOUSLY:
2233 if (ignore_system_lyxrc ||
2234 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2235 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2241 case RC_RTL_SUPPORT:
2242 if (ignore_system_lyxrc ||
2243 rtl_support != system_lyxrc.rtl_support) {
2244 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2248 case RC_VISUAL_CURSOR:
2249 if (ignore_system_lyxrc ||
2250 visual_cursor != system_lyxrc.visual_cursor) {
2251 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2255 case RC_LANGUAGE_PACKAGE:
2256 if (ignore_system_lyxrc ||
2257 language_package != system_lyxrc.language_package) {
2258 os << "\\language_package \"" << language_package
2263 case RC_LANGUAGE_GLOBAL_OPTIONS:
2264 if (ignore_system_lyxrc ||
2265 language_global_options
2266 != system_lyxrc.language_global_options) {
2267 os << "\\language_global_options \""
2268 << convert<string>(language_global_options)
2273 case RC_LANGUAGE_USE_BABEL:
2274 if (ignore_system_lyxrc ||
2275 language_use_babel != system_lyxrc.language_use_babel) {
2276 os << "\\language_use_babel \""
2277 << convert<string>(language_use_babel)
2282 case RC_LANGUAGE_COMMAND_BEGIN:
2283 if (ignore_system_lyxrc ||
2284 language_command_begin
2285 != system_lyxrc.language_command_begin) {
2286 os << "\\language_command_begin \""
2287 << language_command_begin
2292 case RC_LANGUAGE_COMMAND_END:
2293 if (ignore_system_lyxrc ||
2294 language_command_end
2295 != system_lyxrc.language_command_end) {
2296 os << "\\language_command_end \"" << language_command_end
2301 case RC_LANGUAGE_COMMAND_LOCAL:
2302 if (ignore_system_lyxrc ||
2303 language_command_local
2304 != system_lyxrc.language_command_local) {
2305 os << "\\language_command_local \""
2306 << language_command_local
2311 case RC_LANGUAGE_AUTO_BEGIN:
2312 if (ignore_system_lyxrc ||
2313 language_auto_begin != system_lyxrc.language_auto_begin) {
2314 os << "\\language_auto_begin "
2315 << convert<string>(language_auto_begin) << '\n';
2319 case RC_LANGUAGE_AUTO_END:
2320 if (ignore_system_lyxrc ||
2321 language_auto_end != system_lyxrc.language_auto_end) {
2322 os << "\\language_auto_end "
2323 << convert<string>(language_auto_end) << '\n';
2327 case RC_MARK_FOREIGN_LANGUAGE:
2328 if (ignore_system_lyxrc ||
2329 mark_foreign_language
2330 != system_lyxrc.mark_foreign_language) {
2331 os << "\\mark_foreign_language " <<
2332 convert<string>(mark_foreign_language) << '\n';
2338 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2341 case RC_AUTO_NUMBER:
2342 if (ignore_system_lyxrc ||
2343 auto_number != system_lyxrc.auto_number) {
2344 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2348 case RC_DEFAULT_LANGUAGE:
2349 if (ignore_system_lyxrc ||
2350 default_language != system_lyxrc.default_language) {
2351 os << "\\default_language " << default_language << '\n';
2355 case RC_GUI_LANGUAGE:
2356 if (ignore_system_lyxrc ||
2357 gui_language != system_lyxrc.gui_language) {
2358 os << "\\gui_language " << gui_language << '\n';
2364 << "# FORMATS SECTION ##########################\n"
2368 // New/modified formats
2369 for (Formats::const_iterator cit = formats.begin();
2370 cit != formats.end(); ++cit) {
2371 Format const * format =
2372 system_formats.getFormat(cit->name());
2374 format->extension() != cit->extension() ||
2375 format->prettyname() != cit->prettyname() ||
2376 format->shortcut() != cit->shortcut() ||
2377 format->viewer() != cit->viewer() ||
2378 format->editor() != cit->editor() ||
2379 format->documentFormat() != cit->documentFormat() ||
2380 format->vectorFormat() != cit->vectorFormat()) {
2381 os << "\\format \"" << cit->name() << "\" \""
2382 << cit->extension() << "\" \""
2383 << cit->prettyname() << "\" \""
2384 << cit->shortcut() << "\" \""
2385 << escapeCommand(cit->viewer()) << "\" \""
2386 << escapeCommand(cit->editor()) << "\" \"";
2387 vector<string> flags;
2388 if (cit->documentFormat())
2389 flags.push_back("document");
2390 if (cit->vectorFormat())
2391 flags.push_back("vector");
2392 os << getStringFromVector(flags);
2397 // Look for deleted formats
2398 for (Formats::const_iterator cit = system_formats.begin();
2399 cit != system_formats.end(); ++cit)
2400 if (!formats.getFormat(cit->name()))
2401 os << "\\format \"" << cit->name()
2402 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2405 case RC_DEFAULT_VIEW_FORMAT:
2406 if (ignore_system_lyxrc ||
2407 default_view_format != system_lyxrc.default_view_format) {
2408 os << "\\default_view_format " << default_view_format << '\n';
2418 << "# CONVERTERS SECTION ##########################\n"
2422 // Look for new converters
2423 for (Converters::const_iterator cit = theConverters().begin();
2424 cit != theConverters().end(); ++cit) {
2425 Converter const * converter =
2426 theSystemConverters().getConverter(cit->from,
2429 converter->command != cit->command ||
2430 converter->flags != cit->flags)
2431 os << "\\converter \"" << cit->from << "\" \""
2432 << cit->to << "\" \""
2433 << escapeCommand(cit->command) << "\" \""
2434 << cit->flags << "\"\n";
2437 // New/modifed converters
2438 for (Converters::const_iterator cit = theSystemConverters().begin();
2439 cit != theSystemConverters().end(); ++cit)
2440 if (!theConverters().getConverter(cit->from, cit->to))
2441 os << "\\converter \"" << cit->from
2442 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2449 << "# COPIERS SECTION ##########################\n"
2452 // Look for new movers
2453 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2454 Movers::const_iterator const sysend = theSystemMovers().end();
2455 Movers::const_iterator it = theMovers().begin();
2456 Movers::const_iterator end = theMovers().end();
2458 for (; it != end; ++it) {
2459 Movers::const_iterator const sysit =
2460 find_if(sysbegin, sysend, SameMover(*it));
2461 if (sysit == sysend) {
2462 string const & fmt = it->first;
2463 string const & command =
2464 it->second.command();
2466 os << "\\copier " << fmt
2467 << " \"" << escapeCommand(command) << "\"\n";
2473 // We don't actually delete SpecialisedMover(s) from the
2474 // map, just clear their 'command', so there's no need
2475 // to test for anything else.
2483 string const LyXRC::getDescription(LyXRCTags tag)
2488 case RC_ACCEPT_COMPOUND:
2489 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2493 case RC_USE_ALT_LANG:
2494 str = _("Specify an alternate language. The default is to use the language of the document.");
2497 case RC_PLAINTEXT_ROFF_COMMAND:
2498 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.");
2501 case RC_PLAINTEXT_LINELEN:
2502 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.");
2505 case RC_AUTOREGIONDELETE:
2506 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2509 case RC_AUTORESET_OPTIONS:
2510 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2514 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2517 case RC_AUTO_NUMBER:
2520 case RC_BACKUPDIR_PATH:
2521 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.");
2524 case RC_BIBTEX_COMMAND:
2525 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2528 case RC_JBIBTEX_COMMAND:
2529 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2533 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2536 case RC_CHECKLASTFILES:
2537 str = _("Select to check whether the lastfiles still exist.");
2540 case RC_CHKTEX_COMMAND:
2541 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2550 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2551 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.");
2554 case RC_SCROLL_BELOW_DOCUMENT:
2555 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");
2558 case RC_MAC_LIKE_WORD_MOVEMENT:
2559 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2562 case RC_SHOW_MACRO_LABEL:
2563 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2566 case RC_DATE_INSERT_FORMAT:
2567 //xgettext:no-c-format
2568 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2572 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2575 case RC_DEFAULT_VIEW_FORMAT:
2576 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2579 case RC_DEFAULT_LANGUAGE:
2580 str = _("New documents will be assigned this language.");
2583 case RC_DEFAULT_PAPERSIZE:
2584 str = _("Specify the default paper size.");
2587 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2588 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2591 case RC_DISPLAY_GRAPHICS:
2592 str = _("Select how LyX will display any graphics.");
2595 case RC_DOCUMENTPATH:
2596 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2600 case RC_USE_ESC_CHARS:
2601 str = _("Specify additional chars that can be part of a word.");
2604 case RC_EXAMPLEPATH:
2605 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2608 case RC_FONT_ENCODING:
2609 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2615 case RC_INDEX_COMMAND:
2616 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\".");
2619 case RC_JINDEX_COMMAND:
2620 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2623 case RC_NOMENCL_COMMAND:
2624 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2631 case RC_KBMAP_PRIMARY:
2632 case RC_KBMAP_SECONDARY:
2633 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.");
2636 case RC_LABEL_INIT_LENGTH:
2637 str = _("Maximum number of words in the initialization string for a new label");
2640 case RC_LANGUAGE_AUTO_BEGIN:
2641 str = _("Select if a language switching command is needed at the beginning of the document.");
2644 case RC_LANGUAGE_AUTO_END:
2645 str = _("Select if a language switching command is needed at the end of the document.");
2648 case RC_LANGUAGE_COMMAND_BEGIN:
2649 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.");
2652 case RC_LANGUAGE_COMMAND_END:
2653 str = _("The LaTeX command for changing back to the language of the document.");
2656 case RC_LANGUAGE_COMMAND_LOCAL:
2657 str = _("The LaTeX command for local changing of the language.");
2660 case RC_LANGUAGE_GLOBAL_OPTIONS:
2661 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2664 case RC_LANGUAGE_PACKAGE:
2665 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2668 case RC_LANGUAGE_USE_BABEL:
2669 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2672 case RC_USELASTFILEPOS:
2673 str = _("De-select if you do not want LyX to scroll to saved position.");
2676 case RC_LOADSESSION:
2677 str = _("De-select to prevent loading files opened from the last LyX session.");
2680 case RC_MAKE_BACKUP:
2681 str = _("De-select if you don't want LyX to create backup files.");
2684 case RC_MARK_FOREIGN_LANGUAGE:
2685 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2688 case RC_MOUSE_WHEEL_SPEED:
2689 str = bformat(_("The scrolling speed of the mouse wheel."),
2693 case RC_COMPLETION_POPUP_DELAY:
2694 str = _("The completion popup delay.");
2697 case RC_COMPLETION_POPUP_MATH:
2698 str = _("Select to display the completion popup in math mode.");
2701 case RC_COMPLETION_POPUP_TEXT:
2702 str = _("Select to display the completion popup in text mode.");
2705 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2706 str = _("Show the completion popup without delay after non-unique completion attempt.");
2709 case RC_COMPLETION_POPUP_TEXT:
2710 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2713 case RC_COMPLETION_POPUP_DELAY:
2714 str = _("The inline completion delay.");
2717 case RC_COMPLETION_INLINE_MATH:
2718 str = _("Select to display the inline completion in math mode.");
2721 case RC_COMPLETION_INLINE_TEXT:
2722 str = _("Select to display the inline completion in text mode.");
2725 case RC_COMPLETION_INLINE_DOTS:
2726 str = _("Use \"...\" to shorten long completions.");
2729 case RC_AUTOCORRECTION_MATH:
2730 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2733 case RC_NUMLASTFILES:
2734 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2738 case RC_PATH_PREFIX:
2739 str = _("Specify those directories which should be "
2740 "prepended to the PATH environment variable. "
2741 "Use the OS native format.");
2745 case RC_USE_PERS_DICT:
2746 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2750 str = _("Shows a typeset preview of things such as math");
2753 case RC_PREVIEW_HASHED_LABELS:
2754 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2757 case RC_PREVIEW_SCALE_FACTOR:
2758 str = _("Scale the preview size to suit.");
2761 case RC_PRINTCOLLCOPIESFLAG:
2762 str = _("The option for specifying whether the copies should be collated.");
2765 case RC_PRINTCOPIESFLAG:
2766 str = _("The option for specifying the number of copies to print.");
2770 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2773 case RC_PRINTEVENPAGEFLAG:
2774 str = _("The option to print only even pages.");
2777 case RC_PRINTEXSTRAOPTIONS:
2778 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2781 case RC_PRINTFILEEXTENSION:
2782 str = _("Extension of printer program output file. Usually \".ps\".");
2785 case RC_PRINTLANDSCAPEFLAG:
2786 str = _("The option to print out in landscape.");
2789 case RC_PRINTODDPAGEFLAG:
2790 str = _("The option to print only odd pages.");
2793 case RC_PRINTPAGERANGEFLAG:
2794 str = _("The option for specifying a comma-separated list of pages to print.");
2797 case RC_PRINTPAPERDIMENSIONFLAG:
2798 str = _("Option to specify the dimensions of the print paper.");
2801 case RC_PRINTPAPERFLAG:
2802 str = _("The option to specify paper type.");
2805 case RC_PRINTREVERSEFLAG:
2806 str = _("The option to reverse the order of the pages printed.");
2809 case RC_PRINTSPOOL_COMMAND:
2810 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.");
2813 case RC_PRINTSPOOL_PRINTERPREFIX:
2814 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.");
2817 case RC_PRINTTOFILE:
2818 str = _("Option to pass to the print program to print to a file.");
2821 case RC_PRINTTOPRINTER:
2822 str = _("Option to pass to the print program to print on a specific printer.");
2825 case RC_PRINT_ADAPTOUTPUT:
2826 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2829 case RC_PRINT_COMMAND:
2830 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2833 case RC_RTL_SUPPORT:
2834 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2837 case RC_VISUAL_CURSOR:
2838 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2842 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2845 case RC_SCREEN_FONT_ROMAN:
2846 case RC_SCREEN_FONT_SANS:
2847 case RC_SCREEN_FONT_TYPEWRITER:
2848 str = _("The screen fonts used to display the text while editing.");
2851 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2852 case RC_SCREEN_FONT_SANS_FOUNDRY:
2853 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2856 case RC_SCREEN_FONT_SCALABLE:
2857 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.");
2860 case RC_SCREEN_FONT_SIZES:
2861 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2864 case RC_SCREEN_ZOOM:
2865 //xgettext:no-c-format
2866 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2869 case RC_GEOMETRY_SESSION:
2870 str = _("Allow session manager to save and restore windows geometry.");
2874 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2880 case RC_SHOW_BANNER:
2881 str = _("De-select if you don't want the startup banner.");
2884 case RC_TEMPDIRPATH:
2885 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2888 case RC_THESAURUSDIRPATH:
2889 str = _("This is the place where the files of the thesaurus library reside.");
2892 case RC_TEMPLATEPATH:
2893 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2896 case RC_TEX_ALLOWS_SPACES:
2899 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2903 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2915 case RC_USE_INP_ENC:
2916 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.");
2919 case RC_USE_TOOLTIP:
2920 str = _("Enable the automatic appearance of tool tips in the work area.");
2923 case RC_USE_PIXMAP_CACHE:
2924 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2927 case RC_USE_SPELL_LIB:
2930 case RC_VIEWDVI_PAPEROPTION:
2931 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2946 // The global instance
2949 // The global copy of the system lyxrc entries (everything except preferences)