]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macro.h
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_macro.h
index 6b824f6846cc4f3cdff48b2b168696bbb75cfd00..ed8067bde531c8f3c76905e04cd71a29f1024fcb 100644 (file)
@@ -6,16 +6,16 @@
  *  Created:     November 1996
  *  Description: WYSIWYG math macros
  *
- *  Dependencies: Mathed
+ *  Dependencies: Math
  *
  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
  *
- *   Version: 0.2, Mathed & Lyx project.
+ *   Version: 0.2, Math & Lyx project.
  *
  *   This code is under the GNU General Public Licence version 2 or later.
  */
-#ifndef MATH_MACRO
-#define MATH_MACRO
+#ifndef MATH_MACRO_H
+#define MATH_MACRO_H
 
 #ifdef __GNUG__
 #pragma interface
@@ -23,9 +23,8 @@
 
 #include <vector>
 #include <iosfwd>
-#include <boost/smart_ptr.hpp>
 
-#include "math_parinset.h"
+#include "math_nestinset.h"
 #include "math_macroarg.h"
 
 class MathMacroTemplate;
@@ -35,73 +34,50 @@ class MathMacroTemplate;
     \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
     \version November 1996
  */
-class MathMacro : public MathParInset {
+class MathMacro : public MathNestInset {
 public:
        /// A macro can be built from an existing template
        explicit MathMacro(MathMacroTemplate const &);
        ///
-       void draw(Painter &, int, int);
+       MathMacro(MathMacro const &);
        ///
-       void Metrics();
+       void draw(Painter &, int x, int y) const;
        ///
-       MathedInset * Clone();
+       void metrics(MathStyles st) const;
        ///
-       void Write(std::ostream &, bool fragile);
+       MathInset * clone() const;
        ///
-       void WriteNormal(std::ostream &);
-       /// Index 0 is the template, index 1..nargs() are the parameters
-       bool setArgumentIdx(int);
+       void write(std::ostream &, bool fragile) const;
        ///
-       int getArgumentIdx() const;
+       void writeNormal(std::ostream &) const;
        ///
-       int getMaxArgumentIdx() const;
-       ///
-       int nargs() const;
-       ///
-       int GetColumns() const;
-       ///
-       void GetXY(int &, int &) const;
-       ///
-       void SetFocus(int, int);
-       ///
-       MathedArray & GetData();
-       ///
-       MathedArray const & GetData() const;
-       ///
-       void setData(MathedArray const &);
-       ///
-       void setData(MathedArray const &, int);
-       ///
-       MathedTextCodes getTCode() const;
+       void dump() const;
+
        ///
-       bool Permit(short) const;
+       bool idxUp(unsigned int &, unsigned int &) const;
        ///
-       void expand();
+       bool idxDown(unsigned int &, unsigned int &) const;
        ///
-       void dump(std::ostream & os) const;
+       bool idxLeft(unsigned int &, unsigned int &) const;
        ///
-       MathParInset const * arg(int) const;
+       bool idxRight(unsigned int &, unsigned int &) const;
+
        ///
-       MathParInset * arg(int);
+       void validate(LaTeXFeatures &) const;
        ///
-       MathMacroTemplate * tmplate() const;
+       bool isMacro() const { return true; }
+
 private:
        ///
-       MathMacroTemplate * tmplate_;
-       /// our arguments
-       std::vector< boost::shared_ptr<MathParInset> > args_;
-       /// the expanded version fror drawing
-       boost::shared_ptr<MathParInset> expanded_;
+       void operator=(MathMacro const &);
        ///
-       int idx_;
+       char const * name() const;
 
-       /// unimplemented
-       void operator=(MathMacro const &);
+       ///
+       MathMacroTemplate const * const tmplate_;
+       ///
+       mutable MathXArray expanded_;
 };
 
-inline std::ostream & operator<<(std::ostream & os, MathMacro const & m)
-{
-       m.dump(os);
-       return os;
-}
+
 #endif