2 horizontal-bracket.cc -- implement Horizontal_bracket
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "horizontal-bracket.hh"
12 #include "side-position-interface.hh"
13 #include "pointer-group-interface.hh"
14 #include "directional-element-interface.hh"
15 #include "output-def.hh"
16 #include "staff-symbol-referencer.hh"
17 #include "tuplet-bracket.hh"
18 #include "axis-group-interface.hh"
22 Horizontal_bracket::make_bracket (Grob *me,
24 Axis a, Direction dir)
26 Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
28 Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare"),
30 Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
33 // Make sure that it points in the correct direction:
34 scale_drul (&edge_height, Real (-dir));
41 ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around.
43 return Tuplet_bracket::make_bracket (me, other_axis (a), start,
44 edge_height, empty, flare, shorten);
49 Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint,
51 Axis a, Direction dir)
53 Grob *common = common_refpoint_of_array (grobs, refpoint, a);
54 Interval ext = Axis_group_interface::relative_group_extent (grobs, common, a);
56 Stencil b = make_bracket (me, ext.length(), a, dir);
57 b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
66 Support texts on the brackets?
69 MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
71 Horizontal_bracket::print (SCM smob)
73 Grob *me = unsmob_grob (smob);
74 extract_grob_set (me, "columns", gs);
81 Stencil b = make_enclosing_bracket (me, me, gs, X_AXIS, get_grob_direction (me));
82 return b.smobbed_copy ();
85 ADD_INTERFACE (Horizontal_bracket,
87 "horizontal-bracket-interface",
88 "A horizontal bracket encompassing notes.",