]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/hara-kiri-group-spanner.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / hara-kiri-group-spanner.cc
index c4fa088d3388b5aa6fdb70ba353a7cc82636af00..981639c237d81db41dc4f37ca5354a38a8f2bba9 100644 (file)
@@ -3,8 +3,8 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "hara-kiri-group-spanner.hh"
@@ -43,9 +43,9 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me)
           == 0)) 
     return;
 
-  Link_array<Grob> childs;
+  vector<Grob*> childs;
   Axis_group_interface::get_children (me, &childs);
-  for (int i = 0; i < childs.size (); i++)
+  for (vsize i = 0; i < childs.size (); i++)
     childs[i]->suicide ();
 
   /*
@@ -58,33 +58,37 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me)
   We can't rely on offsets and dimensions of elements in a hara-kiri
   group. Use a callback to make sure that hara-kiri has been done
   before asking for offsets.  */
-MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, force_hara_kiri_callback, 2);
+MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, after_line_breaking, 1);
 SCM
-Hara_kiri_group_spanner::force_hara_kiri_callback (SCM smob, SCM axis)
+Hara_kiri_group_spanner::after_line_breaking (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  (void) axis;
+  consider_suicide (me);
+  return SCM_UNSPECIFIED;
+}
 
-  assert (scm_to_int (axis) == Y_AXIS);
+MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, force_hara_kiri_callback, 1);
+SCM
+Hara_kiri_group_spanner::force_hara_kiri_callback (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
   consider_suicide (me);
   return scm_from_double (0.0);
 }
 
-MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, force_hara_kiri_in_parent_callback, 2);
+MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, force_hara_kiri_in_y_parent_callback, 1);
 SCM
-Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM smob, SCM axis)
+Hara_kiri_group_spanner::force_hara_kiri_in_y_parent_callback (SCM smob)
 {
   Grob *daughter = unsmob_grob (smob);
-  Axis a = (Axis) scm_to_int (axis);
-  assert (a == Y_AXIS);
-  force_hara_kiri_callback (daughter->get_parent (a)->self_scm (), axis);
+  force_hara_kiri_callback (daughter->get_parent (Y_AXIS)->self_scm ());
   return scm_from_double (0.0);
 }
 
 void
 Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n)
 {
-  Pointer_group_interface::add_grob (me, ly_symbol2scm ("items-worth-living"), n);
+  Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("items-worth-living"), n);
 }
 
 ADD_INTERFACE (Hara_kiri_group_spanner, "hara-kiri-group-interface",