]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/paper-system.hh (class Paper_system): remove
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Sep 2005 10:50:17 +0000 (10:50 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Sep 2005 10:50:17 +0000 (10:50 +0000)
number_ variable. Remove is_title_. Remove break_before_penalty_

* lily/paper-book.cc (systems): use 'number property iso. number_
member.

* lily/paper-system-scheme.cc: remove ly:paper-system-break-before-penalty
remove ly:paper-system-number.

* scm/lily-library.scm (paper-system-title?): new function.

* scm/page-layout.scm (ly:optimal-page-breaks): read next-space
and next-padding.
(optimal-page-breaks): rename from ly:optimal-page-breaks.

* lily/paper-system-scheme.cc (LY_DEFINE): new function.

* lily/paper-system.cc (internal_get_property): new function.

* scm/page-layout.scm (ly:optimal-page-breaks): add support for
pagetopspace

* lily/paper-system.cc (read_left_bound): new function. Read
line-break-system-details from left bound to determine extents.

* python/convertrules.py (conv): rule

28 files changed:
ChangeLog
input/regression/apply-context.ly
input/regression/apply-output.ly
input/regression/balloon.ly
input/regression/cluster-cross-staff.ly
input/regression/cluster.ly
input/regression/generic-output-property.ly
input/regression/music-map.ly
input/regression/repeat-unfold-tremolo.ly
input/test/add-staccato.ly
input/test/add-text-script.ly
input/test/ancient-font.ly
input/test/bar-number-every-five-reset.ly
input/test/move-specific-text.ly
input/test/music-box.ly
input/test/reverse-music.ly
input/test/smart-transpose.ly
input/test/unfold-all-repeats.ly
lily/include/paper-system.hh
lily/paper-book.cc
lily/paper-system-scheme.cc
lily/paper-system.cc
lily/system.cc
python/convertrules.py
scm/framework-ps.scm
scm/lily-library.scm
scm/page-layout.scm
scm/safe-lily.scm

index 07c2ccdb479e58be2212b37a621dac242cf561c7..da4975e51706ede0131a126dac05d3c2f01db4e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2005-09-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/include/paper-system.hh (class Paper_system): remove
+       number_ variable. Remove is_title_. Remove break_before_penalty_
+
+       * lily/paper-book.cc (systems): use 'number property iso. number_
+       member.
+
+       * lily/paper-system-scheme.cc: remove ly:paper-system-break-before-penalty
+       remove ly:paper-system-number.
+
+       * scm/lily-library.scm (paper-system-title?): new function.
+
        * lily/book.cc (process): bugfix: flip ?: cases. 
 
        * Documentation/user/changing-defaults.itely (Difficult tweaks):
index 86c838d9994c11cc3c03f6a47e7bac699269c3aa..9eff3c001d57e3c31baceb9f33304e5dbbfd4136 100644 (file)
@@ -1,10 +1,10 @@
 
-\version "2.6.0"
+\version "2.7.10"
 
 
 \header {
 
-texidoc = "With @code{\\applycontext}, @code{\\properties} can be modified
+texidoc = "With @code{\\applyContext}, @code{\\properties} can be modified
 procedurally. Applications include: checking bar numbers, smart
 octavation.
 
@@ -22,7 +22,7 @@ This example prints a bar-number during processing on stdout.
 
   %% todo: should put something interesting in the .tex output.
   
-  \applycontext
+  \applyContext
   #(lambda (tr)
     (format #t "\nWe were called in barnumber ~a.\n"
      (ly:context-property tr 'currentBarNumber)))
index cf99e3dba589d393bbb8db4d03dc474be972c341..85829a0e889c93044e450bf0be382b473f83a450 100644 (file)
@@ -1,8 +1,8 @@
 
-\version "2.6.0" 
+\version "2.7.10" 
 \header {
 
-  texidoc = "The @code{\applyoutput} expression is the most flexible way to
+  texidoc = "The @code{\applyOutput} expression is the most flexible way to
 tune properties for individual grobs.
 
 Here, the layout of a note head is changed depending on its vertical
@@ -38,7 +38,7 @@ position.
   \stemUp
   \set autoBeaming =  ##f
   { <d f g b>8
-    \context Voice \applyoutput #mc-squared
+    \context Voice \applyOutput #mc-squared
 
     <d f g b>
   }
index f710b9bc5c7fab085a42e9a2182e5b812cc4ad3d..18e095445501aefb3c78d96eaf4837a1a4d1cf22 100644 (file)
@@ -3,7 +3,7 @@
   texidoc = "With balloon texts, objects in the output can be marked,
 with lines and explanatory text added."
 }
-\version "2.6.0"
+\version "2.7.10"
 
 \layout{ raggedright = ##t }
 
@@ -21,7 +21,7 @@ with lines and explanatory text added."
 
 
     %% use predefd function. 
-    \context Voice \applyoutput #(add-balloon-text
+    \context Voice \applyOutput #(add-balloon-text
                                  'NoteHead "heads, or tails?"
                                  '(0 . -3))
 
index ac491a4badf44e2cc5077cd87763ea3c3f7007c0..9a6adbb76bf749c2108a2bcce110c8cdada094be 100644 (file)
@@ -7,14 +7,14 @@
   raggedright= ##t
 }
 
-\version "2.6.0"
+\version "2.7.10"
 
 \new PianoStaff <<
   \context Staff = "up"     {
     s1 *2
   }
   \context Staff = "down" <<
-    \applymusic #notes-to-clusters \relative c  { <c e>4 <f a> <b e> \change Staff = up <e a>
+    \applyMusic #notes-to-clusters \relative c  { <c e>4 <f a> <b e> \change Staff = up <e a>
                                                  <a d> <d g> }
 
     { \clef bass s1 * 2 }
index 1926b3679355d991bfd2676914e76117c5510c4e..ef805b9f706e0d238bff916bc96dcae44076d6ee 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.10"
 \header {
   texidoc = "Clusters are a device to denote that a complete range of
 notes is to be played."
@@ -15,7 +15,7 @@ fragment = \relative c' {
 
 <<
   \new Staff \fragment
-  \new Staff \applymusic #notes-to-clusters \fragment
+  \new Staff \applyMusic #notes-to-clusters \fragment
 >>
 
 
index 353d8b88ed05e93b1f7477acbc38c7fb69e8dde4..5efd751c46e04edc7356ad8d8e12f000edfad7cd 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.10"
 
 \header{
   texidoc="
@@ -13,13 +13,13 @@ setting the @code{extra-offset} of a grob.
 
 \relative c''{
   \context Bottom
-  \applyoutput #(outputproperty-compatibility
+  \applyOutput #(outputproperty-compatibility
                 (make-type-checker 'note-head-interface)
                 'extra-offset '(2 . 3))
   c2
   c
   \context Score {
-    \applyoutput #(outputproperty-compatibility (make-type-checker 'mark-interface) 'extra-offset '(-1 . 4))
+    \applyOutput #(outputproperty-compatibility (make-type-checker 'mark-interface) 'extra-offset '(-1 . 4))
   }
   \mark A
   d1
index a3821d8a65060d5625007f07aa54c6d3a8066993..c381b74e0a01c54f9afa7dc41c3e051950faea94 100644 (file)
@@ -10,7 +10,7 @@ dynamics are left over. These are put onto the 2nd measure."
 
 }
 
-\version "2.6.0"
+\version "2.7.10"
 
 #(define (notes-to-skip m)
   "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips.
@@ -35,7 +35,7 @@ foobar =  \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^  }
 \relative c''  \context Voice {
   \foobar
 
-  << \applymusic #(lambda (x) (music-map notes-to-skip x))
+  << \applyMusic #(lambda (x) (music-map notes-to-skip x))
      \foobar
      { d2 d2 } >> 
 }
index cd5454e8ea5211a1b29cc2a63931b0bfa00755fa..b1e3d629def252cd1e658c41f6e5eb4051a0dac2 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 \header {
 
   texidoc = "Unfolding tremolo repeats. All fragments fill one
 
 {
   \time 2/4 
-  \applymusic #unfold-repeats  
+  \applyMusic #unfold-repeats  
   { \repeat tremolo 4 { c'16 e' } |
     \repeat tremolo 8 c'16 } |
 
   \time 3/4 
-  \applymusic #unfold-repeats  
+  \applyMusic #unfold-repeats  
   { \repeat tremolo 6 { c'16 e' } |
     \repeat tremolo 12 c'16 } | \bar "|."
   
index bd4b6dcaa4410881330c0819f7f953200061728d..841569a533ea2a48ca9bd7e25b56dc905bf7cc7e 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.10"
 
 \header {
 
@@ -27,7 +27,7 @@ it is not necessary to use scm constructs (see @code{separate-staccato.ly}).
 
 \score {
   \relative c'' {
-    a b \applymusic #(lambda (x) (music-map add-staccato x)) { c c } 
+    a b \applyMusic #(lambda (x) (music-map add-staccato x)) { c c } 
   }
   \layout{ raggedright = ##t }
 }
index 4d5f3a274942344f99304d623c37de4a78f2abb8..fe532957ae0855d644cb55ba25ff0382d8e9acc5 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 
 \header {
 texidoc= "@cindex make-music Fingering
@@ -28,7 +28,7 @@ create, then write a function that will structure the music for you.
    m)
 
 \score {
-  \applymusic #(lambda (x)  (add-text-script x "6") (display-music x) x )  { c'4-3 }
+  \applyMusic #(lambda (x)  (add-text-script x "6") (display-music x) x )  { c'4-3 }
        \layout{ raggedright = ##t }
 }
 
index e135a20c5d87ace900cc6d9209ed58498510596f..e5245d52c3f0c9be525731ddc3bdbb5c5c462128 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 % TODO: split ancient-font into seperate files; possibly in
 % different locations.
 \header {
@@ -117,7 +117,7 @@ lowerStaff = \context MensuralStaff = "lowerStaff" <<
     
     % this is broken until further notice -- see refman
     % \override Staff.StaffSymbol  #'line-count = #5
-    \context Staff \applyoutput #(outputproperty-compatibility (make-type-checker 'staff-symbol-interface) 'line-count 5)
+    \context Staff \applyOutput #(outputproperty-compatibility (make-type-checker 'staff-symbol-interface) 'line-count 5)
 
      \transpose c c {
        \set autoBeaming = ##f
index 5cbd25a27972ec9b89df6cd19199bf0300e4f802..9fbb860115262185f45b7d31dca6a9b1bcc14d4d 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 
 \header {
     texidoc = "@cindex Bar Number Every Fifth Reset
@@ -7,12 +7,12 @@ not starting from measure zero, you can use a context function,
 @code{set-bar-number-visibility}, to set automatically
 @code{barNumberVisibility}, so that the bar numbers appear at regular
 intervals, starting from the measure in which 
-@code{set-bar-number-visibility} is set using @code{\applycontext}.
+@code{set-bar-number-visibility} is set using @code{\applyContext}.
 "
 
 }
 
-resetBarnum = \context Score \applycontext
+resetBarnum = \context Score \applyContext
   #(set-bar-number-visibility 4)
 \score {
     <<
index c251f0a67270f807d2418843ba676726041cd77a..a82b6bdeee4e42810a02212dfeda246bce42d977 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.10"
 % possible rename to scheme- or something like that.  -gp
 \header { texidoc = "@cindex Scheme Move Text
 Objects, like text, can be moved around by using some Scheme code.
@@ -11,7 +11,7 @@ Objects, like text, can be moved around by using some Scheme code.
 \score {
   \relative c''' {
     \stemUp
-    \applyoutput #(outputproperty-compatibility (make-text-checker (make-simple-markup "m.d."))
+    \applyOutput #(outputproperty-compatibility (make-text-checker (make-simple-markup "m.d."))
       'extra-offset '(-3.5 . -4.5))
     a^2^"m.d."
   }
index d1924e9fb3a04f045602a8b030ff9634fc5d4aad..47b2cfdd183f78820f47232d9173b14b6688e44b 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 \include "deutsch.ly"
 % possible rename to scheme- something.  -gp
 % TODO: ask if it needs to have so many empty bars in the middle.  -gp
@@ -53,7 +53,7 @@ using Scheme functions to avoid typing work. " }
 
 
 
-\version "2.6.0"
+\version "2.7.10"
 
 pat =  \transpose c c' \repeat unfold 2 {
   << { \context Staff = "up" {r8 e16 f g e f g } }
@@ -75,7 +75,7 @@ endc =  {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
    \transpose c c' \context PianoStaff <<
        \context Staff = "up"   { \clef "G"  }
        \context Staff = "down" { \clef "F" }
-       { \applymusic #transform {
+       { \applyMusic #transform {
           \pat {c e g c' e' }
           \pat {c d a d' f' }
        }
index 6640823353ab1cbe422cf368b13ca4d948ab41d1..a0e31643bf6af896ca690662a3062763593f0aba 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.10"
 % possible rename to scheme-something.
 \header { texidoc="@cindex Scheme Reverse Music
 Symmetric, or palindromical music can be produced, first, by printing
@@ -33,7 +33,7 @@ music =  \relative c'' { c4 d4( e4 f4 }
 \score {
   \context Voice {
     \music
-    \applymusic #reverse-music \music
+    \applyMusic #reverse-music \music
   }
   \layout { raggedright = ##t}
 }
index c164d8fcbf09083e8a88067811a7d3f2193c3bc5..dec010bd84e64b55c3eb4d1376526432bf3cb9a6 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.10"
 
 \header {
 texidoc="@cindex Smart Transpose
@@ -69,9 +69,9 @@ music =  \relative c' { c4 d  e f g a b  c }
 \score {
    \context Staff {
     \transpose c ais \music
-    \applymusic #naturalise \transpose c ais \music
+    \applyMusic #naturalise \transpose c ais \music
     \transpose c deses \music
-    \applymusic #naturalise \transpose c deses \music
+    \applyMusic #naturalise \transpose c deses \music
   }
   \layout { raggedright = ##t}
 }
index cc7e831b13703b37ac70e81faf10995d11f3c354..153c930f17dd2900ef086f1d5aa354c36328f58d 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.10"
 
 \header { 
 texidoc = "Applying the standard function @code{unfold-repeats} unfolds 
@@ -18,7 +18,7 @@ mel =  \context Staff {
 
 \score {  {
   \mel \break
-  \applymusic #unfold-repeats \mel 
+  \applyMusic #unfold-repeats \mel 
  }
 }
 
index c2640e6548e16af4047d59087a912f539208c95d..e35077b9cb1d219dd25e329e60ef3bcf7953eb03 100644 (file)
@@ -21,18 +21,18 @@ class Paper_system
 {
   DECLARE_SMOBS (Paper_system,);
   Stencil stencil_;
-  bool is_title_;
-  SCM details_;
+  SCM mutable_property_alist_;
+  SCM immutable_property_alist_;
+
+  void init_vars ();
 public:
   Interval staff_refpoints_;
-  Real break_before_penalty_;
-  int number_;
 
-  Paper_system (Stencil, bool);
-  void read_left_bound (Item*);
+  Paper_system (Stencil, SCM);
   Stencil to_stencil () const;
   SCM stencils () const;
   SCM internal_get_property (SCM sym) const;
+  void internal_set_property (SCM sym, SCM val);
   bool is_title () const;
   Real break_before_penalty () const;
   Interval staff_refpoints () const;
index 2294a0aef80dd89a0235b7cbcb731d890f6834f2..fc4da3d89df256ca263f162427201ffbfee05990 100644 (file)
@@ -227,9 +227,10 @@ set_system_penalty (Paper_system *ps, SCM header)
       if (SCM_VARIABLEP (force)
          && scm_is_bool (SCM_VARIABLE_REF (force)))
        {
-         ps->break_before_penalty_ = to_boolean (SCM_VARIABLE_REF (force))
-           ? -10000
-           : 10000;
+         ps->set_property ("penalty",
+                           scm_from_int(to_boolean (SCM_VARIABLE_REF (force))
+                                        ? -10000
+                                        : 10000));
        }
     }
 }
@@ -242,7 +243,9 @@ Paper_book::add_score_title (SCM header)
     title = score_title (header_);
   if (!title.is_empty ())
     {
-      Paper_system *ps = new Paper_system (title, true);
+      //  TODO: init properties, from where? 
+      Paper_system *ps = new Paper_system (title, SCM_EOL);
+      ps->set_property ("is-title", SCM_BOOL_T); 
       systems_ = scm_cons (ps->self_scm (), systems_);
       ps->unprotect ();
       set_system_penalty (ps, header);
@@ -260,7 +263,8 @@ Paper_book::systems ()
 
   if (!title.is_empty ())
     {
-      Paper_system *ps = new Paper_system (title, true);
+      Paper_system *ps = new Paper_system (title, SCM_EOL);
+      ps->set_property ("is-title", SCM_BOOL_T); 
       set_system_penalty (ps, header_);
 
       systems_ = scm_cons (ps->self_scm (), systems_);
@@ -317,8 +321,10 @@ Paper_book::systems ()
          SCM t = Text_interface::interpret_markup (paper_->self_scm (),
                                                    page_properties,
                                                    scm_car (s));
-         // FIXME: title=true?
-         Paper_system *ps = new Paper_system (*unsmob_stencil (t), true);
+         
+         // TODO: init props
+         Paper_system *ps = new Paper_system (*unsmob_stencil (t), SCM_EOL);
+         ps->set_property ("is-title", SCM_BOOL_T); 
          systems_ = scm_cons (ps->self_scm (), systems_);
          ps->unprotect ();
          
@@ -336,12 +342,12 @@ Paper_book::systems ()
   for (SCM s = systems_; s != SCM_EOL; s = scm_cdr (s))
     {
       Paper_system *ps = unsmob_paper_system (scm_car (s));
-      ps->number_ = ++i;
+      ps->set_property ("number", scm_from_int (++i));
 
       if (last
-         && last->is_title ()
-         && !ps->break_before_penalty_)
-       ps->break_before_penalty_ = 10000;
+         && to_boolean (last->get_property ("is-title"))
+         && !scm_is_number (ps->get_property ("penalty")))
+       ps->set_property ("penalty", scm_from_int (10000));
       last = ps;
     }
 
index ee393e0eeb4b73d07ce983b10641ebfe7a736b4c..8f89313e5bc00fac55e4899b42851b2545da11e0 100644 (file)
@@ -19,33 +19,6 @@ LY_DEFINE (ly_paper_system_height, "ly:paper-system-extent",
   return ly_interval2scm (ps->to_stencil ().extent (ax));
 }
 
-LY_DEFINE (ly_paper_system_title_p, "ly:paper-system-title?",
-          1, 0, 0, (SCM system),
-          "Is  @var{system} a title system?")
-{
-  Paper_system *ps = unsmob_paper_system (system);
-  SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
-  return SCM_BOOL (ps->is_title ());
-}
-
-LY_DEFINE (ly_paper_system_number, "ly:paper-system-number",
-          1, 0, 0, (SCM system),
-          "Return the number of @var{system}.")
-{
-  Paper_system *ps = unsmob_paper_system (system);
-  SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
-  return scm_from_int (ps->number_);
-}
-
-LY_DEFINE (ly_paper_system_break_before_penalty, "ly:paper-system-break-before-penalty",
-          1, 0, 0, (SCM system),
-          "Return the score for page break after @var{system}.")
-{
-  Paper_system *ps = unsmob_paper_system (system);
-  SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
-  return scm_from_int (int (ps->break_before_penalty ()));
-}
-
 LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
           1, 0, 0, (SCM system),
           "Return the height of @var{system}.")
index 87925402d467edefa6c04925bf88529a0c395faf..a7e95227d061251f97960625e4d60193979e0c50 100644 (file)
@@ -15,16 +15,17 @@ IMPLEMENT_SMOBS (Paper_system);
 IMPLEMENT_TYPE_P (Paper_system, "ly:paper-system?");
 IMPLEMENT_DEFAULT_EQUAL_P (Paper_system);
 
-Paper_system::Paper_system (Stencil s, bool is_title)
+Paper_system::Paper_system (Stencil s, SCM immutable_init)
 {
-  is_title_ = is_title;
-  number_ = 0;
-  break_before_penalty_ = 0;
+  mutable_property_alist_ = SCM_EOL;
+  immutable_property_alist_ = immutable_init;
   smobify_self ();
   stencil_ = s;
   staff_refpoints_ = Interval (0, 0);
+  init_vars ();
 }
 
+
 Paper_system::~Paper_system ()
 {
 }
@@ -33,7 +34,7 @@ SCM
 Paper_system::mark_smob (SCM smob)
 {
   Paper_system *system = (Paper_system *) SCM_CELL_WORD_1 (smob);
-  scm_gc_mark (system->details_);
+  scm_gc_mark (system->mutable_property_alist_);
   return system->stencil_.expr ();
 }
 
@@ -43,27 +44,12 @@ Paper_system::print_smob (SCM smob, SCM port, scm_print_state*)
   Paper_system *p = (Paper_system *) SCM_CELL_WORD_1 (smob);
   scm_puts ("#<", port);
   scm_puts (classname (p), port);
-  scm_puts ("n ", port);
-  scm_puts (to_string (p->number_).to_str0 (), port);
-  scm_puts (", p ", port);
-  scm_puts (to_string (p->break_before_penalty_).to_str0 (), port);
-  if (p->is_title ())
-    scm_puts (" t", port);
+  scm_display (p->mutable_property_alist_, port);
+  
   scm_puts (" >", port);
   return 1;
 }
 
-bool
-Paper_system::is_title () const
-{
-  return is_title_;
-}
-
-Real
-Paper_system::break_before_penalty () const
-{
-  return break_before_penalty_;
-}
 
 Stencil
 Paper_system::to_stencil () const
@@ -72,19 +58,10 @@ Paper_system::to_stencil () const
 }
 
 void
-Paper_system::read_left_bound (Item *left)
+Paper_system::init_vars ()
 {
-  break_before_penalty_
-    = robust_scm2double (left->get_property ("page-penalty"), 0.0);
-
-  details_
-    = left->get_property ("line-break-system-details");
-
-  SCM yext
-    = scm_assq (ly_symbol2scm ("Y-extent"), details_);
-  
-  SCM staff_ext
-    = scm_assq (ly_symbol2scm ("refpoint-Y-extent"), details_);
+  SCM yext = get_property ("Y-extent");
+  SCM staff_ext = get_property ("refpoint-Y-extent");
 
   if (scm_is_pair (yext)
       && is_number_pair (scm_cdr (yext)))
@@ -105,11 +82,23 @@ Paper_system::read_left_bound (Item *left)
 SCM
 Paper_system::internal_get_property (SCM sym) const
 {
-  SCM handle = scm_assq (sym, details_);
-  if (scm_is_pair (handle))
-    return scm_cdr (handle);
-  else
-    return SCM_EOL;
+  /*
+    TODO: type checking
+   */
+  SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
+  if (s != SCM_BOOL_F)
+    return scm_cdr (s);
+
+  s = scm_sloppy_assq (sym, immutable_property_alist_);
+
+     
+  return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
+}
+
+void
+Paper_system::internal_set_property (SCM sym, SCM val) 
+{
+  mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, sym, val);
 }
 
 /*
index 7df79c196c9489ef0256ed9bae95a7064ca2c9b9..1ede4824c52684eef33d072805c8b1731f8fe598 100644 (file)
@@ -383,9 +383,14 @@ System::get_paper_system ()
       staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
     }
 
-  Paper_system *pl = new Paper_system (sys_stencil, false);
+  Grob *left_bound = this->get_bound (LEFT);
+  SCM prop_init = left_bound->get_property ("line-break-system-details");
+  Paper_system *pl = new Paper_system (sys_stencil,
+                                      prop_init);
+  
   pl->staff_refpoints_ = staff_refpoints;
-  pl->read_left_bound (this->get_bound (LEFT));
+  pl->set_property ("penalty",
+                   left_bound->get_property ("page-penalty"));
   
   return pl->unprotect ();
 }
index 471a4927b40697326c5ff8191ed52b33b49be8ce..f04577e8a49052af9a2b5d81864956c13a14dba2 100644 (file)
@@ -2558,9 +2558,9 @@ inside-slur -> avoid-slur'''))
 
 
 def conv (str):
-       str = re.sub(r'\\applyoutput', '\\applyOutput', str)
-       str = re.sub(r'\\applycontext', '\\applyContext', str)
-       str = re.sub(r'\\applymusic', '\\applyMusic', str)
+       str = re.sub(r'\\applyoutput', r'\\applyOutput', str)
+       str = re.sub(r'\\applycontext', r'\\applyContext', str)
+       str = re.sub(r'\\applymusic',  r'\\applyMusic', str)
        str = re.sub(r'ly:grob-suicide', 'ly:grob-suicide!', str)
        return str
 
index 031e51998fc904ab6c04bf4d70d10a1a73451786..125fd8645ffe06909f4a9b27da2c847869ba0d01 100644 (file)
         (not
          (ly:get-option 'preview-include-book-title))
         (< 1 (length systems))
-        (ly:paper-system-title? (list-ref systems 0))
-        (ly:paper-system-title? (list-ref systems 1)))
+        (paper-system-title? (list-ref systems 0))
+        (paper-system-title? (list-ref systems 1)))
        (set! systems (cdr systems)))
 
     (for-each
      (lambda (sys)
        (if (or
-           (ly:paper-system-title? sys)
+           (paper-system-title? sys)
            (not (pair? to-dump-systems))
-           (ly:paper-system-title? (car to-dump-systems)))
+           (paper-system-title? (car to-dump-systems)))
           (set! to-dump-systems (cons sys to-dump-systems))))
      systems)
 
       (let* ((paper (ly:paper-book-paper book))
             (systems (ly:paper-book-systems book))
             (scale (ly:output-def-lookup paper 'outputscale))
-            (titles (take-while ly:paper-system-title? systems))
+            (titles (take-while paper-system-title? systems))
             (non-title (find (lambda (x)
-                               (not (ly:paper-system-title? x))) systems))
+                               (not (paper-system-title? x))) systems))
             (dump-me
              (stack-stencils Y DOWN 0.0
                              (map ly:paper-system-stencil
index c16acc56f2a1f6b15897e849b3d369845f49c581..3b16305577c8929b12e155a44235a344fba455db 100644 (file)
     (ly:score-process score header paper layout base)
     ))
 
+
+(define-public (paper-system-title? ps)
+  (equal? #t (ly:paper-system-property ps 'is-title)
+         ))
+
 ;;;;;;;;;;;;;;;;
 ;; alist
 (define-public assoc-get ly:assoc-get)
index 7dcdd8bd53a63236f8351d20e6cbd0d407312ec2..3272a2ff3f0db802b464e88090cabc773bb7c9ce 100644 (file)
        "\n")))
 
 (define-method (node-system-numbers (node <optimally-broken-page-node>))
-  (map ly:paper-system-number (node-lines node)))
+  (map ly:paper-system-property (node-lines node) 'number))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -130,13 +133,13 @@ create offsets.
            (let* ((system (car stencil-position))
                   (stencil (ly:paper-system-stencil system))
                   (y (cadr stencil-position))
-                  (is-title (ly:paper-system-title?
+                  (is-title (paper-system-title?
                              (car stencil-position))))
              (add-to-page stencil y)
              (if (and (ly:stencil? system-separator-stencil)
                       last-system
-                      (not (ly:paper-system-title? system))
-                      (not (ly:paper-system-title? last-system)))
+                      (not (paper-system-title? system))
+                      (not (paper-system-title? last-system)))
                  (add-to-page
                   system-separator-stencil
                   (average (- last-y
@@ -189,7 +192,6 @@ create offsets.
   "Return pages as a list starting with 1st page. Each page is a list
 of lines. "
 
-
   (define MAXPENALTY 1e9)
   (define paper (ly:paper-book-paper paper-book))
   (define scopes (ly:paper-book-scopes paper-book))
@@ -293,10 +295,11 @@ is what have collected so far, and has ascending page numbers."
                                         fixed-dist)
                                      (interval-start this-system-ext))))
                     (title1? (and (vector-ref system-vector idx)
-                                  (ly:paper-system-title? (vector-ref system-vector idx))))
+                                  (paper-system-title? (vector-ref system-vector idx)
+                                                            )))
                     (title2? (and
                               (vector-ref system-vector (1+ idx))
-                              (ly:paper-system-title? (vector-ref system-vector (1+ idx)))))
+                              (paper-system-title? (vector-ref system-vector (1+ idx)))))
                     (ideal (+
                             (cond
                              ((and title2? title1?)
@@ -384,14 +387,16 @@ CURRENT-BEST is the best result sofar, or #f."
                          satisfied-constraints)
                      10000))
           (positions (cdr vertical-spacing))
+          (get-break-penalty (lambda (sys)
+                               (ly:paper-system-property sys 'penalty 0.0)))
           (user-nobreak-penalties
            (-
             (apply + (filter negative?
-                             (map ly:paper-system-break-before-penalty
+                             (map get-break-penalty
                                   (cdr current-lines))))))
            (user-penalty
            (+
-            (max (ly:paper-system-break-before-penalty (car current-lines)) 0.0)
+            (max (get-break-penalty (car current-lines)) 0.0)
             user-nobreak-penalties))
            (total-penalty (combine-penalties
                            force user-penalty
@@ -457,7 +462,7 @@ DONE."
                      (cdr todo)))))
 
   (define (line-number node)
-    (ly:paper-system-number (car (node-lines node))))
+    (ly:paper-system-property (car (node-lines node)) 'number))
 
   (ly:message (_ "Calculating page breaks..."))
   (set! force-equalization-factor
index 9300f8b248a365efbf98a2afa89651be3d98ab59..023b553147994e6ead1c7a2411fa364f02b6d4f1 100644 (file)
    ly:layout-def?
    ly:paper-get-font
    ly:paper-get-number
-   ly:paper-system-break-before-penalty
    ly:paper-system-extent
-   ly:paper-system-number
    ly:paper-system-stencil
    ly:paper-system?
    ly:output-def-lookup