]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/output-def-scheme.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / output-def-scheme.cc
index 8bf702c6ffb0a10f9bc7c1d5ee692c24a119f911..95fd4a578245d6e9cd4a66b7a9994fcf6a38bcd1 100644 (file)
@@ -3,15 +3,16 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include "font-metric.hh"
+#include "output-def.hh"
+
 #include "pango-font.hh"
 #include "modified-font-metric.hh"
-#include "output-def.hh"
 #include "ly-module.hh"
 #include "context-def.hh"
+#include "lily-parser.hh"
 
 LY_DEFINE (ly_layout_lookup, "ly:output-def-lookup",
           2, 1, 0, (SCM pap, SCM sym, SCM def),
@@ -70,7 +71,6 @@ LY_DEFINE (ly_output_description, "ly:output-description",
   Output_def *id = unsmob_output_def (output_def);
 
   SCM al = ly_module2alist (id->scope_);
-
   SCM ell = SCM_EOL;
   for (SCM s = al; scm_is_pair (s); s = scm_cdr (s))
     {
@@ -91,13 +91,28 @@ LY_DEFINE (ly_layout_def_p, "ly:layout-def?",
 
 LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale",
           1, 0, 0, (SCM bp),
-          "Get outputscale for BP.")
+          "Get output-scale for BP.")
 {
   Output_def *b = unsmob_output_def (bp);
   SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper");
   return scm_from_double (output_scale (b));
 }
 
+/*
+  Cannot put in scope, but need a separate function, since we don't
+  want to allow this in --safe.
+ */
+LY_DEFINE (ly_output_def_parser, "ly:output-def-parser",
+          1, 0, 0, (SCM odef),
+          "Return the parser where @var{odef} is coming from.")
+{
+  Output_def *b = unsmob_output_def (odef);
+  SCM_ASSERT_TYPE (b, odef, SCM_ARG1, __FUNCTION__, "paper");
+
+  return b->get_parser()->self_scm ();
+}
+
+
 LY_DEFINE (ly_make_output_def, "ly:make-output-def",
           0, 0, 0, (),
           "Make a output def.")