]> git.donarmstrong.com Git - lilypond.git/blob - lily/dimensions-scheme.cc
end context snippet with '\n'
[lilypond.git] / lily / dimensions-scheme.cc
1 /*
2   dimensions-scheme.cc -- implement Dimension handling
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "lily-guile.hh"
10 #include "dimensions.hh"
11 #include "warn.hh"
12
13 LY_DEFINE (ly_pt, "ly:pt",
14            1, 0, 0, (SCM num),
15            "@var{num} printer points")
16 {
17   SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
18                    "number");
19   return scm_from_double (point_constant
20                           * scm_to_double (num));
21 }
22
23 LY_DEFINE (ly_cm, "ly:cm",
24            1, 0, 0, (SCM num),
25            "@var{num} cm")
26 {
27   SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
28                    "number");
29   return scm_from_double (cm_constant
30                           * scm_to_double (num));
31 }
32
33 LY_DEFINE (ly_inch, "ly:inch",
34            1, 0, 0, (SCM num),
35            "@var{num} inches")
36 {
37   SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
38                    "number");
39   return scm_from_double (inch_constant
40                           * scm_to_double (num));
41 }
42
43 LY_DEFINE (ly_mm, "ly:mm",
44            1, 0, 0, (SCM num),
45            "@var{num} mm")
46 {
47   SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
48                    "number");
49   return scm_from_double (mm_constant
50                           * scm_to_double (num));
51 }
52
53 LY_DEFINE (ly_bp, "ly:bp",
54            1, 0, 0, (SCM num),
55            "@var{num} bigpoints (1/72th inch)")
56 {
57   SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
58                    "number");
59   return scm_from_double (bigpoint_constant
60                           * scm_to_double (num));
61 }