#pragma interface
#endif
-#include "math_iter.h"
-#include "math_inset.h"
+#include "math_xiter.h"
+
+class MathFuncInset;
+class MathParInset;
+class Painter;
/// This is the external interface of Mathed's subkernel
class MathedCursor {
- public:
- ///
- explicit
- MathedCursor(MathParInset * p);
- ///
- void Insert(byte, MathedTextCodes t = LM_TC_MIN);
- ///
- void Insert(MathedInset *, int t = LM_TC_INSET);
- ///
- void Home();
- ///
- void End();
- ///
- bool Right(bool sel = false);
- ///
- bool Left(bool sel = false);
- ///
- bool Up(bool sel = false);
- ///
- bool Down(bool sel = false);
- ///
- bool Pop();
- ///
- bool Push();
- /// Pull out an argument from its container inset
- bool pullArg();
- ///
- void draw(Painter &, int x, int y);
- ///
- void Redraw(Painter &);
- ///
- void Delete();
- ///
- void DelLine();
- ///
- void SetPos(int, int);
- ///
- void GetPos(int & x, int & y) { cursor->GetPos(x, y); }
- ///
- short GetFCode() { return cursor->FCode(); }
- ///
- MathParInset * GetPar() { return par; }
- ///
- MathParInset * getCurrentPar() const { return cursor->p; }
- ///
- void SetPar(MathParInset *);
- ///
- void Interpret(char const *);
- ///
- void SetSize(short);
- ///
- void setNumbered();
- void setLabel(char const *);
- ///
- bool Limits();
- /// Set accent: if argument = 0 it's considered consumed
- void setAccent(int ac = 0);
- /// Returns last accent
- int getAccent() const;
- ///
- bool IsEnd() const { return !cursor->OK(); }
- // Macro mode methods
- ///
- void MacroModeOpen();
- ///
- void MacroModeClose();
- ///
- bool InMacroMode() { return macro_mode; }
-
- // Local selection methods
- ///
- bool Selection() { return selection; }
- ///
- void SelCopy();
- ///
- void SelCut();
- ///
- void SelDel();
- ///
- void SelPaste();
- ///
- void SelStart();
- ///
- void SelClear();
- ///
- void SelBalance();
- ///
- void SelGetArea(int ** xp, int ** yp, int & n);
- ///
- void clearLastCode() { lastcode = LM_TC_MIN; }
- ///
- void setLastCode(MathedTextCodes t) { lastcode = t; }
- ///
- MathedTextCodes getLastCode() const { return lastcode; }
-
- protected:
- ///
- bool macro_mode;
- ///
- void MacroModeBack();
- ///
- void MacroModeInsert(char);
-
- // Selection stuff
- ///
- bool selection;
- ///
- int selpos;
- ///
- MathedXIter cursel, * anchor;
- ///
-// LyxArrayBase *selarray;
- ///
- Bool is_visible;
- ///
- long unsigned win;
- ///
- MathParInset * par;
- ///
- MathedXIter * cursor;
- ///
- int xc, yc;
- ///
- void doAccent(byte c, MathedTextCodes t);
- ///
- void doAccent(MathedInset * p);
- ///
- int accent;
- ///
- int nestaccent[8];
- ///
- MathedTextCodes lastcode;
-
- private:
+public:
+ ///
+ explicit
+ MathedCursor(MathParInset * p);
+ ///
+ void Insert(byte, MathedTextCodes t = LM_TC_MIN);
+ ///
+ void Insert(MathedInset *, int t = LM_TC_INSET);
+ ///
+ void Home();
+ ///
+ void End();
+ ///
+ bool Right(bool sel = false);
+ ///
+ bool Left(bool sel = false);
+ ///
+ bool Up(bool sel = false);
+ ///
+ bool Down(bool sel = false);
+ ///
+ bool Pop();
+ ///
+ bool Push();
+ /// Pull out an argument from its container inset
+ bool pullArg();
+ ///
+ void draw(Painter &, int x, int y);
+ ///
+ void Redraw(Painter &);
+ ///
+ void Delete();
+ ///
+ void DelLine();
+ ///
+ void SetPos(int, int);
+ ///
+ void GetPos(int & x, int & y);
+ ///
+ short GetFCode();
+ ///
+ MathParInset * GetPar();
+ ///
+ MathParInset * getCurrentPar() const;
+ ///
+ void SetPar(MathParInset *);
+ ///
+ void Interpret(string const &);
+ ///
+ void SetSize(short);
+ ///
+ void setNumbered();
+ ///
+ void setLabel(string const &);
+ ///
+ string const & getLabel() const;
+ ///
+ bool Limits();
+ /// Set accent: if argument = 0 it's considered consumed
+ void setAccent(int ac = 0);
+ /// Returns last accent
+ int getAccent() const;
+ ///
+ bool IsEnd() const;
+ // Macro mode methods
///
- char macrobf[80];
+ void MacroModeOpen();
///
- int macroln;
+ void MacroModeClose();
///
- MathFuncInset * imacro;
+ bool InMacroMode();
+
+ // Local selection methods
+ ///
+ bool Selection();
+ ///
+ void SelCopy();
+ ///
+ void SelCut();
+ ///
+ void SelDel();
+ ///
+ void SelPaste();
+ ///
+ void SelStart();
+ ///
+ void SelClear();
+ ///
+ void SelBalance();
+ ///
+ void SelGetArea(int ** xp, int ** yp, int & n);
+ ///
+ void clearLastCode();
+ ///
+ void setLastCode(MathedTextCodes t);
+ ///
+ void toggleLastCode(MathedTextCodes t);
+ ///
+ MathedTextCodes getLastCode() const;
+
+protected:
+ ///
+ bool macro_mode;
+
+ // Selection stuff
+ ///
+ bool selection;
+ ///
+ int selpos;
+ ///
+ MathedXIter cursel;
+ ///
+ MathedXIter * anchor;
+ ///
+ MathParInset * par;
+ ///
+ MathedXIter * cursor;
+ ///
+ void doAccent(byte c, MathedTextCodes t);
+ ///
+ void doAccent(MathedInset * p);
+ ///
+ int accent;
+ ///
+ int nestaccent[8];
+ ///
+ MathedTextCodes lastcode;
+
+private:
+ ///
+ MathFuncInset * imacro;
};
-
-//-------------------- Inline Functions -------------------------//
-
-
#endif