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.
25 /// member: the symbols
26 Molecule *output; // should scrap, and use temp var?
30 This is needed, because #output# may still be
34 Array<Staff_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 OUTPUT, // molecule has been output
44 DELETED, // to catch malloc mistakes.
47 /// the pstaff it is in
51 Staff_elem(Staff_elem const&);
52 String TeXstring () const ;
53 virtual void print() const;
54 virtual Interval width() const;
55 virtual Interval height() const;
56 Paper_def *paper() const;
57 virtual ~Staff_elem();
59 NAME_MEMBERS(Staff_elem);
62 translate the symbol. The symbol does not have to be created yet.
63 Overridable, since this staff-elem might act as a pseudo-list.
65 virtual void translate(Offset);
67 void add_processing();
68 void pre_processing();
69 void post_processing();
70 void molecule_processing();
72 virtual Spanner* spanner() { return 0; }
73 virtual Item * item() { return 0; }
75 add a dependency. It may be the 0 pointer, in which case, it is ignored.
77 void add_dependency(Staff_elem* );
78 void substitute_dependency(Staff_elem* old, Staff_elem * newdep);
81 virtual Interval do_height()const;
82 virtual Interval do_width()const;
83 /// do printing of derived info.
84 virtual void do_print() const {}
85 /// generate the molecule
86 virtual Molecule* brew_molecule_p()const;
87 ///executed directly after the item is added to the PScore
88 virtual void do_add_processing();
89 /// do calculations before determining horizontal spacing
90 virtual void do_pre_processing();
92 /// do calculations after determining horizontal spacing
93 virtual void do_post_processing();
95 Array<Staff_elem*> dependant_l_arr_;
100 #endif // STAFFELEM_HH