]> git.donarmstrong.com Git - lilypond.git/blobdiff - molecule.hh
release: 0.0.4
[lilypond.git] / molecule.hh
index 6709b7375074b89124e5e39e2de2a2ac71e3d438..60a7a05f44ed8664a6458a0f1eaf6131af575b0b 100644 (file)
@@ -4,11 +4,11 @@
 #include "list.hh"
 #include "boxes.hh"
 #include "item.hh"
-
+#include "symbol.hh"
 /// a symbol which can be translated, and freely copied
 struct Atom {
     Offset off;
-    const Symbol * sym;
+    Symbol sym;
 
     void translate(Offset o) {
        off += o;
@@ -16,28 +16,34 @@ struct Atom {
     
     /// how big is #this#?
     Box extent() const;
-    Atom(const Symbol*s);
+    Atom(Symbol s);
+
+
     String TeXstring() const;
 };
 
 /// a group of #Atom#s
-struct Molecule : Output {
-    List<Atom> ats;
+struct Molecule {
+    PointerList<Atom*> ats;
 
     Molecule() { }
-    Molecule(Atom a) { ats.bottom().add(a); }
-    //    Molecule(Molecule const&src);
+    Molecule(Atom a) { add(a) ; }
+
     void add_right(const Molecule &m);
     void add_left(const Molecule &m);
     void add_top(const Molecule &m);
     void add_bot(const Molecule &m);
     void add(Molecule const &m);
     void translate(Offset);
-
+    void add(Atom a) { ats.bottom().add(new Atom(a)); }
     /// how big is #this#? 
     Box extent() const;
 
     String TeXstring() const;
+
+    Molecule(const Molecule&s);
+private:
+    void operator=(const Molecule&);
 };
 /** a group of individually translated symbols. You can add molecules
     to the top, to the right, etc.  */