WorkAreaFactory.h \
font_metrics.h \
guiapi.h \
- guiapi.C \
key_state.h \
lyx_gui.h \
mouse_state.h \
* 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>
* GUI.h: public derivation from boost::noncopyable.
* Copyright 2001 The LyX Team.
* See the file COPYING.
*
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming <leeming@lyx.org>
*/
#ifndef GUI_H
*/
template <typename Controller, typename GUIview,
typename Policy, typename GUIbc>
-class GUI : public boost::noncopyable {
+class GUI : boost::noncopyable {
public:
///
GUI(LyXView & lv, Dialogs & d);
* 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>
* FormBaseDeprecated.h: public derivation from boost::noncopyable.
* Copyright 2000-2001 The LyX Team.
* See the file COPYING.
*
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming <leeming@lyx.org>
*/
#include <config.h>
} // extern "C"
-FormBaseDeprecated::FormBaseDeprecated(LyXView * lv, Dialogs * d,
+FormBaseDeprecated::FormBaseDeprecated(LyXView & lv, Dialogs & d,
string const & t, bool allowResize)
: lv_(lv), d_(d), title_(t),
minw_(0), minh_(0), allow_resize_(allowResize),
tooltips_(new Tooltips())
-{
- lyx::Assert(lv && d);
-}
+{}
FormBaseDeprecated::~FormBaseDeprecated()
void FormBaseDeprecated::connect()
{
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));
}
}
-FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t,
+FormBaseBI::FormBaseBI(LyXView & lv, Dialogs & d, string const & t,
bool allowResize)
: FormBaseDeprecated(lv, d, t, allowResize)
{}
void FormBaseBI::connect()
{
- h_ = d_->hideAll.connect(boost::bind(&FormBaseBI::hide, this));
+ h_ = d_.hideAll.connect(boost::bind(&FormBaseBI::hide, this));
FormBaseDeprecated::connect();
}
-FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t,
+FormBaseBD::FormBaseBD(LyXView & lv, Dialogs & d, string const & t,
bool allowResize)
: FormBaseDeprecated(lv, d, t, allowResize)
{}
void FormBaseBD::connect()
{
- u_ = d_->updateBufferDependent.
+ u_ = d_.updateBufferDependent.
connect(boost::bind(&FormBaseBD::updateSlot, this, _1));
- h_ = d_->hideBufferDependent.
+ h_ = d_.hideBufferDependent.
connect(boost::bind(&FormBaseBD::hide, this));
FormBaseDeprecated::connect();
}
* Copyright 2000-2002 the LyX Team
* 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
class LyXView;
class Tooltips;
-class FormBaseDeprecated : public boost::noncopyable, public FeedbackController
+class FormBaseDeprecated : boost::noncopyable, public FeedbackController
{
public:
///
- FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool);
+ FormBaseDeprecated(LyXView &, Dialogs &, string const &, bool);
///
virtual ~FormBaseDeprecated();
* We could modify Dialogs to have a visible LyXFunc* instead and
* save a couple of bytes per dialog.
*/
- LyXView * lv_;
+ LyXView & lv_;
/// Used so we can get at the signals we have to connect to.
- Dialogs * d_;
+ Dialogs & d_;
/// Hide connection.
boost::signals::connection h_;
/// Redraw connection.
class FormBaseBI : public FormBaseDeprecated {
protected:
/// Constructor
- FormBaseBI(LyXView *, Dialogs *, string const &,
+ FormBaseBI(LyXView &, Dialogs &, string const &,
bool allowResize = true);
/// Connect signals
class FormBaseBD : public FormBaseDeprecated {
protected:
/// Constructor
- FormBaseBD(LyXView *, Dialogs *, string const &,
+ FormBaseBD(LyXView &, Dialogs &, string const &,
bool allowResize = true);
/// Connect signals
using Liason::setMinibuffer;
using std::vector;
-FormDocument::FormDocument(LyXView * lv, Dialogs * d)
+FormDocument::FormDocument(LyXView & lv, Dialogs & d)
: FormBaseBD(lv, d, _("Document Layout")),
ActCell(0), Confirmed(0),
current_bullet_panel(0), current_bullet_depth(0), fbullet(0)
void FormDocument::apply()
{
- if (!lv_->view()->available() || !dialog_.get())
+ if (!lv_.view()->available() || !dialog_.get())
return;
bool redo = class_apply();
bullets_apply();
if (redo) {
- lv_->view()->redoCurrentBuffer();
+ lv_.view()->redoCurrentBuffer();
}
- lv_->buffer()->markDirty();
- setMinibuffer(lv_, _("Document layout set"));
+ lv_.buffer()->markDirty();
+ setMinibuffer(&lv_, _("Document layout set"));
}
void FormDocument::cancel()
{
// 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[1] = param.user_defined_bullets[1];
param.temp_bullets[2] = param.user_defined_bullets[2];
checkReadOnly();
- BufferParams const & params = lv_->buffer()->params;
+ BufferParams const & params = lv_.buffer()->params;
class_update(params);
paper_update(params);
language_apply(params);
options_apply(params);
bullets_apply(params);
- params.preamble = lv_->buffer()->params.preamble;
+ params.preamble = lv_.buffer()->params.preamble;
saveParamsAsDefault(params);
}
if (ob == dialog_->button_reset_defaults) {
- BufferParams params = lv_->buffer()->params;
+ BufferParams params = lv_.buffer()->params;
params.textclass = combo_doc_class->get() - 1;
params.useClassDefaults();
UpdateLayoutDocument(params);
bool FormDocument::class_apply()
{
- BufferParams ¶ms = lv_->buffer()->params;
+ BufferParams ¶ms = lv_.buffer()->params;
unsigned int const old_class = params.textclass;
if (textclasslist[params.textclass].load()) {
// successfully loaded
redo = true;
- setMinibuffer(lv_, _("Converting document to new document class..."));
+ setMinibuffer(&lv_, _("Converting document to new document class..."));
int ret = CutAndPaste::SwitchLayoutsBetweenClasses(
old_class, params.textclass,
- &*(lv_->buffer()->paragraphs.begin()),
- lv_->buffer()->params);
+ &*(lv_.buffer()->paragraphs.begin()),
+ lv_.buffer()->params);
if (ret) {
string s;
if (ret == 1) {
void FormDocument::paper_apply()
{
- paper_apply(lv_->buffer()->params);
+ paper_apply(lv_.buffer()->params);
}
if (old_language != new_language
&& old_language->RightToLeft() == new_language->RightToLeft()
- && !lv_->buffer()->isMultiLingual())
- lv_->buffer()->changeLanguage(old_language, new_language);
+ && !lv_.buffer()->isMultiLingual())
+ lv_.buffer()->changeLanguage(old_language, new_language);
if (old_language != new_language) {
redo = true;
bool FormDocument::language_apply()
{
- return language_apply(lv_->buffer()->params);
+ return language_apply(lv_.buffer()->params);
}
bool FormDocument::options_apply()
{
- return options_apply(lv_->buffer()->params);
+ return options_apply(lv_.buffer()->params);
}
void FormDocument::bullets_apply(BufferParams & params)
{
/* update the bullet settings */
- BufferParams & buf_params = lv_->buffer()->params;
+ BufferParams & buf_params = lv_.buffer()->params;
// a little bit of loop unrolling
params.user_defined_bullets[0] = buf_params.temp_bullets[0];
void FormDocument::bullets_apply()
{
- bullets_apply(lv_->buffer()->params);
+ bullets_apply(lv_.buffer()->params);
}
void FormDocument::UpdateClassParams(BufferParams const & params)
(XpmVersion==4 && XpmRevision<7)))
return;
- bool const isLinuxDoc = lv_->buffer()->isLinuxDoc();
+ bool const isLinuxDoc = lv_.buffer()->isLinuxDoc();
setEnabled(fbullet, !isLinuxDoc);
if (isLinuxDoc) return;
void FormDocument::checkReadOnly()
{
- if (bc().readOnly(lv_->buffer()->isReadonly())) {
+ if (bc().readOnly(lv_.buffer()->isReadonly())) {
combo_doc_class->deactivate();
combo_language->deactivate();
postWarning(_("Document is read-only."
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
param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
void FormDocument::InputBulletLaTeX(FL_OBJECT *, long)
{
- BufferParams & param = lv_->buffer()->params;
+ BufferParams & param = lv_.buffer()->params;
param.temp_bullets[current_bullet_depth].
setText(fl_get_input(bullets_->input_bullet_latex));
/* */
/* I'm inclined to just go with 3 and 4 at the moment and */
/* maybe try to support the others later */
- BufferParams & param = lv_->buffer()->params;
+ BufferParams & param = lv_.buffer()->params;
int data = 0;
if (ob == bullets_->radio_bullet_depth_1)
/* to that extracted from the current chosen position of the BMTable */
/* 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);
/* try to keep the button held down till another is pushed */
if (!ob)
ob = class_->choice_doc_class;
- lv_->prohibitInput();
+ lv_.prohibitInput();
unsigned int tc = combo_doc_class->get() - 1;
if (textclasslist[tc].load()) {
// we use a copy of the bufferparams because we do not
// want to modify them yet.
- BufferParams params = lv_->buffer()->params;
+ BufferParams params = lv_.buffer()->params;
if (lyxrc.auto_reset_options) {
params.textclass = tc;
Alert::alert(_("Conversion Errors!"),
_("Unable to switch to new 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();
}
*/
class FormDocument : public FormBaseBD {
public:
- FormDocument(LyXView *, Dialogs *);
+ FormDocument(LyXView &, Dialogs &);
///
static void ComboInputCB(int, void *, Combox *);
private:
* Copyright 2000-2001 The LyX Team.
* See the file COPYING.
*
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming <leeming@lyx.org>
*/
#include <config.h>
#pragma implementation
#endif
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
#include "FormInset.h"
-#include "xformsBC.h"
-#include "insets/insetcommand.h"
+
+#include "frontends/Dialogs.h"
#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)
{}
void FormInset::connect()
{
- u_ = d_->updateBufferDependent.
+ u_ = d_.updateBufferDependent.
connect(boost::bind(&FormInset::updateSlot, this, _1));
- h_ = d_->hideBufferDependent.
+ h_ = d_.hideBufferDependent.
connect(boost::bind(&FormInset::hide, this));
FormBaseDeprecated::connect();
}
else
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();
-}
* Copyright 2000-2001 the LyX Team
* 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
class FormInset : public FormBaseBD {
protected:
/// Constructor
- FormInset(LyXView *, Dialogs *, string const &);
+ FormInset(LyXView &, Dialogs &, string const &);
/// Connect signals. Also perform any necessary initialisation.
virtual void connect();
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
* Copyright 2000-2001 The LyX Team.
* See the file COPYING.
*
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming <leeming@lyx.org>
*/
#include <config.h>
FormPreferences::FormPreferences(LyXView & lv, Dialogs & d)
- : FormBaseBI(&lv, &d, _("Preferences"), false),
+ : FormBaseBI(lv, d, _("Preferences"), false),
colors_(*this), converters_(*this), inputs_misc_(*this),
formats_(*this), interface_(*this), language_(*this),
lnf_misc_(*this), outputs_misc_(*this), paths_(*this),
colors_.modifiedXformsPrefs = !XformsColor::write(filename);
}
- lv_->dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
+ lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
}
setCursorColor(GUI_COLOR_CURSOR);
}
}
- parent_.lv_->getDialogs().redrawGUI();
+ parent_.lv_.getDialogs().redrawGUI();
}
// Now do the same for the LyX LColors...
string const s = lcolor.getLyXName(lc) + string(" ") +
hexname;
- parent_.lv_->dispatch(FuncRequest(LFUN_SET_COLOR, s));
+ parent_.lv_.dispatch(FuncRequest(LFUN_SET_COLOR, s));
}
}
}
<< "\". Set to \"black\"!" << endl;
string const arg = lcolor.getLyXName(lc) + " black";
- parent_.lv_->dispatch(FuncRequest(LFUN_SET_COLOR, arg));
+ parent_.lv_.dispatch(FuncRequest(LFUN_SET_COLOR, arg));
continue;
}
if (changed) {
// Now update the buffers
// Can anything below here affect the redraw process?
- parent_.lv_->dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
+ parent_.lv_.dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
}
}
// Show the file browser dialog
string const new_filename =
- browseFile(lv_, filename, title, pattern, dir1, dir2);
+ browseFile(&lv_, filename, title, pattern, dir1, dir2);
// Save the filename to the dialog
if (new_filename != filename && !new_filename.empty()) {
FormTabular::FormTabular(LyXView & lv, Dialogs & d)
- : FormInset(&lv, &d, _("Tabular Layout")),
+ : FormInset(lv, d, _("Tabular Layout")),
inset_(0), actCell_(-1), closing_(false)
{
}
cell_options_->choice_value_mcolumn_width,
pwidth, default_unit);
- if (!lv_->buffer()->isReadonly()) {
+ if (!lv_.buffer()->isReadonly()) {
setEnabled(cell_options_->input_special_multialign, true);
setEnabled(cell_options_->input_mcolumn_width, true);
setEnabled(cell_options_->choice_value_mcolumn_width, true);
special = tabular->GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
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);
pwidth = tabular->GetColumnPWidth(cell);
}
// No point in processing directives that you can't do anything with
// anyhow, so exit now if the buffer is read-only.
- if (lv_->buffer()->isReadonly()) {
+ if (lv_.buffer()->isReadonly()) {
update();
return false;
}
string const str =
getLengthFromWidgets(column_options_->input_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
string const input =
string const str =
getLengthFromWidgets(cell_options_->input_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
string const input =
else
return false;
- inset_->tabularFeatures(lv_->view().get(), num, special);
+ inset_->tabularFeatures(lv_.view().get(), num, special);
update();
return true;
FormUrl.h \
FormVCLog.C \
FormVCLog.h \
- guiapi.C \
LyXKeySymFactory.C \
LyXScreenFactory.C \
MathsSymbols.C \