2 paper-system-scheme.cc -- implement Paper_system bindings
4 source file of the GNU LilyPond music typesetter
6 (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "paper-system.hh"
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}.")
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));
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?")
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 ());
34 LY_DEFINE (ly_paper_system_number, "ly:paper-system-number",
35 1, 0, 0, (SCM system),
36 "Return the number of @var{system}.")
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_);
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}.")
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 ()));
52 LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
53 1, 0, 0, (SCM system),
54 "Return the height of @var{system}.")
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 ();
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.")
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_);