]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-book.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / paper-book.cc
index 2294a0aef80dd89a0235b7cbcb731d890f6834f2..fc344239868f5f9632e688e045fe10f9d9df0b67 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2004--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "paper-book.hh"
@@ -56,11 +56,8 @@ int
 Paper_book::print_smob (SCM smob, SCM port, scm_print_state*)
 {
   Paper_book *b = (Paper_book *) SCM_CELL_WORD_1 (smob);
-
-  scm_puts ("#<", port);
-  scm_puts (classname (b), port);
-  scm_puts (" ", port);
-  scm_puts (">", port);
+  (void)b;
+  scm_puts ("#<Paper_book>", port);
   return 1;
 }
 
@@ -227,9 +224,10 @@ set_system_penalty (Paper_system *ps, SCM header)
       if (SCM_VARIABLEP (force)
          && scm_is_bool (SCM_VARIABLE_REF (force)))
        {
-         ps->break_before_penalty_ = to_boolean (SCM_VARIABLE_REF (force))
-           ? -10000
-           : 10000;
+         ps->set_property ("penalty",
+                           scm_from_int(to_boolean (SCM_VARIABLE_REF (force))
+                                        ? -10000
+                                        : 10000));
        }
     }
 }
@@ -242,7 +240,12 @@ Paper_book::add_score_title (SCM header)
     title = score_title (header_);
   if (!title.is_empty ())
     {
-      Paper_system *ps = new Paper_system (title, true);
+      /*
+       TODO: this should come from the \layout {} block, which should
+       override settings from \paper {}
+      */
+      SCM props = paper_->lookup_variable (ly_symbol2scm ("score-title-properties"));
+      Paper_system *ps = new Paper_system (title, props);
       systems_ = scm_cons (ps->self_scm (), systems_);
       ps->unprotect ();
       set_system_penalty (ps, header);
@@ -260,7 +263,8 @@ Paper_book::systems ()
 
   if (!title.is_empty ())
     {
-      Paper_system *ps = new Paper_system (title, true);
+      SCM props = paper_->lookup_variable (ly_symbol2scm ("book-title-properties"));
+      Paper_system *ps = new Paper_system (title, props);
       set_system_penalty (ps, header_);
 
       systems_ = scm_cons (ps->self_scm (), systems_);
@@ -317,8 +321,10 @@ Paper_book::systems ()
          SCM t = Text_interface::interpret_markup (paper_->self_scm (),
                                                    page_properties,
                                                    scm_car (s));
-         // FIXME: title=true?
-         Paper_system *ps = new Paper_system (*unsmob_stencil (t), true);
+         
+         // TODO: init props
+         Paper_system *ps = new Paper_system (*unsmob_stencil (t), SCM_EOL);
+         ps->set_property ("is-title", SCM_BOOL_T); 
          systems_ = scm_cons (ps->self_scm (), systems_);
          ps->unprotect ();
          
@@ -336,12 +342,12 @@ Paper_book::systems ()
   for (SCM s = systems_; s != SCM_EOL; s = scm_cdr (s))
     {
       Paper_system *ps = unsmob_paper_system (scm_car (s));
-      ps->number_ = ++i;
+      ps->set_property ("number", scm_from_int (++i));
 
       if (last
-         && last->is_title ()
-         && !ps->break_before_penalty_)
-       ps->break_before_penalty_ = 10000;
+         && to_boolean (last->get_property ("is-title"))
+         && !scm_is_number (ps->get_property ("penalty")))
+       ps->set_property ("penalty", scm_from_int (10000));
       last = ps;
     }