#include "bufferparams.h"
#include "cursor.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "factory.h"
#include "FloatList.h"
#include "funcrequest.h"
+2003-10-29 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * text3.C:
+ * text2.C:
+ * text.C:
+ * lyxtext.h:
+ * lyxfunc.C:
+ * cursor.C:
+ * BufferView_pimpl.C: dispatch_result -> DispatchResult changes.
+
+ * dispatchresult.h: new file, DispatchResult broken out of
+ insets/insetbase.h
+
+ * Makefile.am (lyx_SOURCES): add dispatchresult.h
+
2003-10-28 Alfredo Braunstein <abraunst@libero.it>
* text.C (rowBreakPoint): put a hack inside #if 0
2003-10-27 Alfredo Braunstein <abraunst@libero.it>
- * text.C:
- * lyxrow_funcs.[Ch]:
- * Bidi.C:
- * paragraph.C:
- * lyxtext.h:
- * rowpainter.C:
- * text2.C:
+ * text.C:
+ * lyxrow_funcs.[Ch]:
+ * Bidi.C:
+ * paragraph.C:
+ * lyxtext.h:
+ * rowpainter.C:
+ * text2.C:
* text3.C: remove lastPos uses in favour of Row::endpos
2003-10-27 Alfredo Braunstein <abraunst@libero.it>
2003-10-25 Alfredo Braunstein <abraunst@libero.it>
- * text.C (prepareToPrint): fix linebreak rowbreaking as suggested
+ * text.C (prepareToPrint): fix linebreak rowbreaking as suggested
by Martin
- (rowBreakPoint): fix width. change point to point + 1.
+ (rowBreakPoint): fix width. change point to point + 1.
Add a missing check.
2003-10-25 Martin Vermeer <martin.vermeer@hut.fi>
* text3.C (cursorPrevious, cursorNext): fix 2 "dontlikes"
2003-10-23 André Pönitz <poenitz@gmx.net>
-
+
* RowList_fwd.h: change list<> to vector<> to gain speed
after suggestion from Alfredo
debug.h \
dimension.C \
dimension.h \
+ dispatchresult.h \
encoding.C \
encoding.h \
errorlist.C \
#include "BufferView.h"
#include "cursor.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "iterators.h"
#include "lyxtext.h"
#include "paragraph.h"
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file dispatchresult.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author none
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef DISPATCH_RESULT_H
+#define DISPATCH_RESULT_H
+
+/** Dispatch result codes
+ DISPATCHED = the inset catched the action
+ DISPATCHED_NOUPDATE = the inset catched the action and no update
+ is needed here to redraw the inset
+ FINISHED = the inset must be unlocked as a result
+ of the action
+ FINISHED_RIGHT = FINISHED, but put the cursor to the RIGHT of
+ the inset.
+ FINISHED_UP = FINISHED, but put the cursor UP of
+ the inset.
+ FINISHED_DOWN = FINISHED, but put the cursor DOWN of
+ the inset.
+ UNDISPATCHED = the action was not catched, it should be
+ dispatched by lower level insets
+*/
+enum dispatch_result_t {
+ UNDISPATCHED = 0,
+ DISPATCHED,
+ DISPATCHED_NOUPDATE,
+ FINISHED,
+ FINISHED_RIGHT,
+ FINISHED_UP,
+ FINISHED_DOWN,
+ DISPATCHED_POP
+};
+
+/** \c DispatchResult is a wrapper for dispatch_result_t.
+ * It can be forward-declared and passed as a function argument without
+ * having to expose insetbase.h.
+ */
+class DispatchResult {
+ dispatch_result_t val_;
+public:
+ DispatchResult()
+ : val_(UNDISPATCHED) {}
+ DispatchResult(dispatch_result_t val) : val_(val) {}
+ operator dispatch_result_t() const{ return val_; }
+};
+
+#endif // DISPATCH_RESULT_H
+2003-10-29 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * most insets: dispatch_result -> DispatchResult
+
+ * insetbase.h: move DispatchResult out to dispatchresult.h
2003-10-27 André Pönitz <poenitz@gmx.net>
* inset.h:
* insetfloat.h:
- * insetfootlike.h: re-introduce display() for insets,
+ * insetfootlike.h: re-introduce display() for insets,
fixing the various bugs (stretch of line above, math inset
positioning, ...)
#include <config.h>
#include "insetbase.h"
+#include "dispatchresult.h"
-dispatch_result
+DispatchResult
InsetBase::dispatch(FuncRequest const & f, idx_type & i, pos_type & p)
{
return priv_dispatch(f, i, p);
}
-dispatch_result
+DispatchResult
InsetBase::dispatch(FuncRequest const & f)
{
idx_type i = 0;
}
-dispatch_result
+DispatchResult
InsetBase::priv_dispatch(FuncRequest const &, idx_type &, pos_type &)
{
return UNDISPATCHED;
class Dimension;
class PainterInfo;
class LaTeXFeatures;
-
-/** Dispatch result codes
- DISPATCHED = the inset catched the action
- DISPATCHED_NOUPDATE = the inset catched the action and no update
- is needed here to redraw the inset
- FINISHED = the inset must be unlocked as a result
- of the action
- FINISHED_RIGHT = FINISHED, but put the cursor to the RIGHT of
- the inset.
- FINISHED_UP = FINISHED, but put the cursor UP of
- the inset.
- FINISHED_DOWN = FINISHED, but put the cursor DOWN of
- the inset.
- UNDISPATCHED = the action was not catched, it should be
- dispatched by lower level insets
-*/
-enum dispatch_result {
- UNDISPATCHED = 0,
- DISPATCHED,
- DISPATCHED_NOUPDATE,
- FINISHED,
- FINISHED_RIGHT,
- FINISHED_UP,
- FINISHED_DOWN,
- DISPATCHED_POP
-};
-
-/** \c DispatchResult is a wrapper for dispatch_result.
- * It can be forward-declared and passed as a function argument without
- * having to expose insetbase.h.
- */
-class DispatchResult {
- dispatch_result val_;
-public:
- DispatchResult(dispatch_result val) : val_(val) {}
- operator dispatch_result() const{ return val_; }
-};
-
-
+class DispatchResult;
/// Common base class to all insets
class InsetBase {
virtual std::auto_ptr<InsetBase> clone() const = 0;
// the real dispatcher
- dispatch_result
+ DispatchResult
dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
// the real dispatcher
- dispatch_result
+ DispatchResult
dispatch(FuncRequest const & cmd);
/// compute the size of the object returned in dim
std::vector<std::string> & /* list */) const {}
protected:
// the real dispatcher
- virtual dispatch_result priv_dispatch
- (FuncRequest const & cmd, idx_type & idx, pos_type & pos);
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
};
#endif
#include "buffer.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "lyxfont.h"
#include "lyxlex.h"
}
-dispatch_result
+DispatchResult
InsetBibitem::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///
#include "buffer.h"
#include "bufferparams.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
}
-dispatch_result
+DispatchResult
InsetBibtex::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};
#include <config.h>
#include "insetbox.h"
-#include "debug.h"
#include "BufferView.h"
+#include "dispatchresult.h"
+#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
+DispatchResult
InsetBox::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
friend class InsetBoxParams;
#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LColor.h"
}
-dispatch_result
+DispatchResult
InsetBranch::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
friend class InsetBranchParams;
#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
+DispatchResult
InsetCitation::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
- dispatch_result localDispatch(FuncRequest const & cmd);
+ DispatchResult localDispatch(FuncRequest const & cmd);
///
void validate(LaTeXFeatures &) const;
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
struct Cache {
#include "buffer.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "LColor.h"
#include "lyxlex.h"
#include "funcrequest.h"
}
-dispatch_result
+DispatchResult
InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
return DISPATCHED;
default:
- dispatch_result result = inset.dispatch(cmd);
+ DispatchResult result = inset.dispatch(cmd);
if (result >= FINISHED)
bv->unlockInset(this);
first_after_edit = false;
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
///
void dimension_collapsed(Dimension &) const;
#include "insetcommand.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "lyxlex.h"
#include "metricsinfo.h"
}
-dispatch_result
+DispatchResult
InsetCommand::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {
virtual int docbook(Buffer const &, std::ostream &, bool) const;
///
InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
-
+
///
InsetCommandParams const & params() const { return p_; }
///
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
///
std::string const getCommand() const { return p_.getCommand(); }
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "language.h"
}
-dispatch_result
+DispatchResult
InsetERT::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
- dispatch_result result = UNDISPATCHED;
+ DispatchResult result = UNDISPATCHED;
BufferView * bv = cmd.view();
if (inset.paragraphs.begin()->empty()) {
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
///
#include "buffer.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
} // namespace anon
-Translator<DisplayType, string> const & displayTranslator()
+Translator<DisplayType, string> const & displayTranslator()
{
static Translator<DisplayType, string> const translator =
initTranslator();
}
-dispatch_result
+DispatchResult
InsetExternal::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
/** This method is connected to the graphics loader, so we are
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "Floating.h"
#include "FloatList.h"
#include "funcrequest.h"
}
-dispatch_result
+DispatchResult
InsetFloat::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
InsetFloatParams const & params() const { return params_; }
protected:
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///
#include "buffer.h"
#include "bufferparams.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "Floating.h"
#include "FloatList.h"
#include "funcrequest.h"
}
-dispatch_result
+DispatchResult
InsetFloatList::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};
#include "BufferView.h"
#include "converter.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "format.h"
#include "funcrequest.h"
#include "gettext.h"
}
-dispatch_result
+DispatchResult
InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
+DispatchResult
InsetInclude::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
{
switch (cmd.action) {
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
/// Slot receiving a signal that the preview is ready to display.
#include "insetindex.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
+DispatchResult
InsetIndex::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};
#include "insetlabel.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "frontends/LyXView.h"
}
-dispatch_result
+DispatchResult
InsetLabel::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};
case ACUTE:
drawAccent(pi, x2, baseline, char(0xB4));
break;
-
- case GRAVE:
+
+ case GRAVE:
drawAccent(pi, x2, baseline, char(0x60));
break;
drawAccent(pi, x2, baseline, '.');
break;
- case CIRCLE:
+ case CIRCLE:
drawAccent(pi, x2, baseline, char(0xB0));
break;
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LColor.h"
}
-dispatch_result
+DispatchResult
InsetMinipage::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///
#include "insetnote.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
+DispatchResult
InsetNote::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
friend class InsetNoteParams;
#include "buffer.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
-InsetRef::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+InsetRef::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_INSET_EDIT:
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "FuncStatus.h"
#include "gettext.h"
}
-dispatch_result
+DispatchResult
InsetTabular::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
// We need to save the value of the_locking_inset as the call to
// the_locking_inset->localDispatch might unlock it.
old_locking_inset = the_locking_inset;
- dispatch_result result = UpdatableInset::priv_dispatch(cmd, idx, pos);
+ DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
BufferView * bv = cmd.view();
if (cmd.action == LFUN_INSET_EDIT) {
}
-dispatch_result InsetTabular::moveRight(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveRight(BufferView * bv, bool lock)
{
if (lock && !old_locking_inset) {
if (activateCellInset(bv))
}
-dispatch_result InsetTabular::moveLeft(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveLeft(BufferView * bv, bool lock)
{
bool moved = isRightToLeft(bv) ? moveNextCell(bv) : movePrevCell(bv);
if (!moved)
}
-dispatch_result InsetTabular::moveUp(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveUp(BufferView * bv, bool lock)
{
int const ocell = actcell;
actcell = tabular.getCellAbove(actcell);
}
-dispatch_result InsetTabular::moveDown(BufferView * bv, bool lock)
+DispatchResult InsetTabular::moveDown(BufferView * bv, bool lock)
{
int const ocell = actcell;
actcell = tabular.getCellBelow(actcell);
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
/// lock cell with given index
///
void setPos(BufferView *, int x, int y) const;
///
- dispatch_result moveRight(BufferView *, bool lock = true);
+ DispatchResult moveRight(BufferView *, bool lock = true);
///
- dispatch_result moveLeft(BufferView *, bool lock = true);
+ DispatchResult moveLeft(BufferView *, bool lock = true);
///
- dispatch_result moveUp(BufferView *, bool lock = true);
+ DispatchResult moveUp(BufferView *, bool lock = true);
///
- dispatch_result moveDown(BufferView *, bool lock = true);
+ DispatchResult moveDown(BufferView *, bool lock = true);
///
bool moveNextCell(BufferView *, bool lock = false);
///
#include "BufferView.h"
#include "CutAndPaste.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "errorlist.h"
#include "funcrequest.h"
#include "gettext.h"
}
-dispatch_result
+DispatchResult
InsetText::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
bool was_empty = paragraphs.begin()->empty() && paragraphs.size() == 1;
no_selection = false;
- dispatch_result result = UpdatableInset::priv_dispatch(cmd, idx, pos);
+ DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
if (result != UNDISPATCHED)
return DISPATCHED;
}
-dispatch_result InsetText::moveRight(BufferView * bv)
+DispatchResult InsetText::moveRight(BufferView * bv)
{
if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params()))
return moveLeftIntern(bv, false, true, false);
}
-dispatch_result InsetText::moveLeft(BufferView * bv)
+DispatchResult InsetText::moveLeft(BufferView * bv)
{
if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params()))
return moveRightIntern(bv, true, true, false);
}
-dispatch_result
+DispatchResult
InsetText::moveRightIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
}
-dispatch_result
+DispatchResult
InsetText::moveLeftIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
}
-dispatch_result InsetText::moveUp(BufferView * bv)
+DispatchResult InsetText::moveUp(BufferView * bv)
{
if (crow() == text_.firstRow())
return FINISHED_UP;
}
-dispatch_result InsetText::moveDown(BufferView * bv)
+DispatchResult InsetText::moveDown(BufferView * bv)
{
if (crow() == text_.lastRow())
return FINISHED_DOWN;
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
///
void updateLocal(BufferView *, bool mark_dirty);
void lfunMouseMotion(FuncRequest const &);
///
- dispatch_result moveRight(BufferView *);
+ DispatchResult moveRight(BufferView *);
///
- dispatch_result moveLeft(BufferView *);
+ DispatchResult moveLeft(BufferView *);
///
- dispatch_result moveRightIntern(BufferView *, bool front,
+ DispatchResult moveRightIntern(BufferView *, bool front,
bool activate_inset = true,
bool selecting = false);
///
- dispatch_result moveLeftIntern(BufferView *, bool front,
+ DispatchResult moveLeftIntern(BufferView *, bool front,
bool activate_inset = true,
bool selecting = false);
///
- dispatch_result moveUp(BufferView *);
+ DispatchResult moveUp(BufferView *);
///
- dispatch_result moveDown(BufferView *);
+ DispatchResult moveDown(BufferView *);
///
void setCharFont(Buffer const &, int pos, LyXFont const & font);
///
#include "insettoc.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
#include "metricsinfo.h"
}
-dispatch_result
-InsetTOC::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+InsetTOC::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_MOUSE_RELEASE:
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};
#include "inseturl.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "latexrunparams.h"
#include "LaTeXFeatures.h"
}
-dispatch_result
+DispatchResult
InsetUrl::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
};
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "Floating.h"
#include "FloatList.h"
#include "funcrequest.h"
}
-dispatch_result
+DispatchResult
InsetWrap::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
///
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "lyxtext.h"
#include "WordLangTuple.h"
/// An updatable inset could handle lyx editing commands
-dispatch_result
+DispatchResult
UpdatableInset::priv_dispatch(FuncRequest const & ev, idx_type &, pos_type &)
{
if (ev.action == LFUN_MOUSE_RELEASE)
protected:
/// An updatable inset could handle lyx editing commands
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
/// scrolls to absolute position in bufferview-workwidth * sx units
void scroll(BufferView *, float sx) const;
#include "BufferView.h"
#include "cursor.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "encoding.h"
#include "exporter.h"
#include "format.h"
if (view()->available() && view()->theLockingInset()) {
- dispatch_result result;
+ DispatchResult result;
if (action > 1 || (action == LFUN_UNKNOWN_ACTION &&
!keyseq.deleted()))
{
break;
}
- case LFUN_DIALOG_SHOW_NEXT_INSET:
+ case LFUN_DIALOG_SHOW_NEXT_INSET:
break;
case LFUN_INSET_DIALOG_SHOW: {
InsetOld * inset = view()->getLyXText()->getInset();
- if (inset)
+ if (inset)
inset->dispatch(FuncRequest(view(), LFUN_INSET_DIALOG_SHOW));
break;
}
argument = split(argument, countstr, ' ');
istringstream is(countstr);
int count = 0;
- is >> count;
+ is >> count;
lyxerr << "repeat: count: " << count << " cmd: " << argument << endl;
for (int i = 0; i < count; ++i)
dispatch(lyxaction.lookupFunc(argument));
if (isStrInt(argument)) {
pid_t const pid = strToInt(argument);
ForkedcallsController & fcc = ForkedcallsController::get();
- fcc.kill(pid);
+ fcc.kill(pid);
}
break;
void metrics(MetricsInfo & mi, Dimension & dim);
///
- dispatch_result dispatch(FuncRequest const & cmd);
+ DispatchResult dispatch(FuncRequest const & cmd);
BufferView * bv();
/// FIXME
int labelEnd(ParagraphList::iterator pit, Row const & row) const;
-
+
///
void charInserted();
+2003-10-29 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * math_scriptinset.h: change dispatch to priv_dispatch and make it
+ protected
+
+ * math_nestinset.h: make priv_dispatch protected
+
+ * math_hullinset.h: make priv_dispatch protected
+
+ * math_gridinset.h: make priv_dispatch protected
+
+ * command_inset.[Ch]: change dispatch to priv_dispatch and make it
+ protected.
+
+ * several files: dispatch_result -> DispatchResult
+
2003-10-22 Angus Leeming <leeming@lyx.org>
* formula.C (generatePreview): changes due to the changed
into this
(localDispatch): delete
- * math_nestinset.C (dispatch):
+ * math_nestinset.C (dispatch):
* math_hullinset.C (dispatch):
* math_gridinset.C (dispatch):
* formulabase.C (openNewInset, priv_dispatch, mathDispatch):
#include "command_inset.h"
#include "math_data.h"
#include "math_mathmlstream.h"
+#include "dispatchresult.h"
#include "funcrequest.h"
#include "support/std_sstream.h"
button_.draw(pi, x, y);
}
-dispatch_result
-CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+
+DispatchResult
+CommandInset::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
default:
//
// void infoize(std::ostream & os) const;
///
- dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
- ///
virtual std::string const screenLabel() const;
/// generate something that will be understood by the Dialogs.
std::string const createDialogStr(std::string const & name) const;
std::string const & commandname() const { return name_; }
-
+protected:
+ ///
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
private:
std::string name_;
mutable bool set_label_;
#include "BufferView.h"
#include "bufferview_funcs.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
}
-dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
+DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
{
if (!mathcursor)
return UNDISPATCHED;
}
-dispatch_result InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
+DispatchResult InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
{
BufferView * bv = cmd.view();
//lyxerr << "lfunMousePress: buttons: " << cmd.button() << endl;
}
-dispatch_result InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
+DispatchResult InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
{
if (!mathcursor)
return DISPATCHED;
}
-dispatch_result
+DispatchResult
InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
idx_type &, pos_type &)
{
return UNDISPATCHED;
string argument = cmd.argument;
- dispatch_result result = DISPATCHED;
+ DispatchResult result = DISPATCHED;
bool sel = false;
bool was_macro = mathcursor->inMacroMode();
bool was_selection = mathcursor->selection();
// case LFUN_GETXY:
// sprintf(dispatch_buffer, "%d %d",);
- // dispatch_result = dispatch_buffer;
+ // DispatchResult= dispatch_buffer;
// break;
case LFUN_SETXY: {
lyxerr << "LFUN_SETXY broken!" << endl;
protected:
/// To allow transparent use of math editing functions
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
private:
/// unimplemented
/// common base for handling accents
void handleAccent(BufferView * bv, std::string const & arg, std::string const & name);
/// lfun handler
- dispatch_result lfunMousePress(FuncRequest const &);
+ DispatchResult lfunMousePress(FuncRequest const &);
///
- dispatch_result lfunMouseRelease(FuncRequest const &);
+ DispatchResult lfunMouseRelease(FuncRequest const &);
///
- dispatch_result lfunMouseMotion(FuncRequest const &);
+ DispatchResult lfunMouseMotion(FuncRequest const &);
protected:
#include <config.h>
+#include "math_cursor.h"
#include "lyxrc.h"
#include "support/limited_stack.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "support/std_sstream.h"
-#include "math_cursor.h"
#include "formulabase.h"
#include "funcrequest.h"
#include "math_braceinset.h"
}
-dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
+DispatchResult MathCursor::dispatch(FuncRequest const & cmd)
{
// mouse clicks are somewhat special
// check
case LFUN_MOUSE_RELEASE:
case LFUN_MOUSE_DOUBLE: {
CursorPos & pos = Cursor_.back();
- dispatch_result res = UNDISPATCHED;
+ DispatchResult res = UNDISPATCHED;
int x = 0, y = 0;
getPos(x, y);
if (x < cmd.x && hasPrevAtom()) {
for (int i = Cursor_.size() - 1; i >= 0; --i) {
CursorPos & pos = Cursor_[i];
- dispatch_result res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
+ DispatchResult res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
if (res != UNDISPATCHED) {
if (res == DISPATCHED_POP) {
Cursor_.shrink(i + 1);
CursorPos const & cursor() const;
/// how deep are we nested?
unsigned depth() const;
-
- /// local dispatcher
- dispatch_result dispatch(FuncRequest const & cmd);
/// describe the situation
std::string info() const;
/// dump selection information for debugging
void pullArg();
/// split font inset etc
void handleFont(std::string const & font);
-
+ ///
+ DispatchResult
+ dispatch(FuncRequest const & cmd);
private:
/// moves cursor index one cell to the left
bool idxLeft();
#include "math_data.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "LColor.h"
}
-dispatch_result MathGridInset::priv_dispatch(FuncRequest const & cmd,
+DispatchResult MathGridInset::priv_dispatch(FuncRequest const & cmd,
idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
MathGridInset * asGridInset() { return this; }
/// identifies GridInset
MathGridInset const * asGridInset() const { return this; }
- /// local dispatcher
- dispatch_result priv_dispatch(FuncRequest const & cmd,
- idx_type & idx, pos_type & pos);
-
///
col_type ncols() const;
///
//void octave(OctaveStream &) const;
protected:
+ ///
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
+
/// returns x offset of cell compared to inset
int cellXOffset(idx_type idx) const;
/// returns y offset of cell compared to inset
#include "math_extern.h"
#include "math_charinset.h"
#include "textpainter.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h"
}
-dispatch_result MathHullInset::priv_dispatch
+DispatchResult MathHullInset::priv_dispatch
(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
bool display() const;
///
bool ams() const;
- /// local dispatcher
- dispatch_result priv_dispatch(FuncRequest const & cmd,
- idx_type & idx, pos_type & pos);
/// Appends \c list with all labels found within this inset.
void getLabelList(Buffer const &,
std::vector<std::string> & list) const;
void infoize(std::ostream & os) const;
protected:
+ ///
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
///
std::string eolString(row_type row, bool fragile) const;
#include "math_mathmlstream.h"
#include "math_parser.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "LColor.h"
}
-dispatch_result MathNestInset::priv_dispatch(FuncRequest const & cmd,
- idx_type & idx, pos_type & pos)
+DispatchResult
+MathNestInset::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
BufferView * bv = cmd.view();
void write(WriteStream & os) const;
/// writes [, name(), and args in []
void normalize(NormalStream & os) const;
-
- /// local dispatcher
- dispatch_result priv_dispatch(FuncRequest const & cmd,
- idx_type & idx, pos_type & pos);
-
protected:
+ ///
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
+
/// we store the cells in a vector
typedef std::vector<MathArray> cells_type;
/// thusly:
void metricsMarkers(int frame = 1) const;
/// add space for markers
void metricsMarkers2(int frame = 1) const;
-
};
#endif
#include "math_mathmlstream.h"
#include "math_support.h"
#include "math_symbolinset.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
}
-dispatch_result MathScriptInset::dispatch
- (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+MathScriptInset::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
if (cmd.action == LFUN_MATH_LIMITS) {
if (!cmd.argument.empty()) {
void infoize(std::ostream & os) const;
/// say whether we have displayed limits
void infoize2(std::ostream & os) const;
- /// local dispatcher
- dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
-
+protected:
+ ///
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
private:
/// returns x offset for main part
int dxx() const;
#include "math_factory.h"
#include "BufferView.h"
+#include "dispatchresult.h"
#include "debug.h"
#include "funcrequest.h"
#include "math_support.h"
}
-dispatch_result
-RefInset::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+RefInset::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_INSET_MODIFY:
int docbook(std::ostream & os, bool) const;
/// small wrapper for the time being
- dispatch_result localDispatch(FuncRequest const & cmd);
+ DispatchResult localDispatch(FuncRequest const & cmd);
struct ref_type_info {
///
protected:
///
virtual
- dispatch_result
+ DispatchResult
priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
};
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "encoding.h"
#include "funcrequest.h"
#include "gettext.h"
return font_metrics::width(c, font);
}
- if (c == Paragraph::META_INSET)
+ if (c == Paragraph::META_INSET)
return pit->getInset(pos)->width();
if (IsSeparatorChar(c))
pos_type addressBreakPoint(pos_type i, Paragraph const & par)
{
pos_type const end = par.size();
-
+
for (; i < end; ++i)
if (par.isNewline(i))
return i + 1;
row.endpos(end);
return;
}
-
+
// maximum pixel width of a row.
int width = workWidth() - rightMargin(*pit, *bv()->buffer());
// - leftMargin(pit, row);
point = i + 1;
break;
}
- // Break before...
+ // Break before...
if (i + 1 < end) {
InsetOld * in = pit->getInset(i + 1);
if (in && in->display()) {
}
char const c = pit->getChar(i);
-
+
if (i > endPosOfFontSpan) {
font = getFont(pit, i);
endPosOfFontSpan = pit->getEndPosOfFontSpan(i);
}
-
+
{
int thiswidth = singleWidth(pit, i, c, font);
//<< x << " width: " << width << endl;
chunkwidth += thiswidth;
}
-
+
// break before a character that will fall off
// the right of the row
if (point == end || chunkwidth >= width - left) {
if (i > pos) {
point = i;
- break;
+ break;
}
}
// exit on last registered breakpoint:
// some insets are line separators too
if (pit->isLineSeparator(i)) {
// register breakpoint:
- point = i + 1;
+ point = i + 1;
chunkwidth = 0;
}
}
BufferParams const & bufparams = bv()->buffer()->params();
// some parksips VERY EASY IMPLEMENTATION
if (bv()->buffer()->params().paragraph_separation
- == BufferParams::PARSEP_SKIP
+ == BufferParams::PARSEP_SKIP
&& pit != ownerParagraphs().begin()
&& ((layout->isParagraph() && pit->getDepth() == 0)
|| (boost::prior(pit)->layout()->isParagraph()
{
align = LYX_ALIGN_CENTER;
}
-
+
switch (align) {
case LYX_ALIGN_BLOCK: {
int const ns = numberOfSeparators(*pit, row);
#include "counters.h"
#include "CutAndPaste.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "errorlist.h"
#include "Floating.h"
#include "FloatList.h"
// If there is a change in the language the implicit word selection
// is disabled.
LyXCursor resetCursor = cursor;
- bool implicitSelection =
+ bool implicitSelection =
font.language() == ignore_language
&& font.number() == LyXFont::IGNORE
&& selectWordWhenUnderCursor(lyx::WHOLE_WORD_STRICT);
double fill_label_hfill = row.fill_label_hfill();
pos_type const row_pos = row.pos();
pos_type const end = row.endpos();
-
+
if (end <= row_pos)
cursor_vpos = row_pos;
else if (pos >= end && !boundary)
#include "bufferparams.h"
#include "BufferView.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "factory.h"
#include "funcrequest.h"
#include "gettext.h"
} // anon namespace
-dispatch_result LyXText::dispatch(FuncRequest const & cmd)
+DispatchResult LyXText::dispatch(FuncRequest const & cmd)
{
lyxerr[Debug::ACTION] << "LyXText::dispatch: action[" << cmd.action
<<"] arg[" << cmd.argument << ']' << "xy[" <<