]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-system-scheme.cc
* The grand 2005-2006 replace.
[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--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "paper-system.hh"
10
11 LY_DEFINE (ly_paper_system_set_property_x, "ly:paper-system-set-property!",
12            2, 1, 0, (SCM system, SCM sym, SCM value),
13            "Set property @var{sym} of @var{system} to @var{value}")
14 {
15   Paper_system *ps = unsmob_paper_system (system);
16   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
17
18   ps->internal_set_property (sym, value);
19   return SCM_UNSPECIFIED;
20 }
21
22 LY_DEFINE (ly_paper_system_property, "ly:paper-system-property",
23            2, 1, 0, (SCM system, SCM sym, SCM dfault),
24            "Return the value for @var{sym}. Properties may be set by "
25            "setting the @code{line-break-system-details} property of "
26            "NonMusicalPaperColumn.  If the property is not found, "
27            "return @var{dfault}, "
28            "or @code{'()} if undefined.")
29 {
30   Paper_system *ps = unsmob_paper_system (system);
31   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
32   if (dfault == SCM_UNDEFINED)
33     dfault = SCM_EOL;
34
35   SCM retval = ps->internal_get_property (sym);
36   if (retval == SCM_EOL)
37     return dfault;
38   else
39     return retval;
40 }
41
42