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_stencil, "ly:paper-system-stencil",
23 1, 0, 0, (SCM system),
24 "Return the height of @var{system}.")
26 Paper_system *ps = unsmob_paper_system (system);
27 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
28 return ps->to_stencil ().smobbed_copy ();
31 LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents",
32 1, 0, 0, (SCM system),
33 "Return the top and bottom staff refpoint.")
35 Paper_system *ps = unsmob_paper_system (system);
36 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
37 return ly_interval2scm (ps->staff_refpoints ());
42 LY_DEFINE (ly_paper_system_property, "ly:paper-system-property",
43 2, 1, 0, (SCM system, SCM sym, SCM dfault),
44 "Return the value for @var{sym}. Properties may be set by "
45 "setting the @code{line-break-system-details} property of "
46 "NonMusicalPaperColumn. If the property is not found, "
47 "return @var{dfault}, "
48 "or @code{'()} if undefined.")
50 Paper_system *ps = unsmob_paper_system (system);
51 SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
52 if (dfault == SCM_UNDEFINED)
55 SCM retval = ps->internal_get_property (sym);
56 if (retval == SCM_EOL)