]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_atom.h
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_atom.h
index 38c40469b0f575320208bcc9fea87b9c5a9bb2ee..8e78a4b0c8188047d3d1a070946aa27a4c0b65f4 100644 (file)
@@ -15,35 +15,46 @@ Exactly where the subscript and superscript are drawn depends on the
 size, and type, of the nucleus they are attached to.  
 
 Jules
+
+--
+
+Ok: Implementing it thusly is not feasible since cursor movement gets
+hackish. We use MathAtom only as a wrapper around MathInset * with value
+semantics.
+
+The MathAtom owns the MathInset * and is responsible for proper cloning and
+destruction. Every MathInset * should be put into a MathAtom after its
+creation as soon as possible.
+
+Andre'
+
 */
 
 class MathInset;
 
 class MathAtom {
 public: 
-       ///
+       /// default constructor, object is useless, but we need it to put it into
+       // std::containers
        MathAtom();
-       ///
-       MathAtom(MathAtom const &);
-       ///
+       /// the "real constructor"
        explicit MathAtom(MathInset * p);
-       /// 
-       virtual ~MathAtom(); 
-       ///
+       /// 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 reset(MathInset * p);
+       /// access to the inset
        MathInset * nucleus() const;
-       ///
+       /// access to the inset
        MathInset * operator->() const;
 
 private:
        ///
        MathInset * nucleus_;
-
-       /// raw copy
-       void copy(MathAtom const & p);
-       /// raw destruction
-       void done();
 };
 
 #endif