X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbook.cc;h=8e63d889e09ab80cc51f7f3aba265364afd3e331;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=a13a3ca51d0d9a25a3b2f4f49472a437f40cd351;hpb=f4abbfff5f0d985a457e15586dbcc3ae473b0dee;p=lilypond.git diff --git a/lily/book.cc b/lily/book.cc index a13a3ca51d..8e63d889e0 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2014 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,7 +33,6 @@ using namespace std; #include "paper-score.hh" #include "page-marker.hh" -#include "ly-smobs.icc" Book::Book () { @@ -44,10 +43,11 @@ Book::Book () input_location_ = SCM_EOL; smobify_self (); - input_location_ = make_input (Input ()); + input_location_ = Input ().smobbed_copy (); } Book::Book (Book const &s) + : Smob () { paper_ = 0; header_ = SCM_EOL; @@ -62,7 +62,7 @@ Book::Book (Book const &s) paper_->unprotect (); } - input_location_ = make_input (*s.origin ()); + input_location_ = s.origin ()->smobbed_copy (); header_ = ly_make_module (false); if (ly_is_module (s.header_)) @@ -105,28 +105,17 @@ Book::~Book () { } -IMPLEMENT_SMOBS (Book); -IMPLEMENT_DEFAULT_EQUAL_P (Book); SCM -Book::mark_smob (SCM s) +Book::mark_smob () { - Book *book = (Book *) SCM_CELL_WORD_1 (s); + if (paper_) + scm_gc_mark (paper_->self_scm ()); + scm_gc_mark (scores_); + scm_gc_mark (bookparts_); + scm_gc_mark (input_location_); - if (book->paper_) - scm_gc_mark (book->paper_->self_scm ()); - scm_gc_mark (book->scores_); - scm_gc_mark (book->bookparts_); - scm_gc_mark (book->input_location_); - - return book->header_; -} - -int -Book::print_smob (SCM, SCM p, scm_print_state *) -{ - scm_puts ("#", p); - return 1; + return header_; } void @@ -252,7 +241,7 @@ Book::process_score (SCM s, Paper_book *output_paper_book, Output_def *layout) } } else if (Text_interface::is_markup_list (scm_car (s)) - || Page_marker::unsmob (scm_car (s))) + || Page_marker::is_smob (scm_car (s))) output_paper_book->add_score (scm_car (s)); else assert (0);