]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/span-bar.cc
2002-07-31 Rune Zedeler <rune@zedeler.dk>
[lilypond.git] / lily / span-bar.cc
index c1d82c6df047d96cc1c8f79615112c29d1d3b8a2..45cfa80e15f6c3a815bfe262ff8499956dc97c2a 100644 (file)
@@ -27,20 +27,22 @@ Span_bar::add_bar (Grob*me, Grob*b)
 
 MAKE_SCHEME_CALLBACK (Span_bar,brew_molecule,1);
 
-/**
- * Limitations/Bugs:
- *
- * (1) Elements from 'me->get_grob_property ("elements")' must be
- * ordered according to their y coordinates relative to their common
- * axis group parent.  Otherwise, the computation goes mad.  (TODO:
- * apply a sort algorithm that ensures this precondition.)  However,
- * until now, I have seen no case where lily has not fulfilled this
- * precondition.
- *
- * (2) This method depends on bar_engraver not being removed from
- * staff context.  If bar_engraver is removed, the size of the staff
- * lines is evaluated as 0, which results in a solid span bar line
- * with faulty y coordinate.
+/*
+  Limitations/Bugs:
+
+   (1) Elements from 'me->get_grob_property ("elements")' must be
+   ordered according to their y coordinates relative to their common
+   axis group parent.  Otherwise, the computation goes mad.
+
+   (TODO:
+   apply a sort algorithm that ensures this precondition.)  However,
+   until now, I have seen no case where lily has not fulfilled this
+   precondition.
+
+   (2) This method depends on bar_engraver not being removed from
+   staff context.  If bar_engraver is removed, the size of the staff
+   lines is evaluated as 0, which results in a solid span bar line
+   with faulty y coordinate.
  */
 
 /*
@@ -72,7 +74,7 @@ Span_bar::brew_molecule (SCM smobbed_me)
   if (!gh_string_p (glyph))
     return SCM_EOL;
   
-  String glyph_str = ly_scm2string (glyph);
+  String glyph_string = ly_scm2string (glyph);
 
   // compose span_bar_mol
   Molecule span_bar_mol;
@@ -99,7 +101,7 @@ Span_bar::brew_molecule (SCM smobbed_me)
          else
            {
              Molecule interbar
-               = Bar_line::compound_barline (staff_bar, glyph_str, l.length());
+               = Bar_line::compound_barline (staff_bar, glyph_string, l.length());
              interbar.translate_axis (l.center (), Y_AXIS);
              span_bar_mol.add_molecule (interbar);
            }
@@ -216,7 +218,7 @@ Span_bar::evaluate_glyph (Grob*me)
       type = ".|.";
     }
 
-  gl = ly_str02scm (type.ch_C ());
+  gl = ly_str02scm (type.to_str0 ());
   if (scm_equal_p (me->internal_get_grob_property (glyph_symbol), gl) != SCM_BOOL_T)
     me->internal_set_grob_property (glyph_symbol, gl);
 }
@@ -245,17 +247,10 @@ Span_bar::get_bar_size (SCM smob)
   return gh_double2scm (iv.length ());
 }
 
-void
-Span_bar::set_interface (Grob *me)
-{
-  Bar_line::set_interface (me);
-  
-  me->set_interface (ly_symbol2scm ("span-bar-interface"));
-  me->set_extent_callback (SCM_EOL, Y_AXIS);
-}
 
-bool
-Span_bar::has_interface (Grob*m)
-{
-  return m && m->has_interface (ly_symbol2scm ("span-bar-interface"));
-}
+
+ADD_INTERFACE (Span_bar,"span-bar-interface",
+  "A bar line that spans other barlines (typically used to get cross-staff barlines.",
+  "");
+
+