2 script.cc -- implement Script
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
8 #include "script-def.hh"
9 #include "musical-request.hh"
10 #include "paper-def.hh"
13 #include "molecule.hh"
17 Script::do_print() const
25 Script::do_substitute_dependency(Score_elem*o,Score_elem*n)
27 Staff_side::do_substitute_dependency(o,n);
29 stem_l_ = n ? (Stem*)n->item() : 0;
34 Script::set_stem(Stem*st_l)
44 inside_staff_b_ = false;
50 Script::set_default_dir()
52 int s_i=specs_l_->rel_stem_dir_i();
55 dir_i_ = stem_l_->dir_i_ * s_i;
57 specs_l_->warning("Script needs stem direction");
61 dir_i_ =specs_l_->staff_dir_i();
68 Script::do_width() const
70 return specs_l_->get_atom(paper(), dir_i_).extent().x;
74 Script::do_pre_processing()
78 inside_staff_b_ = specs_l_->inside_b();
82 Script::symbol_height()const
84 return specs_l_->get_atom(paper(), dir_i_).extent().y;
88 Script::brew_molecule_p() const
90 Real dy = paper()->internote_f();
92 Molecule*out = new Molecule(specs_l_->get_atom(paper(), dir_i_));
93 out->translate_y(dy * pos_i_);
97 IMPLEMENT_STATIC_NAME(Script);
98 IMPLEMENT_IS_TYPE_B2(Script,Item,Staff_side);
101 Script::compare(Script *const&l1, Script *const&l2)
103 return l1->specs_l_->priority_i() - l2->specs_l_->priority_i();