]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-scheme.cc
Revert "Web-es: make Spanish Pondings work."
[lilypond.git] / lily / grob-scheme.cc
index 92f755d7a77e3eb098d84f1c3fa031c13a558d0a..e56e02d27a40c2e709d4ba18ad72df086005a48c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org>
+  Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org>
   Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -100,6 +100,27 @@ LY_DEFINE (ly_grob_pure_property, "ly:grob-pure-property",
   return retval;
 }
 
+LY_DEFINE (ly_grob_pure_height, "ly:grob-pure-height",
+           4, 1, 0, (SCM grob, SCM refp, SCM beg, SCM end, SCM val),
+           "Return the pure height of @var{grob} given refpoint @var{refp}."
+           "  If no value is found, return @var{val} or @code{'()}"
+           " if @var{val} is not specified.")
+{
+  Grob *sc = unsmob_grob (grob);
+  Grob *ref = unsmob_grob (refp);
+
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB (Grob, refp, 2);
+  LY_ASSERT_TYPE (scm_is_integer, beg, 3);
+  LY_ASSERT_TYPE (scm_is_integer, end, 4);
+  if (val == SCM_UNDEFINED)
+    val = SCM_EOL;
+
+  Interval retval = sc->pure_height (ref, scm_to_int (beg), scm_to_int (end));
+
+  return ly_interval2scm (retval);
+}
+
 LY_DEFINE (ly_grob_property, "ly:grob-property",
            2, 1, 0, (SCM grob, SCM sym, SCM val),
            "Return the value for property @var{sym} of @var{grob}."