]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
authorJoe Neeman <joeneeman@gmail.com>
Wed, 31 Jan 2007 07:38:46 +0000 (09:38 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Wed, 31 Jan 2007 07:38:46 +0000 (09:38 +0200)
Conflicts:

lily/text-spanner-engraver.cc

145 files changed:
.gitignore
Documentation/topdocs/NEWS.tely
Documentation/user/advanced-notation.itely
Documentation/user/tutorial.itely
Documentation/user/tweaks.itely
Documentation/user/working.itely
ROADMAP
THANKS
VERSION
buildscripts/coverage.py
input/regression/clip-systems.ly
input/regression/dynamics-text-spanner-padding.ly [new file with mode: 0644]
input/regression/line-arrows.ly
input/regression/line-dashed-period.ly [new file with mode: 0644]
input/regression/markup-commands.ly [new file with mode: 0644]
input/regression/music-map.ly
input/regression/skip-of-length.ly [new file with mode: 0644]
input/regression/staff-mixed-size.ly
lily/accidental-placement.cc
lily/align-interface.cc
lily/all-font-metrics-scheme.cc [new file with mode: 0644]
lily/all-font-metrics.cc
lily/axis-group-interface-scheme.cc
lily/bar-number-engraver.cc
lily/beam-quanting.cc
lily/beam.cc
lily/book-scheme.cc
lily/book.cc
lily/break-alignment-interface.cc
lily/context-scheme.cc
lily/dimensions-scheme.cc
lily/dispatcher-scheme.cc
lily/dot-column.cc
lily/duration-scheme.cc
lily/engraver.cc
lily/font-config-scheme.cc
lily/font-metric-scheme.cc
lily/function-documentation.cc
lily/general-scheme.cc
lily/global-context-scheme.cc
lily/global-context.cc
lily/grob-array-scheme.cc
lily/grob-interface-scheme.cc
lily/grob-pq-engraver.cc
lily/grob-property.cc
lily/grob-scheme.cc
lily/grob.cc
lily/include/font-metric.hh
lily/include/global-context.hh
lily/include/lily-guile-macros.hh
lily/include/lily-guile.hh
lily/include/line-spanner.hh [deleted file]
lily/include/ly-module.hh
lily/include/ly-smobs.icc
lily/include/music-output.hh
lily/include/music.hh
lily/include/smobs.hh
lily/include/text-spanner.hh [deleted file]
lily/input-scheme.cc
lily/item-scheme.cc
lily/lily-guile.cc
lily/lily-lexer-scheme.cc
lily/lily-parser-scheme.cc
lily/line-interface.cc
lily/line-spanner.cc
lily/ly-module.cc
lily/moment-scheme.cc
lily/music-function-scheme.cc
lily/music-scheme.cc
lily/music.cc
lily/new-line-spanner.cc [deleted file]
lily/note-collision.cc
lily/note-head-scheme.cc
lily/open-type-font-scheme.cc
lily/ottava-bracket.cc
lily/output-def-scheme.cc
lily/pango-select-scheme.cc
lily/paper-book-scheme.cc
lily/paper-outputter-scheme.cc
lily/paper-score-scheme.cc
lily/paper-score.cc
lily/performance-scheme.cc
lily/performance.cc
lily/pfb-scheme.cc [new file with mode: 0644]
lily/pfb.cc
lily/pitch-scheme.cc
lily/pitched-trill-engraver.cc
lily/prob-scheme.cc
lily/program-option-scheme.cc [new file with mode: 0644]
lily/program-option.cc
lily/rest-collision.cc
lily/scale.cc
lily/scheme-listener-scheme.cc
lily/score-scheme.cc
lily/self-aligment-interface.cc
lily/semi-tie-column.cc
lily/side-position-interface.cc
lily/simple-spacer-scheme.cc
lily/slur.cc
lily/spanner-scheme.cc
lily/staff-symbol-referencer-scheme.cc
lily/stem.cc
lily/stencil-scheme.cc
lily/stencil.cc
lily/stream-event-scheme.cc
lily/text-interface.cc
lily/text-spanner-engraver.cc
lily/text-spanner.cc [deleted file]
lily/tie-column.cc
lily/translator-scheme.cc
lily/trill-spanner-engraver.cc
lily/ttf.cc
ly/engraver-init.ly
make/lilypond.fedora.spec.in [deleted file]
mf/parmesan-heads.mf
python/convertrules.py
python/relocate-preamble.py.in [new file with mode: 0644]
scm/define-grob-interfaces.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/define-markup-commands.scm
scm/font.scm
scm/framework-eps.scm
scm/framework-ps.scm
scm/framework-scm.scm
scm/lily-library.scm
scm/lily.scm
scm/music-functions.scm
scm/output-lib.scm
scm/output-ps.scm
scm/output-socket.scm
scm/paper.scm
scm/safe-lily.scm
scm/stencil.scm
scm/x11-color.scm
scripts/GNUmakefile
scripts/abc2ly.py
scripts/convert-ly.py
scripts/etf2ly.py
scripts/lilypond-book.py
scripts/midi2ly.py
scripts/musicxml2ly.py
stepmake/stepmake/python-module-rules.make
stepmake/stepmake/script-rules.make
stepmake/stepmake/substitute-vars.make

index f69a725cab37b78e65ea408c0564edacbbf3a071..0c7c899e609494a67f7d2c0813be58c6f0b0780a 100644 (file)
@@ -59,3 +59,6 @@ tags
 test-output-distance
 config-*.hh
 config-*.make
+*.graph
+*.stacks
+*.profile
index e7b58fc71fc819d53308b8d610700ff3e77da124..b79a19a998ec3b8510a38836f82499974d6c5db7 100644 (file)
@@ -65,6 +65,26 @@ which scares away people.
 
 @end ignore
 
+All line spanners are more flexible now in the configuration of their
+end points.  This includes glissando, voice followers, text crescendos
+and other text spanners.
+
+@lilypond
+\relative c'' {
+  \override Glissando #'bound-details #'right #'text = \markup { \hcenter \bold down }
+  \override Glissando #'bound-details #'right #'Y = #-4
+  \override Glissando #'bound-details #'right #'padding = #0.0
+  \override Glissando #'bound-details #'left #'arrow = ##t
+  \override Glissando #'bound-details #'left #'padding = #5.0
+  \override Glissando #'style = #'trill
+  
+  c1 \glissando c'
+}
+@end lilypond
+
+This feature was sponsored by Trevor Bača.
+
 @item
 Notes or rests, such as a typical end note, that fill an entire
 measure are preceded by some more space.
index 42cdb7bdae0f8a670720217f81e0be8b17cc7553..31b4a75c31535f6e661224eebfcc6f92f2a481ce 100644 (file)
@@ -40,6 +40,7 @@ saved as UTF-8.  For more information, see @ref{Text encoding}.
 
 @menu
 * Text scripts::                
+* Text and line spanners::      
 * Text spanners::               
 * Text marks::                  
 * Text markup::                 
@@ -105,6 +106,143 @@ In this manual: @ref{Text markup}.
 Program reference: @internalsref{TextScript}.
 
 
+@node Text and line spanners
+@subsection Text and line spanners
+
+Some performance indications, e.g., @i{rallentando} and
+@i{accelerando} and @i{trills} are written as text and are extended
+over many measures with lines, sometimes dotted or wavy.
+
+These all use the same routines as the glissando for drawing the texts
+and the lines, and tuning their behavior is therefore also done in the
+same way. It is done with a spanner, and the routine responsible for
+drawing the spanners is @code{ly:line-interface::print}. This
+routine creates determines the exact location of the two @i{span
+points} and draws a line in between, in the style requested.
+
+Here is an example of the different line styles available, and how to
+tune them.
+
+@lilypond[relative=2,ragged-right,verbatim,fragment]
+d2 \glissando d'2
+\once \override Glissando #'dash-fraction = #0.5
+d,2 \glissando d'2
+\override Glissando #'style = #'dotted-line
+d,2 \glissando d'2
+\override Glissando #'style = #'zigzag
+d,2 \glissando d'2
+\override Glissando #'style = #'trill
+d,2 \glissando d'2
+@end lilypond
+
+The information that determines the end-points is computed on-the-fly
+for every graphic object, but it is possible to override these. 
+
+@lilypond[relative=2,ragged-right,verbatim,fragment]
+e2 \glissando f
+\once \override Glissando #'bound-details #'right #'Y = #-2
+e2 \glissando f
+@end lilypond
+
+The @code{Glissando} object, like any other using the
+@code{ly:line-interface::print} routine, carries a nested
+association list. In the above statement, the value for @code{Y}
+is set to @code{-2} for association list corresponding to the right
+end point. Of course, it is also possible to adjust the left side with
+@code{left} instead of @code{right}.
+
+If @code{Y} is not set, the value is computed from the vertical
+position of right attachment point of the spanner. 
+
+In case of a line break, the values for the span-points are extended
+with contents of the @code{left-broken} and @code{right-broken}
+sublists, for example
+
+@lilypond[relative=2,ragged-right,verbatim,fragment]
+\override Glissando #'breakable = ##T 
+\override Glissando #'bound-details #'right-broken #'Y = #-3
+c1 \glissando \break
+f1
+@end lilypond
+
+The following properties can be used for the
+
+@table @code
+@item Y
+This sets the Y-coordinate of the end point, in staff space.  By
+default, it is the center of the bound object, so for a glissando it
+points to the vertical center of the note head.
+
+For horizontal spanners, such as text spanner and trill spanners, it
+is hardcoded to 0.
+
+@item attach-dir
+This determines where the line starts and ends in X-direction,
+relative to the bound object.  So, a value of @code{-1} (or
+@code{LEFT}) makes the line start/end at the left side of the note
+head it is attached to.
+
+@item X
+This is the absolute coordinate of the end point. It is usually
+computed on the fly, and there is little use in overriding it. 
+
+@item stencil
+Line spanners may have symbols at the beginning or end, which is
+contained in this sub-property.  This is for internal use, it is
+recommended to use @code{text}.
+
+@item text
+This is a markup that is evaluated to yield stencil. It is
+used to put @i{cresc.} and @i{tr} on horizontal spanners.
+
+@lilypond[quote,ragged-right,fragment,relative=2,verbatim]
+\override TextSpanner #'bound-details #'left #'text
+   = \markup { \small \bold Slower }
+c2\startTextSpan b c a\stopTextSpan
+@end lilypond
+
+@item stencil-align-dir-y
+@item stencil-offset
+Without setting this, the stencil is simply put there at the
+end-point, as defined by the @code{X} and @code{Y} sub properties.
+Setting either @code{stencil-align-dir-y} or @code{stencil-offset}
+will move the symbol at the edge relative to the end point of the line
+
+@lilypond[relative=1,fragment,verbatim]
+\override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #DOWN
+\override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #UP
+
+\override TextSpanner #'bound-details #'left #'text = #"gggg"
+\override TextSpanner #'bound-details #'right #'text = #"hhhh"
+c4^\startTextSpan c c c \stopTextSpan
+@end lilypond
+
+@item arrow
+Setting this sub property to @code{#t} produce an arrowhead at the end
+of the line.
+
+@item padding
+This sub property controls the space between the specified end-point
+of the line and the actual end.  Without padding, a glissando would
+start and end in the center of each note head.
+
+@end table
+
+@seealso
+
+Program reference: @internalsref{TextSpanner},
+@internalsref{Glissando}, @internalsref{VoiceFollower},
+@internalsref{TrillSpanner}, @internalsref{line-spanner-interface}.
+
+Examples:
+@inputfileref{input/@/regression,dynamics@/-text@/-spanner@/-padding.ly}.
+@inputfileref{input/@/regression,glissando@/-broken@/.ly}.
+@inputfileref{input/@/regression,line@/-arrows@/.ly}.
+@inputfileref{input/@/regression,line@/-style@/.ly}.
+@inputfileref{input/@/regression,text@/-spanner@/.ly}.
+@inputfileref{input/@/regression,text@/-spanner@/.ly}.
+
+
 @node Text spanners
 @subsection Text spanners
 
index d1b5eb467ce88abdbc56e770421370dd92925f59..93a5db0ec07e7ad0f2f4dd1cc744196e8341067f 100644 (file)
@@ -127,7 +127,7 @@ and how to view or print the output.
 @subsubheading MacOS X
 
 If you double click LilyPond.app, it will open with an example
-file. Save it, for example, to @file{test.ly} on your Desktop, and
+file.  Save it, for example, to @file{test.ly} on your Desktop, and
 then process it with the menu command @samp{Compile > Typeset File}.
 The resulting PDF file will be displayed on your screen.
 
@@ -157,7 +157,7 @@ the file and show the resulting PDF file.  To edit an existing
 @file{.ly} file, right-click on it and select @qq{Edit source}.
 
 If you double-click in the LilyPond icon on the Desktop, it will open
-a simple text editor with an example file. Save it, for example, to
+a simple text editor with an example file.  Save it, for example, to
 @file{test.ly} on your Desktop, and then double-click on the file to
 process it.  After some seconds, you will get a file @file{test.pdf}
 on your desktop.  Double-click on this PDF file to view the typeset
@@ -352,7 +352,7 @@ The @rglos{clef} can be set using the @code{\clef} command:
   \clef treble
   c1
   \clef alto
-       c1
+  c1
   \clef tenor
   c1
   \clef bass
@@ -823,7 +823,7 @@ of music is multiplied by the fraction.  Triplets make notes occupy
 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
 \times 2/3 { f8 g a }
 \times 2/3 { c r c }
-\times 2/3 { f,8 g16 a g a }
+\times 2/3 { f,8 g16[ a g a] }
 \times 2/3 { d4 a8 }
 @end lilypond
 
@@ -837,7 +837,7 @@ can also be created by prefixing a music expression with the
 keyword @code{\appoggiatura} or @code{\acciaccatura}
 
 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
-c2 \grace { a32 b} c2
+c2 \grace { a32[ b] } c2
 c2 \appoggiatura b16 c2
 c2 \acciaccatura b16 c2
 @end lilypond
@@ -1158,7 +1158,7 @@ Consider a simple melody:
 @lilypond[quote,ragged-right,verbatim]
 \relative c'' {
   a4 e c8 e r4
-       b2 c4( d)
+  b2 c4( d)
 }
 @end lilypond
 
@@ -1170,7 +1170,7 @@ syllable with a space.
 <<
   \relative c'' {
     a4 e c8 e r4
-         b2 c4( d)
+    b2 c4( d)
   }
   \addlyrics { One day this shall be free }
 >>
@@ -1186,7 +1186,7 @@ line}.  It is entered as two underscores @code{__}:
 <<
   \relative c'' {
     a4 e c8 e r4
-         b2 c4( d)
+    b2 c4( d)
   }
   \addlyrics { One day this shall be free __ }
 >>
@@ -1220,9 +1220,6 @@ discussed in @ref{Vocal music}.
 @cindex chords
 @cindex chord names
 
-@c TODO: revise this, \chords { } is shorter and more intuitive.
-@c  I need help for this.  -gp
-
 In popular music it is common to denote accompaniment with chord names.
 Such chords can be entered like notes,
 
@@ -1230,12 +1227,10 @@ Such chords can be entered like notes,
 \chordmode { c2 f4. g8 }
 @end lilypond
 
-@noindent
 Now each pitch is read as the root of a chord instead of a note.
-This mode is switched on with @code{\chordmode}
-
-Other chords can be created by adding modifiers after a colon.  The
-following example shows a few common modifiers
+This mode is switched on with @code{\chordmode}.  Other chords can be
+created by adding modifiers after a colon.  The
+following example shows a few common modifiers:
 
 @lilypond[quote,verbatim,ragged-right]
 \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
@@ -1245,7 +1240,7 @@ For lead sheets, chords are not printed on staves, but as names on a
 line for themselves.  This is achieved by using @code{\chords} instead
 of @code{\chordmode}.  This uses the same syntax as @code{\chordmode},
 but renders the notes in a @code{ChordNames} context, with the
-following result.
+following result:
 
 @lilypond[quote,verbatim,ragged-right]
 \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
@@ -1253,22 +1248,25 @@ following result.
 
 @cindex lead sheet
 When put together, chord names, lyrics and a melody form
-a lead sheet, for example,
+a lead sheet,
 
 @lilypond[quote,verbatim,ragged-right]
-% FIXME: this melody needs to be changed.  See my new example in 2.4.1. -gp
 <<
-  \chords { r2 c:sus4 f }
-  \relative {
-    r4 c' \times 2/3 { f g g }
-    \times 2/3 { g4( a2) }
+  \chords { c2 g:sus4 f e }
+  \relative c'' {
+    a4 e c8 e r4
+    b2 c4( d)
   }
-  \addlyrics { I want to break free __ }
+  \addlyrics { One day this shall be free __ }
 >>
 @end lilypond
 
+
+@moreinfo
+@quotation
 A complete list of modifiers and other options for layout can be found
 in @ref{Chords}.
+@end quotation
 
 
 @node Final touches
index 25a878120e4d00be7dff4808fdc9ebadf246c85e..3d211709dd2d7e22f5bfafc08acbf596ba549d33 100644 (file)
@@ -288,7 +288,7 @@ voices:
 } >>
 @end lilypond
 
-To make sure that the just blanked stem doesn't sqeeuze the too much
+To make sure that the just blanked stem doesn't squeeze the too much
 tie, we also lengthen the stem, by setting the @code{length} to
 @code{8},
 
@@ -373,10 +373,10 @@ space at the bottom of the page.
 
 @example
 \paper @{
-between-system-padding = #0.1
-between-system-space = #0.1
-ragged-last-bottom = ##f
-ragged-bottom = ##f
+  between-system-padding = #0.1
+  between-system-space = #0.1
+  ragged-last-bottom = ##f
+  ragged-bottom = ##f
 @}
 @end example
 
@@ -387,7 +387,7 @@ use 10).
 
 @example
 \paper @{
-system-count = #10
+  system-count = #10
 @}
 @end example
 
@@ -474,9 +474,9 @@ tempoMark = #(define-music-function (parser location padding marktext)
 #})
 
 \relative c'' {
-c2 e
-\tempoMark #3.0 #"Allegro"
-g c
+  c2 e
+  \tempoMark #3.0 #"Allegro"
+  g c
 }
 @end lilypond
 
index 22659409a21078460f3998a970f91a3e87a4ee15..abef49234d2961dd6ebec0f36f340f3aed86e9a9 100644 (file)
@@ -10,7 +10,7 @@
 @node Working on LilyPond projects
 @chapter Working on LilyPond projects
 
-This section explains how to solve or avoid certain common
+This section explains how to solve or avoid certain common
 problems.  If you have programming experience, many of these
 tips may seem obvious, but it is still advisable to read
 this chapter.
@@ -632,7 +632,7 @@ Another very useful debugging technique is constructing
 @node Minimal examples
 @section Minimal examples
 
-A minimal example is an example which is small as possible.  These
+A minimal example is an example which is as small as possible.  These
 examples are much easier to understand than long examples.  Minimal
 examples are used for
 
@@ -655,14 +655,14 @@ There are two exceptions to the @qq{as small as possible} rule:
 @itemize
 @item Include the @code{\version} number.
 @item If possible, use @code{\paper@{ ragged-right=##t @}} at the
-top of your example. 
+top of your example.
 @end itemize
 
 The whole point of a minimal example is to make it easy to read:
 
 @itemize
 @item Avoid using complicated notes, keys, or time signatures, unless you
-wish to demonstrate something is about the behavior of those items. 
+wish to demonstrate something is about the behavior of those items.
 @item Do not use \override commands unless that is the point of the
 example.
 @end itemize
diff --git a/ROADMAP b/ROADMAP
index 6a691b623710e9c12d65bbf55ce37eebb5af09e7..af31b7b52ff949cc45473842c43f9d85d816925d 100644 (file)
--- a/ROADMAP
+++ b/ROADMAP
@@ -13,11 +13,13 @@ source files.
                        patches for third party programs
    Documentation/
        bibliography/   .bib files with references to books and articles
-       misc            Old announcements, ChangeLogs and NEWS
+       misc/           Old announcements, ChangeLogs and NEWS
        pictures/       The logo
        topdocs/                Sources for the toplevel READMEs
                        (README.txt, INSTALL.txt, NEWS.txt etc.)
        user/           User manuals
+       po/              translated manual node names
+       fr/              docs translated to French.
    buildscripts/       Scripts for the build process
    cygwin/             Cygwin (Windows) package support
    debian/             Debian package support
@@ -25,9 +27,7 @@ source files.
    flower/             A simple c++ library
        include/
    input/              Music input examples
-       bugs/           Buggy or problematic notation
        mutopia/                Real music, more at www.mutopiaproject.org
-       no-notation/    Examples that do not produce output
        regression/     Testing of features, one test per file
        test/           Tips and tricks
        tutorial/       Examples from the tutorial 
diff --git a/THANKS b/THANKS
index 2e7cd7cf4a59eabbb63051eaeb16d6eddd1ad972..75aa8e2d0e234998d3e6d12492c32e1a39689d7f 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -15,11 +15,12 @@ John Mandereau    - Translation Meister
 CONTRIBUTORS
 
 Rune Zedeler
+Maximilian Albert
 
 SPONSORS
 
 Mike Amundsen
-
+Trevor Bača
 
 BUG HUNTERS/SUGGESTIONS
 
diff --git a/VERSION b/VERSION
index 1380565e9e23ad59c3090aec2eca325eec525959..60452491a662cd3bad5b3383ec2243533021e422 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=11
-PATCH_LEVEL=13
+PATCH_LEVEL=15
 MY_PATCH_LEVEL=
 
index 0b3b2b7aafa1f431ed8112dccfa95936c35cd728..ed7d0eef255a59078d796e2a7341e25e518df054 100644 (file)
@@ -79,6 +79,9 @@ class SchemeChunk (Chunk):
             and not text.startswith ('(define (')):
             return 0
 
+        if text.startswith  ('(use-modules '):
+            return 0
+
         if (text.startswith  ('(define-public ')
             and not text.startswith ('(define-public (')):
             return 0
@@ -228,7 +231,7 @@ def main ():
 
         if options.uncovered:
             chunks = filter_uncovered (chunks)
-            chunks = [(c.uncovered_score (), c) for c in chunks]
+            chunks = [(c.uncovered_score (), c) for c in chunks if c.uncovered_score() > 0]
         elif options.hotspots:
             chunks = [((c.coverage_count, -c.length()), c) for c in chunks]
             
index a49dceaf9d1416a4e4ceab45372d39d636c09bef..06247e76b52ce23938f37096cf150a1c2939a3e1 100644 (file)
@@ -21,41 +21,65 @@ The result will be files named
 
 \version "2.10.0"
 
+#(ly:set-option 'clip-systems)
 
-% each clip-region is a (START . END) pair
-% where both are rhythmic-locations.
+#(set! output-count 1)
 
-% (make-rhythmic-locations BAR-NUMBER NUM DEN)
-% means NUM/DEN whole-notes into bar numbered BAR-NUMBER
-
-\paper {
+origScore = \score{
+    \relative {
+      \set Staff.instrumentName = #"bla"
+      c1
+      d
+      \grace c16
+      e1
+      \key d\major
+      
+      f
+      \break  \clef bass
+      g,
+      fis
+    }  
+}
 
-  clip-regions
-  = #(list
-      (cons
-       (make-rhythmic-location 2 0 1)
-       (make-rhythmic-location 4 0 1))
+\book { 
+  \score {
+    \origScore
+    \layout {
 
-      (cons
-       (make-rhythmic-location 0 0 1)
-       (make-rhythmic-location 4 0 1))
+      %% each clip-region is a (START . END) pair
+      %% where both are rhythmic-locations.
       
-      (cons
-       (make-rhythmic-location 0 0 1)
-       (make-rhythmic-location 6 0 1))
-    )
+      %% (make-rhythmic-locations BAR-NUMBER NUM DEN)
+      %% means NUM/DEN whole-notes into bar numbered BAR-NUMBER
+
+      clip-regions
+      = #(list
+         (cons
+          (make-rhythmic-location 2 0 1)
+          (make-rhythmic-location 4 0 1))
+
+         (cons
+          (make-rhythmic-location 0 0 1)
+          (make-rhythmic-location 4 0 1))
+         
+         (cons
+          (make-rhythmic-location 0 0 1)
+          (make-rhythmic-location 6 0 1))
+       )
+    }
+  }
 }
 
-\relative {
-  \set Staff.instrumentName = #"bla"
-  c1
-  d
-  \grace c16
-  e1
-  \key d\major
-  
-  f
-  \break  \clef bass
-  g,
-  fis
-}  
+#(set! output-count 0)
+#(ly:set-option 'clip-systems #f)
+
+\book {
+  \score { \origScore }
+  \markup { \bold \fontsize #6 clips }
+  \score {
+    \lyrics {
+      \markup { from-2.0.1-to-4.0.1-clip.eps }
+      \markup { \epsfile #X #30.0 #(format #f "~a-1-from-2.0.1-to-4.0.1-clip.eps" (ly:parser-output-name parser)) }
+    }
+  }
+}
diff --git a/input/regression/dynamics-text-spanner-padding.ly b/input/regression/dynamics-text-spanner-padding.ly
new file mode 100644 (file)
index 0000000..545eb2e
--- /dev/null
@@ -0,0 +1,19 @@
+\header {
+
+  texidoc = "The 2nd half of the cresc. stays at a reasonable distance
+from the notes. "
+
+}
+\version "2.10.13"
+
+\layout {
+  indent = 0.0\mm
+  line-width = 70.0\mm
+}
+
+\relative c' {
+  \setTextCresc
+  c\< c c c | \break
+  c  c\! c c
+}
+
index 201210c353e54f5c58f7d50c35b43871fe4dc367..7512711cb190c2120fb37aa7b95c5f0eb0bdd6d8 100644 (file)
@@ -9,12 +9,17 @@
 }
 
 \relative c'' {
-  \override TextSpanner #'edge-text = #'("foo" . "bar")
   \override TextSpanner #'bound-padding = #1.0
   \override TextSpanner #'dash-fraction = #'()
-  \override TextSpanner #'arrow = ##t
+  \override TextSpanner #'bound-details #'right #'arrow = ##t
+  \override TextSpanner #'bound-details #'left #'text = #"fof"
+  \override TextSpanner #'bound-details #'right #'text = #"gag"
+  \override TextSpanner #'bound-details #'right #'padding = #0.6
+
+  \override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #CENTER
+  \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #CENTER
   
-  \override Glissando #'arrow = ##t
+  \override Glissando #'bound-details #'right #'arrow = ##t
   \override Glissando #'arrow-length = #0.5
   \override Glissando #'arrow-width = #0.25
   
diff --git a/input/regression/line-dashed-period.ly b/input/regression/line-dashed-period.ly
new file mode 100644 (file)
index 0000000..dd0b55e
--- /dev/null
@@ -0,0 +1,27 @@
+\header {
+
+  texidoc = "The period of a dashed line is adjusted such that it
+starts and ends on a full dash. "
+
+}
+
+\version "2.11.13"
+
+\layout {
+  indent = 0.0\mm
+  ragged-right = ##T
+}
+
+\relative <<
+  \new Staff {
+    \override DynamicTextSpanner #'dash-fraction = ##f
+    \setTextCresc
+    c1_\< c c1\!
+  }
+  \new Staff {
+    \override DynamicTextSpanner #'dash-period = #3
+    \override DynamicTextSpanner #'dash-fraction = #0.3
+    \setTextCresc
+    c1^\< c c1\!
+  }
+>>
diff --git a/input/regression/markup-commands.ly b/input/regression/markup-commands.ly
new file mode 100644 (file)
index 0000000..dc01e9e
--- /dev/null
@@ -0,0 +1,35 @@
+\header
+{
+
+  texidoc = "test various markup commands."
+
+}
+\paper { ragged-right = ##T }
+\version "2.11.13"
+
+{
+  g'_\markup {
+    \column {
+      \line { 
+       foo \magnify #2 foo
+       LOWER \lower #3 LOWER
+       \large \bold { normal \normal-text normal }
+       Small-Caps \smallCaps   Small-Caps
+      }
+      
+      \override #'(line-width . 50) 
+      \override #'(bla . "This is a field containing text. Blah blah
+blah.  This is a field containing text. Blah blah blah.  This is a
+field containing text. Blah blah blah.  This is a field containing
+text. Blah blah blah. This is a field containing text. Blah blah
+blah.") 
+      \column  {
+       justify:
+       \justify-field #'bla
+       wordwrap:
+       \wordwrap-field #'bla
+      }
+      
+    }
+  }
+}
index 1a1afb1d284a423916aa897ea18867afaa1b249f..1450098a1ca648e0277eb2b38d851f850e8fa0e4 100644 (file)
@@ -37,5 +37,5 @@ foobar =  \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^  }
 
   << \applyMusic #(lambda (x) (music-map notes-to-skip x))
      \foobar
-     { d2 d2 } >> 
+     { d8 d d d d d d d  } >> 
 }
diff --git a/input/regression/skip-of-length.ly b/input/regression/skip-of-length.ly
new file mode 100644 (file)
index 0000000..e80bede
--- /dev/null
@@ -0,0 +1,25 @@
+\header {
+  texidoc = "skip-of-length and mmrest-of-length create skips and rests that
+last as long as their arguments."
+  
+}
+\paper {
+  ragged-right = ##T
+}
+
+\version "2.11.13"
+
+\relative
+<<
+  \new Staff {
+    c\breve    f4 r2.
+    c\breve    f4 r2.
+    s\breve^"skip"
+  }
+  \new Staff {
+    \applyMusic #skip-of-length { c\breve } f4 r2.
+    \applyMusic #mmrest-of-length { c\breve } f4 r2.
+    \displayMusic \musicMap #skip->rest s\breve 
+  }
+>>
+  
index d1d7cc502176c0f206f2bf789dccc0a89f39a878..02b26c068eab03f98d0f91ea90694e64ba0138ba 100644 (file)
@@ -10,24 +10,24 @@ large on smaller staves."
 \version "2.11.11"
 
 \layout {
-  #(layout-set-staff-size 6)
   ragged-right = ##t
 }
 
+melody = \relative {
+  \override DynamicText  #'extra-offset = #'(0 . 3)
+  s1-\f c''8[(\< r a g]) e[ r d( <f a>])\! \times 2/3 { d4 d d }
+}
+
 <<
   \new Staff \with {
     fontSize = #-4
     \override StaffSymbol #'staff-space = #(magstep -4)
+  } {
+    \melody
   }
-  \relative c' {
-    \override DynamicText  #'extra-offset = #'(0 . 3)
-    s1-\f c''8[(\< r a g]) e[ r d( <f a>])\! \times 2/3 { d4 d d }
-                           }
-    \new Staff
+  \new Staff {
     \relative c' {
-      \override DynamicText  #'extra-offset = #'(0 . 3)
-      s1-\f c''8[(\< r a g]) e[ r d( <f a>])\! \times 2/3 { d4 d d }
-                             }
-    >>
-
-
+      \melody
+    }
+  }
+>>
index cbc1478608fba2bc42ddf31c34ae5a5b59157da4..15049f5bc0d076c568cc395608bd46a808407bb4 100644 (file)
@@ -251,6 +251,8 @@ Accidental_placement::calc_positioning_done (SCM smob)
   if (!me->is_live ())
     return SCM_BOOL_T;
 
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   SCM accs = me->get_object ("accidental-grobs");
   if (!scm_is_pair (accs))
     return SCM_BOOL_T;
index 69fb5e921c3a56f4efd3867493d75fb2cf0b8840..68077c817622aa69c77bcda35d434bb808a5a12d 100644 (file)
@@ -30,6 +30,9 @@ SCM
 Align_interface::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   SCM axis = scm_car (me->get_property ("axes"));
   Axis ax = Axis (scm_to_int (axis));
 
diff --git a/lily/all-font-metrics-scheme.cc b/lily/all-font-metrics-scheme.cc
new file mode 100644 (file)
index 0000000..c74f959
--- /dev/null
@@ -0,0 +1,36 @@
+/* 
+  all-font-metrics-scheme.cc -- implement bindings for
+  All_font_metrics.
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2007 Han-Wen Nienhuys <hanwen@lilypond.org>
+  
+*/
+
+#include "all-font-metrics.hh"
+#include "main.hh"
+
+LY_DEFINE (ly_reset_all_fonts, "ly:reset-all-fonts", 0, 0, 0,
+          (),
+          "Forget all about previously loaded fonts. ")
+{
+  delete all_fonts_global;
+  all_fonts_global = new All_font_metrics (global_path.to_string ());
+
+  return SCM_UNSPECIFIED;
+}
+
+
+LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0,
+          (SCM name),
+          "Load the font @var{name}. ")
+{
+  LY_ASSERT_TYPE(scm_is_string, name, 1);
+  
+  Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
+
+  return fm->self_scm ();
+}
+
+
index f8da4b2ecdf4ef205e0989baa64b83f85b0ba76c..8a1143a537e2d33982506d4f7102e4c1e8590d28 100644 (file)
@@ -147,27 +147,3 @@ All_font_metrics::find_font (string name)
 }
 
 All_font_metrics *all_fonts_global;
-
-LY_DEFINE (ly_reset_all_fonts, "ly:reset-all-fonts", 0, 0, 0,
-          (),
-          "Forget all about previously loaded fonts. ")
-{
-  delete all_fonts_global;
-  all_fonts_global = new All_font_metrics (global_path.to_string ());
-
-  return SCM_UNSPECIFIED;
-}
-
-
-LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0,
-          (SCM name),
-          "Load the font @var{name}. ")
-{
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
-
-  Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
-
-  return fm->self_scm ();
-}
-
-
index d0470b5a75c1ffad648d8ba1f8d6865d787540ea..11306233be02fb1e07f2be1b6f52a9427d8a1c78 100644 (file)
@@ -19,8 +19,8 @@ LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent",
   Grob_array *ga = unsmob_grob_array (elements);
 
   SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array");
-  SCM_ASSERT_TYPE (unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+  LY_ASSERT_SMOB(Grob, common, 2);
+  LY_ASSERT_TYPE(is_axis, axis, 3);
 
   vector<Grob*> elts;
   if (!ga)
index 84ba60c83f60d0187f7b3a000a09423d7a3be1d5..9f2396504248255304a885ac9d6773718798dfa6 100644 (file)
@@ -36,8 +36,6 @@ protected:
 void
 Bar_number_engraver::process_music ()
 {
-  // todo include (&&!time->cadenza_b_)
-
   SCM wb = get_property ("whichBar");
 
   if (scm_is_string (wb))
index 695cb80b6eb2b8a950758b403b7e3bc3cb021507..7ef972ec27cdc721660ae36827673d31cb334e8b 100644 (file)
@@ -160,10 +160,8 @@ Beam::quanting (SCM smob, SCM posns)
   Real xr = fvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
 
   /*
-    We store some info to quickly interpolate.
-
-    Sometimes my head is screwed on backwards.  The stemlength are
-    AFFINE linear in YL and YR. If YL == YR == 0, then we might have
+    We store some info to quickly interpolate.  The stemlength are
+    affine linear in YL and YR. If YL == YR == 0, then we might have
     stem_y != 0.0, when we're cross staff.
 
   */
@@ -179,11 +177,18 @@ Beam::quanting (SCM smob, SCM posns)
       bool f = to_boolean (s->get_property ("french-beaming"))
        && s != lvs && s != fvs;
 
-      base_lengths.push_back (calc_stem_y (me, s, common, xl, xr,
-                                     Interval (0, 0), f) / ss);
+      if (Stem::is_normal_stem (s))
+       {
+         base_lengths.push_back (calc_stem_y (me, s, common, xl, xr,
+                                              Interval (0, 0), f) / ss);
+       }
+      else
+       {
+         base_lengths.push_back (0);
+       }
+
       stem_xposns.push_back (s->relative_coordinate (common[X_AXIS], X_AXIS));
     }
-
   bool xstaff = false;
   if (lvs && fvs)
     {
@@ -348,7 +353,7 @@ Beam::score_stem_lengths (vector<Grob*> const &stems,
   for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
-      if (Stem::is_invisible (s))
+      if (!Stem::is_normal_stem (s))
        continue;
 
       Real x = stem_xs[i];
index 75f859ffe4a46e274be806ecce5c548631e3b452..18cfae23cd2f58462b524a5387c95ad8871d7b92 100644 (file)
@@ -1306,7 +1306,7 @@ Beam::last_normal_stem (Grob *me)
 
   rest -> stem -> beam -> interpolate_y_position ()
 */
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Beam, rest_collision_callback, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Beam, rest_collision_callback, 2, 1, "");
 SCM
 Beam::rest_collision_callback (SCM smob, SCM prev_offset)
 {
index 23237dbb0d7559e9cfa877d85f7a28596835a3d8..516ad6fbe40f2705e235826ec84f4b5de2dbafdc 100644 (file)
@@ -19,8 +19,7 @@ LY_DEFINE (ly_make_book, "ly:make-book",
           "containing @code{\\scores}.")
 {
   Output_def *odef = unsmob_output_def (paper);
-  SCM_ASSERT_TYPE (odef, paper,
-                  SCM_ARG1, __FUNCTION__, "Output_def");
+  LY_ASSERT_SMOB (Output_def, paper, 1);
 
   Book *book = new Book;
   book->paper_ = odef;
@@ -35,7 +34,7 @@ LY_DEFINE (ly_make_book, "ly:make-book",
   return x;
 }
 
-LY_DEFINE (ly_parser_print_book, "ly:book-process",
+LY_DEFINE (ly_book_process, "ly:book-process",
           4, 0, 0, (SCM book_smob,
                     SCM default_paper,
                     SCM default_layout,
@@ -47,11 +46,9 @@ LY_DEFINE (ly_parser_print_book, "ly:book-process",
 {
   Book *book = unsmob_book (book_smob);
 
-  SCM_ASSERT_TYPE (book, book_smob, SCM_ARG1, __FUNCTION__, "Book");
-  SCM_ASSERT_TYPE (unsmob_output_def (default_paper),
-                  default_layout, SCM_ARG2, __FUNCTION__, "\\paper block");
-  SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
-                  default_layout, SCM_ARG3, __FUNCTION__, "\\layout block");
+  LY_ASSERT_SMOB(Book, book_smob, 1);
+  LY_ASSERT_SMOB(Output_def, default_paper, 2);
+  LY_ASSERT_SMOB(Output_def, default_layout, 3);
 
   Paper_book *pb = book->process (unsmob_output_def (default_paper),
                                  unsmob_output_def (default_layout));
@@ -65,7 +62,7 @@ LY_DEFINE (ly_parser_print_book, "ly:book-process",
 }
 
 
-LY_DEFINE (ly_parser_print_book_to_systems, "ly:book-process-to-systems",
+LY_DEFINE (ly_book_process_to_systems, "ly:book-process-to-systems",
           4, 0, 0, (SCM book_smob,
                     SCM default_paper,
                     SCM default_layout,
@@ -75,13 +72,11 @@ LY_DEFINE (ly_parser_print_book_to_systems, "ly:book-process-to-systems",
           "a string (for file based outputs) or a socket (for network based "
           "output).")
 {
-  Book *book = unsmob_book (book_smob);
+  LY_ASSERT_SMOB (Book, book_smob, 1);
+  LY_ASSERT_SMOB(Output_def, default_paper, 2);
+  LY_ASSERT_SMOB(Output_def, default_layout, 3);
 
-  SCM_ASSERT_TYPE (book, book_smob, SCM_ARG1, __FUNCTION__, "Book");
-  SCM_ASSERT_TYPE (unsmob_output_def (default_paper),
-                  default_layout, SCM_ARG2, __FUNCTION__, "\\paper block");
-  SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
-                  default_layout, SCM_ARG3, __FUNCTION__, "\\layout block");
+  Book *book = unsmob_book (book_smob); 
 
   Paper_book *pb = book->process (unsmob_output_def (default_paper),
                                  unsmob_output_def (default_layout));
index f4d4dd790e1310b31cc53223b3e23f4b6f4e9404..01e52ce9cdce87151b731a9301e653813a399af1 100644 (file)
@@ -83,11 +83,6 @@ Book::mark_smob (SCM s)
 {
   Book *book = (Book *) SCM_CELL_WORD_1 (s);
 
-#if 0
-  if (book->key_)
-    scm_gc_mark (book->key_->self_scm ());
-#endif
-
   if (book->paper_)
     scm_gc_mark (book->paper_->self_scm ());
   scm_gc_mark (book->scores_);
index 61eca90ab6b3611ef98d0a0c63fa5bf752519241..c2c335434962a6e7b32d268580c276d7701bc5ea 100644 (file)
@@ -93,6 +93,9 @@ Break_alignment_interface::calc_positioning_done (SCM smob)
   Grob *grob = unsmob_grob (smob);  
   Item *me = dynamic_cast<Item *> (grob);
 
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   vector<Grob*> elems = ordered_elements (me);
   vector<Interval> extents;
 
index a6ee973a1c3adc37164f4157ea54ba07c7b628c5..30a876f36d3fbc44f89b64e3bd04109447d460c3 100644 (file)
@@ -18,7 +18,8 @@ LY_DEFINE (ly_context_id, "ly:context-id",
           "return the string @code{one}.")
 {
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
+
+  LY_ASSERT_SMOB (Context, context, 1);
 
   return ly_string2scm (tr->id_string ());
 }
@@ -29,8 +30,10 @@ LY_DEFINE (ly_context_name, "ly:context-name",
           "i.e. for @code{\\context Voice = one .. } "
           "return the symbol @code{Voice}.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
+
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
+
   return ly_symbol2scm (tr->context_name ().c_str ());
 }
 
@@ -40,8 +43,9 @@ LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
           "as an alist")
 {
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
 
   return updated_grob_properties (tr, name);
 }
@@ -54,9 +58,10 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
           "or reverted (if  unspecified).")
 {
   Context *tg = unsmob_context (context);
-  SCM_ASSERT_TYPE (tg, context, SCM_ARG1, __FUNCTION__, "context");
-  SCM_ASSERT_TYPE (scm_is_symbol (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
-  SCM_ASSERT_TYPE (scm_is_symbol (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
+
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, grob, 2);
+  LY_ASSERT_TYPE(ly_is_symbol, eltprop, 3);
 
   execute_pushpop_property (tg, grob, eltprop, val);
 
@@ -67,22 +72,22 @@ LY_DEFINE (ly_context_property, "ly:context-property",
           2, 0, 0, (SCM c, SCM name),
           "Return the value of @var{name} from context @var{c}")
 {
-  Context *t = unsmob_context (c);
-  Context *tr = (t);
-  SCM_ASSERT_TYPE (tr, c, SCM_ARG1, __FUNCTION__, "Translator group");
-  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+  LY_ASSERT_SMOB (Context, c, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
 
-  return tr->internal_get_property (name);
+  Context *t = unsmob_context (c);
+  return t->internal_get_property (name);
 }
 
-LY_DEFINE (ly_context_set_property, "ly:context-set-property!",
+LY_DEFINE (ly_context_set_property_x, "ly:context-set-property!",
           3, 0, 0, (SCM context, SCM name, SCM val),
           "Set value of property @var{name} in context @var{context} "
           "to @var{val}.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
+
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   tr->set_property (name, val);
 
@@ -94,9 +99,10 @@ LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined
           "Return the context above @var{context} "
           "where @var{name} is defined.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
+  
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   SCM val;
   tr = tr->where_defined (name, &val);
@@ -106,14 +112,14 @@ LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined
   return SCM_EOL;
 }
 
-LY_DEFINE (ly_unset_context_property, "ly:context-unset-property", 2, 0, 0,
+LY_DEFINE (ly_context_unset_property, "ly:context-unset-property", 2, 0, 0,
           (SCM context, SCM name),
           "Unset value of property @var{name} in context @var{context}.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
-
+  
   tr->unset_property (name);
   return SCM_UNSPECIFIED;
 }
@@ -122,8 +128,8 @@ LY_DEFINE (ly_context_parent, "ly:context-parent",
           1, 0, 0, (SCM context),
           "Return the parent of @var{context}, @code{#f} if none.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
 
   tr = tr->get_parent_context ();
   if (tr)
@@ -138,9 +144,9 @@ LY_DEFINE (ly_context_find, "ly:context-find",
           "Find a parent of @var{context} that has name or alias @var{name}. "
           "Return @code{#f} if not found.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
   Context *tr = unsmob_context (context);
-  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "context");
-  SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
   while (tr)
     {
@@ -156,8 +162,8 @@ LY_DEFINE (ly_context_now, "ly:context-now",
           1, 0, 0, (SCM context),
           "Return now-moment of context CONTEXT")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *ctx = unsmob_context (context);
-  SCM_ASSERT_TYPE (ctx, context, SCM_ARG1, __FUNCTION__, "Context");
   return ctx->now_mom ().smobbed_copy ();
 }
 
@@ -165,8 +171,8 @@ LY_DEFINE (ly_context_event_source, "ly:context-event-source",
            1, 0, 0, (SCM context),
            "Return event-source of context CONTEXT")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *ctx = unsmob_context (context);
-  SCM_ASSERT_TYPE (ctx, context, SCM_ARG1, __FUNCTION__, "Context");
   return ctx->event_source ()->self_scm ();
 }
 
@@ -175,7 +181,7 @@ LY_DEFINE (ly_context_events_below, "ly:context-events-below",
            "Return a stream-distributor that distributes all events\n"
            " from @var{context} and all its subcontexts.")
 {
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *ctx = unsmob_context (context);
-  SCM_ASSERT_TYPE (ctx, context, SCM_ARG1, __FUNCTION__, "Context");
   return ctx->events_below ()->self_scm ();
 }
index 0d6ed607f75eab756d499e74e55d2b36b6bc2401..4025b4078a5d24be0d19db771153e42c2f8e987e 100644 (file)
@@ -14,8 +14,7 @@ LY_DEFINE (ly_pt, "ly:pt",
           1, 0, 0, (SCM num),
           "@var{num} printer points")
 {
-  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                  "number");
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (point_constant
                          * scm_to_double (num));
 }
@@ -24,8 +23,7 @@ LY_DEFINE (ly_cm, "ly:cm",
           1, 0, 0, (SCM num),
           "@var{num} cm")
 {
-  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                  "number");
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (cm_constant
                          * scm_to_double (num));
 }
@@ -34,8 +32,7 @@ LY_DEFINE (ly_inch, "ly:inch",
           1, 0, 0, (SCM num),
           "@var{num} inches")
 {
-  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                  "number");
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (inch_constant
                          * scm_to_double (num));
 }
@@ -44,8 +41,7 @@ LY_DEFINE (ly_mm, "ly:mm",
           1, 0, 0, (SCM num),
           "@var{num} mm")
 {
-  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                  "number");
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (mm_constant
                          * scm_to_double (num));
 }
@@ -54,8 +50,7 @@ LY_DEFINE (ly_bp, "ly:bp",
           1, 0, 0, (SCM num),
           "@var{num} bigpoints (1/72th inch)")
 {
-  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                  "number");
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (bigpoint_constant
                          * scm_to_double (num));
 }
index 9e491e0a9abc185795c01e1c1be5091dd32998da..00c52aca59b3a2989ac71b2e80f4291176376cb2 100644 (file)
@@ -15,14 +15,16 @@ LY_DEFINE (ly_make_dispatcher, "ly:make-dispatcher",
   return (new Dispatcher ())->unprotect ();
 }
 
-LY_DEFINE (ly_register_dispatcher, "ly:connect-dispatchers",
+LY_DEFINE (ly_connect_dispatchers, "ly:connect-dispatchers",
           2, 0, 0, (SCM to, SCM from),
           "Makes the dispatcher @var{to} listen to events from @var{from}." )
 {
   Dispatcher *t = unsmob_dispatcher (to);
   Dispatcher *f = unsmob_dispatcher (from);
-  SCM_ASSERT_TYPE (t, from, SCM_ARG1, __FUNCTION__, "dispatcher");
-  SCM_ASSERT_TYPE (f, to, SCM_ARG2, __FUNCTION__, "dispatcher");
+  
+  LY_ASSERT_SMOB (Dispatcher, to, 1); 
+  LY_ASSERT_SMOB(Dispatcher, from,  2); 
+
   t->register_as_listener (f);
 
   return SCM_UNDEFINED;
@@ -35,8 +37,9 @@ LY_DEFINE (ly_add_listener, "ly:add-listener",
 {
   Listener *l = unsmob_listener (list);
   Dispatcher *d = unsmob_dispatcher (disp);
-  SCM_ASSERT_TYPE (l, list, SCM_ARG1, __FUNCTION__, "listener");
-  SCM_ASSERT_TYPE (d, disp, SCM_ARG2, __FUNCTION__, "dispatcher");
+
+  LY_ASSERT_SMOB (Listener, list, 1); 
+  LY_ASSERT_SMOB(Dispatcher, disp, 2); 
   
   for (int arg = SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
     {
@@ -55,8 +58,10 @@ LY_DEFINE (ly_broadcast, "ly:broadcast",
 {
   Dispatcher *d = unsmob_dispatcher (disp);
   Stream_event *e = unsmob_stream_event (ev);
-  SCM_ASSERT_TYPE (d, disp, SCM_ARG1, __FUNCTION__, "dispatcher");
-  SCM_ASSERT_TYPE (e, ev, SCM_ARG2, __FUNCTION__, "stream event");
+  LY_ASSERT_SMOB (Dispatcher, disp, 1);
+
+  LY_ASSERT_SMOB(Stream_event, ev, 2); 
   d->broadcast (e);
   return SCM_UNDEFINED;
 }
index 173a9ad981f3add800a0295f074f56a343b9bfc4..b2ff0308fac19b82bd251167a4255d2698e9bcb0 100644 (file)
@@ -213,6 +213,9 @@ SCM
 Dot_column::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);  
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   vector<Grob*> dots
     = extract_grob_array (me, "dots");
 
index 4b8c4605c0e19e40c984c4b1e4fe424a7b112d0c..11e6b58d0d5be3619db549045015bf1fbbc921bb 100644 (file)
@@ -27,12 +27,12 @@ LY_DEFINE (ly_duration_less_p, "ly:duration<?",
           2, 0, 0, (SCM p1, SCM p2),
           "Is @var{p1} shorter than @var{p2}?")
 {
+  LY_ASSERT_SMOB(Duration, p1, 1);
+  LY_ASSERT_SMOB(Duration, p2, 2);
+
   Duration *a = unsmob_duration (p1);
   Duration *b = unsmob_duration (p2);
 
-  SCM_ASSERT_TYPE (a, p1, SCM_ARG1, __FUNCTION__, "Duration");
-  SCM_ASSERT_TYPE (b, p2, SCM_ARG2, __FUNCTION__, "Duration");
-
   if (Duration::compare (*a, *b) < 0)
     return SCM_BOOL_T;
   else
@@ -53,21 +53,19 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
           "(whole, half, quarter, etc.) and a number of augmentation\n"
           "dots. \n")
 {
-  SCM_ASSERT_TYPE (scm_is_integer (length),
-                  length, SCM_ARG1, __FUNCTION__, "integer");
+  LY_ASSERT_TYPE (scm_is_integer, length, 1);
 
   int dots = 0;
   if (dotcount != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_integer (dotcount),
-                      dotcount, SCM_ARG2, __FUNCTION__, "integer");
+      LY_ASSERT_TYPE (scm_is_integer, dotcount,2);
       dots = scm_to_int (dotcount);
     }
 
   bool compress = false;
   if (num != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG3, __FUNCTION__, "integer");
+      LY_ASSERT_TYPE (scm_is_number,num, 3);
       compress = true;
     }
   else
@@ -75,7 +73,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
 
   if (den != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_number (den), den, SCM_ARG4, __FUNCTION__, "integer");
+      LY_ASSERT_TYPE (scm_is_number,den, 4);
       compress = true;
     }
   else
@@ -92,7 +90,7 @@ LY_DEFINE (ly_duration_log, "ly:duration-log",
           1, 0, 0, (SCM dur),
           "Extract the duration log from @var{dur}")
 {
-  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return scm_from_int (unsmob_duration (dur)->duration_log ());
 }
 
@@ -100,7 +98,7 @@ LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
           1, 0, 0, (SCM dur),
           "Extract the dot count from @var{dur}")
 {
-  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return scm_from_int (unsmob_duration (dur)->dot_count ());
 }
 
@@ -108,7 +106,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
           1, 0, 0, (SCM d),
           "The 2-logarithm of 1/@var{d}.")
 {
-  SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG1, __FUNCTION__, "integer");
+  LY_ASSERT_TYPE (scm_is_number, d, 1);
   int log = intlog2 (scm_to_int (d));
   return scm_from_int (log);
 }
@@ -117,15 +115,15 @@ LY_DEFINE (ly_duration_length, "ly:duration-length",
           1, 0, 0, (SCM dur),
           "The length of the duration as a Moment.")
 {
-  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy ();
 }
 
-LY_DEFINE (ly_duration2string, "ly:duration->string",
+LY_DEFINE (ly_duration_2_string, "ly:duration->string",
           1, 0, 0, (SCM dur),
           "Convert @var{dur} to string.")
 {
-  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return ly_string2scm (unsmob_duration (dur)->to_string ());
 }
 
@@ -133,7 +131,7 @@ LY_DEFINE (ly_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
           "Extract the compression factor from @var{dur}. Return as a pair.")
 {
-  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  LY_ASSERT_SMOB (Duration, dur, 1);
   Rational r = unsmob_duration (dur)->factor ();
   return scm_cons (scm_from_int (r.num ()), scm_from_int (r.den ()));
 }
index ac74d5e93064f9c808dccf6358fc95fae9465cc3..84780dd0a2fc489997560a472ab67db2bb18fab3 100644 (file)
@@ -96,8 +96,7 @@ LY_DEFINE (ly_set_grob_creation_callback, "ly:set-grob-creation-callback",
           "the grob to be created and the corresponding line number in the "
           "C++ source file.")
 {
-  SCM_ASSERT_TYPE(ly_is_procedure (cb), cb, SCM_ARG1, __FUNCTION__,
-                 "procedure");
+  LY_ASSERT_TYPE (ly_is_procedure, cb, 1);
 
   creation_callback = cb;
 
index 5d734899b2b8a3cf95ba7a91d4a7ec19dc0c0bd2..5fa68f862c094f697b7a29cd031c245830901482 100644 (file)
@@ -89,9 +89,7 @@ LY_DEFINE (ly_font_config_get_font_file, "ly:font-config-get-font-file", 1, 0, 0
           (SCM name),
           "Get the file for font @var{name}")
 {
-  SCM_ASSERT_TYPE (scm_is_string (name), name,
-                  SCM_ARG1, __FUNCTION__, "string");
-
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   
   FcPattern*pat = FcPatternCreate ();
   FcValue val;
index 18edb7513a060344de7036c85cb641ae29376493..a1e18da2c24e120efabdaa078d1916d18440ecf4 100644 (file)
@@ -20,8 +20,8 @@ LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph",
           "is not available, return @code{#f}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG2, __FUNCTION__, "string");
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,name, 2);
 
   Stencil m = fm->find_by_name (ly_scm2string (name));
 
@@ -36,8 +36,8 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph",
           "in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (scm_is_number (index), index, SCM_ARG2, __FUNCTION__, "number");
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_number, index,2);
 
   return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
 }
@@ -48,8 +48,8 @@ LY_DEFINE (ly_font_glyph_name_to_index, "ly:font-glyph-name-to-index",
           "Return the index for @var{name} in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG2, __FUNCTION__, "string");
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,name, 2);
 
   return scm_from_int (fm->name_to_index (ly_scm2string (name)));
 }
@@ -60,8 +60,8 @@ LY_DEFINE (ly_font_index_to_charcode, "ly:font-index-to-charcode",
           "Return the character code for @var{index} @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (scm_is_integer (index), index, SCM_ARG2, __FUNCTION__, "index");
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_integer,index, 2);
 
   return scm_from_unsigned_integer (fm->index_to_charcode (scm_to_int (index)));
 }
@@ -72,8 +72,8 @@ LY_DEFINE (ly_font_glyph_name_to_charcode, "ly:font-glyph-name-to-charcode",
           "Return the character code for glyph @var{name} in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG2, __FUNCTION__, "string");
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,name, 2);
 
   return scm_from_unsigned_integer (fm->index_to_charcode (fm->name_to_index (ly_scm2string (name))));
 }
@@ -89,8 +89,8 @@ LY_DEFINE (ly_text_dimension, "ly:text-dimension",
   Modified_font_metric *fm = dynamic_cast<Modified_font_metric *>
     (unsmob_metrics (font));
 
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "modified font metric");
-  SCM_ASSERT_TYPE (scm_is_string (text), text, SCM_ARG2, __FUNCTION__, "string");
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,text, 2);
   Stencil stc (fm->text_stencil (ly_scm2string (text)));
   return scm_cons (ly_interval2scm (stc.extent (X_AXIS)),
                   ly_interval2scm (stc.extent (Y_AXIS)));
@@ -106,8 +106,9 @@ LY_DEFINE (ly_font_file_name, "ly:font-file-name",
           "Given the font metric @var{font}, "
           "return the corresponding file name.")
 {
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
   SCM name = fm->font_file_name ();
 
   return name;
@@ -119,19 +120,20 @@ LY_DEFINE (ly_font_name, "ly:font-name",
           "Given the font metric @var{font}, "
           "return the corresponding name.")
 {
+  LY_ASSERT_SMOB (Font_metric, font, 1);
   Font_metric *fm = unsmob_metrics (font);
 
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
   return ly_string2scm (fm->font_name ());
 }
 
 LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
           (SCM font),
           "Given the font metric @var{font}, return the "
-          "magnification, relative to the current outputs-cale.")
+          "magnification, relative to the current output-scale.")
 {
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
   return scm_cdr (fm->description_);
 }
 
@@ -140,8 +142,9 @@ LY_DEFINE (ly_font_design_size, "ly:font-design-size", 1, 0, 0,
           "Given the font metric @var{font}, return the "
           "design size, relative to the current output-scale.")
 {
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
   return scm_from_double (fm->design_size ());
 }
 
index 7e450528ae13e65813f26cbbd6baeba9fa61a6ef..38e85837c0f6397b894c3f14b29cf67b59e6c5bc 100644 (file)
@@ -11,15 +11,33 @@ using namespace std;
 
 #include "std-string.hh"
 #include "lily-guile.hh"
+#include "warn.hh"
+
+/* type predicates. */
+#include "spanner.hh"
+#include "item.hh"
+
 
 static SCM doc_hash_table;
 
-void ly_add_function_documentation (SCM func,
-                                   char const *fname,
-                                   char const *varlist,
-                                   char const *doc)
+void
+ly_check_name (string cxx, string scm_name)
+{
+  string mangle = mangle_cxx_identifier (cxx);
+  if (mangle != scm_name)
+    {
+      programming_error ("wrong cxx name: " + mangle + ", " + cxx +  ", " + scm_name);
+    }
+}
+
+
+void
+ly_add_function_documentation (SCM func,
+                                   string fname,
+                                   string varlist,
+                                   string doc)
 {
-  if (!strlen (doc))
+  if (doc == "")
     return;
 
   if (!doc_hash_table)
@@ -30,8 +48,8 @@ void ly_add_function_documentation (SCM func,
 
   scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
                                ly_string2scm (s));
-  SCM entry = scm_cons (scm_from_locale_string (varlist), scm_from_locale_string (doc));
-  scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
+  SCM entry = scm_cons (ly_string2scm (varlist), ly_string2scm (doc));
+  scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname.c_str()), entry);
 }
 
 LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
@@ -40,3 +58,55 @@ LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation
 {
   return doc_hash_table;
 }
+
+
+#include <map>
+
+map<void *, string>  type_names;
+  
+void
+ly_add_type_predicate (void *ptr,
+                      string name)
+{
+  type_names[ptr] = name; 
+}
+
+string
+predicate_to_typename (void *ptr)
+{
+  if (type_names.find (ptr) == type_names.end ())
+    return "unknown type";
+  else
+    return type_names[ptr];
+}
+
+static int
+arg_dir (int a, int b)
+{
+  if (&a < &b)
+    return 1;
+  else
+    return -1;
+}
+
+
+int function_argument_direction;
+void
+init_func_doc ()
+{
+  function_argument_direction = arg_dir (2,3);
+
+  ly_add_type_predicate ((void*) &scm_is_integer, "integer");
+  ly_add_type_predicate ((void*) &scm_is_bool, "boolean");
+  ly_add_type_predicate ((void*) &scm_is_pair, "pair");
+  ly_add_type_predicate ((void*) &is_number_pair, "number pair");
+  ly_add_type_predicate ((void*) &scm_is_number, "number");
+  ly_add_type_predicate ((void*) &scm_is_string, "string");
+  ly_add_type_predicate ((void*) &ly_is_symbol, "symbol");
+  ly_add_type_predicate ((void*) &scm_is_vector, "vector");
+  ly_add_type_predicate ((void*) &is_axis, "axis");
+  ly_add_type_predicate ((void*) &unsmob_spanner, "spanner");
+  ly_add_type_predicate ((void*) &unsmob_item, "item");
+}
+
+ADD_SCM_INIT_FUNC(func_doc, init_func_doc);
index cbc3b605ed13c9be41229f04db1119f952b772f4..7f741d059cf2289d85772fa2f07c6cf1e3514a50 100644 (file)
@@ -32,7 +32,7 @@ LY_DEFINE (ly_find_file, "ly:find-file",
           "Return the absolute file name of @var{name}, "
           "or @code{#f} if not found.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
 
   string nm = ly_scm2string (name);
   string file_name = global_path.find (nm);
@@ -51,11 +51,11 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file",
           "Read the file @var{name}, and return its contents in a string.  "
           "The file is looked up using the search path. ")
 {
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   int sz = INT_MAX;
   if (size != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_number (size), size, SCM_ARG2, __FUNCTION__, "number");
+      LY_ASSERT_TYPE(scm_is_number,size, 2);
       sz = scm_to_int (size);
     }
   
@@ -68,7 +68,7 @@ LY_DEFINE (ly_error, "ly:error",
           "Scheme callable function to issue the error @code{msg}. "
           "The error is formatted with @code{format} and @code{rest}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   error (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -79,7 +79,7 @@ LY_DEFINE (ly_message, "ly:message",
           "Scheme callable function to issue the message @code{msg}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   message (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -90,7 +90,7 @@ LY_DEFINE (ly_progress, "ly:progress",
           "Scheme callable function to print progress @code{str}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   progress_indication (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -101,7 +101,7 @@ LY_DEFINE (ly_programming_error, "ly:programming-error",
           "Scheme callable function to issue the warning @code{msg}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   programming_error (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -112,7 +112,7 @@ LY_DEFINE (ly_warning, "ly:warning",
           "Scheme callable function to issue the warning @code{str}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   warning (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -152,9 +152,9 @@ LY_DEFINE (ly_string_substitute, "ly:string-substitute",
           3, 0, 0, (SCM a, SCM b, SCM s),
           "Replace @var{a} by @var{b} in @var{s}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (a), s, SCM_ARG1, __FUNCTION__, "string");
-  SCM_ASSERT_TYPE (scm_is_string (b), s, SCM_ARG2, __FUNCTION__, "string");
-  SCM_ASSERT_TYPE (scm_is_string (s), s, SCM_ARG3, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, s, 1);
+  LY_ASSERT_TYPE(scm_is_string,b, 2);
+  LY_ASSERT_TYPE(scm_is_string,s, 3);
 
   string ss = ly_scm2string (s);
   replace_all (ss, string (scm_i_string_chars (a)),
@@ -162,11 +162,11 @@ LY_DEFINE (ly_string_substitute, "ly:string-substitute",
   return ly_string2scm (ss);
 }
   
-LY_DEFINE (ly_number2string, "ly:number->string",
+LY_DEFINE (ly_number_2_string, "ly:number->string",
           1, 0, 0, (SCM s),
           "Convert @var{num} to a string without generating many decimals.")
 {
-  SCM_ASSERT_TYPE (scm_is_number (s), s, SCM_ARG1, __FUNCTION__, "number");
+  LY_ASSERT_TYPE (scm_is_number, s, 1);
 
   char str[400];                       // ugh.
 
@@ -224,8 +224,7 @@ LY_DEFINE (ly_gettext, "ly:gettext",
           1, 0, 0, (SCM string),
           "Gettext wrapper.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (string), string, SCM_ARG1,
-                  __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, string, 1);
   return ly_string2scm (_ (scm_i_string_chars (string)));
 }
 
@@ -251,13 +250,13 @@ LY_DEFINE (ly_output_formats, "ly:output-formats",
   return lst;
 }
 
-LY_DEFINE (ly_wchar_to_utf_8, "ly:wide-char->utf-8",
+LY_DEFINE (ly_wide_char_2_utf_8, "ly:wide-char->utf-8",
           1, 0, 0, (SCM wc),
           "Encode the Unicode codepoint @var{wc}, an integer, as UTF-8")
 {
   char buf[5];
 
-  SCM_ASSERT_TYPE (scm_is_integer (wc), wc, SCM_ARG1, __FUNCTION__, "integer");
+  LY_ASSERT_TYPE (scm_is_integer, wc, 1);
   unsigned wide_char = (unsigned) scm_to_int (wc);
   char *p = buf;
 
@@ -315,8 +314,7 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect",
           1, 1, 0, (SCM file_name, SCM mode),
           "Redirect stderr to FILE-NAME, opened with MODE.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (file_name), file_name, SCM_ARG1,
-                  __FUNCTION__, "file_name");
+  LY_ASSERT_TYPE (scm_is_string, file_name, 1);
 
   string m = "w";
   if (mode != SCM_UNDEFINED && scm_string_p (mode))
@@ -344,12 +342,11 @@ LY_DEFINE(ly_hash_table_keys, "ly:hash-table-keys",
                                 NULL, SCM_EOL, tab);
 }
 
-LY_DEFINE (ly_camel_case_to_lisp_identifier, "ly:camel-case->lisp-identifier",
+LY_DEFINE (ly_camel_case_2_lisp_identifier, "ly:camel-case->lisp-identifier",
           1, 0, 0, (SCM name_sym),
           "Convert FooBar_Bla to foo-bar-bla style symbol.")
 {
-  SCM_ASSERT_TYPE(scm_is_symbol (name_sym), name_sym,
-                 SCM_ARG1, __FUNCTION__, "symbol");
+  LY_ASSERT_TYPE (ly_is_symbol, name_sym, 1);
   
   /*
     TODO: should use strings instead?
@@ -365,8 +362,7 @@ LY_DEFINE (ly_expand_environment, "ly:expand-environment",
           1, 0, 0, (SCM str),
           "Expand $VAR and $@{VAR@} in @var{str}.")
 {
-  SCM_ASSERT_TYPE(scm_is_string (str), str,
-                 SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
 
   return ly_string2scm (expand_environment_variables (ly_scm2string (str)));
 }
@@ -376,8 +372,7 @@ LY_DEFINE (ly_truncate_list_x, "ly:truncate-list!",
           2, 0, 0, (SCM lst, SCM i),
           "Take at most the first @var{i} of list @var{lst}")
 {
-  SCM_ASSERT_TYPE(scm_is_integer (i), i,
-                 SCM_ARG1, __FUNCTION__, "integer");
+  LY_ASSERT_TYPE (scm_is_integer, i, 1);
 
   int k = scm_to_int (i);
   if (k == 0)
@@ -432,7 +427,7 @@ LY_DEFINE (ly_format, "ly:format",
           1, 0, 1, (SCM str, SCM rest),
           "LilyPond specific format, supporting ~a ~[0-9]f.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
 
   string format = ly_scm2string (str);
   vector<string> results;
index c5f4d561f9966487c647527f8d189809ef0a8d6b..c888487776684bc24ed9a26109d3e6f64a3c0f66 100644 (file)
@@ -5,6 +5,7 @@
 
   (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
+
 #include "cpu-timer.hh"
 #include "global-context.hh"
 #include "international.hh"
@@ -22,7 +23,8 @@ LY_DEFINE (ly_format_output, "ly:format-output",
           "process it and return the @code{Music_output} object in its final state.")
 {
   Global_context *g = dynamic_cast<Global_context *> (unsmob_context (context));
-  SCM_ASSERT_TYPE (g, context, SCM_ARG1, __FUNCTION__, "Global context");
+  
+  LY_ASSERT_TYPE (unsmob_global_context, context, 1)
 
   SCM output = g->get_output ();
   progress_indication ("\n");
@@ -39,7 +41,7 @@ LY_DEFINE (ly_make_global_translator, "ly:make-global-translator",
           "@var{global}. The translator group is returned.")
 {
   Global_context *g = dynamic_cast<Global_context *> (unsmob_context (global));
-  SCM_ASSERT_TYPE (g, global, SCM_ARG1, __FUNCTION__, "Global context");
+  LY_ASSERT_TYPE (unsmob_global_context, global, 1)
 
   Translator_group *tg = new Translator_group ();
   tg->connect_to_context (g);
@@ -55,10 +57,8 @@ LY_DEFINE (ly_make_global_context, "ly:make-global-context",
           "The context is returned.\n"
           )
 {
-  Output_def *odef = unsmob_output_def (output_def);
-
-  SCM_ASSERT_TYPE (odef, output_def, SCM_ARG1, __FUNCTION__,
-                  "Output definition");
+  LY_ASSERT_SMOB (Output_def, output_def, 1);
+  Output_def *odef = unsmob_output_def (output_def); 
 
   Global_context *glob = new Global_context (odef);
 
@@ -77,11 +77,10 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
           "global context @var{ctx}. The context is returned in its\n"
           "final state.\n")
 {
-  Music *music = unsmob_music (mus);
-  Global_context *g = dynamic_cast<Global_context *> (unsmob_context (ctx));
-  SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
-  SCM_ASSERT_TYPE (g, ctx, SCM_ARG2, __FUNCTION__, "Global context");
+  LY_ASSERT_SMOB (Music, mus, 1);
+  LY_ASSERT_TYPE (unsmob_global_context,ctx, 2);
 
+  Music *music = unsmob_music (mus);
   if (!music
       || !music->get_length ().to_bool ())
     {
@@ -89,6 +88,8 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
       return SCM_BOOL_F;
     }
 
+  Global_context *g = dynamic_cast<Global_context *> (unsmob_context (ctx));
+
   Cpu_timer timer;
 
   message (_ ("Interpreting music... "));
@@ -129,6 +130,9 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
           "Optionally, this routine takes an Object-key to\n"
           "to uniquely identify the Score block containing it.\n")
 {
+  LY_ASSERT_SMOB (Music, mus, 1);
+  LY_ASSERT_SMOB (Output_def, output_def, 2);
+
   SCM glob = ly_make_global_context (output_def);
   ly_make_global_translator (glob);
   ly_interpret_music_expression (mus, glob);
index f4aff0398eeaa977015b2142e212c88985aa7fa8..f31a1283afa7fe1e4862736bf07630d503ff4172 100644 (file)
@@ -196,3 +196,9 @@ Global_context::get_default_interpreter ()
   else
     return Context::get_default_interpreter ();
 }
+
+Global_context *
+unsmob_global_context (SCM x)
+{
+  return dynamic_cast<Global_context *> (unsmob_context (x));
+}
index b242addf9b82ff162260eea895f2dff8f921a998..b74b10fc51aab43d39907c8ab8455c49c2f34cfe 100644 (file)
@@ -15,8 +15,9 @@ LY_DEFINE (ly_grob_array_length, "ly:grob-array-length",
           (SCM grob_arr),
           "Return the grob_array length.")
 {
+  LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
+
   Grob_array *me = unsmob_grob_array (grob_arr);
-  SCM_ASSERT_TYPE (me, grob_arr, SCM_ARG1, __FUNCTION__, "Grob_array");
   return  scm_from_int (me->size ());
 }
 
@@ -27,8 +28,8 @@ LY_DEFINE (ly_grob_array_ref, "ly:grob-array-ref",
           "Retrieve the @code{index} element of @code{grob-arr}.")
 {
   Grob_array *me = unsmob_grob_array (grob_arr);
-  SCM_ASSERT_TYPE (me, grob_arr, SCM_ARG1, __FUNCTION__, "Grob_array");
-  SCM_ASSERT_TYPE (scm_is_integer (index), index, SCM_ARG2, __FUNCTION__, "integer");
+  LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
+  LY_ASSERT_TYPE(scm_is_integer,index, 2);
 
   vsize i = scm_to_unsigned (index);
   if (i == VPOS || i >= me->size ())
index 5d5947cbb7a88faac1028dc0f52a6a08249a319c..a174d264532d4c3747bbe6d108ae3af6db960b61 100644 (file)
@@ -15,9 +15,9 @@ LY_DEFINE (ly_add_interface, "ly:add-interface",
           3, 0, 0, (SCM a, SCM b, SCM c),
           "Add an interface description.")
 {
-  SCM_ASSERT_TYPE (scm_is_symbol (a), a, SCM_ARG1, __FUNCTION__, "symbol");
-  SCM_ASSERT_TYPE (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string");
-  SCM_ASSERT_TYPE (ly_is_list (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+  LY_ASSERT_TYPE (ly_is_symbol, a, 1);
+  LY_ASSERT_TYPE(scm_is_string,b, 2);
+  LY_ASSERT_TYPE(ly_is_list,c, 3);
   if (!all_ifaces)
     {
       SCM tab = scm_c_make_hash_table (59);
index 476cae950ca61cece500a96b27fd0f510742ca77..7cb4afab87900821d25ee4f39df5e28a8cec35ea 100644 (file)
@@ -47,7 +47,7 @@ Grob_pq_engraver::initialize ()
   context ()->set_property ("busyGrobs", SCM_EOL);
 }
 
-LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
+LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq<?",
           2, 0, 0, (SCM a, SCM b),
           "Compare 2 grob priority queue entries. Internal")
 {
index b62a6bb9f9f94f815221f2c1f7819d0276e24ec0..1a9c61dccc603c299c3ab3e15c6ec453e144bc5d 100644 (file)
@@ -32,9 +32,7 @@ LY_DEFINE (ly_set_grob_modification_callback, "ly:set-grob-modification-callback
           "which the modification was requested, the property to be changed and "
           "the new value for the property.")
 {
-
-  SCM_ASSERT_TYPE(ly_is_procedure (cb), cb, SCM_ARG1, __FUNCTION__,
-                 "procedure");
+  LY_ASSERT_TYPE (ly_is_procedure, cb, 1);
 
   modification_callback = cb;
   return SCM_UNSPECIFIED;
@@ -149,6 +147,14 @@ SCM
 Grob::internal_get_property (SCM sym) const
 {
   SCM val = get_property_data (sym);
+
+#ifndef NDEBUG
+  if (val == ly_symbol2scm ("calculation-in-progress"))
+    programming_error (_f ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)",
+                          ly_symbol2string (sym).c_str (),
+                          name().c_str ()));
+#endif
+  
   if (ly_is_procedure (val)
       || is_simple_closure (val))
     {
@@ -203,7 +209,7 @@ Grob::try_callback_on_alist (SCM *alist, SCM sym, SCM proc)
   */
   if (value == SCM_UNSPECIFIED)
     {
-      value = internal_get_property (sym);
+      value = get_property_data (sym);
       assert (value == SCM_EOL || value == marker);
       if (value == marker)
        *alist = scm_assq_remove_x (*alist, marker);
index 8d3cc0b4a454ed8faf4ae9dbe8ecf315c16db2cf..a76797a8d2a3741de885f9b782ec5cfafe71bf8f 100644 (file)
@@ -20,8 +20,9 @@ LY_DEFINE (ly_grob_property_data, "ly:grob-property-data",
           "Retrieve @var{sym} for @var{grob} but don't process callbacks.")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   return sc->get_property_data (sym);
 }
@@ -31,8 +32,9 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
           "Set @var{sym} in grob @var{grob} to value @var{val}")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   if (!ly_is_procedure (val)
       && !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
@@ -50,8 +52,9 @@ LY_DEFINE (ly_grob_property, "ly:grob-property",
           "\n\n")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
   if (deflt == SCM_UNDEFINED)
     deflt = SCM_EOL;
 
@@ -68,7 +71,8 @@ LY_DEFINE (ly_grob_interfaces, "ly:grob-interfaces",
           "Return the interfaces list of grob @var{grob}.")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   return sc->interfaces ();
 }
@@ -81,8 +85,9 @@ LY_DEFINE (ly_grob_object, "ly:grob-object",
           "\n\n")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   return sc->internal_get_object (sym);
 }
@@ -92,11 +97,12 @@ LY_DEFINE (ly_grob_object, "ly:grob-object",
 /* TODO: make difference between scaled and unscalead variable in
    calling (i.e different funcs.) */
 LY_DEFINE (ly_grob_layout, "ly:grob-layout",
-          1, 0, 0, (SCM g),
-          "Get @code{\\layout} definition from grob @var{g}.")
+          1, 0, 0, (SCM grob),
+          "Get @code{\\layout} definition from grob @var{grob}.")
 {
-  Grob *sc = unsmob_grob (g);
-  SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
+  Grob *sc = unsmob_grob (grob);
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   return sc->layout ()->self_scm ();
 }
@@ -108,7 +114,8 @@ LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
           "from the layout block is taken. ")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   if (global == SCM_UNDEFINED)
     {
@@ -120,7 +127,7 @@ LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
   return sc->get_property_alist_chain (global);
 }
 
-LY_DEFINE (ly_get_extent, "ly:grob-extent",
+LY_DEFINE (ly_grob_extent, "ly:grob-extent",
           3, 0, 0, (SCM grob, SCM refp, SCM axis),
           "Get the extent in @var{axis} direction of @var{grob} relative to "
           "the grob @var{refp}")
@@ -128,9 +135,10 @@ LY_DEFINE (ly_get_extent, "ly:grob-extent",
   Grob *sc = unsmob_grob (grob);
   Grob *ref = unsmob_grob (refp);
   
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob, refp, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
 
@@ -151,9 +159,10 @@ LY_DEFINE (ly_grob_robust_relative_extent, "ly:grob-robust-relative-extent",
   Grob *sc = unsmob_grob (grob);
   Grob *ref = unsmob_grob (refp);
   
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob, refp, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
     
@@ -174,9 +183,10 @@ LY_DEFINE (ly_grob_relative_coordinate, "ly:grob-relative-coordinate",
   Grob *sc = unsmob_grob (grob);
   Grob *ref = unsmob_grob (refp);
   
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob,refp, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
 
@@ -197,8 +207,9 @@ LY_DEFINE (ly_grob_parent, "ly:grob-parent",
           "1 for the Y-axis.")
 {
   Grob *sc = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE(is_axis,axis, 2);
 
   Grob *par = sc->get_parent (Axis (scm_to_int (axis)));
   return par ? par->self_scm () : SCM_EOL;
@@ -209,7 +220,8 @@ LY_DEFINE (ly_grob_properties, "ly:grob-properties",
           "Get the mutable proprerties of @var{grob}.")
 {
   Grob *g = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (g, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   /* FIXME: uhg? copy/read only? */
   return g->mutable_property_alist_;
@@ -220,18 +232,20 @@ LY_DEFINE (ly_grob_basic_properties, "ly:grob-basic-properties",
           "Get the immutable properties of @var{grob}.")
 {
   Grob *g = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (g, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   /* FIXME: uhg? copy/read only? */
   return g->immutable_property_alist_;
 }
 
 LY_DEFINE (ly_grob_system, "ly:grob-system",
-          1, 0, 0, (SCM g),
-          "Return the System Grob of @var{g}.")
+          1, 0, 0, (SCM grob),
+          "Return the System Grob of @var{grob}.")
 {
-  Grob *me = unsmob_grob (g);
-  SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
+  Grob *me = unsmob_grob (grob);
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   if (System *g = me->get_system ())
     return g->self_scm ();
@@ -244,30 +258,33 @@ LY_DEFINE (ly_grob_original, "ly:grob-original",
           "Return the unbroken original Grob of @var{grob}.")
 {
   Grob *me = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
   return me->original () ? me->original ()->self_scm () : me->self_scm ();
 }
 
 
 LY_DEFINE (ly_grob_suicide_x, "ly:grob-suicide!",
-          1, 0, 0, (SCM g),
-          "Kill @var{g}.")
+          1, 0, 0, (SCM grob),
+          "Kill @var{grob}.")
 {
-  Grob *me = unsmob_grob (g);
-  SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
+  Grob *me = unsmob_grob (grob);
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   me->suicide ();
   return SCM_UNSPECIFIED;
 }
 
 LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
-          3, 0, 0, (SCM g, SCM d, SCM a),
+          3, 0, 0, (SCM grob, SCM d, SCM a),
           "Translate @var{g} on axis @var{a} over distance @var{d}.")
 {
-  Grob *me = unsmob_grob (g);
-  SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG2, __FUNCTION__, "dimension");
-  SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
+  Grob *me = unsmob_grob (grob);
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE(scm_is_number,d, 2);
+  LY_ASSERT_TYPE(is_axis,a, 3);
 
   me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
   return SCM_UNSPECIFIED;
@@ -278,7 +295,8 @@ LY_DEFINE (ly_grob_default_font, "ly:grob-default-font",
           "Return the default font for grob @var{gr}.")
 {
   Grob *gr = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   return Font_interface::get_default_font (gr)->self_scm ();
 }
@@ -296,12 +314,13 @@ LY_DEFINE (ly_grob_common_refpoint, "ly:grob-common-refpoint",
 {
   
   Grob *gr = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob,other, 2);
 
   Grob *o = unsmob_grob (other);
-  SCM_ASSERT_TYPE (o, other, SCM_ARG2, __FUNCTION__, "grob");
 
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Grob *refp = gr->common_refpoint (o,  Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
@@ -314,11 +333,12 @@ LY_DEFINE (ly_grob_common_refpoint_of_array, "ly:grob-common-refpoint-of-array",
           )
 {
   Grob *gr = unsmob_grob (grob);
-  SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+   
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob_array,others, 2);
 
   Grob_array *ga = unsmob_grob_array (others);
-  SCM_ASSERT_TYPE (ga, others, SCM_ARG2, __FUNCTION__, "grob array");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
index d1318ba95481fac4d743fe164dba7c5341b41de8..37d715bf0743f4c2cb31b27970656d0ff40a2a51 100644 (file)
@@ -394,7 +394,7 @@ Grob::extent (Grob *refp, Axis a) const
        (a == X_AXIS)
        ? ly_symbol2scm ("X-extent")
        : ly_symbol2scm ("Y-extent");
-
+       
       SCM ext = internal_get_property (ext_sym);
       if (is_number_pair (ext))
        real_ext.unite (ly_scm2interval (ext));
index f77d394599cb09b06cee3d5c3dbbd4c5134ee4b1..793c0e14a9e065ecb9cd543c05c41585b5fc5baf 100644 (file)
@@ -79,4 +79,6 @@ DECLARE_UNSMOB (Font_metric, metrics);
 
 Box lookup_tex_text_dimension (Font_metric *font, SCM text);
 
+char *pfb2pfa (Byte const *pfb, int length);
+
 #endif /* FONT_METRIC_HH */
index 540d96654bb9296e3d9f2bdf934bd271d9afd998..2fcbfca2982cc7ff770d9a862dd36fe43efa122a 100644 (file)
@@ -44,5 +44,6 @@ protected:
 };
 
 SCM ly_format_output (SCM);
+Global_context *unsmob_global_context (SCM x);
 
 #endif // GLOBAL_CONTEXT_HH
index 555d65bfd3a6aa116923ec46456796184f582f37..6b0a60a2f041271bded2b8d938afb3acaeacc7c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  lily-guile-macros.hh -- declare
+  lily-guile-macros.hh -- declare GUILE interaction macros.
 
   source file of the GNU LilyPond music typesetter
 
@@ -25,9 +25,6 @@
    FIXME: should add check for x86 as well?  */
 #define CACHE_SYMBOLS
 
-
-
-
 #ifdef CACHE_SYMBOLS
 
 /* this lets us "overload" macros such as get_property to take
@@ -94,33 +91,57 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); }
 #define DECLARE_SCHEME_CALLBACK(NAME, ARGS)    \
   static SCM NAME ARGS;                                \
   static SCM NAME ## _proc
+#define ADD_TYPE_PREDICATE(func, type_name) \
+  void \
+  func ## _type_adder ()                       \
+  {\
+    ly_add_type_predicate ((Type_predicate_ptr)func, type_name);       \
+  }\
+  ADD_SCM_INIT_FUNC(func ## _type_adder_ctor, \
+                   func ## _type_adder);
+#define ADD_TYPE_PREDICATE(func, type_name) \
+  void \
+  func ## _type_adder ()                       \
+  {\
+    ly_add_type_predicate ((Type_predicate_ptr)func, type_name);       \
+  }\
+  ADD_SCM_INIT_FUNC(func ## _type_adder_ctor, \
+                   func ## _type_adder);
+
+string mangle_cxx_identifier (string);
+
+void ly_add_type_predicate (void *ptr, string name);
+string predicate_to_typename (void *ptr);
+
 /*
   Make TYPE::FUNC available as a Scheme function.
 */
-string mangle_cxx_identifier (string);
-#define MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE, FUNC, ARGCOUNT, OPTIONAL_COUNT)        \
+#define MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE, FUNC, ARGCOUNT, OPTIONAL_COUNT, DOC) \
   SCM TYPE ::FUNC ## _proc;                                            \
   void                                                                 \
   TYPE ## _ ## FUNC ## _init_functions ()                              \
   {                                                                    \
-    string id = mangle_cxx_identifier (string (#TYPE) + "::" + string (#FUNC)); \
+    string cxx = string (#TYPE) + "::" + string (#FUNC); \
+    string id = mangle_cxx_identifier (cxx); \
     TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(),                     \
                                               (ARGCOUNT-OPTIONAL_COUNT), OPTIONAL_COUNT, 0,    \
                                               (Scheme_function_unknown) TYPE::FUNC); \
+    ly_add_function_documentation (TYPE :: FUNC ## _proc, id.c_str(), "", \
+                                  DOC);                                \
     scm_c_export (id.c_str (), NULL);                                  \
   }                                                                    \
                                                                        \
   ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback,                   \
                     TYPE ## _ ## FUNC ## _init_functions);
 
+#define MAKE_DOCUMENTED_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT, DOC)             \
+  MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE, FUNC, ARGCOUNT, 0, DOC);
+
 #define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT)                     \
-  MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE,FUNC,ARGCOUNT,0);
+  MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE,FUNC,ARGCOUNT, 0, "");
 
-void
-ly_add_function_documentation (SCM proc, char const *fname,
-                              char const *varlist,
-                              char const *doc);
+void ly_add_function_documentation (SCM proc, string fname, string varlist, string doc);
+void ly_check_name (string cxx, string fname);
 
 #define ADD_SCM_INIT_FUNC(name, func)          \
   class name ## _scm_initter                   \
@@ -143,6 +164,7 @@ ly_add_function_documentation (SCM proc, char const *fname,
   {                                                                    \
     FNAME ## _proc = scm_c_define_gsubr (PRIMNAME, REQ, OPT, VAR,      \
                                         (Scheme_function_unknown) FNAME); \
+    ly_check_name (#FNAME, PRIMNAME);\
     ly_add_function_documentation (FNAME ## _proc, PRIMNAME, #ARGLIST, \
                                   DOCSTRING);                          \
     scm_c_export (PRIMNAME, NULL);                                     \
@@ -178,4 +200,20 @@ ly_add_function_documentation (SCM proc, char const *fname,
 #define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)
 #endif
 
+
+
+#define LY_ASSERT_TYPE(pred, var, number)                                      \
+  {                                                                    \
+    if (!pred (var)) \
+      {                                                                        \
+       scm_wrong_type_arg_msg(mangle_cxx_identifier (__FUNCTION__).c_str(), \
+                              number, var, \
+                              predicate_to_typename ((void*) &pred).c_str()); \
+      }                                                                        \
+  }
+
+#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::unsmob, var, number)
+
+
+
 #endif /* LILY_GUILE_MACROS_HH */
index 6f21a29b03c172e53c7c720a9628027a556a7e06..7349050810477bc1ae1f209906c1fd6c75b757be 100644 (file)
@@ -88,6 +88,12 @@ inline bool ly_is_list (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
 inline bool ly_is_procedure (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
 inline bool ly_is_port (SCM x) { return SCM_NFALSEP (scm_port_p (x)); }
 
+/*
+  want to take the address of this function; scm_is_symbol() is a
+  macro.
+ */
+inline bool ly_is_symbol (SCM x) { return scm_is_symbol (x); }
+
 inline bool ly_is_equal (SCM x, SCM y)
 {
   return SCM_NFALSEP (scm_equal_p (x, y));
diff --git a/lily/include/line-spanner.hh b/lily/include/line-spanner.hh
deleted file mode 100644 (file)
index ceff6f6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  line-spanner.hh -- declare Line_spanner
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef LINE_SPANNER_HH
-#define LINE_SPANNER_HH
-
-#include "lily-proto.hh"
-#include "grob-interface.hh"
-
-class Line_spanner
-{
-public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
-  static Stencil line_stencil (Grob *me, Offset f, Offset t);
-  DECLARE_GROB_INTERFACE();
-
-private:
-  static Offset get_broken_offset (Grob *me, Direction dir);
-  static Offset broken_trend_offset (Grob *me, Direction dir);
-};
-
-#endif /* LINE_SPANNER_HH */
index 17595408a71965ab102578136fa83c63d10a600c..abb4b200405cee65221ea27a28fd949eb2139674 100644 (file)
@@ -12,7 +12,7 @@
 
 SCM ly_make_anonymous_module (bool safe);
 SCM ly_module_copy (SCM dest, SCM src);
-SCM ly_module2alist (SCM mod);
+SCM ly_module_2_alist (SCM mod);
 SCM ly_module_lookup (SCM module, SCM sym);
 SCM ly_modules_lookup (SCM modules, SCM sym, SCM);
 SCM ly_module_symbols (SCM mod);
index a77da17fc82733cfa708c9fc33cd13e3c0007e69..af8035644c1fcbc762a47ab2a91d546c48a386c4 100644 (file)
   ADD_SCM_INIT_FUNC (init_type_ ## CL, init_type_ ## CL)
 
 #define IMPLEMENT_BASE_SMOBS(CL)                                       \
+  void \
+  CL ## _type_adder ()                 \
+  {\
+    ly_add_type_predicate ((void*) &CL::unsmob, #CL);  \
+  }\
+  ADD_SCM_INIT_FUNC(CL ## _type_adder_ctor, \
+                   CL ## _type_adder);\
+  const char *CL::smob_name_ = #CL;                                    \
   scm_t_bits CL::smob_tag_;                                            \
   SCM                                                                  \
   CL::smob_p (SCM s)                                                   \
index c7c3b82bd5af0d97bff020245de61aca16d91422..eafb6ec8d023126d4882d7304beb8be60aabba7e 100644 (file)
@@ -28,5 +28,6 @@ public:
 };
 
 DECLARE_UNSMOB (Music_output, music_output);
-
+Paper_score *unsmob_paper_score (SCM);
+Performance *unsmob_performance (SCM);
 #endif /* MUSIC_OUTPUT_HH */
index ec6f98766cdc3d912f6f87ee74dbcc3c33a3f0eb..4ed048fda01448255239261c76830f940b91c318 100644 (file)
@@ -61,7 +61,7 @@ protected:
 Music *unsmob_music (SCM);
 Music *make_music_by_name (SCM sym);
 SCM ly_music_deep_copy (SCM);
-SCM ly_camel_case_to_lisp_identifier (SCM name_sym);
+SCM ly_camel_case_2_lisp_identifier (SCM name_sym);
 
 extern SCM ly_music_p_proc;
 
index 5bd403bce45364763f307fb2014960034e146b58..9971b19da5023d0711acd4d7a05ae03a3dc8b3a0 100644 (file)
 #define DECLARE_BASE_SMOBS(CL)                                 \
   friend class Non_existent_class;                             \
   private:                                                     \
+  static const char* smob_name_; \
   static scm_t_bits smob_tag_;                                 \
   static SCM mark_smob (SCM);                                  \
   static size_t free_smob (SCM s);                             \
   static int print_smob (SCM s, SCM p, scm_print_state*);      \
   public:                                                      \
   static SCM equal_p (SCM a, SCM b);                           \
-  static CL *unsmob (SCM s)                                    \
+  static CL *unsmob (SCM s) __attribute__((pure))              \
   {                                                            \
     if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_)                \
       return (CL *) SCM_CELL_WORD_1 (s);                       \
diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh
deleted file mode 100644 (file)
index 3af69d6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  text-spanner.hh -- declare Text_spanner
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef TEXT_SPANNER_HH
-#define TEXT_SPANNER_HH
-
-#include "grob-interface.hh"
-#include "lily-proto.hh"
-
-class Text_spanner
-{
-public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_GROB_INTERFACE();
-};
-
-#endif /* TEXT_SPANNER_HH */
index 2ff7bf500762d7496efe533ed80bf1a728e701b4..e3d0312642fd8488b75db27dfcfea9f467dba3f9 100644 (file)
@@ -11,7 +11,7 @@
 
 /* We don't use IMPLEMENT_TYPE_P, since the smobification part is
    implemented separately from the class.  */
-LY_DEFINE (ly_input, "ly:input-location?", 1, 0, 0,
+LY_DEFINE (ly_input_location_p, "ly:input-location?", 1, 0, 0,
           (SCM x),
           "Is @var{x} an @code{input-location}?")
 {
@@ -23,8 +23,9 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM
           "location in @var{sip}. @var{msg} is interpreted similar to @code{format}'s argument\n")
 {
   Input *ip = unsmob_input (sip);
-  SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
-  SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, "string");
+
+  LY_ASSERT_TYPE (unsmob_input, sip, 1);
+  LY_ASSERT_TYPE(scm_is_string, msg,2);
 
   msg = scm_simple_format (SCM_BOOL_F, msg, rest);
 
@@ -35,13 +36,13 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM
 }
 
 
-LY_DEFINE (ly_input_file_line_column,
+LY_DEFINE (ly_input_file_line_char_column,
           "ly:input-file-line-char-column",
           1, 0, 0, (SCM sip),
           "Return input location in @var{sip} as (file-name line char column).")
 {
+  LY_ASSERT_TYPE (unsmob_input, sip, 1);
   Input *ip = unsmob_input (sip);
-  SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
 
   int l = 0;
   int ch = 0;
@@ -59,8 +60,10 @@ LY_DEFINE (ly_input_both_locations,
           "Return input location in @var{sip} as "
           "(file-name first-line first-column last-line last-column).")
 {
+  
+  LY_ASSERT_TYPE (unsmob_input, sip, 1);
   Input *ip = unsmob_input (sip);
-  SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
+  
   return scm_list_5 (ly_string2scm (ip->file_string ()),
                     scm_from_int (ip->line_number ()),
                     scm_from_int (ip->column_number ()),
index 0ebbc2832de9a65663a665e7e39a847a23c3c317..426d9532a6ebeb3fcee8cc145d01aec3b68a71dc 100644 (file)
@@ -24,7 +24,7 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
           "The break status dir of item @var{it}. @code{-1} is end of "
           "line, @code{0} unbroken, and @code{1} begin of line.")
 {
-  Item *me = dynamic_cast<Item *> (unsmob_grob (it));
-  SCM_ASSERT_TYPE (me, it, SCM_ARG1, __FUNCTION__, "Item");
+  LY_ASSERT_TYPE (unsmob_item, it, 1);
+  Item *me = unsmob_item (it);
   return scm_from_int (me->break_status_dir ());
 }
index 976b19e47c0819a32111fea6f28d5261d24ee2ae..370dba2998e932f32b63520c3413da7d2b7af41d 100644 (file)
@@ -126,7 +126,7 @@ ly_string2scm (string const &str)
 char *
 ly_scm2newstr (SCM str, size_t *lenp)
 {
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
 
   size_t len = scm_i_string_length (str);
   if (char *new_str = (char *) malloc ((len + 1) * sizeof (char)))
@@ -630,11 +630,16 @@ mangle_cxx_identifier (string cxx_id)
       cxx_id = "ly:" + cxx_id;
     }
   if (cxx_id.substr (cxx_id.length () - 2) == "_p")
-    cxx_id = cxx_id.replace (cxx_id.length () - 2, 1, "?");
+    cxx_id = cxx_id.replace (cxx_id.length () - 2, 2, "?");
   else if (cxx_id.substr (cxx_id.length () - 2) == "_x")
-    cxx_id = cxx_id.replace (cxx_id.length () - 2, 1, "!");
+    cxx_id = cxx_id.replace (cxx_id.length () - 2, 2, "!");
 
+  cxx_id = replace_all (cxx_id, "_less?", "<?");
+  cxx_id = replace_all (cxx_id, "_2_", "->");
+  cxx_id = replace_all (cxx_id, "__", "::");
   cxx_id = replace_all (cxx_id, '_', '-');
+
+
   return cxx_id;
 }
 
index 4bf001ea0a3941eb1e6002ad54889a55f9e38264..a0501e9eab0df06692df8d1ee0138b6341530934 100644 (file)
@@ -13,7 +13,8 @@ LY_DEFINE(ly_lexer_keywords, "ly:lexer-keywords",
          1, 0, 0, (SCM lexer),
          "Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.")
 {
+  LY_ASSERT_SMOB (Lily_lexer, lexer, 1);
+
   Lily_lexer * lex = Lily_lexer::unsmob (lexer);
-  SCM_ASSERT_TYPE(lex, lexer, SCM_ARG1, __FUNCTION__, "lily lexer");
   return lex->keyword_list ();
 }
index ca1d224bd6ac7703f7d8f54b64434fe4102965ee..4e22461638f6354289208371c8f009f673f8be1d 100644 (file)
@@ -36,7 +36,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
           "Parse a single @code{.ly} file.  "
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   string file = ly_scm2string (name);
   char const *extensions[] = {"ly", "", 0};
 
@@ -138,7 +138,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
 
   /*
     outside the if-else to ensure cleanup fo Sources object, 
-   */
+  */
   if (error)
     /* TODO: pass renamed input file too.  */
     scm_throw (ly_symbol2scm ("ly-file-failed"),
@@ -160,20 +160,23 @@ LY_DEFINE (ly_parser_clone, "ly:parser-clone",
           1, 0, 0, (SCM parser_smob),
           "Return a clone of @var{parser-smob}.")
 {
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
   Lily_parser *clone = new Lily_parser (*parser);
 
   return clone->unprotect ();
 }
 
-LY_DEFINE (ly_parser_define, "ly:parser-define!",
+LY_DEFINE (ly_parser_define_x, "ly:parser-define!",
           3, 0, 0, (SCM parser_smob, SCM symbol, SCM val),
           "Bind @var{symbol} to @var{val} in @var{parser-smob}'s module.")
 {
+  
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
-  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
-  SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");
 
+  LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
+    
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
   return SCM_UNSPECIFIED;
 }
@@ -183,10 +186,11 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
           "Lookup @var{symbol} in @var{parser-smob}'s module.  "
           "Undefined is '().")
 {
-  Lily_parser *parser = unsmob_lily_parser (parser_smob);
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
 
-  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
-  SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");
+  Lily_parser *parser = unsmob_lily_parser (parser_smob);
+  LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
 
   SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
   if (val != SCM_UNDEFINED)
@@ -200,10 +204,9 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
           "Parse the string @code{ly-code} with @code{parser-smob}."
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-  Lily_parser *parser = unsmob_lily_parser (parser_smob);
-
-  SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
-  SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string");
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
+  Lily_parser *parser = unsmob_lily_parser (parser_smob); 
+  LY_ASSERT_TYPE(scm_is_string,ly_code, 2);
 
   parser->parse_string (ly_scm2string (ly_code));
 
@@ -216,8 +219,8 @@ LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names",
           "@var{names} is an alist of symbols.  "
           "This only has effect if the current mode is notes.")
 {
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
-  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
 
   if (p->lexer_->is_note_state ())
     {
@@ -232,8 +235,8 @@ LY_DEFINE (ly_parser_output_name, "ly:parser-output-name",
           1, 0, 0, (SCM parser),
           "Return the base name of the output file.")
 {
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
-  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
 
   return ly_string2scm (p->output_basename_);
 }
@@ -242,9 +245,10 @@ LY_DEFINE (ly_parser_error, "ly:parser-error",
           2, 1, 0, (SCM parser, SCM msg, SCM input),
           "Display an error message, and make the parser fail")
 {
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
-  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
-  SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, "string");
+  
+  LY_ASSERT_TYPE(scm_is_string,msg, 2);
   string s = ly_scm2string (msg);
   
   Input *i = unsmob_input (input);
@@ -260,8 +264,9 @@ LY_DEFINE (ly_parser_clear_error, "ly:parser-clear-error",
           1, 0, 0, (SCM parser),
           "Clear the error flag for the parser.")
 {
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
-  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
+  
 
   p->error_level_ = 0;
   p->lexer_->error_level_ = 0;
@@ -273,8 +278,8 @@ LY_DEFINE (ly_parser_has_error_p, "ly:parser-has-error?",
           1, 0, 0, (SCM parser),
           "Does @var{parser} have an error flag?")
 {
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
-  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
 
   return scm_from_bool (p->error_level_ || p->lexer_->error_level_);
 }
index 8c54fa7ed1d35a31aa9ca34405fd2a3e64bf7ec7..b9155a07ab53b4c0a28638282392e23218deb6e7 100644 (file)
@@ -48,7 +48,7 @@ Line_interface::make_trill_line (Grob *me,
                                           alist_chain));
 
   Stencil elt = fm->find_by_name ("scripts.trill_element");
-
+  elt.align_to (Y_AXIS, CENTER);
   Real elt_len = elt.extent (X_AXIS).length ();
   if (elt_len <= 0.0)
     {
@@ -65,7 +65,7 @@ Line_interface::make_trill_line (Grob *me,
     }
   while (len + elt_len < dz.length ());
 
-  line.rotate (dz.arg (), Offset (0,0));
+  line.rotate (dz.arg (), Offset (LEFT, CENTER));
   line.translate (from);
 
   return line; 
@@ -225,9 +225,20 @@ Line_interface::line (Grob *me, Offset from, Offset to)
       Real period = Staff_symbol_referencer::staff_space (me)
        * robust_scm2double (me->get_property ("dash-period"), 1.0);
 
-      if (period < 0)
+      if (period <= 0)
        return Stencil ();
 
+      Real len = (to-from).length();
+      
+      int n = (int) rint ((len - period * fraction) / period);
+      if (n > 0)
+       {
+         /*
+           TODO: figure out something intelligent for really short
+           sections.
+          */
+         period = ((to-from).length() - period * fraction) / n;
+       }
       stil = make_dashed_line (thick, from, to, period, fraction);
     }
   else
index 7a8870aee5d8c4ac4f0ab0ac682e5e56d225198e..5bbc1eeaf2652da44c720c597f163c63045a8bdd 100644 (file)
@@ -6,70 +6,34 @@
   (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "line-spanner.hh"
-
-
 #include "spanner.hh"
 #include "output-def.hh"
-#include "paper-column.hh"
+#include "item.hh"
 #include "staff-symbol-referencer.hh"
 #include "font-interface.hh"
 #include "warn.hh"
 #include "align-interface.hh"
-#include "lookup.hh"
 #include "line-interface.hh"
+#include "moment.hh"
 
-MAKE_SCHEME_CALLBACK (Line_spanner, after_line_breaking, 1);
-SCM
-Line_spanner::after_line_breaking (SCM g)
-{
-  Grob *me = unsmob_grob (g);
-  Spanner *sp = dynamic_cast<Spanner *> (me);
-
-  /*
-    We remove the line at the start of the line.  For piano voice
-    indicators, it makes no sense to have them at the start of the
-    line.
-
-    I'm not sure what the official rules for glissandi are, but
-    usually the 2nd note of the glissando is "exact", so when playing
-    from the start of the line, there is no need to glide.
-
-    From a typographical p.o.v. this makes sense, since the amount of
-    space left of a note at the start of a line is very small.
+#include "lily-proto.hh"
+#include "grob-interface.hh"
+#include "text-interface.hh"
 
-    --hwn.
-
-  */
-  if (sp->get_bound (LEFT)->break_status_dir ()
-      && !sp->get_bound (RIGHT)->break_status_dir ())
-    {
-      /*
-       Can't do suicide, since this mucks up finding the trend.
-      */
-      me->set_property ("transparent", SCM_BOOL_T);
-    }
-  return SCM_EOL;
-}
-
-Stencil
-Line_spanner::line_stencil (Grob *me,
-                           Offset from,
-                           Offset to)
+class Line_spanner
 {
-  Stencil line = Line_interface::line (me, from, to);
-
-  if (to_boolean (me->get_property ("arrow")))
-    line.add_stencil (Line_interface::arrows (me, from, to, false, true));
-
-  return line;
-}
-
-/*
-  Find a common Y parent, which --if found-- should be the
-  fixed-distance alignment.
-*/
-Grob *
+public:
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_left_bound_info, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_left_bound_info_and_text, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_right_bound_info, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_bound_info, (SCM, Direction));
+  DECLARE_GROB_INTERFACE();
+};
+
+
+static Grob *
 line_spanner_common_parent (Grob *me)
 {
   Grob *common = find_fixed_alignment_parent (me);
@@ -85,129 +49,271 @@ line_spanner_common_parent (Grob *me)
   return common;
 }
 
-/*
-  Warning: this thing is a cross-staff object, so it should have empty Y-dimensions.
-
-  (If not, you risk that this is called from the staff-alignment
-  routine, via stencil_extent. At this point, the staves aren't
-  separated yet, so it doesn't work cross-staff.
-
-  (huh? crossable staves have fixed distance? --hwn)
-*/
-
-MAKE_SCHEME_CALLBACK (Line_spanner, print, 1);
 SCM
-Line_spanner::print (SCM smob)
+Line_spanner::calc_bound_info (SCM smob, Direction dir)
 {
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+  Spanner *me = unsmob_spanner (smob);
 
-  Drul_array<Item *> bound (me->get_bound (LEFT),
-                           me->get_bound (RIGHT));
+  Grob *commonx = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
+  commonx = me->common_refpoint (commonx, X_AXIS);
 
-  Real gap = robust_scm2double (me->get_property ("gap"), 0.0);
+  SCM bound_details = me->get_property ("bound-details");
 
-  Offset ofxy (gap, 0); /* offset from start point to start of line */
-  Offset dxy;
-  Offset my_off;
-  Offset his_off;
+  SCM details = SCM_BOOL_F;
+  if (details == SCM_BOOL_F)
+    details = ly_assoc_get ((dir == LEFT)
+                           ? ly_symbol2scm ("left")
+                           : ly_symbol2scm ("right"), bound_details, SCM_BOOL_F);
 
-  Real extra_dy = robust_scm2double (me->get_property ("extra-dy"),
-                                    0.0);
-  
-  if (bound[RIGHT]->break_status_dir ())
+  if (me->get_bound (dir)->break_status_dir ())
     {
-      if (bound[LEFT]->break_status_dir ())
-       {
-         programming_error ("line-spanner with two broken ends. Farewell sweet world.");
+      SCM extra = ly_assoc_get ((dir == LEFT)
+                               ? ly_symbol2scm ("left-broken")
+                               : ly_symbol2scm ("right-broken"), bound_details, SCM_EOL);
 
-         me->suicide ();
-         return SCM_EOL;
-       }
+      for (SCM s = extra; scm_is_pair (s); s = scm_cdr (s))
+       details = scm_cons (scm_car (s), details);
+    }
+  
+  if (details == SCM_BOOL_F)
+    details = ly_assoc_get (ly_symbol2scm ("default"), bound_details, SCM_EOL);
 
-      /*
-       This is hairy. For the normal case, we simply find common
-       parents, and draw a line between the bounds. When two note
-       heads are on different systems, there is no common parent
-       anymore. We have to find the piano-staff object.
-      */
+  SCM text = ly_assoc_get (ly_symbol2scm ("text"), details, SCM_BOOL_F);
+  if (Text_interface::is_markup (text))
+    {
+      Output_def *layout = me->layout ();
+      SCM properties = Font_interface::text_font_alist_chain (me);
+      details = scm_acons (ly_symbol2scm ("stencil"),
+                          Text_interface::interpret_markup (layout->self_scm (),
+                                                            properties, text),
+                          details);
+    }
+  
+  if (!scm_is_number (ly_assoc_get (ly_symbol2scm ("X"), details, SCM_BOOL_F)))
+    {
+      Direction attach = (Direction)
+       robust_scm2int (ly_assoc_get (ly_symbol2scm ("attach-dir"),
+                                                    details, SCM_BOOL_F),
+                       CENTER);
+
+      details = scm_acons (ly_symbol2scm ("X"),
+                          scm_from_double (me->get_bound (dir)->extent (commonx, X_AXIS)
+                                           .linear_combination (attach)),
+                          details);
+    }
+  
 
-      Spanner *next_sp = me->broken_neighbor (RIGHT);
-      Item *next_bound = next_sp->get_bound (RIGHT);
+  if (!scm_is_number (ly_assoc_get (ly_symbol2scm ("Y"), details, SCM_BOOL_F)))
+    {
+      Real y = 0.0;
 
-      if (next_bound->break_status_dir ())
+      Real extra_dy = robust_scm2double (me->get_property ("extra-dy"),
+                                        0.0);
+         
+      if (me->get_bound (dir)->break_status_dir ())
+       {
+         /*
+           This is hairy. For the normal case, we simply find common
+           parents, and draw a line between the bounds. When two note
+           heads are on different systems, there is no common parent
+           anymore. We have to find the piano-staff object.
+         */
+
+         Spanner *next_sp = me->broken_neighbor (dir);
+         Item *next_bound = next_sp->get_bound (dir);
+
+         if (next_bound->break_status_dir ())
+           {
+             programming_error ("no note heads for the line spanner on neighbor line?"
+                                " Confused.");
+             me->suicide ();
+             return SCM_EOL;
+           }
+
+         Grob *next_common_y = line_spanner_common_parent (next_bound);
+         Interval next_ext = next_bound->extent (next_common_y, Y_AXIS);
+
+         y = next_ext.center ();
+       }
+      else
        {
-         programming_error ("no note heads for the line spanner on next line?"
-                            " Confused.");
-         me->suicide ();
-         return SCM_EOL;
+         Grob *commony = me->common_refpoint (me->get_bound (dir), Y_AXIS);
+         y = me->get_bound (dir)->extent (commony, Y_AXIS).center();
+         details = scm_acons (ly_symbol2scm ("common-Y"), commony->self_scm (), details);
        }
 
-      Grob *commonx = bound[LEFT]->common_refpoint (bound[RIGHT], X_AXIS);
-      commonx = me->common_refpoint (commonx, X_AXIS);
+      y += dir * extra_dy / 2; 
+      details = scm_acons (ly_symbol2scm ("Y"), scm_from_double (y), details);
+    }
 
-      Grob *next_common_y = line_spanner_common_parent (next_bound);
-      Grob *this_common_y = line_spanner_common_parent (bound[LEFT]);
+  return details;
+}
 
-      Grob *all_common_y = me->common_refpoint (this_common_y, Y_AXIS);
+MAKE_SCHEME_CALLBACK (Line_spanner, calc_right_bound_info, 1);
+SCM
+Line_spanner::calc_right_bound_info (SCM smob)
+{
+  return Line_spanner::calc_bound_info (smob, RIGHT);
+}
 
-      Interval next_ext = next_bound->extent (next_common_y, Y_AXIS);
-      Interval this_ext = bound[LEFT]->extent (this_common_y, Y_AXIS);
+MAKE_SCHEME_CALLBACK (Line_spanner, calc_left_bound_info, 1);
+SCM
+Line_spanner::calc_left_bound_info (SCM smob)
+{
+  return Line_spanner::calc_bound_info (smob, LEFT);
+}
 
-      Real yoff = this_common_y->relative_coordinate (all_common_y, Y_AXIS);
+MAKE_SCHEME_CALLBACK (Line_spanner, calc_left_bound_info_and_text, 1);
+SCM
+Line_spanner::calc_left_bound_info_and_text (SCM smob)
+{
+  SCM alist = Line_spanner::calc_bound_info (smob, LEFT);
+  Spanner *me = unsmob_spanner (smob);
 
-      Offset p1 (bound[LEFT]->extent (commonx, X_AXIS)[RIGHT],
-                this_ext.center () + yoff - extra_dy / 2);
-      Offset p2 (bound[RIGHT]->extent (commonx, X_AXIS)[LEFT],
-                next_ext.center () + yoff + extra_dy / 2);
+  SCM text = me->get_property ("text");
+  if (Text_interface::is_markup (text)
+      && me->get_bound (LEFT)->break_status_dir () == CENTER
+      && ly_assoc_get (ly_symbol2scm ("stencil"), alist, SCM_BOOL_F) == SCM_BOOL_F)
+    {
+      Output_def *layout = me->layout ();
+      SCM properties = Font_interface::text_font_alist_chain (me);
+      alist = scm_acons (ly_symbol2scm ("stencil"),
+                        Text_interface::interpret_markup (layout->self_scm (),
+                                                          properties, text),
+                        alist);
+    }
+  
+  return alist;
+}
 
-      Offset dz (p2 - p1);
-      Real len = dz.length ();
+MAKE_SCHEME_CALLBACK (Line_spanner, print, 1);
+SCM
+Line_spanner::print (SCM smob)
+{
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
 
-      Offset dir = dz * (1 / len);
-      dz = (dz.length () - 2 * gap) * dir;
+  Interval_t<Moment> moments = me->spanned_time ();
+  /*
+    We remove the line at the start of the line.  For piano voice
+    indicators, it makes no sense to have them at the start of the
+    line.
 
-      Stencil l (line_stencil (me, Offset (0, 0), dz));
+    I'm not sure what the official rules for glissandi are, but
+    usually the 2nd note of the glissando is "exact", so when playing
+    from the start of the line, there is no need to glide.
 
-      l.translate (dir * gap + p1
-                  - Offset (me->relative_coordinate (commonx, X_AXIS),
-                            me->relative_coordinate (all_common_y, Y_AXIS)));
+    From a typographical p.o.v. this makes sense, since the amount of
+    space left of a note at the start of a line is very small.
+
+    --hwn.
+
+  */
+  if (moments.length () == Moment (0,0))
+    return SCM_EOL;
+  
+  Drul_array<SCM> bounds (me->get_property ("left-bound-info"),
+                         me->get_property ("right-bound-info"));
 
-      return l.smobbed_copy ();
+  
+  Grob *commonx = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
+  commonx = me->common_refpoint (commonx, X_AXIS);
+
+  Drul_array<Offset> span_points;
+
+  Direction d =  LEFT;
+  do
+    {
+      Offset z (robust_scm2double (ly_assoc_get (ly_symbol2scm ("X"),
+                                                bounds[d], SCM_BOOL_F), 0.0)
+               + commonx->relative_coordinate (commonx, X_AXIS),
+               robust_scm2double (ly_assoc_get (ly_symbol2scm ("Y"),
+                                                bounds[d], SCM_BOOL_F), 0.0));
+      
+      span_points[d] = z;
     }
-  else
+  while (flip (&d) != LEFT);
+
+  Drul_array<Real> gaps (0, 0);
+  Drul_array<bool> arrows (0, 0);
+  Drul_array<Stencil*> stencils (0,0);
+  Drul_array<Grob*> common_y (0, 0);
+  do
     {
-      Grob *common[] = { me, me };
-      for (int a = X_AXIS; a < NO_AXES; a++)
-       {
-         common[a] = me->common_refpoint (bound[RIGHT], Axis (a));
-         common[a] = common[a]->common_refpoint (bound[LEFT], Axis (a));
-       }
+      gaps[d] = robust_scm2double (ly_assoc_get (ly_symbol2scm ("padding"),
+                                                bounds[d], SCM_BOOL_F), 0.0);
+      arrows[d] = to_boolean (ly_assoc_get (ly_symbol2scm ("arrow"),
+                                           bounds[d], SCM_BOOL_F));
+      stencils[d] = unsmob_stencil (ly_assoc_get (ly_symbol2scm ("stencil"),
+                                                 bounds[d], SCM_BOOL_F));
+      common_y[d] = unsmob_grob (ly_assoc_get (ly_symbol2scm ("common-Y"),
+                                              bounds[d], SCM_BOOL_F));
+      if (!common_y[d])
+       common_y[d] = me; 
+    }
+  while (flip (&d) != LEFT);
 
-      // distance from center to start of line      
-      Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length () * 3) / 4);
+  Grob *my_common_y = common_y[LEFT]->common_refpoint (common_y[RIGHT], Y_AXIS);
+  do
+    span_points[d][Y_AXIS] += common_y[d]->relative_coordinate (my_common_y, Y_AXIS);
+  while (flip (&d) != LEFT);
 
-      for (int a = X_AXIS; a < NO_AXES; a++)
-       {
-         Axis ax = (Axis)a;
-         dxy[ax]
-           = + robust_relative_extent (bound[RIGHT], common[X_AXIS], ax).center ()
-           - robust_relative_extent (bound[LEFT], common[X_AXIS], ax).center ();
+  Offset dz = (span_points[RIGHT] - span_points[LEFT]);
+  Offset dz_dir = dz.direction ();
+  if (gaps[LEFT] + gaps[RIGHT] > dz.length ())
+    {
+      return SCM_EOL;
+    }
 
-         my_off[ax] = me->relative_coordinate (common[a], ax);
-         his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax);
+  Stencil line;
+  do
+    {
+      if (stencils[d])
+       {
+        Stencil s = stencils[d]->translated (span_points[d]);
+        SCM align = ly_assoc_get (ly_symbol2scm ("stencil-align-dir-y"),
+                                  bounds[d], SCM_BOOL_F);
+        SCM off = ly_assoc_get (ly_symbol2scm ("stencil-offset"),
+                                  bounds[d], SCM_BOOL_F);
+
+        if (scm_is_number (align)) 
+          s.align_to (Y_AXIS, scm_to_double (align));
+
+        /*
+          todo: should use font-size.
+         */
+        if (is_number_pair (off))
+          s.translate (ly_scm2offset (off));
+        
+        line.add_stencil (s);
        }
+    }
+  while (flip (&d) != LEFT);
 
-      ofxy = dxy * (off / dxy.length ()) ;
-      dxy -= 2*ofxy;
-
-      dxy[Y_AXIS] += extra_dy;
+  do
+    {
+      if (stencils[d])
+       span_points[d] += dz_dir *
+         (stencils[d]->extent (X_AXIS)[-d] / dz_dir[X_AXIS]);
       
-      Stencil line = line_stencil (me, Offset (0, 0), dxy);
-
-      line.translate_axis (bound[LEFT]->extent (bound[LEFT], X_AXIS).length () / 2, X_AXIS);
-      line.translate (ofxy - my_off + his_off + Offset (0, -extra_dy/2));
-      return line.smobbed_copy ();
+      span_points[d] += -d * gaps[d] *  dz.direction ();
     }
+  while (flip (&d) != LEFT);
+
+  line.add_stencil (Line_interface::line (me, 
+                                         span_points[LEFT],
+                                         span_points[RIGHT]));
+
+  line.add_stencil (Line_interface::arrows (me,
+                                           span_points[LEFT],
+                                           span_points[RIGHT],
+                                           arrows[LEFT],
+                                           arrows[RIGHT]));
+
+  line.translate (Offset (-me->relative_coordinate (commonx, X_AXIS),
+                         -me->relative_coordinate (my_common_y, Y_AXIS)));
+                         
+    
+  return line.smobbed_copy ();
 }
 
 ADD_INTERFACE (Line_spanner,
@@ -218,8 +324,10 @@ ADD_INTERFACE (Line_spanner,
               "\n",
 
               "extra-dy "
-              "arrow "
               "gap "
               "thickness "
+              "bound-details " 
+              "left-bound-info " 
+              "right-bound-info " 
               );
 
index c2e96a4a1cf800c62197c085424f6a8460f457ed..581984dfe9951495bd4320684d8d1f562784ae94 100644 (file)
@@ -106,7 +106,7 @@ entry_to_alist (void *closure, SCM key, SCM val, SCM result)
   return result;
 }
 
-LY_DEFINE (ly_module2alist, "ly:module->alist",
+LY_DEFINE (ly_module_2_alist, "ly:module->alist",
           1, 0, 0, (SCM mod),
           "Dump the contents of  module @var{mod} as an alist.")
 {
index b19259e6b2505d36c30034282cc3caf55abfcdb9..16839f81bb568449ed83b7247584a0e1596123c3 100644 (file)
@@ -21,20 +21,20 @@ LY_DEFINE (ly_make_moment, "ly:make-moment",
           "notes, and @var{g} the timing for grace notes.  "
           "In absence of grace notes, @var{g} is zero.\n")
 {
-  SCM_ASSERT_TYPE (scm_is_integer (n), n, SCM_ARG1, __FUNCTION__, "integer");
-  SCM_ASSERT_TYPE (scm_is_integer (d), d, SCM_ARG2, __FUNCTION__, "integer");
+  LY_ASSERT_TYPE (scm_is_integer, n, 1);
+  LY_ASSERT_TYPE(scm_is_integer,d, 2);
 
   int grace_num = 0;
   if (gn != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_integer (gn), gn, SCM_ARG3, __FUNCTION__, "integer");
+      LY_ASSERT_TYPE(scm_is_integer,gn, 3);
       grace_num = scm_to_int (gn);
     }
 
   int grace_den = 1;
   if (gd != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_integer (gd), gd, SCM_ARG4, __FUNCTION__, "integer");
+      LY_ASSERT_TYPE(scm_is_integer,gd, 4);
       grace_den = scm_to_int (gd);
     }
 
@@ -42,14 +42,16 @@ LY_DEFINE (ly_make_moment, "ly:make-moment",
                 Rational (grace_num, grace_den)).smobbed_copy ();
 }
 
-LY_DEFINE (ly_sub_moment, "ly:moment-sub",
+LY_DEFINE (ly_moment_sub, "ly:moment-sub",
           2, 0, 0, (SCM a, SCM b),
           "Subtract two moments.")
 {
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB (Moment,b, 2);
+  
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
-  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+
   return (*ma - *mb).smobbed_copy ();
 }
 
@@ -57,10 +59,12 @@ LY_DEFINE (ly_moment_add, "ly:moment-add",
           2, 0, 0, (SCM a, SCM b),
           "Add two moments.")
 {
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment,b, 2); 
+
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
-  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+
   return (*ma + *mb).smobbed_copy ();
 }
 
@@ -68,10 +72,11 @@ LY_DEFINE (ly_moment_mul, "ly:moment-mul",
           2, 0, 0, (SCM a, SCM b),
           "Multiply two moments.")
 {
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment, b, 2); 
+
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
-  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
   return (*ma * * mb).smobbed_copy ();
 }
 
@@ -79,10 +84,12 @@ LY_DEFINE (ly_moment_div, "ly:moment-div",
           2, 0, 0, (SCM a, SCM b),
           "Divide two moments.")
 {
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment, b, 2); 
+
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
-  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+  
   return (*ma / * mb).smobbed_copy ();
 }
 
@@ -90,10 +97,11 @@ LY_DEFINE (ly_moment_mod, "ly:moment-mod",
           2, 0, 0, (SCM a, SCM b),
           "Modulo of two moments.")
 {
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment, b, 2); 
+  
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
-  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
   return (*ma % * mb).smobbed_copy ();
 }
 
@@ -101,8 +109,9 @@ LY_DEFINE (ly_moment_grace_numerator, "ly:moment-grace-numerator",
           1, 0, 0, (SCM mom),
           "Extract numerator from grace timing.")
 {
+  LY_ASSERT_SMOB (Moment, mom, 1);
+
   Moment *ma = unsmob_moment (mom);
-  SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
 
   return scm_from_int (ma->grace_part_.numerator ());
 }
@@ -111,8 +120,8 @@ LY_DEFINE (ly_moment_grace_denominator, "ly:moment-grace-denominator",
           1, 0, 0, (SCM mom),
           "Extract denominator from grace timing.")
 {
+  LY_ASSERT_SMOB (Moment, mom, 1);
   Moment *ma = unsmob_moment (mom);
-  SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
 
   return scm_from_int (ma->grace_part_.denominator ());
 }
@@ -120,8 +129,8 @@ LY_DEFINE (ly_moment_main_numerator, "ly:moment-main-numerator",
           1, 0, 0, (SCM mom),
           "Extract numerator from main timing.")
 {
+  LY_ASSERT_SMOB (Moment, mom, 1);
   Moment *ma = unsmob_moment (mom);
-  SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
 
   return scm_from_int (ma->main_part_.numerator ());
 }
@@ -130,8 +139,8 @@ LY_DEFINE (ly_moment_main_denominator, "ly:moment-main-denominator",
           1, 0, 0, (SCM mom),
           "Extract denominator from main timing.")
 {
+  LY_ASSERT_SMOB (Moment, mom, 1);
   Moment *ma = unsmob_moment (mom);
-  SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
 
   return scm_from_int (ma->main_part_.denominator ());
 }
@@ -140,10 +149,12 @@ LY_DEFINE (ly_moment_less_p, "ly:moment<?",
           2, 0, 0, (SCM a, SCM b),
           "Compare two moments.")
 {
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB (Moment, b, 2); 
+  
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
-  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
-  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+
   return ly_bool2scm (*ma < *mb);
 }
 
index 06e57f083b7f51326a7248bdd2b589d4e51a3d54..828929994a93515b22840709f5a5efdcda65d28c 100644 (file)
@@ -11,8 +11,7 @@ LY_DEFINE (ly_music_function_extract, "ly:music-function-extract", 1, 0, 0,
           (SCM x),
           "Return the Scheme function inside @var{x}")
 {
-  SCM_ASSERT_TYPE(is_music_function (x), x, SCM_ARG1, __FUNCTION__,
-                 "music function");
+  LY_ASSERT_TYPE (is_music_function, x, 1);
   
   return SCM_CELL_OBJECT_1(x);
 }
@@ -24,7 +23,7 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
           "Its arguments. @code{signature} is a list containing either "
           "@code{ly:music?} predicates or other type predicates.")
 {
-  SCM_ASSERT_TYPE(ly_is_procedure (func), func, SCM_ARG1, __FUNCTION__, "function");
+  LY_ASSERT_TYPE (ly_is_procedure, func, 1);
   return  make_music_function (signature, func);
 }
 
index 711df4d1a194352790df0dc839e8ce142316408d..1e08ba26ef0d42956f5a6975c83857d9df2f9794 100644 (file)
@@ -15,8 +15,8 @@ LY_DEFINE (ly_music_length, "ly:music-length",
           1, 0, 0, (SCM mus),
           "Get the length of music expression @var{mus}, and return as a @code{Moment} object.")
 {
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   Music *sc = unsmob_music (mus);
-  SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
   return sc->get_length ().smobbed_copy ();
 }
 
@@ -25,17 +25,16 @@ LY_DEFINE (ly_music_property,
           "Get the property @var{sym} of music expression @var{mus}.\n"
           "If @var{sym} is undefined, return @code{'()}.\n")
 {
-  Music *sc = unsmob_music (mus);
-  SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   return ly_prob_property (mus,sym,dfault);
 }
 
-LY_DEFINE (ly_music_set_property, "ly:music-set-property!",
+LY_DEFINE (ly_music_set_property_x, "ly:music-set-property!",
           3, 0, 0, (SCM mus, SCM sym, SCM val),
           "Set property @var{sym} in music expression @var{mus} to @var{val}.")
 {
-  Music *sc = unsmob_music (mus);
-  SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
+
   return ly_prob_set_property_x (mus, sym, val);
 }
 
@@ -69,8 +68,8 @@ LY_DEFINE (ly_music_mutable_properties, "ly:music-mutable-properties",
           "they are constant and initialized by the "
           "@code{make-music} function.\n")
 {
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   Music *m = unsmob_music (mus);
-  SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "music");
   return m->get_property_alist (true);
 }
 
@@ -111,10 +110,11 @@ LY_DEFINE (ly_music_transpose, "ly:music-transpose",
           "Transpose @var{m} such that central C is mapped to @var{p}. "
           "Return @var{m}.")
 {
+  LY_ASSERT_TYPE (unsmob_music, m, 1);
+  LY_ASSERT_SMOB (Pitch, p, 2);
+
   Music *sc = unsmob_music (m);
   Pitch *sp = unsmob_pitch (p);
-  SCM_ASSERT_TYPE (sc, m, SCM_ARG1, __FUNCTION__, "music");
-  SCM_ASSERT_TYPE (sp, p, SCM_ARG2, __FUNCTION__, "pitch");
 
   sc->transpose (*sp);
   // SCM_UNDEFINED ?
@@ -128,11 +128,10 @@ LY_DEFINE (ly_music_compress, "ly:music-compress",
           2, 0, 0, (SCM m, SCM factor),
           "Compress music object @var{m} by moment @var{factor}.")
 {
-  Music *sc = unsmob_music (m);
-
-  SCM_ASSERT_TYPE (sc, m, SCM_ARG1, __FUNCTION__, "music");
-  SCM_ASSERT_TYPE (unsmob_moment (factor), factor, SCM_ARG2, __FUNCTION__, "moment");
+  LY_ASSERT_TYPE (unsmob_music, m, 1);
+  LY_ASSERT_TYPE(unsmob_moment,factor, 2);
 
+  Music *sc = unsmob_music (m);
   sc->compress (*unsmob_moment (factor));
   return sc->self_scm ();
 }
@@ -141,8 +140,8 @@ LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0, 0,
           (SCM mus),
           "Extract the duration field from @var{mus}, and return the length.")
 {
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   Music *m = unsmob_music (mus);
-  SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music");
 
   Duration *d = unsmob_duration (m->get_property ("duration"));
   Moment len;
@@ -158,10 +157,11 @@ LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0,
           (SCM mus, SCM fact),
           "Compress @var{mus} by factor @var{fact}, which is a @code{Moment}.")
 {
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
+  LY_ASSERT_SMOB (Moment, fact, 2);
+  
   Music *m = unsmob_music (mus);
   Moment *f = unsmob_moment (fact);
-  SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music");
-  SCM_ASSERT_TYPE (f, fact, SCM_ARG2, __FUNCTION__, "Moment");
 
   Duration *d = unsmob_duration (m->get_property ("duration"));
   if (d)
index b22e243139690aa239ea475d7a6bff176675afe0..77c8f34335629a5c75c4d2e7e9614976e95e259e 100644 (file)
@@ -250,7 +250,7 @@ Music::origin () const
 Stream_event *
 Music::to_event () const
 {
-  SCM class_name = ly_camel_case_to_lisp_identifier (get_property ("name"));
+  SCM class_name = ly_camel_case_2_lisp_identifier (get_property ("name"));
 
   // catch programming mistakes.
   if (!internal_is_music_type (class_name))
diff --git a/lily/new-line-spanner.cc b/lily/new-line-spanner.cc
deleted file mode 100644 (file)
index 3842cb2..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
-  line-spanner.cc -- implement New_line_spanner
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "spanner.hh"
-#include "output-def.hh"
-#include "paper-column.hh"
-#include "staff-symbol-referencer.hh"
-#include "font-interface.hh"
-#include "warn.hh"
-#include "align-interface.hh"
-#include "lookup.hh"
-#include "line-interface.hh"
-#include "moment.hh"
-
-#include "lily-proto.hh"
-#include "grob-interface.hh"
-#include "text-interface.hh"
-
-class New_line_spanner
-{
-public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
-
-  DECLARE_SCHEME_CALLBACK (calc_left_bound_info, (SCM));
-  DECLARE_SCHEME_CALLBACK (calc_left_bound_info_and_text, (SCM));
-  DECLARE_SCHEME_CALLBACK (calc_right_bound_info, (SCM));
-  DECLARE_SCHEME_CALLBACK (calc_bound_info, (SCM, Direction));
-  DECLARE_GROB_INTERFACE();
-
-  static Grob *common_y (Grob*); 
-};
-
-Grob*
-New_line_spanner::common_y (Grob*me_grob) 
-{
-  Spanner *me = dynamic_cast<Spanner*> (me_grob);
-  
-  Grob *commony = me;
-  Direction d = LEFT;
-  do
-    if (me->get_bound (d)->break_status_dir () == CENTER)
-      commony = me->get_bound (d)->common_refpoint (commony, Y_AXIS);
-  while (flip (&d) != LEFT);
-
-  return commony;
-}
-
-static Grob *
-line_spanner_common_parent (Grob *me)
-{
-  Grob *common = find_fixed_alignment_parent (me);
-  if (!common)
-    {
-      common = Staff_symbol_referencer::get_staff_symbol (me);
-      if (common)
-       common = common->get_parent (Y_AXIS);
-      else
-       common = me->get_parent (Y_AXIS);
-    }
-
-  return common;
-}
-
-SCM
-New_line_spanner::calc_bound_info (SCM smob, Direction dir)
-{
-  Spanner *me = unsmob_spanner (smob);
-
-  Grob *commonx = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
-  commonx = me->common_refpoint (commonx, X_AXIS);
-
-  SCM bound_details = me->get_property ("bound-details");
-
-  SCM details = SCM_BOOL_F;
-  if (details == SCM_BOOL_F)
-    details = ly_assoc_get ((dir == LEFT)
-                           ? ly_symbol2scm ("left")
-                           : ly_symbol2scm ("right"), bound_details, SCM_BOOL_F);
-
-  if (me->get_bound (dir)->break_status_dir ())
-    {
-      SCM extra = ly_assoc_get ((dir == LEFT)
-                               ? ly_symbol2scm ("left-broken")
-                               : ly_symbol2scm ("right-broken"), bound_details, SCM_EOL);
-
-      for (SCM s = extra; scm_is_pair (s); s = scm_cdr (s))
-       details = scm_cons (scm_car (s), details);
-    }
-  
-  if (details == SCM_BOOL_F)
-    details = ly_assoc_get (ly_symbol2scm ("default"), bound_details, SCM_EOL);
-
-  SCM text = ly_assoc_get (ly_symbol2scm ("text"), details, SCM_BOOL_F);
-  if (Text_interface::is_markup (text))
-    {
-      Output_def *layout = me->layout ();
-      SCM properties = Font_interface::text_font_alist_chain (me);
-      details = scm_acons (ly_symbol2scm ("stencil"),
-                          Text_interface::interpret_markup (layout->self_scm (),
-                                                            properties, text),
-                          details);
-    }
-  
-  if (!scm_is_number (ly_assoc_get (ly_symbol2scm ("X"), details, SCM_BOOL_F)))
-    {
-      Direction attach = (Direction)
-       robust_scm2int (ly_assoc_get (ly_symbol2scm ("attach-dir"),
-                                                    details, SCM_BOOL_F),
-                       CENTER);
-
-      details = scm_acons (ly_symbol2scm ("X"),
-                          scm_from_double (me->get_bound (dir)->extent (commonx, X_AXIS)
-                                           .linear_combination (attach)),
-                          details);
-    }
-  
-
-  if (!scm_is_number (ly_assoc_get (ly_symbol2scm ("Y"), details, SCM_BOOL_F)))
-    {
-      Real y = 0.0;
-
-      Real extra_dy = robust_scm2double (me->get_property ("extra-dy"),
-                                        0.0);
-         
-      if (me->get_bound (dir)->break_status_dir ())
-       {
-         /*
-           This is hairy. For the normal case, we simply find common
-           parents, and draw a line between the bounds. When two note
-           heads are on different systems, there is no common parent
-           anymore. We have to find the piano-staff object.
-         */
-
-         Spanner *next_sp = me->broken_neighbor (dir);
-         Item *next_bound = next_sp->get_bound (dir);
-
-         if (next_bound->break_status_dir ())
-           {
-             programming_error ("no note heads for the line spanner on neighbor line?"
-                                " Confused.");
-             me->suicide ();
-             return SCM_EOL;
-           }
-
-         Grob *next_common_y = line_spanner_common_parent (next_bound);
-         Interval next_ext = next_bound->extent (next_common_y, Y_AXIS);
-
-         y = next_ext.center ();
-       }
-      else
-       {
-         Grob *commony = common_y (me);
-         y = me->get_bound (dir)->extent (commony, Y_AXIS).center();
-       }
-
-      y += dir * extra_dy / 2; 
-      details = scm_acons (ly_symbol2scm ("Y"), scm_from_double (y), details);
-    }
-
-  return details;
-}
-
-MAKE_SCHEME_CALLBACK (New_line_spanner, calc_right_bound_info, 1);
-SCM
-New_line_spanner::calc_right_bound_info (SCM smob)
-{
-  return New_line_spanner::calc_bound_info (smob, RIGHT);
-}
-
-MAKE_SCHEME_CALLBACK (New_line_spanner, calc_left_bound_info, 1);
-SCM
-New_line_spanner::calc_left_bound_info (SCM smob)
-{
-  return New_line_spanner::calc_bound_info (smob, LEFT);
-}
-
-MAKE_SCHEME_CALLBACK (New_line_spanner, calc_left_bound_info_and_text, 1);
-SCM
-New_line_spanner::calc_left_bound_info_and_text (SCM smob)
-{
-  SCM alist = New_line_spanner::calc_bound_info (smob, LEFT);
-  Spanner *me = unsmob_spanner (smob);
-
-  SCM text = me->get_property ("text");
-  if (Text_interface::is_markup (text)
-      && me->get_bound (LEFT)->break_status_dir () == CENTER
-      && ly_assoc_get (ly_symbol2scm ("stencil"), alist, SCM_BOOL_F) == SCM_BOOL_F)
-    {
-      Output_def *layout = me->layout ();
-      SCM properties = Font_interface::text_font_alist_chain (me);
-      alist = scm_acons (ly_symbol2scm ("stencil"),
-                        Text_interface::interpret_markup (layout->self_scm (),
-                                                          properties, text),
-                        alist);
-    }
-  
-  return alist;
-}
-
-MAKE_SCHEME_CALLBACK (New_line_spanner, print, 1);
-SCM
-New_line_spanner::print (SCM smob)
-{
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
-
-  Interval_t<Moment> moments = me->spanned_time ();
-  /*
-    We remove the line at the start of the line.  For piano voice
-    indicators, it makes no sense to have them at the start of the
-    line.
-
-    I'm not sure what the official rules for glissandi are, but
-    usually the 2nd note of the glissando is "exact", so when playing
-    from the start of the line, there is no need to glide.
-
-    From a typographical p.o.v. this makes sense, since the amount of
-    space left of a note at the start of a line is very small.
-
-    --hwn.
-
-  */
-  if (moments.length () == Moment (0,0))
-    return SCM_EOL;
-  
-  Drul_array<SCM> bounds (me->get_property ("left-bound-info"),
-                         me->get_property ("right-bound-info"));
-
-  
-  Grob *commonx = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
-  commonx = me->common_refpoint (commonx, X_AXIS);
-
-  Drul_array<Offset> span_points;
-
-  Direction d =  LEFT;
-  do
-    {
-      Offset z (robust_scm2double (ly_assoc_get (ly_symbol2scm ("X"),
-                                                bounds[d], SCM_BOOL_F), 0.0)
-               + commonx->relative_coordinate (commonx, X_AXIS),
-               robust_scm2double (ly_assoc_get (ly_symbol2scm ("Y"),
-                                                bounds[d], SCM_BOOL_F), 0.0));
-      
-      span_points[d] = z;
-    }
-  while (flip (&d) != LEFT);
-
-  Offset dz = (span_points[RIGHT] - span_points[LEFT]);
-  Offset dz_dir = dz.direction ();
-  Drul_array<Real> gaps (0, 0);
-  Drul_array<bool> arrows (0, 0);
-  Drul_array<Stencil*> stencils (0,0);
-  do
-    {
-      gaps[d] = robust_scm2double (ly_assoc_get (ly_symbol2scm ("padding"),
-                                                bounds[d], SCM_BOOL_F), 0.0);
-      arrows[d] = to_boolean (ly_assoc_get (ly_symbol2scm ("arrow"),
-                                           bounds[d], SCM_BOOL_F));
-      stencils[d] = unsmob_stencil (ly_assoc_get (ly_symbol2scm ("stencil"),
-                                                 bounds[d], SCM_BOOL_F));
-     
-    }
-  while (flip (&d) != LEFT);
-
-  if (gaps[LEFT] + gaps[RIGHT] > dz.length ())
-    {
-      return SCM_EOL;
-    }
-
-  Stencil line;
-  do
-    {
-      if (stencils[d])
-       {
-        Stencil s = stencils[d]->translated (span_points[d]);
-        SCM align = ly_assoc_get (ly_symbol2scm ("stencil-align-dir-y"),
-                                  bounds[d], SCM_BOOL_F);
-        SCM off = ly_assoc_get (ly_symbol2scm ("stencil-offset"),
-                                  bounds[d], SCM_BOOL_F);
-
-        if (scm_is_number (align)) 
-          s.align_to (Y_AXIS, scm_to_double (align));
-
-        /*
-          todo: should use font-size.
-         */
-        if (is_number_pair (off))
-          s.translate (ly_scm2offset (off));
-        
-        line.add_stencil (s);
-       }
-    }
-  while (flip (&d) != LEFT);
-
-  do
-    {
-      if (stencils[d])
-       span_points[d] += dz_dir *
-         (stencils[d]->extent (X_AXIS)[-d] / dz_dir[X_AXIS]);
-
-      
-      span_points[d] += -d * gaps[d] *  dz.direction ();
-    }
-  while (flip (&d) != LEFT);
-
-  line.add_stencil (Line_interface::line (me, 
-                                         span_points[LEFT],
-                                         span_points[RIGHT]));
-
-  line.add_stencil (Line_interface::arrows (me,
-                                           span_points[LEFT],
-                                           span_points[RIGHT],
-                                           arrows[LEFT],
-                                           arrows[RIGHT]));
-  Grob *commony = common_y (me);
-
-  line.translate (Offset (-me->relative_coordinate (commonx, X_AXIS),
-                         -me->relative_coordinate (commony, Y_AXIS)));
-                         
-    
-  return line.smobbed_copy ();
-}
-
-ADD_INTERFACE (New_line_spanner,
-              "Generic line drawn between two objects, e.g. for use with glissandi.\n"
-              "The property @code{style} can be @code{line}, "
-              "@code{dashed-line}, @code{trill}, \n"
-              "@code{dotted-line} or @code{zigzag}.\n"
-              "\n",
-
-              "extra-dy "
-              "gap "
-              "thickness "
-              "bound-details " 
-              "left-bound-info " 
-              "right-bound-info " 
-              );
-
index 7d92a76ec0600f33756094e3086ee711b8bcb453..488d77f1b72b4cffc07969dc20c53172eb1068ee 100644 (file)
@@ -323,7 +323,9 @@ MAKE_SCHEME_CALLBACK(Note_collision_interface, calc_positioning_done, 1)
 SCM
 Note_collision_interface::calc_positioning_done (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);  
+  Grob *me = unsmob_grob (smob);
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   Drul_array<vector<Grob*> > cg = get_clash_groups (me);
 
   Direction d = UP;
index 621e5311b98f034a671c833fcfc5919889be1f5c..57919802694ae70582e83e21bf0ffa0106149746 100644 (file)
@@ -16,9 +16,9 @@ LY_DEFINE(ly_note_head__stem_attachment, "ly:note-head::stem-attachment",
          "Get attachment in @var{font-metric} for attaching a stem to notehead "
          "@var{glyph-name}.")
 {
+  LY_ASSERT_SMOB (Font_metric, font_metric, 1);
   Font_metric *fm = unsmob_metrics (font_metric);
-  SCM_ASSERT_TYPE(fm, font_metric, SCM_ARG1, __FUNCTION__, "font metric");
-  SCM_ASSERT_TYPE(scm_is_string (glyph_name), glyph_name, SCM_ARG2, __FUNCTION__, "string");
+  LY_ASSERT_TYPE(scm_is_string,glyph_name, 2);
   
   return ly_offset2scm (Note_head::get_stem_attachment (fm, ly_scm2string (glyph_name)));
 }
index c6561b48cb111c9540d1b2b26e34c38e55527562..64b140f07e021b10cfc15f1e1390c2d936c63e28 100644 (file)
@@ -14,8 +14,8 @@ LY_DEFINE (ly_font_sub_fonts, "ly:font-sub-fonts", 1, 0, 0,
           "Given the font metric @var{font} of an OpenType font, return the "
           "names of the subfonts within @var{font}.")
 {
+  LY_ASSERT_SMOB (Font_metric, font, 1);
   Font_metric *fm = unsmob_metrics (font);
-  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
   return fm->sub_fonts ();
 }
 
@@ -27,9 +27,9 @@ LY_DEFINE (ly_otf_font_glyph_info, "ly:otf-font-glyph-info", 2, 0, 0,
   Modified_font_metric *fm
     = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
   Open_type_font *otf = dynamic_cast<Open_type_font *> (fm->original_font ());
+
   SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OTF font-metric");
-  SCM_ASSERT_TYPE (scm_is_string (glyph), glyph, SCM_ARG1,
-                  __FUNCTION__, "string");
+  LY_ASSERT_TYPE(scm_is_string, glyph, 2);
 
   SCM sym = scm_string_to_symbol (glyph);
   return scm_hashq_ref (otf->get_char_table (), sym, SCM_EOL);
@@ -47,7 +47,7 @@ LY_DEFINE (ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0,
     : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
 
   SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "Open type font");
-  SCM_ASSERT_TYPE (scm_is_string (tag), tag, SCM_ARG1, __FUNCTION__, "Open type font");
+  LY_ASSERT_TYPE (scm_is_string, tag, 2);
 
   char ctag [5] = "    ";
 
@@ -83,7 +83,7 @@ LY_DEFINE (ly_otf_glyph_list, "ly:otf-glyph-list",
     : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
 
 
-  SCM_ASSERT_TYPE (otf,font, SCM_ARG1, __FUNCTION__, "OTF font");
+  SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OTF font");
   return otf->glyph_list ();
 
 }
index cf13802844cf866eedf8d13615bb5a5aee14a94b..5dd1036ef1a9acec143abf2a2c2a24a537d999bf 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "text-interface.hh"
-#include "line-spanner.hh"
 #include "spanner.hh"
 #include "font-interface.hh"
 #include "dimensions.hh"
index e7533eed16597c2d68a1595dd16abfc660bffb97..ea216a371fc3ae5ad63d36a31e1f2ef06f8e2564 100644 (file)
 #include "context-def.hh"
 #include "lily-parser.hh"
 
-LY_DEFINE (ly_layout_lookup, "ly:output-def-lookup",
+LY_DEFINE (ly_output_def_lookup, "ly:output-def-lookup",
           2, 1, 0, (SCM pap, SCM sym, SCM def),
-          "Lookup @var{sym} in @var{pap}. "
+          "Lookup @var{sym} in the Output_def @var{pap}. "
           "Return the value or @var{def} (which defaults to  @code{'()}) if undefined.")
 {
+  LY_ASSERT_SMOB (Output_def, pap, 1);
   Output_def *op = unsmob_output_def (pap);
-  SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   SCM answer = op->lookup_variable (sym);
   if (answer == SCM_UNDEFINED)
@@ -39,8 +39,8 @@ LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
           1, 0, 0, (SCM def),
           "Get the variable scope inside @var{def}.")
 {
+  LY_ASSERT_SMOB (Output_def, def, 1);
   Output_def *op = unsmob_output_def (def);
-  SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
   return op->scope_;
 }
 
@@ -48,8 +48,8 @@ LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
           1, 0, 0, (SCM def),
           "Get the parent output-def of @var{def}.")
 {
+  LY_ASSERT_SMOB (Output_def, def, 1);
   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;
 }
 
@@ -57,8 +57,8 @@ LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
           1, 0, 0, (SCM def),
           "Clone @var{def}.")
 {
+  LY_ASSERT_SMOB (Output_def, def, 1);
   Output_def *op = unsmob_output_def (def);
-  SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
 
   Output_def *clone = op->clone ();
   return clone->unprotect ();
@@ -70,7 +70,7 @@ LY_DEFINE (ly_output_description, "ly:output-description",
 {
   Output_def *id = unsmob_output_def (output_def);
 
-  SCM al = ly_module2alist (id->scope_);
+  SCM al = ly_module_2_alist (id->scope_);
   SCM ell = SCM_EOL;
   for (SCM s = al; scm_is_pair (s); s = scm_cdr (s))
     {
@@ -93,8 +93,8 @@ LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale",
           1, 0, 0, (SCM bp),
           "Get output-scale for BP.")
 {
+  LY_ASSERT_SMOB (Output_def, bp, 1);
   Output_def *b = unsmob_output_def (bp);
-  SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper");
   return scm_from_double (output_scale (b));
 }
 
@@ -114,10 +114,9 @@ LY_DEFINE (ly_paper_get_font, "ly:paper-get-font", 2, 0, 0,
           "(An alist chain is a list of alists, "
           "containing grob properties).\n")
 {
-  Output_def *paper = unsmob_output_def (paper_smob);
-  SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
-                  __FUNCTION__, "paper definition");
+  LY_ASSERT_SMOB (Output_def, paper_smob, 1);
 
+  Output_def *paper = unsmob_output_def (paper_smob);
   Font_metric *fm = select_font (paper, chain);
   return fm->self_scm ();
 }
@@ -126,9 +125,9 @@ LY_DEFINE (ly_paper_get_number, "ly:paper-get-number", 2, 0, 0,
           (SCM layout_smob, SCM name),
           "Return the layout variable @var{name}.")
 {
+  LY_ASSERT_SMOB (Output_def, layout_smob, 1);
   Output_def *layout = unsmob_output_def (layout_smob);
-  SCM_ASSERT_TYPE (layout, layout_smob, SCM_ARG1,
-                  __FUNCTION__, "layout definition");
   return scm_from_double (layout->get_dimension (name));
 }
 
@@ -137,10 +136,9 @@ LY_DEFINE (ly_paper_fonts, "ly:paper-fonts",
           (SCM bp),
           "Return fonts from the @code{\\paper} block @var{bp}.")
 {
+  LY_ASSERT_SMOB (Output_def, bp, 1);
   Output_def *b = unsmob_output_def (bp);
 
-  SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper");
-
   SCM tab1 = b->lookup_variable (ly_symbol2scm ("scaled-fonts"));
   SCM tab2 = b->lookup_variable (ly_symbol2scm ("pango-fonts"));
 
index b1edd941c5e1c5f9004fd0d738269bc841ff8fb2..613cd01caeba114b232959665260e724639aab59 100644 (file)
@@ -15,7 +15,7 @@ LY_DEFINE (ly_make_pango_description_string, "ly:make-pango-description-string",
           2, 0, 0, (SCM chain, SCM size),
           "Make a PangoFontDescription string for the property alist @var{chain} at size @var{size}.")
 {
-  SCM_ASSERT_TYPE (scm_is_number (size), size, SCM_ARG1, __FUNCTION__, "number");
+  LY_ASSERT_TYPE (scm_is_number, size, 1);
   PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size));
   char *str = pango_font_description_to_string (pfd);
 
index 01e777220b24655c19c0a860bcd32849a9392082..94bb17f05e0f3626f25e451f99372aa88f316b95 100644 (file)
@@ -14,6 +14,7 @@ LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
           1, 0, 0, (SCM pb),
           "Return pages in book PB.")
 {
+  LY_ASSERT_SMOB (Paper_book, pb, 1);
   return unsmob_paper_book (pb)->pages ();
 }
 
@@ -21,8 +22,8 @@ LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
           1, 0, 0, (SCM book),
           "Return pages in layout book @var{book}.")
 {
+  LY_ASSERT_SMOB (Paper_book, book, 1);
   Paper_book *pb = unsmob_paper_book (book);
-  SCM_ASSERT_TYPE (pb, book, SCM_ARG1, __FUNCTION__, "Paper_book");
 
   SCM scopes = SCM_EOL;
   if (ly_is_module (pb->header_))
@@ -35,6 +36,7 @@ LY_DEFINE (ly_paper_book_performances, "ly:paper-book-performances",
           1, 0, 0, (SCM paper_book),
           "Return performances in book @var{paper-book}.")
 {
+  LY_ASSERT_SMOB (Paper_book, paper_book, 1);
   return unsmob_paper_book (paper_book)->performances ();
 }
 
@@ -42,6 +44,7 @@ LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
           1, 0, 0, (SCM pb),
           "Return systems in book PB.")
 {
+  LY_ASSERT_SMOB (Paper_book, pb, 1);
   return unsmob_paper_book (pb)->systems ();
 }
 
@@ -49,7 +52,7 @@ LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
           1, 0, 0, (SCM pb),
           "Return pages in book PB.")
 {
+  LY_ASSERT_SMOB (Paper_book, pb, 1);
   Paper_book *pbook = unsmob_paper_book (pb);
-  SCM_ASSERT_TYPE(pbook, pb, SCM_ARG1, __FUNCTION__, "Paper_book");
   return pbook->paper_->self_scm ();
 }
index e4906f4a9bda4fb34eda3c90f85cfef9482723fd..3c00d79308e40ec3f010349dd7da8d21ee968069 100644 (file)
@@ -17,10 +17,8 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
           "Create an outputter that evaluates within "
           "@code{output-}@var{format}, writing to  @var{port}.")
 {
-  SCM_ASSERT_TYPE (ly_is_port (port), port, SCM_ARG1, __FUNCTION__,
-                  "port");
-  SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__,
-                  "String");
+  LY_ASSERT_TYPE (ly_is_port, port, 1);
+  LY_ASSERT_TYPE (scm_is_string, format, 2);
 
   string f = ly_scm2string (format);
 
@@ -45,10 +43,13 @@ LY_DEFINE (ly_outputter_dump_stencil, "ly:outputter-dump-stencil",
           2, 0, 0, (SCM outputter, SCM stencil),
           "Dump stencil @var{expr} onto @var{outputter}.")
 {
+  
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
+  LY_ASSERT_SMOB(Stencil, stencil, 2);
+
   Paper_outputter *po = unsmob_outputter (outputter);
   Stencil *st = unsmob_stencil (stencil);
-  SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
-  SCM_ASSERT_TYPE (st, stencil, SCM_ARG1, __FUNCTION__, "Paper_outputter");
+
   po->output_stencil (*st);
   return SCM_UNSPECIFIED;
 }
@@ -57,9 +58,10 @@ LY_DEFINE (ly_outputter_dump_string, "ly:outputter-dump-string",
           2, 0, 0, (SCM outputter, SCM str),
           "Dump @var{str} onto @var{outputter}.")
 {
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
+  LY_ASSERT_TYPE(scm_is_string, str, 2);
+
   Paper_outputter *po = unsmob_outputter (outputter);
-  SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
-  SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "Paper_outputter");
 
   return po->dump_string (str);
 }
@@ -68,8 +70,8 @@ LY_DEFINE (ly_outputter_port, "ly:outputter-port",
           1, 0, 0, (SCM outputter),
           "Return output port for @var{outputter}.")
 {
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
   Paper_outputter *po = unsmob_outputter (outputter);
-  SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
 
   return po->file ();
 }
@@ -78,8 +80,8 @@ LY_DEFINE (ly_outputter_close, "ly:outputter-close",
           1, 0, 0, (SCM outputter),
           "Close port of @var{outputter}.")
 {
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
   Paper_outputter *po = unsmob_outputter (outputter);
-  SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
 
   po->close ();
   return SCM_UNSPECIFIED;
@@ -89,8 +91,8 @@ LY_DEFINE (ly_outputter_output_scheme, "ly:outputter-output-scheme",
           2, 0, 0, (SCM outputter, SCM expr),
           "Eval @var{expr} in module of @var{outputter}.")
 {
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
   Paper_outputter *po = unsmob_outputter (outputter);
-  SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
 
   po->output_scheme (expr);
 
index 0c6a16c21c60de057d1da33f1760aa2860c7b08a..055b5363df95d4342661c6c0ae834ba84cb9025f 100644 (file)
@@ -13,8 +13,8 @@ LY_DEFINE (ly_paper_score_paper_systems, "ly:paper-score-paper-systems",
           (SCM paper_score),
           "Return vector of paper_system objects from @var{paper-score}.")
 {
-  Paper_score *pscore = dynamic_cast<Paper_score *> (unsmob_music_output (paper_score));
-  SCM_ASSERT_TYPE (pscore, paper_score, SCM_ARG1, __FUNCTION__, "Paper score (Music output)");
+  LY_ASSERT_TYPE (unsmob_paper_score, paper_score, 1);
 
+  Paper_score *pscore = dynamic_cast<Paper_score *> (unsmob_music_output (paper_score));
   return pscore->get_paper_systems ();
 }
index f91a4cddee1deaa0ab3e2466dc5f99037c7097f7..db0258328232ee30cec1a199bd7862c0e51f8f61 100644 (file)
@@ -158,3 +158,9 @@ Paper_score::get_paper_systems ()
   return paper_systems_;
 }
 
+
+Paper_score *
+unsmob_paper_score (SCM x)
+{
+  return dynamic_cast<Paper_score*> (unsmob_music_output (x));
+}
index 3f45829882b8b174e73f99bb077973333800850e..5da5e3ee729970eb02ad9082b783cf02d1ae803c 100644 (file)
@@ -12,12 +12,10 @@ LY_DEFINE (ly_performance_write, "ly:performance-write",
           2, 0, 0, (SCM performance, SCM filename),
           "Write @var{performance} to @var{filename}")
 {
-  Performance *perf = dynamic_cast<Performance *> (unsmob_music_output (performance));
+  LY_ASSERT_TYPE (unsmob_performance, performance, 1);
+  LY_ASSERT_TYPE(scm_is_string, filename, 2);
 
-  SCM_ASSERT_TYPE (perf, performance, SCM_ARG1, __FUNCTION__, "Performance");
-  SCM_ASSERT_TYPE (scm_is_string (filename), filename, SCM_ARG2, __FUNCTION__, "file name");
-
-  perf->write_output (ly_scm2string (filename));
+  unsmob_performance (performance)->write_output (ly_scm2string (filename));
   return SCM_UNSPECIFIED;
 }
 
index e536622f06f550336876ea29f4e3b421df787bce..70d5348a9b1d6f0513e7cc8b983538ec79b77cfe 100644 (file)
@@ -109,3 +109,9 @@ void
 Performance::process ()
 {
 }
+
+Performance *
+unsmob_performance (SCM x)
+{
+  return dynamic_cast<Performance*> (unsmob_music_output (x));
+}
diff --git a/lily/pfb-scheme.cc b/lily/pfb-scheme.cc
new file mode 100644 (file)
index 0000000..f22a745
--- /dev/null
@@ -0,0 +1,53 @@
+
+#include "program-option.hh"
+#include "source-file.hh"
+#include "memory-stream.hh"
+#include "open-type-font.hh"
+#include "main.hh"
+#include "warn.hh"
+
+LY_DEFINE (ly_pfb_2_pfa, "ly:pfb->pfa",
+          1, 0, 0, (SCM pfb_file_name),
+          "Convert the contents of a PFB file to PFA.")
+{
+  LY_ASSERT_TYPE (scm_is_string, pfb_file_name, 1);
+
+  string file_name = ly_scm2string (pfb_file_name);
+
+  if (be_verbose_global)
+    progress_indication ("[" + file_name);
+  
+  vector<char> pfb_string = gulp_file (file_name, 0);
+  char *pfa = pfb2pfa ((Byte *) &pfb_string[0], pfb_string.size ());
+  
+  SCM pfa_scm = scm_from_locale_string (pfa);
+  free (pfa);
+
+  if (be_verbose_global)
+    progress_indication ("]");
+
+  return pfa_scm;
+}
+
+LY_DEFINE (ly_otf_2_cff, "ly:otf->cff",
+          1, 0, 0, (SCM otf_file_name),
+          "Convert the contents of a OTF file to CFF file, returning it as "
+          " a string.")
+{
+  LY_ASSERT_TYPE (scm_is_string, otf_file_name, 1);
+
+  string file_name = ly_scm2string (otf_file_name);
+  if (be_verbose_global)
+    progress_indication ("[" + file_name);
+
+  FT_Face face = open_ft_face (file_name);
+  string table = get_otf_table (face, "CFF ");
+
+  SCM asscm = scm_from_locale_stringn ((char *) table.data (),
+                                      table.length ());
+
+  if (be_verbose_global)
+    progress_indication ("]");
+
+  return asscm;
+}
index f062c986dbcb75a30c7f5947634ede72ba54452c..3cee20618921fe8870ca7c2c3437476159be2f29 100644 (file)
@@ -70,51 +70,3 @@ pfb2pfa (Byte const *pfb, int length)
   return out;
 }
 
-LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
-          1, 0, 0, (SCM pfb_file_name),
-          "Convert the contents of a PFB file to PFA.")
-{
-  SCM_ASSERT_TYPE (scm_is_string (pfb_file_name), pfb_file_name,
-                  SCM_ARG1, __FUNCTION__, "string");
-
-  string file_name = ly_scm2string (pfb_file_name);
-
-  if (be_verbose_global)
-    progress_indication ("[" + file_name);
-  
-  vector<char> pfb_string = gulp_file (file_name, 0);
-  char *pfa = pfb2pfa ((Byte *) &pfb_string[0], pfb_string.size ());
-  
-  SCM pfa_scm = scm_from_locale_string (pfa);
-  free (pfa);
-
-  if (be_verbose_global)
-    progress_indication ("]");
-
-  return pfa_scm;
-}
-
-LY_DEFINE (ly_otf_to_cff, "ly:otf->cff",
-          1, 0, 0, (SCM otf_file_name),
-          "Convert the contents of a OTF file to CFF file, returning it as "
-          " a string.")
-{
-  SCM_ASSERT_TYPE (scm_is_string (otf_file_name), otf_file_name,
-                  SCM_ARG1, __FUNCTION__, "string");
-
-  string file_name = ly_scm2string (otf_file_name);
-  if (be_verbose_global)
-    progress_indication ("[" + file_name);
-
-  FT_Face face = open_ft_face (file_name);
-  string table = get_otf_table (face, "CFF ");
-
-  SCM asscm = scm_from_locale_stringn ((char *) table.data (),
-                                      table.length ());
-
-  if (be_verbose_global)
-    progress_indication ("]");
-
-  return asscm;
-}
-
index 440df366ebe68a7175b412bbfc09a010426e0326..aa1ac5cbfeb1617f2984dca2ed5be8adb1a4cc74 100644 (file)
@@ -13,10 +13,11 @@ LY_DEFINE (ly_pitch_transpose, "ly:pitch-transpose",
           "Transpose @var{p} by the amount @var{delta}, "
           "where @var{delta} is relative to middle C.")
 {
+  LY_ASSERT_SMOB (Pitch, p, 1);
+  LY_ASSERT_SMOB (Pitch, delta, 2);
+
   Pitch *t = unsmob_pitch (p);
   Pitch *d = unsmob_pitch (delta);
-  SCM_ASSERT_TYPE (t, p, SCM_ARG1, __FUNCTION__, "pitch");
-  SCM_ASSERT_TYPE (d, delta, SCM_ARG1, __FUNCTION__, "pitch");
   return t->transposed (*d).smobbed_copy ();
 }
 
@@ -29,10 +30,9 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch",
           "with 0 corresponding to C and 6 corresponding to B.  "
           "The @var{alter} is a rational number of whole tones for alteration.")
 {
-  SCM_ASSERT_TYPE (scm_is_integer (octave), octave, SCM_ARG1, __FUNCTION__, "integer");
-  SCM_ASSERT_TYPE (scm_is_integer (note), note, SCM_ARG2, __FUNCTION__, "integer");
-  SCM_ASSERT_TYPE (scm_is_rational (alter),
-                  alter, SCM_ARG3, __FUNCTION__, "rational");
+  LY_ASSERT_TYPE (scm_is_integer, octave, 1);
+  LY_ASSERT_TYPE(scm_is_integer, note, 2);
+  LY_ASSERT_TYPE(scm_is_rational, alter, 3);
   
   Pitch p (scm_to_int (octave), scm_to_int (note),
           ly_scm2rational (alter));
@@ -44,8 +44,8 @@ LY_DEFINE (ly_pitch_negate, "ly:pitch-negate", 1, 0, 0,
           (SCM p),
           "Negate @var{p}.")
 {
+  LY_ASSERT_SMOB (Pitch, p, 1);
   Pitch *pp = unsmob_pitch (p);
-  SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
   return pp->negated ().smobbed_copy ();
 }
 
@@ -53,8 +53,8 @@ LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
           (SCM p),
           "Number of steps counted from middle C of the pitch @var{p}.")
 {
+  LY_ASSERT_SMOB (Pitch, p, 1);
   Pitch *pp = unsmob_pitch (p);
-  SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
   return scm_from_int (pp->steps ());
 }
 
@@ -62,8 +62,8 @@ LY_DEFINE (ly_pitch_octave, "ly:pitch-octave",
           1, 0, 0, (SCM pp),
           "Extract the octave from pitch @var{p}.")
 {
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
-  SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
   int q = p->get_octave ();
   return scm_from_int (q);
 }
@@ -72,8 +72,8 @@ LY_DEFINE (ly_pitch_alteration, "ly:pitch-alteration",
           1, 0, 0, (SCM pp),
           "Extract the alteration from pitch  @var{p}.")
 {
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
-  SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
   Rational q = p->get_alteration ();
 
   return ly_rational2scm (q);
@@ -83,8 +83,8 @@ LY_DEFINE (pitch_notename, "ly:pitch-notename",
           1, 0, 0, (SCM pp),
           "Extract the note name from pitch  @var{pp}.")
 {
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
-  SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
   int q = p->get_notename ();
   return scm_from_int (q);
 }
@@ -93,8 +93,8 @@ LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
           1, 0, 0, (SCM pp),
           "Calculate the number of quarter tones of @var{p} from middle C.")
 {
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
-  SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
   int q = p->rounded_quartertone_pitch ();
   return scm_from_int (q);
 }
@@ -103,8 +103,8 @@ LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
           1, 0, 0, (SCM pp),
           "calculate the number of semitones of @var{p} from middle C.")
 {
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
-  SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
   int q = p->rounded_semitone_pitch ();
   return scm_from_int (q);
 }
@@ -113,12 +113,12 @@ LY_DEFINE (ly_pitch_less_p, "ly:pitch<?",
           2, 0, 0, (SCM p1, SCM p2),
           "Is @var{p1} lexicographically smaller than @var{p2}?")
 {
+  LY_ASSERT_SMOB (Pitch, p1, 1);
+  LY_ASSERT_SMOB (Pitch, p2, 2);
+
   Pitch *a = unsmob_pitch (p1);
   Pitch *b = unsmob_pitch (p2);
 
-  SCM_ASSERT_TYPE (a, p1, SCM_ARG1, __FUNCTION__, "Pitch");
-  SCM_ASSERT_TYPE (b, p2, SCM_ARG2, __FUNCTION__, "Pitch");
-
   if (Pitch::compare (*a, *b) < 0)
     return SCM_BOOL_T;
   else
@@ -130,10 +130,12 @@ LY_DEFINE (ly_pitch_diff, "ly:pitch-diff",
           "Return pitch @var{delta} such that @code{pitch} transposed by "
           "@var{delta} equals @var{root}")
 {
+  LY_ASSERT_SMOB (Pitch, pitch, 1);
+  LY_ASSERT_SMOB (Pitch, root, 2);
+
   Pitch *p = unsmob_pitch (pitch);
   Pitch *r = unsmob_pitch (root);
-  SCM_ASSERT_TYPE (p, pitch, SCM_ARG1, __FUNCTION__, "Pitch");
-  SCM_ASSERT_TYPE (r, root, SCM_ARG2, __FUNCTION__, "Pitch");
 
   return pitch_interval (*r, *p).smobbed_copy ();
 }
index 2d632a02a13347e4de3c623abd38fbfeaf5dc8f7..daa3bee42c772b37f6e4e53f90fbd3e4e42b68a6 100644 (file)
@@ -27,8 +27,7 @@ public:
 protected:
   DECLARE_ACKNOWLEDGER (note_head);
   DECLARE_ACKNOWLEDGER (dots);
-  DECLARE_ACKNOWLEDGER (text_spanner);
-  void process_music ();
+  DECLARE_ACKNOWLEDGER (trill_spanner);
   void stop_translation_timestep ();
 
 private:
@@ -60,7 +59,7 @@ Pitched_trill_engraver::acknowledge_note_head (Grob_info info)
 }
 
 void
-Pitched_trill_engraver::acknowledge_text_spanner (Grob_info info)
+Pitched_trill_engraver::acknowledge_trill_spanner (Grob_info info)
 {
   Stream_event *ev = info.event_cause ();
   if (ev
@@ -132,17 +131,12 @@ Pitched_trill_engraver::stop_translation_timestep ()
   trill_accidental_ = 0;
 }
 
-void
-Pitched_trill_engraver::process_music ()
-{
-}
-
 
 #include "translator.icc"
 
 ADD_ACKNOWLEDGER (Pitched_trill_engraver, note_head);
 ADD_ACKNOWLEDGER (Pitched_trill_engraver, dots);
-ADD_ACKNOWLEDGER (Pitched_trill_engraver, text_spanner);
+ADD_ACKNOWLEDGER (Pitched_trill_engraver, trill_spanner);
 
 ADD_TRANSLATOR (Pitched_trill_engraver,
                /* doc */
index dc53e51d3387e1bdae82b12774a3a6c08be4fcbe..a9838bb4353be12aafaea4ef3a315bbf19f477d3 100644 (file)
@@ -13,9 +13,9 @@ LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
           2, 1, 0, (SCM obj, SCM sym, SCM value),
           "Set property @var{sym} of @var{obj} to @var{value}")
 {
+  LY_ASSERT_SMOB (Prob, obj, 1);
   Prob *ps = unsmob_prob (obj);
-  SCM_ASSERT_TYPE (ps, obj, SCM_ARG1, __FUNCTION__, "Prob");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   ps->set_property (sym, value);
   return SCM_UNSPECIFIED;
@@ -23,7 +23,7 @@ LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
 
 /*
   Hmm, this is not orthogonal.
- */
+*/
 LY_DEFINE (ly_prob_property_p, "ly:prob-property?",
           2, 1, 0, (SCM obj, SCM sym),
           "Is boolean prop @var{sym} set?")
@@ -35,9 +35,9 @@ LY_DEFINE (ly_prob_property, "ly:prob-property",
           2, 1, 0, (SCM obj, SCM sym, SCM dfault),
           "Return the value for @var{sym}.")
 {
+  LY_ASSERT_SMOB (Prob, obj, 1);
   Prob *ps = unsmob_prob (obj);
-  SCM_ASSERT_TYPE (ps, obj, SCM_ARG1, __FUNCTION__, "Prob");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   if (dfault == SCM_UNDEFINED)
     dfault = SCM_EOL;
diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc
new file mode 100644 (file)
index 0000000..fe0f290
--- /dev/null
@@ -0,0 +1,244 @@
+/*
+  program-option-scheme.cc -- implement option setting from Scheme
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2001--2007  Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
+
+#include "program-option.hh"
+
+#include <cstdio>
+#include <cstring>
+using namespace std;
+
+#include "profile.hh"
+#include "international.hh"
+#include "main.hh"
+#include "parse-scm.hh"
+#include "string-convert.hh"
+#include "warn.hh"
+
+bool debug_skylines;
+
+/*
+  Backwards compatibility.
+*/
+bool lily_1_8_relative = false;
+bool lily_1_8_compatibility_used = false;
+bool profile_property_accesses = false;
+/*
+  crash if internally the wrong type is used for a grob property.
+*/
+bool do_internal_type_checking_global;
+bool strict_infinity_checking = false; 
+
+static SCM option_hash;
+
+void internal_set_option (SCM var, SCM val)
+{
+  scm_hashq_set_x (option_hash, var, val);
+
+  if (0)
+    ;
+  else if (var == ly_symbol2scm ("profile-property-accesses"))
+    {
+      profile_property_accesses = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("point-and-click"))
+    {
+      point_and_click_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("protected-scheme-parsing"))
+    {
+      parse_protect_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("check-internal-types"))
+    {
+      do_internal_type_checking_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("debug-gc-assert-parsed-dead"))
+    {
+      parsed_objects_should_be_dead = to_boolean (val);
+      val = scm_from_bool (parsed_objects_should_be_dead);
+    }
+  else if (var == ly_symbol2scm ("safe"))
+    {
+      be_safe_global = to_boolean (val);
+      val = scm_from_bool (be_safe_global);
+    }
+  else if (var == ly_symbol2scm ("old-relative"))
+    {
+      lily_1_8_relative = to_boolean (val);
+      /*  Needs to be reset for each file that uses this option.  */
+      lily_1_8_compatibility_used = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("strict-infinity-checking"))
+    {
+      strict_infinity_checking = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("debug-skylines"))
+    {
+      debug_skylines = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+}
+
+
+
+
+bool
+get_program_option (const char *s)
+{
+  SCM sym = ly_symbol2scm (s);
+
+  return to_boolean (ly_get_option (sym));
+}
+
+
+ssize const HELP_INDENT = 30;
+ssize const INDENT = 2;
+ssize const SEPARATION = 5;
+
+/*
+  Hmmm. should do in SCM / C++  ?
+*/
+static string
+get_help_string ()
+{
+  SCM alist = ly_hash2alist (option_hash);
+  SCM convertor = ly_lily_module_constant ("scm->string");
+
+  vector<string> opts;
+
+  for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
+    {
+      SCM sym = scm_caar (s);
+      SCM val = scm_cdar (s);
+      string opt_spec
+       = String_convert::char_string (' ', INDENT)
+       + ly_symbol2string (sym)
+       + " ("
+       + ly_scm2string (scm_call_1 (convertor, val))
+       + ")";
+
+      if (opt_spec.length () + SEPARATION > HELP_INDENT)
+       {
+         opt_spec += "\n"
+           + String_convert::char_string (' ', HELP_INDENT);
+       }
+      else
+       opt_spec += String_convert::char_string (' ', HELP_INDENT - opt_spec.length ());
+
+      SCM opt_help_scm
+       = scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
+      string opt_help = ly_scm2string (opt_help_scm);
+      replace_all (opt_help,
+                  string ("\n"),
+                  string ("\n")
+                  + String_convert::char_string (' ', HELP_INDENT));
+
+      opts.push_back (opt_spec + opt_help + "\n");
+    }
+
+  string help ("Options supported by ly:set-option\n\n");
+  vector_sort (opts, less<string> ());
+  for (vsize i = 0; i < opts.size (); i++)
+    help += opts[i];
+
+  help += string ("\n");
+  return help;
+}
+
+
+LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
+          "Print @code{ly:set-option} usage")
+{
+  string help = get_help_string ();
+  progress_indication (help);
+
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0,
+          (SCM sym, SCM val, SCM description),
+          "Add a program option @var{sym} with default @var{val}.")
+{
+  if (!option_hash)
+    {
+      option_hash = scm_permanent_object (scm_c_make_hash_table (11));
+    }
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 1);
+  LY_ASSERT_TYPE (scm_is_string, description, 3);
+
+  internal_set_option (sym, val);
+
+  scm_set_object_property_x (sym, ly_symbol2scm ("program-option-documentation"),
+                            description);
+
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
+          "Set a program option.")
+{
+  LY_ASSERT_TYPE (ly_is_symbol, var, 1);
+
+  if (val == SCM_UNDEFINED)
+    val = SCM_BOOL_T;
+
+  string varstr = ly_scm2string (scm_symbol_to_string (var));
+  if (varstr.substr (0, 3) == string ("no-"))
+    {
+      var = ly_symbol2scm (varstr.substr (3, varstr.length () -3).c_str ());
+      val = scm_from_bool (!to_boolean (val));
+    }
+
+  SCM handle = scm_hashq_get_handle (option_hash, var);
+  if (handle == SCM_BOOL_F)
+    warning (_f ("no such internal option: %s", varstr.c_str ()));
+
+  internal_set_option (var, val);
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_command_line_options, "ly:command-line-options", 0, 0, 0, (),
+          "The Scheme specified on command-line with @samp{-d}.")
+{
+  return ly_string2scm (init_scheme_variables_global); 
+}
+
+LY_DEFINE (ly_command_line_code, "ly:command-line-code", 0, 0, 0, (),
+          "The Scheme specified on command-line with @samp{-e}.")
+{
+  return ly_string2scm (init_scheme_code_global); 
+}
+
+LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (),
+          "Was be_verbose_global set?")
+{
+  return scm_from_bool (be_verbose_global);
+}
+
+
+
+LY_DEFINE (ly_all_options, "ly:all-options",
+          0, 0, 0, (),
+          "Get all option settings in an alist.")
+{
+  return ly_hash2alist (option_hash);
+}
+
+
+LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
+          "Get a global option setting.")
+{
+  LY_ASSERT_TYPE (ly_is_symbol, var, 1);
+  return scm_hashq_ref (option_hash, var, SCM_BOOL_F);
+}
index 5d9bebd7382728656addb4e9e5b01ac75fe1776c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,250 +0,0 @@
-/*
-  scm-option.cc -- implement option setting from Scheme
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2007  Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-#include "program-option.hh"
-
-#include <cstdio>
-#include <cstring>
-using namespace std;
-
-#include "profile.hh"
-#include "international.hh"
-#include "main.hh"
-#include "parse-scm.hh"
-#include "string-convert.hh"
-#include "warn.hh"
-
-bool debug_skylines;
-
-/*
-  Backwards compatibility.
-*/
-bool lily_1_8_relative = false;
-bool lily_1_8_compatibility_used = false;
-bool profile_property_accesses = false;
-/*
-  crash if internally the wrong type is used for a grob property.
-*/
-bool do_internal_type_checking_global;
-bool strict_infinity_checking = false; 
-
-static SCM option_hash;
-
-void internal_set_option (SCM var, SCM val)
-{
-  scm_hashq_set_x (option_hash, var, val);
-
-  if (0)
-    ;
-  else if (var == ly_symbol2scm ("profile-property-accesses"))
-    {
-      profile_property_accesses = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-  else if (var == ly_symbol2scm ("point-and-click"))
-    {
-      point_and_click_global = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-  else if (var == ly_symbol2scm ("protected-scheme-parsing"))
-    {
-      parse_protect_global = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-  else if (var == ly_symbol2scm ("check-internal-types"))
-    {
-      do_internal_type_checking_global = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-  else if (var == ly_symbol2scm ("debug-gc-assert-parsed-dead"))
-    {
-      parsed_objects_should_be_dead = to_boolean (val);
-      val = scm_from_bool (parsed_objects_should_be_dead);
-    }
-  else if (var == ly_symbol2scm ("safe"))
-    {
-      be_safe_global = to_boolean (val);
-      val = scm_from_bool (be_safe_global);
-    }
-  else if (var == ly_symbol2scm ("old-relative"))
-    {
-      lily_1_8_relative = to_boolean (val);
-      /*  Needs to be reset for each file that uses this option.  */
-      lily_1_8_compatibility_used = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-  else if (var == ly_symbol2scm ("strict-infinity-checking"))
-    {
-      strict_infinity_checking = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-  else if (var == ly_symbol2scm ("debug-skylines"))
-    {
-      debug_skylines = to_boolean (val);
-      val = scm_from_bool (to_boolean (val));
-    }
-}
-
-ssize const HELP_INDENT = 30;
-ssize const INDENT = 2;
-ssize const SEPARATION = 5;
-
-/*
-  Hmmm. should do in SCM / C++  ?
-*/
-static string
-get_help_string ()
-{
-  SCM alist = ly_hash2alist (option_hash);
-  SCM convertor = ly_lily_module_constant ("scm->string");
-
-  vector<string> opts;
-
-  for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
-    {
-      SCM sym = scm_caar (s);
-      SCM val = scm_cdar (s);
-      string opt_spec
-       = String_convert::char_string (' ', INDENT)
-       + ly_symbol2string (sym)
-       + " ("
-       + ly_scm2string (scm_call_1 (convertor, val))
-       + ")";
-
-      if (opt_spec.length () + SEPARATION > HELP_INDENT)
-       {
-         opt_spec += "\n"
-           + String_convert::char_string (' ', HELP_INDENT);
-       }
-      else
-       opt_spec += String_convert::char_string (' ', HELP_INDENT - opt_spec.length ());
-
-      SCM opt_help_scm
-       = scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
-      string opt_help = ly_scm2string (opt_help_scm);
-      replace_all (opt_help,
-                  string ("\n"),
-                  string ("\n")
-                  + String_convert::char_string (' ', HELP_INDENT));
-
-      opts.push_back (opt_spec + opt_help + "\n");
-    }
-
-  string help ("Options supported by ly:set-option\n\n");
-  vector_sort (opts, less<string> ());
-  for (vsize i = 0; i < opts.size (); i++)
-    help += opts[i];
-
-  help += string ("\n");
-  return help;
-}
-
-LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
-          "Print @code{ly:set-option} usage")
-{
-  string help = get_help_string ();
-  progress_indication (help);
-
-  return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0,
-          (SCM sym, SCM val, SCM description),
-          "Add a program option @var{sym} with default @var{val}.")
-{
-  if (!option_hash)
-    {
-      option_hash = scm_permanent_object (scm_c_make_hash_table (11));
-    }
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG1, __FUNCTION__, "symbol");
-  SCM_ASSERT_TYPE (scm_is_string (description), description,
-                  SCM_ARG3, __FUNCTION__, "string");
-
-  internal_set_option (sym, val);
-
-  scm_set_object_property_x (sym, ly_symbol2scm ("program-option-documentation"),
-                            description);
-
-  return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
-          "Set a program option. Try setting 'help for a help string.")
-{
-  SCM_ASSERT_TYPE (scm_is_symbol (var), var, SCM_ARG1,
-                  __FUNCTION__, "symbol");
-
-  if (ly_symbol2scm ("help") == var)
-    {
-      ly_option_usage ();
-      exit (0);
-    }
-
-  if (val == SCM_UNDEFINED)
-    val = SCM_BOOL_T;
-
-  string varstr = ly_scm2string (scm_symbol_to_string (var));
-  if (varstr.substr (0, 3) == string ("no-"))
-    {
-      var = ly_symbol2scm (varstr.substr (3, varstr.length () -3).c_str ());
-      val = scm_from_bool (!to_boolean (val));
-    }
-
-  SCM handle = scm_hashq_get_handle (option_hash, var);
-  if (handle == SCM_BOOL_F)
-    warning (_f ("no such internal option: %s", varstr.c_str ()));
-
-  internal_set_option (var, val);
-  return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_command_line_options, "ly:command-line-options", 0, 0, 0, (),
-          "The Scheme specified on command-line with @samp{-d}.")
-{
-  return ly_string2scm (init_scheme_variables_global); 
-}
-
-LY_DEFINE (ly_command_line_code, "ly:command-line-code", 0, 0, 0, (),
-          "The Scheme specified on command-line with @samp{-e}.")
-{
-  return ly_string2scm (init_scheme_code_global); 
-}
-
-LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (),
-          "Was be_verbose_global set?")
-{
-  return scm_from_bool (be_verbose_global);
-}
-
-
-
-LY_DEFINE (ly_all_option, "ly:all-options",
-          0, 0, 0, (),
-          "Get all option settings in an alist.")
-{
-  return ly_hash2alist (option_hash);
-}
-
-
-LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
-          "Get a global option setting.")
-{
-  SCM_ASSERT_TYPE (scm_is_symbol (var), var,
-                  SCM_ARG1, __FUNCTION__, "symbol");
-  return scm_hashq_ref (option_hash, var, SCM_BOOL_F);
-}
-
-
-
-bool
-get_program_option (const char *s)
-{
-  SCM sym = ly_symbol2scm (s);
-
-  return to_boolean (ly_get_option (sym));
-}
index b8ad86ba916a9c5e31633da5d44a7548a4bcdb51..e470e9154c838263e3bf988513705fd01dc315e7 100644 (file)
@@ -41,7 +41,7 @@ Rest_collision::force_shift_callback (SCM smob)
   return scm_from_double (0.0);
 }
 
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Rest_collision, force_shift_callback_rest, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Rest_collision, force_shift_callback_rest, 2, 1, "");
 SCM
 Rest_collision::force_shift_callback_rest (SCM rest, SCM offset)
 {
@@ -92,6 +92,9 @@ SCM
 Rest_collision::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   extract_grob_set (me, "elements", elts);
 
   vector<Grob*> rests;
index c9fa8b7f22afc7499a1782a0f956122eb3e804d4..0859c25dba306de8fdddaca00c4a421fb0c7a9c6 100644 (file)
@@ -66,9 +66,9 @@ LY_DEFINE (ly_set_default_scale, "ly:set-default-scale",
           1, 0, 0, (SCM scale),
           "Set the global default scale.")
 {
-  Scale *s = Scale::unsmob (scale);
-  SCM_ASSERT_TYPE (s, scale, SCM_ARG1, __FUNCTION__, "scale");
+  LY_ASSERT_SMOB (Scale, scale, 1);
 
+  Scale *s = Scale::unsmob (scale);
   if (default_global_scale)
     default_global_scale->unprotect ();
   default_global_scale = s;
index 5d46d7fc5b15a9d76f7822113726a8748f2f9dea..004c14c14f2ea748d96580a8d137c4b5eba1e029 100644 (file)
@@ -16,7 +16,7 @@ LY_DEFINE (ly_make_listener, "ly:make-listener",
           "\n"
           " @var{callback} should take exactly one argument." )
 {
-  SCM_ASSERT_TYPE (ly_is_procedure (callback), callback, SCM_ARG1, __FUNCTION__, "procedure");
+  LY_ASSERT_TYPE (ly_is_procedure, callback, 1);
   Scheme_listener *l = new Scheme_listener (callback);
   SCM listener = GET_LISTENER (l->call).smobbed_copy ();
   l->unprotect ();
index eebdedbb95c3d8614b043d932a799d1e9896b25e..4e08f46ae1e62841d253aa6220b12ed459a3077c 100644 (file)
@@ -20,8 +20,8 @@ LY_DEFINE (ly_make_score, "ly:make-score",
           (SCM music),
           "Return score with @var{music} encapsulated in @var{score}.")
 {
+  LY_ASSERT_SMOB (Music, music, 1);
   Music *mus = unsmob_music (music);
-  SCM_ASSERT_TYPE (mus, music, SCM_ARG1, __FUNCTION__, "music");
 
   Score *score = new Score;
   score->set_music (music);
@@ -33,8 +33,8 @@ LY_DEFINE (ly_score_output_defs, "ly:score-output-defs",
           1, 0, 0, (SCM score),
           "All output defs in a score.")
 {
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
-  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
 
   SCM l = SCM_EOL;
   for (vsize i = 0; i < sc->defs_.size (); i++)
@@ -48,8 +48,8 @@ LY_DEFINE (ly_score_header, "ly:score-header",
           1, 0, 0, (SCM score),
           "return score header.")
 {
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
-  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
   return sc->header_;
 }
 
@@ -58,8 +58,8 @@ LY_DEFINE (ly_score_music, "ly:score-music",
           1, 0, 0, (SCM score),
           "return score music.")
 {
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
-  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
   return sc->get_music ();
 }
 
@@ -67,8 +67,8 @@ LY_DEFINE (ly_score_error_p, "ly:score-error?",
           1, 0, 0, (SCM score),
           "Was there an error in the score?")
 {
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
-  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "score");
   return scm_from_bool (sc->error_found_);
 }
 
@@ -79,15 +79,15 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
           "return a list of layout-lines. "
           "\nTake optional Object_key argument.")
 {
+  LY_ASSERT_SMOB (Score, score, 1);
+  LY_ASSERT_SMOB (Output_def, layout, 2);
+
   Score *sc = unsmob_score (score);
   Output_def *od = unsmob_output_def (layout);
 
   if (sc->error_found_)
     return SCM_EOL;
 
-  SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "Score");
-  SCM_ASSERT_TYPE (od, layout, SCM_ARG2, __FUNCTION__, "Output_def");
-
   Output_def *score_def = 0;
 
   /* UGR, FIXME, these are default \layout blocks once again.  They
index ff089b6bbdc2e05c9d683d1ddcdd0512b7ac6e9e..b990ff01c0271b4f4688837daf95cd39f12cd4d4 100644 (file)
@@ -7,7 +7,9 @@
 */
 
 #include "self-alignment-interface.hh"
+
 #include "warn.hh"
+#include "paper-column.hh"
 #include "grob.hh"
 
 MAKE_SCHEME_CALLBACK (Self_alignment_interface, y_aligned_on_self, 1);
@@ -92,6 +94,9 @@ SCM
 Self_alignment_interface::aligned_on_parent (Grob *me, Axis a)
 {
   Grob *him = me->get_parent (a);
+  if (Paper_column::has_interface (him))
+    return scm_from_double (0.0);
+    
   Interval he = him->extent (him, a);
 
   SCM sym = (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X")
index c7d44a9568fa506c12196ba8f1285a97f45c137f..ee18953aef22247e8472eae4319ee81b20069cba 100644 (file)
@@ -39,7 +39,9 @@ SCM
 Semi_tie_column::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+    
   extract_grob_set (me, "ties", lv_ro_ties);
   vector<Grob*> lv_ties (lv_ro_ties);
 
index 0d56fe18681968efe5b5c4f739717336e8ff0688..ceee8a37cba397e79f099f9aaf41c5b1238d7809 100644 (file)
@@ -177,21 +177,21 @@ axis_aligned_side_helper (SCM smob, Axis a, bool pure, int start, int end, SCM c
 }
 
 
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, x_aligned_side, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, x_aligned_side, 2, 1, "");
 SCM
 Side_position_interface::x_aligned_side (SCM smob, SCM current_off)
 {
   return axis_aligned_side_helper (smob, X_AXIS, false, 0, 0, current_off);
 }
 
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, y_aligned_side, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, y_aligned_side, 2, 1, "");
 SCM
 Side_position_interface::y_aligned_side (SCM smob, SCM current_off)
 {
   return axis_aligned_side_helper (smob, Y_AXIS, false, 0, 0, current_off);
 }
 
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, pure_y_aligned_side, 4, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Side_position_interface, pure_y_aligned_side, 4, 1, "");
 SCM
 Side_position_interface::pure_y_aligned_side (SCM smob, SCM start, SCM end, SCM cur_off)
 {
index 24b6d1c76351f3830d105651c75eb46644332ba8..2e0f4ba9f73883a31832c40afff776dd1b8821ed 100644 (file)
@@ -28,9 +28,8 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
     return scm_list_2 (scm_from_double (0.0), scm_from_double (0.0));
 
   SCM_ASSERT_TYPE (len >= 0, springs, SCM_ARG1, __FUNCTION__, "list of springs");
-  SCM_ASSERT_TYPE (scm_ilength (rods) >= 0, rods, SCM_ARG2, __FUNCTION__, "list of rods");
-  SCM_ASSERT_TYPE (scm_is_number (length) || length == SCM_BOOL_F,
-                  length, SCM_ARG3, __FUNCTION__, "number or #f");
+  SCM_ASSERT_TYPE (scm_ilength (rods)  > 0, rods, SCM_ARG1, __FUNCTION__, "list of rods");
+  LY_ASSERT_TYPE(scm_is_number, length, 3);
 
   bool is_ragged = ragged == SCM_BOOL_T;
   Simple_spacer spacer;
index f3938b23d11ef5c14e53ab090eadf46ddb0a90db..3b26af8bebabb63b83ba8c965cbf5687e45b696d 100644 (file)
@@ -221,7 +221,7 @@ Slur::add_extra_encompass (Grob *me, Grob *n)
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("encompass-objects"), n);
 }
 
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, pure_outside_slur_callback, 4, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, pure_outside_slur_callback, 4, 1, "");
 SCM
 Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offset_scm)
 {
@@ -241,7 +241,7 @@ Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offs
   return scm_from_double (offset + dir * slur->pure_height (slur, start, end).length () / 4);
 }
 
-MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1, "");
 SCM
 Slur::outside_slur_callback (SCM grob, SCM offset_scm)
 {
index e5a33e0c4b45976ffc7f50907c5a592b25872931..ec70ba6817b6e9bab5a4a9d51bd6c3f548eb2f1d 100644 (file)
 #include "spanner.hh"
 #include "item.hh"
 
-LY_DEFINE (ly_spanner_get_bound, "ly:spanner-bound",
+LY_DEFINE (ly_spanner_bound, "ly:spanner-bound",
           2, 0, 0, (SCM slur, SCM dir),
           "Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} "
           "for left, and @code{1} for right.")
 {
-  Spanner *sl = dynamic_cast<Spanner *> (unsmob_grob (slur));
-  SCM_ASSERT_TYPE (sl, slur, SCM_ARG1, __FUNCTION__, "spanner grob");
-  SCM_ASSERT_TYPE (is_direction (dir), slur, SCM_ARG2, __FUNCTION__, "dir");
-  return sl->get_bound (to_dir (dir))->self_scm ();
+  LY_ASSERT_TYPE (unsmob_spanner, slur, 1);
+  LY_ASSERT_TYPE(is_direction, dir,2);
+  
+  return unsmob_spanner (slur)->get_bound (to_dir (dir))->self_scm ();
 }
 
 /* TODO: maybe we should return a vector -- random access is more
@@ -27,8 +27,8 @@ LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into",
           1, 0, 0, (SCM spanner),
           "Return broken-into list for @var{spanner}.")
 {
+  LY_ASSERT_TYPE (unsmob_spanner, spanner, 1);
   Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (spanner));
-  SCM_ASSERT_TYPE (me, spanner, SCM_ARG1, __FUNCTION__, "spanner");
 
   SCM s = SCM_EOL;
   for (vsize i = me->broken_intos_.size (); i--;)
index ec12f1639be0d06ea20145d1320b2d7b7f0ad68b..8e0094f143d29abc7f56e8db760e161f934e9f23 100644 (file)
@@ -14,9 +14,8 @@ LY_DEFINE (ly_grob_staff_position, "ly:grob-staff-position",
           1, 0, 0, (SCM sg),
           "Return the Y-position of @var{sg} relative to the staff.")
 {
+  LY_ASSERT_SMOB (Grob, sg, 1);
   Grob *g = unsmob_grob (sg);
-
-  SCM_ASSERT_TYPE (g, sg, SCM_ARG1, __FUNCTION__, "grob");
   Real pos = Staff_symbol_referencer::get_position (g);
 
   if (fabs (rint (pos) -pos) < 1e-6) // ugh.
index dd247b4baa1997e2d74ea8783d13649631d91f38..09786b750b5d205d4b7f834b6c6fa69fe507453b 100644 (file)
@@ -414,6 +414,8 @@ Stem::calc_positioning_done (SCM smob)
   if (!head_count (me))
     return SCM_BOOL_T;
 
+  me->set_property ("positioning-done", SCM_BOOL_T);
+  
   extract_grob_set (me, "note-heads", ro_heads);
   vector<Grob*> heads (ro_heads);
   vector_sort (heads, position_less);
@@ -559,13 +561,11 @@ SCM
 Stem::height (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-
+  if (!is_normal_stem (me))
+    return ly_interval2scm (Interval ());
+  
   Direction dir = get_grob_direction (me);
   
-  /* Trigger callback.
-
-  UGH. Should be automatic
-  */
   Grob *beam = get_beam (me);
   if (beam)
     {
@@ -912,10 +912,14 @@ Stem::calc_stem_info (SCM smob)
   Real height_of_my_trem = 0.0;
   Grob *trem = unsmob_grob (me->get_object ("tremolo-flag"));
   if (trem)
-      height_of_my_trem = trem->extent (trem, Y_AXIS).length ()
+    {
+      height_of_my_trem
+       = Stem_tremolo::vertical_length (trem)
         /* hack a bit of space around the trem. */
         + beam_translation;
+    }
 
+  
   /* UGH
      It seems that also for ideal minimum length, we must use
      the maximum beam count (for this direction):
index 6ef0e191fd4394bad150cf94dfc7aa45151f3e23..90a82ec466eeedd6dfc12f3754879487c24fd459 100644 (file)
   TODO: naming add/combine.
 */
 
-LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
+LY_DEFINE (ly_stencil_translate_axis, "ly:stencil-translate-axis",
           3, 0, 0, (SCM stil, SCM amount, SCM axis),
           "Return a copy of @var{stil} but translated by @var{amount} in @var{axis} direction.")
 {
   Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(scm_is_number,amount, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Real real_amount = scm_to_double (amount);
 
-#if 0
-  SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
-                  amount, SCM_ARG2, __FUNCTION__, "finite number");
-#endif
-
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
-
   SCM new_s = s->smobbed_copy ();
   Stencil *q = unsmob_stencil (new_s);
   q->translate_axis (real_amount, Axis (scm_to_int (axis)));
   return new_s;
 }
 
-LY_DEFINE (ly_translate_stencil, "ly:stencil-translate",
+LY_DEFINE (ly_stencil_translate, "ly:stencil-translate",
           2, 0, 0, (SCM stil, SCM offset),
           "Return a @var{stil}, "
           "but translated by @var{offset} (a pair of numbers).")
 {
   Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (is_number_pair (offset), offset, SCM_ARG2, __FUNCTION__, "number pair");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(is_number_pair, offset, 2);
   Offset o = ly_scm2offset (offset);
 
   SCM new_s = s->smobbed_copy ();
@@ -60,7 +54,7 @@ LY_DEFINE (ly_stencil_expr, "ly:stencil-expr",
           "Return the expression of @var{stil}.")
 {
   Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
   return s->expr ();
 }
 
@@ -70,8 +64,8 @@ LY_DEFINE (ly_stencil_extent, "ly:stencil-extent",
           "@var{axis} direction (0 or 1 for x and y axis respectively).")
 {
   Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(is_axis, axis, 2);
 
   return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
 }
@@ -81,7 +75,7 @@ LY_DEFINE (ly_stencil_empty_p, "ly:stencil-empty?",
           "Return whether @var{stil} is empty ")
 {
   Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
   return scm_from_bool (s->is_empty ());
 }
 
@@ -106,19 +100,19 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
                   first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
   SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second == SCM_EOL,
                   second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE (is_direction (direction), direction, SCM_ARG3, __FUNCTION__, "dir");
+  LY_ASSERT_TYPE(is_axis, axis,  2);
+  LY_ASSERT_TYPE(is_direction, direction, 3);
 
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+      LY_ASSERT_TYPE(scm_is_number, padding, 5);
       p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (scm_is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+      LY_ASSERT_TYPE(scm_is_number, minimum, 6);
       m = scm_to_double (minimum);
     }
 
@@ -180,14 +174,14 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
   Interval x; 
   if (xext != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair");
+      LY_ASSERT_TYPE(is_number_pair, xext, 2);
       x = ly_scm2interval (xext);
     }
 
   Interval y; 
   if (yext != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair");
+      LY_ASSERT_TYPE(is_number_pair,yext, 3);
       y = ly_scm2interval (yext);
     }
 
@@ -202,9 +196,9 @@ LY_DEFINE (ly_stencil_aligned_to, "ly:stencil-aligned-to",
           "@var{dir} is a number -1, 1 are left and right respectively. "
           "Other values are interpolated (so 0 means the center).")
 {
-  SCM_ASSERT_TYPE (unsmob_stencil (stil), stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE (scm_is_number (dir), dir, SCM_ARG3, __FUNCTION__, "number");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(is_axis,axis, 2);
+  LY_ASSERT_TYPE(scm_is_number, dir, 3);
 
   Stencil target = *unsmob_stencil (stil);
 
@@ -217,8 +211,8 @@ LY_DEFINE (ly_stencil_fonts, "ly:stencil-fonts",
           1, 0, 0, (SCM s),
           " Analyse @var{s}, and return a list of fonts used in @var{s}.")
 {
+  LY_ASSERT_SMOB (Stencil, s, 1);
   Stencil *stil = unsmob_stencil (s);
-  SCM_ASSERT_TYPE (stil, s, SCM_ARG1, __FUNCTION__, "Stencil");
   return find_expression_fonts (stil->expr ());
 }
 
@@ -226,8 +220,8 @@ LY_DEFINE (ly_stencil_in_color, "ly:stencil-in-color",
           4, 0, 0, (SCM stc, SCM r, SCM g, SCM b),
           "Put @var{stc} in a different color.")
 {
+  LY_ASSERT_SMOB (Stencil, stc, 1);
   Stencil *stil = unsmob_stencil (stc);
-  SCM_ASSERT_TYPE (stil, stc, SCM_ARG1, __FUNCTION__, "Stencil");
   return Stencil (stil->extent_box (),
                  scm_list_3 (ly_symbol2scm ("color"),
                              scm_list_3 (r, g, b),
@@ -250,8 +244,7 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression",
           4, 0, 0, (SCM expr, SCM func, SCM arg1, SCM offset),
           "Parse EXPR, feed bits to FUNC with first arg ARG1")
 {
-  SCM_ASSERT_TYPE (ly_is_procedure (func), func, SCM_ARG1, __FUNCTION__,
-                  "procedure");
+  LY_ASSERT_TYPE (ly_is_procedure, func, 2);
 
   Stencil_interpret_arguments a;
   a.func = func;
@@ -270,10 +263,10 @@ LY_DEFINE (ly_bracket, "ly:bracket",
           "given by @var{iv}. The wings protude by an amount of @var{p}, which "
           "may be negative. The thickness is given by @var{t}.")
 {
-  SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair");
-  SCM_ASSERT_TYPE (scm_is_number (t), a, SCM_ARG3, __FUNCTION__, "number");
-  SCM_ASSERT_TYPE (scm_is_number (p), a, SCM_ARG4, __FUNCTION__, "number");
+  LY_ASSERT_TYPE (is_axis, a, 1);
+  LY_ASSERT_TYPE(is_number_pair,iv, 2);
+  LY_ASSERT_TYPE(scm_is_number, t,3);
+  LY_ASSERT_TYPE(scm_is_number, p,4);
 
   return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
                          scm_to_double (t),
@@ -281,15 +274,15 @@ LY_DEFINE (ly_bracket, "ly:bracket",
                          0.95 * scm_to_double (t)).smobbed_copy ();
 }
 
-LY_DEFINE (ly_rotate_stencil, "ly:stencil-rotate",
+LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate",
           4, 0, 0, (SCM stil, SCM angle, SCM x, SCM y),
           "Return a @var{stil} rotated @var{angle} degrees around point (@var{x}, @var{y}).")
 {
   Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (scm_is_number (angle), angle, SCM_ARG2, __FUNCTION__, "number");
-  SCM_ASSERT_TYPE (scm_is_number (x), x, SCM_ARG3, __FUNCTION__, "number");
-  SCM_ASSERT_TYPE (scm_is_number (y), y, SCM_ARG4, __FUNCTION__, "number");
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(scm_is_number,angle, 2);
+  LY_ASSERT_TYPE(scm_is_number, x,3);
+  LY_ASSERT_TYPE(scm_is_number, y, 4);
   Real a = scm_to_double (angle);
   Real x_off = scm_to_double (x);
   Real y_off = scm_to_double (y);
@@ -300,16 +293,16 @@ LY_DEFINE (ly_rotate_stencil, "ly:stencil-rotate",
   return new_s;
 }
 
-LY_DEFINE (ly_filled_box, "ly:round-filled-box",
+LY_DEFINE (ly_round_filled_box, "ly:round-filled-box",
           3, 0, 0,
           (SCM xext, SCM yext, SCM blot),
           "Make a @code{Stencil} "
           "that prints a black box of dimensions @var{xext}, "
           "@var{yext} and roundness @var{blot}.")
 {
-  SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair");
-  SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair");
-  SCM_ASSERT_TYPE (scm_is_number (blot), blot, SCM_ARG3, __FUNCTION__, "number");
+  LY_ASSERT_TYPE (is_number_pair, xext, 1);
+  LY_ASSERT_TYPE(is_number_pair, yext, 2);
+  LY_ASSERT_TYPE(scm_is_number, blot, 3);
 
   return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
                                   scm_to_double (blot)).smobbed_copy ();
@@ -320,8 +313,7 @@ LY_DEFINE (ly_register_stencil_expression, "ly:register-stencil-expression",
           (SCM symbol),
           "Add @var{symbol} as head of a stencil expression")
 {
-  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol,
-                  SCM_ARG1, __FUNCTION__, "Symbol");
+  LY_ASSERT_TYPE (ly_is_symbol, symbol, 1);
   register_stencil_head (symbol);
   return SCM_UNSPECIFIED;
 }
index 12bbf4ea128f0f573a41ae1e9b7d1f6cabd5fbe4..59e88398f29b11f7449353aa5f1d317203b95610 100644 (file)
@@ -76,14 +76,17 @@ Stencil::extent_box () const
 void
 Stencil::rotate (Real a, Offset off)
 {
-  rotate_degrees (a *180/M_PI, off); 
+  rotate_degrees (a * 180/M_PI, off); 
 }
 
 /*
-  Rotate this stencil around the point [x, y]
+  Rotate this stencil around the point RELATIVE_OFF.
+
+  RELATIVE_OFF is measured in terms of the extent of the stencil, so
+  -1 = LEFT/DOWN edge, 1 = RIGHT/UP edge.
  */
 void
-Stencil::rotate_degrees (Real a, Offset off)
+Stencil::rotate_degrees (Real a, Offset relative_off)
 {
   const Real x_cen = extent (X_AXIS).center ();
   const Real y_cen = extent (Y_AXIS).center ();
@@ -91,8 +94,8 @@ Stencil::rotate_degrees (Real a, Offset off)
   /*
    * Calculate the center of rotation
    */
-  const Real x = x_cen + off[X_AXIS] * x_cen;
-  const Real y = y_cen + off[Y_AXIS] * y_cen;
+  const Real x = x_cen + relative_off[X_AXIS] * x_cen;
+  const Real y = y_cen + relative_off[Y_AXIS] * y_cen;
 
   /*
    * Build scheme expression (processed in stencil-interpret.cc)
index e6e4fb7dc60faaac59ae85c6354dd8d43a340aa2..68aedd5497164eb09fa575b80e4b65756cac5a8e 100644 (file)
@@ -12,10 +12,10 @@ LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
           1, 1, 0, (SCM cl, SCM proplist),
           "Creates a stream event of class @var{cl} with the given mutable property list.\n" )
 {
-  SCM_ASSERT_TYPE (scm_is_symbol (cl), cl, SCM_ARG1, __FUNCTION__, "symbol");
+  LY_ASSERT_TYPE (ly_is_symbol, cl, 1);
 
   /* should be scm_list_p, but scm_list_p is expensive. */
-  SCM_ASSERT_TYPE (scm_is_pair (proplist), proplist, SCM_ARG2, __FUNCTION__, "association list");
+  LY_ASSERT_TYPE(scm_is_pair, proplist, 2);
   
   if (proplist == SCM_UNDEFINED)
     proplist = SCM_EOL;
@@ -29,18 +29,21 @@ LY_DEFINE (ly_event_property, "ly:event-property",
           "Get the property @var{sym} of stream event @var{mus}.\n"
           "If @var{sym} is undefined, return @code{'()}.\n")
 {
+  LY_ASSERT_SMOB (Stream_event, sev, 1);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
+
   Stream_event *e = unsmob_stream_event (sev);
-  SCM_ASSERT_TYPE (e, sev, SCM_ARG1, __FUNCTION__, "stream event");
-  SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
   return e->internal_get_property (sym);
 }
 
-LY_DEFINE (ly_event_set_property, "ly:event-set-property!",
+LY_DEFINE (ly_event_set_property_x, "ly:event-set-property!",
            3, 0, 0, (SCM ev, SCM sym, SCM val),
-           "Set property @var{sym} in event @var{ev} to @var{val}."){
-  Stream_event *sc = unsmob_stream_event (ev);
-  SCM_ASSERT_TYPE (sc, ev, SCM_ARG1, __FUNCTION__, "event");
+           "Set property @var{sym} in event @var{ev} to @var{val}.")
+{
+  LY_ASSERT_SMOB (Stream_event, ev, 1);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
+  
   return ly_prob_set_property_x (ev, sym, val);
 }
 
index eec815089429a4ff115244552bbcea2e33c46535..86a1381bb411312e28b337640fe814e5a1dfcbb6 100644 (file)
@@ -25,20 +25,25 @@ Text_interface::interpret_string (SCM layout_smob,
                                  SCM props,
                                  SCM markup)
 {
-  Output_def *layout = unsmob_output_def (layout_smob);
-
-  SCM_ASSERT_TYPE (layout, layout_smob, SCM_ARG1,
-                  __FUNCTION__, "Layout definition");
-  SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3,
-                  __FUNCTION__, "string");
+  LY_ASSERT_SMOB (Output_def, layout_smob, 1);
+  LY_ASSERT_TYPE (scm_is_string, props, 3);
 
   string str = ly_scm2string (markup);
-
+  Output_def *layout = unsmob_output_def (layout_smob);
   Font_metric *fm = select_encoded_font (layout, props);
   return fm->word_stencil (str).smobbed_copy ();
 }
 
-MAKE_SCHEME_CALLBACK (Text_interface, interpret_markup, 3);
+MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Text_interface, interpret_markup, 3, 0,
+                                  "Convert a text markup into a stencil. "
+"Takes 3 arguments, @var{layout}, @var{props} and @var{markup}. "
+"\n\n"
+"@var{layout} is a @code{\\layout} block; it may be obtained from a grob with "
+"@code{ly:grob-layout}.  @var{props} is a alist chain, ie. a list of alists. "
+"This is typically obtained with "
+"@code{(ly:grob-alist-chain (ly:layout-lookup layout 'text-font-defaults))}. "
+"@var{markup} is the markup text to be processed. "
+                                  );
 SCM
 Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
 {
@@ -92,7 +97,13 @@ Text_interface::is_markup (SCM x)
 }
 
 ADD_INTERFACE (Text_interface,
-              "A scheme markup text, see @usermanref{Text markup}.",
+              "A scheme markup text, see @usermanref{Text markup} and "
+              "@usermanref{New markup command definition}. "
+              "\n\n"
+              "There are two important commands: ly:text-interface::print, which is a "
+              "grob callback, and ly:text-interface::interpret-markup ",
+
+              /* props */
               "baseline-skip "
               "text "
               "word-space "
index 0b9f3e4a67db4463eb7cf372cd525f91d0871839..f7b2576d85043c734d0dc9e55add6526ff762ddc 100644 (file)
@@ -122,7 +122,12 @@ Text_spanner_engraver::finalize ()
 }
 
 ADD_TRANSLATOR (Text_spanner_engraver,
-               /* doc */ "Create text spanner from an event.",
-               /* create */ "TextSpanner",
-               /* read */ "",
-               /* write */ "");
+               /* doc */
+               "Create text spanner from an event.",
+               /* create */
+               "TextSpanner ",
+               /* read */
+               "",
+               /* write */
+               ""
+               );
diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc
deleted file mode 100644 (file)
index e98ae0f..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-  text-spanner.cc -- implement Text_spanner
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
-
-  Revised over good by Han-Wen.
-*/
-
-#include "text-spanner.hh"
-
-#include "text-interface.hh"
-#include "line-spanner.hh"
-#include "spanner.hh"
-#include "font-interface.hh"
-#include "dimensions.hh"
-#include "output-def.hh"
-#include "warn.hh"
-#include "paper-column.hh"
-#include "staff-symbol-referencer.hh"
-
-/*
-  TODO:
-  - vertical start / vertical end (fixme-name) |
-  - contination types (vert. star, vert. end)  |-> eat volta-bracket
-  - more styles
-  - more texts/positions
-*/
-
-MAKE_SCHEME_CALLBACK (Text_spanner, print, 1);
-
-/*
-  TODO: this function is too long
-*/
-SCM
-Text_spanner::print (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-  Spanner *spanner = dynamic_cast<Spanner *> (me);
-
-  /* Ugh, must be same as Hairpin::print.  */
-
-  Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
-  Output_def *layout = me->layout ();
-
-  SCM flare = me->get_property ("bracket-flare");
-  SCM shorten = me->get_property ("shorten-pair");
-
-  Interval span_points;
-  Drul_array<bool> broken;
-  Direction d = LEFT;
-  do
-    {
-      Item *b = spanner->get_bound (d);
-      broken[d] = b->break_status_dir () != CENTER;
-
-      if (broken[d])
-       {
-         if (d == LEFT)
-           span_points[d] = spanner->get_broken_left_end_align ();
-         else
-           span_points[d] = b->relative_coordinate (common, X_AXIS);
-       }
-      else
-       {
-         Real encl = robust_scm2double (me->get_property ("enclose-bounds"), 0.0);
-         Interval ext = b->extent (common, X_AXIS);
-
-         span_points[d]
-           = robust_relative_extent (b, common, X_AXIS).linear_combination (d * encl);
-
-         if (is_number_pair (shorten))
-           span_points -= d * scm_to_double (index_get_cell (shorten, d));
-       }
-
-      if (is_number_pair (flare))
-       span_points -= d * scm_to_double (index_get_cell (flare, d));
-    }
-  while (flip (&d) != LEFT);
-
-  SCM properties = Font_interface::text_font_alist_chain (me);
-  SCM edge_text = me->get_property ("edge-text");
-  Drul_array<Stencil> edge;
-  if (scm_is_pair (edge_text))
-    {
-      Direction d = LEFT;
-      do
-       {
-         if (broken[d])
-           continue;
-
-         SCM text = index_get_cell (edge_text, d);
-
-         if (Text_interface::is_markup (text))
-           edge[d] = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), properties, text));
-
-         if (!edge[d].is_empty ())
-           edge[d].align_to (Y_AXIS, CENTER);
-       }
-      while (flip (&d) != LEFT);
-    }
-
-  Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
-                                                     Interval (0.0, 0.0));
-  Drul_array<Stencil> edge_line;
-  {
-    Direction d = LEFT;
-    int dir = to_dir (me->get_property ("direction"));
-    do
-      {
-       if (broken[d])
-         continue;
-
-       Real dx = 0.0;
-       if (is_number_pair (flare))
-         dx = scm_to_double (index_get_cell (flare, d)) * d;
-
-       Real dy = -dir * edge_height[d];
-       if (dy)
-         edge_line[d] = Line_spanner::line_stencil (me, Offset (0, 0), Offset (dx, dy));
-      }
-    while (flip (&d) != LEFT);
-  }
-
-  Stencil m;
-  do
-    {
-      Interval ext = edge[d].extent (X_AXIS);
-      if (!ext.is_empty ())
-       {
-         Real pad = robust_scm2double (me->get_property ("bound-padding"), 0.0);
-         edge[d].translate_axis (span_points[d], X_AXIS);
-         m.add_stencil (edge[d]);
-         span_points[d] += -d * (ext[-d] + pad);
-       }
-    }
-  while (flip (&d) != LEFT);
-
-  do
-    {
-      if (d * span_points[d] > d * edge[-d].extent (X_AXIS)[d])
-       {
-         edge_line[d].translate_axis (span_points[d], X_AXIS);
-         m.add_stencil (edge_line[d]);
-       }
-    }
-  while (flip (&d) != LEFT);
-
-  
-  if (!span_points.is_empty ()
-      && span_points.length () > robust_scm2double (me->get_property ("dash-period"), 0.0))
-    {
-      Stencil l = Line_spanner::line_stencil (me,
-                                             Offset (span_points[LEFT], 0),
-                                             Offset (span_points[RIGHT], 0));
-      m.add_stencil (l);
-    }
-  m.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS);
-  return m.smobbed_copy ();
-}
-
-ADD_INTERFACE (Text_spanner,
-
-              "generic text spanner",
-
-              "bound-padding "
-              "bracket-flare "
-              "dash-fraction "
-              "dash-period "
-              "edge-height "
-              "edge-text "
-              "enclose-bounds "
-              "shorten-pair "
-              "style "
-              "thickness "
-              );
-
index 9eefbbf8ee10252c5b3360152280c9e759703392..b54428d986fca49ac7a1b2492cefd227c762c8f6 100644 (file)
@@ -79,6 +79,9 @@ Tie_column::calc_positioning_done (SCM smob)
   if (!ties.size ())
     return SCM_BOOL_T;
 
+
+  me->set_property ("positioning-done", SCM_BOOL_T);
+
   vector_sort (ties, Tie::less);
 
   Tie_formatting_problem problem;
index 3b2604fe18846b9e34dc8c2a8d84d49d8a292a98..31e7afa92e48b95554ddbe9285817a0696773d01 100644 (file)
@@ -15,8 +15,8 @@ LY_DEFINE (ly_translator_name, "ly:translator-name",
           "Return the type name of the translator object @var{trans}. "
           "The name is a symbol.")
 {
+  LY_ASSERT_SMOB (Translator, trans, 1);
   Translator *tr = unsmob_translator (trans);
-  SCM_ASSERT_TYPE (tr, trans, SCM_ARG1, __FUNCTION__, "Translator");
   char const *nm = tr->class_name ();
   return ly_symbol2scm (nm);
 }
@@ -25,8 +25,8 @@ LY_DEFINE (ly_translator_description, "ly:translator-description",
           1, 0, 0, (SCM me),
           "Return an alist of properties of  translator @var{me}.")
 {
+  LY_ASSERT_SMOB (Translator, me, 1);
   Translator *tr = unsmob_translator (me);
-  SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
   return tr->translator_description ();
 }
 
index 8e56784812c6369e692011c0d69ae33c20a6272f..d2ef7e1eb8045c836316aa3c838ed8ebe3667374 100644 (file)
@@ -128,6 +128,7 @@ Trill_spanner_engraver::finalize ()
 
 ADD_TRANSLATOR (Trill_spanner_engraver,
                /* doc */ "Create trill spanner from an event.",
-               /* create */ "TrillSpanner",
+               /* create */
+               "TrillSpanner ",
                /* read */ "",
                /* write */ "");
index 26deb0841b9db4696abd4ac8a8960aae5d9d2155..574d1464af7492278189db36e8a7be379a3050e8 100644 (file)
@@ -223,8 +223,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
           1, 0, 0, (SCM ttf_file_name),
           "Extract the PostScript name from a TrueType font.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
-                  SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
   string file_name = ly_scm2string (ttf_file_name);
   if (be_verbose_global)
     progress_indication ("[" + file_name);
@@ -243,13 +242,12 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
 
 
 
-LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa",
+LY_DEFINE (ly_ttf_2_pfa, "ly:ttf->pfa",
           1, 0, 0, (SCM ttf_file_name),
           "Convert the contents of a TTF file to Type42 PFA, returning it as "
           " a string.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
-                  SCM_ARG1, __FUNCTION__, "string");
+  LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
 
   string file_name = ly_scm2string (ttf_file_name);
   if (be_verbose_global)
index ddcced5c46f0d30df301fc06141b6e51fa75eb23..0f8560c8106926083f3518db1cedc1f34bbd1cc5 100644 (file)
@@ -756,10 +756,7 @@ AncientRemoveEmptyStaffContext = \context {
   %%
   \override TextSpanner #'dash-fraction = #'()
   \override TextSpanner #'style = #'line
-  \override TextSpanner #'edge-height = #'(0 . 0)
   \override TextSpanner #'padding = #-0.1
-  \override TextSpanner #'enclose-bounds = #1
-  \override TextSpanner #'edge-text = #'("" . "")
 }
 
 \context {
@@ -830,10 +827,7 @@ AncientRemoveEmptyStaffContext = \context {
   %%
   \override TextSpanner #'dash-fraction = #'()
   \override TextSpanner #'style = #'line
-  \override TextSpanner #'edge-height = #'(0 . 0)
   \override TextSpanner #'padding = #-0.1
-  \override TextSpanner #'enclose-bounds = #1
-  \override TextSpanner #'edge-text = #'("" . "")
 }
 
 \context {
diff --git a/make/lilypond.fedora.spec.in b/make/lilypond.fedora.spec.in
deleted file mode 100644 (file)
index fafd9cd..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-# -*-rpm-spec-mode-*-
-
-%define info yes
-%define docdir %{_docdir}/lilypond/
-
-Name: lilypond
-Version: @TOPLEVEL_VERSION@
-Release: 1
-License: GPL
-Group: Applications/Publishing
-Source0: http://lilypond.org/download/development/lilypond-@TOPLEVEL_VERSION@.tar.gz
-Summary: Create and print music notation 
-URL: http://lilypond.org/
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-
-
-Buildrequires: t1utils bison flex mftrace ImageMagick
-Buildrequires: texinfo >= 4.7
-Buildrequires: guile-devel >= 1.6.4-8 
-Buildrequires: freetype-devel >= 2.1
-
-Buildrequires: fontforge
-#fontforge must be >= 20041211 urg. 0.0.0-fdr.1.20041211
-
-Buildrequires: pango-devel >= 1.6.0
-Buildrequires: fontconfig-devel
-
-Requires: libstdc++ python 
-Requires: guile >= 1.6.4-8 ghostscript >= 8.15
-
-%description
-LilyPond lets you create music notation.  It produces
-beautiful sheet music from a high-level description file.
-
-%package documentation
-Summary:  All LilyPond documentation, in HTML
-Group: Applications/Publishing
-# BuildArchitectures: noarch
-
-%description documentation
-Documentation and example files of LilyPond.  An index is available at
-%{docdir}/web/Documentation/index.html
-
-%prep
-%setup
-
-%build
-
-# DO NOT use % { configure } , it hardcodes all paths, runs libtool,
-# so we can't do make prefixix=/tmp/ install.
-
-# In fact, do not take out the spaces between % and { in the above comment,
-# because RPM will gladly do a substitution anyway.
-
-# compile with static libstdc++ for better platform portability.
-./configure --enable-static-gxx --disable-checking --prefix=%{_prefix} --enable-optimising
-
-
-make -j2 all
-make web
-make -C Documentation/user local_package_docdir=%{docdir} omf
-
-%install
-
-
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/tmp/lilypond-rpm-doc
-
-make prefix="$RPM_BUILD_ROOT%{_prefix}" \
-       infodir="$RPM_BUILD_ROOT%{_infodir}"  \
-       mandir="$RPM_BUILD_ROOT%{_mandir}" install
-
-#emacs
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d
-install -m 644 elisp/lilypond-init.el  $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d
-
-#manual pages
-gzip -9fn $RPM_BUILD_ROOT%{_mandir}/man1/*
-
-
-# profile scripts.
-
-
-# web doc
-make prefix="$RPM_BUILD_ROOT%{_prefix}" \
-  infodir="$RPM_BUILD_ROOT%{_infodir}"  \
-  webdir="$RPM_BUILD_ROOT%{_prefix}/share/doc/lilypond/" web-install
-
-ln -sf ../../doc/lilypond/Documentation/user/*png $RPM_BUILD_ROOT%{_infodir}/lilypond/
-
-# info 
-%if %{info}
-rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
-gzip -9fn `find $RPM_BUILD_ROOT%{_infodir}/ -name '*.info'`
-%endif
-
-
-
-%post
-
-touch /tmp/.lilypond-install
-
-%if %{info}
-  /sbin/install-info %{_infodir}/lilypond/lilypond.info.gz %{_infodir}/dir 
-  /sbin/install-info %{_infodir}/lilypond/lilypond-internals.info.gz %{_infodir}/dir 
-  /sbin/install-info %{_infodir}/lilypond/music-glossary.info.gz %{_infodir}/dir 
-%endif
-
-export PACKAGEDIR=%{_datadir}/lilypond/@TOPLEVEL_VERSION@
-if [ -d /usr/share/vim ]; then
-  VIMDIR=`find /usr/share/vim -name bugreport.vim`
-  VIMDIR=`dirname $VIMDIR`
-  for a in `cd $PACKAGEDIR/vim/ ; find -type d -name '*' ` ; do
-     mkdir -p  $VIMDIR/$a
-     ln -s $PACKAGEDIR/vim/$a/*.vim $VIMDIR/$a/
-  done
-fi
-
-
-%preun
-if [ -f /usr/share/lilypond/%{version}/ls-R ]; then
-  rm -f /usr/share/lilypond/%{version}/ls-R
-fi
-
-
-if [ -d /usr/share/vim ]; then
-       rm `find /usr/share/vim -name 'lilypond*.vim'`
-fi
-
-
-%if %{info}
-    /sbin/install-info --delete %{_infodir}/lilypond/lilypond.info.gz %{_infodir}/dir 
-    /sbin/install-info --delete %{_infodir}/lilypond/lilypond-internals.info.gz %{_infodir}/dir 
-    /sbin/install-info --delete %{_infodir}/lilypond/music-glossary.info.gz %{_infodir}/dir 
-%endif
-
-# chkfontpath --remove=%{_datadir}/share/lilypond/@TOPLEVEL_VERSION@/fonts/type1n/
-
-%postun
-
-%post documentation
-scrollkeeper-update
-
-%postun documentation
-scrollkeeper-update
-
-
-
-%files
-%defattr(-, root, root)
-%{_datadir}/emacs/site-lisp/lilypond*
-%{_datadir}/emacs/site-lisp/site-start.d/lilypond*
-
-%{_bindir}/abc2ly
-%{_bindir}/convert-ly
-%{_bindir}/etf2ly
-%{_bindir}/lilypond
-%{_bindir}/midi2ly
-%{_bindir}/lilypond-book
-%{_bindir}/mup2ly
-%{_bindir}/musicxml2ly
-%{_bindir}/lilypond-invoke-editor
-
-%doc THANKS
-%doc COPYING
-%doc DEDICATION
-%doc README.txt
-%doc AUTHORS.txt
-%doc INSTALL.txt
-%doc NEWS.txt
-
-%if %{info}
-%{_infodir}/lilypond/
-%endif
-
-%{_mandir}/man1/abc2ly.1.gz
-%{_mandir}/man1/musicxml2ly.1.gz
-%{_mandir}/man1/convert-ly.1.gz
-%{_mandir}/man1/etf2ly.1.gz
-%{_mandir}/man1/lilypond.1.gz
-%{_mandir}/man1/midi2ly.1.gz
-%{_mandir}/man1/lilypond-book.1.gz
-%{_mandir}/man1/mup2ly.1.gz
-%{_mandir}/man1/lilypond-invoke-editor.1.gz
-
-%{_datadir}/lilypond/@TOPLEVEL_VERSION@/
-%{_datadir}/locale/*/LC_MESSAGES/lilypond.mo
-%{_libdir}/lilypond/
-
-
-%files documentation
-
-%defattr(-, root, root)
-
-%{docdir}
-%{_datadir}/omf/lilypond/@TOPLEVEL_VERSION@
-
-
-%clean
-rm -rf %{buildroot
index da64dbeb4b5a25a104f859a49bfb504dc5af3acc..551e3e3bd2ec48bc5f405d64b10d0abaabb87841 100644 (file)
@@ -192,6 +192,13 @@ fet_beginchar("Harmonic notehead (Neo-mensural open)",
        charwy := 0;
 fet_endchar;
 
+fet_beginchar("Harmonic notehead (Neo-mensural black)",
+             "s2harmonic")
+       draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#);
+       charwx := head_width#;
+       charwy := 0;
+fet_endchar;
+
 fet_beginchar("Neo-mensural semibrevis head","s0neomensural")
       draw_neomensural_open_head (staff_space#, noteheight#);
 fet_endchar;
index 06f572e2048c4514c5be02271245e7f87f09b474..71dbd10d427b2e80405508e273cb0a4a5ed83abf 100644 (file)
@@ -2952,3 +2952,20 @@ def conv (str):
     return str
 
 conversions.append (((2, 11, 11), conv, """layout-set-staff-size -> layout-set-absolute-staff-size"""))
+
+
+def conv (str):
+    str = re.sub (r"\\override\s*([a-zA-Z.]+)\s*#'arrow\s*=\s*##t",
+                  r"\\override \1 #'bound-details #'right #'arrow = ##t",
+                  str)
+
+    if re.search ('edge-text', str):
+       error_file.write (NOT_SMART % "edge-text settings for TextSpanner.")
+       error_file.write ("Use\n\n"
+                          "\t\\override TextSpanner #'bound-details #'right #'text = <right-text>\n"
+                          "\t\\override TextSpanner #'bound-details #'left #'text = <left-text>\n")
+
+        
+    return str
+
+conversions.append (((2, 11, 13), conv, """#'arrow = ##t -> #'bound-details #'right #'arrow = ##t"""))
diff --git a/python/relocate-preamble.py.in b/python/relocate-preamble.py.in
new file mode 100644 (file)
index 0000000..23db6d8
--- /dev/null
@@ -0,0 +1,19 @@
+This generic code used for all python scripts.
+
+The quotes are to ensure that the source .py file can still be
+run as a python script, but does not include any sys.path handling.
+Otherwise, the lilypond-book calls inside the build
+might modify installed .pyc files.
+
+"""
+
+for d in ['@lilypond_datadir@',
+         '@lilypond_libdir@']:
+    sys.path.insert (0, os.path.join (d, 'python'))
+
+# dynamic relocation, for GUB binaries.
+bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
+for p in ['share', 'lib']:
+    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
+    sys.path.insert (0, datadir)
+"""
index 2f8c1413d31a7bc473094da67436539bcb311175..8f7c52660e9711581e939dbd2a9a329ff8028710 100644 (file)
  '()
  )
 
+(ly:add-interface
+ 'trill-spanner-interface
+ "An accidental for trill pitch"
+ '())
+
 (ly:add-interface
  'rhythmic-grob-interface
  "Any object with a duration. Used to determine which grobs are
index 68e92a4fbb1274a0040f6f4fc020107290be6b79..7cf4d853f8ea18c8329f0586af2c0e7884f4389d 100644 (file)
@@ -35,7 +35,6 @@ relative to its Y-parent")
      (allow-loose-spacing ,boolean? "If set, column can be detached from main spacing.")
      (arpeggio-direction ,ly:dir? "If set, put an
 arrow on the arpeggio squiggly line.")
-     (arrow ,boolean? "Add an arrow to the line.")
      (arrow-length ,number? "Arrow length.")
      (arrow-width ,number? "Arrow width.")
      (auto-knee-gap ,ly:dimension? "If a gap is found between note heads
@@ -130,9 +129,6 @@ the vertical edges '(@var{left-height} . @var{right-height}).")
      (edge-text ,pair? "A pair specifying the texts to be set at the
 edges '(@var{left-text} . @var{right-text}).")
      (eccentricity ,number? "How asymmetrical to make a slur. Positive means move the center to the right.")
-     (enclose-bounds ,number?
-                    "How much of the bound a spanner should enclose:
-+1 = completely, 0 = center, -1 not at all.")
      (expand-limit ,integer? "maximum number of measures expanded in church rests.")
      ;; remove me?
      (extra-dy ,number? "Slope glissandi this much extra.")
index 5acb4fc1c6bd3972ce69681f0d43abb0d52720c1..eefc76fe1343181c821de59f2792f3e4dc52b0c1 100644 (file)
        (font-shape . italic)
        (style . dashed-line)
 
+       ;; make sure the spanner doesn't get too close to notes
+       (minimum-Y-extent . (-1 . 1))
        (bound-details . ((right . ((attach-dir .  ,LEFT)
                                    (Y . 0)
                                    (padding . 0.75)
                                   (padding . 0.5)
                                   ))
                          (left-broken . ((attach-dir .  ,RIGHT)
-                                         
-                                         ;; make sure the - - - stays at reasonable
-                                         ;; distance from staff.
-                                         (text . " ")
                                   ))
                          ))
-       (stencil . ,ly:new-line-spanner::print)
-       (left-bound-info . ,ly:new-line-spanner::calc-left-bound-info-and-text)
-       (right-bound-info . ,ly:new-line-spanner::calc-right-bound-info)
+       (stencil . ,ly:line-spanner::print)
+       (left-bound-info . ,ly:line-spanner::calc-left-bound-info-and-text)
+       (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
 
        ;; need to blend with dynamic texts.
        (font-size . 1)
        (meta . ((class . Spanner)
                 (interfaces . (font-interface
                                text-interface
-                               new-line-spanner-interface
+                               line-spanner-interface
                                line-interface
                                dynamic-interface
                                dynamic-text-spanner-interface
                                   (padding . 1.5)
                                      ))
                          ))
-       (stencil . ,ly:new-line-spanner::print)
-       (left-bound-info . ,ly:new-line-spanner::calc-left-bound-info)
-       (right-bound-info . ,ly:new-line-spanner::calc-right-bound-info)
+       (stencil . ,ly:line-spanner::print)
+       (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
+       (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
        (meta . ((class . Spanner)
                 (interfaces . (line-interface
                                unbreakable-spanner-interface
-                               new-line-spanner-interface))))))
+                               line-spanner-interface))))))
 
     (GraceSpacing
      . (
        (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
        (meta . ((class . Item)
                 (interfaces . (piano-pedal-interface
-                               text-spanner-interface
-                               line-spanner-interface
                                text-interface
                                self-alignment-interface
                                piano-pedal-script-interface
 
     (TextSpanner
      . (
-       (stencil . ,ly:text-spanner::print)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (font-shape . italic)
        (style . dashed-line)
        (side-axis . ,Y)
        (direction . ,UP)
        (outside-staff-priority . 350)
+
+       (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
+       (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
+       (bound-details . ((left . ((Y . 0)
+                                  (padding . 0.25)
+                                  (attach-dir . ,LEFT)
+                                  ))
+                         (right . ((Y . 0)
+                                   (padding . 0.25)
+                                  ))
+                         ))
+       (stencil . ,ly:line-spanner::print)
+
        (meta . ((class . Spanner)
-                (interfaces . (text-spanner-interface
-                               line-spanner-interface
+                (interfaces . (line-spanner-interface
                                side-position-interface
                                font-interface))))))
 
 
     (TrillSpanner
      . (
-       (left-bound-info . ,ly:new-line-spanner::calc-left-bound-info)
-       (right-bound-info . ,ly:new-line-spanner::calc-right-bound-info)
+       (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
+       (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
 
        (bound-details . ((left . ((text . ,(make-translate-scaled-markup
                                             '(0.5 . -0.6)
                          (right . ((Y . 0)))
                          ))
        
-       (stencil . ,ly:new-line-spanner::print)
+       (stencil . ,ly:line-spanner::print)
 
        (style . trill)
        (staff-padding . 1.0)
        (side-axis . ,Y)
        (outside-staff-priority . 50)
        (meta . ((class . Spanner)
-                (interfaces . (text-spanner-interface
-                               new-line-spanner-interface
+                (interfaces . (line-spanner-interface
+                               line-interface
+                               trill-spanner-interface
                                side-position-interface
                                font-interface))))))
 
                                   (padding . 1.5)
                                      ))
                          ))
-       (stencil . ,ly:new-line-spanner::print)
-       (left-bound-info . ,ly:new-line-spanner::calc-left-bound-info)
-       (right-bound-info . ,ly:new-line-spanner::calc-right-bound-info)
+       (stencil . ,ly:line-spanner::print)
+       (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
+       (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
        (meta . ((class . Spanner)
-                (interfaces . (new-line-spanner-interface
+                (interfaces . (line-spanner-interface
                                line-interface))))
        ))
 
index 12dd691634b4bf127761ac77f29056e1dcf1145e..45833f08e0abf7e41cb01c8a31c3a1edaa704948 100644 (file)
@@ -848,10 +848,7 @@ any sort of property supported by @internalsref{font-interface} and
                   (cons 'font-size (+ fs increment )))))
 
     (interpret-markup layout (cons entries props) arg)))
-  
-
 
-;; FIXME -> should convert to font-size.
 (define-builtin-markup-command (magnify layout props sz arg) (number? markup?)
   "Set the font magnification for the its argument. In the following
 example, the middle A will be 10% larger:
@@ -863,7 +860,7 @@ Note: magnification only works if a font-name is explicitly selected.
 Use @code{\\fontsize} otherwise."
   (interpret-markup
    layout 
-   (prepend-alist-chain 'font-magnification sz props)
+   (prepend-alist-chain 'font-size (magnification->font-size sz) props)
    arg))
 
 (define-builtin-markup-command (bold layout props arg) (markup?)
index 8774042ca90b87d8ef458f2e7ebbb828cec44fcb..4d5a4bcef367f8c3ca93b4fb6086283bf0884204 100644 (file)
     "Century Schoolbook L" 
     "Sans" "Mono" factor))
 
-(define-public (magstep x)
-  (exp (* (/ x 6) (log 2))))
+(define-public (magstep s)
+  (exp (* (/ s 6) (log 2))))
+
+(define-public (magnification->font-size m)
+  (* 6 (/ (log m) (log 2))))
index cf9bec54b30888aa08fc3526bcecb2a24fa8596a..fab2d771771dd4303c8420d5c95d865bc0a56af0 100644 (file)
@@ -146,6 +146,9 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
 
 (define-public (output-framework basename book scopes fields)
   (output-scopes scopes fields basename)
+  (if (ly:get-option 'clip-systems)
+      (clip-system-EPSes basename book))
+
   (dump-stencils-as-EPSes
    (map page-stencil (ly:paper-book-pages book)) book basename))
   
index 213d995c2c463a3eb7dd3897190ba192643693ca..28579ebc96f93c0175d793fa39d8dd2547741cfb 100644 (file)
               (ly:output-def-lookup paper 'output-scale))
            (ly:bp 1)))
        (landscape? (eq? (ly:output-def-lookup paper 'landscape) #t)))
-  (format "%%DocumentMedia: ~a ~a ~a ~a ~a ~a\n"
-   (ly:output-def-lookup paper 'papersizename)
-   (round2 (if landscape? h w))
-   (round2 (if landscape? w h))
-   80  ;; weight
-   "()" ;; color
-   "()"  ;; type
+  (ly:format "%%DocumentMedia: ~a ~2f ~2f ~a ~a ~a\n"
+            (ly:output-def-lookup paper 'papersizename)
+            (if landscape? h w)
+            (if landscape? w h)
+            80  ;; weight
+            "()" ;; color
+            "()"  ;; type
   )))
 
 
     ))
 
 
-(define (clip-system-EPSes basename paper-book)
+(define-public (clip-system-EPSes basename paper-book)
   (define do-pdf (member  "pdf" (ly:output-formats)))
 
   (define (clip-score-systems basename systems)
index e4895ae2e0fd6cb2fe011edd673145bb8ca023a5..ecbe711af88ed3d6ef3fd86ff107c273afac0c03 100644 (file)
@@ -17,6 +17,7 @@
   (let*
       ((file (open-output-file (format "~a.scm" basename))))
     
+    (display ";;Creator: LilyPond\n" file)
     (display ";; raw SCM output\n" file)
 
   (for-each
index 0746876ca3d6625d9c678c857618fe38f8ebf00a..e6215b98235349e4f95f50b6799cd212869d0eee 100644 (file)
   (string<? (symbol->string (car x))
            (symbol->string (car y))))
 
-(define-public (chain-assoc x alist-list)
-  (if (null? alist-list)
-      #f
-      (let* ((handle (assoc x (car alist-list))))
-       (if (pair? handle)
-           handle
-           (chain-assoc x (cdr alist-list))))))
-
 (define-public (chain-assoc-get x alist-list . default)
   "Return ALIST entry for X. Return DEFAULT (optional, else #f) if not
 found."
@@ -444,9 +436,6 @@ found."
          (make-string 1 (integer->char (+ 65 (modulo i 26))))
          (string-encode-integer (quotient i 26))))))
 
-(define-public (ly:numbers->string lst)
-  (string-join (map ly:number->string lst) " "))
-
 (define (number->octal-string x)
   (let* ((n (inexact->exact x))
          (n64 (quotient n 64))
@@ -526,13 +515,9 @@ possibly turned off."
       0
       (if (< x 0) -1 1)))
 
-(define-public (round2 num)
-  (/ (round (* 100 num)) 100))
-
-(define-public (round4 num)
-  (/ (round (* 10000 num)) 10000))
 
-(define-public (car< a b) (< (car a) (car b)))
+(define-public (car< a b)
+  (< (car a) (car b)))
 
 (define-public (symbol<? lst r)
   (string<? (symbol->string lst) (symbol->string r)))
index a5aee5458b4107b4ed902a8679e2ded9b0255aea..893cc59243f8b7ef45819aa78465878f2bf64b19 100644 (file)
 (debug-enable 'debug)
 
 
-(define (define-scheme-options)
-  (for-each (lambda (x)
-             (ly:add-option (car x) (cadr x) (caddr x)))
-         
-           `(
 
-             ;; NAMING: either
+(define scheme-options-definitions
+  `(
+
+    ;; NAMING: either
 
-             ;; - [subject-]object-object-verb +"ing"
-             ;; - [subject-]-verb-object-object
+    ;; - [subject-]object-object-verb +"ing"
+    ;; - [subject-]-verb-object-object
 
-             (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG")
-             (check-internal-types #f "check every property assignment for types")
-             (clip-systems #f "Generate cut-out snippets of a score")
-             (debug-gc #f "dump memory debugging statistics")
-             (debug-gc-assert-parsed-dead #f "for memory debugging:
+    (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG")
+    (check-internal-types #f "check every property assignment for types")
+    (clip-systems #f "Generate cut-out snippets of a score")
+    (debug-gc #f "dump memory debugging statistics")
+    (debug-gc-assert-parsed-dead #f "for memory debugging:
 ensure that all refs to parsed objects are dead.  This is an internal option, and is switched on automatically for -ddebug-gc.") 
-             (debug-lexer #f "debug the flex lexer")
-             (debug-parser #f "debug the bison parser")
-             (debug-skylines #f "debug skylines")
-             (delete-intermediate-files #f
-                                        "delete unusable PostScript files")
-             (dump-profile #f "dump timing information for each file")
-             (dump-signatures #f "dump output signatures of each system.  Used for regression testing.")
-             
-             (eps-box-padding #f "Pad EPS bounding box left edge.  Guarantee alignment between systems in LaTeX.")
-             (gs-load-fonts #f
-                           "load fonts via Ghostscript.")
-             (gui #f "running from gui; redirect stderr to log file")
-
-             (include-book-title-preview #t "include book-titles in preview images.")
-             (include-eps-fonts #t "Include fonts in separate-system EPS files.")
-             (job-count #f "Process in parallel") 
-             (log-file #f "redirect output to log FILE.log")
-
-             (old-relative #f
-                           "relative for simultaneous music works
+    (debug-lexer #f "debug the flex lexer")
+    (debug-parser #f "debug the bison parser")
+    (debug-skylines #f "debug skylines")
+    (delete-intermediate-files #f
+                              "delete unusable PostScript files")
+    (dump-profile #f "dump timing information for each file")
+    (dump-signatures #f "dump output signatures of each system.  Used for regression testing.")
+    
+    (eps-box-padding #f "Pad EPS bounding box left edge.  Guarantee alignment between systems in LaTeX.")
+    (gs-load-fonts #f
+                  "load fonts via Ghostscript.")
+    (gui #f "running from gui; redirect stderr to log file")
+    (help #f "show this help.") 
+    (include-book-title-preview #t "include book-titles in preview images.")
+    (include-eps-fonts #t "Include fonts in separate-system EPS files.")
+    (job-count #f "Process in parallel") 
+    (log-file #f "redirect output to log FILE.log")
+
+    (old-relative #f
+                 "relative for simultaneous music works
 similar to chord syntax")
-             (point-and-click #t "use point & click")
-             (paper-size "a4" "the default paper size")
-             (pixmap-format "png16m" "GS format to use for pixel images")
-             (protected-scheme-parsing #t "continue when finding errors in inline
+    (point-and-click #t "use point & click")
+    (paper-size "a4" "the default paper size")
+    (pixmap-format "png16m" "GS format to use for pixel images")
+    (protected-scheme-parsing #t "continue when finding errors in inline
 scheme are caught in the parser. If off, halt 
 on errors, and print a stack trace.")
-             (profile-property-accesses #f "keep statistics of get_property() calls.")
-             
-             (resolution 101 "resolution for generating PNG bitmaps")
-             (read-file-list #f "Read files to be processed from command line arguments")
-
-             (safe #f "Run safely")
-             (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.")
-             (separate-log-files #f "Output to FILE.log per file.")
-             (trace-memory-frequency #f "Record Scheme cell usage this many times per second, and dump to file.")
-             (trace-scheme-coverage #f "Record coverage of Scheme files") 
-             (ttf-verbosity 0
-                            "how much verbosity for TTF font embedding?")
-             (show-available-fonts #f
-                                   "List font names available.")
-             (verbose ,(ly:command-line-verbose?) "value for the --verbose flag")
-             ))
-
-  (map
-   (lambda (x)
-     (ly:set-option (car x) (cdr x))) 
-   (eval-string (ly:command-line-options))))
-
+    (profile-property-accesses #f "keep statistics of get_property() calls.")
+    
+    (resolution 101 "resolution for generating PNG bitmaps")
+    (read-file-list #f "Read files to be processed from command line arguments")
+
+    (safe #f "Run safely")
+    (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.")
+    (separate-log-files #f "Output to FILE.log per file.")
+    (trace-memory-frequency #f "Record Scheme cell usage this many times per second, and dump to file.")
+    (trace-scheme-coverage #f "Record coverage of Scheme files") 
+    (ttf-verbosity 0
+                  "how much verbosity for TTF font embedding?")
+    (show-available-fonts #f
+                         "List font names available.")
+    (verbose ,(ly:command-line-verbose?) "value for the --verbose flag")
+    ))
 
 ;; need to do this in the beginning. Other parts of the
 ;; Scheme init depend on these options.
 ;;
-(define-scheme-options)
-
+(for-each
+ (lambda (x)
+   (ly:add-option (car x) (cadr x) (caddr x)))
+ scheme-options-definitions)
 
+(for-each
+ (lambda (x)
+   (ly:set-option (car x) (cdr x)))
+ (eval-string (ly:command-line-options)))
 
 (debug-set! stack 0)
 
@@ -337,8 +335,6 @@ The syntax is the same as `define*-public'."
            "safe-lily.scm"))
 
 
-
-
 (for-each ly:load init-scheme-files)
 
 
@@ -642,8 +638,10 @@ The syntax is the same as `define*-public'."
          (exit 0)))))
 
 (define-public (lilypond-all files)
-  
-
+  (if (ly:get-option 'help)
+      (begin
+       (ly:option-usage)
+       (exit 0)))
   (if (ly:get-option 'show-available-fonts)
       (begin
        (ly:font-config-display-fonts)
index 049f27ea3ae63cf69e77267c9c4227a9a7b8652f..c4bfa93d18afb11f0c915049a8628745dde136f3 100644 (file)
@@ -620,7 +620,7 @@ of beat groupings "
   "Replace MUS by RestEvent of the same duration if it is a
 SkipEvent. Useful for extracting parts from crowded scores"
 
-  (if (equal? (ly:music-property mus 'name) 'SkipEvent)
+  (if  (memq (ly:music-property mus 'name) '(SkipEvent SkipMusic))
    (make-music 'RestEvent 'duration (ly:music-property mus 'duration))
    mus))
 
index f66a78bcbc7bf42082f35d66831dbd64c5e58c70..3cfefc8f3e58f53aac4f323105d7f769fb32d3ef 100644 (file)
   (lambda (grob) (circle-stencil (callback grob) thickness padding)))
 
 (define-public (print-circled-text-callback grob)
-  (let* ((text (ly:grob-property grob 'text))
-        
-        (layout (ly:grob-layout grob))
-        (defs (ly:output-def-lookup layout 'text-font-defaults))
-        (props (ly:grob-alist-chain grob defs))
-        (circle (ly:text-interface::interpret-markup
-                 layout props (make-circle-markup text))))
-    circle))
-
-(define-public (music-cause grob)
-  (let*
-      ((event (event-cause grob)))
-
-    (if (ly:stream-event? event)
-       (ly:event-property event 'music-cause)
-       #f)))
+  (grob-interpret-markup grob (make-circle-markup
+                  (ly:grob-property grob 'text))
+            ))
 
 (define-public (event-cause grob)
   (let*
       ;; statement.  -- jr
       ((xcircle) "2xcircle")
       ((harmonic) "0harmonic")
+      ((harmonic-black) "2harmonic")
+      ((harmonic-mixed) (if (<= log 1) "0harmonic"
+                                       "2harmonic"))
       ((baroque) 
        ;; Oops, I actually would not call this "baroque", but, for
        ;; backwards compatibility to 1.4, this is supposed to take
@@ -436,7 +426,7 @@ centered, X==1 is at the right, X == -1 is at the left."
     (list lp rp)))
 
 
-(define (grob-text grob text)
+(define-public (grob-interpret-markup grob text)
   (let*
       ((layout (ly:grob-layout grob))
        (defs (ly:output-def-lookup layout 'text-font-defaults))
@@ -448,9 +438,9 @@ centered, X==1 is at the right, X == -1 is at the left."
 (define-public (parentheses-item::calc-angled-bracket-stencils grob)
   (let* (
         (font (ly:grob-default-font grob))
-        (lp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-text grob (ly:wide-char->utf-8 #x2329))
+        (lp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-interpret-markup grob (ly:wide-char->utf-8 #x2329))
                                                           Y CENTER)  X RIGHT))
-        (rp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-text grob (ly:wide-char->utf-8 #x232A))
+        (rp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-interpret-markup grob (ly:wide-char->utf-8 #x232A))
                                                           Y CENTER) X LEFT))
         )
 
@@ -639,16 +629,12 @@ centered, X==1 is at the right, X == -1 is at the left."
   "Allow interpretation of tildes as lyric tieing marks."
   
   (let*
-      ((text (ly:grob-property grob 'text))
-       (layout (ly:grob-layout grob))
-       (defs (ly:output-def-lookup layout 'text-font-defaults))
-       (props (ly:grob-alist-chain grob defs)))
+      ((text (ly:grob-property grob 'text)))
 
-    (ly:text-interface::interpret-markup layout
-                                        props
-                                        (if (string? text)
-                                            (make-tied-lyric-markup text)
-                                            text))))
+    (grob-interpret-markup grob 
+              (if (string? text)
+                  (make-tied-lyric-markup text)
+                  text))))
 
 (define-public ((grob::calc-property-by-copy prop) grob)
   (ly:event-property (event-cause grob) prop))
@@ -685,10 +671,8 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (fret-board::calc-stencil grob)
   (let* ((string-frets (ly:grob-property grob 'string-fret-finger-combinations))
-        (string-count (ly:grob-property grob 'string-count))
-        (layout (ly:grob-layout grob))
-        (defs (ly:output-def-lookup layout 'text-font-defaults))
-        (props (ly:grob-alist-chain grob defs)))
-
-    (make-fret-diagram layout props
-                      (string-frets->description string-frets 6))))
+        (string-count (ly:grob-property grob 'string-count)))
+    
+    (grob-interpret-markup grob
+                          (make-fret-diagram-verbose-markup
+                           (string-frets->description string-frets string-count)))))
index b82c185e02caa7638dc0acd9a6628e4dc179cd65..1a136ba772b2f14dbd6c843daeffcf842386245d 100644 (file)
@@ -67,9 +67,6 @@
 (define (number-pair->string4 numpair)
   (ly:format "~4l" numpair)) 
 
-(define (numbers->string4 numlist)
-  (string-join (map str4 numlist) " "))
-
 ;;;
 ;;; Lily output interface, PostScript implementation --- cleanup and docme
 ;;;
index e992e7c74b095605c4729338a10bdc3bb59f42cb..083d5a081be223493612e8be276aa4f366de2664 100644 (file)
@@ -55,7 +55,6 @@
 
     (cond
      ((ly:stream-event? cause) cause)
-;     ((ly:grob? cause) (music-cause cause))
      (else
       #f))))
 
index 4750b518f7d67db2c40eb6ae71ba648f9175142b..dd2ba52b6f530fad58e58ab465af673c1ddfafe3 100644 (file)
@@ -61,8 +61,8 @@ points"
   (layout-set-absolute-staff-size-in-module (current-module) sz))
 
 (define-public (layout-set-staff-size sz)
-  "Function to be called inside a \\layout{} block to set the staff size. SZ is in
-points"
+  "Function to be called inside a \\layout{} block to set the staff
+size. SZ is in points"
   
   (layout-set-absolute-staff-size (* (eval 'pt (current-module)) sz)))
 
index c47f05583b26f21e3b2f888ef44f15a78090f1ce..2e3f2afe654fb0bb4d3ba8101483b6b7ce0da995 100644 (file)
@@ -51,7 +51,6 @@
    ly:grob-original
    ly:grob-layout
    ly:grob-parent
-   ly:grob-pq-less?
    ly:grob-property
    ly:grob-script-priority-less
    ly:grob-set-property!
    ly:sustain-pedal::print
    ly:system-start-delimiter::print
    ly:text-interface::print
-   ly:text-spanner::print
    ly:tie::print
    ly:time-signature::print
    ly:tuplet-bracket::print
index 283f04fe2d6665055ab605b3eb564a0b63e8f874..32a64fdedee300616c5cccca1490fe29beef80f4 100644 (file)
@@ -274,14 +274,21 @@ encloses the contents.
 (define-public (eps-file->stencil axis size file-name)
   (let*
       ((contents (ly:gulp-file file-name))
-       (bbox (get-postscript-bbox contents))
+       (bbox (get-postscript-bbox (car (string-split contents #\nul))))
        (bbox-size (if (= axis X)
                      (- (list-ref bbox 2) (list-ref bbox 0))
                      (- (list-ref bbox 3) (list-ref bbox 1))
                      ))
        (factor (exact->inexact (/ size bbox-size)))
        (scaled-bbox
-       (map (lambda (x) (* factor x)) bbox)))
+       (map (lambda (x) (* factor x)) bbox))
+       (clip-rect-string (format
+                         "~a ~a ~a ~a rectclip"
+                         (list-ref bbox 0) 
+                         (list-ref bbox 1) 
+                         (- (list-ref bbox 2) (list-ref bbox 0))
+                         (- (list-ref bbox 3) (list-ref bbox 1)))))
+    
 
     (if bbox
        (ly:make-stencil
@@ -293,9 +300,11 @@ encloses the contents.
 gsave
 currentpoint translate
 BeginEPSF
-~a ~a scale
+~a dup scale
+~a 
 %%BeginDocument: ~a
-"         factor factor
+"         factor clip-rect-string
+
           file-name
           )
           contents
index 522ae0d5fe08fa29127b10359b2e446024856fab..77f3838b8b7a949c7bf2d8acbc4a43174f8e23b4 100644 (file)
 ;;;; (c) 2005--2006 Bernard Hurley <bernard@fong-hurley.org.uk>
 ;;;;
 
-(define-public (make-x11-color-handler)
-  (let
-      ((x11-color-table (make-hash-table 31))
-       (x11-color-list             
-       '((snow 1 0.98039215686274506 0.98039215686274506)
-         (GhostWhite 0.97254901960784312 0.97254901960784312 1)
-         (WhiteSmoke 0.96078431372549022 0.96078431372549022 0.96078431372549022)
-         (gainsboro 0.86274509803921573 0.86274509803921573 0.86274509803921573)
-         (FloralWhite 1 0.98039215686274506 0.94117647058823528)
-         (OldLace 0.99215686274509807 0.96078431372549022 0.90196078431372551)
-         (linen 0.98039215686274506 0.94117647058823528 0.90196078431372551)
-         (AntiqueWhite 0.98039215686274506 0.92156862745098034 0.84313725490196079)
-         (PapayaWhip 1 0.93725490196078431 0.83529411764705885)
-         (BlanchedAlmond 1 0.92156862745098034 0.80392156862745101)
-         (bisque 1 0.89411764705882357 0.7686274509803922)
-         (PeachPuff 1 0.85490196078431369 0.72549019607843135)
-         (NavajoWhite 1 0.87058823529411766 0.67843137254901964)
-         (moccasin 1 0.89411764705882357 0.70980392156862748)
-         (cornsilk 1 0.97254901960784312 0.86274509803921573)
-         (ivory 1 1 0.94117647058823528)
-         (LemonChiffon 1 0.98039215686274506 0.80392156862745101)
-         (seashell 1 0.96078431372549022 0.93333333333333335)
-         (honeydew 0.94117647058823528 1 0.94117647058823528)
-         (MintCream 0.96078431372549022 1 0.98039215686274506)
-         (azure 0.94117647058823528 1 1)
-         (AliceBlue 0.94117647058823528 0.97254901960784312 1)
-         (lavender 0.90196078431372551 0.90196078431372551 0.98039215686274506)
-         (LavenderBlush 1 0.94117647058823528 0.96078431372549022)
-         (MistyRose 1 0.89411764705882357 0.88235294117647056)
-         (white 1 1 1)
-         (black 0 0 0)
-         (DarkSlateGray 0.18431372549019609 0.30980392156862746 0.30980392156862746)
-         (DarkSlateGrey 0.18431372549019609 0.30980392156862746 0.30980392156862746)
-         (DimGray 0.41176470588235292 0.41176470588235292 0.41176470588235292)
-         (DimGrey 0.41176470588235292 0.41176470588235292 0.41176470588235292)
-         (SlateGray 0.4392156862745098 0.50196078431372548 0.56470588235294117)
-         (SlateGrey 0.4392156862745098 0.50196078431372548 0.56470588235294117)
-         (LightSlateGray 0.46666666666666667 0.53333333333333333 0.59999999999999998)
-         (LightSlateGrey 0.46666666666666667 0.53333333333333333 0.59999999999999998)
-         (gray 0.74509803921568629 0.74509803921568629 0.74509803921568629)
-         (grey 0.74509803921568629 0.74509803921568629 0.74509803921568629)
-         (LightGrey 0.82745098039215681 0.82745098039215681 0.82745098039215681)
-         (LightGray 0.82745098039215681 0.82745098039215681 0.82745098039215681)
-         (MidnightBlue 0.098039215686274508 0.098039215686274508 0.4392156862745098)
-         (navy 0 0 0.50196078431372548)
-         (NavyBlue 0 0 0.50196078431372548)
-         (CornflowerBlue 0.39215686274509803 0.58431372549019611 0.92941176470588238)
-         (DarkSlateBlue 0.28235294117647058 0.23921568627450981 0.54509803921568623)
-         (SlateBlue 0.41568627450980394 0.35294117647058826 0.80392156862745101)
-         (MediumSlateBlue 0.4823529411764706 0.40784313725490196 0.93333333333333335)
-         (LightSlateBlue 0.51764705882352946 0.4392156862745098 1)
-         (MediumBlue 0 0 0.80392156862745101)
-         (RoyalBlue 0.25490196078431371 0.41176470588235292 0.88235294117647056)
-         (blue 0 0 1)
-         (DodgerBlue 0.11764705882352941 0.56470588235294117 1)
-         (DeepSkyBlue 0 0.74901960784313726 1)
-         (SkyBlue 0.52941176470588236 0.80784313725490198 0.92156862745098034)
-         (LightSkyBlue 0.52941176470588236 0.80784313725490198 0.98039215686274506)
-         (SteelBlue 0.27450980392156865 0.50980392156862742 0.70588235294117652)
-         (LightSteelBlue 0.69019607843137254 0.7686274509803922 0.87058823529411766)
-         (LightBlue 0.67843137254901964 0.84705882352941175 0.90196078431372551)
-         (PowderBlue 0.69019607843137254 0.8784313725490196 0.90196078431372551)
-         (PaleTurquoise 0.68627450980392157 0.93333333333333335 0.93333333333333335)
-         (DarkTurquoise 0 0.80784313725490198 0.81960784313725488)
-         (MediumTurquoise 0.28235294117647058 0.81960784313725488 0.80000000000000004)
-         (turquoise 0.25098039215686274 0.8784313725490196 0.81568627450980391)
-         (cyan 0 1 1)
-         (LightCyan 0.8784313725490196 1 1)
-         (CadetBlue 0.37254901960784315 0.61960784313725492 0.62745098039215685)
-         (MediumAquamarine 0.40000000000000002 0.80392156862745101 0.66666666666666663)
-         (aquamarine 0.49803921568627452 1 0.83137254901960789)
-         (DarkGreen 0 0.39215686274509803 0)
-         (DarkOliveGreen 0.33333333333333331 0.41960784313725491 0.18431372549019609)
-         (DarkSeaGreen 0.5607843137254902 0.73725490196078436 0.5607843137254902)
-         (SeaGreen 0.1803921568627451 0.54509803921568623 0.3411764705882353)
-         (MediumSeaGreen 0.23529411764705882 0.70196078431372544 0.44313725490196076)
-         (LightSeaGreen 0.12549019607843137 0.69803921568627447 0.66666666666666663)
-         (PaleGreen 0.59607843137254901 0.98431372549019602 0.59607843137254901)
-         (SpringGreen 0 1 0.49803921568627452)
-         (LawnGreen 0.48627450980392156 0.9882352941176471 0)
-         (green 0 1 0)
-         (chartreuse 0.49803921568627452 1 0)
-         (MediumSpringGreen 0 0.98039215686274506 0.60392156862745094)
-         (GreenYellow 0.67843137254901964 1 0.18431372549019609)
-         (LimeGreen 0.19607843137254902 0.80392156862745101 0.19607843137254902)
-         (YellowGreen 0.60392156862745094 0.80392156862745101 0.19607843137254902)
-         (ForestGreen 0.13333333333333333 0.54509803921568623 0.13333333333333333)
-         (OliveDrab 0.41960784313725491 0.55686274509803924 0.13725490196078433)
-         (DarkKhaki 0.74117647058823533 0.71764705882352942 0.41960784313725491)
-         (khaki 0.94117647058823528 0.90196078431372551 0.5490196078431373)
-         (PaleGoldenrod 0.93333333333333335 0.90980392156862744 0.66666666666666663)
-         (LightGoldenrodYellow 0.98039215686274506 0.98039215686274506 0.82352941176470584)
-         (LightYellow 1 1 0.8784313725490196)
-         (yellow 1 1 0)
-         (gold 1 0.84313725490196079 0)
-         (LightGoldenrod 0.93333333333333335 0.8666666666666667 0.50980392156862742)
-         (goldenrod 0.85490196078431369 0.6470588235294118 0.12549019607843137)
-         (DarkGoldenrod 0.72156862745098038 0.52549019607843139 0.043137254901960784)
-         (RosyBrown 0.73725490196078436 0.5607843137254902 0.5607843137254902)
-         (IndianRed 0.80392156862745101 0.36078431372549019 0.36078431372549019)
-         (SaddleBrown 0.54509803921568623 0.27058823529411763 0.074509803921568626)
-         (sienna 0.62745098039215685 0.32156862745098042 0.17647058823529413)
-         (peru 0.80392156862745101 0.52156862745098043 0.24705882352941178)
-         (burlywood 0.87058823529411766 0.72156862745098038 0.52941176470588236)
-         (beige 0.96078431372549022 0.96078431372549022 0.86274509803921573)
-         (wheat 0.96078431372549022 0.87058823529411766 0.70196078431372544)
-         (SandyBrown 0.95686274509803926 0.64313725490196083 0.37647058823529411)
-         (tan 0.82352941176470584 0.70588235294117652 0.5490196078431373)
-         (chocolate 0.82352941176470584 0.41176470588235292 0.11764705882352941)
-         (firebrick 0.69803921568627447 0.13333333333333333 0.13333333333333333)
-         (brown 0.6470588235294118 0.16470588235294117 0.16470588235294117)
-         (DarkSalmon 0.9137254901960784 0.58823529411764708 0.47843137254901963)
-         (salmon 0.98039215686274506 0.50196078431372548 0.44705882352941179)
-         (LightSalmon 1 0.62745098039215685 0.47843137254901963)
-         (orange 1 0.6470588235294118 0)
-         (DarkOrange 1 0.5490196078431373 0)
-         (coral 1 0.49803921568627452 0.31372549019607843)
-         (LightCoral 0.94117647058823528 0.50196078431372548 0.50196078431372548)
-         (tomato 1 0.38823529411764707 0.27843137254901962)
-         (OrangeRed 1 0.27058823529411763 0)
-         (red 1 0 0)
-         (HotPink 1 0.41176470588235292 0.70588235294117652)
-         (DeepPink 1 0.078431372549019607 0.57647058823529407)
-         (pink 1 0.75294117647058822 0.79607843137254897)
-         (LightPink 1 0.71372549019607845 0.75686274509803919)
-         (PaleVioletRed 0.85882352941176465 0.4392156862745098 0.57647058823529407)
-         (maroon 0.69019607843137254 0.18823529411764706 0.37647058823529411)
-         (MediumVioletRed 0.7803921568627451 0.082352941176470587 0.52156862745098043)
-         (VioletRed 0.81568627450980391 0.12549019607843137 0.56470588235294117)
-         (magenta 1 0 1)
-         (violet 0.93333333333333335 0.50980392156862742 0.93333333333333335)
-         (plum 0.8666666666666667 0.62745098039215685 0.8666666666666667)
-         (orchid 0.85490196078431369 0.4392156862745098 0.83921568627450982)
-         (MediumOrchid 0.72941176470588232 0.33333333333333331 0.82745098039215681)
-         (DarkOrchid 0.59999999999999998 0.19607843137254902 0.80000000000000004)
-         (DarkViolet 0.58039215686274515 0 0.82745098039215681)
-         (BlueViolet 0.54117647058823526 0.16862745098039217 0.88627450980392153)
-         (purple 0.62745098039215685 0.12549019607843137 0.94117647058823528)
-         (MediumPurple 0.57647058823529407 0.4392156862745098 0.85882352941176465)
-         (thistle 0.84705882352941175 0.74901960784313726 0.84705882352941175)
-         (snow1 1 0.98039215686274506 0.98039215686274506)
-         (snow2 0.93333333333333335 0.9137254901960784 0.9137254901960784)
-         (snow3 0.80392156862745101 0.78823529411764703 0.78823529411764703)
-         (snow4 0.54509803921568623 0.53725490196078429 0.53725490196078429)
-         (seashell1 1 0.96078431372549022 0.93333333333333335)
-         (seashell2 0.93333333333333335 0.89803921568627454 0.87058823529411766)
-         (seashell3 0.80392156862745101 0.77254901960784317 0.74901960784313726)
-         (seashell4 0.54509803921568623 0.52549019607843139 0.50980392156862742)
-         (AntiqueWhite1 1 0.93725490196078431 0.85882352941176465)
-         (AntiqueWhite2 0.93333333333333335 0.87450980392156863 0.80000000000000004)
-         (AntiqueWhite3 0.80392156862745101 0.75294117647058822 0.69019607843137254)
-         (AntiqueWhite4 0.54509803921568623 0.51372549019607838 0.47058823529411764)
-         (bisque1 1 0.89411764705882357 0.7686274509803922)
-         (bisque2 0.93333333333333335 0.83529411764705885 0.71764705882352942)
-         (bisque3 0.80392156862745101 0.71764705882352942 0.61960784313725492)
-         (bisque4 0.54509803921568623 0.49019607843137253 0.41960784313725491)
-         (PeachPuff1 1 0.85490196078431369 0.72549019607843135)
-         (PeachPuff2 0.93333333333333335 0.79607843137254897 0.67843137254901964)
-         (PeachPuff3 0.80392156862745101 0.68627450980392157 0.58431372549019611)
-         (PeachPuff4 0.54509803921568623 0.46666666666666667 0.396078431372549)
-         (NavajoWhite1 1 0.87058823529411766 0.67843137254901964)
-         (NavajoWhite2 0.93333333333333335 0.81176470588235294 0.63137254901960782)
-         (NavajoWhite3 0.80392156862745101 0.70196078431372544 0.54509803921568623)
-         (NavajoWhite4 0.54509803921568623 0.47450980392156861 0.36862745098039218)
-         (LemonChiffon1 1 0.98039215686274506 0.80392156862745101)
-         (LemonChiffon2 0.93333333333333335 0.9137254901960784 0.74901960784313726)
-         (LemonChiffon3 0.80392156862745101 0.78823529411764703 0.6470588235294118)
-         (LemonChiffon4 0.54509803921568623 0.53725490196078429 0.4392156862745098)
-         (cornsilk1 1 0.97254901960784312 0.86274509803921573)
-         (cornsilk2 0.93333333333333335 0.90980392156862744 0.80392156862745101)
-         (cornsilk3 0.80392156862745101 0.78431372549019607 0.69411764705882351)
-         (cornsilk4 0.54509803921568623 0.53333333333333333 0.47058823529411764)
-         (ivory1 1 1 0.94117647058823528)
-         (ivory2 0.93333333333333335 0.93333333333333335 0.8784313725490196)
-         (ivory3 0.80392156862745101 0.80392156862745101 0.75686274509803919)
-         (ivory4 0.54509803921568623 0.54509803921568623 0.51372549019607838)
-         (honeydew1 0.94117647058823528 1 0.94117647058823528)
-         (honeydew2 0.8784313725490196 0.93333333333333335 0.8784313725490196)
-         (honeydew3 0.75686274509803919 0.80392156862745101 0.75686274509803919)
-         (honeydew4 0.51372549019607838 0.54509803921568623 0.51372549019607838)
-         (LavenderBlush1 1 0.94117647058823528 0.96078431372549022)
-         (LavenderBlush2 0.93333333333333335 0.8784313725490196 0.89803921568627454)
-         (LavenderBlush3 0.80392156862745101 0.75686274509803919 0.77254901960784317)
-         (LavenderBlush4 0.54509803921568623 0.51372549019607838 0.52549019607843139)
-         (MistyRose1 1 0.89411764705882357 0.88235294117647056)
-         (MistyRose2 0.93333333333333335 0.83529411764705885 0.82352941176470584)
-         (MistyRose3 0.80392156862745101 0.71764705882352942 0.70980392156862748)
-         (MistyRose4 0.54509803921568623 0.49019607843137253 0.4823529411764706)
-         (azure1 0.94117647058823528 1 1)
-         (azure2 0.8784313725490196 0.93333333333333335 0.93333333333333335)
-         (azure3 0.75686274509803919 0.80392156862745101 0.80392156862745101)
-         (azure4 0.51372549019607838 0.54509803921568623 0.54509803921568623)
-         (SlateBlue1 0.51372549019607838 0.43529411764705883 1)
-         (SlateBlue2 0.47843137254901963 0.40392156862745099 0.93333333333333335)
-         (SlateBlue3 0.41176470588235292 0.34901960784313724 0.80392156862745101)
-         (SlateBlue4 0.27843137254901962 0.23529411764705882 0.54509803921568623)
-         (RoyalBlue1 0.28235294117647058 0.46274509803921571 1)
-         (RoyalBlue2 0.2627450980392157 0.43137254901960786 0.93333333333333335)
-         (RoyalBlue3 0.22745098039215686 0.37254901960784315 0.80392156862745101)
-         (RoyalBlue4 0.15294117647058825 0.25098039215686274 0.54509803921568623)
-         (blue1 0 0 1)
-         (blue2 0 0 0.93333333333333335)
-         (blue3 0 0 0.80392156862745101)
-         (blue4 0 0 0.54509803921568623)
-         (DodgerBlue1 0.11764705882352941 0.56470588235294117 1)
-         (DodgerBlue2 0.10980392156862745 0.52549019607843139 0.93333333333333335)
-         (DodgerBlue3 0.094117647058823528 0.45490196078431372 0.80392156862745101)
-         (DodgerBlue4 0.062745098039215685 0.30588235294117649 0.54509803921568623)
-         (SteelBlue1 0.38823529411764707 0.72156862745098038 1)
-         (SteelBlue2 0.36078431372549019 0.67450980392156867 0.93333333333333335)
-         (SteelBlue3 0.30980392156862746 0.58039215686274515 0.80392156862745101)
-         (SteelBlue4 0.21176470588235294 0.39215686274509803 0.54509803921568623)
-         (DeepSkyBlue1 0 0.74901960784313726 1)
-         (DeepSkyBlue2 0 0.69803921568627447 0.93333333333333335)
-         (DeepSkyBlue3 0 0.60392156862745094 0.80392156862745101)
-         (DeepSkyBlue4 0 0.40784313725490196 0.54509803921568623)
-         (SkyBlue1 0.52941176470588236 0.80784313725490198 1)
-         (SkyBlue2 0.49411764705882355 0.75294117647058822 0.93333333333333335)
-         (SkyBlue3 0.42352941176470588 0.65098039215686276 0.80392156862745101)
-         (SkyBlue4 0.29019607843137257 0.4392156862745098 0.54509803921568623)
-         (LightSkyBlue1 0.69019607843137254 0.88627450980392153 1)
-         (LightSkyBlue2 0.64313725490196083 0.82745098039215681 0.93333333333333335)
-         (LightSkyBlue3 0.55294117647058827 0.71372549019607845 0.80392156862745101)
-         (LightSkyBlue4 0.37647058823529411 0.4823529411764706 0.54509803921568623)
-         (SlateGray1 0.77647058823529413 0.88627450980392153 1)
-         (SlateGray2 0.72549019607843135 0.82745098039215681 0.93333333333333335)
-         (SlateGray3 0.62352941176470589 0.71372549019607845 0.80392156862745101)
-         (SlateGray4 0.42352941176470588 0.4823529411764706 0.54509803921568623)
-         (LightSteelBlue1 0.792156862745098 0.88235294117647056 1)
-         (LightSteelBlue2 0.73725490196078436 0.82352941176470584 0.93333333333333335)
-         (LightSteelBlue3 0.63529411764705879 0.70980392156862748 0.80392156862745101)
-         (LightSteelBlue4 0.43137254901960786 0.4823529411764706 0.54509803921568623)
-         (LightBlue1 0.74901960784313726 0.93725490196078431 1)
-         (LightBlue2 0.69803921568627447 0.87450980392156863 0.93333333333333335)
-         (LightBlue3 0.60392156862745094 0.75294117647058822 0.80392156862745101)
-         (LightBlue4 0.40784313725490196 0.51372549019607838 0.54509803921568623)
-         (LightCyan1 0.8784313725490196 1 1)
-         (LightCyan2 0.81960784313725488 0.93333333333333335 0.93333333333333335)
-         (LightCyan3 0.70588235294117652 0.80392156862745101 0.80392156862745101)
-         (LightCyan4 0.47843137254901963 0.54509803921568623 0.54509803921568623)
-         (PaleTurquoise1 0.73333333333333328 1 1)
-         (PaleTurquoise2 0.68235294117647061 0.93333333333333335 0.93333333333333335)
-         (PaleTurquoise3 0.58823529411764708 0.80392156862745101 0.80392156862745101)
-         (PaleTurquoise4 0.40000000000000002 0.54509803921568623 0.54509803921568623)
-         (CadetBlue1 0.59607843137254901 0.96078431372549022 1)
-         (CadetBlue2 0.55686274509803924 0.89803921568627454 0.93333333333333335)
-         (CadetBlue3 0.47843137254901963 0.77254901960784317 0.80392156862745101)
-         (CadetBlue4 0.32549019607843138 0.52549019607843139 0.54509803921568623)
-         (turquoise1 0 0.96078431372549022 1)
-         (turquoise2 0 0.89803921568627454 0.93333333333333335)
-         (turquoise3 0 0.77254901960784317 0.80392156862745101)
-         (turquoise4 0 0.52549019607843139 0.54509803921568623)
-         (cyan1 0 1 1)
-         (cyan2 0 0.93333333333333335 0.93333333333333335)
-         (cyan3 0 0.80392156862745101 0.80392156862745101)
-         (cyan4 0 0.54509803921568623 0.54509803921568623)
-         (DarkSlateGray1 0.59215686274509804 1 1)
-         (DarkSlateGray2 0.55294117647058827 0.93333333333333335 0.93333333333333335)
-         (DarkSlateGray3 0.47450980392156861 0.80392156862745101 0.80392156862745101)
-         (DarkSlateGray4 0.32156862745098042 0.54509803921568623 0.54509803921568623)
-         (aquamarine1 0.49803921568627452 1 0.83137254901960789)
-         (aquamarine2 0.46274509803921571 0.93333333333333335 0.77647058823529413)
-         (aquamarine3 0.40000000000000002 0.80392156862745101 0.66666666666666663)
-         (aquamarine4 0.27058823529411763 0.54509803921568623 0.45490196078431372)
-         (DarkSeaGreen1 0.75686274509803919 1 0.75686274509803919)
-         (DarkSeaGreen2 0.70588235294117652 0.93333333333333335 0.70588235294117652)
-         (DarkSeaGreen3 0.60784313725490191 0.80392156862745101 0.60784313725490191)
-         (DarkSeaGreen4 0.41176470588235292 0.54509803921568623 0.41176470588235292)
-         (SeaGreen1 0.32941176470588235 1 0.62352941176470589)
-         (SeaGreen2 0.30588235294117649 0.93333333333333335 0.58039215686274515)
-         (SeaGreen3 0.2627450980392157 0.80392156862745101 0.50196078431372548)
-         (SeaGreen4 0.1803921568627451 0.54509803921568623 0.3411764705882353)
-         (PaleGreen1 0.60392156862745094 1 0.60392156862745094)
-         (PaleGreen2 0.56470588235294117 0.93333333333333335 0.56470588235294117)
-         (PaleGreen3 0.48627450980392156 0.80392156862745101 0.48627450980392156)
-         (PaleGreen4 0.32941176470588235 0.54509803921568623 0.32941176470588235)
-         (SpringGreen1 0 1 0.49803921568627452)
-         (SpringGreen2 0 0.93333333333333335 0.46274509803921571)
-         (SpringGreen3 0 0.80392156862745101 0.40000000000000002)
-         (SpringGreen4 0 0.54509803921568623 0.27058823529411763)
-         (green1 0 1 0)
-         (green2 0 0.93333333333333335 0)
-         (green3 0 0.80392156862745101 0)
-         (green4 0 0.54509803921568623 0)
-         (chartreuse1 0.49803921568627452 1 0)
-         (chartreuse2 0.46274509803921571 0.93333333333333335 0)
-         (chartreuse3 0.40000000000000002 0.80392156862745101 0)
-         (chartreuse4 0.27058823529411763 0.54509803921568623 0)
-         (OliveDrab1 0.75294117647058822 1 0.24313725490196078)
-         (OliveDrab2 0.70196078431372544 0.93333333333333335 0.22745098039215686)
-         (OliveDrab3 0.60392156862745094 0.80392156862745101 0.19607843137254902)
-         (OliveDrab4 0.41176470588235292 0.54509803921568623 0.13333333333333333)
-         (DarkOliveGreen1 0.792156862745098 1 0.4392156862745098)
-         (DarkOliveGreen2 0.73725490196078436 0.93333333333333335 0.40784313725490196)
-         (DarkOliveGreen3 0.63529411764705879 0.80392156862745101 0.35294117647058826)
-         (DarkOliveGreen4 0.43137254901960786 0.54509803921568623 0.23921568627450981)
-         (khaki1 1 0.96470588235294119 0.5607843137254902)
-         (khaki2 0.93333333333333335 0.90196078431372551 0.52156862745098043)
-         (khaki3 0.80392156862745101 0.77647058823529413 0.45098039215686275)
-         (khaki4 0.54509803921568623 0.52549019607843139 0.30588235294117649)
-         (LightGoldenrod1 1 0.92549019607843142 0.54509803921568623)
-         (LightGoldenrod2 0.93333333333333335 0.86274509803921573 0.50980392156862742)
-         (LightGoldenrod3 0.80392156862745101 0.74509803921568629 0.4392156862745098)
-         (LightGoldenrod4 0.54509803921568623 0.50588235294117645 0.29803921568627451)
-         (LightYellow1 1 1 0.8784313725490196)
-         (LightYellow2 0.93333333333333335 0.93333333333333335 0.81960784313725488)
-         (LightYellow3 0.80392156862745101 0.80392156862745101 0.70588235294117652)
-         (LightYellow4 0.54509803921568623 0.54509803921568623 0.47843137254901963)
-         (yellow1 1 1 0)
-         (yellow2 0.93333333333333335 0.93333333333333335 0)
-         (yellow3 0.80392156862745101 0.80392156862745101 0)
-         (yellow4 0.54509803921568623 0.54509803921568623 0)
-         (gold1 1 0.84313725490196079 0)
-         (gold2 0.93333333333333335 0.78823529411764703 0)
-         (gold3 0.80392156862745101 0.67843137254901964 0)
-         (gold4 0.54509803921568623 0.45882352941176469 0)
-         (goldenrod1 1 0.75686274509803919 0.14509803921568629)
-         (goldenrod2 0.93333333333333335 0.70588235294117652 0.13333333333333333)
-         (goldenrod3 0.80392156862745101 0.60784313725490191 0.11372549019607843)
-         (goldenrod4 0.54509803921568623 0.41176470588235292 0.078431372549019607)
-         (DarkGoldenrod1 1 0.72549019607843135 0.058823529411764705)
-         (DarkGoldenrod2 0.93333333333333335 0.67843137254901964 0.054901960784313725)
-         (DarkGoldenrod3 0.80392156862745101 0.58431372549019611 0.047058823529411764)
-         (DarkGoldenrod4 0.54509803921568623 0.396078431372549 0.031372549019607843)
-         (RosyBrown1 1 0.75686274509803919 0.75686274509803919)
-         (RosyBrown2 0.93333333333333335 0.70588235294117652 0.70588235294117652)
-         (RosyBrown3 0.80392156862745101 0.60784313725490191 0.60784313725490191)
-         (RosyBrown4 0.54509803921568623 0.41176470588235292 0.41176470588235292)
-         (IndianRed1 1 0.41568627450980394 0.41568627450980394)
-         (IndianRed2 0.93333333333333335 0.38823529411764707 0.38823529411764707)
-         (IndianRed3 0.80392156862745101 0.33333333333333331 0.33333333333333331)
-         (IndianRed4 0.54509803921568623 0.22745098039215686 0.22745098039215686)
-         (sienna1 1 0.50980392156862742 0.27843137254901962)
-         (sienna2 0.93333333333333335 0.47450980392156861 0.25882352941176473)
-         (sienna3 0.80392156862745101 0.40784313725490196 0.22352941176470589)
-         (sienna4 0.54509803921568623 0.27843137254901962 0.14901960784313725)
-         (burlywood1 1 0.82745098039215681 0.60784313725490191)
-         (burlywood2 0.93333333333333335 0.77254901960784317 0.56862745098039214)
-         (burlywood3 0.80392156862745101 0.66666666666666663 0.49019607843137253)
-         (burlywood4 0.54509803921568623 0.45098039215686275 0.33333333333333331)
-         (wheat1 1 0.90588235294117647 0.72941176470588232)
-         (wheat2 0.93333333333333335 0.84705882352941175 0.68235294117647061)
-         (wheat3 0.80392156862745101 0.72941176470588232 0.58823529411764708)
-         (wheat4 0.54509803921568623 0.49411764705882355 0.40000000000000002)
-         (tan1 1 0.6470588235294118 0.30980392156862746)
-         (tan2 0.93333333333333335 0.60392156862745094 0.28627450980392155)
-         (tan3 0.80392156862745101 0.52156862745098043 0.24705882352941178)
-         (tan4 0.54509803921568623 0.35294117647058826 0.16862745098039217)
-         (chocolate1 1 0.49803921568627452 0.14117647058823529)
-         (chocolate2 0.93333333333333335 0.46274509803921571 0.12941176470588237)
-         (chocolate3 0.80392156862745101 0.40000000000000002 0.11372549019607843)
-         (chocolate4 0.54509803921568623 0.27058823529411763 0.074509803921568626)
-         (firebrick1 1 0.18823529411764706 0.18823529411764706)
-         (firebrick2 0.93333333333333335 0.17254901960784313 0.17254901960784313)
-         (firebrick3 0.80392156862745101 0.14901960784313725 0.14901960784313725)
-         (firebrick4 0.54509803921568623 0.10196078431372549 0.10196078431372549)
-         (brown1 1 0.25098039215686274 0.25098039215686274)
-         (brown2 0.93333333333333335 0.23137254901960785 0.23137254901960785)
-         (brown3 0.80392156862745101 0.20000000000000001 0.20000000000000001)
-         (brown4 0.54509803921568623 0.13725490196078433 0.13725490196078433)
-         (salmon1 1 0.5490196078431373 0.41176470588235292)
-         (salmon2 0.93333333333333335 0.50980392156862742 0.3843137254901961)
-         (salmon3 0.80392156862745101 0.4392156862745098 0.32941176470588235)
-         (salmon4 0.54509803921568623 0.29803921568627451 0.22352941176470589)
-         (LightSalmon1 1 0.62745098039215685 0.47843137254901963)
-         (LightSalmon2 0.93333333333333335 0.58431372549019611 0.44705882352941179)
-         (LightSalmon3 0.80392156862745101 0.50588235294117645 0.3843137254901961)
-         (LightSalmon4 0.54509803921568623 0.3411764705882353 0.25882352941176473)
-         (orange1 1 0.6470588235294118 0)
-         (orange2 0.93333333333333335 0.60392156862745094 0)
-         (orange3 0.80392156862745101 0.52156862745098043 0)
-         (orange4 0.54509803921568623 0.35294117647058826 0)
-         (DarkOrange1 1 0.49803921568627452 0)
-         (DarkOrange2 0.93333333333333335 0.46274509803921571 0)
-         (DarkOrange3 0.80392156862745101 0.40000000000000002 0)
-         (DarkOrange4 0.54509803921568623 0.27058823529411763 0)
-         (coral1 1 0.44705882352941179 0.33725490196078434)
-         (coral2 0.93333333333333335 0.41568627450980394 0.31372549019607843)
-         (coral3 0.80392156862745101 0.35686274509803922 0.27058823529411763)
-         (coral4 0.54509803921568623 0.24313725490196078 0.18431372549019609)
-         (tomato1 1 0.38823529411764707 0.27843137254901962)
-         (tomato2 0.93333333333333335 0.36078431372549019 0.25882352941176473)
-         (tomato3 0.80392156862745101 0.30980392156862746 0.22352941176470589)
-         (tomato4 0.54509803921568623 0.21176470588235294 0.14901960784313725)
-         (OrangeRed1 1 0.27058823529411763 0)
-         (OrangeRed2 0.93333333333333335 0.25098039215686274 0)
-         (OrangeRed3 0.80392156862745101 0.21568627450980393 0)
-         (OrangeRed4 0.54509803921568623 0.14509803921568629 0)
-         (red1 1 0 0)
-         (red2 0.93333333333333335 0 0)
-         (red3 0.80392156862745101 0 0)
-         (red4 0.54509803921568623 0 0)
-         (DeepPink1 1 0.078431372549019607 0.57647058823529407)
-         (DeepPink2 0.93333333333333335 0.070588235294117646 0.53725490196078429)
-         (DeepPink3 0.80392156862745101 0.062745098039215685 0.46274509803921571)
-         (DeepPink4 0.54509803921568623 0.039215686274509803 0.31372549019607843)
-         (HotPink1 1 0.43137254901960786 0.70588235294117652)
-         (HotPink2 0.93333333333333335 0.41568627450980394 0.65490196078431373)
-         (HotPink3 0.80392156862745101 0.37647058823529411 0.56470588235294117)
-         (HotPink4 0.54509803921568623 0.22745098039215686 0.3843137254901961)
-         (pink1 1 0.70980392156862748 0.77254901960784317)
-         (pink2 0.93333333333333335 0.66274509803921566 0.72156862745098038)
-         (pink3 0.80392156862745101 0.56862745098039214 0.61960784313725492)
-         (pink4 0.54509803921568623 0.38823529411764707 0.42352941176470588)
-         (LightPink1 1 0.68235294117647061 0.72549019607843135)
-         (LightPink2 0.93333333333333335 0.63529411764705879 0.67843137254901964)
-         (LightPink3 0.80392156862745101 0.5490196078431373 0.58431372549019611)
-         (LightPink4 0.54509803921568623 0.37254901960784315 0.396078431372549)
-         (PaleVioletRed1 1 0.50980392156862742 0.6705882352941176)
-         (PaleVioletRed2 0.93333333333333335 0.47450980392156861 0.62352941176470589)
-         (PaleVioletRed3 0.80392156862745101 0.40784313725490196 0.53725490196078429)
-         (PaleVioletRed4 0.54509803921568623 0.27843137254901962 0.36470588235294116)
-         (maroon1 1 0.20392156862745098 0.70196078431372544)
-         (maroon2 0.93333333333333335 0.18823529411764706 0.65490196078431373)
-         (maroon3 0.80392156862745101 0.16078431372549021 0.56470588235294117)
-         (maroon4 0.54509803921568623 0.10980392156862745 0.3843137254901961)
-         (VioletRed1 1 0.24313725490196078 0.58823529411764708)
-         (VioletRed2 0.93333333333333335 0.22745098039215686 0.5490196078431373)
-         (VioletRed3 0.80392156862745101 0.19607843137254902 0.47058823529411764)
-         (VioletRed4 0.54509803921568623 0.13333333333333333 0.32156862745098042)
-         (magenta1 1 0 1)
-         (magenta2 0.93333333333333335 0 0.93333333333333335)
-         (magenta3 0.80392156862745101 0 0.80392156862745101)
-         (magenta4 0.54509803921568623 0 0.54509803921568623)
-         (orchid1 1 0.51372549019607838 0.98039215686274506)
-         (orchid2 0.93333333333333335 0.47843137254901963 0.9137254901960784)
-         (orchid3 0.80392156862745101 0.41176470588235292 0.78823529411764703)
-         (orchid4 0.54509803921568623 0.27843137254901962 0.53725490196078429)
-         (plum1 1 0.73333333333333328 1)
-         (plum2 0.93333333333333335 0.68235294117647061 0.93333333333333335)
-         (plum3 0.80392156862745101 0.58823529411764708 0.80392156862745101)
-         (plum4 0.54509803921568623 0.40000000000000002 0.54509803921568623)
-         (MediumOrchid1 0.8784313725490196 0.40000000000000002 1)
-         (MediumOrchid2 0.81960784313725488 0.37254901960784315 0.93333333333333335)
-         (MediumOrchid3 0.70588235294117652 0.32156862745098042 0.80392156862745101)
-         (MediumOrchid4 0.47843137254901963 0.21568627450980393 0.54509803921568623)
-         (DarkOrchid1 0.74901960784313726 0.24313725490196078 1)
-         (DarkOrchid2 0.69803921568627447 0.22745098039215686 0.93333333333333335)
-         (DarkOrchid3 0.60392156862745094 0.19607843137254902 0.80392156862745101)
-         (DarkOrchid4 0.40784313725490196 0.13333333333333333 0.54509803921568623)
-         (purple1 0.60784313725490191 0.18823529411764706 1)
-         (purple2 0.56862745098039214 0.17254901960784313 0.93333333333333335)
-         (purple3 0.49019607843137253 0.14901960784313725 0.80392156862745101)
-         (purple4 0.33333333333333331 0.10196078431372549 0.54509803921568623)
-         (MediumPurple1 0.6705882352941176 0.50980392156862742 1)
-         (MediumPurple2 0.62352941176470589 0.47450980392156861 0.93333333333333335)
-         (MediumPurple3 0.53725490196078429 0.40784313725490196 0.80392156862745101)
-         (MediumPurple4 0.36470588235294116 0.27843137254901962 0.54509803921568623)
-         (thistle1 1 0.88235294117647056 1)
-         (thistle2 0.93333333333333335 0.82352941176470584 0.93333333333333335)
-         (thistle3 0.80392156862745101 0.70980392156862748 0.80392156862745101)
-         (thistle4 0.54509803921568623 0.4823529411764706 0.54509803921568623)
-         (gray0 0 0 0)
-         (grey0 0 0 0)
-         (gray1 0.011764705882352941 0.011764705882352941 0.011764705882352941)
-         (grey1 0.011764705882352941 0.011764705882352941 0.011764705882352941)
-         (gray2 0.019607843137254902 0.019607843137254902 0.019607843137254902)
-         (grey2 0.019607843137254902 0.019607843137254902 0.019607843137254902)
-         (gray3 0.031372549019607843 0.031372549019607843 0.031372549019607843)
-         (grey3 0.031372549019607843 0.031372549019607843 0.031372549019607843)
-         (gray4 0.039215686274509803 0.039215686274509803 0.039215686274509803)
-         (grey4 0.039215686274509803 0.039215686274509803 0.039215686274509803)
-         (gray5 0.050980392156862744 0.050980392156862744 0.050980392156862744)
-         (grey5 0.050980392156862744 0.050980392156862744 0.050980392156862744)
-         (gray6 0.058823529411764705 0.058823529411764705 0.058823529411764705)
-         (grey6 0.058823529411764705 0.058823529411764705 0.058823529411764705)
-         (gray7 0.070588235294117646 0.070588235294117646 0.070588235294117646)
-         (grey7 0.070588235294117646 0.070588235294117646 0.070588235294117646)
-         (gray8 0.078431372549019607 0.078431372549019607 0.078431372549019607)
-         (grey8 0.078431372549019607 0.078431372549019607 0.078431372549019607)
-         (gray9 0.090196078431372548 0.090196078431372548 0.090196078431372548)
-         (grey9 0.090196078431372548 0.090196078431372548 0.090196078431372548)
-         (gray10 0.10196078431372549 0.10196078431372549 0.10196078431372549)
-         (grey10 0.10196078431372549 0.10196078431372549 0.10196078431372549)
-         (gray11 0.10980392156862745 0.10980392156862745 0.10980392156862745)
-         (grey11 0.10980392156862745 0.10980392156862745 0.10980392156862745)
-         (gray12 0.12156862745098039 0.12156862745098039 0.12156862745098039)
-         (grey12 0.12156862745098039 0.12156862745098039 0.12156862745098039)
-         (gray13 0.12941176470588237 0.12941176470588237 0.12941176470588237)
-         (grey13 0.12941176470588237 0.12941176470588237 0.12941176470588237)
-         (gray14 0.14117647058823529 0.14117647058823529 0.14117647058823529)
-         (grey14 0.14117647058823529 0.14117647058823529 0.14117647058823529)
-         (gray15 0.14901960784313725 0.14901960784313725 0.14901960784313725)
-         (grey15 0.14901960784313725 0.14901960784313725 0.14901960784313725)
-         (gray16 0.16078431372549021 0.16078431372549021 0.16078431372549021)
-         (grey16 0.16078431372549021 0.16078431372549021 0.16078431372549021)
-         (gray17 0.16862745098039217 0.16862745098039217 0.16862745098039217)
-         (grey17 0.16862745098039217 0.16862745098039217 0.16862745098039217)
-         (gray18 0.1803921568627451 0.1803921568627451 0.1803921568627451)
-         (grey18 0.1803921568627451 0.1803921568627451 0.1803921568627451)
-         (gray19 0.18823529411764706 0.18823529411764706 0.18823529411764706)
-         (grey19 0.18823529411764706 0.18823529411764706 0.18823529411764706)
-         (gray20 0.20000000000000001 0.20000000000000001 0.20000000000000001)
-         (grey20 0.20000000000000001 0.20000000000000001 0.20000000000000001)
-         (gray21 0.21176470588235294 0.21176470588235294 0.21176470588235294)
-         (grey21 0.21176470588235294 0.21176470588235294 0.21176470588235294)
-         (gray22 0.2196078431372549 0.2196078431372549 0.2196078431372549)
-         (grey22 0.2196078431372549 0.2196078431372549 0.2196078431372549)
-         (gray23 0.23137254901960785 0.23137254901960785 0.23137254901960785)
-         (grey23 0.23137254901960785 0.23137254901960785 0.23137254901960785)
-         (gray24 0.23921568627450981 0.23921568627450981 0.23921568627450981)
-         (grey24 0.23921568627450981 0.23921568627450981 0.23921568627450981)
-         (gray25 0.25098039215686274 0.25098039215686274 0.25098039215686274)
-         (grey25 0.25098039215686274 0.25098039215686274 0.25098039215686274)
-         (gray26 0.25882352941176473 0.25882352941176473 0.25882352941176473)
-         (grey26 0.25882352941176473 0.25882352941176473 0.25882352941176473)
-         (gray27 0.27058823529411763 0.27058823529411763 0.27058823529411763)
-         (grey27 0.27058823529411763 0.27058823529411763 0.27058823529411763)
-         (gray28 0.27843137254901962 0.27843137254901962 0.27843137254901962)
-         (grey28 0.27843137254901962 0.27843137254901962 0.27843137254901962)
-         (gray29 0.29019607843137257 0.29019607843137257 0.29019607843137257)
-         (grey29 0.29019607843137257 0.29019607843137257 0.29019607843137257)
-         (gray30 0.30196078431372547 0.30196078431372547 0.30196078431372547)
-         (grey30 0.30196078431372547 0.30196078431372547 0.30196078431372547)
-         (gray31 0.30980392156862746 0.30980392156862746 0.30980392156862746)
-         (grey31 0.30980392156862746 0.30980392156862746 0.30980392156862746)
-         (gray32 0.32156862745098042 0.32156862745098042 0.32156862745098042)
-         (grey32 0.32156862745098042 0.32156862745098042 0.32156862745098042)
-         (gray33 0.32941176470588235 0.32941176470588235 0.32941176470588235)
-         (grey33 0.32941176470588235 0.32941176470588235 0.32941176470588235)
-         (gray34 0.3411764705882353 0.3411764705882353 0.3411764705882353)
-         (grey34 0.3411764705882353 0.3411764705882353 0.3411764705882353)
-         (gray35 0.34901960784313724 0.34901960784313724 0.34901960784313724)
-         (grey35 0.34901960784313724 0.34901960784313724 0.34901960784313724)
-         (gray36 0.36078431372549019 0.36078431372549019 0.36078431372549019)
-         (grey36 0.36078431372549019 0.36078431372549019 0.36078431372549019)
-         (gray37 0.36862745098039218 0.36862745098039218 0.36862745098039218)
-         (grey37 0.36862745098039218 0.36862745098039218 0.36862745098039218)
-         (gray38 0.38039215686274508 0.38039215686274508 0.38039215686274508)
-         (grey38 0.38039215686274508 0.38039215686274508 0.38039215686274508)
-         (gray39 0.38823529411764707 0.38823529411764707 0.38823529411764707)
-         (grey39 0.38823529411764707 0.38823529411764707 0.38823529411764707)
-         (gray40 0.40000000000000002 0.40000000000000002 0.40000000000000002)
-         (grey40 0.40000000000000002 0.40000000000000002 0.40000000000000002)
-         (gray41 0.41176470588235292 0.41176470588235292 0.41176470588235292)
-         (grey41 0.41176470588235292 0.41176470588235292 0.41176470588235292)
-         (gray42 0.41960784313725491 0.41960784313725491 0.41960784313725491)
-         (grey42 0.41960784313725491 0.41960784313725491 0.41960784313725491)
-         (gray43 0.43137254901960786 0.43137254901960786 0.43137254901960786)
-         (grey43 0.43137254901960786 0.43137254901960786 0.43137254901960786)
-         (gray44 0.4392156862745098 0.4392156862745098 0.4392156862745098)
-         (grey44 0.4392156862745098 0.4392156862745098 0.4392156862745098)
-         (gray45 0.45098039215686275 0.45098039215686275 0.45098039215686275)
-         (grey45 0.45098039215686275 0.45098039215686275 0.45098039215686275)
-         (gray46 0.45882352941176469 0.45882352941176469 0.45882352941176469)
-         (grey46 0.45882352941176469 0.45882352941176469 0.45882352941176469)
-         (gray47 0.47058823529411764 0.47058823529411764 0.47058823529411764)
-         (grey47 0.47058823529411764 0.47058823529411764 0.47058823529411764)
-         (gray48 0.47843137254901963 0.47843137254901963 0.47843137254901963)
-         (grey48 0.47843137254901963 0.47843137254901963 0.47843137254901963)
-         (gray49 0.49019607843137253 0.49019607843137253 0.49019607843137253)
-         (grey49 0.49019607843137253 0.49019607843137253 0.49019607843137253)
-         (gray50 0.49803921568627452 0.49803921568627452 0.49803921568627452)
-         (grey50 0.49803921568627452 0.49803921568627452 0.49803921568627452)
-         (gray51 0.50980392156862742 0.50980392156862742 0.50980392156862742)
-         (grey51 0.50980392156862742 0.50980392156862742 0.50980392156862742)
-         (gray52 0.52156862745098043 0.52156862745098043 0.52156862745098043)
-         (grey52 0.52156862745098043 0.52156862745098043 0.52156862745098043)
-         (gray53 0.52941176470588236 0.52941176470588236 0.52941176470588236)
-         (grey53 0.52941176470588236 0.52941176470588236 0.52941176470588236)
-         (gray54 0.54117647058823526 0.54117647058823526 0.54117647058823526)
-         (grey54 0.54117647058823526 0.54117647058823526 0.54117647058823526)
-         (gray55 0.5490196078431373 0.5490196078431373 0.5490196078431373)
-         (grey55 0.5490196078431373 0.5490196078431373 0.5490196078431373)
-         (gray56 0.5607843137254902 0.5607843137254902 0.5607843137254902)
-         (grey56 0.5607843137254902 0.5607843137254902 0.5607843137254902)
-         (gray57 0.56862745098039214 0.56862745098039214 0.56862745098039214)
-         (grey57 0.56862745098039214 0.56862745098039214 0.56862745098039214)
-         (gray58 0.58039215686274515 0.58039215686274515 0.58039215686274515)
-         (grey58 0.58039215686274515 0.58039215686274515 0.58039215686274515)
-         (gray59 0.58823529411764708 0.58823529411764708 0.58823529411764708)
-         (grey59 0.58823529411764708 0.58823529411764708 0.58823529411764708)
-         (gray60 0.59999999999999998 0.59999999999999998 0.59999999999999998)
-         (grey60 0.59999999999999998 0.59999999999999998 0.59999999999999998)
-         (gray61 0.61176470588235299 0.61176470588235299 0.61176470588235299)
-         (grey61 0.61176470588235299 0.61176470588235299 0.61176470588235299)
-         (gray62 0.61960784313725492 0.61960784313725492 0.61960784313725492)
-         (grey62 0.61960784313725492 0.61960784313725492 0.61960784313725492)
-         (gray63 0.63137254901960782 0.63137254901960782 0.63137254901960782)
-         (grey63 0.63137254901960782 0.63137254901960782 0.63137254901960782)
-         (gray64 0.63921568627450975 0.63921568627450975 0.63921568627450975)
-         (grey64 0.63921568627450975 0.63921568627450975 0.63921568627450975)
-         (gray65 0.65098039215686276 0.65098039215686276 0.65098039215686276)
-         (grey65 0.65098039215686276 0.65098039215686276 0.65098039215686276)
-         (gray66 0.6588235294117647 0.6588235294117647 0.6588235294117647)
-         (grey66 0.6588235294117647 0.6588235294117647 0.6588235294117647)
-         (gray67 0.6705882352941176 0.6705882352941176 0.6705882352941176)
-         (grey67 0.6705882352941176 0.6705882352941176 0.6705882352941176)
-         (gray68 0.67843137254901964 0.67843137254901964 0.67843137254901964)
-         (grey68 0.67843137254901964 0.67843137254901964 0.67843137254901964)
-         (gray69 0.69019607843137254 0.69019607843137254 0.69019607843137254)
-         (grey69 0.69019607843137254 0.69019607843137254 0.69019607843137254)
-         (gray70 0.70196078431372544 0.70196078431372544 0.70196078431372544)
-         (grey70 0.70196078431372544 0.70196078431372544 0.70196078431372544)
-         (gray71 0.70980392156862748 0.70980392156862748 0.70980392156862748)
-         (grey71 0.70980392156862748 0.70980392156862748 0.70980392156862748)
-         (gray72 0.72156862745098038 0.72156862745098038 0.72156862745098038)
-         (grey72 0.72156862745098038 0.72156862745098038 0.72156862745098038)
-         (gray73 0.72941176470588232 0.72941176470588232 0.72941176470588232)
-         (grey73 0.72941176470588232 0.72941176470588232 0.72941176470588232)
-         (gray74 0.74117647058823533 0.74117647058823533 0.74117647058823533)
-         (grey74 0.74117647058823533 0.74117647058823533 0.74117647058823533)
-         (gray75 0.74901960784313726 0.74901960784313726 0.74901960784313726)
-         (grey75 0.74901960784313726 0.74901960784313726 0.74901960784313726)
-         (gray76 0.76078431372549016 0.76078431372549016 0.76078431372549016)
-         (grey76 0.76078431372549016 0.76078431372549016 0.76078431372549016)
-         (gray77 0.7686274509803922 0.7686274509803922 0.7686274509803922)
-         (grey77 0.7686274509803922 0.7686274509803922 0.7686274509803922)
-         (gray78 0.7803921568627451 0.7803921568627451 0.7803921568627451)
-         (grey78 0.7803921568627451 0.7803921568627451 0.7803921568627451)
-         (gray79 0.78823529411764703 0.78823529411764703 0.78823529411764703)
-         (grey79 0.78823529411764703 0.78823529411764703 0.78823529411764703)
-         (gray80 0.80000000000000004 0.80000000000000004 0.80000000000000004)
-         (grey80 0.80000000000000004 0.80000000000000004 0.80000000000000004)
-         (gray81 0.81176470588235294 0.81176470588235294 0.81176470588235294)
-         (grey81 0.81176470588235294 0.81176470588235294 0.81176470588235294)
-         (gray82 0.81960784313725488 0.81960784313725488 0.81960784313725488)
-         (grey82 0.81960784313725488 0.81960784313725488 0.81960784313725488)
-         (gray83 0.83137254901960789 0.83137254901960789 0.83137254901960789)
-         (grey83 0.83137254901960789 0.83137254901960789 0.83137254901960789)
-         (gray84 0.83921568627450982 0.83921568627450982 0.83921568627450982)
-         (grey84 0.83921568627450982 0.83921568627450982 0.83921568627450982)
-         (gray85 0.85098039215686272 0.85098039215686272 0.85098039215686272)
-         (grey85 0.85098039215686272 0.85098039215686272 0.85098039215686272)
-         (gray86 0.85882352941176465 0.85882352941176465 0.85882352941176465)
-         (grey86 0.85882352941176465 0.85882352941176465 0.85882352941176465)
-         (gray87 0.87058823529411766 0.87058823529411766 0.87058823529411766)
-         (grey87 0.87058823529411766 0.87058823529411766 0.87058823529411766)
-         (gray88 0.8784313725490196 0.8784313725490196 0.8784313725490196)
-         (grey88 0.8784313725490196 0.8784313725490196 0.8784313725490196)
-         (gray89 0.8901960784313725 0.8901960784313725 0.8901960784313725)
-         (grey89 0.8901960784313725 0.8901960784313725 0.8901960784313725)
-         (gray90 0.89803921568627454 0.89803921568627454 0.89803921568627454)
-         (grey90 0.89803921568627454 0.89803921568627454 0.89803921568627454)
-         (gray91 0.90980392156862744 0.90980392156862744 0.90980392156862744)
-         (grey91 0.90980392156862744 0.90980392156862744 0.90980392156862744)
-         (gray92 0.92156862745098034 0.92156862745098034 0.92156862745098034)
-         (grey92 0.92156862745098034 0.92156862745098034 0.92156862745098034)
-         (gray93 0.92941176470588238 0.92941176470588238 0.92941176470588238)
-         (grey93 0.92941176470588238 0.92941176470588238 0.92941176470588238)
-         (gray94 0.94117647058823528 0.94117647058823528 0.94117647058823528)
-         (grey94 0.94117647058823528 0.94117647058823528 0.94117647058823528)
-         (gray95 0.94901960784313721 0.94901960784313721 0.94901960784313721)
-         (grey95 0.94901960784313721 0.94901960784313721 0.94901960784313721)
-         (gray96 0.96078431372549022 0.96078431372549022 0.96078431372549022)
-         (grey96 0.96078431372549022 0.96078431372549022 0.96078431372549022)
-         (gray97 0.96862745098039216 0.96862745098039216 0.96862745098039216)
-         (grey97 0.96862745098039216 0.96862745098039216 0.96862745098039216)
-         (gray98 0.98039215686274506 0.98039215686274506 0.98039215686274506)
-         (grey98 0.98039215686274506 0.98039215686274506 0.98039215686274506)
-         (gray99 0.9882352941176471 0.9882352941176471 0.9882352941176471)
-         (grey99 0.9882352941176471 0.9882352941176471 0.9882352941176471)
-         (gray100 1 1 1)
-         (grey100 1 1 1)
-         (DarkGrey 0.66274509803921566 0.66274509803921566 0.66274509803921566)
-         (DarkGray 0.66274509803921566 0.66274509803921566 0.66274509803921566)
-         (DarkBlue 0 0 0.54509803921568623)
-         (DarkCyan 0 0.54509803921568623 0.54509803921568623)
-         (DarkMagenta 0.54509803921568623 0 0.54509803921568623)
-         (DarkRed 0.54509803921568623 0 0)
-         (LightGreen 0.56470588235294117 0.93333333333333335 0.56470588235294117)
-
-         )))
+(define x11-color-list             
+  '((snow 1 0.98039215686274506 0.98039215686274506)
+    (GhostWhite 0.97254901960784312 0.97254901960784312 1)
+    (WhiteSmoke 0.96078431372549022 0.96078431372549022 0.96078431372549022)
+    (gainsboro 0.86274509803921573 0.86274509803921573 0.86274509803921573)
+    (FloralWhite 1 0.98039215686274506 0.94117647058823528)
+    (OldLace 0.99215686274509807 0.96078431372549022 0.90196078431372551)
+    (linen 0.98039215686274506 0.94117647058823528 0.90196078431372551)
+    (AntiqueWhite 0.98039215686274506 0.92156862745098034 0.84313725490196079)
+    (PapayaWhip 1 0.93725490196078431 0.83529411764705885)
+    (BlanchedAlmond 1 0.92156862745098034 0.80392156862745101)
+    (bisque 1 0.89411764705882357 0.7686274509803922)
+    (PeachPuff 1 0.85490196078431369 0.72549019607843135)
+    (NavajoWhite 1 0.87058823529411766 0.67843137254901964)
+    (moccasin 1 0.89411764705882357 0.70980392156862748)
+    (cornsilk 1 0.97254901960784312 0.86274509803921573)
+    (ivory 1 1 0.94117647058823528)
+    (LemonChiffon 1 0.98039215686274506 0.80392156862745101)
+    (seashell 1 0.96078431372549022 0.93333333333333335)
+    (honeydew 0.94117647058823528 1 0.94117647058823528)
+    (MintCream 0.96078431372549022 1 0.98039215686274506)
+    (azure 0.94117647058823528 1 1)
+    (AliceBlue 0.94117647058823528 0.97254901960784312 1)
+    (lavender 0.90196078431372551 0.90196078431372551 0.98039215686274506)
+    (LavenderBlush 1 0.94117647058823528 0.96078431372549022)
+    (MistyRose 1 0.89411764705882357 0.88235294117647056)
+    (white 1 1 1)
+    (black 0 0 0)
+    (DarkSlateGray 0.18431372549019609 0.30980392156862746 0.30980392156862746)
+    (DarkSlateGrey 0.18431372549019609 0.30980392156862746 0.30980392156862746)
+    (DimGray 0.41176470588235292 0.41176470588235292 0.41176470588235292)
+    (DimGrey 0.41176470588235292 0.41176470588235292 0.41176470588235292)
+    (SlateGray 0.4392156862745098 0.50196078431372548 0.56470588235294117)
+    (SlateGrey 0.4392156862745098 0.50196078431372548 0.56470588235294117)
+    (LightSlateGray 0.46666666666666667 0.53333333333333333 0.59999999999999998)
+    (LightSlateGrey 0.46666666666666667 0.53333333333333333 0.59999999999999998)
+    (gray 0.74509803921568629 0.74509803921568629 0.74509803921568629)
+    (grey 0.74509803921568629 0.74509803921568629 0.74509803921568629)
+    (LightGrey 0.82745098039215681 0.82745098039215681 0.82745098039215681)
+    (LightGray 0.82745098039215681 0.82745098039215681 0.82745098039215681)
+    (MidnightBlue 0.098039215686274508 0.098039215686274508 0.4392156862745098)
+    (navy 0 0 0.50196078431372548)
+    (NavyBlue 0 0 0.50196078431372548)
+    (CornflowerBlue 0.39215686274509803 0.58431372549019611 0.92941176470588238)
+    (DarkSlateBlue 0.28235294117647058 0.23921568627450981 0.54509803921568623)
+    (SlateBlue 0.41568627450980394 0.35294117647058826 0.80392156862745101)
+    (MediumSlateBlue 0.4823529411764706 0.40784313725490196 0.93333333333333335)
+    (LightSlateBlue 0.51764705882352946 0.4392156862745098 1)
+    (MediumBlue 0 0 0.80392156862745101)
+    (RoyalBlue 0.25490196078431371 0.41176470588235292 0.88235294117647056)
+    (blue 0 0 1)
+    (DodgerBlue 0.11764705882352941 0.56470588235294117 1)
+    (DeepSkyBlue 0 0.74901960784313726 1)
+    (SkyBlue 0.52941176470588236 0.80784313725490198 0.92156862745098034)
+    (LightSkyBlue 0.52941176470588236 0.80784313725490198 0.98039215686274506)
+    (SteelBlue 0.27450980392156865 0.50980392156862742 0.70588235294117652)
+    (LightSteelBlue 0.69019607843137254 0.7686274509803922 0.87058823529411766)
+    (LightBlue 0.67843137254901964 0.84705882352941175 0.90196078431372551)
+    (PowderBlue 0.69019607843137254 0.8784313725490196 0.90196078431372551)
+    (PaleTurquoise 0.68627450980392157 0.93333333333333335 0.93333333333333335)
+    (DarkTurquoise 0 0.80784313725490198 0.81960784313725488)
+    (MediumTurquoise 0.28235294117647058 0.81960784313725488 0.80000000000000004)
+    (turquoise 0.25098039215686274 0.8784313725490196 0.81568627450980391)
+    (cyan 0 1 1)
+    (LightCyan 0.8784313725490196 1 1)
+    (CadetBlue 0.37254901960784315 0.61960784313725492 0.62745098039215685)
+    (MediumAquamarine 0.40000000000000002 0.80392156862745101 0.66666666666666663)
+    (aquamarine 0.49803921568627452 1 0.83137254901960789)
+    (DarkGreen 0 0.39215686274509803 0)
+    (DarkOliveGreen 0.33333333333333331 0.41960784313725491 0.18431372549019609)
+    (DarkSeaGreen 0.5607843137254902 0.73725490196078436 0.5607843137254902)
+    (SeaGreen 0.1803921568627451 0.54509803921568623 0.3411764705882353)
+    (MediumSeaGreen 0.23529411764705882 0.70196078431372544 0.44313725490196076)
+    (LightSeaGreen 0.12549019607843137 0.69803921568627447 0.66666666666666663)
+    (PaleGreen 0.59607843137254901 0.98431372549019602 0.59607843137254901)
+    (SpringGreen 0 1 0.49803921568627452)
+    (LawnGreen 0.48627450980392156 0.9882352941176471 0)
+    (green 0 1 0)
+    (chartreuse 0.49803921568627452 1 0)
+    (MediumSpringGreen 0 0.98039215686274506 0.60392156862745094)
+    (GreenYellow 0.67843137254901964 1 0.18431372549019609)
+    (LimeGreen 0.19607843137254902 0.80392156862745101 0.19607843137254902)
+    (YellowGreen 0.60392156862745094 0.80392156862745101 0.19607843137254902)
+    (ForestGreen 0.13333333333333333 0.54509803921568623 0.13333333333333333)
+    (OliveDrab 0.41960784313725491 0.55686274509803924 0.13725490196078433)
+    (DarkKhaki 0.74117647058823533 0.71764705882352942 0.41960784313725491)
+    (khaki 0.94117647058823528 0.90196078431372551 0.5490196078431373)
+    (PaleGoldenrod 0.93333333333333335 0.90980392156862744 0.66666666666666663)
+    (LightGoldenrodYellow 0.98039215686274506 0.98039215686274506 0.82352941176470584)
+    (LightYellow 1 1 0.8784313725490196)
+    (yellow 1 1 0)
+    (gold 1 0.84313725490196079 0)
+    (LightGoldenrod 0.93333333333333335 0.8666666666666667 0.50980392156862742)
+    (goldenrod 0.85490196078431369 0.6470588235294118 0.12549019607843137)
+    (DarkGoldenrod 0.72156862745098038 0.52549019607843139 0.043137254901960784)
+    (RosyBrown 0.73725490196078436 0.5607843137254902 0.5607843137254902)
+    (IndianRed 0.80392156862745101 0.36078431372549019 0.36078431372549019)
+    (SaddleBrown 0.54509803921568623 0.27058823529411763 0.074509803921568626)
+    (sienna 0.62745098039215685 0.32156862745098042 0.17647058823529413)
+    (peru 0.80392156862745101 0.52156862745098043 0.24705882352941178)
+    (burlywood 0.87058823529411766 0.72156862745098038 0.52941176470588236)
+    (beige 0.96078431372549022 0.96078431372549022 0.86274509803921573)
+    (wheat 0.96078431372549022 0.87058823529411766 0.70196078431372544)
+    (SandyBrown 0.95686274509803926 0.64313725490196083 0.37647058823529411)
+    (tan 0.82352941176470584 0.70588235294117652 0.5490196078431373)
+    (chocolate 0.82352941176470584 0.41176470588235292 0.11764705882352941)
+    (firebrick 0.69803921568627447 0.13333333333333333 0.13333333333333333)
+    (brown 0.6470588235294118 0.16470588235294117 0.16470588235294117)
+    (DarkSalmon 0.9137254901960784 0.58823529411764708 0.47843137254901963)
+    (salmon 0.98039215686274506 0.50196078431372548 0.44705882352941179)
+    (LightSalmon 1 0.62745098039215685 0.47843137254901963)
+    (orange 1 0.6470588235294118 0)
+    (DarkOrange 1 0.5490196078431373 0)
+    (coral 1 0.49803921568627452 0.31372549019607843)
+    (LightCoral 0.94117647058823528 0.50196078431372548 0.50196078431372548)
+    (tomato 1 0.38823529411764707 0.27843137254901962)
+    (OrangeRed 1 0.27058823529411763 0)
+    (red 1 0 0)
+    (HotPink 1 0.41176470588235292 0.70588235294117652)
+    (DeepPink 1 0.078431372549019607 0.57647058823529407)
+    (pink 1 0.75294117647058822 0.79607843137254897)
+    (LightPink 1 0.71372549019607845 0.75686274509803919)
+    (PaleVioletRed 0.85882352941176465 0.4392156862745098 0.57647058823529407)
+    (maroon 0.69019607843137254 0.18823529411764706 0.37647058823529411)
+    (MediumVioletRed 0.7803921568627451 0.082352941176470587 0.52156862745098043)
+    (VioletRed 0.81568627450980391 0.12549019607843137 0.56470588235294117)
+    (magenta 1 0 1)
+    (violet 0.93333333333333335 0.50980392156862742 0.93333333333333335)
+    (plum 0.8666666666666667 0.62745098039215685 0.8666666666666667)
+    (orchid 0.85490196078431369 0.4392156862745098 0.83921568627450982)
+    (MediumOrchid 0.72941176470588232 0.33333333333333331 0.82745098039215681)
+    (DarkOrchid 0.59999999999999998 0.19607843137254902 0.80000000000000004)
+    (DarkViolet 0.58039215686274515 0 0.82745098039215681)
+    (BlueViolet 0.54117647058823526 0.16862745098039217 0.88627450980392153)
+    (purple 0.62745098039215685 0.12549019607843137 0.94117647058823528)
+    (MediumPurple 0.57647058823529407 0.4392156862745098 0.85882352941176465)
+    (thistle 0.84705882352941175 0.74901960784313726 0.84705882352941175)
+    (snow1 1 0.98039215686274506 0.98039215686274506)
+    (snow2 0.93333333333333335 0.9137254901960784 0.9137254901960784)
+    (snow3 0.80392156862745101 0.78823529411764703 0.78823529411764703)
+    (snow4 0.54509803921568623 0.53725490196078429 0.53725490196078429)
+    (seashell1 1 0.96078431372549022 0.93333333333333335)
+    (seashell2 0.93333333333333335 0.89803921568627454 0.87058823529411766)
+    (seashell3 0.80392156862745101 0.77254901960784317 0.74901960784313726)
+    (seashell4 0.54509803921568623 0.52549019607843139 0.50980392156862742)
+    (AntiqueWhite1 1 0.93725490196078431 0.85882352941176465)
+    (AntiqueWhite2 0.93333333333333335 0.87450980392156863 0.80000000000000004)
+    (AntiqueWhite3 0.80392156862745101 0.75294117647058822 0.69019607843137254)
+    (AntiqueWhite4 0.54509803921568623 0.51372549019607838 0.47058823529411764)
+    (bisque1 1 0.89411764705882357 0.7686274509803922)
+    (bisque2 0.93333333333333335 0.83529411764705885 0.71764705882352942)
+    (bisque3 0.80392156862745101 0.71764705882352942 0.61960784313725492)
+    (bisque4 0.54509803921568623 0.49019607843137253 0.41960784313725491)
+    (PeachPuff1 1 0.85490196078431369 0.72549019607843135)
+    (PeachPuff2 0.93333333333333335 0.79607843137254897 0.67843137254901964)
+    (PeachPuff3 0.80392156862745101 0.68627450980392157 0.58431372549019611)
+    (PeachPuff4 0.54509803921568623 0.46666666666666667 0.396078431372549)
+    (NavajoWhite1 1 0.87058823529411766 0.67843137254901964)
+    (NavajoWhite2 0.93333333333333335 0.81176470588235294 0.63137254901960782)
+    (NavajoWhite3 0.80392156862745101 0.70196078431372544 0.54509803921568623)
+    (NavajoWhite4 0.54509803921568623 0.47450980392156861 0.36862745098039218)
+    (LemonChiffon1 1 0.98039215686274506 0.80392156862745101)
+    (LemonChiffon2 0.93333333333333335 0.9137254901960784 0.74901960784313726)
+    (LemonChiffon3 0.80392156862745101 0.78823529411764703 0.6470588235294118)
+    (LemonChiffon4 0.54509803921568623 0.53725490196078429 0.4392156862745098)
+    (cornsilk1 1 0.97254901960784312 0.86274509803921573)
+    (cornsilk2 0.93333333333333335 0.90980392156862744 0.80392156862745101)
+    (cornsilk3 0.80392156862745101 0.78431372549019607 0.69411764705882351)
+    (cornsilk4 0.54509803921568623 0.53333333333333333 0.47058823529411764)
+    (ivory1 1 1 0.94117647058823528)
+    (ivory2 0.93333333333333335 0.93333333333333335 0.8784313725490196)
+    (ivory3 0.80392156862745101 0.80392156862745101 0.75686274509803919)
+    (ivory4 0.54509803921568623 0.54509803921568623 0.51372549019607838)
+    (honeydew1 0.94117647058823528 1 0.94117647058823528)
+    (honeydew2 0.8784313725490196 0.93333333333333335 0.8784313725490196)
+    (honeydew3 0.75686274509803919 0.80392156862745101 0.75686274509803919)
+    (honeydew4 0.51372549019607838 0.54509803921568623 0.51372549019607838)
+    (LavenderBlush1 1 0.94117647058823528 0.96078431372549022)
+    (LavenderBlush2 0.93333333333333335 0.8784313725490196 0.89803921568627454)
+    (LavenderBlush3 0.80392156862745101 0.75686274509803919 0.77254901960784317)
+    (LavenderBlush4 0.54509803921568623 0.51372549019607838 0.52549019607843139)
+    (MistyRose1 1 0.89411764705882357 0.88235294117647056)
+    (MistyRose2 0.93333333333333335 0.83529411764705885 0.82352941176470584)
+    (MistyRose3 0.80392156862745101 0.71764705882352942 0.70980392156862748)
+    (MistyRose4 0.54509803921568623 0.49019607843137253 0.4823529411764706)
+    (azure1 0.94117647058823528 1 1)
+    (azure2 0.8784313725490196 0.93333333333333335 0.93333333333333335)
+    (azure3 0.75686274509803919 0.80392156862745101 0.80392156862745101)
+    (azure4 0.51372549019607838 0.54509803921568623 0.54509803921568623)
+    (SlateBlue1 0.51372549019607838 0.43529411764705883 1)
+    (SlateBlue2 0.47843137254901963 0.40392156862745099 0.93333333333333335)
+    (SlateBlue3 0.41176470588235292 0.34901960784313724 0.80392156862745101)
+    (SlateBlue4 0.27843137254901962 0.23529411764705882 0.54509803921568623)
+    (RoyalBlue1 0.28235294117647058 0.46274509803921571 1)
+    (RoyalBlue2 0.2627450980392157 0.43137254901960786 0.93333333333333335)
+    (RoyalBlue3 0.22745098039215686 0.37254901960784315 0.80392156862745101)
+    (RoyalBlue4 0.15294117647058825 0.25098039215686274 0.54509803921568623)
+    (blue1 0 0 1)
+    (blue2 0 0 0.93333333333333335)
+    (blue3 0 0 0.80392156862745101)
+    (blue4 0 0 0.54509803921568623)
+    (DodgerBlue1 0.11764705882352941 0.56470588235294117 1)
+    (DodgerBlue2 0.10980392156862745 0.52549019607843139 0.93333333333333335)
+    (DodgerBlue3 0.094117647058823528 0.45490196078431372 0.80392156862745101)
+    (DodgerBlue4 0.062745098039215685 0.30588235294117649 0.54509803921568623)
+    (SteelBlue1 0.38823529411764707 0.72156862745098038 1)
+    (SteelBlue2 0.36078431372549019 0.67450980392156867 0.93333333333333335)
+    (SteelBlue3 0.30980392156862746 0.58039215686274515 0.80392156862745101)
+    (SteelBlue4 0.21176470588235294 0.39215686274509803 0.54509803921568623)
+    (DeepSkyBlue1 0 0.74901960784313726 1)
+    (DeepSkyBlue2 0 0.69803921568627447 0.93333333333333335)
+    (DeepSkyBlue3 0 0.60392156862745094 0.80392156862745101)
+    (DeepSkyBlue4 0 0.40784313725490196 0.54509803921568623)
+    (SkyBlue1 0.52941176470588236 0.80784313725490198 1)
+    (SkyBlue2 0.49411764705882355 0.75294117647058822 0.93333333333333335)
+    (SkyBlue3 0.42352941176470588 0.65098039215686276 0.80392156862745101)
+    (SkyBlue4 0.29019607843137257 0.4392156862745098 0.54509803921568623)
+    (LightSkyBlue1 0.69019607843137254 0.88627450980392153 1)
+    (LightSkyBlue2 0.64313725490196083 0.82745098039215681 0.93333333333333335)
+    (LightSkyBlue3 0.55294117647058827 0.71372549019607845 0.80392156862745101)
+    (LightSkyBlue4 0.37647058823529411 0.4823529411764706 0.54509803921568623)
+    (SlateGray1 0.77647058823529413 0.88627450980392153 1)
+    (SlateGray2 0.72549019607843135 0.82745098039215681 0.93333333333333335)
+    (SlateGray3 0.62352941176470589 0.71372549019607845 0.80392156862745101)
+    (SlateGray4 0.42352941176470588 0.4823529411764706 0.54509803921568623)
+    (LightSteelBlue1 0.792156862745098 0.88235294117647056 1)
+    (LightSteelBlue2 0.73725490196078436 0.82352941176470584 0.93333333333333335)
+    (LightSteelBlue3 0.63529411764705879 0.70980392156862748 0.80392156862745101)
+    (LightSteelBlue4 0.43137254901960786 0.4823529411764706 0.54509803921568623)
+    (LightBlue1 0.74901960784313726 0.93725490196078431 1)
+    (LightBlue2 0.69803921568627447 0.87450980392156863 0.93333333333333335)
+    (LightBlue3 0.60392156862745094 0.75294117647058822 0.80392156862745101)
+    (LightBlue4 0.40784313725490196 0.51372549019607838 0.54509803921568623)
+    (LightCyan1 0.8784313725490196 1 1)
+    (LightCyan2 0.81960784313725488 0.93333333333333335 0.93333333333333335)
+    (LightCyan3 0.70588235294117652 0.80392156862745101 0.80392156862745101)
+    (LightCyan4 0.47843137254901963 0.54509803921568623 0.54509803921568623)
+    (PaleTurquoise1 0.73333333333333328 1 1)
+    (PaleTurquoise2 0.68235294117647061 0.93333333333333335 0.93333333333333335)
+    (PaleTurquoise3 0.58823529411764708 0.80392156862745101 0.80392156862745101)
+    (PaleTurquoise4 0.40000000000000002 0.54509803921568623 0.54509803921568623)
+    (CadetBlue1 0.59607843137254901 0.96078431372549022 1)
+    (CadetBlue2 0.55686274509803924 0.89803921568627454 0.93333333333333335)
+    (CadetBlue3 0.47843137254901963 0.77254901960784317 0.80392156862745101)
+    (CadetBlue4 0.32549019607843138 0.52549019607843139 0.54509803921568623)
+    (turquoise1 0 0.96078431372549022 1)
+    (turquoise2 0 0.89803921568627454 0.93333333333333335)
+    (turquoise3 0 0.77254901960784317 0.80392156862745101)
+    (turquoise4 0 0.52549019607843139 0.54509803921568623)
+    (cyan1 0 1 1)
+    (cyan2 0 0.93333333333333335 0.93333333333333335)
+    (cyan3 0 0.80392156862745101 0.80392156862745101)
+    (cyan4 0 0.54509803921568623 0.54509803921568623)
+    (DarkSlateGray1 0.59215686274509804 1 1)
+    (DarkSlateGray2 0.55294117647058827 0.93333333333333335 0.93333333333333335)
+    (DarkSlateGray3 0.47450980392156861 0.80392156862745101 0.80392156862745101)
+    (DarkSlateGray4 0.32156862745098042 0.54509803921568623 0.54509803921568623)
+    (aquamarine1 0.49803921568627452 1 0.83137254901960789)
+    (aquamarine2 0.46274509803921571 0.93333333333333335 0.77647058823529413)
+    (aquamarine3 0.40000000000000002 0.80392156862745101 0.66666666666666663)
+    (aquamarine4 0.27058823529411763 0.54509803921568623 0.45490196078431372)
+    (DarkSeaGreen1 0.75686274509803919 1 0.75686274509803919)
+    (DarkSeaGreen2 0.70588235294117652 0.93333333333333335 0.70588235294117652)
+    (DarkSeaGreen3 0.60784313725490191 0.80392156862745101 0.60784313725490191)
+    (DarkSeaGreen4 0.41176470588235292 0.54509803921568623 0.41176470588235292)
+    (SeaGreen1 0.32941176470588235 1 0.62352941176470589)
+    (SeaGreen2 0.30588235294117649 0.93333333333333335 0.58039215686274515)
+    (SeaGreen3 0.2627450980392157 0.80392156862745101 0.50196078431372548)
+    (SeaGreen4 0.1803921568627451 0.54509803921568623 0.3411764705882353)
+    (PaleGreen1 0.60392156862745094 1 0.60392156862745094)
+    (PaleGreen2 0.56470588235294117 0.93333333333333335 0.56470588235294117)
+    (PaleGreen3 0.48627450980392156 0.80392156862745101 0.48627450980392156)
+    (PaleGreen4 0.32941176470588235 0.54509803921568623 0.32941176470588235)
+    (SpringGreen1 0 1 0.49803921568627452)
+    (SpringGreen2 0 0.93333333333333335 0.46274509803921571)
+    (SpringGreen3 0 0.80392156862745101 0.40000000000000002)
+    (SpringGreen4 0 0.54509803921568623 0.27058823529411763)
+    (green1 0 1 0)
+    (green2 0 0.93333333333333335 0)
+    (green3 0 0.80392156862745101 0)
+    (green4 0 0.54509803921568623 0)
+    (chartreuse1 0.49803921568627452 1 0)
+    (chartreuse2 0.46274509803921571 0.93333333333333335 0)
+    (chartreuse3 0.40000000000000002 0.80392156862745101 0)
+    (chartreuse4 0.27058823529411763 0.54509803921568623 0)
+    (OliveDrab1 0.75294117647058822 1 0.24313725490196078)
+    (OliveDrab2 0.70196078431372544 0.93333333333333335 0.22745098039215686)
+    (OliveDrab3 0.60392156862745094 0.80392156862745101 0.19607843137254902)
+    (OliveDrab4 0.41176470588235292 0.54509803921568623 0.13333333333333333)
+    (DarkOliveGreen1 0.792156862745098 1 0.4392156862745098)
+    (DarkOliveGreen2 0.73725490196078436 0.93333333333333335 0.40784313725490196)
+    (DarkOliveGreen3 0.63529411764705879 0.80392156862745101 0.35294117647058826)
+    (DarkOliveGreen4 0.43137254901960786 0.54509803921568623 0.23921568627450981)
+    (khaki1 1 0.96470588235294119 0.5607843137254902)
+    (khaki2 0.93333333333333335 0.90196078431372551 0.52156862745098043)
+    (khaki3 0.80392156862745101 0.77647058823529413 0.45098039215686275)
+    (khaki4 0.54509803921568623 0.52549019607843139 0.30588235294117649)
+    (LightGoldenrod1 1 0.92549019607843142 0.54509803921568623)
+    (LightGoldenrod2 0.93333333333333335 0.86274509803921573 0.50980392156862742)
+    (LightGoldenrod3 0.80392156862745101 0.74509803921568629 0.4392156862745098)
+    (LightGoldenrod4 0.54509803921568623 0.50588235294117645 0.29803921568627451)
+    (LightYellow1 1 1 0.8784313725490196)
+    (LightYellow2 0.93333333333333335 0.93333333333333335 0.81960784313725488)
+    (LightYellow3 0.80392156862745101 0.80392156862745101 0.70588235294117652)
+    (LightYellow4 0.54509803921568623 0.54509803921568623 0.47843137254901963)
+    (yellow1 1 1 0)
+    (yellow2 0.93333333333333335 0.93333333333333335 0)
+    (yellow3 0.80392156862745101 0.80392156862745101 0)
+    (yellow4 0.54509803921568623 0.54509803921568623 0)
+    (gold1 1 0.84313725490196079 0)
+    (gold2 0.93333333333333335 0.78823529411764703 0)
+    (gold3 0.80392156862745101 0.67843137254901964 0)
+    (gold4 0.54509803921568623 0.45882352941176469 0)
+    (goldenrod1 1 0.75686274509803919 0.14509803921568629)
+    (goldenrod2 0.93333333333333335 0.70588235294117652 0.13333333333333333)
+    (goldenrod3 0.80392156862745101 0.60784313725490191 0.11372549019607843)
+    (goldenrod4 0.54509803921568623 0.41176470588235292 0.078431372549019607)
+    (DarkGoldenrod1 1 0.72549019607843135 0.058823529411764705)
+    (DarkGoldenrod2 0.93333333333333335 0.67843137254901964 0.054901960784313725)
+    (DarkGoldenrod3 0.80392156862745101 0.58431372549019611 0.047058823529411764)
+    (DarkGoldenrod4 0.54509803921568623 0.396078431372549 0.031372549019607843)
+    (RosyBrown1 1 0.75686274509803919 0.75686274509803919)
+    (RosyBrown2 0.93333333333333335 0.70588235294117652 0.70588235294117652)
+    (RosyBrown3 0.80392156862745101 0.60784313725490191 0.60784313725490191)
+    (RosyBrown4 0.54509803921568623 0.41176470588235292 0.41176470588235292)
+    (IndianRed1 1 0.41568627450980394 0.41568627450980394)
+    (IndianRed2 0.93333333333333335 0.38823529411764707 0.38823529411764707)
+    (IndianRed3 0.80392156862745101 0.33333333333333331 0.33333333333333331)
+    (IndianRed4 0.54509803921568623 0.22745098039215686 0.22745098039215686)
+    (sienna1 1 0.50980392156862742 0.27843137254901962)
+    (sienna2 0.93333333333333335 0.47450980392156861 0.25882352941176473)
+    (sienna3 0.80392156862745101 0.40784313725490196 0.22352941176470589)
+    (sienna4 0.54509803921568623 0.27843137254901962 0.14901960784313725)
+    (burlywood1 1 0.82745098039215681 0.60784313725490191)
+    (burlywood2 0.93333333333333335 0.77254901960784317 0.56862745098039214)
+    (burlywood3 0.80392156862745101 0.66666666666666663 0.49019607843137253)
+    (burlywood4 0.54509803921568623 0.45098039215686275 0.33333333333333331)
+    (wheat1 1 0.90588235294117647 0.72941176470588232)
+    (wheat2 0.93333333333333335 0.84705882352941175 0.68235294117647061)
+    (wheat3 0.80392156862745101 0.72941176470588232 0.58823529411764708)
+    (wheat4 0.54509803921568623 0.49411764705882355 0.40000000000000002)
+    (tan1 1 0.6470588235294118 0.30980392156862746)
+    (tan2 0.93333333333333335 0.60392156862745094 0.28627450980392155)
+    (tan3 0.80392156862745101 0.52156862745098043 0.24705882352941178)
+    (tan4 0.54509803921568623 0.35294117647058826 0.16862745098039217)
+    (chocolate1 1 0.49803921568627452 0.14117647058823529)
+    (chocolate2 0.93333333333333335 0.46274509803921571 0.12941176470588237)
+    (chocolate3 0.80392156862745101 0.40000000000000002 0.11372549019607843)
+    (chocolate4 0.54509803921568623 0.27058823529411763 0.074509803921568626)
+    (firebrick1 1 0.18823529411764706 0.18823529411764706)
+    (firebrick2 0.93333333333333335 0.17254901960784313 0.17254901960784313)
+    (firebrick3 0.80392156862745101 0.14901960784313725 0.14901960784313725)
+    (firebrick4 0.54509803921568623 0.10196078431372549 0.10196078431372549)
+    (brown1 1 0.25098039215686274 0.25098039215686274)
+    (brown2 0.93333333333333335 0.23137254901960785 0.23137254901960785)
+    (brown3 0.80392156862745101 0.20000000000000001 0.20000000000000001)
+    (brown4 0.54509803921568623 0.13725490196078433 0.13725490196078433)
+    (salmon1 1 0.5490196078431373 0.41176470588235292)
+    (salmon2 0.93333333333333335 0.50980392156862742 0.3843137254901961)
+    (salmon3 0.80392156862745101 0.4392156862745098 0.32941176470588235)
+    (salmon4 0.54509803921568623 0.29803921568627451 0.22352941176470589)
+    (LightSalmon1 1 0.62745098039215685 0.47843137254901963)
+    (LightSalmon2 0.93333333333333335 0.58431372549019611 0.44705882352941179)
+    (LightSalmon3 0.80392156862745101 0.50588235294117645 0.3843137254901961)
+    (LightSalmon4 0.54509803921568623 0.3411764705882353 0.25882352941176473)
+    (orange1 1 0.6470588235294118 0)
+    (orange2 0.93333333333333335 0.60392156862745094 0)
+    (orange3 0.80392156862745101 0.52156862745098043 0)
+    (orange4 0.54509803921568623 0.35294117647058826 0)
+    (DarkOrange1 1 0.49803921568627452 0)
+    (DarkOrange2 0.93333333333333335 0.46274509803921571 0)
+    (DarkOrange3 0.80392156862745101 0.40000000000000002 0)
+    (DarkOrange4 0.54509803921568623 0.27058823529411763 0)
+    (coral1 1 0.44705882352941179 0.33725490196078434)
+    (coral2 0.93333333333333335 0.41568627450980394 0.31372549019607843)
+    (coral3 0.80392156862745101 0.35686274509803922 0.27058823529411763)
+    (coral4 0.54509803921568623 0.24313725490196078 0.18431372549019609)
+    (tomato1 1 0.38823529411764707 0.27843137254901962)
+    (tomato2 0.93333333333333335 0.36078431372549019 0.25882352941176473)
+    (tomato3 0.80392156862745101 0.30980392156862746 0.22352941176470589)
+    (tomato4 0.54509803921568623 0.21176470588235294 0.14901960784313725)
+    (OrangeRed1 1 0.27058823529411763 0)
+    (OrangeRed2 0.93333333333333335 0.25098039215686274 0)
+    (OrangeRed3 0.80392156862745101 0.21568627450980393 0)
+    (OrangeRed4 0.54509803921568623 0.14509803921568629 0)
+    (red1 1 0 0)
+    (red2 0.93333333333333335 0 0)
+    (red3 0.80392156862745101 0 0)
+    (red4 0.54509803921568623 0 0)
+    (DeepPink1 1 0.078431372549019607 0.57647058823529407)
+    (DeepPink2 0.93333333333333335 0.070588235294117646 0.53725490196078429)
+    (DeepPink3 0.80392156862745101 0.062745098039215685 0.46274509803921571)
+    (DeepPink4 0.54509803921568623 0.039215686274509803 0.31372549019607843)
+    (HotPink1 1 0.43137254901960786 0.70588235294117652)
+    (HotPink2 0.93333333333333335 0.41568627450980394 0.65490196078431373)
+    (HotPink3 0.80392156862745101 0.37647058823529411 0.56470588235294117)
+    (HotPink4 0.54509803921568623 0.22745098039215686 0.3843137254901961)
+    (pink1 1 0.70980392156862748 0.77254901960784317)
+    (pink2 0.93333333333333335 0.66274509803921566 0.72156862745098038)
+    (pink3 0.80392156862745101 0.56862745098039214 0.61960784313725492)
+    (pink4 0.54509803921568623 0.38823529411764707 0.42352941176470588)
+    (LightPink1 1 0.68235294117647061 0.72549019607843135)
+    (LightPink2 0.93333333333333335 0.63529411764705879 0.67843137254901964)
+    (LightPink3 0.80392156862745101 0.5490196078431373 0.58431372549019611)
+    (LightPink4 0.54509803921568623 0.37254901960784315 0.396078431372549)
+    (PaleVioletRed1 1 0.50980392156862742 0.6705882352941176)
+    (PaleVioletRed2 0.93333333333333335 0.47450980392156861 0.62352941176470589)
+    (PaleVioletRed3 0.80392156862745101 0.40784313725490196 0.53725490196078429)
+    (PaleVioletRed4 0.54509803921568623 0.27843137254901962 0.36470588235294116)
+    (maroon1 1 0.20392156862745098 0.70196078431372544)
+    (maroon2 0.93333333333333335 0.18823529411764706 0.65490196078431373)
+    (maroon3 0.80392156862745101 0.16078431372549021 0.56470588235294117)
+    (maroon4 0.54509803921568623 0.10980392156862745 0.3843137254901961)
+    (VioletRed1 1 0.24313725490196078 0.58823529411764708)
+    (VioletRed2 0.93333333333333335 0.22745098039215686 0.5490196078431373)
+    (VioletRed3 0.80392156862745101 0.19607843137254902 0.47058823529411764)
+    (VioletRed4 0.54509803921568623 0.13333333333333333 0.32156862745098042)
+    (magenta1 1 0 1)
+    (magenta2 0.93333333333333335 0 0.93333333333333335)
+    (magenta3 0.80392156862745101 0 0.80392156862745101)
+    (magenta4 0.54509803921568623 0 0.54509803921568623)
+    (orchid1 1 0.51372549019607838 0.98039215686274506)
+    (orchid2 0.93333333333333335 0.47843137254901963 0.9137254901960784)
+    (orchid3 0.80392156862745101 0.41176470588235292 0.78823529411764703)
+    (orchid4 0.54509803921568623 0.27843137254901962 0.53725490196078429)
+    (plum1 1 0.73333333333333328 1)
+    (plum2 0.93333333333333335 0.68235294117647061 0.93333333333333335)
+    (plum3 0.80392156862745101 0.58823529411764708 0.80392156862745101)
+    (plum4 0.54509803921568623 0.40000000000000002 0.54509803921568623)
+    (MediumOrchid1 0.8784313725490196 0.40000000000000002 1)
+    (MediumOrchid2 0.81960784313725488 0.37254901960784315 0.93333333333333335)
+    (MediumOrchid3 0.70588235294117652 0.32156862745098042 0.80392156862745101)
+    (MediumOrchid4 0.47843137254901963 0.21568627450980393 0.54509803921568623)
+    (DarkOrchid1 0.74901960784313726 0.24313725490196078 1)
+    (DarkOrchid2 0.69803921568627447 0.22745098039215686 0.93333333333333335)
+    (DarkOrchid3 0.60392156862745094 0.19607843137254902 0.80392156862745101)
+    (DarkOrchid4 0.40784313725490196 0.13333333333333333 0.54509803921568623)
+    (purple1 0.60784313725490191 0.18823529411764706 1)
+    (purple2 0.56862745098039214 0.17254901960784313 0.93333333333333335)
+    (purple3 0.49019607843137253 0.14901960784313725 0.80392156862745101)
+    (purple4 0.33333333333333331 0.10196078431372549 0.54509803921568623)
+    (MediumPurple1 0.6705882352941176 0.50980392156862742 1)
+    (MediumPurple2 0.62352941176470589 0.47450980392156861 0.93333333333333335)
+    (MediumPurple3 0.53725490196078429 0.40784313725490196 0.80392156862745101)
+    (MediumPurple4 0.36470588235294116 0.27843137254901962 0.54509803921568623)
+    (thistle1 1 0.88235294117647056 1)
+    (thistle2 0.93333333333333335 0.82352941176470584 0.93333333333333335)
+    (thistle3 0.80392156862745101 0.70980392156862748 0.80392156862745101)
+    (thistle4 0.54509803921568623 0.4823529411764706 0.54509803921568623)
+    (gray0 0 0 0)
+    (grey0 0 0 0)
+    (gray1 0.011764705882352941 0.011764705882352941 0.011764705882352941)
+    (grey1 0.011764705882352941 0.011764705882352941 0.011764705882352941)
+    (gray2 0.019607843137254902 0.019607843137254902 0.019607843137254902)
+    (grey2 0.019607843137254902 0.019607843137254902 0.019607843137254902)
+    (gray3 0.031372549019607843 0.031372549019607843 0.031372549019607843)
+    (grey3 0.031372549019607843 0.031372549019607843 0.031372549019607843)
+    (gray4 0.039215686274509803 0.039215686274509803 0.039215686274509803)
+    (grey4 0.039215686274509803 0.039215686274509803 0.039215686274509803)
+    (gray5 0.050980392156862744 0.050980392156862744 0.050980392156862744)
+    (grey5 0.050980392156862744 0.050980392156862744 0.050980392156862744)
+    (gray6 0.058823529411764705 0.058823529411764705 0.058823529411764705)
+    (grey6 0.058823529411764705 0.058823529411764705 0.058823529411764705)
+    (gray7 0.070588235294117646 0.070588235294117646 0.070588235294117646)
+    (grey7 0.070588235294117646 0.070588235294117646 0.070588235294117646)
+    (gray8 0.078431372549019607 0.078431372549019607 0.078431372549019607)
+    (grey8 0.078431372549019607 0.078431372549019607 0.078431372549019607)
+    (gray9 0.090196078431372548 0.090196078431372548 0.090196078431372548)
+    (grey9 0.090196078431372548 0.090196078431372548 0.090196078431372548)
+    (gray10 0.10196078431372549 0.10196078431372549 0.10196078431372549)
+    (grey10 0.10196078431372549 0.10196078431372549 0.10196078431372549)
+    (gray11 0.10980392156862745 0.10980392156862745 0.10980392156862745)
+    (grey11 0.10980392156862745 0.10980392156862745 0.10980392156862745)
+    (gray12 0.12156862745098039 0.12156862745098039 0.12156862745098039)
+    (grey12 0.12156862745098039 0.12156862745098039 0.12156862745098039)
+    (gray13 0.12941176470588237 0.12941176470588237 0.12941176470588237)
+    (grey13 0.12941176470588237 0.12941176470588237 0.12941176470588237)
+    (gray14 0.14117647058823529 0.14117647058823529 0.14117647058823529)
+    (grey14 0.14117647058823529 0.14117647058823529 0.14117647058823529)
+    (gray15 0.14901960784313725 0.14901960784313725 0.14901960784313725)
+    (grey15 0.14901960784313725 0.14901960784313725 0.14901960784313725)
+    (gray16 0.16078431372549021 0.16078431372549021 0.16078431372549021)
+    (grey16 0.16078431372549021 0.16078431372549021 0.16078431372549021)
+    (gray17 0.16862745098039217 0.16862745098039217 0.16862745098039217)
+    (grey17 0.16862745098039217 0.16862745098039217 0.16862745098039217)
+    (gray18 0.1803921568627451 0.1803921568627451 0.1803921568627451)
+    (grey18 0.1803921568627451 0.1803921568627451 0.1803921568627451)
+    (gray19 0.18823529411764706 0.18823529411764706 0.18823529411764706)
+    (grey19 0.18823529411764706 0.18823529411764706 0.18823529411764706)
+    (gray20 0.20000000000000001 0.20000000000000001 0.20000000000000001)
+    (grey20 0.20000000000000001 0.20000000000000001 0.20000000000000001)
+    (gray21 0.21176470588235294 0.21176470588235294 0.21176470588235294)
+    (grey21 0.21176470588235294 0.21176470588235294 0.21176470588235294)
+    (gray22 0.2196078431372549 0.2196078431372549 0.2196078431372549)
+    (grey22 0.2196078431372549 0.2196078431372549 0.2196078431372549)
+    (gray23 0.23137254901960785 0.23137254901960785 0.23137254901960785)
+    (grey23 0.23137254901960785 0.23137254901960785 0.23137254901960785)
+    (gray24 0.23921568627450981 0.23921568627450981 0.23921568627450981)
+    (grey24 0.23921568627450981 0.23921568627450981 0.23921568627450981)
+    (gray25 0.25098039215686274 0.25098039215686274 0.25098039215686274)
+    (grey25 0.25098039215686274 0.25098039215686274 0.25098039215686274)
+    (gray26 0.25882352941176473 0.25882352941176473 0.25882352941176473)
+    (grey26 0.25882352941176473 0.25882352941176473 0.25882352941176473)
+    (gray27 0.27058823529411763 0.27058823529411763 0.27058823529411763)
+    (grey27 0.27058823529411763 0.27058823529411763 0.27058823529411763)
+    (gray28 0.27843137254901962 0.27843137254901962 0.27843137254901962)
+    (grey28 0.27843137254901962 0.27843137254901962 0.27843137254901962)
+    (gray29 0.29019607843137257 0.29019607843137257 0.29019607843137257)
+    (grey29 0.29019607843137257 0.29019607843137257 0.29019607843137257)
+    (gray30 0.30196078431372547 0.30196078431372547 0.30196078431372547)
+    (grey30 0.30196078431372547 0.30196078431372547 0.30196078431372547)
+    (gray31 0.30980392156862746 0.30980392156862746 0.30980392156862746)
+    (grey31 0.30980392156862746 0.30980392156862746 0.30980392156862746)
+    (gray32 0.32156862745098042 0.32156862745098042 0.32156862745098042)
+    (grey32 0.32156862745098042 0.32156862745098042 0.32156862745098042)
+    (gray33 0.32941176470588235 0.32941176470588235 0.32941176470588235)
+    (grey33 0.32941176470588235 0.32941176470588235 0.32941176470588235)
+    (gray34 0.3411764705882353 0.3411764705882353 0.3411764705882353)
+    (grey34 0.3411764705882353 0.3411764705882353 0.3411764705882353)
+    (gray35 0.34901960784313724 0.34901960784313724 0.34901960784313724)
+    (grey35 0.34901960784313724 0.34901960784313724 0.34901960784313724)
+    (gray36 0.36078431372549019 0.36078431372549019 0.36078431372549019)
+    (grey36 0.36078431372549019 0.36078431372549019 0.36078431372549019)
+    (gray37 0.36862745098039218 0.36862745098039218 0.36862745098039218)
+    (grey37 0.36862745098039218 0.36862745098039218 0.36862745098039218)
+    (gray38 0.38039215686274508 0.38039215686274508 0.38039215686274508)
+    (grey38 0.38039215686274508 0.38039215686274508 0.38039215686274508)
+    (gray39 0.38823529411764707 0.38823529411764707 0.38823529411764707)
+    (grey39 0.38823529411764707 0.38823529411764707 0.38823529411764707)
+    (gray40 0.40000000000000002 0.40000000000000002 0.40000000000000002)
+    (grey40 0.40000000000000002 0.40000000000000002 0.40000000000000002)
+    (gray41 0.41176470588235292 0.41176470588235292 0.41176470588235292)
+    (grey41 0.41176470588235292 0.41176470588235292 0.41176470588235292)
+    (gray42 0.41960784313725491 0.41960784313725491 0.41960784313725491)
+    (grey42 0.41960784313725491 0.41960784313725491 0.41960784313725491)
+    (gray43 0.43137254901960786 0.43137254901960786 0.43137254901960786)
+    (grey43 0.43137254901960786 0.43137254901960786 0.43137254901960786)
+    (gray44 0.4392156862745098 0.4392156862745098 0.4392156862745098)
+    (grey44 0.4392156862745098 0.4392156862745098 0.4392156862745098)
+    (gray45 0.45098039215686275 0.45098039215686275 0.45098039215686275)
+    (grey45 0.45098039215686275 0.45098039215686275 0.45098039215686275)
+    (gray46 0.45882352941176469 0.45882352941176469 0.45882352941176469)
+    (grey46 0.45882352941176469 0.45882352941176469 0.45882352941176469)
+    (gray47 0.47058823529411764 0.47058823529411764 0.47058823529411764)
+    (grey47 0.47058823529411764 0.47058823529411764 0.47058823529411764)
+    (gray48 0.47843137254901963 0.47843137254901963 0.47843137254901963)
+    (grey48 0.47843137254901963 0.47843137254901963 0.47843137254901963)
+    (gray49 0.49019607843137253 0.49019607843137253 0.49019607843137253)
+    (grey49 0.49019607843137253 0.49019607843137253 0.49019607843137253)
+    (gray50 0.49803921568627452 0.49803921568627452 0.49803921568627452)
+    (grey50 0.49803921568627452 0.49803921568627452 0.49803921568627452)
+    (gray51 0.50980392156862742 0.50980392156862742 0.50980392156862742)
+    (grey51 0.50980392156862742 0.50980392156862742 0.50980392156862742)
+    (gray52 0.52156862745098043 0.52156862745098043 0.52156862745098043)
+    (grey52 0.52156862745098043 0.52156862745098043 0.52156862745098043)
+    (gray53 0.52941176470588236 0.52941176470588236 0.52941176470588236)
+    (grey53 0.52941176470588236 0.52941176470588236 0.52941176470588236)
+    (gray54 0.54117647058823526 0.54117647058823526 0.54117647058823526)
+    (grey54 0.54117647058823526 0.54117647058823526 0.54117647058823526)
+    (gray55 0.5490196078431373 0.5490196078431373 0.5490196078431373)
+    (grey55 0.5490196078431373 0.5490196078431373 0.5490196078431373)
+    (gray56 0.5607843137254902 0.5607843137254902 0.5607843137254902)
+    (grey56 0.5607843137254902 0.5607843137254902 0.5607843137254902)
+    (gray57 0.56862745098039214 0.56862745098039214 0.56862745098039214)
+    (grey57 0.56862745098039214 0.56862745098039214 0.56862745098039214)
+    (gray58 0.58039215686274515 0.58039215686274515 0.58039215686274515)
+    (grey58 0.58039215686274515 0.58039215686274515 0.58039215686274515)
+    (gray59 0.58823529411764708 0.58823529411764708 0.58823529411764708)
+    (grey59 0.58823529411764708 0.58823529411764708 0.58823529411764708)
+    (gray60 0.59999999999999998 0.59999999999999998 0.59999999999999998)
+    (grey60 0.59999999999999998 0.59999999999999998 0.59999999999999998)
+    (gray61 0.61176470588235299 0.61176470588235299 0.61176470588235299)
+    (grey61 0.61176470588235299 0.61176470588235299 0.61176470588235299)
+    (gray62 0.61960784313725492 0.61960784313725492 0.61960784313725492)
+    (grey62 0.61960784313725492 0.61960784313725492 0.61960784313725492)
+    (gray63 0.63137254901960782 0.63137254901960782 0.63137254901960782)
+    (grey63 0.63137254901960782 0.63137254901960782 0.63137254901960782)
+    (gray64 0.63921568627450975 0.63921568627450975 0.63921568627450975)
+    (grey64 0.63921568627450975 0.63921568627450975 0.63921568627450975)
+    (gray65 0.65098039215686276 0.65098039215686276 0.65098039215686276)
+    (grey65 0.65098039215686276 0.65098039215686276 0.65098039215686276)
+    (gray66 0.6588235294117647 0.6588235294117647 0.6588235294117647)
+    (grey66 0.6588235294117647 0.6588235294117647 0.6588235294117647)
+    (gray67 0.6705882352941176 0.6705882352941176 0.6705882352941176)
+    (grey67 0.6705882352941176 0.6705882352941176 0.6705882352941176)
+    (gray68 0.67843137254901964 0.67843137254901964 0.67843137254901964)
+    (grey68 0.67843137254901964 0.67843137254901964 0.67843137254901964)
+    (gray69 0.69019607843137254 0.69019607843137254 0.69019607843137254)
+    (grey69 0.69019607843137254 0.69019607843137254 0.69019607843137254)
+    (gray70 0.70196078431372544 0.70196078431372544 0.70196078431372544)
+    (grey70 0.70196078431372544 0.70196078431372544 0.70196078431372544)
+    (gray71 0.70980392156862748 0.70980392156862748 0.70980392156862748)
+    (grey71 0.70980392156862748 0.70980392156862748 0.70980392156862748)
+    (gray72 0.72156862745098038 0.72156862745098038 0.72156862745098038)
+    (grey72 0.72156862745098038 0.72156862745098038 0.72156862745098038)
+    (gray73 0.72941176470588232 0.72941176470588232 0.72941176470588232)
+    (grey73 0.72941176470588232 0.72941176470588232 0.72941176470588232)
+    (gray74 0.74117647058823533 0.74117647058823533 0.74117647058823533)
+    (grey74 0.74117647058823533 0.74117647058823533 0.74117647058823533)
+    (gray75 0.74901960784313726 0.74901960784313726 0.74901960784313726)
+    (grey75 0.74901960784313726 0.74901960784313726 0.74901960784313726)
+    (gray76 0.76078431372549016 0.76078431372549016 0.76078431372549016)
+    (grey76 0.76078431372549016 0.76078431372549016 0.76078431372549016)
+    (gray77 0.7686274509803922 0.7686274509803922 0.7686274509803922)
+    (grey77 0.7686274509803922 0.7686274509803922 0.7686274509803922)
+    (gray78 0.7803921568627451 0.7803921568627451 0.7803921568627451)
+    (grey78 0.7803921568627451 0.7803921568627451 0.7803921568627451)
+    (gray79 0.78823529411764703 0.78823529411764703 0.78823529411764703)
+    (grey79 0.78823529411764703 0.78823529411764703 0.78823529411764703)
+    (gray80 0.80000000000000004 0.80000000000000004 0.80000000000000004)
+    (grey80 0.80000000000000004 0.80000000000000004 0.80000000000000004)
+    (gray81 0.81176470588235294 0.81176470588235294 0.81176470588235294)
+    (grey81 0.81176470588235294 0.81176470588235294 0.81176470588235294)
+    (gray82 0.81960784313725488 0.81960784313725488 0.81960784313725488)
+    (grey82 0.81960784313725488 0.81960784313725488 0.81960784313725488)
+    (gray83 0.83137254901960789 0.83137254901960789 0.83137254901960789)
+    (grey83 0.83137254901960789 0.83137254901960789 0.83137254901960789)
+    (gray84 0.83921568627450982 0.83921568627450982 0.83921568627450982)
+    (grey84 0.83921568627450982 0.83921568627450982 0.83921568627450982)
+    (gray85 0.85098039215686272 0.85098039215686272 0.85098039215686272)
+    (grey85 0.85098039215686272 0.85098039215686272 0.85098039215686272)
+    (gray86 0.85882352941176465 0.85882352941176465 0.85882352941176465)
+    (grey86 0.85882352941176465 0.85882352941176465 0.85882352941176465)
+    (gray87 0.87058823529411766 0.87058823529411766 0.87058823529411766)
+    (grey87 0.87058823529411766 0.87058823529411766 0.87058823529411766)
+    (gray88 0.8784313725490196 0.8784313725490196 0.8784313725490196)
+    (grey88 0.8784313725490196 0.8784313725490196 0.8784313725490196)
+    (gray89 0.8901960784313725 0.8901960784313725 0.8901960784313725)
+    (grey89 0.8901960784313725 0.8901960784313725 0.8901960784313725)
+    (gray90 0.89803921568627454 0.89803921568627454 0.89803921568627454)
+    (grey90 0.89803921568627454 0.89803921568627454 0.89803921568627454)
+    (gray91 0.90980392156862744 0.90980392156862744 0.90980392156862744)
+    (grey91 0.90980392156862744 0.90980392156862744 0.90980392156862744)
+    (gray92 0.92156862745098034 0.92156862745098034 0.92156862745098034)
+    (grey92 0.92156862745098034 0.92156862745098034 0.92156862745098034)
+    (gray93 0.92941176470588238 0.92941176470588238 0.92941176470588238)
+    (grey93 0.92941176470588238 0.92941176470588238 0.92941176470588238)
+    (gray94 0.94117647058823528 0.94117647058823528 0.94117647058823528)
+    (grey94 0.94117647058823528 0.94117647058823528 0.94117647058823528)
+    (gray95 0.94901960784313721 0.94901960784313721 0.94901960784313721)
+    (grey95 0.94901960784313721 0.94901960784313721 0.94901960784313721)
+    (gray96 0.96078431372549022 0.96078431372549022 0.96078431372549022)
+    (grey96 0.96078431372549022 0.96078431372549022 0.96078431372549022)
+    (gray97 0.96862745098039216 0.96862745098039216 0.96862745098039216)
+    (grey97 0.96862745098039216 0.96862745098039216 0.96862745098039216)
+    (gray98 0.98039215686274506 0.98039215686274506 0.98039215686274506)
+    (grey98 0.98039215686274506 0.98039215686274506 0.98039215686274506)
+    (gray99 0.9882352941176471 0.9882352941176471 0.9882352941176471)
+    (grey99 0.9882352941176471 0.9882352941176471 0.9882352941176471)
+    (gray100 1 1 1)
+    (grey100 1 1 1)
+    (DarkGrey 0.66274509803921566 0.66274509803921566 0.66274509803921566)
+    (DarkGray 0.66274509803921566 0.66274509803921566 0.66274509803921566)
+    (DarkBlue 0 0 0.54509803921568623)
+    (DarkCyan 0 0.54509803921568623 0.54509803921568623)
+    (DarkMagenta 0.54509803921568623 0 0.54509803921568623)
+    (DarkRed 0.54509803921568623 0 0)
+    (LightGreen 0.56470588235294117 0.93333333333333335 0.56470588235294117)))
 
+(define (make-x11-color-handler)
+  (let
+      ((x11-color-table (make-hash-table 31)))
     
     (lambda (arg)
       (let* 
index ce7b006479d511ef940cc11aede77faa3465c27b..2a683a89751f9ba6ab786c752098519d7161e0b6 100644 (file)
@@ -6,6 +6,9 @@ STEPMAKE_TEMPLATES=script help2man po
 LOCALSTEPMAKE_TEMPLATES = lilypond
 HELP2MAN_EXECS = $(SEXECUTABLES)
 
+AT_FILES=relocate-preamble
+at-ext=.py.in
+at-dir=$(depth)/python
+
 include $(depth)/make/stepmake.make
 include $(stepdir)/executable-targets.make
-
index 83dc1f79ae4d135b12b6c8b1d19a5be0a72d4ecd..570846c4ac40bbda4ebee33a5874be19eb82e974 100644 (file)
@@ -78,16 +78,9 @@ import os
 program_name = sys.argv[0]
 
 
-for d in ['@lilypond_datadir@',
-          '@lilypond_libdir@']:
-    sys.path.insert (0, os.path.join (d, 'python'))
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
-
+"""
+@relocate-preamble@
+"""
 
 import lilylib as ly
 global _;_=ly._
index 474144c3ce081d16b3f45f67e1a0aa0a52d53ff3..cf67f9f2400d0fbdb42ecf2d08299c5f283648fd 100644 (file)
@@ -15,18 +15,9 @@ import sys
 import string
 import re
 
-
-datadir = '@local_lilypond_datadir@'
-if not os.path.isdir (datadir):
-    datadir = '@lilypond_datadir@'
-
-sys.path.insert (0, os.path.join (datadir, 'python'))
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
+"""
+@relocate-preamble@
+"""
 
 import lilylib as ly
 global _;_=ly._
index 126288f6766723928689a2bd15b14dca78ca467f..f87778d9d4fc61c93fca965328ee60cdf3b5fd45 100644 (file)
@@ -39,25 +39,9 @@ version = '@TOPLEVEL_VERSION@'
 if version == '@' + 'TOPLEVEL_VERSION' + '@':
     version = '(unknown version)'           # uGUHGUHGHGUGH
 
-
-################################################################
-# Users of python modules should include this snippet.
-#
-
-
-
-
-for d in ['@lilypond_datadir@',
-          '@lilypond_libdir@']:
-    sys.path.insert (0, os.path.join (d, 'python'))
-
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
-
+"""
+@relocate-preamble@
+"""
 
 ################################################################
 
index dd495fc7509e213d10fbe49c3153aefc5e4e9489..09eefff340c2322be5dd50b53770ad8661d2d5cb 100644 (file)
@@ -37,23 +37,9 @@ import sys
 import re
 import md5
 
-################
-# RELOCATION
-################
-
-
-for d in ['@lilypond_datadir@',
-          '@lilypond_libdir@']:
-    sys.path.insert (0, os.path.join (d, 'python'))
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-
-os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
-
+"""
+@relocate-preamble@
+"""
 
 import lilylib as ly
 import fontextract
index f1db678cfb3990a50cda7e70925bcdb65e9d1fcb..35b10f39874a9dd3f5d561c07d92928d9b02e87d 100644 (file)
@@ -25,26 +25,15 @@ import os
 import string
 import sys
 
-################################################################
-# Users of python modules should include this snippet.
-#
-
-for d in ['@lilypond_datadir@',
-          '@lilypond_libdir@']:
-    sys.path.insert (0, os.path.join (d, 'python'))
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
-
+"""
+@relocate-preamble@
+"""
 
 import midi
 import lilylib as ly
 
 ################################################################
-################ CONSTANTS
+## CONSTANTS
 
 
 output_name = ''
index 665cc1d02fcab5623e45e14784d77f44c4fad17b..c29daed136ca268bd0ff01c85504943b0a3be894 100644 (file)
@@ -7,20 +7,9 @@ import os
 import string
 from gettext import gettext as _
 
-
-
-for d in ['@lilypond_datadir@',
-          '@lilypond_libdir@']:
-    sys.path.insert (0, os.path.join (d, 'python'))
-
-# dynamic relocation, for GUB binaries.
-bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
-for p in ['share', 'lib']:
-    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, datadir)
-
-
-
+"""
+@relocate-preamble@
+"""
 
 import lilylib as ly
 
@@ -592,7 +581,7 @@ def print_score_setup (printer, part_list, voices):
 
 def print_ly_preamble (printer, filename):
     printer.dump_version ()
-    printer.print_verbatim ('%% converted from %s\n' % filename)
+    printer.print_verbatim ('%% automatically converted from %s\n' % filename)
 
 def read_musicxml (filename, use_lxml):
     if use_lxml:
index 511bd87afd9e171118b73764c8ffc0c23228b090..cb3ef487d8984f4ca7df3c90c0394828d5b865db 100644 (file)
@@ -9,5 +9,6 @@ $(outdir)/%.pyo: $(outdir)/%.py
        $(PYTHON) -O -c 'import py_compile; py_compile.compile ("$<")'
 
 $(outdir)/%.py: %.py $(config_make)
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles) $(sed-atvariables) > $@
        chmod 755 $@
+
index 02e99909ac114480cb848fbf7628c9e13ea33eb0..bf6589e15c3c1796d85f4141b858ee6867f7e0a6 100644 (file)
@@ -1,25 +1,25 @@
 
 $(outdir)/%: %.pl $(config_make)  $(depth)/VERSION
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles) $(sed-atvariables) > $@
        chmod 755 $@
 
 $(outdir)/%: %.bash $(config_make) $(depth)/VERSION
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles) $(sed-atvariables) > $@
        chmod 755 $@
 
 $(outdir)/%: %.scm $(config_make) $(depth)/VERSION
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles) $(sed-atvariables) > $@
        chmod 755 $@
 
 $(outdir)/%: %.expect $(config_make) $(depth)/VERSION
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles) $(sed-atvariables) > $@
        chmod 755 $@
 
 $(outdir)/%: %.sh $(config_make) $(depth)/VERSION
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles)$(sed-atvariables) > $@
        chmod 755 $@
 
 $(outdir)/%: %.py $(config_make) $(depth)/VERSION
-       cat $< | sed $(sed-atvariables) > $@
+       cat $< | sed $(sed-atfiles) $(sed-atvariables) > $@
        chmod 755 $@
 
index eb45a465fc9b3ea1fe52ab34dc4599d61bfb4bf8..8d7fd6295bd8264c2de8854a43355beda0c29c56 100644 (file)
@@ -10,9 +10,10 @@ DATE = $(date)
 # for all FILE in AT_FILES:
 # substitute occurrences of @FILE@ with contents $(at-dir)BLA$(at-ext)
 sed-atfiles = -e '\#' $(foreach i, $(AT_FILES), \
-  -e '/@$i@/r $(at-dir)$i$(at-ext)' -e 's%@$i@%%g')
+  -e '/@$i@/r $(at-dir)/$i$(at-ext)' -e 's%@$i@%%g')
 
 # for all VAR in ATVARIABLES
 # substitute occurrences of @VAR@ with $(VAR)
 sed-atvariables = -e '\#' $(foreach i, $(ATVARIABLES), -e 's!@$i@!$($i)!g')
 
+