]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
Partially revert r34995, which broke math output. Not sure why yet....
[lyx.git] / src / LyXRC.cpp
index bc63df81678c75d954df0e9a14286b25bcf0609d..bd52e887bb1425b5a39ab398b870b6350bd71b04 100644 (file)
@@ -43,6 +43,7 @@
 
 #include <fstream>
 #include <iostream>
+#include <algorithm>
 
 using namespace std;
 using namespace lyx::support;
@@ -84,6 +85,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
        { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
        { "\\def_file", LyXRC::RC_DEFFILE },
+       { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
        { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
        { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
        { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
@@ -171,6 +173,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
        { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
        { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
+       { "\\scroll_whell_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
        { "\\serverpipe", LyXRC::RC_SERVERPIPE },
        { "\\set_color", LyXRC::RC_SET_COLOR },
        { "\\show_banner", LyXRC::RC_SHOW_BANNER },
@@ -283,7 +286,10 @@ void LyXRC::setDefaults()
        backupdir_path.erase();
        display_graphics = true;
        // Spellchecker settings:
-#if defined(USE_ASPELL)
+// FIXME: this check should test the target platform (darwin)
+#if defined(USE_MACOSX_PACKAGING)
+       spellchecker = "native";
+#elif defined(USE_ASPELL)
        spellchecker = "aspell";
 #elif defined(USE_HUNSPELL)
        spellchecker = "hunspell";
@@ -315,6 +321,7 @@ void LyXRC::setDefaults()
        date_insert_format = "%x";
        cursor_follows_scrollbar = false;
        scroll_below_document = false;
+       scroll_whell_zoom = SCROLL_WHEEL_ZOOM_CTRL;
        paragraph_markers = false;
        mac_like_word_movement = false;
        macro_edit_style = MACRO_EDIT_INLINE_BOX;
@@ -352,6 +359,7 @@ void LyXRC::setDefaults()
        completion_inline_text = false;
        completion_inline_dots = -1;
        completion_inline_delay = 0.2;
+       default_decimal_point = ".";
 }
 
 
@@ -939,6 +947,9 @@ int LyXRC::read(Lexer & lexrc)
                                backupdir_path = expandPath(backupdir_path);
                        }
                        break;
+               case RC_DEFAULT_DECIMAL_POINT:
+                       lexrc >> default_decimal_point;
+                       break;
                case RC_DATE_INSERT_FORMAT:
                        lexrc >> date_insert_format;
                        break;
@@ -1186,6 +1197,23 @@ int LyXRC::read(Lexer & lexrc)
                                }
                        }
                        break;
+               case RC_SCROLL_WHEEL_ZOOM:
+                       if (lexrc.next()) {
+                               string const tmp = lexrc.getString();
+                               if (tmp == "ctrl")
+                                       scroll_whell_zoom = SCROLL_WHEEL_ZOOM_CTRL;
+                               else if (tmp == "shift")
+                                       scroll_whell_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
+                               else if (tmp == "alt")
+                                       scroll_whell_zoom = SCROLL_WHEEL_ZOOM_ALT;
+                               else {
+                                       scroll_whell_zoom = SCROLL_WHEEL_ZOOM_OFF;
+                                       if (tmp != "off" && tmp != "false")
+                                               LYXERR0("Unrecognized scroll_whell_zoom status \""
+                                                      << tmp << '"');
+                               }
+                       }
+                       break;
 
                // Obsoteted in 1.4.0
                case RC_USETEMPDIR:
@@ -1418,8 +1446,30 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                        case PAPER_B5:
                                os << "b5"; break;
                        case PAPER_CUSTOM:
+                       case PAPER_A0:
+                       case PAPER_A1:
+                       case PAPER_A2:
+                       case PAPER_A6:
+                       case PAPER_B0:
+                       case PAPER_B1:
+                       case PAPER_B2:
                        case PAPER_B3:
-                       case PAPER_B4: break;
+                       case PAPER_B4:
+                       case PAPER_B6:
+                       case PAPER_C0:
+                       case PAPER_C1:
+                       case PAPER_C2:
+                       case PAPER_C3:
+                       case PAPER_C4:
+                       case PAPER_C5:
+                       case PAPER_C6:
+                       case PAPER_JISB0:
+                       case PAPER_JISB1:
+                       case PAPER_JISB2:
+                       case PAPER_JISB3:
+                       case PAPER_JISB4:
+                       case PAPER_JISB5:
+                       case PAPER_JISB6: break;
                        }
                        os << "\"\n";
                }
@@ -2365,6 +2415,14 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
 
+       case RC_DEFAULT_DECIMAL_POINT:
+               if (ignore_system_lyxrc ||
+                   default_decimal_point != system_lyxrc.default_decimal_point) {
+                       os << "\\default_decimal_point " << default_decimal_point << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
+
        case RC_SPELLCHECKER:
                if (ignore_system_lyxrc ||
                    spellchecker != system_lyxrc.spellchecker) {
@@ -2532,6 +2590,29 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
 
+       case RC_SCROLL_WHEEL_ZOOM:
+               if (ignore_system_lyxrc ||
+                   scroll_whell_zoom != system_lyxrc.scroll_whell_zoom) {
+                       string status;
+                       switch (scroll_whell_zoom) {
+                       case SCROLL_WHEEL_ZOOM_OFF:
+                               status = "off";
+                               break;
+                       case SCROLL_WHEEL_ZOOM_CTRL:
+                               status = "ctrl";
+                               break;
+                       case SCROLL_WHEEL_ZOOM_SHIFT:
+                               status = "shift";
+                               break;
+                       case SCROLL_WHEEL_ZOOM_ALT:
+                               status = "alt";
+                               break;
+                       }
+                       os << "\\scroll_whell_zoom " << status << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
+
                os << "\n#\n"
                   << "# FORMATS SECTION ##########################\n"
                   << "#\n\n";
@@ -2869,6 +2950,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_FORWARD_SEARCH_DVI:
        case LyXRC::RC_FORWARD_SEARCH_PDF:
        case LyXRC::RC_EXPORT_OVERWRITE:
+       case LyXRC::RC_DEFAULT_DECIMAL_POINT:
+       case LyXRC::RC_SCROLL_WHEEL_ZOOM:
        case LyXRC::RC_LAST:
                break;
        }