]> git.donarmstrong.com Git - lilypond.git/blob - lily/hara-kiri-vertical-group-spanner.cc
76c95fcb8b935857e853fcad97e9f27d953fc4ba
[lilypond.git] / lily / hara-kiri-vertical-group-spanner.cc
1 /*
2   hara-kiri-vertical-group-spanner.cc 
3     -- implement Hara_kiri_vertical_group_spanner
4
5   source file of the GNU LilyPond music typesetter
6
7   (c)  1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
8   Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 */
10
11 #include "axis-group-interface.hh"
12 #include "hara-kiri-vertical-group-spanner.hh"
13 #include "debug.hh"
14 #include "item.hh"
15
16 Hara_kiri_group_spanner::Hara_kiri_group_spanner()
17 {
18   set_elt_pointer ("items-worth-living", SCM_EOL);
19 }
20
21 void 
22 Hara_kiri_group_spanner::add_interesting_item (Item* n)
23 {
24   add_dependency (n);
25   Pointer_group_interface (this, "items-worth-living").add_element (n);
26 }
27
28 void 
29 Hara_kiri_group_spanner::after_line_breaking ()
30 {
31   SCM worth = get_elt_pointer ("items-worth-living");
32   if (gh_pair_p (worth))
33     return;
34
35   Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
36   for (int i = 0; i < childs.size (); i++)
37     {
38       Score_element* s = childs[i];
39
40       if ( line_l () != s->line_l ())
41         programming_error ("Killing other children too");
42       s->set_elt_property ("transparent", SCM_BOOL_T);
43       s->set_extent_callback (0, X_AXIS);
44       s->set_extent_callback (0, Y_AXIS);
45
46     }
47   set_extent_callback (0, X_AXIS);
48   set_extent_callback (0, Y_AXIS);  
49 }
50
51
52