///
~MathCursor();
///
- void insert(BufferView & bv, MathAtom const &);
+ void insert(LCursor & cur, MathAtom const &);
///
- void insert(BufferView & bv, MathArray const &);
+ void insert(LCursor & cur, MathArray const &);
///
- void insert2(BufferView & bv, std::string const &);
+ void insert2(LCursor & cur, std::string const &);
///
- void paste(BufferView & bv, std::string const & data);
+ void paste(LCursor & cur, std::string const & data);
/// return false for empty math insets
- bool erase(BufferView & bv);
+ bool erase(LCursor & cur);
/// return false for empty math insets
- bool backspace(BufferView & bv);
+ bool backspace(LCursor & cur);
/// called for LFUN_HOME etc
- bool home(BufferView & bv, bool sel = false);
+ bool home(LCursor & cur, bool sel = false);
/// called for LFUN_END etc
- bool end(BufferView & bv, bool sel = false);
+ bool end(LCursor & cur, bool sel = false);
/// called for LFUN_RIGHT and LFUN_RIGHTSEL
- bool right(BufferView & bv, bool sel = false);
+ bool right(LCursor & cur, bool sel = false);
/// called for LFUN_LEFT etc
- bool left(BufferView & bv, bool sel = false);
+ bool left(LCursor & cur, bool sel = false);
/// called for LFUN_UP etc
- bool up(BufferView & bv, bool sel = false);
+ bool up(LCursor & cur, bool sel = false);
/// called for LFUN_DOWN etc
- bool down(BufferView & bv, bool sel = false);
+ bool down(LCursor & cur, bool sel = false);
/// Put the cursor in the first position
- void first(BufferView & bv);
+ void first(LCursor & cur);
/// Put the cursor in the last position
- void last(BufferView & bv);
+ void last(LCursor & cur);
/// move to next cell in current inset
- void idxNext(BufferView & bv);
+ void idxNext(LCursor & bv);
/// move to previous cell in current inset
- void idxPrev(BufferView & bv);
+ void idxPrev(LCursor & bv);
///
- void plainErase(BufferView & bv);
+ void plainErase(LCursor & cur);
///
- void plainInsert(BufferView & bv, MathAtom const & at);
+ void plainInsert(LCursor & cur, MathAtom const & at);
///
- void niceInsert(BufferView & bv, MathAtom const & at);
+ void niceInsert(LCursor & cur, MathAtom const & at);
///
- void niceInsert(BufferView & bv, std::string const & str);
+ void niceInsert(LCursor & cur, std::string const & str);
/// in pixels from top of screen
- void setScreenPos(BufferView & bv, int x, int y);
+ void setScreenPos(LCursor & cur, int x, int y);
/// in pixels from top of screen
- void getScreenPos(BufferView & bv, int & x, int & y) const;
+ void getScreenPos(LCursor & cur, int & x, int & y) const;
/// in pixels from left of screen
- int targetX(BufferView & bv) const;
+ int targetX(LCursor & cur) const;
/// return the next enclosing grid inset and the cursor's index in it
- MathGridInset * enclosingGrid(BufferView & bv, idx_type & idx) const;
+ MathGridInset * enclosingGrid(LCursor & cur, idx_type & idx) const;
/// go up to enclosing grid
- void popToEnclosingGrid(BufferView & bv);
+ void popToEnclosingGrid(LCursor & cur);
/// go up to the hull inset
- void popToEnclosingHull(BufferView & bv);
+ void popToEnclosingHull(LCursor & cur);
/// go up to the hull inset
- void popToHere(BufferView & bv, MathInset const * p);
+ void popToHere(LCursor & cur, MathInset const * p);
/// adjust anchor position after deletions/insertions
- void adjust(BufferView & bv, pos_type from, difference_type diff);
+ void adjust(LCursor & cur, pos_type from, difference_type diff);
///
InsetFormulaBase * formula() const;
/// current offset in the current cell
///
- bool script(BufferView & bv, bool);
+ bool script(LCursor & cur, bool);
///
- bool interpret(BufferView & bv, char);
+ bool interpret(LCursor & cur, char);
/// interpret name a name of a macro
- void macroModeClose(BufferView & bv);
+ void macroModeClose(LCursor & cur);
/// are we currently typing the name of a macro?
- bool inMacroMode(BufferView & bv) const;
+ bool inMacroMode(LCursor & cur) const;
/// get access to the macro we are currently typing
- MathUnknownInset * activeMacro(BufferView & bv);
+ MathUnknownInset * activeMacro(LCursor & cur);
/// get access to the macro we are currently typing
- MathUnknownInset const * activeMacro(BufferView & bv) const;
+ MathUnknownInset const * activeMacro(LCursor & cur) const;
/// are we currently typing '#1' or '#2' or...?
- bool inMacroArgMode(BufferView & bv) const;
+ bool inMacroArgMode(LCursor & cur) const;
/// are we in math mode (1), text mode (-1) or unsure?
- MathInset::mode_type currentMode(BufferView & bv) const;
+ MathInset::mode_type currentMode(LCursor & cur) const;
// Local selection methods
///
bool selection() const;
///
- void selCopy(BufferView & bv);
+ void selCopy(LCursor & cur);
///
- void selCut(BufferView & bv);
+ void selCut(LCursor & cur);
///
- void selDel(BufferView & bv);
+ void selDel(LCursor & cur);
/// pastes n-th element of cut buffer
- void selPaste(BufferView & bv, size_t n);
+ void selPaste(LCursor & cur, size_t n);
///
- void selHandle(BufferView & bv, bool);
+ void selHandle(LCursor & cur, bool);
///
- void selStart(BufferView & bv);
+ void selStart(LCursor & cur);
///
- void selClear(BufferView & bv);
+ void selClear(LCursor & cur);
/// clears or deletes selection depending on lyxrc setting
- void selClearOrDel(BufferView & bv);
+ void selClearOrDel(LCursor & cur);
/// draws light-blue selection background
void drawSelection(PainterInfo & pi) const;
/// replace selected stuff with at, placing the former
// selection in given cell of atom
- void handleNest(BufferView & bv, MathAtom const & at, int cell = 0);
+ void handleNest(LCursor & cur, MathAtom const & at, int cell = 0);
/// remove this as soon as LyXFunc::getStatus is "localized"
std::string getLastCode() const { return "mathnormal"; }
///
bool isInside(MathInset const *) const;
///
- char valign(BufferView & bv) const;
+ char valign(LCursor & cur) const;
///
- char halign(BufferView & bv) const;
+ char halign(LCursor & cur) const;
/// make sure cursor position is valid
- void normalize(BufferView & bv);
+ void normalize(LCursor & cur);
/// mark current cursor trace for redraw
void touch();
/// enter a MathInset
- void push(BufferView & bv, MathAtom & par);
+ void push(LCursor & cur, MathAtom & par);
/// enter a MathInset from the front
- void pushLeft(BufferView & bv, MathAtom & par);
+ void pushLeft(LCursor & cur, MathAtom & par);
/// enter a MathInset from the back
- void pushRight(BufferView & bv, MathAtom & par);
+ void pushRight(LCursor & cur, MathAtom & par);
/// leave current MathInset to the left
- bool popLeft(BufferView & bv);
+ bool popLeft(LCursor & cur);
/// leave current MathInset to the left
- bool popRight(BufferView & bv);
+ bool popRight(LCursor & cur);
///
- bool hasPrevAtom(BufferView & bv) const;
+ bool hasPrevAtom(LCursor & cur) const;
///
- bool hasNextAtom(BufferView & bv) const;
+ bool hasNextAtom(LCursor & cur) const;
///
- MathAtom const & prevAtom(BufferView & bv) const;
+ MathAtom const & prevAtom(LCursor & cur) const;
///
- MathAtom & prevAtom(BufferView & bv);
+ MathAtom & prevAtom(LCursor & cur);
///
- MathAtom const & nextAtom(BufferView & bv) const;
+ MathAtom const & nextAtom(LCursor & cur) const;
///
- MathAtom & nextAtom(BufferView & bv);
+ MathAtom & nextAtom(LCursor & cur);
/// returns the selection
- void getSelection(BufferView & bv, CursorSlice &, CursorSlice &) const;
+ void getSelection(LCursor & cur, CursorSlice &, CursorSlice &) const;
/// returns the normalized anchor of the selection
- CursorSlice normalAnchor(BufferView & bv) const;
+ CursorSlice normalAnchor(LCursor & cur) const;
/// how deep are we nested?
- unsigned depth(BufferView & bv) const;
+ unsigned depth(LCursor & cur) const;
/// describe the situation
- std::string info(BufferView & bv) const;
+ std::string info(LCursor & cur) const;
/// dump selection information for debugging
void seldump(char const * str) const;
/// dump selection information for debugging
void dump(char const * str) const;
/// moves on
- void setSelection(BufferView & bv, CursorBase const & where, size_type n);
+ void setSelection(LCursor & cur, CursorBase const & where, size_type n);
/// grab selection marked by anchor and current cursor
- std::string grabSelection(BufferView & bv) const;
+ std::string grabSelection(LCursor & cur) const;
/// guess what
- std::string grabAndEraseSelection(BufferView & bv);
+ std::string grabAndEraseSelection(LCursor & cur);
///
- void insert(BufferView & bv, char c);
+ void insert(LCursor & cur, char c);
///
- void insert(BufferView & bv, std::string const & str);
+ void insert(LCursor & cur, std::string const & str);
/// lock/unlock inset
- void insetToggle(BufferView & bv);
+ void insetToggle(LCursor & cur);
/// hack for reveal codes
- void markInsert(BufferView & bv);
- void markErase(BufferView & bv);
+ void markInsert(LCursor & cur);
+ void markErase(LCursor & cur);
/// injects content of a cell into parent
- void pullArg(BufferView & bv);
+ void pullArg(LCursor & cur);
/// split font inset etc
- void handleFont(BufferView & bv, std::string const & font);
+ void handleFont(LCursor & cur, std::string const & font);
///
- DispatchResult dispatch(BufferView & bv, FuncRequest const & cmd);
+ DispatchResult dispatch(LCursor & cur, FuncRequest const & cmd);
private:
/// moves cursor index one cell to the left
- bool idxLeft(BufferView & bv);
+ bool idxLeft(LCursor & bv);
/// moves cursor index one cell to the right
- bool idxRight(BufferView & bv);
+ bool idxRight(LCursor & bv);
/// moves cursor to end of last cell of current line
- bool idxLineLast(BufferView & bv);
+ bool idxLineLast(LCursor & bv);
/// moves cursor position one cell to the left
- bool posLeft(BufferView & bv);
+ bool posLeft(LCursor & cur);
/// moves cursor position one cell to the right
- bool posRight(BufferView & bv);
+ bool posRight(LCursor & cur);
/// moves position somehow up or down
- bool goUpDown(BufferView & bv, bool up);
+ bool goUpDown(LCursor & cur, bool up);
/// moves position closest to (x, y) in given box
- bool bruteFind(BufferView & bv,
+ bool bruteFind(LCursor & cur,
int x, int y, int xlow, int xhigh, int ylow, int yhigh);
/// moves position closest to (x, y) in current cell
- void bruteFind2(BufferView & bv, int x, int y);
+ void bruteFind2(LCursor & cur, int x, int y);
/// are we in a nucleus of a script inset?
- bool inNucleus(BufferView & bv) const;
+ bool inNucleus(LCursor & cur) const;
/// erase the selected part and re-sets the cursor
- void eraseSelection(BufferView & bv);
+ void eraseSelection(LCursor & cur);
/// the name of the macro we are currently inputting
- std::string macroName(BufferView & bv) const;
+ std::string macroName(LCursor & cur) const;
/// where in the curent cell does the macro name start?
- difference_type macroNamePos(BufferView & bv) const;
+ difference_type macroNamePos(LCursor & cur) const;
/// can we enter the inset?
bool openable(MathAtom const &, bool selection) const;