2 staffelem.hh -- part of LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
12 #include "molecule.hh"
16 ORPHAN, // not yet added to pstaff
17 VIRGIN, // added to pstaff
18 PRECALCED, // calcs before spacing done
19 POSTCALCED, // after spacing calcs done
20 OUTPUT, // molecule has been output
23 Array<Staff_elem*> dependencies;
25 /// the pstaff it is in
29 Staff_elem(Staff_elem const&);
30 String TeXstring () const ;
31 virtual void print() const;
32 virtual Interval width() const;
33 virtual Interval height() const;
34 Paperdef *paper() const;
35 virtual ~Staff_elem();
38 void translate(Offset);
39 void add_processing();
40 void pre_processing();
41 void post_processing();
42 void molecule_processing();
43 virtual const char *name() const; // to find out derived classes.
44 virtual Spanner* spanner() { return 0; }
45 virtual Item * item() { return 0; }
48 /// do printing of derived info.
49 virtual void do_print() const=0;
50 /// generate the molecule
51 virtual Molecule* brew_molecule_p()const=0;
52 ///executed directly after the item is added to the PScore
53 virtual void do_add_processing();
54 /// do calculations before determining horizontal spacing
55 virtual void do_pre_processing();
57 /// do calculations after determining horizontal spacing
58 virtual void do_post_processing();
61 /// member: the symbols
62 Molecule *output; // should scrap, and use temp var?
67 This is needed, because #output# may still be
71 /** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend
72 on other Staff_elem's, eg, Beam needs to know and set direction of
73 Stem. So the Beam has to be calculated *before* Stem. This is
74 accomplished with the dependencies field of struct Staff_elem.
78 #define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c
79 #endif // STAFFELEM_HH