2 dimensions-scheme.cc -- implement Dimension handling
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "lily-guile.hh"
10 #include "dimensions.hh"
13 LY_DEFINE (ly_pt, "ly:pt",
15 "@var{num} printer points")
17 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
19 return scm_from_double (point_constant
20 * scm_to_double (num));
23 LY_DEFINE (ly_cm, "ly:cm",
27 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
29 return scm_from_double (cm_constant
30 * scm_to_double (num));
33 LY_DEFINE (ly_inch, "ly:inch",
37 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
39 return scm_from_double (inch_constant
40 * scm_to_double (num));
43 LY_DEFINE (ly_mm, "ly:mm",
47 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
49 return scm_from_double (mm_constant
50 * scm_to_double (num));
53 LY_DEFINE (ly_bp, "ly:bp",
55 "@var{num} bigpoints (1/72th inch)")
57 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
59 return scm_from_double (bigpoint_constant
60 * scm_to_double (num));