#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
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;
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
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
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