#include "staff-symbol-referencer.hh"
#include "line-interface.hh"
-/* Get the extent of just the line part of the bar (ie. excluding any
- repeat dots) */
-Interval
-Bar_line::bar_y_extent (Grob *me, Grob *refpoint)
+MAKE_SCHEME_CALLBACK (Bar_line, calc_bar_extent, 1)
+SCM
+Bar_line::calc_bar_extent (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
+
SCM size = me->get_property ("bar-size");
+
if (!scm_is_number (size))
- return Interval ();
+ return ly_interval2scm (Interval ());
Real h = scm_to_double (size);
- Interval iv (-h/2, h/2);
+ return ly_interval2scm (Interval (-h/2, h/2));
+}
+
+Interval
+Bar_line::bar_y_extent (Grob *me, Grob *refpoint)
+{
+ Interval iv = robust_scm2interval (me->get_property ("bar-extent"), Interval ());
iv.translate (me->relative_coordinate (refpoint, Y_AXIS));
return iv;
"glyph "
"glyph-name "
"bar-size "
+ "bar-extent "
);
static Stencil compound_barline (Grob *, string, Real height, bool rounded);
static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
static Interval bar_y_extent (Grob *, Grob *);
+ DECLARE_SCHEME_CALLBACK (calc_bar_extent, (SCM));
DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_anchor, (SCM));
(axis-group-parent-X ,ly:grob? "Containing X@tie{}axis group.")
(axis-group-parent-Y ,ly:grob? "Containing Y@tie{}axis group.")
+ (bar-extent ,number-pair? "The Y-extent of the actual barline.
+This may differ from 'Y-extent because it does not include the dots in
+a repeat barline.")
(bars ,ly:grob-array? "A list of bar line pointers.")
(beam ,ly:grob? "A pointer to the beam, if applicable.")
(bounded-by-me ,ly:grob-array? "A list of spanners that have this
(stencil . ,ly:bar-line::print)
(glyph-name . ,bar-line::calc-glyph-name)
(bar-size . ,ly:bar-line::calc-bar-size)
+ (bar-extent . ,ly:bar-line::calc-bar-extent)
(allow-span-bar . #t)
(space-alist . (
(non-musical . #t)
(stencil . ,ly:span-bar::print)
(bar-size . ,ly:span-bar::calc-bar-size)
+ (bar-extent . ,ly:axis-group-interface::height)
(X-extent . ,ly:span-bar::width)
(glyph-name . ,ly:span-bar::calc-glyph-name)
(before-line-breaking . ,ly:span-bar::before-line-breaking)
+ (allow-span-bar . #t)
;; ugh duplication!