]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-system-scheme.cc
* lily/main.cc (setup_guile_env): new function. Set GC min_yields
[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_title_p, "ly:paper-system-title?",
23            1, 0, 0, (SCM system),
24            "Is  @var{system} a title system?")
25 {
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 ());
29 }
30
31 LY_DEFINE (ly_paper_system_number, "ly:paper-system-number",
32            1, 0, 0, (SCM system),
33            "Return the number of @var{system}.")
34 {
35   Paper_system *ps = unsmob_paper_system (system);
36   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
37   return scm_from_int (ps->number_);
38 }
39
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}.")
43 {
44   Paper_system *ps = unsmob_paper_system (system);
45   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
46   return scm_from_int (int (ps->break_before_penalty ()));
47 }
48
49 LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
50            1, 0, 0, (SCM system),
51            "Return the height of @var{system}.")
52 {
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 ();
56 }
57
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.")
61 {
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_);
65 }
66