]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.C
fix "make dist" target
[lyx.git] / src / bufferview_funcs.C
index e3da5b4f02cabf4468cab998272800f4c4c218a9..56ddcad68d9c967c3512e56038ae6b1992167de2 100644 (file)
 #include "lyxfont.h"
 #include "lyx_gui_misc.h"
 #include "lyxtext.h"
-#include "minibuffer.h"
 #include "buffer.h"
 #include "support/lstrings.h"
 #include "lyx_cb.h"
-#include "layout_forms.h"
-
-extern FD_form_character * fd_form_character;
-
-#ifndef NEW_INSETS
-void Foot(BufferView * bv)
-{
-       if (!bv->available()) 
-               return;
-       
-       bv->owner()->getMiniBuffer()
-               ->Set(_("Inserting Footnote..."));
-       bv->hideCursor();
-       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
-       bv->text->InsertFootnoteEnvironment(bv, LyXParagraph::FOOTNOTE);
-       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-}
-#endif
+#include "language.h"
+#include "gettext.h"
 
 
 void Emph(BufferView * bv)
@@ -69,19 +52,6 @@ void Noun(BufferView * bv)
 }
 
 
-#ifndef NEW_INSETS
-void Margin(BufferView * bv)
-{
-       if (bv->available()) {
-               bv->owner()->getMiniBuffer()->Set(_("Inserting margin note..."));
-               bv->hideCursor();
-               bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
-               bv->text->InsertFootnoteEnvironment(bv, LyXParagraph::MARGIN);
-               bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-       }
-}
-#endif
-
 void Number(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
@@ -101,21 +71,6 @@ void Lang(BufferView * bv, string const & l)
 }
 
 
-#ifndef NEW_INSETS
-void Melt(BufferView * bv)
-{
-       if (!bv->available()) return;
-       
-       bv->owner()->getMiniBuffer()->Set(_("Melt"));
-       bv->hideCursor();
-       bv->beforeChange(bv->text);
-       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
-       bv->text->MeltFootnoteEnvironment(bv);
-       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-}
-#endif
-
-
 void Tex(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
@@ -141,15 +96,8 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
        if (text->inset_owner)
            bv->updateInset((Inset *)text->inset_owner, true);
        bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-       bv->owner()->getMiniBuffer()
-               ->Set(_("Changed environment depth"
-                       " (in possible range, maybe not)"));
-}
-
-
-void Free(BufferView * bv)
-{
-       ToggleAndShow(bv, UserFreeFont(bv->buffer()->params));
+       bv->owner()->message(_("Changed environment depth "
+                              "(in possible range, maybe not)"));
 }
 
 
@@ -177,11 +125,6 @@ void ProhibitInput(BufferView * bv)
        XDefineCursor(fl_get_display(), bv->owner()->getForm()->window, 
                      cursor);
 
-       if (fd_form_character->form_character->visible)
-               XDefineCursor(fl_get_display(),
-                             fd_form_character->form_character->window,
-                             cursor);
-
        XFlush(fl_get_display());
        fl_deactivate_all_forms();
 }
@@ -193,10 +136,6 @@ void AllowInput(BufferView * bv)
    
        XUndefineCursor(fl_get_display(), bv->owner()->getForm()->window);
 
-       if (fd_form_character->form_character->visible)
-               XUndefineCursor(fl_get_display(),
-                               fd_form_character->form_character->window);
-
        XFlush(fl_get_display());
        fl_activate_all_forms();
 }
@@ -271,9 +210,9 @@ string const CurrentState(BufferView * bv)
                        state += string(_(", Depth: ")) + tostr(depth);
                // The paragraph spacing, but only if different from
                // buffer spacing.
-               if (!text->cursor.par()->spacing.isDefault()) {
+               if (!text->cursor.par()->params.spacing().isDefault()) {
                        Spacing::Space cur_space =
-                               text->cursor.par()->spacing.getSpace();
+                               text->cursor.par()->params.spacing().getSpace();
                        state += _(", Spacing: ");
                        switch (cur_space) {
                        case Spacing::Single:
@@ -287,7 +226,7 @@ string const CurrentState(BufferView * bv)
                                break;
                        case Spacing::Other:
                                state += _("Other (");
-                               state += tostr(text->cursor.par()->spacing.getValue());
+                               state += tostr(text->cursor.par()->params.spacing().getValue());
                                state += ")";
                                break;
                        case Spacing::Default:
@@ -303,7 +242,7 @@ string const CurrentState(BufferView * bv)
 /* -------> Does the actual toggle job of the XxxCB() calls above.
  * Also shows the current font state.
  */
-void ToggleAndShow(BufferView * bv, LyXFont const & font)
+void ToggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
 {
        if (bv->available()) { 
                LyXText * text = bv->getLyXText();