#ifndef MATH_CURSOR
#define MATH_CURSOR
-#ifdef __GNUG__
-#pragma interface
-#endif
#include "math_inset.h"
#include "math_iterator.h"
class InsetFormulaBase;
class BufferView;
-class MathPainterInfo;
+class PainterInfo;
class MathUnknownInset;
/**
[Have a look at math_inset.h first]
The MathCursor is different from the kind of cursor used in the Outer
-World. It contains a stack of MathCursorPos, each of which is made
+World. It contains a stack of CursorPos, each of which is made
up of a inset pointer, an index and a position offset, marking a path from
this formula's MathHullInset to the current position.
///
void insert(MathArray const &);
///
- void paste(string const & data);
- ///
- void erase();
+ void insert2(string const &);
///
- void backspace();
+ void paste(string const & data);
+ /// return false for empty math insets
+ bool erase();
+ /// return false for empty math insets
+ bool backspace();
/// called for LFUN_HOME etc
bool home(bool sel = false);
/// called for LFUN_END etc
/// in pixels from left of screen
int targetX() const;
/// current inset
- MathInset * par() const;
+ MathInset * inset() const;
/// return the next enclosing grid inset and the cursor's index in it
MathGridInset * enclosingGrid(idx_type & idx) const;
/// go up to enclosing grid
void selCut();
///
void selDel();
- ///
- void selPaste();
+ /// pastes n-th element of cut buffer
+ void selPaste(size_t n);
///
void selHandle(bool);
///
/// clears or deletes selection depending on lyxrc setting
void selClearOrDel();
/// draws light-blue selection background
- void drawSelection(MathPainterInfo & pi) const;
+ void drawSelection(PainterInfo & pi) const;
///
void handleNest(MathAtom const & at);
/// remove this as soon as LyXFunc::getStatus is "localized"
MathAtom & nextAtom();
/// returns the selection
- void getSelection(MathCursorPos &, MathCursorPos &) const;
+ void getSelection(CursorPos &, CursorPos &) const;
/// returns the normalized anchor of the selection
- MathCursorPos normalAnchor() const;
+ CursorPos normalAnchor() const;
/// reference to the last item of the path, i.e. "The Cursor"
- MathCursorPos & cursor();
+ CursorPos & cursor();
/// reference to the last item of the path, i.e. "The Cursor"
- MathCursorPos const & cursor() const;
+ CursorPos const & cursor() const;
/// how deep are we nested?
unsigned depth() const;
/// local dispatcher
- MathInset::result_type dispatch(FuncRequest const & cmd);
+ dispatch_result dispatch(FuncRequest const & cmd);
/// describe the situation
string info() const;
/// dump selection information for debugging