]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macro.h
partial revert of macro stuff
[lyx.git] / src / mathed / math_macro.h
index a1637a7607de4447a88cadbccd060dfc72c12128..8056c99175c658e89db9a94df580c5fc1405fe0b 100644 (file)
 
 #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<InsetBase> 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_;
 };