]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stencil-scheme.cc
Updates. Add targets: tar, dist, release.
[lilypond.git] / lily / stencil-scheme.cc
index af6904f5c25656752e0130bbb19c1549077b4b04..0848c1afc3eac93e5161ff5ca7f60b576610d1c8 100644 (file)
@@ -13,8 +13,7 @@
   TODO: naming add/combine.
  */
 /*
-  UMGH. junkme!
-  
+  UGH. Junk all mutators.
  */
 LY_DEFINE (ly_stencil_set_extent_x, "ly:stencil-set-extent!",
           3, 0, 0, (SCM stil, SCM axis, SCM np),
@@ -31,7 +30,7 @@ LY_DEFINE (ly_stencil_set_extent_x, "ly:stencil-set-extent!",
   Interval iv = ly_scm2interval (np);
   s->dim_[Axis (ly_scm2int (axis))] = iv;
 
-  return SCM_UNDEFINED;
+  return SCM_UNSPECIFIED;
 }
 
 LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
@@ -66,7 +65,7 @@ LY_DEFINE (ly_translate_stencil, "ly:stencil-translate",
   return new_s;
 }
 
-LY_DEFINE (ly_stencil_expr, "ly:stencil-get-expr",
+LY_DEFINE (ly_stencil_expr, "ly:stencil-expr",
           1, 0, 0, (SCM stil),
           "Return the expression of @var{stil}.")
 {
@@ -128,7 +127,7 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
 }
 
 
-  
+
 LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
           4, 2, 0,  (SCM first, SCM axis, SCM direction,
                      SCM second,
@@ -139,14 +138,19 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
           "@var{direction} can be -1 (left or down) or 1 (right or up). "
           "The stencils are juxtaposed with  @var{padding} as extra space. "
           "If this puts the reference points closer than @var{minimum}, "
-          "they are moved by the latter amount.")
+          "they are moved by the latter amount."
+          "@var{first} and @var{second} may also be '() or #f.")
 {
   Stencil *s1 = unsmob_stencil (first);
   Stencil *s2 = unsmob_stencil (second);
   Stencil result;
 
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE (is_direction (direction), direction, SCM_ARG4, __FUNCTION__, "dir");
+  SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first  == SCM_EOL,
+                  first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
+  SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second  == SCM_EOL,
+                  second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
+  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+  SCM_ASSERT_TYPE (is_direction (direction), direction, SCM_ARG3, __FUNCTION__, "dir");
 
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
@@ -163,6 +167,7 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
 
   if (s1)
     result = *s1;
+  
   if (s2)
     result.add_at_edge (Axis (ly_scm2int (axis)),
                        Direction (ly_scm2int (direction)), *s2, p, m);
@@ -211,7 +216,7 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
 }
 
 
-LY_DEFINE (ly_align_to_x, "ly:stencil-align-to!",
+LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
           3, 0, 0, (SCM stil, SCM axis, SCM dir),
           "Align @var{stil} using its own extents. "
           "@var{dir} is a number -1, 1 are left and right respectively. "
@@ -223,5 +228,5 @@ LY_DEFINE (ly_align_to_x, "ly:stencil-align-to!",
 
   unsmob_stencil (stil)->align_to ((Axis)ly_scm2int (axis),
                                   ly_scm2double (dir));
-  return SCM_UNDEFINED;
+  return stil;
 }