2 g-script.cc -- implement G_script
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 TODO: Quantisation support (staccato dots between stafflines)
16 #include "g-script.hh"
18 #include "g-staff-side.hh"
26 G_script::do_substitute_element_pointer (Score_element*o, Score_element*n)
28 if (o == staff_side_l_)
29 staff_side_l_ = dynamic_cast<G_staff_side_item*>(n);
35 G_script::get_molecule(Direction d) const
37 return lookup_l ()->afm_find ("scripts-" + indices_drul_[d]);
42 G_script::do_pre_processing ()
45 = staff_side_l_->dim_cache_[X_AXIS].parent_l_->element_l();
46 translate_axis (e->extent (X_AXIS).center (), X_AXIS);
50 G_script::do_post_processing ()
52 Direction d = staff_side_l_->dir_;
53 Molecule m (get_molecule(d));
54 translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
58 G_script::set_staff_side (G_staff_side_item*g)
62 dim_cache_[Y_AXIS].parent_l_ = & g->dim_cache_[Y_AXIS];
66 G_script::do_brew_molecule_p () const
68 return new Molecule (get_molecule (staff_side_l_->dir_));