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"
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;
}
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));
}
}
}
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);
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_);
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 ();
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;
}