// -*- C++ -*- /* * File: math_macro.h * Purpose: Declaration of macro class for mathed * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx> * Created: November 1996 * Description: WYSIWYG math macros * * Dependencies: Mathed * * Copyright: (c) 1996, 1997 Alejandro Aguilar Sierra * * Version: 0.2, Mathed & Lyx project. * * This code is under the GNU General Public Licence version 2 or later.
*/ #ifndef __MATH_MACRO__ #define __MATH_MACRO__
/// This class contains the data for a macro class MathMacro: public MathParInset
{ public: /// A macro can only be builded from an existing template
MathMacro(MathMacroTemplate *); /// or from another macro.
MathMacro(MathMacro*); ///
~MathMacro(); /// void Draw(int, int); /// void Metrics(); ///
MathedInset *Clone(); /// void Write(FILE *); /// void Write(LString &); /// bool setArgumentIdx(int); /// int getArgumentIdx(); /// int getMaxArgumentIdx(); /// int GetColumns(); /// void GetXY(int&, int&) const; /// void SetFocus(int, int); ///
LyxArrayBase *GetData(); ///
MathedRowSt *getRowSt() const { return args[idx].row; } /// void SetData(LyxArrayBase *); ///
MathedTextCodes getTCode() { return tcode; } /// bool Permit(short);
private: ///
MathMacroTemplate *tmplate; /// struct MacroArgumentBase { /// Position of the macro int x, y; ///
MathedRowSt *row; ///
LyxArrayBase *array; ///
MacroArgumentBase() { x = y = 0; array = 0; row = 0; }
} *args; /// int idx; /// int nargs; ///
MathedTextCodes tcode; /// friendclass MathMacroTemplate;
};
/// An argument class MathMacroArgument: public MathParInset
{ public: ///
MathMacroArgument() { expnd_mode = false; number = 1; SetType(LM_OT_MACRO_ARG); } ///
MathMacroArgument(int); ///
~MathMacroArgument() { fprintf(stderr, "help, destroyme!\n"); } ///
MathedInset *Clone() { returnthis; } /// void Metrics(); /// void Draw(int x, int baseline); /// void Write(FILE*); /// void Write(LString &); /// void setNumber(int n) { number = n; } /// Is expanded or not void setExpand(bool e) { expnd_mode = e; } /// Is expanded or not bool getExpand() { return expnd_mode; }
private: /// bool expnd_mode; /// int number;
};
/// This class contains the macro definition class MathMacroTemplate: public MathParInset
{ public: /// A template constructor needs all the data
MathMacroTemplate(charconst*, int na=0, int f=0); ///
~MathMacroTemplate(); /// void Draw(int, int); /// void Metrics(); /// void WriteDef(FILE *); /// void WriteDef(LString &); /// useful for special insets void setTCode(MathedTextCodes t) { tcode = t; } ///
MathedTextCodes getTCode() { return tcode; } /// void setArgument(LyxArrayBase *, int i=0); /// Number of arguments int getNoArgs() { return nargs; } /// void GetMacroXY(int, int&, int&) const; ///
MathParInset *getMacroPar(int) const; /// void SetMacroFocus(int&, int, int); /// void setEditMode(bool);
/// Replace the appropriate arguments with a specific macro's data void update(MathMacro* m=0);
private: /// short flags; ///
MathedTextCodes tcode; ///
MathMacroArgument *args; /// int nargs; /// friendclass MathMacro;
};
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.