]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-system-scheme.cc
* lily/include/paper-system.hh (class Paper_system): remove
[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 #include "paper-system.hh"
10
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}.")
14 {
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));
20 }
21
22 LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
23            1, 0, 0, (SCM system),
24            "Return the height of @var{system}.")
25 {
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 ();
29 }
30
31
32
33 LY_DEFINE (ly_paper_system_property, "ly:paper-system-property",
34            2, 1, 0, (SCM system, SCM sym, SCM dfault),
35            "Return the value for @var{sym}. Properties may be set by "
36            "setting the @code{line-break-system-details} property of "
37            "NonMusicalPaperColumn.  If the property is not found, "
38            "return @var{dfault}, "
39            "or @code{'()} if undefined.")
40 {
41   Paper_system *ps = unsmob_paper_system (system);
42   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
43   if (dfault == SCM_UNDEFINED)
44     dfault = SCM_EOL;
45
46   SCM retval = ps->internal_get_property (sym);
47   if (retval == SCM_EOL)
48     return dfault;
49   else
50     return retval;
51 }
52
53