source file of the GNU LilyPond music typesetter
- (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 2004--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "text-interface.hh"
-#include "line-spanner.hh"
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
struct Ottava_bracket
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
- static bool has_interface (Grob *);
+ DECLARE_GROB_INTERFACE ();
};
/*
Interval span_points;
Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
- Output_def *layout = me->get_layout ();
+ Output_def *layout = me->layout ();
Drul_array<bool> broken;
Direction d = LEFT;
{
extract_grob_set (b, "note-heads", heads);
common = common_refpoint_of_array (heads, common, X_AXIS);
- for (int i = 0; i < heads.size (); i++)
+ for (vsize i = 0; i < heads.size (); i++)
{
Grob *h = heads[i];
Grob *dots = Rhythmic_head::get_dots (h);
SCM markup = me->get_property ("text");
Stencil text;
if (Text_interface::is_markup (markup))
- text = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), properties, markup));
+ text = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (),
+ properties, markup));
Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
Interval (0, 0));
if (Note_column::has_interface (b))
{
extract_grob_set (b, "note-heads", heads);
- for (int i = 0; i < heads.size (); i++)
+ for (vsize i = 0; i < heads.size (); i++)
{
Grob *h = heads[i];
ext.unite (h->extent (common, X_AXIS));
Grob *dots = Rhythmic_head::get_dots (h);
if (dots && d == RIGHT)
- {
- ext.unite (dots->extent (common, X_AXIS));
- }
+ ext.unite (dots->extent (common, X_AXIS));
}
}
if (ext.is_empty ())
- {
- ext = robust_relative_extent (b, common, X_AXIS);
- }
+ ext = robust_relative_extent (b, common, X_AXIS);
if (broken[d])
{
Real text_size = text.extent (X_AXIS).is_empty ()
? 0.0 : text.extent (X_AXIS)[RIGHT] + 0.3;
- span_points[LEFT] =
- min (span_points[LEFT],
- (span_points[RIGHT] - text_size
- - robust_scm2double (me->get_property ("minimum-length"), -1.0)));
+ span_points[LEFT]
+ = min (span_points[LEFT],
+ (span_points[RIGHT] - text_size
+ - robust_scm2double (me->get_property ("minimum-length"), -1.0)));
Interval bracket_span_points = span_points;
bracket_span_points[LEFT] += text_size;
return b.smobbed_copy ();
}
-ADD_INTERFACE (Ottava_bracket, "ottava-bracket-interface",
+ADD_INTERFACE (Ottava_bracket,
"An ottava bracket",
- "edge-height bracket-flare shorten-pair minimum-length");
+
+ /*
+ properties
+ */
+ "edge-height "
+ "bracket-flare "
+ "shorten-pair "
+ "minimum-length");