CVSROOT: /cvsroot/lilypond Module name: lilypond Branch: Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/09/27 10:50:17
Modified files: . : ChangeLog input/regression: apply-context.ly apply-output.ly balloon.ly cluster-cross-staff.ly cluster.ly generic-output-property.ly music-map.ly repeat-unfold-tremolo.ly input/test : add-staccato.ly add-text-script.ly ancient-font.ly bar-number-every-five-reset.ly move-specific-text.ly music-box.ly reverse-music.ly smart-transpose.ly unfold-all-repeats.ly lily : paper-book.cc paper-system-scheme.cc paper-system.cc system.cc lily/include : paper-system.hh python : convertrules.py scm : framework-ps.scm lily-library.scm page-layout.scm safe-lily.scm Log message: * 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. * 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 CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.4137&tr2=1.4138&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/apply-context.ly.diff?tr1=1.31&tr2=1.32&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/apply-output.ly.diff?tr1=1.29&tr2=1.30&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/balloon.ly.diff?tr1=1.20&tr2=1.21&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/cluster-cross-staff.ly.diff?tr1=1.13&tr2=1.14&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/cluster.ly.diff?tr1=1.34&tr2=1.35&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/generic-output-property.ly.diff?tr1=1.33&tr2=1.34&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/music-map.ly.diff?tr1=1.29&tr2=1.30&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/repeat-unfold-tremolo.ly.diff?tr1=1.12&tr2=1.13&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/add-staccato.ly.diff?tr1=1.43&tr2=1.44&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/add-text-script.ly.diff?tr1=1.40&tr2=1.41&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/ancient-font.ly.diff?tr1=1.75&tr2=1.76&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/bar-number-every-five-reset.ly.diff?tr1=1.24&tr2=1.25&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/move-specific-text.ly.diff?tr1=1.37&tr2=1.38&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/music-box.ly.diff?tr1=1.38&tr2=1.39&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/reverse-music.ly.diff?tr1=1.34&tr2=1.35&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/smart-transpose.ly.diff?tr1=1.41&tr2=1.42&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/test/unfold-all-repeats.ly.diff?tr1=1.28&tr2=1.29&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/paper-book.cc.diff?tr1=1.116&tr2=1.117&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/paper-system-scheme.cc.diff?tr1=1.6&tr2=1.7&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/paper-system.cc.diff?tr1=1.19&tr2=1.20&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/system.cc.diff?tr1=1.120&tr2=1.121&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/paper-system.hh.diff?tr1=1.12&tr2=1.13&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/python/convertrules.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/framework-ps.scm.diff?tr1=1.134&tr2=1.135&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/lily-library.scm.diff?tr1=1.48&tr2=1.49&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/page-layout.scm.diff?tr1=1.80&tr2=1.81&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/safe-lily.scm.diff?tr1=1.36&tr2=1.37&r1=text&r2=text Patches: Index: lilypond/ChangeLog diff -u lilypond/ChangeLog:1.4137 lilypond/ChangeLog:1.4138 --- lilypond/ChangeLog:1.4137 Tue Sep 27 10:01:14 2005 +++ lilypond/ChangeLog Tue Sep 27 10:50:09 2005 @@ -1,5 +1,16 @@ 2005-09-27 Han-Wen Nienhuys <[EMAIL PROTECTED]> + * 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: lilypond/input/regression/apply-context.ly diff -u lilypond/input/regression/apply-context.ly:1.31 lilypond/input/regression/apply-context.ly:1.32 --- lilypond/input/regression/apply-context.ly:1.31 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/apply-context.ly Tue Sep 27 10:50:10 2005 @@ -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 @@ %% 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: lilypond/input/regression/apply-output.ly diff -u lilypond/input/regression/apply-output.ly:1.29 lilypond/input/regression/apply-output.ly:1.30 --- lilypond/input/regression/apply-output.ly:1.29 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/apply-output.ly Tue Sep 27 10:50:10 2005 @@ -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 @@ \stemUp \set autoBeaming = ##f { <d f g b>8 - \context Voice \applyoutput #mc-squared + \context Voice \applyOutput #mc-squared <d f g b> } Index: lilypond/input/regression/balloon.ly diff -u lilypond/input/regression/balloon.ly:1.20 lilypond/input/regression/balloon.ly:1.21 --- lilypond/input/regression/balloon.ly:1.20 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/balloon.ly Tue Sep 27 10:50:10 2005 @@ -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 @@ %% use predefd function. - \context Voice \applyoutput #(add-balloon-text + \context Voice \applyOutput #(add-balloon-text 'NoteHead "heads, or tails?" '(0 . -3)) Index: lilypond/input/regression/cluster-cross-staff.ly diff -u lilypond/input/regression/cluster-cross-staff.ly:1.13 lilypond/input/regression/cluster-cross-staff.ly:1.14 --- lilypond/input/regression/cluster-cross-staff.ly:1.13 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/cluster-cross-staff.ly Tue Sep 27 10:50:10 2005 @@ -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: lilypond/input/regression/cluster.ly diff -u lilypond/input/regression/cluster.ly:1.34 lilypond/input/regression/cluster.ly:1.35 --- lilypond/input/regression/cluster.ly:1.34 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/cluster.ly Tue Sep 27 10:50:10 2005 @@ -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 @@ << \new Staff \fragment - \new Staff \applymusic #notes-to-clusters \fragment + \new Staff \applyMusic #notes-to-clusters \fragment >> Index: lilypond/input/regression/generic-output-property.ly diff -u lilypond/input/regression/generic-output-property.ly:1.33 lilypond/input/regression/generic-output-property.ly:1.34 --- lilypond/input/regression/generic-output-property.ly:1.33 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/generic-output-property.ly Tue Sep 27 10:50:10 2005 @@ -1,5 +1,5 @@ -\version "2.6.0" +\version "2.7.10" \header{ texidoc=" @@ -13,13 +13,13 @@ \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: lilypond/input/regression/music-map.ly diff -u lilypond/input/regression/music-map.ly:1.29 lilypond/input/regression/music-map.ly:1.30 --- lilypond/input/regression/music-map.ly:1.29 Thu Aug 18 13:43:05 2005 +++ lilypond/input/regression/music-map.ly Tue Sep 27 10:50:10 2005 @@ -10,7 +10,7 @@ } -\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 @@ \relative c'' \context Voice { \foobar - << \applymusic #(lambda (x) (music-map notes-to-skip x)) + << pplyMusic #(lambda (x) (music-map notes-to-skip x)) \foobar { d2 d2 } >> } Index: lilypond/input/regression/repeat-unfold-tremolo.ly diff -u lilypond/input/regression/repeat-unfold-tremolo.ly:1.12 lilypond/input/regression/repeat-unfold-tremolo.ly:1.13 --- lilypond/input/regression/repeat-unfold-tremolo.ly:1.12 Mon Aug 22 17:28:50 2005 +++ lilypond/input/regression/repeat-unfold-tremolo.ly Tue Sep 27 10:50:10 2005 @@ -1,4 +1,4 @@ -\version "2.6.0" +\version "2.7.10" \header { texidoc = "Unfolding tremolo repeats. All fragments fill one @@ -12,12 +12,12 @@ { \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: lilypond/input/test/add-staccato.ly diff -u lilypond/input/test/add-staccato.ly:1.43 lilypond/input/test/add-staccato.ly:1.44 --- lilypond/input/test/add-staccato.ly:1.43 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/add-staccato.ly Tue Sep 27 10:50:11 2005 @@ -1,5 +1,5 @@ -\version "2.6.0" +\version "2.7.10" \header { @@ -27,7 +27,7 @@ \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: lilypond/input/test/add-text-script.ly diff -u lilypond/input/test/add-text-script.ly:1.40 lilypond/input/test/add-text-script.ly:1.41 --- lilypond/input/test/add-text-script.ly:1.40 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/add-text-script.ly Tue Sep 27 10:50:11 2005 @@ -1,4 +1,4 @@ -\version "2.6.0" +\version "2.7.10" \header { texidoc= "@cindex make-music Fingering @@ -28,7 +28,7 @@ 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: lilypond/input/test/ancient-font.ly diff -u lilypond/input/test/ancient-font.ly:1.75 lilypond/input/test/ancient-font.ly:1.76 --- lilypond/input/test/ancient-font.ly:1.75 Thu Aug 18 22:01:01 2005 +++ lilypond/input/test/ancient-font.ly Tue Sep 27 10:50:11 2005 @@ -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 @@ % 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: lilypond/input/test/bar-number-every-five-reset.ly diff -u lilypond/input/test/bar-number-every-five-reset.ly:1.24 lilypond/input/test/bar-number-every-five-reset.ly:1.25 --- lilypond/input/test/bar-number-every-five-reset.ly:1.24 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/bar-number-every-five-reset.ly Tue Sep 27 10:50:11 2005 @@ -1,4 +1,4 @@ -\version "2.6.0" +\version "2.7.10" \header { texidoc = "@cindex Bar Number Every Fifth Reset @@ -7,12 +7,12 @@ @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 [EMAIL PROTECTED] is set using @code{\applycontext}. [EMAIL PROTECTED] is set using @code{\applyContext}. " } -resetBarnum = \context Score \applycontext +resetBarnum = \context Score \applyContext #(set-bar-number-visibility 4) \score { << Index: lilypond/input/test/move-specific-text.ly diff -u lilypond/input/test/move-specific-text.ly:1.37 lilypond/input/test/move-specific-text.ly:1.38 --- lilypond/input/test/move-specific-text.ly:1.37 Thu Aug 18 22:01:02 2005 +++ lilypond/input/test/move-specific-text.ly Tue Sep 27 10:50:11 2005 @@ -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 @@ \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: lilypond/input/test/music-box.ly diff -u lilypond/input/test/music-box.ly:1.38 lilypond/input/test/music-box.ly:1.39 --- lilypond/input/test/music-box.ly:1.38 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/music-box.ly Tue Sep 27 10:50:11 2005 @@ -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 @@ -\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 @@ \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: lilypond/input/test/reverse-music.ly diff -u lilypond/input/test/reverse-music.ly:1.34 lilypond/input/test/reverse-music.ly:1.35 --- lilypond/input/test/reverse-music.ly:1.34 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/reverse-music.ly Tue Sep 27 10:50:11 2005 @@ -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 @@ \score { \context Voice { \music - \applymusic #reverse-music \music + \applyMusic #reverse-music \music } \layout { raggedright = ##t} } Index: lilypond/input/test/smart-transpose.ly diff -u lilypond/input/test/smart-transpose.ly:1.41 lilypond/input/test/smart-transpose.ly:1.42 --- lilypond/input/test/smart-transpose.ly:1.41 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/smart-transpose.ly Tue Sep 27 10:50:11 2005 @@ -1,5 +1,5 @@ -\version "2.6.0" +\version "2.7.10" \header { texidoc="@cindex Smart Transpose @@ -69,9 +69,9 @@ \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: lilypond/input/test/unfold-all-repeats.ly diff -u lilypond/input/test/unfold-all-repeats.ly:1.28 lilypond/input/test/unfold-all-repeats.ly:1.29 --- lilypond/input/test/unfold-all-repeats.ly:1.28 Sun Jun 26 22:46:56 2005 +++ lilypond/input/test/unfold-all-repeats.ly Tue Sep 27 10:50:11 2005 @@ -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 @@ \score { { \mel \break - \applymusic #unfold-repeats \mel + \applyMusic #unfold-repeats \mel } } Index: lilypond/lily/include/paper-system.hh diff -u lilypond/lily/include/paper-system.hh:1.12 lilypond/lily/include/paper-system.hh:1.13 --- lilypond/lily/include/paper-system.hh:1.12 Tue Sep 27 10:01:15 2005 +++ lilypond/lily/include/paper-system.hh Tue Sep 27 10:50:12 2005 @@ -21,18 +21,18 @@ { 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: lilypond/lily/paper-book.cc diff -u lilypond/lily/paper-book.cc:1.116 lilypond/lily/paper-book.cc:1.117 --- lilypond/lily/paper-book.cc:1.116 Mon Sep 26 23:25:58 2005 +++ lilypond/lily/paper-book.cc Tue Sep 27 10:50:11 2005 @@ -227,9 +227,10 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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: lilypond/lily/paper-system-scheme.cc diff -u lilypond/lily/paper-system-scheme.cc:1.6 lilypond/lily/paper-system-scheme.cc:1.7 --- lilypond/lily/paper-system-scheme.cc:1.6 Tue Sep 27 10:01:15 2005 +++ lilypond/lily/paper-system-scheme.cc Tue Sep 27 10:50:12 2005 @@ -19,33 +19,6 @@ 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: lilypond/lily/paper-system.cc diff -u lilypond/lily/paper-system.cc:1.19 lilypond/lily/paper-system.cc:1.20 --- lilypond/lily/paper-system.cc:1.19 Tue Sep 27 10:01:15 2005 +++ lilypond/lily/paper-system.cc Tue Sep 27 10:50:12 2005 @@ -15,16 +15,17 @@ 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 @@ 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 *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 @@ } 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 @@ 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: lilypond/lily/system.cc diff -u lilypond/lily/system.cc:1.120 lilypond/lily/system.cc:1.121 --- lilypond/lily/system.cc:1.120 Mon Sep 26 23:25:58 2005 +++ lilypond/lily/system.cc Tue Sep 27 10:50:12 2005 @@ -383,9 +383,14 @@ 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: lilypond/python/convertrules.py diff -u lilypond/python/convertrules.py:1.14 lilypond/python/convertrules.py:1.15 --- lilypond/python/convertrules.py:1.14 Mon Sep 26 23:25:59 2005 +++ lilypond/python/convertrules.py Tue Sep 27 10:50:12 2005 @@ -2558,9 +2558,9 @@ 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: lilypond/scm/framework-ps.scm diff -u lilypond/scm/framework-ps.scm:1.134 lilypond/scm/framework-ps.scm:1.135 --- lilypond/scm/framework-ps.scm:1.134 Wed Aug 24 15:54:57 2005 +++ lilypond/scm/framework-ps.scm Tue Sep 27 10:50:17 2005 @@ -498,16 +498,16 @@ (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) @@ -527,9 +527,9 @@ (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: lilypond/scm/lily-library.scm diff -u lilypond/scm/lily-library.scm:1.48 lilypond/scm/lily-library.scm:1.49 --- lilypond/scm/lily-library.scm:1.48 Wed Aug 24 20:19:06 2005 +++ lilypond/scm/lily-library.scm Tue Sep 27 10:50:17 2005 @@ -115,6 +115,11 @@ (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: lilypond/scm/page-layout.scm diff -u lilypond/scm/page-layout.scm:1.80 lilypond/scm/page-layout.scm:1.81 --- lilypond/scm/page-layout.scm:1.80 Tue Sep 27 10:01:15 2005 +++ lilypond/scm/page-layout.scm Tue Sep 27 10:50:17 2005 @@ -28,7 +28,10 @@ "\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 @@ (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 @@ "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 @@ 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 @@ 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 @@ (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: lilypond/scm/safe-lily.scm diff -u lilypond/scm/safe-lily.scm:1.36 lilypond/scm/safe-lily.scm:1.37 --- lilypond/scm/safe-lily.scm:1.36 Mon Sep 26 23:25:59 2005 +++ lilypond/scm/safe-lily.scm Tue Sep 27 10:50:17 2005 @@ -100,9 +100,7 @@ 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 _______________________________________________ Lilypond-cvs mailing list Lilypond-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-cvs