]> git.donarmstrong.com Git - lilypond.git/blob - lily/hara-kiri-vertical-group-spanner.cc
patch::: 1.3.33.jcn3
[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 "hara-kiri-vertical-group-spanner.hh"
12 #include "debug.hh"
13 #include "item.hh"
14
15 Hara_kiri_group_spanner::Hara_kiri_group_spanner()
16 {
17   set_elt_property ("items-worth-living", SCM_EOL);
18   set_axes(Y_AXIS,Y_AXIS);
19 }
20
21 void 
22 Hara_kiri_group_spanner::add_interesting_item (Item* n)
23 {
24   add_dependency (n);
25   set_elt_property ("items-worth-living",
26                     gh_cons (n->self_scm_,
27                              get_elt_property ("items-worth-living")));
28 }
29
30 void 
31 Hara_kiri_group_spanner::after_line_breaking ()
32 {
33   SCM worth = get_elt_property ("items-worth-living");
34   if (gh_pair_p (worth))
35     return;
36
37   Link_array<Score_element> childs = get_children ();
38   for (int i = 0; i < childs.size (); i++)
39     {
40       Score_element* s = childs[i];
41
42       if ( line_l () != s->line_l ())
43         programming_error ("Killing other children too");
44       s->set_elt_property ("transparent", SCM_BOOL_T);
45       s->set_empty (X_AXIS);
46       s->set_empty (Y_AXIS);
47
48     }
49   set_empty (X_AXIS);
50   set_empty (Y_AXIS);  
51 }
52
53
54