#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 &);
- ///
- std::auto_ptr<InsetBase> clone() const;
- ///
- MathMacro * asMacro() { return this; }
- ///
- MathMacro const * asMacro() const { return this; }
+ MathMacro(std::string const & name, int numargs);
///
void draw(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;
void infoize2(std::ostream &) const;
private:
+ virtual std::auto_ptr<InsetBase> doClone() const;
///
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_;
};