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: (c) 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
34 MathedCursor(MathParInset * p);
38 void Insert(byte, MathedTextCodes t = LM_TC_MIN);
40 void Insert(MathedInset *, int t = LM_TC_INSET);
46 bool Right(bool sel = false);
48 bool Left(bool sel = false);
50 bool Up(bool sel = false);
52 bool Down(bool sel = false);
57 /// Pull out an argument from its container inset
61 void draw(Painter &, int x, int y);
63 void Redraw(Painter &);
66 void Draw(long unsigned pm, int x, int y);
75 void SetPos(int, int);
77 void GetPos(int & x, int & y) { cursor->GetPos(x, y); }
79 short GetFCode() { return cursor->FCode(); }
81 MathParInset * GetPar() { return par; }
83 MathParInset * getCurrentPar() const { return cursor->p; }
85 void SetPar(MathParInset *);
87 void Interpret(char const *);
92 void setLabel(char const *);
95 /// Set accent: if argument = 0 it's considered consumed
96 void setAccent(int ac = 0);
97 /// Returns last accent
98 int getAccent() const;
100 bool IsEnd() const { return !cursor->OK(); }
101 // Macro mode methods
103 void MacroModeOpen();
105 void MacroModeClose();
107 bool InMacroMode() { return macro_mode; }
109 // Local selection methods
111 bool Selection() { return selection; }
127 void SelGetArea(int * xp, int * yp, int & n);
130 XPoint * SelGetArea(int &);
133 void clearLastCode() { lastcode = LM_TC_MIN; }
135 void setLastCode(MathedTextCodes t) { lastcode = t; }
137 MathedTextCodes getLastCode() const { return lastcode; }
143 void MacroModeBack();
145 void MacroModeInsert(char);
153 MathedXIter cursel, * anchor;
155 // LyxArrayBase *selarray;
163 MathedXIter * cursor;
167 void doAccent(byte c, MathedTextCodes t);
169 void doAccent(MathedInset * p);
175 MathedTextCodes lastcode;
183 MathFuncInset * imacro;
187 //-------------------- Inline Functions -------------------------//