2 paper-score.cc -- implement Paper_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "paper-score.hh"
11 #include "all-font-metrics.hh"
12 #include "gourlay-breaking.hh"
15 #include "output-def.hh"
16 #include "paper-book.hh"
17 #include "paper-column.hh"
18 #include "scm-hash.hh"
24 Paper_score::Paper_score ()
30 Paper_score::Paper_score (Paper_score
const &s
)
37 Paper_score::typeset_line (System
*system
)
42 systems_
= scm_cons (system
->self_scm (), systems_
);
43 system
->pscore_
= this;
45 scm_gc_unprotect_object (system
->self_scm ());
48 Array
<Column_x_positions
>
49 Paper_score::calc_breaking ()
51 Break_algorithm
*algorithm
= 0;
52 Array
<Column_x_positions
> sol
;
54 algorithm
= new Gourlay_breaking
;
55 algorithm
->set_pscore (this);
56 sol
= algorithm
->solve ();
63 Paper_score::process (String
)
65 if (be_verbose_global
)
66 message (_f ("Element count %d (spanners %d) ",
67 system_
->element_count (),
68 system_
->spanner_count ()));
70 message (_ ("Preprocessing graphical objects...") + " ");
72 /* FIXME: Check out why we need this - removing gives assertion failures
75 doubly, also done in Score_engraver */
76 Link_array
<Grob
> pc (system_
->columns ());
77 pc
[0]->set_property ("breakable", SCM_BOOL_T
);
78 pc
.top ()->set_property ("breakable", SCM_BOOL_T
);
80 system_
->pre_processing ();
82 Array
<Column_x_positions
> breaking
= calc_breaking ();
83 system_
->break_into_pieces (breaking
);
84 SCM lines
= system_
->get_lines ();
87 retain Grobs, since they are pointed to by the point & click data
88 structures, and are not marked fully, because child -> parent