using std::endl;
-extern void AutoSave(BufferView *);
-extern void QuitLyX();
-
string current_layout;
autosave_timeout_.reset(new Timeout(5000));
dialogs_.reset(new Dialogs(this));
- Dialogs::redrawGUI.connect(boost::bind(&LyXView::redraw, this));
}
}
-void LyXView::resize()
+void LyXView::init()
{
- view()->resize();
+ // Set the textclass choice
+ invalidateLayoutChoice();
+ updateLayoutChoice();
+ updateMenubar();
+
+ // Start autosave timer
+ if (lyxrc.autosave) {
+ autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
+ autosave_timeout_->start();
+ }
+
+ intl_->InitKeyMapper(lyxrc.use_kbmap);
}
}
-void LyXView::AutoSave()
+void LyXView::autoSave()
{
- lyxerr[Debug::INFO] << "Running AutoSave()" << endl;
- if (view()->available())
+ lyxerr[Debug::INFO] << "Running autoSave()" << endl;
+
+ if (view()->available()) {
::AutoSave(view());
+ }
}
*/
class LyXView : public boost::signals::trackable, boost::noncopyable {
public:
- ///
+
LyXView();
- ///
+
virtual ~LyXView();
- /// Redraw the main form.
- virtual void redraw() = 0;
- /// Resize all BufferViews in this LyXView (because the width changed)
- void resize();
+ /// FIXME: what is the requirement for this be to separate from the ctor ?
+ void init();
- /// returns the buffer currently shown in the main form.
- Buffer * buffer() const;
-
- ///
- BufferView * view() const;
+ /// start modal operation
+ virtual void prohibitInput() const = 0;
+ /// end modal operation
+ virtual void allowInput() const = 0;
- /// return the toolbar for this view
- Toolbar * getToolbar() const;
+ //@{ generic accessor functions
- /// sets the layout in the toolbar layout combox
- void setLayout(string const & layout);
- /// update the toolbar
- void updateToolbar();
+ /// return the current buffer view
+ BufferView * view() const;
- /// return a pointer to the lyxfunc
+ /// return the LyX function handler for this view
LyXFunc * getLyXFunc() const;
- /// return a pointer to the minibuffer
- MiniBuffer * getMiniBuffer() const;
+ /// return the buffer currently shown in this window
+ Buffer * buffer() const;
- ///
- void message(string const &);
- ///
- void messagePush(string const & str);
- ///
- void messagePop();
+ /// return the toolbar for this view
+ Toolbar * getToolbar() const;
/// return the menubar for this view
Menubar * getMenubar() const;
- ///
- void updateMenubar();
-
- ///
- Intl * getIntl() const;
+ /// return the minibuffer for this view
+ /// FIXME: I'm not at all sure that LyXFunc should be
+ /// aware of a mini buffer as such
+ MiniBuffer * getMiniBuffer() const;
/// get access to the dialogs
Dialogs * getDialogs() { return dialogs_.get(); }
- ///
+ /// get this view's keyboard map handler
+ Intl * getIntl() const;
+
+ //@}
+
+ /// sets the layout in the toolbar layout selection
+ void setLayout(string const & layout);
+ /// updates the possible layouts selectable
void updateLayoutChoice();
- /// Updates the title of the window
- void updateWindowTitle();
+ /// update the toolbar
+ void updateToolbar();
+ /// update the menubar
+ void updateMenubar();
- /// Show state (toolbar and font in minibuffer)
+ /// display a message in the view
+ void message(string const &);
+ /// push a message onto the history, and show it
+ void messagePush(string const & str);
+ /// pop the last message pushed
+ void messagePop();
+ /// show state (font etc.) in minibuffer
void showState();
+
+ /// updates the title of the window
+ void updateWindowTitle();
- /// Reset autosave timer
+ /// reset autosave timer
void resetAutosaveTimer();
- ///
- virtual void prohibitInput() const = 0;
- ///
- virtual void allowInput() const = 0;
-
+
protected:
/// view of a buffer. Eventually there will be several.
boost::scoped_ptr<BufferView> bufferview_;
boost::scoped_ptr<Timeout> autosave_timeout_;
/// called on timeout
- void AutoSave();
+ void autoSave();
/// FIXME: GUII - toolbar property
void invalidateLayoutChoice();
#include "frontends/Toolbar.h"
#include "frontends/Menubar.h"
#include "frontends/Timeout.h"
+#include "frontends/Dialogs.h"
#include "MenuBackend.h"
#include "ToolbarDefaults.h"
#include "lyxfunc.h"
// Make sure the buttons are disabled if needed.
updateToolbar();
+ Dialogs::redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
}
width - (2 * air), 25));
// FIXME: why do this in xforms/ ?
- autosave_timeout_->timeout.connect(boost::bind(&XFormsView::AutoSave, this));
+ autosave_timeout_->timeout.connect(boost::bind(&XFormsView::autoSave, this));
// assign an icon to main form
string iconname = LibFileSearch("images", "lyx", "xpm");
}
-void XFormsView::init()
-{
- // Set the textclass choice
- invalidateLayoutChoice();
- updateLayoutChoice();
- updateMenubar();
-
- // Start autosave timer
- if (lyxrc.autosave) {
- autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
- autosave_timeout_->start();
- }
-
- intl_->InitKeyMapper(lyxrc.use_kbmap);
-}
-
-
void XFormsView::setWindowTitle(string const & title, string const & icon_title)
{
fl_set_form_title(getForm(), title.c_str());