2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
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 "paper-book.hh"
21 #include "ly-module.hh"
22 #include "output-def.hh"
24 LY_DEFINE (ly_paper_book_pages
, "ly:paper-book-pages",
26 "Return pages in @code{Paper_book} object @var{pb}.")
28 LY_ASSERT_SMOB (Paper_book
, pb
, 1);
29 return unsmob_paper_book (pb
)->pages ();
32 LY_DEFINE (ly_paper_book_scopes
, "ly:paper-book-scopes",
34 "Return scopes in @code{Paper_book} object @var{pb}.")
36 LY_ASSERT_SMOB (Paper_book
, pb
, 1);
37 Paper_book
*book
= unsmob_paper_book (pb
);
42 scopes
= ly_paper_book_scopes (book
->parent_
->self_scm ());
44 if (ly_is_module (book
->header_
))
45 scopes
= scm_cons (book
->header_
, scopes
);
50 LY_DEFINE (ly_paper_book_performances
, "ly:paper-book-performances",
52 "Return performances in @code{Paper_book} object @var{pb}.")
54 LY_ASSERT_SMOB (Paper_book
, pb
, 1);
55 return unsmob_paper_book (pb
)->performances ();
58 LY_DEFINE (ly_paper_book_systems
, "ly:paper-book-systems",
60 "Return systems in @code{Paper_book} object @var{pb}.")
62 LY_ASSERT_SMOB (Paper_book
, pb
, 1);
63 return unsmob_paper_book (pb
)->systems ();
66 LY_DEFINE (ly_paper_book_paper
, "ly:paper-book-paper",
68 "Return the paper output definition (@code{\\paper})"
69 " in @code{Paper_book} object @var{pb}.")
71 LY_ASSERT_SMOB (Paper_book
, pb
, 1);
72 Paper_book
*pbook
= unsmob_paper_book (pb
);
73 return pbook
->paper_
->self_scm ();