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>
9 #include "paper-system.hh"
11 LY_DEFINE (ly_paper_system_height, "ly:paper-system-extent",
12 2, 0, 0, (SCM system, SCM axis),
13 "Return the extent of @var{system}.")
15 Paper_system *ps = unsmob_paper_system (system);
16 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
17 SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
18 Axis ax = (Axis)scm_to_int (axis);
19 return ly_interval2scm (ps->to_stencil ().extent (ax));
22 LY_DEFINE (ly_paper_system_title_p, "ly:paper-system-title?",
23 1, 0, 0, (SCM system),
24 "Is @var{system} a title system?")
26 Paper_system *ps = unsmob_paper_system (system);
27 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
28 return SCM_BOOL (ps->is_title ());
31 LY_DEFINE (ly_paper_system_number, "ly:paper-system-number",
32 1, 0, 0, (SCM system),
33 "Return the number of @var{system}.")
35 Paper_system *ps = unsmob_paper_system (system);
36 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
37 return scm_int2num (ps->number_);
40 LY_DEFINE (ly_paper_system_break_before_penalty, "ly:paper-system-break-before-penalty",
41 1, 0, 0, (SCM system),
42 "Return the score for page break after @var{system}.")
44 Paper_system *ps = unsmob_paper_system (system);
45 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
46 return scm_int2num (int (ps->break_before_penalty ()));
49 LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
50 1, 0, 0, (SCM system),
51 "Return the height of @var{system}.")
53 Paper_system *ps = unsmob_paper_system (system);
54 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
55 return ps->to_stencil ().smobbed_copy ();
58 LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents",
59 1, 0, 0, (SCM system),
60 "Return the top and bottom staff refpoint.")
62 Paper_system *ps = unsmob_paper_system (system);
63 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
64 return ly_interval2scm (ps->staff_refpoints_);