#include "international.hh"
#include "item.hh"
#include "output-def.hh"
+#include "paper-column.hh"
#include "pitch.hh"
#include "stencil.hh"
return SCM_UNSPECIFIED;
}
+MAKE_SCHEME_CALLBACK (Accidental_interface, pure_height, 3);
+SCM
+Accidental_interface::pure_height (SCM smob, SCM start_scm, SCM)
+{
+ Item *me = dynamic_cast<Item*> (unsmob_grob (smob));
+ int start = scm_to_int (start_scm);
+ int rank = me->get_column ()->get_rank ();
+
+ bool visible = to_boolean (me->get_property ("forced"))
+ || !unsmob_grob (me->get_object ("tie"))
+ || rank != start + 1; /* we are in the middle of a line */
+
+ return visible ? Grob::stencil_height (smob) : ly_interval2scm (Interval ());
+}
+
vector<Box>
Accidental_interface::accurate_boxes (Grob *me, Grob **common)
{
Interval
Grob::pure_height (Grob *refp, int start, int end)
{
- SCM proc = get_property_data ( ly_symbol2scm ("Y-extent"));
- Interval iv = robust_scm2interval (call_pure_function (proc,
- scm_list_1 (self_scm ()),
- start, end),
- Interval (0, 0));
+ SCM proc = get_property_data (ly_symbol2scm ("Y-extent"));
+ SCM pure_proc = get_property_data (ly_symbol2scm ("pure-Y-extent"));
+ SCM iv_scm;
+
+ if (ly_is_procedure (pure_proc))
+ iv_scm = scm_apply_3 (pure_proc,
+ self_scm (),
+ scm_from_int (start),
+ scm_from_int (end), SCM_EOL);
+ else
+ iv_scm = call_pure_function (proc,
+ scm_list_1 (self_scm ()),
+ start, end);
+
+ Interval iv = robust_scm2interval (iv_scm, Interval (0, 0));
Real offset = pure_relative_y_coordinate (refp, start, end);
SCM min_ext = get_property ("minimum-Y-extent");
"outside-staff-horizontal-padding "
"outside-staff-padding "
"outside-staff-priority "
+ "pure-Y-extent "
"rotation "
"springs-and-rods "
"staff-symbol "
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_stencils, (SCM));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
DECLARE_GROB_INTERFACE();
static string get_fontcharname (string style, int alteration);
(glyph-name-alist . ,standard-alteration-glyph-name-alist)
(alteration . ,accidental-interface::calc-alteration)
(stencil . ,ly:accidental-interface::print)
+ (pure-Y-extent . ,ly:accidental-interface::pure-height)
(after-line-breaking
. ,ly:accidental-interface::after-line-breaking)
(meta . ((class . Item)
(glyph-name-alist . ,standard-alteration-glyph-name-alist)
(alteration . ,accidental-interface::calc-alteration)
(stencil . ,ly:accidental-interface::print)
+ (pure-Y-extent . ,ly:accidental-interface::pure-height)
(after-line-breaking
. ,ly:accidental-interface::after-line-breaking)
(meta . ((class . Item)
(X-offset . ,ly:side-position-interface::x-aligned-side)
(direction . ,LEFT)
(stencil . ,ly:accidental-interface::print)
+ (pure-Y-extent . ,ly:accidental-interface::pure-height)
(glyph-name-alist . ,standard-alteration-glyph-name-alist)
(after-line-breaking . ,ly:accidental-interface::after-line-breaking)
(side-axis . ,X)