X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_macro.h;fp=src%2Fmathed%2Fmath_macro.h;h=8056c99175c658e89db9a94df580c5fc1405fe0b;hb=0ea524145a00c57df49ab1bebafdc74b19a23813;hp=a1637a7607de4447a88cadbccd060dfc72c12128;hpb=671aab63771f5d55a71d268745115e8d1ec38aa3;p=lyx.git diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index a1637a7607..8056c99175 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -15,30 +15,24 @@ #include "math_nestinset.h" #include "math_data.h" +#include "math_nestinset.h" +#include "math_macrotable.h" /// This class contains the data for a macro. -class MathMacro : public MathDimInset { +class MathMacro : public MathNestInset { public: /// A macro can be built from an existing template - explicit MathMacro(std::string const &); + MathMacro(std::string const & name, int numargs); /// std::auto_ptr clone() const; /// - MathMacro * asMacro() { return this; } - /// - MathMacro const * asMacro() const { return this; } - /// void draw(PainterInfo & pi, int x, int y) const; /// void drawExpanded(PainterInfo & pi, int x, int y) const; /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// - void metricsExpanded(MetricsInfo & mi, Dimension & dim) const; - /// - int widthExpanded() const; - /// std::string name() const; /// void setExpansion(MathArray const & exp, MathArray const & args) const; @@ -60,13 +54,15 @@ public: private: /// void updateExpansion() const; - /// + void expand() const; + + /// name of macro std::string name_; - /// + /// the unexpanded macro defintition + mutable MathArray tmpl_; + /// the matcro substituted with our args mutable MathArray expanded_; - /// - mutable MathArray args_; };