Another minor change, but this should almost get us to the point that we
[lyx.git] / src / LyXRC.cpp
blob896f84d415f246906f6f0df836d17c6238d59914
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 "LyXRC.h"
21 #include "ColorSet.h"
22 #include "Converter.h"
23 #include "FontEnums.h"
24 #include "Format.h"
25 #include "Lexer.h"
26 #include "Mover.h"
27 #include "Session.h"
28 #include "version.h"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/FileName.h"
36 #include "support/filetools.h"
37 #include "support/gettext.h"
38 #include "support/lstrings.h"
39 #include "support/os.h"
40 #include "support/Package.h"
41 #include "support/userinfo.h"
43 #include <fstream>
44 #include <iostream>
46 using namespace std;
47 using namespace lyx::support;
49 namespace lyx {
51 namespace os = support::os;
53 namespace {
55 // when adding something to this array keep it sorted!
56 LexerKeyword lyxrcTags[] = {
57 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
58 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
59 { "\\alternate_language", LyXRC::RC_ALT_LANG },
60 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
61 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
62 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
63 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
64 { "\\autosave", LyXRC::RC_AUTOSAVE },
65 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
66 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
67 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
68 { "\\bind_file", LyXRC::RC_BINDFILE },
69 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
70 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
71 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
72 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
73 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
74 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
75 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
76 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
77 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
78 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
79 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
80 { "\\converter", LyXRC::RC_CONVERTER },
81 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
82 { "\\copier", LyXRC::RC_COPIER },
83 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
84 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
85 { "\\def_file", LyXRC::RC_DEFFILE },
86 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
87 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
88 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
89 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
90 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
91 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
92 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
93 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
94 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
95 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
96 { "\\format", LyXRC::RC_FORMAT },
97 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
98 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
99 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
100 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
101 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
102 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
103 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
104 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
105 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
106 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
107 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
108 { "\\input", LyXRC::RC_INPUT },
109 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
110 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
111 { "\\kbmap", LyXRC::RC_KBMAP },
112 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
113 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
114 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
115 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
116 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
117 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
118 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
119 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
120 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
121 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
122 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
123 { "\\load_session", LyXRC::RC_LOADSESSION },
124 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
125 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
126 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
127 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
128 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
129 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
130 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
131 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
132 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
133 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
134 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
135 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
136 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
137 { "\\preview", LyXRC::RC_PREVIEW },
138 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
139 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
140 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
141 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
142 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
143 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
144 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
145 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
146 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
147 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
148 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
149 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
150 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
151 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
152 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
153 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
154 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
155 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
156 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
157 { "\\printer", LyXRC::RC_PRINTER },
158 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
159 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
160 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
161 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
162 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
163 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
164 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
165 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
166 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
167 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
168 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
169 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
170 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
171 { "\\set_color", LyXRC::RC_SET_COLOR },
172 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
173 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
174 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
175 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
176 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
177 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
178 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
179 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
180 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
181 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
182 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
183 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
184 { "\\ui_file", LyXRC::RC_UIFILE },
185 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
186 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
187 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
188 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
189 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
190 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
191 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
192 // compatibility with versions older than 1.4.0 only
193 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
194 // compatibility with versions older than 1.4.0 only
195 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
196 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
197 { "\\user_email", LyXRC::RC_USER_EMAIL },
198 { "\\user_name", LyXRC::RC_USER_NAME },
199 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
200 // compatibility with versions older than 1.4.0 only
201 { "\\viewer", LyXRC::RC_VIEWER},
202 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
203 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
206 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
208 } // namespace anon
211 LyXRC::LyXRC()
213 setDefaults();
217 void LyXRC::setDefaults()
219 bind_file = "cua";
220 def_file = "default";
221 ui_file = "default";
222 // Get printer from the environment. If fail, use default "",
223 // assuming that everything is set up correctly.
224 printer = getEnv("PRINTER");
225 print_adapt_output = false;
226 print_command = "dvips";
227 print_evenpage_flag = "-B";
228 print_oddpage_flag = "-A";
229 print_pagerange_flag = "-pp";
230 print_copies_flag = "-c";
231 print_collcopies_flag = "-C";
232 print_reverse_flag = "-r";
233 print_landscape_flag = "-t landscape";
234 print_to_printer = "-P";
235 print_to_file = "-o ";
236 print_file_extension = ".ps";
237 print_paper_flag = "-t";
238 print_paper_dimension_flag = "-T";
239 document_path.erase();
240 view_dvi_paper_option.erase();
241 default_papersize = PAPER_DEFAULT;
242 default_view_format = "pdf2";
243 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
244 bibtex_command = "bibtex";
245 fontenc = "default";
246 index_command = "makeindex -c -q";
247 nomencl_command = "makeindex -s nomencl.ist";
248 dpi = 75;
249 // Because a screen is typically wider than a piece of paper:
250 zoom = 150;
251 allow_geometry_session = true;
252 // Default LaTeX font size:
253 font_sizes[FONT_SIZE_TINY] = "5.0";
254 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
255 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
256 font_sizes[FONT_SIZE_SMALL] = "9.0";
257 font_sizes[FONT_SIZE_NORMAL] = "10.0";
258 font_sizes[FONT_SIZE_LARGE] = "12.0";
259 font_sizes[FONT_SIZE_LARGER] = "14.4";
260 font_sizes[FONT_SIZE_LARGEST] = "17.26";
261 font_sizes[FONT_SIZE_HUGE] = "20.74";
262 font_sizes[FONT_SIZE_HUGER] = "24.88";
263 use_scalable_fonts = true;
264 roman_font_name = "";
265 sans_font_name = "";
266 typewriter_font_name = "";
267 autosave = 300;
268 auto_region_delete = true;
269 auto_reset_options = false;
270 plaintext_linelen = 65;
271 mouse_wheel_speed = 1.0;
272 num_lastfiles = maxlastfiles;
273 check_lastfiles = true;
274 use_lastfilepos = true;
275 load_session = false;
276 make_backup = true;
277 backupdir_path.erase();
278 display_graphics = true;
279 // Spellchecker settings:
280 spellchecker = "aspell";
281 spellchecker_accept_compound = false;
282 spellcheck_continuously = false;
283 use_kbmap = false;
284 rtl_support = true;
285 visual_cursor = false;
286 auto_number = true;
287 mark_foreign_language = true;
288 language_auto_begin = true;
289 language_auto_end = true;
290 language_global_options = true;
291 language_use_babel = true;
292 language_package = "\\usepackage{babel}";
293 language_command_begin = "\\selectlanguage{$$lang}";
294 language_command_local = "\\foreignlanguage{$$lang}{";
295 sort_layouts = false;
296 group_layouts = true;
297 default_language = "english";
298 gui_language = "auto";
299 show_banner = true;
300 windows_style_tex_paths = false;
301 tex_allows_spaces = false;
302 date_insert_format = "%x";
303 cursor_follows_scrollbar = false;
304 scroll_below_document = false;
305 paragraph_markers = false;
306 mac_like_word_movement = false;
307 macro_edit_style = MACRO_EDIT_INLINE_BOX;
308 dialogs_iconify_with_main = false;
309 label_init_length = 3;
310 preview = PREVIEW_OFF;
311 preview_hashed_labels = false;
312 preview_scale_factor = 1.0;
313 use_converter_cache = true;
314 use_tooltip = true;
315 use_pixmap_cache = false;
316 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
317 user_name = to_utf8(support::user_name());
318 user_email = to_utf8(support::user_email());
319 open_buffers_in_tabs = true;
320 single_close_tab_button = false;
322 // Fullscreen settings
323 full_screen_limit = false;
324 full_screen_toolbars = true;
325 full_screen_tabbar = true;
326 full_screen_menubar = true;
327 full_screen_scrollbar = true;
328 full_screen_width = 700;
330 completion_cursor_text = true;
331 completion_popup_math = true;
332 completion_popup_text = false;
333 completion_popup_delay = 2.0;
334 completion_popup_after_complete = true;
335 autocorrection_math = false;
336 completion_inline_math = true;
337 completion_inline_text = false;
338 completion_inline_dots = -1;
339 completion_inline_delay = 0.2;
343 namespace {
345 void oldFontFormat(string & family, string & foundry)
347 if (family.empty() || family[0] != '-')
348 return;
349 foundry = token(family, '-', 1);
350 family = token(family, '-', 2);
351 if (foundry == "*")
352 foundry.erase();
355 } // namespace anon
358 int LyXRC::read(FileName const & filename)
360 Lexer lexrc(lyxrcTags);
361 if (lyxerr.debugging(Debug::PARSER))
362 lexrc.printTable(lyxerr);
364 lexrc.setFile(filename);
365 if (!lexrc.isOK())
366 return -2;
368 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
370 return read(lexrc);
374 int LyXRC::read(istream & is)
376 Lexer lexrc(lyxrcTags);
377 if (lyxerr.debugging(Debug::PARSER))
378 lexrc.printTable(lyxerr);
380 lexrc.setStream(is);
381 if (!lexrc.isOK())
382 return -2;
384 LYXERR(Debug::LYXRC, "Reading istream...");
386 return read(lexrc);
390 int LyXRC::read(Lexer & lexrc)
392 if (!lexrc.isOK())
393 return -2;
395 while (lexrc.isOK()) {
396 // By using two switches we take advantage of the compiler
397 // telling us if we have missed a LyXRCTags element in
398 // the second switch.
399 // Note that this also shows a problem with Lexer since it
400 // helps us avoid taking advantage of the strictness of the
401 // compiler.
403 int le = lexrc.lex();
404 switch (le) {
405 case Lexer::LEX_UNDEF:
406 lexrc.printError("Unknown tag `$$Token'");
407 continue;
408 case Lexer::LEX_FEOF:
409 continue;
410 default:
411 break;
413 switch (static_cast<LyXRCTags>(le)) {
414 case RC_INPUT: // Include file
415 if (lexrc.next()) {
416 FileName const tmp =
417 libFileSearch(string(),
418 lexrc.getString());
419 if (read(tmp)) {
420 lexrc.printError("Error reading "
421 "included file: " + tmp.absFilename());
424 break;
425 case RC_BINDFILE:
426 if (lexrc.next())
427 bind_file = os::internal_path(lexrc.getString());
428 break;
430 case RC_DEFFILE:
431 if (lexrc.next())
432 def_file = os::internal_path(lexrc.getString());
433 break;
435 case RC_UIFILE:
436 if (lexrc.next())
437 ui_file = os::internal_path(lexrc.getString());
438 break;
440 case RC_AUTORESET_OPTIONS:
441 lexrc >> auto_reset_options;
442 break;
444 case RC_DISPLAY_GRAPHICS:
445 if (lexrc.next())
446 display_graphics = lexrc.getString() == "true";
447 break;
449 case RC_TEX_EXPECTS_WINDOWS_PATHS:
450 lexrc >> windows_style_tex_paths;
451 break;
453 case RC_TEX_ALLOWS_SPACES:
454 lexrc >> tex_allows_spaces;
455 break;
457 case RC_KBMAP:
458 lexrc >> use_kbmap;
459 break;
461 case RC_KBMAP_PRIMARY:
462 if (lexrc.next()) {
463 string const kmap(os::internal_path(lexrc.getString()));
464 if (!libFileSearch("kbd", kmap, "kmap").empty()
465 || kmap.empty()) {
466 primary_kbmap = kmap;
467 } else {
468 lexrc.printError("LyX: Keymap `$$Token' not found");
471 break;
473 case RC_KBMAP_SECONDARY:
474 if (lexrc.next()) {
475 string const kmap(os::internal_path(lexrc.getString()));
476 if (!libFileSearch("kbd", kmap, "kmap").empty()
477 || kmap.empty()) {
478 secondary_kbmap = kmap;
479 } else {
480 lexrc.printError("LyX: Keymap `$$Token' not found");
483 break;
485 case RC_FONT_ENCODING:
486 lexrc >> fontenc;
487 break;
489 case RC_PRINTER:
490 lexrc >> printer;
491 break;
493 case RC_PRINT_COMMAND:
494 if (lexrc.next(true)) {
495 print_command = lexrc.getString();
497 break;
499 case RC_PRINTEVENPAGEFLAG:
500 lexrc >> print_evenpage_flag;
501 break;
503 case RC_PRINTODDPAGEFLAG:
504 lexrc >> print_oddpage_flag;
505 break;
507 case RC_PRINTPAGERANGEFLAG:
508 lexrc >> print_pagerange_flag;
509 break;
511 case RC_PRINTCOPIESFLAG:
512 lexrc >> print_copies_flag;
513 break;
515 case RC_PRINTCOLLCOPIESFLAG:
516 lexrc >> print_collcopies_flag;
517 break;
519 case RC_PRINTREVERSEFLAG:
520 lexrc >> print_reverse_flag;
521 break;
523 case RC_PRINTLANDSCAPEFLAG:
524 lexrc >> print_landscape_flag;
525 break;
527 case RC_PRINTTOPRINTER:
528 lexrc >> print_to_printer;
529 break;
531 case RC_PRINT_ADAPTOUTPUT:
532 lexrc >> print_adapt_output;
533 break;
535 case RC_PRINTTOFILE:
536 if (lexrc.next()) {
537 print_to_file = os::internal_path(lexrc.getString());
539 break;
541 case RC_PRINTFILEEXTENSION:
542 lexrc >> print_file_extension;
543 break;
545 case RC_PRINTEXSTRAOPTIONS:
546 lexrc >> print_extra_options;
547 break;
549 case RC_PRINTSPOOL_COMMAND:
550 if (lexrc.next(true)) {
551 print_spool_command = lexrc.getString();
553 break;
555 case RC_PRINTSPOOL_PRINTERPREFIX:
556 lexrc >> print_spool_printerprefix;
557 break;
559 case RC_PRINTPAPERDIMENSIONFLAG:
560 lexrc >> print_paper_dimension_flag;
561 break;
563 case RC_PRINTPAPERFLAG:
564 lexrc >> print_paper_flag;
565 break;
567 case RC_DEFAULT_PAPERSIZE:
568 if (lexrc.next()) {
569 string const size = ascii_lowercase(lexrc.getString());
570 if (size == "usletter")
571 default_papersize = PAPER_USLETTER;
572 else if (size == "legal")
573 default_papersize = PAPER_USLEGAL;
574 else if (size == "executive")
575 default_papersize = PAPER_USEXECUTIVE;
576 else if (size == "a3")
577 default_papersize = PAPER_A3;
578 else if (size == "a4")
579 default_papersize = PAPER_A4;
580 else if (size == "a5")
581 default_papersize = PAPER_A5;
582 else if (size == "b5")
583 default_papersize = PAPER_B5;
584 else if (size == "default")
585 default_papersize = PAPER_DEFAULT;
587 break;
589 case RC_VIEWDVI_PAPEROPTION:
590 if (lexrc.next())
591 view_dvi_paper_option = lexrc.getString();
592 else
593 view_dvi_paper_option.erase();
594 break;
596 case RC_CHKTEX_COMMAND:
597 if (lexrc.next(true)) {
598 chktex_command = lexrc.getString();
600 break;
602 case RC_BIBTEX_ALTERNATIVES:
603 if (lexrc.next(true)) {
604 bibtex_alternatives.insert(lexrc.getString());
606 break;
608 case RC_BIBTEX_COMMAND:
609 if (lexrc.next(true)) {
610 bibtex_command = lexrc.getString();
612 break;
614 case RC_JBIBTEX_COMMAND:
615 if (lexrc.next(true)) {
616 jbibtex_command = lexrc.getString();
618 break;
620 case RC_INDEX_ALTERNATIVES:
621 if (lexrc.next(true)) {
622 index_alternatives.insert(lexrc.getString());
624 break;
626 case RC_INDEX_COMMAND:
627 if (lexrc.next(true)) {
628 index_command = lexrc.getString();
630 break;
632 case RC_JINDEX_COMMAND:
633 if (lexrc.next(true)) {
634 jindex_command = lexrc.getString();
636 break;
638 case RC_SPLITINDEX_COMMAND:
639 if (lexrc.next(true)) {
640 splitindex_command = lexrc.getString();
642 break;
644 case RC_NOMENCL_COMMAND:
645 if (lexrc.next(true)) {
646 nomencl_command = lexrc.getString();
648 break;
650 case RC_SCREEN_DPI:
651 lexrc >> dpi;
652 break;
654 case RC_SCREEN_ZOOM:
655 lexrc >> zoom;
656 break;
658 case RC_GEOMETRY_SESSION:
659 lexrc >> allow_geometry_session;
660 break;
662 case RC_SCREEN_FONT_SIZES:
663 lexrc >> font_sizes[FONT_SIZE_TINY];
664 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
665 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
666 lexrc >> font_sizes[FONT_SIZE_SMALL];
667 lexrc >> font_sizes[FONT_SIZE_NORMAL];
668 lexrc >> font_sizes[FONT_SIZE_LARGE];
669 lexrc >> font_sizes[FONT_SIZE_LARGER];
670 lexrc >> font_sizes[FONT_SIZE_LARGEST];
671 lexrc >> font_sizes[FONT_SIZE_HUGE];
672 lexrc >> font_sizes[FONT_SIZE_HUGER];
673 break;
675 case RC_SCREEN_FONT_SCALABLE:
676 lexrc >> use_scalable_fonts;
677 break;
679 case RC_AUTOSAVE:
680 lexrc >> autosave;
681 break;
683 case RC_DOCUMENTPATH:
684 if (lexrc.next()) {
685 document_path = os::internal_path(lexrc.getString());
686 document_path = expandPath(document_path);
688 break;
690 case RC_EXAMPLEPATH:
691 if (lexrc.next()) {
692 example_path = os::internal_path(lexrc.getString());
693 example_path = expandPath(example_path);
695 break;
697 case RC_TEMPLATEPATH:
698 if (lexrc.next()) {
699 template_path = os::internal_path(lexrc.getString());
700 template_path = expandPath(template_path);
702 break;
704 case RC_TEMPDIRPATH:
705 if (lexrc.next()) {
706 tempdir_path = os::internal_path(lexrc.getString());
707 tempdir_path = expandPath(tempdir_path);
709 break;
711 case RC_THESAURUSDIRPATH:
712 if (lexrc.next()) {
713 thesaurusdir_path = os::internal_path(lexrc.getString());
714 thesaurusdir_path = expandPath(thesaurusdir_path);
716 break;
718 case RC_HUNSPELLDIR_PATH:
719 if (lexrc.next()) {
720 hunspelldir_path = os::internal_path(lexrc.getString());
721 hunspelldir_path = expandPath(hunspelldir_path);
723 break;
725 case RC_USELASTFILEPOS:
726 lexrc >> use_lastfilepos;
727 break;
729 case RC_LOADSESSION:
730 lexrc >> load_session;
731 break;
733 case RC_MOUSE_WHEEL_SPEED:
734 lexrc >> mouse_wheel_speed;
735 break;
737 case RC_COMPLETION_INLINE_DELAY:
738 lexrc >> completion_inline_delay;
739 break;
741 case RC_COMPLETION_INLINE_MATH:
742 lexrc >> completion_inline_math;
743 break;
745 case RC_COMPLETION_INLINE_TEXT:
746 lexrc >> completion_inline_text;
747 break;
749 case RC_COMPLETION_INLINE_DOTS:
750 lexrc >> completion_inline_dots;
751 break;
753 case RC_AUTOCORRECTION_MATH:
754 lexrc >> autocorrection_math;
755 break;
757 case RC_COMPLETION_POPUP_DELAY:
758 lexrc >> completion_popup_delay;
759 break;
761 case RC_COMPLETION_POPUP_MATH:
762 lexrc >> completion_popup_math;
763 break;
765 case RC_COMPLETION_POPUP_TEXT:
766 lexrc >> completion_popup_text;
767 break;
769 case RC_COMPLETION_CURSOR_TEXT:
770 lexrc >> completion_cursor_text;
771 break;
773 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
774 lexrc >> completion_popup_after_complete;
775 break;
777 case RC_NUMLASTFILES:
778 lexrc >> num_lastfiles;
779 break;
781 case RC_CHECKLASTFILES:
782 lexrc >> check_lastfiles;
783 break;
785 case RC_SCREEN_FONT_ROMAN:
786 if (lexrc.next()) {
787 roman_font_name = lexrc.getString();
788 oldFontFormat(roman_font_name,
789 roman_font_foundry);
791 break;
793 case RC_SCREEN_FONT_SANS:
794 if (lexrc.next()) {
795 sans_font_name = lexrc.getString();
796 oldFontFormat(sans_font_name, sans_font_foundry);
798 break;
800 case RC_SCREEN_FONT_TYPEWRITER:
801 if (lexrc.next()) {
802 typewriter_font_name = lexrc.getString();
803 oldFontFormat(typewriter_font_name,
804 typewriter_font_foundry);
806 break;
808 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
809 lexrc >> roman_font_foundry;
810 break;
812 case RC_SCREEN_FONT_SANS_FOUNDRY:
813 lexrc >> sans_font_foundry;
814 break;
816 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
817 lexrc >> typewriter_font_foundry;
818 break;
820 case RC_SET_COLOR: {
821 if (!lexrc.next()) {
822 lexrc.printError("Missing color tag.");
823 break;
825 string lyx_name = lexrc.getString();
827 if (!lexrc.next()) {
828 lexrc.printError("Missing color name for color: `$$Token'");
829 break;
831 string x11_name = lexrc.getString();
833 ColorCode const col =
834 lcolor.getFromLyXName(lyx_name);
835 if (col == Color_none ||
836 col == Color_inherit ||
837 col == Color_ignore)
838 break;
840 if (!lcolor.setColor(col, x11_name))
841 LYXERR0("Bad lyxrc set_color for " << lyx_name);
842 break;
845 case RC_AUTOREGIONDELETE:
846 // Auto region delete defaults to true
847 lexrc >> auto_region_delete;
848 break;
850 case RC_SERVERPIPE:
851 if (lexrc.next()) {
852 lyxpipes = os::internal_path(lexrc.getString());
853 lyxpipes = expandPath(lyxpipes);
855 break;
857 case RC_CURSOR_FOLLOWS_SCROLLBAR:
858 lexrc >> cursor_follows_scrollbar;
859 break;
861 case RC_SCROLL_BELOW_DOCUMENT:
862 lexrc >> scroll_below_document;
863 break;
865 case RC_PARAGRAPH_MARKERS:
866 lexrc >> paragraph_markers;
867 break;
869 case RC_MAC_LIKE_WORD_MOVEMENT:
870 lexrc >> mac_like_word_movement;
871 break;
873 case RC_MACRO_EDIT_STYLE:
874 if (lexrc.next()) {
875 switch (lexrc.getInteger()) {
876 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
877 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
878 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
881 break;
883 case RC_DIALOGS_ICONIFY_WITH_MAIN:
884 lexrc >> dialogs_iconify_with_main;
885 break;
887 case RC_PLAINTEXT_LINELEN:
888 lexrc >> plaintext_linelen;
889 break;
890 // Spellchecker settings:
891 case RC_ACCEPT_COMPOUND:
892 lexrc >> spellchecker_accept_compound;
893 break;
894 case RC_USE_TOOLTIP:
895 lexrc >> use_tooltip;
896 break;
897 case RC_USE_PIXMAP_CACHE:
898 lexrc >> use_pixmap_cache;
899 break;
900 case RC_SPELLCHECKER:
901 lexrc >> spellchecker;
902 break;
903 case RC_ALT_LANG:
904 lexrc >> spellchecker_alt_lang;
905 break;
906 case RC_ESC_CHARS:
907 lexrc >> spellchecker_esc_chars;
908 break;
909 case RC_SPELLCHECK_CONTINUOUSLY:
910 lexrc >> spellcheck_continuously;
911 break;
912 case RC_MAKE_BACKUP:
913 lexrc >> make_backup;
914 break;
915 case RC_BACKUPDIR_PATH:
916 if (lexrc.next()) {
917 backupdir_path = os::internal_path(lexrc.getString());
918 backupdir_path = expandPath(backupdir_path);
920 break;
921 case RC_DATE_INSERT_FORMAT:
922 lexrc >> date_insert_format;
923 break;
924 case RC_LANGUAGE_PACKAGE:
925 lexrc >> language_package;
926 break;
927 case RC_LANGUAGE_AUTO_BEGIN:
928 lexrc >> language_auto_begin;
929 break;
930 case RC_LANGUAGE_AUTO_END:
931 lexrc >> language_auto_end;
932 break;
933 case RC_LANGUAGE_GLOBAL_OPTIONS:
934 lexrc >> language_global_options;
935 break;
936 case RC_LANGUAGE_USE_BABEL:
937 lexrc >> language_use_babel;
938 break;
939 case RC_LANGUAGE_COMMAND_BEGIN:
940 lexrc >> language_command_begin;
941 break;
942 case RC_LANGUAGE_COMMAND_END:
943 lexrc >> language_command_end;
944 break;
945 case RC_LANGUAGE_COMMAND_LOCAL:
946 lexrc >> language_command_local;
947 break;
948 case RC_RTL_SUPPORT:
949 lexrc >> rtl_support;
950 break;
951 case RC_VISUAL_CURSOR:
952 lexrc >> visual_cursor;
953 break;
954 case RC_AUTO_NUMBER:
955 lexrc >> auto_number;
956 break;
957 case RC_MARK_FOREIGN_LANGUAGE:
958 lexrc >> mark_foreign_language;
959 break;
961 case RC_COPIER: {
962 string fmt, command;
963 if (lexrc.next())
964 fmt = lexrc.getString();
965 if (lexrc.next(true))
966 command = lexrc.getString();
967 setMover(fmt, command);
968 break;
971 case RC_CONVERTER: {
972 string from, to, command, flags;
973 if (lexrc.next())
974 from = lexrc.getString();
975 if (lexrc.next())
976 to = lexrc.getString();
977 if (lexrc.next(true))
978 command = lexrc.getString();
979 if (lexrc.next())
980 flags = lexrc.getString();
981 if (command.empty())
982 theConverters().erase(from, to);
983 else
984 theConverters().add(from, to, command, flags);
985 break;
987 // compatibility with versions older than 1.4.0 only
988 case RC_VIEWER: {
989 string format, command;
990 lexrc >> format >> command;
991 formats.setViewer(format, command);
992 break;
994 case RC_FORMAT: {
995 string format, extension, prettyname, shortcut;
996 lexrc >> format >> extension >> prettyname >> shortcut;
997 string viewer, editor;
998 if (lexrc.next(true))
999 viewer = lexrc.getString();
1000 if (lexrc.next(true))
1001 editor = lexrc.getString();
1002 string flags;
1003 // Hack to ensure compatibility with versions older
1004 // than 1.5.0
1005 int le = lexrc.lex();
1006 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1007 flags = lexrc.getString();
1008 if (le != Lexer::LEX_DATA) {
1009 // We have got a known token.
1010 // Therefore this is an old style
1011 // format definition without
1012 // flags.
1013 lexrc.pushToken(flags);
1014 flags.erase();
1017 int flgs = Format::none;
1018 while (!flags.empty()) {
1019 string flag;
1020 flags = split(flags, flag, ',');
1021 if (flag == "document")
1022 flgs |= Format::document;
1023 else if (flag == "vector")
1024 flgs |= Format::vector;
1025 else
1026 LYXERR0("Ignoring unknown flag `"
1027 << flag << "' for format `"
1028 << format << "'.");
1030 if (prettyname.empty()) {
1031 if (theConverters().formatIsUsed(format))
1032 LYXERR0("Can't delete format " << format);
1033 else
1034 formats.erase(format);
1035 } else {
1036 formats.add(format, extension, prettyname,
1037 shortcut, viewer, editor, flgs);
1039 break;
1041 case RC_VIEWER_ALTERNATIVES: {
1042 string format, command;
1043 if (lexrc.next())
1044 format = lexrc.getString();
1045 if (lexrc.eatLine())
1046 command = lexrc.getString();
1047 viewer_alternatives[format].insert(command);
1048 break;
1050 case RC_EDITOR_ALTERNATIVES: {
1051 string format, command;
1052 lexrc >> format >> command;
1053 editor_alternatives[format].insert(command);
1054 break;
1057 case RC_DEFAULT_VIEW_FORMAT:
1058 lexrc >> default_view_format;
1059 break;
1061 case RC_DEFAULT_LANGUAGE:
1062 lexrc >> default_language;
1063 break;
1065 case RC_GUI_LANGUAGE:
1066 lexrc >> gui_language;
1067 break;
1069 case RC_LABEL_INIT_LENGTH:
1070 lexrc >> label_init_length;
1071 break;
1073 case RC_SHOW_BANNER:
1074 lexrc >> show_banner;
1075 break;
1077 case RC_PREVIEW:
1078 if (lexrc.next()) {
1079 string const tmp = lexrc.getString();
1080 if (tmp == "true" || tmp == "on")
1081 preview = PREVIEW_ON;
1082 else if (tmp == "no_math")
1083 preview = PREVIEW_NO_MATH;
1084 else {
1085 preview = PREVIEW_OFF;
1086 if (tmp != "false" && tmp != "off")
1087 LYXERR0("Unrecognized preview status \""
1088 << tmp << '\n');
1091 break;
1093 case RC_PREVIEW_HASHED_LABELS:
1094 lexrc >> preview_hashed_labels;
1095 break;
1097 case RC_PREVIEW_SCALE_FACTOR:
1098 lexrc >> preview_scale_factor;
1099 break;
1101 case RC_USER_NAME:
1102 lexrc >> user_name;
1103 break;
1104 case RC_USER_EMAIL:
1105 lexrc >> user_email;
1106 break;
1108 case RC_PATH_PREFIX:
1109 lexrc >> path_prefix;
1110 break;
1112 case RC_USE_CONVERTER_CACHE:
1113 lexrc >> use_converter_cache;
1114 break;
1115 case RC_CONVERTER_CACHE_MAXAGE:
1116 lexrc >> converter_cache_maxage;
1117 break;
1119 case RC_SORT_LAYOUTS:
1120 lexrc >> sort_layouts;
1121 break;
1122 case RC_GROUP_LAYOUTS:
1123 lexrc >> group_layouts;
1124 break;
1125 case RC_FULL_SCREEN_LIMIT:
1126 lexrc >> full_screen_limit;
1127 break;
1128 case RC_FULL_SCREEN_TOOLBARS:
1129 lexrc >> full_screen_toolbars;
1130 break;
1131 case RC_FULL_SCREEN_SCROLLBAR:
1132 lexrc >> full_screen_scrollbar;
1133 break;
1134 case RC_FULL_SCREEN_TABBAR:
1135 lexrc >> full_screen_tabbar;
1136 break;
1137 case RC_FULL_SCREEN_MENUBAR:
1138 lexrc >> full_screen_menubar;
1139 break;
1140 case RC_FULL_SCREEN_WIDTH:
1141 lexrc >> full_screen_width;
1142 break;
1143 case RC_OPEN_BUFFERS_IN_TABS:
1144 lexrc >> open_buffers_in_tabs;
1145 break;
1146 case RC_SINGLE_CLOSE_TAB_BUTTON:
1147 lexrc >> single_close_tab_button;
1148 break;
1150 // Obsoteted in 1.4.0
1151 case RC_USETEMPDIR:
1152 // Obsoleted in 2.0
1153 case RC_SPELL_COMMAND:
1154 case RC_PERS_DICT:
1155 case RC_PLAINTEXT_ROFF_COMMAND:
1156 case RC_USE_ALT_LANG:
1157 case RC_USE_ESC_CHARS:
1158 case RC_USE_INP_ENC:
1159 case RC_USE_PERS_DICT:
1160 case RC_USE_SPELL_LIB:
1161 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1162 << lexrc.getString() << "'.");
1163 lexrc.next(true);
1164 break;
1166 case RC_LAST:
1167 break; // this is just a dummy
1171 /// Update converters data-structures
1172 theConverters().update(formats);
1173 theConverters().buildGraph();
1175 return 0;
1179 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1181 ofstream ofs(filename.toFilesystemEncoding().c_str());
1182 if (ofs)
1183 write(ofs, ignore_system_lyxrc);
1187 void LyXRC::print() const
1189 if (lyxerr.debugging())
1190 write(lyxerr, false);
1191 else
1192 write(cout, false);
1196 class SameMover {
1197 public:
1198 typedef pair<string, SpecialisedMover> Data;
1200 SameMover(Data const & comparison)
1201 : comparison_(comparison) {}
1203 bool operator()(Data const & data) const
1205 return data.first == comparison_.first &&
1206 data.second.command() == comparison_.second.command();
1209 private:
1210 Data comparison_;
1214 namespace {
1216 // Escape \ and " so that LyXLex can read the string later
1217 string escapeCommand(string const & str) {
1218 return subst(subst(str , "\\", "\\\\"),
1219 "\"", "\\\"");
1225 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1227 LyXRCTags tag = RC_LAST;
1229 if (!name.empty()) {
1230 for (int i = 0; i != lyxrcCount; ++i)
1231 if ("\\" + name == lyxrcTags[i].tag)
1232 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1235 if (tag == RC_LAST)
1236 os << "# LyX " << lyx_version
1237 << " generated this file. If you want to make your own\n"
1238 << "# modifications you should do them from inside LyX and save.\n"
1239 << "\n";
1241 // Why the switch you might ask. It is a trick to ensure that all
1242 // the elements in the LyXRCTags enum are handled. As you can see
1243 // there are no breaks at all. So it is just a huge fall-through.
1244 // The nice thing is that we will get a warning from the compiler
1245 // if we forget an element.
1246 switch (tag) {
1247 case RC_LAST:
1248 case RC_INPUT:
1249 // input/include files are not done here
1250 case RC_BINDFILE:
1251 if (ignore_system_lyxrc ||
1252 bind_file != system_lyxrc.bind_file) {
1253 string const path = os::external_path(bind_file);
1254 os << "\\bind_file \"" << path << "\"\n";
1256 if (tag != RC_LAST)
1257 break;
1259 case RC_DEFFILE:
1260 if (ignore_system_lyxrc ||
1261 def_file != system_lyxrc.def_file) {
1262 string const path = os::external_path(def_file);
1263 os << "\\def_file \"" << path << "\"\n";
1265 if (tag != RC_LAST)
1266 break;
1269 // Misc Section
1271 os << "\n#\n"
1272 << "# MISC SECTION ######################################\n"
1273 << "#\n\n";
1274 // bind files are not done here.
1276 case RC_PATH_PREFIX:
1277 if (ignore_system_lyxrc ||
1278 path_prefix != system_lyxrc.path_prefix) {
1279 os << "\\path_prefix \"" << path_prefix << "\"\n";
1281 if (tag != RC_LAST)
1282 break;
1283 case RC_UIFILE:
1284 if (ignore_system_lyxrc ||
1285 ui_file != system_lyxrc.ui_file) {
1286 string const path = os::external_path(ui_file);
1287 os << "\\ui_file \"" << path << "\"\n";
1289 if (tag != RC_LAST)
1290 break;
1291 case RC_AUTOREGIONDELETE:
1292 if (ignore_system_lyxrc ||
1293 auto_region_delete != system_lyxrc.auto_region_delete) {
1294 os << "# Set to false to inhibit automatic replacement of\n"
1295 << "# the current selection.\n"
1296 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1297 << '\n';
1299 if (tag != RC_LAST)
1300 break;
1301 case RC_AUTORESET_OPTIONS:
1302 if (ignore_system_lyxrc ||
1303 auto_reset_options != system_lyxrc.auto_reset_options) {
1304 os << "# Set to false to inhibit automatic reset of\n"
1305 << "# the class options to defaults on class change.\n"
1306 << "\\auto_reset_options "
1307 << convert<string>(auto_reset_options)
1308 << '\n';
1310 if (tag != RC_LAST)
1311 break;
1312 case RC_AUTOSAVE:
1313 if (ignore_system_lyxrc ||
1314 autosave != system_lyxrc.autosave) {
1315 os << "# The time interval between auto-saves in seconds.\n"
1316 << "\\autosave " << autosave << '\n';
1318 if (tag != RC_LAST)
1319 break;
1320 case RC_DISPLAY_GRAPHICS:
1321 if (ignore_system_lyxrc ||
1322 display_graphics != system_lyxrc.display_graphics) {
1323 os << "# Display graphics within LyX\n"
1324 << "# true|false\n"
1325 << "\\display_graphics "
1326 << (display_graphics ? "true" : "false")
1327 << '\n';
1329 if (tag != RC_LAST)
1330 break;
1331 case RC_SORT_LAYOUTS:
1332 if (ignore_system_lyxrc ||
1333 sort_layouts != system_lyxrc.sort_layouts) {
1334 os << "# Sort layouts alphabetically.\n"
1335 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1337 if (tag != RC_LAST)
1338 break;
1339 case RC_GROUP_LAYOUTS:
1340 if (ignore_system_lyxrc ||
1341 group_layouts != system_lyxrc.group_layouts) {
1342 os << "# Group layouts by their category.\n"
1343 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1345 if (tag != RC_LAST)
1346 break;
1347 case RC_VIEWDVI_PAPEROPTION:
1348 if (ignore_system_lyxrc ||
1349 view_dvi_paper_option
1350 != system_lyxrc.view_dvi_paper_option) {
1351 os << "# Options used to specify paper size to the\n"
1352 << "# view_dvi_command (e.g. -paper)\n"
1353 << "\\view_dvi_paper_option \""
1354 << view_dvi_paper_option << "\"\n";
1356 if (tag != RC_LAST)
1357 break;
1358 case RC_DEFAULT_PAPERSIZE:
1359 if (ignore_system_lyxrc ||
1360 default_papersize != system_lyxrc.default_papersize) {
1361 os << "# The default papersize to use.\n"
1362 << "\\default_papersize \"";
1363 switch (default_papersize) {
1364 case PAPER_DEFAULT:
1365 os << "default"; break;
1366 case PAPER_USLETTER:
1367 os << "usletter"; break;
1368 case PAPER_USLEGAL:
1369 os << "legal"; break;
1370 case PAPER_USEXECUTIVE:
1371 os << "executive"; break;
1372 case PAPER_A3:
1373 os << "a3"; break;
1374 case PAPER_A4:
1375 os << "a4"; break;
1376 case PAPER_A5:
1377 os << "a5"; break;
1378 case PAPER_B5:
1379 os << "b5"; break;
1380 case PAPER_CUSTOM:
1381 case PAPER_B3:
1382 case PAPER_B4: break;
1384 os << "\"\n";
1386 if (tag != RC_LAST)
1387 break;
1388 case RC_CHKTEX_COMMAND:
1389 if (ignore_system_lyxrc ||
1390 chktex_command != system_lyxrc.chktex_command) {
1391 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1393 if (tag != RC_LAST)
1394 break;
1395 case RC_BIBTEX_ALTERNATIVES: {
1396 CommandSet::const_iterator it = bibtex_alternatives.begin();
1397 CommandSet::const_iterator end = bibtex_alternatives.end();
1398 for ( ; it != end; ++it) {
1399 if (ignore_system_lyxrc
1400 || !system_lyxrc.bibtex_alternatives.count(*it))
1401 os << "\\bibtex_alternatives \""
1402 << *it << "\"\n";
1404 if (tag != RC_LAST)
1405 break;
1407 case RC_BIBTEX_COMMAND:
1408 if (ignore_system_lyxrc ||
1409 bibtex_command != system_lyxrc.bibtex_command) {
1410 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1412 if (tag != RC_LAST)
1413 break;
1414 case RC_JBIBTEX_COMMAND:
1415 if (ignore_system_lyxrc ||
1416 jbibtex_command != system_lyxrc.jbibtex_command) {
1417 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1419 if (tag != RC_LAST)
1420 break;
1421 case RC_INDEX_ALTERNATIVES: {
1422 CommandSet::const_iterator it = index_alternatives.begin();
1423 CommandSet::const_iterator end = index_alternatives.end();
1424 for ( ; it != end; ++it) {
1425 if (ignore_system_lyxrc
1426 || !system_lyxrc.index_alternatives.count(*it))
1427 os << "\\index_alternatives \""
1428 << *it << "\"\n";
1430 if (tag != RC_LAST)
1431 break;
1433 case RC_INDEX_COMMAND:
1434 if (ignore_system_lyxrc ||
1435 index_command != system_lyxrc.index_command) {
1436 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1438 if (tag != RC_LAST)
1439 break;
1440 case RC_JINDEX_COMMAND:
1441 if (ignore_system_lyxrc ||
1442 jindex_command != system_lyxrc.jindex_command) {
1443 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1445 if (tag != RC_LAST)
1446 break;
1447 case RC_SPLITINDEX_COMMAND:
1448 if (ignore_system_lyxrc ||
1449 splitindex_command != system_lyxrc.splitindex_command) {
1450 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1452 if (tag != RC_LAST)
1453 break;
1454 case RC_NOMENCL_COMMAND:
1455 if (ignore_system_lyxrc ||
1456 nomencl_command != system_lyxrc.nomencl_command) {
1457 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1459 if (tag != RC_LAST)
1460 break;
1461 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1462 if (ignore_system_lyxrc ||
1463 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1464 os << "\\tex_expects_windows_paths "
1465 << convert<string>(windows_style_tex_paths) << '\n';
1467 if (tag != RC_LAST)
1468 break;
1469 case RC_TEX_ALLOWS_SPACES:
1470 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1471 os << "\\tex_allows_spaces "
1472 << convert<string>(tex_allows_spaces) << '\n';
1474 if (tag != RC_LAST)
1475 break;
1476 case RC_KBMAP:
1477 if (ignore_system_lyxrc ||
1478 use_kbmap != system_lyxrc.use_kbmap) {
1479 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1481 if (tag != RC_LAST)
1482 break;
1483 case RC_KBMAP_PRIMARY:
1484 if (ignore_system_lyxrc ||
1485 primary_kbmap != system_lyxrc.primary_kbmap) {
1486 string const path = os::external_path(primary_kbmap);
1487 os << "\\kbmap_primary \"" << path << "\"\n";
1489 if (tag != RC_LAST)
1490 break;
1491 case RC_KBMAP_SECONDARY:
1492 if (ignore_system_lyxrc ||
1493 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1494 string const path = os::external_path(secondary_kbmap);
1495 os << "\\kbmap_secondary \"" << path << "\"\n";
1497 if (tag != RC_LAST)
1498 break;
1499 case RC_SERVERPIPE:
1500 if (ignore_system_lyxrc ||
1501 lyxpipes != system_lyxrc.lyxpipes) {
1502 string const path = os::external_path(lyxpipes);
1503 os << "\\serverpipe \"" << path << "\"\n";
1505 if (tag != RC_LAST)
1506 break;
1507 case RC_DATE_INSERT_FORMAT:
1508 if (ignore_system_lyxrc ||
1509 date_insert_format != system_lyxrc.date_insert_format) {
1510 os << "\\date_insert_format \"" << date_insert_format
1511 << "\"\n";
1513 if (tag != RC_LAST)
1514 break;
1515 case RC_LABEL_INIT_LENGTH:
1516 if (ignore_system_lyxrc ||
1517 label_init_length != system_lyxrc.label_init_length) {
1518 os << "\\label_init_length " << label_init_length
1519 << '\n';
1521 if (tag != RC_LAST)
1522 break;
1524 case RC_USER_NAME:
1525 os << "\\user_name \"" << user_name << "\"\n";
1526 if (tag != RC_LAST)
1527 break;
1529 case RC_USER_EMAIL:
1530 os << "\\user_email \"" << user_email << "\"\n";
1531 if (tag != RC_LAST)
1532 break;
1534 case RC_SHOW_BANNER:
1535 if (ignore_system_lyxrc ||
1536 show_banner != system_lyxrc.show_banner) {
1537 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1539 if (tag != RC_LAST)
1540 break;
1542 case RC_PREVIEW:
1543 if (ignore_system_lyxrc ||
1544 preview != system_lyxrc.preview) {
1545 string status;
1546 switch (preview) {
1547 case PREVIEW_ON:
1548 status = "on";
1549 break;
1550 case PREVIEW_NO_MATH:
1551 status = "no_math";
1552 break;
1553 case PREVIEW_OFF:
1554 status = "off";
1555 break;
1557 os << "\\preview " << status << '\n';
1559 if (tag != RC_LAST)
1560 break;
1562 case RC_PREVIEW_HASHED_LABELS:
1563 if (ignore_system_lyxrc ||
1564 preview_hashed_labels !=
1565 system_lyxrc.preview_hashed_labels) {
1566 os << "\\preview_hashed_labels "
1567 << convert<string>(preview_hashed_labels) << '\n';
1569 if (tag != RC_LAST)
1570 break;
1572 case RC_PREVIEW_SCALE_FACTOR:
1573 if (ignore_system_lyxrc ||
1574 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1575 os << "\\preview_scale_factor "
1576 << preview_scale_factor << '\n';
1578 if (tag != RC_LAST)
1579 break;
1581 case RC_USE_CONVERTER_CACHE:
1582 if (ignore_system_lyxrc ||
1583 use_converter_cache != system_lyxrc.use_converter_cache) {
1584 os << "\\use_converter_cache "
1585 << convert<string>(use_converter_cache) << '\n';
1587 if (tag != RC_LAST)
1588 break;
1590 case RC_CONVERTER_CACHE_MAXAGE:
1591 if (ignore_system_lyxrc ||
1592 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1593 os << "\\converter_cache_maxage "
1594 << converter_cache_maxage << '\n';
1596 if (tag != RC_LAST)
1597 break;
1599 os << "\n#\n"
1600 << "# SCREEN & FONTS SECTION ############################\n"
1601 << "#\n\n";
1603 case RC_SCREEN_DPI:
1604 if (ignore_system_lyxrc ||
1605 dpi != system_lyxrc.dpi) {
1606 os << "\\screen_dpi " << dpi << '\n';
1608 if (tag != RC_LAST)
1609 break;
1610 case RC_SCREEN_ZOOM:
1611 if (ignore_system_lyxrc ||
1612 zoom != system_lyxrc.zoom) {
1613 os << "\\screen_zoom " << zoom << '\n';
1615 if (tag != RC_LAST)
1616 break;
1617 case RC_GEOMETRY_SESSION:
1618 if (ignore_system_lyxrc ||
1619 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1620 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1621 << '\n';
1623 if (tag != RC_LAST)
1624 break;
1625 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1626 if (ignore_system_lyxrc ||
1627 cursor_follows_scrollbar
1628 != system_lyxrc.cursor_follows_scrollbar) {
1629 os << "\\cursor_follows_scrollbar "
1630 << convert<string>(cursor_follows_scrollbar) << '\n';
1632 if (tag != RC_LAST)
1633 break;
1634 case RC_SCROLL_BELOW_DOCUMENT:
1635 if (ignore_system_lyxrc ||
1636 scroll_below_document
1637 != system_lyxrc.scroll_below_document) {
1638 os << "\\scroll_below_document "
1639 << convert<string>(scroll_below_document) << '\n';
1641 if (tag != RC_LAST)
1642 break;
1643 case RC_PARAGRAPH_MARKERS:
1644 if (ignore_system_lyxrc ||
1645 paragraph_markers
1646 != system_lyxrc.paragraph_markers) {
1647 os << "\\paragraph_markers "
1648 << convert<string>(paragraph_markers) << '\n';
1650 if (tag != RC_LAST)
1651 break;
1652 case RC_MAC_LIKE_WORD_MOVEMENT:
1653 if (ignore_system_lyxrc ||
1654 mac_like_word_movement
1655 != system_lyxrc.mac_like_word_movement) {
1656 os << "\\mac_like_word_movement "
1657 << convert<string>(mac_like_word_movement) << '\n';
1659 if (tag != RC_LAST)
1660 break;
1661 case RC_MACRO_EDIT_STYLE:
1662 if (ignore_system_lyxrc ||
1663 macro_edit_style
1664 != system_lyxrc.macro_edit_style) {
1665 os << "\\macro_edit_style ";
1666 switch (macro_edit_style) {
1667 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1668 case MACRO_EDIT_INLINE: os << "1\n"; break;
1669 case MACRO_EDIT_LIST: os << "2\n"; break;
1672 if (tag != RC_LAST)
1673 break;
1674 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1675 if (ignore_system_lyxrc ||
1676 dialogs_iconify_with_main
1677 != system_lyxrc.dialogs_iconify_with_main) {
1678 os << "\\dialogs_iconify_with_main "
1679 << convert<string>(dialogs_iconify_with_main) << '\n';
1681 if (tag != RC_LAST)
1682 break;
1683 case RC_SCREEN_FONT_ROMAN:
1684 if (ignore_system_lyxrc ||
1685 roman_font_name != system_lyxrc.roman_font_name) {
1686 os << "\\screen_font_roman \"" << roman_font_name
1687 << "\"\n";
1689 if (tag != RC_LAST)
1690 break;
1691 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1692 if (ignore_system_lyxrc ||
1693 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1694 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1695 << "\"\n";
1697 if (tag != RC_LAST)
1698 break;
1699 case RC_SCREEN_FONT_SANS:
1700 if (ignore_system_lyxrc ||
1701 sans_font_name != system_lyxrc.sans_font_name) {
1702 os << "\\screen_font_sans \"" << sans_font_name
1703 << "\"\n";
1705 if (tag != RC_LAST)
1706 break;
1707 case RC_SCREEN_FONT_SANS_FOUNDRY:
1708 if (ignore_system_lyxrc ||
1709 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1710 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1711 << "\"\n";
1713 if (tag != RC_LAST)
1714 break;
1715 case RC_SCREEN_FONT_TYPEWRITER:
1716 if (ignore_system_lyxrc ||
1717 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1718 os << "\\screen_font_typewriter \""
1719 << typewriter_font_name << "\"\n";
1721 if (tag != RC_LAST)
1722 break;
1723 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1724 if (ignore_system_lyxrc ||
1725 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1726 os << "\\screen_font_typewriter_foundry \""
1727 << typewriter_font_foundry << "\"\n";
1729 if (tag != RC_LAST)
1730 break;
1732 case RC_SCREEN_FONT_SCALABLE:
1733 if (ignore_system_lyxrc ||
1734 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1735 os << "\\screen_font_scalable "
1736 << convert<string>(use_scalable_fonts)
1737 << '\n';
1739 if (tag != RC_LAST)
1740 break;
1741 case RC_SCREEN_FONT_SIZES:
1742 if (ignore_system_lyxrc ||
1743 font_sizes[FONT_SIZE_TINY]
1744 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1745 font_sizes[FONT_SIZE_SCRIPT]
1746 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1747 font_sizes[FONT_SIZE_FOOTNOTE]
1748 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1749 font_sizes[FONT_SIZE_SMALL]
1750 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1751 font_sizes[FONT_SIZE_NORMAL]
1752 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1753 font_sizes[FONT_SIZE_LARGE]
1754 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1755 font_sizes[FONT_SIZE_LARGER]
1756 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1757 font_sizes[FONT_SIZE_LARGEST]
1758 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1759 font_sizes[FONT_SIZE_HUGE]
1760 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1761 font_sizes[FONT_SIZE_HUGER]
1762 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1763 os.setf(ios::fixed);
1764 os.precision(2);
1765 os << "\\screen_font_sizes"
1766 << ' ' << font_sizes[FONT_SIZE_TINY]
1767 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1768 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1769 << ' ' << font_sizes[FONT_SIZE_SMALL]
1770 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1771 << ' ' << font_sizes[FONT_SIZE_LARGE]
1772 << ' ' << font_sizes[FONT_SIZE_LARGER]
1773 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1774 << ' ' << font_sizes[FONT_SIZE_HUGE]
1775 << ' ' << font_sizes[FONT_SIZE_HUGER]
1776 << '\n';
1778 if (tag != RC_LAST)
1779 break;
1780 case RC_FULL_SCREEN_LIMIT:
1781 if (ignore_system_lyxrc ||
1782 full_screen_limit != system_lyxrc.full_screen_limit) {
1783 os << "\\fullscreen_limit "
1784 << convert<string>(full_screen_limit)
1785 << '\n';
1787 if (tag != RC_LAST)
1788 break;
1789 case RC_FULL_SCREEN_TOOLBARS:
1790 if (ignore_system_lyxrc ||
1791 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1792 os << "\\fullscreen_toolbars "
1793 << convert<string>(full_screen_toolbars)
1794 << '\n';
1796 if (tag != RC_LAST)
1797 break;
1798 case RC_FULL_SCREEN_SCROLLBAR:
1799 if (ignore_system_lyxrc ||
1800 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1801 os << "\\fullscreen_scrollbar "
1802 << convert<string>(full_screen_scrollbar)
1803 << '\n';
1805 if (tag != RC_LAST)
1806 break;
1807 case RC_FULL_SCREEN_TABBAR:
1808 if (ignore_system_lyxrc ||
1809 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1810 os << "\\fullscreen_tabbar "
1811 << convert<string>(full_screen_tabbar)
1812 << '\n';
1814 if (tag != RC_LAST)
1815 break;
1816 case RC_FULL_SCREEN_MENUBAR:
1817 if (ignore_system_lyxrc ||
1818 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1819 os << "\\fullscreen_menubar "
1820 << convert<string>(full_screen_menubar)
1821 << '\n';
1823 if (tag != RC_LAST)
1824 break;
1825 case RC_FULL_SCREEN_WIDTH:
1826 if (ignore_system_lyxrc ||
1827 full_screen_width != system_lyxrc.full_screen_width) {
1828 os << "\\fullscreen_width "
1829 << convert<string>(full_screen_width)
1830 << '\n';
1832 if (tag != RC_LAST)
1833 break;
1834 case RC_OPEN_BUFFERS_IN_TABS:
1835 if (ignore_system_lyxrc ||
1836 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1837 os << "\\open_buffers_in_tabs "
1838 << convert<string>(open_buffers_in_tabs)
1839 << '\n';
1841 case RC_SINGLE_CLOSE_TAB_BUTTON:
1842 if (ignore_system_lyxrc ||
1843 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1844 os << "\\single_close_tab_button "
1845 << convert<string>(single_close_tab_button)
1846 << '\n';
1848 if (tag != RC_LAST)
1849 break;
1851 os << "\n#\n"
1852 << "# COLOR SECTION ###################################\n"
1853 << "#\n\n";
1855 case RC_SET_COLOR:
1856 for (int i = 0; i < Color_ignore; ++i) {
1857 ColorCode lc = static_cast<ColorCode>(i);
1858 string const col = lcolor.getX11Name(lc);
1859 if (ignore_system_lyxrc
1860 || col != system_lcolor.getX11Name(lc)) {
1861 os << "\\set_color \""
1862 << lcolor.getLyXName(lc) << "\" \""
1863 << col << "\"\n";
1866 if (tag != RC_LAST)
1867 break;
1869 os << "\n#\n"
1870 << "# PRINTER SECTION ###################################\n"
1871 << "#\n\n";
1873 case RC_PRINTER:
1874 if (ignore_system_lyxrc ||
1875 printer != system_lyxrc.printer) {
1876 os << "\\printer \"" << printer << "\"\n";
1878 if (tag != RC_LAST)
1879 break;
1880 case RC_PRINT_ADAPTOUTPUT:
1881 if (ignore_system_lyxrc ||
1882 print_adapt_output != system_lyxrc.print_adapt_output) {
1883 os << "\\print_adapt_output "
1884 << convert<string>(print_adapt_output)
1885 << '\n';
1887 if (tag != RC_LAST)
1888 break;
1889 case RC_PRINT_COMMAND:
1890 if (ignore_system_lyxrc ||
1891 print_command != system_lyxrc.print_command) {
1892 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1894 if (tag != RC_LAST)
1895 break;
1896 case RC_PRINTEXSTRAOPTIONS:
1897 if (ignore_system_lyxrc ||
1898 print_extra_options != system_lyxrc.print_extra_options) {
1899 os << "\\print_extra_options \"" << print_extra_options
1900 << "\"\n";
1902 if (tag != RC_LAST)
1903 break;
1904 case RC_PRINTSPOOL_COMMAND:
1905 if (ignore_system_lyxrc ||
1906 print_spool_command != system_lyxrc.print_spool_command) {
1907 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1908 << "\"\n";
1910 if (tag != RC_LAST)
1911 break;
1912 case RC_PRINTSPOOL_PRINTERPREFIX:
1913 if (ignore_system_lyxrc ||
1914 print_spool_printerprefix
1915 != system_lyxrc.print_spool_printerprefix) {
1916 os << "\\print_spool_printerprefix \""
1917 << print_spool_printerprefix << "\"\n";
1919 if (tag != RC_LAST)
1920 break;
1921 case RC_PRINTEVENPAGEFLAG:
1922 if (ignore_system_lyxrc ||
1923 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1924 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1925 << "\"\n";
1927 if (tag != RC_LAST)
1928 break;
1929 case RC_PRINTODDPAGEFLAG:
1930 if (ignore_system_lyxrc ||
1931 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1932 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1933 << "\"\n";
1935 if (tag != RC_LAST)
1936 break;
1937 case RC_PRINTREVERSEFLAG:
1938 if (ignore_system_lyxrc ||
1939 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1940 os << "\\print_reverse_flag \"" << print_reverse_flag
1941 << "\"\n";
1943 if (tag != RC_LAST)
1944 break;
1945 case RC_PRINTLANDSCAPEFLAG:
1946 if (ignore_system_lyxrc ||
1947 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1948 os << "\\print_landscape_flag \"" << print_landscape_flag
1949 << "\"\n";
1951 if (tag != RC_LAST)
1952 break;
1953 case RC_PRINTPAGERANGEFLAG:
1954 if (ignore_system_lyxrc ||
1955 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1956 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1957 << "\"\n";
1959 if (tag != RC_LAST)
1960 break;
1961 case RC_PRINTCOPIESFLAG:
1962 if (ignore_system_lyxrc ||
1963 print_copies_flag != system_lyxrc.print_copies_flag) {
1964 os << "\\print_copies_flag \"" << print_copies_flag
1965 << "\"\n";
1967 if (tag != RC_LAST)
1968 break;
1969 case RC_PRINTCOLLCOPIESFLAG:
1970 if (ignore_system_lyxrc ||
1971 print_collcopies_flag
1972 != system_lyxrc.print_collcopies_flag) {
1973 os << "\\print_collcopies_flag \""
1974 << print_collcopies_flag
1975 << "\"\n";
1977 if (tag != RC_LAST)
1978 break;
1979 case RC_PRINTPAPERFLAG:
1980 if (ignore_system_lyxrc ||
1981 print_paper_flag != system_lyxrc.print_paper_flag) {
1982 os << "\\print_paper_flag \"" << print_paper_flag
1983 << "\"\n";
1985 if (tag != RC_LAST)
1986 break;
1987 case RC_PRINTPAPERDIMENSIONFLAG:
1988 if (ignore_system_lyxrc ||
1989 print_paper_dimension_flag
1990 != system_lyxrc.print_paper_dimension_flag) {
1991 os << "\\print_paper_dimension_flag \""
1992 << print_paper_dimension_flag << "\"\n";
1994 if (tag != RC_LAST)
1995 break;
1996 case RC_PRINTTOPRINTER:
1997 if (ignore_system_lyxrc ||
1998 print_to_printer != system_lyxrc.print_to_printer) {
1999 os << "\\print_to_printer \"" << print_to_printer
2000 << "\"\n";
2002 if (tag != RC_LAST)
2003 break;
2004 case RC_PRINTTOFILE:
2005 if (ignore_system_lyxrc ||
2006 print_to_file != system_lyxrc.print_to_file) {
2007 string const path = os::external_path(print_to_file);
2008 os << "\\print_to_file \"" << path << "\"\n";
2010 if (tag != RC_LAST)
2011 break;
2012 case RC_PRINTFILEEXTENSION:
2013 if (ignore_system_lyxrc ||
2014 print_file_extension != system_lyxrc.print_file_extension) {
2015 os << "\\print_file_extension \""
2016 << print_file_extension
2017 << "\"\n";
2019 if (tag != RC_LAST)
2020 break;
2022 os << "\n#\n"
2023 << "# TEX SECTION #######################################\n"
2024 << "#\n\n";
2026 case RC_FONT_ENCODING:
2027 if (ignore_system_lyxrc ||
2028 fontenc != system_lyxrc.fontenc) {
2029 os << "\\font_encoding \"" << fontenc << "\"\n";
2031 if (tag != RC_LAST)
2032 break;
2034 os << "\n#\n"
2035 << "# FILE SECTION ######################################\n"
2036 << "#\n\n";
2038 case RC_DOCUMENTPATH:
2039 if (ignore_system_lyxrc ||
2040 document_path != system_lyxrc.document_path) {
2041 string const path = os::external_path(document_path);
2042 os << "\\document_path \"" << path << "\"\n";
2044 if (tag != RC_LAST)
2045 break;
2046 case RC_USELASTFILEPOS:
2047 if (ignore_system_lyxrc ||
2048 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2049 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2050 << '\n';
2052 if (tag != RC_LAST)
2053 break;
2054 case RC_LOADSESSION:
2055 if (ignore_system_lyxrc ||
2056 load_session != system_lyxrc.load_session) {
2057 os << "\\load_session " << convert<string>(load_session)
2058 << "\n";
2060 if (tag != RC_LAST)
2061 break;
2062 case RC_MOUSE_WHEEL_SPEED:
2063 if (ignore_system_lyxrc ||
2064 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2065 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2067 if (tag != RC_LAST)
2068 break;
2069 case RC_COMPLETION_INLINE_DELAY:
2070 if (ignore_system_lyxrc ||
2071 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2072 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2074 if (tag != RC_LAST)
2075 break;
2076 case RC_COMPLETION_INLINE_MATH:
2077 if (ignore_system_lyxrc ||
2078 completion_inline_math != system_lyxrc.completion_inline_math) {
2079 os << "\\completion_inline_math "
2080 << convert<string>(completion_inline_math) << '\n';
2082 if (tag != RC_LAST)
2083 break;
2084 case RC_COMPLETION_INLINE_TEXT:
2085 if (ignore_system_lyxrc ||
2086 completion_inline_text != system_lyxrc.completion_inline_text) {
2087 os << "\\completion_inline_text "
2088 << convert<string>(completion_inline_text) << '\n';
2090 if (tag != RC_LAST)
2091 break;
2092 case RC_COMPLETION_INLINE_DOTS:
2093 if (ignore_system_lyxrc ||
2094 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2095 os << "\\completion_inline_dots "
2096 << convert<string>(completion_inline_dots) << '\n';
2098 if (tag != RC_LAST)
2099 break;
2100 case RC_AUTOCORRECTION_MATH:
2101 if (ignore_system_lyxrc ||
2102 autocorrection_math != system_lyxrc.autocorrection_math) {
2103 os << "\\autocorrection_math "
2104 << convert<string>(autocorrection_math) << '\n';
2106 if (tag != RC_LAST)
2107 break;
2108 case RC_COMPLETION_POPUP_DELAY:
2109 if (ignore_system_lyxrc ||
2110 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2111 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2113 if (tag != RC_LAST)
2114 break;
2115 case RC_COMPLETION_POPUP_MATH:
2116 if (ignore_system_lyxrc ||
2117 completion_popup_math != system_lyxrc.completion_popup_math) {
2118 os << "\\completion_popup_math "
2119 << convert<string>(completion_popup_math) << '\n';
2121 if (tag != RC_LAST)
2122 break;
2123 case RC_COMPLETION_POPUP_TEXT:
2124 if (ignore_system_lyxrc ||
2125 completion_popup_text != system_lyxrc.completion_popup_text) {
2126 os << "\\completion_popup_text "
2127 << convert<string>(completion_popup_text) << '\n';
2129 if (tag != RC_LAST)
2130 break;
2131 case RC_COMPLETION_CURSOR_TEXT:
2132 if (ignore_system_lyxrc ||
2133 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2134 os << "\\completion_cursor_text "
2135 << convert<string>(completion_cursor_text) << '\n';
2137 if (tag != RC_LAST)
2138 break;
2139 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2140 if (ignore_system_lyxrc ||
2141 completion_popup_after_complete
2142 != system_lyxrc.completion_popup_after_complete) {
2143 os << "\\completion_popup_after_complete "
2144 << convert<string>(completion_popup_after_complete) << '\n';
2146 if (tag != RC_LAST)
2147 break;
2148 case RC_NUMLASTFILES:
2149 if (ignore_system_lyxrc ||
2150 num_lastfiles != system_lyxrc.num_lastfiles) {
2151 os << "\\num_lastfiles " << num_lastfiles << '\n';
2153 if (tag != RC_LAST)
2154 break;
2155 case RC_CHECKLASTFILES:
2156 if (ignore_system_lyxrc ||
2157 check_lastfiles != system_lyxrc.check_lastfiles) {
2158 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2159 << '\n';
2161 if (tag != RC_LAST)
2162 break;
2163 case RC_EXAMPLEPATH:
2164 if (ignore_system_lyxrc ||
2165 example_path != system_lyxrc.example_path) {
2166 string const path = os::external_path(example_path);
2167 os << "\\example_path \"" << path << "\"\n";
2169 if (tag != RC_LAST)
2170 break;
2171 case RC_TEMPLATEPATH:
2172 if (ignore_system_lyxrc ||
2173 template_path != system_lyxrc.template_path) {
2174 string const path = os::external_path(template_path);
2175 os << "\\template_path \"" << path << "\"\n";
2177 if (tag != RC_LAST)
2178 break;
2179 case RC_TEMPDIRPATH:
2180 if (ignore_system_lyxrc ||
2181 tempdir_path != system_lyxrc.tempdir_path) {
2182 string const path = os::external_path(tempdir_path);
2183 os << "\\tempdir_path \"" << path << "\"\n";
2185 if (tag != RC_LAST)
2186 break;
2187 case RC_THESAURUSDIRPATH:
2188 if (ignore_system_lyxrc ||
2189 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2190 string const path = os::external_path(thesaurusdir_path);
2191 os << "\\thesaurusdir_path \"" << path << "\"\n";
2193 if (tag != RC_LAST)
2194 break;
2195 case RC_HUNSPELLDIR_PATH:
2196 if (ignore_system_lyxrc ||
2197 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2198 string const path = os::external_path(hunspelldir_path);
2199 os << "\\hunspelldir_path \"" << path << "\"\n";
2201 if (tag != RC_LAST)
2202 break;
2203 case RC_USETEMPDIR:
2204 if (tag != RC_LAST)
2205 break;
2206 // Ignore it
2207 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2208 if (tag != RC_LAST)
2209 break;
2210 case RC_PLAINTEXT_LINELEN:
2211 if (ignore_system_lyxrc ||
2212 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2213 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2215 if (tag != RC_LAST)
2216 break;
2217 case RC_MAKE_BACKUP:
2218 if (ignore_system_lyxrc ||
2219 make_backup != system_lyxrc.make_backup) {
2220 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2222 if (tag != RC_LAST)
2223 break;
2224 case RC_BACKUPDIR_PATH:
2225 if (ignore_system_lyxrc ||
2226 backupdir_path != system_lyxrc.backupdir_path) {
2227 string const path = os::external_path(backupdir_path);
2228 os << "\\backupdir_path \"" << path << "\"\n";
2230 if (tag != RC_LAST)
2231 break;
2233 os << "\n#\n"
2234 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2235 << "#\n\n";
2237 os << "\n#\n"
2238 << "# SPELLCHECKER SECTION ##############################\n"
2239 << "#\n\n";
2241 case RC_SPELL_COMMAND:
2242 case RC_USE_SPELL_LIB:
2243 // Obsoleted in 2.0
2244 if (tag != RC_LAST)
2245 break;
2246 case RC_ACCEPT_COMPOUND:
2247 if (ignore_system_lyxrc ||
2248 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2249 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2250 << '\n';
2252 if (tag != RC_LAST)
2253 break;
2254 case RC_USE_ALT_LANG:
2255 // Obsoleted in 2.0
2256 if (tag != RC_LAST)
2257 break;
2258 case RC_ALT_LANG:
2259 if (ignore_system_lyxrc ||
2260 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2261 os << "\\alternate_language \"" << spellchecker_alt_lang
2262 << "\"\n";
2264 if (tag != RC_LAST)
2265 break;
2266 case RC_USE_ESC_CHARS:
2267 if (tag != RC_LAST)
2268 break;
2269 case RC_ESC_CHARS:
2270 if (ignore_system_lyxrc ||
2271 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2272 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2274 if (tag != RC_LAST)
2275 break;
2276 case RC_USE_PERS_DICT:
2277 // obsoleted in 2.0
2278 if (tag != RC_LAST)
2279 break;
2280 case RC_USE_TOOLTIP:
2281 if (ignore_system_lyxrc ||
2282 use_tooltip != system_lyxrc.use_tooltip) {
2283 os << "\\use_tooltip "
2284 << convert<string>(use_tooltip)
2285 << '\n';
2287 if (tag != RC_LAST)
2288 break;
2289 case RC_USE_PIXMAP_CACHE:
2290 if (ignore_system_lyxrc ||
2291 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2292 os << "\\use_pixmap_cache "
2293 << convert<string>(use_pixmap_cache)
2294 << '\n';
2296 if (tag != RC_LAST)
2297 break;
2298 case RC_PERS_DICT:
2299 // obsoleted in 2.0
2300 if (tag != RC_LAST)
2301 break;
2302 case RC_USE_INP_ENC:
2303 // obsoleted in 2.0
2304 if (tag != RC_LAST)
2305 break;
2307 os << "\n#\n"
2308 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2309 << "#\n\n";
2310 if (tag != RC_LAST)
2311 break;
2313 case RC_SPELLCHECKER:
2314 if (ignore_system_lyxrc ||
2315 spellchecker != system_lyxrc.spellchecker) {
2316 os << "\\spellchecker " << spellchecker << '\n';
2318 if (tag != RC_LAST)
2319 break;
2321 case RC_SPELLCHECK_CONTINUOUSLY:
2322 if (ignore_system_lyxrc ||
2323 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2324 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2325 << '\n';
2327 if (tag != RC_LAST)
2328 break;
2330 case RC_RTL_SUPPORT:
2331 if (ignore_system_lyxrc ||
2332 rtl_support != system_lyxrc.rtl_support) {
2333 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2335 if (tag != RC_LAST)
2336 break;
2337 case RC_VISUAL_CURSOR:
2338 if (ignore_system_lyxrc ||
2339 visual_cursor != system_lyxrc.visual_cursor) {
2340 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2342 if (tag != RC_LAST)
2343 break;
2344 case RC_LANGUAGE_PACKAGE:
2345 if (ignore_system_lyxrc ||
2346 language_package != system_lyxrc.language_package) {
2347 os << "\\language_package \"" << language_package
2348 << "\"\n";
2350 if (tag != RC_LAST)
2351 break;
2352 case RC_LANGUAGE_GLOBAL_OPTIONS:
2353 if (ignore_system_lyxrc ||
2354 language_global_options
2355 != system_lyxrc.language_global_options) {
2356 os << "\\language_global_options \""
2357 << convert<string>(language_global_options)
2358 << "\"\n";
2360 if (tag != RC_LAST)
2361 break;
2362 case RC_LANGUAGE_USE_BABEL:
2363 if (ignore_system_lyxrc ||
2364 language_use_babel != system_lyxrc.language_use_babel) {
2365 os << "\\language_use_babel \""
2366 << convert<string>(language_use_babel)
2367 << "\"\n";
2369 if (tag != RC_LAST)
2370 break;
2371 case RC_LANGUAGE_COMMAND_BEGIN:
2372 if (ignore_system_lyxrc ||
2373 language_command_begin
2374 != system_lyxrc.language_command_begin) {
2375 os << "\\language_command_begin \""
2376 << language_command_begin
2377 << "\"\n";
2379 if (tag != RC_LAST)
2380 break;
2381 case RC_LANGUAGE_COMMAND_END:
2382 if (ignore_system_lyxrc ||
2383 language_command_end
2384 != system_lyxrc.language_command_end) {
2385 os << "\\language_command_end \"" << language_command_end
2386 << "\"\n";
2388 if (tag != RC_LAST)
2389 break;
2390 case RC_LANGUAGE_COMMAND_LOCAL:
2391 if (ignore_system_lyxrc ||
2392 language_command_local
2393 != system_lyxrc.language_command_local) {
2394 os << "\\language_command_local \""
2395 << language_command_local
2396 << "\"\n";
2398 if (tag != RC_LAST)
2399 break;
2400 case RC_LANGUAGE_AUTO_BEGIN:
2401 if (ignore_system_lyxrc ||
2402 language_auto_begin != system_lyxrc.language_auto_begin) {
2403 os << "\\language_auto_begin "
2404 << convert<string>(language_auto_begin) << '\n';
2406 if (tag != RC_LAST)
2407 break;
2408 case RC_LANGUAGE_AUTO_END:
2409 if (ignore_system_lyxrc ||
2410 language_auto_end != system_lyxrc.language_auto_end) {
2411 os << "\\language_auto_end "
2412 << convert<string>(language_auto_end) << '\n';
2414 if (tag != RC_LAST)
2415 break;
2416 case RC_MARK_FOREIGN_LANGUAGE:
2417 if (ignore_system_lyxrc ||
2418 mark_foreign_language
2419 != system_lyxrc.mark_foreign_language) {
2420 os << "\\mark_foreign_language " <<
2421 convert<string>(mark_foreign_language) << '\n';
2423 if (tag != RC_LAST)
2424 break;
2426 os << "\n#\n"
2427 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2428 << "#\n\n";
2430 case RC_AUTO_NUMBER:
2431 if (ignore_system_lyxrc ||
2432 auto_number != system_lyxrc.auto_number) {
2433 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2435 if (tag != RC_LAST)
2436 break;
2437 case RC_DEFAULT_LANGUAGE:
2438 if (ignore_system_lyxrc ||
2439 default_language != system_lyxrc.default_language) {
2440 os << "\\default_language " << default_language << '\n';
2442 if (tag != RC_LAST)
2443 break;
2444 case RC_GUI_LANGUAGE:
2445 if (ignore_system_lyxrc ||
2446 gui_language != system_lyxrc.gui_language) {
2447 os << "\\gui_language " << gui_language << '\n';
2449 if (tag != RC_LAST)
2450 break;
2452 os << "\n#\n"
2453 << "# FORMATS SECTION ##########################\n"
2454 << "#\n\n";
2456 case RC_FORMAT:
2457 // New/modified formats
2458 for (Formats::const_iterator cit = formats.begin();
2459 cit != formats.end(); ++cit) {
2460 Format const * format =
2461 system_formats.getFormat(cit->name());
2462 if (!format ||
2463 format->extension() != cit->extension() ||
2464 format->prettyname() != cit->prettyname() ||
2465 format->shortcut() != cit->shortcut() ||
2466 format->viewer() != cit->viewer() ||
2467 format->editor() != cit->editor() ||
2468 format->documentFormat() != cit->documentFormat() ||
2469 format->vectorFormat() != cit->vectorFormat()) {
2470 os << "\\format \"" << cit->name() << "\" \""
2471 << cit->extension() << "\" \""
2472 << cit->prettyname() << "\" \""
2473 << cit->shortcut() << "\" \""
2474 << escapeCommand(cit->viewer()) << "\" \""
2475 << escapeCommand(cit->editor()) << "\" \"";
2476 vector<string> flags;
2477 if (cit->documentFormat())
2478 flags.push_back("document");
2479 if (cit->vectorFormat())
2480 flags.push_back("vector");
2481 os << getStringFromVector(flags);
2482 os << "\"\n";
2486 // Look for deleted formats
2487 for (Formats::const_iterator cit = system_formats.begin();
2488 cit != system_formats.end(); ++cit)
2489 if (!formats.getFormat(cit->name()))
2490 os << "\\format \"" << cit->name()
2491 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2492 if (tag != RC_LAST)
2493 break;
2494 case RC_VIEWER_ALTERNATIVES: {
2495 Alternatives::const_iterator it = viewer_alternatives.begin();
2496 Alternatives::const_iterator const en = viewer_alternatives.end();
2497 Alternatives::const_iterator const sysend =
2498 system_lyxrc.viewer_alternatives.end();
2499 for (; it != en; ++it) {
2500 string const & fmt = it->first;
2501 CommandSet const & cmd = it->second;
2502 CommandSet::const_iterator sit = cmd.begin();
2503 CommandSet::const_iterator const sen = cmd.end();
2504 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2505 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2506 system_lyxrc.viewer_alternatives.find(fmt);
2507 for (; sit != sen; ++sit) {
2508 string const & cmd = *sit;
2509 if (ignore_system_lyxrc
2510 || sysfmt == sysend // format not found
2511 || sysfmt->second.count(cmd) == 0 // this command not found
2513 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2516 if (tag != RC_LAST)
2517 break;
2519 case RC_EDITOR_ALTERNATIVES: {
2520 Alternatives::const_iterator it = editor_alternatives.begin();
2521 Alternatives::const_iterator const en = editor_alternatives.end();
2522 Alternatives::const_iterator const sysend =
2523 system_lyxrc.editor_alternatives.end();
2524 for (; it != en; ++it) {
2525 string const & fmt = it->first;
2526 CommandSet const & cmd = it->second;
2527 CommandSet::const_iterator sit = cmd.begin();
2528 CommandSet::const_iterator const sen = cmd.end();
2529 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2530 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2531 system_lyxrc.editor_alternatives.find(fmt);
2532 for (; sit != sen; ++sit) {
2533 string const & cmd = *sit;
2534 if (ignore_system_lyxrc
2535 || sysfmt == sysend // format not found
2536 || sysfmt->second.count(cmd) == 0 // this command not found
2538 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2541 if (tag != RC_LAST)
2542 break;
2544 case RC_DEFAULT_VIEW_FORMAT:
2545 if (ignore_system_lyxrc ||
2546 default_view_format != system_lyxrc.default_view_format) {
2547 os << "\\default_view_format " << default_view_format << '\n';
2549 if (tag != RC_LAST)
2550 break;
2551 case RC_VIEWER:
2552 // Ignore it
2553 if (tag != RC_LAST)
2554 break;
2556 os << "\n#\n"
2557 << "# CONVERTERS SECTION ##########################\n"
2558 << "#\n\n";
2560 case RC_CONVERTER:
2561 // Look for new converters
2562 for (Converters::const_iterator cit = theConverters().begin();
2563 cit != theConverters().end(); ++cit) {
2564 Converter const * converter =
2565 theSystemConverters().getConverter(cit->from,
2566 cit->to);
2567 if (!converter ||
2568 converter->command != cit->command ||
2569 converter->flags != cit->flags)
2570 os << "\\converter \"" << cit->from << "\" \""
2571 << cit->to << "\" \""
2572 << escapeCommand(cit->command) << "\" \""
2573 << cit->flags << "\"\n";
2576 // New/modifed converters
2577 for (Converters::const_iterator cit = theSystemConverters().begin();
2578 cit != theSystemConverters().end(); ++cit)
2579 if (!theConverters().getConverter(cit->from, cit->to))
2580 os << "\\converter \"" << cit->from
2581 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2582 if (tag != RC_LAST)
2583 break;
2585 case RC_COPIER:
2586 if (tag == RC_LAST)
2587 os << "\n#\n"
2588 << "# COPIERS SECTION ##########################\n"
2589 << "#\n\n";
2591 // Look for new movers
2592 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2593 Movers::const_iterator const sysend = theSystemMovers().end();
2594 Movers::const_iterator it = theMovers().begin();
2595 Movers::const_iterator end = theMovers().end();
2597 for (; it != end; ++it) {
2598 Movers::const_iterator const sysit =
2599 find_if(sysbegin, sysend, SameMover(*it));
2600 if (sysit == sysend) {
2601 string const & fmt = it->first;
2602 string const & command =
2603 it->second.command();
2605 os << "\\copier " << fmt
2606 << " \"" << escapeCommand(command) << "\"\n";
2609 if (tag != RC_LAST)
2610 break;
2612 // We don't actually delete SpecialisedMover(s) from the
2613 // map, just clear their 'command', so there's no need
2614 // to test for anything else.
2617 os.flush();
2621 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2623 // Why the switch you might ask. It is a trick to ensure that all
2624 // the elements in the LyXRCTags enum is handled. As you can see
2625 // there are no breaks at all. So it is just a huge fall-through.
2626 // The nice thing is that we will get a warning from the compiler
2627 // if we forget an element.
2628 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2629 switch (tag) {
2630 case LyXRC::RC_ACCEPT_COMPOUND:
2631 case LyXRC::RC_ALT_LANG:
2632 case LyXRC::RC_PLAINTEXT_LINELEN:
2633 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2634 case LyXRC::RC_AUTOCORRECTION_MATH:
2635 case LyXRC::RC_AUTOREGIONDELETE:
2636 case LyXRC::RC_AUTORESET_OPTIONS:
2637 case LyXRC::RC_AUTOSAVE:
2638 case LyXRC::RC_AUTO_NUMBER:
2639 case LyXRC::RC_BACKUPDIR_PATH:
2640 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2641 case LyXRC::RC_BIBTEX_COMMAND:
2642 case LyXRC::RC_BINDFILE:
2643 case LyXRC::RC_CHECKLASTFILES:
2644 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2645 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2646 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2647 case LyXRC::RC_COMPLETION_INLINE_MATH:
2648 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2649 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2650 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2651 case LyXRC::RC_COMPLETION_POPUP_MATH:
2652 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2653 case LyXRC::RC_USELASTFILEPOS:
2654 case LyXRC::RC_LOADSESSION:
2655 case LyXRC::RC_CHKTEX_COMMAND:
2656 case LyXRC::RC_CONVERTER:
2657 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2658 case LyXRC::RC_COPIER:
2659 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2660 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2661 case LyXRC::RC_DATE_INSERT_FORMAT:
2662 case LyXRC::RC_DEFAULT_LANGUAGE:
2663 case LyXRC::RC_GUI_LANGUAGE:
2664 case LyXRC::RC_DEFAULT_PAPERSIZE:
2665 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2666 case LyXRC::RC_DEFFILE:
2667 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2668 case LyXRC::RC_DISPLAY_GRAPHICS:
2669 case LyXRC::RC_DOCUMENTPATH:
2670 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2671 FileName path(lyxrc_new.document_path);
2672 if (path.exists() && path.isDirectory())
2673 package().document_dir() = FileName(lyxrc.document_path);
2675 case LyXRC::RC_EDITOR_ALTERNATIVES:
2676 case LyXRC::RC_ESC_CHARS:
2677 case LyXRC::RC_EXAMPLEPATH:
2678 case LyXRC::RC_FONT_ENCODING:
2679 case LyXRC::RC_FORMAT:
2680 case LyXRC::RC_GROUP_LAYOUTS:
2681 case LyXRC::RC_HUNSPELLDIR_PATH:
2682 case LyXRC::RC_INDEX_ALTERNATIVES:
2683 case LyXRC::RC_INDEX_COMMAND:
2684 case LyXRC::RC_JBIBTEX_COMMAND:
2685 case LyXRC::RC_JINDEX_COMMAND:
2686 case LyXRC::RC_NOMENCL_COMMAND:
2687 case LyXRC::RC_INPUT:
2688 case LyXRC::RC_KBMAP:
2689 case LyXRC::RC_KBMAP_PRIMARY:
2690 case LyXRC::RC_KBMAP_SECONDARY:
2691 case LyXRC::RC_LABEL_INIT_LENGTH:
2692 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2693 case LyXRC::RC_LANGUAGE_AUTO_END:
2694 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2695 case LyXRC::RC_LANGUAGE_COMMAND_END:
2696 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2697 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2698 case LyXRC::RC_LANGUAGE_PACKAGE:
2699 case LyXRC::RC_LANGUAGE_USE_BABEL:
2700 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2701 case LyXRC::RC_MACRO_EDIT_STYLE:
2702 case LyXRC::RC_MAKE_BACKUP:
2703 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2704 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2705 case LyXRC::RC_NUMLASTFILES:
2706 case LyXRC::RC_PARAGRAPH_MARKERS:
2707 case LyXRC::RC_PATH_PREFIX:
2708 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2709 prependEnvPath("PATH", lyxrc.path_prefix);
2711 case LyXRC::RC_PERS_DICT:
2712 case LyXRC::RC_PREVIEW:
2713 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2714 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2715 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2716 case LyXRC::RC_PRINTCOPIESFLAG:
2717 case LyXRC::RC_PRINTER:
2718 case LyXRC::RC_PRINTEVENPAGEFLAG:
2719 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2720 case LyXRC::RC_PRINTFILEEXTENSION:
2721 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2722 case LyXRC::RC_PRINTODDPAGEFLAG:
2723 case LyXRC::RC_PRINTPAGERANGEFLAG:
2724 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2725 case LyXRC::RC_PRINTPAPERFLAG:
2726 case LyXRC::RC_PRINTREVERSEFLAG:
2727 case LyXRC::RC_PRINTSPOOL_COMMAND:
2728 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2729 case LyXRC::RC_PRINTTOFILE:
2730 case LyXRC::RC_PRINTTOPRINTER:
2731 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2732 case LyXRC::RC_PRINT_COMMAND:
2733 case LyXRC::RC_RTL_SUPPORT:
2734 case LyXRC::RC_SCREEN_DPI:
2735 case LyXRC::RC_SCREEN_FONT_ROMAN:
2736 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2737 case LyXRC::RC_SCREEN_FONT_SANS:
2738 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2739 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2740 case LyXRC::RC_SCREEN_FONT_SIZES:
2741 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2742 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2743 case LyXRC::RC_GEOMETRY_SESSION:
2744 case LyXRC::RC_SCREEN_ZOOM:
2745 case LyXRC::RC_SERVERPIPE:
2746 case LyXRC::RC_SET_COLOR:
2747 case LyXRC::RC_SHOW_BANNER:
2748 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2749 case LyXRC::RC_SPELL_COMMAND:
2750 case LyXRC::RC_SPELLCHECKER:
2751 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2752 case LyXRC::RC_SPLITINDEX_COMMAND:
2753 case LyXRC::RC_TEMPDIRPATH:
2754 case LyXRC::RC_TEMPLATEPATH:
2755 case LyXRC::RC_TEX_ALLOWS_SPACES:
2756 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2757 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2758 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2760 case LyXRC::RC_THESAURUSDIRPATH:
2761 case LyXRC::RC_UIFILE:
2762 case LyXRC::RC_USER_EMAIL:
2763 case LyXRC::RC_USER_NAME:
2764 case LyXRC::RC_USETEMPDIR:
2765 case LyXRC::RC_USE_ALT_LANG:
2766 case LyXRC::RC_USE_CONVERTER_CACHE:
2767 case LyXRC::RC_USE_ESC_CHARS:
2768 case LyXRC::RC_USE_INP_ENC:
2769 case LyXRC::RC_USE_PERS_DICT:
2770 case LyXRC::RC_USE_TOOLTIP:
2771 case LyXRC::RC_USE_PIXMAP_CACHE:
2772 case LyXRC::RC_USE_SPELL_LIB:
2773 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2774 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2775 case LyXRC::RC_SORT_LAYOUTS:
2776 case LyXRC::RC_FULL_SCREEN_LIMIT:
2777 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2778 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2779 case LyXRC::RC_FULL_SCREEN_TABBAR:
2780 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2781 case LyXRC::RC_FULL_SCREEN_WIDTH:
2782 case LyXRC::RC_VISUAL_CURSOR:
2783 case LyXRC::RC_VIEWER:
2784 case LyXRC::RC_VIEWER_ALTERNATIVES:
2785 case LyXRC::RC_LAST:
2786 break;
2791 #if 0
2792 string const LyXRC::getDescription(LyXRCTags tag)
2794 docstring str;
2796 switch (tag) {
2797 case RC_ACCEPT_COMPOUND:
2798 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2799 break;
2801 case RC_ALT_LANG:
2802 case RC_USE_ALT_LANG:
2803 str = _("Specify an alternate language. The default is to use the language of the document.");
2804 break;
2806 case RC_PLAINTEXT_ROFF_COMMAND:
2807 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.");
2808 break;
2810 case RC_PLAINTEXT_LINELEN:
2811 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.");
2812 break;
2814 case RC_AUTOREGIONDELETE:
2815 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2816 break;
2818 case RC_AUTORESET_OPTIONS:
2819 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2820 break;
2822 case RC_AUTOSAVE:
2823 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2824 break;
2826 case RC_AUTO_NUMBER:
2827 break;
2829 case RC_BACKUPDIR_PATH:
2830 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.");
2831 break;
2833 case RC_BIBTEX_COMMAND:
2834 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2835 break;
2837 case RC_JBIBTEX_COMMAND:
2838 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2839 break;
2841 case RC_BINDFILE:
2842 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2843 break;
2845 case RC_CHECKLASTFILES:
2846 str = _("Select to check whether the lastfiles still exist.");
2847 break;
2849 case RC_CHKTEX_COMMAND:
2850 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2851 break;
2853 case RC_CONVERTER:
2854 break;
2856 case RC_COPIER:
2857 break;
2859 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2860 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.");
2861 break;
2863 case RC_SCROLL_BELOW_DOCUMENT:
2864 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");
2865 break;
2867 case RC_MAC_LIKE_WORD_MOVEMENT:
2868 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2869 break;
2871 case RC_SHOW_MACRO_LABEL:
2872 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2873 break;
2875 case RC_DATE_INSERT_FORMAT:
2876 //xgettext:no-c-format
2877 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2878 break;
2880 case RC_DEFFILE:
2881 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2882 break;
2884 case RC_DEFAULT_VIEW_FORMAT:
2885 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2886 break;
2888 case RC_DEFAULT_LANGUAGE:
2889 str = _("New documents will be assigned this language.");
2890 break;
2892 case RC_DEFAULT_PAPERSIZE:
2893 str = _("Specify the default paper size.");
2894 break;
2896 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2897 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2898 break;
2900 case RC_DISPLAY_GRAPHICS:
2901 str = _("Select how LyX will display any graphics.");
2902 break;
2904 case RC_DOCUMENTPATH:
2905 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2906 break;
2908 case RC_ESC_CHARS:
2909 case RC_USE_ESC_CHARS:
2910 str = _("Specify additional chars that can be part of a word.");
2911 break;
2913 case RC_EXAMPLEPATH:
2914 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2915 break;
2917 case RC_FONT_ENCODING:
2918 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2919 break;
2921 case RC_FORMAT:
2922 break;
2924 case RC_INDEX_COMMAND:
2925 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\".");
2926 break;
2928 case RC_JINDEX_COMMAND:
2929 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2930 break;
2932 case RC_NOMENCL_COMMAND:
2933 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2934 break;
2936 case RC_INPUT:
2937 break;
2939 case RC_KBMAP:
2940 case RC_KBMAP_PRIMARY:
2941 case RC_KBMAP_SECONDARY:
2942 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.");
2943 break;
2945 case RC_LABEL_INIT_LENGTH:
2946 str = _("Maximum number of words in the initialization string for a new label");
2947 break;
2949 case RC_LANGUAGE_AUTO_BEGIN:
2950 str = _("Select if a language switching command is needed at the beginning of the document.");
2951 break;
2953 case RC_LANGUAGE_AUTO_END:
2954 str = _("Select if a language switching command is needed at the end of the document.");
2955 break;
2957 case RC_LANGUAGE_COMMAND_BEGIN:
2958 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.");
2959 break;
2961 case RC_LANGUAGE_COMMAND_END:
2962 str = _("The LaTeX command for changing back to the language of the document.");
2963 break;
2965 case RC_LANGUAGE_COMMAND_LOCAL:
2966 str = _("The LaTeX command for local changing of the language.");
2967 break;
2969 case RC_LANGUAGE_GLOBAL_OPTIONS:
2970 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2971 break;
2973 case RC_LANGUAGE_PACKAGE:
2974 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2975 break;
2977 case RC_LANGUAGE_USE_BABEL:
2978 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2979 break;
2981 case RC_USELASTFILEPOS:
2982 str = _("De-select if you do not want LyX to scroll to saved position.");
2983 break;
2985 case RC_LOADSESSION:
2986 str = _("De-select to prevent loading files opened from the last LyX session.");
2987 break;
2989 case RC_MAKE_BACKUP:
2990 str = _("De-select if you don't want LyX to create backup files.");
2991 break;
2993 case RC_MARK_FOREIGN_LANGUAGE:
2994 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2995 break;
2997 case RC_MOUSE_WHEEL_SPEED:
2998 str = bformat(_("The scrolling speed of the mouse wheel."),
2999 maxlastfiles);
3000 break;
3002 case RC_COMPLETION_POPUP_DELAY:
3003 str = _("The completion popup delay.");
3004 break;
3006 case RC_COMPLETION_POPUP_MATH:
3007 str = _("Select to display the completion popup in math mode.");
3008 break;
3010 case RC_COMPLETION_POPUP_TEXT:
3011 str = _("Select to display the completion popup in text mode.");
3012 break;
3014 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3015 str = _("Show the completion popup without delay after non-unique completion attempt.");
3016 break;
3018 case RC_COMPLETION_POPUP_TEXT:
3019 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3020 break;
3022 case RC_COMPLETION_POPUP_DELAY:
3023 str = _("The inline completion delay.");
3024 break;
3026 case RC_COMPLETION_INLINE_MATH:
3027 str = _("Select to display the inline completion in math mode.");
3028 break;
3030 case RC_COMPLETION_INLINE_TEXT:
3031 str = _("Select to display the inline completion in text mode.");
3032 break;
3034 case RC_COMPLETION_INLINE_DOTS:
3035 str = _("Use \"...\" to shorten long completions.");
3036 break;
3038 case RC_AUTOCORRECTION_MATH:
3039 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3040 break;
3042 case RC_NUMLASTFILES:
3043 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3044 maxlastfiles);
3045 break;
3047 case RC_PATH_PREFIX:
3048 str = _("Specify those directories which should be "
3049 "prepended to the PATH environment variable. "
3050 "Use the OS native format.");
3051 break;
3053 case RC_PREVIEW:
3054 str = _("Shows a typeset preview of things such as math");
3055 break;
3057 case RC_PREVIEW_HASHED_LABELS:
3058 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3059 break;
3061 case RC_PREVIEW_SCALE_FACTOR:
3062 str = _("Scale the preview size to suit.");
3063 break;
3065 case RC_PRINTCOLLCOPIESFLAG:
3066 str = _("The option for specifying whether the copies should be collated.");
3067 break;
3069 case RC_PRINTCOPIESFLAG:
3070 str = _("The option for specifying the number of copies to print.");
3071 break;
3073 case RC_PRINTER:
3074 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3075 break;
3077 case RC_PRINTEVENPAGEFLAG:
3078 str = _("The option to print only even pages.");
3079 break;
3081 case RC_PRINTEXSTRAOPTIONS:
3082 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3083 break;
3085 case RC_PRINTFILEEXTENSION:
3086 str = _("Extension of printer program output file. Usually \".ps\".");
3087 break;
3089 case RC_PRINTLANDSCAPEFLAG:
3090 str = _("The option to print out in landscape.");
3091 break;
3093 case RC_PRINTODDPAGEFLAG:
3094 str = _("The option to print only odd pages.");
3095 break;
3097 case RC_PRINTPAGERANGEFLAG:
3098 str = _("The option for specifying a comma-separated list of pages to print.");
3099 break;
3101 case RC_PRINTPAPERDIMENSIONFLAG:
3102 str = _("Option to specify the dimensions of the print paper.");
3103 break;
3105 case RC_PRINTPAPERFLAG:
3106 str = _("The option to specify paper type.");
3107 break;
3109 case RC_PRINTREVERSEFLAG:
3110 str = _("The option to reverse the order of the pages printed.");
3111 break;
3113 case RC_PRINTSPOOL_COMMAND:
3114 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.");
3115 break;
3117 case RC_PRINTSPOOL_PRINTERPREFIX:
3118 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.");
3119 break;
3121 case RC_PRINTTOFILE:
3122 str = _("Option to pass to the print program to print to a file.");
3123 break;
3125 case RC_PRINTTOPRINTER:
3126 str = _("Option to pass to the print program to print on a specific printer.");
3127 break;
3129 case RC_PRINT_ADAPTOUTPUT:
3130 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3131 break;
3133 case RC_PRINT_COMMAND:
3134 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3135 break;
3137 case RC_RTL_SUPPORT:
3138 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3139 break;
3141 case RC_VISUAL_CURSOR:
3142 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3143 break;
3145 case RC_SCREEN_DPI:
3146 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3147 break;
3149 case RC_SCREEN_FONT_ROMAN:
3150 case RC_SCREEN_FONT_SANS:
3151 case RC_SCREEN_FONT_TYPEWRITER:
3152 str = _("The screen fonts used to display the text while editing.");
3153 break;
3155 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3156 case RC_SCREEN_FONT_SANS_FOUNDRY:
3157 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3158 break;
3160 case RC_SCREEN_FONT_SCALABLE:
3161 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.");
3162 break;
3164 case RC_SCREEN_FONT_SIZES:
3165 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3166 break;
3168 case RC_SCREEN_ZOOM:
3169 //xgettext:no-c-format
3170 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3171 break;
3173 case RC_GEOMETRY_SESSION:
3174 str = _("Allow session manager to save and restore windows geometry.");
3175 break;
3177 case RC_SERVERPIPE:
3178 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3179 break;
3181 case RC_SET_COLOR:
3182 break;
3184 case RC_SHOW_BANNER:
3185 str = _("De-select if you don't want the startup banner.");
3186 break;
3188 case RC_TEMPDIRPATH:
3189 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3190 break;
3192 case RC_THESAURUSDIRPATH:
3193 str = _("This is the place where the files of the thesaurus library reside.");
3194 break;
3196 case RC_TEMPLATEPATH:
3197 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3198 break;
3200 case RC_TEX_ALLOWS_SPACES:
3201 break;
3203 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3204 break;
3206 case RC_UIFILE:
3207 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3208 break;
3210 case RC_USER_EMAIL:
3211 break;
3213 case RC_USER_NAME:
3214 break;
3216 case RC_USETEMPDIR:
3217 break;
3219 case RC_USE_TOOLTIP:
3220 str = _("Enable the automatic appearance of tool tips in the work area.");
3221 break;
3223 case RC_USE_PIXMAP_CACHE:
3224 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3225 break;
3227 case RC_USE_SPELL_LIB:
3228 break;
3230 case RC_VIEWDVI_PAPEROPTION:
3231 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3232 break;
3234 case RC_VIEWER:
3235 break;
3237 case RC_LAST:
3238 break;
3241 return str;
3243 #endif
3246 // The global instance
3247 LyXRC lyxrc;
3249 // The global copy of the system lyxrc entries (everything except preferences)
3250 LyXRC system_lyxrc;
3253 } // namespace lyx