]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.26
authorfred <fred>
Sun, 24 Mar 2002 19:28:45 +0000 (19:28 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:28:45 +0000 (19:28 +0000)
hdr/item.hh
hdr/spanner.hh
hdr/staffelem.hh

index 9b234819ec44e9ebe9d83e6bc2d23a6b06969563..68f1402c5b84d62191d60278299ecfad3c601e1a 100644 (file)
@@ -6,16 +6,16 @@
 #include "string.hh"
 #include "staffelem.hh"
 
-
 /// a horizontally fixed size element of the score
 struct Item : Staff_elem {
     /// indirection to the column it is in
     PCol * pcol_l_;
 
     /****************/
-    
+    virtual Item *item() { return this; }
     Item();
-    void print()const;
+    void do_print()const;
+    const char*name()const;
 };
 /** Item is the datastructure for printables whose width is known
   before the spacing is calculated
index d04f0736a6252a95d2abd7314f61e18b8aae5cbf..144b110e29df0b5e64bb4362d5d56f7b2c24d948 100644 (file)
@@ -19,9 +19,10 @@ struct Spanner:Staff_elem {
     
     Spanner();
     virtual Interval width()const;
-    void print()const;
-
+    void do_print()const;
+    const char* name()const;
     Spanner *broken_at(PCol *c1,  PCol *c2) const;
+    virtual Spanner* spanner() { return this; }
 protected:
     /// clone a piece of  this spanner.
     virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0; 
@@ -31,9 +32,9 @@ protected:
     c1 >= start, c2  <= stop
     */
 };
-/**
-  A spanner is a symbol whose final appearance can only be calculated
-  after the breaking problem is solved.
+/** A spanner is a symbol which spans across several columns, so its
+  final appearance can only be calculated after the breaking problem
+  is solved.
 
   Examples
 
index 3eed7dfba7e0a5775a48b2d8a15efb1ea5083d53..c7751b6ecc9a7652fffa948c15add5c05abf521d 100644 (file)
@@ -40,8 +40,13 @@ struct Staff_elem {
     void pre_processing();
     void post_processing();
     void molecule_processing();
-    
+    virtual const char *name() const;          // to find out derived classes.
+    virtual Spanner* spanner()  { return 0; }
+    virtual Item * item() { return 0; }
 protected:
+    
+    /// do printing of derived info.
+    virtual void do_print() const=0;
     /// generate the molecule    
     virtual Molecule* brew_molecule_p()const=0;
     ///executed directly after the item is added to the PScore
@@ -69,5 +74,7 @@ private:
   accomplished with the dependencies field of struct Staff_elem.
 
   */
+
+#define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c
 #endif // STAFFELEM_HH