Prepare ANNOUNCE and NEWS for rc2
[lyx.git] / src / LyXRC.cpp
blob3f9366cb044a73234ca9c23ec226cdd0a97526e4
1 /**
2 * \file LyXRC.cpp
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
9 * \author John Levon
10 * \author André Pönitz
11 * \author Allan Rae
12 * \author Dekel Tsur
14 * Full author contact details are available in file CREDITS.
17 #include <config.h>
19 #include <fstream>
20 #include <iostream>
22 #include "LyXRC.h"
24 #include "Color.h"
25 #include "Converter.h"
26 #include "Format.h"
27 #include "Session.h"
28 #include "Lexer.h"
29 #include "FontEnums.h"
30 #include "Mover.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
43 using namespace std;
44 using namespace lyx::support;
46 namespace lyx {
48 namespace os = support::os;
50 namespace {
52 // when adding something to this array keep it sorted!
53 LexerKeyword lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
67 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
68 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
69 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
70 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
71 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
72 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
73 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
74 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
75 { "\\converter", LyXRC::RC_CONVERTER },
76 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
77 { "\\copier", LyXRC::RC_COPIER },
78 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
79 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
80 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
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 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
86 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
87 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
88 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
89 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
90 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
91 { "\\format", LyXRC::RC_FORMAT },
92 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
93 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
94 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
95 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
96 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
97 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
98 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
99 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
100 { "\\input", LyXRC::RC_INPUT },
101 { "\\kbmap", LyXRC::RC_KBMAP },
102 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
103 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
104 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
105 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
106 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
107 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
108 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
109 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
110 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
111 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
112 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
113 { "\\load_session", LyXRC::RC_LOADSESSION },
114 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
115 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
116 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
117 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
118 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
119 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
120 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
121 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
122 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
123 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
124 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
125 { "\\preview", LyXRC::RC_PREVIEW },
126 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
127 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
128 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
129 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
130 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
131 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
132 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
133 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
134 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
135 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
136 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
137 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
138 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
139 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
140 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
141 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
142 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
143 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
144 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
145 { "\\printer", LyXRC::RC_PRINTER },
146 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
147 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
148 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
149 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
150 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
151 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
152 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
153 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
154 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
155 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
156 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
157 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
158 { "\\set_color", LyXRC::RC_SET_COLOR },
159 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
160 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
161 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
162 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
163 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
164 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
165 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
166 { "\\ui_file", LyXRC::RC_UIFILE },
167 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
168 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
169 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
170 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
171 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
172 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
173 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
174 // compatibility with versions older than 1.4.0 only
175 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
176 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
177 // compatibility with versions older than 1.4.0 only
178 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
179 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
180 { "\\user_email", LyXRC::RC_USER_EMAIL },
181 { "\\user_name", LyXRC::RC_USER_NAME },
182 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
183 // compatibility with versions older than 1.4.0 only
184 { "\\viewer", LyXRC::RC_VIEWER},
185 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
188 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
190 } // namespace anon
193 LyXRC::LyXRC()
195 setDefaults();
199 void LyXRC::setDefaults()
201 bind_file = "cua";
202 def_file = "default";
203 ui_file = "default";
204 // Get printer from the environment. If fail, use default "",
205 // assuming that everything is set up correctly.
206 printer = getEnv("PRINTER");
207 print_adapt_output = false;
208 print_command = "dvips";
209 print_evenpage_flag = "-B";
210 print_oddpage_flag = "-A";
211 print_pagerange_flag = "-pp";
212 print_copies_flag = "-c";
213 print_collcopies_flag = "-C";
214 print_reverse_flag = "-r";
215 print_landscape_flag = "-t landscape";
216 print_to_printer = "-P";
217 print_to_file = "-o ";
218 print_file_extension = ".ps";
219 print_paper_flag = "-t";
220 print_paper_dimension_flag = "-T";
221 document_path.erase();
222 view_dvi_paper_option.erase();
223 default_papersize = PAPER_DEFAULT;
224 custom_export_format = "ps";
225 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
226 bibtex_command = "bibtex";
227 fontenc = "default";
228 index_command = "makeindex -c -q";
229 dpi = 75;
230 // Because a screen typically is wider than a piece of paper:
231 zoom = 150;
232 allow_geometry_session = true;
233 // Default LaTeX font size:
234 font_sizes[FONT_SIZE_TINY] = "5.0";
235 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
236 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
237 font_sizes[FONT_SIZE_SMALL] = "9.0";
238 font_sizes[FONT_SIZE_NORMAL] = "10.0";
239 font_sizes[FONT_SIZE_LARGE] = "12.0";
240 font_sizes[FONT_SIZE_LARGER] = "14.4";
241 font_sizes[FONT_SIZE_LARGEST] = "17.26";
242 font_sizes[FONT_SIZE_HUGE] = "20.74";
243 font_sizes[FONT_SIZE_HUGER] = "24.88";
244 use_scalable_fonts = true;
245 roman_font_name = "";
246 sans_font_name = "";
247 typewriter_font_name = "";
248 autosave = 300;
249 auto_region_delete = true;
250 auto_reset_options = false;
251 plaintext_linelen = 65;
252 mouse_wheel_speed = 1.0;
253 num_lastfiles = maxlastfiles;
254 check_lastfiles = true;
255 use_lastfilepos = true;
256 load_session = false;
257 make_backup = true;
258 backupdir_path.erase();
259 display_graphics = true;
260 // Spellchecker settings:
261 use_spell_lib = true;
262 isp_command = "ispell";
263 isp_accept_compound = false;
264 isp_use_input_encoding = false;
265 isp_use_alt_lang = false;
266 isp_use_pers_dict = false;
267 isp_use_esc_chars = false;
268 use_kbmap = false;
269 rtl_support = true;
270 visual_cursor = false;
271 auto_number = true;
272 mark_foreign_language = true;
273 language_auto_begin = true;
274 language_auto_end = true;
275 language_global_options = true;
276 language_use_babel = true;
277 language_package = "\\usepackage{babel}";
278 language_command_begin = "\\selectlanguage{$$lang}";
279 language_command_local = "\\foreignlanguage{$$lang}{";
280 sort_layouts = false;
281 group_layouts = true;
282 default_language = "english";
283 gui_language = "auto";
284 show_banner = true;
285 windows_style_tex_paths = false;
286 tex_allows_spaces = false;
287 date_insert_format = "%x";
288 cursor_follows_scrollbar = false;
289 mac_like_word_movement = false;
290 macro_edit_style = MACRO_EDIT_INLINE_BOX;
291 dialogs_iconify_with_main = false;
292 label_init_length = 3;
293 preview = PREVIEW_OFF;
294 preview_hashed_labels = false;
295 preview_scale_factor = "0.9";
296 use_converter_cache = true;
297 use_tooltip = true;
298 use_pixmap_cache = false;
299 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
300 user_name = to_utf8(support::user_name());
301 user_email = to_utf8(support::user_email());
302 open_buffers_in_tabs = true;
304 // Fullscreen settings
305 full_screen_limit = false;
306 full_screen_toolbars = true;
307 full_screen_tabbar = true;
308 full_screen_scrollbar = true;
309 full_screen_width = 700;
311 completion_cursor_text = true;
312 completion_popup_math = true;
313 completion_popup_text = false;
314 completion_popup_delay = 2.0;
315 completion_popup_after_complete = true;
316 completion_inline_math = true;
317 completion_inline_text = false;
318 completion_inline_dots = -1;
319 completion_inline_delay = 0.2;
323 namespace {
325 void oldFontFormat(string & family, string & foundry)
327 if (family.empty() || family[0] != '-')
328 return;
329 foundry = token(family, '-', 1);
330 family = token(family, '-', 2);
331 if (foundry == "*")
332 foundry.erase();
335 } // namespace anon
338 int LyXRC::read(FileName const & filename)
340 Lexer lexrc(lyxrcTags);
341 if (lyxerr.debugging(Debug::PARSER))
342 lexrc.printTable(lyxerr);
344 lexrc.setFile(filename);
345 if (!lexrc.isOK())
346 return -2;
348 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
350 return read(lexrc);
354 int LyXRC::read(istream & is)
356 Lexer lexrc(lyxrcTags);
357 if (lyxerr.debugging(Debug::PARSER))
358 lexrc.printTable(lyxerr);
360 lexrc.setStream(is);
361 if (!lexrc.isOK())
362 return -2;
364 LYXERR(Debug::LYXRC, "Reading istream...");
366 return read(lexrc);
370 int LyXRC::read(Lexer & lexrc)
372 if (!lexrc.isOK()) return -2;
374 while (lexrc.isOK()) {
375 // By using two switches we take advantage of the compiler
376 // telling us if we have missed a LyXRCTags element in
377 // the second switch.
378 // Note that this also shows a problem with Lexer since it
379 // helps us avoid taking advantage of the strictness of the
380 // compiler.
382 int le = lexrc.lex();
383 switch (le) {
384 case Lexer::LEX_UNDEF:
385 lexrc.printError("Unknown tag `$$Token'");
386 continue;
387 case Lexer::LEX_FEOF:
388 continue;
389 default: break;
391 switch (static_cast<LyXRCTags>(le)) {
392 case RC_INPUT: // Include file
393 if (lexrc.next()) {
394 FileName const tmp =
395 libFileSearch(string(),
396 lexrc.getString());
397 if (read(tmp)) {
398 lexrc.printError("Error reading "
399 "included file: " + tmp.absFilename());
402 break;
403 case RC_BINDFILE:
404 if (lexrc.next()) {
405 bind_file = os::internal_path(lexrc.getString());
407 break;
409 case RC_DEFFILE:
410 if (lexrc.next()) {
411 def_file = os::internal_path(lexrc.getString());
413 break;
415 case RC_UIFILE:
416 if (lexrc.next()) {
417 ui_file = os::internal_path(lexrc.getString());
419 break;
421 case RC_AUTORESET_OPTIONS:
422 lexrc >> auto_reset_options;
423 break;
425 case RC_DISPLAY_GRAPHICS:
426 if (lexrc.next())
427 display_graphics = lexrc.getString() == "true";
428 break;
430 case RC_TEX_EXPECTS_WINDOWS_PATHS:
431 lexrc >> windows_style_tex_paths;
432 break;
434 case RC_TEX_ALLOWS_SPACES:
435 lexrc >> tex_allows_spaces;
436 break;
438 case RC_KBMAP:
439 lexrc >> use_kbmap;
440 break;
442 case RC_KBMAP_PRIMARY:
443 if (lexrc.next()) {
444 string const kmap(os::internal_path(lexrc.getString()));
445 if (kmap.empty()) {
446 // nothing
447 } else if (!libFileSearch("kbd", kmap,
448 "kmap").empty()) {
449 primary_kbmap = kmap;
450 } else {
451 lexrc.printError("LyX: Keymap `$$Token' not found");
454 break;
456 case RC_KBMAP_SECONDARY:
457 if (lexrc.next()) {
458 string const kmap(os::internal_path(lexrc.getString()));
459 if (kmap.empty()) {
460 // nothing
461 } else if (!libFileSearch("kbd", kmap,
462 "kmap").empty()) {
463 secondary_kbmap = kmap;
464 } else {
465 lexrc.printError("LyX: Keymap `$$Token' not found");
468 break;
470 case RC_FONT_ENCODING:
471 lexrc >> fontenc;
472 break;
474 case RC_PRINTER:
475 lexrc >> printer;
476 break;
478 case RC_PRINT_COMMAND:
479 if (lexrc.next(true)) {
480 print_command = lexrc.getString();
482 break;
484 case RC_PRINTEVENPAGEFLAG:
485 lexrc >> print_evenpage_flag;
486 break;
488 case RC_PRINTODDPAGEFLAG:
489 lexrc >> print_oddpage_flag;
490 break;
492 case RC_PRINTPAGERANGEFLAG:
493 lexrc >> print_pagerange_flag;
494 break;
496 case RC_PRINTCOPIESFLAG:
497 lexrc >> print_copies_flag;
498 break;
500 case RC_PRINTCOLLCOPIESFLAG:
501 lexrc >> print_collcopies_flag;
502 break;
504 case RC_PRINTREVERSEFLAG:
505 lexrc >> print_reverse_flag;
506 break;
508 case RC_PRINTLANDSCAPEFLAG:
509 lexrc >> print_landscape_flag;
510 break;
512 case RC_PRINTTOPRINTER:
513 lexrc >> print_to_printer;
514 break;
516 case RC_PRINT_ADAPTOUTPUT:
517 lexrc >> print_adapt_output;
518 break;
520 case RC_PRINTTOFILE:
521 if (lexrc.next()) {
522 print_to_file = os::internal_path(lexrc.getString());
524 break;
526 case RC_PRINTFILEEXTENSION:
527 lexrc >> print_file_extension;
528 break;
530 case RC_PRINTEXSTRAOPTIONS:
531 lexrc >> print_extra_options;
532 break;
534 case RC_PRINTSPOOL_COMMAND:
535 if (lexrc.next(true)) {
536 print_spool_command = lexrc.getString();
538 break;
540 case RC_PRINTSPOOL_PRINTERPREFIX:
541 lexrc >> print_spool_printerprefix;
542 break;
544 case RC_PRINTPAPERDIMENSIONFLAG:
545 lexrc >> print_paper_dimension_flag;
546 break;
548 case RC_PRINTPAPERFLAG:
549 lexrc >> print_paper_flag;
550 break;
552 case RC_CUSTOM_EXPORT_COMMAND:
553 lexrc >> custom_export_command;
554 break;
556 case RC_CUSTOM_EXPORT_FORMAT:
557 lexrc >> custom_export_format;
558 break;
560 case RC_DEFAULT_PAPERSIZE:
561 if (lexrc.next()) {
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;
580 break;
582 case RC_VIEWDVI_PAPEROPTION:
583 if (lexrc.next())
584 view_dvi_paper_option = lexrc.getString();
585 else
586 view_dvi_paper_option.erase();
587 break;
589 case RC_CHKTEX_COMMAND:
590 if (lexrc.next(true)) {
591 chktex_command = lexrc.getString();
593 break;
595 case RC_BIBTEX_COMMAND:
596 if (lexrc.next(true)) {
597 bibtex_command = lexrc.getString();
599 break;
601 case RC_INDEX_COMMAND:
602 if (lexrc.next(true)) {
603 index_command = lexrc.getString();
605 break;
607 case RC_SCREEN_DPI:
608 lexrc >> dpi;
609 break;
611 case RC_SCREEN_ZOOM:
612 lexrc >> zoom;
613 break;
615 case RC_GEOMETRY_SESSION:
616 lexrc >> allow_geometry_session;
617 break;
619 case RC_SCREEN_FONT_SIZES:
620 lexrc >> font_sizes[FONT_SIZE_TINY];
621 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
622 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
623 lexrc >> font_sizes[FONT_SIZE_SMALL];
624 lexrc >> font_sizes[FONT_SIZE_NORMAL];
625 lexrc >> font_sizes[FONT_SIZE_LARGE];
626 lexrc >> font_sizes[FONT_SIZE_LARGER];
627 lexrc >> font_sizes[FONT_SIZE_LARGEST];
628 lexrc >> font_sizes[FONT_SIZE_HUGE];
629 lexrc >> font_sizes[FONT_SIZE_HUGER];
630 break;
632 case RC_SCREEN_FONT_SCALABLE:
633 lexrc >> use_scalable_fonts;
634 break;
636 case RC_AUTOSAVE:
637 lexrc >> autosave;
638 break;
640 case RC_DOCUMENTPATH:
641 if (lexrc.next()) {
642 document_path = os::internal_path(lexrc.getString());
643 document_path = expandPath(document_path);
645 break;
647 case RC_EXAMPLEPATH:
648 if (lexrc.next()) {
649 example_path = os::internal_path(lexrc.getString());
650 example_path = expandPath(example_path);
652 break;
654 case RC_TEMPLATEPATH:
655 if (lexrc.next()) {
656 template_path = os::internal_path(lexrc.getString());
657 template_path = expandPath(template_path);
659 break;
661 case RC_TEMPDIRPATH:
662 if (lexrc.next()) {
663 tempdir_path = os::internal_path(lexrc.getString());
664 tempdir_path = expandPath(tempdir_path);
666 break;
668 case RC_USETEMPDIR:
669 if (lexrc.next())
670 LYXERR0("Ignoring obsolete use_tempdir flag.");
671 break;
673 case RC_USELASTFILEPOS:
674 lexrc >> use_lastfilepos;
675 break;
677 case RC_LOADSESSION:
678 lexrc >> load_session;
679 break;
681 case RC_MOUSE_WHEEL_SPEED:
682 lexrc >> mouse_wheel_speed;
683 break;
685 case RC_COMPLETION_INLINE_DELAY:
686 lexrc >> completion_inline_delay;
687 break;
689 case RC_COMPLETION_INLINE_MATH:
690 lexrc >> completion_inline_math;
691 break;
693 case RC_COMPLETION_INLINE_TEXT:
694 lexrc >> completion_inline_text;
695 break;
697 case RC_COMPLETION_INLINE_DOTS:
698 lexrc >> completion_inline_dots;
699 break;
701 case RC_COMPLETION_POPUP_DELAY:
702 lexrc >> completion_popup_delay;
703 break;
705 case RC_COMPLETION_POPUP_MATH:
706 lexrc >> completion_popup_math;
707 break;
709 case RC_COMPLETION_POPUP_TEXT:
710 lexrc >> completion_popup_text;
711 break;
713 case RC_COMPLETION_CURSOR_TEXT:
714 lexrc >> completion_cursor_text;
715 break;
717 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
718 lexrc >> completion_popup_after_complete;
719 break;
721 case RC_NUMLASTFILES:
722 lexrc >> num_lastfiles;
723 break;
725 case RC_CHECKLASTFILES:
726 lexrc >> check_lastfiles;
727 break;
729 case RC_SCREEN_FONT_ROMAN:
730 if (lexrc.next()) {
731 roman_font_name = lexrc.getString();
732 oldFontFormat(roman_font_name,
733 roman_font_foundry);
735 break;
737 case RC_SCREEN_FONT_SANS:
738 if (lexrc.next()) {
739 sans_font_name = lexrc.getString();
740 oldFontFormat(sans_font_name, sans_font_foundry);
742 break;
744 case RC_SCREEN_FONT_TYPEWRITER:
745 if (lexrc.next()) {
746 typewriter_font_name = lexrc.getString();
747 oldFontFormat(typewriter_font_name,
748 typewriter_font_foundry);
750 break;
752 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
753 lexrc >> roman_font_foundry;
754 break;
756 case RC_SCREEN_FONT_SANS_FOUNDRY:
757 lexrc >> sans_font_foundry;
758 break;
760 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
761 lexrc >> typewriter_font_foundry;
762 break;
764 case RC_SET_COLOR: {
765 if (!lexrc.next()) {
766 lexrc.printError("Missing color tag.");
767 break;
769 string lyx_name = lexrc.getString();
771 if (!lexrc.next()) {
772 lexrc.printError("Missing color name for color: `$$Token'");
773 break;
775 string x11_name = lexrc.getString();
777 ColorCode const col =
778 lcolor.getFromLyXName(lyx_name);
779 if (col == Color_none ||
780 col == Color_inherit ||
781 col == Color_ignore)
782 break;
784 if (!lcolor.setColor(col, x11_name))
785 LYXERR0("Bad lyxrc set_color for " << lyx_name);
786 break;
789 case RC_AUTOREGIONDELETE:
790 // Auto region delete defaults to true
791 lexrc >> auto_region_delete;
792 break;
794 case RC_SERVERPIPE:
795 if (lexrc.next()) {
796 lyxpipes = os::internal_path(lexrc.getString());
797 lyxpipes = expandPath(lyxpipes);
799 break;
801 case RC_CURSOR_FOLLOWS_SCROLLBAR:
802 lexrc >> cursor_follows_scrollbar;
803 break;
805 case RC_MAC_LIKE_WORD_MOVEMENT:
806 lexrc >> mac_like_word_movement;
807 break;
809 case RC_MACRO_EDIT_STYLE:
810 if (lexrc.next()) {
811 switch (lexrc.getInteger()) {
812 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
813 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
814 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
817 break;
819 case RC_DIALOGS_ICONIFY_WITH_MAIN:
820 lexrc >> dialogs_iconify_with_main;
821 break;
823 case RC_PLAINTEXT_ROFF_COMMAND:
824 if (lexrc.next(true)) {
825 plaintext_roff_command = lexrc.getString();
827 break;
828 case RC_PLAINTEXT_LINELEN:
829 lexrc >> plaintext_linelen;
830 break;
831 // Spellchecker settings:
832 case RC_USE_SPELL_LIB:
833 lexrc >> use_spell_lib;
834 break;
835 case RC_SPELL_COMMAND:
836 if (lexrc.next(true))
837 isp_command = lexrc.getString();
838 break;
839 case RC_ACCEPT_COMPOUND:
840 lexrc >> isp_accept_compound;
841 break;
842 case RC_USE_INP_ENC:
843 lexrc >> isp_use_input_encoding;
844 break;
845 case RC_USE_ALT_LANG:
846 lexrc >> isp_use_alt_lang;
847 break;
848 case RC_USE_PERS_DICT:
849 lexrc >> isp_use_pers_dict;
850 break;
851 case RC_USE_TOOLTIP:
852 lexrc >> use_tooltip;
853 break;
854 case RC_USE_PIXMAP_CACHE:
855 lexrc >> use_pixmap_cache;
856 break;
857 case RC_USE_ESC_CHARS:
858 lexrc >> isp_use_esc_chars;
859 break;
860 case RC_ALT_LANG:
861 lexrc >> isp_alt_lang;
862 break;
863 case RC_PERS_DICT:
864 if (lexrc.next())
865 isp_pers_dict = os::internal_path(lexrc.getString());
866 break;
867 case RC_ESC_CHARS:
868 lexrc >> isp_esc_chars;
869 break;
870 case RC_MAKE_BACKUP:
871 lexrc >> make_backup;
872 break;
873 case RC_BACKUPDIR_PATH:
874 if (lexrc.next()) {
875 backupdir_path = os::internal_path(lexrc.getString());
876 backupdir_path = expandPath(backupdir_path);
878 break;
879 case RC_DATE_INSERT_FORMAT:
880 lexrc >> date_insert_format;
881 break;
882 case RC_LANGUAGE_PACKAGE:
883 lexrc >> language_package;
884 break;
885 case RC_LANGUAGE_AUTO_BEGIN:
886 lexrc >> language_auto_begin;
887 break;
888 case RC_LANGUAGE_AUTO_END:
889 lexrc >> language_auto_end;
890 break;
891 case RC_LANGUAGE_GLOBAL_OPTIONS:
892 lexrc >> language_global_options;
893 break;
894 case RC_LANGUAGE_USE_BABEL:
895 lexrc >> language_use_babel;
896 break;
897 case RC_LANGUAGE_COMMAND_BEGIN:
898 lexrc >> language_command_begin;
899 break;
900 case RC_LANGUAGE_COMMAND_END:
901 lexrc >> language_command_end;
902 break;
903 case RC_LANGUAGE_COMMAND_LOCAL:
904 lexrc >> language_command_local;
905 break;
906 case RC_RTL_SUPPORT:
907 lexrc >> rtl_support;
908 break;
909 case RC_VISUAL_CURSOR:
910 lexrc >> visual_cursor;
911 break;
912 case RC_AUTO_NUMBER:
913 lexrc >> auto_number;
914 break;
915 case RC_MARK_FOREIGN_LANGUAGE:
916 lexrc >> mark_foreign_language;
917 break;
919 case RC_COPIER: {
920 string fmt, command;
921 if (lexrc.next())
922 fmt = lexrc.getString();
923 if (lexrc.next(true))
924 command = lexrc.getString();
925 setMover(fmt, command);
926 break;
929 case RC_CONVERTER: {
930 string from, to, command, flags;
931 if (lexrc.next())
932 from = lexrc.getString();
933 if (lexrc.next())
934 to = lexrc.getString();
935 if (lexrc.next(true))
936 command = lexrc.getString();
937 if (lexrc.next())
938 flags = lexrc.getString();
939 if (command.empty())
940 theConverters().erase(from, to);
941 else
942 theConverters().add(from, to, command, flags);
943 break;
945 // compatibility with versions older than 1.4.0 only
946 case RC_VIEWER: {
947 string format, command;
948 lexrc >> format >> command;
949 formats.setViewer(format, command);
950 break;
952 case RC_FORMAT: {
953 string format, extension, prettyname, shortcut;
954 lexrc >> format >> extension >> prettyname >> shortcut;
955 string viewer, editor;
956 if (lexrc.next(true))
957 viewer = lexrc.getString();
958 if (lexrc.next(true))
959 editor = lexrc.getString();
960 string flags;
961 // Hack to ensure compatibility with versions older
962 // than 1.5.0
963 int le = lexrc.lex();
964 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
965 flags = lexrc.getString();
966 if (le != Lexer::LEX_DATA) {
967 // We have got a known token.
968 // Therefore this is an old style
969 // format definition without
970 // flags.
971 lexrc.pushToken(flags);
972 flags.erase();
975 int flgs = Format::none;
976 while (!flags.empty()) {
977 string flag;
978 flags = split(flags, flag, ',');
979 if (flag == "document")
980 flgs |= Format::document;
981 else if (flag == "vector")
982 flgs |= Format::vector;
983 else
984 LYXERR0("Ignoring unknown flag `"
985 << flag << "' for format `"
986 << format << "'.");
988 if (prettyname.empty()) {
989 if (theConverters().formatIsUsed(format))
990 LYXERR0("Can't delete format " << format);
991 else
992 formats.erase(format);
993 } else {
994 formats.add(format, extension, prettyname,
995 shortcut, viewer, editor, flgs);
997 break;
999 case RC_DEFAULT_LANGUAGE:
1000 lexrc >> default_language;
1001 break;
1003 case RC_GUI_LANGUAGE:
1004 lexrc >> gui_language;
1005 break;
1007 case RC_LABEL_INIT_LENGTH:
1008 lexrc >> label_init_length;
1009 break;
1011 case RC_SHOW_BANNER:
1012 lexrc >> show_banner;
1013 break;
1015 case RC_PREVIEW:
1016 if (lexrc.next()) {
1017 string const tmp = lexrc.getString();
1018 if (tmp == "true" || tmp == "on")
1019 preview = PREVIEW_ON;
1020 else if (tmp == "no_math")
1021 preview = PREVIEW_NO_MATH;
1022 else {
1023 preview = PREVIEW_OFF;
1024 if (tmp != "false" && tmp != "off")
1025 LYXERR0("Unrecognized preview status \""
1026 << tmp << '\n');
1029 break;
1031 case RC_PREVIEW_HASHED_LABELS:
1032 lexrc >> preview_hashed_labels;
1033 break;
1035 case RC_PREVIEW_SCALE_FACTOR:
1036 lexrc >> preview_scale_factor;
1037 break;
1039 case RC_USER_NAME:
1040 lexrc >> user_name;
1041 break;
1042 case RC_USER_EMAIL:
1043 lexrc >> user_email;
1044 break;
1046 case RC_PATH_PREFIX:
1047 lexrc >> path_prefix;
1048 break;
1050 case RC_USE_CONVERTER_CACHE:
1051 lexrc >> use_converter_cache;
1052 break;
1053 case RC_CONVERTER_CACHE_MAXAGE:
1054 lexrc >> converter_cache_maxage;
1055 break;
1057 case RC_SORT_LAYOUTS:
1058 lexrc >> sort_layouts;
1059 break;
1060 case RC_GROUP_LAYOUTS:
1061 lexrc >> group_layouts;
1062 break;
1063 case RC_FULL_SCREEN_LIMIT:
1064 lexrc >> full_screen_limit;
1065 break;
1066 case RC_FULL_SCREEN_TOOLBARS:
1067 lexrc >> full_screen_toolbars;
1068 break;
1069 case RC_FULL_SCREEN_SCROLLBAR:
1070 lexrc >> full_screen_scrollbar;
1071 break;
1072 case RC_FULL_SCREEN_TABBAR:
1073 lexrc >> full_screen_tabbar;
1074 break;
1075 case RC_FULL_SCREEN_WIDTH:
1076 lexrc >> full_screen_width;
1077 break;
1078 case RC_OPEN_BUFFERS_IN_TABS:
1079 lexrc >> open_buffers_in_tabs;
1080 break;
1082 case RC_LAST:
1083 break; // this is just a dummy
1087 /// Update converters data-structures
1088 theConverters().update(formats);
1089 theConverters().buildGraph();
1091 return 0;
1095 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1097 ofstream ofs(filename.toFilesystemEncoding().c_str());
1098 if (ofs)
1099 write(ofs, ignore_system_lyxrc);
1103 void LyXRC::print() const
1105 if (lyxerr.debugging())
1106 write(lyxerr, false);
1107 else
1108 write(cout, false);
1112 class SameMover {
1113 public:
1114 typedef pair<string, SpecialisedMover> Data;
1116 SameMover(Data const & comparison)
1117 : comparison_(comparison) {}
1119 bool operator()(Data const & data) const
1121 return data.first == comparison_.first &&
1122 data.second.command() == comparison_.second.command();
1125 private:
1126 Data comparison_;
1130 namespace {
1132 // Escape \ and " so that LyXLex can read the string later
1133 string escapeCommand(string const & str) {
1134 return subst(subst(str , "\\", "\\\\"),
1135 "\"", "\\\"");
1141 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1143 LyXRCTags tag = RC_LAST;
1145 if (!name.empty()) {
1146 for (int i = 0; i != lyxrcCount; ++i)
1147 if ("\\" + name == lyxrcTags[i].tag)
1148 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1151 if (tag == RC_LAST)
1152 os << "# This file is written by LyX, if you want to make your own\n"
1153 << "# modifications you should do them from inside LyX and save\n"
1154 << "\n";
1156 // Why the switch you might ask. It is a trick to ensure that all
1157 // the elements in the LyXRCTags enum are handled. As you can see
1158 // there are no breaks at all. So it is just a huge fall-through.
1159 // The nice thing is that we will get a warning from the compiler
1160 // if we forget an element.
1161 switch (tag) {
1162 case RC_LAST:
1163 case RC_INPUT:
1164 // input/include files are not done here
1165 case RC_BINDFILE:
1166 if (ignore_system_lyxrc ||
1167 bind_file != system_lyxrc.bind_file) {
1168 string const path = os::external_path(bind_file);
1169 os << "\\bind_file \"" << path << "\"\n";
1171 if (tag != RC_LAST)
1172 break;
1174 case RC_DEFFILE:
1175 if (ignore_system_lyxrc ||
1176 def_file != system_lyxrc.def_file) {
1177 string const path = os::external_path(def_file);
1178 os << "\\def_file \"" << path << "\"\n";
1180 if (tag != RC_LAST)
1181 break;
1184 // Misc Section
1186 os << "\n#\n"
1187 << "# MISC SECTION ######################################\n"
1188 << "#\n\n";
1189 // bind files are not done here.
1191 case RC_PATH_PREFIX:
1192 if (ignore_system_lyxrc ||
1193 path_prefix != system_lyxrc.path_prefix) {
1194 os << "\\path_prefix \"" << path_prefix << "\"\n";
1196 if (tag != RC_LAST)
1197 break;
1198 case RC_UIFILE:
1199 if (ignore_system_lyxrc ||
1200 ui_file != system_lyxrc.ui_file) {
1201 string const path = os::external_path(ui_file);
1202 os << "\\ui_file \"" << path << "\"\n";
1204 if (tag != RC_LAST)
1205 break;
1206 case RC_AUTOREGIONDELETE:
1207 if (ignore_system_lyxrc ||
1208 auto_region_delete != system_lyxrc.auto_region_delete) {
1209 os << "# Set to false to inhibit automatic replacement of\n"
1210 << "# the current selection.\n"
1211 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1212 << '\n';
1214 if (tag != RC_LAST)
1215 break;
1216 case RC_AUTORESET_OPTIONS:
1217 if (ignore_system_lyxrc ||
1218 auto_reset_options != system_lyxrc.auto_reset_options) {
1219 os << "# Set to false to inhibit automatic reset of\n"
1220 << "# the class options to defaults on class change.\n"
1221 << "\\auto_reset_options "
1222 << convert<string>(auto_reset_options)
1223 << '\n';
1225 if (tag != RC_LAST)
1226 break;
1227 case RC_AUTOSAVE:
1228 if (ignore_system_lyxrc ||
1229 autosave != system_lyxrc.autosave) {
1230 os << "# The time interval between auto-saves in seconds.\n"
1231 << "\\autosave " << autosave << '\n';
1233 if (tag != RC_LAST)
1234 break;
1235 case RC_DISPLAY_GRAPHICS:
1236 if (ignore_system_lyxrc ||
1237 display_graphics != system_lyxrc.display_graphics) {
1238 os << "# Display graphics within LyX\n"
1239 << "# true|false\n"
1240 << "\\display_graphics "
1241 << (display_graphics ? "true" : "false")
1242 << '\n';
1244 if (tag != RC_LAST)
1245 break;
1246 case RC_SORT_LAYOUTS:
1247 if (ignore_system_lyxrc ||
1248 sort_layouts != system_lyxrc.sort_layouts) {
1249 os << "# Sort layouts alphabetically.\n"
1250 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1252 if (tag != RC_LAST)
1253 break;
1254 case RC_GROUP_LAYOUTS:
1255 if (ignore_system_lyxrc ||
1256 group_layouts != system_lyxrc.group_layouts) {
1257 os << "# Group layouts by their category.\n"
1258 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1260 if (tag != RC_LAST)
1261 break;
1262 case RC_VIEWDVI_PAPEROPTION:
1263 if (ignore_system_lyxrc ||
1264 view_dvi_paper_option
1265 != system_lyxrc.view_dvi_paper_option) {
1266 os << "# Options used to specify paper size to the\n"
1267 << "# view_dvi_command (e.g. -paper)\n"
1268 << "\\view_dvi_paper_option \""
1269 << view_dvi_paper_option << "\"\n";
1271 if (tag != RC_LAST)
1272 break;
1273 case RC_DEFAULT_PAPERSIZE:
1274 if (ignore_system_lyxrc ||
1275 default_papersize != system_lyxrc.default_papersize) {
1276 os << "# The default papersize to use.\n"
1277 << "\\default_papersize \"";
1278 switch (default_papersize) {
1279 case PAPER_DEFAULT:
1280 os << "default"; break;
1281 case PAPER_USLETTER:
1282 os << "usletter"; break;
1283 case PAPER_USLEGAL:
1284 os << "legal"; break;
1285 case PAPER_USEXECUTIVE:
1286 os << "executive"; break;
1287 case PAPER_A3:
1288 os << "a3"; break;
1289 case PAPER_A4:
1290 os << "a4"; break;
1291 case PAPER_A5:
1292 os << "a5"; break;
1293 case PAPER_B5:
1294 os << "b5"; break;
1295 case PAPER_CUSTOM:
1296 case PAPER_B3:
1297 case PAPER_B4: break;
1299 os << "\"\n";
1301 if (tag != RC_LAST)
1302 break;
1303 case RC_CHKTEX_COMMAND:
1304 if (ignore_system_lyxrc ||
1305 chktex_command != system_lyxrc.chktex_command) {
1306 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1308 if (tag != RC_LAST)
1309 break;
1310 case RC_BIBTEX_COMMAND:
1311 if (ignore_system_lyxrc ||
1312 bibtex_command != system_lyxrc.bibtex_command) {
1313 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1315 if (tag != RC_LAST)
1316 break;
1317 case RC_INDEX_COMMAND:
1318 if (ignore_system_lyxrc ||
1319 index_command != system_lyxrc.index_command) {
1320 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1322 if (tag != RC_LAST)
1323 break;
1324 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1325 if (ignore_system_lyxrc ||
1326 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1327 os << "\\tex_expects_windows_paths "
1328 << convert<string>(windows_style_tex_paths) << '\n';
1330 if (tag != RC_LAST)
1331 break;
1332 case RC_TEX_ALLOWS_SPACES:
1333 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1334 os << "\\tex_allows_spaces "
1335 << convert<string>(tex_allows_spaces) << '\n';
1337 if (tag != RC_LAST)
1338 break;
1339 case RC_KBMAP:
1340 if (ignore_system_lyxrc ||
1341 use_kbmap != system_lyxrc.use_kbmap) {
1342 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1344 if (tag != RC_LAST)
1345 break;
1346 case RC_KBMAP_PRIMARY:
1347 if (ignore_system_lyxrc ||
1348 primary_kbmap != system_lyxrc.primary_kbmap) {
1349 string const path = os::external_path(primary_kbmap);
1350 os << "\\kbmap_primary \"" << path << "\"\n";
1352 if (tag != RC_LAST)
1353 break;
1354 case RC_KBMAP_SECONDARY:
1355 if (ignore_system_lyxrc ||
1356 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1357 string const path = os::external_path(secondary_kbmap);
1358 os << "\\kbmap_secondary \"" << path << "\"\n";
1360 if (tag != RC_LAST)
1361 break;
1362 case RC_SERVERPIPE:
1363 if (ignore_system_lyxrc ||
1364 lyxpipes != system_lyxrc.lyxpipes) {
1365 string const path = os::external_path(lyxpipes);
1366 os << "\\serverpipe \"" << path << "\"\n";
1368 if (tag != RC_LAST)
1369 break;
1370 case RC_DATE_INSERT_FORMAT:
1371 if (ignore_system_lyxrc ||
1372 date_insert_format != system_lyxrc.date_insert_format) {
1373 os << "\\date_insert_format \"" << date_insert_format
1374 << "\"\n";
1376 if (tag != RC_LAST)
1377 break;
1378 case RC_LABEL_INIT_LENGTH:
1379 if (ignore_system_lyxrc ||
1380 label_init_length != system_lyxrc.label_init_length) {
1381 os << "\\label_init_length " << label_init_length
1382 << '\n';
1384 if (tag != RC_LAST)
1385 break;
1387 case RC_USER_NAME:
1388 os << "\\user_name \"" << user_name << "\"\n";
1389 if (tag != RC_LAST)
1390 break;
1392 case RC_USER_EMAIL:
1393 os << "\\user_email \"" << user_email << "\"\n";
1394 if (tag != RC_LAST)
1395 break;
1397 case RC_SHOW_BANNER:
1398 if (ignore_system_lyxrc ||
1399 show_banner != system_lyxrc.show_banner) {
1400 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1402 if (tag != RC_LAST)
1403 break;
1405 case RC_PREVIEW:
1406 if (ignore_system_lyxrc ||
1407 preview != system_lyxrc.preview) {
1408 string status;
1409 switch (preview) {
1410 case PREVIEW_ON:
1411 status = "on";
1412 break;
1413 case PREVIEW_NO_MATH:
1414 status = "no_math";
1415 break;
1416 case PREVIEW_OFF:
1417 status = "off";
1418 break;
1420 os << "\\preview " << status << '\n';
1422 if (tag != RC_LAST)
1423 break;
1425 case RC_PREVIEW_HASHED_LABELS:
1426 if (ignore_system_lyxrc ||
1427 preview_hashed_labels !=
1428 system_lyxrc.preview_hashed_labels) {
1429 os << "\\preview_hashed_labels "
1430 << convert<string>(preview_hashed_labels) << '\n';
1432 if (tag != RC_LAST)
1433 break;
1435 case RC_PREVIEW_SCALE_FACTOR:
1436 if (ignore_system_lyxrc ||
1437 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1438 os << "\\preview_scale_factor "
1439 << preview_scale_factor << '\n';
1441 if (tag != RC_LAST)
1442 break;
1444 case RC_USE_CONVERTER_CACHE:
1445 if (ignore_system_lyxrc ||
1446 use_converter_cache != system_lyxrc.use_converter_cache) {
1447 os << "\\use_converter_cache "
1448 << convert<string>(use_converter_cache) << '\n';
1450 if (tag != RC_LAST)
1451 break;
1453 case RC_CONVERTER_CACHE_MAXAGE:
1454 if (ignore_system_lyxrc ||
1455 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1456 os << "\\converter_cache_maxage "
1457 << converter_cache_maxage << '\n';
1459 if (tag != RC_LAST)
1460 break;
1462 os << "\n#\n"
1463 << "# SCREEN & FONTS SECTION ############################\n"
1464 << "#\n\n";
1466 case RC_SCREEN_DPI:
1467 if (ignore_system_lyxrc ||
1468 dpi != system_lyxrc.dpi) {
1469 os << "\\screen_dpi " << dpi << '\n';
1471 if (tag != RC_LAST)
1472 break;
1473 case RC_SCREEN_ZOOM:
1474 if (ignore_system_lyxrc ||
1475 zoom != system_lyxrc.zoom) {
1476 os << "\\screen_zoom " << zoom << '\n';
1478 if (tag != RC_LAST)
1479 break;
1480 case RC_GEOMETRY_SESSION:
1481 if (ignore_system_lyxrc ||
1482 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1483 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1484 << '\n';
1486 if (tag != RC_LAST)
1487 break;
1488 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1489 if (ignore_system_lyxrc ||
1490 cursor_follows_scrollbar
1491 != system_lyxrc.cursor_follows_scrollbar) {
1492 os << "\\cursor_follows_scrollbar "
1493 << convert<string>(cursor_follows_scrollbar) << '\n';
1495 if (tag != RC_LAST)
1496 break;
1497 case RC_MAC_LIKE_WORD_MOVEMENT:
1498 if (ignore_system_lyxrc ||
1499 mac_like_word_movement
1500 != system_lyxrc.mac_like_word_movement) {
1501 os << "\\mac_like_word_movement "
1502 << convert<string>(mac_like_word_movement) << '\n';
1504 if (tag != RC_LAST)
1505 break;
1506 case RC_MACRO_EDIT_STYLE:
1507 if (ignore_system_lyxrc ||
1508 macro_edit_style
1509 != system_lyxrc.macro_edit_style) {
1510 os << "\\macro_edit_style ";
1511 switch (macro_edit_style) {
1512 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1513 case MACRO_EDIT_INLINE: os << "1\n"; break;
1514 case MACRO_EDIT_LIST: os << "2\n"; break;
1517 if (tag != RC_LAST)
1518 break;
1519 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1520 if (ignore_system_lyxrc ||
1521 dialogs_iconify_with_main
1522 != system_lyxrc.dialogs_iconify_with_main) {
1523 os << "\\dialogs_iconify_with_main "
1524 << convert<string>(dialogs_iconify_with_main) << '\n';
1526 if (tag != RC_LAST)
1527 break;
1528 case RC_SCREEN_FONT_ROMAN:
1529 if (ignore_system_lyxrc ||
1530 roman_font_name != system_lyxrc.roman_font_name) {
1531 os << "\\screen_font_roman \"" << roman_font_name
1532 << "\"\n";
1534 if (tag != RC_LAST)
1535 break;
1536 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1537 if (ignore_system_lyxrc ||
1538 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1539 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1540 << "\"\n";
1542 if (tag != RC_LAST)
1543 break;
1544 case RC_SCREEN_FONT_SANS:
1545 if (ignore_system_lyxrc ||
1546 sans_font_name != system_lyxrc.sans_font_name) {
1547 os << "\\screen_font_sans \"" << sans_font_name
1548 << "\"\n";
1550 if (tag != RC_LAST)
1551 break;
1552 case RC_SCREEN_FONT_SANS_FOUNDRY:
1553 if (ignore_system_lyxrc ||
1554 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1555 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1556 << "\"\n";
1558 if (tag != RC_LAST)
1559 break;
1560 case RC_SCREEN_FONT_TYPEWRITER:
1561 if (ignore_system_lyxrc ||
1562 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1563 os << "\\screen_font_typewriter \""
1564 << typewriter_font_name << "\"\n";
1566 if (tag != RC_LAST)
1567 break;
1568 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1569 if (ignore_system_lyxrc ||
1570 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1571 os << "\\screen_font_typewriter_foundry \""
1572 << typewriter_font_foundry << "\"\n";
1574 if (tag != RC_LAST)
1575 break;
1577 case RC_SCREEN_FONT_SCALABLE:
1578 if (ignore_system_lyxrc ||
1579 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1580 os << "\\screen_font_scalable "
1581 << convert<string>(use_scalable_fonts)
1582 << '\n';
1584 if (tag != RC_LAST)
1585 break;
1586 case RC_SCREEN_FONT_SIZES:
1587 if (ignore_system_lyxrc ||
1588 font_sizes[FONT_SIZE_TINY]
1589 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1590 font_sizes[FONT_SIZE_SCRIPT]
1591 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1592 font_sizes[FONT_SIZE_FOOTNOTE]
1593 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1594 font_sizes[FONT_SIZE_SMALL]
1595 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1596 font_sizes[FONT_SIZE_NORMAL]
1597 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1598 font_sizes[FONT_SIZE_LARGE]
1599 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1600 font_sizes[FONT_SIZE_LARGER]
1601 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1602 font_sizes[FONT_SIZE_LARGEST]
1603 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1604 font_sizes[FONT_SIZE_HUGE]
1605 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1606 font_sizes[FONT_SIZE_HUGER]
1607 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1608 os.setf(ios::fixed);
1609 os.precision(2);
1610 os << "\\screen_font_sizes"
1611 << ' ' << font_sizes[FONT_SIZE_TINY]
1612 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1613 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1614 << ' ' << font_sizes[FONT_SIZE_SMALL]
1615 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1616 << ' ' << font_sizes[FONT_SIZE_LARGE]
1617 << ' ' << font_sizes[FONT_SIZE_LARGER]
1618 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1619 << ' ' << font_sizes[FONT_SIZE_HUGE]
1620 << ' ' << font_sizes[FONT_SIZE_HUGER]
1621 << '\n';
1623 if (tag != RC_LAST)
1624 break;
1625 case RC_FULL_SCREEN_LIMIT:
1626 if (ignore_system_lyxrc ||
1627 full_screen_limit != system_lyxrc.full_screen_limit) {
1628 os << "\\fullscreen_limit "
1629 << convert<string>(full_screen_limit)
1630 << '\n';
1632 if (tag != RC_LAST)
1633 break;
1634 case RC_FULL_SCREEN_TOOLBARS:
1635 if (ignore_system_lyxrc ||
1636 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1637 os << "\\fullscreen_toolbars "
1638 << convert<string>(full_screen_toolbars)
1639 << '\n';
1641 if (tag != RC_LAST)
1642 break;
1643 case RC_FULL_SCREEN_SCROLLBAR:
1644 if (ignore_system_lyxrc ||
1645 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1646 os << "\\fullscreen_scrollbar "
1647 << convert<string>(full_screen_scrollbar)
1648 << '\n';
1650 if (tag != RC_LAST)
1651 break;
1652 case RC_FULL_SCREEN_TABBAR:
1653 if (ignore_system_lyxrc ||
1654 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1655 os << "\\fullscreen_tabbar "
1656 << convert<string>(full_screen_tabbar)
1657 << '\n';
1659 if (tag != RC_LAST)
1660 break;
1661 case RC_FULL_SCREEN_WIDTH:
1662 if (ignore_system_lyxrc ||
1663 full_screen_width != system_lyxrc.full_screen_width) {
1664 os << "\\fullscreen_width "
1665 << convert<string>(full_screen_width)
1666 << '\n';
1668 if (tag != RC_LAST)
1669 break;
1670 case RC_OPEN_BUFFERS_IN_TABS:
1671 if (ignore_system_lyxrc ||
1672 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1673 os << "\\open_buffers_in_tabs "
1674 << convert<string>(open_buffers_in_tabs)
1675 << '\n';
1677 if (tag != RC_LAST)
1678 break;
1680 os << "\n#\n"
1681 << "# COLOR SECTION ###################################\n"
1682 << "#\n\n";
1684 case RC_SET_COLOR:
1685 for (int i = 0; i < Color_ignore; ++i) {
1686 ColorCode lc = static_cast<ColorCode>(i);
1687 string const col = lcolor.getX11Name(lc);
1688 if (ignore_system_lyxrc
1689 || col != system_lcolor.getX11Name(lc)) {
1690 os << "\\set_color \""
1691 << lcolor.getLyXName(lc) << "\" \""
1692 << col << "\"\n";
1695 if (tag != RC_LAST)
1696 break;
1698 os << "\n#\n"
1699 << "# PRINTER SECTION ###################################\n"
1700 << "#\n\n";
1702 case RC_PRINTER:
1703 if (ignore_system_lyxrc ||
1704 printer != system_lyxrc.printer) {
1705 os << "\\printer \"" << printer << "\"\n";
1707 if (tag != RC_LAST)
1708 break;
1709 case RC_PRINT_ADAPTOUTPUT:
1710 if (ignore_system_lyxrc ||
1711 print_adapt_output != system_lyxrc.print_adapt_output) {
1712 os << "\\print_adapt_output "
1713 << convert<string>(print_adapt_output)
1714 << '\n';
1716 if (tag != RC_LAST)
1717 break;
1718 case RC_PRINT_COMMAND:
1719 if (ignore_system_lyxrc ||
1720 print_command != system_lyxrc.print_command) {
1721 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1723 if (tag != RC_LAST)
1724 break;
1725 case RC_PRINTEXSTRAOPTIONS:
1726 if (ignore_system_lyxrc ||
1727 print_extra_options != system_lyxrc.print_extra_options) {
1728 os << "\\print_extra_options \"" << print_extra_options
1729 << "\"\n";
1731 if (tag != RC_LAST)
1732 break;
1733 case RC_PRINTSPOOL_COMMAND:
1734 if (ignore_system_lyxrc ||
1735 print_spool_command != system_lyxrc.print_spool_command) {
1736 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1737 << "\"\n";
1739 if (tag != RC_LAST)
1740 break;
1741 case RC_PRINTSPOOL_PRINTERPREFIX:
1742 if (ignore_system_lyxrc ||
1743 print_spool_printerprefix
1744 != system_lyxrc.print_spool_printerprefix) {
1745 os << "\\print_spool_printerprefix \""
1746 << print_spool_printerprefix << "\"\n";
1748 if (tag != RC_LAST)
1749 break;
1750 case RC_PRINTEVENPAGEFLAG:
1751 if (ignore_system_lyxrc ||
1752 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1753 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1754 << "\"\n";
1756 if (tag != RC_LAST)
1757 break;
1758 case RC_PRINTODDPAGEFLAG:
1759 if (ignore_system_lyxrc ||
1760 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1761 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1762 << "\"\n";
1764 if (tag != RC_LAST)
1765 break;
1766 case RC_PRINTREVERSEFLAG:
1767 if (ignore_system_lyxrc ||
1768 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1769 os << "\\print_reverse_flag \"" << print_reverse_flag
1770 << "\"\n";
1772 if (tag != RC_LAST)
1773 break;
1774 case RC_PRINTLANDSCAPEFLAG:
1775 if (ignore_system_lyxrc ||
1776 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1777 os << "\\print_landscape_flag \"" << print_landscape_flag
1778 << "\"\n";
1780 if (tag != RC_LAST)
1781 break;
1782 case RC_PRINTPAGERANGEFLAG:
1783 if (ignore_system_lyxrc ||
1784 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1785 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1786 << "\"\n";
1788 if (tag != RC_LAST)
1789 break;
1790 case RC_PRINTCOPIESFLAG:
1791 if (ignore_system_lyxrc ||
1792 print_copies_flag != system_lyxrc.print_copies_flag) {
1793 os << "\\print_copies_flag \"" << print_copies_flag
1794 << "\"\n";
1796 if (tag != RC_LAST)
1797 break;
1798 case RC_PRINTCOLLCOPIESFLAG:
1799 if (ignore_system_lyxrc ||
1800 print_collcopies_flag
1801 != system_lyxrc.print_collcopies_flag) {
1802 os << "\\print_collcopies_flag \""
1803 << print_collcopies_flag
1804 << "\"\n";
1806 if (tag != RC_LAST)
1807 break;
1808 case RC_PRINTPAPERFLAG:
1809 if (ignore_system_lyxrc ||
1810 print_paper_flag != system_lyxrc.print_paper_flag) {
1811 os << "\\print_paper_flag \"" << print_paper_flag
1812 << "\"\n";
1814 if (tag != RC_LAST)
1815 break;
1816 case RC_PRINTPAPERDIMENSIONFLAG:
1817 if (ignore_system_lyxrc ||
1818 print_paper_dimension_flag
1819 != system_lyxrc.print_paper_dimension_flag) {
1820 os << "\\print_paper_dimension_flag \""
1821 << print_paper_dimension_flag << "\"\n";
1823 if (tag != RC_LAST)
1824 break;
1825 case RC_PRINTTOPRINTER:
1826 if (ignore_system_lyxrc ||
1827 print_to_printer != system_lyxrc.print_to_printer) {
1828 os << "\\print_to_printer \"" << print_to_printer
1829 << "\"\n";
1831 if (tag != RC_LAST)
1832 break;
1833 case RC_PRINTTOFILE:
1834 if (ignore_system_lyxrc ||
1835 print_to_file != system_lyxrc.print_to_file) {
1836 string const path = os::external_path(print_to_file);
1837 os << "\\print_to_file \"" << path << "\"\n";
1839 if (tag != RC_LAST)
1840 break;
1841 case RC_PRINTFILEEXTENSION:
1842 if (ignore_system_lyxrc ||
1843 print_file_extension != system_lyxrc.print_file_extension) {
1844 os << "\\print_file_extension \""
1845 << print_file_extension
1846 << "\"\n";
1848 if (tag != RC_LAST)
1849 break;
1851 os << "\n#\n"
1852 << "# EXPORT SECTION ####################################\n"
1853 << "#\n\n";
1855 case RC_CUSTOM_EXPORT_COMMAND:
1856 if (ignore_system_lyxrc ||
1857 custom_export_command
1858 != system_lyxrc.custom_export_command) {
1859 os << "\\custom_export_command \""
1860 << custom_export_command
1861 << "\"\n";
1863 if (tag != RC_LAST)
1864 break;
1865 case RC_CUSTOM_EXPORT_FORMAT:
1866 if (ignore_system_lyxrc ||
1867 custom_export_format
1868 != system_lyxrc.custom_export_format) {
1869 os << "\\custom_export_format \"" << custom_export_format
1870 << "\"\n";
1872 if (tag != RC_LAST)
1873 break;
1875 os << "\n#\n"
1876 << "# TEX SECTION #######################################\n"
1877 << "#\n\n";
1879 case RC_FONT_ENCODING:
1880 if (ignore_system_lyxrc ||
1881 fontenc != system_lyxrc.fontenc) {
1882 os << "\\font_encoding \"" << fontenc << "\"\n";
1884 if (tag != RC_LAST)
1885 break;
1887 os << "\n#\n"
1888 << "# FILE SECTION ######################################\n"
1889 << "#\n\n";
1891 case RC_DOCUMENTPATH:
1892 if (ignore_system_lyxrc ||
1893 document_path != system_lyxrc.document_path) {
1894 string const path = os::external_path(document_path);
1895 os << "\\document_path \"" << path << "\"\n";
1897 if (tag != RC_LAST)
1898 break;
1899 case RC_USELASTFILEPOS:
1900 if (ignore_system_lyxrc ||
1901 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1902 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1903 << '\n';
1905 if (tag != RC_LAST)
1906 break;
1907 case RC_LOADSESSION:
1908 if (ignore_system_lyxrc ||
1909 load_session != system_lyxrc.load_session) {
1910 os << "\\load_session " << convert<string>(load_session)
1911 << "\n";
1913 if (tag != RC_LAST)
1914 break;
1915 case RC_MOUSE_WHEEL_SPEED:
1916 if (ignore_system_lyxrc ||
1917 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1918 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1920 if (tag != RC_LAST)
1921 break;
1922 case RC_COMPLETION_INLINE_DELAY:
1923 if (ignore_system_lyxrc ||
1924 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1925 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1927 if (tag != RC_LAST)
1928 break;
1929 case RC_COMPLETION_INLINE_MATH:
1930 if (ignore_system_lyxrc ||
1931 completion_inline_math != system_lyxrc.completion_inline_math) {
1932 os << "\\completion_inline_math "
1933 << convert<string>(completion_inline_math) << '\n';
1935 if (tag != RC_LAST)
1936 break;
1937 case RC_COMPLETION_INLINE_TEXT:
1938 if (ignore_system_lyxrc ||
1939 completion_inline_text != system_lyxrc.completion_inline_text) {
1940 os << "\\completion_inline_text "
1941 << convert<string>(completion_inline_text) << '\n';
1943 if (tag != RC_LAST)
1944 break;
1945 case RC_COMPLETION_INLINE_DOTS:
1946 if (ignore_system_lyxrc ||
1947 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1948 os << "\\completion_inline_dots "
1949 << convert<string>(completion_inline_dots) << '\n';
1951 if (tag != RC_LAST)
1952 break;
1953 case RC_COMPLETION_POPUP_DELAY:
1954 if (ignore_system_lyxrc ||
1955 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1956 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1958 if (tag != RC_LAST)
1959 break;
1960 case RC_COMPLETION_POPUP_MATH:
1961 if (ignore_system_lyxrc ||
1962 completion_popup_math != system_lyxrc.completion_popup_math) {
1963 os << "\\completion_popup_math "
1964 << convert<string>(completion_popup_math) << '\n';
1966 if (tag != RC_LAST)
1967 break;
1968 case RC_COMPLETION_POPUP_TEXT:
1969 if (ignore_system_lyxrc ||
1970 completion_popup_text != system_lyxrc.completion_popup_text) {
1971 os << "\\completion_popup_text "
1972 << convert<string>(completion_popup_text) << '\n';
1974 if (tag != RC_LAST)
1975 break;
1976 case RC_COMPLETION_CURSOR_TEXT:
1977 if (ignore_system_lyxrc ||
1978 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1979 os << "\\completion_cursor_text "
1980 << convert<string>(completion_cursor_text) << '\n';
1982 if (tag != RC_LAST)
1983 break;
1984 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
1985 if (ignore_system_lyxrc ||
1986 completion_popup_after_complete
1987 != system_lyxrc.completion_popup_after_complete) {
1988 os << "\\completion_popup_after_complete "
1989 << convert<string>(completion_popup_after_complete) << '\n';
1991 if (tag != RC_LAST)
1992 break;
1993 case RC_NUMLASTFILES:
1994 if (ignore_system_lyxrc ||
1995 num_lastfiles != system_lyxrc.num_lastfiles) {
1996 os << "\\num_lastfiles " << num_lastfiles << '\n';
1998 if (tag != RC_LAST)
1999 break;
2000 case RC_CHECKLASTFILES:
2001 if (ignore_system_lyxrc ||
2002 check_lastfiles != system_lyxrc.check_lastfiles) {
2003 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2004 << '\n';
2006 if (tag != RC_LAST)
2007 break;
2008 case RC_EXAMPLEPATH:
2009 if (ignore_system_lyxrc ||
2010 example_path != system_lyxrc.example_path) {
2011 string const path = os::external_path(example_path);
2012 os << "\\example_path \"" << path << "\"\n";
2014 if (tag != RC_LAST)
2015 break;
2016 case RC_TEMPLATEPATH:
2017 if (ignore_system_lyxrc ||
2018 template_path != system_lyxrc.template_path) {
2019 string const path = os::external_path(template_path);
2020 os << "\\template_path \"" << path << "\"\n";
2022 if (tag != RC_LAST)
2023 break;
2024 case RC_TEMPDIRPATH:
2025 if (ignore_system_lyxrc ||
2026 tempdir_path != system_lyxrc.tempdir_path) {
2027 string const path = os::external_path(tempdir_path);
2028 os << "\\tempdir_path \"" << path << "\"\n";
2030 if (tag != RC_LAST)
2031 break;
2032 case RC_USETEMPDIR:
2033 if (tag != RC_LAST)
2034 break;
2035 // Ignore it
2036 case RC_PLAINTEXT_LINELEN:
2037 if (ignore_system_lyxrc ||
2038 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2039 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2041 if (tag != RC_LAST)
2042 break;
2043 case RC_MAKE_BACKUP:
2044 if (ignore_system_lyxrc ||
2045 make_backup != system_lyxrc.make_backup) {
2046 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2048 if (tag != RC_LAST)
2049 break;
2050 case RC_BACKUPDIR_PATH:
2051 if (ignore_system_lyxrc ||
2052 backupdir_path != system_lyxrc.backupdir_path) {
2053 string const path = os::external_path(backupdir_path);
2054 os << "\\backupdir_path \"" << path << "\"\n";
2056 if (tag != RC_LAST)
2057 break;
2059 os << "\n#\n"
2060 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2061 << "#\n\n";
2063 case RC_PLAINTEXT_ROFF_COMMAND:
2064 if (ignore_system_lyxrc ||
2065 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2066 os << "\\plaintext_roff_command \"" << escapeCommand(plaintext_roff_command)
2067 << "\"\n";
2069 if (tag != RC_LAST)
2070 break;
2072 os << "\n#\n"
2073 << "# SPELLCHECKER SECTION ##############################\n"
2074 << "#\n\n";
2075 case RC_USE_SPELL_LIB:
2076 if (ignore_system_lyxrc ||
2077 use_spell_lib != system_lyxrc.use_spell_lib) {
2078 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2080 if (tag != RC_LAST)
2081 break;
2082 case RC_SPELL_COMMAND:
2083 if (ignore_system_lyxrc ||
2084 isp_command != system_lyxrc.isp_command) {
2085 os << "\\spell_command \"" << escapeCommand(isp_command) << "\"\n";
2087 if (tag != RC_LAST)
2088 break;
2089 case RC_ACCEPT_COMPOUND:
2090 if (ignore_system_lyxrc ||
2091 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2092 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2093 << '\n';
2095 if (tag != RC_LAST)
2096 break;
2097 case RC_USE_ALT_LANG:
2098 if (ignore_system_lyxrc ||
2099 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2100 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2101 << '\n';
2103 if (tag != RC_LAST)
2104 break;
2105 case RC_ALT_LANG:
2106 if (ignore_system_lyxrc ||
2107 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2108 os << "\\alternate_language \"" << isp_alt_lang
2109 << "\"\n";
2111 if (tag != RC_LAST)
2112 break;
2113 case RC_USE_ESC_CHARS:
2114 if (ignore_system_lyxrc ||
2115 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2116 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2117 << '\n';
2119 if (tag != RC_LAST)
2120 break;
2121 case RC_ESC_CHARS:
2122 if (ignore_system_lyxrc ||
2123 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2124 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2126 if (tag != RC_LAST)
2127 break;
2128 case RC_USE_PERS_DICT:
2129 if (ignore_system_lyxrc ||
2130 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2131 os << "\\use_personal_dictionary "
2132 << convert<string>(isp_use_pers_dict)
2133 << '\n';
2135 if (tag != RC_LAST)
2136 break;
2137 case RC_USE_TOOLTIP:
2138 if (ignore_system_lyxrc ||
2139 use_tooltip != system_lyxrc.use_tooltip) {
2140 os << "\\use_tooltip "
2141 << convert<string>(use_tooltip)
2142 << '\n';
2144 case RC_USE_PIXMAP_CACHE:
2145 if (ignore_system_lyxrc ||
2146 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2147 os << "\\use_pixmap_cache "
2148 << convert<string>(use_pixmap_cache)
2149 << '\n';
2151 case RC_PERS_DICT:
2152 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2153 string const path = os::external_path(isp_pers_dict);
2154 os << "\\personal_dictionary \"" << path << "\"\n";
2156 if (tag != RC_LAST)
2157 break;
2158 case RC_USE_INP_ENC:
2159 if (ignore_system_lyxrc ||
2160 isp_use_input_encoding
2161 != system_lyxrc.isp_use_input_encoding) {
2162 os << "\\use_input_encoding "
2163 << convert<string>(isp_use_input_encoding)
2164 << '\n';
2166 if (tag != RC_LAST)
2167 break;
2169 os << "\n#\n"
2170 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2171 << "#\n\n";
2173 case RC_RTL_SUPPORT:
2174 if (ignore_system_lyxrc ||
2175 rtl_support != system_lyxrc.rtl_support) {
2176 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2178 if (tag != RC_LAST)
2179 break;
2180 case RC_VISUAL_CURSOR:
2181 if (ignore_system_lyxrc ||
2182 visual_cursor != system_lyxrc.visual_cursor) {
2183 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2185 if (tag != RC_LAST)
2186 break;
2187 case RC_LANGUAGE_PACKAGE:
2188 if (ignore_system_lyxrc ||
2189 language_package != system_lyxrc.language_package) {
2190 os << "\\language_package \"" << language_package
2191 << "\"\n";
2193 if (tag != RC_LAST)
2194 break;
2195 case RC_LANGUAGE_GLOBAL_OPTIONS:
2196 if (ignore_system_lyxrc ||
2197 language_global_options
2198 != system_lyxrc.language_global_options) {
2199 os << "\\language_global_options \""
2200 << convert<string>(language_global_options)
2201 << "\"\n";
2203 if (tag != RC_LAST)
2204 break;
2205 case RC_LANGUAGE_USE_BABEL:
2206 if (ignore_system_lyxrc ||
2207 language_use_babel != system_lyxrc.language_use_babel) {
2208 os << "\\language_use_babel \""
2209 << convert<string>(language_use_babel)
2210 << "\"\n";
2212 if (tag != RC_LAST)
2213 break;
2214 case RC_LANGUAGE_COMMAND_BEGIN:
2215 if (ignore_system_lyxrc ||
2216 language_command_begin
2217 != system_lyxrc.language_command_begin) {
2218 os << "\\language_command_begin \""
2219 << language_command_begin
2220 << "\"\n";
2222 if (tag != RC_LAST)
2223 break;
2224 case RC_LANGUAGE_COMMAND_END:
2225 if (ignore_system_lyxrc ||
2226 language_command_end
2227 != system_lyxrc.language_command_end) {
2228 os << "\\language_command_end \"" << language_command_end
2229 << "\"\n";
2231 if (tag != RC_LAST)
2232 break;
2233 case RC_LANGUAGE_COMMAND_LOCAL:
2234 if (ignore_system_lyxrc ||
2235 language_command_local
2236 != system_lyxrc.language_command_local) {
2237 os << "\\language_command_local \""
2238 << language_command_local
2239 << "\"\n";
2241 if (tag != RC_LAST)
2242 break;
2243 case RC_LANGUAGE_AUTO_BEGIN:
2244 if (ignore_system_lyxrc ||
2245 language_auto_begin != system_lyxrc.language_auto_begin) {
2246 os << "\\language_auto_begin "
2247 << convert<string>(language_auto_begin) << '\n';
2249 if (tag != RC_LAST)
2250 break;
2251 case RC_LANGUAGE_AUTO_END:
2252 if (ignore_system_lyxrc ||
2253 language_auto_end != system_lyxrc.language_auto_end) {
2254 os << "\\language_auto_end "
2255 << convert<string>(language_auto_end) << '\n';
2257 if (tag != RC_LAST)
2258 break;
2259 case RC_MARK_FOREIGN_LANGUAGE:
2260 if (ignore_system_lyxrc ||
2261 mark_foreign_language
2262 != system_lyxrc.mark_foreign_language) {
2263 os << "\\mark_foreign_language " <<
2264 convert<string>(mark_foreign_language) << '\n';
2266 if (tag != RC_LAST)
2267 break;
2269 os << "\n#\n"
2270 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2271 << "#\n\n";
2273 case RC_AUTO_NUMBER:
2274 if (ignore_system_lyxrc ||
2275 auto_number != system_lyxrc.auto_number) {
2276 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2278 if (tag != RC_LAST)
2279 break;
2280 case RC_DEFAULT_LANGUAGE:
2281 if (ignore_system_lyxrc ||
2282 default_language != system_lyxrc.default_language) {
2283 os << "\\default_language " << default_language << '\n';
2285 if (tag != RC_LAST)
2286 break;
2287 case RC_GUI_LANGUAGE:
2288 if (ignore_system_lyxrc ||
2289 gui_language != system_lyxrc.gui_language) {
2290 os << "\\gui_language " << gui_language << '\n';
2292 if (tag != RC_LAST)
2293 break;
2295 os << "\n#\n"
2296 << "# FORMATS SECTION ##########################\n"
2297 << "#\n\n";
2299 case RC_FORMAT:
2300 // New/modified formats
2301 for (Formats::const_iterator cit = formats.begin();
2302 cit != formats.end(); ++cit) {
2303 Format const * format =
2304 system_formats.getFormat(cit->name());
2305 if (!format ||
2306 format->extension() != cit->extension() ||
2307 format->prettyname() != cit->prettyname() ||
2308 format->shortcut() != cit->shortcut() ||
2309 format->viewer() != cit->viewer() ||
2310 format->editor() != cit->editor() ||
2311 format->documentFormat() != cit->documentFormat() ||
2312 format->vectorFormat() != cit->vectorFormat()) {
2313 os << "\\format \"" << cit->name() << "\" \""
2314 << cit->extension() << "\" \""
2315 << cit->prettyname() << "\" \""
2316 << cit->shortcut() << "\" \""
2317 << escapeCommand(cit->viewer()) << "\" \""
2318 << escapeCommand(cit->editor()) << "\" \"";
2319 vector<string> flags;
2320 if (cit->documentFormat())
2321 flags.push_back("document");
2322 if (cit->vectorFormat())
2323 flags.push_back("vector");
2324 os << getStringFromVector(flags);
2325 os << "\"\n";
2329 // Look for deleted formats
2330 for (Formats::const_iterator cit = system_formats.begin();
2331 cit != system_formats.end(); ++cit)
2332 if (!formats.getFormat(cit->name()))
2333 os << "\\format \"" << cit->name()
2334 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2335 if (tag != RC_LAST)
2336 break;
2337 case RC_VIEWER:
2338 // Ignore it
2339 if (tag != RC_LAST)
2340 break;
2342 os << "\n#\n"
2343 << "# CONVERTERS SECTION ##########################\n"
2344 << "#\n\n";
2346 case RC_CONVERTER:
2347 // Look for new converters
2348 for (Converters::const_iterator cit = theConverters().begin();
2349 cit != theConverters().end(); ++cit) {
2350 Converter const * converter =
2351 theSystemConverters().getConverter(cit->from,
2352 cit->to);
2353 if (!converter ||
2354 converter->command != cit->command ||
2355 converter->flags != cit->flags)
2356 os << "\\converter \"" << cit->from << "\" \""
2357 << cit->to << "\" \""
2358 << escapeCommand(cit->command) << "\" \""
2359 << cit->flags << "\"\n";
2362 // New/modifed converters
2363 for (Converters::const_iterator cit = theSystemConverters().begin();
2364 cit != theSystemConverters().end(); ++cit)
2365 if (!theConverters().getConverter(cit->from, cit->to))
2366 os << "\\converter \"" << cit->from
2367 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2368 if (tag != RC_LAST)
2369 break;
2371 case RC_COPIER:
2372 if (tag == RC_LAST)
2373 os << "\n#\n"
2374 << "# COPIERS SECTION ##########################\n"
2375 << "#\n\n";
2377 // Look for new movers
2378 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2379 Movers::const_iterator const sysend = theSystemMovers().end();
2380 Movers::const_iterator it = theMovers().begin();
2381 Movers::const_iterator end = theMovers().end();
2383 for (; it != end; ++it) {
2384 Movers::const_iterator const sysit =
2385 find_if(sysbegin, sysend, SameMover(*it));
2386 if (sysit == sysend) {
2387 string const & fmt = it->first;
2388 string const & command =
2389 it->second.command();
2391 os << "\\copier " << fmt
2392 << " \"" << escapeCommand(command) << "\"\n";
2395 if (tag != RC_LAST)
2396 break;
2398 // We don't actually delete SpecialisedMover(s) from the
2399 // map, just clear their 'command', so there's no need
2400 // to test for anything else.
2403 os.flush();
2407 #if 0
2408 string const LyXRC::getDescription(LyXRCTags tag)
2410 docstring str;
2412 switch (tag) {
2413 case RC_ACCEPT_COMPOUND:
2414 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2415 break;
2417 case RC_ALT_LANG:
2418 case RC_USE_ALT_LANG:
2419 str = _("Specify an alternate language. The default is to use the language of the document.");
2420 break;
2422 case RC_PLAINTEXT_ROFF_COMMAND:
2423 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.");
2424 break;
2426 case RC_PLAINTEXT_LINELEN:
2427 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.");
2428 break;
2430 case RC_AUTOREGIONDELETE:
2431 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2432 break;
2434 case RC_AUTORESET_OPTIONS:
2435 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2436 break;
2438 case RC_AUTOSAVE:
2439 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2440 break;
2442 case RC_AUTO_NUMBER:
2443 break;
2445 case RC_BACKUPDIR_PATH:
2446 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.");
2447 break;
2449 case RC_BIBTEX_COMMAND:
2450 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2451 break;
2453 case RC_BINDFILE:
2454 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2455 break;
2457 case RC_CHECKLASTFILES:
2458 str = _("Select to check whether the lastfiles still exist.");
2459 break;
2461 case RC_CHKTEX_COMMAND:
2462 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2463 break;
2465 case RC_CONVERTER:
2466 break;
2468 case RC_COPIER:
2469 break;
2471 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2472 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.");
2473 break;
2475 case RC_MAC_LIKE_WORD_MOVEMENT:
2476 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2477 break;
2479 case RC_SHOW_MACRO_LABEL:
2480 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2481 break;
2483 case RC_CUSTOM_EXPORT_COMMAND:
2484 break;
2486 case RC_CUSTOM_EXPORT_FORMAT:
2487 break;
2489 case RC_DATE_INSERT_FORMAT:
2490 //xgettext:no-c-format
2491 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2492 break;
2494 case RC_DEFFILE:
2495 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2496 break;
2498 case RC_DEFAULT_LANGUAGE:
2499 str = _("New documents will be assigned this language.");
2500 break;
2502 case RC_DEFAULT_PAPERSIZE:
2503 str = _("Specify the default paper size.");
2504 break;
2506 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2507 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2508 break;
2510 case RC_DISPLAY_GRAPHICS:
2511 str = _("Select how LyX will display any graphics.");
2512 break;
2514 case RC_DOCUMENTPATH:
2515 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2516 break;
2518 case RC_ESC_CHARS:
2519 case RC_USE_ESC_CHARS:
2520 str = _("Specify additional chars that can be part of a word.");
2521 break;
2523 case RC_EXAMPLEPATH:
2524 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2525 break;
2527 case RC_FONT_ENCODING:
2528 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2529 break;
2531 case RC_FORMAT:
2532 break;
2534 case RC_INDEX_COMMAND:
2535 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\".");
2536 break;
2538 case RC_INPUT:
2539 break;
2541 case RC_KBMAP:
2542 case RC_KBMAP_PRIMARY:
2543 case RC_KBMAP_SECONDARY:
2544 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.");
2545 break;
2547 case RC_LABEL_INIT_LENGTH:
2548 str = _("Maximum number of words in the initialization string for a new label");
2549 break;
2551 case RC_LANGUAGE_AUTO_BEGIN:
2552 str = _("Select if a language switching command is needed at the beginning of the document.");
2553 break;
2555 case RC_LANGUAGE_AUTO_END:
2556 str = _("Select if a language switching command is needed at the end of the document.");
2557 break;
2559 case RC_LANGUAGE_COMMAND_BEGIN:
2560 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.");
2561 break;
2563 case RC_LANGUAGE_COMMAND_END:
2564 str = _("The LaTeX command for changing back to the language of the document.");
2565 break;
2567 case RC_LANGUAGE_COMMAND_LOCAL:
2568 str = _("The LaTeX command for local changing of the language.");
2569 break;
2571 case RC_LANGUAGE_GLOBAL_OPTIONS:
2572 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2573 break;
2575 case RC_LANGUAGE_PACKAGE:
2576 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2577 break;
2579 case RC_LANGUAGE_USE_BABEL:
2580 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2581 break;
2583 case RC_USELASTFILEPOS:
2584 str = _("De-select if you do not want LyX to scroll to saved position.");
2585 break;
2587 case RC_LOADSESSION:
2588 str = _("De-select to prevent loading files opened from the last LyX session.");
2589 break;
2591 case RC_MAKE_BACKUP:
2592 str = _("De-select if you don't want LyX to create backup files.");
2593 break;
2595 case RC_MARK_FOREIGN_LANGUAGE:
2596 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2597 break;
2599 case RC_MOUSE_WHEEL_SPEED:
2600 str = bformat(_("The scrolling speed of the mouse wheel."),
2601 maxlastfiles);
2602 break;
2604 case RC_COMPLETION_POPUP_DELAY:
2605 str = _("The completion popup delay.");
2606 break;
2608 case RC_COMPLETION_POPUP_MATH:
2609 str = _("Select to display the completion popup in math mode.");
2610 break;
2612 case RC_COMPLETION_POPUP_TEXT:
2613 str = _("Select to display the completion popup in text mode.");
2614 break;
2616 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2617 str = _("Show the completion popup without delay after non-unique completion attempt.");
2618 break;
2620 case RC_COMPLETION_POPUP_TEXT:
2621 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2622 break;
2624 case RC_COMPLETION_POPUP_DELAY:
2625 str = _("The inline completion delay.");
2626 break;
2628 case RC_COMPLETION_INLINE_MATH:
2629 str = _("Select to display the inline completion in math mode.");
2630 break;
2632 case RC_COMPLETION_INLINE_TEXT:
2633 str = _("Select to display the inline completion in text mode.");
2634 break;
2636 case RC_COMPLETION_INLINE_DOTS:
2637 str = _("Use \"...\" to shorten long completions.");
2638 break;
2640 case RC_NUMLASTFILES:
2641 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2642 maxlastfiles);
2643 break;
2645 case RC_PATH_PREFIX:
2646 str = _("Specify those directories which should be "
2647 "prepended to the PATH environment variable. "
2648 "Use the OS native format.");
2649 break;
2651 case RC_PERS_DICT:
2652 case RC_USE_PERS_DICT:
2653 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2654 break;
2656 case RC_PREVIEW:
2657 str = _("Shows a typeset preview of things such as math");
2658 break;
2660 case RC_PREVIEW_HASHED_LABELS:
2661 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2662 break;
2664 case RC_PREVIEW_SCALE_FACTOR:
2665 str = _("Scale the preview size to suit.");
2666 break;
2668 case RC_PRINTCOLLCOPIESFLAG:
2669 str = _("The option for specifying whether the copies should be collated.");
2670 break;
2672 case RC_PRINTCOPIESFLAG:
2673 str = _("The option for specifying the number of copies to print.");
2674 break;
2676 case RC_PRINTER:
2677 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2678 break;
2680 case RC_PRINTEVENPAGEFLAG:
2681 str = _("The option to print only even pages.");
2682 break;
2684 case RC_PRINTEXSTRAOPTIONS:
2685 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2686 break;
2688 case RC_PRINTFILEEXTENSION:
2689 str = _("Extension of printer program output file. Usually \".ps\".");
2690 break;
2692 case RC_PRINTLANDSCAPEFLAG:
2693 str = _("The option to print out in landscape.");
2694 break;
2696 case RC_PRINTODDPAGEFLAG:
2697 str = _("The option to print only odd pages.");
2698 break;
2700 case RC_PRINTPAGERANGEFLAG:
2701 str = _("The option for specifying a comma-separated list of pages to print.");
2702 break;
2704 case RC_PRINTPAPERDIMENSIONFLAG:
2705 str = _("Option to specify the dimensions of the print paper.");
2706 break;
2708 case RC_PRINTPAPERFLAG:
2709 str = _("The option to specify paper type.");
2710 break;
2712 case RC_PRINTREVERSEFLAG:
2713 str = _("The option to reverse the order of the pages printed.");
2714 break;
2716 case RC_PRINTSPOOL_COMMAND:
2717 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.");
2718 break;
2720 case RC_PRINTSPOOL_PRINTERPREFIX:
2721 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.");
2722 break;
2724 case RC_PRINTTOFILE:
2725 str = _("Option to pass to the print program to print to a file.");
2726 break;
2728 case RC_PRINTTOPRINTER:
2729 str = _("Option to pass to the print program to print on a specific printer.");
2730 break;
2732 case RC_PRINT_ADAPTOUTPUT:
2733 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2734 break;
2736 case RC_PRINT_COMMAND:
2737 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2738 break;
2740 case RC_RTL_SUPPORT:
2741 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2742 break;
2744 case RC_VISUAL_CURSOR:
2745 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2746 break;
2748 case RC_SCREEN_DPI:
2749 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2750 break;
2752 case RC_SCREEN_FONT_ROMAN:
2753 case RC_SCREEN_FONT_SANS:
2754 case RC_SCREEN_FONT_TYPEWRITER:
2755 str = _("The screen fonts used to display the text while editing.");
2756 break;
2758 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2759 case RC_SCREEN_FONT_SANS_FOUNDRY:
2760 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2761 break;
2763 case RC_SCREEN_FONT_SCALABLE:
2764 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.");
2765 break;
2767 case RC_SCREEN_FONT_SIZES:
2768 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2769 break;
2771 case RC_SCREEN_ZOOM:
2772 //xgettext:no-c-format
2773 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2774 break;
2776 case RC_GEOMETRY_SESSION:
2777 str = _("Allow session manager to save and restore windows geometry.");
2778 break;
2780 case RC_SERVERPIPE:
2781 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2782 break;
2784 case RC_SET_COLOR:
2785 break;
2787 case RC_SHOW_BANNER:
2788 str = _("De-select if you don't want the startup banner.");
2789 break;
2791 case RC_SPELL_COMMAND:
2792 str = _("What command runs the spellchecker?");
2793 break;
2795 case RC_TEMPDIRPATH:
2796 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2797 break;
2799 case RC_TEMPLATEPATH:
2800 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2801 break;
2803 case RC_TEX_ALLOWS_SPACES:
2804 break;
2806 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2807 break;
2809 case RC_UIFILE:
2810 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2811 break;
2813 case RC_USER_EMAIL:
2814 break;
2816 case RC_USER_NAME:
2817 break;
2819 case RC_USETEMPDIR:
2820 break;
2822 case RC_USE_INP_ENC:
2823 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2824 break;
2826 case RC_USE_TOOLTIP:
2827 str = _("Enable the automatic appearance of tool tips in the work area.");
2828 break;
2830 case RC_USE_PIXMAP_CACHE:
2831 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2832 break;
2834 case RC_USE_SPELL_LIB:
2835 break;
2837 case RC_VIEWDVI_PAPEROPTION:
2838 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2839 break;
2841 case RC_VIEWER:
2842 break;
2844 case RC_LAST:
2845 break;
2848 return str;
2850 #endif
2853 // The global instance
2854 LyXRC lyxrc;
2856 // The global copy of the system lyxrc entries (everything except preferences)
2857 LyXRC system_lyxrc;
2860 } // namespace lyx