3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/filetools.h"
36 #include "support/gettext.h"
37 #include "support/lstrings.h"
38 #include "support/os.h"
39 #include "support/userinfo.h"
45 using namespace lyx::support
;
49 namespace os
= support::os
;
53 // when adding something to this array keep it sorted!
54 LexerKeyword lyxrcTags
[] = {
55 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND
},
56 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION
},
57 { "\\alternate_language", LyXRC::RC_ALT_LANG
},
58 { "\\auto_number", LyXRC::RC_AUTO_NUMBER
},
59 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE
},
60 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS
},
61 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH
},
62 { "\\autosave", LyXRC::RC_AUTOSAVE
},
63 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH
},
64 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES
},
65 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND
},
66 { "\\bind_file", LyXRC::RC_BINDFILE
},
67 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES
},
68 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND
},
69 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT
},
70 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY
},
71 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS
},
72 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH
},
73 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT
},
74 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE
},
75 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY
},
76 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH
},
77 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT
},
78 { "\\converter", LyXRC::RC_CONVERTER
},
79 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE
},
80 { "\\copier", LyXRC::RC_COPIER
},
81 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR
},
82 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT
},
83 { "\\def_file", LyXRC::RC_DEFFILE
},
84 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE
},
85 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE
},
86 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT
},
87 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN
},
88 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS
},
89 { "\\document_path", LyXRC::RC_DOCUMENTPATH
},
90 { "\\escape_chars", LyXRC::RC_ESC_CHARS
},
91 { "\\example_path", LyXRC::RC_EXAMPLEPATH
},
92 { "\\font_encoding", LyXRC::RC_FONT_ENCODING
},
93 { "\\format", LyXRC::RC_FORMAT
},
94 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT
},
95 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR
},
96 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR
},
97 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR
},
98 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS
},
99 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH
},
100 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS
},
101 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE
},
102 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH
},
103 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES
},
104 { "\\index_command", LyXRC::RC_INDEX_COMMAND
},
105 { "\\input", LyXRC::RC_INPUT
},
106 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND
},
107 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND
},
108 { "\\kbmap", LyXRC::RC_KBMAP
},
109 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY
},
110 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY
},
111 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH
},
112 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN
},
113 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END
},
114 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN
},
115 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END
},
116 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL
},
117 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS
},
118 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE
},
119 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL
},
120 { "\\load_session", LyXRC::RC_LOADSESSION
},
121 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT
},
122 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE
},
123 { "\\make_backup", LyXRC::RC_MAKE_BACKUP
},
124 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE
},
125 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED
},
126 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND
},
127 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES
},
128 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS
},
129 { "\\path_prefix", LyXRC::RC_PATH_PREFIX
},
130 { "\\personal_dictionary", LyXRC::RC_PERS_DICT
},
131 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN
},
132 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND
},
133 { "\\preview", LyXRC::RC_PREVIEW
},
134 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS
},
135 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR
},
136 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT
},
137 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG
},
138 { "\\print_command", LyXRC::RC_PRINT_COMMAND
},
139 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG
},
140 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG
},
141 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS
},
142 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION
},
143 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG
},
144 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG
},
145 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG
},
146 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG
},
147 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG
},
148 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG
},
149 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND
},
150 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX
},
151 { "\\print_to_file", LyXRC::RC_PRINTTOFILE
},
152 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER
},
153 { "\\printer", LyXRC::RC_PRINTER
},
154 { "\\rtl", LyXRC::RC_RTL_SUPPORT
},
155 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI
},
156 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN
},
157 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY
},
158 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS
},
159 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY
},
160 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE
},
161 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES
},
162 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER
},
163 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY
},
164 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM
},
165 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT
},
166 { "\\serverpipe", LyXRC::RC_SERVERPIPE
},
167 { "\\set_color", LyXRC::RC_SET_COLOR
},
168 { "\\show_banner", LyXRC::RC_SHOW_BANNER
},
169 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS
},
170 { "\\spell_command", LyXRC::RC_SPELL_COMMAND
},
171 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY
},
172 { "\\spellchecker", LyXRC::RC_SPELLCHECKER
},
173 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND
},
174 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH
},
175 { "\\template_path", LyXRC::RC_TEMPLATEPATH
},
176 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES
},
177 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS
},
178 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH
},
179 { "\\ui_file", LyXRC::RC_UIFILE
},
180 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG
},
181 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE
},
182 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS
},
183 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC
},
184 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS
},
185 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT
},
186 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE
},
187 // compatibility with versions older than 1.4.0 only
188 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB
},
189 // compatibility with versions older than 1.4.0 only
190 { "\\use_tempdir", LyXRC::RC_USETEMPDIR
},
191 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP
},
192 { "\\user_email", LyXRC::RC_USER_EMAIL
},
193 { "\\user_name", LyXRC::RC_USER_NAME
},
194 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION
},
195 // compatibility with versions older than 1.4.0 only
196 { "\\viewer", LyXRC::RC_VIEWER
},
197 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR
}
200 const int lyxrcCount
= sizeof(lyxrcTags
) / sizeof(lyxrcTags
[0]);
211 void LyXRC::setDefaults()
214 def_file
= "default";
216 // Get printer from the environment. If fail, use default "",
217 // assuming that everything is set up correctly.
218 printer
= getEnv("PRINTER");
219 print_adapt_output
= false;
220 print_command
= "dvips";
221 print_evenpage_flag
= "-B";
222 print_oddpage_flag
= "-A";
223 print_pagerange_flag
= "-pp";
224 print_copies_flag
= "-c";
225 print_collcopies_flag
= "-C";
226 print_reverse_flag
= "-r";
227 print_landscape_flag
= "-t landscape";
228 print_to_printer
= "-P";
229 print_to_file
= "-o ";
230 print_file_extension
= ".ps";
231 print_paper_flag
= "-t";
232 print_paper_dimension_flag
= "-T";
233 document_path
.erase();
234 view_dvi_paper_option
.erase();
235 default_papersize
= PAPER_DEFAULT
;
236 default_view_format
= "pdf2";
237 chktex_command
= "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
238 bibtex_command
= "bibtex";
240 index_command
= "makeindex -c -q";
241 nomencl_command
= "makeindex -s nomencl.ist";
243 // Because a screen typically is wider than a piece of paper:
245 allow_geometry_session
= true;
246 // Default LaTeX font size:
247 font_sizes
[FONT_SIZE_TINY
] = "5.0";
248 font_sizes
[FONT_SIZE_SCRIPT
] = "7.0";
249 font_sizes
[FONT_SIZE_FOOTNOTE
] = "8.0";
250 font_sizes
[FONT_SIZE_SMALL
] = "9.0";
251 font_sizes
[FONT_SIZE_NORMAL
] = "10.0";
252 font_sizes
[FONT_SIZE_LARGE
] = "12.0";
253 font_sizes
[FONT_SIZE_LARGER
] = "14.4";
254 font_sizes
[FONT_SIZE_LARGEST
] = "17.26";
255 font_sizes
[FONT_SIZE_HUGE
] = "20.74";
256 font_sizes
[FONT_SIZE_HUGER
] = "24.88";
257 use_scalable_fonts
= true;
258 roman_font_name
= "";
260 typewriter_font_name
= "";
262 auto_region_delete
= true;
263 auto_reset_options
= false;
264 plaintext_linelen
= 65;
265 mouse_wheel_speed
= 1.0;
266 num_lastfiles
= maxlastfiles
;
267 check_lastfiles
= true;
268 use_lastfilepos
= true;
269 load_session
= false;
271 backupdir_path
.erase();
272 display_graphics
= true;
273 // Spellchecker settings:
274 spellchecker
= "aspell";
275 spellchecker_accept_compound
= false;
276 spellcheck_continuously
= false;
279 visual_cursor
= false;
281 mark_foreign_language
= true;
282 language_auto_begin
= true;
283 language_auto_end
= true;
284 language_global_options
= true;
285 language_use_babel
= true;
286 language_package
= "\\usepackage{babel}";
287 language_command_begin
= "\\selectlanguage{$$lang}";
288 language_command_local
= "\\foreignlanguage{$$lang}{";
289 sort_layouts
= false;
290 group_layouts
= true;
291 default_language
= "english";
292 gui_language
= "auto";
294 windows_style_tex_paths
= false;
295 tex_allows_spaces
= false;
296 date_insert_format
= "%x";
297 cursor_follows_scrollbar
= false;
298 scroll_below_document
= false;
299 mac_like_word_movement
= false;
300 macro_edit_style
= MACRO_EDIT_INLINE_BOX
;
301 dialogs_iconify_with_main
= false;
302 label_init_length
= 3;
303 preview
= PREVIEW_OFF
;
304 preview_hashed_labels
= false;
305 preview_scale_factor
= "0.9";
306 use_converter_cache
= true;
308 use_pixmap_cache
= false;
309 converter_cache_maxage
= 6 * 30 * 24 * 3600; // 6 months
310 user_name
= to_utf8(support::user_name());
311 user_email
= to_utf8(support::user_email());
312 open_buffers_in_tabs
= true;
314 // Fullscreen settings
315 full_screen_limit
= false;
316 full_screen_toolbars
= true;
317 full_screen_tabbar
= true;
318 full_screen_menubar
= true;
319 full_screen_scrollbar
= true;
320 full_screen_width
= 700;
322 completion_cursor_text
= true;
323 completion_popup_math
= true;
324 completion_popup_text
= false;
325 completion_popup_delay
= 2.0;
326 completion_popup_after_complete
= true;
327 autocorrection_math
= false;
328 completion_inline_math
= true;
329 completion_inline_text
= false;
330 completion_inline_dots
= -1;
331 completion_inline_delay
= 0.2;
337 void oldFontFormat(string
& family
, string
& foundry
)
339 if (family
.empty() || family
[0] != '-')
341 foundry
= token(family
, '-', 1);
342 family
= token(family
, '-', 2);
350 int LyXRC::read(FileName
const & filename
)
352 Lexer
lexrc(lyxrcTags
);
353 if (lyxerr
.debugging(Debug::PARSER
))
354 lexrc
.printTable(lyxerr
);
356 lexrc
.setFile(filename
);
360 LYXERR(Debug::LYXRC
, "Reading '" << filename
<< "'...");
366 int LyXRC::read(istream
& is
)
368 Lexer
lexrc(lyxrcTags
);
369 if (lyxerr
.debugging(Debug::PARSER
))
370 lexrc
.printTable(lyxerr
);
376 LYXERR(Debug::LYXRC
, "Reading istream...");
382 int LyXRC::read(Lexer
& lexrc
)
387 while (lexrc
.isOK()) {
388 // By using two switches we take advantage of the compiler
389 // telling us if we have missed a LyXRCTags element in
390 // the second switch.
391 // Note that this also shows a problem with Lexer since it
392 // helps us avoid taking advantage of the strictness of the
395 int le
= lexrc
.lex();
397 case Lexer::LEX_UNDEF
:
398 lexrc
.printError("Unknown tag `$$Token'");
400 case Lexer::LEX_FEOF
:
405 switch (static_cast<LyXRCTags
>(le
)) {
406 case RC_INPUT
: // Include file
409 libFileSearch(string(),
412 lexrc
.printError("Error reading "
413 "included file: " + tmp
.absFilename());
419 bind_file
= os::internal_path(lexrc
.getString());
424 def_file
= os::internal_path(lexrc
.getString());
429 ui_file
= os::internal_path(lexrc
.getString());
432 case RC_AUTORESET_OPTIONS
:
433 lexrc
>> auto_reset_options
;
436 case RC_DISPLAY_GRAPHICS
:
438 display_graphics
= lexrc
.getString() == "true";
441 case RC_TEX_EXPECTS_WINDOWS_PATHS
:
442 lexrc
>> windows_style_tex_paths
;
445 case RC_TEX_ALLOWS_SPACES
:
446 lexrc
>> tex_allows_spaces
;
453 case RC_KBMAP_PRIMARY
:
455 string
const kmap(os::internal_path(lexrc
.getString()));
456 if (!libFileSearch("kbd", kmap
, "kmap").empty()
458 primary_kbmap
= kmap
;
460 lexrc
.printError("LyX: Keymap `$$Token' not found");
465 case RC_KBMAP_SECONDARY
:
467 string
const kmap(os::internal_path(lexrc
.getString()));
468 if (!libFileSearch("kbd", kmap
, "kmap").empty()
470 secondary_kbmap
= kmap
;
472 lexrc
.printError("LyX: Keymap `$$Token' not found");
477 case RC_FONT_ENCODING
:
485 case RC_PRINT_COMMAND
:
486 if (lexrc
.next(true)) {
487 print_command
= lexrc
.getString();
491 case RC_PRINTEVENPAGEFLAG
:
492 lexrc
>> print_evenpage_flag
;
495 case RC_PRINTODDPAGEFLAG
:
496 lexrc
>> print_oddpage_flag
;
499 case RC_PRINTPAGERANGEFLAG
:
500 lexrc
>> print_pagerange_flag
;
503 case RC_PRINTCOPIESFLAG
:
504 lexrc
>> print_copies_flag
;
507 case RC_PRINTCOLLCOPIESFLAG
:
508 lexrc
>> print_collcopies_flag
;
511 case RC_PRINTREVERSEFLAG
:
512 lexrc
>> print_reverse_flag
;
515 case RC_PRINTLANDSCAPEFLAG
:
516 lexrc
>> print_landscape_flag
;
519 case RC_PRINTTOPRINTER
:
520 lexrc
>> print_to_printer
;
523 case RC_PRINT_ADAPTOUTPUT
:
524 lexrc
>> print_adapt_output
;
529 print_to_file
= os::internal_path(lexrc
.getString());
533 case RC_PRINTFILEEXTENSION
:
534 lexrc
>> print_file_extension
;
537 case RC_PRINTEXSTRAOPTIONS
:
538 lexrc
>> print_extra_options
;
541 case RC_PRINTSPOOL_COMMAND
:
542 if (lexrc
.next(true)) {
543 print_spool_command
= lexrc
.getString();
547 case RC_PRINTSPOOL_PRINTERPREFIX
:
548 lexrc
>> print_spool_printerprefix
;
551 case RC_PRINTPAPERDIMENSIONFLAG
:
552 lexrc
>> print_paper_dimension_flag
;
555 case RC_PRINTPAPERFLAG
:
556 lexrc
>> print_paper_flag
;
559 case RC_DEFAULT_PAPERSIZE
:
561 string
const size
= ascii_lowercase(lexrc
.getString());
562 if (size
== "usletter")
563 default_papersize
= PAPER_USLETTER
;
564 else if (size
== "legal")
565 default_papersize
= PAPER_USLEGAL
;
566 else if (size
== "executive")
567 default_papersize
= PAPER_USEXECUTIVE
;
568 else if (size
== "a3")
569 default_papersize
= PAPER_A3
;
570 else if (size
== "a4")
571 default_papersize
= PAPER_A4
;
572 else if (size
== "a5")
573 default_papersize
= PAPER_A5
;
574 else if (size
== "b5")
575 default_papersize
= PAPER_B5
;
576 else if (size
== "default")
577 default_papersize
= PAPER_DEFAULT
;
581 case RC_VIEWDVI_PAPEROPTION
:
583 view_dvi_paper_option
= lexrc
.getString();
585 view_dvi_paper_option
.erase();
588 case RC_CHKTEX_COMMAND
:
589 if (lexrc
.next(true)) {
590 chktex_command
= lexrc
.getString();
594 case RC_BIBTEX_ALTERNATIVES
:
595 if (lexrc
.next(true)) {
596 bibtex_alternatives
.insert(lexrc
.getString());
600 case RC_BIBTEX_COMMAND
:
601 if (lexrc
.next(true)) {
602 bibtex_command
= lexrc
.getString();
606 case RC_JBIBTEX_COMMAND
:
607 if (lexrc
.next(true)) {
608 jbibtex_command
= lexrc
.getString();
612 case RC_INDEX_ALTERNATIVES
:
613 if (lexrc
.next(true)) {
614 index_alternatives
.insert(lexrc
.getString());
618 case RC_INDEX_COMMAND
:
619 if (lexrc
.next(true)) {
620 index_command
= lexrc
.getString();
624 case RC_JINDEX_COMMAND
:
625 if (lexrc
.next(true)) {
626 jindex_command
= lexrc
.getString();
630 case RC_SPLITINDEX_COMMAND
:
631 if (lexrc
.next(true)) {
632 splitindex_command
= lexrc
.getString();
636 case RC_NOMENCL_COMMAND
:
637 if (lexrc
.next(true)) {
638 nomencl_command
= lexrc
.getString();
650 case RC_GEOMETRY_SESSION
:
651 lexrc
>> allow_geometry_session
;
654 case RC_SCREEN_FONT_SIZES
:
655 lexrc
>> font_sizes
[FONT_SIZE_TINY
];
656 lexrc
>> font_sizes
[FONT_SIZE_SCRIPT
];
657 lexrc
>> font_sizes
[FONT_SIZE_FOOTNOTE
];
658 lexrc
>> font_sizes
[FONT_SIZE_SMALL
];
659 lexrc
>> font_sizes
[FONT_SIZE_NORMAL
];
660 lexrc
>> font_sizes
[FONT_SIZE_LARGE
];
661 lexrc
>> font_sizes
[FONT_SIZE_LARGER
];
662 lexrc
>> font_sizes
[FONT_SIZE_LARGEST
];
663 lexrc
>> font_sizes
[FONT_SIZE_HUGE
];
664 lexrc
>> font_sizes
[FONT_SIZE_HUGER
];
667 case RC_SCREEN_FONT_SCALABLE
:
668 lexrc
>> use_scalable_fonts
;
675 case RC_DOCUMENTPATH
:
677 document_path
= os::internal_path(lexrc
.getString());
678 document_path
= expandPath(document_path
);
684 example_path
= os::internal_path(lexrc
.getString());
685 example_path
= expandPath(example_path
);
689 case RC_TEMPLATEPATH
:
691 template_path
= os::internal_path(lexrc
.getString());
692 template_path
= expandPath(template_path
);
698 tempdir_path
= os::internal_path(lexrc
.getString());
699 tempdir_path
= expandPath(tempdir_path
);
703 case RC_THESAURUSDIRPATH
:
705 thesaurusdir_path
= os::internal_path(lexrc
.getString());
706 thesaurusdir_path
= expandPath(thesaurusdir_path
);
710 case RC_HUNSPELLDIR_PATH
:
712 hunspelldir_path
= os::internal_path(lexrc
.getString());
713 hunspelldir_path
= expandPath(hunspelldir_path
);
717 case RC_USELASTFILEPOS
:
718 lexrc
>> use_lastfilepos
;
722 lexrc
>> load_session
;
725 case RC_MOUSE_WHEEL_SPEED
:
726 lexrc
>> mouse_wheel_speed
;
729 case RC_COMPLETION_INLINE_DELAY
:
730 lexrc
>> completion_inline_delay
;
733 case RC_COMPLETION_INLINE_MATH
:
734 lexrc
>> completion_inline_math
;
737 case RC_COMPLETION_INLINE_TEXT
:
738 lexrc
>> completion_inline_text
;
741 case RC_COMPLETION_INLINE_DOTS
:
742 lexrc
>> completion_inline_dots
;
745 case RC_AUTOCORRECTION_MATH
:
746 lexrc
>> autocorrection_math
;
749 case RC_COMPLETION_POPUP_DELAY
:
750 lexrc
>> completion_popup_delay
;
753 case RC_COMPLETION_POPUP_MATH
:
754 lexrc
>> completion_popup_math
;
757 case RC_COMPLETION_POPUP_TEXT
:
758 lexrc
>> completion_popup_text
;
761 case RC_COMPLETION_CURSOR_TEXT
:
762 lexrc
>> completion_cursor_text
;
765 case RC_COMPLETION_POPUP_AFTER_COMPLETE
:
766 lexrc
>> completion_popup_after_complete
;
769 case RC_NUMLASTFILES
:
770 lexrc
>> num_lastfiles
;
773 case RC_CHECKLASTFILES
:
774 lexrc
>> check_lastfiles
;
777 case RC_SCREEN_FONT_ROMAN
:
779 roman_font_name
= lexrc
.getString();
780 oldFontFormat(roman_font_name
,
785 case RC_SCREEN_FONT_SANS
:
787 sans_font_name
= lexrc
.getString();
788 oldFontFormat(sans_font_name
, sans_font_foundry
);
792 case RC_SCREEN_FONT_TYPEWRITER
:
794 typewriter_font_name
= lexrc
.getString();
795 oldFontFormat(typewriter_font_name
,
796 typewriter_font_foundry
);
800 case RC_SCREEN_FONT_ROMAN_FOUNDRY
:
801 lexrc
>> roman_font_foundry
;
804 case RC_SCREEN_FONT_SANS_FOUNDRY
:
805 lexrc
>> sans_font_foundry
;
808 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY
:
809 lexrc
>> typewriter_font_foundry
;
814 lexrc
.printError("Missing color tag.");
817 string lyx_name
= lexrc
.getString();
820 lexrc
.printError("Missing color name for color: `$$Token'");
823 string x11_name
= lexrc
.getString();
825 ColorCode
const col
=
826 lcolor
.getFromLyXName(lyx_name
);
827 if (col
== Color_none
||
828 col
== Color_inherit
||
832 if (!lcolor
.setColor(col
, x11_name
))
833 LYXERR0("Bad lyxrc set_color for " << lyx_name
);
837 case RC_AUTOREGIONDELETE
:
838 // Auto region delete defaults to true
839 lexrc
>> auto_region_delete
;
844 lyxpipes
= os::internal_path(lexrc
.getString());
845 lyxpipes
= expandPath(lyxpipes
);
849 case RC_CURSOR_FOLLOWS_SCROLLBAR
:
850 lexrc
>> cursor_follows_scrollbar
;
853 case RC_SCROLL_BELOW_DOCUMENT
:
854 lexrc
>> scroll_below_document
;
857 case RC_MAC_LIKE_WORD_MOVEMENT
:
858 lexrc
>> mac_like_word_movement
;
861 case RC_MACRO_EDIT_STYLE
:
863 switch (lexrc
.getInteger()) {
864 case 0: macro_edit_style
= MACRO_EDIT_INLINE_BOX
; break;
865 case 1: macro_edit_style
= MACRO_EDIT_INLINE
; break;
866 case 2: macro_edit_style
= MACRO_EDIT_LIST
; break;
871 case RC_DIALOGS_ICONIFY_WITH_MAIN
:
872 lexrc
>> dialogs_iconify_with_main
;
875 case RC_PLAINTEXT_LINELEN
:
876 lexrc
>> plaintext_linelen
;
878 // Spellchecker settings:
879 case RC_ACCEPT_COMPOUND
:
880 lexrc
>> spellchecker_accept_compound
;
883 lexrc
>> use_tooltip
;
885 case RC_USE_PIXMAP_CACHE
:
886 lexrc
>> use_pixmap_cache
;
888 case RC_SPELLCHECKER
:
889 lexrc
>> spellchecker
;
892 lexrc
>> spellchecker_alt_lang
;
895 lexrc
>> spellchecker_esc_chars
;
897 case RC_SPELLCHECK_CONTINUOUSLY
:
898 lexrc
>> spellcheck_continuously
;
901 lexrc
>> make_backup
;
903 case RC_BACKUPDIR_PATH
:
905 backupdir_path
= os::internal_path(lexrc
.getString());
906 backupdir_path
= expandPath(backupdir_path
);
909 case RC_DATE_INSERT_FORMAT
:
910 lexrc
>> date_insert_format
;
912 case RC_LANGUAGE_PACKAGE
:
913 lexrc
>> language_package
;
915 case RC_LANGUAGE_AUTO_BEGIN
:
916 lexrc
>> language_auto_begin
;
918 case RC_LANGUAGE_AUTO_END
:
919 lexrc
>> language_auto_end
;
921 case RC_LANGUAGE_GLOBAL_OPTIONS
:
922 lexrc
>> language_global_options
;
924 case RC_LANGUAGE_USE_BABEL
:
925 lexrc
>> language_use_babel
;
927 case RC_LANGUAGE_COMMAND_BEGIN
:
928 lexrc
>> language_command_begin
;
930 case RC_LANGUAGE_COMMAND_END
:
931 lexrc
>> language_command_end
;
933 case RC_LANGUAGE_COMMAND_LOCAL
:
934 lexrc
>> language_command_local
;
937 lexrc
>> rtl_support
;
939 case RC_VISUAL_CURSOR
:
940 lexrc
>> visual_cursor
;
943 lexrc
>> auto_number
;
945 case RC_MARK_FOREIGN_LANGUAGE
:
946 lexrc
>> mark_foreign_language
;
952 fmt
= lexrc
.getString();
953 if (lexrc
.next(true))
954 command
= lexrc
.getString();
955 setMover(fmt
, command
);
960 string from
, to
, command
, flags
;
962 from
= lexrc
.getString();
964 to
= lexrc
.getString();
965 if (lexrc
.next(true))
966 command
= lexrc
.getString();
968 flags
= lexrc
.getString();
970 theConverters().erase(from
, to
);
972 theConverters().add(from
, to
, command
, flags
);
975 // compatibility with versions older than 1.4.0 only
977 string format
, command
;
978 lexrc
>> format
>> command
;
979 formats
.setViewer(format
, command
);
983 string format
, extension
, prettyname
, shortcut
;
984 lexrc
>> format
>> extension
>> prettyname
>> shortcut
;
985 string viewer
, editor
;
986 if (lexrc
.next(true))
987 viewer
= lexrc
.getString();
988 if (lexrc
.next(true))
989 editor
= lexrc
.getString();
991 // Hack to ensure compatibility with versions older
993 int le
= lexrc
.lex();
994 if (le
!= Lexer::LEX_FEOF
&& le
!= Lexer::LEX_UNDEF
) {
995 flags
= lexrc
.getString();
996 if (le
!= Lexer::LEX_DATA
) {
997 // We have got a known token.
998 // Therefore this is an old style
999 // format definition without
1001 lexrc
.pushToken(flags
);
1005 int flgs
= Format::none
;
1006 while (!flags
.empty()) {
1008 flags
= split(flags
, flag
, ',');
1009 if (flag
== "document")
1010 flgs
|= Format::document
;
1011 else if (flag
== "vector")
1012 flgs
|= Format::vector
;
1014 LYXERR0("Ignoring unknown flag `"
1015 << flag
<< "' for format `"
1018 if (prettyname
.empty()) {
1019 if (theConverters().formatIsUsed(format
))
1020 LYXERR0("Can't delete format " << format
);
1022 formats
.erase(format
);
1024 formats
.add(format
, extension
, prettyname
,
1025 shortcut
, viewer
, editor
, flgs
);
1029 case RC_DEFAULT_VIEW_FORMAT
:
1030 lexrc
>> default_view_format
;
1033 case RC_DEFAULT_LANGUAGE
:
1034 lexrc
>> default_language
;
1037 case RC_GUI_LANGUAGE
:
1038 lexrc
>> gui_language
;
1041 case RC_LABEL_INIT_LENGTH
:
1042 lexrc
>> label_init_length
;
1045 case RC_SHOW_BANNER
:
1046 lexrc
>> show_banner
;
1051 string
const tmp
= lexrc
.getString();
1052 if (tmp
== "true" || tmp
== "on")
1053 preview
= PREVIEW_ON
;
1054 else if (tmp
== "no_math")
1055 preview
= PREVIEW_NO_MATH
;
1057 preview
= PREVIEW_OFF
;
1058 if (tmp
!= "false" && tmp
!= "off")
1059 LYXERR0("Unrecognized preview status \""
1065 case RC_PREVIEW_HASHED_LABELS
:
1066 lexrc
>> preview_hashed_labels
;
1069 case RC_PREVIEW_SCALE_FACTOR
:
1070 lexrc
>> preview_scale_factor
;
1077 lexrc
>> user_email
;
1080 case RC_PATH_PREFIX
:
1081 lexrc
>> path_prefix
;
1084 case RC_USE_CONVERTER_CACHE
:
1085 lexrc
>> use_converter_cache
;
1087 case RC_CONVERTER_CACHE_MAXAGE
:
1088 lexrc
>> converter_cache_maxage
;
1091 case RC_SORT_LAYOUTS
:
1092 lexrc
>> sort_layouts
;
1094 case RC_GROUP_LAYOUTS
:
1095 lexrc
>> group_layouts
;
1097 case RC_FULL_SCREEN_LIMIT
:
1098 lexrc
>> full_screen_limit
;
1100 case RC_FULL_SCREEN_TOOLBARS
:
1101 lexrc
>> full_screen_toolbars
;
1103 case RC_FULL_SCREEN_SCROLLBAR
:
1104 lexrc
>> full_screen_scrollbar
;
1106 case RC_FULL_SCREEN_TABBAR
:
1107 lexrc
>> full_screen_tabbar
;
1109 case RC_FULL_SCREEN_MENUBAR
:
1110 lexrc
>> full_screen_menubar
;
1112 case RC_FULL_SCREEN_WIDTH
:
1113 lexrc
>> full_screen_width
;
1115 case RC_OPEN_BUFFERS_IN_TABS
:
1116 lexrc
>> open_buffers_in_tabs
;
1119 // Obsoteted in 1.4.0
1122 case RC_SPELL_COMMAND
:
1124 case RC_PLAINTEXT_ROFF_COMMAND
:
1125 case RC_USE_ALT_LANG
:
1126 case RC_USE_ESC_CHARS
:
1127 case RC_USE_INP_ENC
:
1128 case RC_USE_PERS_DICT
:
1129 case RC_USE_SPELL_LIB
:
1130 LYXERR(Debug::LYXRC
, "Skipping obsolete tag `"
1131 << lexrc
.getString() << "'.");
1136 break; // this is just a dummy
1140 /// Update converters data-structures
1141 theConverters().update(formats
);
1142 theConverters().buildGraph();
1148 void LyXRC::write(FileName
const & filename
, bool ignore_system_lyxrc
) const
1150 ofstream
ofs(filename
.toFilesystemEncoding().c_str());
1152 write(ofs
, ignore_system_lyxrc
);
1156 void LyXRC::print() const
1158 if (lyxerr
.debugging())
1159 write(lyxerr
, false);
1167 typedef pair
<string
, SpecialisedMover
> Data
;
1169 SameMover(Data
const & comparison
)
1170 : comparison_(comparison
) {}
1172 bool operator()(Data
const & data
) const
1174 return data
.first
== comparison_
.first
&&
1175 data
.second
.command() == comparison_
.second
.command();
1185 // Escape \ and " so that LyXLex can read the string later
1186 string
escapeCommand(string
const & str
) {
1187 return subst(subst(str
, "\\", "\\\\"),
1194 void LyXRC::write(ostream
& os
, bool ignore_system_lyxrc
, string
const & name
) const
1196 LyXRCTags tag
= RC_LAST
;
1198 if (!name
.empty()) {
1199 for (int i
= 0; i
!= lyxrcCount
; ++i
)
1200 if ("\\" + name
== lyxrcTags
[i
].tag
)
1201 tag
= static_cast<LyXRCTags
>(lyxrcTags
[i
].code
);
1205 os
<< "# LyX " << lyx_version
1206 << " generated this file. If you want to make your own\n"
1207 << "# modifications you should do them from inside LyX and save.\n"
1210 // Why the switch you might ask. It is a trick to ensure that all
1211 // the elements in the LyXRCTags enum are handled. As you can see
1212 // there are no breaks at all. So it is just a huge fall-through.
1213 // The nice thing is that we will get a warning from the compiler
1214 // if we forget an element.
1218 // input/include files are not done here
1220 if (ignore_system_lyxrc
||
1221 bind_file
!= system_lyxrc
.bind_file
) {
1222 string
const path
= os::external_path(bind_file
);
1223 os
<< "\\bind_file \"" << path
<< "\"\n";
1229 if (ignore_system_lyxrc
||
1230 def_file
!= system_lyxrc
.def_file
) {
1231 string
const path
= os::external_path(def_file
);
1232 os
<< "\\def_file \"" << path
<< "\"\n";
1241 << "# MISC SECTION ######################################\n"
1243 // bind files are not done here.
1245 case RC_PATH_PREFIX
:
1246 if (ignore_system_lyxrc
||
1247 path_prefix
!= system_lyxrc
.path_prefix
) {
1248 os
<< "\\path_prefix \"" << path_prefix
<< "\"\n";
1253 if (ignore_system_lyxrc
||
1254 ui_file
!= system_lyxrc
.ui_file
) {
1255 string
const path
= os::external_path(ui_file
);
1256 os
<< "\\ui_file \"" << path
<< "\"\n";
1260 case RC_AUTOREGIONDELETE
:
1261 if (ignore_system_lyxrc
||
1262 auto_region_delete
!= system_lyxrc
.auto_region_delete
) {
1263 os
<< "# Set to false to inhibit automatic replacement of\n"
1264 << "# the current selection.\n"
1265 << "\\auto_region_delete " << convert
<string
>(auto_region_delete
)
1270 case RC_AUTORESET_OPTIONS
:
1271 if (ignore_system_lyxrc
||
1272 auto_reset_options
!= system_lyxrc
.auto_reset_options
) {
1273 os
<< "# Set to false to inhibit automatic reset of\n"
1274 << "# the class options to defaults on class change.\n"
1275 << "\\auto_reset_options "
1276 << convert
<string
>(auto_reset_options
)
1282 if (ignore_system_lyxrc
||
1283 autosave
!= system_lyxrc
.autosave
) {
1284 os
<< "# The time interval between auto-saves in seconds.\n"
1285 << "\\autosave " << autosave
<< '\n';
1289 case RC_DISPLAY_GRAPHICS
:
1290 if (ignore_system_lyxrc
||
1291 display_graphics
!= system_lyxrc
.display_graphics
) {
1292 os
<< "# Display graphics within LyX\n"
1294 << "\\display_graphics "
1295 << (display_graphics
? "true" : "false")
1300 case RC_SORT_LAYOUTS
:
1301 if (ignore_system_lyxrc
||
1302 sort_layouts
!= system_lyxrc
.sort_layouts
) {
1303 os
<< "# Sort layouts alphabetically.\n"
1304 << "\\sort_layouts " << convert
<string
>(sort_layouts
) << '\n';
1308 case RC_GROUP_LAYOUTS
:
1309 if (ignore_system_lyxrc
||
1310 group_layouts
!= system_lyxrc
.group_layouts
) {
1311 os
<< "# Group layouts by their category.\n"
1312 << "\\group_layouts " << convert
<string
>(group_layouts
) << '\n';
1316 case RC_VIEWDVI_PAPEROPTION
:
1317 if (ignore_system_lyxrc
||
1318 view_dvi_paper_option
1319 != system_lyxrc
.view_dvi_paper_option
) {
1320 os
<< "# Options used to specify paper size to the\n"
1321 << "# view_dvi_command (e.g. -paper)\n"
1322 << "\\view_dvi_paper_option \""
1323 << view_dvi_paper_option
<< "\"\n";
1327 case RC_DEFAULT_PAPERSIZE
:
1328 if (ignore_system_lyxrc
||
1329 default_papersize
!= system_lyxrc
.default_papersize
) {
1330 os
<< "# The default papersize to use.\n"
1331 << "\\default_papersize \"";
1332 switch (default_papersize
) {
1334 os
<< "default"; break;
1335 case PAPER_USLETTER
:
1336 os
<< "usletter"; break;
1338 os
<< "legal"; break;
1339 case PAPER_USEXECUTIVE
:
1340 os
<< "executive"; break;
1351 case PAPER_B4
: break;
1357 case RC_CHKTEX_COMMAND
:
1358 if (ignore_system_lyxrc
||
1359 chktex_command
!= system_lyxrc
.chktex_command
) {
1360 os
<< "\\chktex_command \"" << escapeCommand(chktex_command
) << "\"\n";
1364 case RC_BIBTEX_ALTERNATIVES
: {
1365 set
<string
>::const_iterator it
= bibtex_alternatives
.begin();
1366 set
<string
>::const_iterator end
= bibtex_alternatives
.end();
1367 for ( ; it
!= end
; ++it
) {
1368 if (ignore_system_lyxrc
1369 || !system_lyxrc
.bibtex_alternatives
.count(*it
))
1370 os
<< "\\bibtex_alternatives \""
1376 case RC_BIBTEX_COMMAND
:
1377 if (ignore_system_lyxrc
||
1378 bibtex_command
!= system_lyxrc
.bibtex_command
) {
1379 os
<< "\\bibtex_command \"" << escapeCommand(bibtex_command
) << "\"\n";
1383 case RC_JBIBTEX_COMMAND
:
1384 if (ignore_system_lyxrc
||
1385 jbibtex_command
!= system_lyxrc
.jbibtex_command
) {
1386 os
<< "\\jbibtex_command \"" << escapeCommand(jbibtex_command
) << "\"\n";
1390 case RC_INDEX_ALTERNATIVES
: {
1391 set
<string
>::const_iterator it
= index_alternatives
.begin();
1392 set
<string
>::const_iterator end
= index_alternatives
.end();
1393 for ( ; it
!= end
; ++it
) {
1394 if (ignore_system_lyxrc
1395 || !system_lyxrc
.index_alternatives
.count(*it
))
1396 os
<< "\\index_alternatives \""
1402 case RC_INDEX_COMMAND
:
1403 if (ignore_system_lyxrc
||
1404 index_command
!= system_lyxrc
.index_command
) {
1405 os
<< "\\index_command \"" << escapeCommand(index_command
) << "\"\n";
1409 case RC_JINDEX_COMMAND
:
1410 if (ignore_system_lyxrc
||
1411 jindex_command
!= system_lyxrc
.jindex_command
) {
1412 os
<< "\\jindex_command \"" << escapeCommand(jindex_command
) << "\"\n";
1416 case RC_SPLITINDEX_COMMAND
:
1417 if (ignore_system_lyxrc
||
1418 splitindex_command
!= system_lyxrc
.splitindex_command
) {
1419 os
<< "\\splitindex_command \"" << escapeCommand(splitindex_command
) << "\"\n";
1423 case RC_NOMENCL_COMMAND
:
1424 if (ignore_system_lyxrc
||
1425 nomencl_command
!= system_lyxrc
.nomencl_command
) {
1426 os
<< "\\nomencl_command \"" << escapeCommand(nomencl_command
) << "\"\n";
1430 case RC_TEX_EXPECTS_WINDOWS_PATHS
:
1431 if (ignore_system_lyxrc
||
1432 windows_style_tex_paths
!= system_lyxrc
.windows_style_tex_paths
) {
1433 os
<< "\\tex_expects_windows_paths "
1434 << convert
<string
>(windows_style_tex_paths
) << '\n';
1438 case RC_TEX_ALLOWS_SPACES
:
1439 if (tex_allows_spaces
!= system_lyxrc
.tex_allows_spaces
) {
1440 os
<< "\\tex_allows_spaces "
1441 << convert
<string
>(tex_allows_spaces
) << '\n';
1446 if (ignore_system_lyxrc
||
1447 use_kbmap
!= system_lyxrc
.use_kbmap
) {
1448 os
<< "\\kbmap " << convert
<string
>(use_kbmap
) << '\n';
1452 case RC_KBMAP_PRIMARY
:
1453 if (ignore_system_lyxrc
||
1454 primary_kbmap
!= system_lyxrc
.primary_kbmap
) {
1455 string
const path
= os::external_path(primary_kbmap
);
1456 os
<< "\\kbmap_primary \"" << path
<< "\"\n";
1460 case RC_KBMAP_SECONDARY
:
1461 if (ignore_system_lyxrc
||
1462 secondary_kbmap
!= system_lyxrc
.secondary_kbmap
) {
1463 string
const path
= os::external_path(secondary_kbmap
);
1464 os
<< "\\kbmap_secondary \"" << path
<< "\"\n";
1469 if (ignore_system_lyxrc
||
1470 lyxpipes
!= system_lyxrc
.lyxpipes
) {
1471 string
const path
= os::external_path(lyxpipes
);
1472 os
<< "\\serverpipe \"" << path
<< "\"\n";
1476 case RC_DATE_INSERT_FORMAT
:
1477 if (ignore_system_lyxrc
||
1478 date_insert_format
!= system_lyxrc
.date_insert_format
) {
1479 os
<< "\\date_insert_format \"" << date_insert_format
1484 case RC_LABEL_INIT_LENGTH
:
1485 if (ignore_system_lyxrc
||
1486 label_init_length
!= system_lyxrc
.label_init_length
) {
1487 os
<< "\\label_init_length " << label_init_length
1494 os
<< "\\user_name \"" << user_name
<< "\"\n";
1499 os
<< "\\user_email \"" << user_email
<< "\"\n";
1503 case RC_SHOW_BANNER
:
1504 if (ignore_system_lyxrc
||
1505 show_banner
!= system_lyxrc
.show_banner
) {
1506 os
<< "\\show_banner " << convert
<string
>(show_banner
) << '\n';
1512 if (ignore_system_lyxrc
||
1513 preview
!= system_lyxrc
.preview
) {
1519 case PREVIEW_NO_MATH
:
1526 os
<< "\\preview " << status
<< '\n';
1531 case RC_PREVIEW_HASHED_LABELS
:
1532 if (ignore_system_lyxrc
||
1533 preview_hashed_labels
!=
1534 system_lyxrc
.preview_hashed_labels
) {
1535 os
<< "\\preview_hashed_labels "
1536 << convert
<string
>(preview_hashed_labels
) << '\n';
1541 case RC_PREVIEW_SCALE_FACTOR
:
1542 if (ignore_system_lyxrc
||
1543 preview_scale_factor
!= system_lyxrc
.preview_scale_factor
) {
1544 os
<< "\\preview_scale_factor "
1545 << preview_scale_factor
<< '\n';
1550 case RC_USE_CONVERTER_CACHE
:
1551 if (ignore_system_lyxrc
||
1552 use_converter_cache
!= system_lyxrc
.use_converter_cache
) {
1553 os
<< "\\use_converter_cache "
1554 << convert
<string
>(use_converter_cache
) << '\n';
1559 case RC_CONVERTER_CACHE_MAXAGE
:
1560 if (ignore_system_lyxrc
||
1561 converter_cache_maxage
!= system_lyxrc
.converter_cache_maxage
) {
1562 os
<< "\\converter_cache_maxage "
1563 << converter_cache_maxage
<< '\n';
1569 << "# SCREEN & FONTS SECTION ############################\n"
1573 if (ignore_system_lyxrc
||
1574 dpi
!= system_lyxrc
.dpi
) {
1575 os
<< "\\screen_dpi " << dpi
<< '\n';
1579 case RC_SCREEN_ZOOM
:
1580 if (ignore_system_lyxrc
||
1581 zoom
!= system_lyxrc
.zoom
) {
1582 os
<< "\\screen_zoom " << zoom
<< '\n';
1586 case RC_GEOMETRY_SESSION
:
1587 if (ignore_system_lyxrc
||
1588 allow_geometry_session
!= system_lyxrc
.allow_geometry_session
) {
1589 os
<< "\\allow_geometry_session " << convert
<string
>(allow_geometry_session
)
1594 case RC_CURSOR_FOLLOWS_SCROLLBAR
:
1595 if (ignore_system_lyxrc
||
1596 cursor_follows_scrollbar
1597 != system_lyxrc
.cursor_follows_scrollbar
) {
1598 os
<< "\\cursor_follows_scrollbar "
1599 << convert
<string
>(cursor_follows_scrollbar
) << '\n';
1603 case RC_SCROLL_BELOW_DOCUMENT
:
1604 if (ignore_system_lyxrc
||
1605 scroll_below_document
1606 != system_lyxrc
.scroll_below_document
) {
1607 os
<< "\\scroll_below_document "
1608 << convert
<string
>(scroll_below_document
) << '\n';
1612 case RC_MAC_LIKE_WORD_MOVEMENT
:
1613 if (ignore_system_lyxrc
||
1614 mac_like_word_movement
1615 != system_lyxrc
.mac_like_word_movement
) {
1616 os
<< "\\mac_like_word_movement "
1617 << convert
<string
>(mac_like_word_movement
) << '\n';
1621 case RC_MACRO_EDIT_STYLE
:
1622 if (ignore_system_lyxrc
||
1624 != system_lyxrc
.macro_edit_style
) {
1625 os
<< "\\macro_edit_style ";
1626 switch (macro_edit_style
) {
1627 case MACRO_EDIT_INLINE_BOX
: os
<< "0\n"; break;
1628 case MACRO_EDIT_INLINE
: os
<< "1\n"; break;
1629 case MACRO_EDIT_LIST
: os
<< "2\n"; break;
1634 case RC_DIALOGS_ICONIFY_WITH_MAIN
:
1635 if (ignore_system_lyxrc
||
1636 dialogs_iconify_with_main
1637 != system_lyxrc
.dialogs_iconify_with_main
) {
1638 os
<< "\\dialogs_iconify_with_main "
1639 << convert
<string
>(dialogs_iconify_with_main
) << '\n';
1643 case RC_SCREEN_FONT_ROMAN
:
1644 if (ignore_system_lyxrc
||
1645 roman_font_name
!= system_lyxrc
.roman_font_name
) {
1646 os
<< "\\screen_font_roman \"" << roman_font_name
1651 case RC_SCREEN_FONT_ROMAN_FOUNDRY
:
1652 if (ignore_system_lyxrc
||
1653 roman_font_foundry
!= system_lyxrc
.roman_font_foundry
) {
1654 os
<< "\\screen_font_roman_foundry \"" << roman_font_foundry
1659 case RC_SCREEN_FONT_SANS
:
1660 if (ignore_system_lyxrc
||
1661 sans_font_name
!= system_lyxrc
.sans_font_name
) {
1662 os
<< "\\screen_font_sans \"" << sans_font_name
1667 case RC_SCREEN_FONT_SANS_FOUNDRY
:
1668 if (ignore_system_lyxrc
||
1669 sans_font_foundry
!= system_lyxrc
.sans_font_foundry
) {
1670 os
<< "\\screen_font_sans_foundry \"" << sans_font_foundry
1675 case RC_SCREEN_FONT_TYPEWRITER
:
1676 if (ignore_system_lyxrc
||
1677 typewriter_font_name
!= system_lyxrc
.typewriter_font_name
) {
1678 os
<< "\\screen_font_typewriter \""
1679 << typewriter_font_name
<< "\"\n";
1683 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY
:
1684 if (ignore_system_lyxrc
||
1685 typewriter_font_foundry
!= system_lyxrc
.typewriter_font_foundry
) {
1686 os
<< "\\screen_font_typewriter_foundry \""
1687 << typewriter_font_foundry
<< "\"\n";
1692 case RC_SCREEN_FONT_SCALABLE
:
1693 if (ignore_system_lyxrc
||
1694 use_scalable_fonts
!= system_lyxrc
.use_scalable_fonts
) {
1695 os
<< "\\screen_font_scalable "
1696 << convert
<string
>(use_scalable_fonts
)
1701 case RC_SCREEN_FONT_SIZES
:
1702 if (ignore_system_lyxrc
||
1703 font_sizes
[FONT_SIZE_TINY
]
1704 != system_lyxrc
.font_sizes
[FONT_SIZE_TINY
] ||
1705 font_sizes
[FONT_SIZE_SCRIPT
]
1706 != system_lyxrc
.font_sizes
[FONT_SIZE_SCRIPT
] ||
1707 font_sizes
[FONT_SIZE_FOOTNOTE
]
1708 != system_lyxrc
.font_sizes
[FONT_SIZE_FOOTNOTE
] ||
1709 font_sizes
[FONT_SIZE_SMALL
]
1710 != system_lyxrc
.font_sizes
[FONT_SIZE_SMALL
] ||
1711 font_sizes
[FONT_SIZE_NORMAL
]
1712 != system_lyxrc
.font_sizes
[FONT_SIZE_NORMAL
] ||
1713 font_sizes
[FONT_SIZE_LARGE
]
1714 != system_lyxrc
.font_sizes
[FONT_SIZE_LARGE
] ||
1715 font_sizes
[FONT_SIZE_LARGER
]
1716 != system_lyxrc
.font_sizes
[FONT_SIZE_LARGER
] ||
1717 font_sizes
[FONT_SIZE_LARGEST
]
1718 != system_lyxrc
.font_sizes
[FONT_SIZE_LARGEST
] ||
1719 font_sizes
[FONT_SIZE_HUGE
]
1720 != system_lyxrc
.font_sizes
[FONT_SIZE_HUGE
] ||
1721 font_sizes
[FONT_SIZE_HUGER
]
1722 != system_lyxrc
.font_sizes
[FONT_SIZE_HUGER
]) {
1723 os
.setf(ios::fixed
);
1725 os
<< "\\screen_font_sizes"
1726 << ' ' << font_sizes
[FONT_SIZE_TINY
]
1727 << ' ' << font_sizes
[FONT_SIZE_SCRIPT
]
1728 << ' ' << font_sizes
[FONT_SIZE_FOOTNOTE
]
1729 << ' ' << font_sizes
[FONT_SIZE_SMALL
]
1730 << ' ' << font_sizes
[FONT_SIZE_NORMAL
]
1731 << ' ' << font_sizes
[FONT_SIZE_LARGE
]
1732 << ' ' << font_sizes
[FONT_SIZE_LARGER
]
1733 << ' ' << font_sizes
[FONT_SIZE_LARGEST
]
1734 << ' ' << font_sizes
[FONT_SIZE_HUGE
]
1735 << ' ' << font_sizes
[FONT_SIZE_HUGER
]
1740 case RC_FULL_SCREEN_LIMIT
:
1741 if (ignore_system_lyxrc
||
1742 full_screen_limit
!= system_lyxrc
.full_screen_limit
) {
1743 os
<< "\\fullscreen_limit "
1744 << convert
<string
>(full_screen_limit
)
1749 case RC_FULL_SCREEN_TOOLBARS
:
1750 if (ignore_system_lyxrc
||
1751 full_screen_toolbars
!= system_lyxrc
.full_screen_toolbars
) {
1752 os
<< "\\fullscreen_toolbars "
1753 << convert
<string
>(full_screen_toolbars
)
1758 case RC_FULL_SCREEN_SCROLLBAR
:
1759 if (ignore_system_lyxrc
||
1760 full_screen_scrollbar
!= system_lyxrc
.full_screen_scrollbar
) {
1761 os
<< "\\fullscreen_scrollbar "
1762 << convert
<string
>(full_screen_scrollbar
)
1767 case RC_FULL_SCREEN_TABBAR
:
1768 if (ignore_system_lyxrc
||
1769 full_screen_tabbar
!= system_lyxrc
.full_screen_tabbar
) {
1770 os
<< "\\fullscreen_tabbar "
1771 << convert
<string
>(full_screen_tabbar
)
1776 case RC_FULL_SCREEN_MENUBAR
:
1777 if (ignore_system_lyxrc
||
1778 full_screen_menubar
!= system_lyxrc
.full_screen_menubar
) {
1779 os
<< "\\fullscreen_menubar "
1780 << convert
<string
>(full_screen_menubar
)
1785 case RC_FULL_SCREEN_WIDTH
:
1786 if (ignore_system_lyxrc
||
1787 full_screen_width
!= system_lyxrc
.full_screen_width
) {
1788 os
<< "\\fullscreen_width "
1789 << convert
<string
>(full_screen_width
)
1794 case RC_OPEN_BUFFERS_IN_TABS
:
1795 if (ignore_system_lyxrc
||
1796 open_buffers_in_tabs
!= system_lyxrc
.open_buffers_in_tabs
) {
1797 os
<< "\\open_buffers_in_tabs "
1798 << convert
<string
>(open_buffers_in_tabs
)
1805 << "# COLOR SECTION ###################################\n"
1809 for (int i
= 0; i
< Color_ignore
; ++i
) {
1810 ColorCode lc
= static_cast<ColorCode
>(i
);
1811 string
const col
= lcolor
.getX11Name(lc
);
1812 if (ignore_system_lyxrc
1813 || col
!= system_lcolor
.getX11Name(lc
)) {
1814 os
<< "\\set_color \""
1815 << lcolor
.getLyXName(lc
) << "\" \""
1823 << "# PRINTER SECTION ###################################\n"
1827 if (ignore_system_lyxrc
||
1828 printer
!= system_lyxrc
.printer
) {
1829 os
<< "\\printer \"" << printer
<< "\"\n";
1833 case RC_PRINT_ADAPTOUTPUT
:
1834 if (ignore_system_lyxrc
||
1835 print_adapt_output
!= system_lyxrc
.print_adapt_output
) {
1836 os
<< "\\print_adapt_output "
1837 << convert
<string
>(print_adapt_output
)
1842 case RC_PRINT_COMMAND
:
1843 if (ignore_system_lyxrc
||
1844 print_command
!= system_lyxrc
.print_command
) {
1845 os
<< "\\print_command \"" << escapeCommand(print_command
) << "\"\n";
1849 case RC_PRINTEXSTRAOPTIONS
:
1850 if (ignore_system_lyxrc
||
1851 print_extra_options
!= system_lyxrc
.print_extra_options
) {
1852 os
<< "\\print_extra_options \"" << print_extra_options
1857 case RC_PRINTSPOOL_COMMAND
:
1858 if (ignore_system_lyxrc
||
1859 print_spool_command
!= system_lyxrc
.print_spool_command
) {
1860 os
<< "\\print_spool_command \"" << escapeCommand(print_spool_command
)
1865 case RC_PRINTSPOOL_PRINTERPREFIX
:
1866 if (ignore_system_lyxrc
||
1867 print_spool_printerprefix
1868 != system_lyxrc
.print_spool_printerprefix
) {
1869 os
<< "\\print_spool_printerprefix \""
1870 << print_spool_printerprefix
<< "\"\n";
1874 case RC_PRINTEVENPAGEFLAG
:
1875 if (ignore_system_lyxrc
||
1876 print_evenpage_flag
!= system_lyxrc
.print_evenpage_flag
) {
1877 os
<< "\\print_evenpage_flag \"" << print_evenpage_flag
1882 case RC_PRINTODDPAGEFLAG
:
1883 if (ignore_system_lyxrc
||
1884 print_oddpage_flag
!= system_lyxrc
.print_oddpage_flag
) {
1885 os
<< "\\print_oddpage_flag \"" << print_oddpage_flag
1890 case RC_PRINTREVERSEFLAG
:
1891 if (ignore_system_lyxrc
||
1892 print_reverse_flag
!= system_lyxrc
.print_reverse_flag
) {
1893 os
<< "\\print_reverse_flag \"" << print_reverse_flag
1898 case RC_PRINTLANDSCAPEFLAG
:
1899 if (ignore_system_lyxrc
||
1900 print_landscape_flag
!= system_lyxrc
.print_landscape_flag
) {
1901 os
<< "\\print_landscape_flag \"" << print_landscape_flag
1906 case RC_PRINTPAGERANGEFLAG
:
1907 if (ignore_system_lyxrc
||
1908 print_pagerange_flag
!= system_lyxrc
.print_pagerange_flag
) {
1909 os
<< "\\print_pagerange_flag \"" << print_pagerange_flag
1914 case RC_PRINTCOPIESFLAG
:
1915 if (ignore_system_lyxrc
||
1916 print_copies_flag
!= system_lyxrc
.print_copies_flag
) {
1917 os
<< "\\print_copies_flag \"" << print_copies_flag
1922 case RC_PRINTCOLLCOPIESFLAG
:
1923 if (ignore_system_lyxrc
||
1924 print_collcopies_flag
1925 != system_lyxrc
.print_collcopies_flag
) {
1926 os
<< "\\print_collcopies_flag \""
1927 << print_collcopies_flag
1932 case RC_PRINTPAPERFLAG
:
1933 if (ignore_system_lyxrc
||
1934 print_paper_flag
!= system_lyxrc
.print_paper_flag
) {
1935 os
<< "\\print_paper_flag \"" << print_paper_flag
1940 case RC_PRINTPAPERDIMENSIONFLAG
:
1941 if (ignore_system_lyxrc
||
1942 print_paper_dimension_flag
1943 != system_lyxrc
.print_paper_dimension_flag
) {
1944 os
<< "\\print_paper_dimension_flag \""
1945 << print_paper_dimension_flag
<< "\"\n";
1949 case RC_PRINTTOPRINTER
:
1950 if (ignore_system_lyxrc
||
1951 print_to_printer
!= system_lyxrc
.print_to_printer
) {
1952 os
<< "\\print_to_printer \"" << print_to_printer
1957 case RC_PRINTTOFILE
:
1958 if (ignore_system_lyxrc
||
1959 print_to_file
!= system_lyxrc
.print_to_file
) {
1960 string
const path
= os::external_path(print_to_file
);
1961 os
<< "\\print_to_file \"" << path
<< "\"\n";
1965 case RC_PRINTFILEEXTENSION
:
1966 if (ignore_system_lyxrc
||
1967 print_file_extension
!= system_lyxrc
.print_file_extension
) {
1968 os
<< "\\print_file_extension \""
1969 << print_file_extension
1976 << "# TEX SECTION #######################################\n"
1979 case RC_FONT_ENCODING
:
1980 if (ignore_system_lyxrc
||
1981 fontenc
!= system_lyxrc
.fontenc
) {
1982 os
<< "\\font_encoding \"" << fontenc
<< "\"\n";
1988 << "# FILE SECTION ######################################\n"
1991 case RC_DOCUMENTPATH
:
1992 if (ignore_system_lyxrc
||
1993 document_path
!= system_lyxrc
.document_path
) {
1994 string
const path
= os::external_path(document_path
);
1995 os
<< "\\document_path \"" << path
<< "\"\n";
1999 case RC_USELASTFILEPOS
:
2000 if (ignore_system_lyxrc
||
2001 use_lastfilepos
!= system_lyxrc
.use_lastfilepos
) {
2002 os
<< "\\use_lastfilepos " << convert
<string
>(use_lastfilepos
)
2007 case RC_LOADSESSION
:
2008 if (ignore_system_lyxrc
||
2009 load_session
!= system_lyxrc
.load_session
) {
2010 os
<< "\\load_session " << convert
<string
>(load_session
)
2015 case RC_MOUSE_WHEEL_SPEED
:
2016 if (ignore_system_lyxrc
||
2017 mouse_wheel_speed
!= system_lyxrc
.mouse_wheel_speed
) {
2018 os
<< "\\mouse_wheel_speed " << mouse_wheel_speed
<< '\n';
2022 case RC_COMPLETION_INLINE_DELAY
:
2023 if (ignore_system_lyxrc
||
2024 completion_inline_delay
!= system_lyxrc
.completion_inline_delay
) {
2025 os
<< "\\completion_inline_delay " << completion_inline_delay
<< '\n';
2029 case RC_COMPLETION_INLINE_MATH
:
2030 if (ignore_system_lyxrc
||
2031 completion_inline_math
!= system_lyxrc
.completion_inline_math
) {
2032 os
<< "\\completion_inline_math "
2033 << convert
<string
>(completion_inline_math
) << '\n';
2037 case RC_COMPLETION_INLINE_TEXT
:
2038 if (ignore_system_lyxrc
||
2039 completion_inline_text
!= system_lyxrc
.completion_inline_text
) {
2040 os
<< "\\completion_inline_text "
2041 << convert
<string
>(completion_inline_text
) << '\n';
2045 case RC_COMPLETION_INLINE_DOTS
:
2046 if (ignore_system_lyxrc
||
2047 completion_inline_dots
!= system_lyxrc
.completion_inline_dots
) {
2048 os
<< "\\completion_inline_dots "
2049 << convert
<string
>(completion_inline_dots
) << '\n';
2053 case RC_AUTOCORRECTION_MATH
:
2054 if (ignore_system_lyxrc
||
2055 autocorrection_math
!= system_lyxrc
.autocorrection_math
) {
2056 os
<< "\\autocorrection_math "
2057 << convert
<string
>(autocorrection_math
) << '\n';
2061 case RC_COMPLETION_POPUP_DELAY
:
2062 if (ignore_system_lyxrc
||
2063 completion_popup_delay
!= system_lyxrc
.completion_popup_delay
) {
2064 os
<< "\\completion_popup_delay " << completion_popup_delay
<< '\n';
2068 case RC_COMPLETION_POPUP_MATH
:
2069 if (ignore_system_lyxrc
||
2070 completion_popup_math
!= system_lyxrc
.completion_popup_math
) {
2071 os
<< "\\completion_popup_math "
2072 << convert
<string
>(completion_popup_math
) << '\n';
2076 case RC_COMPLETION_POPUP_TEXT
:
2077 if (ignore_system_lyxrc
||
2078 completion_popup_text
!= system_lyxrc
.completion_popup_text
) {
2079 os
<< "\\completion_popup_text "
2080 << convert
<string
>(completion_popup_text
) << '\n';
2084 case RC_COMPLETION_CURSOR_TEXT
:
2085 if (ignore_system_lyxrc
||
2086 completion_cursor_text
!= system_lyxrc
.completion_cursor_text
) {
2087 os
<< "\\completion_cursor_text "
2088 << convert
<string
>(completion_cursor_text
) << '\n';
2092 case RC_COMPLETION_POPUP_AFTER_COMPLETE
:
2093 if (ignore_system_lyxrc
||
2094 completion_popup_after_complete
2095 != system_lyxrc
.completion_popup_after_complete
) {
2096 os
<< "\\completion_popup_after_complete "
2097 << convert
<string
>(completion_popup_after_complete
) << '\n';
2101 case RC_NUMLASTFILES
:
2102 if (ignore_system_lyxrc
||
2103 num_lastfiles
!= system_lyxrc
.num_lastfiles
) {
2104 os
<< "\\num_lastfiles " << num_lastfiles
<< '\n';
2108 case RC_CHECKLASTFILES
:
2109 if (ignore_system_lyxrc
||
2110 check_lastfiles
!= system_lyxrc
.check_lastfiles
) {
2111 os
<< "\\check_lastfiles " << convert
<string
>(check_lastfiles
)
2116 case RC_EXAMPLEPATH
:
2117 if (ignore_system_lyxrc
||
2118 example_path
!= system_lyxrc
.example_path
) {
2119 string
const path
= os::external_path(example_path
);
2120 os
<< "\\example_path \"" << path
<< "\"\n";
2124 case RC_TEMPLATEPATH
:
2125 if (ignore_system_lyxrc
||
2126 template_path
!= system_lyxrc
.template_path
) {
2127 string
const path
= os::external_path(template_path
);
2128 os
<< "\\template_path \"" << path
<< "\"\n";
2132 case RC_TEMPDIRPATH
:
2133 if (ignore_system_lyxrc
||
2134 tempdir_path
!= system_lyxrc
.tempdir_path
) {
2135 string
const path
= os::external_path(tempdir_path
);
2136 os
<< "\\tempdir_path \"" << path
<< "\"\n";
2140 case RC_THESAURUSDIRPATH
:
2141 if (ignore_system_lyxrc
||
2142 thesaurusdir_path
!= system_lyxrc
.thesaurusdir_path
) {
2143 string
const path
= os::external_path(thesaurusdir_path
);
2144 os
<< "\\thesaurusdir_path \"" << path
<< "\"\n";
2148 case RC_HUNSPELLDIR_PATH
:
2149 if (ignore_system_lyxrc
||
2150 hunspelldir_path
!= system_lyxrc
.hunspelldir_path
) {
2151 string
const path
= os::external_path(hunspelldir_path
);
2152 os
<< "\\hunspelldir_path \"" << path
<< "\"\n";
2160 case RC_PLAINTEXT_ROFF_COMMAND
: // Obsoleted in 2.0
2163 case RC_PLAINTEXT_LINELEN
:
2164 if (ignore_system_lyxrc
||
2165 plaintext_linelen
!= system_lyxrc
.plaintext_linelen
) {
2166 os
<< "\\plaintext_linelen " << plaintext_linelen
<< '\n';
2170 case RC_MAKE_BACKUP
:
2171 if (ignore_system_lyxrc
||
2172 make_backup
!= system_lyxrc
.make_backup
) {
2173 os
<< "\\make_backup " << convert
<string
>(make_backup
) << '\n';
2177 case RC_BACKUPDIR_PATH
:
2178 if (ignore_system_lyxrc
||
2179 backupdir_path
!= system_lyxrc
.backupdir_path
) {
2180 string
const path
= os::external_path(backupdir_path
);
2181 os
<< "\\backupdir_path \"" << path
<< "\"\n";
2187 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2191 << "# SPELLCHECKER SECTION ##############################\n"
2194 case RC_SPELL_COMMAND
:
2195 case RC_USE_SPELL_LIB
:
2199 case RC_ACCEPT_COMPOUND
:
2200 if (ignore_system_lyxrc
||
2201 spellchecker_accept_compound
!= system_lyxrc
.spellchecker_accept_compound
) {
2202 os
<< "\\accept_compound " << convert
<string
>(spellchecker_accept_compound
)
2207 case RC_USE_ALT_LANG
:
2212 if (ignore_system_lyxrc
||
2213 spellchecker_alt_lang
!= system_lyxrc
.spellchecker_alt_lang
) {
2214 os
<< "\\alternate_language \"" << spellchecker_alt_lang
2219 case RC_USE_ESC_CHARS
:
2223 if (ignore_system_lyxrc
||
2224 spellchecker_esc_chars
!= system_lyxrc
.spellchecker_esc_chars
) {
2225 os
<< "\\escape_chars \"" << spellchecker_esc_chars
<< "\"\n";
2229 case RC_USE_PERS_DICT
:
2233 case RC_USE_TOOLTIP
:
2234 if (ignore_system_lyxrc
||
2235 use_tooltip
!= system_lyxrc
.use_tooltip
) {
2236 os
<< "\\use_tooltip "
2237 << convert
<string
>(use_tooltip
)
2242 case RC_USE_PIXMAP_CACHE
:
2243 if (ignore_system_lyxrc
||
2244 use_pixmap_cache
!= system_lyxrc
.use_pixmap_cache
) {
2245 os
<< "\\use_pixmap_cache "
2246 << convert
<string
>(use_pixmap_cache
)
2255 case RC_USE_INP_ENC
:
2261 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2266 case RC_SPELLCHECKER
:
2267 if (ignore_system_lyxrc
||
2268 spellchecker
!= system_lyxrc
.spellchecker
) {
2269 os
<< "\\spellchecker " << spellchecker
<< '\n';
2274 case RC_SPELLCHECK_CONTINUOUSLY
:
2275 if (ignore_system_lyxrc
||
2276 spellcheck_continuously
!= system_lyxrc
.spellcheck_continuously
) {
2277 os
<< "\\spellcheck_continuously " << convert
<string
>(spellcheck_continuously
)
2283 case RC_RTL_SUPPORT
:
2284 if (ignore_system_lyxrc
||
2285 rtl_support
!= system_lyxrc
.rtl_support
) {
2286 os
<< "\\rtl " << convert
<string
>(rtl_support
) << '\n';
2290 case RC_VISUAL_CURSOR
:
2291 if (ignore_system_lyxrc
||
2292 visual_cursor
!= system_lyxrc
.visual_cursor
) {
2293 os
<< "\\visual_cursor " << convert
<string
>(visual_cursor
) << '\n';
2297 case RC_LANGUAGE_PACKAGE
:
2298 if (ignore_system_lyxrc
||
2299 language_package
!= system_lyxrc
.language_package
) {
2300 os
<< "\\language_package \"" << language_package
2305 case RC_LANGUAGE_GLOBAL_OPTIONS
:
2306 if (ignore_system_lyxrc
||
2307 language_global_options
2308 != system_lyxrc
.language_global_options
) {
2309 os
<< "\\language_global_options \""
2310 << convert
<string
>(language_global_options
)
2315 case RC_LANGUAGE_USE_BABEL
:
2316 if (ignore_system_lyxrc
||
2317 language_use_babel
!= system_lyxrc
.language_use_babel
) {
2318 os
<< "\\language_use_babel \""
2319 << convert
<string
>(language_use_babel
)
2324 case RC_LANGUAGE_COMMAND_BEGIN
:
2325 if (ignore_system_lyxrc
||
2326 language_command_begin
2327 != system_lyxrc
.language_command_begin
) {
2328 os
<< "\\language_command_begin \""
2329 << language_command_begin
2334 case RC_LANGUAGE_COMMAND_END
:
2335 if (ignore_system_lyxrc
||
2336 language_command_end
2337 != system_lyxrc
.language_command_end
) {
2338 os
<< "\\language_command_end \"" << language_command_end
2343 case RC_LANGUAGE_COMMAND_LOCAL
:
2344 if (ignore_system_lyxrc
||
2345 language_command_local
2346 != system_lyxrc
.language_command_local
) {
2347 os
<< "\\language_command_local \""
2348 << language_command_local
2353 case RC_LANGUAGE_AUTO_BEGIN
:
2354 if (ignore_system_lyxrc
||
2355 language_auto_begin
!= system_lyxrc
.language_auto_begin
) {
2356 os
<< "\\language_auto_begin "
2357 << convert
<string
>(language_auto_begin
) << '\n';
2361 case RC_LANGUAGE_AUTO_END
:
2362 if (ignore_system_lyxrc
||
2363 language_auto_end
!= system_lyxrc
.language_auto_end
) {
2364 os
<< "\\language_auto_end "
2365 << convert
<string
>(language_auto_end
) << '\n';
2369 case RC_MARK_FOREIGN_LANGUAGE
:
2370 if (ignore_system_lyxrc
||
2371 mark_foreign_language
2372 != system_lyxrc
.mark_foreign_language
) {
2373 os
<< "\\mark_foreign_language " <<
2374 convert
<string
>(mark_foreign_language
) << '\n';
2380 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2383 case RC_AUTO_NUMBER
:
2384 if (ignore_system_lyxrc
||
2385 auto_number
!= system_lyxrc
.auto_number
) {
2386 os
<< "\\auto_number " << convert
<string
>(auto_number
) << '\n';
2390 case RC_DEFAULT_LANGUAGE
:
2391 if (ignore_system_lyxrc
||
2392 default_language
!= system_lyxrc
.default_language
) {
2393 os
<< "\\default_language " << default_language
<< '\n';
2397 case RC_GUI_LANGUAGE
:
2398 if (ignore_system_lyxrc
||
2399 gui_language
!= system_lyxrc
.gui_language
) {
2400 os
<< "\\gui_language " << gui_language
<< '\n';
2406 << "# FORMATS SECTION ##########################\n"
2410 // New/modified formats
2411 for (Formats::const_iterator cit
= formats
.begin();
2412 cit
!= formats
.end(); ++cit
) {
2413 Format
const * format
=
2414 system_formats
.getFormat(cit
->name());
2416 format
->extension() != cit
->extension() ||
2417 format
->prettyname() != cit
->prettyname() ||
2418 format
->shortcut() != cit
->shortcut() ||
2419 format
->viewer() != cit
->viewer() ||
2420 format
->editor() != cit
->editor() ||
2421 format
->documentFormat() != cit
->documentFormat() ||
2422 format
->vectorFormat() != cit
->vectorFormat()) {
2423 os
<< "\\format \"" << cit
->name() << "\" \""
2424 << cit
->extension() << "\" \""
2425 << cit
->prettyname() << "\" \""
2426 << cit
->shortcut() << "\" \""
2427 << escapeCommand(cit
->viewer()) << "\" \""
2428 << escapeCommand(cit
->editor()) << "\" \"";
2429 vector
<string
> flags
;
2430 if (cit
->documentFormat())
2431 flags
.push_back("document");
2432 if (cit
->vectorFormat())
2433 flags
.push_back("vector");
2434 os
<< getStringFromVector(flags
);
2439 // Look for deleted formats
2440 for (Formats::const_iterator cit
= system_formats
.begin();
2441 cit
!= system_formats
.end(); ++cit
)
2442 if (!formats
.getFormat(cit
->name()))
2443 os
<< "\\format \"" << cit
->name()
2444 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2447 case RC_DEFAULT_VIEW_FORMAT
:
2448 if (ignore_system_lyxrc
||
2449 default_view_format
!= system_lyxrc
.default_view_format
) {
2450 os
<< "\\default_view_format " << default_view_format
<< '\n';
2460 << "# CONVERTERS SECTION ##########################\n"
2464 // Look for new converters
2465 for (Converters::const_iterator cit
= theConverters().begin();
2466 cit
!= theConverters().end(); ++cit
) {
2467 Converter
const * converter
=
2468 theSystemConverters().getConverter(cit
->from
,
2471 converter
->command
!= cit
->command
||
2472 converter
->flags
!= cit
->flags
)
2473 os
<< "\\converter \"" << cit
->from
<< "\" \""
2474 << cit
->to
<< "\" \""
2475 << escapeCommand(cit
->command
) << "\" \""
2476 << cit
->flags
<< "\"\n";
2479 // New/modifed converters
2480 for (Converters::const_iterator cit
= theSystemConverters().begin();
2481 cit
!= theSystemConverters().end(); ++cit
)
2482 if (!theConverters().getConverter(cit
->from
, cit
->to
))
2483 os
<< "\\converter \"" << cit
->from
2484 << "\" \"" << cit
->to
<< "\" \"\" \"\"\n";
2491 << "# COPIERS SECTION ##########################\n"
2494 // Look for new movers
2495 Movers::const_iterator
const sysbegin
= theSystemMovers().begin();
2496 Movers::const_iterator
const sysend
= theSystemMovers().end();
2497 Movers::const_iterator it
= theMovers().begin();
2498 Movers::const_iterator end
= theMovers().end();
2500 for (; it
!= end
; ++it
) {
2501 Movers::const_iterator
const sysit
=
2502 find_if(sysbegin
, sysend
, SameMover(*it
));
2503 if (sysit
== sysend
) {
2504 string
const & fmt
= it
->first
;
2505 string
const & command
=
2506 it
->second
.command();
2508 os
<< "\\copier " << fmt
2509 << " \"" << escapeCommand(command
) << "\"\n";
2515 // We don't actually delete SpecialisedMover(s) from the
2516 // map, just clear their 'command', so there's no need
2517 // to test for anything else.
2525 string
const LyXRC::getDescription(LyXRCTags tag
)
2530 case RC_ACCEPT_COMPOUND
:
2531 str
= _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2535 case RC_USE_ALT_LANG
:
2536 str
= _("Specify an alternate language. The default is to use the language of the document.");
2539 case RC_PLAINTEXT_ROFF_COMMAND
:
2540 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.");
2543 case RC_PLAINTEXT_LINELEN
:
2544 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.");
2547 case RC_AUTOREGIONDELETE
:
2548 str
= _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2551 case RC_AUTORESET_OPTIONS
:
2552 str
= _("De-select if you don't want the class options to be reset to defaults after class change.");
2556 str
= _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2559 case RC_AUTO_NUMBER
:
2562 case RC_BACKUPDIR_PATH
:
2563 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.");
2566 case RC_BIBTEX_COMMAND
:
2567 str
= _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2570 case RC_JBIBTEX_COMMAND
:
2571 str
= _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2575 str
= _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2578 case RC_CHECKLASTFILES
:
2579 str
= _("Select to check whether the lastfiles still exist.");
2582 case RC_CHKTEX_COMMAND
:
2583 str
= _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2592 case RC_CURSOR_FOLLOWS_SCROLLBAR
:
2593 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.");
2596 case RC_SCROLL_BELOW_DOCUMENT
:
2597 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");
2600 case RC_MAC_LIKE_WORD_MOVEMENT
:
2601 str
= _("Use the Mac OS X conventions for the word-level cursor movement");
2604 case RC_SHOW_MACRO_LABEL
:
2605 str
= _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2608 case RC_DATE_INSERT_FORMAT
:
2609 //xgettext:no-c-format
2610 str
= _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2614 str
= _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2617 case RC_DEFAULT_VIEW_FORMAT
:
2618 str
= _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2621 case RC_DEFAULT_LANGUAGE
:
2622 str
= _("New documents will be assigned this language.");
2625 case RC_DEFAULT_PAPERSIZE
:
2626 str
= _("Specify the default paper size.");
2629 case RC_DIALOGS_ICONIFY_WITH_MAIN
:
2630 str
= _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2633 case RC_DISPLAY_GRAPHICS
:
2634 str
= _("Select how LyX will display any graphics.");
2637 case RC_DOCUMENTPATH
:
2638 str
= _("The default path for your documents. An empty value selects the directory LyX was started from.");
2642 case RC_USE_ESC_CHARS
:
2643 str
= _("Specify additional chars that can be part of a word.");
2646 case RC_EXAMPLEPATH
:
2647 str
= _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2650 case RC_FONT_ENCODING
:
2651 str
= _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2657 case RC_INDEX_COMMAND
:
2658 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\".");
2661 case RC_JINDEX_COMMAND
:
2662 str
= _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2665 case RC_NOMENCL_COMMAND
:
2666 str
= _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2673 case RC_KBMAP_PRIMARY
:
2674 case RC_KBMAP_SECONDARY
:
2675 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.");
2678 case RC_LABEL_INIT_LENGTH
:
2679 str
= _("Maximum number of words in the initialization string for a new label");
2682 case RC_LANGUAGE_AUTO_BEGIN
:
2683 str
= _("Select if a language switching command is needed at the beginning of the document.");
2686 case RC_LANGUAGE_AUTO_END
:
2687 str
= _("Select if a language switching command is needed at the end of the document.");
2690 case RC_LANGUAGE_COMMAND_BEGIN
:
2691 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.");
2694 case RC_LANGUAGE_COMMAND_END
:
2695 str
= _("The LaTeX command for changing back to the language of the document.");
2698 case RC_LANGUAGE_COMMAND_LOCAL
:
2699 str
= _("The LaTeX command for local changing of the language.");
2702 case RC_LANGUAGE_GLOBAL_OPTIONS
:
2703 str
= _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2706 case RC_LANGUAGE_PACKAGE
:
2707 str
= _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2710 case RC_LANGUAGE_USE_BABEL
:
2711 str
= _("De-select if you don't want babel to be used when the language of the document is the default language.");
2714 case RC_USELASTFILEPOS
:
2715 str
= _("De-select if you do not want LyX to scroll to saved position.");
2718 case RC_LOADSESSION
:
2719 str
= _("De-select to prevent loading files opened from the last LyX session.");
2722 case RC_MAKE_BACKUP
:
2723 str
= _("De-select if you don't want LyX to create backup files.");
2726 case RC_MARK_FOREIGN_LANGUAGE
:
2727 str
= _("Select to control the highlighting of words with a language foreign to that of the document.");
2730 case RC_MOUSE_WHEEL_SPEED
:
2731 str
= bformat(_("The scrolling speed of the mouse wheel."),
2735 case RC_COMPLETION_POPUP_DELAY
:
2736 str
= _("The completion popup delay.");
2739 case RC_COMPLETION_POPUP_MATH
:
2740 str
= _("Select to display the completion popup in math mode.");
2743 case RC_COMPLETION_POPUP_TEXT
:
2744 str
= _("Select to display the completion popup in text mode.");
2747 case RC_COMPLETION_POPUP_AFTER_COMPLETE
:
2748 str
= _("Show the completion popup without delay after non-unique completion attempt.");
2751 case RC_COMPLETION_POPUP_TEXT
:
2752 str
= _("Show a small triangle on the cursor to indicate that a completion is available.");
2755 case RC_COMPLETION_POPUP_DELAY
:
2756 str
= _("The inline completion delay.");
2759 case RC_COMPLETION_INLINE_MATH
:
2760 str
= _("Select to display the inline completion in math mode.");
2763 case RC_COMPLETION_INLINE_TEXT
:
2764 str
= _("Select to display the inline completion in text mode.");
2767 case RC_COMPLETION_INLINE_DOTS
:
2768 str
= _("Use \"...\" to shorten long completions.");
2771 case RC_AUTOCORRECTION_MATH
:
2772 str
= _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2775 case RC_NUMLASTFILES
:
2776 str
= bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2780 case RC_PATH_PREFIX
:
2781 str
= _("Specify those directories which should be "
2782 "prepended to the PATH environment variable. "
2783 "Use the OS native format.");
2787 str
= _("Shows a typeset preview of things such as math");
2790 case RC_PREVIEW_HASHED_LABELS
:
2791 str
= _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2794 case RC_PREVIEW_SCALE_FACTOR
:
2795 str
= _("Scale the preview size to suit.");
2798 case RC_PRINTCOLLCOPIESFLAG
:
2799 str
= _("The option for specifying whether the copies should be collated.");
2802 case RC_PRINTCOPIESFLAG
:
2803 str
= _("The option for specifying the number of copies to print.");
2807 str
= _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2810 case RC_PRINTEVENPAGEFLAG
:
2811 str
= _("The option to print only even pages.");
2814 case RC_PRINTEXSTRAOPTIONS
:
2815 str
= _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2818 case RC_PRINTFILEEXTENSION
:
2819 str
= _("Extension of printer program output file. Usually \".ps\".");
2822 case RC_PRINTLANDSCAPEFLAG
:
2823 str
= _("The option to print out in landscape.");
2826 case RC_PRINTODDPAGEFLAG
:
2827 str
= _("The option to print only odd pages.");
2830 case RC_PRINTPAGERANGEFLAG
:
2831 str
= _("The option for specifying a comma-separated list of pages to print.");
2834 case RC_PRINTPAPERDIMENSIONFLAG
:
2835 str
= _("Option to specify the dimensions of the print paper.");
2838 case RC_PRINTPAPERFLAG
:
2839 str
= _("The option to specify paper type.");
2842 case RC_PRINTREVERSEFLAG
:
2843 str
= _("The option to reverse the order of the pages printed.");
2846 case RC_PRINTSPOOL_COMMAND
:
2847 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.");
2850 case RC_PRINTSPOOL_PRINTERPREFIX
:
2851 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.");
2854 case RC_PRINTTOFILE
:
2855 str
= _("Option to pass to the print program to print to a file.");
2858 case RC_PRINTTOPRINTER
:
2859 str
= _("Option to pass to the print program to print on a specific printer.");
2862 case RC_PRINT_ADAPTOUTPUT
:
2863 str
= _("Select for LyX to pass the name of the destination printer to your print command.");
2866 case RC_PRINT_COMMAND
:
2867 str
= _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2870 case RC_RTL_SUPPORT
:
2871 str
= _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2874 case RC_VISUAL_CURSOR
:
2875 str
= _("Select to have visual bidi cursor movement, unselect for logical movement.");
2879 str
= _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2882 case RC_SCREEN_FONT_ROMAN
:
2883 case RC_SCREEN_FONT_SANS
:
2884 case RC_SCREEN_FONT_TYPEWRITER
:
2885 str
= _("The screen fonts used to display the text while editing.");
2888 case RC_SCREEN_FONT_ROMAN_FOUNDRY
:
2889 case RC_SCREEN_FONT_SANS_FOUNDRY
:
2890 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY
:
2893 case RC_SCREEN_FONT_SCALABLE
:
2894 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.");
2897 case RC_SCREEN_FONT_SIZES
:
2898 str
= _("The font sizes used for calculating the scaling of the screen fonts.");
2901 case RC_SCREEN_ZOOM
:
2902 //xgettext:no-c-format
2903 str
= _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2906 case RC_GEOMETRY_SESSION
:
2907 str
= _("Allow session manager to save and restore windows geometry.");
2911 str
= _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2917 case RC_SHOW_BANNER
:
2918 str
= _("De-select if you don't want the startup banner.");
2921 case RC_TEMPDIRPATH
:
2922 str
= _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2925 case RC_THESAURUSDIRPATH
:
2926 str
= _("This is the place where the files of the thesaurus library reside.");
2929 case RC_TEMPLATEPATH
:
2930 str
= _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2933 case RC_TEX_ALLOWS_SPACES
:
2936 case RC_TEX_EXPECTS_WINDOWS_PATHS
:
2940 str
= _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2952 case RC_USE_TOOLTIP
:
2953 str
= _("Enable the automatic appearance of tool tips in the work area.");
2956 case RC_USE_PIXMAP_CACHE
:
2957 str
= _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2960 case RC_USE_SPELL_LIB
:
2963 case RC_VIEWDVI_PAPEROPTION
:
2964 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2979 // The global instance
2982 // The global copy of the system lyxrc entries (everything except preferences)