]> git.donarmstrong.com Git - lilypond.git/commitdiff
new file, move from
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 27 May 2004 22:29:01 +0000 (22:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 27 May 2004 22:29:01 +0000 (22:29 +0000)
music-output-def.hh

* lily/include/paper-def.hh: move all functionality out of class.
Junk header.

* lily/include/music-output-def.hh: rename Music_output_def to
Output_def.

* input/wilhelmus.ly: only set space for Paper formatting.

* lily/include/midi-def.hh: remove file, remove class.
Move functions to Music-output-def.

123 files changed:
ChangeLog
Documentation/user/notation.itely
buildscripts/mf-to-table.py
input/wilhelmus.ly
lily/accidental.cc
lily/align-interface.cc
lily/ambitus.cc
lily/apply-context-iterator.cc
lily/arpeggio.cc
lily/balloon.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/beam-quanting.cc
lily/beam.cc
lily/book-paper-def.cc
lily/book.cc
lily/break-algorithm.cc
lily/break-align-interface.cc
lily/breathing-sign.cc
lily/chord-name-engraver.cc
lily/chord-name.cc
lily/cluster.cc
lily/completion-note-heads-engraver.cc
lily/context-def.cc
lily/context.cc
lily/dots.cc
lily/font-interface.cc
lily/font-select.cc
lily/global-context.cc
lily/gourlay-breaking.cc
lily/grob-property.cc
lily/grob-scheme.cc
lily/grob.cc
lily/hairpin.cc
lily/horizontal-bracket.cc
lily/include/book-paper-def.hh
lily/include/book.hh
lily/include/context-def.hh
lily/include/context.hh
lily/include/global-context.hh
lily/include/grob.hh
lily/include/lily-proto.hh
lily/include/midi-def.hh [deleted file]
lily/include/music-output-def.hh [deleted file]
lily/include/my-lily-parser.hh
lily/include/output-def.hh [new file with mode: 0644]
lily/include/page.hh
lily/include/paper-book.hh
lily/include/paper-def.hh
lily/include/paper-outputter.hh
lily/include/paper-score.hh
lily/include/performance.hh
lily/include/score.hh
lily/include/translator.hh
lily/key-signature-interface.cc
lily/line-interface.cc
lily/line-spanner.cc
lily/lyric-extender.cc
lily/lyric-hyphen.cc
lily/main.cc
lily/measure-grouping-spanner.cc
lily/mensural-ligature-engraver.cc
lily/mensural-ligature.cc
lily/midi-def.cc
lily/multi-measure-rest.cc
lily/music-output-def.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/note-spacing.cc
lily/ottava-bracket.cc
lily/page.cc
lily/paper-book.cc
lily/paper-column.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/paper-score.cc
lily/parser.yy
lily/performance.cc
lily/rest-collision.cc
lily/rest.cc
lily/score-engraver.cc
lily/score-performer.cc
lily/score.cc
lily/script.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/slur-bezier-bow.cc
lily/slur.cc
lily/spacing-spanner.cc
lily/span-bar.cc
lily/staff-symbol-engraver.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/system.cc
lily/tab-note-heads-engraver.cc
lily/text-item.cc
lily/text-spanner.cc
lily/tie.cc
lily/time-signature.cc
lily/translator-group.cc
lily/translator.cc
lily/tuplet-bracket.cc
lily/vaticana-ligature-engraver.cc
lily/vaticana-ligature.cc
lily/virtual-font-metric.cc
lily/volta-bracket.cc
ly/book-paper-defaults.ly
ly/declarations-init.ly
scm/output-lib.scm
scm/output-ps.scm
scm/page-layout.scm
scm/paper.scm
scm/safe-lily.scm
scripts/convert-ly.py
scripts/lilypond-book.py

index 191ed30360c26a577ab0dbbbbbb468c56d212404..2dda116c80947d837f19ed14baffd59009b752b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,27 @@
+2004-05-28  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/include/output-def.hh: new file, move from
+       music-output-def.hh
+
 2004-05-27  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/output-gnome.scm: Describe feta-cork hack.
 
 2004-05-27  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/include/book-paper-def.hh: derive from Output_def 
+
+       * lily/include/paper-def.hh: move all functionality out of class.
+       Junk header.
+
+       * lily/include/music-output-def.hh: rename Music_output_def to
+       Output_def.
+
+       * input/wilhelmus.ly: only set space for Paper formatting. 
+
+       * lily/include/midi-def.hh: remove file, remove class.
+       Move functions to Music-output-def.
+
        * lily/music-output-def.cc (Music_output_def): remove separate
        translator table. Lookup translators in scope directly. This
        obviates Context suffix for context identifiers, i.e.
index 103e9f61f7a8a2a74ad13bbeaea31de0f3679f03..74eec643a8c5e2a8ad486d7a49d924caedd58dbc 100644 (file)
@@ -4596,7 +4596,7 @@ empty after the line-breaking process, they are removed.
 For normal staves, a specialized @internalsref{Staff} context is
 available, which does the same: staves containing nothing (or only
 multi measure rests) are removed. The context definition is stored in
-@code{\RemoveEmptyStaff} variable. Observe how the second staff
+@code{\RemoveEmptyStaffContext} variable. Observe how the second staff
 in this example disappears in the second line
 
 
@@ -4608,7 +4608,7 @@ in this example disappears in the second line
   >>
   \paper {
     linewidth = 6.\cm 
-    \context { \RemoveEmptyStaff }
+    \context { \RemoveEmptyStaffContext }
   }
 }
 @end lilypond
index 3e102d76ad102da5bf08bb64f1e698fda28a52cb..972cbdd81a5d368bdfcddf56d35b6c5cf068faa7 100644 (file)
@@ -198,12 +198,12 @@ def write_fontlist (file, global_info, charmetrics):
     interscoreline = 1.0
     indent = 0.0 \cm
     \context {
-      \LyricsContext
+      \Lyrics
       \override SeparationItem #'padding = #2
       minimumVerticalExtent = ##f
     }
     \context {
-       \ScoreContext
+       \Score
        \remove "Bar_number_engraver"
        }
        }
index cb43459464e934049ea0da4ad4c97e59a9d027d5..26e1990de715a34751896c6c2f2c9d6ebb568471 100644 (file)
 #(define (prepend-grob-property grob-name
          grob-prop entry)
   (lambda (context)
-   (ly:context-pushpop-property context grob-name grob-prop
-    (cons
-     entry
-     (assoc-get grob-prop (car (ly:context-property context grob-name)))))))
+   (let*
+    ((grob-def (ly:context-property context grob-name)))
+    (if (pair? grob-def)
+     (ly:context-pushpop-property context grob-name grob-prop
+      (cons
+       entry
+       (assoc-get grob-prop (car grob-def))))))))
 
 #(define (set-extra-space grob-name entry value)
   (prepend-grob-property grob-name 'space-alist
@@ -183,7 +186,7 @@ oneHalfNoteTime = \markup {
     }
   >>
   \paper {}
-%  \midi {}
+  \midi {}
 }
 
 %%% Local variables:
index 755ce60e1054cd3063cd9d67b4e6c05103d908b2..0958dbae8ed7dfcd954de933a6ae7e3b4778e07b 100644 (file)
@@ -8,7 +8,7 @@
 #include "item.hh"
 #include "stencil.hh"
 #include "accidental-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "pitch.hh"
 
 /*
index 3928ae8f6eb13cdd9184c1a5e27fa3b11bbdd0fe..8f5ece25113d90d592fb6c4e08f95862338bf1be 100644 (file)
@@ -12,7 +12,7 @@
 #include "group-interface.hh"
 #include "axis-group-interface.hh"
 #include "hara-kiri-group-spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2);
 SCM
index 669cd61a0783493cc99c393d85c81178a5fc0f2f..e864fa0bbd0cf6d4366a6702d422a80d62b85370 100644 (file)
@@ -13,7 +13,7 @@
 #include "note-head.hh"
 #include "item.hh"
 #include "font-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "lookup.hh"
 
 /*
index 38036708c0dd867c0f966b0c4929032cd1f3093e..c2251bed270ec73d24c324bfe3d7d720c9e7c4ed 100644 (file)
@@ -1,6 +1,16 @@
+/* 
+  apply-context-iterator.cc --  implement Apply_context_iterator
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  
+*/
+
 #include "simple-music-iterator.hh"
 #include "context.hh"
 #include "music.hh"
+#include "input.hh"
 
 /**
   Iterate a property.  
@@ -19,7 +29,10 @@ Apply_context_iterator::process (Moment m)
 {
   SCM proc = get_music ()->get_property ("procedure");
 
-  scm_call_1 (proc, get_outlet ()->self_scm ());
+  if (ly_c_procedure_p (proc))
+    scm_call_1 (proc, get_outlet ()->self_scm ());
+  else
+    get_music ()->origin ()->warning (_("\\applycontext argument is not a procedure"));
   
   Simple_music_iterator::process (m);
 }
index ce076af4d8af36927a7461857176c261e21378cd..ad0ca353e1b8adb9d6532ef7e8bab4a8778c5d16 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "arpeggio.hh"
 #include "grob.hh"
 #include "stem.hh"
index 43ee85e7e8eab6c40df572c6ef5d0e175cf85514..bda3fa20cbd9f8d55372a1062d31f0935176ce58 100644 (file)
@@ -13,7 +13,7 @@
 #include "font-interface.hh"
 #include "stencil.hh"
 #include "lily-guile.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "misc.hh"
 
 class Balloon_interface
index 716c776d7279b396d9d89bd36f6f391ddee90adb..28d4e88ca70c03dc6183d2673a6db32e6b3a3e6a 100644 (file)
@@ -14,7 +14,7 @@
 #include "bar-line.hh"
 #include "string.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 
 #include "all-font-metrics.hh"
index 4328e81a91dd6a71bdb20af43a5f79aab39a71c8..7ba942a3b37640e86c9250e7052a7b3015ee9806 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "lily-guile.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "side-position-interface.hh"
 #include "item.hh"
 #include "moment.hh"
index 3a6f5e9aaf168022438685c38b4cada96a29805a..25df72abb180a87e345a5ef6d1639b3f451191cc 100644 (file)
@@ -19,7 +19,7 @@
 #include "staff-symbol-referencer.hh"
 #include "beam.hh"
 #include "stem.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "group-interface.hh"
 #include "align-interface.hh"
 
index 0ef6741faccea779d1cebb0e95bd8345d2aeb7c6..91574c3484afa1a49f9cec597e3626b191683db0 100644 (file)
@@ -35,7 +35,7 @@ Notes:
 #include "misc.hh"
 #include "least-squares.hh"
 #include "stem.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "lookup.hh"
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
index 42d8bd623d13ef88d4b08558ece3aee579c36396..5dae02d31b31153d1d1973b99ab49505d5e0a142 100644 (file)
@@ -1,5 +1,5 @@
 /* 
-  book-paper-def.cc --  implement Book_paper_def
+  book-paper-def.cc --  implement Book_output_def
   
   source file of the GNU LilyPond music typesetter
   
@@ -8,7 +8,7 @@
 */
 
 #include "ly-module.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "dimensions.hh"
 #include "book-paper-def.hh"
 #include "ly-smobs.icc"
 #include "virtual-font-metric.hh"
 #include "scaled-font-metric.hh"
 
-IMPLEMENT_SMOBS (Book_paper_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Book_paper_def);
-
-Book_paper_def::Book_paper_def ()
+Book_output_def::Book_output_def ()
 {
   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)
+Real
+Book_output_def::output_scale () const
+{
+  return output_scale_;
+}
+
+Book_output_def::Book_output_def (Book_output_def const & src)
+  : Output_def (src)
 {
   output_scale_ = src.output_scale_;
-  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_);
-
   scaled_fonts_ = scm_c_make_hash_table (11); // copying is not done with live defs. hopefully.
 }
 
-Book_paper_def::~Book_paper_def ()
+void
+Book_output_def::derived_mark ()
 {
+  scm_gc_mark (scaled_fonts_);
 }
 
-SCM
-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_;
-}
-
-int
-Book_paper_def::print_smob (SCM s, SCM p, scm_print_state*)
-{
-  (void) s;
-  scm_puts ("#<Book_paper>", p);
-  return 1;
-}
 
 Font_metric*
