Ensure scripts inside chords obey manual directions.
[lilypond/mpolesky.git] / lily / minimal-page-breaking.cc
blob1f4cb4d686cbb92d9d8142aba3a588dea7791d90
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2007--2010 Nicolas Sceaux <nicolas.sceaux@free.fr>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "international.hh"
21 #include "minimal-page-breaking.hh"
22 #include "output-def.hh"
23 #include "page-spacing.hh"
24 #include "paper-book.hh"
26 static bool
27 is_break (Grob *)
29 return false;
32 Minimal_page_breaking::Minimal_page_breaking (Paper_book *pb)
33 : Page_breaking (pb, is_break)
37 Minimal_page_breaking::~Minimal_page_breaking ()
41 SCM
42 Minimal_page_breaking::solve ()
44 vsize end = last_break_position ();
46 message (_ ("Calculating line breaks..."));
47 set_to_ideal_line_configuration (0, end);
48 break_into_pieces (0, end, current_configuration (0));
50 message (_ ("Calculating page breaks..."));
51 vsize first_page_num = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1);
52 Page_spacing_result res = pack_systems_on_least_pages (0, first_page_num);
53 SCM lines = systems ();
54 return make_pages (res.systems_per_page_, lines);