]> git.donarmstrong.com Git - lilypond.git/blob - lily/page-breaking-scheme.cc
8b698942072ebf9ddc8459aa01360dd51dd52a2d
[lilypond.git] / lily / page-breaking-scheme.cc
1 /*
2   page-breaking-scheme.cc -- implement bindings to the various
3   page-breakers
4
5   source file of the GNU LilyPond music typesetter
6
7   (c) 2006--2007 Joe Neeman <joeneeman@gmail.com>
8 */
9
10 #include "paper-book.hh"
11 #include "page-turn-page-breaking.hh"
12 #include "optimal-page-breaking.hh"
13 #include "minimal-page-breaking.hh"
14
15 LY_DEFINE (ly_page_turn_breaking, "ly:page-turn-breaking",
16            1, 0, 0, (SCM pb),
17            "Optimally break (pages and lines) the @code{Paper_book} object"
18            " @var{pb} such that page turns only happen in specified places,"
19            " returning its pages.")
20 {
21   Page_turn_page_breaking b (unsmob_paper_book (pb));
22   return b.solve ();
23 }
24
25 LY_DEFINE (ly_optimal_breaking, "ly:optimal-breaking",
26            1, 0, 0, (SCM pb),
27            "Optimally break (pages and lines) the @code{Paper_book} object"
28            " @var{pb} to minimize badness in bother vertical and horizontal"
29            " spacing.")
30 {
31   Optimal_page_breaking b (unsmob_paper_book (pb));
32   return b.solve ();
33 }
34
35 LY_DEFINE (ly_minimal_breaking, "ly:minimal-breaking",
36            1, 0, 0, (SCM pb),
37            "Break (pages and lines) the @code{Paper_book} object @var{pb}"
38            " without looking for optimal spacing: stack as many lines on"
39            " a page before moving to the next one.")
40 {
41   Minimal_page_breaking b (unsmob_paper_book (pb));
42   return b.solve ();
43 }