Use scalar instead of embedded_scm for context mod overrides.
[lilypond/mpolesky.git] / lily / paper-book-scheme.cc
blob8306c79585ea5cdb0b99ee42020a2b65aa43fbbe
1 /*
2 paper-book-scheme.cc -- implement Paper_book bindings
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #include "paper-book.hh"
10 #include "ly-module.hh"
11 #include "output-def.hh"
13 LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
14 1, 0, 0, (SCM pb),
15 "Return pages in @code{Paper_book} object @var{pb}.")
17 LY_ASSERT_SMOB (Paper_book, pb, 1);
18 return unsmob_paper_book (pb)->pages ();
21 LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
22 1, 0, 0, (SCM pb),
23 "Return scopes in @code{Paper_book} object @var{pb}.")
25 LY_ASSERT_SMOB (Paper_book, pb, 1);
26 Paper_book *book = unsmob_paper_book (pb);
28 SCM scopes = SCM_EOL;
29 if (book->parent_)
31 scopes = ly_paper_book_scopes (book->parent_->self_scm ());
33 if (ly_is_module (book->header_))
34 scopes = scm_cons (book->header_, scopes);
36 return scopes;
39 LY_DEFINE (ly_paper_book_performances, "ly:paper-book-performances",
40 1, 0, 0, (SCM pb),
41 "Return performances in @code{Paper_book} object @var{pb}.")
43 LY_ASSERT_SMOB (Paper_book, pb, 1);
44 return unsmob_paper_book (pb)->performances ();
47 LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
48 1, 0, 0, (SCM pb),
49 "Return systems in @code{Paper_book} object @var{pb}.")
51 LY_ASSERT_SMOB (Paper_book, pb, 1);
52 return unsmob_paper_book (pb)->systems ();
55 LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
56 1, 0, 0, (SCM pb),
57 "Return the paper output definition (@code{\\paper})"
58 " in @code{Paper_book} object @var{pb}.")
60 LY_ASSERT_SMOB (Paper_book, pb, 1);
61 Paper_book *pbook = unsmob_paper_book (pb);
62 return pbook->paper_->self_scm ();