-Book_paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
+Book_output_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
 {
   Real lookup_mag = m;
   if (!dynamic_cast<Virtual_font_metric*> (f))
-    lookup_mag /= output_scale_;
+    lookup_mag /= output_scale ();
   
   SCM sizes = scm_hashq_ref (scaled_fonts_, f->self_scm (), SCM_BOOL_F);
   if (sizes != SCM_BOOL_F)
@@ -114,13 +96,11 @@ Book_paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
     {
       if (!ly_c_symbol_p (input_enc_name))
        {
-#if 0
-         /* FIXME.*/
          SCM var = ly_module_lookup (scope_, ly_symbol2scm ("inputencoding"));
-         input_enc_name = scm_variable_ref (var);
-      
-#endif
-         input_enc_name = ly_symbol2scm ("latin1"); 
+         if (var != SCM_BOOL_F) 
+           input_enc_name = scm_variable_ref (var);
+         if (!ly_c_symbol_p (input_enc_name))
+           input_enc_name = ly_symbol2scm ("latin1"); 
        }
 
       val = Modified_font_metric::make_scaled_font_metric (input_enc_name,
@@ -133,17 +113,17 @@ Book_paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
   return unsmob_metrics (val);
 }
 
-Paper_def 
-Book_paper_def::scale_paper (Paper_def *pd) const
+Output_def
+Book_output_def::scale_paper (Output_def *pd) const
 {
   SCM proc = ly_scheme_function ("scale-paper");
   SCM new_pap = scm_call_2 (proc, pd->self_scm (), self_scm ());
 
   scm_gc_protect_object (new_pap);
 
-  Paper_def *p = unsmob_paper (new_pap);
+  Output_def *p = unsmob_output_def (new_pap);
   
-  p->bookpaper_ = (Book_paper_def*) this;
+  p->parent_ = (Output_def*) this;
   return p;
 }
 
@@ -152,7 +132,7 @@ LY_DEFINE (ly_make_bookpaper, "ly:make-bookpaper",
           (SCM size),
           "Make a paperbook, for staff space SIZE, which is in INTERNAL_UNIT.") 
 {
-  Book_paper_def *bp = new Book_paper_def ;
+  Book_output_def *bp = new Book_output_def ;
 
   SCM_ASSERT_TYPE (ly_c_number_p (size), size,
                   SCM_ARG1, __FUNCTION__, "number");
@@ -162,12 +142,18 @@ LY_DEFINE (ly_make_bookpaper, "ly:make-bookpaper",
   return scm_gc_unprotect_object (bp->self_scm ());
 }
 
+Book_output_def *
+unsmob_book_output_def (SCM bp)
+{
+  return dynamic_cast<Book_output_def*> (unsmob_output_def (bp));
+}
+
 LY_DEFINE (ly_bookpaper_fonts, "ly:bookpaper-fonts",
           1, 0, 0,
           (SCM bp),
           "Return fonts scaled up BP")
 {
-  Book_paper_def *b = unsmob_book_paper_def (bp);
+  Book_output_def *b = unsmob_book_output_def (bp);
   
   SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "bookpaper");
 
@@ -195,32 +181,18 @@ LY_DEFINE (ly_bookpaper_outputscale, "ly:bookpaper-outputscale",
          (SCM bp),
          "Get outputscale for BP.")
 {
-  Book_paper_def *b = unsmob_book_paper_def (bp);
+  Book_output_def *b = unsmob_book_output_def (bp);
   SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "bookpaper");
   return scm_make_real (b->output_scale_);
 }
 
 
-SCM
-Book_paper_def::lookup_variable (SCM sym) const
-{
-  SCM var = ly_module_lookup (scope_, sym);
-
-  return scm_variable_ref (var);
-}
-
-SCM
-Book_paper_def::c_variable (String s) const
-{
-  return lookup_variable (ly_symbol2scm (s.to_str0 ()));
-}
-
 
-LY_DEFINE (ly_book_paper_def_scope, "ly:bookpaper-def-scope",
+LY_DEFINE (ly_book_output_def_scope, "ly:bookpaper-def-scope",
           1, 0,0, (SCM def),
           "Get the variable scope inside @var{def}.")
 {
-  Book_paper_def *op = unsmob_book_paper_def (def);
+  Book_output_def *op = unsmob_book_output_def (def);
   SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
   return op->scope_;
 }
index 8ff6521d7753033f27023653ddba423553e2a7d0..c970a964fe6ea2c7a6867c5e8cf53b66b8510470 100644 (file)
 #include "ly-module.hh"
 #include "main.hh"
 #include "music-iterator.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
 #include "music-output.hh"
 #include "music.hh"
 #include "page.hh"
 #include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "score.hh"
 #include "warn.hh"
 
@@ -62,14 +62,14 @@ Book::print_smob (SCM, SCM p, scm_print_state*)
 }
 
 void
-Book::process (String outname, Music_output_def *default_def, SCM header)
+Book::process (String outname, Output_def *default_def, SCM header)
 {
   Paper_book *paper_book = new Paper_book ();
   paper_book->bookpaper_ = bookpaper_;
   int score_count = scores_.size ();
   for (int i = 0; i < score_count; i++)
     {
-      Paper_def *paper = 0;
+      Output_def *paper = 0;
       SCM systems = scores_[i]->book_rendering (outname,
                                                bookpaper_,
                                                default_def, &paper);
@@ -89,14 +89,14 @@ Book::process (String outname, Music_output_def *default_def, SCM header)
 
 /* FIXME: WIP, this is a hack.  Return first page as stencil.  */
 SCM
-Book::to_stencil (Music_output_def *default_def, SCM header)
+Book::to_stencil (Output_def *default_def, SCM header)
 {
   Paper_book *paper_book = new Paper_book ();
   paper_book->bookpaper_ = bookpaper_;
   int score_count = scores_.size ();
   for (int i = 0; i < score_count; i++)
     {
-      Paper_def *paper = 0;
+      Output_def *paper = 0;
       SCM systems = scores_[i]->book_rendering ("<markup>",
                                                bookpaper_,
                                                default_def,
index 5db8a7c08ed0927c23fe0b3beb9cbb48a744826e..72d7021e9555fdc25612a6f9b399e65bd5bf4af5 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "paper-column.hh"
 #include "break-algorithm.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "system.hh"
 #include "paper-score.hh"
 #include "paper-column.hh"
index b8c5c739ababb620b7eb2e20967c3f5524800d96..6bbd74a950ab5c9e5e125e09d03b02dcbd163c17 100644 (file)
@@ -17,7 +17,7 @@
 #include "lily-guile.hh"
 #include "break-align-interface.hh"
 #include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh"
 #include "group-interface.hh"
 #include "align-interface.hh"
index 312c3463d522c6d80a6b1f7755da2d81ee3a223d..511fbd8373bcd68c396c29818f51f38b209e0f97 100644 (file)
@@ -15,7 +15,7 @@
 #include "breathing-sign.hh"
 #include "string.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "lookup.hh"
 
 #include "dimensions.hh"
index 252dfb8743c840a6669dd1e9ba930097759478dd..88635e5285860c2a3cd3c29bd1ff7bd08543b022 100644 (file)
@@ -9,9 +9,9 @@
 #include "engraver.hh"
 #include "chord-name.hh"
 #include "event.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "dimensions.hh"
 #include "item.hh"
 #include "pitch.hh"
index 92f8c2418b32783da2dc43071a12cb8d724c1517..ce7099fa7df743120d68a87eb5a432c5060484e8 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "chord-name.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 #include "grob.hh"
 #include "paper-column.hh"
index 687eaabae3309014ebfd2a98a8b5719ba3d3223b..794c42640b358a4eef97229158cf7f215f41f401 100644 (file)
@@ -19,7 +19,7 @@
 #include "lookup.hh"
 #include "box.hh"
 #include "interval.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 
 
index 73d3473a89e565aa30260e2b06510d2b85158186..525e53ca368dc4eebc3855fdebe9d81b613a7d55 100644 (file)
@@ -7,7 +7,7 @@
 #include <ctype.h>
 
 #include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "event.hh"
 #include "dots.hh"
 #include "dot-column.hh"
index adb33c9abc009ed6dab75f5f594d82fde52d64ae..42ea516f91568d60d9e5581723503a43ba507de7 100644 (file)
@@ -16,7 +16,7 @@
 #include "context-def.hh"
 #include "translator-group.hh"
 #include "warn.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
 #include "ly-smobs.icc"
 #include "score-context.hh"
 
@@ -175,7 +175,7 @@ Context_def::get_accepted (SCM user_mod) const
 
           
 Link_array<Context_def>
-Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) const
+Context_def::path_to_acceptable_context (SCM type_sym, Output_def* odef) const
 {
   assert (ly_c_symbol_p (type_sym));
   
@@ -184,7 +184,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) c
   Link_array<Context_def> accepteds;
   for (SCM s = accepted; ly_c_pair_p (s); s = ly_cdr (s))
     {
-      Context_def *t = unsmob_context_def (odef->find_context_def (ly_car (s)));
+      Context_def *t = unsmob_context_def (find_context_def (odef, ly_car (s)));
       if (!t)
        continue;
       accepteds.push (t);
index b97a5f1a62b0b3812e759d6d16bfa957ff88fad1..3a4a875ec1f05cde55eaced15f517b577fdbd4db 100644 (file)
@@ -11,7 +11,7 @@
 #include "context-def.hh"
 #include "context.hh"
 #include "warn.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
 #include "scm-hash.hh"
 #include "main.hh"
 #include "ly-smobs.icc"
@@ -193,7 +193,7 @@ Context::get_default_interpreter ()
   if (!is_bottom_context ())
     {
       SCM nm = default_child_context_name ();
-      SCM st = get_output_def ()->find_context_def (nm);
+      SCM st = find_context_def (get_output_def (), nm);
 
       Context_def *t = unsmob_context_def (st);
       if (!t)
@@ -344,7 +344,7 @@ Context::get_score_context () const
     return 0;
 }
 
-Music_output_def *
+Output_def *
 Context::get_output_def () const
 {
   return  (daddy_context_)
index d324027a1ab123573fe55d6d11777fda721ba388..c93a6f8c67c0a9e6640d8f80e79fee6da7906781 100644 (file)
@@ -9,7 +9,7 @@
 #include "dots.hh"
 #include "item.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
index a85bd4db7414c3ebd450cd597dfd9d63c5888d01..f8ff01ab65b096e47c1fe1815d5f882595d46804 100644 (file)
@@ -10,7 +10,7 @@
 #include "font-metric.hh"
 #include "font-interface.hh"
 #include "grob.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 
 
index df98d77ceeb2de419e98debbb58c58a17caa5069..45a5b9e7491cdbb59e1b771d17e48207a218a226 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "book-paper-def.hh"
 #include "all-font-metrics.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 #include "warn.hh"
 
@@ -22,7 +22,7 @@ LY_DEFINE (ly_paper_get_font, "ly:paper-get-font", 2, 0, 0,
           "in the alist chain @var{chain}.\n"
           "(An alist chain is a list of alists, containing grob properties).\n")
 {
-  Paper_def *pap = unsmob_paper (paper);
+  Output_def *pap = unsmob_output_def (paper);
   SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
   
   Font_metric *fm = select_font (pap, chain);
@@ -33,7 +33,7 @@ LY_DEFINE (ly_paper_get_number, "ly:paper-get-number", 2, 0, 0,
           (SCM paper, SCM name),
           "Return the paper variable @var{name}.")
 {
-  Paper_def *pap = unsmob_paper (paper);
+  Output_def *pap = unsmob_output_def (paper);
   SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
   return scm_make_real (pap->get_dimension (name));
 }
@@ -51,7 +51,7 @@ wild_compare (SCM field_val, SCM val)
   design size is specced in advance.
  */
 Font_metric*
-get_font_by_design_size (Paper_def* paper, Real requested,
+get_font_by_design_size (Output_def* paper, Real requested,
                         SCM font_vector, SCM input_encoding_name)
 {
   int n = SCM_VECTOR_LENGTH (font_vector);
@@ -84,13 +84,15 @@ get_font_by_design_size (Paper_def* paper, Real requested,
     }
 
   Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
-  return paper->bookpaper_->find_scaled_font (fm, requested / size, input_encoding_name);
+  return dynamic_cast<Book_output_def*> (paper->parent_)
+    // ugh.
+    ->find_scaled_font (fm, requested / size, input_encoding_name);
 
 }
 
 
 Font_metric*
-get_font_by_mag_step (Paper_def* paper, Real requested_step,
+get_font_by_mag_step (Output_def* paper, Real requested_step,
                      SCM font_vector, Real default_size, SCM input_encoding_name)
 {
   return get_font_by_design_size (paper,
@@ -108,7 +110,7 @@ properties_to_font_size_family (SCM fonts, SCM alist_chain)
 
 
 Font_metric *
-select_encoded_font (Paper_def *paper, SCM chain, SCM encoding_name)
+select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
 {
   SCM name = ly_assoc_chain (ly_symbol2scm  ("font-name"), chain);
   
@@ -129,7 +131,8 @@ select_encoded_font (Paper_def *paper, SCM chain, SCM encoding_name)
       Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
       
       
-      return paper->bookpaper_->find_scaled_font (fm, rmag, encoding_name);
+      return dynamic_cast<Book_output_def*> (paper->parent_)
+       ->find_scaled_font (fm, rmag, encoding_name);
     }
   else if (scm_instance_p (name))
     {
@@ -151,7 +154,7 @@ select_encoded_font (Paper_def *paper, SCM chain, SCM encoding_name)
 }
 
 Font_metric *
-select_font (Paper_def *paper, SCM chain)
+select_font (Output_def *paper, SCM chain)
 {
   return select_encoded_font (paper, chain, SCM_EOL);
 }
index 7b43d2b174bb70db5b8007bc7aafcc15706cacf5..77a67639c49588b1007ed70591c5232851c569c9 100644 (file)
 #include "global-context.hh"
 #include "score-context.hh"
 #include "context-def.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
 #include "grace-fixup.hh"
 
-Global_context::Global_context (Music_output_def *o, Moment final)
+Global_context::Global_context (Output_def *o, Moment final)
 {
   output_def_ = o;
   final_mom_ = final;
-  definition_ = o->find_context_def (ly_symbol2scm ("Global"));
+  definition_ = find_context_def (o, ly_symbol2scm ("Global"));
   unsmob_context_def (definition_)->apply_default_property_operations (this);
   accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
 }
 
-Music_output_def* 
+Output_def* 
 Global_context::get_output_def () const
 {
   return output_def_;
@@ -145,8 +145,7 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
       if (!get_score_context ()) 
        {
          SCM key = ly_symbol2scm ("Score");
-         Context_def * t = unsmob_context_def (get_output_def ()
-                                               ->find_context_def (key));
+         Context_def * t = unsmob_context_def (find_context_def (get_output_def (), key));
          if (!t)
            error (_f ("can't find `%s' context", "Score"));
 
index 789710daba5c2eb9b6df630f2393e861f25a03c4..9cfd6b531f5677999a8ac6be1daab5274dd8d95b 100644 (file)
@@ -14,7 +14,7 @@
 #include "main.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "simple-spacer.hh"
 #include "system.hh"
 
@@ -106,7 +106,7 @@ Gourlay_breaking::do_solve () const
          cp.cols_ = line;
 
          Interval line_dims
-           = pscore_->paper_->line_dimensions_int (optimal_paths[start_idx].line_);
+           = line_dimensions_int (pscore_->paper_, optimal_paths[start_idx].line_);
          Simple_spacer * sp = generate_spacing_problem (line, line_dims);
          bool last_line = break_idx == breaks.size ()-1;
          bool ragged = ragged_right
index 8cb4b84cd75860dc7c7d0d49424d4a46ab559140..72353140f38e228d2c32674d998b7edd831cd538 100644 (file)
@@ -10,7 +10,7 @@
 #include "group-interface.hh"
 #include "misc.hh"
 #include "paper-score.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "grob.hh"
 #include "spanner.hh"
 #include "item.hh"
index 1557d3105bc0a0499d2554fa601cfa680e3091dc..740491f52a1b32a20a9f0a20b67fc9a0af3176c0 100644 (file)
@@ -11,7 +11,7 @@
 #include "warn.hh"
 #include "spanner.hh"
 #include "item.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "system.hh"
 
 
index b32b83a201aa8bac64d53033343d057e744be073..5ca831a51ae9c0d55788e77bc1b67956c6733631 100644 (file)
@@ -158,7 +158,7 @@ Grob::stencil_extent (SCM element_smob, SCM scm_axis)
   return ly_interval2scm (e);
 }
 
-Paper_def*
+Output_def*
 Grob::get_paper ()  const
 {
  return pscore_ ? pscore_->paper_ : 0;
index 28b5a0910f5ef5ca1fc5c3937d06322970b6c80a..4c31cbad2e1ea83508f29742fe7124792d5bbe9b 100644 (file)
@@ -13,7 +13,7 @@
 #include "spanner.hh"
 #include "font-interface.hh"
 #include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 #include "paper-column.hh"
 #include "lookup.hh"
index 4961721496ee18c0939e96fdfc7ac52b5e7420be..de9ccb32514f3a1fb1b844af1a4efb756b45ca48 100644 (file)
@@ -11,7 +11,7 @@
 #include "lookup.hh"
 #include "group-interface.hh"
 #include "directional-element-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "staff-symbol-referencer.hh"
 
 struct Horizontal_bracket
index a0f3bcfab6babb9c24fb4fefbbcb1d69372dbf94..2d4386b927f4b91b54fcb6089d174aef19df418c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  book-paper-def.hh -- declare Book_paper_def
+  book-paper-def.hh -- declare Book_output_def
 
   source file of the GNU LilyPond music typesetter
 
 #define BOOK_PAPER_DEF_HH
 
 #include "lily-proto.hh"
-#include "smobs.hh"
-#include "virtual-methods.hh"
+#include "output-def.hh"
 
-class Book_paper_def
+class Book_output_def : public Output_def
 {
-  DECLARE_SMOBS (Book_paper_def, Music_output_def);
-
 public:
-  VIRTUAL_COPY_CONSTRUCTOR (Book_paper_def, Book_paper_def);
-  Book_paper_def (Book_paper_def const &);
-  SCM scope_;
+  VIRTUAL_COPY_CONSTRUCTOR (Output_def, Book_output_def);
+  Book_output_def (Book_output_def const &);
   SCM scaled_fonts_;
   Real output_scale_;
+  Real output_scale () const;
 
-  Book_paper_def ();
-  SCM c_variable (String id) const;
-  SCM lookup_variable (SCM sym) const;
+  Book_output_def ();
 
+  virtual void derived_mark ();
   Font_metric *find_scaled_font (Font_metric *f, Real m, SCM input_enc_name);
-  Paper_def *scale_paper (Paper_def *pd) const;
+  Output_def *scale_paper (Output_def *pd) const;
 };
-DECLARE_UNSMOB (Book_paper_def, book_paper_def);
+
+Book_output_def *unsmob_book_output_def (SCM bp);
 
 #endif /* BOOK_PAPER_DEF_HH */
index b815b75edc9ec58c9ebcbf09391892ede7e5caff..0c5e46863bfa304b9b184551e0d69eabecc21902 100644 (file)
@@ -20,13 +20,13 @@ class Book : public Input
 
 public:
   SCM header_;
-  Book_paper_def *bookpaper_;
+  Book_output_def *bookpaper_;
   
   Link_array<Score> scores_;
   Book ();
 
-  void process (String outname, Music_output_def*, SCM header);
-  SCM to_stencil (Music_output_def*, SCM header);
+  void process (String outname, Output_def*, SCM header);
+  SCM to_stencil (Output_def*, SCM header);
 };
 DECLARE_UNSMOB (Book, book);
 
index 01484666a6d797744cba2bb0faac913b03c45524..c734ed924086a6a5a7bcf65e25a78c0d016d75db 100644 (file)
@@ -42,7 +42,7 @@ public:
   void set_acceptor (SCM accepts, bool add);
 
   Link_array<Context_def> path_to_acceptable_context (SCM type_string,
-                                                     Music_output_def*) const;
+                                                     Output_def*) const;
   Context * instantiate (SCM extra_ops);
 
   SCM to_alist () const;
index 6413d8b49f14689f5a60db0e85e960d0cbb4b0cb..af504c121881480047f21744d01989ee833495f3 100644 (file)
@@ -64,7 +64,7 @@ public:
   Global_context * get_global_context () const;
   
   virtual Score_context * get_score_context () const;  
-  virtual Music_output_def *get_output_def () const;
+  virtual Output_def *get_output_def () const;
   virtual Moment now_mom () const;
   virtual Context *get_default_interpreter ();
 
@@ -78,7 +78,7 @@ public:
   Context *find_create_context (SCM context_name,
                                String id, SCM ops);
   Link_array<Context> path_to_acceptable_context (SCM alias,
-                                                 Music_output_def*) const;
+                                                 Output_def*) const;
 
 };
 
index c3f1834f02af9532da6a3a5d2fe3022fe502b4f4..353b8cf0443b45ff8a2b2bbbd7959e1748a7f826 100644 (file)
 class Global_context : public virtual Context
 {
   PQueue<Moment> extra_mom_pq_;
-  Music_output_def*  output_def_;
+  Output_def*  output_def_;
   
-  friend class Music_output_def;
+  friend class Output_def;
 public:
-  Global_context (Music_output_def*, Moment final);
+  Global_context (Output_def*, Moment final);
   int get_moments_left () const;
   Moment sneaky_insert_extra_moment (Moment);
   void add_moment_to_process (Moment);
@@ -34,7 +34,7 @@ public:
   virtual void prepare (Moment);
   virtual void one_time_step ();
   virtual void finish ();
-  virtual Music_output_def* get_output_def () const; 
+  virtual Output_def* get_output_def () const; 
   virtual Moment now_mom () const;
   virtual Context *get_default_interpreter ();
 
index fba4a8eaad15bb0f311b6edff9a70afaeea38fab..ba7a7b8a0da8ee564c9f15864ecc0da1ee1d715f 100644 (file)
@@ -82,7 +82,7 @@ public:
   /*
     related classes.
    */
-  Paper_def *get_paper () const;
+  Output_def *get_paper () const;
 
   /**
     add a dependency. It may be the 0 pointer, in which case, it is ignored.
index f74f32d9786748664a64af38ae2ea0ff81c6ca39..b1fa3c44aa8f805f988c1a6c019f0526ab134f4b 100644 (file)
@@ -37,7 +37,7 @@ class Beaming_info_list;
 class Bezier;
 class Bezier_bow;
 class Book;
-class Book_paper_def;
+class Book_output_def;
 class Break_algorithm;
 class Change_iterator;
 class Change_translator;
@@ -78,7 +78,6 @@ class Lyric_performer;
 class Lyric_phrasing_engraver;
 class Mensural_ligature_engraver;
 class Midi_chunk;
-class Midi_def;
 class Midi_duration;
 class Midi_dynamic;
 class Midi_header;
@@ -100,7 +99,7 @@ class Music;
 class Music_iterator;
 class Music_list;
 class Music_output;
-class Music_output_def;
+class Output_def;
 class Music_sequence;
 class Music_wrapper;
 class Music_wrapper_iterator;
@@ -111,7 +110,7 @@ class Note_performer;
 class Output_property;
 class Paper_book;
 class Paper_column;
-class Paper_def;
+class Output_def;
 class Paper_line;
 class Paper_outputter;
 class Paper_score;
diff --git a/lily/include/midi-def.hh b/lily/include/midi-def.hh
deleted file mode 100644 (file)
index c919a87..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  midi-def.hh -- declare Midi_def
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-
-#ifndef MIDI_DEF_HH
-#define MIDI_DEF_HH
-
-#include "lily-proto.hh"
-#include "real.hh"
-#include "string.hh"
-#include "moment.hh"
-#include "music-output-def.hh"
-
-/** 
-  definitions for midi output. Rather empty
- */
-class Midi_def : public Music_output_def
-{
-  static int score_count_;
-
-public:
-  Midi_def ();
-  VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Midi_def);
-
-  int get_tempo (Moment moment);
-  void set_tempo (Moment moment, int count_per_minute_i);
-};
-
-#endif /* MIDI_DEF_HH */
diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh
deleted file mode 100644 (file)
index d95ee03..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  music-output-def.hh -- declare Music_output_def
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef MUSIC_OUTPUT_DEF_HH
-#define MUSIC_OUTPUT_DEF_HH
-
-#include "string.hh"
-#include "lily-proto.hh"
-#include "lily-guile.hh"
-#include "virtual-methods.hh"
-#include "smobs.hh"
-#include "input.hh"
-
-/**
-  Definition of how to output lilypond.
- */
-class Music_output_def   
-{
-public:
-  Input input_origin_;
-  SCM scope_;
-
-  void assign_context_def (SCM transdef);
-  SCM find_context_def (SCM name) const;
-
-  Music_output_def (Music_output_def const&);
-  Music_output_def ();
-  VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Music_output_def);
-
-  Context *get_group_translator (String type) const;
-  String outname_string () ;
-  SCM c_variable (String id) const;
-  SCM lookup_variable (SCM sym) const;
-  void set_variable (SCM, SCM sym);
-  DECLARE_SMOBS (Music_output_def,);
-};
-
-DECLARE_UNSMOB (Music_output_def, music_output_def);
-
-#endif /* MUSIC_OUTPUT_DEF_HH */
index f8138e15c039322324b7a29e22eecb28c42682db..0f97dabf0f3d5e0b4e4aeb05fa612404c518b99d 100644 (file)
@@ -79,7 +79,8 @@ SCM ly_parser_print_score (SCM, SCM);
 SCM ly_parser_bookify (SCM, SCM);
 SCM ly_parser_scorify (SCM, SCM);
 
-Music_output_def *get_paper (My_lily_parser *parser);
-Book_paper_def *get_bookpaper (My_lily_parser *parser);
+Output_def *get_paper (My_lily_parser *parser);
+Output_def *get_midi (My_lily_parser *parser);
+Book_output_def *get_bookpaper (My_lily_parser *parser);
 
 #endif /* MY_LILY_PARSER_HH */
diff --git a/lily/include/output-def.hh b/lily/include/output-def.hh
new file mode 100644 (file)
index 0000000..e18326f
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+  music-output-def.hh -- declare Output_def
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#ifndef MUSIC_OUTPUT_DEF_HH
+#define MUSIC_OUTPUT_DEF_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+#include "virtual-methods.hh"
+#include "smobs.hh"
+#include "input.hh"
+
+/**
+  Definition of how to output lilypond.
+ */
+class Output_def   
+{
+public:
+  VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
+  DECLARE_SMOBS (Output_def,);
+public:
+  Output_def * parent_;
+  Input input_origin_;
+  SCM scope_;
+
+  Output_def (Output_def const&);
+  Output_def ();
+  virtual void derived_mark ();
+  
+  /*
+    variables.
+   */
+  SCM c_variable (String id) const;
+  SCM lookup_variable (SCM sym) const;
+  void set_variable (SCM sym, SCM val);
+  Real get_dimension (SCM symbol) const;
+};
+
+void assign_context_def (Output_def *m, SCM transdef);
+SCM find_context_def (Output_def const *m, SCM name);
+
+int get_tempo (Output_def*def, Moment moment);
+void set_tempo (Output_def*def, Moment moment, int count_per_minute_i);
+
+Interval line_dimensions_int (Output_def*def, int);
+
+Font_metric *select_encoded_font (Output_def *paper, SCM input_encoding, SCM chain);
+Font_metric *select_font (Output_def *paper, SCM chain);
+
+DECLARE_UNSMOB (Output_def, output_def);
+
+#endif /* MUSIC_OUTPUT_DEF_HH */
index e082b6ab1837f9ec99674e8ae6365ecde7ae8c44..07d76d909c494dde2a26a4cd3733ec43e0a3adf8 100644 (file)
@@ -18,8 +18,8 @@ class Page
   DECLARE_SMOBS (Page, );
 
 public:
-  Paper_def *paper_;           // todo: make private? 
-  Book_paper_def * bookpaper () const;
+  Output_def *paper_;          // todo: make private? 
+  Book_output_def * bookpaper () const;
   static int page_count_;
   static Real MIN_COVERAGE_;
   int number_;
@@ -38,7 +38,7 @@ public:
   Real top_margin_;
   Real bottom_margin_;
 
-  Page (Paper_def*, int);
+  Page (Output_def*, int);
 
   /* available area for text.  */
   Real text_height () const;
index e0cab4c45b01cff0af6ad3c06e604f99dcc875fe..2e0d3863b39817ec5eb387c2aeea361e4a6622e5 100644 (file)
@@ -18,7 +18,7 @@ struct Score_lines
   SCM lines_;
   SCM header_;
   SCM global_header_;
-  Paper_def *paper_;
+  Output_def *paper_;
 
   Score_lines () ;
   void gc_mark ();
@@ -34,7 +34,7 @@ class Paper_book
   SCM tagline_;
 public:
   Array<Score_lines> score_lines_;
-  Book_paper_def *bookpaper_;
+  Book_output_def *bookpaper_;
 
   Paper_book ();
 
index a23afe7f455764337a1339857a1302a9026e4789..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,74 +0,0 @@
-/*
-  paper-def.hh -- declare Paper_def
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef PAPER_DEF_HH
-#define PAPER_DEF_HH
-
-
-#include "lily-proto.hh"
-#include "lily-guile.hh"
-#include "real.hh"
-#include "array.hh"
-#include "interval.hh"
-#include "music-output-def.hh"
-
-
-/** 
-
-  Symbols, dimensions and constants pertaining to visual output.
-
-  This struct takes care of all kinds of symbols, dimensions and
-  constants. Most of them are related to the point-size of the fonts,
-  so therefore, the lookup table for symbols is also in here.
-
-  TODO: 
-  
-  add support for multiple fontsizes 
-
-  remove all utility funcs 
-  
-
-  add support for other len->wid conversions.
-
-
-  Interesting variables:
-  
-  /// The distance between lines
-  interline
-  
-*/
-class Paper_def : public Music_output_def 
-{
-protected:
-  VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Paper_def);
-  
-public:
-  Book_paper_def * bookpaper_;
-  static int score_count_;
-  
-  Paper_def ();
-  Paper_def (Paper_def const&);
-  virtual ~Paper_def ();
-  
-  Paper_outputter* get_paper_outputter (String) const;
-  SCM font_descriptions () const;
-  void reinit ();
-  Interval line_dimensions_int (int) const;
-  void output_settings (Paper_outputter*) const;
-  Font_metric *find_scaled_font (Font_metric *fm, Real mag, SCM enc_name);
-  Real get_dimension (SCM symbol) const;
-  
-  friend int yyparse (void*);
-};
-
-Paper_def * unsmob_paper (SCM x);
-Font_metric *select_encoded_font (Paper_def *paper, SCM input_encoding, SCM chain);
-Font_metric *select_font (Paper_def *paper, SCM chain);
-
-#endif /* PAPER_DEF_HH */
index bbd67d495b43e827b9649c03b30643cfde5d668e..dca083ffa86932396c3345629732c27196289888 100644 (file)
@@ -32,8 +32,8 @@ class Paper_outputter
   String filename_;
   
   void output_expr (SCM expr, Offset o);
-  void output_metadata (Book_paper_def*, SCM);
-  void output_music_output_def (Music_output_def* odef);
+  void output_metadata (Output_def *, SCM);
+  void output_music_output_def (Output_def* odef);
 
 public:
   Paper_outputter (String nm);
@@ -42,9 +42,11 @@ public:
   void dump_scheme (SCM);
   void output_scheme (SCM scm);
   void output_stencil (Stencil);
-  void output_header (Book_paper_def*, SCM, int, bool);
+  void output_header (Output_def*, SCM, int, bool);
   void output_line (SCM, Offset*, bool);
   void output_page (Page*, bool);
 };
 
+Paper_outputter* get_paper_outputter (String);
+
 #endif /* PAPER_OUTPUTTER_HH */
index 43bc6a58364250d4b397997faba57e09e8025cb5..2adfdafb38b248699ba4a4831b1ff9cf0220d383 100644 (file)
@@ -20,7 +20,7 @@
 class Paper_score : public Music_output
 {
 public:
-  Paper_def *paper_;
+  Output_def *paper_;
   System *system_;
 
   Paper_score ();
index 907b1ec9989a7dbf6e70c547e5698e66a3f7d6ba..416349371183f93905c1327dd9c1463d2c1146dd 100644 (file)
@@ -29,7 +29,7 @@ public:
 
   Link_array<Audio_staff> audio_staffs_;
   Cons<Audio_element> *audio_elem_p_list_;
-  Midi_def *midi_;
+  Output_def *midi_;
 };
 
 #endif /* PERFORMANCE_HH */
index ca25c3d0f980fbf5dd1f472a4b048cd178a829db..d9a81f79e8c549306d8a21e34321a421899b13ec 100644 (file)
@@ -21,13 +21,13 @@ class Score : public Input
   DECLARE_SMOBS (Score, foo);
 
 public:
-  Link_array<Music_output_def> defs_;
+  Link_array<Output_def> defs_;
   SCM music_;
   SCM header_;
     
   Score ();
   Score (Score const&);
-  SCM book_rendering (String, Book_paper_def*, Music_output_def*, Paper_def**);
+  SCM book_rendering (String, Book_output_def*, Output_def*, Output_def**);
 };
 
 DECLARE_UNSMOB (Score, score);
index e4ae2fb3432ee6a232076019d3c6e12ba73ec109..1050cac31af4aacb15fdaaa0e9254e46ad6e1713 100644 (file)
@@ -43,7 +43,7 @@ public:
 
   SCM internal_get_property (SCM symbol) const;
   
-  virtual Music_output_def *get_output_def () const;
+  virtual Output_def *get_output_def () const;
   virtual Translator_group* get_daddy_translator ()const;
   virtual Moment now_mom () const;  
   virtual bool try_music (Music *req);
index 7f9a96b1d7d9f37d97ec09968050cc50d131dc85..1990b336a5a3606f0b7a26065c18b3d20a608489 100644 (file)
@@ -11,7 +11,7 @@
 #include "item.hh"
 
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
index 317df83495b5e2c434e2b364e04469fce768147f..33c0f3820915485e9f06f8330aab3eb1490386d6 100644 (file)
@@ -12,7 +12,7 @@ source file of the GNU LilyPond music typesetter
 #include "grob.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 
 Stencil
index 023c504f21602f2f07eaf49abad11dc5eb094335..9dc4562539484b949974bd9be0f065eedf08079d 100644 (file)
@@ -12,7 +12,7 @@
 #include "item.hh"
 #include "spanner.hh"
 #include "line-spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh"
 #include "staff-symbol-referencer.hh"
 #include "font-interface.hh"
index 9fda17d9467ccd5edb52a3d00a09defe9d36a74f..7343b6bfcd072a3aefc37e6c8dda3fcf60305f23 100644 (file)
@@ -13,7 +13,7 @@
 #include "lookup.hh"
 #include "stencil.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "lyric-extender.hh"
 #include "note-head.hh"
 #include "group-interface.hh"
index 0f5460b4b8e599af3b589a94c7b71bded9cb9214..3a2ea9e68f6d084512347e8983a663d37e4db5f7 100644 (file)
@@ -11,7 +11,7 @@
 #include "box.hh"
 #include "lookup.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh"
 #include "spanner.hh"
 #include "item.hh"
index a3b89c602048cd96cd64b9f079aa1204d459c86c..c8811fdc04350d43a017dcf0ab192074855d30ce 100644 (file)
@@ -27,9 +27,8 @@
 #include "lily-guile.hh"
 #include "lily-version.hh"
 #include "main.hh"
-#include "midi-def.hh"
 #include "misc.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "string.hh"
 #include "warn.hh"
 
index 62c7c287ab0d3148a40310aca28feab2dcd621f9..7d160ac8e43cfbb6f9273bdb1f13922b9770ef3c 100644 (file)
@@ -7,7 +7,7 @@
 
  */
 
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "spanner.hh"
 #include "measure-grouping-spanner.hh"
 #include "lookup.hh" 
index 4d6493fec8ade3b7331a92876a4156e47f26dfb2..8252e5a5697b6db66550a7c7e008e25ce16d4847 100644 (file)
@@ -18,7 +18,7 @@
 #include "rhythmic-head.hh"
 #include "note-head.hh"
 #include "staff-symbol-referencer.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 
 /*
index 2035745173a32db57f5b4e85529fdc9a14716f08..c9cab99eb4d3a3838be26cea5ea675fdfb65811b 100644 (file)
@@ -14,7 +14,7 @@
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 #include "note-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 
 /*
index 234ebeb2aaf6f1cf968e693e81fde8726d47c96b..d30e94e599a37407ce6961c735ced9e4d28ae346 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  midi-def.cc -- implement Midi_def
+  midi-def.cc -- implement midi output def functions
 
   source file of the GNU LilyPond music typesetter
 
@@ -7,23 +7,21 @@
 
 */
 #include <math.h>
+
 #include "misc.hh"
-#include "midi-def.hh"
-#include "performance.hh"
+#include "output-def.hh"
+#include "moment.hh"
 #include "warn.hh"
 #include "scm-hash.hh"
 
-Midi_def::Midi_def ()
-{
-  // ugh
-  set_tempo (Moment (Rational (1, 4)), 60);
-}
+
 
 int
-Midi_def::get_tempo (Moment one_beat_mom)
+get_tempo (Output_def * def,
+          Moment one_beat_mom)
 {
   SCM wis  = ly_symbol2scm ("whole-in-seconds");
-  Moment *w = unsmob_moment (lookup_variable (wis));
+  Moment *w = unsmob_moment (def->lookup_variable (wis));
 
   Moment wholes_per_min = Moment (60);
   if (!w)
@@ -41,11 +39,13 @@ Midi_def::get_tempo (Moment one_beat_mom)
 }
 
 void
-Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i)
+set_tempo (Output_def * def,
+          Moment one_beat_mom,
+          int beats_per_minute_i)
 {
   Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
 
   Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom);
-  set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
+  def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
 }
 
index 61bbf1f84d8991f5ba86b7abe0c5c5a983aa7aa8..49b6c7b63179b15ab7b78413b71881c467bbe5f4 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "multi-measure-rest.hh"
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh" // urg
 #include "font-interface.hh"
 #include "rest.hh"
index e22549f5020f5b85032c31a20b87a1ce51e53dc3..95ca70953327a714f47d2958b458d80a15d09be2 100644 (file)
@@ -1,39 +1,42 @@
 /*
-  music-output-def.cc -- implement Music_output_def
+  music-output-def.cc -- implement Output_def
 
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "scm-hash.hh"
+#include "book-paper-def.hh"
 #include "context-def.hh"
 #include "file-path.hh"
 #include "global-context.hh"
 #include "lily-guile.hh"
 #include "ly-module.hh"
 #include "main.hh"
-#include "music-output-def.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
+#include "output-def.hh"
+#include "scm-hash.hh"
 #include "warn.hh"
 
 #include "ly-smobs.icc"
 
-Music_output_def::Music_output_def ()
+Output_def::Output_def ()
 {
   scope_ = SCM_EOL;
+  parent_ = 0;
   smobify_self ();
 
   scope_ = ly_make_anonymous_module (false);
 }
 
-Music_output_def::~Music_output_def ()
+Output_def::~Output_def ()
 {
 }
 
-Music_output_def::Music_output_def (Music_output_def const &s)
+Output_def::Output_def (Output_def const &s)
 {
   scope_ = SCM_EOL;
+  parent_ = 0;
   smobify_self ();
 
   scope_= ly_make_anonymous_module (false);
@@ -42,30 +45,32 @@ Music_output_def::Music_output_def (Music_output_def const &s)
 }
 
 
-IMPLEMENT_SMOBS (Music_output_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Music_output_def);
+IMPLEMENT_SMOBS (Output_def);
+IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
 
-#include "paper-def.hh"
-#include "book-paper-def.hh"
 
 SCM
-Music_output_def::mark_smob (SCM m)
+Output_def::mark_smob (SCM m)
 {
-  Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m);
+  Output_def * mo = (Output_def*) SCM_CELL_WORD_1 (m);
 
   /*
     FIXME: why is this necessary?
     all bookpaper_ should be protected by themselves.
   */
-  Paper_def *pd  = dynamic_cast<Paper_def*>(mo);
-  if (pd && pd->bookpaper_)
-    scm_gc_mark (pd->bookpaper_->self_scm ());
+  if (mo->parent_)
+    scm_gc_mark (mo->parent_->self_scm ());
   
+
+  mo->derived_mark ();
   return mo->scope_;
 }
 
 void
-Music_output_def::assign_context_def (SCM transdef)
+Output_def::derived_mark () {}
+
+void
+assign_context_def (Output_def * m, SCM transdef)
 {
   Context_def *tp = unsmob_context_def (transdef);
   assert (tp);
@@ -73,7 +78,7 @@ Music_output_def::assign_context_def (SCM transdef)
   if (tp)
     {
       SCM sym = tp->get_context_name ();
-      scm_module_define (scope_, sym, transdef);
+      scm_module_define (m->scope_, sym, transdef);
     }  
 }
 
@@ -81,24 +86,16 @@ Music_output_def::assign_context_def (SCM transdef)
   find the translator for NAME. NAME must be a symbol.
 */
 SCM
-Music_output_def::find_context_def (SCM name) const
+find_context_def (Output_def const *m, SCM name)
 {  
-  SCM var = ly_module_lookup (scope_, name);
-
-  if (var != SCM_BOOL_F)
-    {
-      var = scm_variable_ref (var);
-      Context_def *cd = (unsmob_context_def (var));
-      return cd ? cd->self_scm () : SCM_EOL;
-    }
-  else
-    return SCM_EOL;
+  Context_def *cd = unsmob_context_def (m->lookup_variable (name));
+  return cd ? cd->self_scm () : SCM_EOL;
 }
 
 int
-Music_output_def::print_smob (SCM s, SCM p, scm_print_state *)
+Output_def::print_smob (SCM s, SCM p, scm_print_state *)
 {
-  Music_output_def * def = unsmob_music_output_def (s);
+  Output_def * def = unsmob_output_def (s);
   scm_puts ("#< ", p);
   scm_puts (classname (def), p);
   
@@ -107,56 +104,76 @@ Music_output_def::print_smob (SCM s, SCM p, scm_print_state *)
   return 1;
 }
 
+Real
+Output_def::get_dimension (SCM s) const
+{
+  SCM val = lookup_variable (s);
+  return ly_scm2double (val);
+}
+
+
 SCM
-Music_output_def::lookup_variable (SCM sym) const
+Output_def::lookup_variable (SCM sym) const
 {
   SCM var = ly_module_lookup (scope_, sym);
-
-  return scm_variable_ref (var);
+  if (SCM_VARIABLEP (var))
+    return SCM_VARIABLE_REF (var);
+  
+  if (parent_)
+    return parent_->lookup_variable (sym);
+  
+  return SCM_EOL;
 }
 
 SCM
-Music_output_def::c_variable (String s) const
+Output_def::c_variable (String s) const
 {
   return lookup_variable (ly_symbol2scm (s.to_str0 ()));
 }
 
 void
-Music_output_def::set_variable (SCM sym, SCM val)
+Output_def::set_variable (SCM sym, SCM val)
 {
   scm_module_define (scope_, sym, val);
 }
 
-LY_DEFINE (ly_paper_lookup, "ly:paper-lookup",
-          2, 0,0, (SCM pap, SCM sym),
+LY_DEFINE (ly_paper_lookup, "ly:output-def-lookup",
+          2, 0, 0, (SCM pap, SCM sym),
           "Lookup @var{sym} in @var{pap}. "
           "Return the value or @code{'()} if undefined.")
 {
-  Music_output_def *op = unsmob_music_output_def (pap);
-  SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Paper");
+  Output_def *op = unsmob_output_def (pap);
+  SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
   SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
-  SCM var = ly_module_lookup (op->scope_, sym);
-  if (SCM_VARIABLEP (var))
-    return SCM_VARIABLE_REF (var);
-  else
-    return SCM_EOL;
+  return op->lookup_variable (sym);
 }
 
 LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
           1, 0,0, (SCM def),
           "Get the variable scope inside @var{def}.")
 {
-  Music_output_def *op = unsmob_music_output_def (def);
+  Output_def *op = unsmob_output_def (def);
   SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
   return op->scope_;
 }
 
+
+LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
+          1, 0, 0, (SCM def),
+          "Get the parent output-def of @var{def}.")
+{
+  Output_def *op = unsmob_output_def (def);
+  SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
+  return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
+}
+
+
 LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
           1, 0, 0, (SCM def),
           "Clone @var{def}.")
 {
-  Music_output_def *op = unsmob_music_output_def (def);
+  Output_def *op = unsmob_output_def (def);
   SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
   SCM s = op->clone ()->self_scm ();
   scm_gc_unprotect_object (s);
@@ -168,7 +185,7 @@ LY_DEFINE(ly_output_description, "ly:output-description",
          (SCM output_def),
          "Return the description of translators in @var{output-def}.")
 {
-  Music_output_def *id = unsmob_music_output_def (output_def);
+  Output_def *id = unsmob_output_def (output_def);
   
   SCM al =ly_module_to_alist (id->scope_);
 
@@ -187,3 +204,23 @@ LY_DEFINE(ly_output_description, "ly:output-description",
 }
   
 
+
+#include "interval.hh"
+
+/* FIXME.  This is broken until we have a generic way of
+   putting lists inside the \paper block.  */
+Interval
+line_dimensions_int (Output_def *def, int n)
+{
+  Real lw =  def->get_dimension (ly_symbol2scm ("linewidth"));
+  Real ind = n ? 0.0 : def->get_dimension (ly_symbol2scm ("indent"));
+
+  return Interval (ind, lw);
+}
+
+LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
+          1, 0, 0, (SCM def),
+          "Is @var{def} a paper definition?")
+{
+  return ly_bool2scm (unsmob_output_def (def));
+}
index 88661b346dcd4512b3a91314c54df3563a919291..8d9fcb93deeebc4ac12fbdf60771c6a1add66bfd 100644 (file)
@@ -178,17 +178,26 @@ My_lily_lexer::start_main_input ()
 void
 My_lily_lexer::set_identifier (SCM name, SCM s)
 {
-  assert (ly_c_string_p (name));
+  SCM sym = name;
+  if (ly_c_string_p (name))
+    sym =  scm_string_to_symbol (name);
   
-  if (lookup_keyword (ly_scm2string (name)) >= 0)
+  if (ly_c_symbol_p (sym))
     {
-      warning (_f ("Identifier name is a keyword: `%s'", SCM_STRING_CHARS (name)));
-    }
+      if (lookup_keyword (ly_symbol2string (sym)) >= 0)
+       {
+         warning (_f ("Identifier name is a keyword: `%s'", SCM_SYMBOL_CHARS (sym)));
+       }
 
-  SCM sym = scm_string_to_symbol (name);
-  SCM mod = ly_car (scopes_);
+      SCM mod = ly_car (scopes_);
 
-  scm_module_define (mod, sym, s);
+      scm_module_define (mod, sym, s);
+    }
+  
+  else
+    {
+      programming_error ("Identifier is not a symbol.");
+    }
 }
 
 My_lily_lexer::~My_lily_lexer ()
index 018d4b0e8ab0d69ea2e9920c6c60c1697dbacd8a..c6bdec50c3313a860905b2de90909ad61488752e 100644 (file)
@@ -17,7 +17,7 @@
 #include "main.hh"
 #include "my-lily-lexer.hh"
 #include "my-lily-parser.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "parray.hh"
 #include "parser.hh"
 #include "scm-hash.hh"
@@ -371,21 +371,37 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
   return SCM_UNSPECIFIED;
 }
 
-Music_output_def*
+Output_def*
 get_paper (My_lily_parser *parser)
 {
   SCM id = parser->lexer_->lookup_identifier ("$defaultpaper");
-  Music_output_def *paper = unsmob_music_output_def (id);
-  return paper ? paper->clone () : new Paper_def;
+  Output_def *paper = unsmob_output_def (id);
+  paper = paper ? paper->clone () : new Output_def;
+  paper->set_variable (ly_symbol2scm ("is-paper"), SCM_BOOL_T);
+  return paper;
 }
 
 
-Book_paper_def*
+Output_def*
+get_midi (My_lily_parser *parser)
+{
+  SCM id = parser->lexer_->lookup_identifier ("$defaultmidi");
+  Output_def *paper = unsmob_output_def (id);
+  paper = paper ? paper->clone () : new Output_def;
+  paper->set_variable (ly_symbol2scm ("is-midi"), SCM_BOOL_T);
+  return paper;
+}
+
+
+Book_output_def*
 get_bookpaper (My_lily_parser *parser)
 {
   SCM id = parser->lexer_->lookup_identifier ("$defaultbookpaper");
-  Book_paper_def *paper = unsmob_book_paper_def (id);
-  return paper->clone ();
+  Book_output_def *paper = unsmob_book_output_def (id);
+
+  paper = paper ? dynamic_cast<Book_output_def*> (paper->clone ()) : new Book_output_def;
+  paper->set_variable (ly_symbol2scm ("is-bookpaper"), SCM_BOOL_T);
+  return paper;
 }
 
 
@@ -421,7 +437,7 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
 
   if (score->defs_.is_empty ())
     {
-      Music_output_def *paper = get_paper (parser);
+      Output_def *paper = get_paper (parser);
       default_rendering (score->music_, paper->self_scm (),
                         get_bookpaper (parser)->self_scm (),
                         header, os);
@@ -437,7 +453,7 @@ LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
 {
   My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   Book *book = unsmob_book (book_smob);
-  Book_paper_def *bp = unsmob_book_paper_def (parser->lexer_->lookup_identifier ("$defaultbookpaper"));
+  Book_output_def *bp = unsmob_book_output_def (parser->lexer_->lookup_identifier ("$defaultbookpaper"));
   
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "Lilypond parser");
   SCM_ASSERT_TYPE (book, book_smob, SCM_ARG2, __FUNCTION__, "Book");
@@ -451,7 +467,7 @@ LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
   if (*c)
     outname.base_ += "-" + to_string (*c);
   (*c)++;
-  Music_output_def *paper = get_paper (parser);
+  Output_def *paper = get_paper (parser);
   book->process (outname.to_string (), paper, header);
   scm_gc_unprotect_object (paper->self_scm ());
   return SCM_UNDEFINED;
index 2d7c595cf1b9caeb1de6d9c71b64bd22731e0250..ee3f53c8883fa9f72fe0cc63ac5360057e5b3ea1 100644 (file)
@@ -13,7 +13,7 @@
 #include "note-column.hh"
 #include "note-head.hh"
 #include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "axis-group-interface.hh"
 #include "item.hh"
 #include "stem.hh"
index 2edd77425740ca3148aa9a7e871ede12d324e781..75117699b422f16d6ccad086c2e15d8f7fc05485 100644 (file)
@@ -11,7 +11,7 @@
 #include "note-column.hh"
 #include "stem.hh"
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "rest.hh"
index 39f57e848c82c48d7b65154359d5c42ba90067f9..dfe20fbf5262266d1420b7e7b14ae9c92ef5bdad 100644 (file)
@@ -19,7 +19,7 @@
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 /*
   Note_head contains the code for printing note heads.
index 12398fc0689f8bdb291543a6c06f8b1031fdd915..7898b85ec39407dfe06f64f7af8f093214fc2edc 100644 (file)
@@ -6,7 +6,7 @@
 #include <ctype.h>
 
 #include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "event.hh"
 #include "dots.hh"
 #include "dot-column.hh"
index a3b94a5749595d3686296e2d9e6dd76dc921e02b..3a9d904e288265516f0c07e070c1c5c653e03efc 100644 (file)
@@ -18,7 +18,7 @@
 #include "separation-item.hh"
 #include "staff-spacing.hh"
 #include "accidental-placement.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 
 /*
index c877f2ce59b118f5361774d05afc04a44bc0d709..8f86a03eff62b9ffb5cbf0c3e6d1c6f99e5cecbb 100644 (file)
@@ -14,7 +14,7 @@
 #include "spanner.hh"
 #include "font-interface.hh"
 #include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 #include "paper-column.hh"
 #include "staff-symbol-referencer.hh"
@@ -49,7 +49,7 @@ Ottava_bracket::print (SCM smob)
   Interval span_points;
   
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
-  Paper_def * paper = me->get_paper ();
+  Output_def * paper = me->get_paper ();
 
   
   Drul_array<bool> broken;
index 3eeba7a5d94f344fea88ed1e06e4a6ffa44f0d8e..104f0052f960bd524ccc7788c277310cc56831f3 100644 (file)
@@ -9,7 +9,7 @@
 #include "dimensions.hh"
 #include "ly-module.hh"
 #include "page.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-outputter.hh"
 #include "paper-line.hh"
 #include "stencil.hh"
 int Page::page_count_ = 0;
 Real Page::MIN_COVERAGE_ = 0.66;
 
-Book_paper_def *
+Book_output_def *
 Page::bookpaper () const
 {
-  return paper_->bookpaper_;
+  return dynamic_cast<Book_output_def*> ( paper_->parent_);
 }
 
-Page::Page (Paper_def *paper, int number)
+Page::Page (Output_def *paper, int number)
 {
   copyright_ = SCM_EOL;
   footer_ = SCM_EOL;
index c4cc819c96c8fcde7eb0b32cb1a69ada330385ec..b95b614c3edd34d31ed159ef14978e4eea9d5b64 100644 (file)
@@ -10,7 +10,7 @@
 #include "main.hh"
 #include "page.hh"
 #include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-outputter.hh"
 #include "paper-line.hh"
 #include "paper-score.hh"
@@ -90,10 +90,11 @@ Paper_book::output (String outname)
   /* Generate all stencils to trigger font loads.  */
   SCM pages = this->pages ();
 
-  Paper_def *paper = score_lines_[0].paper_;
-  Paper_outputter *out = paper->get_paper_outputter (outname);
+  Output_def *paper = score_lines_[0].paper_;
+  Paper_outputter *out = get_paper_outputter (outname);
   int page_count = scm_ilength (pages);
-  out->output_header (paper->bookpaper_, scopes (0), page_count, false);
+
+  out->output_header (paper->parent_, scopes (0), page_count, false);
 
   for (SCM s = pages; s != SCM_EOL; s = ly_cdr (s))
     {
@@ -144,9 +145,13 @@ void
 Paper_book::classic_output (String outname)
 {
   int count = score_lines_.size ();
-  Paper_def * p = score_lines_.top ().paper_;
-  Paper_outputter *out = p->get_paper_outputter (outname);
-  out->output_header (p->bookpaper_, scopes (count - 1), 0, true);
+  Paper_outputter *out = get_paper_outputter (outname);
+
+  Output_def * p = score_lines_.top ().paper_;
+  while (p && p->parent_)
+    p = p->parent_;
+  
+  out->output_header (p, scopes (count - 1), 0, true);
 
   SCM top_lines = score_lines_.top ().lines_;
   Paper_line *first = unsmob_paper_line (scm_vector_ref (top_lines,
@@ -195,7 +200,7 @@ Paper_book::init ()
        }
     }
 
-  Paper_def *paper = score_lines_[0].paper_;
+  Output_def *paper = score_lines_[0].paper_;
   SCM scopes = this->scopes (0);
 
   SCM make_tagline = paper->c_variable ("make-tagline");
@@ -238,7 +243,7 @@ Paper_book::pages ()
 {
   init ();
   Page::page_count_ = 0;
-  Paper_def *paper = score_lines_[0].paper_;
+  Output_def *paper = score_lines_[0].paper_;
   Page *page = new Page (paper, 1);
 
   Real text_height = page->text_height ();
index 0c06555920f08ca8b2c9971e017a2248befdbbe9..6f52171db191e6e1e6bea095da00d7329f874aa1 100644 (file)
@@ -16,7 +16,7 @@
 #include "text-item.hh"
 #include "lookup.hh"
 #include "font-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 
 
index 388235ab7d9f858042832daa4d0319ffd2aa6572..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,89 +0,0 @@
-/*
-  paper-def.cc -- implement Paper_def
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#include <math.h>
-
-#include "book-paper-def.hh"
-#include "virtual-font-metric.hh"
-#include "all-font-metrics.hh"
-#include "string.hh"
-#include "misc.hh"
-#include "paper-def.hh"
-#include "warn.hh"
-#include "scaled-font-metric.hh"
-#include "main.hh"
-#include "scm-hash.hh"
-#include "paper-outputter.hh"
-#include "ly-module.hh"
-
-/*
-  This is an almost empty thing. The only substantial thing this class
-  handles is scaling up and down to real-world dimensions (internally
-  dimensions are against global staff-space.)
- */
-
-Paper_def::Paper_def ()
-{
-  bookpaper_ = 0;
-}
-
-Paper_def::Paper_def (Paper_def const&src)
-  : Music_output_def (src)
-{
-  /* Do not remove this statement, scm_make_hash_table may trigger GC.  */
-  bookpaper_ = 0;
-}
-
-Paper_def::~Paper_def ()
-{
-}
-
-Real
-Paper_def::get_dimension (SCM s) const
-{
-  SCM val = lookup_variable (s);
-  return ly_scm2double (val);
-}
-
-/* FIXME.  This is broken until we have a generic way of
-   putting lists inside the \paper block.  */
-Interval
-Paper_def::line_dimensions_int (int n) const
-{
-  Real lw =  get_dimension (ly_symbol2scm ("linewidth"));
-  Real ind = n? 0.0:get_dimension (ly_symbol2scm ("indent"));
-
-  return Interval (ind, lw);
-}
-
-Paper_outputter*
-Paper_def::get_paper_outputter (String outname) const
-{
-  progress_indication (_f ("paper output to `%s'...",
-                          outname == "-" ? String ("<stdout>") : outname));
-  return new Paper_outputter (outname);
-
-}
-
-Paper_def* 
-unsmob_paper (SCM x)
-{
-  return dynamic_cast<Paper_def*> (unsmob_music_output_def (x));
-}
-  
-
-LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
-          1, 0, 0, (SCM def),
-          "Is @var{def} a paper definition?")
-{
-  Paper_def *op = dynamic_cast<Paper_def*> (unsmob_music_output_def (def));
-
-  bool pap = op;
-  return ly_bool2scm (pap);
-}
index 318784259e4e49695e0bdf63acf6bec74e749ae9..310ce238303f2ebea3716dca2622766ef4e5ab61 100644 (file)
@@ -21,7 +21,7 @@
 #include "main.hh"
 #include "page.hh"
 #include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-line.hh"
 #include "paper-outputter.hh"
 #include "file-name.hh"
@@ -56,7 +56,7 @@ Paper_outputter::output_scheme (SCM scm)
 }
 
 void
-Paper_outputter::output_metadata (Book_paper_def *paper, SCM scopes)
+Paper_outputter::output_metadata (Output_def *paper, SCM scopes)
 {
   SCM fields = SCM_EOL;
   for (int i = dump_header_fieldnames_global.size (); i--; )
@@ -76,8 +76,7 @@ Paper_outputter::output_metadata (Book_paper_def *paper, SCM scopes)
 }
 
 void
-Paper_outputter::output_header (Book_paper_def * bookpaper,
-                               
+Paper_outputter::output_header (Output_def * bookpaper,
                                SCM scopes,
                                int page_count,
                                bool is_classic)
@@ -146,7 +145,7 @@ Paper_outputter::output_page (Page *p, bool is_last)
 }
 
 void
-Paper_outputter::output_music_output_def (Music_output_def *odef)
+Paper_outputter::output_music_output_def (Output_def *odef)
 {
   output_scheme (scm_list_2 (ly_symbol2scm ("output-paper-def"),
                              odef->self_scm ()));
@@ -168,3 +167,11 @@ Paper_outputter::output_stencil (Stencil stil)
                          (void*) this, Offset (0,0));
 }
 
+Paper_outputter*
+get_paper_outputter (String outname) 
+{
+  progress_indication (_f ("paper output to `%s'...",
+                          outname == "-" ? String ("<stdout>") : outname));
+  return new Paper_outputter (outname);
+
+}
index 430cd52c57fefa94bbd873fbe1688bf6493f5ddd..9d4024b18a4c73c2dc4912366dd62cc9316f3478 100644 (file)
@@ -11,7 +11,7 @@
 #include "warn.hh"
 #include "font-metric.hh"
 #include "spanner.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "system.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
index 3820640b2deee8cdc33440717fcb5d0041a84902..915449be0f10de07b2a4d89838debcb664762806 100644 (file)
@@ -37,14 +37,13 @@ TODO:
 #include "lilypond-input-version.hh"
 #include "ly-module.hh"
 #include "main.hh"
-#include "midi-def.hh"
 #include "misc.hh"
 #include "music-list.hh"
 #include "music-sequence.hh"
 #include "my-lily-lexer.hh"
 #include "my-lily-parser.hh"
 #include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "scm-hash.hh"
 #include "scm-option.hh"
 #include "score.hh"
@@ -194,8 +193,8 @@ of the parse stack onto the heap. */
 
 %union {
        Book *book;
-       Book_paper_def *bookpaper;
-       Music_output_def *outputdef;
+       Book_output_def *bookpaper;
+       Output_def *outputdef;
        SCM scm;
        String *string;
        Music *music;
@@ -474,15 +473,18 @@ toplevel_expression:
        }
        | output_def {
                SCM id = SCM_EOL;
-               if (dynamic_cast<Paper_def*> ($1))
-                       id = scm_makfrom0str ("$defaultpaper");
-               else if (dynamic_cast<Midi_def*> ($1))
-                       id = scm_makfrom0str ("$defaultmidi");
+               if ($1->c_variable ("is-paper") == SCM_BOOL_T)
+                       id = ly_symbol2scm ("$defaultpaper");
+               else if ($1->c_variable ("is-midi") == SCM_BOOL_T)
+                       id = ly_symbol2scm ("$defaultmidi");
+               else if ($1->c_variable ("is-book-paper") == SCM_BOOL_T)
+                       id = ly_symbol2scm ("$defaultbookpaper");
+
                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 ());
+               THIS->lexer_->set_identifier (ly_symbol2scm ("$defaultbookpaper"), $1->self_scm ());
                scm_gc_unprotect_object ($1->self_scm ());
        }
        ;
@@ -622,7 +624,7 @@ book_paper_block:
        ;
 book_paper_head:
        BOOKPAPER '{' {
-               $$ = unsmob_book_paper_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ();
+               $$ = get_bookpaper (THIS);
                THIS->lexer_->add_scope ($$->scope_);
        }
        ;
@@ -651,7 +653,7 @@ book_body:
        {
                $$ = new Book;
                $$->set_spot (THIS->here_input ());
-               $$->bookpaper_ = unsmob_book_paper_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ();
+               $$->bookpaper_ = dynamic_cast<Book_output_def*> (unsmob_book_output_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ());
                scm_gc_unprotect_object ($$->bookpaper_->self_scm ());
        }
        | book_body book_paper_block {
@@ -735,25 +737,13 @@ output_def:
 
 music_output_def_head:
        MIDI    {
-               Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi"));
-
-
-               Midi_def *p = 0;
-               if (id)
-                       p = dynamic_cast<Midi_def*> (id->clone ());
-               else
-                       p = new Midi_def;
-
+               Output_def *p = get_midi (THIS);
                $$ = p;
                THIS->lexer_->add_scope (p->scope_);
        }
        | PAPER         {
-               Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
-                 Paper_def *p = 0;
-               if (id)
-                       p = dynamic_cast<Paper_def*> (id->clone ());
-               else
-                       p = new Paper_def;
+               Output_def* p = get_paper (THIS);
+
 
                THIS->lexer_->add_scope (p->scope_);
                $$ = p;
@@ -769,7 +759,7 @@ music_output_def_body:
        }
        | music_output_def_head '{' MUSIC_OUTPUT_DEF_IDENTIFIER         {
                scm_gc_unprotect_object ($1->self_scm ());
-               Music_output_def *o = unsmob_music_output_def ($3);
+               Output_def *o = unsmob_output_def ($3);
                o->input_origin_.set_spot (THIS->here_input ());
                $$ = o;
                THIS->lexer_->remove_scope ();
@@ -780,18 +770,16 @@ music_output_def_body:
 
        }
        | music_output_def_body context_def_spec_block  {
-               $$->assign_context_def ($2);
+               assign_context_def ($$, $2);
        }
        | music_output_def_body tempo_event  {
                /*
                        junk this ? there already is tempo stuff in
                        music.
                */
-               int m = ly_scm2int ( $2->get_property ("metronome-count"));
+               int m = ly_scm2int ($2->get_property ("metronome-count"));
                Duration *d = unsmob_duration ($2->get_property ("tempo-unit"));
-               Midi_def *md = dynamic_cast<Midi_def*> ($$);
-               if (md)
-                       md->set_tempo (d->get_length (), m);
+               set_tempo ($$, d->get_length (), m);
                scm_gc_unprotect_object ($2->self_scm ());
        }
        | music_output_def_body error {
@@ -2478,7 +2466,7 @@ markup:
                Book *book = new Book;
                book->scores_.push (score);
                        
-               Music_output_def *paper = get_paper (THIS);
+               Output_def *paper = get_paper (THIS);
                book->bookpaper_ = get_bookpaper (THIS);
 
                SCM s = book->to_stencil (paper, THIS->header_);
@@ -2583,8 +2571,8 @@ My_lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
        } else if (unsmob_duration (sid)) {
                *destination = unsmob_duration (sid)->smobbed_copy ();
                return DURATION_IDENTIFIER;
-       } else if (unsmob_music_output_def (sid)) {
-               Music_output_def *p = unsmob_music_output_def (sid);
+       } else if (unsmob_output_def (sid)) {
+               Output_def *p = unsmob_output_def (sid);
                p = p->clone ();
 
                *destination = p->self_scm ();
index 5bb074307f11865035660b997fc550ef857dccb4..379e024793d9f112d0b20e84c1acf9ab5f024113 100644 (file)
@@ -14,7 +14,6 @@
 #include "file-name.hh"
 #include "lily-version.hh"
 #include "main.hh"
-#include "midi-def.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
 #include "performance.hh"
index 9f0aeef0cb288098465089249397f0ddeceffbc5..83354c3a50541462b02e2145061699bbeef55e84 100644 (file)
@@ -13,7 +13,7 @@
 #include "note-column.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "rest.hh"
 #include "group-interface.hh"
 #include "staff-symbol-referencer.hh"
index fc1f7e278276d556f809399bc5ea977f6c547fe1..63b8e55d54745b49e16565a2f2a44727ca7b8cbb 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 #include "rest.hh"
 #include "dots.hh"
index 27c7d520384cb956de17b6c92eb4ff8fa382af00..9321423219f981385853e2d338b1f9db502e6b3a 100644 (file)
@@ -15,7 +15,7 @@
 #include "score-engraver.hh"
 #include "paper-score.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "axis-group-interface.hh"
 #include "context-def.hh"
 #include "staff-spacing.hh"
@@ -105,7 +105,7 @@ Score_engraver::initialize ()
    
 
   pscore_ = new Paper_score;
-  pscore_->paper_ = dynamic_cast<Paper_def*> (get_output_def ());
+  pscore_->paper_ = dynamic_cast<Output_def*> (get_output_def ());
 
   SCM props = updated_grob_properties (context (), ly_symbol2scm ("System"));
 
index f1aa57691796cb2b9321efbd9b0c96ed6aff2d36..4d231ff63a34fe2a72e2a82d32261a94f88a9cb3 100644 (file)
@@ -7,7 +7,6 @@
  */
 
 #include "score-performer.hh"
-#include "midi-def.hh"
 #include "audio-column.hh"
 #include "audio-item.hh"
 #include "performance.hh"
@@ -15,6 +14,7 @@
 #include "string-convert.hh"
 #include "warn.hh"
 #include "context-def.hh"
+#include "output-def.hh"
 
 
 
@@ -78,7 +78,7 @@ Score_performer::one_time_step ()
 int
 Score_performer::get_tempo () const
 {
-  return performance_->midi_->get_tempo (Moment (Rational (1, 4)));
+  return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
 }
 
 
@@ -94,7 +94,7 @@ void
 Score_performer::initialize ()
 {
   performance_ = new Performance;
-  performance_->midi_ = dynamic_cast<Midi_def*> (get_output_def ());
+  performance_->midi_ = get_output_def ();
 
   Translator_group::initialize ();
 }
index 58f4e97e394120b44f1c604680714bc74167924d..aa66207b9dae9f7d2335ea67a591e4b493fbd329 100644 (file)
 #include "ly-smobs.icc"
 #include "main.hh"
 #include "music-iterator.hh"
-#include "music-output-def.hh"
+#include "output-def.hh"
 #include "music-output.hh"
 #include "music.hh"
 #include "paper-book.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-score.hh"
 #include "scm-hash.hh"
 #include "score.hh"
@@ -99,7 +99,7 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
           "and @var{mus} is interpreted with it.  "
           "The context is returned in its final state.")
 {
-  Music_output_def *odef = unsmob_music_output_def (output_def);
+  Output_def *odef = unsmob_output_def (output_def);
   Music *music = unsmob_music (mus);
 
   SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
@@ -160,10 +160,10 @@ default_rendering (SCM music, SCM outdef,
                   SCM book_outputdef,
                   SCM header, SCM outname)
 {
-  Book_paper_def *bpd = unsmob_book_paper_def (book_outputdef);
-  if (bpd && unsmob_paper (outdef))
+  Book_output_def *bpd = unsmob_book_output_def (book_outputdef);
+  if (bpd && unsmob_output_def (outdef))
     /* FIXME:  memory leak */
-    outdef = bpd->scale_paper (unsmob_paper (outdef))->self_scm ();
+    outdef = bpd->scale_paper (unsmob_output_def (outdef))->self_scm ();
   
   SCM context = ly_run_translator (music, outdef);
 
@@ -193,22 +193,22 @@ default_rendering (SCM music, SCM outdef,
  
 SCM
 Score::book_rendering (String outname,
-                      Book_paper_def* paperbook,
-                      Music_output_def *default_def,
-                      Paper_def **paper)
+                      Book_output_def* paperbook,
+                      Output_def *default_def,
+                      Output_def **paper)
 {
   SCM out = scm_makfrom0str (outname.to_str0 ());
   SCM systems = SCM_EOL;
   int outdef_count = defs_.size ();
   for (int i = 0; !i || i < outdef_count; i++)
     {
-      Music_output_def *def = outdef_count ? defs_[i] : default_def;
-      if (Paper_def * pd = dynamic_cast<Paper_def*> (def))
+      Output_def *def = outdef_count ? defs_[i] : default_def;
+      if (Output_def * pd = dynamic_cast<Output_def*> (def))
        {
          def = paperbook->scale_paper (pd);
        }
       
-      if (!(no_paper_global_b && dynamic_cast<Paper_def*> (def)))
+      if (!(no_paper_global_b && dynamic_cast<Output_def*> (def)))
        {
          SCM context = ly_run_translator (music_, def->self_scm ());
          if (Global_context *g = dynamic_cast<Global_context*>
index d314e976a899ea4428f93752d074afe48890b75f..910c240a6aa221f9448d84ef9ef2ab92033bb16b 100644 (file)
@@ -12,7 +12,7 @@
 #include "script.hh"
 #include "font-interface.hh"
 #include "side-position-interface.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "item.hh"
 #include "stencil.hh"
 #include "lookup.hh"
index 0ca1a16471a3d679943b223c6057c88aeea07458..250fcade9265f4a65f70f659cdf4a21e222be72c 100644 (file)
@@ -10,7 +10,7 @@
 #include "separating-group-spanner.hh"
 #include "separation-item.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "dimensions.hh"
 #include "group-interface.hh"
 
index 5b7054f1ee8302e43f9f73262a246d0ae1f9745a..acaf1920b4c64c22beb22938fd58abf717661ee9 100644 (file)
@@ -10,7 +10,7 @@
 #include "separating-group-spanner.hh"
 #include "separation-item.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "engraver.hh"
 #include "axis-group-interface.hh"
 #include "note-spacing.hh"
index 45d599399efa5d9c285d6cb2db532c16a340d5bf..380435befb828e7ac3ec7292b680a80f2b9feafb 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "slur-bezier-bow.hh"
 
 Slur_bezier_bow::Slur_bezier_bow (Array<Offset> encompass, Direction dir,
index 3759cc75d50ba8bac67ccd82b1bed4542a8f9eae..0363945cc408a3658919dd05423a52cdc2358a7f 100644 (file)
@@ -25,7 +25,7 @@
 #include "group-interface.hh"
 #include "slur.hh"
 #include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "note-column.hh"
 #include "stem.hh"
 #include "paper-column.hh"
index deedd461a675e4a5504e875445cffd4b364a9ae7..bdb3212023149bddb52cc8f7fe67df44eaba2c4c 100644 (file)
@@ -13,7 +13,7 @@
 #include "main.hh"
 #include "system.hh"
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-score.hh"
 #include "paper-column.hh"
 #include "item.hh"
index b54e4a74d5173470fc2626ed48db7d2c681c8358..b49bde8aa3b06ad78496d4e3371646559aefe331 100644 (file)
@@ -9,7 +9,7 @@
 #include "span-bar.hh"
 #include "font-interface.hh"
 #include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "stencil.hh"
 #include "warn.hh"
 #include "axis-group-interface.hh"
index 49be8930e320d446679117374f1e8282b492368f..fe813adc0a3209effd8c2dee75079f3d5c54d6ae 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "score.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "side-position-interface.hh"
 #include "engraver.hh"
 #include "moment.hh"
index 354c402f792be242cf8d248b726b7fd359bf8f68..160576caae4364f5cde613242a8355e70183ef9c 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "staff-symbol-referencer.hh"
 #include "staff-symbol.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "libc-extension.hh"
 
 
index 46de29351095ff9f5bfd78be9b1d43d277838763..695ebb201c54a9ed893fd831910a79b5af65d874 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "lookup.hh"
 #include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "stencil.hh"
 #include "warn.hh"
 #include "item.hh"
index 7f08717622f6cf62447b875f29a60002ccb2aeb7..1ac44ca61ef02be7f142b2a08a0cfd17eaaf9aab 100644 (file)
@@ -11,7 +11,7 @@
 #include "directional-element-interface.hh"
 #include "item.hh"
 #include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "staff-symbol-referencer.hh"
 #include "stem-tremolo.hh"
 #include "stem.hh"
index 437a316f701858312fc6f05b81e85c0eda319dc4..e359efb9ebe5e3b8261580fecf18732a41fe4a22 100644 (file)
@@ -20,7 +20,7 @@
 #include "note-head.hh"
 #include "stem.hh"
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "rhythmic-head.hh"
 #include "font-interface.hh"
 #include "stencil.hh"
index 81dd379dae6f2f4d4e84dfdf454b76cb7d572144..719a5ed17d0a8cb8c91097fa49c65af8cc173650 100644 (file)
@@ -12,7 +12,7 @@
 #include "staff-symbol.hh"
 #include "group-interface.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "spanner.hh"
 
 class System_start_delimiter_engraver : public Engraver
index 4dff002c815835fc1625a9f0e660aa73311de861..4977fa0ddce6ca27dc5ced3a3aefe75a04d1e5f4 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "axis-group-interface.hh"
 #include "system-start-delimiter.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "stencil.hh"
 #include "font-interface.hh"
 #include "all-font-metrics.hh"
index fed4dfd7921beee1e5cfee0ae47eed959578fa45..48f7034236bc3d26adb732d4eb5015d073cd6461 100644 (file)
@@ -13,7 +13,7 @@
 #include "system.hh"
 #include "main.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-outputter.hh"
 #include "paper-score.hh"
 #include "string.hh"
index af1450d692c21cb79702098ec449c843c33aedb7..e4caf6835b14949d4710600a96262c9100253bc8 100644 (file)
@@ -7,7 +7,7 @@
 #include <stdio.h>
 
 #include "rhythmic-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "event.hh"
 #include "dots.hh"
 #include "dot-column.hh"
index 782cd4d1c1457e2eeecea74e0ecf6cb69ed54e1b..b03027b965ea9304bdc755dc5468d2aa8eb539db 100644 (file)
 #include "text-item.hh"
 #include "font-interface.hh"
 #include "virtual-font-metric.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "scaled-font-metric.hh"
 
 MAKE_SCHEME_CALLBACK (Text_item, interpret_string, 4)
 SCM
 Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
 {
-  Paper_def *pap = unsmob_paper (paper);
+  Output_def *pap = unsmob_output_def (paper);
   
   SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "Paper definition");
   SCM_ASSERT_TYPE(ly_c_string_p (markup), markup, SCM_ARG3, __FUNCTION__, "string");
index 6f07666a6878b44afb79744a6cddc2fad3896ee3..b2254b14517cd4f331f5d42dc51038403cab48f2 100644 (file)
@@ -15,7 +15,7 @@
 #include "spanner.hh"
 #include "font-interface.hh"
 #include "dimensions.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "warn.hh"
 #include "paper-column.hh"
 #include "staff-symbol-referencer.hh"
@@ -42,7 +42,7 @@ Text_spanner::print (SCM smob)
   /* Ugh, must be same as Hairpin::print.  */
 
   Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
-  Paper_def * paper = me->get_paper ();
+  Output_def * paper = me->get_paper ();
 
   SCM flare = me->get_property ("bracket-flare");
   SCM shorten = me->get_property ("shorten-pair");
index 0ac50e5e852d6e3db21fe0df046fbb8c7cd7d83c..c13f97f3540f42d454f6036039e7bd2cbe772f28 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "spanner.hh"
 #include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "tie.hh"
 #include "rhythmic-head.hh"
 #include "bezier.hh"
index 7cb072fa00b4facd4f4239435fb17f651215e800..d6e3b16f3efdbbbbd6c43301dd77b4c3191bd802 100644 (file)
@@ -11,7 +11,7 @@
 #include "stencil.hh"
 #include "text-item.hh"
 #include "time-signature.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "font-interface.hh"
 #include "warn.hh"
 #include "staff-symbol-referencer.hh"
index 85e9d43b62d65e9371a9ab2fd42eafc205354cc3..803832378680cfa58531827860256972c4e7a4b7 100644 (file)
@@ -6,7 +6,7 @@
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "music-output-def.hh"
+#include "output-def.hh"
 #include "translator-group.hh"
 #include "translator.hh"
 #include "warn.hh"
index 62846fb3cd783120b48ed6ddc9ec658853a33467..485e22b29af528baf46dbb4b216f69deddfda2b9 100644 (file)
@@ -64,7 +64,7 @@ Translator::now_mom () const
   return daddy_context_->now_mom ();
 }
 
-Music_output_def *
+Output_def *
 Translator::get_output_def () const
 {
   return daddy_context_->get_output_def ();
index 2c87802a08d651d3c954b06cbb4f50bebca6268c..7a56f9c5d473fe06a603c5fc6573c7306a6c2f47 100644 (file)
@@ -31,7 +31,7 @@
 #include "warn.hh"
 #include "font-interface.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "text-item.hh"
 #include "tuplet-bracket.hh"
 #include "stem.hh"
@@ -168,7 +168,7 @@ Tuplet_bracket::print (SCM smob)
   
   SCM number = me->get_property ("text");
 
-  Paper_def *pap = me->get_paper ();
+  Output_def *pap = me->get_paper ();
   Stencil num;
  if (ly_c_string_p (number) && number_visibility)
     {
index b6d6e5b6b8ea0de363ab93552a6173d8b6784c1f..94cccf6f08bdfa9f983b1a62d0420a2091fda9c4 100644 (file)
@@ -14,7 +14,7 @@
 #include "staff-symbol-referencer.hh"
 #include "font-interface.hh"
 #include "warn.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "paper-column.hh"
 
 /*
index ea1d4d447e6c5b253a76d0633876f12aa277b8d7..2528586aa1c002ed5d866c6ac7cdeee5495060f9 100644 (file)
@@ -14,7 +14,7 @@
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 #include "note-head.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "bezier.hh"
 #include "warn.hh"
 
index 065a9a5436f1d29a6f390aedffc28eda976245b2..d63d8b74a00ec9e7540497ac60433bfe9741d065 100644 (file)
@@ -11,7 +11,7 @@ source file of the GNU LilyPond music typesetter
 #include "virtual-font-metric.hh"
 #include "all-font-metrics.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 
 /*
index 1309e98837255a1cdd9d07cbcf4f9dc3ca533d47..9f4d8a505f8d87c54e5f6449906dc031b1f0a094 100644 (file)
@@ -14,7 +14,7 @@
 #include "line-interface.hh"
 #include "stencil.hh"
 #include "paper-column.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "text-item.hh"
 #include "volta-bracket.hh"
 #include "group-interface.hh"
@@ -66,7 +66,7 @@ Volta_bracket_interface::print (SCM smob)
     (strcmp (cs,":|")!=0 && strcmp (cs,"|:")!=0 && strcmp (cs,"|.")!=0
      && strcmp (cs,":|:")!=0 && strcmp (cs,".|")!=0);
 
-  Paper_def * paper =me->get_paper ();
+  Output_def * paper =me->get_paper ();
   Real half_space = 0.5;
 
   Item * bound = dynamic_cast<Spanner*> (me)->get_bound (LEFT);
index bb344e921e920015fae23f6e2d59ad98de4f3011..6ba340e714bb2d9ed81ca97be5b0800a8348572a 100644 (file)
@@ -1,5 +1,7 @@
 \version "2.3.2"
+
 \bookpaper {
+#(define-public is-bookpaper #t)
     
 #(define-public (book-title paper scopes)
   "Generate book title from header strings."
index b710b6f82c408ebe5d5b91075afd263b97260aaa..6dfa049e5d9c1af38ba98ca8f6d050dce72f97bc 100644 (file)
@@ -91,7 +91,7 @@ melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
 %
 
 #(define-public $defaultbookpaper (ly:make-bookpaper 1.7573))
-  
+
 \include "book-paper-defaults.ly"
 
 #(set-default-paper-size "a4")
index 943cf4c39092a342fefaa1aab8c2867f96c5f97e..eba247bc61ef5673cbaf5e3494395a59d284de92 100644 (file)
@@ -42,7 +42,7 @@
           (paper (ly:grob-paper grob))
           (text (interpret-markup
                  paper
-                 (ly:grob-alist-chain grob (ly:paper-lookup paper 'text-font-defaults))
+                 (ly:grob-alist-chain grob (ly:output-def-lookup paper 'text-font-defaults))
                  letter)))
     
       (let ((x (/ (- (cdr (ly:stencil-extent slur 0)) 
index 4cc714fdecf34ac05ae58d18c255ebed76b10f1b..537b5f03308ad35b8de7ce024db7e51a75531fd3 100644 (file)
           (plain (font-command font #f))
           (designsize (ly:font-design-size font))
           (magnification (* (ly:font-magnification font)))
-          (ops (ly:paper-lookup paper 'outputscale))
+          (ops (ly:output-def-lookup paper 'outputscale))
           (scaling (* ops magnification designsize)))
 
       (string-append
    "%%Creator: " creator " " time-stamp "\n"
    "%%Pages: " (number->string page-count) "\n"
    "%%PageOrder: Ascend\n"
-   "%%DocumentPaperSizes: " (ly:paper-lookup paper 'papersize) "\n"
+   "%%DocumentPaperSizes: " (ly:output-def-lookup paper 'papersize) "\n"
    ;;(string-append "GNU LilyPond (" (lilypond-version) "), ")
    ;;     (strftime "%c" (localtime (current-time))))
    ;; FIXME: duplicated in every backend
index 5d22f14c00ab64e18a251d0bcdcc907687a16141..aa1f847dc04eabaf784cd228366a12b24af616b3 100644 (file)
@@ -8,7 +8,7 @@
 (define-public (page-properties paper)
   (list (append `((linewidth . ,(ly:paper-get-number
                                 paper 'linewidth)))
-               (ly:paper-lookup paper 'text-font-defaults))))
+               (ly:output-def-lookup paper 'text-font-defaults))))
 
 (define-public (plain-header paper page-number)
   (let ((props (page-properties paper) ))
index b6ab3761a5c1f828ed68f270c83a98598bd6f741..41fa80f54c63fb99166cfea1860d0ecd1291d7fe 100644 (file)
   (let*
       ((scale (ly:bookpaper-outputscale bookpap))
        (new-pap (ly:output-def-clone pap))
-       (dim-vars (ly:paper-lookup pap 'dimension-variables))
+       (dim-vars (ly:output-def-lookup pap 'dimension-variables))
        (scope (ly:output-def-scope new-pap)))
 
     (for-each
      (lambda (v)
        (module-define! scope v
-                      (/ (ly:paper-lookup pap v) scale)))
+                      (/ (ly:output-def-lookup pap v) scale)))
      
      dim-vars)
 
index ea9215c5d18023c3fe6f3660405cc526d219009d..bcd9a41fa4622c111bf4b60a32da80ac209c9893 100644 (file)
      ly:paper-line-number
      ly:paper-line-stencil
      ly:paper-line?
-     ly:paper-lookup
+     ly:output-def-lookup
      ly:parse-string
      ly:parser-parse-string
      ly:parser-print-book
index 22ffd43048e2b8a9e326be9dd0d4c1957e0804d3..83035a911af8490748abb87a6132c1543a0addc9 100644 (file)
@@ -2097,7 +2097,10 @@ def conv (str):
                else:
                        return m.group (0)
                
-       return re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
+       str = re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
+
+       str = re.sub ('ly:paper-lookup', 'ly:output-def-lookup', str)
+       return str
 
 conversions.append (((2, 3, 2), conv,
                     '''\\FooContext -> \\Foo'''))
index 73670333a42871a7c224c2a24963276d96531f44..1da2f27ff794586af7f38114d3a250c9f788c301 100644 (file)
@@ -204,7 +204,7 @@ ly_options = {
     indent = 0.0\mm''',
        NOTIME : r'''
     \context {
-        \StaffContext
+        \Staff
         \remove Time_signature_engraver
     }''',
        QUOTE : r'''