2 hara-kiri-vertical-group-spanner.cc -- implement Hara_kiri_group_spanner
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "axis-group-interface.hh"
11 #include "hara-kiri-group-spanner.hh"
17 Hara_kiri_group_spanner::Hara_kiri_group_spanner(SCM s)
20 set_elt_pointer ("items-worth-living", SCM_EOL);
24 Hara_kiri_group_spanner::add_interesting_item (Item* n)
27 Pointer_group_interface (this, "items-worth-living").add_element (n);
31 GLUE_SCORE_ELEMENT(Hara_kiri_group_spanner,after_line_breaking);
33 Hara_kiri_group_spanner::member_after_line_breaking ()
35 SCM worth = get_elt_pointer ("items-worth-living");
37 worth == self_scm is a stupid way to signal that we're done.
39 if (gh_pair_p (worth))
42 Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
43 for (int i = 0; i < childs.size (); i++)
45 Score_element* s = childs[i];
47 if ( line_l () != s->line_l ())
48 programming_error ("Killing other children too");
53 very appropriate name here :-)
62 We can't rely on offsets and dimensions of elements in a hara-kiri
63 group. Use a callback to make sure that hara-kiri has been done
64 before asking for offsets. */
66 Hara_kiri_group_spanner::force_hara_kiri_callback (Score_element const *elt, Axis a)
68 while (elt && !dynamic_cast<Hara_kiri_group_spanner const*> (elt))
69 elt = elt->parent_l(a);
73 Hara_kiri_group_spanner const * seppuku = dynamic_cast<Hara_kiri_group_spanner const*> (elt);
75 ((Hara_kiri_group_spanner*)seppuku)->member_after_line_breaking ();