Pass and store references to LyXView and Dialogs, not pointers in the

FormBaseDeprecated-derived classes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5000 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-15 16:34:48 +00:00
parent 555abe1948
commit 5fab05e48a
14 changed files with 87 additions and 144 deletions

View File

@ -40,7 +40,6 @@ libfrontends_la_SOURCES = \
WorkAreaFactory.h \ WorkAreaFactory.h \
font_metrics.h \ font_metrics.h \
guiapi.h \ guiapi.h \
guiapi.C \
key_state.h \ key_state.h \
lyx_gui.h \ lyx_gui.h \
mouse_state.h \ mouse_state.h \

View File

@ -2,6 +2,8 @@
* lots: changed my email address to leeming@lyx.org. * lots: changed my email address to leeming@lyx.org.
* GUI.h: return it to private derivation from boost::noncopyable.
2002-08-14 Angus Leeming <leeming@lyx.org> 2002-08-14 Angus Leeming <leeming@lyx.org>
* GUI.h: public derivation from boost::noncopyable. * GUI.h: public derivation from boost::noncopyable.

View File

@ -4,7 +4,7 @@
* Copyright 2001 The LyX Team. * Copyright 2001 The LyX Team.
* See the file COPYING. * See the file COPYING.
* *
* \author Angus Leeming <a.leeming@ic.ac.uk> * \author Angus Leeming <leeming@lyx.org>
*/ */
#ifndef GUI_H #ifndef GUI_H
@ -18,7 +18,7 @@
*/ */
template <typename Controller, typename GUIview, template <typename Controller, typename GUIview,
typename Policy, typename GUIbc> typename Policy, typename GUIbc>
class GUI : public boost::noncopyable { class GUI : boost::noncopyable {
public: public:
/// ///
GUI(LyXView & lv, Dialogs & d); GUI(LyXView & lv, Dialogs & d);

0
src/frontends/guiapi.C Normal file
View File

View File

@ -2,6 +2,19 @@
* lots: changed my email address to leeming@lyx.org. * lots: changed my email address to leeming@lyx.org.
* FormBaseDeprecated.[Ch]: return it to private derivation from
boost::noncopyable.
* FormBaseDeprecated.[Ch]:
* FormDocument.[Ch]:
* FormInset.[Ch]:
* FormMaths*.[Ch]:
* FormPreferences.[Ch]:
* FormTabular.[Ch]:
pass and store references to LyXView and Dialogs, not pointers.
* FormInset.[Ch]: remove class FormCommand.
2002-08-14 Angus Leeming <leeming@lyx.org> 2002-08-14 Angus Leeming <leeming@lyx.org>
* FormBaseDeprecated.h: public derivation from boost::noncopyable. * FormBaseDeprecated.h: public derivation from boost::noncopyable.

View File

@ -3,7 +3,7 @@
* Copyright 2000-2001 The LyX Team. * Copyright 2000-2001 The LyX Team.
* See the file COPYING. * See the file COPYING.
* *
* \author Angus Leeming, a.leeming@ic.ac.uk * \author Angus Leeming <leeming@lyx.org>
*/ */
#include <config.h> #include <config.h>
@ -39,14 +39,12 @@ static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *);
} // extern "C" } // extern "C"
FormBaseDeprecated::FormBaseDeprecated(LyXView * lv, Dialogs * d, FormBaseDeprecated::FormBaseDeprecated(LyXView & lv, Dialogs & d,
string const & t, bool allowResize) string const & t, bool allowResize)
: lv_(lv), d_(d), title_(t), : lv_(lv), d_(d), title_(t),
minw_(0), minh_(0), allow_resize_(allowResize), minw_(0), minh_(0), allow_resize_(allowResize),
tooltips_(new Tooltips()) tooltips_(new Tooltips())
{ {}
lyx::Assert(lv && d);
}
FormBaseDeprecated::~FormBaseDeprecated() FormBaseDeprecated::~FormBaseDeprecated()
@ -71,7 +69,7 @@ void FormBaseDeprecated::redraw()
void FormBaseDeprecated::connect() void FormBaseDeprecated::connect()
{ {
fl_set_form_minsize(form(), minw_, minh_); fl_set_form_minsize(form(), minw_, minh_);
r_ = d_->redrawGUI.connect(boost::bind(&FormBaseDeprecated::redraw, this)); r_ = d_.redrawGUI.connect(boost::bind(&FormBaseDeprecated::redraw, this));
} }
@ -205,7 +203,7 @@ void FormBaseDeprecated::RestoreCB()
} }
FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t, FormBaseBI::FormBaseBI(LyXView & lv, Dialogs & d, string const & t,
bool allowResize) bool allowResize)
: FormBaseDeprecated(lv, d, t, allowResize) : FormBaseDeprecated(lv, d, t, allowResize)
{} {}
@ -213,12 +211,12 @@ FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t,
void FormBaseBI::connect() void FormBaseBI::connect()
{ {
h_ = d_->hideAll.connect(boost::bind(&FormBaseBI::hide, this)); h_ = d_.hideAll.connect(boost::bind(&FormBaseBI::hide, this));
FormBaseDeprecated::connect(); FormBaseDeprecated::connect();
} }
FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t, FormBaseBD::FormBaseBD(LyXView & lv, Dialogs & d, string const & t,
bool allowResize) bool allowResize)
: FormBaseDeprecated(lv, d, t, allowResize) : FormBaseDeprecated(lv, d, t, allowResize)
{} {}
@ -226,9 +224,9 @@ FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t,
void FormBaseBD::connect() void FormBaseBD::connect()
{ {
u_ = d_->updateBufferDependent. u_ = d_.updateBufferDependent.
connect(boost::bind(&FormBaseBD::updateSlot, this, _1)); connect(boost::bind(&FormBaseBD::updateSlot, this, _1));
h_ = d_->hideBufferDependent. h_ = d_.hideBufferDependent.
connect(boost::bind(&FormBaseBD::hide, this)); connect(boost::bind(&FormBaseBD::hide, this));
FormBaseDeprecated::connect(); FormBaseDeprecated::connect();
} }

