4 * Purpose: Declaration of interaction classes for mathed
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: January 1996
7 * Description: MathCursor control all user interaction
9 * Dependencies: Xlib, XForms
11 * Copyright: 1996, Alejandro Aguilar Sierra
13 * Version: 0.8beta, Mathed & Lyx project.
15 * You are free to use and modify this code under the terms of
16 * the GNU General Public Licence version 2 or later.
26 #include "math_iter.h"
27 #include "math_inset.h"
30 /// This is the external interface of Mathed's subkernel
35 MathedCursor(MathParInset * p);
39 void Insert(byte, MathedTextCodes t = LM_TC_MIN);
41 void Insert(MathedInset *, int t = LM_TC_INSET);
47 bool Right(bool sel = false);
49 bool Left(bool sel = false);
51 bool Up(bool sel = false);
53 bool Down(bool sel = false);
58 /// Pull out an argument from its container inset
61 void draw(Painter &, int x, int y);
63 void Redraw(Painter &);
69 void SetPos(int, int);
71 void GetPos(int & x, int & y) { cursor->GetPos(x, y); }
73 short GetFCode() { return cursor->FCode(); }
75 MathParInset * GetPar() { return par; }
77 MathParInset * getCurrentPar() const { return cursor->p; }
79 void SetPar(MathParInset *);
81 void Interpret(char const *);
86 void setLabel(char const *);
89 /// Set accent: if argument = 0 it's considered consumed
90 void setAccent(int ac = 0);
91 /// Returns last accent
92 int getAccent() const;
94 bool IsEnd() const { return !cursor->OK(); }
99 void MacroModeClose();
101 bool InMacroMode() { return macro_mode; }
103 // Local selection methods
105 bool Selection() { return selection; }
121 void SelGetArea(int ** xp, int ** yp, int & n);
123 void clearLastCode() { lastcode = LM_TC_MIN; }
125 void setLastCode(MathedTextCodes t) { lastcode = t; }
127 MathedTextCodes getLastCode() const { return lastcode; }
133 void MacroModeBack();
135 void MacroModeInsert(char);
143 MathedXIter cursel, * anchor;
145 // LyxArrayBase *selarray;
153 MathedXIter * cursor;
157 void doAccent(byte c, MathedTextCodes t);
159 void doAccent(MathedInset * p);
165 MathedTextCodes lastcode;
173 MathFuncInset * imacro;
177 //-------------------- Inline Functions -------------------------//