3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "BufferView.h"
17 #include "dispatchresult.h"
18 #include "iterators.h"
20 #include "paragraph.h"
22 #include "insets/updatableinset.h"
28 DispatchResult Cursor::dispatch(FuncRequest const & cmd)
30 for (int i = data_.size() - 1; i >= 0; --i) {
31 CursorItem & citem = data_[i];
33 lyxerr << "trying to dispatch to inset" << citem.inset_ << endl;
34 DispatchResult res = citem.inset_->dispatch(cmd);
35 lyxerr << " result: " << res.val() << endl;
40 lyxerr << "# unhandled result: " << res.val() << endl;
42 return DispatchResult(false);
46 void buildCursor(Cursor & cursor, BufferView & bv)
48 UpdatableInset * inset = bv.theLockingInset();
49 lyxerr << "\nbuildCursor: " << inset << endl;
53 inset = inset->getLockingInset();
56 ParIterator pit = bv.buffer()->par_iterator_begin();
57 ParIterator end = bv.buffer()->par_iterator_end();
58 for ( ; pit != end && !ok; ++pit) {
59 InsetList::iterator it = pit->insetlist.begin();
60 InsetList::iterator iend = pit->insetlist.end();
61 for ( ; it != iend && !ok; ++it)
62 if (it->inset == inset || it->inset == inset->owner())
67 lyxerr << " tli not found! inset: " << inset << endl;
72 for (size_t i = 0, n = cursor.data_.size(); i != n; ++i) {
73 lyxerr << " inset: " << cursor.data_[i].inset_
74 << " idx: " << cursor.data_[i].idx_
75 << " text: " << cursor.data_[i].text_
76 << " par: " << cursor.data_[i].par_
77 << " pos: " << cursor.data_[i].pos_