+2004-05-18 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/book-paper-def.cc (Book_paper_def): add copy ctor.
+
+ * lily/parser.yy (book_paper_head): \bookpaper {}
+
+ * python/midi.c: remove config.h
+
2004-05-18 Jan Nieuwenhuizen <janneke@gnu.org>
* scm/output-gnome.scm: Update.
*/
+#include "ly-module.hh"
#include "paper-def.hh"
#include "dimensions.hh"
#include "book-paper-def.hh"
{
output_scale_ = 1.0;
scaled_fonts_ = SCM_EOL;
+ scope_ = SCM_EOL;
smobify_self ();
scaled_fonts_ = scm_c_make_hash_table (11);
+ scope_ = ly_make_anonymous_module (false);
+}
+
+Book_paper_def::Book_paper_def (Book_paper_def const & src)
+{
+ scope_ = SCM_EOL;
+ scaled_fonts_ = SCM_EOL;
+ smobify_self ();
+ scope_= ly_make_anonymous_module (false);
+ if (is_module (src.scope_))
+ ly_import_module (scope_, src.scope_);
}
Book_paper_def::~Book_paper_def ()
Book_paper_def::mark_smob (SCM m)
{
Book_paper_def *mo = (Book_paper_def*) SCM_CELL_WORD_1 (m);
+
+ scm_gc_mark (mo->scope_);
return mo->scaled_fonts_;
}
public:
VIRTUAL_COPY_CONSTRUCTOR (Book_paper_def, Book_paper_def);
-
+ Book_paper_def(Book_paper_def const &);
+ SCM scope_;
SCM scaled_fonts_;
Real output_scale_;
{"alternative", ALTERNATIVE},
{"bar", BAR},
{"book", BOOK},
+ {"bookpaper", BOOKPAPER},
{"change", CHANGE},
{"chords", CHORDS},
{"clef", CLEF},
%union {
Book *book;
+ Book_paper_def *bookpaper;
Music_output_def *outputdef;
SCM scm;
String *string;
%token ALTERNATIVE
%token BAR
%token BOOK
+%token BOOKPAPER
%token CHANGE
%token CHORDMODIFIERS
%token CHORDS
%type <scm> markup markup_line markup_list markup_list_body full_markup
%type <book> book_block book_body
+%type <bookpaper> book_paper_head book_paper_block book_paper_body
+
%type <i> exclamations questions dots optional_rest
%type <i> bass_mod
%type <scm> oct_check
THIS->lexer_->set_identifier (id, $1->self_scm ());
scm_gc_unprotect_object ($1->self_scm ());
}
+ | book_paper_block {
+ THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultbookpaper"), $1->self_scm ());
+ scm_gc_unprotect_object ($1->self_scm ());
+ }
;
toplevel_music:
}
;
+
+book_paper_block:
+ book_paper_body '}' {
+ $$ = $1;
+ }
+ ;
+book_paper_head:
+ BOOKPAPER '{' {
+ $$ = unsmob_book_paper_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ();
+ THIS->lexer_->add_scope ($$->scope_);
+ }
+ ;
+
+book_paper_body:
+ book_paper_head
+ | book_paper_body assignment { }
+ ;
+
+
+
book_block:
BOOK {
THIS->push_spot ();
{
$$ = new Book;
$$->set_spot (THIS->here_input ());
- $$->bookpaper_ = unsmob_book_paper_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"));
+ scm_gc_unprotect_object ($$->bookpaper_->self_scm ());
+ }
+ | book_body book_paper_block {
+ $$->bookpaper_ = $2;
+ scm_gc_unprotect_object ($2->self_scm ());
}
| book_body score_block {
Score *score = $2;
THIS->header_ = $1;
}
| book_body error {
+
}
;
*/
-#include "config.h"
#include <Python.h>
#if 0