View File

@ -4,7 +4,7 @@
* Copyright 2000-2002 the LyX Team * Copyright 2000-2002 the LyX Team
* Read the file COPYING * Read the file COPYING
* *
* \author Angus Leeming, a.leeming@ic.ac.uk * \author Angus Leeming <leeming@lyx.org>
*/ */
/* A base class for those remaining xforms dialogs that haven't yet undergone /* A base class for those remaining xforms dialogs that haven't yet undergone
@ -34,11 +34,11 @@ class Dialogs;
class LyXView; class LyXView;
class Tooltips; class Tooltips;
class FormBaseDeprecated : public boost::noncopyable, public FeedbackController class FormBaseDeprecated : boost::noncopyable, public FeedbackController
{ {
public: public:
/// ///
FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool); FormBaseDeprecated(LyXView &, Dialogs &, string const &, bool);
/// ///
virtual ~FormBaseDeprecated(); virtual ~FormBaseDeprecated();
@ -118,9 +118,9 @@ protected: // methods
* We could modify Dialogs to have a visible LyXFunc* instead and * We could modify Dialogs to have a visible LyXFunc* instead and
* save a couple of bytes per dialog. * save a couple of bytes per dialog.
*/ */
LyXView * lv_; LyXView & lv_;
/// Used so we can get at the signals we have to connect to. /// Used so we can get at the signals we have to connect to.
Dialogs * d_; Dialogs & d_;
/// Hide connection. /// Hide connection.
boost::signals::connection h_; boost::signals::connection h_;
/// Redraw connection. /// Redraw connection.
@ -147,7 +147,7 @@ private:
class FormBaseBI : public FormBaseDeprecated { class FormBaseBI : public FormBaseDeprecated {
protected: protected:
/// Constructor /// Constructor
FormBaseBI(LyXView *, Dialogs *, string const &, FormBaseBI(LyXView &, Dialogs &, string const &,
bool allowResize = true); bool allowResize = true);
/// Connect signals /// Connect signals
@ -160,7 +160,7 @@ protected:
class FormBaseBD : public FormBaseDeprecated { class FormBaseBD : public FormBaseDeprecated {
protected: protected:
/// Constructor /// Constructor
FormBaseBD(LyXView *, Dialogs *, string const &, FormBaseBD(LyXView &, Dialogs &, string const &,
bool allowResize = true); bool allowResize = true);
/// Connect signals /// Connect signals

View File

@ -56,7 +56,7 @@ using std::bind2nd;
using Liason::setMinibuffer; using Liason::setMinibuffer;
using std::vector; using std::vector;
FormDocument::FormDocument(LyXView * lv, Dialogs * d) FormDocument::FormDocument(LyXView & lv, Dialogs & d)
: FormBaseBD(lv, d, _("Document Layout")), : FormBaseBD(lv, d, _("Document Layout")),
ActCell(0), Confirmed(0), ActCell(0), Confirmed(0),
current_bullet_panel(0), current_bullet_depth(0), fbullet(0) current_bullet_panel(0), current_bullet_depth(0), fbullet(0)
@ -341,7 +341,7 @@ void FormDocument::build()
void FormDocument::apply() void FormDocument::apply()
{ {
if (!lv_->view()->available() || !dialog_.get()) if (!lv_.view()->available() || !dialog_.get())
return; return;
bool redo = class_apply(); bool redo = class_apply();
@ -351,17 +351,17 @@ void FormDocument::apply()
bullets_apply(); bullets_apply();
if (redo) { if (redo) {
lv_->view()->redoCurrentBuffer(); lv_.view()->redoCurrentBuffer();
} }
lv_->buffer()->markDirty(); lv_.buffer()->markDirty();
setMinibuffer(lv_, _("Document layout set")); setMinibuffer(&lv_, _("Document layout set"));
} }
void FormDocument::cancel() void FormDocument::cancel()
{ {
// this avoids confusion when reopening // this avoids confusion when reopening
BufferParams & param = lv_->buffer()->params; BufferParams & param = lv_.buffer()->params;
param.temp_bullets[0] = param.user_defined_bullets[0]; param.temp_bullets[0] = param.user_defined_bullets[0];
param.temp_bullets[1] = param.user_defined_bullets[1]; param.temp_bullets[1] = param.user_defined_bullets[1];
param.temp_bullets[2] = param.user_defined_bullets[2]; param.temp_bullets[2] = param.user_defined_bullets[2];
@ -377,7 +377,7 @@ void FormDocument::update()
checkReadOnly(); checkReadOnly();
BufferParams const & params = lv_->buffer()->params; BufferParams const & params = lv_.buffer()->params;
class_update(params); class_update(params);
paper_update(params); paper_update(params);
@ -481,12 +481,12 @@ bool FormDocument::input(FL_OBJECT * ob, long)
language_apply(params); language_apply(params);
options_apply(params); options_apply(params);
bullets_apply(params); bullets_apply(params);
params.preamble = lv_->buffer()->params.preamble; params.preamble = lv_.buffer()->params.preamble;
saveParamsAsDefault(params); saveParamsAsDefault(params);
} }
if (ob == dialog_->button_reset_defaults) { if (ob == dialog_->button_reset_defaults) {
BufferParams params = lv_->buffer()->params; BufferParams params = lv_.buffer()->params;
params.textclass = combo_doc_class->get() - 1; params.textclass = combo_doc_class->get() - 1;
params.useClassDefaults(); params.useClassDefaults();
UpdateLayoutDocument(params); UpdateLayoutDocument(params);
@ -735,7 +735,7 @@ bool FormDocument::class_apply(BufferParams &params)
bool FormDocument::class_apply() bool FormDocument::class_apply()
{ {
BufferParams &params = lv_->buffer()->params; BufferParams &params = lv_.buffer()->params;
unsigned int const old_class = params.textclass; unsigned int const old_class = params.textclass;
@ -746,11 +746,11 @@ bool FormDocument::class_apply()
if (textclasslist[params.textclass].load()) { if (textclasslist[params.textclass].load()) {
// successfully loaded // successfully loaded
redo = true; redo = true;
setMinibuffer(lv_, _("Converting document to new document class...")); setMinibuffer(&lv_, _("Converting document to new document class..."));
int ret = CutAndPaste::SwitchLayoutsBetweenClasses( int ret = CutAndPaste::SwitchLayoutsBetweenClasses(
old_class, params.textclass, old_class, params.textclass,
&*(lv_->buffer()->paragraphs.begin()), &*(lv_.buffer()->paragraphs.begin()),
lv_->buffer()->params); lv_.buffer()->params);
if (ret) { if (ret) {
string s; string s;
if (ret == 1) { if (ret == 1) {
@ -833,7 +833,7 @@ void FormDocument::paper_apply(BufferParams & params)
void FormDocument::paper_apply() void FormDocument::paper_apply()
{ {
paper_apply(lv_->buffer()->params); paper_apply(lv_.buffer()->params);
} }
@ -876,8 +876,8 @@ bool FormDocument::language_apply(BufferParams & params)
if (old_language != new_language if (old_language != new_language
&& old_language->RightToLeft() == new_language->RightToLeft() && old_language->RightToLeft() == new_language->RightToLeft()
&& !lv_->buffer()->isMultiLingual()) && !lv_.buffer()->isMultiLingual())
lv_->buffer()->changeLanguage(old_language, new_language); lv_.buffer()->changeLanguage(old_language, new_language);
if (old_language != new_language) { if (old_language != new_language) {
redo = true; redo = true;
@ -892,7 +892,7 @@ bool FormDocument::language_apply(BufferParams & params)
bool FormDocument::language_apply() bool FormDocument::language_apply()
{ {
return language_apply(lv_->buffer()->params); return language_apply(lv_.buffer()->params);
} }
@ -923,14 +923,14 @@ bool FormDocument::options_apply(BufferParams & params)
bool FormDocument::options_apply() bool FormDocument::options_apply()
{ {
return options_apply(lv_->buffer()->params); return options_apply(lv_.buffer()->params);
} }
void FormDocument::bullets_apply(BufferParams & params) void FormDocument::bullets_apply(BufferParams & params)
{ {
/* update the bullet settings */ /* update the bullet settings */
BufferParams & buf_params = lv_->buffer()->params; BufferParams & buf_params = lv_.buffer()->params;
// a little bit of loop unrolling // a little bit of loop unrolling
params.user_defined_bullets[0] = buf_params.temp_bullets[0]; params.user_defined_bullets[0] = buf_params.temp_bullets[0];
@ -942,7 +942,7 @@ void FormDocument::bullets_apply(BufferParams & params)
void FormDocument::bullets_apply() void FormDocument::bullets_apply()
{ {
bullets_apply(lv_->buffer()->params); bullets_apply(lv_.buffer()->params);
} }
void FormDocument::UpdateClassParams(BufferParams const & params) void FormDocument::UpdateClassParams(BufferParams const & params)
@ -1203,7 +1203,7 @@ void FormDocument::bullets_update(BufferParams const & params)
(XpmVersion==4 && XpmRevision<7))) (XpmVersion==4 && XpmRevision<7)))
return; return;
bool const isLinuxDoc = lv_->buffer()->isLinuxDoc(); bool const isLinuxDoc = lv_.buffer()->isLinuxDoc();
setEnabled(fbullet, !isLinuxDoc); setEnabled(fbullet, !isLinuxDoc);
if (isLinuxDoc) return; if (isLinuxDoc) return;
@ -1218,7 +1218,7 @@ void FormDocument::bullets_update(BufferParams const & params)
void FormDocument::checkReadOnly() void FormDocument::checkReadOnly()
{ {
if (bc().readOnly(lv_->buffer()->isReadonly())) { if (bc().readOnly(lv_.buffer()->isReadonly())) {
combo_doc_class->deactivate(); combo_doc_class->deactivate();
combo_language->deactivate(); combo_language->deactivate();
postWarning(_("Document is read-only." postWarning(_("Document is read-only."
@ -1300,7 +1300,7 @@ bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long)
void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/) void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/)
{ {
BufferParams & param = lv_->buffer()->params; BufferParams & param = lv_.buffer()->params;
// convert from 1-6 range to -1-4 // convert from 1-6 range to -1-4
param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2); param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
@ -1311,7 +1311,7 @@ void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/)
void FormDocument::InputBulletLaTeX(FL_OBJECT *, long) void FormDocument::InputBulletLaTeX(FL_OBJECT *, long)
{ {
BufferParams & param = lv_->buffer()->params; BufferParams & param = lv_.buffer()->params;
param.temp_bullets[current_bullet_depth]. param.temp_bullets[current_bullet_depth].
setText(fl_get_input(bullets_->input_bullet_latex)); setText(fl_get_input(bullets_->input_bullet_latex));
@ -1328,7 +1328,7 @@ void FormDocument::BulletDepth(FL_OBJECT * ob)
/* */ /* */
/* I'm inclined to just go with 3 and 4 at the moment and */ /* I'm inclined to just go with 3 and 4 at the moment and */
/* maybe try to support the others later */ /* maybe try to support the others later */
BufferParams & param = lv_->buffer()->params; BufferParams & param = lv_.buffer()->params;
int data = 0; int data = 0;
if (ob == bullets_->radio_bullet_depth_1) if (ob == bullets_->radio_bullet_depth_1)
@ -1413,7 +1413,7 @@ void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/)
/* to that extracted from the current chosen position of the BMTable */ /* to that extracted from the current chosen position of the BMTable */
/* Don't forget to free the button's old pixmap first. */ /* Don't forget to free the button's old pixmap first. */
BufferParams & param = lv_->buffer()->params; BufferParams & param = lv_.buffer()->params;
int bmtable_button = fl_get_bmtable(ob); int bmtable_button = fl_get_bmtable(ob);
/* try to keep the button held down till another is pushed */ /* try to keep the button held down till another is pushed */
@ -1430,13 +1430,13 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
if (!ob) if (!ob)
ob = class_->choice_doc_class; ob = class_->choice_doc_class;
lv_->prohibitInput(); lv_.prohibitInput();
unsigned int tc = combo_doc_class->get() - 1; unsigned int tc = combo_doc_class->get() - 1;
if (textclasslist[tc].load()) { if (textclasslist[tc].load()) {
// we use a copy of the bufferparams because we do not // we use a copy of the bufferparams because we do not
// want to modify them yet. // want to modify them yet.
BufferParams params = lv_->buffer()->params; BufferParams params = lv_.buffer()->params;
if (lyxrc.auto_reset_options) { if (lyxrc.auto_reset_options) {
params.textclass = tc; params.textclass = tc;
@ -1454,9 +1454,9 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
Alert::alert(_("Conversion Errors!"), Alert::alert(_("Conversion Errors!"),
_("Unable to switch to new document class."), _("Unable to switch to new document class."),
_("Reverting to original document class.")); _("Reverting to original document class."));
combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1); combo_doc_class->select(int(lv_.buffer()->params.textclass) + 1);
} }
lv_->allowInput(); lv_.allowInput();
} }

View File

@ -35,7 +35,7 @@ struct FD_document_bullet;
*/ */
class FormDocument : public FormBaseBD { class FormDocument : public FormBaseBD {
public: public:
FormDocument(LyXView *, Dialogs *); FormDocument(LyXView &, Dialogs &);
/// ///
static void ComboInputCB(int, void *, Combox *); static void ComboInputCB(int, void *, Combox *);
private: private:

View File

@ -3,7 +3,7 @@
* Copyright 2000-2001 The LyX Team. * Copyright 2000-2001 The LyX Team.
* See the file COPYING. * See the file COPYING.
* *
* \author Angus Leeming, a.leeming@ic.ac.uk * \author Angus Leeming <leeming@lyx.org>
*/ */
#include <config.h> #include <config.h>
@ -14,24 +14,22 @@
#pragma implementation #pragma implementation
#endif #endif
#include "Dialogs.h"
#include "frontends/LyXView.h"
#include "FormInset.h" #include "FormInset.h"
#include "xformsBC.h"
#include "insets/insetcommand.h" #include "frontends/Dialogs.h"
#include <boost/bind.hpp> #include <boost/bind.hpp>
FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t) FormInset::FormInset(LyXView & lv, Dialogs & d, string const & t)
: FormBaseBD(lv, d, t) : FormBaseBD(lv, d, t)
{} {}
void FormInset::connect() void FormInset::connect()
{ {
u_ = d_->updateBufferDependent. u_ = d_.updateBufferDependent.
connect(boost::bind(&FormInset::updateSlot, this, _1)); connect(boost::bind(&FormInset::updateSlot, this, _1));
h_ = d_->hideBufferDependent. h_ = d_.hideBufferDependent.
connect(boost::bind(&FormInset::hide, this)); connect(boost::bind(&FormInset::hide, this));
FormBaseDeprecated::connect(); FormBaseDeprecated::connect();
} }
@ -51,46 +49,3 @@ void FormInset::updateSlot(bool switched)
else else
update(); update();
} }
FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t)
: FormInset(lv, d, t),
inset_(0)
{}
void FormCommand::disconnect()
{
inset_ = 0;
params = InsetCommandParams(string());
FormInset::disconnect();
}
void FormCommand::showInset(InsetCommand * inset)
{
if (inset == 0) return; // maybe we should Assert this?
// If connected to another inset, disconnect from it.
if (inset_)
ih_.disconnect();
inset_ = inset;
params = inset->params();
ih_ = inset->hideDialog.connect(boost::bind(&FormCommand::hide, this));
show();
}
void FormCommand::createInset(string const & arg)
{
if (inset_) {
ih_.disconnect();
inset_ = 0;
}
params.setFromString(arg);
if (!arg.empty())
bc().valid(); // so that the user can press Ok
show();
}

View File

@ -4,7 +4,7 @@
* Copyright 2000-2001 the LyX Team * Copyright 2000-2001 the LyX Team
* Read the file COPYING * Read the file COPYING
* *
* \author Angus Leeming, a.leeming@ic.ac.uk * \author Angus Leeming <leeming@lyx.org>
*/ */
/* A base class for dialogs connected to insets. This class is temporary in that /* A base class for dialogs connected to insets. This class is temporary in that
@ -30,7 +30,7 @@ class InsetCommand;
class FormInset : public FormBaseBD { class FormInset : public FormBaseBD {
protected: protected:
/// Constructor /// Constructor
FormInset(LyXView *, Dialogs *, string const &); FormInset(LyXView &, Dialogs &, string const &);
/// Connect signals. Also perform any necessary initialisation. /// Connect signals. Also perform any necessary initialisation.
virtual void connect(); virtual void connect();
@ -44,27 +44,4 @@ protected:
boost::signals::connection ih_; boost::signals::connection ih_;
}; };
/** This class is an XForms GUI base class to insets derived from
InsetCommand
*/
class FormCommand : public FormInset {
protected:
/// Constructor
FormCommand(LyXView *, Dialogs *, string const &);
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
/// Slot launching dialog to (possibly) create a new inset
void createInset(string const &);
/// Slot launching dialog to an existing inset
void showInset(InsetCommand *);
/// pointer to the inset passed through showInset
InsetCommand * inset_;
/// the nitty-griity. What is modified and passed back
InsetCommandParams params;
};
#endif #endif

View File

@ -3,7 +3,7 @@
* Copyright 2000-2001 The LyX Team. * Copyright 2000-2001 The LyX Team.
* See the file COPYING. * See the file COPYING.
* *
* \author Angus Leeming, a.leeming@ic.ac.uk * \author Angus Leeming <leeming@lyx.org>
*/ */
#include <config.h> #include <config.h>
@ -72,7 +72,7 @@ Converters local_converters;
FormPreferences::FormPreferences(LyXView & lv, Dialogs & d) FormPreferences::FormPreferences(LyXView & lv, Dialogs & d)
: FormBaseBI(&lv, &d, _("Preferences"), false), : FormBaseBI(lv, d, _("Preferences"), false),
colors_(*this), converters_(*this), inputs_misc_(*this), colors_(*this), converters_(*this), inputs_misc_(*this),
formats_(*this), interface_(*this), language_(*this), formats_(*this), interface_(*this), language_(*this),
lnf_misc_(*this), outputs_misc_(*this), paths_(*this), lnf_misc_(*this), outputs_misc_(*this), paths_(*this),
@ -132,7 +132,7 @@ void FormPreferences::ok()
colors_.modifiedXformsPrefs = !XformsColor::write(filename); colors_.modifiedXformsPrefs = !XformsColor::write(filename);
} }
lv_->dispatch(FuncRequest(LFUN_SAVEPREFERENCES)); lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
} }
@ -415,7 +415,7 @@ void FormPreferences::Colors::apply()
setCursorColor(GUI_COLOR_CURSOR); setCursorColor(GUI_COLOR_CURSOR);
} }
} }
parent_.lv_->getDialogs().redrawGUI(); parent_.lv_.getDialogs().redrawGUI();
} }
// Now do the same for the LyX LColors... // Now do the same for the LyX LColors...
@ -437,7 +437,7 @@ void FormPreferences::Colors::apply()
string const s = lcolor.getLyXName(lc) + string(" ") + string const s = lcolor.getLyXName(lc) + string(" ") +
hexname; hexname;
parent_.lv_->dispatch(FuncRequest(LFUN_SET_COLOR, s)); parent_.lv_.dispatch(FuncRequest(LFUN_SET_COLOR, s));
} }
} }
} }
@ -744,7 +744,7 @@ void FormPreferences::Colors::LoadBrowserLyX()
<< "\". Set to \"black\"!" << endl; << "\". Set to \"black\"!" << endl;
string const arg = lcolor.getLyXName(lc) + " black"; string const arg = lcolor.getLyXName(lc) + " black";
parent_.lv_->dispatch(FuncRequest(LFUN_SET_COLOR, arg)); parent_.lv_.dispatch(FuncRequest(LFUN_SET_COLOR, arg));
continue; continue;
} }
@ -2556,7 +2556,7 @@ void FormPreferences::ScreenFonts::apply() const
if (changed) { if (changed) {
// Now update the buffers // Now update the buffers
// Can anything below here affect the redraw process? // Can anything below here affect the redraw process?
parent_.lv_->dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE)); parent_.lv_.dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
} }
} }
@ -2979,7 +2979,7 @@ void FormPreferences::browse(FL_OBJECT * inpt,
// Show the file browser dialog // Show the file browser dialog
string const new_filename = string const new_filename =
browseFile(lv_, filename, title, pattern, dir1, dir2); browseFile(&lv_, filename, title, pattern, dir1, dir2);
// Save the filename to the dialog // Save the filename to the dialog
if (new_filename != filename && !new_filename.empty()) { if (new_filename != filename && !new_filename.empty()) {

View File

@ -39,7 +39,7 @@ using std::remove_if;
FormTabular::FormTabular(LyXView & lv, Dialogs & d) FormTabular::FormTabular(LyXView & lv, Dialogs & d)
: FormInset(&lv, &d, _("Tabular Layout")), : FormInset(lv, d, _("Tabular Layout")),
inset_(0), actCell_(-1), closing_(false) inset_(0), actCell_(-1), closing_(false)
{ {
} }
@ -246,7 +246,7 @@ void FormTabular::update()
cell_options_->choice_value_mcolumn_width, cell_options_->choice_value_mcolumn_width,
pwidth, default_unit); pwidth, default_unit);
if (!lv_->buffer()->isReadonly()) { if (!lv_.buffer()->isReadonly()) {
setEnabled(cell_options_->input_special_multialign, true); setEnabled(cell_options_->input_special_multialign, true);
setEnabled(cell_options_->input_mcolumn_width, true); setEnabled(cell_options_->input_mcolumn_width, true);
setEnabled(cell_options_->choice_value_mcolumn_width, true); setEnabled(cell_options_->choice_value_mcolumn_width, true);
@ -322,7 +322,7 @@ void FormTabular::update()
special = tabular->GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN); special = tabular->GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
fl_set_input(column_options_->input_special_alignment, special.c_str()); fl_set_input(column_options_->input_special_alignment, special.c_str());
bool const isReadonly = lv_->buffer()->isReadonly(); bool const isReadonly = lv_.buffer()->isReadonly();
setEnabled(column_options_->input_special_alignment, !isReadonly); setEnabled(column_options_->input_special_alignment, !isReadonly);
pwidth = tabular->GetColumnPWidth(cell); pwidth = tabular->GetColumnPWidth(cell);
@ -548,7 +548,7 @@ bool FormTabular::input(FL_OBJECT * ob, long)
} }
// No point in processing directives that you can't do anything with // No point in processing directives that you can't do anything with
// anyhow, so exit now if the buffer is read-only. // anyhow, so exit now if the buffer is read-only.
if (lv_->buffer()->isReadonly()) { if (lv_.buffer()->isReadonly()) {
update(); update();
return false; return false;
} }
@ -557,7 +557,7 @@ bool FormTabular::input(FL_OBJECT * ob, long)
string const str = string const str =
getLengthFromWidgets(column_options_->input_column_width, getLengthFromWidgets(column_options_->input_column_width,
column_options_->choice_value_column_width); column_options_->choice_value_column_width);
inset_->tabularFeatures(lv_->view().get(), LyXTabular::SET_PWIDTH, str); inset_->tabularFeatures(lv_.view().get(), LyXTabular::SET_PWIDTH, str);
//check if the input is valid //check if the input is valid
string const input = string const input =
@ -576,7 +576,7 @@ bool FormTabular::input(FL_OBJECT * ob, long)
string const str = string const str =
getLengthFromWidgets(cell_options_->input_mcolumn_width, getLengthFromWidgets(cell_options_->input_mcolumn_width,
cell_options_->choice_value_mcolumn_width); cell_options_->choice_value_mcolumn_width);
inset_->tabularFeatures(lv_->view().get(), LyXTabular::SET_MPWIDTH, str); inset_->tabularFeatures(lv_.view().get(), LyXTabular::SET_MPWIDTH, str);
//check if the input is valid //check if the input is valid
string const input = string const input =
@ -689,7 +689,7 @@ bool FormTabular::input(FL_OBJECT * ob, long)
else else
return false; return false;
inset_->tabularFeatures(lv_->view().get(), num, special); inset_->tabularFeatures(lv_.view().get(), num, special);
update(); update();
return true; return true;

View File

@ -143,7 +143,6 @@ libxforms_la_SOURCES = \
FormUrl.h \ FormUrl.h \
FormVCLog.C \ FormVCLog.C \
FormVCLog.h \ FormVCLog.h \
guiapi.C \
LyXKeySymFactory.C \ LyXKeySymFactory.C \
LyXScreenFactory.C \ LyXScreenFactory.C \
MathsSymbols.C \ MathsSymbols.C \