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>
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",
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",
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
);
31 scopes
= ly_paper_book_scopes (book
->parent_
->self_scm ());
33 if (ly_is_module (book
->header_
))
34 scopes
= scm_cons (book
->header_
, scopes
);
39 LY_DEFINE (ly_paper_book_performances
, "ly:paper-book-performances",
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",
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",
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 ();