2 paper-score.cc -- implement Paper_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "paper-score.hh"
11 #include "all-font-metrics.hh"
13 #include "gourlay-breaking.hh"
14 #include "international.hh"
17 #include "output-def.hh"
18 #include "paper-book.hh"
19 #include "paper-column.hh"
20 #include "scm-hash.hh"
26 Paper_score::Paper_score (Output_def *layout)
31 paper_systems_ = SCM_EOL;
34 Paper_score::Paper_score (Paper_score const &s)
41 Paper_score::derived_mark () const
44 scm_gc_mark (layout_->self_scm ());
45 scm_gc_mark (systems_);
46 scm_gc_mark (paper_systems_);
50 Paper_score::typeset_system (System *system)
55 systems_ = scm_cons (system->self_scm (), systems_);
56 system->pscore_ = this;
57 system->layout_ = layout_;
61 vector<Column_x_positions>
62 Paper_score::calc_breaking ()
64 Break_algorithm *algorithm = 0;
65 vector<Column_x_positions> sol;
67 algorithm = new Gourlay_breaking;
68 algorithm->set_pscore (this);
69 sol = algorithm->solve ();
76 Paper_score::process ()
78 if (be_verbose_global)
79 message (_f ("Element count %d (spanners %d) ",
80 system_->element_count (),
81 system_->spanner_count ()));
83 message (_ ("Preprocessing graphical objects...") + " ");
85 /* FIXME: Check out why we need this - removing gives assertion failures
88 doubly, also done in Score_engraver */
89 vector<Grob*> pc (system_->columns ());
90 pc[0]->set_property ("breakable", SCM_BOOL_T);
91 pc.back ()->set_property ("breakable", SCM_BOOL_T);
93 system_->pre_processing ();
95 vector<Column_x_positions> breaking = calc_breaking ();
96 system_->break_into_pieces (breaking);
98 paper_systems_ = system_->get_paper_systems ();
102 Paper_score::root_system () const
108 Paper_score::layout () const
114 Paper_score::get_paper_systems () const
116 return paper_systems_;