]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-system-scheme.cc
*** empty log message ***
[lilypond.git] / lily / paper-system-scheme.cc
1 /*
2   paper-system-scheme.cc --  implement Paper_system bindings
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #include "paper-system.hh"
11
12 LY_DEFINE (ly_paper_system_height, "ly:paper-system-extent",
13            2, 0, 0, (SCM system, SCM axis),
14            "Return the extent of @var{system}.")
15 {
16   Paper_system *ps = unsmob_paper_system (system);
17   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
18   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
19   Axis ax = (Axis)scm_to_int (axis);
20   return ly_interval2scm (ps->to_stencil().extent (ax));
21 }
22
23
24
25 LY_DEFINE (ly_paper_system_title_p, "ly:paper-system-title?",
26            1, 0, 0, (SCM system),
27            "Is  @var{system} a title system?")
28 {
29   Paper_system *ps = unsmob_paper_system (system);
30   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
31   return SCM_BOOL (ps->is_title ());
32 }
33
34 LY_DEFINE (ly_paper_system_number, "ly:paper-system-number",
35            1, 0, 0, (SCM system),
36            "Return the number of @var{system}.")
37 {
38   Paper_system *ps = unsmob_paper_system (system);
39   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
40   return scm_int2num (ps->number_);
41 }
42
43 LY_DEFINE (ly_paper_system_break_before_penalty, "ly:paper-system-break-before-penalty",
44            1, 0, 0, (SCM system),
45            "Return the score for page break after @var{system}.")
46 {
47   Paper_system *ps = unsmob_paper_system (system);
48   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
49   return scm_int2num (int (ps->break_before_penalty ()));
50 }
51
52 LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
53            1, 0, 0, (SCM system),
54            "Return the height of @var{system}.")
55 {
56   Paper_system *ps = unsmob_paper_system (system);
57   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
58   return ps->to_stencil ().smobbed_copy ();
59 }
60
61
62
63 LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents",
64            1, 0, 0, (SCM system),
65            "Return the top and bottom staff refpoint.")
66 {
67   Paper_system *ps = unsmob_paper_system (system);
68   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
69   return ly_interval2scm (ps->staff_refpoints_);
70 }
71