Use this if you want to. Lgb
? build Index: po/POTFILES.in =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v retrieving revision 1.120.4.7 diff -u -p -r1.120.4.7 POTFILES.in --- po/POTFILES.in 2001/03/02 15:45:11 1.120.4.7 +++ po/POTFILES.in 2001/03/03 09:31:56 @@ -71,47 +71,47 @@ src/frontends/qt2/FormPrint.C src/frontends/qt2/FormTabularCreate.C src/frontends/qt2/paragraphdlgimpl.C src/frontends/qt2/tabularcreatedlgimpl.C -src/frontends/xforms/FormBibitem.C src/frontends/xforms/form_bibitem.C -src/frontends/xforms/FormBibtex.C +src/frontends/xforms/FormBibitem.C src/frontends/xforms/form_bibtex.C +src/frontends/xforms/FormBibtex.C src/frontends/xforms/form_browser.C -src/frontends/xforms/FormCharacter.C src/frontends/xforms/form_character.C -src/frontends/xforms/FormCitation.C +src/frontends/xforms/FormCharacter.C src/frontends/xforms/form_citation.C -src/frontends/xforms/FormCopyright.C +src/frontends/xforms/FormCitation.C src/frontends/xforms/form_copyright.C -src/frontends/xforms/FormDocument.C +src/frontends/xforms/FormCopyright.C src/frontends/xforms/form_document.C -src/frontends/xforms/FormError.C +src/frontends/xforms/FormDocument.C src/frontends/xforms/form_error.C -src/frontends/xforms/FormGraphics.C +src/frontends/xforms/FormError.C src/frontends/xforms/form_graphics.C -src/frontends/xforms/FormInclude.C +src/frontends/xforms/FormGraphics.C src/frontends/xforms/form_include.C -src/frontends/xforms/FormIndex.C +src/frontends/xforms/FormInclude.C src/frontends/xforms/form_index.C +src/frontends/xforms/FormIndex.C src/frontends/xforms/FormLog.C -src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_paragraph.C -src/frontends/xforms/FormPreamble.C +src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_preamble.C -src/frontends/xforms/FormPreferences.C +src/frontends/xforms/FormPreamble.C src/frontends/xforms/form_preferences.C -src/frontends/xforms/FormPrint.C +src/frontends/xforms/FormPreferences.C src/frontends/xforms/form_print.C -src/frontends/xforms/FormRef.C +src/frontends/xforms/FormPrint.C src/frontends/xforms/form_ref.C +src/frontends/xforms/FormRef.C src/frontends/xforms/FormSplash.C -src/frontends/xforms/FormTabular.C src/frontends/xforms/form_tabular.C -src/frontends/xforms/FormTabularCreate.C +src/frontends/xforms/FormTabular.C src/frontends/xforms/form_tabular_create.C -src/frontends/xforms/FormToc.C +src/frontends/xforms/FormTabularCreate.C src/frontends/xforms/form_toc.C -src/frontends/xforms/FormUrl.C +src/frontends/xforms/FormToc.C src/frontends/xforms/form_url.C +src/frontends/xforms/FormUrl.C src/frontends/xforms/FormVCLog.C src/frontends/xforms/input_validators.C src/frontends/xforms/Menubar_pimpl.C Index: src/frontends/DialogBase.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/DialogBase.h,v retrieving revision 1.7.8.1 diff -u -p -r1.7.8.1 DialogBase.h --- src/frontends/DialogBase.h 2001/02/19 17:46:22 1.7.8.1 +++ src/frontends/DialogBase.h 2001/03/03 09:31:57 @@ -40,7 +40,7 @@ class DialogBase : public Object, public public: /**@name Constructors and Deconstructors */ //@{ - /// + /// Virtual base destructor virtual ~DialogBase() {} //@} Index: src/frontends/Dialogs.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/Dialogs.h,v retrieving revision 1.19.8.2 diff -u -p -r1.19.8.2 Dialogs.h --- src/frontends/Dialogs.h 2001/02/27 12:44:00 1.19.8.2 +++ src/frontends/Dialogs.h 2001/03/03 09:32:01 @@ -24,6 +24,10 @@ #include "LString.h" #include <boost/utility.hpp> +#ifdef __GNUG__ +#pragma interface +#endif + class DialogBase; // Maybe this should be a UIFunc modelled on LyXFunc Index: src/frontends/xforms/Color.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Color.C,v retrieving revision 1.5 diff -u -p -r1.5 Color.C --- src/frontends/xforms/Color.C 2000/11/21 15:46:10 1.5 +++ src/frontends/xforms/Color.C 2001/03/03 09:32:04 @@ -10,14 +10,16 @@ *======================================================*/ #include <config.h> + +#include <algorithm> // max +#include <cmath> // floor + #include FORMS_H_LOCATION #ifdef __GNUG_ #pragma implementation #endif -#include <algorithm> // max -#include <cmath> // floor #include "Color.h" using std::max; Index: src/frontends/xforms/Dialogs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Dialogs.C,v retrieving revision 1.20.8.4 diff -u -p -r1.20.8.4 Dialogs.C --- src/frontends/xforms/Dialogs.C 2001/02/27 12:44:01 1.20.8.4 +++ src/frontends/xforms/Dialogs.C 2001/03/03 09:32:06 @@ -10,8 +10,12 @@ */ #include <config.h> - #include FORMS_H_LOCATION + +#ifdef __GNUG__ +#pragma implementation +#endif + #include "Dialogs.h" #include "ControlCitation.h" @@ -20,6 +24,7 @@ #include "FormBibitem.h" #include "FormBibtex.h" #include "FormCitation.h" +#include "form_citation.h" #include "FormCharacter.h" #include "FormCopyright.h" #include "FormDocument.h" @@ -39,10 +44,6 @@ #include "FormToc.h" #include "FormUrl.h" #include "FormVCLog.h" - -#ifdef __GNUG__ -#pragma implementation -#endif // temporary till ported extern void ShowCredits(); Index: src/frontends/xforms/FormBase.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBase.C,v retrieving revision 1.17.8.4 diff -u -p -r1.17.8.4 FormBase.C --- src/frontends/xforms/FormBase.C 2001/03/02 15:45:14 1.17.8.4 +++ src/frontends/xforms/FormBase.C 2001/03/03 09:32:06 @@ -9,12 +9,12 @@ * ====================================================== */ +#include <config.h> + #ifdef __GNUG__ #pragma implementation #endif -#include <config.h> - #include "Dialogs.h" #include "FormBase.h" #include "xformsBC.h" @@ -24,7 +24,7 @@ extern "C" int C_FormBaseWMHideCB(FL_FOR FormBase::FormBase(ControlBase & c, string const & t) - : ViewBC<xformsBC>(c), minw_(0), minh_(0), title(t) + : ViewBC<xformsBC>(c), minw_(0), minh_(0), title_(t) {} @@ -64,7 +64,7 @@ void FormBase::show() fl_set_form_minsize(form(), minw_, minh_); fl_show_form(form(), FL_PLACE_MOUSE | FL_FREE_SIZE, 0, - title.c_str()); + title_.c_str()); } } Index: src/frontends/xforms/FormBase.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBase.h,v retrieving revision 1.18.8.3 diff -u -p -r1.18.8.3 FormBase.h --- src/frontends/xforms/FormBase.h 2001/02/27 12:44:01 1.18.8.3 +++ src/frontends/xforms/FormBase.h 2001/03/03 09:32:09 @@ -14,14 +14,14 @@ #ifndef FORMBASE_H #define FORMBASE_H -#ifdef __GNUG__ -#pragma interface -#endif - #include FORMS_H_LOCATION // Can't forward-declare FL_FORM #include "ViewBase.h" #include "LString.h" +#ifdef __GNUG__ +#pragma interface +#endif + class xformsBC; /** This class is an XForms GUI base class. @@ -64,9 +64,6 @@ protected: private: /// dialog title, displayed by WM. - string title; - + string title_; }; - - #endif // FORMBASE_H Index: src/frontends/xforms/FormBibitem.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBibitem.C,v retrieving revision 1.2.4.2 diff -u -p -r1.2.4.2 FormBibitem.C --- src/frontends/xforms/FormBibitem.C 2001/03/02 13:17:51 1.2.4.2 +++ src/frontends/xforms/FormBibitem.C 2001/03/03 09:32:09 @@ -27,22 +27,15 @@ using std::endl; FormBibitem::FormBibitem(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Bibliography Entry")), - dialog_(0) + : FormCommand(lv, d, _("Bibliography Entry")) { d->showBibitem.connect(slot(this, &FormBibitem::showInset)); } -FormBibitem::~FormBibitem() -{ - delete dialog_; -} - - FL_FORM * FormBibitem::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -57,7 +50,7 @@ void FormBibitem::connect() void FormBibitem::build() { - dialog_ = build_bibitem(); + dialog_.reset(build_bibitem()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormBibitem.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBibitem.h,v retrieving revision 1.1.6.2 diff -u -p -r1.1.6.2 FormBibitem.h --- src/frontends/xforms/FormBibitem.h 2001/03/02 13:17:51 1.1.6.2 +++ src/frontends/xforms/FormBibitem.h 2001/03/03 09:32:09 @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormBibitem.h * Copyright 2001 the LyX Team @@ -10,12 +11,15 @@ #ifndef FORMBIBITEM_H #define FORMBIBITEM_H +#include <boost/smart_ptr.hpp> + +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" struct FD_form_bibitem; /** @@ -25,11 +29,9 @@ class FormBibitem : public FormCommand { public: /// FormBibitem(LyXView *, Dialogs *); - /// - ~FormBibitem(); private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Build the dialog @@ -45,9 +47,15 @@ private: /// FD_form_bibitem * build_bibitem(); /// Real GUI implementation. - FD_form_bibitem * dialog_; + boost::scoped_ptr<FD_form_bibitem> dialog_; /// The ButtonController ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormBibitem::bc() +{ + return bc_; +} #endif // FORMBIBITEM_H Index: src/frontends/xforms/FormBibtex.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBibtex.C,v retrieving revision 1.2.4.2 diff -u -p -r1.2.4.2 FormBibtex.C --- src/frontends/xforms/FormBibtex.C 2001/03/02 13:17:51 1.2.4.2 +++ src/frontends/xforms/FormBibtex.C 2001/03/03 09:32:09 @@ -27,22 +27,15 @@ using std::endl; FormBibtex::FormBibtex(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("BibTeX Database")), - dialog_(0) + : FormCommand(lv, d, _("BibTeX Database")) { d->showBibtex.connect(slot(this, &FormBibtex::showInset)); } -FormBibtex::~FormBibtex() -{ - delete dialog_; -} - - FL_FORM * FormBibtex::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -57,7 +50,7 @@ void FormBibtex::connect() void FormBibtex::build() { - dialog_ = build_bibtex(); + dialog_.reset(build_bibtex()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormBibtex.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBibtex.h,v retrieving revision 1.1.6.2 diff -u -p -r1.1.6.2 FormBibtex.h --- src/frontends/xforms/FormBibtex.h 2001/03/02 13:17:51 1.1.6.2 +++ src/frontends/xforms/FormBibtex.h 2001/03/03 09:32:10 @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormBibtex.h * Copyright 2001 the LyX Team @@ -10,12 +11,15 @@ #ifndef FORMBIBTEX_H #define FORMBIBTEX_H +#include <boost/smart_ptr.hpp> + +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" struct FD_form_bibtex; /** @@ -25,11 +29,9 @@ class FormBibtex : public FormCommand { public: /// FormBibtex(LyXView *, Dialogs *); - /// - ~FormBibtex(); private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Build the dialog @@ -45,9 +47,15 @@ private: /// FD_form_bibtex * build_bibtex(); /// Real GUI implementation. - FD_form_bibtex * dialog_; + boost::scoped_ptr<FD_form_bibtex> dialog_; /// The ButtonController ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormBibtex::bc() +{ + return bc_; +} #endif // FORMBIBTEX_H Index: src/frontends/xforms/FormBrowser.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBrowser.C,v retrieving revision 1.3.6.2 diff -u -p -r1.3.6.2 FormBrowser.C --- src/frontends/xforms/FormBrowser.C 2001/03/02 13:17:51 1.3.6.2 +++ src/frontends/xforms/FormBrowser.C 2001/03/03 09:32:10 @@ -24,19 +24,13 @@ using SigC::slot; #endif FormBrowser::FormBrowser(LyXView * lv, Dialogs * d, const string & name) - : FormBaseBD(lv, d, name), - dialog_(0) -{ -} + : FormBaseBD(lv, d, name) +{} -FormBrowser::~FormBrowser() -{ - delete dialog_; -} void FormBrowser::build() { - dialog_ = build_browser(); + dialog_.reset(build_browser()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -47,16 +41,17 @@ void FormBrowser::build() bc().refresh(); } + FL_FORM * FormBrowser::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } void FormBrowser::update() -{ -} +{} + bool FormBrowser::input(FL_OBJECT *, long) { Index: src/frontends/xforms/FormBrowser.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBrowser.h,v retrieving revision 1.1.6.3 diff -u -p -r1.1.6.3 FormBrowser.h --- src/frontends/xforms/FormBrowser.h 2001/03/02 13:17:51 1.1.6.3 +++ src/frontends/xforms/FormBrowser.h 2001/03/03 09:32:10 @@ -9,12 +9,15 @@ #ifndef FORMBROWSER_H #define FORMBROWSER_H +#include <boost/smart_ptr.hpp> + +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormBaseDeprecated.h" -#include "xformsBC.h" class LyXView; class Dialogs; struct FD_form_browser; @@ -25,18 +28,16 @@ struct FD_form_browser; */ class FormBrowser : public FormBaseBD { public: + /// FormBrowser(LyXView *, Dialogs *, const string &); - ~FormBrowser(); - protected: /// Update the dialog. virtual void update(); /// Real GUI implementation. - FD_form_browser * dialog_; + boost::scoped_ptr<FD_form_browser> dialog_; /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } - + virtual xformsBC & bc(); private: /// Pointer to the actual instantiation of the xform's form virtual FL_FORM * form() const; @@ -51,4 +52,10 @@ private: ButtonController<OkCancelPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormBrowser::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormCharacter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormCharacter.C,v retrieving revision 1.2.2.2 diff -u -p -r1.2.2.2 FormCharacter.C --- src/frontends/xforms/FormCharacter.C 2001/03/02 13:17:51 1.2.2.2 +++ src/frontends/xforms/FormCharacter.C 2001/03/03 09:32:10 @@ -8,12 +8,12 @@ #include <config.h> +#include FORMS_H_LOCATION + #ifdef __GNUG_ #pragma implementation #endif -#include FORMS_H_LOCATION - #include "FormCharacter.h" #include "form_character.h" #include "bufferview_funcs.h" @@ -31,8 +31,7 @@ using Liason::setMinibuffer; FormCharacter::FormCharacter(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Character Layout")), - dialog_(0), combo_language2_(0) + : FormBaseBD(lv, d, _("Character Layout")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -43,17 +42,9 @@ FormCharacter::FormCharacter(LyXView * l } -FormCharacter::~FormCharacter() -{ - // This must be done before the deletion of the dialog. - delete combo_language2_; - delete dialog_; -} - - FL_FORM * FormCharacter::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -61,7 +52,7 @@ FL_FORM * FormCharacter::form() const void FormCharacter::build() { - dialog_ = build_character(); + dialog_.reset(build_character()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; @@ -93,7 +84,7 @@ void FormCharacter::build() // insert default language box manually fl_addto_form(dialog_->form); FL_OBJECT * ob = dialog_->choice_language; - combo_language2_ = new Combox(FL_COMBOX_DROPLIST); + combo_language2_.reset(new Combox(FL_COMBOX_DROPLIST)); combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250); combo_language2_->shortcut("#L", 1); fl_end_form(); @@ -110,7 +101,7 @@ void FormCharacter::build() void FormCharacter::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; LyXFont font(LyXFont::ALL_IGNORE); @@ -212,7 +203,7 @@ void FormCharacter::apply() void FormCharacter::update() { - if (!dialog_) + if (!dialog_.get()) return; bc().readOnly(lv_->buffer()->isReadonly()); Index: src/frontends/xforms/FormCharacter.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormCharacter.h,v retrieving revision 1.2.2.2 diff -u -p -r1.2.2.2 FormCharacter.h --- src/frontends/xforms/FormCharacter.h 2001/03/02 13:17:51 1.2.2.2 +++ src/frontends/xforms/FormCharacter.h 2001/03/03 09:32:10 @@ -10,13 +10,15 @@ #ifndef FORM_CHARACTER_H #define FORM_CHARACTER_H -#ifdef __GNUG_ -#pragma interface -#endif +#include <boost/smart_ptr.hpp> #include "FormBaseDeprecated.h" #include "xformsBC.h" +#ifdef __GNUG_ +#pragma interface +#endif + class LyXView; class Dialogs; class Combox; @@ -31,13 +33,10 @@ class FormCharacter : public FormBaseBD public: /// FormCharacter(LyXView *, Dialogs *); - /// - ~FormCharacter(); - private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Build the popup virtual void build(); @@ -51,15 +50,23 @@ private: /// Pointer to the actual instantiation of the xform's form virtual FL_FORM * form() const; + /// FD_form_character * build_character(); /// Real GUI implementation. - FD_form_character * dialog_; - - Combox * combo_language2_; + boost::scoped_ptr<FD_form_character> dialog_; + /// + boost::scoped_ptr<Combox> combo_language2_; + /// The ButtonController ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormCharacter::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormCitation.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormCitation.C,v retrieving revision 1.28.8.5 diff -u -p -r1.28.8.5 FormCitation.C --- src/frontends/xforms/FormCitation.C 2001/03/02 15:45:14 1.28.8.5 +++ src/frontends/xforms/FormCitation.C 2001/03/03 09:32:15 @@ -9,13 +9,14 @@ * ====================================================== */ +#include <config.h> + +#include <algorithm> + #ifdef __GNUG__ #pragma implementation #endif -#include <config.h> - -#include <algorithm> #include "ControlCitation.h" #include "FormCitation.h" #include "form_citation.h" @@ -32,16 +33,10 @@ using std::sort; using std::vector; FormCitation::FormCitation(ControlCitation & c) - : FormBase(c, _("Citation")), dialog_(0) + : FormBase(c, _("Citation")) {} -FormCitation::~FormCitation() -{ - delete dialog_; -} - - ControlCitation & FormCitation::controller() const { return static_cast<ControlCitation &>(controller_); @@ -51,7 +46,7 @@ ControlCitation & FormCitation::controll FL_FORM * FormCitation::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -85,7 +80,7 @@ void FormCitation::hide() void FormCitation::build() { - dialog_ = build_citation(); + dialog_.reset(build_citation()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormCitation.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormCitation.h,v retrieving revision 1.19.8.3 diff -u -p -r1.19.8.3 FormCitation.h --- src/frontends/xforms/FormCitation.h 2001/02/27 12:44:01 1.19.8.3 +++ src/frontends/xforms/FormCitation.h 2001/03/03 09:32:15 @@ -14,28 +14,27 @@ #ifndef FORMCITATION_H #define FORMCITATION_H -#ifdef __GNUG__ -#pragma interface -#endif - #include FORMS_H_LOCATION // Can't forward-declare FL_FORM #include <vector> +#include <boost/smart_ptr.hpp> + #include "FormBase.h" +#ifdef __GNUG__ +#pragma interface +#endif + class ControlCitation; class FD_form_citation; /** This class provides an XForms implementation of the Citation Dialog. */ -class FormCitation : public FormBase -{ +class FormCitation : public FormBase { public: /// FormCitation(ControlCitation &); - /// - ~FormCitation(); - /// Functions accessible to the Controller. + // Functions accessible to the Controller. /// Set the Params variable for the Controller. virtual void apply(); @@ -76,7 +75,7 @@ private: void setSize(int, bool) const; /// Real GUI implementation. - FD_form_citation * dialog_; + boost::scoped_ptr<FD_form_citation> dialog_; /// std::vector<string> citekeys; Index: src/frontends/xforms/FormCopyright.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormCopyright.C,v retrieving revision 1.16.8.1 diff -u -p -r1.16.8.1 FormCopyright.C --- src/frontends/xforms/FormCopyright.C 2001/03/02 13:17:51 1.16.8.1 +++ src/frontends/xforms/FormCopyright.C 2001/03/03 09:32:15 @@ -17,8 +17,7 @@ #include "xform_helpers.h" FormCopyright::FormCopyright( LyXView * lv, Dialogs * d ) - : FormBaseBI(lv, d, _("Copyright and Warranty")), - dialog_(0) + : FormBaseBI(lv, d, _("Copyright and Warranty")) { // let the dialog be shown // This is a permanent connection so we won't bother @@ -27,22 +26,16 @@ FormCopyright::FormCopyright( LyXView * } -FormCopyright::~FormCopyright() -{ - delete dialog_; -} - - FL_FORM * FormCopyright::form() const { - if (dialog_ ) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } void FormCopyright::build() { - dialog_ = build_copyright(); + dialog_.reset(build_copyright()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormCopyright.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormCopyright.h,v retrieving revision 1.11.8.2 diff -u -p -r1.11.8.2 FormCopyright.h --- src/frontends/xforms/FormCopyright.h 2001/03/02 13:17:51 1.11.8.2 +++ src/frontends/xforms/FormCopyright.h 2001/03/03 09:32:15 @@ -17,12 +17,15 @@ #ifndef FORMCOPYRIGHT_H #define FORMCOPYRIGHT_H +#include <boost/smart_ptr.hpp> + +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormBaseDeprecated.h" -#include "xformsBC.h" struct FD_form_copyright; /** This class provides an XForms implementation of the FormCopyright Dialog. @@ -31,12 +34,9 @@ class FormCopyright : public FormBaseBI public: /// #FormCopyright x(LyXFunc ..., Dialogs ...);# FormCopyright(LyXView *, Dialogs *); - /// - ~FormCopyright(); - private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// Pointer to the actual instantiation of the xform's form @@ -45,10 +45,16 @@ private: FD_form_copyright * build_copyright(); /// Real GUI implementation. - FD_form_copyright * dialog_; + boost::scoped_ptr<FD_form_copyright> dialog_; /// The ButtonController ButtonController<OkCancelPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormCopyright::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormDocument.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormDocument.C,v retrieving revision 1.35.8.3 diff -u -p -r1.35.8.3 FormDocument.C --- src/frontends/xforms/FormDocument.C 2001/03/02 13:17:51 1.35.8.3 +++ src/frontends/xforms/FormDocument.C 2001/03/03 09:32:25 @@ -11,13 +11,14 @@ #include <config.h> +#include FORMS_H_LOCATION +#include XPM_H_LOCATION + #ifdef __GNUG_ #pragma implementation #endif #include "lyx_gui_misc.h" -#include FORMS_H_LOCATION -#include XPM_H_LOCATION #include "FormDocument.h" #include "form_document.h" @@ -45,10 +46,7 @@ using Liason::setMinibuffer; #define USE_CLASS_COMBO 1 FormDocument::FormDocument(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Document Layout")), - dialog_(0), paper_(0), class_(0), language_(0), options_(0), - bullets_(0), current_bullet_panel(0), current_bullet_depth(0), - fbullet(0), combo_language(0), combo_doc_class(0) + : FormBaseBD(lv, d, _("Document Layout")), fbullet(0) { // let the popup be shown // This is a permanent connection so we won't bother @@ -57,21 +55,6 @@ FormDocument::FormDocument(LyXView * lv, } -FormDocument::~FormDocument() -{ -#ifdef USE_CLASS_COMBO - delete combo_doc_class; -#endif - delete class_; - delete paper_; - delete combo_language; - delete language_; - delete options_; - delete bullets_; - delete dialog_; -} - - void FormDocument::redraw() { if( form() && form()->visible ) @@ -87,7 +70,7 @@ void FormDocument::redraw() FL_FORM * FormDocument::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -97,7 +80,7 @@ void FormDocument::build() int n; // the tabbed folder - dialog_ = build_tabbed_document(); + dialog_.reset(build_tabbed_document()); // Manage the restore, ok, apply, restore and cancel/close buttons bc().setOK(dialog_->button_ok); @@ -111,7 +94,7 @@ void FormDocument::build() minh_ = form()->h; // the document paper form - paper_ = build_doc_paper(); + paper_.reset(build_doc_paper()); fl_addto_choice(paper_->choice_papersize2, _(" Default | Custom | USletter | USlegal " "| USexecutive | A3 | A4 | A5 | B3 | B4 | B5 ")); @@ -147,7 +130,7 @@ void FormDocument::build() bc().addReadOnly (paper_->input_foot_skip); // the document class form - class_ = build_doc_class(); + class_.reset(build_doc_class()); FL_OBJECT * obj; #ifdef USE_CLASS_COMBO @@ -155,7 +138,7 @@ void FormDocument::build() obj = class_->choice_doc_class; fl_deactivate_object(obj); fl_addto_form(class_->form); - combo_doc_class = new Combox(FL_COMBOX_DROPLIST); + combo_doc_class.reset(new Combox(FL_COMBOX_DROPLIST)); combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400, dialog_->tabbed_folder); combo_doc_class->shortcut("#C",1); @@ -207,7 +190,7 @@ void FormDocument::build() bc().addReadOnly (class_->input_doc_spacing); // the document language form - language_ = build_doc_language(); + language_.reset(build_doc_language()); fl_addto_choice(language_->choice_inputenc, "default|auto|latin1|latin2|latin5" "|koi8-r|koi8-u|cp866|cp1251|iso88595"); @@ -216,7 +199,7 @@ void FormDocument::build() obj = language_->choice_language; fl_deactivate_object(obj); fl_addto_form(language_->form); - combo_language = new Combox(FL_COMBOX_DROPLIST); + combo_language.reset(new Combox(FL_COMBOX_DROPLIST)); combo_language->add(obj->x, obj->y, obj->w, obj->h, 400, dialog_->tabbed_folder); combo_language->shortcut("#L",1); @@ -235,7 +218,7 @@ void FormDocument::build() bc().addReadOnly (language_->choice_inputenc); // the document options form - options_ = build_doc_options(); + options_.reset(build_doc_options()); fl_set_input_return(options_->input_float_placement, FL_RETURN_CHANGED); fl_set_counter_bounds(options_->slider_secnumdepth,-2,5); fl_set_counter_bounds(options_->slider_tocdepth,-1,5); @@ -254,7 +237,7 @@ void FormDocument::build() bc().addReadOnly (options_->choice_postscript_driver); // the document bullets form - bullets_ = build_doc_bullet(); + bullets_.reset(build_doc_bullet()); fl_addto_choice(bullets_->choice_bullet_size, _(" default | tiny | script | footnote | small |" " normal | large | Large | LARGE | huge | Huge")); @@ -288,7 +271,7 @@ void FormDocument::build() void FormDocument::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; bool redo = class_apply(); @@ -319,7 +302,7 @@ void FormDocument::cancel() void FormDocument::update() { - if (!dialog_) + if (!dialog_.get()) return; checkReadOnly(); @@ -387,7 +370,7 @@ bool FormDocument::input( FL_OBJECT * ob void FormDocument::ComboInputCB(int, void * v, Combox * combox) { FormDocument * pre = static_cast<FormDocument*>(v); - if (combox == pre->combo_doc_class) + if (combox == pre->combo_doc_class.get()) pre->CheckChoiceClass(0, 0); pre->bc().valid(pre->CheckDocumentInput(0,0)); } @@ -635,7 +618,7 @@ void FormDocument::bullets_apply() void FormDocument::class_update(BufferParams const & params) { - if (!class_) + if (!class_.get()) return; LyXTextClass const & tclass = textclasslist.TextClass(params.textclass); @@ -730,7 +713,7 @@ void FormDocument::class_update(BufferPa void FormDocument::language_update(BufferParams const & params) { - if (!language_) + if (!language_.get()) return; combo_language->select_text(params.language->lang()); @@ -747,7 +730,7 @@ void FormDocument::language_update(Buffe void FormDocument::options_update(BufferParams const & params) { - if (!options_) + if (!options_.get()) return; fl_set_choice_text(options_->choice_postscript_driver, @@ -765,7 +748,7 @@ void FormDocument::options_update(Buffer void FormDocument::paper_update(BufferParams const & params) { - if (!paper_) + if (!paper_.get()) return; fl_set_choice(paper_->choice_papersize2, params.papersize2 + 1); @@ -792,7 +775,7 @@ void FormDocument::paper_update(BufferPa void FormDocument::bullets_update(BufferParams const & params) { - if (!bullets_ || ((XpmVersion<4) || (XpmVersion==4 && XpmRevision<7))) + if (!bullets_.get() || ((XpmVersion<4) || (XpmVersion==4 && XpmRevision<7))) return; if (lv_->buffer()->isLinuxDoc()) { @@ -1116,7 +1099,7 @@ void FormDocument::CheckChoiceClass(FL_O void FormDocument::UpdateLayoutDocument(BufferParams const & params) { - if (!dialog_) + if (!dialog_.get()) return; checkReadOnly(); Index: src/frontends/xforms/FormDocument.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormDocument.h,v retrieving revision 1.14.8.2 diff -u -p -r1.14.8.2 FormDocument.h --- src/frontends/xforms/FormDocument.h 2001/03/02 13:17:51 1.14.8.2 +++ src/frontends/xforms/FormDocument.h 2001/03/03 09:32:25 @@ -13,14 +13,15 @@ #ifndef FORM_DOCUMENT_H #define FORM_DOCUMENT_H -#ifdef __GNUG_ -#pragma interface -#endif - #include <vector> +#include <boost/smart_ptr.hpp> #include "FormBaseDeprecated.h" #include "xformsBC.h" +#ifdef __GNUG_ +#pragma interface +#endif + class LyXView; class Dialogs; class Combox; @@ -42,10 +43,7 @@ public: /// #FormDocument x(Communicator ..., Popups ...);# FormDocument(LyXView *, Dialogs *); /// - ~FormDocument(); - /// static void ComboInputCB(int, void *, Combox *); - private: /// enum State { @@ -81,7 +79,7 @@ private: BULLETBMTABLE }; /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /** Redraw the form (on receipt of a Signal indicating, for example, that the xform colours have been re-mapped). */ virtual void redraw(); @@ -156,17 +154,17 @@ private: FD_form_doc_bullet * build_doc_bullet(); /// Real GUI implementation. - FD_form_tabbed_document * dialog_; + boost::scoped_ptr<FD_form_tabbed_document> dialog_; /// - FD_form_doc_paper * paper_; + boost::scoped_ptr<FD_form_doc_paper> paper_; /// - FD_form_doc_class * class_; + boost::scoped_ptr<FD_form_doc_class> class_; /// - FD_form_doc_language * language_; + boost::scoped_ptr<FD_form_doc_language> language_; /// - FD_form_doc_options * options_; + boost::scoped_ptr<FD_form_doc_options> options_; /// - FD_form_doc_bullet * bullets_; + boost::scoped_ptr<FD_form_doc_bullet> bullets_; /// int ActCell; /// @@ -178,11 +176,18 @@ private: /// FL_OBJECT * fbullet; /// - Combox * combo_language; + boost::scoped_ptr<Combox> combo_language; /// - Combox * combo_doc_class; + boost::scoped_ptr<Combox> combo_doc_class; /// The ButtonController ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_; }; + + +inline +xformsBC & FormDocument::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormError.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormError.C,v retrieving revision 1.14.8.2 diff -u -p -r1.14.8.2 FormError.C --- src/frontends/xforms/FormError.C 2001/03/02 13:17:51 1.14.8.2 +++ src/frontends/xforms/FormError.C 2001/03/03 09:32:30 @@ -24,7 +24,7 @@ FormError::FormError(LyXView * lv, Dialogs * d) : FormInset( lv, d, _("LaTeX Error")), - dialog_(0), inset_(0) + inset_(0) { Assert(lv && d); // let the dialog be shown @@ -34,15 +34,9 @@ FormError::FormError(LyXView * lv, Dialo } -FormError::~FormError() -{ - delete dialog_; -} - - FL_FORM * FormError::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -78,7 +72,7 @@ void FormError::update() void FormError::build() { - dialog_ = build_error(); + dialog_.reset(build_error()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormError.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormError.h,v retrieving revision 1.9.8.1 diff -u -p -r1.9.8.1 FormError.h --- src/frontends/xforms/FormError.h 2001/03/02 13:17:51 1.9.8.1 +++ src/frontends/xforms/FormError.h 2001/03/03 09:32:30 @@ -12,13 +12,14 @@ #ifndef FORMERROR_H #define FORMERROR_H +#include <boost/smart_ptr.hpp> +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" - class InsetError; struct FD_form_error; @@ -28,11 +29,9 @@ class FormError : public FormInset { public: /// Constructor FormError(LyXView *, Dialogs *); - /// - ~FormError(); private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Disconnect signals. Also perform any necessary housekeeping. virtual void disconnect(); @@ -48,7 +47,7 @@ private: FD_form_error * build_error(); /// Real GUI implementation. - FD_form_error * dialog_; + boost::scoped_ptr<FD_form_error> dialog_; /// pointer to the inset passed through showInset InsetError * inset_; /// the error message @@ -57,4 +56,10 @@ private: ButtonController<OkCancelPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormError::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormGraphics.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormGraphics.C,v retrieving revision 1.15.8.2 diff -u -p -r1.15.8.2 FormGraphics.C --- src/frontends/xforms/FormGraphics.C 2001/03/02 13:17:51 1.15.8.2 +++ src/frontends/xforms/FormGraphics.C 2001/03/03 09:32:31 @@ -56,6 +56,7 @@ FormGraphics::~FormGraphics() // Free the form. // delete dialog_; +#warning where is the dialog_ deleted? (Lgb) } Index: src/frontends/xforms/FormGraphics.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormGraphics.h,v retrieving revision 1.11.8.1 diff -u -p -r1.11.8.1 FormGraphics.h --- src/frontends/xforms/FormGraphics.h 2001/03/02 13:17:51 1.11.8.1 +++ src/frontends/xforms/FormGraphics.h 2001/03/03 09:32:31 @@ -16,16 +16,16 @@ #ifndef FORMGRAPHICS_H #define FORMGRAPHICS_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "LString.h" #include "RadioButtonGroup.h" #include "ButtonPolicies.h" #include "FormInset.h" #include "xformsBC.h" +#ifdef __GNUG__ +#pragma interface +#endif + // Forward declarations for classes we use only as pointers. class InsetGraphics; @@ -74,7 +74,7 @@ private: }; /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// Filter the inputs @@ -117,4 +117,10 @@ private: ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormGraphics::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormInclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormInclude.C,v retrieving revision 1.2.6.2 diff -u -p -r1.2.6.2 FormInclude.C --- src/frontends/xforms/FormInclude.C 2001/03/02 13:17:51 1.2.6.2 +++ src/frontends/xforms/FormInclude.C 2001/03/03 09:32:36 @@ -30,8 +30,7 @@ using std::cout; FormInclude::FormInclude(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Include file")), - dialog_(0) + : FormCommand(lv, d, _("Include file")) { // let the dialog be shown // These are permanent connections so we won't bother @@ -41,15 +40,9 @@ FormInclude::FormInclude(LyXView * lv, D } -FormInclude::~FormInclude() -{ - delete dialog_; -} - - FL_FORM * FormInclude::form() const { - if (dialog_) + if (dialog_.get()) return dialog_->form; return 0; } @@ -57,7 +50,7 @@ FL_FORM * FormInclude::form() const void FormInclude::build() { - dialog_ = build_include(); + dialog_.reset(build_include()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormInclude.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormInclude.h,v retrieving revision 1.1.6.2 diff -u -p -r1.1.6.2 FormInclude.h --- src/frontends/xforms/FormInclude.h 2001/03/02 13:17:51 1.1.6.2 +++ src/frontends/xforms/FormInclude.h 2001/03/03 09:32:36 @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormInclude.h * Copyright 2001 the LyX Team @@ -9,13 +10,14 @@ #ifndef FORMINCLUDE_H #define FORMINCLUDE_H +#include <boost/smart_ptr.hpp> +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" - class InsetInclude; struct FD_form_include; @@ -26,23 +28,21 @@ class FormInclude : public FormCommand { public: /// FormInclude(LyXView *, Dialogs *); - /// - ~FormInclude(); private: /// enum State { /// the browse button - BROWSE=0, + BROWSE = 0, /// the load file button - LOAD=5, + LOAD = 5, /// the verbatim radio choice - VERBATIM=10, + VERBATIM = 10, /// the input and include radio choices - INPUTINCLUDE=11 + INPUTINCLUDE = 11 }; /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Build the dialog virtual void build(); /// Filter the inputs @@ -58,9 +58,15 @@ private: FD_form_include * build_include(); /// Real GUI implementation. - FD_form_include * dialog_; + boost::scoped_ptr<FD_form_include> dialog_; /// The ButtonController ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormInclude::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormIndex.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormIndex.C,v retrieving revision 1.16.8.1 diff -u -p -r1.16.8.1 FormIndex.C --- src/frontends/xforms/FormIndex.C 2001/03/02 13:17:51 1.16.8.1 +++ src/frontends/xforms/FormIndex.C 2001/03/03 09:32:36 @@ -26,8 +26,7 @@ #include "lyxfunc.h" FormIndex::FormIndex(LyXView * lv, Dialogs * d) - : FormCommand(lv, d, _("Index")), - dialog_(0) + : FormCommand(lv, d, _("Index")) { // let the dialog be shown // These are permanent connections so we won't bother @@ -37,15 +36,9 @@ FormIndex::FormIndex(LyXView * lv, Dialo } -FormIndex::~FormIndex() -{ - delete dialog_; -} - - FL_FORM * FormIndex::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -59,7 +52,7 @@ void FormIndex::connect() void FormIndex::build() { - dialog_ = build_index(); + dialog_.reset(build_index()); // Workaround dumb xforms sizing bug minw_ = form()->w; Index: src/frontends/xforms/FormIndex.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormIndex.h,v retrieving revision 1.9.8.1 diff -u -p -r1.9.8.1 FormIndex.h --- src/frontends/xforms/FormIndex.h 2001/03/02 13:17:51 1.9.8.1 +++ src/frontends/xforms/FormIndex.h 2001/03/03 09:32:36 @@ -12,12 +12,14 @@ #ifndef FORMINDEX_H #define FORMINDEX_H +#include <boost/smart_ptr.hpp> +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" struct FD_form_index; /** This class provides an XForms implementation of the FormIndex Dialog. @@ -26,11 +28,9 @@ class FormIndex : public FormCommand { public: /// FormIndex(LyXView *, Dialogs *); - /// - ~FormIndex(); private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Build the dialog @@ -44,9 +44,15 @@ private: /// FD_form_index * build_index(); /// Real GUI implementation. - FD_form_index * dialog_; + boost::scoped_ptr<FD_form_index> dialog_; /// The ButtonController ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormIndex::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormLog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormLog.C,v retrieving revision 1.2.6.1 diff -u -p -r1.2.6.1 FormLog.C --- src/frontends/xforms/FormLog.C 2001/02/19 17:46:29 1.2.6.1 +++ src/frontends/xforms/FormLog.C 2001/03/03 09:32:37 @@ -32,13 +32,10 @@ FormLog::FormLog(LyXView * lv, Dialogs * d->showLogFile.connect(slot(this, &FormLog::show)); } -FormLog::~FormLog() -{ -} void FormLog::update() { - if (!dialog_ || !lv_->view()->available()) + if (!dialog_.get() || !lv_->view()->available()) return; std::pair<Buffer::LogType, string> const logfile Index: src/frontends/xforms/FormLog.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormLog.h,v retrieving revision 1.1.6.2 diff -u -p -r1.1.6.2 FormLog.h --- src/frontends/xforms/FormLog.h 2001/02/27 12:44:01 1.1.6.2 +++ src/frontends/xforms/FormLog.h 2001/03/03 09:32:37 @@ -25,9 +25,8 @@ class Dialogs; */ class FormLog : public FormBrowser { public: + /// FormLog(LyXView *, Dialogs *); - ~FormLog(); - private: /// Update the dialog. virtual void update(); Index: src/frontends/xforms/FormParagraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormParagraph.C,v retrieving revision 1.14.8.2 diff -u -p -r1.14.8.2 FormParagraph.C --- src/frontends/xforms/FormParagraph.C 2001/03/02 13:17:52 1.14.8.2 +++ src/frontends/xforms/FormParagraph.C 2001/03/03 09:32:41 @@ -11,12 +11,12 @@ #include <config.h> +#include FORMS_H_LOCATION + #ifdef __GNUG_ #pragma implementation #endif -#include FORMS_H_LOCATION - #include "FormParagraph.h" #include "form_paragraph.h" #include "Dialogs.h" @@ -30,8 +30,7 @@ using Liason::setMinibuffer; #endif FormParagraph::FormParagraph(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("Paragraph Layout")), - dialog_(0), general_(0), extra_(0) + : FormBaseBD(lv, d, _("Paragraph Layout")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -40,14 +39,6 @@ FormParagraph::FormParagraph(LyXView * l } -FormParagraph::~FormParagraph() -{ - delete general_; - delete extra_; - delete dialog_; -} - - void FormParagraph::redraw() { if( form() && form()->visible ) @@ -63,7 +54,7 @@ void FormParagraph::redraw() FL_FORM * FormParagraph::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -71,7 +62,7 @@ FL_FORM * FormParagraph::form() const void FormParagraph::build() { // the tabbed folder - dialog_ = build_tabbed_paragraph(); + dialog_.reset(build_tabbed_paragraph()); // Workaround dumb xforms sizing bug minw_ = form()->w; @@ -85,7 +76,7 @@ void FormParagraph::build() bc().refresh(); // the general paragraph data form - general_ = build_paragraph_general(); + general_.reset(build_paragraph_general()); fl_addto_choice(general_->choice_space_above, _(" None | Defskip | Smallskip " @@ -116,7 +107,7 @@ void FormParagraph::build() bc().addReadOnly (general_->input_labelwidth); // the document class form - extra_ = build_paragraph_extra(); + extra_.reset(build_paragraph_extra()); fl_set_input_return(extra_->input_pextra_width, FL_RETURN_CHANGED); fl_set_input_return(extra_->input_pextra_widthp, FL_RETURN_CHANGED); @@ -135,7 +126,7 @@ void FormParagraph::build() void FormParagraph::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; general_apply(); @@ -150,7 +141,7 @@ void FormParagraph::apply() void FormParagraph::update() { - if (!dialog_) + if (!dialog_.get()) return; general_update(); @@ -294,7 +285,7 @@ void FormParagraph::extra_apply() void FormParagraph::general_update() { - if (!general_) + if (!general_.get()) return; Buffer * buf = lv_->view()->buffer(); @@ -468,7 +459,7 @@ void FormParagraph::general_update() void FormParagraph::extra_update() { - if (!lv_->view()->available() || !extra_) + if (!lv_->view()->available() || !extra_.get()) return; LyXParagraph * par = lv_->view()->text->cursor.par(); Index: src/frontends/xforms/FormParagraph.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormParagraph.h,v retrieving revision 1.7.8.2 diff -u -p -r1.7.8.2 FormParagraph.h --- src/frontends/xforms/FormParagraph.h 2001/03/02 13:17:52 1.7.8.2 +++ src/frontends/xforms/FormParagraph.h 2001/03/03 09:32:41 @@ -13,13 +13,13 @@ #ifndef FORM_PARAGRAPH_H #define FORM_PARAGRAPH_H -#ifdef __GNUG_ -#pragma interface -#endif - +#include <boost/smart_ptr.hpp> #include "FormBaseDeprecated.h" #include "xformsBC.h" +#ifdef __GNUG_ +#pragma interface +#endif struct FD_form_tabbed_paragraph; struct FD_form_paragraph_general; @@ -32,12 +32,9 @@ class FormParagraph : public FormBaseBD public: /// FormParagraph(LyXView *, Dialogs *); - /// - ~FormParagraph(); - private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /** Redraw the form (on receipt of a Signal indicating, for example, that the xform colours have been re-mapped). */ virtual void redraw(); @@ -70,13 +67,19 @@ private: FD_form_paragraph_extra * build_paragraph_extra(); /// Real GUI implementation. - FD_form_tabbed_paragraph * dialog_; + boost::scoped_ptr<FD_form_tabbed_paragraph> dialog_; /// - FD_form_paragraph_general * general_; + boost::scoped_ptr<FD_form_paragraph_general> general_; /// - FD_form_paragraph_extra * extra_; + boost::scoped_ptr<FD_form_paragraph_extra> extra_; /// The ButtonController ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormParagraph::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormPreamble.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreamble.C,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 FormPreamble.C --- src/frontends/xforms/FormPreamble.C 2001/03/02 13:17:52 1.1.2.2 +++ src/frontends/xforms/FormPreamble.C 2001/03/03 09:32:42 @@ -10,6 +10,10 @@ #include FORMS_H_LOCATION +#ifdef __GNUG__ +#pragma implementation +#endif + #include "form_preamble.h" #include "FormPreamble.h" #include "Dialogs.h" @@ -23,8 +27,7 @@ using Liason::setMinibuffer; #endif FormPreamble::FormPreamble(LyXView * lv, Dialogs * d) - : FormBaseBD(lv, d, _("LaTeX preamble")), - dialog_(0) + : FormBaseBD(lv, d, _("LaTeX preamble")) { // let the popup be shown // This is a permanent connection so we won't bother @@ -33,21 +36,16 @@ FormPreamble::FormPreamble(LyXView * lv, } -FormPreamble::~FormPreamble() -{ - delete dialog_; -} - - FL_FORM * FormPreamble::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } + void FormPreamble::build() { - dialog_ = build_preamble(); + dialog_.reset(build_preamble()); // Workaround dumb xforms sizing bug minw_ = form()->w; minh_ = form()->h; @@ -61,9 +59,10 @@ void FormPreamble::build() bc().refresh(); } + void FormPreamble::apply() { - if (!lv_->view()->available() || !dialog_) + if (!lv_->view()->available() || !dialog_.get()) return; // is this needed?: @@ -77,7 +76,7 @@ void FormPreamble::apply() void FormPreamble::update() { - if (!dialog_) + if (!dialog_.get()) return; fl_set_input(dialog_->input_preamble,lv_->buffer()->params.preamble.c_str()); Index: src/frontends/xforms/FormPreamble.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreamble.h,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 FormPreamble.h --- src/frontends/xforms/FormPreamble.h 2001/03/02 13:17:52 1.1.2.3 +++ src/frontends/xforms/FormPreamble.h 2001/03/03 09:32:42 @@ -1,3 +1,4 @@ +// -*- C++ -*- /** * \file FormPreamble.h * Copyright 2001 The LyX Team. @@ -9,9 +10,14 @@ #ifndef FORMPREAMBLE_H #define FORMPREAMBLE_H +#include <boost/smart_ptr.hpp> #include "FormBaseDeprecated.h" #include "xformsBC.h" +#ifdef __GNUG__ +#pragma interface +#endif + struct FD_form_preamble; /** This class provides an XForms implementation of the FormPreamble Dialog. @@ -20,12 +26,9 @@ class FormPreamble : public FormBaseBD { public: /// FormPreamble(LyXView *, Dialogs *); - /// - ~FormPreamble(); - private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Filter the inputs // virtual bool input(FL_OBJECT *, long); @@ -43,9 +46,15 @@ private: FD_form_preamble * build_preamble(); /// Real GUI implementation. - FD_form_preamble * dialog_; + boost::scoped_ptr<FD_form_preamble> dialog_; /// The ButtonController ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_; }; + +inline +xformsBC & FormPreamble::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormPreferences.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreferences.C,v retrieving revision 1.50.8.3 diff -u -p -r1.50.8.3 FormPreferences.C --- src/frontends/xforms/FormPreferences.C 2001/03/02 13:17:52 1.50.8.3 +++ src/frontends/xforms/FormPreferences.C 2001/03/03 09:32:59 @@ -66,9 +66,6 @@ static Converters local_converters; FormPreferences::FormPreferences(LyXView * lv, Dialogs * d) : FormBaseBI(lv, d, _("Preferences")), - dialog_(0), - converters_tab_(0), inputs_tab_(0), look_n_feel_tab_(0), - outputs_tab_(0), lang_opts_tab_(0), warningPosted(false), colors_(*this), converters_(*this), inputs_misc_(*this), formats_(*this), interface_(*this), language_(*this), @@ -82,18 +79,6 @@ FormPreferences::FormPreferences(LyXView } -FormPreferences::~FormPreferences() -{ - delete converters_tab_; - delete inputs_tab_; - delete look_n_feel_tab_; - delete outputs_tab_; - delete lang_opts_tab_; - - delete dialog_; -} - - void FormPreferences::connect() { fl_set_form_maxsize( dialog_->form, minw_, minh_ ); @@ -146,7 +131,7 @@ void FormPreferences::redraw() FL_FORM * FormPreferences::form() const { - if (dialog_) return dialog_->form; + if (dialog_.get()) return dialog_->form; return 0; } @@ -180,7 +165,7 @@ void FormPreferences::hide() void FormPreferences::build() { - dialog_ = build_preferences(); + dialog_.reset(build_preferences()); // Manage the restore, save, apply and cancel/close buttons bc().setOK(dialog_->button_ok); @@ -194,11 +179,11 @@ void FormPreferences::build() minh_ = form()->h; // build the tab folders - converters_tab_ = build_outer_tab(); - look_n_feel_tab_ = build_outer_tab(); - inputs_tab_ = build_outer_tab(); - outputs_tab_ = build_outer_tab(); - lang_opts_tab_ = build_outer_tab(); + converters_tab_.reset(build_outer_tab()); + look_n_feel_tab_.reset(build_outer_tab()); + inputs_tab_.reset(build_outer_tab()); + outputs_tab_.reset(build_outer_tab()); + lang_opts_tab_.reset(build_outer_tab()); // build actual tabfolder contents // these will become nested tabfolders @@ -382,7 +367,7 @@ bool FormPreferences::input(FL_OBJECT * void FormPreferences::update() { - if (!dialog_) return; + if (!dialog_.get()) return; // read lyxrc entries colors_.update(); @@ -399,10 +384,15 @@ void FormPreferences::update() spellchecker_.update(); } + +FormPreferences::Colors::Colors(FormPreferences & p) + : parent_(p) +{} -FormPreferences::Colors::~Colors() + +FD_form_colors const * FormPreferences::Colors::dialog() { - delete dialog_; + return dialog_.get(); } @@ -481,7 +471,7 @@ void FormPreferences::Colors::apply() void FormPreferences::Colors::build() { - dialog_ = parent_.build_colors(); + dialog_.reset(parent_.build_colors()); fl_set_object_color(dialog_->button_color, GUI_COLOR_CHOICE, GUI_COLOR_CHOICE); @@ -962,10 +952,15 @@ string const FormPreferences::Colors::X1 return ostr.str().c_str(); } + +FormPreferences::Converters::Converters(FormPreferences & p) + : parent_(p) +{} -FormPreferences::Converters::~Converters() + +FD_form_converters const * FormPreferences::Converters::dialog() { - delete dialog_; + return dialog_.get(); } @@ -979,7 +974,7 @@ void FormPreferences::Converters::apply( void FormPreferences::Converters::build() { - dialog_ = parent_.build_converters(); + dialog_.reset(parent_.build_converters()); fl_set_input_return(dialog_->input_converter, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_flags, FL_RETURN_CHANGED); @@ -1232,10 +1227,15 @@ void FormPreferences::Converters::Update fl_addto_choice(dialog_->choice_to, choice.c_str()); } + +FormPreferences::Formats::Formats( FormPreferences & p ) + : parent_(p) +{} -FormPreferences::Formats::~Formats() + +FD_form_formats const * FormPreferences::Formats::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1247,7 +1247,7 @@ void FormPreferences::Formats::apply() c void FormPreferences::Formats::build() { - dialog_ = parent_.build_formats(); + dialog_.reset(parent_.build_formats()); fl_set_input_return(dialog_->input_format, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_viewer, FL_RETURN_CHANGED); @@ -1467,10 +1467,15 @@ bool FormPreferences::Formats::Input() return false; } + +FormPreferences::InputsMisc::InputsMisc( FormPreferences & p ) + : parent_(p) +{} -FormPreferences::InputsMisc::~InputsMisc() + +FD_form_inputs_misc const * FormPreferences::InputsMisc::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1483,7 +1488,7 @@ void FormPreferences::InputsMisc::apply( void FormPreferences::InputsMisc::build() { - dialog_ = parent_.build_inputs_misc(); + dialog_.reset(parent_.build_inputs_misc()); fl_set_input_return(dialog_->input_date_format, FL_RETURN_CHANGED); @@ -1510,10 +1515,15 @@ void FormPreferences::InputsMisc::update lyxrc.date_insert_format.c_str()); } + +FormPreferences::Interface::Interface( FormPreferences & p ) + : parent_(p) +{} + -FormPreferences::Interface::~Interface() +FD_form_interface const * FormPreferences::Interface::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1533,7 +1543,7 @@ void FormPreferences::Interface::apply() void FormPreferences::Interface::build() { - dialog_ = parent_.build_interface(); + dialog_.reset(parent_.build_interface()); fl_set_input_return(dialog_->input_popup_font, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_menu_font, FL_RETURN_CHANGED); @@ -1623,10 +1633,14 @@ void FormPreferences::Interface::update( } -FormPreferences::Language::~Language() +FormPreferences::Language::Language( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_language const * FormPreferences::Language::dialog() { - delete combo_default_lang; - delete dialog_; + return dialog_.get(); } @@ -1675,7 +1689,7 @@ void FormPreferences::Language::apply() void FormPreferences::Language::build() { - dialog_ = parent_.build_language(); + dialog_.reset(parent_.build_language()); fl_set_input_return(dialog_->input_package, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_command_begin, FL_RETURN_CHANGED); @@ -1687,7 +1701,7 @@ void FormPreferences::Language::build() FL_OBJECT * obj = dialog_->choice_default_lang; fl_deactivate_object(dialog_->choice_default_lang); - combo_default_lang = new Combox(FL_COMBOX_DROPLIST); + combo_default_lang.reset(new Combox(FL_COMBOX_DROPLIST)); combo_default_lang->add(obj->x, obj->y, obj->w, obj->h, 400, parent_.lang_opts_tab_->tabfolder_outer, parent_.dialog_->tabfolder_prefs); @@ -1735,7 +1749,7 @@ FormPreferences::Language::feedback(FL_O { string str; - if (reinterpret_cast<Combox const *>(ob) == combo_default_lang) + if (reinterpret_cast<Combox const *>(ob) == combo_default_lang.get()) str = lyxrc.getDescription(LyXRC::RC_DEFAULT_LANGUAGE); else if (ob == dialog_->check_use_kbmap) str = lyxrc.getDescription(LyXRC::RC_KBMAP); @@ -1874,10 +1888,15 @@ void FormPreferences::Language::ComboCB( pre->bc().valid(pre->input(reinterpret_cast<FL_OBJECT *>(combox), 0)); } + +FormPreferences::LnFmisc::LnFmisc( FormPreferences & p ) + : parent_(p) +{} + -FormPreferences::LnFmisc::~LnFmisc() +FD_form_lnf_misc const * FormPreferences::LnFmisc::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1901,7 +1920,7 @@ void FormPreferences::LnFmisc::apply() c void FormPreferences::LnFmisc::build() { - dialog_ = parent_.build_lnf_misc(); + dialog_.reset(parent_.build_lnf_misc()); fl_set_counter_step(dialog_->counter_autosave, 1, 10); fl_set_counter_step(dialog_->counter_wm_jump, 1, 10); @@ -1962,9 +1981,14 @@ void FormPreferences::LnFmisc::update() } -FormPreferences::OutputsMisc::~OutputsMisc() +FormPreferences::OutputsMisc::OutputsMisc( FormPreferences & p ) + : parent_(p) +{} + + +FD_form_outputs_misc const * FormPreferences::OutputsMisc::dialog() { - delete dialog_; + return dialog_.get(); } @@ -1985,7 +2009,7 @@ void FormPreferences::OutputsMisc::apply void FormPreferences::OutputsMisc::build() { - dialog_ = parent_.build_outputs_misc(); + dialog_.reset(parent_.build_outputs_misc()); fl_set_counter_step(dialog_->counter_line_len, 1, 10); @@ -2040,10 +2064,15 @@ void FormPreferences::OutputsMisc::updat lyxrc.chktex_command.c_str()); } + +FormPreferences::Paths::Paths( FormPreferences & p ) + : parent_(p) +{} + -FormPreferences::Paths::~Paths() +FD_form_paths const * FormPreferences::Paths::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2084,7 +2113,7 @@ void FormPreferences::Paths::apply() void FormPreferences::Paths::build() { - dialog_ = parent_.build_paths(); + dialog_.reset(parent_.build_paths()); fl_set_input_return(dialog_->input_default_path, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_template_path, FL_RETURN_CHANGED); @@ -2320,9 +2349,14 @@ void FormPreferences::Paths::update() } -FormPreferences::Printer::~Printer() +FormPreferences::Printer::Printer(FormPreferences & p) + : parent_(p) +{} + + +FD_form_printer const * FormPreferences::Printer::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2402,7 +2436,7 @@ FormPreferences::Printer::feedback(FL_OB void FormPreferences::Printer::build() { - dialog_ = parent_.build_printer(); + dialog_.reset(parent_.build_printer()); fl_set_input_return(dialog_->input_command, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_page_range, FL_RETURN_CHANGED); @@ -2484,10 +2518,15 @@ void FormPreferences::Printer::update() lyxrc.printer.c_str()); } + +FormPreferences::ScreenFonts::ScreenFonts( FormPreferences & p ) + : parent_(p) +{} + -FormPreferences::ScreenFonts::~ScreenFonts() +FD_form_screen_fonts const * FormPreferences::ScreenFonts::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2609,7 +2648,7 @@ void FormPreferences::ScreenFonts::apply void FormPreferences::ScreenFonts::build() { - dialog_ = parent_.build_screen_fonts(); + dialog_.reset(parent_.build_screen_fonts()); fl_set_counter_step(dialog_->counter_zoom, 1, 10); fl_set_counter_step(dialog_->counter_dpi, 1, 10); @@ -2786,10 +2825,16 @@ void FormPreferences::ScreenFonts::updat tostr(lyxrc.font_sizes[LyXFont::SIZE_HUGER]).c_str()); } + + +FormPreferences::SpellChecker::SpellChecker( FormPreferences & p ) + : parent_(p) +{} + -FormPreferences::SpellChecker::~SpellChecker() +FD_form_spellchecker const * FormPreferences::SpellChecker::dialog() { - delete dialog_; + return dialog_.get(); } @@ -2853,7 +2898,7 @@ void FormPreferences::SpellChecker::appl void FormPreferences::SpellChecker::build() { - dialog_ = parent_.build_spellchecker(); + dialog_.reset(parent_.build_spellchecker()); fl_addto_choice(dialog_->choice_spell_command, _(" none | ispell | aspell ")); Index: src/frontends/xforms/FormPreferences.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreferences.h,v retrieving revision 1.36.8.2 diff -u -p -r1.36.8.2 FormPreferences.h --- src/frontends/xforms/FormPreferences.h 2001/03/02 13:17:52 1.36.8.2 +++ src/frontends/xforms/FormPreferences.h 2001/03/03 09:33:04 @@ -17,16 +17,17 @@ #ifndef FORMPREFERENCES_H #define FORMPREFERENCES_H -#ifdef __GNUG_ -#pragma interface -#endif - #include <utility> // pair +#include <boost/smart_ptr.hpp> #include "FormBaseDeprecated.h" #include "Color.h" // NamedColor #include "xform_helpers.h" // XformColor #include "xformsBC.h" +#ifdef __GNUG_ +#pragma interface +#endif + class Combox; class Dialogs; class LyXView; @@ -55,14 +56,12 @@ public: /// #FormPreferences x(LyXFunc ..., Dialogs ...);# FormPreferences(LyXView *, Dialogs *); /// - ~FormPreferences(); - /// static int FeedbackCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *); private: /// Pointer to the actual instantiation of the ButtonController. - virtual xformsBC & bc() { return bc_; } + virtual xformsBC & bc(); /// Connect signals etc. Set form's max size. virtual void connect(); /// Disconnect signals. Also perform any necessary housekeeping. @@ -131,17 +130,17 @@ private: FD_form_spellchecker * build_spellchecker(); /// Real GUI implementation. - FD_form_preferences * dialog_; + boost::scoped_ptr<FD_form_preferences> dialog_; /// Converters tabfolder - FD_form_outer_tab * converters_tab_; + boost::scoped_ptr<FD_form_outer_tab> converters_tab_; /// reLyX and other import/input stuff - FD_form_outer_tab * inputs_tab_; + boost::scoped_ptr<FD_form_outer_tab> inputs_tab_; /// HCI configuration - FD_form_outer_tab * look_n_feel_tab_; + boost::scoped_ptr<FD_form_outer_tab> look_n_feel_tab_; /// Outputs tabfolder - FD_form_outer_tab * outputs_tab_; + boost::scoped_ptr<FD_form_outer_tab> outputs_tab_; /// Spellchecker, language stuff, etc - FD_form_outer_tab * lang_opts_tab_; + boost::scoped_ptr<FD_form_outer_tab> lang_opts_tab_; /** Flag whether a warning has been posted to the text window. If so, don't redraw the window when the mouse leaves an object. */ @@ -159,12 +158,10 @@ private: GUI_COLOR_CURSOR = FL_FREE_COL3 }; /// - Colors( FormPreferences & p ) : parent_(p), dialog_(0) {} + Colors( FormPreferences & p ); /// - ~Colors(); + FD_form_colors const * dialog(); /// - FD_form_colors const * dialog() { return dialog_; } - /// void apply(); // not const as modifies modifiedXformPrefs. /// void build(); @@ -199,7 +196,7 @@ private: /// FormPreferences & parent_; /// - FD_form_colors * dialog_; + boost::scoped_ptr<FD_form_colors> dialog_; /// A vector of LyX LColor GUI name and associated RGB color. std::vector<NamedColor> lyxColorDB; @@ -212,12 +209,10 @@ private: /// class Converters { public: - /// - Converters( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~Converters(); + Converters( FormPreferences & p ); /// - FD_form_converters const * dialog() { return dialog_; } + FD_form_converters const * dialog(); /// void apply() const; /// @@ -250,7 +245,7 @@ private: /// FormPreferences & parent_; /// - FD_form_converters * dialog_; + boost::scoped_ptr<FD_form_converters> dialog_; }; /// friend class Converters; @@ -258,12 +253,10 @@ private: /// class Formats { public: - /// - Formats( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~Formats(); + Formats( FormPreferences & p ); /// - FD_form_formats const * dialog() { return dialog_; } + FD_form_formats const * dialog(); /// void apply() const; /// @@ -290,7 +283,7 @@ private: /// FormPreferences & parent_; /// - FD_form_formats * dialog_; + boost::scoped_ptr<FD_form_formats> dialog_; }; /// friend class Formats; @@ -299,12 +292,10 @@ private: class InputsMisc { public: /// - InputsMisc( FormPreferences & p ) : parent_(p), dialog_(0) {} + InputsMisc( FormPreferences & p ); /// - ~InputsMisc(); + FD_form_inputs_misc const * dialog(); /// - FD_form_inputs_misc const * dialog() { return dialog_; } - /// void apply() const; /// void build(); @@ -317,7 +308,7 @@ private: /// FormPreferences & parent_; /// - FD_form_inputs_misc * dialog_; + boost::scoped_ptr<FD_form_inputs_misc> dialog_; }; /// friend class InputsMisc; @@ -325,12 +316,10 @@ private: /// class Interface { public: - /// - Interface( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~Interface(); + Interface( FormPreferences & p ); /// - FD_form_interface const * dialog() { return dialog_; } + FD_form_interface const * dialog(); /// void apply() const; /// @@ -346,7 +335,7 @@ private: /// FormPreferences & parent_; /// - FD_form_interface * dialog_; + boost::scoped_ptr<FD_form_interface> dialog_; }; /// friend class Interface; @@ -354,13 +343,10 @@ private: /// class Language { public: - /// - Language( FormPreferences & p ) - : parent_(p), dialog_(0), combo_default_lang(0) {} /// - ~Language(); + Language( FormPreferences & p ); /// - FD_form_language const * dialog() { return dialog_; } + FD_form_language const * dialog(); /// void apply(); // not const because calls update() /// @@ -378,9 +364,9 @@ private: /// FormPreferences & parent_; /// - FD_form_language * dialog_; + boost::scoped_ptr<FD_form_language> dialog_; /// - Combox * combo_default_lang; + boost::scoped_ptr<Combox> combo_default_lang; }; /// friend class Language; @@ -389,12 +375,10 @@ private: class LnFmisc { public: /// - LnFmisc( FormPreferences & p ) : parent_(p), dialog_(0) {} + LnFmisc( FormPreferences & p ); /// - ~LnFmisc(); + FD_form_lnf_misc const * dialog(); /// - FD_form_lnf_misc const * dialog() { return dialog_; } - /// void apply() const; /// void build(); @@ -407,7 +391,7 @@ private: /// FormPreferences & parent_; /// - FD_form_lnf_misc * dialog_; + boost::scoped_ptr<FD_form_lnf_misc> dialog_; }; /// friend class LnFmisc; @@ -415,12 +399,10 @@ private: /// class OutputsMisc { public: - /// - OutputsMisc( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~OutputsMisc(); + OutputsMisc( FormPreferences & p ); /// - FD_form_outputs_misc const * dialog() { return dialog_; } + FD_form_outputs_misc const * dialog(); /// void apply() const; /// @@ -434,7 +416,7 @@ private: /// FormPreferences & parent_; /// - FD_form_outputs_misc * dialog_; + boost::scoped_ptr<FD_form_outputs_misc> dialog_; }; /// friend class OutputsMisc; @@ -442,12 +424,10 @@ private: /// class Paths { public: - /// - Paths( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~Paths(); + Paths( FormPreferences & p ); /// - FD_form_paths const * dialog() { return dialog_; } + FD_form_paths const * dialog(); /// void apply(); /// @@ -463,7 +443,7 @@ private: /// FormPreferences & parent_; /// - FD_form_paths * dialog_; + boost::scoped_ptr<FD_form_paths> dialog_; }; /// friend class Paths; @@ -472,12 +452,10 @@ private: class Printer { public: /// - Printer( FormPreferences & p ) : parent_(p), dialog_(0) {} + Printer( FormPreferences & p ); /// - ~Printer(); + FD_form_printer const * dialog(); /// - FD_form_printer const * dialog() { return dialog_; } - /// void apply() const; /// void build(); @@ -490,7 +468,7 @@ private: /// FormPreferences & parent_; /// - FD_form_printer * dialog_; + boost::scoped_ptr<FD_form_printer> dialog_; }; /// friend class Printer; @@ -498,12 +476,10 @@ private: /// class ScreenFonts { public: - /// - ScreenFonts( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~ScreenFonts(); + ScreenFonts( FormPreferences & p ); /// - FD_form_screen_fonts const * dialog() { return dialog_; } + FD_form_screen_fonts const * dialog(); /// void apply() const; /// @@ -519,7 +495,7 @@ private: /// FormPreferences & parent_; /// - FD_form_screen_fonts * dialog_; + boost::scoped_ptr<FD_form_screen_fonts> dialog_; }; /// friend class ScreenFonts; @@ -527,12 +503,10 @@ private: /// class SpellChecker { public: - /// - SpellChecker( FormPreferences & p ) : parent_(p), dialog_(0) {} /// - ~SpellChecker(); + SpellChecker( FormPreferences & p ); /// - FD_form_spellchecker const * dialog() { return dialog_; } + FD_form_spellchecker const * dialog(); /// void apply(); // not const because calls update()! /// @@ -548,7 +522,7 @@ private: /// FormPreferences & parent_; /// - FD_form_spellchecker * dialog_; + boost::scoped_ptr<FD_form_spellchecker> dialog_; }; /// friend class SpellChecker; @@ -601,5 +575,12 @@ private: /// The ButtonController ButtonController<PreferencesPolicy, xformsBC> bc_; }; + + +inline +xformsBC & FormPreferences::bc() +{ + return bc_; +} #endif Index: src/frontends/xforms/FormPrint.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPrint.h,v retrieving revision 1.13.2.2 diff -u -p -r1.13.2.2 FormPrint.h --- src/frontends/xforms/FormPrint.h 2001/03/02 13:17:52 1.13.2.2 +++ src/frontends/xforms/FormPrint.h 2001/03/03 09:33:04 @@ -17,13 +17,13 @@ #ifndef FORMPRINT_H #define FORMPRINT_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "FormBaseDeprecated.h" #include "RadioButtonGroup.h" #include "xformsBC.h" + +#ifdef __GNUG__ +#pragma interface +#endif class LyXView; class Dialogs; Index: src/frontends/xforms/FormRef.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormRef.h,v retrieving revision 1.13.8.3 diff -u -p -r1.13.8.3 FormRef.h --- src/frontends/xforms/FormRef.h 2001/03/02 13:17:52 1.13.8.3 +++ src/frontends/xforms/FormRef.h 2001/03/03 09:33:04 @@ -12,12 +12,13 @@ #ifndef FORMREF_H #define FORMREF_H +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" struct FD_form_ref; /** This class provides an XForms implementation of the FormRef Dialog. Index: src/frontends/xforms/FormSplash.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormSplash.h,v retrieving revision 1.1.6.3 diff -u -p -r1.1.6.3 FormSplash.h --- src/frontends/xforms/FormSplash.h 2001/03/02 13:17:52 1.1.6.3 +++ src/frontends/xforms/FormSplash.h 2001/03/03 09:33:04 @@ -10,12 +10,12 @@ #ifndef FORMSPLASH_H #define FORMSPLASH_H +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif - -#include "FormBaseDeprecated.h" -#include "xformsBC.h" struct FD_form_splash; Index: src/frontends/xforms/FormTabular.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormTabular.C,v retrieving revision 1.16.8.2 diff -u -p -r1.16.8.2 FormTabular.C --- src/frontends/xforms/FormTabular.C 2001/03/02 13:17:52 1.16.8.2 +++ src/frontends/xforms/FormTabular.C 2001/03/03 09:33:09 @@ -14,6 +14,10 @@ #include <config.h> +#ifdef __GNUG__ +#pragma implementation +#endif + #include "FormTabular.h" #include "form_tabular.h" #include "LyXView.h" Index: src/frontends/xforms/FormTabular.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormTabular.h,v retrieving revision 1.10.8.1 diff -u -p -r1.10.8.1 FormTabular.h --- src/frontends/xforms/FormTabular.h 2001/03/02 13:17:52 1.10.8.1 +++ src/frontends/xforms/FormTabular.h 2001/03/03 09:33:09 @@ -18,6 +18,10 @@ #include "FormInset.h" #include "xformsBC.h" +#ifdef __GNUG__ +#pragma interface +#endif + class InsetTabular; struct FD_form_tabular; struct FD_form_tabular_options; Index: src/frontends/xforms/FormTabularCreate.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormTabularCreate.h,v retrieving revision 1.2.8.2 diff -u -p -r1.2.8.2 FormTabularCreate.h --- src/frontends/xforms/FormTabularCreate.h 2001/03/02 13:17:52 1.2.8.2 +++ src/frontends/xforms/FormTabularCreate.h 2001/03/03 09:33:09 @@ -15,12 +15,12 @@ #ifndef FORMTABULARCREATE_H #define FORMTABULARCREATE_H +#include "FormBaseDeprecated.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif - -#include "FormBaseDeprecated.h" -#include "xformsBC.h" class LyXView; class Dialogs; Index: src/frontends/xforms/FormToc.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormToc.h,v retrieving revision 1.11.8.1 diff -u -p -r1.11.8.1 FormToc.h --- src/frontends/xforms/FormToc.h 2001/03/02 13:17:52 1.11.8.1 +++ src/frontends/xforms/FormToc.h 2001/03/03 09:33:09 @@ -12,13 +12,14 @@ #ifndef FORMTOC_H #define FORMTOC_H +#include "FormInset.h" +#include "buffer.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "buffer.h" -#include "xformsBC.h" struct FD_form_toc; /** This class provides an XForms implementation of the FormToc Dialog. Index: src/frontends/xforms/FormUrl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormUrl.C,v retrieving revision 1.22.8.1 diff -u -p -r1.22.8.1 FormUrl.C --- src/frontends/xforms/FormUrl.C 2001/03/02 13:17:52 1.22.8.1 +++ src/frontends/xforms/FormUrl.C 2001/03/03 09:33:09 @@ -17,7 +17,6 @@ #pragma implementation #endif - #include "Dialogs.h" #include "FormUrl.h" #include "LyXView.h" Index: src/frontends/xforms/FormUrl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormUrl.h,v retrieving revision 1.13.8.1 diff -u -p -r1.13.8.1 FormUrl.h --- src/frontends/xforms/FormUrl.h 2001/03/02 13:17:52 1.13.8.1 +++ src/frontends/xforms/FormUrl.h 2001/03/03 09:33:09 @@ -12,12 +12,13 @@ #ifndef FORMURL_H #define FORMURL_H +#include "FormInset.h" +#include "xformsBC.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormInset.h" -#include "xformsBC.h" struct FD_form_url; /** This class provides an XForms implementation of the FormUrl Dialog. Index: src/frontends/xforms/FormVCLog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormVCLog.C,v retrieving revision 1.1.6.1 diff -u -p -r1.1.6.1 FormVCLog.C --- src/frontends/xforms/FormVCLog.C 2001/02/19 17:46:29 1.1.6.1 +++ src/frontends/xforms/FormVCLog.C 2001/03/03 09:33:10 @@ -32,13 +32,10 @@ FormVCLog::FormVCLog(LyXView * lv, Dialo d->showVCLogFile.connect(slot(this, &FormVCLog::show)); } -FormVCLog::~FormVCLog() -{ -} void FormVCLog::update() { - if (!dialog_ || !lv_->view()->available()) + if (!dialog_.get() || !lv_->view()->available()) return; const string logfile = lv_->view()->buffer()->lyxvc.getLogFile(); Index: src/frontends/xforms/FormVCLog.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormVCLog.h,v retrieving revision 1.1.6.3 diff -u -p -r1.1.6.3 FormVCLog.h --- src/frontends/xforms/FormVCLog.h 2001/03/02 13:17:52 1.1.6.3 +++ src/frontends/xforms/FormVCLog.h 2001/03/03 09:33:10 @@ -9,13 +9,13 @@ #ifndef FORMVCLOG_H #define FORMVCLOG_H +#include "FormBaseDeprecated.h" +#include "FormBrowser.h" + #ifdef __GNUG__ #pragma interface #endif -#include "FormBaseDeprecated.h" -#include "FormBrowser.h" - class LyXView; class Dialogs; @@ -25,9 +25,8 @@ class Dialogs; */ class FormVCLog : public FormBrowser { public: + /// FormVCLog(LyXView *, Dialogs *); - ~FormVCLog(); - private: /// Update the dialog. virtual void update(); Index: src/frontends/xforms/GUIRunTime.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/GUIRunTime.C,v retrieving revision 1.6 diff -u -p -r1.6 GUIRunTime.C --- src/frontends/xforms/GUIRunTime.C 2000/09/18 19:41:51 1.6 +++ src/frontends/xforms/GUIRunTime.C 2001/03/03 09:33:10 @@ -9,11 +9,12 @@ #include <config.h> +#include FORMS_H_LOCATION + #ifdef __GNUG__ #pragma implementation #endif -#include FORMS_H_LOCATION #include "GUIRunTime.h" #include "debug.h" Index: src/frontends/xforms/Menubar_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Menubar_pimpl.C,v retrieving revision 1.24.8.1 diff -u -p -r1.24.8.1 Menubar_pimpl.C --- src/frontends/xforms/Menubar_pimpl.C 2001/02/19 17:46:29 1.24.8.1 +++ src/frontends/xforms/Menubar_pimpl.C 2001/03/03 09:33:15 @@ -7,13 +7,14 @@ * *======================================================*/ +#include <config.h> + +#include <algorithm> + #ifdef __GNUG__ #pragma implementation #endif -#include <config.h> - -#include <algorithm> #include "support/lstrings.h" #include "support/LAssert.h" #include "debug.h" Index: src/frontends/xforms/Menubar_pimpl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Menubar_pimpl.h,v retrieving revision 1.7 diff -u -p -r1.7 Menubar_pimpl.h --- src/frontends/xforms/Menubar_pimpl.h 2000/10/04 09:54:31 1.7 +++ src/frontends/xforms/Menubar_pimpl.h 2001/03/03 09:33:15 @@ -14,16 +14,19 @@ #ifndef MENUBAR_PIMPL_H #define MENUBAR_PIMPL_H -#ifdef __GNUG__ -#pragma interface -#endif - #include <vector> #include <map> + +#include FORMS_H_LOCATION + #include "LString.h" #include "frontends/Menubar.h" #include "commandtags.h" -#include FORMS_H_LOCATION + +#ifdef __GNUG__ +#pragma interface +#endif + class LyXView; class MenuBackend; class MenuItem; Index: src/frontends/xforms/RadioButtonGroup.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/RadioButtonGroup.C,v retrieving revision 1.4 diff -u -p -r1.4 RadioButtonGroup.C --- src/frontends/xforms/RadioButtonGroup.C 2000/08/14 09:44:52 1.4 +++ src/frontends/xforms/RadioButtonGroup.C 2001/03/03 09:33:18 @@ -11,6 +11,10 @@ #include <config.h> +#include <functional> +#include <algorithm> +#include <iterator> + #ifdef __GNUG__ #pragma implementation #endif @@ -19,9 +23,6 @@ #include "debug.h" // for lyxerr -#include <functional> -#include <algorithm> -#include <iterator> using std::find_if; using std::bind2nd; using std::endl; Index: src/frontends/xforms/RadioButtonGroup.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/RadioButtonGroup.h,v retrieving revision 1.6 diff -u -p -r1.6 RadioButtonGroup.h --- src/frontends/xforms/RadioButtonGroup.h 2000/10/02 00:10:24 1.6 +++ src/frontends/xforms/RadioButtonGroup.h 2001/03/03 09:33:18 @@ -13,17 +13,18 @@ #ifndef RADIOBUTTONGROUP_H #define RADIOBUTTONGROUP_H +#include <vector> +#include <utility> + +#include FORMS_H_LOCATION + #ifdef __GNUG__ #pragma interface #endif -#include <vector> -#include <utility> - using std::vector; using std::pair; -#include FORMS_H_LOCATION /** This class simplifies the work with a group of radio buttons, * the idea is that you register a bunch of radio buttons with the accompanying Index: src/frontends/xforms/Timeout_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Timeout_pimpl.C,v retrieving revision 1.1.6.1 diff -u -p -r1.1.6.1 Timeout_pimpl.C --- src/frontends/xforms/Timeout_pimpl.C 2001/02/19 17:46:29 1.1.6.1 +++ src/frontends/xforms/Timeout_pimpl.C 2001/03/03 09:33:18 @@ -7,13 +7,13 @@ * \author John Levon */ -#ifdef __GNUG__ -#pragma implementation -#endif - #include <config.h> #include FORMS_H_LOCATION + +#ifdef __GNUG__ +#pragma implementation +#endif #include "Timeout_pimpl.h" #include "debug.h" Index: src/frontends/xforms/Timeout_pimpl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Timeout_pimpl.h,v retrieving revision 1.1.6.1 diff -u -p -r1.1.6.1 Timeout_pimpl.h --- src/frontends/xforms/Timeout_pimpl.h 2001/02/19 17:46:29 1.1.6.1 +++ src/frontends/xforms/Timeout_pimpl.h 2001/03/03 09:33:18 @@ -11,13 +11,13 @@ #include <config.h> -#ifdef __GNUG__ -#pragma interface -#endif - #include "frontends/Timeout.h" #include <sigc++/signal_system.h> + +#ifdef __GNUG__ +#pragma interface +#endif /** * This class executes the callback when the timeout expires Index: src/frontends/xforms/Toolbar_pimpl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Toolbar_pimpl.h,v retrieving revision 1.3 diff -u -p -r1.3 Toolbar_pimpl.h --- src/frontends/xforms/Toolbar_pimpl.h 2000/09/26 13:54:55 1.3 +++ src/frontends/xforms/Toolbar_pimpl.h 2001/03/03 09:33:19 @@ -14,17 +14,18 @@ #ifndef TOOLBAR_PIMPL_H #define TOOLBAR_PIMPL_H -#include "frontends/Toolbar.h" - -#ifdef __GNUG__ -#pragma interface -#endif - #include <vector> #include FORMS_H_LOCATION + +#include "frontends/Toolbar.h" + #include "commandtags.h" #include "combox.h" #include "ToolbarDefaults.h" + +#ifdef __GNUG__ +#pragma interface +#endif /** The LyX xforms toolbar class */ Index: src/frontends/xforms/input_validators.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/input_validators.C,v retrieving revision 1.2 diff -u -p -r1.2 input_validators.C --- src/frontends/xforms/input_validators.C 2001/01/08 09:37:12 1.2 +++ src/frontends/xforms/input_validators.C 2001/03/03 09:33:19 @@ -4,7 +4,7 @@ * be extended to include other generally useful xforms-specific tools. */ -#include "config.h" +#include <config.h> #include FORMS_H_LOCATION #include "support/lstrings.h" #include "input_validators.h" Index: src/frontends/xforms/xform_helpers.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/xform_helpers.h,v retrieving revision 1.4 diff -u -p -r1.4 xform_helpers.h --- src/frontends/xforms/xform_helpers.h 2000/12/29 12:48:02 1.4 +++ src/frontends/xforms/xform_helpers.h 2001/03/03 09:33:22 @@ -6,7 +6,6 @@ #endif #include <utility> // pair -//#include <config.h> #include "LString.h" #include "Color.h"