]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/score.cc (default_rendering): clean protection.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Mar 2004 01:39:59 +0000 (01:39 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Mar 2004 01:39:59 +0000 (01:39 +0000)
* lily/paper-book.cc (mark_smob): implement smob marking.

ChangeLog
Documentation/user/changing-defaults.itely
Documentation/user/lilypond-book.itely
Documentation/user/notation.itely
Documentation/user/programming-interface.itely
lily/include/paper-book.hh
lily/input-file-results.cc
lily/paper-book.cc
lily/score.cc

index d1cb7604728dcb16d1efefe46372da1cd764cb94..a47a52b1bb81628cb6ad75e4a2877297dd84ec49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-03-10  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/score.cc (default_rendering): clean protection.
+
+       * lily/paper-book.cc (mark_smob): implement smob marking.
+
        * scripts/lilypond.py (make_html_menu_file): remove --psgz option
 
        * Documentation/user/*.itely: user manual edits. 
index 711c426e36be7d378e516c812f61633df6fd334d..439af71b3787f5db86726b2351a61c296d332014 100644 (file)
@@ -404,12 +404,6 @@ The back-end is not very strict in type-checking object properties.
 Cyclic references in Scheme values for properties can cause hangs
 and/or crashes.
 
-@menu
-* Constructing a tweak::        
-* Applyoutput::                 
-* Font selection::              
-* Text markup::                 
-@end menu
 
 @node Constructing a tweak
 @subsection Constructing a tweak
@@ -647,8 +641,7 @@ is a  symbol indicating the series of the font. There are typically several
 font series for each font family and shape. Choices are @code{medium}
 and @code{bold}. 
 
-@end table
-
+@end itemize
 
 Fonts selected in the way sketched above come from a predefined style
 sheet.
index 680450218244284d75a6e2c074313ad034aa8fa4..92f1d8083d30ba63aa816793b1e88f76636b65ea 100644 (file)
@@ -329,6 +329,22 @@ documents are composed from small @file{.ly} files in this way:
 @item relative, relative=@var{N}
 uses relative octave mode.  By default, notes are specified relative
 to middle C.  The optional integer argument specifies the octave of the
+@item relative, relative=@var{N}
+uses relative octave mode.  By default, notes are specified relative
+to middle C.  The optional integer argument specifies the octave of the
+starting note, where the default @code{1} is middle C.
+@end table
+
+
+@node Invoking lilypond-book
+@section Invoking lilypond-book
+
+
+Running @command{lilypond-book} generates lots of small files that
+LilyPond will process.  To avoid all that garbage in the source
+directory use the @option{--output} command line option, and change to
+that directory before running La@TeX{} or @file{makeinfo}:
+
 @example
 lilypond-book --output=out yourfile.lytex
 cd out && latex yourfile.tex
index cc9a6f58bbbb9b84f27d9ff5f7a6a75777a140b5..f97d8025ef58a6feb15e492286be9d89a3aaa9bc 100644 (file)
@@ -7304,7 +7304,7 @@ The following are supported
         r
     }
     \context Lyrics \lyrics {
-    \override LyricText #'font = #'typewriter
+    \override LyricText #'font-family = #'typewriter
       "shortfermata" "fermata"  "longfermata" "verylongfermata"
     } >>
 }
index b83c689dd2c7c042ac28b011734d4a80e018040a..18e2997d9589275ed421b633642a46a34d95e39a 100644 (file)
@@ -311,7 +311,7 @@ a type predicate for the i@var{th} argument
 the `paper' definition
 @item props
 a list of alists, containing all active properties. 
-@end lisp
+@end table
 
 As a simple example, we show how to add a @code{\smallcaps} command,
 which selects @TeX{}'s small caps font.  Normally, we could select the
@@ -423,7 +423,7 @@ letter a little larger:
 
 @example
 #(def-markup-command (smallcaps paper props str) (string?)
-   "Print the string argument in small caps. Syntax: \\smallcaps #\"string\""
+   "Print the string argument in small caps."
    (interpret-markup paper props
     (make-line-markup
      (map (lambda (s)
@@ -456,7 +456,7 @@ to the @code{interpret-markup} function, with the @code{paper} and
 
 @menu
 * Context evaluation::         
-* Applyoutput::                        
+* Running a function on all layout objects::  
 @end menu
 
 @node Context evaluation
index 1f481c2dd40114b8bced83baaff7e92d117b8041..2e58a51388616c56a60c2f0cca0c7e57696e3740 100644 (file)
@@ -19,7 +19,6 @@
 class Paper_book
 {
 public:
-  Protected_scm protect_;
   Array<SCM> headers_;
   Array<SCM> global_headers_;
   Link_array<Paper_def> papers_;
@@ -31,11 +30,7 @@ public:
   Stencil* get_title (int);
   void output (String);
   void classic_output (String);
-
-  SCM smobbed_copy () const;
-
-private:
-  DECLARE_SIMPLE_SMOBS (Paper_book, )
+  DECLARE_SMOBS (Paper_book, )
 };
 
 DECLARE_UNSMOB (Paper_book, paper_book)
index 05729cf669faa9f41cd014d614a963aafa2b1124..92fa4f329c3d5d040aef87df7c2d6c9b1e23395c 100644 (file)
@@ -230,9 +230,11 @@ do_one_file (char const *file)
   if (!proc)
     proc = scm_c_eval_string ("dump-gc-protects");
 
-  Paper_book book;
-  paper_book = &book;
+  paper_book = new Paper_book ();;
   Input_file_results inp_file (init, in_file, out_file);
   if (output_format_global == PAGE_LAYOUT)
-    book.output (out_file);
+    paper_book->output (out_file);
+
+  scm_gc_unprotect_object (paper_book->self_scm ());
+  paper_book = 0;
 }
index 5eedc873fef5c05c455dee3b8be18701868084f5..999fd0255b80035c6be2b398acd50f08b1a24813 100644 (file)
@@ -79,12 +79,14 @@ Page::text_height ()
   return h;
 }
 
+/****************************************************************/
 
-Paper_book *paper_book;
+
+Paper_book *paper_book;                // huh? global var? --hwn
 
 Paper_book::Paper_book ()
 {
-  protect_ = SCM_EOL;
+  smobify_self ();
 }
 
 void
@@ -248,21 +250,21 @@ Paper_book::classic_output (String outname)
 #include "ly-smobs.icc"
 
 IMPLEMENT_DEFAULT_EQUAL_P (Paper_book);
-IMPLEMENT_SIMPLE_SMOBS (Paper_book)
-IMPLEMENT_TYPE_P (Paper_book, "ly:paper_book?")
+IMPLEMENT_SMOBS (Paper_book)
+IMPLEMENT_TYPE_P (Paper_book, "ly:paper-book?")
 
 SCM
 Paper_book::mark_smob (SCM smob)
 {
-  Paper_book *b = (Paper_book*) SCM_CELL_WORD_1 (smob);
-
-#if 0 //TODO
-  scm_gc_mark (b->scores_);
-  scm_gc_mark (b->global_headers_);
-  scm_gc_mark (b->headers_);
-  scm_gc_mark (b->papers_);
-#endif
-
+  Paper_book *pb = (Paper_book*) SCM_CELL_WORD_1 (smob);
+  for (int i = 0; i < pb->headers_.size (); i++)
+    scm_gc_mark (pb->headers_[i]);
+  for (int i = 0; i < pb->global_headers_.size (); i++)
+    scm_gc_mark (pb->global_headers_[i]);
+  for (int i = 0; i < pb->papers_.size (); i++)
+    scm_gc_mark (pb->papers_[i]->self_scm ());
+  for (int i = 0; i < pb->scores_.size (); i++)
+    scm_gc_mark (pb->scores_[i]);
   return SCM_EOL;
 }
 
@@ -279,9 +281,7 @@ Paper_book::print_smob (SCM smob, SCM port, scm_print_state*)
   return 1;
 }
 
-SCM
-Paper_book::smobbed_copy () const
+Paper_book::~Paper_book ()
 {
-  Paper_book *b = new Paper_book (*this);
-  return b->smobbed_self ();
 }
+
index b1c1c554b3c8b22692cc3fa46a05ca751503b406..d0124b2c746c939f4bc23730650edf6fcbf05961 100644 (file)
@@ -176,14 +176,7 @@ default_rendering (SCM music, SCM outdef, SCM header, SCM outname)
       if (systems != SCM_UNDEFINED)
        {
          Paper_score *ps = dynamic_cast<Paper_score*> (output);
-#if 1
-         paper_book->protect_ = scm_cons (systems, paper_book->protect_);
-         paper_book->protect_ = scm_cons (global_input_file->header_,
-                                          paper_book->protect_);
-         paper_book->protect_ = scm_cons (header, paper_book->protect_);
-         paper_book->protect_ = scm_cons (ps->paper_->smobbed_copy (),
-                                          paper_book->protect_);
-#endif
+
          paper_book->papers_.push (ps->paper_);
          paper_book->scores_.push (systems);
          paper_book->global_headers_.push (global_input_file->header_);