From 1e3d2fce7fdf59ffebedee91ce50d02307ce2083 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 12 Aug 2002 14:28:43 +0000 Subject: [PATCH] No longer pass Controller & or Dialogs & to the View c-tors. GUI now contains a controller rather than derives from a controller. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4942 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/ChangeLog | 6 ++ src/frontends/DialogBase.h | 3 +- src/frontends/Toolbar.C | 5 +- src/frontends/Toolbar.h | 5 +- src/frontends/controllers/ChangeLog | 18 ++++++ src/frontends/controllers/ControlButtons.C | 31 ++++++++- src/frontends/controllers/ControlButtons.h | 31 +++++---- src/frontends/controllers/ControlDialog.h | 7 +- src/frontends/controllers/ControlInset.h | 3 +- src/frontends/controllers/GUI.h | 70 +++++++------------- src/frontends/controllers/ViewBase.h | 68 +++++++++----------- src/frontends/controllers/character.h | 3 + src/frontends/qt2/ChangeLog | 54 ++++++++++++++++ src/frontends/qt2/Menubar_pimpl.C | 3 +- src/frontends/qt2/Menubar_pimpl.h | 4 +- src/frontends/qt2/QAbout.C | 4 +- src/frontends/qt2/QAbout.h | 3 +- src/frontends/qt2/QBibitem.C | 4 +- src/frontends/qt2/QBibitem.h | 2 +- src/frontends/qt2/QBibtex.C | 4 +- src/frontends/qt2/QBibtex.h | 2 +- src/frontends/qt2/QCharacter.C | 4 +- src/frontends/qt2/QCharacter.h | 4 +- src/frontends/qt2/QCitation.C | 4 +- src/frontends/qt2/QCitation.h | 4 +- src/frontends/qt2/QERT.C | 4 +- src/frontends/qt2/QERT.h | 4 +- src/frontends/qt2/QError.C | 4 +- src/frontends/qt2/QError.h | 4 +- src/frontends/qt2/QExternal.C | 4 +- src/frontends/qt2/QExternal.h | 2 +- src/frontends/qt2/QFloat.C | 4 +- src/frontends/qt2/QFloat.h | 2 +- src/frontends/qt2/QGraphics.C | 4 +- src/frontends/qt2/QGraphics.h | 2 +- src/frontends/qt2/QInclude.C | 4 +- src/frontends/qt2/QInclude.h | 2 +- src/frontends/qt2/QIndex.C | 4 +- src/frontends/qt2/QIndex.h | 4 +- src/frontends/qt2/QLog.C | 4 +- src/frontends/qt2/QLog.h | 2 +- src/frontends/qt2/QMinipage.C | 4 +- src/frontends/qt2/QMinipage.h | 2 +- src/frontends/qt2/QParagraph.C | 4 +- src/frontends/qt2/QParagraph.h | 4 +- src/frontends/qt2/QPreamble.C | 4 +- src/frontends/qt2/QPreamble.h | 2 +- src/frontends/qt2/QPrint.C | 4 +- src/frontends/qt2/QPrint.h | 2 +- src/frontends/qt2/QRef.C | 4 +- src/frontends/qt2/QRef.h | 4 +- src/frontends/qt2/QSearch.C | 4 +- src/frontends/qt2/QSearch.h | 4 +- src/frontends/qt2/QShowFile.C | 4 +- src/frontends/qt2/QShowFile.h | 4 +- src/frontends/qt2/QSpellchecker.C | 4 +- src/frontends/qt2/QSpellchecker.h | 4 +- src/frontends/qt2/QTabularCreate.C | 4 +- src/frontends/qt2/QTabularCreate.h | 4 +- src/frontends/qt2/QTexinfo.C | 4 +- src/frontends/qt2/QTexinfo.h | 2 +- src/frontends/qt2/QThesaurus.C | 4 +- src/frontends/qt2/QThesaurus.h | 2 +- src/frontends/qt2/QToc.C | 4 +- src/frontends/qt2/QToc.h | 2 +- src/frontends/qt2/QURL.C | 4 +- src/frontends/qt2/QURL.h | 4 +- src/frontends/qt2/QVCLog.C | 4 +- src/frontends/qt2/QVCLog.h | 2 +- src/frontends/qt2/Qt2Base.C | 22 +++++-- src/frontends/qt2/Qt2Base.h | 36 +++++++---- src/frontends/qt2/QtView.C | 2 +- src/frontends/qt2/Toolbar_pimpl.C | 2 +- src/frontends/qt2/Toolbar_pimpl.h | 2 +- src/frontends/qt2/guiapi.C | 74 +++++++++++----------- src/frontends/xforms/ChangeLog | 59 +++++++++++++++++ src/frontends/xforms/Dialogs.C | 3 + src/frontends/xforms/FormAboutlyx.C | 4 +- src/frontends/xforms/FormAboutlyx.h | 2 +- src/frontends/xforms/FormBase.C | 32 ++++++---- src/frontends/xforms/FormBase.h | 42 ++++++------ src/frontends/xforms/FormBaseDeprecated.C | 2 +- src/frontends/xforms/FormBaseDeprecated.h | 2 +- src/frontends/xforms/FormBibitem.C | 4 +- src/frontends/xforms/FormBibitem.h | 2 +- src/frontends/xforms/FormBibtex.C | 4 +- src/frontends/xforms/FormBibtex.h | 2 +- src/frontends/xforms/FormBrowser.C | 5 +- src/frontends/xforms/FormBrowser.h | 3 +- src/frontends/xforms/FormCharacter.C | 4 +- src/frontends/xforms/FormCharacter.h | 2 +- src/frontends/xforms/FormCitation.C | 4 +- src/frontends/xforms/FormCitation.h | 2 +- src/frontends/xforms/FormERT.C | 4 +- src/frontends/xforms/FormERT.h | 2 +- src/frontends/xforms/FormError.C | 4 +- src/frontends/xforms/FormError.h | 2 +- src/frontends/xforms/FormExternal.C | 4 +- src/frontends/xforms/FormExternal.h | 2 +- src/frontends/xforms/FormFloat.C | 4 +- src/frontends/xforms/FormFloat.h | 2 +- src/frontends/xforms/FormForks.C | 4 +- src/frontends/xforms/FormForks.h | 2 +- src/frontends/xforms/FormGraphics.C | 4 +- src/frontends/xforms/FormGraphics.h | 2 +- src/frontends/xforms/FormInclude.C | 6 +- src/frontends/xforms/FormInclude.h | 2 +- src/frontends/xforms/FormIndex.C | 4 +- src/frontends/xforms/FormIndex.h | 2 +- src/frontends/xforms/FormLog.C | 4 +- src/frontends/xforms/FormLog.h | 2 +- src/frontends/xforms/FormMinipage.C | 4 +- src/frontends/xforms/FormMinipage.h | 2 +- src/frontends/xforms/FormParagraph.C | 4 +- src/frontends/xforms/FormParagraph.h | 2 +- src/frontends/xforms/FormPreamble.C | 4 +- src/frontends/xforms/FormPreamble.h | 2 +- src/frontends/xforms/FormPrint.C | 4 +- src/frontends/xforms/FormPrint.h | 2 +- src/frontends/xforms/FormRef.C | 4 +- src/frontends/xforms/FormRef.h | 2 +- src/frontends/xforms/FormSearch.C | 4 +- src/frontends/xforms/FormSearch.h | 2 +- src/frontends/xforms/FormSendto.C | 4 +- src/frontends/xforms/FormSendto.h | 2 +- src/frontends/xforms/FormShowFile.C | 4 +- src/frontends/xforms/FormShowFile.h | 2 +- src/frontends/xforms/FormSpellchecker.C | 4 +- src/frontends/xforms/FormSpellchecker.h | 2 +- src/frontends/xforms/FormTabularCreate.C | 4 +- src/frontends/xforms/FormTabularCreate.h | 2 +- src/frontends/xforms/FormTexinfo.C | 4 +- src/frontends/xforms/FormTexinfo.h | 2 +- src/frontends/xforms/FormThesaurus.C | 4 +- src/frontends/xforms/FormThesaurus.h | 2 +- src/frontends/xforms/FormToc.C | 4 +- src/frontends/xforms/FormToc.h | 2 +- src/frontends/xforms/FormUrl.C | 4 +- src/frontends/xforms/FormUrl.h | 2 +- src/frontends/xforms/FormVCLog.C | 4 +- src/frontends/xforms/FormVCLog.h | 2 +- src/frontends/xforms/Toolbar_pimpl.C | 4 +- src/frontends/xforms/Toolbar_pimpl.h | 3 +- src/frontends/xforms/Tooltips.C | 8 +-- src/frontends/xforms/Tooltips.h | 16 ++--- src/frontends/xforms/XFormsView.C | 7 +- src/frontends/xforms/XFormsView.h | 3 +- src/frontends/xforms/guiapi.C | 74 +++++++++++----------- 148 files changed, 621 insertions(+), 454 deletions(-) diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index c78464eb2b..fb64a27cd0 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,9 @@ +2002-08-12 Angus Leeming + + * DialogBase.h: no longer derive from boost::signals::trackable. + + * Toolbar.[Ch] (c-tor): no londer passed a Dialogs &. + 2002-08-08 John Levon * Toolbar.C: diff --git a/src/frontends/DialogBase.h b/src/frontends/DialogBase.h index e9ba6926c3..e4179d0022 100644 --- a/src/frontends/DialogBase.h +++ b/src/frontends/DialogBase.h @@ -17,7 +17,6 @@ #ifndef DIALOGBASE_H #define DIALOGBASE_H -#include #include /** Abstract base class of all dialogs. @@ -26,7 +25,7 @@ satisfy that request. Thus a dialog will have to "pull" the necessary details from the core of the program. */ -class DialogBase : public boost::signals::trackable, boost::noncopyable +class DialogBase : boost::noncopyable { public: /**@name Constructors and Deconstructors */ diff --git a/src/frontends/Toolbar.C b/src/frontends/Toolbar.C index c544bb3f91..251f628004 100644 --- a/src/frontends/Toolbar.C +++ b/src/frontends/Toolbar.C @@ -20,11 +20,10 @@ using std::endl; -Toolbar::Toolbar(LyXView * o, Dialogs & d, - int x, int y, ToolbarDefaults const &tbd) +Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd) : last_textclass_(-1) { - pimpl_ = new Pimpl(o, d, x, y); + pimpl_ = new Pimpl(o, x, y); // extracts the toolbar actions from tbd for (ToolbarDefaults::const_iterator cit = tbd.begin(); diff --git a/src/frontends/Toolbar.h b/src/frontends/Toolbar.h index 77c1bd52d9..331024efd0 100644 --- a/src/frontends/Toolbar.h +++ b/src/frontends/Toolbar.h @@ -22,7 +22,7 @@ class LyXView; class ToolbarDefaults; -class Dialogs; + /** The LyX GUI independent toolbar class The GUI interface is implemented in the corresponding Toolbar_pimpl class. @@ -30,8 +30,7 @@ class Dialogs; class Toolbar { public: /// - Toolbar(LyXView * o, Dialogs & d, - int x, int y, ToolbarDefaults const &); + Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &); /// ~Toolbar(); diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 384d656a38..4837f603b7 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,21 @@ +2002-08-12 Angus Leeming + + * ControlButtons.[Ch] (bc, view): no longer virtual. + (setView, setButtonController): new methods, invoked by GUI. + + * ControlDialog.h (show): + * ControlInset.h (createInset, showInset): make public, so that GUI can + invoke them. + + * GUI.h: GUI now contains a controller, rather than deriving from it. + remove all those friend functions since we can now access the show, + createInset, showInset controller methods. + + * ViewBase.h: simplifiy, enabling ControlButtons to be forward-declared. + (ViewBC): scrapped. + + * character.h: #include a couple of STL files. + 2002-08-08 John Levon * ControlCommandBuffer.C: LyXAction cleanup diff --git a/src/frontends/controllers/ControlButtons.C b/src/frontends/controllers/ControlButtons.C index 4b9560acb3..7c2172744b 100644 --- a/src/frontends/controllers/ControlButtons.C +++ b/src/frontends/controllers/ControlButtons.C @@ -21,9 +21,11 @@ #include "ButtonControllerBase.h" #include "ViewBase.h" #include "lyxrc.h" +#include "support/LAssert.h" + ControlButtons::ControlButtons() - : emergency_exit_(false), is_closing_(false) + : emergency_exit_(false), is_closing_(false), bc_ptr_(0), view_ptr_(0) {} @@ -62,3 +64,30 @@ bool ControlButtons::IconifyWithMain() const { return lyxrc.dialogs_iconify_with_main; } + + +ButtonControllerBase & ControlButtons::bc() +{ + lyx::Assert(bc_ptr_); + return *bc_ptr_; +} + + +ViewBase & ControlButtons::view() +{ + lyx::Assert(view_ptr_); + return *view_ptr_; +} + + +void ControlButtons::setView(ViewBase & v) +{ + view_ptr_ = &v; +} + + +void ControlButtons::setButtonController(ButtonControllerBase & bc) +{ + bc_ptr_ = &bc; +} + diff --git a/src/frontends/controllers/ControlButtons.h b/src/frontends/controllers/ControlButtons.h index 23978f2212..2e5e796cae 100644 --- a/src/frontends/controllers/ControlButtons.h +++ b/src/frontends/controllers/ControlButtons.h @@ -48,7 +48,9 @@ public: /// virtual ~ControlButtons() {} - /// These functions are called when the controlling buttons are pressed. + /** These functions are called by the view when the appropriate buttons + * are pressed. + */ /// void ApplyButton(); /// @@ -57,15 +59,22 @@ public: void CancelButton(); /// void RestoreButton(); - /// + + /// Returns the user-specified iconification policy. bool IconifyWithMain() const; - /** Allow the view to access the ButtonController. This method must be - instantiated in a daughter class that creates the actual instance - of the ButtonController. */ - virtual ButtonControllerBase & bc() = 0; + /// + ButtonControllerBase & bc(); + + /// + void setView(ViewBase &); + /// + void setButtonController(ButtonControllerBase &); protected: + /// + ViewBase & view(); + /** When Applying it's useful to know whether the dialog is about to close or not (no point refreshing the display for example). */ bool isClosing() const { return is_closing_; } @@ -77,11 +86,6 @@ protected: /// Update dialog before showing it. virtual void update() = 0; - /** Allow the Controller to access the View. This method must be - instantiated in a daughter class that creates the actual instance - of the View. */ - virtual ViewBase & view() = 0; - /** This flag can be set by one of the miriad the controller methods to ensure that the dialog is shut down. */ bool emergency_exit_; @@ -89,7 +93,10 @@ protected: private: /// bool is_closing_; - + /// We own neither of these pointers. + ButtonControllerBase * bc_ptr_; + /// + ViewBase * view_ptr_; }; #endif // CONTROLBUTTONS_H diff --git a/src/frontends/controllers/ControlDialog.h b/src/frontends/controllers/ControlDialog.h index a2cbfd0fbd..f55b9ef8ee 100644 --- a/src/frontends/controllers/ControlDialog.h +++ b/src/frontends/controllers/ControlDialog.h @@ -29,9 +29,12 @@ public: /// ControlDialog(LyXView &, Dialogs &); -protected: - /// Show the dialog. + /** Show the dialog. + * Publicly accessible so that it can be invoked by the Dialogs class. + */ virtual void show(); + +protected: /// Hide the dialog. virtual void hide(); /// Update the dialog. diff --git a/src/frontends/controllers/ControlInset.h b/src/frontends/controllers/ControlInset.h index 89ae4b5d5e..494737845d 100644 --- a/src/frontends/controllers/ControlInset.h +++ b/src/frontends/controllers/ControlInset.h @@ -37,12 +37,13 @@ public: /// Params const & params() const; -protected: /// Slots connected in the daughter classes c-tor. /// Slot launching dialog to (possibly) create a new inset. void createInset(string const &); /// Slot launching dialog to an existing inset. void showInset(Inset *); + +protected: /// Allow the daughter methods to access the inset. Inset * inset() const; diff --git a/src/frontends/controllers/GUI.h b/src/frontends/controllers/GUI.h index 6a93661c91..c54320a786 100644 --- a/src/frontends/controllers/GUI.h +++ b/src/frontends/controllers/GUI.h @@ -11,65 +11,41 @@ #define GUI_H #include "ButtonController.h" -#include "ViewBase.h" -/** This class instantiates and makes available the GUI-specific - ButtonController and View. + +/** This class makes a whole out of the disparate parts of a dialog. */ -template -class GUI : public Controller { +template +class GUI { public: /// - GUI(LyXView & lv, Dialogs & d) : Controller(lv, d), view_(*this, d) {} + GUI(LyXView & lv, Dialogs & d); /// - virtual ButtonControllerBase & bc() { return bc_; } + Controller & controller() { return controller_; } /// - virtual ViewBase & view() { return view_; } - - friend void gui_ShowAboutlyx(LyXView &, Dialogs &); - friend void gui_ShowBibitem(InsetCommand *, LyXView &, Dialogs &); - friend void gui_ShowBibtex(InsetCommand *, LyXView &, Dialogs &); - friend void gui_ShowCharacter(LyXView &, Dialogs &); - friend void gui_SetUserFreeFont(LyXView &, Dialogs &); - friend void gui_ShowCitation(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateCitation(string const &, LyXView &, Dialogs &); - friend void gui_ShowDocument(LyXView &, Dialogs &); - friend void gui_ShowError(InsetError *, LyXView &, Dialogs &); - friend void gui_ShowERT(InsetERT *, LyXView &, Dialogs &); - friend void gui_UpdateERT(InsetERT *, LyXView &, Dialogs &); - friend void gui_ShowExternal(InsetExternal *, LyXView &, Dialogs &); - friend void gui_ShowFloat(InsetFloat *, LyXView &, Dialogs &); - friend void gui_ShowForks(LyXView &, Dialogs &); - friend void gui_ShowGraphics(InsetGraphics *, LyXView &, Dialogs &); - friend void gui_ShowInclude(InsetInclude *, LyXView &, Dialogs &); - friend void gui_ShowIndex(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateIndex(LyXView &, Dialogs &); - friend void gui_ShowLogFile(LyXView &, Dialogs &); - friend void gui_ShowMathPanel(LyXView &, Dialogs &); - friend void gui_ShowMinipage(InsetMinipage *, LyXView &, Dialogs &); - friend void gui_UpdateMinipage(InsetMinipage *, LyXView &, Dialogs &); - friend void gui_ShowParagraph(LyXView &, Dialogs &); - friend void gui_ShowPreamble(LyXView &, Dialogs &); - friend void gui_ShowPreferences(LyXView &, Dialogs &); - friend void gui_ShowPrint(LyXView &, Dialogs &); - friend void gui_ShowRef(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateRef(string const &, LyXView &, Dialogs &); - friend void gui_ShowSearch(LyXView &, Dialogs &); - friend void gui_ShowSendto(LyXView &, Dialogs &); - friend void gui_ShowSpellchecker(LyXView &, Dialogs &); - friend void gui_ShowTabularCreate(LyXView &, Dialogs &); - friend void gui_ShowTexinfo(LyXView &, Dialogs &); - friend void gui_ShowTOC(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateTOC(string const &, LyXView &, Dialogs &); - friend void gui_ShowUrl(InsetCommand *, LyXView &, Dialogs &); - friend void gui_CreateUrl(string const &, LyXView &, Dialogs &); - friend void gui_ShowVCLogFile(LyXView &, Dialogs &); + Controller const & controller() const { return controller_; } private: + /// + Controller controller_; /// ButtonController bc_; /// GUIview view_; }; + +template +GUI::GUI(LyXView & lv, Dialogs & d) + : controller_(lv, d), + view_() +{ + controller_.setView(view_); + controller_.setButtonController(bc_); + view_.setController(controller_); +} + + #endif // GUI_H diff --git a/src/frontends/controllers/ViewBase.h b/src/frontends/controllers/ViewBase.h index b12eed5295..c1d98ab83b 100644 --- a/src/frontends/controllers/ViewBase.h +++ b/src/frontends/controllers/ViewBase.h @@ -14,18 +14,22 @@ #ifndef VIEWBASE_H #define VIEWBASE_H -#include -#include "ControlButtons.h" +#include "support/LAssert.h" + +class ControlButtons; + class ViewBase { public: /// - ViewBase(ControlButtons & c) : controller_(c) {} + ViewBase() : controller_ptr_(0) {} /// virtual ~ViewBase() {} /// Apply changes to LyX data from dialog. virtual void apply() = 0; + /// build the dialog + virtual void build() = 0; /// Hide the dialog. virtual void hide() = 0; /// Redraw the dialog (e.g. if the colors have been remapped). @@ -34,47 +38,35 @@ public: virtual void show() = 0; /// Update dialog before/whilst showing it. virtual void update() = 0; - /// build the dialog - virtual void build() = 0; - /** These shortcuts allow (e.g. xform's) global callback functions - access to the buttons without making the whole controller_ public. - */ - /// - void ApplyButton() { controller_.ApplyButton(); } - /// - void OKButton() { controller_.OKButton(); } - /// - void CancelButton() { controller_.CancelButton(); } - /// - void RestoreButton() { controller_.RestoreButton(); } - - /** Defaults to nothing. Can be used by the Controller, however, to - indicate to the View that something has changed and that the - dialog therefore needs updating. */ + /** Defaults to nothing. Can be used by the controller, however, to + * indicate to the view that something has changed and that the + * dialog therefore needs updating. + */ virtual void partialUpdate(int) {} -protected: - /// The view is, after all, controlled! - ControlButtons & controller_; -}; - - -/** A generic class to cast the ButtonController controller_.bc_ to it's - daughter class. */ -template -class ViewBC : public ViewBase { -public: + /** This should be set by the GUI class that owns both the controller + * and the view + */ + void setController(ControlButtons & c) { controller_ptr_ = &c; } + /// - ViewBC(ControlButtons & c) : ViewBase(c) {} - -protected: - /// - GUIbc & bc() const + ControlButtons & getController() { - return static_cast(controller_.bc()); - // return dynamic_cast(controller_.bc()); + lyx::Assert(controller_ptr_); + return *controller_ptr_; } + /// + ControlButtons const & getController() const + { + lyx::Assert(controller_ptr_); + return *controller_ptr_; + } + +protected: + /// We don't own this. + ControlButtons * controller_ptr_; }; + #endif // VIEWBASE_H diff --git a/src/frontends/controllers/character.h b/src/frontends/controllers/character.h index 10c7530c44..75fe91ec96 100644 --- a/src/frontends/controllers/character.h +++ b/src/frontends/controllers/character.h @@ -22,6 +22,9 @@ #include "lyxfont.h" #include "LColor.h" +#include +#include + /** Functions of use to the character GUI controller and view */ namespace frnt { /// diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index eede5dff10..968a020d56 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,57 @@ +2002-08-12 Angus Leeming + + * Menubar_pimpl.C: no need to #include "Dialogs.h". Remove semi-colon + from namespace closing delimiter. + + * Menubar_pimpl.h: remove MenuItemInfo:: prefix from c-tor declaration. + + * QAbout.[Ch]: + * QBibitem.[Ch]: + * QBibtex.[Ch]: + * QCharacter.[Ch]: + * QCitation.[Ch]: + * QERT.[Ch]: + * QError.[Ch]: + * QExternal.[Ch]: + * QFloat.[Ch]: + * QGraphics.[Ch]: + * QInclude.[Ch]: + * QIndex.[Ch]: + * QLog.[Ch]: + * QMinipage.[Ch]: + * QParagraph.[Ch]: + * QPreamble.[Ch]: + * QPrint.[Ch]: + * QRef.[Ch]: + * QSearch.[Ch]: + * QShowFile.[Ch]: + * QSpellchecker.[Ch]: + * QTabularCreate.[Ch]: + * QTexinfo.[Ch]: + * QThesaurus.[Ch]: + * QToc.[Ch]: + * QURL.[Ch]: + * QVCLog.[Ch]: + No longer pass Controller or Dialogs to the c-tor. + No longer forward-declare Dialogs. + + * Qt2Base.[Ch]: derives from ViewBase directly. + No longer passed ControlButtons & or Dialogs &. + (bc): new method, enabling the daughter classes to access the + ButtonController. + (slotWMHide): + (slotApply): + (slotOK): + (slotClose): + (slotRestore): changes due to a change in the ViewBase class. + + * QtView.C (c-tor): no longer pass Dialogs & to the Toolbar. + + * Toolbar_pimpl.[Ch] (c-tor): no longer passed a Dialogs &. + + * guiapi.C: access the controller methods by explicit invocation of the + controller. + 2002-08-09 John Levon * Toolbar_pimpl.C: add missing header diff --git a/src/frontends/qt2/Menubar_pimpl.C b/src/frontends/qt2/Menubar_pimpl.C index afd9da20e9..998b0ed9f7 100644 --- a/src/frontends/qt2/Menubar_pimpl.C +++ b/src/frontends/qt2/Menubar_pimpl.C @@ -19,7 +19,6 @@ #include "LyXAction.h" #include "kbmap.h" #include "buffer.h" -#include "Dialogs.h" #include "lyxfunc.h" #include "FloatList.h" #include "support/lstrings.h" @@ -58,7 +57,7 @@ string const getLabel(MenuItem const & mi) return label; } -}; +} typedef vector::size_type size_type; diff --git a/src/frontends/qt2/Menubar_pimpl.h b/src/frontends/qt2/Menubar_pimpl.h index 66e0e12f75..0ffe61261d 100644 --- a/src/frontends/qt2/Menubar_pimpl.h +++ b/src/frontends/qt2/Menubar_pimpl.h @@ -36,10 +36,10 @@ class MenuBackend; /// stored state for menu items struct MenuItemInfo { // I REALLY hate this stupid requirement of std::map - MenuItemInfo::MenuItemInfo() + MenuItemInfo() : parent_(0), id_(0), item_(0) {}; - MenuItemInfo::MenuItemInfo(QMenuData * p, int id, MenuItem const * item) + MenuItemInfo(QMenuData * p, int id, MenuItem const * item) : parent_(p), id_(id), item_(item) {}; /// menu containing item diff --git a/src/frontends/qt2/QAbout.C b/src/frontends/qt2/QAbout.C index 29b4d283ed..859c3cb563 100644 --- a/src/frontends/qt2/QAbout.C +++ b/src/frontends/qt2/QAbout.C @@ -28,8 +28,8 @@ using std::getline; typedef Qt2CB > base_class; -QAbout::QAbout(ControlAboutlyx & c, Dialogs &) - : base_class(c, _("About LyX")) +QAbout::QAbout() + : base_class(_("About LyX")) { } diff --git a/src/frontends/qt2/QAbout.h b/src/frontends/qt2/QAbout.h index 7f0de19d06..00c360627d 100644 --- a/src/frontends/qt2/QAbout.h +++ b/src/frontends/qt2/QAbout.h @@ -13,7 +13,6 @@ #include "Qt2Base.h" #include "boost/utility.hpp" -class Dialogs; class LyXView; class QAboutDialog; class ControlAboutlyx; @@ -22,7 +21,7 @@ class QAbout : public Qt2CB > { public: - QAbout(ControlAboutlyx &, Dialogs &); + QAbout(); private: /// not needed diff --git a/src/frontends/qt2/QBibitem.C b/src/frontends/qt2/QBibitem.C index 77b3acb5bb..c96dbfcc62 100644 --- a/src/frontends/qt2/QBibitem.C +++ b/src/frontends/qt2/QBibitem.C @@ -23,8 +23,8 @@ typedef Qt2CB > base_class; -QBibitem::QBibitem(ControlBibitem & c, Dialogs &) - : base_class(c, _("Bibliography Item")) +QBibitem::QBibitem() + : base_class(_("Bibliography Item")) { } diff --git a/src/frontends/qt2/QBibitem.h b/src/frontends/qt2/QBibitem.h index 9e6789c029..0797c31581 100644 --- a/src/frontends/qt2/QBibitem.h +++ b/src/frontends/qt2/QBibitem.h @@ -21,7 +21,7 @@ class QBibitem : friend class QBibitemDialog; public: - QBibitem(ControlBibitem &, Dialogs &); + QBibitem(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QBibtex.C b/src/frontends/qt2/QBibtex.C index 75a75e8cea..16f20bee0c 100644 --- a/src/frontends/qt2/QBibtex.C +++ b/src/frontends/qt2/QBibtex.C @@ -29,8 +29,8 @@ using std::vector; typedef Qt2CB > base_class; -QBibtex::QBibtex(ControlBibtex & c, Dialogs &) - : base_class(c, _("BibTeX")) +QBibtex::QBibtex() + : base_class(_("BibTeX")) { } diff --git a/src/frontends/qt2/QBibtex.h b/src/frontends/qt2/QBibtex.h index 104555933e..8528a260df 100644 --- a/src/frontends/qt2/QBibtex.h +++ b/src/frontends/qt2/QBibtex.h @@ -21,7 +21,7 @@ class QBibtex : friend class QBibtexDialog; public: - QBibtex(ControlBibtex &, Dialogs &); + QBibtex(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QCharacter.C b/src/frontends/qt2/QCharacter.C index 2d7a64bc32..ecc9e8eed6 100644 --- a/src/frontends/qt2/QCharacter.C +++ b/src/frontends/qt2/QCharacter.C @@ -27,8 +27,8 @@ using std::vector; typedef Qt2CB > base_class; -QCharacter::QCharacter(ControlCharacter & c, Dialogs &) - : base_class(c, _("Character")) +QCharacter::QCharacter() + : base_class(_("Character")) { } diff --git a/src/frontends/qt2/QCharacter.h b/src/frontends/qt2/QCharacter.h index 0a6883c0b7..2c059e20ca 100644 --- a/src/frontends/qt2/QCharacter.h +++ b/src/frontends/qt2/QCharacter.h @@ -22,7 +22,7 @@ class ControlCharacter; class QCharacterDialog; -class Dialogs; + class QCharacter : public Qt2CB > @@ -30,7 +30,7 @@ class QCharacter : friend class QCharacterDialog; public: - QCharacter(ControlCharacter &, Dialogs &); + QCharacter(); private: /// Apply changes diff --git a/src/frontends/qt2/QCitation.C b/src/frontends/qt2/QCitation.C index ca20bdcf6e..d0e079eefc 100644 --- a/src/frontends/qt2/QCitation.C +++ b/src/frontends/qt2/QCitation.C @@ -41,8 +41,8 @@ using std::vector; typedef Qt2CB > base_class; -QCitation::QCitation(ControlCitation & c, Dialogs &) - : base_class(c, _("Citation")) +QCitation::QCitation() + : base_class(_("Citation")) {} diff --git a/src/frontends/qt2/QCitation.h b/src/frontends/qt2/QCitation.h index 62cd8c6c84..0224fec758 100644 --- a/src/frontends/qt2/QCitation.h +++ b/src/frontends/qt2/QCitation.h @@ -21,7 +21,7 @@ class QListBox; class ControlCitation; class QCitationDialog; -class Dialogs; + class QCitation : public Qt2CB > { @@ -29,7 +29,7 @@ class QCitation : public Qt2CB > public: /// - QCitation(ControlCitation &, Dialogs &); + QCitation(); private: /// diff --git a/src/frontends/qt2/QERT.C b/src/frontends/qt2/QERT.C index c65e28af2a..f034bcbe77 100644 --- a/src/frontends/qt2/QERT.C +++ b/src/frontends/qt2/QERT.C @@ -20,8 +20,8 @@ typedef Qt2CB > base_class; -QERT::QERT(ControlERT & c, Dialogs &) - : base_class(c, _("LaTeX ERT")) +QERT::QERT() + : base_class(_("LaTeX ERT")) { } diff --git a/src/frontends/qt2/QERT.h b/src/frontends/qt2/QERT.h index 7d0e014c8a..fa0bc3f6f4 100644 --- a/src/frontends/qt2/QERT.h +++ b/src/frontends/qt2/QERT.h @@ -14,7 +14,7 @@ class ControlERT; class QERTDialog; -class Dialogs; + class QERT : public Qt2CB > @@ -22,7 +22,7 @@ class QERT : friend class QERTDialog; public: - QERT(ControlERT &, Dialogs &); + QERT(); private: /// Apply changes diff --git a/src/frontends/qt2/QError.C b/src/frontends/qt2/QError.C index 7d32c1fccf..d2cd908c40 100644 --- a/src/frontends/qt2/QError.C +++ b/src/frontends/qt2/QError.C @@ -20,8 +20,8 @@ typedef Qt2CB > base_class; -QError::QError(ControlError & c, Dialogs &) - : base_class(c, _("LaTeX Error")) +QError::QError() + : base_class(_("LaTeX Error")) { } diff --git a/src/frontends/qt2/QError.h b/src/frontends/qt2/QError.h index 17a498afb9..1737a700ba 100644 --- a/src/frontends/qt2/QError.h +++ b/src/frontends/qt2/QError.h @@ -14,7 +14,7 @@ class ControlError; class QErrorDialog; -class Dialogs; + class QError : public Qt2CB > @@ -22,7 +22,7 @@ class QError : friend class QErrorDialog; public: - QError(ControlError &, Dialogs &); + QError(); private: /// Apply changes diff --git a/src/frontends/qt2/QExternal.C b/src/frontends/qt2/QExternal.C index 7cc2941c68..fe8c957699 100644 --- a/src/frontends/qt2/QExternal.C +++ b/src/frontends/qt2/QExternal.C @@ -23,8 +23,8 @@ typedef Qt2CB > base_class; -QExternal::QExternal(ControlExternal & c, Dialogs &) - : base_class(c, _("External")) +QExternal::QExternal() + : base_class(_("External")) { } diff --git a/src/frontends/qt2/QExternal.h b/src/frontends/qt2/QExternal.h index b058df9cce..1f900eb07c 100644 --- a/src/frontends/qt2/QExternal.h +++ b/src/frontends/qt2/QExternal.h @@ -21,7 +21,7 @@ class QExternal : friend class QExternalDialog; public: - QExternal(ControlExternal &, Dialogs &); + QExternal(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QFloat.C b/src/frontends/qt2/QFloat.C index 4101dd4bc2..7713d512bf 100644 --- a/src/frontends/qt2/QFloat.C +++ b/src/frontends/qt2/QFloat.C @@ -27,8 +27,8 @@ typedef Qt2CB > base_class; -QFloat::QFloat(ControlFloat & c, Dialogs &) - : base_class(c, _("LaTeX Information")) +QFloat::QFloat() + : base_class(_("LaTeX Information")) { } diff --git a/src/frontends/qt2/QFloat.h b/src/frontends/qt2/QFloat.h index ceecbdb257..fbea747143 100644 --- a/src/frontends/qt2/QFloat.h +++ b/src/frontends/qt2/QFloat.h @@ -27,7 +27,7 @@ public: /// friend class QFloatDialog; /// - QFloat(ControlFloat &, Dialogs &); + QFloat(); private: /// Apply changes virtual void apply(); diff --git a/src/frontends/qt2/QGraphics.C b/src/frontends/qt2/QGraphics.C index 4e87685986..fe380c55e4 100644 --- a/src/frontends/qt2/QGraphics.C +++ b/src/frontends/qt2/QGraphics.C @@ -41,8 +41,8 @@ typedef Qt2CB > base_class; -QGraphics::QGraphics(ControlGraphics & c, Dialogs &) - : base_class(c, _("Graphics")) +QGraphics::QGraphics() + : base_class(_("Graphics")) { } diff --git a/src/frontends/qt2/QGraphics.h b/src/frontends/qt2/QGraphics.h index 31870e8fb6..92eee3e586 100644 --- a/src/frontends/qt2/QGraphics.h +++ b/src/frontends/qt2/QGraphics.h @@ -28,7 +28,7 @@ public: /// friend class QGraphicsDialog; /// - QGraphics(ControlGraphics &, Dialogs &); + QGraphics(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QInclude.C b/src/frontends/qt2/QInclude.C index 03b1d283b9..73a9b928f2 100644 --- a/src/frontends/qt2/QInclude.C +++ b/src/frontends/qt2/QInclude.C @@ -27,8 +27,8 @@ typedef Qt2CB > base_class; -QInclude::QInclude(ControlInclude & c, Dialogs &) - : base_class(c, _("Include")) +QInclude::QInclude() + : base_class(_("Include")) { } diff --git a/src/frontends/qt2/QInclude.h b/src/frontends/qt2/QInclude.h index 09876bbbe2..b1cb7941a3 100644 --- a/src/frontends/qt2/QInclude.h +++ b/src/frontends/qt2/QInclude.h @@ -27,7 +27,7 @@ public: /// friend class QIncludeDialog; /// - QInclude(ControlInclude &, Dialogs &); + QInclude(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QIndex.C b/src/frontends/qt2/QIndex.C index a730962853..f1c39be96b 100644 --- a/src/frontends/qt2/QIndex.C +++ b/src/frontends/qt2/QIndex.C @@ -19,8 +19,8 @@ typedef Qt2CB > base_class; -QIndex::QIndex(ControlIndex & c, Dialogs &) - : base_class(c, _("Index")) +QIndex::QIndex() + : base_class(_("Index")) { } diff --git a/src/frontends/qt2/QIndex.h b/src/frontends/qt2/QIndex.h index 1d8521ad4b..ecd3885e99 100644 --- a/src/frontends/qt2/QIndex.h +++ b/src/frontends/qt2/QIndex.h @@ -15,7 +15,7 @@ class ControlIndex; class QIndexDialog; -class Dialogs; + class QIndex : public Qt2CB > @@ -23,7 +23,7 @@ class QIndex : friend class QIndexDialog; public: - QIndex(ControlIndex &, Dialogs &); + QIndex(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QLog.C b/src/frontends/qt2/QLog.C index 4c98679229..6d6a53b461 100644 --- a/src/frontends/qt2/QLog.C +++ b/src/frontends/qt2/QLog.C @@ -29,8 +29,8 @@ using std::getline; typedef Qt2CB > base_class; -QLog::QLog(ControlLog & c, Dialogs &) - : base_class(c, _("Log")) +QLog::QLog() + : base_class(_("Log")) { } diff --git a/src/frontends/qt2/QLog.h b/src/frontends/qt2/QLog.h index 84dba70286..1f971c4344 100644 --- a/src/frontends/qt2/QLog.h +++ b/src/frontends/qt2/QLog.h @@ -27,7 +27,7 @@ public: /// friend class QLogDialog; /// - QLog(ControlLog &, Dialogs &); + QLog(); private: /// Apply changes diff --git a/src/frontends/qt2/QMinipage.C b/src/frontends/qt2/QMinipage.C index 1b7104944d..dfa93c7793 100644 --- a/src/frontends/qt2/QMinipage.C +++ b/src/frontends/qt2/QMinipage.C @@ -29,8 +29,8 @@ typedef Qt2CB > base_class; -QMinipage::QMinipage(ControlMinipage & c, Dialogs &) - : base_class(c, _("Minipage")) +QMinipage::QMinipage() + : base_class(_("Minipage")) { } diff --git a/src/frontends/qt2/QMinipage.h b/src/frontends/qt2/QMinipage.h index c270159213..e36e2d594d 100644 --- a/src/frontends/qt2/QMinipage.h +++ b/src/frontends/qt2/QMinipage.h @@ -27,7 +27,7 @@ public: /// friend class QMinipageDialog; /// - QMinipage(ControlMinipage &, Dialogs &); + QMinipage(); private: /// Apply changes diff --git a/src/frontends/qt2/QParagraph.C b/src/frontends/qt2/QParagraph.C index 48a4b84326..d859e21bcf 100644 --- a/src/frontends/qt2/QParagraph.C +++ b/src/frontends/qt2/QParagraph.C @@ -42,8 +42,8 @@ using std::remove_if; typedef Qt2CB > base_class; -QParagraph::QParagraph(ControlParagraph & c, Dialogs &) - : base_class(c, _("Paragraph Layout")) +QParagraph::QParagraph() + : base_class(_("Paragraph Layout")) {} void QParagraph::build_dialog() diff --git a/src/frontends/qt2/QParagraph.h b/src/frontends/qt2/QParagraph.h index f51218c7e1..2c5d5cd996 100644 --- a/src/frontends/qt2/QParagraph.h +++ b/src/frontends/qt2/QParagraph.h @@ -16,7 +16,7 @@ class ControlParagraph; class QParagraphDialog; -class Dialogs; + class QParagraph : public Qt2CB > @@ -24,7 +24,7 @@ class QParagraph : friend class QParagraphDialog; public: - QParagraph(ControlParagraph &, Dialogs &); + QParagraph(); private: /// Apply changes diff --git a/src/frontends/qt2/QPreamble.C b/src/frontends/qt2/QPreamble.C index bbd66f62c7..e9d15963a6 100644 --- a/src/frontends/qt2/QPreamble.C +++ b/src/frontends/qt2/QPreamble.C @@ -26,8 +26,8 @@ typedef Qt2CB > base_class; -QPreamble::QPreamble(ControlPreamble & c, Dialogs &) - : base_class(c, _("LaTeX Preamble")) +QPreamble::QPreamble() + : base_class(_("LaTeX Preamble")) { } diff --git a/src/frontends/qt2/QPreamble.h b/src/frontends/qt2/QPreamble.h index 021973a846..b0f57be281 100644 --- a/src/frontends/qt2/QPreamble.h +++ b/src/frontends/qt2/QPreamble.h @@ -27,7 +27,7 @@ public: /// friend class QPreambleDialog; /// - QPreamble(ControlPreamble &, Dialogs &); + QPreamble(); private: /// Apply changes diff --git a/src/frontends/qt2/QPrint.C b/src/frontends/qt2/QPrint.C index 4241e14d16..7f6af2bb64 100644 --- a/src/frontends/qt2/QPrint.C +++ b/src/frontends/qt2/QPrint.C @@ -32,8 +32,8 @@ typedef Qt2CB > base_class; -QPrint::QPrint(ControlPrint & c, Dialogs &) - : base_class(c, _("Print")) +QPrint::QPrint() + : base_class(_("Print")) { } diff --git a/src/frontends/qt2/QPrint.h b/src/frontends/qt2/QPrint.h index d4f367a9c5..be9de9ecf0 100644 --- a/src/frontends/qt2/QPrint.h +++ b/src/frontends/qt2/QPrint.h @@ -29,7 +29,7 @@ public: /// friend class QPrintDialog; /// - QPrint(ControlPrint &, Dialogs &); + QPrint(); private: /// Apply changes diff --git a/src/frontends/qt2/QRef.C b/src/frontends/qt2/QRef.C index 9ecad81bd6..e287509ccb 100644 --- a/src/frontends/qt2/QRef.C +++ b/src/frontends/qt2/QRef.C @@ -33,8 +33,8 @@ using std::endl; typedef Qt2CB > base_class; -QRef::QRef(ControlRef & c, Dialogs &) - : base_class(c, _("Cross Reference")), +QRef::QRef() + : base_class(_("Cross Reference")), sort_(false), at_ref_(false) { } diff --git a/src/frontends/qt2/QRef.h b/src/frontends/qt2/QRef.h index 2c671c21d6..ff40a27664 100644 --- a/src/frontends/qt2/QRef.h +++ b/src/frontends/qt2/QRef.h @@ -17,7 +17,7 @@ class ControlRef; class QRefDialog; -class Dialogs; + class QRef : public Qt2CB > @@ -25,7 +25,7 @@ class QRef : friend class QRefDialog; public: - QRef(ControlRef & c, Dialogs &); + QRef(); private: /// apply changes diff --git a/src/frontends/qt2/QSearch.C b/src/frontends/qt2/QSearch.C index 8cc286a216..75d96855bf 100644 --- a/src/frontends/qt2/QSearch.C +++ b/src/frontends/qt2/QSearch.C @@ -27,8 +27,8 @@ typedef Qt2CB > base_class; -QSearch::QSearch(ControlSearch & c, Dialogs &) - : base_class(c, _("Search")) +QSearch::QSearch() + : base_class(_("Search")) { } diff --git a/src/frontends/qt2/QSearch.h b/src/frontends/qt2/QSearch.h index 576c413853..0ad702c8d4 100644 --- a/src/frontends/qt2/QSearch.h +++ b/src/frontends/qt2/QSearch.h @@ -18,7 +18,7 @@ class ControlSearch; class QSearchDialog; -class Dialogs; + /// class QSearch @@ -28,7 +28,7 @@ public: /// friend class QSearchDialog; /// - QSearch(ControlSearch &, Dialogs &); + QSearch(); private: /// Apply changes diff --git a/src/frontends/qt2/QShowFile.C b/src/frontends/qt2/QShowFile.C index 42d04e8080..1798cbfb23 100644 --- a/src/frontends/qt2/QShowFile.C +++ b/src/frontends/qt2/QShowFile.C @@ -20,8 +20,8 @@ typedef Qt2CB > base_class; -QShowFile::QShowFile(ControlShowFile & c, Dialogs &) - : base_class(c, _("ShowFile")) +QShowFile::QShowFile() + : base_class(_("ShowFile")) { } diff --git a/src/frontends/qt2/QShowFile.h b/src/frontends/qt2/QShowFile.h index d6279da93f..c35676bf96 100644 --- a/src/frontends/qt2/QShowFile.h +++ b/src/frontends/qt2/QShowFile.h @@ -14,7 +14,7 @@ class ControlShowFile; class QShowFileDialog; -class Dialogs; + class QShowFile : public Qt2CB > @@ -22,7 +22,7 @@ class QShowFile : friend class QShowFileDialog; public: - QShowFile(ControlShowFile &, Dialogs &); + QShowFile(); private: /// Apply changes diff --git a/src/frontends/qt2/QSpellchecker.C b/src/frontends/qt2/QSpellchecker.C index 16c2aedd90..40cd60ddca 100644 --- a/src/frontends/qt2/QSpellchecker.C +++ b/src/frontends/qt2/QSpellchecker.C @@ -23,8 +23,8 @@ typedef Qt2CB > base_class; -QSpellchecker::QSpellchecker(ControlSpellchecker & c, Dialogs &) - : base_class(c, _("Spellchecker")) +QSpellchecker::QSpellchecker() + : base_class(_("Spellchecker")) { } diff --git a/src/frontends/qt2/QSpellchecker.h b/src/frontends/qt2/QSpellchecker.h index c8eea60f96..edbfec7394 100644 --- a/src/frontends/qt2/QSpellchecker.h +++ b/src/frontends/qt2/QSpellchecker.h @@ -16,7 +16,7 @@ class ControlSpellchecker; class QSpellcheckerDialog; -class Dialogs; + class QSpellchecker : public Qt2CB > @@ -24,7 +24,7 @@ class QSpellchecker : friend class QSpellcheckerDialog; public: - QSpellchecker(ControlSpellchecker &, Dialogs &); + QSpellchecker(); /// update from controller void partialUpdate(int id); diff --git a/src/frontends/qt2/QTabularCreate.C b/src/frontends/qt2/QTabularCreate.C index f62327d46b..6a72656e3f 100644 --- a/src/frontends/qt2/QTabularCreate.C +++ b/src/frontends/qt2/QTabularCreate.C @@ -24,8 +24,8 @@ typedef Qt2CB > base_class; -QTabularCreate::QTabularCreate(ControlTabularCreate & c, Dialogs &) - : base_class(c, _("Insert table")) +QTabularCreate::QTabularCreate() + : base_class(_("Insert table")) { } diff --git a/src/frontends/qt2/QTabularCreate.h b/src/frontends/qt2/QTabularCreate.h index 6591df3483..10a68c22bc 100644 --- a/src/frontends/qt2/QTabularCreate.h +++ b/src/frontends/qt2/QTabularCreate.h @@ -18,7 +18,7 @@ class ControlTabularCreate; class QTabularCreateDialog; -class Dialogs; + /// class QTabularCreate @@ -28,7 +28,7 @@ public: /// friend class QTabularCreateDialog; /// - QTabularCreate(ControlTabularCreate &, Dialogs &); + QTabularCreate(); private: /// Apply changes diff --git a/src/frontends/qt2/QTexinfo.C b/src/frontends/qt2/QTexinfo.C index 2d356dd1f7..5c2e006f73 100644 --- a/src/frontends/qt2/QTexinfo.C +++ b/src/frontends/qt2/QTexinfo.C @@ -31,8 +31,8 @@ using std::vector; typedef Qt2CB > base_class; -QTexinfo::QTexinfo(ControlTexinfo & c, Dialogs &) - : base_class(c, _("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls) +QTexinfo::QTexinfo() + : base_class(_("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls) { } diff --git a/src/frontends/qt2/QTexinfo.h b/src/frontends/qt2/QTexinfo.h index 1e1daf5101..26e5cc8ecb 100644 --- a/src/frontends/qt2/QTexinfo.h +++ b/src/frontends/qt2/QTexinfo.h @@ -28,7 +28,7 @@ public: /// friend class QTexinfoDialog; /// - QTexinfo(ControlTexinfo &, Dialogs &); + QTexinfo(); private: /// Apply changes virtual void apply() { }; diff --git a/src/frontends/qt2/QThesaurus.C b/src/frontends/qt2/QThesaurus.C index f76d4cd3e1..feaa237db4 100644 --- a/src/frontends/qt2/QThesaurus.C +++ b/src/frontends/qt2/QThesaurus.C @@ -24,8 +24,8 @@ typedef Qt2CB > base_class; -QThesaurus::QThesaurus(ControlThesaurus & c, Dialogs &) - : base_class(c, _("Thesaurus")) +QThesaurus::QThesaurus() + : base_class(_("Thesaurus")) { } diff --git a/src/frontends/qt2/QThesaurus.h b/src/frontends/qt2/QThesaurus.h index 8a09a1f8ae..f47e5fb775 100644 --- a/src/frontends/qt2/QThesaurus.h +++ b/src/frontends/qt2/QThesaurus.h @@ -27,7 +27,7 @@ public: /// friend class QThesaurusDialog; /// - QThesaurus(ControlThesaurus &, Dialogs &); + QThesaurus(); private: /// Apply changes virtual void apply() { }; diff --git a/src/frontends/qt2/QToc.C b/src/frontends/qt2/QToc.C index 8d9ff056eb..7cb9c9e23d 100644 --- a/src/frontends/qt2/QToc.C +++ b/src/frontends/qt2/QToc.C @@ -35,8 +35,8 @@ using std::vector; typedef Qt2CB > base_class; -QToc::QToc(ControlToc & c, Dialogs &) - : base_class(c, _("Table of contents")), depth_(1) +QToc::QToc() + : base_class(_("Table of contents")), depth_(1) {} diff --git a/src/frontends/qt2/QToc.h b/src/frontends/qt2/QToc.h index b7ae9e981d..520a0759d0 100644 --- a/src/frontends/qt2/QToc.h +++ b/src/frontends/qt2/QToc.h @@ -27,7 +27,7 @@ class QToc : public Qt2CB > { public: - QToc(ControlToc &, Dialogs &); + QToc(); friend class QTocDialog; diff --git a/src/frontends/qt2/QURL.C b/src/frontends/qt2/QURL.C index 66e7b222c8..cc5d1b4573 100644 --- a/src/frontends/qt2/QURL.C +++ b/src/frontends/qt2/QURL.C @@ -22,8 +22,8 @@ typedef Qt2CB > base_class; -QURL::QURL(ControlUrl & c, Dialogs &) - : base_class(c, _("URL")) +QURL::QURL() + : base_class(_("URL")) { } diff --git a/src/frontends/qt2/QURL.h b/src/frontends/qt2/QURL.h index 4f703e0d4a..260ffd5de8 100644 --- a/src/frontends/qt2/QURL.h +++ b/src/frontends/qt2/QURL.h @@ -13,14 +13,14 @@ class ControlUrl; class QURLDialog; -class Dialogs; + class QURL : public Qt2CB > { friend class QURLDialog; public: - QURL(ControlUrl & c, Dialogs &); + QURL(); protected: virtual bool isValid(); diff --git a/src/frontends/qt2/QVCLog.C b/src/frontends/qt2/QVCLog.C index 9c9f1e3d17..da9273e43e 100644 --- a/src/frontends/qt2/QVCLog.C +++ b/src/frontends/qt2/QVCLog.C @@ -26,8 +26,8 @@ typedef Qt2CB > base_class; -QVCLog::QVCLog(ControlVCLog & c, Dialogs &) - : base_class(c, _("VCLog")) +QVCLog::QVCLog() + : base_class(_("VCLog")) { } diff --git a/src/frontends/qt2/QVCLog.h b/src/frontends/qt2/QVCLog.h index b410b35f59..fe59245fc1 100644 --- a/src/frontends/qt2/QVCLog.h +++ b/src/frontends/qt2/QVCLog.h @@ -27,7 +27,7 @@ public: /// friend class QVCLogDialog; /// - QVCLog(ControlVCLog &, Dialogs &); + QVCLog(); private: /// Apply changes diff --git a/src/frontends/qt2/Qt2Base.C b/src/frontends/qt2/Qt2Base.C index b16305dfee..7f2a95f250 100644 --- a/src/frontends/qt2/Qt2Base.C +++ b/src/frontends/qt2/Qt2Base.C @@ -24,13 +24,21 @@ #include "Dialogs.h" #include "Qt2Base.h" #include "Qt2BC.h" +#include "ControlButtons.h" #include "support/LAssert.h" -Qt2Base::Qt2Base(ControlButtons & c, QString const & t) - : ViewBC(c), updating_(false), title_(t) +Qt2Base::Qt2Base(QString const & t) + : ViewBase(), updating_(false), title_(t) {} +Qt2BC & Qt2Base::bc() +{ + return static_cast(getController().bc()); + // return dynamic_cast(getController().bc()); +} + + void Qt2Base::show() { if (!form()) { @@ -77,29 +85,29 @@ void Qt2Base::changed() void Qt2Base::slotWMHide() { - CancelButton(); + getController().CancelButton(); } void Qt2Base::slotApply() { - ApplyButton(); + getController().ApplyButton(); } void Qt2Base::slotOK() { - OKButton(); + getController().OKButton(); } void Qt2Base::slotClose() { - CancelButton(); + getController().CancelButton(); } void Qt2Base::slotRestore() { - RestoreButton(); + getController().RestoreButton(); } diff --git a/src/frontends/qt2/Qt2Base.h b/src/frontends/qt2/Qt2Base.h index 06a5fbe0d8..640a043ced 100644 --- a/src/frontends/qt2/Qt2Base.h +++ b/src/frontends/qt2/Qt2Base.h @@ -21,7 +21,6 @@ #include "LString.h" #include "debug.h" #include "ButtonPolicies.h" -#include "ControlButtons.h" #include @@ -34,12 +33,12 @@ class Qt2BC; /** This class is an Qt2 GUI base class. */ -class Qt2Base : public QObject, public ViewBC +class Qt2Base : public QObject, public ViewBase { Q_OBJECT public: /// - Qt2Base(ControlButtons &, QString const &); + Qt2Base(QString const &); /// virtual ~Qt2Base() {} @@ -59,6 +58,9 @@ protected: /// is the dialog currently valid ? virtual bool isValid(); + /// + Qt2BC & bc(); + /// are we updating ? bool updating_; @@ -92,7 +94,7 @@ template class Qt2DB: public Qt2Base { protected: - Qt2DB(ControlButtons &, QString const &); + Qt2DB(QString const &); /// update the dialog virtual void update(); @@ -110,8 +112,8 @@ protected: template -Qt2DB::Qt2DB(ControlButtons & c, QString const & t) - : Qt2Base(c, t) +Qt2DB::Qt2DB(QString const & t) + : Qt2Base(t) {} @@ -163,23 +165,31 @@ public: protected: /// - Qt2CB(ControlButtons &, QString const &); + Qt2CB(QString const &); /// The parent controller - Controller & controller() const; + Controller & controller(); + /// The parent controller + Controller const & controller() const; }; template -Qt2CB::Qt2CB(ControlButtons & c, QString const & t) - : Base(c, t) +Qt2CB::Qt2CB(QString const & t) + : Base(t) {} template -Controller & Qt2CB::controller() const +Controller & Qt2CB::controller() { - return static_cast(controller_); - //return dynamic_cast(controller_); + return static_cast(getController()); +} + + +template +Controller const & Qt2CB::controller() const +{ + return static_cast(getController()); } diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index 953722b0da..086c775d52 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -65,7 +65,7 @@ QtView::QtView(unsigned int width, unsigned int height) connect(menuBar(), SIGNAL(activated(int)), this, SLOT(activated(int))); - toolbar_.reset(new Toolbar(this, *getDialogs(), 0, 0, toolbardefaults)); + toolbar_.reset(new Toolbar(this, 0, 0, toolbardefaults)); statusBar()->setSizeGripEnabled(false); diff --git a/src/frontends/qt2/Toolbar_pimpl.C b/src/frontends/qt2/Toolbar_pimpl.C index 512d83b451..68e8cd5e85 100644 --- a/src/frontends/qt2/Toolbar_pimpl.C +++ b/src/frontends/qt2/Toolbar_pimpl.C @@ -93,7 +93,7 @@ public: }; -Toolbar::Pimpl::Pimpl(LyXView * o, Dialogs &, int, int) +Toolbar::Pimpl::Pimpl(LyXView * o, int, int) : owner_(static_cast(o)), combo_(0) { diff --git a/src/frontends/qt2/Toolbar_pimpl.h b/src/frontends/qt2/Toolbar_pimpl.h index 49b12c79f4..6205ab6a67 100644 --- a/src/frontends/qt2/Toolbar_pimpl.h +++ b/src/frontends/qt2/Toolbar_pimpl.h @@ -36,7 +36,7 @@ struct Toolbar::Pimpl { friend class ToolbarProxy; public: - Pimpl(LyXView * o, Dialogs &, int x, int y); + Pimpl(LyXView * o, int x, int y); ~Pimpl(); diff --git a/src/frontends/qt2/guiapi.C b/src/frontends/qt2/guiapi.C index 171a7ac8c8..a4589662cd 100644 --- a/src/frontends/qt2/guiapi.C +++ b/src/frontends/qt2/guiapi.C @@ -180,7 +180,7 @@ extern "C" { { static GUI cal(lv, d); - cal.show(); + cal.controller().show(); } @@ -188,7 +188,7 @@ extern "C" { { static GUI cbi(lv, d); - cbi.showInset(ic); + cbi.controller().showInset(ic); } @@ -196,31 +196,31 @@ extern "C" { { static GUI cbt(lv, d); - cbt.showInset(ic); + cbt.controller().showInset(ic); } void gui_ShowCharacter(LyXView & lv, Dialogs & d) { - controlCharacterSingleton.get(lv, d).show(); + controlCharacterSingleton.get(lv, d).controller().show(); } void gui_SetUserFreeFont(LyXView & lv, Dialogs & d) { - controlCharacterSingleton.get(lv, d).apply(); + controlCharacterSingleton.get(lv, d).controller().apply(); } void gui_ShowCitation(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlCitationSingleton.get(lv, d).showInset(ic); + controlCitationSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateCitation(string const & s, LyXView & lv, Dialogs & d) { - controlCitationSingleton.get(lv, d).createInset(s); + controlCitationSingleton.get(lv, d).controller().createInset(s); } @@ -235,19 +235,19 @@ extern "C" { { static GUI ce(lv, d); - ce.showInset(ie); + ce.controller().showInset(ie); } void gui_ShowERT(InsetERT * ie, LyXView & lv, Dialogs & d) { - controlERTSingleton.get(lv, d).showInset(ie); + controlERTSingleton.get(lv, d).controller().showInset(ie); } void gui_UpdateERT(InsetERT * ie, LyXView & lv, Dialogs & d) { - controlERTSingleton.get(lv, d).showInset(ie); + controlERTSingleton.get(lv, d).controller().showInset(ie); } @@ -255,7 +255,7 @@ extern "C" { { static GUI ce(lv, d); - ce.showInset(ie); + ce.controller().showInset(ie); } @@ -263,7 +263,7 @@ extern "C" { { static GUI csf(lv, d); - csf.showFile(f); + csf.controller().showFile(f); } @@ -271,7 +271,7 @@ extern "C" { { static GUI cf(lv, d); - cf.showInset(ifl); + cf.controller().showInset(ifl); } @@ -280,7 +280,7 @@ extern "C" { #if 0 static GUI cf(lv, d); - cf.show(); + cf.controller().show(); #endif } @@ -289,7 +289,7 @@ extern "C" { { static GUI cg(lv, d); - cg.showInset(ig); + cg.controller().showInset(ig); } @@ -297,19 +297,19 @@ extern "C" { { static GUI ci(lv, d); - ci.showInset(ii); + ci.controller().showInset(ii); } void gui_ShowIndex(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlIndexSingleton.get(lv, d).showInset(ic); + controlIndexSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateIndex(LyXView & lv, Dialogs & d) { - controlIndexSingleton.get(lv, d).createInset(""); + controlIndexSingleton.get(lv, d).controller().createInset(""); } @@ -324,7 +324,7 @@ extern "C" { { static GUI cl(lv, d); - cl.show(); + cl.controller().show(); } @@ -337,23 +337,23 @@ extern "C" { void gui_ShowMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) { - controlMinipageSingleton.get(lv, d).showInset(im); + controlMinipageSingleton.get(lv, d).controller().showInset(im); } void gui_UpdateMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) { - controlMinipageSingleton.get(lv, d).showInset(im); + controlMinipageSingleton.get(lv, d).controller().showInset(im); } void gui_ShowParagraph(LyXView & lv, Dialogs & d) { - controlParagraphSingleton.get(lv, d).show(); + controlParagraphSingleton.get(lv, d).controller().show(); #if 0 static GUI cp(lv, d); - cp.show(); + cp.controller().show(); #endif } @@ -376,7 +376,7 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } @@ -390,19 +390,19 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } void gui_ShowRef(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlRefSingleton.get(lv, d).showInset(ic); + controlRefSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateRef(string const & s, LyXView & lv, Dialogs & d) { - controlRefSingleton.get(lv, d).createInset(s); + controlRefSingleton.get(lv, d).controller().createInset(s); } @@ -410,7 +410,7 @@ extern "C" { { static GUI cs(lv, d); - cs.show(); + cs.controller().show(); } @@ -428,7 +428,7 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } @@ -448,7 +448,7 @@ extern "C" { { static GUI ctc(lv, d); - ctc.show(); + ctc.controller().show(); } @@ -456,7 +456,7 @@ extern "C" { { static GUI ct(lv, d); - ct.show(); + ct.controller().show(); } @@ -465,32 +465,32 @@ extern "C" { #ifdef HAVE_LIBAIKSAURUS static GUI ct(lv, d); - ct.showEntry(s); + ct.controller().showEntry(s); #endif } void gui_ShowTOC(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlTocSingleton.get(lv, d).showInset(ic); + controlTocSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateTOC(string const & s, LyXView & lv, Dialogs & d) { - controlTocSingleton.get(lv, d).createInset(s); + controlTocSingleton.get(lv, d).controller().createInset(s); } void gui_ShowUrl(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlUrlSingleton.get(lv, d).showInset(ic); + controlUrlSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateUrl(string const & s, LyXView & lv, Dialogs & d) { - controlUrlSingleton.get(lv, d).createInset(s); + controlUrlSingleton.get(lv, d).controller().createInset(s); } @@ -498,7 +498,7 @@ extern "C" { { static GUI cv(lv, d); - cv.show(); + cv.controller().show(); } } // extern "C" diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 73b688158c..11afc6e7a9 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,62 @@ +2002-08-12 Angus Leeming + + * Dialogs.C (c-tor): connect the Tooltips::toggleEnabled method to + the Dialogs::toggleTooltips signal. + + * FormAboutlyx.[Ch]: + * FormBibitem.[Ch]: + * FormBibtex.[Ch]: + * FormBrowser.[Ch]: + * FormCharacter.[Ch]: + * FormCitation.[Ch]: + * FormERT.[Ch]: + * FormError.[Ch]: + * FormExternal.[Ch]: + * FormFloat.[Ch]: + * FormForks.[Ch]: + * FormGraphics.[Ch]: + * FormInclude.[Ch]: + * FormIndex.[Ch]: + * FormLog.[Ch]: + * FormMinipage.[Ch]: + * FormParagraph.[Ch]: + * FormPreamble.[Ch]: + * FormPrint.[Ch]: + * FormRef.[Ch]: + * FormSearch.[Ch]: + * FormSendto.[Ch]: + * FormShowFile.[Ch]: + * FormSpellchecker.[Ch]: + * FormTabularCreate.[Ch]: + * FormTexinfo.[Ch]: + * FormThesaurus.[Ch]: + * FormToc.[Ch]: + * FormURL.[Ch]: + * FormVCLog.[Ch]: + No longer pass Controller or Dialogs to the c-tor. + No longer forward-declare Dialogs. + + * FormBase.[Ch]: derives from ViewBase directly. + No longer passed ControlButtons & or Dialogs &. + (bc): new method, enabling the daughter classes to access the + ButtonController. + (C_FormBaseApplyCB): + (C_FormBaseOKCB): + (C_FormBaseCancelCB): + (C_FormBaseRestoreCB): + (C_WMHideCB): changes due to a change in the ViewBase class. + + * Toolbar_pimpl.[Ch] (c-tor): + * Tooltips.[Ch] (c-tor): no longer passed a Dialogs &. + + * Tooltips.h (toggleEnabled): made public for the Dialogs c-tor. + + * XFormsView.[Ch] (c-tor, create_form_form_main): no longer pass + Dialogs & to the Toolbar. + + * guiapi.C: access the controller methods by explicit invocation of the + controller. + 2002-08-12 Lars Gullik Bjønnes * FormDocument.C (saveParamsAsDefault): ParagraphList changes diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index f4c3bf74d2..7fc8af49f5 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -16,6 +16,8 @@ #include "Dialogs.h" #include "Tooltips.h" +#include + LyXView * dialogs_lyxview; @@ -31,6 +33,7 @@ Dialogs::Dialogs(LyXView * lv) #if 1 dialogs_lyxview = lv; #endif + toggleTooltips.connect(boost::bind(&Tooltips::toggleEnabled)); // reduce the number of connections needed in // dialogs by a simple connection here. hideAll.connect(hideBufferDependent); diff --git a/src/frontends/xforms/FormAboutlyx.C b/src/frontends/xforms/FormAboutlyx.C index 77c054e174..964217dcae 100644 --- a/src/frontends/xforms/FormAboutlyx.C +++ b/src/frontends/xforms/FormAboutlyx.C @@ -25,8 +25,8 @@ using std::getline; typedef FormCB > base_class; -FormAboutlyx::FormAboutlyx(ControlAboutlyx & c, Dialogs & d) - : base_class(c, d, _("About LyX"), false) +FormAboutlyx::FormAboutlyx() + : base_class(_("About LyX"), false) {} diff --git a/src/frontends/xforms/FormAboutlyx.h b/src/frontends/xforms/FormAboutlyx.h index f09a36704a..1048f166dc 100644 --- a/src/frontends/xforms/FormAboutlyx.h +++ b/src/frontends/xforms/FormAboutlyx.h @@ -30,7 +30,7 @@ struct FD_aboutlyx_license; class FormAboutlyx : public FormCB > { public: /// - FormAboutlyx(ControlAboutlyx &, Dialogs &); + FormAboutlyx(); private: /// not needed. diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index 762a09f1e3..53a0a70e99 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -12,8 +12,9 @@ #pragma implementation #endif -#include "Dialogs.h" #include "FormBase.h" + +#include "ControlButtons.h" #include "xformsBC.h" #include "xforms_resize.h" #include "Tooltips.h" @@ -32,10 +33,9 @@ static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *); } // extern "C" -FormBase::FormBase(ControlButtons & c, Dialogs & d, - string const & t, bool allowResize) - : ViewBC(c), minw_(0), minh_(0), allow_resize_(allowResize), - title_(t), tooltips_(new Tooltips(d)) +FormBase::FormBase(string const & t, bool allowResize) + : ViewBase(), minw_(0), minh_(0), allow_resize_(allowResize), + title_(t), tooltips_(new Tooltips()) {} @@ -58,6 +58,13 @@ void FormBase::redraw() } +xformsBC & FormBase::bc() +{ + return static_cast(getController().bc()); + // return dynamic_cast(controller_ptr_->bc()); +} + + void FormBase::show() { if (!form()) { @@ -102,9 +109,12 @@ void FormBase::show() if (!allow_resize_) fl_set_form_maxsize(form(), minw_, minh_); + int const iconify = getController().IconifyWithMain() ? + FL_TRANSIENT : 0; + fl_show_form(form(), FL_PLACE_MOUSE | FL_FREE_SIZE, - (controller_.IconifyWithMain() ? FL_TRANSIENT : 0), + iconify, title_.c_str()); } @@ -166,26 +176,26 @@ extern "C" { void C_FormBaseApplyCB(FL_OBJECT * ob, long) { - GetForm(ob)->ApplyButton(); + GetForm(ob)->getController().ApplyButton(); } void C_FormBaseOKCB(FL_OBJECT * ob, long) { - GetForm(ob)->OKButton(); + GetForm(ob)->getController().OKButton(); } void C_FormBaseCancelCB(FL_OBJECT * ob, long) { FormBase * form = GetForm(ob); - form->CancelButton(); + form->getController().CancelButton(); } void C_FormBaseRestoreCB(FL_OBJECT * ob, long) { - GetForm(ob)->RestoreButton(); + GetForm(ob)->getController().RestoreButton(); } @@ -200,7 +210,7 @@ static int C_WMHideCB(FL_FORM * form, void *) // Close the dialog cleanly, even if the WM is used to do so. lyx::Assert(form && form->u_vdata); FormBase * ptr = static_cast(form->u_vdata); - ptr->CancelButton(); + ptr->getController().CancelButton(); return FL_CANCEL; } diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h index 53a54864c0..b378ff1cc0 100644 --- a/src/frontends/xforms/FormBase.h +++ b/src/frontends/xforms/FormBase.h @@ -28,16 +28,15 @@ class xformsBC; class Tooltips; -class Dialogs; + /** This class is an XForms GUI base class. */ -class FormBase : public ViewBC, public FeedbackController +class FormBase : public ViewBase, public FeedbackController { public: /// - FormBase(ControlButtons &, Dialogs &, - string const &, bool allowResize); + FormBase(string const &, bool allowResize); /// virtual ~FormBase(); @@ -64,6 +63,9 @@ protected: */ static void setPrehandler(FL_OBJECT * ob); + /// + xformsBC & bc(); + private: /// Pointer to the actual instantiation of xform's form virtual FL_FORM * form() const = 0; @@ -93,8 +95,7 @@ class FormDB: public FormBase { protected: /// - FormDB(ControlButtons &, Dialogs &, - string const &, bool allowResize=true); + FormDB(string const &, bool allowResize=true); /// Pointer to the actual instantiation of xform's form virtual FL_FORM * form() const; /// Real GUI implementation. @@ -103,9 +104,8 @@ protected: template -FormDB::FormDB(ControlButtons & c, Dialogs & d, - string const & t, bool allowResize) - : FormBase(c, d, t, allowResize) +FormDB::FormDB(string const & t, bool allowResize) + : FormBase(t, allowResize) {} @@ -122,25 +122,31 @@ class FormCB: public Base { protected: /// - FormCB(Controller &, Dialogs &, - string const &, bool allowResize = true); + FormCB(string const &, bool allowResize = true); /// The parent controller - Controller & controller() const; + Controller & controller(); + /// + Controller const & controller() const; }; template -FormCB::FormCB(Controller & c, Dialogs & d, - string const & t, bool allowResize) - : Base(c, d, t, allowResize) +FormCB::FormCB(string const & t, bool allowResize) + : Base(t, allowResize) {} template -Controller & FormCB::controller() const +Controller & FormCB::controller() { - return static_cast(controller_); - //return dynamic_cast(controller_); + return static_cast(getController()); +} + + +template +Controller const & FormCB::controller() const +{ + return static_cast(getController()); } diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C index 7213005212..208665502d 100644 --- a/src/frontends/xforms/FormBaseDeprecated.C +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -43,7 +43,7 @@ FormBaseDeprecated::FormBaseDeprecated(LyXView * lv, Dialogs * d, string const & t, bool allowResize) : lv_(lv), d_(d), title_(t), minw_(0), minh_(0), allow_resize_(allowResize), - tooltips_(new Tooltips(*d)) + tooltips_(new Tooltips()) { lyx::Assert(lv && d); } diff --git a/src/frontends/xforms/FormBaseDeprecated.h b/src/frontends/xforms/FormBaseDeprecated.h index 905a315332..71bb9b4db5 100644 --- a/src/frontends/xforms/FormBaseDeprecated.h +++ b/src/frontends/xforms/FormBaseDeprecated.h @@ -27,7 +27,7 @@ #include "forms_fwd.h" -//#include +#include class Buffer; class Dialogs; diff --git a/src/frontends/xforms/FormBibitem.C b/src/frontends/xforms/FormBibitem.C index de9440f359..835ac1c6e3 100644 --- a/src/frontends/xforms/FormBibitem.C +++ b/src/frontends/xforms/FormBibitem.C @@ -22,8 +22,8 @@ typedef FormCB > base_class; -FormBibitem::FormBibitem(ControlBibitem & c, Dialogs & d) - : base_class(c, d, _("Bibliography Entry")) +FormBibitem::FormBibitem() + : base_class(_("Bibliography Entry")) {} diff --git a/src/frontends/xforms/FormBibitem.h b/src/frontends/xforms/FormBibitem.h index 2c18ccbf21..ab24bdbcd9 100644 --- a/src/frontends/xforms/FormBibitem.h +++ b/src/frontends/xforms/FormBibitem.h @@ -26,7 +26,7 @@ struct FD_bibitem; class FormBibitem : public FormCB > { public: /// - FormBibitem(ControlBibitem &, Dialogs &); + FormBibitem(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormBibtex.C b/src/frontends/xforms/FormBibtex.C index 6ec95c50eb..e406a2d86e 100644 --- a/src/frontends/xforms/FormBibtex.C +++ b/src/frontends/xforms/FormBibtex.C @@ -36,8 +36,8 @@ using std::sort; typedef FormCB > base_class; -FormBibtex::FormBibtex(ControlBibtex & c, Dialogs & d) - : base_class(c, d, _("BibTeX Database")) +FormBibtex::FormBibtex() + : base_class(_("BibTeX Database")) {} diff --git a/src/frontends/xforms/FormBibtex.h b/src/frontends/xforms/FormBibtex.h index 572b9c13f8..5b94c0c1da 100644 --- a/src/frontends/xforms/FormBibtex.h +++ b/src/frontends/xforms/FormBibtex.h @@ -26,7 +26,7 @@ struct FD_bibtex; class FormBibtex : public FormCB > { public: /// - FormBibtex(ControlBibtex &, Dialogs &); + FormBibtex(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormBrowser.C b/src/frontends/xforms/FormBrowser.C index 339335a536..82b1a93e5e 100644 --- a/src/frontends/xforms/FormBrowser.C +++ b/src/frontends/xforms/FormBrowser.C @@ -16,9 +16,8 @@ #include "forms/form_browser.h" #include "xformsBC.h" -FormBrowser::FormBrowser(ControlButtons & c, Dialogs & d, - string const & t, bool allowResize) - : FormDB(c, d, t, allowResize) +FormBrowser::FormBrowser(string const & t, bool allowResize) + : FormDB(t, allowResize) {} diff --git a/src/frontends/xforms/FormBrowser.h b/src/frontends/xforms/FormBrowser.h index 6312362c35..196020eb22 100644 --- a/src/frontends/xforms/FormBrowser.h +++ b/src/frontends/xforms/FormBrowser.h @@ -26,8 +26,7 @@ struct FD_browser; class FormBrowser : public FormDB { public: /// - FormBrowser(ControlButtons &, Dialogs &, - string const &, bool allowResize = true); + FormBrowser(string const &, bool allowResize = true); private: /// Build the dialog. virtual void build(); diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C index 41f1641346..ec50266dd9 100644 --- a/src/frontends/xforms/FormCharacter.C +++ b/src/frontends/xforms/FormCharacter.C @@ -36,8 +36,8 @@ using namespace frnt; typedef FormCB > base_class; -FormCharacter::FormCharacter(ControlCharacter & c, Dialogs & d) - : base_class(c, d, _("Character Layout"), false) +FormCharacter::FormCharacter() + : base_class(_("Character Layout"), false) {} diff --git a/src/frontends/xforms/FormCharacter.h b/src/frontends/xforms/FormCharacter.h index 7eb57d30b1..380da7b4e0 100644 --- a/src/frontends/xforms/FormCharacter.h +++ b/src/frontends/xforms/FormCharacter.h @@ -35,7 +35,7 @@ class FormCharacter : public FormCB > { public: /// - FormCharacter(ControlCharacter &, Dialogs &); + FormCharacter(); private: /// Apply from dialog diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index 39d7bf9085..22ac62b05d 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -115,8 +115,8 @@ void updateStyle(FD_citation * dialog, string command) typedef FormCB > base_class; -FormCitation::FormCitation(ControlCitation & c, Dialogs & d) - : base_class(c, d, _("Citation"), false) +FormCitation::FormCitation() + : base_class(_("Citation"), false) {} diff --git a/src/frontends/xforms/FormCitation.h b/src/frontends/xforms/FormCitation.h index efcba5b9ff..c40f10931d 100644 --- a/src/frontends/xforms/FormCitation.h +++ b/src/frontends/xforms/FormCitation.h @@ -25,7 +25,7 @@ struct FD_citation; class FormCitation : public FormCB > { public: /// - FormCitation(ControlCitation &, Dialogs &); + FormCitation(); private: /// enum State { diff --git a/src/frontends/xforms/FormERT.C b/src/frontends/xforms/FormERT.C index 64c66a3d4f..9f2e06bb84 100644 --- a/src/frontends/xforms/FormERT.C +++ b/src/frontends/xforms/FormERT.C @@ -23,8 +23,8 @@ typedef FormCB > base_class; -FormERT::FormERT(ControlERT & c, Dialogs & d) - : base_class(c, d, _("ERT Options")) +FormERT::FormERT() + : base_class(_("ERT Options")) {} diff --git a/src/frontends/xforms/FormERT.h b/src/frontends/xforms/FormERT.h index 7d61116c66..8209e7dc00 100644 --- a/src/frontends/xforms/FormERT.h +++ b/src/frontends/xforms/FormERT.h @@ -26,7 +26,7 @@ class FormERT : public FormCB > { public: /// - FormERT(ControlERT &, Dialogs &); + FormERT(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormError.C b/src/frontends/xforms/FormError.C index ead1e6478a..048e3dd690 100644 --- a/src/frontends/xforms/FormError.C +++ b/src/frontends/xforms/FormError.C @@ -21,8 +21,8 @@ typedef FormCB > base_class; -FormError::FormError(ControlError & c, Dialogs & d) - : base_class(c, d, _("LaTeX Error")) +FormError::FormError() + : base_class(_("LaTeX Error")) {} diff --git a/src/frontends/xforms/FormError.h b/src/frontends/xforms/FormError.h index cbe367c4ef..9af9085ed7 100644 --- a/src/frontends/xforms/FormError.h +++ b/src/frontends/xforms/FormError.h @@ -24,7 +24,7 @@ struct FD_error; class FormError : public FormCB > { public: /// Constructor - FormError(ControlError &, Dialogs &); + FormError(); private: /// not needed. virtual void apply() {} diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index 1a6960bd7a..69d97706e7 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -27,8 +27,8 @@ typedef FormCB > base_class; -FormExternal::FormExternal(ControlExternal & c, Dialogs & d) - : base_class(c, d, _("Edit external file")) +FormExternal::FormExternal() + : base_class(_("Edit external file")) {} diff --git a/src/frontends/xforms/FormExternal.h b/src/frontends/xforms/FormExternal.h index b55abd4708..2fc3dfcfb4 100644 --- a/src/frontends/xforms/FormExternal.h +++ b/src/frontends/xforms/FormExternal.h @@ -26,7 +26,7 @@ struct FD_external; class FormExternal : public FormCB > { public: /// - FormExternal(ControlExternal &, Dialogs &); + FormExternal(); private: /// apply changes void apply(); diff --git a/src/frontends/xforms/FormFloat.C b/src/frontends/xforms/FormFloat.C index 839965d9c1..7252f7cd1a 100644 --- a/src/frontends/xforms/FormFloat.C +++ b/src/frontends/xforms/FormFloat.C @@ -23,8 +23,8 @@ typedef FormCB > base_class; -FormFloat::FormFloat(ControlFloat & c, Dialogs & d) - : base_class(c, d, _("Float Options")) +FormFloat::FormFloat() + : base_class(_("Float Options")) {} diff --git a/src/frontends/xforms/FormFloat.h b/src/frontends/xforms/FormFloat.h index e8ad23e6ad..bf870549d5 100644 --- a/src/frontends/xforms/FormFloat.h +++ b/src/frontends/xforms/FormFloat.h @@ -25,7 +25,7 @@ struct FD_float; class FormFloat : public FormCB > { public: /// - FormFloat(ControlFloat &, Dialogs &); + FormFloat(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormForks.C b/src/frontends/xforms/FormForks.C index a1242a808a..81c7be89c9 100644 --- a/src/frontends/xforms/FormForks.C +++ b/src/frontends/xforms/FormForks.C @@ -30,8 +30,8 @@ using std::find_if; typedef FormCB > base_class; -FormForks::FormForks(ControlForks & c, Dialogs & d) - : base_class(c, d, _("Child processes")) +FormForks::FormForks() + : base_class(_("Child processes")) {} diff --git a/src/frontends/xforms/FormForks.h b/src/frontends/xforms/FormForks.h index 14eb28695e..4f6c234760 100644 --- a/src/frontends/xforms/FormForks.h +++ b/src/frontends/xforms/FormForks.h @@ -22,7 +22,7 @@ struct FD_forks; class FormForks : public FormCB > { public: /// - FormForks(ControlForks &, Dialogs &); + FormForks(); /// preemptive handler for feedback messages void feedbackCB(FL_OBJECT *, int); diff --git a/src/frontends/xforms/FormGraphics.C b/src/frontends/xforms/FormGraphics.C index eb0fc4ce88..231c07707b 100644 --- a/src/frontends/xforms/FormGraphics.C +++ b/src/frontends/xforms/FormGraphics.C @@ -54,8 +54,8 @@ LyXLength getLyXLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice) typedef FormCB > base_class; -FormGraphics::FormGraphics(ControlGraphics & c, Dialogs & d) - : base_class(c, d, _("Graphics"), false) +FormGraphics::FormGraphics() + : base_class(_("Graphics"), false) {} diff --git a/src/frontends/xforms/FormGraphics.h b/src/frontends/xforms/FormGraphics.h index 6ae60f3244..2c4456707f 100644 --- a/src/frontends/xforms/FormGraphics.h +++ b/src/frontends/xforms/FormGraphics.h @@ -35,7 +35,7 @@ struct FD_graphics_special; class FormGraphics : public FormCB > { public: /// - FormGraphics(ControlGraphics &, Dialogs &); + FormGraphics(); private: /** Redraw the form (on receipt of a Signal indicating, for example, diff --git a/src/frontends/xforms/FormInclude.C b/src/frontends/xforms/FormInclude.C index fcf18e902c..8a504533a1 100644 --- a/src/frontends/xforms/FormInclude.C +++ b/src/frontends/xforms/FormInclude.C @@ -26,8 +26,8 @@ typedef FormCB > base_class; -FormInclude::FormInclude(ControlInclude & c, Dialogs & d) - : base_class(c, d, _("Include file")) +FormInclude::FormInclude() + : base_class(_("Include file")) {} @@ -150,7 +150,7 @@ ButtonPolicy::SMInput FormInclude::input(FL_OBJECT * ob, long) string const in_name = fl_get_input(dialog_->input_filename); if (!rtrim(in_name).empty() && controller().fileExists(in_name)) { // ApplyButton(); - OKButton(); + controller().OKButton(); controller().load(rtrim(in_name)); action = ButtonPolicy::SMI_NOOP; } diff --git a/src/frontends/xforms/FormInclude.h b/src/frontends/xforms/FormInclude.h index 325dd4b076..1f508eee84 100644 --- a/src/frontends/xforms/FormInclude.h +++ b/src/frontends/xforms/FormInclude.h @@ -25,7 +25,7 @@ struct FD_include; class FormInclude : public FormCB > { public: /// - FormInclude(ControlInclude &, Dialogs &); + FormInclude(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormIndex.C b/src/frontends/xforms/FormIndex.C index ec704bb07a..7921e66cad 100644 --- a/src/frontends/xforms/FormIndex.C +++ b/src/frontends/xforms/FormIndex.C @@ -21,8 +21,8 @@ typedef FormCB > base_class; -FormIndex::FormIndex(ControlIndex & c, Dialogs & d) - : base_class(c, d, _("Index")) +FormIndex::FormIndex() + : base_class(_("Index")) {} diff --git a/src/frontends/xforms/FormIndex.h b/src/frontends/xforms/FormIndex.h index 360f16c41f..8a1a55a06c 100644 --- a/src/frontends/xforms/FormIndex.h +++ b/src/frontends/xforms/FormIndex.h @@ -24,7 +24,7 @@ struct FD_index; class FormIndex : public FormCB > { public: /// - FormIndex(ControlIndex &, Dialogs &); + FormIndex(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormLog.C b/src/frontends/xforms/FormLog.C index f317805d5f..e0c73bbb2c 100644 --- a/src/frontends/xforms/FormLog.C +++ b/src/frontends/xforms/FormLog.C @@ -19,8 +19,8 @@ #include "gettext.h" #include FORMS_H_LOCATION -FormLog::FormLog(ControlLog & c, Dialogs & d) - : FormCB(c, d, _("LaTeX Log")) +FormLog::FormLog() + : FormCB( _("LaTeX Log")) {} diff --git a/src/frontends/xforms/FormLog.h b/src/frontends/xforms/FormLog.h index 00806b0e23..b69eae3552 100644 --- a/src/frontends/xforms/FormLog.h +++ b/src/frontends/xforms/FormLog.h @@ -25,7 +25,7 @@ class ControlLog; class FormLog : public FormCB { public: /// - FormLog(ControlLog &, Dialogs &); + FormLog(); // Functions accessible to the Controller. diff --git a/src/frontends/xforms/FormMinipage.C b/src/frontends/xforms/FormMinipage.C index 7a5d2a1275..53096b6004 100644 --- a/src/frontends/xforms/FormMinipage.C +++ b/src/frontends/xforms/FormMinipage.C @@ -24,8 +24,8 @@ typedef FormCB > base_class; -FormMinipage::FormMinipage(ControlMinipage & c, Dialogs & d) - : base_class(c, d, _("Minipage Options")) +FormMinipage::FormMinipage() + : base_class(_("Minipage Options")) {} diff --git a/src/frontends/xforms/FormMinipage.h b/src/frontends/xforms/FormMinipage.h index e54acd600d..c1cf7d05cd 100644 --- a/src/frontends/xforms/FormMinipage.h +++ b/src/frontends/xforms/FormMinipage.h @@ -26,7 +26,7 @@ class FormMinipage : public FormCB > { public: /// - FormMinipage(ControlMinipage &, Dialogs &); + FormMinipage(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 1e8ecc082d..481a030a31 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -38,8 +38,8 @@ using std::remove_if; typedef FormCB > base_class; -FormParagraph::FormParagraph(ControlParagraph & c, Dialogs & d) - : base_class(c, d, _("Paragraph Layout"), false) +FormParagraph::FormParagraph() + : base_class(_("Paragraph Layout"), false) {} void FormParagraph::build() diff --git a/src/frontends/xforms/FormParagraph.h b/src/frontends/xforms/FormParagraph.h index c65c474696..a49e2e9f73 100644 --- a/src/frontends/xforms/FormParagraph.h +++ b/src/frontends/xforms/FormParagraph.h @@ -25,7 +25,7 @@ class FormParagraph : public FormCB > { public: /// - FormParagraph(ControlParagraph &, Dialogs &); + FormParagraph(); private: /// Build the dialog virtual void build(); diff --git a/src/frontends/xforms/FormPreamble.C b/src/frontends/xforms/FormPreamble.C index 299a6862ec..2374cffb6d 100644 --- a/src/frontends/xforms/FormPreamble.C +++ b/src/frontends/xforms/FormPreamble.C @@ -21,8 +21,8 @@ typedef FormCB > base_class; -FormPreamble::FormPreamble(ControlPreamble & c, Dialogs & d) - : base_class(c, d, _("LaTeX preamble")) +FormPreamble::FormPreamble() + : base_class(_("LaTeX preamble")) {} diff --git a/src/frontends/xforms/FormPreamble.h b/src/frontends/xforms/FormPreamble.h index 8bf7e9fefa..59e6c6e440 100644 --- a/src/frontends/xforms/FormPreamble.h +++ b/src/frontends/xforms/FormPreamble.h @@ -24,7 +24,7 @@ struct FD_preamble; class FormPreamble : public FormCB > { public: /// - FormPreamble(ControlPreamble &, Dialogs &); + FormPreamble(); private: /// Apply from dialog virtual void apply(); diff --git a/src/frontends/xforms/FormPrint.C b/src/frontends/xforms/FormPrint.C index 551b4eb560..7794204f5a 100644 --- a/src/frontends/xforms/FormPrint.C +++ b/src/frontends/xforms/FormPrint.C @@ -32,8 +32,8 @@ using std::make_pair; typedef FormCB > base_class; -FormPrint::FormPrint(ControlPrint & c, Dialogs & d) - : base_class(c, d, _("Print")), +FormPrint::FormPrint() + : base_class(_("Print")), target_(2), order_(2), which_(3) {} diff --git a/src/frontends/xforms/FormPrint.h b/src/frontends/xforms/FormPrint.h index f9cddad700..5caf1440c0 100644 --- a/src/frontends/xforms/FormPrint.h +++ b/src/frontends/xforms/FormPrint.h @@ -29,7 +29,7 @@ struct FD_print; class FormPrint : public FormCB > { public: /// - FormPrint(ControlPrint &, Dialogs &); + FormPrint(); private: /// Apply from dialog virtual void apply(); diff --git a/src/frontends/xforms/FormRef.C b/src/frontends/xforms/FormRef.C index 86a7ded32e..70640bd4bd 100644 --- a/src/frontends/xforms/FormRef.C +++ b/src/frontends/xforms/FormRef.C @@ -30,8 +30,8 @@ using std::vector; typedef FormCB > base_class; -FormRef::FormRef(ControlRef & c, Dialogs & d) - : base_class(c, d, _("Reference")), +FormRef::FormRef() + : base_class(_("Reference")), at_ref_(false) {} diff --git a/src/frontends/xforms/FormRef.h b/src/frontends/xforms/FormRef.h index 3a5ef194bf..7cd40ee473 100644 --- a/src/frontends/xforms/FormRef.h +++ b/src/frontends/xforms/FormRef.h @@ -24,7 +24,7 @@ struct FD_ref; class FormRef : public FormCB > { public: /// - FormRef(ControlRef &, Dialogs &); + FormRef(); private: /// Set the Params variable for the Controller. virtual void apply(); diff --git a/src/frontends/xforms/FormSearch.C b/src/frontends/xforms/FormSearch.C index da4dd93f46..cfb0cc9416 100644 --- a/src/frontends/xforms/FormSearch.C +++ b/src/frontends/xforms/FormSearch.C @@ -20,8 +20,8 @@ typedef FormCB > base_class; -FormSearch::FormSearch(ControlSearch & c, Dialogs & d) - : base_class(c, d, _("LyX: Find and Replace")) +FormSearch::FormSearch() + : base_class(_("LyX: Find and Replace")) {} diff --git a/src/frontends/xforms/FormSearch.h b/src/frontends/xforms/FormSearch.h index 5f5be4cfb6..f744b25383 100644 --- a/src/frontends/xforms/FormSearch.h +++ b/src/frontends/xforms/FormSearch.h @@ -24,7 +24,7 @@ struct FD_search; class FormSearch : public FormCB > { public: /// - FormSearch(ControlSearch &, Dialogs &); + FormSearch(); private: /// not needed. virtual void apply() {} diff --git a/src/frontends/xforms/FormSendto.C b/src/frontends/xforms/FormSendto.C index 11050fbfa3..6841c28664 100644 --- a/src/frontends/xforms/FormSendto.C +++ b/src/frontends/xforms/FormSendto.C @@ -26,8 +26,8 @@ using std::vector; typedef FormCB > base_class; -FormSendto::FormSendto(ControlSendto & c, Dialogs & d) - : base_class(c, d, _("Send document to command")) +FormSendto::FormSendto() + : base_class(_("Send document to command")) {} diff --git a/src/frontends/xforms/FormSendto.h b/src/frontends/xforms/FormSendto.h index 86f9f7ba80..9ddc83a8e4 100644 --- a/src/frontends/xforms/FormSendto.h +++ b/src/frontends/xforms/FormSendto.h @@ -26,7 +26,7 @@ struct FD_sendto; class FormSendto : public FormCB > { public: /// - FormSendto(ControlSendto &, Dialogs &); + FormSendto(); private: /// Apply from dialog (modify or create inset) virtual void apply(); diff --git a/src/frontends/xforms/FormShowFile.C b/src/frontends/xforms/FormShowFile.C index 8e8f7b8b36..3df6d3a831 100644 --- a/src/frontends/xforms/FormShowFile.C +++ b/src/frontends/xforms/FormShowFile.C @@ -20,8 +20,8 @@ #include FORMS_H_LOCATION -FormShowFile::FormShowFile(ControlShowFile & c, Dialogs & d) - : FormCB(c, d, string()) +FormShowFile::FormShowFile() + : FormCB(string()) {} diff --git a/src/frontends/xforms/FormShowFile.h b/src/frontends/xforms/FormShowFile.h index a00fb533e5..af057a9fff 100644 --- a/src/frontends/xforms/FormShowFile.h +++ b/src/frontends/xforms/FormShowFile.h @@ -25,7 +25,7 @@ class ControlShowFile; class FormShowFile : public FormCB { public: /// - FormShowFile(ControlShowFile &, Dialogs &); + FormShowFile(); // Functions accessible to the Controller. diff --git a/src/frontends/xforms/FormSpellchecker.C b/src/frontends/xforms/FormSpellchecker.C index 23c388d2c5..867ac1ece3 100644 --- a/src/frontends/xforms/FormSpellchecker.C +++ b/src/frontends/xforms/FormSpellchecker.C @@ -21,8 +21,8 @@ typedef FormCB > base_class; -FormSpellchecker::FormSpellchecker(ControlSpellchecker & c, Dialogs & d) - : base_class(c, d, _("LyX: Spellchecker"), false) +FormSpellchecker::FormSpellchecker() + : base_class(_("LyX: Spellchecker"), false) {} diff --git a/src/frontends/xforms/FormSpellchecker.h b/src/frontends/xforms/FormSpellchecker.h index 5f986486cf..d3efe3bedd 100644 --- a/src/frontends/xforms/FormSpellchecker.h +++ b/src/frontends/xforms/FormSpellchecker.h @@ -24,7 +24,7 @@ struct FD_spellchecker; class FormSpellchecker : public FormCB > { public: /// - FormSpellchecker(ControlSpellchecker &, Dialogs &); + FormSpellchecker(); private: /// not needed. void apply() {} diff --git a/src/frontends/xforms/FormTabularCreate.C b/src/frontends/xforms/FormTabularCreate.C index 2e57b59a4a..b6f7150a68 100644 --- a/src/frontends/xforms/FormTabularCreate.C +++ b/src/frontends/xforms/FormTabularCreate.C @@ -26,8 +26,8 @@ using std::make_pair; typedef FormCB > base_class; -FormTabularCreate::FormTabularCreate(ControlTabularCreate & c, Dialogs & d) - : base_class(c, d, _("Insert Tabular")) +FormTabularCreate::FormTabularCreate() + : base_class(_("Insert Tabular")) {} diff --git a/src/frontends/xforms/FormTabularCreate.h b/src/frontends/xforms/FormTabularCreate.h index ef665ee84c..52ca202c94 100644 --- a/src/frontends/xforms/FormTabularCreate.h +++ b/src/frontends/xforms/FormTabularCreate.h @@ -27,7 +27,7 @@ class FormTabularCreate : public FormCB > { public: /// - FormTabularCreate(ControlTabularCreate &, Dialogs &); + FormTabularCreate(); private: /// Apply from dialog virtual void apply(); diff --git a/src/frontends/xforms/FormTexinfo.C b/src/frontends/xforms/FormTexinfo.C index d28e8fb8a9..408c011c55 100644 --- a/src/frontends/xforms/FormTexinfo.C +++ b/src/frontends/xforms/FormTexinfo.C @@ -26,8 +26,8 @@ typedef FormCB > base_class; -FormTexinfo::FormTexinfo(ControlTexinfo & c, Dialogs & d) - : base_class(c, d, _("LaTeX Information")), +FormTexinfo::FormTexinfo() + : base_class(_("LaTeX Information")), activeStyle(ControlTexinfo::cls) {} diff --git a/src/frontends/xforms/FormTexinfo.h b/src/frontends/xforms/FormTexinfo.h index 0564fcd3eb..2a4d18d1cc 100644 --- a/src/frontends/xforms/FormTexinfo.h +++ b/src/frontends/xforms/FormTexinfo.h @@ -22,7 +22,7 @@ struct FD_texinfo; class FormTexinfo : public FormCB > { public: /// - FormTexinfo(ControlTexinfo &, Dialogs &); + FormTexinfo(); private: /// not needed virtual void apply() {} diff --git a/src/frontends/xforms/FormThesaurus.C b/src/frontends/xforms/FormThesaurus.C index e7f351dec7..a91317de61 100644 --- a/src/frontends/xforms/FormThesaurus.C +++ b/src/frontends/xforms/FormThesaurus.C @@ -33,8 +33,8 @@ using std::vector; typedef FormCB > base_class; -FormThesaurus::FormThesaurus(ControlThesaurus & c, Dialogs & d) - : base_class(c, d, _("LyX: Thesaurus"), false), +FormThesaurus::FormThesaurus() + : base_class(_("LyX: Thesaurus"), false), clickline_(-1) { } diff --git a/src/frontends/xforms/FormThesaurus.h b/src/frontends/xforms/FormThesaurus.h index 82cbeafe01..c7c16228d9 100644 --- a/src/frontends/xforms/FormThesaurus.h +++ b/src/frontends/xforms/FormThesaurus.h @@ -24,7 +24,7 @@ struct FD_thesaurus; class FormThesaurus : public FormCB > { public: /// - FormThesaurus(ControlThesaurus &, Dialogs &); + FormThesaurus(); private: /// not needed. virtual void apply() {} diff --git a/src/frontends/xforms/FormToc.C b/src/frontends/xforms/FormToc.C index 9a54cb9632..eb23182e62 100644 --- a/src/frontends/xforms/FormToc.C +++ b/src/frontends/xforms/FormToc.C @@ -30,8 +30,8 @@ using std::endl; typedef FormCB > base_class; -FormToc::FormToc(ControlToc & c, Dialogs & d) - : base_class(c, d, _("Table of Contents")) +FormToc::FormToc() + : base_class(_("Table of Contents")) {} diff --git a/src/frontends/xforms/FormToc.h b/src/frontends/xforms/FormToc.h index bde4789861..e0992974cc 100644 --- a/src/frontends/xforms/FormToc.h +++ b/src/frontends/xforms/FormToc.h @@ -25,7 +25,7 @@ struct FD_toc; class FormToc : public FormCB > { public: /// - FormToc(ControlToc &, Dialogs &); + FormToc(); private: /// not needed virtual void apply() {} diff --git a/src/frontends/xforms/FormUrl.C b/src/frontends/xforms/FormUrl.C index 823c8760af..9a5a5c997b 100644 --- a/src/frontends/xforms/FormUrl.C +++ b/src/frontends/xforms/FormUrl.C @@ -21,8 +21,8 @@ typedef FormCB > base_class; -FormUrl::FormUrl(ControlUrl & c, Dialogs & d) - : base_class(c, d, _("Url")) +FormUrl::FormUrl() + : base_class(_("Url")) {} diff --git a/src/frontends/xforms/FormUrl.h b/src/frontends/xforms/FormUrl.h index 361553a748..74e757a956 100644 --- a/src/frontends/xforms/FormUrl.h +++ b/src/frontends/xforms/FormUrl.h @@ -24,7 +24,7 @@ struct FD_url; class FormUrl : public FormCB > { public: /// - FormUrl(ControlUrl &, Dialogs &); + FormUrl(); private: /// Apply from dialog (modify or create inset) virtual void apply(); diff --git a/src/frontends/xforms/FormVCLog.C b/src/frontends/xforms/FormVCLog.C index 3f4ec370fb..d0a4a0e017 100644 --- a/src/frontends/xforms/FormVCLog.C +++ b/src/frontends/xforms/FormVCLog.C @@ -20,8 +20,8 @@ #include "gettext.h" #include FORMS_H_LOCATION -FormVCLog::FormVCLog(ControlVCLog & c, Dialogs & d) - : FormCB(c, d, _("Version Control Log")) +FormVCLog::FormVCLog() + : FormCB(_("Version Control Log")) {} diff --git a/src/frontends/xforms/FormVCLog.h b/src/frontends/xforms/FormVCLog.h index e4ba01f1cd..9930964bfa 100644 --- a/src/frontends/xforms/FormVCLog.h +++ b/src/frontends/xforms/FormVCLog.h @@ -25,7 +25,7 @@ class ControlVCLog; class FormVCLog : public FormCB { public: /// - FormVCLog(ControlVCLog &, Dialogs &); + FormVCLog(); // Functions accessible to the Controller. diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 501531d7e2..0e8de0e828 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -89,11 +89,11 @@ Toolbar::Pimpl::toolbarItem::operator=(toolbarItem const & ti) -Toolbar::Pimpl::Pimpl(LyXView * o, Dialogs & d, int x, int y) +Toolbar::Pimpl::Pimpl(LyXView * o, int x, int y) : owner_(static_cast(o)), xpos(x), ypos(y) { combox_ = 0; - tooltip_ = new Tooltips(d); + tooltip_ = new Tooltips(); } diff --git a/src/frontends/xforms/Toolbar_pimpl.h b/src/frontends/xforms/Toolbar_pimpl.h index a872e8bd0a..9c712586ac 100644 --- a/src/frontends/xforms/Toolbar_pimpl.h +++ b/src/frontends/xforms/Toolbar_pimpl.h @@ -22,7 +22,6 @@ class XFormsView; class Tooltips; -class Dialogs; class Combox; /** The LyX xforms toolbar class @@ -33,7 +32,7 @@ public: static void layoutSelectedCB(int, void *, Combox *); /// create an empty toolbar - Pimpl(LyXView * o, Dialogs &, int x, int y); + Pimpl(LyXView * o, int x, int y); ~Pimpl(); diff --git a/src/frontends/xforms/Tooltips.C b/src/frontends/xforms/Tooltips.C index 255b40c123..e7125f8073 100644 --- a/src/frontends/xforms/Tooltips.C +++ b/src/frontends/xforms/Tooltips.C @@ -19,7 +19,6 @@ #endif #include "Tooltips.h" -#include "Dialogs.h" #include "xforms_helpers.h" // formatted #include "gettext.h" #include "support/lstrings.h" @@ -35,13 +34,8 @@ boost::signal0 Tooltips::toggled; #if FL_VERSION > 0 || FL_REVISION >= 89 -Tooltips::Tooltips(Dialogs & d) +Tooltips::Tooltips() { - static bool first = true; - if (first) { - first = false; - d.toggleTooltips.connect(boost::bind(&Tooltips::toggleEnabled)); - } toggled.connect(boost::bind(&Tooltips::set, this)); } diff --git a/src/frontends/xforms/Tooltips.h b/src/frontends/xforms/Tooltips.h index e6bcc0f637..213e5f2c2f 100644 --- a/src/frontends/xforms/Tooltips.h +++ b/src/frontends/xforms/Tooltips.h @@ -26,16 +26,14 @@ #include -class Dialogs; - - #ifdef __GNUG__ #pragma interface #endif class Tooltips : boost::noncopyable, public boost::signals::trackable { public: - Tooltips(Dialogs &); + /// + Tooltips(); /// Initialise a tooltip for this ob. void init(FL_OBJECT * ob, string const & tip); @@ -55,16 +53,16 @@ public: #endif -private: - - /// Are the tooltips on or off? - static bool enabled_; - /** This method is connected to Dialogs::toggleTooltips and toggles * the state of enabled_. */ static void toggleEnabled(); +private: + + /// Are the tooltips on or off? + static bool enabled_; + /** Once enabled_ is changed, then this signal is emitted to update * all the tooltips. */ diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index ea6a8929f9..eeb2776c8b 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -59,7 +59,7 @@ int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p) XFormsView::XFormsView(int width, int height) : LyXView() { - create_form_form_main(*getDialogs(), width, height); + create_form_form_main(width, height); fl_set_form_atclose(getForm(), C_XFormsView_atCloseMainFormCB, 0); view_state_con = view_state_changed.connect(boost::bind(&XFormsView::show_view_state, this)); @@ -125,7 +125,7 @@ void XFormsView::show(int x, int y, string const & title) } -void XFormsView::create_form_form_main(Dialogs & dia, int width, int height) +void XFormsView::create_form_form_main(int width, int height) /* to make this work as it should, .lyxrc should have been * read first; OR maybe this one should be made dynamic. * Hmmmm. Lgb. @@ -146,8 +146,7 @@ void XFormsView::create_form_form_main(Dialogs & dia, int width, int height) menubar_.reset(new Menubar(this, menubackend)); - toolbar_.reset(new Toolbar(this, dia, - air, 30 + air + bw, toolbardefaults)); + toolbar_.reset(new Toolbar(this, air, 30 + air + bw, toolbardefaults)); int const ywork = 60 + 2 * air + bw; int const workheight = height - ywork - (25 + 2 * air); diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index 6e8953ae34..e81ce2c7c8 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -20,7 +20,6 @@ #include "frontends/LyXView.h" -class Dialogs; class XMiniBuffer; /** @@ -70,7 +69,7 @@ private: void show_view_state(); /// makes the main form. - void create_form_form_main(Dialogs & d, int width, int height); + void create_form_form_main(int width, int height); /// the minibuffer boost::scoped_ptr minibuffer_; /// diff --git a/src/frontends/xforms/guiapi.C b/src/frontends/xforms/guiapi.C index 67941e52d5..170da9a79c 100644 --- a/src/frontends/xforms/guiapi.C +++ b/src/frontends/xforms/guiapi.C @@ -216,7 +216,7 @@ extern "C" { { static GUI cal(lv, d); - cal.show(); + cal.controller().show(); } @@ -224,7 +224,7 @@ extern "C" { { static GUI cbi(lv, d); - cbi.showInset(ic); + cbi.controller().showInset(ic); } @@ -232,31 +232,31 @@ extern "C" { { static GUI cbt(lv, d); - cbt.showInset(ic); + cbt.controller().showInset(ic); } void gui_ShowCharacter(LyXView & lv, Dialogs & d) { - controlCharacterSingleton.get(lv, d).show(); + controlCharacterSingleton.get(lv, d).controller().show(); } void gui_SetUserFreeFont(LyXView & lv, Dialogs & d) { - controlCharacterSingleton.get(lv, d).apply(); + controlCharacterSingleton.get(lv, d).controller().apply(); } void gui_ShowCitation(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlCitationSingleton.get(lv, d).showInset(ic); + controlCitationSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateCitation(string const & s, LyXView & lv, Dialogs & d) { - controlCitationSingleton.get(lv, d).createInset(s); + controlCitationSingleton.get(lv, d).controller().createInset(s); } @@ -271,19 +271,19 @@ extern "C" { { static GUI ce(lv, d); - ce.showInset(ie); + ce.controller().showInset(ie); } void gui_ShowERT(InsetERT * ie, LyXView & lv, Dialogs & d) { - controlERTSingleton.get(lv, d).showInset(ie); + controlERTSingleton.get(lv, d).controller().showInset(ie); } void gui_UpdateERT(InsetERT * ie, LyXView & lv, Dialogs & d) { - controlERTSingleton.get(lv, d).showInset(ie); + controlERTSingleton.get(lv, d).controller().showInset(ie); } @@ -291,7 +291,7 @@ extern "C" { { static GUI ce(lv, d); - ce.showInset(ie); + ce.controller().showInset(ie); } @@ -299,7 +299,7 @@ extern "C" { { static GUI csf(lv, d); - csf.showFile(f); + csf.controller().showFile(f); } @@ -307,7 +307,7 @@ extern "C" { { static GUI cf(lv, d); - cf.showInset(ifl); + cf.controller().showInset(ifl); } @@ -315,7 +315,7 @@ extern "C" { { static GUI cf(lv, d); - cf.show(); + cf.controller().show(); } @@ -323,7 +323,7 @@ extern "C" { { static GUI cg(lv, d); - cg.showInset(ig); + cg.controller().showInset(ig); } @@ -331,19 +331,19 @@ extern "C" { { static GUI ci(lv, d); - ci.showInset(ii); + ci.controller().showInset(ii); } void gui_ShowIndex(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlIndexSingleton.get(lv, d).showInset(ic); + controlIndexSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateIndex(LyXView & lv, Dialogs & d) { - controlIndexSingleton.get(lv, d).createInset(""); + controlIndexSingleton.get(lv, d).controller().createInset(""); } @@ -358,7 +358,7 @@ extern "C" { { static GUI cl(lv, d); - cl.show(); + cl.controller().show(); } @@ -371,13 +371,13 @@ extern "C" { void gui_ShowMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) { - controlMinipageSingleton.get(lv, d).showInset(im); + controlMinipageSingleton.get(lv, d).controller().showInset(im); } void gui_UpdateMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) { - controlMinipageSingleton.get(lv, d).showInset(im); + controlMinipageSingleton.get(lv, d).controller().showInset(im); } @@ -385,7 +385,7 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } @@ -407,7 +407,7 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } @@ -421,19 +421,19 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } void gui_ShowRef(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlRefSingleton.get(lv, d).showInset(ic); + controlRefSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateRef(string const & s, LyXView & lv, Dialogs & d) { - controlRefSingleton.get(lv, d).createInset(s); + controlRefSingleton.get(lv, d).controller().createInset(s); } @@ -441,7 +441,7 @@ extern "C" { { static GUI cs(lv, d); - cs.show(); + cs.controller().show(); } @@ -449,7 +449,7 @@ extern "C" { { static GUI cs(lv, d); - cs.show(); + cs.controller().show(); } @@ -457,7 +457,7 @@ extern "C" { { static GUI cp(lv, d); - cp.show(); + cp.controller().show(); } @@ -477,7 +477,7 @@ extern "C" { { static GUI ctc(lv, d); - ctc.show(); + ctc.controller().show(); } @@ -485,7 +485,7 @@ extern "C" { { static GUI ct(lv, d); - ct.show(); + ct.controller().show(); } @@ -495,7 +495,7 @@ extern "C" { { static GUI ct(lv, d); - ct.showEntry(s); + ct.controller().showEntry(s); } #else @@ -508,25 +508,25 @@ extern "C" { void gui_ShowTOC(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlTocSingleton.get(lv, d).showInset(ic); + controlTocSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateTOC(string const & s, LyXView & lv, Dialogs & d) { - controlTocSingleton.get(lv, d).createInset(s); + controlTocSingleton.get(lv, d).controller().createInset(s); } void gui_ShowUrl(InsetCommand * ic, LyXView & lv, Dialogs & d) { - controlUrlSingleton.get(lv, d).showInset(ic); + controlUrlSingleton.get(lv, d).controller().showInset(ic); } void gui_CreateUrl(string const & s, LyXView & lv, Dialogs & d) { - controlUrlSingleton.get(lv, d).createInset(s); + controlUrlSingleton.get(lv, d).controller().createInset(s); } @@ -534,7 +534,7 @@ extern "C" { { static GUI cv(lv, d); - cv.show(); + cv.controller().show(); } } // extern "C"