]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-outputter.cc
* lily/system.cc (get_line): Return Paper_line. Change all users.
[lilypond.git] / lily / paper-outputter.cc
index 134b19bc4c01f30d6c1f545d431bfc8219b1e5a4..7e5fc947c9f81e9e6060f14d00a9a8e887c48ef3 100644 (file)
@@ -25,6 +25,7 @@
 #include "input-file-results.hh"
 #include "ly-module.hh"
 #include "paper-book.hh"
+#include "paper-line.hh"
 #include "input-smob.hh"  // output_expr
 
 
@@ -53,6 +54,7 @@ Paper_outputter::Paper_outputter (String name)
       else
        output_module_ = scm_c_resolve_module (name.to_str0 ());
 
+      /* FIXME: output-lib should be module, that can be imported.  */
 #define IMPORT_LESS 1 // only import the list of IMPORTS
 #if IMPORT_LESS
       scm_c_use_module ("lily");
@@ -64,10 +66,12 @@ Paper_outputter::Paper_outputter (String name)
        "ly:output-def-scope",
        "ly:gulp-file",
        "ly:number->string",
-       "assoc-get",
-       "number-pair->string",
-       "inexact->string",
+       
+       "number-pair->string",       /* output-lib.scm */
        "numbers->string",
+       
+       "assoc-get",
+       "inexact->string",           /* insecure guile? */
 #if IMPORT_LESS        
        "string-index",              /* from srfi srfi-13 */
        "regexp-substitute/global",  /* from (ice9 regex) */
@@ -161,7 +165,8 @@ Paper_outputter::output_header (Paper_def *paper, SCM scopes, int page_count)
 void
 Paper_outputter::output_line (SCM line, Offset *origin, bool is_last)
 {
-  Offset dim = ly_scm2offset (ly_car (line));
+  Paper_line *pl = unsmob_paper_line (line);
+  Offset dim = pl->dim ();
   if (dim[Y_AXIS] > 50 CM)
     {
       programming_error ("Improbable system height.");
@@ -181,19 +186,14 @@ Paper_outputter::output_line (SCM line, Offset *origin, bool is_last)
     }
 
   SCM between = SCM_EOL;
-  for (SCM s = ly_cdr (line); gh_pair_p (s); s = ly_cdr (s))
+  for (SCM s = pl->stencils (); gh_pair_p (s); s = ly_cdr (s))
     {
-      Stencil *stil = unsmob_stencil (ly_cdar (s));
-      SCM head = ly_caar (s);
-      
-      if (head == ly_symbol2scm ("between-system-string"))
-       {
-         between = stil->get_expr ();
-         continue;
-       }
-
+      Stencil *stil = unsmob_stencil (ly_car (s));
       if (stil)
-       output_expr (stil->get_expr (), ly_scm2offset (head));
+       output_expr (stil->get_expr (), stil->origin ());
+      /* Only if !PAGE_LAYOUT */
+      else if (ly_caar (s) == ly_symbol2scm ("between-system-string"))
+       between = ly_cdar (s);
     }
 
   if (is_last)