]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
redraw fix 1.
[lyx.git] / src / lyxrc.C
index 51d6d777759125eb12d216a52cb7949277ae4c74..e75b78aab89550241dbe5fe7e83362c03574a547 100644 (file)
@@ -43,6 +43,7 @@ extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 
 namespace {
 
+// when adding something to this array keep it sorted!
 keyword_item lyxrcTags[] = {
        { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
        { "\\alternate_language", LyXRC::RC_ALT_LANG },
@@ -94,6 +95,9 @@ keyword_item lyxrcTags[] = {
        { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
        { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
        { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
+       { "\\preview", LyXRC::RC_PREVIEW },
+       { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
+       { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
        { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
        { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
        { "\\print_command", LyXRC::RC_PRINT_COMMAND },
@@ -130,6 +134,7 @@ keyword_item lyxrcTags[] = {
        { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
        { "\\serverpipe", LyXRC::RC_SERVERPIPE },
        { "\\set_color", LyXRC::RC_SET_COLOR },
+       { "\\show_banner", LyXRC::RC_SHOW_BANNER },
        { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
        { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
        { "\\template_path", LyXRC::RC_TEMPLATEPATH },
@@ -253,6 +258,9 @@ void LyXRC::setDefaults() {
        cursor_follows_scrollbar = false;
        dialogs_iconify_with_main = false;
        label_init_length = 3;
+       preview = false;
+       preview_hashed_labels  = false;
+       preview_scale_factor = 0.9;
 
        /// These variables are not stored on disk (perhaps they
        // should be moved from the LyXRC class).
@@ -935,6 +943,26 @@ int LyXRC::read(string const & filename)
                                label_init_length = lexrc.getInteger();
                        break;
 
+               case RC_SHOW_BANNER:
+                       if (lexrc.next())
+                               show_banner = lexrc.getBool();
+                       break;
+
+               case RC_PREVIEW:
+                       if (lexrc.next())
+                               preview = lexrc.getBool();
+                       break;
+
+               case RC_PREVIEW_HASHED_LABELS:
+                       if (lexrc.next())
+                               preview_hashed_labels = lexrc.getBool();
+                       break;
+
+               case RC_PREVIEW_SCALE_FACTOR:
+                       if (lexrc.next())
+                               preview_scale_factor = lexrc.getFloat();
+                       break;
+
                case RC_LAST: break; // this is just a dummy
                }
        }
@@ -1109,6 +1137,29 @@ void LyXRC::output(ostream & os) const
                           << "\n";
                }
 
+       case RC_SHOW_BANNER:
+               if (show_banner != system_lyxrc.show_banner) {
+                       os << "\\show_banner " << tostr(show_banner) << "\n";
+               }
+
+       case RC_PREVIEW:
+               if (preview != system_lyxrc.preview) {
+                       os << "\\preview " << tostr(preview) << "\n";
+               }
+
+       case RC_PREVIEW_HASHED_LABELS:
+               if (preview_hashed_labels !=
+                   system_lyxrc.preview_hashed_labels) {
+                       os << "\\preview_hashed_labels "
+                          << tostr(preview_hashed_labels) << "\n";
+               }
+
+       case RC_PREVIEW_SCALE_FACTOR:
+               if (preview_scale_factor != system_lyxrc.preview_scale_factor) {
+                       os << "\\preview_scale_factor "
+                          << preview_scale_factor << "\n";
+               }
+
                os << "\n#\n"
                   << "# SCREEN & FONTS SECTION ############################\n"
                   << "#\n\n";
@@ -1976,6 +2027,18 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Maximum number of words in the initialization string for a new label");
                break;
 
+       case RC_PREVIEW:
+               str = _("Shows a typeset preview of things such as math");
+               break;
+
+       case RC_PREVIEW_HASHED_LABELS:
+               str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
+               break;
+
+       case RC_PREVIEW_SCALE_FACTOR:
+               str = _("Scale the preview size to suit.");
+               break;
+
        default:
                break;
        }