]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-book-scheme.cc
Web-ja: update introduction
[lilypond.git] / lily / paper-book-scheme.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
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.
10
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.
15
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/>.
18 */
19
20 #include "paper-book.hh"
21 #include "output-def.hh"
22
23 LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
24            1, 0, 0, (SCM pb),
25            "Return pages in @code{Paper_book} object @var{pb}.")
26 {
27   LY_ASSERT_SMOB (Paper_book, pb, 1);
28   return unsmob<Paper_book> (pb)->pages ();
29 }
30
31 LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
32            1, 0, 0, (SCM pb),
33            "Return scopes in @code{Paper_book} object @var{pb}.")
34 {
35   LY_ASSERT_SMOB (Paper_book, pb, 1);
36   Paper_book *book = unsmob<Paper_book> (pb);
37
38   SCM scopes = SCM_EOL;
39   if (book->parent_)
40     {
41       scopes = ly_paper_book_scopes (book->parent_->self_scm ());
42     }
43   if (ly_is_module (book->header_))
44     scopes = scm_cons (book->header_, scopes);
45
46   return scopes;
47 }
48
49 LY_DEFINE (ly_paper_book_performances, "ly:paper-book-performances",
50            1, 0, 0, (SCM pb),
51            "Return performances in @code{Paper_book} object @var{pb}.")
52 {
53   LY_ASSERT_SMOB (Paper_book, pb, 1);
54   return unsmob<Paper_book> (pb)->performances ();
55 }
56
57 LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
58            1, 0, 0, (SCM pb),
59            "Return systems in @code{Paper_book} object @var{pb}.")
60 {
61   LY_ASSERT_SMOB (Paper_book, pb, 1);
62   return unsmob<Paper_book> (pb)->systems ();
63 }
64
65 LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
66            1, 0, 0, (SCM pb),
67            "Return the paper output definition (@code{\\paper})"
68            " in @code{Paper_book} object @var{pb}.")
69 {
70   LY_ASSERT_SMOB (Paper_book, pb, 1);
71   Paper_book *pbook = unsmob<Paper_book> (pb);
72   return pbook->paper_->self_scm ();
73 }
74
75 LY_DEFINE (ly_paper_book_header, "ly:paper-book-header",
76            1, 0, 0, (SCM pb),
77            "Return the header definition (@code{\\header})"
78            " in @code{Paper_book} object @var{pb}.")
79 {
80   LY_ASSERT_SMOB (Paper_book, pb, 1);
81   Paper_book *pbook = unsmob<Paper_book> (pb);
82   return pbook->header_;
83 }