+/* Draws a vertical bracket to the left of a chord
+ Chris Jackson <chris@fluffhouse.org.uk> */
+
+MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_bracket, 1);
+SCM
+Arpeggio::brew_chord_bracket (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Interval heads = robust_scm2interval (me->get_property ("positions"),
+ Interval())
+ * Staff_symbol_referencer::staff_space (me);
+
+ Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
+ Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
+ Real dy = heads.length () + sp;
+ Real x = 0.7;
+
+ Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt));
+ mol.translate_axis (heads[LEFT] - sp / 2.0, Y_AXIS);
+ return mol.smobbed_copy ();
+}
+
+/*
+ We have to do a callback, because print () triggers a
+ vertical alignment if it is cross-staff.
+*/
+MAKE_SCHEME_CALLBACK (Arpeggio, width, 1);
+SCM
+Arpeggio::width (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts.arpeggio");
+
+ return ly_interval2scm (arpeggio.extent (X_AXIS));
+}
+
+MAKE_SCHEME_CALLBACK (Arpeggio, height, 1);
+SCM
+Arpeggio::height (SCM smob)
+{
+ return Grob::stencil_height (smob);
+}
+
+MAKE_SCHEME_CALLBACK (Arpeggio, pure_height, 3);
+SCM
+Arpeggio::pure_height (SCM smob, SCM, SCM)
+{
+ Grob *me = unsmob_grob (smob);
+ if (to_boolean (me->get_property ("cross-staff")))
+ return ly_interval2scm (Interval ());
+
+ return height (smob);
+}
+
+ADD_INTERFACE (Arpeggio,
+ "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.",
+
+ /* properties */
+ "arpeggio-direction "
+ "positions "
+ "script-priority " // TODO: make around-note-interface
+ "stems "
+ );