2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2005--2015 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 "output-def.hh"
23 LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
25 "Return pages in @code{Paper_book} object @var{pb}.")
27 LY_ASSERT_SMOB (Paper_book, pb, 1);
28 return unsmob<Paper_book> (pb)->pages ();
31 LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
33 "Return scopes in @code{Paper_book} object @var{pb}.")
35 LY_ASSERT_SMOB (Paper_book, pb, 1);
36 Paper_book *book = unsmob<Paper_book> (pb);
41 scopes = ly_paper_book_scopes (book->parent_->self_scm ());
43 if (ly_is_module (book->header_))
44 scopes = scm_cons (book->header_, scopes);
49 LY_DEFINE (ly_paper_book_performances, "ly:paper-book-performances",
51 "Return performances in @code{Paper_book} object @var{pb}.")
53 LY_ASSERT_SMOB (Paper_book, pb, 1);
54 return unsmob<Paper_book> (pb)->performances ();
57 LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
59 "Return systems in @code{Paper_book} object @var{pb}.")
61 LY_ASSERT_SMOB (Paper_book, pb, 1);
62 return unsmob<Paper_book> (pb)->systems ();
65 LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
67 "Return the paper output definition (@code{\\paper})"
68 " in @code{Paper_book} object @var{pb}.")
70 LY_ASSERT_SMOB (Paper_book, pb, 1);
71 Paper_book *pbook = unsmob<Paper_book> (pb);
72 return pbook->paper_->self_scm ();
75 LY_DEFINE (ly_paper_book_header, "ly:paper-book-header",
77 "Return the header definition (@code{\\header})"
78 " in @code{Paper_book} object @var{pb}.")
80 LY_ASSERT_SMOB (Paper_book, pb, 1);
81 Paper_book *pbook = unsmob<Paper_book> (pb);
82 return pbook->header_;