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);
37 void Insert(byte, MathedTextCodes t = LM_TC_MIN);
39 void Insert(MathedInset *, int t = LM_TC_INSET);
45 bool Right(bool sel = false);
47 bool Left(bool sel = false);
49 bool Up(bool sel = false);
51 bool Down(bool sel = false);
56 /// Pull out an argument from its container inset
59 void draw(Painter &, int x, int y);
61 void Redraw(Painter &);
67 void SetPos(int, int);
69 void GetPos(int & x, int & y) { cursor->GetPos(x, y); }
71 short GetFCode() { return cursor->FCode(); }
73 MathParInset * GetPar() { return par; }
75 MathParInset * getCurrentPar() const { return cursor->p; }
77 void SetPar(MathParInset *);
79 void Interpret(string const &);
85 void setLabel(string const &);
87 string const & getLabel() const {
88 return cursor->getLabel();
92 /// Set accent: if argument = 0 it's considered consumed
93 void setAccent(int ac = 0);
94 /// Returns last accent
95 int getAccent() const;
97 bool IsEnd() const { return !cursor->OK(); }
100 void MacroModeOpen();
102 void MacroModeClose();
104 bool InMacroMode() { return macro_mode; }
106 // Local selection methods
108 bool Selection() { return selection; }
124 void SelGetArea(int ** xp, int ** yp, int & n);
126 void clearLastCode() { lastcode = LM_TC_MIN; }
128 void setLastCode(MathedTextCodes t) { lastcode = t; }
130 MathedTextCodes getLastCode() const { return lastcode; }
136 void MacroModeBack();
138 void MacroModeInsert(char);
146 MathedXIter cursel, * anchor;
148 // LyxArrayBase *selarray;
156 MathedXIter * cursor;
160 void doAccent(byte c, MathedTextCodes t);
162 void doAccent(MathedInset * p);
168 MathedTextCodes lastcode;
172 MathFuncInset * imacro;
176 //-------------------- Inline Functions -------------------------//