2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "molecule.hh"
11 #include "paper-def.hh"
13 #include "staff-symbol-referencer.hh"
14 #include "directional-element-interface.hh"
21 GLUE_SCORE_ELEMENT(Dots,after_line_breaking);
23 Dots::member_after_line_breaking ()
25 SCM d= get_elt_property ("dot-count");
26 if (gh_number_p (d) && gh_scm2int (d))
28 if (!Directional_element_interface (this).get ())
29 Directional_element_interface (this).set (UP);
31 Staff_symbol_referencer_interface si (this);
32 int p = int (si.position_f ());
34 si.set_position (p + Directional_element_interface (this).get ());
41 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Dots,brew_molecule);
44 Dots::brew_molecule (SCM d)
46 Score_element *sc = unsmob_element (d);
47 Molecule mol (sc->lookup_l ()->blank (Box (Interval (0,0),
50 SCM c = sc->get_elt_property ("dot-count");
53 Molecule d = sc->lookup_l ()->afm_find (String ("dots-dot"));
55 Real dw = d.extent (X_AXIS).length ();
56 d.translate_axis (-dw, X_AXIS);
59 for (int i = gh_scm2int (c); i--; )
61 d.translate_axis (2*dw,X_AXIS);
65 return mol.create_scheme ();