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