]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/hara-kiri-vertical-group-spanner.cc
release: 1.3.44
[lilypond.git] / lily / hara-kiri-vertical-group-spanner.cc
index 92fc9e29ee3bbac06e451ca81ffc5ca123c08503..12d5093c079185a83059eb16c3d325b3d9824071 100644 (file)
@@ -4,51 +4,51 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1998 Jan Nieuwenhuizen <jan@digicash.com>
+  (c)  1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "axis-group-interface.hh"
 #include "hara-kiri-vertical-group-spanner.hh"
+#include "debug.hh"
 #include "item.hh"
-#include "note-head.hh"
-#include "p-col.hh"
-#include "molecule.hh"
 
-IMPLEMENT_IS_TYPE_B1 (Hara_kiri_vertical_group_spanner, Vertical_group_spanner);
-
-void 
-Hara_kiri_vertical_group_spanner::add_element (Graphical_element* e)
+Hara_kiri_group_spanner::Hara_kiri_group_spanner()
 {
-  if (e->is_type_b (Note_head::static_name ()))
-    add_dependency ((Score_elem*)e);
-  Vertical_group_spanner::add_element (e);
+  set_elt_property ("items-worth-living", SCM_EOL);
 }
 
-// we never get here, or indeed in axis-group-spanner::do_break_processing?
 void 
-Hara_kiri_vertical_group_spanner::do_break_processing ()
+Hara_kiri_group_spanner::add_interesting_item (Item* n)
 {
-  Vertical_group_spanner::do_break_processing ();
-  if (dependency_size ())
-    return;
-  transparent_b_ = true;
+  add_dependency (n);
+  set_elt_property ("items-worth-living",
+                   gh_cons (n->self_scm_,
+                            get_elt_property ("items-worth-living")));
 }
 
-// too late ?
 void 
-Hara_kiri_vertical_group_spanner::do_post_processing ()
+Hara_kiri_group_spanner::after_line_breaking ()
 {
-  if (dependency_size ())
+  SCM worth = get_elt_property ("items-worth-living");
+  if (gh_pair_p (worth))
     return;
-  transparent_b_ = true;
-}
 
-Molecule*
-Hara_kiri_vertical_group_spanner::brew_molecule_p() const
-{
-  // aaarg: go away
-  if (1) // transparent_b_)
-    return new Molecule;
-  return Vertical_group_spanner::brew_molecule_p ();
+  Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
+  for (int i = 0; i < childs.size (); i++)
+    {
+      Score_element* s = childs[i];
+
+      if ( line_l () != s->line_l ())
+       programming_error ("Killing other children too");
+      s->set_elt_property ("transparent", SCM_BOOL_T);
+      s->set_extent_callback (0, X_AXIS);
+      s->set_extent_callback (0, Y_AXIS);
+
+    }
+  set_extent_callback (0, X_AXIS);
+  set_extent_callback (0, Y_AXIS);  
 }
 
 
+