2 staff-elem.hh -- part of LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
12 #include "molecule.hh"
13 #include "class-name.hh"
16 /** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend
17 on other Staff_elem's, eg, Beam needs to know and set direction of
18 Stem. So the Beam has to be calculated *before* Stem. This is
19 accomplished with the dependencies field of struct Staff_elem.
24 ORPHAN
, // not yet added to pstaff
25 VIRGIN
, // added to pstaff
27 PRECALCED
, // calcs before spacing done
29 POSTCALCED
, // after spacing calcs done
30 OUTPUT
, // molecule has been output
33 /// the pstaff it is in
37 Staff_elem(Staff_elem
const&);
38 String
TeXstring () const ;
39 virtual void print() const;
40 virtual Interval
width() const;
41 virtual Interval
height() const;
42 Paper_def
*paper() const;
43 virtual ~Staff_elem();
45 NAME_MEMBERS(Staff_elem
);
46 void translate(Offset
);
47 void add_processing();
48 void pre_processing();
49 void post_processing();
50 void molecule_processing();
52 virtual Spanner
* spanner() { return 0; }
53 virtual Item
* item() { return 0; }
54 void add_dependency(Staff_elem
* );
55 void substitute_dependency(Staff_elem
* old
, Staff_elem
* newdep
);
59 /// do printing of derived info.
60 virtual void do_print() const=0;
61 /// generate the molecule
62 virtual Molecule
* brew_molecule_p()const=0;
63 ///executed directly after the item is added to the PScore
64 virtual void do_add_processing();
65 /// do calculations before determining horizontal spacing
66 virtual void do_pre_processing();
68 /// do calculations after determining horizontal spacing
69 virtual void do_post_processing();
71 Array
<Staff_elem
*> dependants
;
74 /// member: the symbols
75 Molecule
*output
; // should scrap, and use temp var?
79 This is needed, because #output# may still be
83 Array
<Staff_elem
*> dependencies
;
87 #endif // STAFFELEM_HH