]> git.lyx.org Git - lyx.git/blobdiff - src/LyXView.C
In for a penny, in for a pound. Consistent use of // -*- C++ -*-
[lyx.git] / src / LyXView.C
index b50eedee8146147ea24b14b0fd09b8c4da9e4039..f11ddce9504487ad5a81c32ee7d631547fd2b62f 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 
 #include "LyXView.h"
 #include "lyx_main.h"
-#if FL_REVISION < 89
+#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
 #include "lyxlookup.h"
 #endif
 #include "minibuffer.h"
-#include "lyxfunc.h"
 #include "debug.h"
-#include "layout_forms.h"
 #include "intl.h"
 #include "lyxrc.h"
 #include "support/filetools.h"        // OnlyFilename()
@@ -39,6 +37,8 @@
 #include "ToolbarDefaults.h"
 #include "lyx_gui_misc.h"      // [update,Close,Redraw]AllBufferRelatedDialogs
 #include "bufferview_funcs.h" // CurrentState()
+#include "gettext.h"
+#include "lyxfunc.h"
 
 using std::endl;
 
@@ -51,10 +51,6 @@ BufferView * current_view;
 
 extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM *, void *);
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Connection;
-using SigC::slot;
-#endif
 
 LyXView::LyXView(int width, int height)
 {
@@ -62,6 +58,13 @@ LyXView::LyXView(int width, int height)
        fl_set_form_atclose(form_, C_LyXView_atCloseMainFormCB, 0);
        lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
        lyxfunc = new LyXFunc(this);
+
+       // Connect the minibuffer signals
+       minibuffer->stringReady.connect(SigC::slot(lyxfunc,
+                                                  &LyXFunc::miniDispatch));
+       minibuffer->timeout.connect(SigC::slot(lyxfunc,
+                                              &LyXFunc::initMiniBuffer));
+       
        intl = new Intl;
 
        // Make sure the buttons are disabled if needed.
@@ -71,11 +74,11 @@ LyXView::LyXView(int width, int height)
        dialogs_ = new Dialogs(this);
        // temporary until all dialogs moved into Dialogs.
        dialogs_->updateBufferDependent
-               .connect(slot(&updateAllVisibleBufferRelatedDialogs));
+               .connect(SigC::slot(&updateAllVisibleBufferRelatedDialogs));
        dialogs_->hideBufferDependent
-               .connect(slot(&CloseAllBufferRelatedDialogs));
-       Dialogs::redrawGUI.connect(slot(this, &LyXView::redraw));
-       Dialogs::redrawGUI.connect(slot(&RedrawAllBufferRelatedDialogs));
+               .connect(SigC::slot(&CloseAllBufferRelatedDialogs));
+       Dialogs::redrawGUI.connect(SigC::slot(this, &LyXView::redraw));
+       Dialogs::redrawGUI.connect(SigC::slot(&RedrawAllBufferRelatedDialogs));
 }
 
 
@@ -95,7 +98,7 @@ LyXView::~LyXView()
 void LyXView::redraw() {
        lyxerr[Debug::INFO] << "LyXView::redraw()" << endl;
        fl_redraw_form(form_);
-       minibuffer->Activate();
+       minibuffer->redraw();
 }
 
 
@@ -149,6 +152,24 @@ MiniBuffer * LyXView::getMiniBuffer() const
 }
 
 
+void LyXView::message(string const & str)
+{
+       minibuffer->message(str);
+}
+
+
+void LyXView::messagePush(string const & str)
+{
+       minibuffer->messagePush(str);
+}
+
+
+void LyXView::messagePop()
+{
+       minibuffer->messagePop();
+}
+
+
 Menubar * LyXView::getMenubar() const
 {
        return menubar;
@@ -213,8 +234,8 @@ void LyXView::setPosition(int x, int y)
 void LyXView::show(int place, int border, string const & title)
 {
        fl_show_form(form_, place, border, title.c_str());
-       minibuffer->Init();
-#if FL_REVISION < 89
+       lyxfunc->initMiniBuffer();
+#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
        InitLyXLookup(fl_get_display(), form_->window);
 #endif
 }
@@ -275,7 +296,7 @@ void LyXView::create_form_form_main(int width, int height)
        // TIMERS
        //
 
-       autosave_timeout.timeout.connect(slot(this, &LyXView::AutoSave));
+       autosave_timeout.timeout.connect(SigC::slot(this, &LyXView::AutoSave));
        
        //
        // Misc
@@ -363,7 +384,7 @@ void LyXView::updateWindowTitle()
        string title = "LyX";
 
        if (view()->available()) {
-               string cur_title = buffer()->fileName();
+               string const cur_title = buffer()->fileName();
                if (!cur_title.empty()){
                        title += ": " + MakeDisplayPath(cur_title, 30);
                        if (!buffer()->isLyxClean())
@@ -382,7 +403,7 @@ void LyXView::updateWindowTitle()
 
 void LyXView::showState()
 {
-       getMiniBuffer()->Set(CurrentState(view()));
+       message(CurrentState(view()));
        getToolbar()->update();
        menubar->update();
 }