]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-book.cc
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / paper-book.cc
index 7b43799e996db98af25b9499f15cd1240d10050a..3db1321f5e495b199915d39007a937638b71f76d 100644 (file)
@@ -3,12 +3,13 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2008 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2004--2009 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "paper-book.hh"
 
 #include "grob.hh"
+#include "international.hh"
 #include "main.hh"
 #include "output-def.hh"
 #include "paper-column.hh"
@@ -174,25 +175,38 @@ Paper_book::output (SCM output_channel)
 
   if (get_program_option ("print-pages"))
     {
-      SCM func = scm_c_module_lookup (mod, "output-framework");
-
-      func = scm_variable_ref (func);
-      scm_apply_0 (func, scm_list_n (output_channel,
-                                    self_scm (),
-                                    scopes,
-                                    dump_fields (),
-                                    SCM_UNDEFINED));
+      SCM framework = ly_module_lookup (mod, ly_symbol2scm ("output-framework"));
+
+      if (framework != SCM_BOOL_F)
+       {
+         SCM func = scm_variable_ref (framework);
+         scm_apply_0 (func, scm_list_n (output_channel,
+                                        self_scm (),
+                                        scopes,
+                                        dump_fields (),
+                                        SCM_UNDEFINED));
+       }
+      else
+       warning (_f ("program option -dprint-pages not supported by backend `%s'",
+                    get_output_backend_name ()));
     }
 
   if (get_program_option ("preview"))
     {
-      SCM func = scm_c_module_lookup (mod, "output-preview-framework");
-      func = scm_variable_ref (func);
-      scm_apply_0 (func, scm_list_n (output_channel,
-                                    self_scm (),
-                                    scopes,
-                                    dump_fields (),
-                                    SCM_UNDEFINED));
+      SCM framework = ly_module_lookup (mod, ly_symbol2scm ("output-preview-framework"));
+
+      if (framework != SCM_BOOL_F)
+       {
+         SCM func = scm_variable_ref (framework);
+         scm_apply_0 (func, scm_list_n (output_channel,
+                                        self_scm (),
+                                        scopes,
+                                        dump_fields (),
+                                        SCM_UNDEFINED));
+       }
+      else
+       warning (_f ("program option -dpreview not supported by backend `%s'",
+                    get_output_backend_name ()));
     }
 }
 
@@ -587,8 +601,11 @@ Paper_book::pages ()
     }
   else if (scm_is_pair (scores_))
     {
-      SCM proc = paper_->c_variable ("page-breaking-wrapper");
-      pages_ = scm_apply_0 (proc, scm_list_1 (self_scm ()));
+      SCM page_breaking = paper_->c_variable ("page-breaking");
+      pages_ = scm_apply_0 (page_breaking, scm_list_1 (self_scm ()));
+      SCM post_process = paper_->c_variable ("page-post-process");
+      if (ly_is_procedure (post_process))
+       scm_apply_2 (post_process, paper_->self_scm (), pages_, SCM_EOL);
 
       /* set systems_ from the pages */
       if (systems_ == SCM_BOOL_F)