2 horizontal-bracket.cc -- implement Horizontal_bracket
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "side-position-interface.hh"
11 #include "pointer-group-interface.hh"
12 #include "directional-element-interface.hh"
13 #include "output-def.hh"
14 #include "staff-symbol-referencer.hh"
15 #include "tuplet-bracket.hh"
16 #include "horizontal-bracket.hh"
17 #include "axis-group-interface.hh"
20 Horizontal_bracket::make_bracket (Grob *me, Grob *refpoint,
21 Link_array<Grob> grobs,
22 Axis a, Direction dir)
24 Axis other = other_axis (a);
25 Grob *common = common_refpoint_of_array (grobs, refpoint, a);
26 Interval ext = Axis_group_interface::relative_group_extent (grobs, common, a);
28 Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
30 Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare"),
32 Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
35 // Make sure that it points in the correct direction:
36 scale_drul (&edge_height, Real (-dir));
40 start[a] = ext.length ();
43 ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around.
46 = Tuplet_bracket::make_bracket (me, other, start,
47 edge_height, empty, flare, shorten);
49 b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a)
59 Support texts on the brackets?
62 MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
64 Horizontal_bracket::print (SCM smob)
66 Grob *me = unsmob_grob (smob);
67 extract_grob_set (me, "columns", gs);
74 Stencil b = make_bracket (me, me, gs, X_AXIS, get_grob_direction (me));
75 return b.smobbed_copy ();
78 ADD_INTERFACE (Horizontal_bracket, "horizontal-bracket-interface",
79 "A horizontal bracket encompassing notes.",