]> git.donarmstrong.com Git - lilypond.git/blob - lily/hara-kiri-vertical-group-spanner.cc
release: 1.3.55
[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(SCM s)
17   : Spanner (s)
18 {
19   set_elt_pointer ("items-worth-living", SCM_EOL);
20 }
21
22 void 
23 Hara_kiri_group_spanner::add_interesting_item (Item* n)
24 {
25   add_dependency (n);
26   Pointer_group_interface (this, "items-worth-living").add_element (n);
27 }
28
29 void 
30 Hara_kiri_group_spanner::after_line_breaking ()
31 {
32   SCM worth = get_elt_pointer ("items-worth-living");
33   if (gh_pair_p (worth))
34     return;
35
36   Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
37   for (int i = 0; i < childs.size (); i++)
38     {
39       Score_element* s = childs[i];
40
41       if ( line_l () != s->line_l ())
42         programming_error ("Killing other children too");
43       s->set_elt_property ("transparent", SCM_BOOL_T);
44       s->set_extent_callback (0, X_AXIS);
45       s->set_extent_callback (0, Y_AXIS);
46
47     }
48   set_extent_callback (0, X_AXIS);
49   set_extent_callback (0, Y_AXIS);  
50 }
51
52
53