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);
30 stem_l_ = n ? (Stem*)n->item() : 0;
35 Script::set_stem (Stem*st_l)
50 Script::set_default_dir()
52 int s_i=specs_l_->rel_stem_dir();
56 dir_ = Direction(stem_l_->dir_ * s_i);
59 specs_l_->warning (_("Script needs stem direction"));
65 dir_ =specs_l_->staff_dir();
72 Script::do_width() const
74 return specs_l_->get_atom (paper(), dir_).extent ().x ();
78 Script::do_pre_processing()
80 if (breakable_b_ && break_status_i() != 1)
82 transparent_b_ = true;
91 Script::symbol_height() const
93 return specs_l_->get_atom (paper(), dir_).extent ().y ();
97 Script::brew_molecule_p() const
99 Real dx = paper()->note_width()/2;
101 Molecule*out = new Molecule (specs_l_->get_atom (paper(), dir_));
102 out->translate_axis (y_, Y_AXIS);
103 out->translate_axis (dx, X_AXIS); // FIXME! ugh
108 IMPLEMENT_IS_TYPE_B2(Script,Item,Staff_side);
111 Script::compare (Script *const&l1, Script *const&l2)
113 return l1->specs_l_->priority_i() - l2->specs_l_->priority_i ();