From ba497c80b7f446cc0217dd15c30750e57a35d635 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:28:45 +0000 Subject: [PATCH] lilypond-0.0.26 --- hdr/item.hh | 6 +++--- hdr/spanner.hh | 11 ++++++----- hdr/staffelem.hh | 9 ++++++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/hdr/item.hh b/hdr/item.hh index 9b234819ec..68f1402c5b 100644 --- a/hdr/item.hh +++ b/hdr/item.hh @@ -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 diff --git a/hdr/spanner.hh b/hdr/spanner.hh index d04f0736a6..144b110e29 100644 --- a/hdr/spanner.hh +++ b/hdr/spanner.hh @@ -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 diff --git a/hdr/staffelem.hh b/hdr/staffelem.hh index 3eed7dfba7..c7751b6ecc 100644 --- a/hdr/staffelem.hh +++ b/hdr/staffelem.hh @@ -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 -- 2.39.5