/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2004--2014 Jan Nieuwenhuizen <janneke@gnu.org>
+ Copyright (C) 2004--2015 Jan Nieuwenhuizen <janneke@gnu.org>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
const char Paper_book::type_p_name_[] = "ly:paper-book?";
SCM
-Paper_book::mark_smob (SCM smob)
+Paper_book::mark_smob ()
{
- Paper_book *b = (Paper_book *) SCM_CELL_WORD_1 (smob);
- if (b->paper_)
- scm_gc_mark (b->paper_->self_scm ());
- if (b->parent_)
- scm_gc_mark (b->parent_->self_scm ());
- scm_gc_mark (b->header_);
- scm_gc_mark (b->header_0_);
- scm_gc_mark (b->pages_);
- scm_gc_mark (b->performances_);
- scm_gc_mark (b->scores_);
- scm_gc_mark (b->bookparts_);
- return b->systems_;
-}
-
-int
-Paper_book::print_smob (SCM smob, SCM port, scm_print_state *)
-{
- Paper_book *b = (Paper_book *) SCM_CELL_WORD_1 (smob);
- (void)b;
- scm_puts ("#<Paper_book>", port);
- return 1;
+ if (paper_)
+ scm_gc_mark (paper_->self_scm ());
+ if (parent_)
+ scm_gc_mark (parent_->self_scm ());
+ scm_gc_mark (header_);
+ scm_gc_mark (header_0_);
+ scm_gc_mark (pages_);
+ scm_gc_mark (performances_);
+ scm_gc_mark (scores_);
+ scm_gc_mark (bookparts_);
+ return systems_;
}
Output_def *
}
else
{
- if (scores_ == SCM_EOL)
+ if (scm_is_null (scores_))
return 0;
paper_->set_variable (ly_symbol2scm ("first-page-number"),
scm_from_long (*first_page_number));
with different line-widths) and why we need it at all.
*/
- if (paper_->c_variable ("line-width") == SCM_UNDEFINED)
+ if (SCM_UNBNDP (paper_->c_variable ("line-width")))
paper_->set_variable (ly_symbol2scm ("line-width"),
paper_->c_variable ("paper-width"));
SCM framework = ly_module_lookup (mod,
ly_symbol2scm ("output-framework"));
- if (framework != SCM_BOOL_F)
+ if (scm_is_true (framework))
{
SCM func = scm_variable_ref (framework);
scm_call_4 (func,
SCM framework
= ly_module_lookup (mod, ly_symbol2scm ("output-preview-framework"));
- if (framework != SCM_BOOL_F)
+ if (scm_is_true (framework))
{
SCM func = scm_variable_ref (framework);
scm_call_4 (func,
paper_->self_scm (),
scopes);
- if (Stencil::unsmob (tit))
+ if (Stencil::is_smob (tit))
title = *Stencil::unsmob (tit);
if (!title.is_empty ())
paper_->self_scm (),
scopes);
- if (Stencil::unsmob (tit))
+ if (Stencil::is_smob (tit))
title = *Stencil::unsmob (tit);
if (!title.is_empty ())
if (ly_is_module (scm_car (s)))
{
header = scm_car (s);
- if (header_0_ == SCM_EOL)
+ if (scm_is_null (header_0_))
header_0_ = header;
}
else if (Page_marker *page_marker = Page_marker::unsmob (scm_car (s)))
if (scm_is_pair (system_specs))
set_system_penalty (scm_car (system_specs), header);
- if (Prob::unsmob (title))
+ if (Prob::is_smob (title))
{
system_specs = scm_cons (title, system_specs);
Prob::unsmob (title)->unprotect ();
SCM
Paper_book::systems ()
{
- if (systems_ != SCM_BOOL_F)
+ if (scm_is_true (systems_))
return systems_;
systems_ = SCM_EOL;
{
SCM perm = ps->get_property ("page-break-permission");
Prob *next = Prob::unsmob (scm_cadr (s));
- if (perm == SCM_EOL)
+ if (scm_is_null (perm))
next->set_property ("penalty", scm_from_int (10001));
- else if (perm == ly_symbol2scm ("force"))
+ else if (scm_is_eq (perm, ly_symbol2scm ("force")))
next->set_property ("penalty", scm_from_int (-10001));
}
}
SCM
Paper_book::pages ()
{
- if (SCM_BOOL_F != pages_)
+ if (scm_is_true (pages_))
return pages_;
pages_ = SCM_EOL;
scm_call_2 (post_process, paper_->self_scm (), pages_);
/* set systems_ from the pages */
- if (systems_ == SCM_BOOL_F)
+ if (scm_is_false (systems_))
{
systems_ = SCM_EOL;
for (SCM p = pages_; scm_is_pair (p); p = scm_cdr (p))