]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_atom.h
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_atom.h
index 04cf2a391d637599f9934cda7b319bcdcacc64e1..286b41ea76d060894d22af1ac8e2af0943ea1313 100644 (file)
@@ -3,9 +3,14 @@
 #ifndef MATH_ATOM_H
 #define MATH_ATOM_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+
+/**
+ * Wrapper for MathInset * with copy-semantics
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS
+ */
 
 /**
 The 'atom' is the major blob in math typesetting.  And 'atom' consists
@@ -30,6 +35,7 @@ Andre'
 
 */
 
+class InsetBase;
 class MathInset;
 
 class MathAtom {
@@ -38,21 +44,20 @@ public:
        // std::containers
        MathAtom();
        /// the "real constructor"
-       explicit MathAtom(MathInset * p);
+       explicit MathAtom(InsetBase * p);
        /// copy constructor, invokes nucleus_->clone()
        MathAtom(MathAtom const &);
        /// we really need to clean up
        ~MathAtom();
        /// assignment invokes nucleus_->clone()
        void operator=(MathAtom const &);
-       /// change inset under the hood
-       void operator=(MathInset * p);
-       /// change inset under the hood
-       void reset(MathInset * p);
        /// access to the inset (checked with gprof)
-       MathInset * nucleus() const { return nucleus_; }
+       MathInset       * nucleus()       { return nucleus_; }
        /// access to the inset
-       MathInset * operator->() const { return nucleus_; }
+       MathInset const * operator->() const { return nucleus_; }
+
+       /// width cache. Not nice...
+       mutable int width_;
 
 private:
        ///