#include "undo.h"
#include "insets/inset.h"
-#include "WordLangTuple.h"
#include <boost/utility.hpp>
class Language;
class Painter;
class UpdatableInset;
+class WordLangTuple;
///
class BufferView : boost::noncopyable {
#include "debug.h"
#include "iterators.h"
#include "lyxlex.h"
+#include "WordLangTuple.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
// make sure we update the combo !
owner()->setLayout(getLyXText()->cursor.par()->layout()->name());
// Tell the paragraph dialog that we changed paragraph
- owner()->getDialogs()->updateParagraph();
+ owner()->getDialogs().updateParagraph();
finishUndo();
return 0;
} else if (inset && theLockingInset() &&
theLockingInset()->unlockInsetInInset(this, inset)) {
// Tell the paragraph dialog that we changed paragraph
- owner()->getDialogs()->updateParagraph();
+ owner()->getDialogs().updateParagraph();
// owner inset has updated the layout combo
finishUndo();
return 0;
// Similarly, buffer-dependent dialogs should be updated or
// hidden. This should go here because some dialogs (eg ToC)
// require bv_->text.
- owner_->getDialogs()->updateBufferDependent(true);
+ owner_->getDialogs().updateBufferDependent(true);
} else {
lyxerr[Debug::INFO] << " No Buffer!" << endl;
- owner_->getDialogs()->hideBufferDependent();
+ owner_->getDialogs().hideBufferDependent();
// Also remove all remaining text's from the testcache.
// (there should not be any!) (if there is any it is a
ret = screen().fitCursor(bv_->text, bv_);
}
- bv_->owner()->getDialogs()->updateParagraph();
+ bv_->owner()->getDialogs().updateParagraph();
if (ret)
updateScrollbar();
return ret;
void BufferView::Pimpl::workAreaKeyPress(LyXKeySymPtr key,
key_modifier::state state)
{
- bv_->owner()->getLyXFunc()->processKeySym(key, state);
+ bv_->owner()->getLyXFunc().processKeySym(key, state);
}
// we have to check this first
bool paste_internally = false;
if (button == mouse_button::button2 && bv_->getLyXText()->selection.set()) {
- owner_->getLyXFunc()->dispatch(LFUN_COPY);
+ owner_->getLyXFunc().dispatch(LFUN_COPY);
paste_internally = true;
}
// insert this
if (button == mouse_button::button2) {
if (paste_internally)
- owner_->getLyXFunc()->dispatch(LFUN_PASTE);
+ owner_->getLyXFunc().dispatch(LFUN_PASTE);
else
- owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_PASTESELECTION, "paragraph"));
+ owner_->getLyXFunc().dispatch(FuncRequest(LFUN_PASTESELECTION, "paragraph"));
selection_possible = false;
return;
}
&& !(bv_->theLockingInset()
&& bv_->theLockingInset()->lyxCode()== Inset::ERT_CODE))
{
- if (owner_->getIntl()->keymap == Intl::PRIMARY)
- owner_->getIntl()->KeyMapSec();
+ if (owner_->getIntl().keymap == Intl::PRIMARY)
+ owner_->getIntl().KeyMapSec();
} else {
- if (owner_->getIntl()->keymap == Intl::SECONDARY)
- owner_->getIntl()->KeyMapPrim();
+ if (owner_->getIntl().keymap == Intl::SECONDARY)
+ owner_->getIntl().KeyMapPrim();
}
}
break;
case LFUN_FREE:
- owner_->getDialogs()->setUserFreeFont();
+ owner_->getDialogs().setUserFreeFont();
break;
case LFUN_FILE_INSERT:
// function list/array with information about what
// functions needs arguments and their type.
if (ev.argument.empty()) {
- owner_->getLyXFunc()->setErrorMessage(
+ owner_->getLyXFunc().setErrorMessage(
_("LyX function 'layout' needs an argument."));
break;
}
}
if (!hasLayout) {
- owner_->getLyXFunc()->setErrorMessage(
+ owner_->getLyXFunc().setErrorMessage(
string(N_("Layout ")) + ev.argument +
N_(" not known"));
break;
break;
case LFUN_FONT_STATE:
- owner_->getLyXFunc()->setMessage(currentState(bv_));
+ owner_->getLyXFunc().setMessage(currentState(bv_));
break;
case LFUN_UPCASE_WORD:
case LFUN_REF_INSERT:
if (ev.argument.empty()) {
InsetCommandParams p("ref");
- owner_->getDialogs()->createRef(p.getAsString());
+ owner_->getDialogs().createRef(p.getAsString());
} else {
InsetCommandParams p;
p.setFromString(ev.argument);
&& lt->cursor.par()->isInset(lt->cursor.pos())
&& isHighlyEditableInset(lt->cursor.par()->getInset(lt->cursor.pos()))) {
Inset * tmpinset = lt->cursor.par()->getInset(lt->cursor.pos());
- owner_->getLyXFunc()->setMessage(tmpinset->editMessage());
+ owner_->getLyXFunc().setMessage(tmpinset->editMessage());
if (is_rtl)
tmpinset->edit(bv_, false);
else
lt->cursor.par()->isInset(lt->cursor.pos()) &&
isHighlyEditableInset(lt->cursor.par()->getInset(lt->cursor.pos()))) {
Inset * tmpinset = lt->cursor.par()->getInset(lt->cursor.pos());
- owner_->getLyXFunc()->setMessage(tmpinset->editMessage());
+ owner_->getLyXFunc().setMessage(tmpinset->editMessage());
if (is_rtl)
tmpinset->edit(bv_);
else
update(lt,
BufferView::SELECT
| BufferView::FITCUR);
- owner_->getLyXFunc()->setMessage(N_("Mark removed"));
+ owner_->getLyXFunc().setMessage(N_("Mark removed"));
} else {
beforeChange(lt);
lt->selection.mark(true);
update(lt,
BufferView::SELECT
| BufferView::FITCUR);
- owner_->getLyXFunc()->setMessage(N_("Mark set"));
+ owner_->getLyXFunc().setMessage(N_("Mark set"));
}
lt->selection.cursor = lt->cursor;
}
beforeChange(lt);
update(lt, BufferView::SELECT|BufferView::FITCUR);
lt->selection.cursor = lt->cursor;
- owner_->getLyXFunc()->setMessage(N_("Mark off"));
+ owner_->getLyXFunc().setMessage(N_("Mark off"));
}
break;
lt->selection.mark(true);
update(lt, BufferView::SELECT|BufferView::FITCUR);
lt->selection.cursor = lt->cursor;
- owner_->getLyXFunc()->setMessage(N_("Mark on"));
+ owner_->getLyXFunc().setMessage(N_("Mark on"));
}
break;
LyXText * lt = bv_->getLyXText();
if (!lt->selection.set()) {
- if (owner_->getIntl()->getTransManager().backspace()) {
+ if (owner_->getIntl().getTransManager().backspace()) {
lt->backspace(bv_);
lt->selection.cursor = lt->cursor;
update(lt,
p.setCmdName("htmlurl");
else
p.setCmdName("url");
- owner_->getDialogs()->createUrl(p.getAsString());
+ owner_->getDialogs().createUrl(p.getAsString());
}
break;
case LFUN_TABULAR_INSERT:
{
if (ev.argument.empty()) {
- owner_->getDialogs()->showTabularCreate();
+ owner_->getDialogs().showTabularCreate();
break;
}
{
pos_type pos = bv_->getLyXText()->cursor.pos();
if (pos < bv_->getLyXText()->cursor.par()->size())
- owner_->getLyXFunc()->setMessage(
+ owner_->getLyXFunc().setMessage(
tostr(bv_->getLyXText()->cursor.par()->getChar(pos)));
else
- owner_->getLyXFunc()->setMessage("EOF");
+ owner_->getLyXFunc().setMessage("EOF");
}
break;
case LFUN_GETXY:
- owner_->getLyXFunc()->setMessage(tostr(bv_->getLyXText()->cursor.x())
+ owner_->getLyXFunc().setMessage(tostr(bv_->getLyXText()->cursor.x())
+ ' '
+ tostr(bv_->getLyXText()->cursor.y()));
break;
break;
case LFUN_GETLAYOUT:
- owner_->getLyXFunc()->setMessage(tostr(bv_->getLyXText()->cursor.par()->layout()));
+ owner_->getLyXFunc().setMessage(tostr(bv_->getLyXText()->cursor.par()->layout()));
break;
case LFUN_GETFONT:
{
LyXFont & font = bv_->getLyXText()->current_font;
if (font.shape() == LyXFont::ITALIC_SHAPE)
- owner_->getLyXFunc()->setMessage("E");
+ owner_->getLyXFunc().setMessage("E");
else if (font.shape() == LyXFont::SMALLCAPS_SHAPE)
- owner_->getLyXFunc()->setMessage("N");
+ owner_->getLyXFunc().setMessage("N");
else
- owner_->getLyXFunc()->setMessage("0");
+ owner_->getLyXFunc().setMessage("0");
}
break;
case LFUN_OGONEK:
if (ev.argument.empty()) {
// As always...
- owner_->getLyXFunc()->handleKeyFunc(ev.action);
+ owner_->getLyXFunc().handleKeyFunc(ev.action);
} else {
- owner_->getLyXFunc()->handleKeyFunc(ev.action);
- owner_->getIntl()->getTransManager()
+ owner_->getLyXFunc().handleKeyFunc(ev.action);
+ owner_->getIntl().getTransManager()
.TranslateAndInsert(ev.argument[0], bv_->getLyXText());
update(bv_->getLyXText(),
BufferView::SELECT
}
if (entry.empty()) {
- owner_->getDialogs()->createIndex();
+ owner_->getDialogs().createIndex();
break;
}
delete inset;
else {
updateInset(inset, true);
- bv_->owner()->getDialogs()->showInclude(inset);
+ bv_->owner()->getDialogs().showInclude(inset);
}
}
break;
}
}
- bv_->owner()->getDialogs()->showThesaurus(arg);
+ bv_->owner()->getDialogs().showThesaurus(arg);
}
break;
string::const_iterator cit = ev.argument.begin();
string::const_iterator end = ev.argument.end();
for (; cit != end; ++cit) {
- owner_->getIntl()->getTransManager().
+ owner_->getIntl().getTransManager().
TranslateAndInsert(*cit, lt);
}
break;
case LFUN_UNKNOWN_ACTION:
- owner_->getLyXFunc()->setErrorMessage(N_("Unknown function!"));
+ owner_->getLyXFunc().setErrorMessage(N_("Unknown function!"));
break;
default:
if (style->pass_thru ||
(!insertInset(new InsetQuotes(c, bv_->buffer()->params))))
- bv_->owner()->getLyXFunc()
- ->dispatch(FuncRequest(LFUN_SELFINSERT, "\""));
+ bv_->owner()->getLyXFunc().
+ dispatch(FuncRequest(LFUN_SELFINSERT, "\""));
}
if (insertInset(inset)) {
inset->edit(bv_);
if (gotsel)
- owner_->getLyXFunc()->dispatch(LFUN_PASTESELECTION);
+ owner_->getLyXFunc().dispatch(LFUN_PASTESELECTION);
}
else
delete inset;
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * BufferView2.C:
+ * BufferView_pimpl.C:
+ * buffer.C:
+ * converter.C:
+ * importer.C:
+ * lyxfunc.C:
+ * lyxvc.C:
+ * toc.C:
+ * vc-backend.C:
+ changes due to the changed LyXView interface that now returns references
+ to member variables not pointers.
+
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * WordLangTuple (word, lang_code): return references to strings,
+ not strings.
+
+ * BufferView.h:
+ * SpellBase.h:
+ * lyxtext.h: forward-declare WordLangTuple.
+
+ * BufferView2.C:
+ * ispell.C:
+ * pspell.C:
+ * text.C: #include "WordLangTuple.h".
+
+ * lyxtext.h:
+ * text.C: (selectNextWordToSpellcheck): constify return type.
+
2002-08-12 Martin Vermeer <martin.vermeer@hut.fi>
* buffer.C:
#include "LString.h" // can't forward declare...
-#include "WordLangTuple.h"
-
class BufferParams;
+class WordLangTuple;
/**
* Base class of all spell checker implementations.
#ifndef WORD_LANG_TUPLE_H
#define WORD_LANG_TUPLE_H
-#include <config.h>
#include "LString.h"
/**
{}
/// return the word
- string const word() const {
+ string const & word() const {
return word_;
}
/// return its language code
- string const lang_code() const {
+ string const & lang_code() const {
return code_;
}
if (read_only != flag) {
read_only = flag;
updateTitles();
- users->owner()->getDialogs()->updateBufferDependent(false);
+ users->owner()->getDialogs().updateBufferDependent(false);
}
}
LaTeX latex(command, name, buffer->filePath());
TeXErrors terr;
int result = latex.run(terr,
- bv ? bv->owner()->getLyXFunc() : 0);
+ bv ? &bv->owner()->getLyXFunc() : 0);
if (bv) {
if ((result & LaTeX::ERRORS)) {
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * LyXView.[Ch]:
+ (getLyXFunc, getToolbar, getMenubar, getDialogs, getIntl): all now
+ return a reference not a pointer.
+ (controlcommand_, intl_, autosave_timeout_): employ the
+ const scoped_ptr idiom.
+
2002-08-12 Angus Leeming <leeming@lyx.org>
* DialogBase.h: no longer derive from boost::signals::trackable.
LyXView::LyXView()
+ : controlcommand_(new ControlCommandBuffer(getLyXFunc())),
+ intl_(new Intl),
+ autosave_timeout_(new Timeout(5000)),
+ lyxfunc_(new LyXFunc(this)),
+ dialogs_(new Dialogs(this))
{
lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
-
- lyxfunc_.reset(new LyXFunc(this));
- intl_.reset(new Intl);
-
- // Give the timeout some default sensible value.
- autosave_timeout_.reset(new Timeout(5000));
-
- dialogs_.reset(new Dialogs(this));
- controlcommand_.reset(new ControlCommandBuffer(*getLyXFunc()));
}
}
-Toolbar * LyXView::getToolbar() const
-{
- return toolbar_.get();
-}
-
-
void LyXView::setLayout(string const & layout)
{
toolbar_->setLayout(layout);
}
-LyXFunc * LyXView::getLyXFunc() const
-{
- return lyxfunc_.get();
-}
-
-
-Menubar * LyXView::getMenubar() const
-{
- return menubar_.get();
-}
-
-
void LyXView::updateMenubar()
{
menubar_->update();
}
-Intl * LyXView::getIntl() const
-{
- return intl_.get();
-}
-
-
void LyXView::autoSave()
{
lyxerr[Debug::INFO] << "Running autoSave()" << endl;
*/
boost::shared_ptr<BufferView> const & view() const;
- /// return the LyX function handler for this view
- LyXFunc * getLyXFunc() const;
-
/// return the buffer currently shown in this window
Buffer * buffer() const;
+ /// return the LyX function handler for this view
+ LyXFunc & getLyXFunc() { return *lyxfunc_.get(); }
+ ///
+ LyXFunc const & getLyXFunc() const { return *lyxfunc_.get(); }
+
/// return the toolbar for this view
- Toolbar * getToolbar() const;
+ Toolbar & getToolbar() { return *toolbar_.get(); }
+ ///
+ Toolbar const & getToolbar() const { return *toolbar_.get(); }
/// return the menubar for this view
- Menubar * getMenubar() const;
+ Menubar & getMenubar() { return *menubar_.get(); }
+ ///
+ Menubar const & getMenubar() const { return *menubar_.get(); }
/// get access to the dialogs
- Dialogs * getDialogs() { return dialogs_.get(); }
+ Dialogs & getDialogs() { return *dialogs_.get(); }
+ ///
+ Dialogs const & getDialogs() const { return *dialogs_.get(); }
/// get this view's keyboard map handler
- Intl * getIntl() const;
+ Intl & getIntl() { return *intl_.get(); }
+ ///
+ Intl const & getIntl() const { return *intl_.get(); }
//@}
void resetAutosaveTimer();
protected:
- /// view of a buffer. FuncRequestually there will be several.
+ /// view of a buffer. Eventtually there will be several.
boost::shared_ptr<BufferView> bufferview_;
/// view's menubar
/// view's toolbar
boost::scoped_ptr<Toolbar> toolbar_;
/// view's command buffer controller
- boost::scoped_ptr<ControlCommandBuffer> controlcommand_;
-
- /// keyboard mapping object
- boost::scoped_ptr<Intl> intl_;
-
- /// auto-saving of buffers
- boost::scoped_ptr<Timeout> autosave_timeout_;
-
- /// called on timeout
- void autoSave();
+ boost::scoped_ptr<ControlCommandBuffer> const controlcommand_;
private:
/**
*/
virtual void setWindowTitle(string const & t, string const & it) = 0;
+ /// called on timeout
+ void autoSave();
+
+ /// keyboard mapping object
+ boost::scoped_ptr<Intl> const intl_;
+ /// auto-saving of buffers
+ boost::scoped_ptr<Timeout> const autosave_timeout_;
/// our function handler
boost::scoped_ptr<LyXFunc> lyxfunc_;
/// dialogs for this view
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * ControlConnections.C:
+ * ControlTexinfo.C:
+ changes due to the changed LyXView interface that now returns references
+ to member variables not pointers.
+
2002-08-12 Angus Leeming <leeming@lyx.org>
* ControlConnections.[Ch]: (isReadonly): renamed as bufferIsReadonly.
* ControlSpellchecker.C: some cleanups
* ControlTabularCreate.C: s/LFUN_INSET_TABULAR/LFUN_TABULAR_INSERT/
-
+ <
2002-08-02 Edwin Leuven <leuven@fee.uva.nl>
* ControlParagraph.[Ch] (changedParagraph): new method invoked when
2002-08-01 John Levon <levon@movementarian.org>
* ControlSendto.C: writeFile() change
-
+
2002-08-01 John Levon <levon@movementarian.org>
* ControlSpellchecker.h:
LyXFunc & ControlConnectBase::lyxfunc()
{
- return *lv_.getLyXFunc();
+ return lv_.getLyXFunc();
}
LyXFunc const & ControlConnectBase::lyxfunc() const
{
- return *lv_.getLyXFunc();
+ return lv_.getLyXFunc();
}
/// The actual spellchecker object
SpellBase * speller_;
-
};
#endif // CONTROLSPELLCHECKER_H
void ControlTexinfo::viewFile(string const filename) const
{
- lv_.getDialogs()->showFile(filename);
+ lv_.getDialogs().showFile(filename);
}
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * Qt2Base.h: compile fix isReadonly -> bufferIsReadonly.
+
+ * FileDialog_private.C:
+ * Menubar_pimpl.C:
+ * Toolbar_pimpl.C:
+ * QtView.C:
+ * lyx_gui.C:
+ changes due to the changed LyXView interface that now returns references
+ to member variables not pointers.
+
2002-08-12 Angus Leeming <leeming@lyx.org>
* Menubar_pimpl.C: no need to #include "Dialogs.h". Remove semi-colon
}
if (what == QDialog::Accepted)
- lv_->getLyXFunc()->dispatch(FuncRequest(action_, selectedFile().data()));
+ lv_->getLyXFunc().dispatch(FuncRequest(action_, selectedFile().data()));
delete this;
}
for (; m != end; ++m) {
if (m->action() > 0) {
FuncStatus const status =
- owner_->getLyXFunc()->getStatus(m->action());
+ owner_->getLyXFunc().getStatus(m->action());
if (!status.disabled())
enable = true;
}
if (i.id_ < 0)
return;
- FuncStatus const status = owner_->getLyXFunc()->getStatus(i.id_);
+ FuncStatus const status = owner_->getLyXFunc().getStatus(i.id_);
i.parent_->setItemEnabled(i.id_, !status.disabled());
i.parent_->setItemChecked(i.id_, status.onoff(true));
}
{
public:
bool readOnly() const {
- return controller().isReadonly();
+ return controller().bufferIsReadonly();
}
protected:
void QtView::activated(int id)
{
- getLyXFunc()->dispatch(id, true);
+ getLyXFunc().dispatch(id, true);
}
int action = p->second;
FuncStatus const status =
- owner_->getLyXFunc()->getStatus(action);
+ owner_->getLyXFunc().getStatus(action);
button->setToggleButton(true);
button->setOn(status.onoff(true));
}
if (combo_)
- combo_->setEnabled(!owner_->getLyXFunc()->getStatus(LFUN_LAYOUT).disabled());
+ combo_->setEnabled(!owner_->getLyXFunc().getStatus(LFUN_LAYOUT).disabled());
}
return;
}
- owner_->getLyXFunc()->dispatch(cit->second, true);
+ owner_->getLyXFunc().dispatch(cit->second, true);
}
for (LyXTextClass::const_iterator cit = tc.begin();
cit != end; ++cit) {
if (_((*cit)->name()) == sel) {
- owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
+ owner_->getLyXFunc().dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
return;
}
}
// FIXME: some code below needs moving
- lyxserver = new LyXServer(view.getLyXFunc(), lyxrc.lyxpipes);
+ lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
vector<string>::const_iterator cit = files.begin();
vector<string>::const_iterator end = files.end();
// handle the batch commands the user asked for
if (!batch.empty()) {
- view.getLyXFunc()->dispatch(batch);
+ view.getLyXFunc().dispatch(batch);
}
qApp->exec();
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * FileDialog.C:
+ * FormMathsDelim.C:
+ * FormMathsMatrix.C:
+ * FormMathsPanel.C:
+ * FormPreferences.C:
+ * Menubar_pimpl.C:
+ * Toolbar_pimpl.C:
+ * XFormsView.C:
+ * lyx_gui.C:
+ changes due to the changed LyXView interface that now returns references
+ to member variables not pointers.
+
2002-08-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.C (create_submenu): fix code to disable submenu
FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
: private_(0), lv_(lv), title_(t), success_(s)
{
- private_ = new FileDialog::Private(*lv->getDialogs());
+ private_ = new FileDialog::Private(lv->getDialogs());
private_->SetButton(0, b1.first, b1.second);
private_->SetButton(1, b2.first, b2.second);
ostringstream ost;
ost << delim_values[left] << ' ' << delim_values[right];
- lv_->getLyXFunc()->
+ lv_->getLyXFunc().
dispatch(FuncRequest(LFUN_MATH_DELIM, ost.str().c_str()), false);
}
ostringstream ost;
ost << nx << ' ' << ny << ' ' << c << ' ' << sh;
- lv_->getLyXFunc()->
+ lv_->getLyXFunc().
dispatch(FuncRequest(LFUN_INSERT_MATRIX, ost.str().c_str()));
}
break;
case MM_SUPER:
- //lv_->getLyXFunc()->dispatch(LFUN_MATH_MODE);
- lv_->getLyXFunc()->dispatch(LFUN_SUPERSCRIPT);
+ //lv_->getLyXFunc().dispatch(LFUN_MATH_MODE);
+ lv_->getLyXFunc().dispatch(LFUN_SUPERSCRIPT);
break;
case MM_SUB:
- //lv_->getLyXFunc()->dispatch(LFUN_MATH_MODE);
- lv_->getLyXFunc()->dispatch(LFUN_SUBSCRIPT);
+ //lv_->getLyXFunc().dispatch(LFUN_MATH_MODE);
+ lv_->getLyXFunc().dispatch(LFUN_SUBSCRIPT);
break;
case MM_SUBSUPER:
- lv_->getLyXFunc()->dispatch(LFUN_SUBSCRIPT);
- lv_->getLyXFunc()->dispatch(LFUN_LEFT);
- lv_->getLyXFunc()->dispatch(LFUN_SUPERSCRIPT);
+ lv_->getLyXFunc().dispatch(LFUN_SUBSCRIPT);
+ lv_->getLyXFunc().dispatch(LFUN_LEFT);
+ lv_->getLyXFunc().dispatch(LFUN_SUPERSCRIPT);
break;
case MM_DELIM:
void FormMathsPanel::insertSymbol(string const & sym, bool bs) const
{
if (bs)
- lv_->getLyXFunc()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + sym));
+ lv_->getLyXFunc().dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + sym));
else
- lv_->getLyXFunc()->dispatch(FuncRequest(LFUN_INSERT_MATH, sym));
+ lv_->getLyXFunc().dispatch(FuncRequest(LFUN_INSERT_MATH, sym));
}
void FormMathsPanel::dispatchFunc(kb_action action) const
{
- lv_->getLyXFunc()->dispatch(action);
+ lv_->getLyXFunc().dispatch(action);
}
void FormMathsPanel::mathDisplay() const
{
- lv_->getLyXFunc()->dispatch(LFUN_MATH_DISPLAY);
+ lv_->getLyXFunc().dispatch(LFUN_MATH_DISPLAY);
}
colors_.modifiedXformsPrefs = !XformsColor::write(filename);
}
- lv_->getLyXFunc()->dispatch(LFUN_SAVEPREFERENCES);
+ lv_->getLyXFunc().dispatch(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_->getLyXFunc()->dispatch(FuncRequest(LFUN_SET_COLOR, s));
+ parent_.lv_->getLyXFunc().dispatch(FuncRequest(LFUN_SET_COLOR, s));
}
}
}
<< "\". Set to \"black\"!" << endl;
string const arg = lcolor.getLyXName(lc) + " black";
- parent_.lv_->getLyXFunc()->
+ parent_.lv_->getLyXFunc().
dispatch(FuncRequest(LFUN_SET_COLOR, arg));
continue;
}
if (changed) {
// Now update the buffers
// Can anything below here affect the redraw process?
- parent_.lv_->getLyXFunc()->dispatch(LFUN_SCREEN_FONT_UPDATE);
+ parent_.lv_->getLyXFunc().dispatch(LFUN_SCREEN_FONT_UPDATE);
}
}
if (i->kind() == MenuItem::Separator)
*last = "%l";
else if (!i->optional() ||
- !(view->getLyXFunc()->getStatus(i->action()).disabled()))
+ !(view->getLyXFunc().getStatus(i->action()).disabled()))
last = it;
it = extra_labels.begin();
switch (item.kind()) {
case MenuItem::Command: {
FuncStatus const flag =
- view->getLyXFunc()->getStatus(item.action());
+ view->getLyXFunc().getStatus(item.action());
// handle optional entries.
if (item.optional()
&& (flag.disabled())) {
// If the action value is too low, then it is not a
// valid action, but something else.
if (choice >= action_offset + 1) {
- view->getLyXFunc()->dispatch(choice - action_offset, true);
+ view->getLyXFunc().dispatch(choice - action_offset, true);
} else {
lyxerr[Debug::GUI]
<< "MenuCallback: ignoring bogus action "
ToolbarList::const_iterator end = toollist_.end();
for (; p != end; ++p) {
if (p->action == ToolbarDefaults::LAYOUTS && combox_) {
- if (owner_->getLyXFunc()->getStatus(LFUN_LAYOUT).disabled())
+ if (owner_->getLyXFunc().getStatus(LFUN_LAYOUT).disabled())
combox_->deactivate();
else
combox_->activate();
if (!p->icon)
continue;
- FuncStatus const status = owner_->getLyXFunc()->getStatus(p->action);
+ FuncStatus const status = owner_->getLyXFunc().getStatus(p->action);
if (status.onoff(true)) {
// I'd like to use a different color
// here, but then the problem is to
for (LyXTextClass::const_iterator cit = tc.begin();
cit != end; ++cit) {
if (_((*cit)->name()) == layoutguiname) {
- owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
+ owner_->getLyXFunc().dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
return;
}
}
{
XFormsView * owner = static_cast<XFormsView *>(ob->u_vdata);
- owner->getLyXFunc()->dispatch(int(ac), true);
+ owner->getLyXFunc().dispatch(int(ac), true);
}
// Make sure the buttons are disabled if needed.
updateToolbar();
- redraw_con = getDialogs()->redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
+ redraw_con = getDialogs().redrawGUI.connect(boost::bind(&XFormsView::redraw, this));
}
void XFormsView::show_view_state()
{
- message(getLyXFunc()->view_status_message());
+ message(getLyXFunc().view_status_message());
}
// FIXME: some code below needs moving
- lyxserver = new LyXServer(view.getLyXFunc(), lyxrc.lyxpipes);
+ lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
vector<string>::const_iterator cit = files.begin();
vector<string>::const_iterator end = files.end();
// handle the batch commands the user asked for
if (!batch.empty()) {
- view.getLyXFunc()->dispatch(batch);
+ view.getLyXFunc().dispatch(batch);
}
// enter the event loop
: ChangeExtension(filename,
formats.extension(loader_format));
InsertAsciiFile(lv->view().get(), filename2, as_paragraphs);
- lv->getLyXFunc()->dispatch(LFUN_MARK_OFF);
+ lv->getLyXFunc().dispatch(LFUN_MARK_OFF);
}
// we are done
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * insetbib.C:
+ * insetcite.C:
+ * inseterror.C:
+ * insetert.C:
+ * insetexternal.C:
+ * insetfloat.C:
+ * insetfloatlist.C:
+ * insetgraphics.C:
+ * insetinclude.C:
+ * insetindex.C:
+ * insetminipage.C:
+ * insetparent.C:
+ * insetref.C:
+ * insettabular.C:
+ * insettext.C:
+ * insettoc.C:
+ * inseturl.C:
+ changes due to the changed LyXView interface that now returns references
+ to member variables not pointers.
+
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * inset.h:
+ * insetcollapsable.h:
+ * insetert.h:
+ * insettabular.h:
+ * insettext.h: forward-declare WordLangTuple
+ (selectNextWordToSpellcheck) constify return type.
+
+ * inset.C:
+ * insetcollapsable.C:
+ * insetert.C:
+ * insettabular.C:
+ * insettext.C: #include "WordLangTuple.h" and rearrange included files.
+
2002-08-12 Angus Leeming <leeming@lyx.org>
* insetgraphicsParams.C: fix reading of lyxsize_type in 1.2.0 documents.
#endif
#include "inset.h"
-#include "debug.h"
+
#include "BufferView.h"
-#include "support/lstrings.h"
-#include "frontends/Painter.h"
-#include "frontends/mouse_state.h"
+#include "debug.h"
#include "funcrequest.h"
-#include "support/lstrings.h"
#include "gettext.h"
-#include "lyxfont.h"
#include "lyxcursor.h"
+#include "lyxfont.h"
#include "lyxtext.h"
+#include "WordLangTuple.h"
+
+#include "frontends/Painter.h"
+#include "frontends/mouse_state.h"
+
+#include "support/lstrings.h"
+#include "support/lstrings.h"
using std::endl;
}
-WordLangTuple UpdatableInset::selectNextWordToSpellcheck(BufferView *bv,
- float & value) const
+WordLangTuple const
+UpdatableInset::selectNextWordToSpellcheck(BufferView *bv, float & value) const
{
// we have to unlock ourself in this function by default!
bv->unlockInset(const_cast<UpdatableInset *>(this));
#include "LString.h"
#include "LColor.h"
#include "frontends/mouse_state.h"
-#include "WordLangTuple.h"
class LyXFont;
class BufferView;
class Paragraph;
class LyXCursor;
class FuncRequest;
+class WordLangTuple;
struct LaTeXFeatures;
///
virtual bool allowSpellcheck() { return false; }
///
- virtual WordLangTuple selectNextWordToSpellcheck(BufferView *, float & value) const;
+ virtual WordLangTuple const
+ selectNextWordToSpellcheck(BufferView *, float & value) const;
///
virtual void selectSelectedWord(BufferView *) { return; }
///
void InsetBibKey::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showBibitem(this);
+ bv->owner()->getDialogs().showBibitem(this);
}
void InsetBibtex::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showBibtex(this);
+ bv->owner()->getDialogs().showBibtex(this);
}
// Doesn't matter if there is no bv->buffer() entry in the map.
loading_buffer[bv->buffer()] = false;
- bv->owner()->getDialogs()->showCitation(this);
+ bv->owner()->getDialogs().showCitation(this);
}
#endif
#include "insetcollapsable.h"
-#include "gettext.h"
-#include "lyxfont.h"
+#include "insettext.h"
+
#include "BufferView.h"
-#include "frontends/Painter.h"
#include "debug.h"
-#include "lyxtext.h"
-#include "frontends/font_metrics.h"
+#include "gettext.h"
+#include "lyxfont.h"
#include "lyxlex.h"
+#include "lyxtext.h"
+#include "WordLangTuple.h"
-#include "insets/insettext.h"
+#include "frontends/font_metrics.h"
+#include "frontends/Painter.h"
#include "support/LOstream.h"
#include "support/lstrings.h"
}
-WordLangTuple InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv,
- float & value) const
+WordLangTuple const
+InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv, float & value) const
{
WordLangTuple word = inset.selectNextWordToSpellcheck(bv, value);
if (first_after_edit && word.word().empty())
void close(BufferView *) const;
///
bool allowSpellcheck() { return inset.allowSpellcheck(); }
-
- WordLangTuple selectNextWordToSpellcheck(BufferView *, float &) const;
-
+ ///
+ WordLangTuple const
+ selectNextWordToSpellcheck(BufferView *, float &) const;
+ ///
void selectSelectedWord(BufferView * bv) {
inset.selectSelectedWord(bv);
}
+ ///
void toggleSelection(BufferView * bv, bool kill_selection) {
inset.toggleSelection(bv, kill_selection);
}
void InsetError::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showError(this);
+ bv->owner()->getDialogs().showError(this);
}
#endif
#include "insetert.h"
-#include "gettext.h"
-#include "lyxfont.h"
-#include "language.h"
+#include "insettext.h"
+
#include "buffer.h"
#include "BufferView.h"
-#include "frontends/LyXView.h"
-#include "lyxtext.h"
-#include "funcrequest.h"
#include "debug.h"
-#include "lyxrow.h"
+#include "funcrequest.h"
+#include "gettext.h"
+#include "language.h"
+#include "lyxfont.h"
#include "lyxlex.h"
+#include "lyxrow.h"
+#include "lyxtext.h"
+#include "WordLangTuple.h"
-#include "insets/insettext.h"
-
-#include "frontends/Dialogs.h"
#include "frontends/Alert.h"
+#include "frontends/Dialogs.h"
+#include "frontends/LyXView.h"
#include "support/LOstream.h"
bool InsetERT::showInsetDialog(BufferView * bv) const
{
- bv->owner()->getDialogs()->showERT(const_cast<InsetERT *>(this));
+ bv->owner()->getDialogs().showERT(const_cast<InsetERT *>(this));
return true;
}
}
-WordLangTuple InsetERT::selectNextWordToSpellcheck(BufferView * bv,
- float &) const
+WordLangTuple const
+InsetERT::selectNextWordToSpellcheck(BufferView * bv, float &) const
{
bv->unlockInset(const_cast<InsetERT *>(this));
return WordLangTuple();
///
bool allowSpellcheck() { return false; }
- WordLangTuple selectNextWordToSpellcheck(BufferView *, float &) const;
+ WordLangTuple const
+ selectNextWordToSpellcheck(BufferView *, float &) const;
///
int ascent(BufferView *, LyXFont const &) const;
///
int /*x*/, int /*y*/, mouse_button::state)
{
view_ = bv;
- view_->owner()->getDialogs()->showExternal(this);
+ view_->owner()->getDialogs().showExternal(this);
}
bool InsetFloat::showInsetDialog(BufferView * bv) const
{
if (!inset.showInsetDialog(bv)) {
- bv->owner()->getDialogs()->showFloat(const_cast<InsetFloat *>(this));
+ bv->owner()->getDialogs().showFloat(const_cast<InsetFloat *>(this));
}
return true;
}
void InsetFloatList::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showTOC(this);
+ bv->owner()->getDialogs().showTOC(this);
}
void InsetGraphics::edit(BufferView *bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showGraphics(this);
+ bv->owner()->getDialogs().showGraphics(this);
}
void InsetInclude::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showInclude(this);
+ bv->owner()->getDialogs().showInclude(this);
}
void InsetIndex::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showIndex(this);
+ bv->owner()->getDialogs().showIndex(this);
}
bool InsetMinipage::showInsetDialog(BufferView * bv) const
{
if (!inset.showInsetDialog(bv))
- bv->owner()->getDialogs()->showMinipage(const_cast<InsetMinipage *>(this));
+ bv->owner()->getDialogs().showMinipage(const_cast<InsetMinipage *>(this));
return true;
}
void InsetParent::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getLyXFunc()->
+ bv->owner()->getLyXFunc().
dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
}
{
// FuncRequestually trigger dialog with button 3 not 1
if (button == mouse_button::button3)
- bv->owner()->getLyXFunc()->
+ bv->owner()->getLyXFunc().
dispatch(FuncRequest(LFUN_REF_GOTO, getContents()));
else if (button == mouse_button::button1)
- bv->owner()->getDialogs()->showRef(this);
+ bv->owner()->getDialogs().showRef(this);
}
#endif
#include "insettabular.h"
+#include "insettext.h"
-#include "lyx_cb.h"
#include "buffer.h"
+#include "BufferView.h"
#include "commandtags.h"
-#include "lyxfunc.h"
-#include "debug.h"
-#include "LaTeXFeatures.h"
-#include "frontends/Painter.h"
-#include "frontends/font_metrics.h"
-#include "lyxtext.h"
-#include "frontends/LyXView.h"
-#include "insets/insettext.h"
#include "debug.h"
+#include "funcrequest.h"
#include "gettext.h"
#include "language.h"
-#include "BufferView.h"
-#include "undo_funcs.h"
+#include "LaTeXFeatures.h"
+#include "lyx_cb.h"
+#include "lyxfunc.h"
#include "lyxlength.h"
-#include "ParagraphParameters.h"
#include "lyxlex.h"
-#include "funcrequest.h"
+#include "lyxtext.h"
+#include "ParagraphParameters.h"
+#include "undo_funcs.h"
+#include "WordLangTuple.h"
-#include "frontends/Dialogs.h"
#include "frontends/Alert.h"
+#include "frontends/Dialogs.h"
+#include "frontends/font_metrics.h"
+#include "frontends/LyXView.h"
+#include "frontends/Painter.h"
#include "support/LAssert.h"
#include "support/lstrings.h"
if (the_locking_inset->unlockInsetInInset(bv, inset, lr)) {
if (inset->lyxCode() == TABULAR_CODE &&
!the_locking_inset->getFirstLockingInsetOfType(TABULAR_CODE)) {
- bv->owner()->getDialogs()->updateTabular(this);
+ bv->owner()->getDialogs().updateTabular(this);
oldcell = actcell;
}
return true;
ret = the_locking_inset->insetButtonRelease(bv, x - inset_x,
y - inset_y, button);
if (button == mouse_button::button3 && !ret) {
- bv->owner()->getDialogs()->showTabular(this);
+ bv->owner()->getDialogs().showTabular(this);
return true;
}
return ret;
case LFUN_ENDBUFSEL:
break;
case LFUN_LAYOUT_TABULAR:
- bv->owner()->getDialogs()->showTabular(this);
+ bv->owner()->getDialogs().showTabular(this);
break;
case LFUN_TABULAR_FEATURE:
if (!tabularFeatures(bv, arg))
!the_locking_inset->getFirstLockingInsetOfType(TABULAR_CODE)) &&
actcell != oldcell) {
InsetTabular * inset = const_cast<InsetTabular *>(this);
- bv->owner()->getDialogs()->updateTabular(inset);
+ bv->owner()->getDialogs().updateTabular(inset);
oldcell = actcell;
}
in_reset_pos = 0;
bool InsetTabular::showInsetDialog(BufferView * bv) const
{
if (!the_locking_inset || !the_locking_inset->showInsetDialog(bv))
- bv->owner()->getDialogs()
- ->showTabular(const_cast<InsetTabular *>(this));
+ bv->owner()->getDialogs().
+ showTabular(const_cast<InsetTabular *>(this));
return true;
}
return;
}
}
- bv->owner()->getDialogs()->showTabular(
+ bv->owner()->getDialogs().showTabular(
const_cast<InsetTabular *>(this));
}
}
-WordLangTuple
+WordLangTuple const
InsetTabular::selectNextWordToSpellcheck(BufferView * bv, float & value) const
{
nodraw(true);
LyXCursor const & cursor(BufferView *) const;
///
bool allowSpellcheck() { return true; }
- WordLangTuple selectNextWordToSpellcheck(BufferView *, float & value) const;
+ ///
+ WordLangTuple const
+ selectNextWordToSpellcheck(BufferView *, float & value) const;
+ ///
void selectSelectedWord(BufferView *);
+ ///
void toggleSelection(BufferView *, bool kill_selection);
///
bool searchForward(BufferView *, string const &,
#endif
#include "insettext.h"
-#include "paragraph.h"
-#include "lyxlex.h"
-#include "debug.h"
-#include "lyxfont.h"
+
#include "buffer.h"
-#include "frontends/LyXView.h"
#include "BufferView.h"
-#include "LaTeXFeatures.h"
-#include "frontends/Painter.h"
-#include "lyxtext.h"
-#include "lyxcursor.h"
#include "CutAndPaste.h"
-#include "frontends/font_metrics.h"
+#include "debug.h"
+#include "funcrequest.h"
+#include "gettext.h"
+#include "intl.h"
+#include "LaTeXFeatures.h"
#include "LColor.h"
+#include "lyxfont.h"
+#include "lyxcursor.h"
+#include "lyxfind.h"
+#include "lyxfunc.h"
+#include "lyxlex.h"
#include "lyxrow.h"
#include "lyxrc.h"
-#include "intl.h"
-#include "trans_mgr.h"
-#include "frontends/screen.h"
-#include "gettext.h"
-#include "lyxfunc.h"
+#include "lyxtext.h"
+#include "paragraph.h"
#include "ParagraphParameters.h"
+#include "trans_mgr.h"
#include "undo_funcs.h"
-#include "lyxfind.h"
-#include "funcrequest.h"
+#include "WordLangTuple.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
+#include "frontends/font_metrics.h"
+#include "frontends/LyXView.h"
+#include "frontends/Painter.h"
+#include "frontends/screen.h"
#include "support/textutils.h"
#include "support/LAssert.h"
showInsetCursor(bv);
// Tell the paragraph dialog that we've entered an insettext.
- bv->owner()->getDialogs()->updateParagraph();
+ bv->owner()->getDialogs().updateParagraph();
}
}
lt->clearSelection();
for (string::size_type i = 0; i < ev.argument.length(); ++i) {
- bv->owner()->getIntl()->getTransManager().
+ bv->owner()->getIntl().getTransManager().
TranslateAndInsert(ev.argument[i], lt);
}
}
// see if we found the layout number:
if (!hasLayout) {
FuncRequest lf(LFUN_MESSAGE, N_("Layout ") + ev.argument + N_(" not known"));
- bv->owner()->getLyXFunc()->dispatch(lf);
+ bv->owner()->getLyXFunc().dispatch(lf);
break;
}
}
-WordLangTuple
+WordLangTuple const
InsetText::selectNextWordToSpellcheck(BufferView * bv,
float & value) const
{
///
bool allowSpellcheck() { return true; }
///
- WordLangTuple selectNextWordToSpellcheck(BufferView *,
- float & value) const;
+ WordLangTuple const
+ selectNextWordToSpellcheck(BufferView *, float & value) const;
+ ///
void selectSelectedWord(BufferView *);
///
void toggleSelection(BufferView *, bool kill_selection);
void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showTOC(this);
+ bv->owner()->getDialogs().showTOC(this);
}
void InsetUrl::edit(BufferView * bv, int, int, mouse_button::state)
{
- bv->owner()->getDialogs()->showUrl(this);
+ bv->owner()->getDialogs().showUrl(this);
}
#include "debug.h"
#include "encoding.h"
#include "ispell.h"
+#include "WordLangTuple.h"
#ifndef CXX_GLOBAL_CSTD
using std::strcpy;
c = 0;
}
- owner->getIntl()->getTransManager()
+ owner->getIntl().getTransManager()
.deadkey(c, get_accent(action).accent, TEXT(false));
// Need to clear, in case the minibuffer calls these
// actions
// A few general toggles
switch (ev.action) {
case LFUN_TOOLTIPS_TOGGLE:
- flag.setOnOff(owner->getDialogs()->tooltipsEnabled());
+ flag.setOnOff(owner->getDialogs().tooltipsEnabled());
break;
case LFUN_READ_ONLY_TOGGLE:
}
finishUndo();
// Tell the paragraph dialog that we changed paragraph
- owner->getDialogs()->updateParagraph();
+ owner->getDialogs().updateParagraph();
}
}
break;
break;
case LFUN_MENUPRINT:
- owner->getDialogs()->showPrint();
+ owner->getDialogs().showPrint();
break;
case LFUN_EXPORT:
if (argument == "custom")
- owner->getDialogs()->showSendto();
+ owner->getDialogs().showSendto();
else
Exporter::Export(owner->buffer(), argument, false);
break;
else
p.setCmdName("listoftables");
#endif
- owner->getDialogs()->createTOC(p.getAsString());
+ owner->getDialogs().createTOC(p.getAsString());
break;
}
break;
case LFUN_MENUSEARCH:
- owner->getDialogs()->showSearch();
+ owner->getDialogs().showSearch();
break;
case LFUN_REMOVEERRORS:
break;
case LFUN_FREE:
- owner->getDialogs()->setUserFreeFont();
+ owner->getDialogs().setUserFreeFont();
break;
case LFUN_RECONFIGURE:
#endif
#endif
case LFUN_HELP_ABOUTLYX:
- owner->getDialogs()->showAboutlyx();
+ owner->getDialogs().showAboutlyx();
break;
case LFUN_HELP_TEXINFO:
- owner->getDialogs()->showTexinfo();
+ owner->getDialogs().showTexinfo();
break;
case LFUN_HELP_OPEN:
case LFUN_VC_HISTORY:
{
- owner->getDialogs()->showVCLogFile();
+ owner->getDialogs().showVCLogFile();
break;
}
break;
case LFUN_LATEX_LOG:
- owner->getDialogs()->showLogFile();
+ owner->getDialogs().showLogFile();
break;
case LFUN_LAYOUT_DOCUMENT:
- owner->getDialogs()->showDocument();
+ owner->getDialogs().showDocument();
break;
case LFUN_LAYOUT_PARAGRAPH:
- owner->getDialogs()->showParagraph();
+ owner->getDialogs().showParagraph();
break;
case LFUN_LAYOUT_CHARACTER:
- owner->getDialogs()->showCharacter();
+ owner->getDialogs().showCharacter();
break;
case LFUN_LAYOUT_TABULAR:
break;
case LFUN_LAYOUT_PREAMBLE:
- owner->getDialogs()->showPreamble();
+ owner->getDialogs().showPreamble();
break;
case LFUN_DROP_LAYOUTS_CHOICE:
- owner->getToolbar()->openLayoutList();
+ owner->getToolbar().openLayoutList();
break;
case LFUN_MENU_OPEN_BY_NAME:
- owner->getMenubar()->openByName(argument);
+ owner->getMenubar().openByName(argument);
break; // RVDK_PATCH_5
case LFUN_SPELLCHECK:
- owner->getDialogs()->showSpellchecker();
+ owner->getDialogs().showSpellchecker();
break;
// --- lyxserver commands ----------------------------
break;
case LFUN_MATH_PANEL:
- owner->getDialogs()->showMathPanel();
+ owner->getDialogs().showMathPanel();
break;
case LFUN_CITATION_CREATE:
}
dispatch(FuncRequest(LFUN_CITATION_INSERT, p.getAsString()));
} else
- owner->getDialogs()->createCitation(p.getAsString());
+ owner->getDialogs().createCitation(p.getAsString());
}
break;
break;
case LFUN_KMAP_OFF: // keymap off
- owner->getIntl()->KeyMapOn(false);
+ owner->getIntl().KeyMapOn(false);
break;
case LFUN_KMAP_PRIM: // primary keymap
- owner->getIntl()->KeyMapPrim();
+ owner->getIntl().KeyMapPrim();
break;
case LFUN_KMAP_SEC: // secondary keymap
- owner->getIntl()->KeyMapSec();
+ owner->getIntl().KeyMapSec();
break;
case LFUN_KMAP_TOGGLE: // toggle keymap
- owner->getIntl()->ToggleKeyMap();
+ owner->getIntl().ToggleKeyMap();
break;
case LFUN_SEQUENCE:
break;
case LFUN_DIALOG_PREFERENCES:
- owner->getDialogs()->showPreferences();
+ owner->getDialogs().showPreferences();
break;
case LFUN_SAVEPREFERENCES:
break;
case LFUN_FORKS_SHOW:
- owner->getDialogs()->showForks();
+ owner->getDialogs().showForks();
break;
case LFUN_FORKS_KILL:
}
case LFUN_TOOLTIPS_TOGGLE:
- owner->getDialogs()->toggleTooltips();
+ owner->getDialogs().toggleTooltips();
break;
default:
// need this otherwise SEGV may occur while trying to
// set variables that don't exist
// since there's no current buffer
- owner->getDialogs()->hideBufferDependent();
+ owner->getDialogs().hideBufferDependent();
} else {
owner->view()->buffer(bufferlist.first());
}
#include "layout.h"
#include "LColor.h"
#include "insets/inset.h"
-#include "WordLangTuple.h"
class Buffer;
class BufferParams;
class Spacing;
class UpdatableInset;
class VSpace;
+class WordLangTuple;
/**
to the beginning of this word.
With SelectSelectedWord can this be highlighted really
*/
- WordLangTuple selectNextWordToSpellcheck(BufferView *, float & value) const;
+ WordLangTuple const selectNextWordToSpellcheck(BufferView *, float & value) const;
///
void selectSelectedWord(BufferView *);
/// returns true if par was empty and was removed
MakeDisplayPath(filename, 50),
_("Save document and proceed?"))) {
vcs->owner()->getUser()->owner()
- ->getLyXFunc()->dispatch(LFUN_MENUWRITE);
+ ->getLyXFunc().dispatch(LFUN_MENUWRITE);
}
// Maybe the save fails, or we answered "no". In both cases,
MakeDisplayPath(vcs->owner()->fileName(), 50),
_("Save document and proceed?"))) {
vcs->owner()->getUser()->owner()
- ->getLyXFunc()->dispatch(LFUN_MENUWRITE);
+ ->getLyXFunc().dispatch(LFUN_MENUWRITE);
}
// Maybe the save fails, or we answered "no". In both cases,
+2002-08-13 Angus Leeming <leeming@lyx.org>
+
+ * formulabase.C:
+ * ref_inset.C:
+ changes due to the changed LyXView interface that now returns references
+ to member variables not pointers.
+
+ * math_inset.[Ch] (getDialogs, getLyXFunc): return a reference, not a
+ pointer, reflecting this change.
+
2002-08-02 Angus Leeming <leeming@lyx.org>
* formula.C: pass the BufferView to the PreviewedInset so that it can
view_->owner()->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
// remove ourselves
- //view_->owner()->getLyXFunc()->dispatch(LFUN_ESCAPE);
+ //view_->owner()->getLyXFunc().dispatch(LFUN_ESCAPE);
#endif
}
return true;
// launch math panel for right mouse button
- bv->owner()->getDialogs()->showMathPanel();
+ bv->owner()->getDialogs().showMathPanel();
return true;
}
case LFUN_REF_INSERT:
//if (argument.empty()) {
// InsetCommandParams p("ref");
- // owner_->getDialogs()->createRef(p.getAsString());
+ // owner_->getDialogs().createRef(p.getAsString());
//} else {
// InsetCommandParams p;
// p.setFromString(argument);
//
if (ev.argument.empty()) {
InsetCommandParams p("ref");
- bv->owner()->getDialogs()->createRef(p.getAsString());
+ bv->owner()->getDialogs().createRef(p.getAsString());
} else {
//mathcursor->handleNest(new InsetRef2);
//mathcursor->insert(arg);
bv->getLyXText()->cutSelection(bv);
openNewInset(bv, f);
}
- bv->owner()->getLyXFunc()->setMessage(N_("Math editor mode"));
+ bv->owner()->getLyXFunc().setMessage(N_("Math editor mode"));
}
if (!bv->available())
return;
if (arg.empty())
- bv->owner()->getLyXFunc()->setErrorMessage(N_("Missing argument"));
+ bv->owner()->getLyXFunc().setErrorMessage(N_("Missing argument"));
else {
string s = arg;
string const s1 = token(s, ' ', 1);
}
-Dialogs * getDialogs()
+Dialogs & getDialogs()
{
return mathcursor->formula()->view()->owner()->getDialogs();
}
-LyXFunc * getLyXFunc()
+LyXFunc & getLyXFunc()
{
return mathcursor->formula()->view()->owner()->getLyXFunc();
}
class Dialogs;
class LyXFunc;
-Dialogs * getDialogs();
-LyXFunc * getLyXFunc();
+Dialogs & getDialogs();
+LyXFunc & getLyXFunc();
#endif
case LFUN_MOUSE_RELEASE:
if (cmd.extra == 3) {
lyxerr << "trying to goto ref" << cell(0) << "\n";
- mathcursor->formula()->view()->owner()->getLyXFunc()->
+ mathcursor->formula()->view()->owner()->getLyXFunc().
dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
return 1; // dispatched
}
}
#include "pspell.h"
+#include "WordLangTuple.h"
using std::endl;
#include "language.h"
#include "ParagraphParameters.h"
#include "undo_funcs.h"
+#include "WordLangTuple.h"
#include "insets/insetbib.h"
#include "insets/insettext.h"
// This function is only used by the spellchecker for NextWord().
// It doesn't handle LYX_ACCENTs and probably never will.
-WordLangTuple LyXText::selectNextWordToSpellcheck(BufferView * bview,
- float & value) const
+WordLangTuple const
+LyXText::selectNextWordToSpellcheck(BufferView * bview, float & value) const
{
if (the_locking_inset) {
WordLangTuple word = the_locking_inset->selectNextWordToSpellcheck(bview, value);
void TocItem::goTo(LyXView & lv_) const
{
string const tmp = tostr(par->id());
- lv_.getLyXFunc()->dispatch(FuncRequest(LFUN_GOTO_PARAGRAPH, tmp));
+ lv_.getLyXFunc().dispatch(FuncRequest(LFUN_GOTO_PARAGRAPH, tmp));
}
cmd += OnlyFilename(owner_->fileName());
cmd += "\"";
doVCCommand(cmd, owner_->filePath());
- owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
}
{
doVCCommand("ci -q -u -m\"" + msg + "\" \""
+ OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
- owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
}
owner_->markClean();
doVCCommand("co -q -l \""
+ OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
- owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
}
// We ignore changes and just reload!
owner_->markClean();
owner_->getUser()->owner()
- ->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ ->getLyXFunc().dispatch(LFUN_MENURELOAD);
}
{
doVCCommand("cvs -q add -m \"" + msg + "\" \""
+ OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
- owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
}
doVCCommand("cvs -q commit -m \"" + msg + "\" \""
+ OnlyFilename(owner_->fileName()) + "\"",
owner_->filePath());
- owner_->getUser()->owner()->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ owner_->getUser()->owner()->getLyXFunc().dispatch(LFUN_MENURELOAD);
}
owner_->filePath());
owner_->markClean();
owner_->getUser()->owner()
- ->getLyXFunc()->dispatch(LFUN_MENURELOAD);
+ ->getLyXFunc().dispatch(LFUN_MENURELOAD);
}