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 Score_elem's. Most Score_elem's depend
17 on other Score_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 Score_elem.
25 /// member: the symbols
26 Molecule
*output
; // should scrap, and use temp var?
30 This is needed, because #output# may still be
34 Array
<Score_elem
*> dependancy_l_arr_
;
37 ORPHAN
, // not yet added to pstaff
38 VIRGIN
, // added to pstaff
40 PRECALCED
, // calcs before spacing done
41 POSTCALCING
, // busy calculating. This is used to trap cyclic deps.
42 POSTCALCED
, // after spacing calcs done
43 VERTICALCING
, // height determined
45 OUTPUT
, // molecule has been output
46 DELETED
, // to catch malloc mistakes.
49 /// the pstaff it is in
53 Score_elem(Score_elem
const&);
54 String
TeXstring () const ;
55 virtual void print() const;
56 virtual Interval
width() const;
57 virtual Interval
height() const;
58 Paper_def
*paper() const;
59 virtual ~Score_elem();
61 NAME_MEMBERS(Score_elem
);
64 translate the symbol. The symbol does not have to be created yet.
65 Overridable, since this staff-elem might act as a pseudo-list.
67 virtual void translate(Offset
);
69 void add_processing();
70 void pre_processing();
71 void post_processing();
72 void molecule_processing();
74 virtual Spanner
* spanner() { return 0; }
75 virtual Item
* item() { return 0; }
77 add a dependency. It may be the 0 pointer, in which case, it is ignored.
79 void add_dependency(Score_elem
* );
80 void substitute_dependency(Score_elem
* old
, Score_elem
* newdep
);
83 virtual Interval
do_height()const;
84 virtual Interval
do_width()const;
85 /// do printing of derived info.
86 virtual void do_print() const {}
87 /// generate the molecule
88 virtual Molecule
* brew_molecule_p()const;
89 ///executed directly after the item is added to the PScore
90 virtual void do_add_processing();
91 /// do calculations before determining horizontal spacing
92 virtual void do_pre_processing();
94 /// do calculations after determining horizontal spacing
95 virtual void do_post_processing();
97 /// do calculations after height of spanners/items is determined.
98 virtual void do_verticalcing();
99 Array
<Score_elem
*> dependant_l_arr_
;
104 #endif // STAFFELEM_HH