]> git.lyx.org Git - lyx.git/commitdiff
Move init() back to LyXView
authorJohn Levon <levon@movementarian.org>
Wed, 12 Jun 2002 11:34:13 +0000 (11:34 +0000)
committerJohn Levon <levon@movementarian.org>
Wed, 12 Jun 2002 11:34:13 +0000 (11:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4379 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/frontends/ChangeLog
src/frontends/LyXView.C
src/frontends/LyXView.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/XFormsView.C
src/frontends/xforms/XFormsView.h
src/lyxfunc.C

index 771836d9e608decfed59f5bdcc051b226772edaa..d533d1f7cf0eedc29c8cafd66a8941fd36e25f3f 100644 (file)
@@ -1032,7 +1032,7 @@ void BufferView::Pimpl::workAreaExpose()
        if (buffer_ != 0) {
                if (widthChange) {
                        // The visible LyXView need a resize
-                       owner_->resize();
+                       owner_->view()->resize();
 
                        // Remove all texts from the textcache
                        // This is not _really_ what we want to do. What
index fd8b28ed9f5e9c8e0c41b098ae92636bd8985037..da46358d14a53fa7145f5405cbeea6c6fd5f7cdc 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
+
+       * lyxfunc.C:
+       * BufferView_pimpl.C: view->resize() change
 2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * BufferView_pimpl.C: topCursorVisible
index b0bede0952b89abfa51502599f2738570fe652e6..48999a728903a23f769ffef83780cd6aadb40cae 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
+
+       * LyXView.h: cleanup
+
+       * LyXView.C: move init() here from xforms/
 2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * screen.h:
index 3db1cfa3a85c0481c7025a15639a4ebf594c9cf1..d8c4ee1539caf2adc2ae77c6d6e51f02c1f14e25 100644 (file)
@@ -42,9 +42,6 @@
 
 using std::endl;
 
-extern void AutoSave(BufferView *);
-extern void QuitLyX();
-
 string current_layout;
 
 
@@ -59,7 +56,6 @@ LyXView::LyXView()
        autosave_timeout_.reset(new Timeout(5000));
 
        dialogs_.reset(new Dialogs(this));
-       Dialogs::redrawGUI.connect(boost::bind(&LyXView::redraw, this));
 }
 
 
@@ -68,9 +64,20 @@ LyXView::~LyXView()
 }
 
 
-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);
 }
 
 
@@ -158,11 +165,13 @@ Intl * LyXView::getIntl() const
 }
 
 
-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());
+       }
 }
 
 
index de5305c6105b73b52eb9ec9cd8c0c4c600a4222a..bf8388a3a4d4be908c9ad566ac7baddb44b0288a 100644 (file)
@@ -50,71 +50,74 @@ class Timeout;
  */
 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_;
@@ -133,7 +136,7 @@ protected:
        boost::scoped_ptr<Timeout> autosave_timeout_;
 
        /// called on timeout
-       void AutoSave();
+       void autoSave();
 
        /// FIXME: GUII - toolbar property
        void invalidateLayoutChoice();
index c4ee4fa018e316fd122a0f1e08aa37d208865899..9d20badd5a7fceadc2516cbd40752c5424001046 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
+
+       * XFormsView.h:
+       * XFormsView.C: move init() back to LyXView
 2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * GUIRunTime.C: remove in favour of ...
index a3f341aebc103afdef603e8a438845febbbf63ff..057e2626eed4cf771530888523d4c5a83d23ad6a 100644 (file)
@@ -26,6 +26,7 @@
 #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"
@@ -65,6 +66,7 @@ XFormsView::XFormsView(int width, int height)
 
        // Make sure the buttons are disabled if needed.
        updateToolbar();
+       Dialogs::redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
 }
 
 
@@ -151,7 +153,7 @@ void XFormsView::create_form_form_main(int width, int height)
                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");
@@ -178,23 +180,6 @@ void XFormsView::create_form_form_main(int width, int height)
 }
 
 
-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());
index cfa8db5ca1f9b5444c76f77aeafbe24c3238e40a..cd2d8877eaeedd3d72774e381e5ef4120189f07b 100644 (file)
@@ -40,8 +40,6 @@ public:
          */
        void show(int xpos, int ypos, string const & t = string("LyX"));
  
-       /// init (should probably be removed later) (Lgb)
-       virtual void init();
        /// get the xforms main form
        FL_FORM * getForm() const;
        /// redraw the main form.
index a5092c264337581f996ba291a35e6ccc3919e7ab..26a1b6aae34ee20166b5e8bd1e6852d7bdbe276f 100644 (file)
@@ -1614,7 +1614,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                // Of course we should only do the resize and the textcache.clear
                // if values really changed...but not very important right now. (Lgb)
                // All visible buffers will need resize
-               owner->resize();
+               owner->view()->resize();
                // We also need to empty the textcache so that
                // the buffer will be formatted correctly after
                // a zoom change.