]> git.donarmstrong.com Git - lilypond.git/commitdiff
* flower
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 10 Mar 2005 14:36:16 +0000 (14:36 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 10 Mar 2005 14:36:16 +0000 (14:36 +0000)
* lily
* kpath-guile: Nitpick run: buildscripts/fixcc.py.

590 files changed:
ChangeLog
flower/cpu-timer.cc
flower/direction.cc
flower/file-name.cc
flower/file-path.cc
flower/getopt-long.cc
flower/include/arithmetic-operator.hh
flower/include/array.hh
flower/include/array.icc
flower/include/axes.hh
flower/include/compare.hh
flower/include/cons.hh
flower/include/cpu-timer.hh
flower/include/direction.hh
flower/include/drul-array.hh
flower/include/file-name.hh
flower/include/file-path.hh
flower/include/file-storage.hh
flower/include/flower-proto.hh
flower/include/getopt-long.hh
flower/include/guile-compatibility.hh
flower/include/international.hh
flower/include/interval-set.hh
flower/include/interval.hh
flower/include/interval.tcc
flower/include/killing-cons.tcc
flower/include/libc-extension.hh
flower/include/memory-stream.hh
flower/include/offset.hh
flower/include/parray.hh
flower/include/parse-afm.hh
flower/include/polynomial.hh
flower/include/pqueue.hh
flower/include/rational.hh
flower/include/real.hh
flower/include/string-convert.hh
flower/include/string-data.hh
flower/include/string-data.icc
flower/include/string-handle.hh
flower/include/string-handle.icc
flower/include/string.hh
flower/include/string.icc
flower/include/virtual-methods.hh
flower/international.cc
flower/interval-set.cc
flower/interval.cc
flower/libc-extension.cc
flower/memory-stream.cc
flower/offset.cc
flower/parse-afm.cc
flower/polynomial.cc
flower/rational.cc
flower/string-convert.cc
flower/string.cc
flower/stringutil.cc
lily/accidental-engraver.cc
lily/accidental-placement.cc
lily/accidental.cc
lily/afm.cc
lily/align-interface.cc
lily/all-font-metrics.cc
lily/ambitus-engraver.cc
lily/ambitus.cc
lily/apply-context-iterator.cc
lily/arpeggio-engraver.cc
lily/arpeggio.cc
lily/audio-column.cc
lily/audio-element-info.cc
lily/audio-element.cc
lily/audio-item.cc
lily/audio-staff.cc
lily/auto-beam-engraver.cc
lily/auto-change-iterator.cc
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/balloon.cc
lily/bar-check-iterator.cc
lily/bar-engraver.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/beam-concave.cc
lily/beam-engraver.cc
lily/beam-performer.cc
lily/beam-quanting.cc
lily/beam.cc
lily/beaming-info.cc
lily/bezier-bow.cc
lily/bezier.cc
lily/binary-source-file.cc
lily/book-scheme.cc
lily/book.cc
lily/box.cc
lily/break-algorithm.cc
lily/break-align-engraver.cc
lily/break-align-interface.cc
lily/break-substitution.cc
lily/breathing-sign-engraver.cc
lily/breathing-sign.cc
lily/change-iterator.cc
lily/chord-name-engraver.cc
lily/chord-name.cc
lily/chord-tremolo-engraver.cc
lily/chord-tremolo-iterator.cc
lily/clef-engraver.cc
lily/clef.cc
lily/cluster-engraver.cc
lily/cluster.cc
lily/coherent-ligature-engraver.cc
lily/collision-engraver.cc
lily/completion-note-heads-engraver.cc
lily/context-def.cc
lily/context-handle.cc
lily/context-property.cc
lily/context-scheme.cc
lily/context-specced-music-iterator.cc
lily/context.cc
lily/custos-engraver.cc
lily/custos.cc
lily/dimension-cache.cc
lily/dimensions.cc
lily/directional-element-interface.cc
lily/dot-column-engraver.cc
lily/dot-column.cc
lily/dots.cc
lily/drum-note-engraver.cc
lily/drum-note-performer.cc
lily/duration-scheme.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/dynamic-text-spanner.cc
lily/engraver-group-engraver.cc
lily/engraver.cc
lily/event-chord-iterator.cc
lily/event.cc
lily/extender-engraver.cc
lily/figured-bass-engraver.cc
lily/fingering-engraver.cc
lily/folded-repeat-iterator.cc
lily/font-config.cc
lily/font-interface.cc
lily/font-metric-scheme.cc
lily/font-metric.cc
lily/font-select.cc
lily/font-size-engraver.cc
lily/forbid-break-engraver.cc
lily/freetype.cc
lily/function-documentation.cc
lily/gdb.cc
lily/general-scheme.cc
lily/glissando-engraver.cc
lily/global-context-scheme.cc
lily/global-context.cc
lily/global-ctor.cc
lily/gourlay-breaking.cc
lily/grace-engraver.cc
lily/grace-iterator.cc
lily/grace-music.cc
lily/gregorian-ligature-engraver.cc
lily/gregorian-ligature.cc
lily/grob-info.cc
lily/grob-interface-scheme.cc
lily/grob-interface.cc
lily/grob-pitch-tuple.cc
lily/grob-pq-engraver.cc
lily/grob-property.cc
lily/grob-scheme.cc
lily/grob.cc
lily/group-interface.cc
lily/hairpin.cc
lily/hara-kiri-group-spanner.cc
lily/horizontal-bracket-engraver.cc
lily/horizontal-bracket.cc
lily/hyphen-engraver.cc
lily/identifier-smob.cc
lily/includable-lexer.cc
lily/include/accidental-interface.hh
lily/include/accidental-placement.hh
lily/include/afm.hh
lily/include/align-interface.hh
lily/include/all-font-metrics.hh
lily/include/ambitus.hh
lily/include/arpeggio.hh
lily/include/audio-column.hh
lily/include/audio-element-info.hh
lily/include/audio-element.hh
lily/include/audio-item.hh
lily/include/audio-staff.hh
lily/include/axis-group-interface.hh
lily/include/bar-line.hh
lily/include/bar.hh
lily/include/beam.hh
lily/include/beaming.hh
lily/include/bezier.hh
lily/include/binary-source-file.hh
lily/include/book.hh
lily/include/box.hh
lily/include/break-algorithm.hh
lily/include/break-align-interface.hh
lily/include/breathing-sign.hh
lily/include/change-iterator.hh
lily/include/chord-name.hh
lily/include/chord-tremolo-iterator.hh
lily/include/clef.hh
lily/include/cluster.hh
lily/include/coherent-ligature-engraver.hh
lily/include/column-x-positions.hh
lily/include/context-def.hh
lily/include/context.hh
lily/include/custos.hh
lily/include/dimension-cache-callback.hh
lily/include/dimension-cache.hh
lily/include/dimensions.hh
lily/include/directional-element-interface.hh
lily/include/dot-column.hh
lily/include/dots.hh
lily/include/duration.hh
lily/include/engraver-group-engraver.hh
lily/include/engraver.hh
lily/include/event-chord-iterator.hh
lily/include/event.hh
lily/include/folded-repeat-iterator.hh
lily/include/font-interface.hh
lily/include/font-metric.hh
lily/include/freetype.hh
lily/include/global-context.hh
lily/include/global-ctor.hh
lily/include/gourlay-breaking.hh
lily/include/grace-fixup.hh
lily/include/grace-iterator.hh
lily/include/gregorian-ligature-engraver.hh
lily/include/gregorian-ligature.hh
lily/include/grob-info.hh
lily/include/grob-interface.hh
lily/include/grob-pitch-tuple.hh
lily/include/grob.hh
lily/include/group-interface.hh
lily/include/hairpin.hh
lily/include/hara-kiri-group-spanner.hh
lily/include/identifier-smob.hh
lily/include/includable-lexer.hh
lily/include/input-smob.hh
lily/include/input.hh
lily/include/interpretation-context-handle.hh
lily/include/item.hh
lily/include/keyword.hh
lily/include/kpath.hh
lily/include/least-squares.hh
lily/include/ligature-engraver.hh
lily/include/lily-guile-macros.hh
lily/include/lily-guile.hh
lily/include/lily-lexer.hh
lily/include/lily-parser.hh
lily/include/lily-proto.hh
lily/include/lily-version.hh
lily/include/lilypond-input-version.hh
lily/include/lilypond-key.hh
lily/include/line-group-group-engraver.hh
lily/include/line-interface.hh
lily/include/line-spanner.hh
lily/include/lookup.hh
lily/include/ly-module.hh
lily/include/ly-smobs.icc
lily/include/lyric-extender.hh
lily/include/lyric-hyphen.hh
lily/include/main.hh
lily/include/measure-grouping-spanner.hh
lily/include/mensural-ligature.hh
lily/include/midi-item.hh
lily/include/midi-stream.hh
lily/include/midi-walker.hh
lily/include/minterval.hh
lily/include/misc.hh
lily/include/modified-font-metric.hh
lily/include/moment.hh
lily/include/multi-measure-rest.hh
lily/include/music-constructor.hh
lily/include/music-function.hh
lily/include/music-iterator.hh
lily/include/music-output.hh
lily/include/music-sequence.hh
lily/include/music-wrapper-iterator.hh
lily/include/music-wrapper.hh
lily/include/music.hh
lily/include/note-collision.hh
lily/include/note-column.hh
lily/include/note-head.hh
lily/include/note-spacing.hh
lily/include/object-key-dumper.hh
lily/include/object-key-undumper.hh
lily/include/object-key.hh
lily/include/open-type-font.hh
lily/include/pango-font.hh
lily/include/paper-book.hh
lily/include/paper-column.hh
lily/include/paper-outputter.hh
lily/include/paper-score.hh
lily/include/paper-system.hh
lily/include/parse-scm.hh
lily/include/percent-repeat-item.hh
lily/include/percent-repeat-iterator.hh
lily/include/performance.hh
lily/include/performer-group-performer.hh
lily/include/performer.hh
lily/include/pitch-interval.hh
lily/include/pitch.hh
lily/include/property-iterator.hh
lily/include/protected-scm.hh
lily/include/repeated-music.hh
lily/include/rest-collision.hh
lily/include/rest.hh
lily/include/rhythmic-head.hh
lily/include/rod.hh
lily/include/scm-hash.hh
lily/include/score-context.hh
lily/include/score-engraver.hh
lily/include/score-performer.hh
lily/include/score-translator.hh
lily/include/score.hh
lily/include/script-column.hh
lily/include/script-interface.hh
lily/include/self-alignment-interface.hh
lily/include/separating-group-spanner.hh
lily/include/separation-item.hh
lily/include/sequential-iterator.hh
lily/include/sequential-music-iterator.hh
lily/include/side-position-interface.hh
lily/include/simple-music-iterator.hh
lily/include/simple-spacer.hh
lily/include/simultaneous-music-iterator.hh
lily/include/skyline.hh
lily/include/slur-configuration.hh
lily/include/slur-scoring.hh
lily/include/slur.hh
lily/include/smobs.hh
lily/include/source-file.hh
lily/include/source.hh
lily/include/spaceable-grob.hh
lily/include/spacing-interface.hh
lily/include/span-bar.hh
lily/include/spanner.hh
lily/include/spring.hh
lily/include/staff-spacing.hh
lily/include/staff-symbol-referencer.hh
lily/include/staff-symbol.hh
lily/include/stem-info.hh
lily/include/stem-tremolo.hh
lily/include/stem.hh
lily/include/stencil.hh
lily/include/stream.hh
lily/include/swallow-perf.hh
lily/include/system-start-delimiter.hh
lily/include/system.hh
lily/include/text-item.hh
lily/include/text-metrics.hh
lily/include/text-spanner.hh
lily/include/tfm-reader.hh
lily/include/tfm.hh
lily/include/tie-column.hh
lily/include/tie.hh
lily/include/time-scaled-music-iterator.hh
lily/include/time-signature.hh
lily/include/timing-translator.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/include/tuplet-bracket.hh
lily/include/tweak-registration.hh
lily/include/type-swallow-translator.hh
lily/include/vaticana-ligature.hh
lily/include/volta-bracket.hh
lily/input-scheme.cc
lily/input-smob.cc
lily/input.cc
lily/instrument-name-engraver.cc
lily/item.cc
lily/key-engraver.cc
lily/key-performer.cc
lily/key-signature-interface.cc
lily/keyword.cc
lily/least-squares.cc
lily/ledger-line-engraver.cc
lily/ledger-line-spanner.cc
lily/ligature-bracket-engraver.cc
lily/ligature-engraver.cc
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser-scheme.cc
lily/lily-parser.cc
lily/lily-version.cc
lily/lilypond-key.cc
lily/lilypond-version.cc
lily/line-interface.cc
lily/line-spanner.cc
lily/lookup.cc
lily/ly-module.cc
lily/lyric-combine-music-iterator.cc
lily/lyric-combine-music.cc
lily/lyric-engraver.cc
lily/lyric-extender.cc
lily/lyric-hyphen.cc
lily/lyric-performer.cc
lily/main.cc
lily/mark-engraver.cc
lily/measure-grouping-engraver.cc
lily/measure-grouping-spanner.cc
lily/melisma-translator.cc
lily/mensural-ligature-engraver.cc
lily/mensural-ligature.cc
lily/metronome-engraver.cc
lily/midi-def.cc
lily/midi-item.cc
lily/midi-stream.cc
lily/midi-walker.cc
lily/misc.cc
lily/modified-font-metric.cc
lily/moment-scheme.cc
lily/moment.cc
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/music-constructor.cc
lily/music-function.cc
lily/music-iterator.cc
lily/music-scheme.cc
lily/music-sequence.cc
lily/music-wrapper-iterator.cc
lily/music-wrapper.cc
lily/music.cc
lily/new-fingering-engraver.cc
lily/new-lyric-combine-music-iterator.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-head-line-engraver.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/note-name-engraver.cc
lily/note-performer.cc
lily/note-spacing.cc
lily/object-key-dumper-scheme.cc
lily/object-key-dumper.cc
lily/object-key-undumper-scheme.cc
lily/object-key-undumper.cc
lily/object-key.cc
lily/open-type-font-scheme.cc
lily/open-type-font.cc
lily/ottava-bracket.cc
lily/ottava-engraver.cc
lily/pango-font-scheme.cc
lily/pango-font.cc
lily/pango-select-scheme.cc
lily/pango-select.cc
lily/paper-book-scheme.cc
lily/paper-book.cc
lily/paper-column.cc
lily/paper-def.cc
lily/paper-outputter-scheme.cc
lily/paper-outputter.cc
lily/paper-score.cc
lily/paper-system-scheme.cc
lily/paper-system.cc
lily/parse-scm.cc
lily/part-combine-engraver.cc
lily/part-combine-iterator.cc
lily/percent-repeat-engraver.cc
lily/percent-repeat-item.cc
lily/percent-repeat-iterator.cc
lily/performance.cc
lily/performer-group-performer.cc
lily/performer.cc
lily/pfb.cc
lily/phrasing-slur-engraver.cc
lily/piano-pedal-bracket.cc
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/pitch-interval.cc
lily/pitch-scheme.cc
lily/pitch-squash-engraver.cc
lily/pitch.cc
lily/property-iterator.cc
lily/protected-scm.cc
lily/quote-iterator.cc
lily/recording-group-engraver.cc
lily/relative-octave-check.cc
lily/relative-octave-music.cc
lily/repeat-acknowledge-engraver.cc
lily/repeated-music.cc
lily/rest-collision-engraver.cc
lily/rest-collision.cc
lily/rest-engraver.cc
lily/rest.cc
lily/rhythmic-column-engraver.cc
lily/rhythmic-head.cc
lily/rod.cc
lily/scm-hash.cc
lily/scm-option.cc
lily/score-context.cc
lily/score-engraver.cc
lily/score-performer.cc
lily/score-scheme.cc
lily/score-translator.cc
lily/score.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/script-engraver.cc
lily/script-interface.cc
lily/self-aligment-interface.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/separation-item.cc
lily/sequential-iterator.cc
lily/sequential-music-iterator.cc
lily/side-position-interface.cc
lily/simple-music-iterator.cc
lily/simple-spacer-scheme.cc
lily/simple-spacer.cc
lily/simultaneous-music-iterator.cc
lily/skyline.cc
lily/slash-repeat-engraver.cc
lily/slur-configuration.cc
lily/slur-engraver.cc
lily/slur-performer.cc
lily/slur-scoring.cc
lily/slur.cc
lily/source-file.cc
lily/source.cc
lily/spaceable-grob.cc
lily/spacing-engraver.cc
lily/spacing-loose-columns.cc
lily/spacing-spanner.cc
lily/span-arpeggio-engraver.cc
lily/span-bar-engraver.cc
lily/span-bar.cc
lily/span-dynamic-performer.cc
lily/spanner.cc
lily/spring-smob.cc
lily/staff-collecting-engraver.cc
lily/staff-performer.cc
lily/staff-spacing.cc
lily/staff-symbol-engraver.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stanza-number-align-engraver.cc
lily/stanza-number-engraver.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/stencil-scheme.cc
lily/stencil.cc
lily/string-number-engraver.cc
lily/sustain-pedal.cc
lily/swallow-engraver.cc
lily/swallow-perf.cc
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/system.cc
lily/tab-note-heads-engraver.cc
lily/template5.cc
lily/tempo-performer.cc
lily/text-engraver.cc
lily/text-item.cc
lily/text-metrics.cc
lily/text-spanner-engraver.cc
lily/text-spanner.cc
lily/tfm-reader.cc
lily/tfm.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie-performer.cc
lily/tie.cc
lily/time-scaled-music-iterator.cc
lily/time-signature-engraver.cc
lily/time-signature-performer.cc
lily/time-signature.cc
lily/timing-engraver.cc
lily/timing-translator.cc
lily/translator-ctors.cc
lily/translator-group.cc
lily/translator-scheme.cc
lily/translator.cc
lily/trill-spanner-engraver.cc
lily/tuplet-bracket.cc
lily/tuplet-engraver.cc
lily/tweak-registration-scheme.cc
lily/tweak-registration.cc
lily/type-swallow-translator.cc
lily/unfolded-repeat-iterator.cc
lily/vaticana-ligature-engraver.cc
lily/vaticana-ligature.cc
lily/vertical-align-engraver.cc
lily/volta-bracket.cc
lily/volta-engraver.cc

index 54bef833018a63064217244d5fa77af003fbbfaf..d50507cb931a1d5db8fd9d2f9acffa23ffc99df5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-10  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * flower
+       * lily
+       * kpath-guile: Nitpick run: buildscripts/fixcc.py.
+
 2005-03-10  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * lily/accidental.cc: special bboxes for natural. 
index 6789b5b0af8bef653f1019af2d067f6caf7d6aee..832606b7018f9ae4416a1d321fa8511fc65e8588 100644 (file)
@@ -12,9 +12,9 @@
 // nextstep
 #ifndef CLOCKS_PER_SEC
 #ifdef CLK_TCK
-#define CLOCKS_PER_SEC  CLK_TCK
+#define CLOCKS_PER_SEC CLK_TCK
 #elif defined _SC_CLK_TCK
-#define CLOCKS_PER_SEC  sysconf (_SC_CLK_TCK)
+#define CLOCKS_PER_SEC sysconf (_SC_CLK_TCK)
 #else
 #error cannot determine CLOCKS_PER_SEC
 #endif
@@ -34,5 +34,5 @@ Real
 Cpu_timer::read ()
 {
   clock_t stop = clock ();
-  return (stop-start_clock_)/Real (CLOCKS_PER_SEC);
+  return (stop - start_clock_) / Real (CLOCKS_PER_SEC);
 }
index fc543b51bbbb0f46582bf2f851e7860a279d3959..71e700893eaffc35774e8083a6eb725fb39b2825 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   direction.cc --  implement Direction
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "direction.hh"
 
@@ -17,11 +16,11 @@ direction_string (Direction d, Axis a)
   String s ("center");
   if (a == Y_AXIS)
     {
-       s = ( d == UP ? "up" : "down");
+      s = (d == UP ? "up" : "down");
     }
   else if (a == X_AXIS)
     {
-      s = (d == LEFT ? "left" : "right" );
+      s = (d == LEFT ? "left" : "right");
     }
   return s;
 }
index 7c93ee65ce6441313e65a336b3cb324e064a2e37..12a63ba694f8c65e52ca463f04ddb6d6f630029d 100644 (file)
@@ -1,10 +1,10 @@
 /*
   file-name.cc - implement File_name
-   
+
   source file of the Flower Library
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "file-name.hh"
@@ -14,7 +14,7 @@
 
 #include "config.hh"
 
-#if HAVE_SYS_STAT_H 
+#if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
 
@@ -63,7 +63,7 @@ File_name::to_string () const
   return s;
 }
 
-char const*
+char const *
 File_name::to_str0 () const
 {
   return to_string ().to_str0 ();
index 88ccd59e17fdf5ee28edb480d4fd52dc3a4e668b..07b278ce4a78289417084ee9fc6bcf0f69fdd0b2 100644 (file)
@@ -1,10 +1,10 @@
 /*
   file-path.cc - implement File_path
-   
+
   source file of the Flower Library
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "file-path.hh"
@@ -13,7 +13,7 @@
 #include <cerrno>
 
 #include "config.hh"
-#if HAVE_SYS_STAT_H 
+#if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
 
@@ -48,18 +48,18 @@ File_path::parse_path (String p)
 }
 
 /** Find a file.
-    
-  Check absolute file name, search in the current dir (DUH! FIXME!),
-  in the construction-arg (what's that?), and in any other appended
-  directory, in this order.
 
-  @return
-  The file name if found, or empty string if not found. */
+Check absolute file name, search in the current dir (DUH! FIXME!),
+in the construction-arg (what's that?), and in any other appended
+directory, in this order.
+
+@return
+The file name if found, or empty string if not found. */
 
 String
 File_path::find (String name) const
 {
-  if (!name.length () || (name == "-") )
+  if (!name.length () || (name == "-"))
     return name;
 
   /* Handle absolute file name.  */
@@ -71,7 +71,7 @@ File_path::find (String name) const
          return name;
        }
     }
-       
+
   for (int i = 0; i < size (); i++)
     {
       String file_name = elem (i);
@@ -86,12 +86,12 @@ File_path::find (String name) const
       struct stat sbuf;
       if (stat (file_name.to_str0 (), &sbuf) != 0)
        continue;
-      
+
       if (! (sbuf.st_mode & __S_IFREG))
        continue;
 #endif
 #if !STAT_MACROS_BROKEN
-      
+
       struct stat sbuf;
       if (stat (file_name.to_str0 (), &sbuf) != 0)
        continue;
@@ -112,15 +112,15 @@ File_path::find (String name) const
 }
 
 /** Find a file.
-    
-  Seach in the current dir (DUH! FIXME?), in the construction-arg
-  (what's that?, and in any other appended directory, in this order.
 
-  Search for NAME, or name without extension, or name with any of
-  EXTENSIONS, in that order.
+Seach in the current dir (DUH! FIXME?), in the construction-arg
+(what's that?, and in any other appended directory, in this order.
+
+Search for NAME, or name without extension, or name with any of
+EXTENSIONS, in that order.
 
-  @return
-  The file name if found, or empty string if not found. */
+@return
+The file name if found, or empty string if not found. */
 String
 File_path::find (String name, char const *extensions[])
 {
@@ -150,7 +150,7 @@ bool
 File_path::try_append (String s)
 {
   if (s == "")
-    s =  ".";
+    s = ".";
   if (FILE *f = fopen (s.to_str0 (), "r"))
     {
       fclose (f);
index 0cc117b9ae066eb3b85cdce286d8bbb43584eded..e3850b153c47e47d63ca39807b1a055410f83bc3 100644 (file)
@@ -1,8 +1,8 @@
 /*
-   process command line, GNU style.
+  process command line, GNU style.
 
-   this is Copyleft (c) 1996--2005 Han-Wen Nienhuys, <hanwen@cs.uu.nl>
- */
+  this is Copyleft (c) 1996--2005 Han-Wen Nienhuys, <hanwen@cs.uu.nl>
+*/
 
 #include "getopt-long.hh"
 
 #include "string-convert.hh"
 
 #if !HAVE_GETTEXT
-inline char*
-gettext (char consts)
+inline char *
+gettext (char const *s)
 {
-  return (char*)s;
+  return (char *)s;
 }
 #else
 #include <libintl.h>
@@ -39,7 +39,7 @@ Getopt_long::get_argument_index ()
 const Long_option_init *
 Getopt_long::parselong ()
 {
-  char const *optnm = arg_value_char_a_a_[array_index_] + 2 ;
+  char const *optnm = arg_value_char_a_a_[array_index_] + 2;
   assert (*optnm);
 
   char const *endopt = strchr (optnm, '=');
@@ -94,7 +94,7 @@ Long_option_init::to_string () const
 {
   String str;
   if (shortname_char_)
-    str +=  "-" + shortname_char_;
+    str += "-" + shortname_char_;
   if (shortname_char_ && longname_str0_)
     str += ", ";
   if (longname_str0_)
@@ -122,7 +122,7 @@ Long_option_init::str_for_help () const
        s = s + "=";
       else
        s = s + " ";
-      
+
       s = s + gettext (take_arg_str0_);
     }
   return s;
@@ -142,41 +142,41 @@ Getopt_long::report (Errorcod c)
     {
     case E_ARGEXPECT:
       str += _f ("option `%s' requires an argument",
-       found_option_->to_string ());
+                found_option_->to_string ());
       break;
-    case  E_NOARGEXPECT:
+    case E_NOARGEXPECT:
       str += _f ("option `%s' doesn't allow an argument",
-       found_option_->to_string ());
+                found_option_->to_string ());
       break;
     case E_UNKNOWNOPTION:
       str += _f ("unrecognized option: `%s'",
-      String (argument_index_ 
-             ? String ("-" + String_convert::form_string ("%c", 
-               arg_value_char_a_a_[array_index_][argument_index_]))
-             : String (arg_value_char_a_a_[array_index_])));
+                String (argument_index_
+                        ? String ("-" + String_convert::form_string ("%c",
+                                                                     arg_value_char_a_a_[array_index_][argument_index_]))
+                        : String (arg_value_char_a_a_[array_index_])));
       break;
     case E_ILLEGALARG:
       str += _f ("invalid argument `%s' to option `%s'",
-        optional_argument_str0_, found_option_->to_string ());
+                optional_argument_str0_, found_option_->to_string ());
       break;
     default:
       assert (false);
     }
-  fprintf(error_out_, "%s\n", str.to_str0 ());
+  fprintf (error_out_, "%s\n", str.to_str0 ());
   exit (2);
 }
 
 const Long_option_init *
 Getopt_long::parseshort ()
 {
-  char c=arg_value_char_a_a_[array_index_][argument_index_];
-  found_option_=0;
+  char c = arg_value_char_a_a_[array_index_][argument_index_];
+  found_option_ = 0;
   assert (c);
 
-  for (int i=0; i < table_len_; i++)
+  for (int i = 0; i < table_len_; i++)
     if (option_a_[i].shortname_char_ == c)
       {
-       found_option_  = option_a_+i;
+       found_option_ = option_a_ + i;
        break;
       }
 
@@ -194,13 +194,13 @@ Getopt_long::parseshort ()
     }
   optional_argument_str0_ = arg_value_char_a_a_[array_index_] + argument_index_;
 
-  array_index_ ++;
+  array_index_++;
   argument_index_ = 0;
 
   if (!optional_argument_str0_[0])
     {
       optional_argument_str0_ = arg_value_char_a_a_[array_index_];
-      array_index_ ++;
+      array_index_++;
     }
   if (!optional_argument_str0_)
     {
@@ -211,7 +211,7 @@ Getopt_long::parseshort ()
 }
 
 const Long_option_init *
-Getopt_long::operator () ()
+Getopt_long::operator() ()
 {
   if (!ok ())
     return 0;
@@ -223,7 +223,7 @@ Getopt_long::operator () ()
   if (argument_index_)
     return parseshort ();
 
-  const char * argument = arg_value_char_a_a_[array_index_];
+  const char *argument = arg_value_char_a_a_[array_index_];
 
   if (argument[0] != '-')
     return 0;
@@ -248,9 +248,7 @@ Getopt_long::operator () ()
     }
 }
 
-
-
-Getopt_long::Getopt_long (int c, char  **v, Long_option_init *lo)
+Getopt_long::Getopt_long (int c, char **v, Long_option_init *lo)
 {
   option_a_ = lo;
   error_out_ = stderr;
@@ -261,15 +259,15 @@ Getopt_long::Getopt_long (int c, char  **v, Long_option_init *lo)
 
   //    reached end of option table?
   table_len_ =0;
-  for (int i = 0;  option_a_[i].longname_str0_ ||option_a_[i].shortname_char_; i++)
-    table_len_ ++;
+  for (int i = 0; option_a_[i].longname_str0_ ||option_a_[i].shortname_char_; i++)
+    table_len_++;
 
 }
 
 bool
 Getopt_long::ok () const
 {
-  return  array_index_ < argument_count_;
+  return array_index_ < argument_count_;
 }
 
 void
@@ -289,46 +287,44 @@ Getopt_long::current_arg ()
 {
   if (array_index_ >= argument_count_)
     return 0;
-  char const * a = arg_value_char_a_a_[array_index_];
+  char const *a = arg_value_char_a_a_[array_index_];
   return a + argument_index_;
 }
 
 char const *
 Getopt_long::get_next_arg ()
 {
-  char const * a = current_arg ();
+  char const *a = current_arg ();
   if (a)
     {
-      array_index_ ++;
+      array_index_++;
       argument_index_= 0;
     }
   return a;
 }
 
-
 const int EXTRA_SPACES = 5;
 
 String
-Long_option_init::table_string (Long_option_init *l) 
+Long_option_init::table_string (Long_option_init *l)
 {
   String argstr = "ARG";
   String tabstr = "";
 
   int wid = 0;
-  for (int i=0; l[i].shortname_char_ || l[i].longname_str0_; i++)
+  for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
     {
       wid = wid >? l[i].str_for_help ().length ();
     }
 
-  for (int i=0; l[i].shortname_char_ || l[i].longname_str0_; i++)
+  for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
     {
-      String s  =  "  " + l[i].str_for_help ();
+      String s = "  " + l[i].str_for_help ();
       s += String_convert::char_string (' ', wid - s.length () + EXTRA_SPACES);
 
       tabstr += s + gettext (l[i].help_str0_) + "\n";
     }
 
-    
   return tabstr;
 }
 
@@ -348,6 +344,6 @@ Long_option_init::compare (Long_option_init const &a, Long_option_init const &b)
       char s[2] = {a.shortname_char_, 0};
       return strcmp (s, b.longname_str0_);
     }
-  
+
   return strcmp (a.longname_str0_, b.longname_str0_);
 }
index 63318d933861eef487946dc941dac3a41ba0e6d7..de07f21a1bb2e6ed3a79b3b6090edb16ba439f35 100644 (file)
@@ -1,22 +1,21 @@
-/*   
-  arithmetic-operator.hh -- declare 
-  
+/*
+  arithmetic-operator.hh -- declare
+
   source file of the Flower Library
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef ARITHMETIC_OPERATOR_HH
 #define ARITHMETIC_OPERATOR_HH
 
-#define IMPLEMENT_ARITHMETIC_OPERATOR(type, op)  \
-inline type \
-operator op (type a1, type const& a2)          \
-{                                              \
-  a1 op ## = a2;                                       \
-  return a1;                                   \
-}
+#define IMPLEMENT_ARITHMETIC_OPERATOR(type, op)        \
+  inline type                                  \
+  operator op (type a1, type const &a2)                \
+  {                                            \
+    a1 op ## = a2;                             \
+    return a1;                                 \
+  }
 
 #endif /* ARITHMETIC_OPERATOR_HH */
 
index e1b39fb58ffe6d53ec67a161c371b964b19372e9..10b91ed97bf1e9501eff68f77a67e90f8030f147 100644 (file)
@@ -1,7 +1,7 @@
 /*
   (c) 1995--2005 Han-Wen Nienhuys
 
-  Distributed under GNU GPL  
+  Distributed under GNU GPL
 */
 
 #ifndef ARRAY_H
 #endif
 
 /// copy a bare (C-)array from #src# to #dest# sized  #count#
-template<class T> void arrcpy (T*dest, T const*src, int count);
+template<class T> void arrcpy (T *dest, T const *src, int count);
 
 /**
-  Scaleable array/stack template, for a type T with default constructor.
-  
-  
-  This template implements a scaleable vector. With (or without) range
-  checking. The type T should have a default constructor. It is
-  best suited for simple types, such as int, double or String, it
-  provides a paranoidly safe replacement for the new T[int] construct.
-
-  You should \bf{never} store pointers to objects in an Array (since
-  the array may be relocated without the pointer knowing it).
-  
-  It uses stack terminology, (push, pop, top), and  can be used as a stack.
-
-  
-  */
+   Scaleable array/stack template, for a type T with default constructor.
+
+
+   This template implements a scaleable vector. With (or without) range
+   checking. The type T should have a default constructor. It is
+   best suited for simple types, such as int, double or String, it
+   provides a paranoidly safe replacement for the new T[int] construct.
+
+   You should \bf{never} store pointers to objects in an Array (since
+   the array may be relocated without the pointer knowing it).
+
+   It uses stack terminology, (push, pop, top), and  can be used as a stack.
+*/
 template<class T>
 class Array
 {
@@ -42,209 +40,209 @@ protected:
   T *array_;
 
   /// stretch or shrink  array.
-  void remax (int newmax) 
-    {   
-      T* newarr = new T[newmax];
-      size_ = (newmax < size_) ? newmax : size_;
-      arrcpy (newarr, array_, size_);
-       
-      delete[] array_;
-      array_ = newarr;
-      max_ = newmax;
-    }
+  void remax (int newmax)
+  {
+    T *newarr = new T[newmax];
+    size_ = (newmax < size_) ? newmax : size_;
+    arrcpy (newarr, array_, size_);
+
+    delete[] array_;
+    array_ = newarr;
+    max_ = newmax;
+  }
   int size_;
 
 public:
   /// check invariants
-  void OK () const ;
+  void OK () const;
   /** report the size_.
-      @see 
+      @see
       {setsize_}
   */
 
-  int size () const  
-    {
-      return size_;
-    }
-    
+  int size () const
+  {
+    return size_;
+  }
+
   /// POST: size () == 0
-  void clear () 
-    {
-      size_ = 0;
-    }
+  void clear ()
+  {
+    size_ = 0;
+  }
 
   Array (T *tp, int n)
-    {
-      array_ = new T[n];
-      max_ =size_ = n;
-      arrcpy (array_, tp, n);      
-    }
-  
-  Array () 
-    { array_ = 0; max_ =0; size_ =0; }
+  {
+    array_ = new T[n];
+    max_ =size_ = n;
+    arrcpy (array_, tp, n);
+  }
 
-  // ugh, get around gcc 2.8.1 ice; see bezier.cc
-  Array (int i) 
-    { 
-      max_ = size_ = i; 
-      array_ = new T[i];
-    }
+  Array ()
+  { array_ = 0; max_ =0; size_ =0; }
 
+  // ugh, get around gcc 2.8.1 ice; see bezier.cc
+  Array (int i)
+  {
+    max_ = size_ = i;
+    array_ = new T[i];
+  }
 
   /** set the size_ to #s#.
       POST: size () == s.
       Warning: contents are unspecified */
-  void set_size (int s) 
-    {
-      if (s > max_) remax (s);
-      size_ = s;    
-    }
-    
-  ~Array () 
-    { delete[] array_; }
+  void set_size (int s)
+  {
+    if (s > max_) remax (s);
+    size_ = s;
+  }
+
+  ~Array ()
+  { delete[] array_; }
 
   /// return a  "new"ed copy of array 
-  T* copys () const 
-    {
-      T* Tarray = new T[size_];
-      arrcpy (Tarray, array_, size_);
-      return Tarray;
-    }
+  T *copys () const
+  {
+    T *Tarray = new T[size_];
+    arrcpy (Tarray, array_, size_);
+    return Tarray;
+  }
 
   T const *accesses () const
-    {
-      return array_;
-    }
-  void operator= (Array const & src) 
-    {
-      set_size (src.size_);
-      arrcpy (array_,src.array_, size_);
-    }
-  Array (Array const & src) 
-    {
-      array_ = src.copys ();
-      max_ = size_ = src.size_;        
-    }
+  {
+    return array_;
+  }
+  void operator= (Array const &src)
+  {
+    set_size (src.size_);
+    arrcpy (array_, src.array_, size_);
+  }
+  Array (Array const &src)
+  {
+    array_ = src.copys ();
+    max_ = size_ = src.size_;
+  }
 
   /// tighten array size_.
-  void tighten_maxsize ()     {
+  void tighten_maxsize ()
+  {
     remax (size_);
   }
-    
-  T * remove_array ();
+
+  T *remove_array ();
 
   /// access element
-  T &operator[] (int i)  
-    {
-      return elem_ref (i);
-    }
+  T &operator[] (int i)
+  {
+    return elem_ref (i);
+  }
   /// access element
-  T const & operator[] (int i) const 
-    {
-      return elem_ref (i);
-    }
+  T const &operator[] (int i) const
+  {
+    return elem_ref (i);
+  }
   /// access element
-  T &elem_ref (int i) const 
-    {
-      assert (i >=0 && i < size_);
-      return ((T*)array_)[i];  
-    }
+  T &elem_ref (int i) const
+  {
+    assert (i >=0 && i < size_);
+    return ((T *)array_)[i];
+  }
   /// access element
-  T elem (int i) const 
-    {
-      return elem_ref (i);
-    }
+  T elem (int i) const
+  {
+    return elem_ref (i);
+  }
 
   /// add to the end of array
-  void push (T x) 
-    {
-      if (size_ == max_)
-       remax (2*max_ + 1);
-
-      // T::operator= (T &) is called here. Safe to use with automatic
-      // vars
-      array_[size_++] = x;
-    }
+  void push (T x)
+  {
+    if (size_ == max_)
+      remax (2*max_ + 1);
+
+    // T::operator= (T &) is called here. Safe to use with automatic
+    // vars
+    array_[size_++] = x;
+  }
   /// remove and return last entry 
-  T pop () 
-    {
-      assert (!is_empty ());
-      T l = top (0);
-      set_size (size ()-1);
-      return l;
-    }
+  T pop ()
+  {
+    assert (!is_empty ());
+    T l = top (0);
+    set_size (size () - 1);
+    return l;
+  }
   /// access last entry
-  T& top (int j=0) 
-    {
-      return (*this)[size_-j-1];
-    }
+  T &top (int j = 0)
+  {
+    return (*this)[size_ - j - 1];
+  }
   /// return last entry
-  T top (int j=0) const 
-    {
-      return (*this)[size_-j-1];
-    }
-  
-  Tboundary (int dir, int idx)
-    {
-      assert (dir);
-      if (dir == 1)
-       return top (idx);
-      else
-       return elem_ref (idx);
-    }
+  T top (int j = 0) const
+  {
+    return (*this)[size_ - j - 1];
+  }
+
+  T &boundary (int dir, int idx)
+  {
+    assert (dir);
+    if (dir == 1)
+      return top (idx);
+    else
+      return elem_ref (idx);
+  }
   T boundary (int dir, int idx) const
-    {
-      assert (dir);
-      if (dir == 1)
-       return top (idx);
-      else
-       return elem (idx);
-    }
-  void swap (int i,int j) 
-    {
-      T t ((*this)[i]);
- (*this)[i]= (*this)[j];
(*this)[j]=t;
-    }
-  bool is_empty () const 
-    { return !size_; }
+  {
+    assert (dir);
+    if (dir == 1)
+      return top (idx);
+    else
+      return elem (idx);
+  }
+  void swap (int i, int j)
+  {
+    T t ((*this)[i]);
   (*this)[i]= (*this)[j];
   (*this)[j] = t;
+  }
+  bool is_empty () const
+  { return !size_; }
 
   void insert (T k, int j);
   /**
      remove  i-th element, and return it.
   */
-  T get (int i) 
-    {
-      T t = elem (i);
-      del (i);
-      return t;
-    }
+  T get (int i)
+  {
+    T t = elem (i);
+    del (i);
+    return t;
+  }
   void unordered_del (int i)
-    {
-      elem_ref (i) = top ();
-      set_size (size () -1);
-    }
-  void del (int i) 
-    {
-      assert (i >=0&& i < size_);
-      arrcpy (array_+i, array_+i+1, size_-i-1);
-      size_--;
-    }
+  {
+    elem_ref (i) = top ();
+    set_size (size () -1);
+  }
+  void del (int i)
+  {
+    assert (i >=0&& i < size_);
+    arrcpy (array_ + i, array_ + i + 1, size_ - i - 1);
+    size_--;
+  }
   // quicksort.
-  void sort (int (*compare) (T const&,T const&),
+  void sort (int (*compare) (T const &, T const &),
             int lower = -1, int upper = -1);
-  void concat (Array<T> const &src) 
-    {
-      int s = size_;
-      set_size (size_ + src.size_);
-      arrcpy (array_+s,src.array_, src.size_); 
-    }
-  Array<T> slice (int lower, int upper) const; 
+  void concat (Array<T> const &src)
+  {
+    int s = size_;
+    set_size (size_ + src.size_);
+    arrcpy (array_ + s, src.array_, src.size_);
+  }
+  Array<T> slice (int lower, int upper) const;
   void reverse ();
 };
 
 template<class T>
-int default_compare (T const&a , T const&b)
+int default_compare (T const &a, T const &b)
 {
   if (a < b)
     return -1;
index a84fe937e4a7834d808069792e4734e502bc7ecc..088a1372528bd85dd7e6e38f291b3d77135700c2 100644 (file)
@@ -4,7 +4,6 @@
   Distributed under GNU GPL
 */
 
-
 #if 0
 #include "array.hh"
 #ifdef INLINE
 #endif
 
 /*
- functions with loops don't inline
- */
 functions with loops don't inline
+*/
 
-template<class T> INLINE void 
-arrcpy (T*dest, T const* src, int count)
+template<class T> INLINE void
+arrcpy (T *dest, T const *src, int count)
 {
-  for (int i_shadows_local=0; i_shadows_local < count ; i_shadows_local++)
+  for (int i_shadows_local = 0; i_shadows_local < count; i_shadows_local++)
 #ifdef __powerpc__
     {
       /*
        urg: wierd egcs-1.1.2-12c (stock LinuxPPC R5) bug on ppc
        bug report filed
        fixed in egcs-1.1.2-12f
-       ftp://dev.linuxppc.org/users/fsirl/R5/RPMS/ppc/ 
+       ftp://dev.linuxppc.org/users/fsirl/R5/RPMS/ppc/
       */
       *dest = *src;
       dest++, src++;
     }
 #else
-    *dest++ = *src++;
+  *dest++ = *src++;
 #endif
 }
 
 template<class T> INLINE void
-Array<T>::insert (T k, int j) 
+Array<T>::insert (T k, int j)
 {
   assert (j >=0 && j<= size_);
-  set_size (size_+1);
-  for (int i=size_-1; i > j; i--)
-    array_[i] = array_[i-1];
+  set_size (size_ + 1);
+  for (int i = size_ - 1; i > j; i--)
+    array_[i] = array_[i - 1];
   array_[j] = k;
 }
 
 template<class T> INLINE void
-Array<T>::sort (int (*compare) (T const&,T const&), int lower, int upper)
+Array<T>::sort (int (*compare) (T const &, T const &), int lower, int upper)
 {
-  if (lower < 0) 
+  if (lower < 0)
     {
-      lower = 0 ;
+      lower = 0;
       upper = size () - 1;
     }
   if (lower >= upper)
     return;
-  swap (lower, (lower+upper)/2);
+  swap (lower, (lower + upper) / 2);
   int last = lower;
   for (int i= lower +1; i <= upper; i++)
     if (compare (array_[i], array_[lower]) < 0)
-      swap (++last,i);
+      swap (++last, i);
   swap (lower, last);
-  sort (compare, lower, last-1);
-  sort (compare, last+1, upper);
+  sort (compare, lower, last - 1);
+  sort (compare, last + 1, upper);
 }
 
 template<class T> INLINE void
-Array<T>::reverse () 
+Array<T>::reverse ()
 {
-  int h = size_/2;
-  for (int i =0,j = size_-1; i < h; i++,j--)
-    swap (i,j);
+  int h = size_ / 2;
+  for (int i =0, j = size_ - 1; i < h; i++, j--)
+    swap (i, j);
 }
 
 template<class T> INLINE
@@ -88,7 +87,7 @@ template<class T> INLINE
 T *
 Array<T>::remove_array ()
 {
-  T * p = array_;
+  T *p = array_;
   size_ = 0;
   max_ = 0;
   array_ =0;
@@ -101,17 +100,16 @@ Array<T>::slice (int lower, int upper) const
 {
   assert (lower >= 0 && lower <=upper&& upper <= size_);
   Array<T> r;
-  int s =upper-lower;
+  int s =upper - lower;
   r.set_size (s);
-  arrcpy (r.array_, array_  + lower, s);
+  arrcpy (r.array_, array_ + lower, s);
   return r;
 }
 
-
 template<class T>
 void
 binary_search_bounds (Array<T> const &table,
-                     T const &key, int (*compare) (T const&, T const &),
+                     T const &key, int (*compare) (T const &, T const &),
                      int *lo,
                      int *hi)
 {
@@ -120,30 +118,28 @@ binary_search_bounds (Array<T> const &table,
 
   /* binary search */
   do
-  {
+    {
       cmp = (*lo + *hi) / 2;
 
-      result = (*compare)  (key, table[cmp]);
+      result = (*compare) (key, table[cmp]);
 
       if (result < 0)
-          *hi = cmp;
+       *hi = cmp;
       else
-          *lo = cmp;
+       *lo = cmp;
     }
   while (*hi - *lo > 1);
 }
 
-
 /*
   lookup with binsearch, return array index.
 */
 template<class T>
 int
 binary_search (Array<T> const &table,
-              T const &key, int (*compare) (T const&, T const &),
+              T const &key, int (*compare) (T const &, T const &),
               int lo = 0,
-              int hi = -1
-              ) 
+              int hi = -1)
 {
   if (hi < 0)
     hi = table.size ();
index f0f438af1fc145bc632b72a3d79cc523c1f70ebf..3a1a7fc9dc90ab46e8fd65f4b76dbd5e9e99ced7 100644 (file)
@@ -6,17 +6,17 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef AXES_HH
 #define AXES_HH
 
 #include <cassert>
 
-enum Axis {
+enum Axis
+  {
     X_AXIS =0,
     Y_AXIS =1,
-    NO_AXES=2,
-};
+    NO_AXES = 2,
+  };
 
 static inline
 Axis
@@ -31,7 +31,7 @@ static inline
 Axis
 other_axis (Axis a)
 {
-  return a ==  Y_AXIS ? X_AXIS : Y_AXIS;
+  return a == Y_AXIS ? X_AXIS : Y_AXIS;
 }
 
 #endif // AXES_HH
index d956c7157c59a845de8e11dd3781d3953745f4b5..a9fde513a5ccc1ef597c937471b82a95c1ea2249 100644 (file)
@@ -2,54 +2,50 @@
   flowerlib
 
   (c) 1996--2005 Han-Wen Nienhuys
-  */
+*/
 #ifndef COMPARE_HH
 #define COMPARE_HH
 
-#define ONE_OPERATOR(type, function, op) \
-inline bool \
-operator op (type t1, type t2) {\
-    return function (t1, t2) op 0;\
-}\
-
-#define GPP_MINMAX_OPERATOR(type, op, opp) \
-inline type \
-operator op (type t1, type t2)\
-{\
-     return (t1 opp t2) ? t1 :  t2;\
-}\
+#define ONE_OPERATOR(type, function, op)       \
+  inline bool                                  \
+  operator op (type t1, type t2)               \
+  {                                            \
+    return function (t1, t2) op 0;             \
+  }
 
+#define GPP_MINMAX_OPERATOR(type, op, opp)     \
+  inline type                                  \
+  operator op (type t1, type t2)               \
+  {                                            \
+    return (t1 opp t2) ? t1 : t2;              \
+  }
 
 #if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-#define GPP_MINMAX(type, prefix)\
-       prefix GPP_MINMAX_OPERATOR (type, <?, <)\
-       prefix GPP_MINMAX_OPERATOR (type, >?, >)
+#define GPP_MINMAX(type, prefix)               \
+  prefix GPP_MINMAX_OPERATOR (type, <?, <)     \
+    prefix GPP_MINMAX_OPERATOR (type, >?, >)
 #else
-#define GPP_MINMAX(type, prefix)
+#define GPP_MINMAX (type, prefix)
 #endif
 
-/**  handy notations for a signed comparison. 
-    make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
-    Please fill a & in the type argument if necessary.    
-    */
-#define TEMPLATE_INSTANTIATE_COMPARE(type, function, prefix) \
-prefix ONE_OPERATOR (type, function, >)\
-prefix ONE_OPERATOR (type, function, >=)\
-prefix ONE_OPERATOR (type, function, ==)\
-prefix ONE_OPERATOR (type, function, !=)\
-prefix ONE_OPERATOR (type, function, <)\
-prefix ONE_OPERATOR (type, function, <=)\
-GPP_MINMAX (type, prefix)\
-prefix inline type max (type t1, type t2) {  return (t1 > t2)? t1 : t2; }\
-prefix inline type min (type t1, type t2) {  return (t1 < t2)? t1 : t2; }\
-  \
-prefix  bool operator< (type t1, type t2) /* stupid fix to allow ; */
-
-
-    
-#define INSTANTIATE_COMPARE(type, func) TEMPLATE_INSTANTIATE_COMPARE (type,func,)
-     
-
-     
+/**  handy notations for a signed comparison.
+     make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
+     Please fill a & in the type argument if necessary.
+*/
+#define TEMPLATE_INSTANTIATE_COMPARE(type, function, prefix)           \
+  prefix ONE_OPERATOR (type, function, >)                              \
+    prefix ONE_OPERATOR (type, function, >=)                           \
+    prefix ONE_OPERATOR (type, function, ==)                           \
+    prefix ONE_OPERATOR (type, function, !=)                           \
+    prefix ONE_OPERATOR (type, function, <)                            \
+    prefix ONE_OPERATOR (type, function, <=)                           \
+    GPP_MINMAX (type, prefix)                                          \
+    prefix inline type max (type t1, type t2) { return (t1 > t2)? t1 : t2; } \
+  prefix inline type min (type t1, type t2) { return (t1 < t2)? t1 : t2; } \
+                                                                       \
+  prefix bool operator< (type t1, type t2) /* stupid fix to allow ; */
+
+#define INSTANTIATE_COMPARE(type, func) TEMPLATE_INSTANTIATE_COMPARE (type, func,)
+
 #endif
-     
+
index a12c3f312ee9c51523e9676230b58378d0a56594..3e6b64f1ab07b23d789294aeea633b3d0f8f1797 100644 (file)
@@ -1,38 +1,36 @@
-/*   
+/*
   cons.hh -- declare LISP like datatypes
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef CONS_HH
 #define CONS_HH
 
-
 #include <cassert>
 
 template<class T>
 class Cons
 {
 public:
-  T * car_;
-  Cons * next_;
+  T *car_;
+  Cons *next_;
   Cons ()
-    {
-      car_=0;
-      next_ =0;
-    }
-  Cons (T*t, Cons<T>*c)
-    {
-      car_ = t;
-      next_ = c;
-    }
- virtual ~Cons ()
-    {
-      delete next_;
-    }
+  {
+    car_ = 0;
+    next_ =0;
+  }
+  Cons (T *t, Cons<T>*c)
+  {
+    car_ = t;
+    next_ = c;
+  }
 virtual ~Cons ()
+  {
+    delete next_;
+  }
 };
 
 template<class T>
@@ -40,13 +38,12 @@ class Killing_cons : public Cons<T>
 {
 public:
   Killing_cons (T *t, Cons<T> *p)
-    : Cons<T> ( t,p)
-    {
-    }
+    : Cons<T> (t, p)
+  {
+  }
   virtual ~Killing_cons ();
 };
 
-
 /// remove the link pointed to by *p.
 template<class T>
 Cons<T> *remove_cons (Cons<T> **pp)
@@ -59,19 +56,16 @@ Cons<T> *remove_cons (Cons<T> **pp)
 
 template<class T> int cons_list_size (Cons<T> *l)
 {
-  int i=0;
+  int i = 0;
   while (l)
     {
       l = l->next_;
-       i++;
+      i++;
     }
   return i;
 }
 
 
-
-
-
 template<class T>
 Cons<T> * last_cons (Cons<T> * head)
 {
@@ -84,12 +78,12 @@ Cons<T> * last_cons (Cons<T> * head)
 
 /**
 
-   Invariants:
+Invariants:
+
+(*tail_) is either the head_ pointer, or a next_ pointer from the list.
 
- (*tail_) is either the head_ pointer, or a next_ pointer from the list.
-   
-   **tail_ == NULL
- */
+**tail_ == NULL
+*/
 
 template<class T>
 class Cons_list
@@ -98,72 +92,71 @@ public:
   Cons<T> * head_;
   Cons<T> ** nil_pointer_address_;
   Cons_list ()
-    {
-      init ();
-    }
+  {
+    init ();
+  }
   void init ()
-    {
-      head_ =0;
-      nil_pointer_address_ = &head_;
-    }
+  {
+    head_ =0;
+    nil_pointer_address_ = &head_;
+  }
   void append (T *c)
-    {
-      append (new Cons<T> (c,0));
-    }
+  {
+    append (new Cons<T> (c, 0));
+  }
   void append (Cons<T> *c)
-    {
-      assert (!c->next_);
-      *nil_pointer_address_ = c;
-      while (*nil_pointer_address_)
-       nil_pointer_address_ = & (*nil_pointer_address_)->next_;
-    }
+  {
+    assert (!c->next_);
+    *nil_pointer_address_ = c;
+    while (*nil_pointer_address_)
+      nil_pointer_address_ = &(*nil_pointer_address_)->next_;
+  }
   /**
      PRE: *pp should either be the head_ pointer, or the next_ pointer
      from a list cell.
   */
   Cons<T> *remove_cons (Cons<T> **pp)
-    {
-      if (& (*pp)->next_ == nil_pointer_address_)
-       nil_pointer_address_ = pp;
+  {
+    if (& (*pp)->next_ == nil_pointer_address_)
+      nil_pointer_address_ = pp;
 
-      return ::remove_cons (pp);
-    }
+    return ::remove_cons (pp);
+  }
 
   /// junk everything after the  first I elements.
   void truncate (int i)
-    {
-      Cons<T> **p  = &head_;
-      for (; *p && i;  p = & ((*p)->next_))
-       {
-         i--;
-       }
-
-      if (*p)
-       {
-         delete *p;
-         *p = 0;
-       }
-      nil_pointer_address_ = p;
-    }
+  {
+    Cons<T> **p = &head_;
+    for (; *p && i; p = &((*p)->next_))
+      {
+       i--;
+      }
+
+    if (*p)
+      {
+       delete *p;
+       *p = 0;
+      }
+    nil_pointer_address_ = p;
+  }
 
   void junk ()
-    {
-      delete head_;
-      head_ =0;
-    }
+  {
+    delete head_;
+    head_ =0;
+  }
   ~Cons_list ()
-    {
-      junk ();
-    }
+  {
+    junk ();
+  }
   int size ()
-    {
-      return cons_list_size (head_);
-    }
+  {
+    return cons_list_size (head_);
+  }
 };
 
-
 template<class T>
-void  copy_killing_cons_list (Cons_list<T>&, Cons<T> *src);
+void copy_killing_cons_list (Cons_list<T>&, Cons<T> *src);
 template<class T>
 void
 clone_killing_cons_list (Cons_list<T>&, Cons<T> *src);
index 055b6aad0416e6f1101f4a959f50e7e078d5fae8..47aae73f04d8c57142077cf709b9880a6f8f1ae3 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef CPU_TIMER_HH
 #define CPU_TIMER_HH
 
@@ -14,7 +13,8 @@
 
 #include "real.hh"
 
-class Cpu_timer {
+class Cpu_timer
+{
   clock_t start_clock_;
 public:
   Cpu_timer ();
index 53d7249b03df22dd4768875eb55fee57ef746846..6ff794be862c508d33b01a9aca21fded04b575b2 100644 (file)
@@ -6,37 +6,36 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef DIRECTION_HH
 #define DIRECTION_HH
 
 #include "axes.hh"
 
-enum Direction 
-{
-  UP=1,
-  DOWN=-1,
-  LEFT=-1,
-  RIGHT=1,
-  MIN=-1,
-  MAX=1,
-  CENTER=0,
-  SMALLER=-1,
-  BIGGER=1,
-  START = -1,
-  STOP = 1,
+enum Direction
+  {
+    UP = 1,
+    DOWN=-1,
+    LEFT=-1,
+    RIGHT = 1,
+    MIN=-1,
+    MAX = 1,
+    CENTER = 0,
+    SMALLER=-1,
+    BIGGER = 1,
+    START = -1,
+    STOP = 1,
+
+    /*
+      This is necessary to safely write loops,
+      since
 
-  /*
-    This is necessary to safely write loops,
-    since
-    
       dir <= RIGHT
 
-    is otherwise transformed into true unconditionally.
-   */
-  DIRECTION_LIMIT = 2,
-  DIRECTION_NEG_LIMIT = -2,
-};
+      is otherwise transformed into true unconditionally.
+    */
+    DIRECTION_LIMIT = 2,
+    DIRECTION_NEG_LIMIT = -2,
+  };
 
 inline Direction
 other_dir (Direction const d)
@@ -45,17 +44,18 @@ other_dir (Direction const d)
 }
 
 inline Direction
-operator - (Direction const d)
+operator- (Direction const d)
 {
   return other_dir (d);
 }
 
 // huh?
 inline Direction
-flip (Direction *i) {
+flip (Direction *i)
+{
   if (*i == (Direction)1)
-    *i = (Direction)-1;
-  else if (*i == (Direction)-1)
+    *i = (Direction) - 1;
+  else if (*i == (Direction) - 1)
     *i = (Direction)1;
   return *i;
 }
@@ -63,7 +63,7 @@ flip (Direction *i) {
 /**
    if d > 0: the max operator
    if d < 0: the min operator
- */
+*/
 template<class T> T minmax (Direction d, T, T);
 
 // String direction_string (Direction, Axis);
index e6d8ee0eaf3c9c03ac4221c58593048af841710e..f670a56286a7a4569b9eca4fd7df787599e9f486 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef DRUL_ARRAY_HH
 #define DRUL_ARRAY_HH
 
 #include "real.hh"
 
 /**
-  Left/right or Up/down arrays. Drul is nicer sounding than udlr
- */
+   Left/right or Up/down arrays. Drul is nicer sounding than udlr
+*/
 template<class T>
 struct Drul_array
 {
   T array_[2];
   T &elem_ref (Direction d)
   {
-    assert (d==1 || d== -1);
-    return array_[ (d+1)/2];
+    assert (d == 1 || d== -1);
+    return array_[ (d + 1) / 2];
   }
   T elem (Direction d) const
   {
-    assert (d==1 || d== -1);
-    return array_[ (d+1)/2];
+    assert (d == 1 || d== -1);
+    return array_[ (d + 1) / 2];
   }
   T &operator[] (Direction d)
   {
index 44061fa2c2749d2c2f3f4a08b0f4411ff84d0c15..be2268ec858c28643cc8287f67ba7c6377fa50c2 100644 (file)
@@ -21,7 +21,7 @@ public:
   String ext_;
 
   File_name (String);
-    
+
   String to_string () const;
   char const *to_str0 () const;
 };
index 5f5549cb19dfcbf4c5ac49dbdcddb341c36e351e..f9d9f816ccbeb2279133ca4a75910f264aaa509e 100644 (file)
 #include "array.hh"
 #include "string.hh"
 
-/**    
-  search in directories for a file.
+/**
+   search in directories for a file.
 
    Abstraction of PATH variable. An interface for searching input files.
    Search a number of dirs for a file.
 
-   TODO: add a unix style PATH interface 
+   TODO: add a unix style PATH interface
 */
 
 class File_path : private Array<String>
index a4ac51fb3329ae7c5b07335ab457b94e33a25b7c..425a61c3d7b6c2faae69a48315dc5257fe1f094c 100644 (file)
@@ -6,21 +6,19 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef FILE_STORAGE_HH
 #define FILE_STORAGE_HH
 
 #include "flower-proto.hh"
 
-
 /**
-  store a file in-memory.
- */
+   store a file in-memory.
+*/
 class File_storage
 {
 public:
-  virtual char const* to_str0 () const=0;
-  virtual int length () const=0;
+  virtual char const *to_str0 () const = 0;
+  virtual int length () const = 0;
   virtual ~File_storage (){}
 };
 
index a3a8b80eb2ab5c6a7eb8667ba4aa0557bdb35e17..68fa9185275bf0aaaea0bb70b0f32f401e39ebfc 100644 (file)
@@ -8,14 +8,13 @@
 #ifndef FPROTO_HH
 #define FPROTO_HH
 
-
-char const * flower_version_str0 ();
+char const *flower_version_str0 ();
 
 template<class T> struct Link_array;
 template<class T> struct Array;
-template<class T,class K> struct Assoc;
-template<class K, class V> struct Hash_table;
-template<class K, class V> struct Hash_table_iter;
+template < class T, class K> struct Assoc;
+template < class K, class V> struct Hash_table;
+template < class K, class V> struct Hash_table_iter;
 template<class T> struct Link_list;
 template<class T> struct Interval_t;
 template<class T> struct PQueue;
@@ -58,7 +57,5 @@ struct File_storage;
 struct Mapped_file_storage;
 struct Simple_file_storage;
 
-
-
 #endif // FPROTO_HH
 
index 8233114ed7674858734ca540e572fca7893a92d7..6d3598954d558715f77c820e1a40b9012ae2be6b 100644 (file)
@@ -8,56 +8,56 @@
 /**
    a struct this for initialising the commandline options.
 */
-struct Long_option_init {
-  char const * take_arg_str0_;
-  char const * longname_str0_;
+struct Long_option_init
+{
+  char const *take_arg_str0_;
+  char const *longname_str0_;
 
   /*
     = 0: don't take short version.
   */
   char shortname_char_;
 
-  char const * help_str0_;
-  
+  char const *help_str0_;
+
   String to_string () const;
   String str_for_help () const;
   //   NO constructor!
 
-  static int compare (Long_option_init const&,Long_option_init const&);
-  static String table_string (Long_option_init *); 
+  static int compare (Long_option_init const &, Long_option_init const &);
+  static String table_string (Long_option_init *);
 };
 
-
 /** C++ for version of long_getopt.  For processing GNU style command
-  line arguments.  No pointer (return values, arguments) contents are
-  copied.
-  
-  TODO: handle 
-  command  - , and command --
-  
-  argument reordering
-  */
-class Getopt_long {
+    line arguments.  No pointer (return values, arguments) contents are
+    copied.
+
+    TODO: handle
+    command  - , and command --
+
+    argument reordering
+*/
+class Getopt_long
+{
 
   /// the option info.
   const Long_option_init *option_a_;
   int table_len_;
-    
+
   /// if doing short option, arg_value_char_a_a_[optind][optindind] is processed next.
   int argument_index_;
 
   /// the option found
   const Long_option_init *found_option_;
 
-
-public: 
+public:
   /** errorcodes: no error, argument expected, no argument expected,
-    unknown option, illegal argument (eg. int expected).  */
+      unknown option, illegal argument (eg. int expected).  */
   enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
-                 E_ILLEGALARG } ;
+                 E_ILLEGALARG };
 
   /// argument. Set to 0 if not present
-  char const * optional_argument_str0_;
+  char const *optional_argument_str0_;
 
   /// current error status
   Errorcod error_;
@@ -84,30 +84,28 @@ public:
   /// report an error and abort
   void report (Errorcod c);
 
-
   /// return an integer (with err. detect)
   long get_argument_index ();
-    
+
   /**
-    What to do with  errors. 
-    report messages on  #*os#, and abort.
-    if #os# is null, then do not report nor abort, just set #error#
-    */
-       
+     What to do with  errors.
+     report messages on  #*os#, and abort.
+     if #os# is null, then do not report nor abort, just set #error#
+  */
+
   void seterror (FILE *os);
 
   /// construct: pass arguments and option info.
-  Getopt_long (int c,  char **v, Long_option_init *lo);
+  Getopt_long (int c, char **v, Long_option_init *lo);
 
-  /**  get the next option. 
-    @return pointer to next option found.
-    0 if error occurred, or next argument is no option.
-    */
-  const Long_option_init *operator () ();
+  /**  get the next option.
+       @return pointer to next option found.
+       0 if error occurred, or next argument is no option.
+  */
+  const Long_option_init *operator() ();
 
   char const *current_arg ();
-  char const * get_next_arg ();
+  char const *get_next_arg ();
 };
 
 #endif // GETOPT_LONG_HH
index 78ec55575b4e666eb8b292378c27cb57bb12b702..690db85d1947f8479269df7edf7d39228a2fe5c4 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   guile-compatibility.hh -- declare compat functions for GUILE 1.6
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #ifndef GUILE_COMPATIBILITY_HH
@@ -22,7 +21,7 @@ inline SCM scm_cdr (SCM x)
 inline SCM scm_car (SCM x)
 {
   if (SCM_NCONSP (x))
-    abort ();    
+    abort ();
   return SCM_CAR (x);
 }
 inline SCM scm_caar (SCM x) { return SCM_CAAR (x); }
@@ -37,7 +36,7 @@ inline SCM scm_cadar (SCM x) { return SCM_CADAR (x); }
 #define scm_gc_register_collectable_memory(a, b, c) scm_done_malloc (b)
 #define scm_is_vector(x) (SCM_VECTORP ((SCM) x))
 #define SCM_HASHTABLE_P(x) (SCM_VECTORP ((SCM) x))
-#define SCM_VECTOR_REF(v, i) (SCM_VELTS ((v))[(i)])
+#define SCM_VECTOR_REF(v, i) (SCM_VELTS ((v))[ (i)])
 #define scm_from_bool(x) (x ? SCM_BOOL_T : SCM_BOOL_F)
 #define scm_from_int(x) SCM_MAKINUM (x)
 #define scm_from_unsigned_integer(x) scm_uint2num (x)
@@ -54,7 +53,7 @@ inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
 inline int ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
 #define scm_is_symbol(x) ly_c_symbol_p (x)
 inline int ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
-#define scm_is_bool(x) ly_c_boolean_p(x)
+#define scm_is_bool(x) ly_c_boolean_p (x)
 inline int ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
 #define scm_is_eq(x, y) (SCM_EQ_P ((x), (y)))
 
@@ -62,7 +61,7 @@ inline int ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
 #define scm_is_pair(x) (SCM_CONSP (x))
 
 #define scm_c_vector_length(x) SCM_VECTOR_LENGTH (x)
-#define scm_c_vector_ref(x, y) SCM_VECTOR_REF(x, y)
+#define scm_c_vector_ref(x, y) SCM_VECTOR_REF (x, y)
 
 inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
 #define scm_to_double(x) (ly_scm2double (x))
index 60fb4c27103048fb01ce19af865ca4a8bf564320..5d1d27f40e00a17751ec5dd338d308384828a691 100644 (file)
@@ -1,35 +1,33 @@
-/*   
+/*
   international.hh -- declare stuff for internationalization
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+*/
 
 #ifndef INTERNATIONAL_HH
 #define INTERNATIONAL_HH
 
-
 /**
- Internationalisation: _i ("to be translated") gets an entry in the POT file
- gettext () must be invoked explicitely to do the actual "translation".
- See flower/getopt-long.cc.
- */
  Internationalisation: _i ("to be translated") gets an entry in the POT file
  gettext () must be invoked explicitely to do the actual "translation".
  See flower/getopt-long.cc.
+*/
 #define _i(sz) sz
 
 // don't inline: get warnings only once
 /**
- Internationalisation: _ ("to be translated") gets "translated" by GNU gettext
  Internationalisation: _ ("to be translated") gets "translated" by GNU gettext
 */
 String _ (char const *ch);
 
 /**
- Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by 
- GNU gettext
+   Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by
  GNU gettext
 */
-String _f (char constformat, ...);
-String _f (char constformat, String s, String s2 = "", String s3 = "");
+String _f (char const *format, ...);
+String _f (char const *format, String s, String s2 = "", String s3 = "");
 
 #endif // INTERNATIONAL_HH
 
index fef00300e7ffa5b37f21df16c307bb6cde793061..4c0ba0ac6a39d949d0da35d38a20a2c8bfb64e75 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   interval-set.hh -- declare Interval_set
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #ifndef INTERVAL_SET_HH
@@ -19,7 +18,7 @@
   Abysmal performance (quadratic) for large N, hopefully we don't have
   that large N. In any case, this should probably be rewritten to use
   a balanced tree.
- */
+*/
 struct Interval_set
 {
   Array<Interval> allowed_regions_;
index 97f1b1225a598e25d1b3b96750bc099c7b7fd77c..3c319cf9d34fe67d289d3fd5e9fed4f9045e0112 100644 (file)
@@ -1,6 +1,6 @@
 /*
   interval.hh -- part of flowerlib
-  
+
   (c) 1996--2005 Han-Wen Nienhuys
 */
 
@@ -23,16 +23,16 @@ struct Interval_t : public Drul_array<T>
   static String T_to_string (T arg);
   T center () const;
   void translate (T t)
-    {
-      elem_ref (LEFT) += t;
-      elem_ref (RIGHT) += t;
-    }
+  {
+    elem_ref (LEFT) += t;
+    elem_ref (RIGHT) += t;
+  }
   void widen (T t)
   {
     elem_ref (LEFT) -= t;
-    elem_ref (RIGHT) += t;    
+    elem_ref (RIGHT) += t;
   }
-  
+
   T distance (T t) const
   {
     if (t > elem (RIGHT))
@@ -43,15 +43,15 @@ struct Interval_t : public Drul_array<T>
       return T (0);
   }
   /**
-    PRE
-    *this and h are comparable
-    */
+     PRE
+     *this and h are comparable
+     */
   void unite (Interval_t<T> h);
   void intersect (Interval_t<T> h);
   void add_point (T p)
   {
-    elem_ref(LEFT) = elem (LEFT) <? p;
-    elem_ref(RIGHT) = elem (RIGHT) >? p;
+    elem_ref (LEFT) = elem (LEFT) <? p;
+    elem_ref (RIGHT) = elem (RIGHT) >? p;
   }
   T length () const;
   T delta () const;
@@ -60,36 +60,39 @@ struct Interval_t : public Drul_array<T>
 
   /*
     TODO: strip hungarian suffix.
-   */
+  */
   bool is_empty () const
   {
     return elem (LEFT) > elem (RIGHT);
   }
-  bool superset (Interval_t<T> const&) const;
+  bool superset (Interval_t<T> const &) const;
   Interval_t ()
   {
     set_empty ();
   }
-  Interval_t (T m, T M) : Drul_array<T> (m,M)
-    {
-    }
-  Interval_t<T> &operator -= (T r) {
+  Interval_t (T m, T M) : Drul_array<T> (m, M)
+  {
+  }
+  Interval_t<T> &operator-= (T r)
+  {
     *this += -r;
     return *this;
   }
 
-  Interval_t<T> &operator += (T r) {
+  Interval_t<T> &operator+= (T r)
+  {
     elem_ref (LEFT) += r;
     elem_ref (RIGHT) +=r;
     return *this;
   }
-  Interval_t<T> &operator *= (T r) {
+  Interval_t<T> &operator*= (T r)
+  {
     if (!is_empty ())
       {
        elem_ref (LEFT) *= r;
        elem_ref (RIGHT) *= r;
        if (r < T (0))
-         swap();
+         swap ();
 
       }
     return *this;
@@ -119,42 +122,39 @@ struct Interval_t : public Drul_array<T>
   }
 };
 
-
 /**
-  inclusion ordering. Crash if not  comparable.
-  */
+   inclusion ordering. Crash if not  comparable.
+*/
 template<class T>
-int Interval__compare (const Interval_t<T>&,Interval_t<T> const&);
+int Interval__compare (const Interval_t<T>&, Interval_t<T> const &);
 
 /**
    Inclusion ordering.  return -2 if not comparable
- */
+*/
 template<class T>
 int
-_Interval__compare (const Interval_t<T>&a,Interval_t<T> const&b);
-
+_Interval__compare (const Interval_t<T>&a, Interval_t<T> const &b);
 
 /*
   INLINE
- */
+*/
 
 #include "compare.hh"
 
 TEMPLATE_INSTANTIATE_COMPARE (Interval_t<T>&, Interval__compare, template<class T>);
 
-
 template<class T>
 inline Interval_t<T>
-intersection (Interval_t<T> a, Interval_t<T> const&b)
+intersection (Interval_t<T> a, Interval_t<T> const &b)
 {
   a.intersect (b);
   return a;
-    
+
 }
 
 template<class T>
 inline
-Interval_t<T> operator + (T a,Interval_t<T> i)
+Interval_t<T> operator+ (T a, Interval_t<T> i)
 {
   i += a;
   return i;
@@ -162,7 +162,7 @@ Interval_t<T> operator + (T a,Interval_t<T> i)
 
 template<class T>
 inline
-Interval_t<T> operator - (Interval_t<T> i, T a)
+Interval_t<T> operator- (Interval_t<T> i, T a)
 {
   i += -a;
   return i;
@@ -170,7 +170,7 @@ Interval_t<T> operator - (Interval_t<T> i, T a)
 
 template<class T>
 inline
-Interval_t<T> operator - (T a,Interval_t<T> i)
+Interval_t<T> operator- (T a, Interval_t<T> i)
 {
   i.negate ();
   i += a;
@@ -179,13 +179,14 @@ Interval_t<T> operator - (T a,Interval_t<T> i)
 
 template<class T>
 inline
-Interval_t<T> operator + (Interval_t<T> i,T a){
-  return a+i;
+Interval_t<T> operator+ (Interval_t<T> i, T a)
+{
+  return a + i;
 }
 
 template<class T>
 inline
-Interval_t<T> operator * (T a,Interval_t<T> i)
+Interval_t<T> operator* (T a, Interval_t<T> i)
 {
   i *= a;
   return i;
@@ -193,11 +194,11 @@ Interval_t<T> operator * (T a,Interval_t<T> i)
 
 template<class T>
 inline
-Interval_t<T> operator * (Interval_t<T> i,T a){
+Interval_t<T> operator* (Interval_t<T> i, T a)
+{
   return a*i;
 }
 
-
 template<class T>
 inline T
 Interval_t<T>::center () const
index 028ad5187ef2c2ad6a392ff0b61ea79f3b0b7db2..b67f18165d312f85e0e7b90e01efcecdbf390cbd 100644 (file)
@@ -6,24 +6,22 @@
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef INTERVAL_TCC
 #define INTERVAL_TCC
 
-#include <cassert> 
+#include <cassert>
 #include <cmath>
 
 #include "interval.hh"
 #include "string.hh"
 
-
 template<class T>
 int
-_Interval__compare (const Interval_t<T>&a,Interval_t<T> const&b)
+_Interval__compare (const Interval_t<T>&a, Interval_t<T> const &b)
 {
   if (a.elem (LEFT) == b.elem (LEFT) && a.elem (RIGHT) == b.elem (RIGHT))
     return 0;
-  
+
   if (a.elem (LEFT) <= b.elem (LEFT) && a.elem (RIGHT) >= b.elem (RIGHT))
     return 1;
 
@@ -34,8 +32,8 @@ _Interval__compare (const Interval_t<T>&a,Interval_t<T> const&b)
 }
 
 template<class T>
-bool 
-Interval_t<T>::superset (Interval_t<T> consta) const
+bool
+Interval_t<T>::superset (Interval_t<T> const &a) const
 {
   int c_i = _Interval__compare (*this, a);
   if (c_i == -2)
@@ -45,9 +43,9 @@ Interval_t<T>::superset (Interval_t<T> const& a) const
 
 template<class T>
 int
-Interval__compare (Interval_t<T> const& a,Interval_t<T> const& b)
+Interval__compare (Interval_t<T> const &a, Interval_t<T> const &b)
 {
-  int i = _Interval__compare (a,b);
+  int i = _Interval__compare (a, b);
   if (i < -1)
     assert (false);
   return i;
@@ -71,17 +69,17 @@ Interval_t<T>::set_full ()
 
 template<class T>
 T
-Interval_t<T>::length () const 
+Interval_t<T>::length () const
 {
-  if (elem (RIGHT) <= elem (LEFT)) 
+  if (elem (RIGHT) <= elem (LEFT))
     return 0;
-  else 
+  else
     return elem (RIGHT) - elem (LEFT);
 }
 
 template<class T>
 T
-Interval_t<T>::delta () const 
+Interval_t<T>::delta () const
 {
   return elem (RIGHT) - elem (LEFT);
 }
@@ -125,9 +123,9 @@ Interval_t<T>::to_string () const
   if (is_empty ())
     return "[empty]";
   String s ("[");
-  return (s + T_to_string (elem (LEFT)) + String ("," )
-         + T_to_string (elem (RIGHT) ) + String ("]" ));
+
+  return (s + T_to_string (elem (LEFT)) + String (",")
+         + T_to_string (elem (RIGHT)) + String ("]"));
 }
 
 template<class T>
@@ -137,7 +135,7 @@ Interval_t<T>::contains (T r)
   return r >= elem (LEFT) && r <= elem (RIGHT);
 }
 
-#define INTERVAL__INSTANTIATE(T) struct Interval_t<T>;\
-template int Interval__compare (const Interval_t<T>&,Interval_t<T> const&)
+#define INTERVAL__INSTANTIATE(T) struct Interval_t<T>;                 \
+  template int Interval__compare (const Interval_t<T>&, Interval_t<T> const &)
 
 #endif // INTERVAL_TCC
index 556d56deeda01fc1ff043833044ac2dc0b49ad5f..3ae9ce66bab0bf3793e435febc30d0c6ff8da68b 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   killing-cons.tcc -- declare Killing_cons
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef KILLING_CONS_TCC
 #define KILLING_CONS_TCC
@@ -19,13 +18,13 @@ Killing_cons<T>::~Killing_cons ()
 }
 
 template<class T>
-void 
-copy_killing_cons_list (Cons_list<T> &dest, Cons<T> *src) 
+void
+copy_killing_cons_list (Cons_list<T> &dest, Cons<T> *src)
 {
-  for (; src; src  = src->next_)
+  for (; src; src = src->next_)
     {
       T *t = new T (*src->car_);
-      dest.append ( new Killing_cons<T> (t, 0));
+      dest.append (new Killing_cons<T> (t, 0));
     }
 }
 
@@ -33,10 +32,10 @@ template<class T>
 void
 clone_killing_cons_list (Cons_list<T> & dest, Cons<T> *src)
 {
-  for (; src; src  = src->next_)
+  for (; src; src = src->next_)
     {
       T *t = src->car_->clone ();
-      dest.append (new Killing_cons<T> (t, 0));      
+      dest.append (new Killing_cons<T> (t, 0));
     }
 }
 
index 9978e237c3dc687f4581fefa85cc900a3d8d4737..a6b5cf83928f4258c77c174e43768040ff7ae59b 100644 (file)
@@ -18,7 +18,7 @@ char *strnlwr (char *start, int n);
 char *strnupr (char *start, int n);
 
 #if ! HAVE_MEMMEM              /* GNU extension. */
-void *memmem (void consthaystack, int haystack_len,
+void *memmem (void const *haystack, int haystack_len,
              void const *needle, int needle_len);
 #endif /* HAVE_MEMMEM */
 
@@ -55,14 +55,15 @@ extern "C" {
 
 #if 1 //! HAVE_FUNOPEN
 
-#define cookie_io_functions_t le_cookie_io_functions_t 
+#define cookie_io_functions_t le_cookie_io_functions_t
   typedef struct
   {
     ssize_t (*read) (void *, char *, size_t);
     ssize_t (*write) (void *, char const *, size_t);
     int (*seek) (void *, off64_t *, int);
     int (*close) (void *);
-  } cookie_io_functions_t;
+  }
+    cookie_io_functions_t;
 
 #else
 
@@ -72,7 +73,8 @@ extern "C" {
     int (*write) (void *, char const *, int);
     fpos_t (*seek) (void *, fpos_t, int);
     int (*close) (void *);
-  } cookie_io_functions_t;
+  }
+    cookie_io_functions_t;
 
 #endif /* ! HAVE_FUNOPEN */
 #endif /* ! HAVE_LIBIO_H */
@@ -86,9 +88,9 @@ extern "C" {
   int handle_cookie_io_fprintf (FILE *file, char const *format, ...);
   int handle_cookie_io_putc (int c, FILE *file);
 
-/* FIXME: ttftool uses fclose fopencookie fprintf and putc only.  if
-          ALIAS_FILE_TO_FILECOOKIE, blondly redefine those functions
-          to wrappers that check for and handle Memory_out_stream.  */
+  /* FIXME: ttftool uses fclose fopencookie fprintf and putc only.  if
+     ALIAS_FILE_TO_FILECOOKIE, blondly redefine those functions
+     to wrappers that check for and handle Memory_out_stream.  */
 #ifdef ALIAS_FILE_TO_FILECOOKIE
 
 #define fclose handle_cookie_io_fclose
index f01c5f4d43043b3e0d304602bbc0925bd2b5bcad..12d2607a3727cee2443c1174a05e786e9d7da689 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef MEMORY_STREAM_HH
index 98f400ed9d1b257953b1337edc7042ae316a4978..a782eb0507d5a85843d4923248c50690c6af25f4 100644 (file)
@@ -14,20 +14,17 @@ Offset complex_multiply (Offset, Offset);
 Offset complex_divide (Offset, Offset);
 Offset complex_exp (Offset);
 
-
 /*
-
-This is a mixture a 2D vector. Sometimes it can
-also be convenient to think of 2D vectors as complex numbers
-(ie. x + i y). The naming of some methods reflects that.
-
+  This is a mixture a 2D vector. Sometimes it can
+  also be convenient to think of 2D vectors as complex numbers
+  (ie. x + i y). The naming of some methods reflects that.
 */
-class Offset 
+class Offset
 {
 public:
   Real coordinate_a_[NO_AXES];
-    
-  Real &operator[] (Axis i) 
+
+  Real &operator[] (Axis i)
   {
     return coordinate_a_[i];
   }
@@ -36,32 +33,32 @@ public:
   {
     return coordinate_a_[i];
   }
-    
-  Offset& operator+= (Offset o) 
+
+  Offset &operator+= (Offset o)
   {
     (*this)[X_AXIS] += o[X_AXIS];
     (*this)[Y_AXIS] += o[Y_AXIS];
     return *this;
   }
 
-  Offset operator - () const 
+  Offset operator- () const
   {
     Offset o = *this;
-    
-    o[X_AXIS]  = - o[X_AXIS];
-    o[Y_AXIS]  = - o[Y_AXIS];
+
+    o[X_AXIS] = -o[X_AXIS];
+    o[Y_AXIS] = -o[Y_AXIS];
     return o;
   }
 
-  Offset& operator-= (Offset o) 
+  Offset &operator-= (Offset o)
   {
     (*this)[X_AXIS] -= o[X_AXIS];
     (*this)[Y_AXIS] -= o[Y_AXIS];
 
     return *this;
   }
-  
-  Offset &scale (Offset o) 
+
+  Offset &scale (Offset o)
   {
     (*this)[X_AXIS] *= o[X_AXIS];
     (*this)[Y_AXIS] *= o[Y_AXIS];
@@ -69,37 +66,37 @@ public:
     return *this;
   }
 
-  Offset &operator *= (Real a) 
+  Offset &operator*= (Real a)
   {
     (*this)[X_AXIS] *= a;
     (*this)[Y_AXIS] *= a;
 
     return *this;
   }
-      
-  Offset (Real ix , Real iy) 
+
+  Offset (Real ix, Real iy)
   {
     coordinate_a_[X_AXIS] =ix;
-    coordinate_a_[Y_AXIS] =iy;    
+    coordinate_a_[Y_AXIS] =iy;
   }
 
-  Offset () 
+  Offset ()
   {
     coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS]= 0.0;
   }
 
   String to_string () const;
 
-  Offsetmirror (Axis a)
+  Offset &mirror (Axis a)
   {
-    coordinate_a_[a] = - coordinate_a_[a];
+    coordinate_a_[a] = -coordinate_a_[a];
     return *this;
   }
-  
+
   Real arg () const;
   Real length () const;
 
-  Offset operator *= (Offset z2) 
+  Offset operator*= (Offset z2)
   {
     *this = complex_multiply (*this, z2);
     return *this;
@@ -134,12 +131,10 @@ mirror (Offset o, Axis a)
 
 inline
 Real
-dot_product  (Offset o1, Offset o2)
+dot_product (Offset o1, Offset o2)
 {
   return o1[X_AXIS] * o2[X_AXIS] + o1[Y_AXIS] * o2[Y_AXIS];
 }
 
-
 #endif /* OFFSET_HH */
 
-
index bbaf1275ee65066a6ff6ca14f6b391dbbabcf23b..5467bf2573e94f3dc18560612e6762b222f146ff 100644 (file)
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef PARRAY_HH
 #define PARRAY_HH
 
 #include "array.hh"
 
-
-
 /**
-  an array of pointers.
+   an array of pointers.
 
-  TODO
-  should init to 0.
- */
+   TODO
+   should init to 0.
+*/
 template<class T>
 class Link_array : private Array<void *>
 {
 
-  Link_array (Array<void*> v)
-    :Array<void*> (v)
-    {
-    }
+  Link_array (Array<void *> v)
+    :Array<void *> (v)
+  {
+  }
 public:
   Link_array ()
-    {}
+  {}
 
-  static int default_compare (T *const& p1, T  *const&p2)
+  static int default_compare (T *const &p1, T *const &p2)
   {
     /* can't do p1 -p2, since T might be an incomplete type */
     if (p1 < p2)
-      return -1 ;
+      return -1;
     if (p2 < p1)
       return 1;
     return 0;
   }
-  Link_array (T * const *tp, int n)
-    : Array<void*> ((void **)tp, n)
-    {
-    }
+  Link_array (T *const *tp, int n)
+    : Array<void *> ((void **)tp, n)
+  {
+  }
 
   Link_array (Link_array<T> const &src)
-    : Array<void*> (src)
-    {
-    }
+    : Array<void *> (src)
+  {
+  }
   /// access element
-  T *elem (int i) const 
-    {
-      return elem_ref (i);
-    }
+  T *elem (int i) const
+  {
+    return elem_ref (i);
+  }
   T *&elem_ref (int i) const
-    {
-      return (T*&) Array<void*>::elem_ref (i);
-    }
+  {
+    return (T *&) Array<void *>::elem_ref (i);
+  }
 
   /// access element
-  T* &operator[] (int i)  
-    {
-      return (T*&) Array<void*>::elem_ref (i);
-    }
+  T *&operator[] (int i)
+  {
+    return (T *&) Array<void *>::elem_ref (i);
+  }
   /// access element
-  T *const operator[] (int i) const 
-    {
-      return (T *const) Array<void*>::elem (i);
-    }
+  T *const operator[] (int i) const
+  {
+    return (T *const) Array<void *>::elem (i);
+  }
   T *pop ()
-    {
-      return (T*) Array<void*>::pop ();
-    }
+  {
+    return (T *) Array<void *>::pop ();
+  }
   void insert (T *t, int i)
-    {
-      Array<void*>::insert (t, i);
-    }
-  void push (Tt)
-    {
-      Array<void*>::push (t);
-    }
+  {
+    Array<void *>::insert (t, i);
+  }
+  void push (T *t)
+  {
+    Array<void *>::push (t);
+  }
   /// return last entry
-  T* top (int j=0) const 
-    {
-      return (T*) Array<void*>::top (j);
-    }
-  T *& top (int i=0)
-    {
-      return (T*&) Array<void*>::top (i);
-    }
-  void substitute (T *old, T*new_p)
-    {
-      int i;
-      while ((i = find_index (old)) >=0) 
-       if (new_p)
-         elem_ref (i) =new_p;
-       else
-         del (i);
-    }
-  void unordered_substitute (T* old, T * new_p)
-    {
-      int i;
-      while ((i = find_index (old)) >=0) 
-       if (new_p)
-         elem_ref (i) =new_p;
-       else {
+  T *top (int j = 0) const
+  {
+    return (T *) Array<void *>::top (j);
+  }
+  T *& top (int i = 0)
+  {
+    return (T *&) Array<void *>::top (i);
+  }
+  void substitute (T *old, T *new_p)
+  {
+    int i;
+    while ((i = find_index (old)) >=0)
+      if (new_p)
+       elem_ref (i) =new_p;
+      else
+       del (i);
+  }
+  void unordered_substitute (T *old, T *new_p)
+  {
+    int i;
+    while ((i = find_index (old)) >=0)
+      if (new_p)
+       elem_ref (i) =new_p;
+      else
+       {
          unordered_del (i);
        }
-    
-    }
-  void default_sort () {
+
+  }
+  void default_sort ()
+  {
     sort (default_compare);
   }
   // quicksort.
-  void sort (int (*compare) (T *const&,T *const&),
+  void sort (int (*compare) (T *const &, T *const &),
             int lower = -1, int upper = -1);
-  
-  void uniq () {
+
+  void uniq ()
+  {
     Link_array<T> ls;
-    for (int i=0; i < size (); i++) 
-      if (!i || elem (i-1) != elem (i))
-       ls.push (elem (i)); 
+    for (int i = 0; i < size (); i++)
+      if (!i || elem (i - 1) != elem (i))
+       ls.push (elem (i));
     *this = ls;
   }
-  Array<void*>::del;
-  Array<void*>::unordered_del;  
-  Array<void*>::size;
-  Array<void*>::clear;
-  Array<void*>::set_size;
-  Array<void*>::is_empty;
-  Array<void*>::reverse;
-  Array<void*>::tighten_maxsize;
+  Array<void *>::del;
+  Array<void *>::unordered_del;
+  Array<void *>::size;
+  Array<void *>::clear;
+  Array<void *>::set_size;
+  Array<void *>::is_empty;
+  Array<void *>::reverse;
+  Array<void *>::tighten_maxsize;
 
   T *& boundary (int d, int i)
   {
@@ -142,7 +142,7 @@ public:
     else
       return elem_ref (i);
   }
-  T * boundary (int d, int i)const
+  T *boundary (int d, int i)const
   {
     assert (d);
     if (d == 1)
@@ -151,91 +151,87 @@ public:
       return elem_ref (i);
   }
 
-  
   T ** accesses () const
-    {
-      return (T**) Array<void*>::accesses ();
-    }
-  T * get (int i)
-    {
-      return (T*) Array<void*>::get (i);
-    }
+  {
+    return (T **) Array<void *>::accesses ();
+  }
+  T *get (int i)
+  {
+    return (T *) Array<void *>::get (i);
+  }
   Link_array<T>
-  slice (int l,int u)
-    {
-      return Array<void*>::slice (l,u);
-    }
+  slice (int l, int u)
+  {
+    return Array<void *>::slice (l, u);
+  }
   void concat (Link_array<T> const &a2)
-    {
-      Array<void*>::concat (a2);
-    }
-  int find_index (T const * t) const {
-    for (int i=0; i < size (); i++)
+  {
+    Array<void *>::concat (a2);
+  }
+  int find_index (T const *t) const
+  {
+    for (int i = 0; i < size (); i++)
       if (elem (i) == t)
        return i;
     return -1;
   }
   T *find (T const *t) const
-    {
-      int i = find_index (t);
-      if (i >= 0)
-       return elem (i);
-      else
-       return 0;
-    }
+  {
+    int i = find_index (t);
+    if (i >= 0)
+      return elem (i);
+    else
+      return 0;
+  }
 };
 
-template<class T, class V>
+template < class T, class V>
 Link_array<T>
-typecasts (Link_array<V> const &a, T * /* dummy */ )
+typecasts (Link_array<V> const &a, T * /* dummy */)
 {
   Link_array<T> ret;
-  for (int i=a.size (); i-- ; )
-       ret.push (dynamic_cast<T*> (a[i]));     // ugh?
+  for (int i = a.size (); i--;)
+    ret.push (dynamic_cast<T *> (a[i]));       // ugh?
   return ret;
 }
 
-
-
 template<class T> inline void
-Link_array<T>::sort (int (*compare)(T *const&,T *const&), int lower, int upper)
+Link_array<T>::sort (int (*compare) (T *const &, T *const &), int lower, int upper)
 {
-  if (lower < 0) 
+  if (lower < 0)
     {
-      lower = 0 ;
+      lower = 0;
       upper = size () - 1;
     }
   if (lower >= upper)
     return;
-  swap (lower, (lower+upper)/2);
+  swap (lower, (lower + upper) / 2);
   int last = lower;
   for (int i= lower +1; i <= upper; i++)
     if (compare (elem (i), elem (lower)) < 0)
-      swap (++last,i);
+      swap (++last, i);
   swap (lower, last);
-  sort (compare, lower, last-1);
-  sort (compare, last+1, upper);
+  sort (compare, lower, last - 1);
+  sort (compare, last + 1, upper);
 }
 
 template<class T>
 void
 junk_pointers (Link_array<T> &a)
 {
-  for (int i=0; i < a.size ();  i++)
+  for (int i = 0; i < a.size (); i++)
     {
       delete a[i];
     }
   a.clear ();
 }
 
-
-
 /*
   lookup with binsearch, return tokencode.
 */
 template<class T>
 int
-binsearch (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
+binsearch (Array<T> const &arr, T t, int (*compare) (T const &, T const &))
 {
   int lo;
   int hi;
@@ -246,15 +242,15 @@ binsearch (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
 
   /* binary search */
   do
-  {
+    {
       cmp = (lo + hi) / 2;
 
       result = compare (t, arr[cmp]);
 
       if (result < 0)
-          hi = cmp;
+       hi = cmp;
       else
-          lo = cmp;
+       lo = cmp;
     }
   while (hi - lo > 1);
   if (!compare (t, arr[lo]))
@@ -263,12 +259,11 @@ binsearch (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
     return -1;              /* not found */
 }
 
-
 template<class T>
 int
 binsearch_links (Link_array<T> const &arr, T *t,
-                     int (*compare) (T *const&,T *const&),
-                     int lo = 0, int hi = -1 )
+                int (*compare) (T *const &, T *const &),
+                int lo = 0, int hi = -1)
 {
   int cmp;
   int result;
@@ -277,18 +272,18 @@ binsearch_links (Link_array<T> const &arr, T *t,
 
   if (hi == 0)
     return -1;
-  
+
   /* binary search */
   do
-  {
+    {
       cmp = (lo + hi) / 2;
 
       result = (*compare) (t, arr[cmp]);
 
       if (result < 0)
-          hi = cmp;
+       hi = cmp;
       else
-          lo = cmp;
+       lo = cmp;
     }
   while (hi - lo > 1);
   if (!compare (t, arr[lo]))
@@ -297,11 +292,10 @@ binsearch_links (Link_array<T> const &arr, T *t,
     return -1;              /* not found */
 }
 
-
 template<class T>
 void
 binary_search_bounds (Link_array<T> const &table,
-                     T const *key, int (*compare) (T * const& , T *const &),
+                     T const *key, int (*compare) (T *const &, T *const &),
                      int *lo,
                      int *hi)
 {
@@ -310,15 +304,15 @@ binary_search_bounds (Link_array<T> const &table,
 
   /* binary search */
   do
-  {
+    {
       cmp = (*lo + *hi) / 2;
 
-      result = (*compare)  ((T*) key, table[cmp]);
+      result = (*compare) ((T *) key, table[cmp]);
 
       if (result < 0)
-          *hi = cmp;
+       *hi = cmp;
       else
-          *lo = cmp;
+       *lo = cmp;
     }
   while (*hi - *lo > 1);
 }
index 3b2d30b577bd0fcee65ee8e78d60dca2e0a99b8e..534dba344e71eee3b0dcc56ce45674ec1de5421e 100644 (file)
@@ -7,20 +7,20 @@
  * (C) 1988, 1989 by Adobe Systems Incorporated. All rights reserved.
  *
  * This file may be freely copied and redistributed as long as:
- *   1) This entire notice continues to be included in the file, 
+ *   1) This entire notice continues to be included in the file,
  *   2) If the file has been modified in any way, a notice of such
  *      modification is conspicuously indicated.
  *
  * PostScript, Display PostScript, and Adobe are registered trademarks of
  * Adobe Systems Incorporated.
- * 
+ *
  * ************************************************************************
  * THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
  * NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
- * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR 
- * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY 
- * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION, 
- * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
+ * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
+ * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
+ * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
+ * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
  * ************************************************************************
  */
  * Together these files provide the functionality to parse Adobe Font
  * Metrics files and store the information in predefined data structures.
  * It is intended to work with an application program that needs font metric
- * information. The program can be used as is by making a procedure call to 
+ * information. The program can be used as is by making a procedure call to
  * parse an AFM file and have the data stored, or an application developer
- * may wish to customize the code. 
+ * may wish to customize the code.
  *
- * This header file defines the data structures used as well as the key 
+ * This header file defines the data structures used as well as the key
  * strings that are currently recognized by this version of the AFM parser.
- * This program is based on the document "Adobe Font Metrics Files, 
+ * This program is based on the document "Adobe Font Metrics Files,
  * Specification Version 2.0".
  *
  * AFM files are separated into distinct sections of different data. Because
  * of this, the parseAFM program can parse a specified file to only save
- * certain sections of information based on the application's needs. A record 
+ * certain sections of information based on the application's needs. A record
  * containing the requested information will be returned to the application.
- * 
+ *
  * AFM files are divided into five sections of data:
  *     1) The Global Font Information
- *     2) The Character Metrics Information 
+ *     2) The Character Metrics Information
  *     3) The Track Kerning Data
  *     4) The Pair-Wise Kerning Data
  *     5) The Composite Character Data
  * of what other sections are requested. In addition, in recognizing that
  * many applications will want ONLY the x-width of characters and not all
  * of the other character metrics information, there is a way to receive
- * only the width information so as not to pay the storage cost for the 
- * unwanted data. An application should never request both the 
- * "quick and dirty" char metrics (widths only) and the Character Metrics 
- * Information since the Character Metrics Information will contain all 
+ * only the width information so as not to pay the storage cost for the
+ * unwanted data. An application should never request both the
+ * "quick and dirty" char metrics (widths only) and the Character Metrics
+ * Information since the Character Metrics Information will contain all
  * of the character widths as well.
- * 
- * There is a procedure in parseAFM.c, called parseFile, that can be 
+ *
+ * There is a procedure in parseAFM.c, called parseFile, that can be
  * called from any application wishing to get information from the AFM File.
  * This procedure expects 3 parameters: a vaild file descriptor, a pointer
- * to a (FontInfo *) variable (for which space will be allocated and then 
+ * to a (FontInfo *) variable (for which space will be allocated and then
  * will be filled in with the data requested), and a mask specifying
  * which data from the AFM File should be saved in the FontInfo structure.
- * 
+ *
  * The flags that can be used to set the appropriate mask are defined below.
- * In addition, several commonly used masks have already been defined. 
- * 
+ * In addition, several commonly used masks have already been defined.
+ *
  * History:
  *     original: DSM  Thu Oct 20 17:39:59 PDT 1988
  *  modified: DSM  Mon Jul  3 14:17:50 PDT 1989
 #define BOOL int
 #define FLAGS int
 
-
-
 /* Possible return codes from the parseFile procedure.
- * 
+ *
  * ok means there were no problems parsing the file.
  *
  * parseError means that there was some kind of parsing error, but the
  * parser went on. This could include problems like the count for any given
  * section does not add up to how many entries there actually were, or
  * there was a key that was not recognized. The return record may contain
- * vaild data or it may not. 
+ * vaild data or it may not.
  *
  * earlyEOF means that an End of File was encountered before expected. This
  * may mean that the AFM file had been truncated, or improperly formed.
- * 
+ *
  * storageProblem means that there were problems allocating storage for
  * the data structures that would have contained the AFM data.
  */
 #define AFM_earlyEOF -2
 #define AFM_storageProblem -3
 
-
-
 /************************* TYPES *********************************/
 /* Below are all of the data structure definitions. These structures
- * try to map as closely as possible to grouping and naming of data 
+ * try to map as closely as possible to grouping and naming of data
  * in the AFM Files.
  */
 
-
-/* Bounding box definition. Used for the Font AFM_BBox as well as the 
+/* Bounding box definition. Used for the Font AFM_BBox as well as the
  * Character AFM_BBox.
  */
 typedef struct
-{ 
-   int llx;    /* lower left x-position  */
-   int lly;    /* lower left y-position  */
-   int urx;    /* upper right x-position */
-   int ury;    /* upper right y-position */
-} AFM_BBox;
-
+{
+  int llx;     /* lower left x-position  */
+  int lly;     /* lower left y-position  */
+  int urx;     /* upper right x-position */
+  int ury;     /* upper right y-position */
+}
+  AFM_BBox;
 
 /* Global Font information.
- * The key that each field is associated with is in comments. For an 
+ * The key that each field is associated with is in comments. For an
  * explanation about each key and its value please refer to the AFM
- * documentation (full title & version given above). 
+ * documentation (full title & version given above).
  */
 typedef struct
-{  
-   char *afmVersion;           /* key: StartFontMetrics */
-   char *fontName;             /* key: FontName */
-   char *fullName;             /* key: FullName */
-   char *familyName;           /* key: FamilyName */
-   char *weight;               /* key: Weight */
-   float italicAngle;          /* key: ItalicAngle */
-   BOOL isFixedPitch;          /* key: IsFixedPitch */
-   AFM_BBox fontBBox;          /* key: FontBBox */
-   int underlinePosition;      /* key: UnderlinePosition */
-   int underlineThickness;     /* key: UnderlineThickness */
-   char *version;              /* key: Version */
-   char *notice;               /* key: Notice */
-   char *encodingScheme;       /* key: EncodingScheme */
-   int capHeight;              /* key: CapHeight */
-   int xHeight;                        /* key: XHeight */
-   int ascender;               /* key: Ascender */
-   int descender;              /* key: Descender */
-} AFM_GlobalFontInfo;
-
+{
+  char *afmVersion;            /* key: StartFontMetrics */
+  char *fontName;              /* key: FontName */
+  char *fullName;              /* key: FullName */
+  char *familyName;            /* key: FamilyName */
+  char *weight;                /* key: Weight */
+  float italicAngle;           /* key: ItalicAngle */
+  BOOL isFixedPitch;           /* key: IsFixedPitch */
+  AFM_BBox fontBBox;           /* key: FontBBox */
+  int underlinePosition;       /* key: UnderlinePosition */
+  int underlineThickness;      /* key: UnderlineThickness */
+  char *version;               /* key: Version */
+  char *notice;                /* key: Notice */
+  char *encodingScheme;        /* key: EncodingScheme */
+  int capHeight;               /* key: CapHeight */
+  int xHeight;                 /* key: XHeight */
+  int ascender;                /* key: Ascender */
+  int descender;               /* key: Descender */
+}
+  AFM_GlobalFontInfo;
 
 /* Ligature definition is a linked list since any character can have
  * any number of ligatures.
  */
 typedef struct _t_ligature
 {
-    char *succ, *lig;
-    struct _t_ligature *next;
-} AFM_Ligature;
-
+  char *succ, *lig;
+  struct _t_ligature *next;
+}
+  AFM_Ligature;
 
-/* Character Metric Information. This structure is used only if ALL 
+/* Character Metric Information. This structure is used only if ALL
  * character metric information is requested. If only the character
  * widths is requested, then only an array of the character x-widths
  * is returned.
  *
- * The key that each field is associated with is in comments. For an 
- * explanation about each key and its value please refer to the 
+ * The key that each field is associated with is in comments. For an
+ * explanation about each key and its value please refer to the
  * Character Metrics section of the AFM documentation (full title
- * & version given above). 
+ * & version given above).
  */
 typedef struct
 {
-    int code,          /* key: C */
-        wx,            /* key: WX */
-        wy;            /* together wx and wy are associated with key: W */
-    char *name;        /* key: N */
-    AFM_BBox charBBox; /* key: B */
-    AFM_Ligature *ligs;        /* key: L (linked list; not a fixed number of Ls */
-} AFM_CharMetricInfo;
-
+  int code,            /* key: C */
+    wx,                /* key: WX */
+    wy;                /* together wx and wy are associated with key: W */
+  char *name;  /* key: N */
+  AFM_BBox charBBox;   /* key: B */
+  AFM_Ligature *ligs;  /* key: L (linked list; not a fixed number of Ls */
+}
+  AFM_CharMetricInfo;
 
 /* Track kerning data structure.
- * The fields of this record are the five values associated with every 
+ * The fields of this record are the five values associated with every
  * TrackKern entry.
- *  
- * For an explanation about each value please refer to the 
+ *
+ * For an explanation about each value please refer to the
  * Track Kerning section of the AFM documentation (full title
- * & version given above). 
+ * & version given above).
  */
-typedef struct 
+typedef struct
 {
-    int degree;  
-    float minPtSize, 
-          minKernAmt, 
-          maxPtSize, 
-          maxKernAmt;
-} AFM_TrackKernData;
-
+  int degree;
+  float minPtSize,
+    minKernAmt,
+    maxPtSize,
+    maxKernAmt;
+}
+  AFM_TrackKernData;
 
 /* Pair Kerning data structure.
  * The fields of this record are the four values associated with every
  * KP entry. For KPX entries, the yamt will be zero.
  *
- * For an explanation about each value please refer to the 
+ * For an explanation about each value please refer to the
  * Pair Kerning section of the AFM documentation (full title
- * & version given above). 
+ * & version given above).
  */
-typedef struct 
+typedef struct
 {
-    char *name1;
-    char *name2;
-    int xamt,
-        yamt;
-} AFM_PairKernData;
-
+  char *name1;
+  char *name2;
+  int xamt,
+    yamt;
+}
+  AFM_PairKernData;
 
 /* AFM_Pcc is a piece of a composite character. This is a sub structure of a
  * AFM_CompCharData described below.
  * These fields will be filled in with the values from the key AFM_Pcc.
- * 
- * For an explanation about each key and its value please refer to the 
+ *
+ * For an explanation about each key and its value please refer to the
  * Composite Character section of the AFM documentation (full title
- * & version given above).  
+ * & version given above).
  */
 typedef struct
 {
-    char *AFM_PccName;
-    int deltax,
-        deltay;
-} AFM_Pcc;
+  char *AFM_PccName;
+  int deltax,
+    deltay;
+}
+  AFM_Pcc;
 
-
-/* Composite Character Information data structure. 
+/* Composite Character Information data structure.
  * The fields ccName and numOfPieces are filled with the values associated
  * with the key CC. The field pieces points to an array (size = numOfPieces)
  * of information about each of the parts of the composite character. That
  * array is filled in with the values from the key AFM_Pcc.
- * 
- * For an explanation about each key and its value please refer to the 
+ *
+ * For an explanation about each key and its value please refer to the
  * Composite Character section of the AFM documentation (full title
- * & version given above).  
+ * & version given above).
  */
 typedef struct
 {
-    char *ccName;
-    int numOfPieces;
-    AFM_Pcc *pieces;
-} AFM_CompCharData;
-
+  char *ccName;
+  int numOfPieces;
+  AFM_Pcc *pieces;
+}
+  AFM_CompCharData;
 
 /*  FontInfo
  *  Record type containing pointers to all of the other data
@@ -262,19 +257,19 @@ typedef struct
  *  parseFile function.
  */
 typedef struct
-{ 
-    AFM_GlobalFontInfo *gfi;   /* ptr to a AFM_GlobalFontInfo record */
-    int *cwi;                  /* ptr to 256 element array of just char widths */ 
-    int numOfChars;            /* number of entries in char metrics array */
-    AFM_CharMetricInfo *cmi;   /* ptr to char metrics array */
-    int numOfTracks;           /* number to entries in track kerning array */
-    AFM_TrackKernData *tkd;            /* ptr to track kerning array */
-    int numOfPairs;            /* number to entries in pair kerning array */
-    AFM_PairKernData *pkd;             /* ptr to pair kerning array */
-    int numOfComps;            /* number to entries in comp char array */
-    AFM_CompCharData *ccd;             /* ptr to comp char array */
-} AFM_Font_info;
-
+{
+  AFM_GlobalFontInfo *gfi;     /* ptr to a AFM_GlobalFontInfo record */
+  int *cwi;                    /* ptr to 256 element array of just char widths */
+  int numOfChars;              /* number of entries in char metrics array */
+  AFM_CharMetricInfo *cmi;     /* ptr to char metrics array */
+  int numOfTracks;             /* number to entries in track kerning array */
+  AFM_TrackKernData *tkd;              /* ptr to track kerning array */
+  int numOfPairs;              /* number to entries in pair kerning array */
+  AFM_PairKernData *pkd;               /* ptr to pair kerning array */
+  int numOfComps;              /* number to entries in comp char array */
+  AFM_CompCharData *ccd;               /* ptr to comp char array */
+}
+  AFM_Font_info;
 
 
 /************************* PROCEDURES ****************************/
@@ -283,7 +278,7 @@ typedef struct
  *
  *  "fp" should be a valid file pointer to an AFM file.
  *
- *  "fi" is a pointer to a pointer to a FontInfo record sturcture 
+ *  "fi" is a pointer to a pointer to a FontInfo record sturcture
  * (defined above). Storage for the FontInfo structure will be
  *  allocated in parseFile and the structure will be filled in
  *  with the requested data from the AFM File.
index 1422f9d63d96e27c208d40a589614e1630807db9..ec61d47103eae2c9b05e8ce9677c5c7ee3d52b1b 100644 (file)
@@ -19,20 +19,20 @@ struct Polynomial
   int degree ()const;
 
   /// coefficients 
-  Array<Real>     coefs_;
+  Array<Real> coefs_;
 
   // leading coef
   Real &lc ();
 
   // leading coef
   Real lc () const;
-  void print () const ;        
-  Real eval (Real) const ;
-  void print_sols (Array<Real>) const ;
-  void check_sols (Array<Real>) const ;
+  void print () const;
+  Real eval (Real) const;
+  void print_sols (Array<Real>) const;
+  void check_sols (Array<Real>) const;
   void check_sol (Real x) const;
-  static Polynomial multiply (const Polynomial & p1, const Polynomial & p2);
-  static Polynomial power (int exponent, const Polynomial & src);
+  static Polynomial multiply (const Polynomial &p1, const Polynomial &p2);
+  static Polynomial power (int exponent, const Polynomial &src);
 
   /// chop low coefficients
   void clean ();
@@ -40,15 +40,15 @@ struct Polynomial
   /// eliminate #x#  close to  zero
   void real_clean ();
   void scalarmultiply (Real fact);
-  void operator *= (Real f) { scalarmultiply (f); }
-  void operator /= (Real f) { scalarmultiply (1/f); }
-  void operator += (Polynomial const &p2);
-  void operator *= (Polynomial const &p2);
-  void operator -= (Polynomial const &p2);
+  void operator*= (Real f) { scalarmultiply (f); }
+  void operator/= (Real f) { scalarmultiply (1 / f); }
+  void operator+= (Polynomial const &p2);
+  void operator*= (Polynomial const &p2);
+  void operator-= (Polynomial const &p2);
   Polynomial (Real a, Real b =0.0);
   Polynomial (){}
-  void set_negate (const Polynomial & src);
-    
+  void set_negate (const Polynomial &src);
+
   /// take the derivative
   void differentiate ();
   int set_mod (const Polynomial &u, const Polynomial &v);
@@ -62,19 +62,18 @@ struct Polynomial
   Array<Real> solve () const;
 };
 
-
-IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, - );
-IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, + );
-IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, * );
+IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, -);
+IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, +);
+IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, *);
 
 inline Polynomial
-operator * (Polynomial p, Real a)
+operator* (Polynomial p, Real a)
 {
   p *=a;
   return p;
 }
 inline Polynomial
-operator * (Real a,Polynomial p)
+operator* (Real a, Polynomial p)
 {
   p *=a;
   return p;
index d7a8375fcbb102238eef5656639d989578b7f60f..c80dae2131690048dec823535dab78ca753b3d1b 100644 (file)
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef PQUEUE_HH
 #define PQUEUE_HH
 #include "array.hh"
 
-
-template<class K, class T>
+template < class K, class T>
 struct PQueue_ent
 {
-    T val;
-    K key;
+  T val;
+  K key;
 };
 
-template<class K, class T>
-int compare (PQueue_ent<K,T> const &e1 , PQueue_ent<K,T> const &e2) {
-    return compare (e1.key , e2.key);
+template < class K, class T>
+int compare (PQueue_ent < K, T> const &e1, PQueue_ent < K, T> const &e2)
+{
+  return compare (e1.key, e2.key);
 }
 
 /**
-  Priority queue using a (variable size) in-situ heap.
+   Priority queue using a (variable size) in-situ heap.
 
-  Hungarian postfix pq
-  
-  TODO: add increase/decrease operations,
-  add max () operation
- */
+   Hungarian postfix pq
+
+   TODO: add increase/decrease operations,
+   add max () operation
+*/
 template<class T>
-class PQueue {
-    Array<T> heap_array_;
-    T &elt (int i) {
-       return heap_array_[i-1];
-    }
-    T const&elt (int i) const {
-       return heap_array_[i-1];
-    }
+class PQueue
+{
+  Array<T> heap_array_;
+  T &elt (int i)
+  {
+    return heap_array_[i - 1];
+  }
+  T const &elt (int i) const
+  {
+    return heap_array_[i - 1];
+  }
 public:
-    /** acces an heap element.  Careful with this, as changing the
+  /** acces an heap element.  Careful with this, as changing the
       priority might fuck up the invariants
 
       @param 1 <= i < size () */
-    T& operator[] (int i) { return heap_array_[i]; }
-    T operator[] (int i) const { return heap_array_[i]; }
-    void OK () const
-    {
+  T &operator[] (int i) { return heap_array_[i]; }
+  T operator[] (int i) const { return heap_array_[i]; }
+  void OK () const
+  {
 #ifndef NDEBUG
-       for (int i =2; i <= size (); i++)
-           assert (compare (elt (i/2), elt (i)) <= 0);
+    for (int i =2; i <= size (); i++)
+      assert (compare (elt (i / 2), elt (i)) <= 0);
 #endif
-    }
-    T front () const { return elt (1); }
-    int size () const { return heap_array_.size (); }
-    void insert (T v) {
-       heap_array_.push (v);
-       int i = heap_array_.size ();
-       int j = i / 2 ;
-       while (j) {
-           if (compare (elt (j), v) > 0) {
-               elt (i) = elt (j);      
-               i = j;
-               j = i/2;
-           } else {
-               break;
-           }
-       }
-       elt (i) = v;
-       OK ();
-    }
-    T max () const {
-       //int first_leaf_i = size ();
-       T max_t;
-       return max_t;
-    }
-    void delmin () {
-       assert (size ());
-       T last = heap_array_.top ();
-       
-       int mini=2;
-       int lasti=1;
+  }
+  T front () const { return elt (1); }
+  int size () const { return heap_array_.size (); }
+  void insert (T v)
+  {
+    heap_array_.push (v);
+    int i = heap_array_.size ();
+    int j = i / 2;
+    while (j)
+      {
+       if (compare (elt (j), v) > 0)
+         {
+           elt (i) = elt (j);
+           i = j;
+           j = i / 2;
+         }
+       else
 
-       while (mini < size ()) {
-           if (compare (elt (mini + 1), elt (mini)) <0)
-               mini++;
-           if (compare (last,elt (mini)) < 0)
-               break;
-           elt (lasti) = elt (mini);
-           lasti = mini;
-           mini *= 2;
-       }
-       elt (lasti) = last;
-       heap_array_.pop ();
-       OK ();
-    }
-    T get () { 
-       T t = front ();
-       delmin ();
-       return t;
-    }
-};
+         {
+           break;
+         }
+      }
+    elt (i) = v;
+    OK ();
+  }
+  T max () const
+  {
+    //int first_leaf_i = size ();
+    T max_t;
+    return max_t;
+  }
+  void delmin ()
+  {
+    assert (size ());
+    T last = heap_array_.top ();
 
+    int mini = 2;
+    int lasti = 1;
+
+    while (mini < size ())
+      {
+       if (compare (elt (mini + 1), elt (mini)) <0)
+         mini++;
+       if (compare (last, elt (mini)) < 0)
+         break;
+       elt (lasti) = elt (mini);
+       lasti = mini;
+       mini *= 2;
+      }
+    elt (lasti) = last;
+    heap_array_.pop ();
+    OK ();
+  }
+  T get ()
+  {
+    T t = front ();
+    delmin ();
+    return t;
+  }
+};
 
 #endif // PQUEUE_HH
index 8ac80fb1246a0b507f6d842a1d3d230e2f8b24fc..a0973e2d58375a46d69fb02316a7e186aaeed285 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef RATIONAL_HH
 #define RATIONAL_HH
 
@@ -14,8 +13,9 @@
 
 /**
    Rational numbers.  Included is support for + and - infinity.
- */
-class Rational {
+*/
+class Rational
+{
   /**
      Sign of rational.
      -2, .. 2
@@ -23,7 +23,7 @@ class Rational {
      -2,2 is - and + infinity.
      -1,1 is negative and positive.
      0 if *this is zero.
-   */
+  */
   int sign_;
   unsigned int num_, den_;
   void normalise ();
@@ -35,8 +35,8 @@ public:
   void invert ();
   int numerator () const { return sign_ * num_; }
   int denominator () const { return den_; }
-  int num () const { return numerator(); }
-  int den () const { return denominator(); }
+  int num () const { return numerator (); }
+  int den () const { return denominator (); }
 
   Rational trunc_rat () const;
   Rational div_rat (Rational) const;
@@ -45,42 +45,43 @@ public:
   //   operator bool () const;
   int to_int () const;
   operator double () const;
-  Rational operator - () const;
+  Rational operator- () const;
   /**
-     Initialize to 0. 
-   */
+     Initialize to 0.
+  */
   Rational ();
   Rational (int);
   Rational (int, int);
   Rational (double);
-  Rational (Rational const&r) {   copy (r);}
-  Rational &operator = (Rational const &r) {
+  Rational (Rational const &r) { copy (r);}
+  Rational &operator= (Rational const &r)
+  {
     copy (r); return *this;
   }
 
-  Rational &operator *= (Rational);
-  Rational &operator /= (Rational);  
-  Rational &operator += (Rational);
-  Rational &operator -= (Rational);
-  Rational &operator %= (Rational);
-  static int compare (Rational const&, Rational const&);
+  Rational &operator*= (Rational);
+  Rational &operator/= (Rational);
+  Rational &operator+= (Rational);
+  Rational &operator-= (Rational);
+  Rational &operator%= (Rational);
+  static int compare (Rational const &, Rational const &);
   int sign () const;
   String to_string () const;
 };
 
-IMPLEMENT_ARITHMETIC_OPERATOR (Rational, / );
-IMPLEMENT_ARITHMETIC_OPERATOR (Rational, + );
-IMPLEMENT_ARITHMETIC_OPERATOR (Rational, * );
-IMPLEMENT_ARITHMETIC_OPERATOR (Rational, - );
-IMPLEMENT_ARITHMETIC_OPERATOR (Rational, % );
+IMPLEMENT_ARITHMETIC_OPERATOR (Rational, /);
+IMPLEMENT_ARITHMETIC_OPERATOR (Rational, +);
+IMPLEMENT_ARITHMETIC_OPERATOR (Rational, *);
+IMPLEMENT_ARITHMETIC_OPERATOR (Rational, -);
+IMPLEMENT_ARITHMETIC_OPERATOR (Rational, %);
 
-INSTANTIATE_COMPARE (Rational const&, Rational::compare);
+INSTANTIATE_COMPARE (Rational const &, Rational::compare);
 
-int compare (Rational const&,Rational const&);
+int compare (Rational const &, Rational const &);
 int sign (Rational r);
 
 inline void
-Rational::copy (Rational const&r)
+Rational::copy (Rational const &r)
 {
   sign_ = r.sign_;
   num_ = r.num_;
@@ -89,7 +90,7 @@ Rational::copy (Rational const&r)
 
 #if 0
 ostream &
-operator << (ostream &,  Rational);
+operator<< (ostream &, Rational);
 #endif
 
 const Rational infinity_rat = INT_MAX;
index ce7a0e0a857f54ab561e799576bbe9ca4938c008..43a35179a655d9f117f28ba822263af1912dc6ff 100644 (file)
@@ -6,11 +6,9 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef REAL_HH
 #define REAL_HH
 
-
 #include <climits>
 
 typedef double Real;
@@ -38,16 +36,15 @@ template<class T> inline T sqr (T x)
   return x*x;
 }
 
-
 template<class T> inline T min (T x, T y)
 {
   return x <? y;
 }
 
 inline Real
-distance (Real x,Real y)
+distance (Real x, Real y)
 {
-    return abs (x-y);
+  return abs (x - y);
 }
 
 #endif
index 65d2c98b87174c8a388ebefe2eb2f7b8c617f83f..8a694742dcc3228677242d2ace095a53be426c88 100644 (file)
@@ -1,7 +1,6 @@
 /*
   PROJECT: FlowerSoft C++ library
   FILE   : string-convert.hh
-
 */
 
 #ifndef STRING_CONVERT_HH
 
 #include "string.hh"
 
-
 /** The functor String_convert handles all conversions to/from String
- (some time, anyway).  The class is quite empty from data view.  */
-class String_convert {
-  static int hex2bin (String hex_string, String& bin_string_r);
+    (some time, anyway).  The class is quite empty from data view.  */
+class String_convert
+{
+  static int hex2bin (String hex_string, String &bin_string_r);
   static int hex2nibble (Byte byte);
   static Byte nibble2hex_byte (Byte byte);
 public:
@@ -29,13 +28,13 @@ public:
   static String char_string (char c, int n);
   static int dec2int (String dec_string);
   static double dec2double (String dec_string);
-  static String double_string (double f, char const* fmt=0);
-  static String form_string (char constformat, ...);
-  static String vform_string (char constformat, va_list args);
+  static String double_string (double f, char const *fmt = 0);
+  static String form_string (char const *format, ...);
+  static String vform_string (char const *format, va_list args);
   static int hex2int (String str);
   static unsigned hex2unsigned (String str);
   static String hex2bin (String str);
-  static String int_string (int i, char const *fmt=0 );
+  static String int_string (int i, char const *fmt = 0);
   static String long_string (long);
   static String int2hex (int i, int length_i, char ch);
   static String unsigned2hex (unsigned u, int length_i, char ch);
@@ -44,7 +43,7 @@ public:
   static String pointer_string (void const *);
   static String precision_string (double x, int n);
   static Array<String> split (String str, char c);
-  static String i64_string (I64, char const * fmt = 0);
+  static String i64_string (I64, char const *fmt = 0);
 };
 
 #endif // __STRING_CONVERT_HH //
index 4cb3bbc3170be7437f36a35f76efe153aa47305d..378432f3ee7dbb3afa9f93a78e8a1343483641a9 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef STRINGDATA_HH
 #define STRINGDATA_HH
 
 
 /**Internal String struct.
    the data itself. Handles simple tasks (resizing, resetting)
-   */
-class String_data {
-    // GNU malloc: storage overhead is 8 bytes anyway.
-
-friend class String_handle;
-    int maxlen;        // maxlen is arraysize-1
-    
-    int length_;
-    Byte* data_byte_;
-    int ref_count_;
-
-    /// init to ""
-    String_data ();
-
-    /// init from src. Conservative allocation.
-    String_data (String_data const &src); 
-    
-    ~String_data ();
-
-    /** POST: maxlen >= j.
-      @param j, maximum stringlength_.    
+*/
+class String_data
+{
+  // GNU malloc: storage overhead is 8 bytes anyway.
+
+  friend class String_handle;
+  int maxlen;  // maxlen is arraysize-1
+
+  int length_;
+  Byte *data_byte_;
+  int ref_count_;
+
+  /// init to ""
+  String_data ();
+
+  /// init from src. Conservative allocation.
+  String_data (String_data const &src);
+
+  ~String_data ();
+
+  /** POST: maxlen >= j.
+      @param j, maximum stringlength_.
       contents thrown away.
-    */
-    void setmax (int j);
-    
-    /** POST: maxlen >= j.
+  */
+  void setmax (int j);
+
+  /** POST: maxlen >= j.
       @param j, maximum stringlength_.
       contents are kept if it grows.
-      */
-    void remax (int j);
+  */
+  void remax (int j);
+
+  /// check if writeable.
+  void OKW ();
 
-    /// check if writeable.
-    void OKW ();
+  /// check state.
+  void OK ();
 
-    /// check state.
-    void OK ();
+  /// reduce memory usage.
+  void tighten ();
 
-    /// reduce memory usage.
-    void tighten ();
+  // assignment.
+  void set (Byte const *byte, int length_i);
 
-    // assignment.
-    void set (Byte const* byte, int length_i);
+  void set (char const *str0);
 
-    void set (char const* str0);
-    
-    /// concatenation.
-    void append (Byte const* byte, int length_i);
+  /// concatenation.
+  void append (Byte const *byte, int length_i);
 
-    void operator += (char const* str0);
+  void operator+= (char const *str0);
 
-    char const* to_str0 () const; 
+  char const *to_str0 () const;
 
-    char* get_str0 ();
+  char *get_str0 ();
 
-    Byte const* to_bytes () const;
+  Byte const *to_bytes () const;
 
-    // idem, non const
-    Byte* get_bytes ();
+  // idem, non const
+  Byte *get_bytes ();
 
-    void trunc (int j);
+  void trunc (int j);
 
-    /** access element. not really safe. Can alter length_ without
+  /** access element. not really safe. Can alter length_ without
       #String_data# knowing it.  */
-    Byte &operator [] (int j);
-    Byte operator [] (int j) const;
-    bool is_binary_bo () const;
+  Byte &operator[] (int j);
+  Byte operator[] (int j) const;
+  bool is_binary_bo () const;
 };
 
-
-
 #ifdef STRING_UTILS_INLINED
 #ifndef INLINE
 #define INLINE inline
@@ -92,5 +90,4 @@ friend class String_handle;
 
 #endif
 
-
 #endif // STRING_DATA_HH
index 5f3ca8b626fcbf12b5bea877e557f945e3ddc9b8..9e7fe6f0ad24d57e37e3d05dbb825e9ae31dfe84 100644 (file)
@@ -1,9 +1,9 @@
 /* -*-C++-*-
-  String_data.inl -- implement String_data
+   String_data.inl -- implement String_data
 
-  source file of Flower lib
+   source file of Flower lib
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #ifndef STRINGDATA_INL
 #include <memory.h>
 
 #include "string-data.hh"
-const int INITIALMAX=8;
+const int INITIALMAX = 8;
 
 #include <sys/types.h>
 
-INLINE void 
-String_data::OKW () 
+INLINE void
+String_data::OKW ()
 {
   assert (ref_count_ == 1);
 }
 
-INLINE void 
-String_data::OK () 
+INLINE void
+String_data::OK ()
 {
   assert (maxlen >= length_);
   assert (bool (data_byte_));
   assert (ref_count_ >= 1);
 }
 
-
 INLINE
-String_data::String_data () 
+String_data::String_data ()
 {
-  ref_count_=0;
+  ref_count_ = 0;
   maxlen = INITIALMAX;
   data_byte_ = new Byte[maxlen + 1];
   data_byte_[0] = 0;
@@ -45,143 +44,140 @@ String_data::String_data ()
 }
 
 INLINE
-String_data::String_data (String_data const &src) 
+String_data::String_data (String_data const &src)
 {
-  ref_count_=0;        
-  maxlen = length_ = src.length_;              
-  data_byte_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.  
-  memcpy (data_byte_, src.data_byte_, length_ + 1);    
+  ref_count_ = 0;
+  maxlen = length_ = src.length_;
+  data_byte_ = new Byte[maxlen + 1]; // should calc GNU 8byte overhead.        
+  memcpy (data_byte_, src.data_byte_, length_ + 1);
 }
 
 INLINE
-String_data::~String_data () 
+String_data::~String_data ()
 {
   assert (ref_count_ == 0);
   delete[] data_byte_;
 }
 
-INLINE void 
-String_data::setmax (int j) 
-{      
+INLINE void
+String_data::setmax (int j)
+{
   OKW ();
-  if (j > maxlen) 
+  if (j > maxlen)
     {
       delete[] data_byte_;
       maxlen = j;
       data_byte_ = new Byte[maxlen + 1];
-  
+
       data_byte_[0] = 0;
       length_ = 0;
     }
 }
 
-/* this is all quite hairy:  
-        update of length_
-        update of maxlen
-        alloc of buffer
-        copying of buffer
- needs blondification: 
-       split tasks
-       define change authority
+/* this is all quite hairy:
+   update of length_
+   update of maxlen
+   alloc of buffer
+   copying of buffer
+   needs blondification:
+   split tasks
+   define change authority
 */
-INLINE void 
-String_data::remax (int j) 
+INLINE void
+String_data::remax (int j)
 {
   OKW ();
-  if (j > maxlen) 
+  if (j > maxlen)
     {
-      Byte *p = new Byte[j + 1];       
-      memcpy (p, data_byte_, (maxlen <? length_) + 1 );            
+      Byte *p = new Byte[j + 1];
+      memcpy (p, data_byte_, (maxlen <? length_) + 1);
       maxlen = j;
       delete[] data_byte_;
       data_byte_ = p;
     }
 }
 
-INLINE void 
-String_data::tighten () 
+INLINE void
+String_data::tighten ()
 { // should be dec'd const
   maxlen = length_;
-  Byte *p = new Byte[maxlen + 1];          
-  memcpy (p, data_byte_, length_ + 1);     
+  Byte *p = new Byte[maxlen + 1];
+  memcpy (p, data_byte_, length_ + 1);
   delete[] data_byte_;
-  data_byte_ = p;              
+  data_byte_ = p;
 }
 // assignment.
-INLINE void 
-String_data::set (Byte const* byte, int length_i) 
+INLINE void
+String_data::set (Byte const *byte, int length_i)
 {
   OKW ();
 
   assert (byte && byte != data_byte_);
 
   length_ = length_i;
-  remax (length_);     // copies too
+  remax (length_); // copies too
   memcpy (data_byte_, byte, length_);
   data_byte_[ length_ ] = 0;
 }
 
 INLINE
-void 
-String_data::set (char const* str0) 
+void
+String_data::set (char const *str0)
 {
-  set ((Byte const*)str0, strlen (str0) );
+  set ((Byte const *)str0, strlen (str0));
 }
 
-
 /// concatenation.
-INLINE void 
-String_data::append (Byte const* byte, int length_i) 
+INLINE void
+String_data::append (Byte const *byte, int length_i)
 {
   OK ();
   OKW ();
   int old_i = length_;
-  
+
   length_ += length_i;
   remax (length_);
-  memcpy (data_byte_ + old_i, byte, length_i); 
+  memcpy (data_byte_ + old_i, byte, length_i);
   data_byte_[ length_ ] = 0;
 }
 
 INLINE
-void 
-String_data::operator += (char const* str0) 
+void
+String_data::operator+= (char const *str0)
 {
-  append ((Byte const*)str0, strlen (str0) );
+  append ((Byte const *)str0, strlen (str0));
 }
 
-
-
 INLINE
-char const*
+char const *
 String_data::to_str0 () const
 {
-  return (char const*)data_byte_; 
+  return (char const *)data_byte_;
 }
-INLINE char
-String_data::get_str0 () 
-{ 
-  return (char*)data_byte_; 
+INLINE char *
+String_data::get_str0 ()
+{
+  return (char *)data_byte_;
 }
 
-INLINE Byte const*
-String_data::to_bytes () const 
-{ 
-  return data_byte_; 
+INLINE Byte const *
+String_data::to_bytes () const
+{
+  return data_byte_;
 }
 
-INLINE Byte
-String_data::get_bytes () 
+INLINE Byte *
+String_data::get_bytes ()
 {
   OKW ();
   return data_byte_;
 }
 
 INLINE
-void 
-String_data::trunc (int j) 
+void
+String_data::trunc (int j)
 {
-  OKW (); 
+  OKW ();
   assert (j >= 0 && j <= length_);
   data_byte_[j] = 0;
   length_ = j;
@@ -191,24 +187,22 @@ INLINE bool
 String_data::is_binary_bo () const
 {
   //    return !memchr (data_byte_, length_, 0);
-  return ((int)strlen ((char const*)data_byte_) != length_ );
+  return ((int)strlen ((char const *)data_byte_) != length_);
 }
 
-INLINE Byte&
-String_data::operator [] (int j) 
+INLINE Byte &
+String_data::operator[] (int j)
 {
   assert (j >= 0 && j <= length_);
-  return data_byte_[j] ; 
+  return data_byte_[j];
 }
 
-INLINE Byte 
-String_data::operator [] (int j) const 
+INLINE Byte
+String_data::operator[] (int j) const
 {
   assert (j >= 0 && j <= length_);
-  return data_byte_[j]; 
+  return data_byte_[j];
 }
 
 
-
-
 #endif // __STRING_UTIL_CC //
index c9cd7f384b0f70e4cef6f63d16911fd9772d9c35..32810219d6b3d7f27c8fe1ada00da26ce4b414f0 100644 (file)
@@ -6,54 +6,52 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef STRINGHANDLE_HH
 #define STRINGHANDLE_HH
 
 #include "flower-proto.hh"
 
-
 /**
-  Reference counting for strings.
-  
+   Reference counting for strings.
+
    handles ref. counting, and provides a very thin interface using
    Byte *
+*/
+class String_handle
+{
+  String_data *data;
 
-   */
-class String_handle {
-  String_data* data;
-    
   /// decrease ref count. Named kind of like a Tanenbaum semafore 
   void down ();
 
   void up (String_data *d);
-    
-  /** make sure data has only one reference.      
+
+  /** make sure data has only one reference.
       POST: data->ref_count_ == 1
   */
   void copy ();
-    
+
 public:
   String_handle ();
   ~String_handle ();
-  String_handle (String_handle const & src);
+  String_handle (String_handle const &src);
 
-  Byte constto_bytes () const;
-  char constto_str0 () const;
-  Byteget_bytes ();
-  char* get_str0 ();    
+  Byte const *to_bytes () const;
+  char const *to_str0 () const;
+  Byte *get_bytes ();
+  char *get_str0 ();
   bool is_binary_bo () const;
-  void operator = (String_handle const &src);
-  void operator += (char const *s);
+  void operator= (String_handle const &src);
+  void operator+= (char const *s);
   Byte operator[] (int j) const;
 
   /** Access elements. WARNING: NOT SAFE
       don't use this for loops. Use to_bytes ()
   */
   Byte &operator[] (int j);
-  void append (Byte constbyte, int length_i);
-  void set (Byte constbyte, int length_i);
-  void operator = (char const *p);
+  void append (Byte const *byte, int length_i);
+  void set (Byte const *byte, int length_i);
+  void operator= (char const *p);
   void trunc (int j);
   int length () const;
 };
@@ -66,5 +64,4 @@ public:
 /* we should be resetting INLINE. oh well. */
 #endif
 
-
 #endif // STRINGHANDLE_HH
index aed19027d00cee907a5d709041bcabc3c60adb41..91af2c56d36986c14e9f8a4d79f4aee5fdc42b59 100644 (file)
@@ -1,10 +1,10 @@
 /* -*-c++-*-
-   
-  stringhandle.inl -- implement String_handle
 
-  source file of Flower lib
+stringhandle.inl -- implement String_handle
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+source file of Flower lib
+
+(c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #ifndef STRINGHANDLE_INL
 #include "string-data.hh"
 #include "string-handle.hh"
 
-INLINE void 
-String_handle::down () 
-{ 
+INLINE void
+String_handle::down ()
+{
   if (! (--data->ref_count_))
     delete data;
-  data = 0; 
+  data = 0;
 }
 
 /*
@@ -30,15 +30,15 @@ String_handle::down ()
 
   THIS does not have to be initialized.
 */
-INLINE void 
-String_handle::up (String_data *d) 
-{ 
-  data=d;
-  data->ref_count_ ++; 
+INLINE void
+String_handle::up (String_data *d)
+{
+  data = d;
+  data->ref_count_++;
 }
 
-INLINE void 
-String_handle::copy () 
+INLINE void
+String_handle::copy ()
 {
   if (data->ref_count_ !=1)
     {
@@ -49,51 +49,51 @@ String_handle::copy ()
 }
 
 INLINE
-String_handle::String_handle () 
+String_handle::String_handle ()
 {
   up (new String_data);
 }
 
 INLINE
-String_handle::~String_handle () 
-{      
+String_handle::~String_handle ()
+{
   down ();
-}    
+}
 
 INLINE
-String_handle::String_handle (String_handle const & src) 
-{      
+String_handle::String_handle (String_handle const &src)
+{
   up (src.data);
 }
 
-INLINE Byte
-String_handle::get_bytes () 
+INLINE Byte *
+String_handle::get_bytes ()
 {
   copy ();
   return data->get_bytes ();
 }
 
-INLINE char
-String_handle::get_str0 () 
+INLINE char *
+String_handle::get_str0 ()
 {
   copy ();
-  return (char*)data->get_bytes ();
+  return (char *)data->get_bytes ();
 }
 
-INLINE Byte 
-const* String_handle::to_bytes () const 
+INLINE Byte
+const *String_handle::to_bytes () const
 {
   return data->to_bytes ();
 }
 
-INLINE char const
-String_handle::to_str0 () const 
+INLINE char const *
+String_handle::to_str0 () const
 {
-  return (char const*)data->to_bytes ();
+  return (char const *)data->to_bytes ();
 }
 
-INLINE void 
-String_handle::operator = (String_handle const &src) 
+INLINE void
+String_handle::operator= (String_handle const &src)
 {
   if (this == &src)
     return;
@@ -101,64 +101,64 @@ String_handle::operator = (String_handle const &src)
   up (src.data);
 }
 
-INLINE void 
-String_handle::operator += (char const *s) 
-{      
+INLINE void
+String_handle::operator+= (char const *s)
+{
   copy ();
   *data += s;
-}    
-
+}
 
-INLINE Byte 
-String_handle::operator[] (int j) const 
-{ 
-  return (*data)[j]; 
+INLINE Byte
+String_handle::operator[] (int j) const
+{
+  return (*data)[j];
 }
 
 // !NOT SAFE!
 // don't use this for loops. Use to_bytes ()
 INLINE Byte &
-String_handle::operator[] (int j) 
+String_handle::operator[] (int j)
 {
   copy ();     // hmm. Not efficient
   return data->get_bytes ()[j];
 }
 
-INLINE void 
-String_handle::append (Byte const* byte, int length_i) 
+INLINE void
+String_handle::append (Byte const *byte, int length_i)
 {
   copy ();
   data->append (byte, length_i);
 }
-                          
-INLINE void 
-String_handle::set (Byte const* byte, int length_i) 
+
+INLINE void
+String_handle::set (Byte const *byte, int length_i)
 {
   copy ();
   data->set (byte, length_i);
 }
-                          
-INLINE void 
-String_handle::operator = (char const *p) 
+
+INLINE void
+String_handle::operator= (char const *p)
 {
   copy ();
   data->set (p);
 }
-                          
-INLINE void 
-String_handle::trunc (int j) 
+
+INLINE void
+String_handle::trunc (int j)
 {
-  copy (); data->trunc (j); 
+  copy (); data->trunc (j);
 }
 
-INLINE int 
-String_handle::length () const 
-{ 
-  return data->length_; 
+INLINE int
+String_handle::length () const
+{
+  return data->length_;
 }
 
 INLINE bool
-String_handle::is_binary_bo () const {
+String_handle::is_binary_bo () const
+{
   return data->is_binary_bo ();
 }
 
index b3f08e6738966ce511f3dcc59d5b9c6923d18004..70e9dd59aa3fb1f08ea47868267e596ff855b4ef 100644 (file)
@@ -1,19 +1,17 @@
 /*
-
   FILE   : string.hh -- declare String
+
   Rehacked by HWN 3/nov/95
   removed String & 's
   introduced Class String_handle
- */
+*/
 
 #ifndef STRING_HH
 #define STRING_HH
 
-
 // too darn slow with gcc3
 #ifdef STREAM_SUPPORT
-#if ( __GNUC__ > 2 )
+#if (__GNUC__ > 2)
 #include <iostream>
 #else
 class ostream;
@@ -23,70 +21,69 @@ class ostream;
 #include "arithmetic-operator.hh"
 #include "string-handle.hh"
 
-/** 
-  Intuitive string class. provides 
+/**
+
+Intuitive string class. provides
 \begin{itemize}
 \item
-  ref counting through #String_handle#
+ref counting through #String_handle#
 \item
-  conversion from bool, int, double, char* , char.  
+conversion from bool, int, double, char* , char.
 \item
-  to be moved to String_convert:
-  conversion to int, upcase, downcase 
+to be moved to String_convert:
+conversion to int, upcase, downcase
 
 \item
-  printable. 
+printable.
 
 \item
-  indexing (index_i, index_any_i, last_index_i)
+indexing (index_i, index_any_i, last_index_i)
 
 \item
-  cutting (left_string, right_string, mid_string)
+cutting (left_string, right_string, mid_string)
 
 \item
-  concat (+=, +)
+concat (+=, +)
 
 \item
-  signed comparison (<, >, ==, etc)
+signed comparison (<, >, ==, etc)
 
 \item
-  No operator[] is provided, since this would be enormously  slow. If needed,
-  convert to char const* .
+No operator[] is provided, since this would be enormously  slow. If needed,
+convert to char const* .
 \end{itemize}
-
 */
 class String
 {
 protected:
-  String_handle strh_; 
+  String_handle strh_;
 
   bool null_terminated ();
-    
+
 public:
 
   /** init to empty string. This is needed because other
-    constructors are provided.*/
+      constructors are provided.*/
   String ();
 
   /// String s = "abc";
-  String (char const* source); 
-  String (Byte constbyte, int length_i);
+  String (char const *source);
+  String (Byte const *byte, int length_i);
 
   ///  return "new"-ed copy of contents
-  Byteget_copy_byte () const;
-  charget_copy_str0 () const;
+  Byte *get_copy_byte () const;
+  char *get_copy_str0 () const;
 
-  char constto_str0 () const;
-  Byte constto_bytes () const;
+  char const *to_str0 () const;
+  Byte const *to_bytes () const;
   char *get_str0 ();
   Byte *get_bytes ();
 
-  String &operator = (String const & source);
+  String &operator= (String const &source);
 
   /// concatenate s
-  void operator += (char const* s) { strh_ += s; }
-  void operator += (String s);
+  void operator+= (char const *s) { strh_ += s; }
+  void operator+= (String s);
 
   bool is_empty () const;
 
@@ -94,10 +91,10 @@ public:
   void prepend (String);
 
   /**
-    Return a char.  UNSAFE because it may change strlen () result
-   */
-  char &operator [] (int n);
-  char operator [] (int n) const;
+     Return a char.  UNSAFE because it may change strlen () result
+  */
+  char &operator[] (int n);
+  char operator[] (int n) const;
 
   /// return n leftmost chars
   String left_string (int n) const;
@@ -115,20 +112,19 @@ public:
   String nomid_string (int index_i, int n) const;
 
   /// signed comparison,  analogous to memcmp;
-  static int compare (String const & s1,const  String& s2);
-       
+  static int compare (String const &s1, const String &s2);
+
   /// index of rightmost c 
   int index_last (char c) const;
 
   /// index of rightmost element of string (???)
-  int index_last (char conststring) const;
+  int index_last (char const *string) const;
 
   int index (char c) const;
 
   /// index of leftmost occurance of STRING
   int index (String) const;
 
-
   int index_any (String) const;
 
   void to_upper ();
@@ -138,7 +134,7 @@ public:
   /// provide Stream output
   void print_on (ostream& os) const;
 #endif
-  
+
   /// the length of the string
   int length () const;
 
@@ -152,33 +148,32 @@ public:
 };
 
 /*
- better to clutter global namespace, than suffer *ugh, ugh, ugh*
- implicit conversions.
 better to clutter global namespace, than suffer *ugh, ugh, ugh*
 implicit conversions.
 
- it might be cool to have no type-checking at all in a language,
- but once there is, having this silently circumvented is a nightmare.
 it might be cool to have no type-checking at all in a language,
 but once there is, having this silently circumvented is a nightmare.
 
- whenever implicit conversions seem necessary (e.g. operator << ()),
- use Scalar as the generic type iso String.
- */
 whenever implicit conversions seem necessary (e.g. operator << ()),
 use Scalar as the generic type iso String.
+*/
 
 /// for completeness (=handy)
 inline String to_string (String s) { return s; }
 /// "cccc"
 String to_string (char c, int n = 1);
-String to_string (int i, char constformat = 0);
-String to_string (double f, char constformat = 0);
-String to_string (long  b);
+String to_string (int i, char const *format = 0);
+String to_string (double f, char const *format = 0);
+String to_string (long b);
 String to_string (bool b);
-String to_string (char const* format, ... );
+String to_string (char const *format, ...);
 
 /*
   technically incorrect, but lets keep it here: this is a
   catch all place for this stuff.
-  */
-  
-#include "international.hh"
+*/
 
+#include "international.hh"
 
 #include "compare.hh"
 INSTANTIATE_COMPARE (String const &, String::compare);
@@ -191,26 +186,27 @@ INSTANTIATE_COMPARE (String const &, String::compare);
 /* we should be resetting INLINE. oh well. */
 #endif
 
-
 // because char const* also has an operator ==, this is for safety:
-inline bool operator== (String s1, char consts2)
+inline bool operator== (String s1, char const *s2)
 {
   return s1 == String (s2);
 }
-inline bool operator== (char consts1, String s2)
+inline bool operator== (char const *s1, String s2)
 {
-  return String (s1)==s2;
+  return String (s1) == s2;
 }
-inline bool operator!= (String s1, char const* s2 ) {
-  return s1!=String (s2);
+inline bool operator!= (String s1, char const *s2)
+{
+  return s1 != String (s2);
 }
-inline bool operator!= (char const* s1,String s2) {
+inline bool operator!= (char const *s1, String s2)
+{
   return String (s2) !=s1;
 }
 
 IMPLEMENT_ARITHMETIC_OPERATOR (String, +);
 #ifdef STREAM_SUPPORT
-ostream &operator << (ostream& os, String d);
+ostream &operator<< (ostream& os, String d);
 #endif
 
 #endif
index 4e558e8f72de42e4cba93e207539e88e764c9713..ed6a5887eeb4801bcf6a33892931cf7c1de77500 100644 (file)
@@ -1,41 +1,38 @@
-/*   
+/*
   string.icc -- implement String inlines
-  
+
   source file of the Flower Library
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef STRING_ICC
 #define STRING_ICC
 
-
-INLINE 
+INLINE
 char &
-String::operator [] (int n)
+String::operator[] (int n)
 {
-  return (char &) strh_[n]; 
+  return (char &) strh_[n];
 }
 
-INLINE 
-char 
-String::operator [] (int n) const
+INLINE
+char
+String::operator[] (int n) const
 {
-  return strh_[n]; 
+  return strh_[n];
 }
 
-INLINE 
-String::String () 
+INLINE
+String::String ()
 {
 }
 
 INLINE
-String::String (char constsource)
-{   
-  assert (source);    
-  strh_ = source;    
+String::String (char const *source)
+{
+  assert (source);
+  strh_ = source;
 }
 
-
 #endif /* STRING_ICC */
index b448f66d2b7cb29a90319344db41e713ae307145..64f30bc6db21613d4b3ba151fcd9c618f1e9ae9e 100644 (file)
@@ -6,13 +6,12 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef VIRTUAL_METHODS_HH
 #define VIRTUAL_METHODS_HH
 
 #include <typeinfo>
 
-#define classname(class_ptr) demangle_classname (typeid (*(class_ptr)))
+#define classname(class_ptr) demangle_classname (typeid (* (class_ptr)))
 
 const char *
 demangle_classname (std::type_info const &);
@@ -22,21 +21,21 @@ demangle_classname (std::type_info const &);
 
    class Foo : Baseclass
    {
-      VIRTUAL_COPY_CONSTRUCTOR (Baseclass, Foo);
+   VIRTUAL_COPY_CONSTRUCTOR (Baseclass, Foo);
    }; */
 
-#define VIRTUAL_COPY_CONSTRUCTOR(base, name) \
-  /* Hack to fix constness: gcc >= 2.95 is correct in defining \
-     typeof (*this) in a const member function to be const.  */ \
-  virtual base* clone_const_helper () \
-    { \
-      return new name (*this); \
-    } \
-  virtual base *clone () const \
-    { \
-      /* return new name (*this); */ \
-      base *urg = (base*) this; \
-      return urg->clone_const_helper (); \
-    }
+#define VIRTUAL_COPY_CONSTRUCTOR(base, name)                   \
+  /* Hack to fix constness: gcc >= 2.95 is correct in defining \
+     typeof (*this) in a const member function to be const.  */        \
+  virtual base* clone_const_helper ()                          \
+  {                                                            \
+    return new name (*this);                                   \
+  }                                                            \
+  virtual base *clone () const                                 \
+  {                                                            \
+    /* return new name (*this); */                             \
+    base *urg = (base*) this;                                  \
+    return urg->clone_const_helper ();                         \
+  }
 
 #endif /* VIRTUAL_METHODS_HH */
index 1196cb2573724353d1c9fc0968d969015bd52892..1e908cc5fde3f8b51ffd7ed2def564b8dc25ba4c 100644 (file)
@@ -1,33 +1,32 @@
-/*   
+/*
   international.cc -- implement stuff for internationalisation
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+*/
 
 #include "config.hh"
 #include "string-convert.hh"
 
 #if !HAVE_GETTEXT
-inline char*
-gettext (char consts)
+inline char *
+gettext (char const *s)
 {
-  return (char*)s;
+  return (char *)s;
 }
 #else
 #include <libintl.h>
 #endif
 
-String 
+String
 _ (char const *ch)
 {
   return String (gettext (ch));
 }
 
-String 
-_f (char constformat, ...)
+String
+_f (char const *format, ...)
 {
   va_list args;
   va_start (args, format);
@@ -36,9 +35,9 @@ _f (char const* format, ...)
   return str;
 }
 
-String 
-_f (char constformat, String s, String s2, String s3)
+String
+_f (char const *format, String s, String s2, String s3)
 {
-  return String_convert::form_string (gettext (format), s.to_str0 (), s2.to_str0 (), 
-    s3.to_str0 ());
+  return String_convert::form_string (gettext (format), s.to_str0 (), s2.to_str0 (),
+                                     s3.to_str0 ());
 }
index c0d3241fc9400a52ede9599df57418e21fc088a8..89e518883085e1bf7051cba084a0f654f8035e00 100644 (file)
@@ -1,10 +1,9 @@
-/* 
-   interval-set.hh -- implement Interval_set 
-  
-   source file of the GNU LilyPond music typesetter
-  
-   (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
+/*
+  interval-set.hh -- implement Interval_set
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "interval-set.hh"
@@ -34,7 +33,7 @@ Interval_set::set_full ()
 void
 Interval_set::remove_interval (Interval rm)
 {
-  for (int i = 0; i < allowed_regions_.size (); )
+  for (int i = 0; i < allowed_regions_.size ();)
     {
       Interval s = rm;
 
index 6a7628702b2082ac7e783f1eb8aa5723960e4b9e..d833d3151fe1306e164b7e4e2c017e2761b07c84 100644 (file)
@@ -12,7 +12,7 @@
 
 template<>
 Real
-Interval_t<Real>::infinity () 
+Interval_t<Real>::infinity ()
 {
   return HUGE_VAL;
 }
@@ -26,12 +26,11 @@ Interval_t<Real>::T_to_string (Real r)
 
 template<>
 int
-Interval_t<int>::infinity () 
+Interval_t<int>::infinity ()
 {
   return INT_MAX;
 }
 
-
 template<>
 String
 Interval_t<int>::T_to_string (int i)
@@ -42,4 +41,3 @@ Interval_t<int>::T_to_string (int i)
 template INTERVAL__INSTANTIATE (int);
 template INTERVAL__INSTANTIATE (Real);
 
-
index b6b32a31cd23c6885e87a947ad79bc0399d8ddc0..7078a3be4e7e5a4cc643fff1fba49e0dd7f1771d 100644 (file)
 
 #include "libc-extension.hh"
 
-char
-strnlwr (char* start ,int n)
+char *
+strnlwr (char *start, int n)
 {
-  char * p = start + n;
-  while (--p >= start) 
+  char *p = start + n;
+  while (--p >= start)
     {
       *p = tolower (*p);    /* a macro on some compilers */
     }
   return start;
 }
 
-char
-strnupr (charstart, int n)
+char *
+strnupr (char *start, int n)
 {
-  char * p = start + n;
-  while (--p >= start) 
+  char *p = start + n;
+  while (--p >= start)
     {
       *p = toupper (*p);    /* a macro on some compilers */
     }
@@ -42,7 +42,7 @@ strnupr (char* start, int n)
 double
 my_round (double x)
 {
-  return floor (x -0.5)+ 1.0 ;
+  return floor (x -0.5)+ 1.0;
 }
 
 #ifndef isinf
@@ -50,7 +50,7 @@ my_round (double x)
 int
 isinf (double x)
 {
-  return x && ( x == x/ 2) ;
+  return x && (x == x/ 2);
 }
 #endif
 #endif
@@ -65,21 +65,21 @@ isinf (double x)
 
 unsigned char *
 _memmem (unsigned char const *haystack, int haystack_len,
-        unsigned char const *needle,int needle_len)
+        unsigned char const *needle, int needle_len)
 {
-  unsigned char const * end_haystack = haystack + haystack_len - needle_len + 1;
-  unsigned char const * end_needle = needle + needle_len ;
+  unsigned char const *end_haystack = haystack + haystack_len - needle_len + 1;
+  unsigned char const *end_needle = needle + needle_len;
 
   /* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
      is the spice of life */
-  while (haystack < end_haystack) 
+  while (haystack < end_haystack)
     {
       unsigned char const *subneedle = needle;
       unsigned char const *subhaystack = haystack;
-      while (subneedle < end_needle) 
-        if (*subneedle++ != *subhaystack++)
+      while (subneedle < end_needle)
+       if (*subneedle++ != *subhaystack++)
          goto next;
-       
+
       /* Completed the needle.  Gotcha.  */
       return (unsigned char *) haystack;
     next:
@@ -90,10 +90,10 @@ _memmem (unsigned char const *haystack, int haystack_len,
 
 void *
 memmem (void const *haystack, int haystack_len,
-       void const *needle,int needle_len)
+       void const *needle, int needle_len)
 {
-  unsigned char const* haystack_byte_c = (unsigned char const*)haystack;
-  unsigned char const* needle_byte_c = (unsigned char const*)needle;
+  unsigned char const *haystack_byte_c = (unsigned char const *)haystack;
+  unsigned char const *needle_byte_c = (unsigned char const *)needle;
   return _memmem (haystack_byte_c, haystack_len, needle_byte_c, needle_len);
 }
 
@@ -103,15 +103,14 @@ unsigned char *
 memrchr (unsigned char const *p, int n, char c)
 {
   const unsigned char *q = p + n;
-  while (q > p) 
+  while (q > p)
     {
       if (*--q == c)
-       return (unsigned char*)q;
+       return (unsigned char *)q;
     }
   return 0;
 }
 
-
 template<class T>
 inline void
 my_swap (T &t1, T &t2, T &tmp)
@@ -128,13 +127,13 @@ strrev (unsigned char *byte, int length)
   unsigned char *left = byte;
   unsigned char *right = byte + length;
 
-  while (right > left) 
-    my_swap (*right--, *left++ , tmp_byte);
+  while (right > left)
+    my_swap (*right--, *left++, tmp_byte);
   return byte;
 }
 
 #if ! HAVE_SNPRINTF
-int 
+int
 snprintf (char *str, size_t, char const *format, ...)
 {
   va_list ap;
@@ -146,7 +145,7 @@ snprintf (char *str, size_t, char const *format, ...)
 #endif
 
 #if ! HAVE_VSNPRINTF
-int 
+int
 vsnprintf (char *str, size_t, char const *format, va_list args)
 {
   int i = vsprintf (str, format, args);
@@ -157,15 +156,15 @@ vsnprintf (char *str, size_t, char const *format, va_list args)
 #include <assert.h>
 
 extern "C" {
-  
+
 #if ! HAVE_FOPENCOOKIE
 #if HAVE_FUNOPEN
-  
+
   FILE *
   fopencookie (void *cookie, char const *mode, cookie_io_functions_t fun)
   {
     (void) mode;
-#if 0    
+#if 0
     return funopen (cookie, fun.read, fun.write, fun.seek, fun.close);
 #else
     return funopen (cookie,
@@ -173,8 +172,8 @@ extern "C" {
                    (int (*) (void *, char const *, int)) fun.write,
                    (fpos_t (*) (void *, fpos_t, int)) fun.seek,
                    (int (*) (void *)) fun.close);
-    
-#endif    
+
+#endif
   }
 
 #else /* ! HAVE_FUNOPEN */
@@ -185,8 +184,8 @@ extern "C" {
   static bool
   is_memory_stream (void *foo)
   {
-    Memory_out_stream* cookie = (Memory_out_stream*) foo;
-    return dynamic_cast<Memory_out_stream*> (cookie);
+    Memory_out_stream *cookie = (Memory_out_stream *) foo;
+    return dynamic_cast<Memory_out_stream *> (cookie);
   }
 
   FILE *
@@ -196,12 +195,12 @@ extern "C" {
     (void) modes;
     (void) io_funcs;
     if (is_memory_stream (cookie))
-      return (FILE*) cookie;
+      return (FILE *) cookie;
     assert (false);
     return 0;
   }
 
-  int 
+  int
   handle_cookie_io_fclose (FILE *file)
   {
     if (is_memory_stream (file))
@@ -209,7 +208,7 @@ extern "C" {
     return fclose (file);
   }
 
-  int 
+  int
   handle_cookie_io_fprintf (FILE *file, char const *format, ...)
   {
     va_list ap;
@@ -227,7 +226,7 @@ extern "C" {
     return i;
   }
 
-  int 
+  int
   handle_cookie_io_putc (int c, FILE *file)
   {
     if (is_memory_stream (file))
@@ -238,7 +237,7 @@ extern "C" {
       }
     return putc (c, file);
   }
-  
+
 #endif /* ! HAVE_FUNOPEN */
 #endif /* ! HAVE_FOPENCOOKIE */
 
index 30e2453fa405abe68ea9d3a58989cb59f9e50faf..3d29993486f8651f3a7a86f1c6a68174f7d6d2c1 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include <assert.h>
 
 #include "memory-stream.hh"
 
-
 /*
   TODO: add read support as well.
 */
 const int Memory_out_stream::block_size_ = 1024;
 
 cookie_io_functions_t
-Memory_out_stream::functions_ = {
+Memory_out_stream::functions_
+= {
   Memory_out_stream::reader,
   Memory_out_stream::writer,
   Memory_out_stream::seeker,
@@ -30,7 +29,7 @@ Memory_out_stream::functions_ = {
 int
 Memory_out_stream::cleaner (void *cookie)
 {
-  Memory_out_stream *stream = (Memory_out_stream*) cookie;
+  Memory_out_stream *stream = (Memory_out_stream *) cookie;
 
   stream->file_ = 0;
   return 0;
@@ -41,7 +40,7 @@ Memory_out_stream::Memory_out_stream ()
   size_ = 0;
   buffer_ = 0;
   buffer_blocks_ = 0;
-  file_ = fopencookie ((void*) this, "w", functions_);
+  file_ = fopencookie ((void *) this, "w", functions_);
 }
 
 Memory_out_stream::~Memory_out_stream ()
@@ -75,7 +74,7 @@ Memory_out_stream::writer (void *cookie,
                           const char *buffer,
                           size_t size)
 {
-  Memory_out_stream *stream = (Memory_out_stream*) cookie;
+  Memory_out_stream *stream = (Memory_out_stream *) cookie;
 
   ssize_t newsize = stream->size_ + size;
 
@@ -88,8 +87,8 @@ Memory_out_stream::writer (void *cookie,
     }
 
   if (change)
-    stream->buffer_ = (char*) realloc (stream->buffer_,
-                                      stream->buffer_blocks_ * block_size_);
+    stream->buffer_ = (char *) realloc (stream->buffer_,
+                                       stream->buffer_blocks_ * block_size_);
 
   memcpy (stream->buffer_ + stream->size_, buffer, size);
   stream->size_ = newsize;
index 9af1f0d90713bae1a8641365c5e3177e5a2f9b97..a3ed32aecbbb9ac447d6450411bbe3c34e780a03 100644 (file)
@@ -15,13 +15,12 @@ String
 Offset::to_string () const
 {
   String s;
-  s = String (" (") + ::to_string (coordinate_a_[X_AXIS]) + ", " 
+  s = String (" (") + ::to_string (coordinate_a_[X_AXIS]) + ", "
     + ::to_string (coordinate_a_[Y_AXIS]) + ")";
   return s;
 }
 #endif
 
-
 bool
 isinf_b (Real r)
 {
@@ -30,25 +29,24 @@ isinf_b (Real r)
 
 /*
   free bsd fix by John Galbraith
- */
-  
+*/
+
 Offset
 complex_multiply (Offset z1, Offset z2)
 {
   Offset z;
   if (!isinf_b (z2[Y_AXIS]))
-  {
+    {
       z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS]*z2[Y_AXIS];
       z[Y_AXIS] = z1[X_AXIS] * z2[Y_AXIS] + z1[Y_AXIS] * z2[X_AXIS];
-  }
+    }
   return z;
 }
 
-
 Offset
 complex_conjugate (Offset o)
 {
-  o[Y_AXIS] = - o[Y_AXIS];
+  o[Y_AXIS] = -o[Y_AXIS];
   return o;
 }
 
@@ -57,18 +55,16 @@ complex_divide (Offset z1, Offset z2)
 {
   z2 = complex_conjugate (z2);
   Offset z = complex_multiply (z1, z2);
-  z *= 1/z2.length ();
+  z *= 1 / z2.length ();
   return z;
 }
 
-
-
 Offset
 complex_exp (Offset o)
 {
   Real s = sin (o[Y_AXIS]);
   Real c = cos (o[Y_AXIS]);
-  
+
   Real r = exp (o[X_AXIS]);
 
   return Offset (r*c, r*s);
@@ -82,7 +78,7 @@ Offset::arg () const
 
 /**
    euclidian vector length / complex modulus
- */
+*/
 Real
 Offset::length () const
 {
index 00c348e79f361ddb083b9a4ba85847192249e800..fdd8ec846cd6e9f9090e9beb60d6947a92d884be 100644 (file)
@@ -14,7 +14,6 @@ Raph Levien <raph@acm.org> writing on 4 Oct 1998, updating 21 Oct 1998
 2. Leak fix in parseFile.
 
 Morten Welinder <terra@diku.dk> September 1999.
-
 */
 
 /*
@@ -85,31 +84,28 @@ Morten Welinder <terra@diku.dk> September 1999.
 #define EOL '\n'                /* end-of-line indicator */
 #define MAX_NAME 4096           /* max length for identifiers */
 
-
-
 /* Flags that can be AND'ed together to specify exactly what
  * information from the AFM file should be saved.
  */
-#define P_G    0x01    /* 0000 0001 */   /* Global Font Info      */
-#define P_W    0x02    /* 0000 0010 */   /* Character Widths ONLY */
-#define P_M    0x06    /* 0000 0110 */   /* All Char Metric Info  */
-#define P_P    0x08    /* 0000 1000 */   /* Pair Kerning Info     */
-#define P_T    0x10    /* 0001 0000 */   /* Track Kerning Info    */
-#define P_C    0x20    /* 0010 0000 */   /* Composite Char Info   */
-
+#define P_G 0x01       /* 0000 0001 */   /* Global Font Info      */
+#define P_W 0x02       /* 0000 0010 */   /* Character Widths ONLY */
+#define P_M 0x06       /* 0000 0110 */   /* All Char Metric Info  */
+#define P_P 0x08       /* 0000 1000 */   /* Pair Kerning Info     */
+#define P_T 0x10       /* 0001 0000 */   /* Track Kerning Info    */
+#define P_C 0x20       /* 0010 0000 */   /* Composite Char Info   */
 
 /* Commonly used flags
  */
-#define P_GW\
-       (P_G | P_W) 
-#define P_GM\
-       (P_G | P_M)
-#define P_GMP\
-       (P_G | P_M | P_P)
-#define P_GMK\
-       (P_G | P_M | P_P | P_T) 
-#define P_GALL\
-       (P_G | P_M | P_P | P_T | P_C)
+#define P_GW                                   \
+  (P_G | P_W)
+#define P_GM                                   \
+  (P_G | P_M)
+#define P_GMP                                  \
+  (P_G | P_M | P_P)
+#define P_GMK                                  \
+  (P_G | P_M | P_P | P_T)
+#define P_GALL                                 \
+  (P_G | P_M | P_P | P_T | P_C)
 
 #define METATYPE1_BUG   /* Parse Metatype1's (version unknown)
                           'Generated' global tag as comment. */
@@ -123,15 +119,12 @@ Morten Welinder <terra@diku.dk> September 1999.
 #define False "false"   /* used in string comparison to check the value of */
                        /* boolean keys (e.g. IsFixedPitch)  */
 
-#define MATCH(A,B) (strncmp ((A), (B), MAX_NAME) == 0)
-
-
+#define MATCH(A, B) (strncmp ((A), (B), MAX_NAME) == 0)
 
 /*************************** GLOBALS ***********************/
 
 static char *ident = NULL; /* storage buffer for keywords */
 
-
 /* "shorts" for fast case statement
  * The values of each of these enumerated items correspond to an entry in the
  * table of strings defined below. Therefore, if you add a new string as
@@ -147,21 +140,22 @@ static char *ident = NULL; /* storage buffer for keywords */
  * "recognize" procedure to calculate how many possible keys there are.
  */
 
-enum parseKey {
-  ASCENDER, CHARBBOX, CODE, COMPCHAR, CAPHEIGHT, COMMENT,
-  DESCENDER, ENCODINGSCHEME, ENDCHARMETRICS, ENDCOMPOSITES,
-  ENDFONTMETRICS, ENDKERNDATA, ENDKERNPAIRS, ENDTRACKKERN,
-  FAMILYNAME, FONTBBOX, FONTNAME, FULLNAME,
+enum parseKey
+  {
+    ASCENDER, CHARBBOX, CODE, COMPCHAR, CAPHEIGHT, COMMENT,
+    DESCENDER, ENCODINGSCHEME, ENDCHARMETRICS, ENDCOMPOSITES,
+    ENDFONTMETRICS, ENDKERNDATA, ENDKERNPAIRS, ENDTRACKKERN,
+    FAMILYNAME, FONTBBOX, FONTNAME, FULLNAME,
 #ifdef METATYPE1_BUG
-  GENERATED,
+    GENERATED,
 #endif
-  ISFIXEDPITCH,
-  ITALICANGLE, KERNPAIR, KERNPAIRXAMT, LIGATURE, CHARNAME,
-  NOTICE, COMPCHARPIECE, STARTCHARMETRICS, STARTCOMPOSITES,
-  STARTFONTMETRICS, STARTKERNDATA, STARTKERNPAIRS,
-  STARTTRACKKERN, TRACKKERN, UNDERLINEPOSITION,
-  UNDERLINETHICKNESS, VERSION, XYWIDTH, XWIDTH, WEIGHT, XHEIGHT,
-  NOPE };
+    ISFIXEDPITCH,
+    ITALICANGLE, KERNPAIR, KERNPAIRXAMT, LIGATURE, CHARNAME,
+    NOTICE, COMPCHARPIECE, STARTCHARMETRICS, STARTCOMPOSITES,
+    STARTFONTMETRICS, STARTKERNDATA, STARTKERNPAIRS,
+    STARTTRACKKERN, TRACKKERN, UNDERLINEPOSITION,
+    UNDERLINETHICKNESS, VERSION, XYWIDTH, XWIDTH, WEIGHT, XHEIGHT,
+    NOPE };
 
 /* keywords for the system:
  * This a table of all of the current strings that are vaild AFM keys.
@@ -176,7 +170,8 @@ enum parseKey {
  * end.
  */
 
-static char *keyStrings[] = {
+static char *keyStrings[]
+= {
   "Ascender", "B", "C", "CC", "CapHeight", "Comment",
   "Descender", "EncodingScheme", "EndCharMetrics", "EndComposites",
   "EndFontMetrics", "EndKernData", "EndKernPairs", "EndTrackKern",
@@ -202,7 +197,7 @@ static char *keyStrings[] = {
  *  reads all tokens until the next end-of-line.
  */
 
-static char*
+static char *
 token (FILE *stream)
 {
   int ch, idx;
@@ -230,7 +225,6 @@ token (FILE *stream)
 
 } /* token */
 
-
 /*************************** linetoken *************************/
 
 /*  "linetoken" will get read all tokens until the EOL character from
@@ -238,7 +232,7 @@ token (FILE *stream)
  *  more than one word (like Comment lines and FullName).
  */
 
-static char*
+static char *
 linetoken (FILE *stream)
 {
   int ch, idx;
@@ -260,7 +254,6 @@ linetoken (FILE *stream)
 
 } /* linetoken */
 
-
 /*************************** recognize *************************/
 
 /*  This function tries to match a string to a known list of
@@ -282,7 +275,7 @@ recognize (register char *ident)
 
   while ((upper >= lower) && !found)
     {
-      midpoint = (lower + upper)/2;
+      midpoint = (lower + upper) / 2;
       if (keyStrings[midpoint] == NULL)
        break;
       cmpvalue = strncmp (ident, keyStrings[midpoint], MAX_NAME);
@@ -291,8 +284,8 @@ recognize (register char *ident)
       else
        if (cmpvalue < 0)
          upper = midpoint - 1;
-      else
-       lower = midpoint + 1;
+       else
+         lower = midpoint + 1;
     }
 
   if (found)
@@ -301,7 +294,6 @@ recognize (register char *ident)
     return NOPE;
 }
 
-
 /************************* parseGlobals *****************************/
 
 /*  This function is called by "parseFile". It will parse the AFM File
@@ -337,19 +329,19 @@ parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi)
       if (keyword == NULL)
        /* Have reached an early and unexpected EOF. */
        /* Set flag and stop parsing */
-        {
+       {
          error = AFM_earlyEOF;
          break;   /* get out of loop */
-        }
+       }
       if (!save)
        /* get tokens until the end of the Global Font info section */
        /* without saving any of the data */
        switch (recognize (keyword))
-         {                             
+         {
          case STARTCHARMETRICS:
            cont = FALSE;
            break;
-         case ENDFONTMETRICS:  
+         case ENDFONTMETRICS:
            cont = FALSE;
            error = normalEOF;
            break;
@@ -369,7 +361,7 @@ parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi)
          case COMMENT:
 #ifdef METATYPE1_BUG
          case GENERATED:
-#endif 
+#endif
            keyword = linetoken (fp);
            break;
          case FONTNAME:
@@ -472,7 +464,6 @@ parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi)
 
 } /* parseGlobals */
 
-
 #if 0
 /************************* initializeArray ************************/
 
@@ -504,12 +495,12 @@ initializeArray (FILE *fp, register int *cwi)
     {
       keyword = token (fp);
       if (keyword == NULL)
-        {
+       {
          error = AFM_earlyEOF;
          break; /* get out of loop */
-        }
+       }
       switch (recognize (keyword))
-        {
+       {
        case COMMENT:
          keyword = linetoken (fp);
          break;
@@ -538,7 +529,7 @@ initializeArray (FILE *fp, register int *cwi)
        default:
          error = AFM_parseError;
          break;
-        } /* switch */
+       } /* switch */
     } /* while */
 
   if (!found)
@@ -587,15 +578,15 @@ parseCharWidths (FILE *fp, register int *cwi)
       /* Have reached an early and unexpected EOF. */
       /* Set flag and stop parsing */
       if (keyword == NULL)
-        {
+       {
          error = AFM_earlyEOF;
          break; /* get out of loop */
-        }
-      if (!save)       
+       }
+      if (!save)
        /* get tokens until the end of the Char Metrics section without */
        /* saving any of the data*/
        switch (recognize (keyword))
-         {                             
+         {
          case ENDCHARMETRICS:
            cont = FALSE;
            break;
@@ -656,7 +647,6 @@ parseCharWidths (FILE *fp, register int *cwi)
 
 } /* parseCharWidths */
 
-
 /************************* parseCharMetrics ************************/
 
 /*  This function is called by parseFile if the caller of parseFile
@@ -686,12 +676,12 @@ parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
     {
       keyword = token (fp);
       if (keyword == NULL)
-        {
+       {
          error = AFM_earlyEOF;
          break; /* get out of loop */
-        }
+       }
       switch (recognize (keyword))
-        {
+       {
        case COMMENT:
          keyword = linetoken (fp);
          break;
@@ -719,13 +709,13 @@ parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
        case XWIDTH:
          temp->wx = atoi (token (fp));
          break;
-       
+
        case CHARNAME:
          keyword = token (fp);
          temp->name = (char *) malloc (strlen (keyword) + 1);
          strcpy (temp->name, keyword);
          break;
-       
+
        case CHARBBOX:
          temp->charBBox.llx = atoi (token (fp));
          temp->charBBox.lly = atoi (token (fp));
@@ -733,25 +723,26 @@ parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
          temp->charBBox.ury = atoi (token (fp));
          break;
 
-       case LIGATURE: {
-         AFM_Ligature **tail = & (temp->ligs);
-         AFM_Ligature *node = *tail;
+       case LIGATURE:
+         {
+           AFM_Ligature **tail = &(temp->ligs);
+           AFM_Ligature *node = *tail;
 
-         if (*tail != NULL)
-           {
-             while (node->next != NULL)
-               node = node->next;
-             tail = & (node->next);
-           }
+           if (*tail != NULL)
+             {
+               while (node->next != NULL)
+                 node = node->next;
+               tail = &(node->next);
+             }
 
-         *tail = (AFM_Ligature *) calloc (1, sizeof (AFM_Ligature));
-         keyword = token (fp);
-         (*tail)->succ = (char *) malloc (strlen (keyword) + 1);
-         strcpy ((*tail)->succ, keyword);
-         keyword = token (fp);
-         (*tail)->lig = (char *) malloc (strlen (keyword) + 1);
-         strcpy ((*tail)->lig, keyword);
-         break; }
+           *tail = (AFM_Ligature *) calloc (1, sizeof (AFM_Ligature));
+           keyword = token (fp);
+           (*tail)->succ = (char *) malloc (strlen (keyword) + 1);
+           strcpy ((*tail)->succ, keyword);
+           keyword = token (fp);
+           (*tail)->lig = (char *) malloc (strlen (keyword) + 1);
+           strcpy ((*tail)->lig, keyword);
+           break; }
        case ENDCHARMETRICS:
          cont = FALSE;;
          break;
@@ -762,10 +753,10 @@ parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
        case NOPE:
        default:
          warning ("Unknown token");
-       
+
          error = AFM_parseError;
          break;
-        } /* switch */
+       } /* switch */
     } /* while */
 
   if ((error == AFM_ok) && (count != fi->numOfChars))
@@ -777,8 +768,6 @@ parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
 
 } /* parseCharMetrics */
 
-
-
 /************************* parseAFM_TrackKernData ***********************/
 
 /*  This function is called by "parseFile". It will parse the AFM File
@@ -806,10 +795,10 @@ parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi)
       keyword = token (fp);
 
       if (keyword == NULL)
-        {
+       {
          error = AFM_earlyEOF;
          break; /* get out of loop */
-        }
+       }
       if (!save)
        /* get tokens until the end of the Track Kerning Data */
        /* section without saving any of the data */
@@ -832,9 +821,9 @@ parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi)
        switch (recognize (keyword))
          {
          case COMMENT:
-#ifdef METATYPE1_BUG   
+#ifdef METATYPE1_BUG
          case GENERATED:
-#endif 
+#endif
            keyword = linetoken (fp);
            break;
          case TRACKKERN:
@@ -884,7 +873,6 @@ parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi)
 
 } /* parseAFM_TrackKernData */
 
-
 /************************* parseAFM_PairKernData ************************/
 
 /*  This function is called by "parseFile". It will parse the AFM File
@@ -912,10 +900,10 @@ parseAFM_PairKernData (FILE *fp, register AFM_Font_info *fi)
       keyword = token (fp);
 
       if (keyword == NULL)
-        {
+       {
          error = AFM_earlyEOF;
          break; /* get out of loop */
-        }
+       }
       if (!save)
        /* get tokens until the end of the Pair Kerning Data */
        /* section without saving any of the data */
@@ -1006,7 +994,6 @@ parseAFM_PairKernData (FILE *fp, register AFM_Font_info *fi)
 
 } /* parseAFM_PairKernData */
 
-
 /************************* parseAFM_CompCharData **************************/
 
 /*  This function is called by "parseFile". It will parse the AFM File
@@ -1038,15 +1025,15 @@ parseAFM_CompCharData (FILE *fp, register AFM_Font_info *fi)
       if (keyword == NULL)
        /* Have reached an early and unexpected EOF. */
        /* Set flag and stop parsing */
-        {
+       {
          error = AFM_earlyEOF;
          break; /* get out of loop */
-        }
+       }
       if (ccount > fi->numOfComps)
-        {
+       {
          error = AFM_parseError;
          break; /* get out of loop */
-        }
+       }
       if (!save)
        /* get tokens until the end of the Composite Character info */
        /* section without saving any of the data */
@@ -1133,72 +1120,78 @@ parseAFM_CompCharData (FILE *fp, register AFM_Font_info *fi)
 } /* parseAFM_CompCharData */
 
 
-
-
 /*************************** 'PUBLIC' FUNCTION ********************/
 
 void
 AFM_free (AFM_Font_info *fi)
 {
-  if (fi->gfi) {
-    free (fi->gfi->afmVersion);
-    free (fi->gfi->fontName);
-    free (fi->gfi->fullName);
-    free (fi->gfi->familyName);
-    free (fi->gfi->weight);
-    free (fi->gfi->version);
-    free (fi->gfi->notice);
-    free (fi->gfi->encodingScheme);
-    free (fi->gfi);
-  }
+  if (fi->gfi)
+    {
+      free (fi->gfi->afmVersion);
+      free (fi->gfi->fontName);
+      free (fi->gfi->fullName);
+      free (fi->gfi->familyName);
+      free (fi->gfi->weight);
+      free (fi->gfi->version);
+      free (fi->gfi->notice);
+      free (fi->gfi->encodingScheme);
+      free (fi->gfi);
+    }
 
   /* This contains just scalars.  */
   free (fi->cwi);
 
-  if (fi->cmi) {
-    int i;
-    for (i = 0; i < fi->numOfChars; i++) {
-      free (fi->cmi[i].name);
-      while (fi->cmi[i].ligs) {
-       AFM_Ligature *tmp;
-       tmp = fi->cmi[i].ligs;
-       free (tmp->succ);
-       free (tmp->lig);
-       free (tmp);
-       fi->cmi[i].ligs = fi->cmi[i].ligs->next;
-      }
+  if (fi->cmi)
+    {
+      int i;
+      for (i = 0; i < fi->numOfChars; i++)
+       {
+         free (fi->cmi[i].name);
+         while (fi->cmi[i].ligs)
+           {
+             AFM_Ligature *tmp;
+             tmp = fi->cmi[i].ligs;
+             free (tmp->succ);
+             free (tmp->lig);
+             free (tmp);
+             fi->cmi[i].ligs = fi->cmi[i].ligs->next;
+           }
+       }
+      free (fi->cmi);
     }
-    free (fi->cmi);
-  }
 
   /* This contains just scalars.  */
   free (fi->tkd);
 
-  if (fi->pkd) {
-    int i;
-    for (i = 0; i < fi->numOfPairs; i++) {
-      free (fi->pkd[i].name1);
-      free (fi->pkd[i].name2);
+  if (fi->pkd)
+    {
+      int i;
+      for (i = 0; i < fi->numOfPairs; i++)
+       {
+         free (fi->pkd[i].name1);
+         free (fi->pkd[i].name2);
+       }
+      free (fi->pkd);
     }
-    free (fi->pkd);
-  }
-
-  if (fi->ccd) {
-    int i, j;
-    for (i = 0; i < fi->numOfComps; i++) {
-      free (fi->ccd[i].ccName);
-      for (j = 0; j < fi->ccd[i].numOfPieces; j++) {
-       free (fi->ccd[i].pieces[j].AFM_PccName);
-      }
-      free (fi->ccd[i].pieces);
+
+  if (fi->ccd)
+    {
+      int i, j;
+      for (i = 0; i < fi->numOfComps; i++)
+       {
+         free (fi->ccd[i].ccName);
+         for (j = 0; j < fi->ccd[i].numOfPieces; j++)
+           {
+             free (fi->ccd[i].pieces[j].AFM_PccName);
+           }
+         free (fi->ccd[i].pieces);
+       }
+      free (fi->ccd);
     }
-    free (fi->ccd);
-  }
 
   free (fi);
 }
 
-
 /*************************** parseFile *****************************/
 
 /*  parseFile is the only 'public' procedure available. It is called
@@ -1227,10 +1220,9 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
   int code = AFM_ok;   /* return code from each of the parsing routines */
   int error = AFM_ok;  /* used as the return code from this function */
 
-  register char *keyword; /* used to store a token */  
+  register char *keyword; /* used to store a token */
 
-                       
-  /* storage data for the global variable ident */                     
+  /* storage data for the global variable ident */
   if (!ident)
     ident = (char *) calloc (MAX_NAME, sizeof (char));
   if (ident == NULL)
@@ -1276,7 +1268,7 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
     {
       (*fi)->numOfChars = atoi (token (fp));
       if (flags & (P_M ^ P_W))
-        {
+       {
          (*fi)->cmi = (AFM_CharMetricInfo *)
            calloc ((*fi)->numOfChars, sizeof (AFM_CharMetricInfo));
          if ((*fi)->cmi == NULL)
@@ -1285,21 +1277,21 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
              return error;
            }
          code = parseCharMetrics (fp, *fi);
-        }
+       }
       else
-        {
+       {
          if (flags & P_W)
-            {
+           {
              (*fi)->cwi = (int *) calloc (256, sizeof (int));
              if ((*fi)->cwi == NULL)
-                {
+               {
                  error = AFM_storageProblem;
                  return (error);
-                }
-            }
+               }
+           }
          /* parse section regardless */
          code = parseCharWidths (fp, (*fi)->cwi);
-        } /* else */
+       } /* else */
     } /* if */
 
   if ((error != AFM_earlyEOF) && (code < 0))
@@ -1317,12 +1309,12 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
       if (keyword == NULL)
        /* Have reached an early and unexpected EOF. */
        /* Set flag and stop parsing */
-        {
+       {
          code = AFM_earlyEOF;
          break; /* get out of loop */
-        }
+       }
       switch (recognize (keyword))
-        {
+       {
        case STARTKERNDATA:
          break;
        case ENDKERNDATA:
@@ -1379,7 +1371,7 @@ AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
        default:
          code = AFM_parseError;
          break;
-        } /* switch */
+       } /* switch */
 
       if ((error != AFM_earlyEOF) && (code < 0))
        error = code;
index 8994d732140916a65efc764d7213ce81f0178536..92447b63001046d6ac8cf4541eb4f380fd063388 100644 (file)
@@ -1,18 +1,18 @@
 /*
-   poly.cc -- routines for manipulation of polynomials in one var
+  poly.cc -- routines for manipulation of polynomials in one var
 
   (c) 1993--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #include "polynomial.hh"
 
 #include <cmath>
 
 /*
-   Een beter milieu begint bij uzelf. Hergebruik!
+  Een beter milieu begint bij uzelf. Hergebruik!
 
 
-   This was ripped from Rayce, a raytracer I once wrote. 
+  This was ripped from Rayce, a raytracer I once wrote.
 */
 
 Real
@@ -21,15 +21,14 @@ Polynomial::eval (Real x)const
   Real p = 0.0;
 
   // horner's scheme
-  for (int i = coefs_.size (); i--; )
+  for (int i = coefs_.size (); i--;)
     p = x * p + coefs_[i];
-  
+
   return p;
 }
 
-
 Polynomial
-Polynomial::multiply (const Polynomial & p1, const Polynomial & p2)
+Polynomial::multiply (const Polynomial &p1, const Polynomial &p2)
 {
   Polynomial dest;
 
@@ -41,7 +40,7 @@ Polynomial::multiply (const Polynomial & p1, const Polynomial & p2)
        if (i - j <= p2.degree () && j <= p1.degree ())
          dest.coefs_.top () += p1.coefs_[j] * p2.coefs_[i - j];
     }
-    
+
   return dest;
 }
 
@@ -50,33 +49,35 @@ Polynomial::differentiate ()
 {
   for (int i = 1; i<= degree (); i++)
     {
-      coefs_[i-1] = coefs_[i] * i;
+      coefs_[i - 1] = coefs_[i] * i;
     }
   coefs_.pop ();
 }
 
 Polynomial
-Polynomial::power (int exponent, const Polynomial & src)
+Polynomial::power (int exponent, const Polynomial &src)
 {
   int e = exponent;
   Polynomial dest (1), base (src);
-    
+
   /*
     classic int power. invariant: src^exponent = dest * src ^ e
     greetings go out to Lex Bijlsma & Jaap vd Woude */
   while (e > 0)
     {
       if (e % 2)
-        {
+       {
          dest = multiply (dest, base);
          e--;
-        } else
-         {
-            base = multiply (base, base);
-            e /= 2;
-         }
+       }
+      else
+
+       {
+         base = multiply (base, base);
+         e /= 2;
+       }
     }
-  return  dest;
+  return dest;
 }
 
 static Real const FUDGE = 1e-8;
@@ -84,39 +85,35 @@ static Real const FUDGE = 1e-8;
 void
 Polynomial::clean ()
 {
-/*
-  We only do relative comparisons. Absolute comparisons break down in
-  degenerate cases.  */
-  while (degree () > 0 &&
(fabs (coefs_.top ()) < FUDGE * fabs (coefs_.top (1))
-         || !coefs_.top ()))
+  /*
+    We only do relative comparisons. Absolute comparisons break down in
+    degenerate cases.  */
+  while (degree () > 0
       && (fabs (coefs_.top ()) < FUDGE *fabs (coefs_.top (1))
+            || !coefs_.top ()))
     coefs_.pop ();
 }
 
-
-
 void
-Polynomial::operator += (Polynomial const &p)
+Polynomial::operator+= (Polynomial const &p)
 {
-  while (degree () < p.degree())
+  while (degree () < p.degree ())
     coefs_.push (0.0);
 
-  for (int i = 0; i <= p.degree(); i++)
+  for (int i = 0; i <= p.degree (); i++)
     coefs_[i] += p.coefs_[i];
 }
 
-
 void
-Polynomial::operator -= (Polynomial const &p)
+Polynomial::operator-= (Polynomial const &p)
 {
-  while (degree () < p.degree())
+  while (degree () < p.degree ())
     coefs_.push (0.0);
 
-  for (int i = 0; i <= p.degree(); i++)
+  for (int i = 0; i <= p.degree (); i++)
     coefs_[i] -= p.coefs_[i];
 }
 
-
 void
 Polynomial::scalarmultiply (Real fact)
 {
@@ -124,33 +121,35 @@ Polynomial::scalarmultiply (Real fact)
     coefs_[i] *= fact;
 }
 
-
-
 void
-Polynomial::set_negate (const Polynomial & src)
+Polynomial::set_negate (const Polynomial &src)
 {
   for (int i = 0; i <= src.degree (); i++)
     coefs_[i] = -src.coefs_[i];
 }
 
 /// mod of #u/v#
-int 
+int
 Polynomial::set_mod (const Polynomial &u, const Polynomial &v)
 {
- (*this) = u;
-    
-  if (v.lc () < 0.0) {
-    for (int k = u.degree () - v.degree () - 1; k >= 0; k -= 2)
-      coefs_[k] = -coefs_[k];
-
-    for (int k = u.degree () - v.degree (); k >= 0; k--)
-      for (int j = v.degree () + k - 1; j >= k; j--)
-       coefs_[j] = -coefs_[j] - coefs_[v.degree () + k] * v.coefs_[j - k];
-  } else {
-    for (int k = u.degree () - v.degree (); k >= 0; k--)
-      for (int j = v.degree () + k - 1; j >= k; j--)
-       coefs_[j] -= coefs_[v.degree () + k] * v.coefs_[j - k];
-  }
+  (*this) = u;
+
+  if (v.lc () < 0.0)
+    {
+      for (int k = u.degree () - v.degree () - 1; k >= 0; k -= 2)
+       coefs_[k] = -coefs_[k];
+
+      for (int k = u.degree () - v.degree (); k >= 0; k--)
+       for (int j = v.degree () + k - 1; j >= k; j--)
+         coefs_[j] = -coefs_[j] - coefs_[v.degree () + k] * v.coefs_[j - k];
+    }
+  else
+
+    {
+      for (int k = u.degree () - v.degree (); k >= 0; k--)
+       for (int j = v.degree () + k - 1; j >= k; j--)
+         coefs_[j] -= coefs_[v.degree () + k] * v.coefs_[j - k];
+    }
 
   int k = v.degree () - 1;
   while (k >= 0 && coefs_[k] == 0.0)
@@ -161,24 +160,23 @@ Polynomial::set_mod (const Polynomial &u, const Polynomial &v)
 }
 
 void
-Polynomial::check_sol (Real x) const 
+Polynomial::check_sol (Real x) const
 {
-  Real f=eval (x);
+  Real f = eval (x);
   Polynomial p (*this);
   p.differentiate ();
   Real d = p.eval (x);
-  
-  if ( abs (f) > abs (d) * FUDGE)
-    ;
+
+  if (abs (f) > abs (d) * FUDGE);
   /*
     warning ("x=%f is not a root of polynomial\n"
     "f (x)=%f, f' (x)=%f \n", x, f, d);        */
 }
-       
+
 void
 Polynomial::check_sols (Array<Real> roots) const
 {
-  for (int i=0; i< roots.size (); i++)
+  for (int i = 0; i< roots.size (); i++)
     check_sol (roots[i]);
 }
 
@@ -193,9 +191,9 @@ Polynomial::Polynomial (Real a, Real b)
 inline Real cubic_root (Real x)
 {
   if (x > 0.0)
-    return pow (x, 1.0/3.0) ;
+    return pow (x, 1.0 / 3.0);
   else if (x < 0.0)
-    return -pow (-x, 1.0/3.0);
+    return -pow (-x, 1.0 / 3.0);
   else
     return 0.0;
 }
@@ -210,7 +208,7 @@ Array<Real>
 Polynomial::solve_cubic ()const
 {
   Array<Real> sol;
-  
+
   /* normal form: x^3 + Ax^2 + Bx + C = 0 */
   Real A = coefs_[2] / coefs_[3];
   Real B = coefs_[1] / coefs_[3];
@@ -220,39 +218,40 @@ Polynomial::solve_cubic ()const
    * substitute x = y - A/3 to eliminate quadric term: x^3 +px + q = 0
    */
 
-  Real sq_A = A * A;
+  Real sq_A = A *A;
   Real p = 1.0 / 3 * (-1.0 / 3 * sq_A + B);
-  Real q = 1.0 / 2 * (2.0 / 27 * A * sq_A - 1.0 / 3 * A * B + C);
+  Real q = 1.0 / 2 * (2.0 / 27 * A *sq_A - 1.0 / 3 * A *B + C);
 
   /* use Cardano's formula */
 
   Real cb = p * p * p;
   Real D = q * q + cb;
 
-  if (iszero (D)) {
-    if (iszero (q)) {  /* one triple solution */
-      sol.push (0);
-      sol.push (0);
-      sol.push (0);      
-    } else {           /* one single and one double solution */
-      Real u = cubic_root (-q);
-
-      sol.push (2 * u);
-      sol.push (-u);
-    }
-  } else if (D < 0) {          /* Casus irreducibilis: three real solutions */
+  if (iszero (D))
+    {
+      if (iszero (q)) {        /* one triple solution */
+       sol.push (0);
+       sol.push (0);
+       sol.push (0);
+      } else {         /* one single and one double solution */
+       Real u = cubic_root (-q);
+
+       sol.push (2 * u);
+       sol.push (-u);
+      }
+    } else if (D < 0) {                /* Casus irreducibilis: three real solutions */
     Real phi = 1.0 / 3 * acos (-q / sqrt (-cb));
     Real t = 2 * sqrt (-p);
 
     sol.push (t * cos (phi));
     sol.push (-t * cos (phi + M_PI / 3));
-    sol.push ( -t * cos (phi - M_PI / 3));
+    sol.push (-t * cos (phi - M_PI / 3));
   } else {                     /* one real solution */
     Real sqrt_D = sqrt (D);
     Real u = cubic_root (sqrt_D - q);
     Real v = -cubic_root (sqrt_D + q);
 
-    sol.push ( u + v);
+    sol.push (u + v);
   }
 
   /* resubstitute */
@@ -263,10 +262,10 @@ Polynomial::solve_cubic ()const
       sol[i] -= sub;
 
 #ifdef PARANOID
-      assert (fabs (eval (sol[i]) ) < 1e-8);
+      assert (fabs (eval (sol[i])) < 1e-8);
 #endif
     }
-  
+
   return sol;
 }
 
@@ -276,8 +275,8 @@ Polynomial::lc () const
   return coefs_.top ();
 }
 
-Real&
-Polynomial::lc () 
+Real &
+Polynomial::lc ()
 {
   return coefs_.top ();
 }
@@ -288,8 +287,8 @@ Polynomial::degree ()const
   return coefs_.size () -1;
 }
 /*
-   all roots of quadratic eqn.
- */
+  all roots of quadratic eqn.
+*/
 Array<Real>
 Polynomial::solve_quadric ()const
 {
@@ -300,13 +299,14 @@ Polynomial::solve_quadric ()const
 
   Real D = p * p - q;
 
-  if (D>0) {
-    D = sqrt (D);
+  if (D > 0)
+    {
+      D = sqrt (D);
 
-    sol.push ( D - p);
-    sol.push ( -D - p);
-  }
-  return sol; 
+      sol.push (D - p);
+      sol.push (-D - p);
+    }
+  return sol;
 }
 
 /* solve linear equation */
@@ -315,17 +315,16 @@ Polynomial::solve_linear ()const
 {
   Array<Real> s;
   if (coefs_[1])
-    s.push ( -coefs_[0] / coefs_[1]);
+    s.push (-coefs_[0] / coefs_[1]);
   return s;
 }
 
-
 Array<Real>
 Polynomial::solve () const
 {
-  Polynomial * me = (Polynomial*) this;
+  Polynomial *me = (Polynomial *) this;
   me->clean ();
-  
+
   switch (degree ())
     {
     case 1:
@@ -340,9 +339,8 @@ Polynomial::solve () const
 }
 
 void
-Polynomial:: operator *= (Polynomial const &p2)
+Polynomial:: operator*= (Polynomial const &p2)
 {
-  *this = multiply (*this,p2);
-}  
-
+  *this = multiply (*this, p2);
+}
 
index 888a82ae9de452c6a398a027f0171836851b7368..a21b939565b09fb41662f4c98954f2bd3c513650 100644 (file)
@@ -1,6 +1,6 @@
 /*
   rational.cc -- implement Rational
-  
+
   source file of the Flower Library
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
@@ -11,7 +11,7 @@
 #include <cmath>
 #include <cstdlib>
 
-#include "string-convert.hh"  
+#include "string-convert.hh"
 #include "libc-extension.hh"
 
 Rational::operator double () const
@@ -21,14 +21,13 @@ Rational::operator double () const
 
 #ifdef STREAM_SUPPORT
 ostream &
-operator << (ostream &o, Rational r)
+operator<< (ostream &o, Rational r)
 {
-  o <<  r.string ();
+  o << r.string ();
   return o;
 }
 #endif
 
-
 Rational
 Rational::trunc_rat () const
 {
@@ -68,15 +67,14 @@ int gcd (int a, int b)
   return b;
 }
 
-
 void
 Rational::set_infinite (int s)
 {
-  sign_ = ::sign (s) * 2; 
+  sign_ = ::sign (s) * 2;
 }
 
 Rational
-Rational::operator - () const
+Rational::operator- () const
 {
   Rational r (*this);
   r.negate ();
@@ -119,7 +117,7 @@ Rational::normalise ()
     }
   else
     {
-      int g = gcd (num_ , den_);
+      int g = gcd (num_, den_);
 
       num_ /= g;
       den_ /= g;
@@ -144,48 +142,46 @@ Rational::compare (Rational const &r, Rational const &s)
     return 0;
   else
     {
-      return r.sign_ * ::sign  (int (r.num_ * s.den_) - int (s.num_ * r.den_));
+      return r.sign_ * ::sign (int (r.num_ * s.den_) - int (s.num_ * r.den_));
     }
 }
 
 int
 compare (Rational const &r, Rational const &s)
 {
-  return Rational::compare (r, s );
+  return Rational::compare (r, s);
 }
 
 Rational &
-Rational::operator %= (Rational r)
+Rational::operator%= (Rational r)
 {
   *this = r.mod_rat (r);
   return *this;
 }
 
 Rational &
-Rational::operator += (Rational r)
+Rational::operator+= (Rational r)
 {
-  if (is_infinity ())
-    ;
+  if (is_infinity ());
   else if (r.is_infinity ())
     {
       *this = r;
     }
-  else 
+  else
     {
       int n = sign_ * num_ *r.den_ + r.sign_ * den_ * r.num_;
       int d = den_ * r.den_;
-      sign_ =  ::sign (n) * ::sign (d);
+      sign_ = ::sign (n) * ::sign (d);
       num_ = abs (n);
       den_ = abs (d);
       normalise ();
     }
   return *this;
 }
-    
 
 /*
   copied from libg++ 2.8.0
- */ 
+*/
 Rational::Rational (double x)
 {
   if (x != 0.0)
@@ -208,7 +204,7 @@ Rational::Rational (double x)
 
       num_ = (unsigned int) (mantissa * FACT);
       den_ = (unsigned int) FACT;
-      normalise ();      
+      normalise ();
       if (expt < 0)
        den_ <<= -expt;
       else
@@ -224,21 +220,20 @@ Rational::Rational (double x)
     }
 }
 
-
 void
 Rational::invert ()
 {
   int r (num_);
-  num_  = den_;
+  num_ = den_;
   den_ = r;
 }
 
 Rational &
-Rational::operator *= (Rational r)
+Rational::operator*= (Rational r)
 {
   sign_ *= ::sign (r.sign_);
   if (r.is_infinity ())
-    {  
+    {
       sign_ = sign () * 2;
       goto exit_func;
     }
@@ -250,9 +245,9 @@ Rational::operator *= (Rational r)
  exit_func:
   return *this;
 }
-  
+
 Rational &
-Rational::operator /= (Rational r)
+Rational::operator/= (Rational r)
 {
   r.invert ();
   return (*this *= r);
@@ -264,8 +259,8 @@ Rational::negate ()
   sign_ *= -1;
 }
 
-Rational&
-Rational::operator -= (Rational r)
+Rational &
+Rational::operator-= (Rational r)
 {
   r.negate ();
   return (*this += r);
@@ -276,7 +271,7 @@ Rational::to_string () const
 {
   if (is_infinity ())
     {
-      String s (sign_ > 0 ? "" : "-" );
+      String s (sign_ > 0 ? "" : "-");
       return String (s + "infinity");
     }
 
index d2fd21ce972df05e570bef412a19aec2bda7be18..be044e062f1851b299bdeb40933d6ff01ff34241 100644 (file)
@@ -2,7 +2,7 @@
   PROJECT: FlowerSoft C++ library
   FILE   : string-convert.cc
 
---*/
+  --*/
 
 #include "string-convert.hh"
 
    2e318, this number would have approx 318 zero's in its string.
 
    Should enlarge buff dynamically.
-   
+
    @see
    man 3 snprintf
-   */
-static const int STRING_BUFFER_LEN=1024;
+*/
+static const int STRING_BUFFER_LEN = 1024;
 
 String
 String_convert::bool_string (bool b)
@@ -36,8 +36,8 @@ String
 String_convert::bin2hex (String bin_string)
 {
   String str;
-  Byte constbyte = bin_string.to_bytes ();
-  for (int i = 0; i < bin_string.length (); i++) 
+  Byte const *byte = bin_string.to_bytes ();
+  for (int i = 0; i < bin_string.length (); i++)
     {
       str += to_string ((char)nibble2hex_byte (*byte >> 4));
       str += to_string ((char)nibble2hex_byte (*byte++));
@@ -57,7 +57,7 @@ String_convert::bin2unsigned (String bin_string)
   assert (bin_string.length () <= (int)sizeof (unsigned));
 
   unsigned result_u = 0;
-  for (int i = 0; i < bin_string.length (); i++) 
+  for (int i = 0; i < bin_string.length (); i++)
     {
       result_u <<= 8;
       result_u += (Byte)bin_string[ i ];
@@ -80,11 +80,11 @@ String_convert::dec2int (String dec_string)
 }
 
 String
-String_convert::i64_string (I64 i64, char constfmt)
+String_convert::i64_string (I64 i64, char const *fmt)
 {
   char buffer[STRING_BUFFER_LEN];
   snprintf (buffer, STRING_BUFFER_LEN,
(fmt ? fmt : "%Ld"), i64);     // assume radix 10
          (fmt ? fmt : "%Ld"), i64); // assume radix 10
   return String (buffer);
 
 }
@@ -101,27 +101,27 @@ String_convert::dec2double (String dec_string)
 }
 
 int
-String_convert::hex2bin (String hex_string, Stringbin_string_r)
+String_convert::hex2bin (String hex_string, String &bin_string_r)
 {
   if (hex_string.length () % 2)
     hex_string = "0" + hex_string;
 
   bin_string_r = "";
-  Byte constbyte= hex_string.to_bytes ();
+  Byte const *byte= hex_string.to_bytes ();
   int i = 0;
-  while (i < hex_string.length ()) 
+  while (i < hex_string.length ())
     {
       int high_i = hex2nibble (*byte++);
       int low_i = hex2nibble (*byte++);
       if (high_i < 0 || low_i < 0)
        return 1; // illegal char
-      bin_string_r += to_string ((char) (high_i << 4 | low_i), 1 );
+      bin_string_r += to_string ((char) (high_i << 4 | low_i), 1);
       i += 2;
     }
   return 0;
 }
 
-String 
+String
 String_convert::hex2bin (String hex_string)
 {
   String str;
@@ -132,7 +132,7 @@ String_convert::hex2bin (String hex_string)
   return str;
 }
 
-int 
+int
 String_convert::hex2nibble (Byte byte)
 {
   if (byte >= '0' && byte <= '9')
@@ -145,7 +145,7 @@ String_convert::hex2nibble (Byte byte)
 }
 
 // stupido.  Should use int_string ()
-String 
+String
 String_convert::int2dec (int i, int length_i, char ch)
 {
   char fill_char = ch;
@@ -154,14 +154,13 @@ String_convert::int2dec (int i, int length_i, char ch)
 
   // ugh
   String dec_string = to_string (i);
-  
+
   // ugh
   return to_string (fill_char, length_i - dec_string.length ()) + dec_string;
 }
 
-
 // stupido.  Should use int_string ()
-String 
+String
 String_convert::unsigned2hex (unsigned u, int length_i, char fill_char)
 {
   String str;
@@ -169,9 +168,9 @@ String_convert::unsigned2hex (unsigned u, int length_i, char fill_char)
     str = "0";
 
 #if 1 // both go...
-  while (u) 
+  while (u)
     {
-      str = to_string ((char) ((u % 16)["0123456789abcdef"] ) ) + str;
+      str = to_string ((char) ((u % 16)["0123456789abcdef"])) + str;
       u /= 16;
     }
 #else
@@ -200,22 +199,22 @@ String_convert::nibble2hex_byte (Byte byte)
     return (byte & 0x0f) - 10 + 'a';
 }
 /**
-  Convert an integer to a string
+   Convert an integer to a string
 
-  @param
-  #fmt# is a printf style format, default assumes "%d" as format. 
-  */
+   @param
+   #fmt# is a printf style format, default assumes "%d" as format.
+*/
 String
-String_convert::int_string (int i, char constfmt)
+String_convert::int_string (int i, char const *fmt)
 {
   char buffer[STRING_BUFFER_LEN];
   snprintf (buffer, STRING_BUFFER_LEN,
(fmt ? fmt : "%d"), i);     // assume radix 10
          (fmt ? fmt : "%d"), i); // assume radix 10
   return String (buffer);
 }
 
 String
-String_convert::form_string (char constformat, ...)
+String_convert::form_string (char const *format, ...)
 {
   va_list args;
   va_start (args, format);
@@ -225,8 +224,8 @@ String_convert::form_string (char const* format, ...)
   return String (buffer);
 }
 
-String 
-String_convert::vform_string (char constformat, va_list args)
+String
+String_convert::vform_string (char const *format, va_list args)
 {
   char buffer[STRING_BUFFER_LEN];
   vsnprintf (buffer, STRING_BUFFER_LEN, format, args);
@@ -234,32 +233,32 @@ String_convert::vform_string (char const* format, va_list args)
 }
 
 /**
-  Convert a double to a string.
+   Convert a double to a string.
 
-  @param #fmt# is a printf style format, default assumes "%lf" as format
- */
+   @param #fmt# is a printf style format, default assumes "%lf" as format
+*/
 String
-String_convert::double_string (double f, char constfmt)
+String_convert::double_string (double f, char const *fmt)
 {
-  char buf[STRING_BUFFER_LEN]; 
+  char buf[STRING_BUFFER_LEN];
 
   snprintf (buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
   return String (buf);
 }
 
 /**
-Make a string from a single character.
+   Make a string from a single character.
 
-  @param
-  #n# is a repetition count, default value is 1
- */
+   @param
+   #n# is a repetition count, default value is 1
+*/
 String
 String_convert::char_string (char c, int n)
 {
   n = n >= 0 ? n : 0;
-  charch = new char[ n ];
+  char *ch = new char[ n ];
   memset (ch, c, n);
-  String s ((Byte*)ch, n);
+  String s ((Byte *)ch, n);
   delete[] ch;
   return s;
 }
@@ -267,23 +266,23 @@ String_convert::char_string (char c, int n)
 String
 String_convert::rational_string (Rational r)
 {
- return r.to_string ();
 return r.to_string ();
 }
 
 String
 String_convert::pointer_string (void const *l)
 {
   char buffer[STRING_BUFFER_LEN];
-  snprintf (buffer, STRING_BUFFER_LEN, "%p", l);     // assume radix 10
+  snprintf (buffer, STRING_BUFFER_LEN, "%p", l); // assume radix 10
   return String (buffer);
 }
 
 /**
-  Convert a double to a string.
+   Convert a double to a string.
 
-  @param
-  #n# is the number of nonzero digits
- */
+   @param
+   #n# is the number of nonzero digits
+*/
 String
 String_convert::precision_string (double x, int n)
 {
@@ -324,8 +323,7 @@ String_convert::split (String str, char c)
     {
       String s = str.left_string (i);
       a.push (s);
-      while (str[++i] == c)
-       ;
+      while (str[++i] == c);
       str = str.cut_string (i, INT_MAX);
       i = str.index (c);
     }
@@ -334,12 +332,11 @@ String_convert::split (String str, char c)
   return a;
 }
 
-
 String
 String_convert::long_string (long l)
 {
   char s[STRING_BUFFER_LEN];
-  sprintf (s,"%ld", l);
+  sprintf (s, "%ld", l);
   return s;
 }
 
index dceafbc26743e7874556682f6bca6bd1725b6b4a..0f8aa09011e41e6e52e4b50d47d63e58a2e5e01a 100644 (file)
@@ -1,10 +1,8 @@
 /*
+  string.cc - implement String
 
- string.cc - implement String
   (c) 1997--2005 Han-Wen Nienhuys & Jan Nieuwenhuizen
-
- */
+*/
 
 #ifndef _GNU_SOURCE // we want memmem
 #define _GNU_SOURCE
 #include "string-convert.hh"
 
 #ifdef STRING_DEBUG
-void* mymemmove (void* dest, void const* src, size_t n);
+void *mymemmove (void *dest, void const *src, size_t n);
 #define memmove mymemmove
 #endif
 
 // return array, alloced with new.
-Byte*
+Byte *
 String::get_copy_byte () const
 {
-  Byte constsrc = strh_.to_bytes ();
-  Bytedest = new Byte[strh_.length () + 1];
+  Byte const *src = strh_.to_bytes ();
+  Byte *dest = new Byte[strh_.length () + 1];
   memcpy (dest, src, strh_.length () + 1);
-  return dest;    
+  return dest;
 }
 
-char*
+char *
 String::get_copy_str0 () const
 {
-  return (char*)get_copy_byte ();
+  return (char *)get_copy_byte ();
 }
 
 \f
 /*
   copying, constructing.
- */
-String&
-String::operator = (String const&source)
+*/
+String &
+String::operator= (String const &source)
 {
   strh_ = source.strh_;
   return *this;
 }
 
-
-String::String (Byte const* byte, int len_i)
-{   
+String::String (Byte const *byte, int len_i)
+{
   strh_.set (byte, len_i);
 }
 
 /**
-  @see
-  String_convert::
- */
+   @see
+   String_convert::
+*/
 String
 to_string (char c, int n)
 {
@@ -71,13 +68,13 @@ to_string (char c, int n)
 }
 
 String
-to_string (double f, char constformat)
+to_string (double f, char const *format)
 {
   return String_convert::double_string (f, format);
 }
 
 String
-to_string (int i, char const * format)
+to_string (int i, char const *format)
 {
   return String_convert::int_string (i, format);
 }
@@ -93,8 +90,8 @@ to_string (long b)
   return String_convert::long_string (b);
 }
 
-String 
-to_string (char const* format, ... )
+String
+to_string (char const *format, ...)
 {
   va_list args;
   va_start (args, format);
@@ -110,7 +107,7 @@ String::append (String s)
   strh_.append (s.to_bytes (), s.length ());
 }
 void
-String::operator += (String s)
+String::operator+= (String s)
 {
   append (s);
 }
@@ -128,49 +125,49 @@ String::length () const
   return strh_.length ();
 }
 
-Byte const*
+Byte const *
 String::to_bytes () const
 {
   return strh_.to_bytes ();
 }
 
-char const*
+char const *
 String::to_str0 () const
 {
   return strh_.to_str0 ();
 }
 
-Byte*
+Byte *
 String::get_bytes ()
 {
   return strh_.get_bytes ();
 }
 
-char*
+char *
 String::get_str0 ()
 {
   return strh_.get_str0 ();
 }
 
-bool 
+bool
 String::is_empty () const
 {
   return !length ();
 }
 /**
-  Do a signed comparison,  analogous to memcmp;
- */
+   Do a signed comparison,  analogous to memcmp;
+*/
 int
-String::compare (String const& s1, String const& s2) 
+String::compare (String const &s1, String const &s2)
 {
-  Byte constp1 = s1.to_bytes ();
-  Byte constp2 = s2.to_bytes ();
+  Byte const *p1 = s1.to_bytes ();
+  Byte const *p2 = s2.to_bytes ();
   if (p1 == p2)
     return 0;
 
   /*
     don't forget the terminating '\0'
-   */
+  */
   int f = (s1.length () <? s2.length ());
   int cmp_length = 1+ f;
   int i = memcmp (p1, p2, cmp_length);
@@ -181,69 +178,69 @@ String::compare (String const& s1, String const& s2)
 int
 String::index_last (char const c) const
 {
-  if (!length ()) 
+  if (!length ())
     return -1;
 
-  char constme = strh_.to_str0 ();
-  char const* p = (char const*)memrchr ((Byte*)me, length (), c);
+  char const *me = strh_.to_str0 ();
+  char const *p = (char const *)memrchr ((Byte *)me, length (), c);
   if (p)
     return p - me;
   return -1;
 }
 
 int
-String::index_last (char conststring) const // UGK!
+String::index_last (char const *string) const // UGK!
 {
   assert (false);              // broken
   int len = strlen (string); // ugrh
-  if (!length () || !len) 
+  if (!length () || !len)
     return -1;
-  
+
   int next_i = index (string);
   if (next_i == -1)
     return -1;
-  
+
   int index_i = 0;
-  while (next_i >= 0) 
+  while (next_i >= 0)
     {
       index_i += next_i;
-      next_i = right_string (length () - index_i - len).index (string );
+      next_i = right_string (length () - index_i - len).index (string);
     }
   return index_i;
 }
 
 /** find  a character.
 
-  @return
-  the index of the leftmost character #c# (0 <= return < length ()),
-  or   -1 if not found. 
+@return
+the index of the leftmost character #c# (0 <= return < length ()),
+or   -1 if not found.
 
-  ? should return length ()?, as in string.left_string (index (delimiter))
+? should return length ()?, as in string.left_string (index (delimiter))
 */
 int
 String::index (char c) const
 {
-  char constme = strh_.to_str0 ();
-  char const* p = (char const *) memchr (me,c,  length ());
+  char const *me = strh_.to_str0 ();
+  char const *p = (char const *) memchr (me, c, length ());
   if (p)
     return p - me;
   return -1;
 }
 
 /**
-  find a substring.
+   find a substring.
 
-  @return
-  index of leftmost occurrence of #searchfor#
- */
+   @return
+   index of leftmost occurrence of #searchfor#
+*/
 int
 String::index (String searchfor) const
 {
-  char constme = strh_.to_str0 ();
+  char const *me = strh_.to_str0 ();
 
-  char const* p = (char const *) 
+  char const *p = (char const *)
     memmem (me, length (), searchfor.to_str0 (), searchfor.length ());
-  
+
   if (p)
     return p - me;
 
@@ -252,12 +249,10 @@ String::index (String searchfor) const
 
 /** find chars of a set.
 
-  @return
-
-  the index of the leftmost occurance of an element of #set#.  -1 if
-  nothing is found.
-
+@return
 
+the index of the leftmost occurance of an element of #set#.  -1 if
+nothing is found.
 */
 int
 String::index_any (String set) const
@@ -266,13 +261,13 @@ String::index_any (String set) const
   if (!n)
     return -1;
 
-  void const * me = (void const *) strh_.to_str0 ();
-  for (int i=0; i  < set.length (); i++) 
+  void const *me = (void const *) strh_.to_str0 ();
+  for (int i = 0; i < set.length (); i++)
     {
-      char * found= (char*) memchr (me, set[i], n );
-      if (found) 
+      char *found= (char *) memchr (me, set[i], n);
+      if (found)
        {
-         return found - (char const*)me;
+         return found - (char const *)me;
        }
     }
   return -1;
@@ -284,10 +279,10 @@ String::left_string (int n) const
   if (n >= length ())
     return *this;
 
-  String retval;       
+  String retval;
   if (n < 1)
     return retval;
-  
+
   retval = *this;
   retval.strh_.trunc (n);
   return retval;
@@ -298,41 +293,40 @@ String::right_string (int n) const
 {
   if (n > length ())
     return *this;
-  
+
   if (n < 1)
     return "";
-  
-  return String (strh_.to_bytes () + length () - n, n); 
-}
 
+  return String (strh_.to_bytes () + length () - n, n);
+}
 
 String
 String::nomid_string (int index_i, int n) const
 {
-  if (index_i < 0) 
+  if (index_i < 0)
     {
       n += index_i;
       index_i = 0;
     }
   if (n <= 0)
     return *this;
-  
+
   return left_string (index_i) + right_string (length () - index_i - n);
 }
 
 String
 String::cut_string (int index_i, int n) const
 {
-  if (index_i <0) 
+  if (index_i <0)
     {
       n += index_i;
-      index_i=0;
+      index_i = 0;
     }
-  
-  if (!length () || (index_i < 0) || (index_i >= length () ) || (n < 1 ) )
+
+  if (!length () || (index_i < 0) || (index_i >= length ()) || (n < 1))
     return String ();
 
-  if ((n > length ()) || (index_i + n > length () ) )
+  if ((n > length ()) || (index_i + n > length ()))
     n = length () - index_i;
 
   return String (to_bytes () + index_i, n);
@@ -348,10 +342,10 @@ String::to_upper ()
 void
 String::to_lower ()
 {
-  strnlwr (get_str0 (), length ());    
+  strnlwr (get_str0 (), length ());
 }
 
-void 
+void
 String::reverse ()
 {
   strrev (get_bytes (), length ());
@@ -371,7 +365,7 @@ String::to_double () const
 
 #ifdef STREAM_SUPPORT
 ostream &
-operator << (ostream& os, String d)
+operator<< (ostream& os, String d)
 {
   d.print_on (os);
   return os;
index a9e67a251371199918324e93d6e0248e2732d0cc..0e42eac4e4eae161cf7ef091837e7dd59b656b97 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  stringutil.cc -- generate non-inline members. 
+  stringutil.cc -- generate non-inline members.
 
   This should be in a separate file, because one can include the .icc
   only once.
@@ -8,7 +8,7 @@
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl> */
 
-#ifdef STRING_DEBUG 
+#ifdef STRING_DEBUG
 #define memmove mymemmove
 #endif
 
@@ -32,9 +32,9 @@
 #ifdef STRING_DEBUG
 #include <sys/types.h>
 #include <memory.h>
-void
-mymemmove (void* dest, void const* src, size_t n)
+void *
+mymemmove (void *dest, void const *src, size_t n)
 {
-       return memcpy (dest, src, n); 
+  return memcpy (dest, src, n);
 }
 #endif
index a60c3880bc4f63424385ae309893dbb253765fc3..64965254d084cea85463419263cd4418631842ed 100644 (file)
@@ -59,10 +59,10 @@ protected:
   virtual void derived_mark () const;
 public:
   SCM last_keysig_;    // ugh.
-  
+
   /* Urgh. Since the accidentals depend on lots of variables, we have
-    to store all information before we can really create the
-    accidentals.  */
+     to store all information before we can really create the
+     accidentals.  */
   Link_array<Grob> left_objects_;
   Link_array<Grob> right_objects_;
 
@@ -72,7 +72,6 @@ public:
   Link_array<Spanner> ties_;
 };
 
-
 /*
   TODO:
 
@@ -80,7 +79,7 @@ public:
   aren't. eg. localKeySignature is changed at runtime, which means
   that references in grobs should always store ly_deep_copy ()s of
   those.
- */
+*/
 
 static void
 set_property_on_children (Context *trans, char const *sym, SCM val)
@@ -124,17 +123,16 @@ Accidental_engraver::update_local_key_signature ()
 void
 Accidental_engraver::initialize ()
 {
-  update_local_key_signature (); 
+  update_local_key_signature ();
 }
 
-
 /** Calculate the number of accidentals on basis of the current local key
     sig (passed as argument)
-    
+
     * First check step+octave (taking into account barnumbers if necessary).
-   
+
     * Then check the global signature (only step).
-  
+
     Return number of accidentals (0, 1 or 2).  */
 
 static bool
@@ -143,7 +141,7 @@ recent_enough (int bar_number, SCM alteration_def, SCM laziness)
   if (scm_is_number (alteration_def)
       || laziness == SCM_BOOL_T)
     return true;
-  
+
   return (bar_number <= scm_to_int (scm_cdr (alteration_def)) + scm_to_int (laziness));
 }
 
@@ -177,19 +175,17 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
 
   SCM previous_alteration = SCM_BOOL_F;
 
-
   SCM from_same_octave = ly_assoc_get (scm_cons (scm_int2num (o),
-                                                    scm_int2num (n)), sig, SCM_BOOL_F);
+                                                scm_int2num (n)), sig, SCM_BOOL_F);
   SCM from_key_signature = ly_assoc_get (scm_int2num (n), sig, SCM_BOOL_F);
   SCM from_other_octaves = SCM_BOOL_F;
-  for (SCM s = sig ; scm_is_pair (s); s = scm_cdr (s))
+  for (SCM s = sig; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM entry = scm_car (s);
       if (scm_is_pair (scm_car (entry))
          && scm_cdar (entry) == scm_int2num (n))
-       from_other_octaves = scm_cdr (entry); 
+       from_other_octaves = scm_cdr (entry);
     }
-  
 
   if (from_same_octave != SCM_BOOL_F
       && recent_enough (bar_number, from_same_octave, laziness))
@@ -206,7 +202,7 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
     {
       previous_alteration = from_key_signature;
     }
-  
+
   int num = 1;
   if (is_tied (previous_alteration))
     {
@@ -215,9 +211,9 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
     }
   else
     {
-      int prev =  extract_alteration (previous_alteration);
+      int prev = extract_alteration (previous_alteration);
       int alter = pitch->get_alteration ();
-      
+
       if (alter == prev)
        num = 0;
       else if ((abs (alter) < abs (prev) || prev*alter < 0) && alter != 0)
@@ -236,9 +232,9 @@ number_accidentals (bool *different,
 
   *different = false;
   if (scm_is_pair (accidentals) && !scm_is_symbol (scm_car (accidentals)))
-    warning (_f ("Accidental typesetting list must begin with context-name: %s", 
+    warning (_f ("Accidental typesetting list must begin with context-name: %s",
                 ly_scm2string (scm_car (accidentals)).to_str0 ()));
-  
+
   for (; scm_is_pair (accidentals) && origin;
        accidentals = scm_cdr (accidentals))
     {
@@ -249,11 +245,11 @@ number_accidentals (bool *different,
          SCM type = scm_car (rule);
          SCM laziness = scm_cdr (rule);
          SCM localsig = origin->get_property ("localKeySignature");
-         
-         bool same_octave_b = 
-           scm_is_eq (ly_symbol2scm ("same-octave"), type);
-         bool any_octave_b = 
-           scm_is_eq (ly_symbol2scm ("any-octave"), type);
+
+         bool same_octave_b
+           scm_is_eq (ly_symbol2scm ("same-octave"), type);
+         bool any_octave_b
+           scm_is_eq (ly_symbol2scm ("any-octave"), type);
 
          if (same_octave_b || any_octave_b)
            {
@@ -261,13 +257,12 @@ number_accidentals (bool *different,
              int n = number_accidentals_from_sig
                (&d, localsig, pitch, bar_number, laziness, any_octave_b);
              *different = *different || d;
-             number = max (number, n);     
+             number = max (number, n);
            }
          else
-           warning (_f ("ignoring unknown accidental: %s", 
+           warning (_f ("ignoring unknown accidental: %s",
                         ly_symbol2string (type).to_str0 ()));
        }
-      
 
       /*
        if symbol then it is a context name. Scan parent contexts to find it.
@@ -277,11 +272,11 @@ number_accidentals (bool *different,
          Context *dad = origin;
          while (dad && !dad->is_alias (rule))
            dad = dad->get_parent_context ();
-      
+
          if (dad)
            origin = dad;
        }
-      else warning (_f ("Accidental rule must be pair or context-name; Found %s", 
+      else warning (_f ("Accidental rule must be pair or context-name; Found %s",
                        ly_scm2string (rule).to_str0 ()));
     }
 
@@ -295,11 +290,11 @@ Accidental_engraver::get_bar_number ()
   SCM smp = get_property ("measurePosition");
 
   int bn = robust_scm2int (barnum, 0);
-  
-  Moment mp = robust_scm2moment (smp,  Moment (0));
+
+  Moment mp = robust_scm2moment (smp, Moment (0));
   if (mp.main_part_ < Rational (0))
     bn--;
-  
+
   return bn;
 }
 
@@ -308,16 +303,16 @@ Accidental_engraver::process_acknowledged_grobs ()
 {
   if (accidentals_.size () && !accidentals_.top ().done_)
     {
-      SCM accidentals =  get_property ("autoAccidentals");
-      SCM cautionaries =  get_property ("autoCautionaries");
+      SCM accidentals = get_property ("autoAccidentals");
+      SCM cautionaries = get_property ("autoCautionaries");
       int barnum = get_bar_number ();
-      
+
       bool extra_natural_b = get_property ("extraNatural") == SCM_BOOL_T;
-      for (int i = 0; i < accidentals_.size (); i++) 
+      for (int i = 0; i < accidentals_.size (); i++)
        {
-         if (accidentals_[i].done_ )
+         if (accidentals_[i].done_)
            continue;
-         accidentals_[i].done_  = true;
+         accidentals_[i].done_ = true;
          Grob *support = accidentals_[i].head_;
          Music *note = accidentals_[i].melodic_;
          Context *origin = accidentals_[i].origin_;
@@ -328,7 +323,7 @@ Accidental_engraver::process_acknowledged_grobs ()
 
          bool different = false;
          bool different_caut = false;
-         
+
          int num = number_accidentals (&different,
                                        pitch, origin,
                                        accidentals, barnum);
@@ -337,7 +332,7 @@ Accidental_engraver::process_acknowledged_grobs ()
                                             cautionaries, barnum);
 
          bool cautionary = to_boolean (note->get_property ("cautionary"));
-         
+
          if (num_caut > num)
            {
              num = num_caut;
@@ -347,26 +342,24 @@ Accidental_engraver::process_acknowledged_grobs ()
 
          if (num == 0 && to_boolean (note->get_property ("force-accidental")))
            num = 1;
-         
 
          /*
            Can not look for ties: it's not guaranteed that they reach
            us before the notes
-          */
-       
+         */
+
          if (num)
            {
              /*
                We construct the accidentals at the originating Voice
                level, so that we get the property settings for
                Accidental from the respective Voice.
-              */
+             */
              Grob *a
                = make_item_from_properties (accidentals_[i].origin_trans_,
                                             ly_symbol2scm ("Accidental"),
                                             note->self_scm (),
-                                            "Accidental"
-                                            );
+                                            "Accidental");
              a->set_parent (support, Y_AXIS);
 
              if (!accidental_placement_)
@@ -382,7 +375,7 @@ Accidental_engraver::process_acknowledged_grobs ()
 
              if (cautionary)
                a->set_property ("cautionary", SCM_BOOL_T);
-             
+
              support->set_property ("accidental-grob", a->self_scm ());
 
              a->set_property ("accidentals", accs);
@@ -392,9 +385,9 @@ Accidental_engraver::process_acknowledged_grobs ()
                We add the accidentals to the support of the arpeggio,
                so it is put left of the accidentals.
              */
-             for (int i = 0;  i < left_objects_.size ();  i++)
+             for (int i = 0; i < left_objects_.size (); i++)
                Side_position_interface::add_support (left_objects_[i], a);
-             for (int i = 0;  i < right_objects_.size ();  i++)
+             for (int i = 0; i < right_objects_.size (); i++)
                Side_position_interface::add_support (a, right_objects_[i]);
            }
        }
@@ -413,7 +406,7 @@ Accidental_engraver::stop_translation_timestep ()
   for (int j = ties_.size (); j--;)
     {
       Grob *r = Tie::head (ties_[j], RIGHT);
-      for (int i = accidentals_.size ();  i--;)
+      for (int i = accidentals_.size (); i--;)
        if (accidentals_[i].head_ == r)
          {
            if (Grob *g = accidentals_[i].accidental_)
@@ -426,12 +419,12 @@ Accidental_engraver::stop_translation_timestep ()
          }
     }
 
-  for (int i = accidentals_.size (); i--;) 
+  for (int i = accidentals_.size (); i--;)
     {
       int barnum = get_bar_number ();
 
       Music *note = accidentals_[i].melodic_;
-      Context * origin = accidentals_[i].origin_;
+      Context *origin = accidentals_[i].origin_;
 
       Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
       if (!pitch)
@@ -446,7 +439,7 @@ Accidental_engraver::stop_translation_timestep ()
             && origin->where_defined (ly_symbol2scm ("localKeySignature")))
        {
          /*
-           huh? we set props all the way to the top? 
+           huh? we set props all the way to the top?
          */
          SCM localsig = origin->get_property ("localKeySignature");
          bool change = false;
@@ -495,14 +488,14 @@ Accidental_engraver::acknowledge_grob (Grob_info info)
       && note->is_mus_type ("note-event")
       && Rhythmic_head::has_interface (info.grob_))
     {
-      if (to_boolean ( get_property ("harmonicAccidentals"))
+      if (to_boolean (get_property ("harmonicAccidentals"))
          || !ly_c_equal_p (info.grob_->get_property ("style"),
-                         ly_symbol2scm ("harmonic")))
+                           ly_symbol2scm ("harmonic")))
        {
-         
-         Accidental_entry entry ;
+
+         Accidental_entry entry;
          entry.head_ = info.grob_;
-         entry.origin_trans_ = dynamic_cast<Engraver*> (info.origin_trans_);
+         entry.origin_trans_ = dynamic_cast<Engraver *> (info.origin_trans_);
          entry.origin_ = info.origin_trans_->context ();
          entry.melodic_ = note;
 
@@ -510,12 +503,12 @@ Accidental_engraver::acknowledge_grob (Grob_info info)
        }
     }
   else if (Tie::has_interface (info.grob_))
-    ties_.push (dynamic_cast<Spanner*> (info.grob_));
+    ties_.push (dynamic_cast<Spanner *> (info.grob_));
   else if (Arpeggio::has_interface (info.grob_))
-    left_objects_.push (info.grob_); 
+    left_objects_.push (info.grob_);
   else if (info.grob_
           ->internal_has_interface (ly_symbol2scm ("finger-interface")))
-    left_objects_.push (info.grob_); 
+    left_objects_.push (info.grob_);
 }
 
 void
@@ -529,26 +522,20 @@ Accidental_engraver::process_music ()
 }
 
 ADD_TRANSLATOR (Accidental_engraver,
-                  "Make accidentals.  "
-                  "Catch note heads, ties and notices key-change events.  "
-                  "This engraver usually lives at Staff level, but "
-                  "reads the settings for Accidental at @code{Voice} level, " 
-                  "so you can @code{\\override} them at @code{Voice}. "
-                  ,
-                  "Accidental"
-                  ,
-                  ""
-                  ,
-                  "arpeggio-interface "
-                  "finger-interface "
-                  "rhythmic-head-interface "
-                  "tie-interface "
-                  ,
-                  "autoAccidentals "
-                  "autoCautionaries "
-                  "extraNatural "
-                  "harmonicAccidentals "
-                  "localKeySignature"
-                  ,
-                  "localKeySignature"
-                  );
+               "Make accidentals.  "
+               "Catch note heads, ties and notices key-change events.  "
+               "This engraver usually lives at Staff level, but "
+               "reads the settings for Accidental at @code{Voice} level, "
+               "so you can @code{\\override} them at @code{Voice}. ",
+               "Accidental",
+               "",
+               "arpeggio-interface "
+               "finger-interface "
+               "rhythmic-head-interface "
+               "tie-interface ",
+               "autoAccidentals "
+               "autoCautionaries "
+               "extraNatural "
+               "harmonicAccidentals "
+               "localKeySignature",
+               "localKeySignature");
index 91e0de193b0707084327a3e57e559a6b7ff92d7b..cf67149f76623e51b6c76d3201cf904b6ffea45d 100644 (file)
@@ -1,15 +1,13 @@
-/*   
-     accidental-placement.cc -- implement Accidental_placement
-
-     source file of the GNU LilyPond music typesetter
+/*
+  accidental-placement.cc -- implement Accidental_placement
 
-     (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  source file of the GNU LilyPond music typesetter
 
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include <math.h>
 
-
 #include "accidental-placement.hh"
 #include "libc-extension.hh"   // isinf
 #include "skyline.hh"
 
 MAKE_SCHEME_CALLBACK (Accidental_placement, alignment_callback, 2);
 SCM
-Accidental_placement::alignment_callback (SCM s, SCM )
+Accidental_placement::alignment_callback (SCM s, SCM)
 {
-  Grob * me = unsmob_grob (s);
+  Grob *me = unsmob_grob (s);
 
-  Grob * par = me->get_parent (X_AXIS);
+  Grob *par = me->get_parent (X_AXIS);
   if (!to_boolean (par->get_property ("positioning-done")))
     {
       par->set_property ("positioning-done", SCM_BOOL_T);
@@ -37,19 +35,18 @@ Accidental_placement::alignment_callback (SCM s, SCM )
   return scm_int2num (0);
 }
 
-
 void
-Accidental_placement::add_accidental (Grob* me, Grob* a)
+Accidental_placement::add_accidental (Grob *me, Grob *a)
 {
   a->set_parent (me, X_AXIS);
   a->add_offset_callback (alignment_callback_proc, X_AXIS);
   SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
 
-  Music *mcause = unsmob_music (cause); 
+  Music *mcause = unsmob_music (cause);
   if (!mcause)
     {
       programming_error ("Note head has no music cause!");
-      return; 
+      return;
     }
 
   Pitch *p = unsmob_pitch (mcause->get_property ("pitch"));
@@ -68,16 +65,16 @@ Accidental_placement::add_accidental (Grob* me, Grob* a)
 
   entry = scm_cons (a->self_scm (), entry);
 
-  accs = scm_assq_set_x (accs,  key, entry);
+  accs = scm_assq_set_x (accs, key, entry);
 
   me->set_property ("accidental-grobs", accs);
 }
 
 /*
   Split into break reminders.
- */
+*/
 void
-Accidental_placement::split_accidentals (Grob * accs,
+Accidental_placement::split_accidentals (Grob *accs,
                                         Link_array<Grob> *break_reminder,
                                         Link_array<Grob> *real_acc)
 {
@@ -108,12 +105,12 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me,
 
   Accidental_placement::split_accidentals (me, &br, &ra);
   br.concat (ra);
-  
-  if (dynamic_cast<Item*>(left_object)->break_status_dir () == RIGHT)
-    which = & br;
+
+  if (dynamic_cast<Item *> (left_object)->break_status_dir () == RIGHT)
+    which = &br;
   else
-    which = & ra;
-  
+    which = &ra;
+
   Interval extent;
   for (int i = 0; i < which->size (); i++)
     {
@@ -125,12 +122,10 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me,
       Real p = robust_scm2double (me->get_property ("left-padding"), 0.2);
       extent[LEFT] -= p;
     }
-  
+
   return extent;
 }
 
-
-
 struct Accidental_placement_entry
 {
   Array<Skyline_entry> left_skyline_;
@@ -138,7 +133,7 @@ struct Accidental_placement_entry
   Interval vertical_extent_;
   Array<Box> extents_;
   Link_array<Grob> grobs_;
-  Real offset_; 
+  Real offset_;
   int notename_;
   Accidental_placement_entry ()
   {
@@ -148,13 +143,11 @@ struct Accidental_placement_entry
 };
 
 static Interval all_accidental_vertical_extent;
-Real ape_priority (Accidental_placement_entry const * a)
+Real ape_priority (Accidental_placement_entry const *a)
 {
   return a->vertical_extent_[UP];
 }
 
-  
-
 int ape_compare (Accidental_placement_entry *const &a,
                 Accidental_placement_entry *const &b)
 {
@@ -162,28 +155,24 @@ int ape_compare (Accidental_placement_entry *const &a,
 }
 
 int ape_rcompare (Accidental_placement_entry *const &a,
-                Accidental_placement_entry *const &b)
+                 Accidental_placement_entry *const &b)
 {
   return -sign (ape_priority (a) - ape_priority (b));
 }
 
-
 /*
-
-TODO: should favor
+  TODO: should favor
 
   b
- b
 b
 
-placement
+  placement
 */
 void
 stagger_apes (Link_array<Accidental_placement_entry> *apes)
 {
   Link_array<Accidental_placement_entry> asc = *apes;
 
-
   asc.sort (&ape_compare);
 
   apes->clear ();
@@ -192,7 +181,7 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
   int parity = 1;
   while (i < asc.size ())
     {
-      Accidental_placement_entry * a = 0;      
+      Accidental_placement_entry *a = 0;
       if (parity)
        a = asc.pop ();
       else
@@ -205,68 +194,63 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
   apes->reverse ();
 }
 
-  
-
 /*
-
   This routine computes placements of accidentals. During
   add_accidental (), accidentals are already grouped by note, so that
   octaves are placed above each other; they form columns. Then the
   columns are sorted: the biggest columns go closest to the note.
   Then the columns are spaced as closely as possible (using skyline
   spacing).
-  
-  
+
+
   TODO: more advanced placement. Typically, the accs should be placed
   to form a C shape, like this
 
-  
-           ##
-        b b
-       # #
-        b
-          b b
 
-   The naturals should be left of the C as well; they should
-   be separate accs.
+  ##
+  b b
+  # #
+  b
+  b b
 
-   Note that this placement problem looks NP hard, so we just use a
-   simple strategy, not an optimal choice.
+  The naturals should be left of the C as well; they should
+  be separate accs.
 
+  Note that this placement problem looks NP hard, so we just use a
+  simple strategy, not an optimal choice.
 */
 
 /*
   TODO: there should be more space in the following situation
 
 
-    Natural + downstem
+  Natural + downstem
 
-    |_       
-    | |    X
-    |_|   | 
-      |   |
-      
- */
+  |_
+  | |    X
+  |_|   |
+  |   |
+*/
 SCM
-Accidental_placement::position_accidentals (Grob * me)
+Accidental_placement::position_accidentals (Grob *me)
 {
   if (!me->is_live ())
     return SCM_UNSPECIFIED;
-  
+
   SCM accs = me->get_property ("accidental-grobs");
   if (!scm_is_pair (accs))
     return SCM_UNSPECIFIED;
-    
+
   /*
     TODO: there is a bug in this code. If two accs are on the same
     Y-position, they share an Ape, and will be printed in overstrike.
-   */
+  */
   Link_array<Accidental_placement_entry> apes;
   for (SCM s = accs; scm_is_pair (s); s = scm_cdr (s))
     {
       Accidental_placement_entry *ape = new Accidental_placement_entry;
       ape->notename_ = scm_to_int (scm_caar (s));
-      
+
       for (SCM t = scm_cdar (s); scm_is_pair (t); t = scm_cdr (t))
        ape->grobs_.push (unsmob_grob (scm_car (t)));
 
@@ -278,23 +262,23 @@ Accidental_placement::position_accidentals (Grob * me)
   /*
     First we must extract *all* pointers. We can only determine
     extents if we're sure that we've found the right common refpoint
-   */
+  */
   Link_array<Grob> note_cols, heads;
   for (int i = apes.size (); i--;)
-    { 
-      Accidental_placement_entry * ape = apes[i];
+    {
+      Accidental_placement_entry *ape = apes[i];
       for (int j = ape->grobs_.size (); j--;)
        {
-         Grob * a = ape->grobs_[j];
+         Grob *a = ape->grobs_[j];
 
          if (common[Y_AXIS])
            common[Y_AXIS] = common[Y_AXIS]->common_refpoint (a, Y_AXIS);
          else
            common[Y_AXIS] = a;
-         
+
          Grob *head = a->get_parent (Y_AXIS);
 
-         Grob * col = head->get_parent (X_AXIS);
+         Grob *col = head->get_parent (X_AXIS);
          if (Note_column::has_interface (col))
            note_cols.push (col);
          else
@@ -305,20 +289,20 @@ Accidental_placement::position_accidentals (Grob * me)
   /*
     This is a little kludgy: to get all notes, we look if there are
     collisions as well.
-   */
-  for (int i = note_cols.size () ; i--;)
+  */
+  for (int i = note_cols.size (); i--;)
     {
       Grob *c = note_cols[i]->get_parent (X_AXIS);
       if (Note_collision_interface::has_interface (c))
        {
-         Link_array<Grob> gs =
-           extract_grob_array (c, ly_symbol2scm ("elements"));
-      
+         Link_array<Grob> gs
+           extract_grob_array (c, ly_symbol2scm ("elements"));
+
          note_cols.concat (gs);
        }
     }
-  
-  for (int i = note_cols.size () ; i--;)
+
+  for (int i = note_cols.size (); i--;)
     {
       heads.concat (extract_grob_array (note_cols[i], ly_symbol2scm ("note-heads")));
     }
@@ -326,34 +310,32 @@ Accidental_placement::position_accidentals (Grob * me)
   heads.uniq ();
   common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);
 
-  
   for (int i = apes.size (); i--;)
     {
-      Accidental_placement_entry * ape = apes[i];
+      Accidental_placement_entry *ape = apes[i];
       ape->left_skyline_ = empty_skyline (LEFT);
       ape->right_skyline_ = empty_skyline (RIGHT);
-   
+
       for (int j = apes[i]->grobs_.size (); j--;)
        {
-         Grob * a = apes[i]->grobs_[j];
+         Grob *a = apes[i]->grobs_[j];
 
          Array<Box> boxes = Accidental_interface::accurate_boxes (a, common);
-         
+
          ape->extents_.concat (boxes);
-         for (int j  = boxes.size (); j--;)
+         for (int j = boxes.size (); j--;)
            {
              insert_extent_into_skyline (&ape->left_skyline_, boxes[j], Y_AXIS, LEFT);
-             insert_extent_into_skyline (&ape->right_skyline_ , boxes[j], Y_AXIS, RIGHT);
+             insert_extent_into_skyline (&ape->right_skyline_, boxes[j], Y_AXIS, RIGHT);
            }
        }
     }
 
-
   Interval total;
   for (int i = apes.size (); i--;)
     {
-      Interval y ;
-      
+      Interval y;
+
       for (int j = apes[i]->extents_.size (); j--;)
        {
          y.unite (apes[i]->extents_[j][Y_AXIS]);
@@ -364,16 +346,16 @@ Accidental_placement::position_accidentals (Grob * me)
   all_accidental_vertical_extent = total;
   stagger_apes (&apes);
 
-  Accidental_placement_entry * head_ape = new Accidental_placement_entry;
-  common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS);  
+  Accidental_placement_entry *head_ape = new Accidental_placement_entry;
+  common[X_AXIS] = common_refpoint_of_array (heads, common[X_AXIS], X_AXIS);
   Array<Skyline_entry> head_skyline (empty_skyline (LEFT));
   Array<Box> head_extents;
   for (int i = heads.size (); i--;)
     {
-      Box b (heads[i]->extent (common[X_AXIS] , X_AXIS),
-           heads[i]->extent (common[Y_AXIS], Y_AXIS));
+      Box b (heads[i]->extent (common[X_AXIS], X_AXIS),
+            heads[i]->extent (common[Y_AXIS], Y_AXIS));
 
-      insert_extent_into_skyline (&head_skyline, b , Y_AXIS, LEFT);
+      insert_extent_into_skyline (&head_skyline, b, Y_AXIS, LEFT);
     }
 
   head_ape-> left_skyline_ = head_skyline;
@@ -386,13 +368,13 @@ Accidental_placement::position_accidentals (Grob * me)
                    -robust_scm2double (me->get_property ("right-padding"), 0));
   /*
     Add accs entries right-to-left.
-   */
+  */
   for (int i = apes.size (); i-- > 0;)
     {
-      Real offset =
-       -skyline_meshing_distance (apes[i]->right_skyline_, left_skyline);
+      Real offset
+       -skyline_meshing_distance (apes[i]->right_skyline_, left_skyline);
       if (isinf (offset))
-       offset = (i < apes.size () - 1) ? apes[i+1]->offset_ : 0.0;
+       offset = (i < apes.size () - 1) ? apes[i + 1]->offset_ : 0.0;
       else
        offset -= padding;
 
@@ -402,35 +384,33 @@ Accidental_placement::position_accidentals (Grob * me)
       heighten_skyline (&new_left_skyline, apes[i]->offset_);
       merge_skyline (&new_left_skyline, left_skyline, LEFT);
       left_skyline = new_left_skyline;
-    }      
+    }
 
   for (int i = apes.size (); i--;)
     {
-      Accidental_placement_entryape = apes[i];
-      for (int j  = ape->grobs_.size (); j--;)
+      Accidental_placement_entry *ape = apes[i];
+      for (int j = ape->grobs_.size (); j--;)
        {
          ape->grobs_[j]->translate_axis (ape->offset_, X_AXIS);
        }
     }
 
-  
   Interval left_extent, right_extent;
   Accidental_placement_entry *ape = apes[0];
 
   for (int i = ape->extents_.size (); i--;)
-    left_extent.unite (ape->offset_ +  ape->extents_[i][X_AXIS]);
+    left_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]);
 
   ape = apes.top ();
   for (int i = ape->extents_.size (); i--;)
-    right_extent.unite (ape->offset_  + ape->extents_[i][X_AXIS]);
+    right_extent.unite (ape->offset_ + ape->extents_[i][X_AXIS]);
 
-  
   left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
   Interval width (left_extent[LEFT], right_extent[RIGHT]);
 
   SCM scm_width = ly_interval2scm (width);
   me->set_extent (scm_width, X_AXIS);
-  
+
   for (int i = apes.size (); i--;)
     delete apes[i];
 
@@ -438,6 +418,6 @@ Accidental_placement::position_accidentals (Grob * me)
 }
 
 ADD_INTERFACE (Accidental_placement,
-             "accidental-placement-interface",
-             "Resolve accidental collisions.",
-             "left-padding padding right-padding accidental-grobs positioning-done")
+              "accidental-placement-interface",
+              "Resolve accidental collisions.",
+              "left-padding padding right-padding accidental-grobs positioning-done")
index 54c68cb640b2de30292d6eedd5235b57b020a7f4..9aab78202a2dcf194d6aba3d6517d7d8f1d235ff 100644 (file)
@@ -2,7 +2,7 @@
   accidental.cc -- implement Accidental_interface
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "pitch.hh"
 
 /*
-  
   TODO: insert support for smaller cautionaries, tie-break-reminders.
   Either here or in new-accidental-engraver.
 
   'accidentals should go, for a single 'accidental property -- see
   accidental-placement.cc
-
 */
 Stencil
-parenthesize (Grob*me, Stencil m)
+parenthesize (Grob *me, Stencil m)
 {
   Stencil open = Font_interface::get_default_font (me)->find_by_name ("accidentals.leftparen");
   Stencil close = Font_interface::get_default_font (me)->find_by_name ("accidentals.rightparen");
@@ -34,12 +32,11 @@ parenthesize (Grob*me, Stencil m)
   return m;
 }
 
-
 MAKE_SCHEME_CALLBACK (Accidental_interface, after_line_breaking, 1);
 SCM
 Accidental_interface::after_line_breaking (SCM smob)
 {
-  Grob *me  = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
   Grob *tie = unsmob_grob (me->get_property ("tie"));
 
   if (tie && !tie->original_)
@@ -50,14 +47,14 @@ Accidental_interface::after_line_breaking (SCM smob)
 }
 
 Array<Box>
-Accidental_interface::accurate_boxes (Grob *a, Grob**common)
+Accidental_interface::accurate_boxes (Grob *a, Grob **common)
 {
   Box b;
   b[X_AXIS] = a->extent (a, X_AXIS);
   b[Y_AXIS] = a->extent (a, Y_AXIS);
 
   Array<Box> boxes;
-  
+
   bool parens = false;
   if (to_boolean (a->get_property ("cautionary")))
     {
@@ -72,194 +69,193 @@ Accidental_interface::accurate_boxes (Grob *a, Grob**common)
       && scm_ilength (accs) == 1)
     {
       switch (scm_to_int (scm_car (accs))
-      {
-      case FLAT:
        {
-         Box stem = b;
-         Box bulb = b;
+       case FLAT:
+         {
+           Box stem = b;
+           Box bulb = b;
+
+           /*
+             we could make the stem thinner, but that places the flats
+             really close.
+           */
+           stem[X_AXIS][RIGHT] *= .5;
+
+           /*
+             To prevent vertical alignment for 6ths
+           */
+           stem[Y_AXIS] *= 1.1;
+           bulb[Y_AXIS][UP] *= .35;
+
+           boxes.push (bulb);
+           boxes.push (stem);
+         }
+         break;
+       case NATURAL:
+         {
+           Box lstem = b;
+           Box rstem = b;
+           Box belly = b;
 
+           lstem[Y_AXIS] *= 1.1;
+           rstem[Y_AXIS] *= 1.1;
+
+           belly[Y_AXIS] *= 0.75;
+           lstem[X_AXIS][RIGHT] *= .5;
+           rstem[X_AXIS][LEFT] = lstem[X_AXIS][RIGHT];
+           lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN];
+           rstem[Y_AXIS][UP] = belly[Y_AXIS][UP];
+           boxes.push (belly);
+           boxes.push (lstem);
+           boxes.push (rstem);
+         }
+         break;
          /*
-           we could make the stem thinner, but that places the flats
-           really close.
+           TODO: add support for, double flat.
          */
-         stem[X_AXIS][RIGHT] *= .5;
+       }
 
-         /*
-           To prevent vertical alignment for 6ths
-          */
-         stem[Y_AXIS]  *= 1.1;  
-         bulb[Y_AXIS][UP] *= .35;
+             if (!boxes.size ())
+               boxes.push (b);
+
+             Offset o (a->relative_coordinate (common[X_AXIS], X_AXIS),
+                       a->relative_coordinate (common[Y_AXIS], Y_AXIS));
+             for (int i = boxes.size (); i--;)
+               {
+                 boxes[i].translate (o);
+               }
+
+             return boxes;
+             }
 
-         boxes.push (bulb);
-         boxes.push (stem);
-       }
-       break;
-      case NATURAL:
-       {
-         Box lstem = b;
-         Box rstem = b;
-         Box belly = b;
-
-         lstem[Y_AXIS] *= 1.1;
-         rstem[Y_AXIS] *= 1.1;
-         
-         belly[Y_AXIS] *= 0.75;
-         lstem[X_AXIS][RIGHT] *= .5;
-         rstem[X_AXIS][LEFT] = lstem[X_AXIS][RIGHT];
-         lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN];
-         rstem[Y_AXIS][UP] = belly[Y_AXIS][UP];
-         boxes.push (belly);
-         boxes.push (lstem);
-         boxes.push (rstem);
-       }
-       break;
       /*
-       TODO: add support for, double flat.
+       * Some styles do not provide all flavours of accidentals, e.g. there
+       * is currently no sharp accidental in vaticana style.  In these cases
+       * this function falls back to one of the other styles.
        */
-    }
-
-  if (!boxes.size ())
-    boxes.push (b);
 
-  Offset o (a->relative_coordinate (common[X_AXIS],  X_AXIS),
-           a->relative_coordinate (common[Y_AXIS],  Y_AXIS));
-  for (int i = boxes.size (); i--;)
-    {
-      boxes[i].translate (o);
-    }
-  
-  return boxes;
-}
+      /*
+       todo: this sort of stuff in Scheme. --hwn.
+      */
+      String
+       Accidental_interface::get_fontcharname (String style, int alteration)
+      {
+       if (alteration == DOUBLE_FLAT
+           || alteration == DOUBLE_SHARP)
+         {
+           return to_string (alteration);
+         }
 
-/*
- * Some styles do not provide all flavours of accidentals, e.g. there
- * is currently no sharp accidental in vaticana style.  In these cases
- * this function falls back to one of the other styles.
- */
+       if (style == "hufnagel")
+         switch (alteration)
+           {
+           case FLAT: return "hufnagel-1";
+           case 0: return "vaticana0";
+           case SHARP: return "mensural1";
+           }
+       if (style == "medicaea")
+         switch (alteration)
+           {
+           case FLAT: return "medicaea-1";
+           case 0: return "vaticana0";
+           case SHARP: return "mensural1";
+           }
+       if (style == "vaticana")
+         switch (alteration)
+           {
+           case FLAT: return "vaticana-1";
+           case 0: return "vaticana0";
+           case SHARP: return "mensural1";
+           }
+       if (style == "mensural")
+         switch (alteration)
+           {
+           case FLAT: return "mensural-1";
+           case 0: return "vaticana0";
+           case SHARP: return "mensural1";
+           }
 
-/*
-  todo: this sort of stuff in Scheme. --hwn.
- */
-String
-Accidental_interface::get_fontcharname (String style, int alteration)
-{
-  if (alteration == DOUBLE_FLAT
-      || alteration == DOUBLE_SHARP)
-    {
-      return to_string (alteration);
-    }
-  
-  if (style == "hufnagel")
-    switch (alteration)
-      {
-      case FLAT: return "hufnagel-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-  if (style == "medicaea")
-    switch (alteration)
-      {
-      case FLAT: return "medicaea-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
+       if (style == "neomensural")
+         style = ""; // currently same as default
+       if (style == "default")
+         style = "";
+       return style + to_string (alteration);
       }
-  if (style == "vaticana")
-    switch (alteration)
-      {
-      case FLAT: return "vaticana-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-  if (style == "mensural")
-    switch (alteration)
+
+      MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1);
+      SCM
+       Accidental_interface::print (SCM smob)
       {
-      case FLAT: return "mensural-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-  
-  if (style == "neomensural")
-    style = ""; // currently same as default
-  if (style == "default")
-    style = "";
-  return style + to_string (alteration);
-}
+       Grob *me = unsmob_grob (smob);
+       bool smaller = false;
+       bool parens = false;
 
-MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1);
-SCM
-Accidental_interface::print (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-  bool smaller = false;
-  bool parens = false;
+       bool caut = to_boolean (me->get_property ("cautionary"));
+       if (caut)
+         {
+           SCM cstyle = me->get_property ("cautionary-style");
+           parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+           smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
+         }
 
-  bool caut  = to_boolean (me->get_property ("cautionary"));
-  if (caut)
-    {
-      SCM cstyle = me->get_property ("cautionary-style");
-      parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
-      smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
-    }
+       SCM scm_style = me->get_property ("style");
+       String style;
+       if (scm_is_symbol (scm_style))
+         {
+           style = ly_symbol2string (scm_style);
+         }
+       else
+         {
+           /*
+             preferably no name for the default style.
+           */
+           style = "";
+         }
 
-  SCM scm_style = me->get_property ("style");
-  String style;
-  if (scm_is_symbol (scm_style))
-    {
-      style = ly_symbol2string (scm_style);
-    }
-  else
-    {
-      /*
-       preferably no name for the default style.
-      */
-      style = "";
-    }
+       Font_metric *fm = 0;
+       if (smaller)
+         {
+           SCM ac = Font_interface::music_font_alist_chain (me);
+           /*
+             TODO: should calc font-size by adding -2 to current font-size
+           */
+           ac = scm_cons (scm_list_1 (scm_cons
+                                      (ly_symbol2scm ("font-size"),
+                                       scm_int2num (-2))),
+                          ac);
+           fm = select_font (me->get_layout (), ac);
+         }
+       else
+         fm = Font_interface::get_default_font (me);
 
-  Font_metric *fm = 0;
-  if (smaller)
-    {
-      SCM ac = Font_interface::music_font_alist_chain (me);
-      /*
-       TODO: should calc font-size by adding -2 to current font-size
-      */
-      ac = scm_cons (scm_list_1 (scm_cons
-                                (ly_symbol2scm ("font-size"),
-                                 scm_int2num (-2))),
-                    ac);
-      fm = select_font (me->get_layout (), ac);
-    }
-  else
-    fm = Font_interface::get_default_font (me);
+       Stencil mol;
+       for (SCM s = me->get_property ("accidentals");
+            scm_is_pair (s); s = scm_cdr (s))
+         {
+           int alteration = scm_to_int (scm_car (s));
+           String font_char = get_fontcharname (style, alteration);
+           Stencil acc (fm->find_by_name ("accidentals." + font_char));
 
-  Stencil mol;
-  for (SCM s = me->get_property ("accidentals");
-       scm_is_pair (s); s = scm_cdr (s))
-    {
-      int alteration = scm_to_int (scm_car (s));
-      String font_char = get_fontcharname (style, alteration);
-      Stencil acc (fm->find_by_name ("accidentals." + font_char));
-
-      if (acc.is_empty ())
-       {
-         me->warning (_f ("accidental `%s' not found", font_char));
-       }
-      else
-       {
-         mol.add_at_edge (X_AXIS,  RIGHT, acc, 0.1, 0);
-       }
-    }
+           if (acc.is_empty ())
+             {
+               me->warning (_f ("accidental `%s' not found", font_char));
+             }
+           else
+             {
+               mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1, 0);
+             }
+         }
 
-  if (parens)
-    mol = parenthesize (me, mol); 
+       if (parens)
+         mol = parenthesize (me, mol);
 
-  return mol.smobbed_copy ();
-}
+       return mol.smobbed_copy ();
+      }
 
+      /*
+       TODO: should move inside-slur into item?
 
-/*
-  TODO: should move inside-slur into item?
-  
- */
-ADD_INTERFACE (Accidental_interface, "accidental-interface",
-             "a single accidental",
-              "inside-slur cautionary cautionary-style style tie accidentals");
+      */
+      ADD_INTERFACE (Accidental_interface, "accidental-interface",
+                    "a single accidental",
+                    "inside-slur cautionary cautionary-style style tie accidentals");
index 0bc5aac07d4879eafac1feb10ef66683bc1b5e3e..8a1b6a8570dd113a35acf578ca6b264d7406080e 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   afm.cc -- implement Adobe_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "afm.hh"
 
@@ -20,16 +19,16 @@ Adobe_font_metric::Adobe_font_metric (AFM_Font_info *fi)
   checksum_ = 0;
   font_info_ = fi;
   design_size_ = 1.0;
-  
+
   for (int i = 256 >? fi->numOfChars; i--;)
     ascii_to_metric_idx_.push (-1);
-  
+
   for (int i = 0; i < fi->numOfChars; i++)
     {
-      AFM_CharMetricInfo * c = fi->cmi + i;
+      AFM_CharMetricInfo *c = fi->cmi + i;
 
       /* Some TeX afm files contain code = -1.  We don't know why,
-       let's ignore it.  */
+        let's ignore it.  */
       if (c->code >= 0)
        ascii_to_metric_idx_[c->code] = i;
       name_to_metric_dict_[c->name] = i;
@@ -48,11 +47,11 @@ Adobe_font_metric::make_afm (AFM_Font_info *fi,
 {
   Adobe_font_metric *fm = new Adobe_font_metric (fi);
   fm->checksum_ = checksum;
-  fm->design_size_ = design_size; 
-  return fm->self_scm ();    
+  fm->design_size_ = design_size;
+  return fm->self_scm ();
 }
 
-AFM_CharMetricInfo const*
+AFM_CharMetricInfo const *
 Adobe_font_metric::find_ascii_metric (int a) const
 {
   if (ascii_to_metric_idx_[a] >= 0)
@@ -64,7 +63,7 @@ Adobe_font_metric::find_ascii_metric (int a) const
   return 0;
 }
 
-AFM_CharMetricInfo const*
+AFM_CharMetricInfo const *
 Adobe_font_metric::find_char_metric (String nm) const
 {
   int idx = name_to_index (nm);
@@ -76,10 +75,10 @@ Adobe_font_metric::find_char_metric (String nm) const
 int
 Adobe_font_metric::name_to_index (String name) const
 {
-  std::map<String, int>::const_iterator ai = name_to_metric_dict_.find (name);
+  std::map < String, int>::const_iterator ai = name_to_metric_dict_.find (name);
   if (ai == name_to_metric_dict_.end ())
     return -1;
-  return (*ai).second; 
+  return (*ai).second;
 }
 
 int
@@ -94,7 +93,7 @@ Adobe_font_metric::get_ascii_char (int code) const
   AFM_CharMetricInfo const *c = find_ascii_metric (code);
   Box b (Interval (0, 0), Interval (0, 0));
   if (c)
-    b = afm_bbox_to_box (c->charBBox);         
+    b = afm_bbox_to_box (c->charBBox);
   return b;
 }
 
@@ -116,14 +115,14 @@ Adobe_font_metric::get_indexed_char (int code) const
 SCM
 read_afm_file (String nm)
 {
-  FILE *f = fopen (nm.to_str0 () , "r");
+  FILE *f = fopen (nm.to_str0 (), "r");
   char s[2048] = "";
   char *check_key = "Comment TfmCheckSum";
   char *size_key = "Comment DesignSize";
 
   unsigned int cs = 0;
   Real ds = 1.0;
-  
+
   /* Assume check_key in first 10 lines */
   for (int i = 0; i < 10; i++)
     {
@@ -133,9 +132,9 @@ read_afm_file (String nm)
       else if (strncmp (s, size_key, strlen (size_key)) == 0)
        sscanf (s + strlen (size_key), "%lf", &ds);
     }
-  
+
   rewind (f);
-    
+
   AFM_Font_info *fi;
   int ok = AFM_parseFile (f, &fi, ~0);
 
@@ -175,11 +174,9 @@ Adobe_font_metric::get_indexed_wxwy (int k) const
 Real
 Adobe_font_metric::design_size () const
 {
-  return design_size_;    
+  return design_size_;
 }
 
-
-
 String
 Adobe_font_metric::font_name () const
 {
index 89c19910771b013470895d1bbf9f32129816881e..7ebe4f33cc64b6cf2db9a03f23414bc8e52a9c48 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   align-interface.cc -- implement Align_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "align-interface.hh"
 
@@ -17,9 +16,9 @@ MAKE_SCHEME_CALLBACK (Align_interface, alignment_callback, 2);
 SCM
 Align_interface::alignment_callback (SCM element_smob, SCM axis)
 {
-  Grob * me = unsmob_grob (element_smob);
+  Grob *me = unsmob_grob (element_smob);
   Axis ax = (Axis)scm_to_int (axis);
-  Grob * par = me->get_parent (ax);
+  Grob *par = me->get_parent (ax);
   if (par && !to_boolean (par->get_property ("positioning-done")))
     {
       Align_interface::align_elements_to_extents (par, ax);
@@ -31,9 +30,9 @@ MAKE_SCHEME_CALLBACK (Align_interface, fixed_distance_alignment_callback, 2);
 SCM
 Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
 {
-  Grob * me = unsmob_grob (element_smob);
+  Grob *me = unsmob_grob (element_smob);
   Axis ax = (Axis)scm_to_int (axis);
-  Grob * par = me->get_parent (ax);
+  Grob *par = me->get_parent (ax);
   if (par && !to_boolean (par->get_property ("positioning-done")))
     {
       Align_interface::align_to_fixed_distance (par, ax);
@@ -42,21 +41,21 @@ Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
 }
 
 /*
-  merge with align-to-extents? 
- */
+  merge with align-to-extents?
+*/
 void
-Align_interface::align_to_fixed_distance (Grob *me , Axis a)
+Align_interface::align_to_fixed_distance (Grob *me, Axis a)
 {
   me->set_property ("positioning-done", SCM_BOOL_T);
-  
-  SCM d =   me->get_property ("stacking-dir");
-  
+
+  SCM d = me->get_property ("stacking-dir");
+
   Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
 
   Real dy = robust_scm2double (me->get_property ("forced-distance"), 0.0);
-  
+
   Link_array<Grob> elems
     = extract_grob_array (me, ly_symbol2scm ("elements"));
 
@@ -65,8 +64,8 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
   Interval v;
   v.set_empty ();
   Array<Real> translates;
-  
-  for (int j = elems.size (); j--; ) 
+
+  for (int j = elems.size (); j--;)
     {
       /*
        This is not very elegant, in that we need special support for
@@ -74,9 +73,9 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
        force_hara_kiri_callback () (extent and offset callback) is
        such that we might get into a loop if we call extent () or
        offset () the elements.
-       
-        
-       */
+
+
+      */
       if (a == Y_AXIS
          && Hara_kiri_group_spanner::has_interface (elems[j]))
        Hara_kiri_group_spanner::consider_suicide (elems[j]);
@@ -94,7 +93,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
 
   /*
     TODO: support self-alignment-{Y, X}
-   */
+  */
   for (int i = 0; i < translates.size (); i++)
     {
       elems[i]->translate_axis (translates[i] - v.center (), a);
@@ -117,68 +116,66 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
   align_to_fixed_distance ().
 */
 void
-Align_interface::align_elements_to_extents (Grob * me, Axis a)
+Align_interface::align_elements_to_extents (Grob *me, Axis a)
 {
   me->set_property ("positioning-done", SCM_BOOL_T);
-  
-  SCM d =   me->get_property ("stacking-dir");
-  
+
+  SCM d = me->get_property ("stacking-dir");
+
   Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
-  
+
   Interval threshold = robust_scm2interval (me->get_property ("threshold"),
                                            Interval (0, Interval::infinity ()));
-  
+
   Array<Interval> dims;
 
   Link_array<Grob> elems;
   Link_array<Grob> all_grobs
     = extract_grob_array (me, ly_symbol2scm ("elements"));
-  for (int i = 0; i < all_grobs.size (); i++) 
+  for (int i = 0; i < all_grobs.size (); i++)
     {
       Interval y = all_grobs[i]->extent (me, a);
       if (!y.is_empty ())
        {
-         Grob *e = dynamic_cast<Grob*> (all_grobs[i]);
+         Grob *e = dynamic_cast<Grob *> (all_grobs[i]);
 
          elems.push (e);
-         dims.push (y);          
+         dims.push (y);
        }
     }
-  
+
   /*
     Read self-alignment-X and self-alignment-Y. This may seem like
     code duplication. (and really: it is), but this is necessary to
     prevent ugly cyclic dependencies that arise when you combine
     self-alignment on a child with alignment of children.
   */
static SCM  prop_syms[2];
 static SCM prop_syms[2];
 
   if (!prop_syms[0])
     {
       prop_syms[X_AXIS] = ly_symbol2scm ("self-alignment-X");
       prop_syms[Y_AXIS] = ly_symbol2scm ("self-alignment-Y");
     }
-  
+
   SCM align (me->internal_get_property (prop_syms[a]));
-  
-  Array<Real> translates ;
+
+  Array<Real> translates;
   Interval total;
   Real where_f = 0;
-  
-  for (int j = 0 ;  j < elems.size (); j++) 
+
+  for (int j = 0; j < elems.size (); j++)
     {
-      Real dy = -  dims[j][-stacking_dir];
+      Real dy = -dims[j][-stacking_dir];
       if (j)
-       dy += dims[j-1][stacking_dir];
-
+       dy += dims[j - 1][stacking_dir];
 
       /*
        we want dy to be > 0
-       */
-      dy *= stacking_dir; 
+      */
+      dy *= stacking_dir;
       if (j)
        {
          dy = (dy >? threshold[SMALLER])
@@ -186,14 +183,13 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
        }
 
       where_f += stacking_dir * dy;
-      total.unite (dims[j] +   where_f);
+      total.unite (dims[j] + where_f);
       translates.push (where_f);
     }
 
-  
   Real center_offset = 0.0;
   /*
-    also move the grobs that were empty, to maintain spatial order. 
+    also move the grobs that were empty, to maintain spatial order.
   */
   Array<Real> all_translates;
   if (translates.size ())
@@ -201,7 +197,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
       int i = 0;
       int j = 0;
       Real w = translates[0];
-      while (j  < all_grobs.size ())
+      while (j < all_grobs.size ())
        {
          if (i < elems.size () && all_grobs[j] == elems[i])
            {
@@ -211,45 +207,43 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
          j++;
        }
 
-
       /*
        FIXME: uncommenting freaks out the Y-alignment of
        line-of-score.
-       */
+      */
       if (scm_is_number (align))
        center_offset = total.linear_combination (scm_to_double (align));
 
-      for (int j = 0 ;  j < all_grobs.size (); j++)
+      for (int j = 0; j < all_grobs.size (); j++)
        all_grobs[j]->translate_axis (all_translates[j] - center_offset, a);
     }
 }
 Axis
-Align_interface::axis (Grob*me)
+Align_interface::axis (Grob *me)
 {
-  return  Axis (scm_to_int (scm_car (me->get_property ("axes"))));
+  return Axis (scm_to_int (scm_car (me->get_property ("axes"))));
 }
 
 void
-Align_interface::add_element (Grob*me, Grob* s, SCM cb)
+Align_interface::add_element (Grob *me, Grob *s, SCM cb)
 {
   s->add_offset_callback (cb, Align_interface::axis (me));
   Axis_group_interface::add_element (me, s);
 }
 
 void
-Align_interface::set_axis (Grob*me, Axis a)
+Align_interface::set_axis (Grob *me, Axis a)
 {
   Axis_group_interface::set_axes (me, a, a);
 }
 
-
 /*
   Find Y-axis parent of G that has a #'forced-distance property. This
   has the effect of finding the piano-staff given an object in that
   piano staff.
- */
+*/
 Grob *
-find_fixed_alignment_parent  (Grob *g)
+find_fixed_alignment_parent (Grob *g)
 {
   while (g)
     {
@@ -263,18 +257,14 @@ find_fixed_alignment_parent  (Grob *g)
 }
 
 
-
-
 ADD_INTERFACE (Align_interface, "align-interface",
               "Order grobs from top to bottom, left to right, right to left or bottom"
-              "to top."
-              ,
+              "to top.",
               "forced-distance stacking-dir align-dir threshold positioning-done "
               "center-element elements axes");
 
-
 struct Foobar
 {
-  bool has_interface (Grob*);
+  bool has_interface (Grob *);
 };
 
index 423243ac684100ebb31eaa721fe00fc522f56f46..6eb62bf103b7a5294aaf56ed910db33f662bbff8 100644 (file)
@@ -1,8 +1,8 @@
 /*
   all-font-metrics.cc -- implement All_font_metrics
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
@@ -25,19 +25,19 @@ All_font_metrics::All_font_metrics (String path)
   otf_dict_ = new Scheme_hash_table;
 
 #if HAVE_PANGO_FT2
-  PangoFontMap*pfm = pango_ft2_font_map_new ();
+  PangoFontMap *pfm = pango_ft2_font_map_new ();
 
-  pango_ft2_fontmap_ =
-    G_TYPE_CHECK_INSTANCE_CAST(pfm,
-                              PANGO_TYPE_FT2_FONT_MAP,
-                              PangoFT2FontMap);
+  pango_ft2_fontmap_
+    = G_TYPE_CHECK_INSTANCE_CAST (pfm,
+                                 PANGO_TYPE_FT2_FONT_MAP,
+                                 PangoFT2FontMap);
   pango_dpi_ = 1200;
   pango_ft2_font_map_set_resolution (pango_ft2_fontmap_,
                                     pango_dpi_, pango_dpi_);
 
   pango_dict_ = new Scheme_hash_table;
 #endif
-  
+
   search_path_.parse_path (path);
 }
 
@@ -53,21 +53,21 @@ All_font_metrics::~All_font_metrics ()
 #endif
 }
 
-All_font_metrics::All_font_metrics (All_font_metrics const&)
+All_font_metrics::All_font_metrics (All_font_metrics const &)
 {
 }
 
 #if HAVE_PANGO_FT2
 
 Pango_font *
-All_font_metrics::find_pango_font (PangoFontDescription*description,
+All_font_metrics::find_pango_font (PangoFontDescription *description,
                                   Real magnification,
                                   Real output_scale)
 {
   pango_font_description_set_size (description,
                                   gint (magnification *
                                         pango_font_description_get_size (description)));
-  
+
   gchar *fn = pango_font_description_to_filename (description);
   SCM key = ly_symbol2scm (fn);
 
@@ -90,8 +90,8 @@ All_font_metrics::find_pango_font (PangoFontDescription*description,
       pf->description_ = scm_cons (SCM_BOOL_F,
                                   scm_make_real (1.0));
     }
-  g_free (fn); 
-  return dynamic_cast<Pango_font*> (unsmob_metrics (val));
+  g_free (fn);
+  return dynamic_cast<Pango_font *> (unsmob_metrics (val));
 }
 
 #endif
@@ -99,15 +99,15 @@ All_font_metrics::find_pango_font (PangoFontDescription*description,
 String
 kpathsea_find_file (String name, String ext)
 {
-  name += "." +  ext;
+  name += "." + ext;
   String path = global_path.find (name);
-  if (path.length() > 0)
+  if (path.length () > 0)
     return path;
 
   SCM kpath = ly_lily_module_constant ("ly:kpathsea-find-file");
   if (ly_c_procedure_p (kpath))
     {
-      SCM kp_result = scm_call_1 (kpath, scm_makfrom0str (name.to_str0()));
+      SCM kp_result = scm_call_1 (kpath, scm_makfrom0str (name.to_str0 ()));
       if (scm_is_string (kp_result))
        return ly_scm2string (kp_result);
     }
@@ -121,7 +121,7 @@ kpathsea_find_file (String name, String ext)
   should include design size when generating an AFM metric.
 
   ugr: copied from find_tfm.
- */
+*/
 Adobe_font_metric *
 All_font_metrics::find_afm (String name)
 {
@@ -133,7 +133,7 @@ All_font_metrics::find_afm (String name)
       String file_name;
 
       if (file_name.is_empty ())
-       file_name = search_path_.find (name  + ".afm");
+       file_name = search_path_.find (name + ".afm");
 
       if (file_name.is_empty ())
        {
@@ -144,13 +144,13 @@ All_font_metrics::find_afm (String name)
 
       if (file_name.is_empty ())
        return 0;
-      
+
       if (be_verbose_global)
        progress_indication ("[" + file_name);
       val = read_afm_file (file_name);
       unsmob_metrics (val)->file_name_ = file_name;
-      
-      unsmob_metrics (val)->description_ = scm_cons (name_string, 
+
+      unsmob_metrics (val)->description_ = scm_cons (name_string,
                                                     scm_make_real (1.0));
 
       if (be_verbose_global)
@@ -160,14 +160,14 @@ All_font_metrics::find_afm (String name)
       scm_gc_unprotect_object (val);
 
       Adobe_font_metric *afm
-       = dynamic_cast<Adobe_font_metric*> (unsmob_metrics (val));
+       = dynamic_cast<Adobe_font_metric *> (unsmob_metrics (val));
 
       /* Only check checksums if there is one.  We take the risk that
         some file has valid checksum 0 */
       if (afm->checksum_)
        {
-         Tex_font_metric * tfm = find_tfm (name);
-         
+         Tex_font_metric *tfm = find_tfm (name);
+
          /* FIXME: better warning message
             (maybe check upon startup for feta16.afm, feta16.tfm?) */
          if (tfm && tfm->info ().checksum != afm->checksum_)
@@ -185,18 +185,18 @@ All_font_metrics::find_afm (String name)
              s += "\n";
              s += _ ("Rerun with -V to show font paths.");
              s += "\n";
-             s += _("A script for removing font-files is delivered with the source-code:");
+             s += _ ("A script for removing font-files is delivered with the source-code:");
              s += "\n";
              s += "buildscripts/clean-fonts.sh";
              error (s);
            }
        }
     }
-  
-  return dynamic_cast<Adobe_font_metric*> (unsmob_metrics (val));
+
+  return dynamic_cast<Adobe_font_metric *> (unsmob_metrics (val));
 }
 
-Open_type_font*
+Open_type_font *
 All_font_metrics::find_otf (String name)
 {
   SCM sname = ly_symbol2scm (name.to_str0 ());
@@ -205,15 +205,15 @@ All_font_metrics::find_otf (String name)
   if (!otf_dict_->try_retrieve (sname, &val))
     {
       String file_name;
-      
+
       if (file_name.is_empty ())
-       file_name = search_path_.find (name  + ".otf");
+       file_name = search_path_.find (name + ".otf");
       if (file_name.is_empty ())
        return 0;
 
       if (be_verbose_global)
        progress_indication ("[" + file_name);
-      
+
       val = Open_type_font::make_otf (file_name);
 
       if (be_verbose_global)
@@ -226,10 +226,10 @@ All_font_metrics::find_otf (String name)
       scm_gc_unprotect_object (val);
     }
 
-  return dynamic_cast<Open_type_font*> (unsmob_metrics (val));
+  return dynamic_cast<Open_type_font *> (unsmob_metrics (val));
 }
 
-Tex_font_metric*
+Tex_font_metric *
 All_font_metrics::find_tfm (String name)
 {
   SCM sname = ly_symbol2scm (name.to_str0 ());
@@ -238,7 +238,7 @@ All_font_metrics::find_tfm (String name)
   if (!tfm_dict_->try_retrieve (sname, &val))
     {
       String file_name;
-      
+
       if (file_name.is_empty ())
        {
          /* FIXME: should add "cork-" prefix to lm* fonts.  How to do
@@ -249,13 +249,13 @@ All_font_metrics::find_tfm (String name)
        }
 
       if (file_name.is_empty ())
-       file_name = search_path_.find (name  + ".tfm");
+       file_name = search_path_.find (name + ".tfm");
       if (file_name.is_empty ())
        return 0;
 
       if (be_verbose_global)
        progress_indication ("[" + file_name);
-      
+
       val = Tex_font_metric::make_tfm (file_name);
 
       if (be_verbose_global)
@@ -268,18 +268,18 @@ All_font_metrics::find_tfm (String name)
       scm_gc_unprotect_object (val);
     }
 
-  return dynamic_cast<Tex_font_metric*> (unsmob_metrics (val));
+  return dynamic_cast<Tex_font_metric *> (unsmob_metrics (val));
 }
 
-Font_metric*
+Font_metric *
 All_font_metrics::find_font (String name)
 {
   Font_metric *f = find_otf (name);
-   
-  if (!f &&
-      (name.left_string (4) == "feta"
-       || name.left_string (8) == "parmesan"
-       || name.left_string (2) == "lm"))
+
+  if (!f
+      && (name.left_string (4) == "feta"
+         || name.left_string (8) == "parmesan"
+         || name.left_string (2) == "lm"))
     {
       f = find_afm (name);
       if (!f)
@@ -297,7 +297,7 @@ All_font_metrics::find_font (String name)
       warning (_f ("can't find font: `%s'", name.to_str0 ()));
       warning (_ ("Loading default font"));
     }
-  
+
   String def_name = default_font_str0_;
 
   /* We're in emergency recovery mode here anyway, so don't try to do
@@ -320,7 +320,6 @@ All_font_metrics::find_font (String name)
 
 All_font_metrics *all_fonts_global;
 
-
 LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0,
           (SCM name),
           "Load the font @var{name}. ")
index 20193234a62b5f4f48acb6190f6f04d3793a5bb7..bca05e31204a3ca5ab73e56870426eb0b06d0ffc 100644 (file)
@@ -4,9 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
-  
+
   Han-Wen Nienhuys <hanwen@xs4all.nl
-  
 */
 
 #include "engraver.hh"
@@ -20,7 +19,7 @@
 class Ambitus_engraver : public Engraver
 {
 public:
-TRANSLATOR_DECLARATIONS (Ambitus_engraver);
+  TRANSLATOR_DECLARATIONS (Ambitus_engraver);
   virtual void process_music ();
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
@@ -64,10 +63,9 @@ Ambitus_engraver::create_ambitus ()
   while (flip (&d) != DOWN);
   ambitus_->set_parent (heads_[DOWN], X_AXIS);
   Axis_group_interface::add_element (group_, ambitus_);
-  
-  is_typeset_ = false;         
-}
 
+  is_typeset_ = false;
+}
 
 Ambitus_engraver::Ambitus_engraver ()
 {
@@ -108,7 +106,6 @@ Ambitus_engraver::stop_translation_timestep ()
       start_c0_ = robust_scm2int (get_property ("middleCPosition"), 0);
       start_key_sig_ = get_property ("keySignature");
 
-
       is_typeset_ = true;
     }
 }
@@ -116,7 +113,7 @@ Ambitus_engraver::stop_translation_timestep ()
 void
 Ambitus_engraver::acknowledge_grob (Grob_info info)
 {
-  Item *item = dynamic_cast <Item *>(info.grob_);
+  Item *item = dynamic_cast<Item *> (info.grob_);
   if (item)
     {
       if (Note_head::has_interface (info.grob_))
@@ -141,8 +138,8 @@ Ambitus_engraver::finalize ()
        {
          Pitch p = pitch_interval_[d];
          heads_[d]->set_property ("staff-position",
-                                  scm_from_int (start_c0_ +
-                                                p.steps ()));
+                                  scm_from_int (start_c0_
+                                                p.steps ()));
 
          SCM handle = scm_assoc (scm_cons (scm_from_int (p.get_octave ()),
                                            scm_from_int (p.get_notename ())),
@@ -151,11 +148,11 @@ Ambitus_engraver::finalize ()
          if (handle == SCM_BOOL_F)
            handle = scm_assoc (scm_from_int (p.get_notename ()),
                                start_key_sig_);
-         
+
          int sig_alter = (handle != SCM_BOOL_F) ? scm_to_int (scm_cdr (handle)) : 0;
          if (sig_alter == p.get_alteration ())
            {
-             accidentals_[d]->suicide();
+             accidentals_[d]->suicide ();
              heads_[d]->set_property ("accidental-grob", SCM_EOL);
            }
          else
@@ -174,18 +171,18 @@ Ambitus_engraver::finalize ()
       Direction d = DOWN;
       do
        {
-         accidentals_[d]->suicide();
-         heads_[d]->suicide();
-       }
+         accidentals_[d]->suicide ();
+         heads_[d]->suicide ();
+       }
       while (flip (&d) != DOWN);
-      ambitus_->suicide();
+      ambitus_->suicide ();
     }
 }
 
 ADD_TRANSLATOR (Ambitus_engraver,
-/* descr */       "",
-/* creats*/       "Ambitus AmbitusLine AmbitusNoteHead AmbitusAccidental",
-/* accepts */ "",
-/* acks  */     "note-head-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "Ambitus AmbitusLine AmbitusNoteHead AmbitusAccidental",
+               /* accepts */ "",
+               /* acks  */ "note-head-interface",
+               /* reads */ "",
+               /* write */ "");
index 43c9f0a01b6b5cb6f53f9bcaadf92078a2cd5c37..420c016834858b1fc2fe8e2178146ae173baaf39 100644 (file)
@@ -21,22 +21,22 @@ MAKE_SCHEME_CALLBACK (Ambitus, print, 1);
 SCM
 Ambitus::print (SCM smob)
 {
-  Item *me = (Item*) unsmob_grob (smob);
+  Item *me = (Item *) unsmob_grob (smob);
   Stencil stencil;
 
   // join heads
   Link_array<Grob> heads (extract_grob_array (me, ly_symbol2scm ("note-heads")));
   if (to_boolean (me->get_property ("join-heads"))
-      && heads.size() > 1)
+      && heads.size () > 1)
     {
       Grob *common
        = common_refpoint_of_array (heads.slice (0, 2), me, Y_AXIS);
 
       Grob *minh = heads[0];
       Grob *maxh = heads[1];
-      
-      if (minh->relative_coordinate (common, Y_AXIS) >
-         maxh->relative_coordinate (common, Y_AXIS))
+
+      if (minh->relative_coordinate (common, Y_AXIS)
+         maxh->relative_coordinate (common, Y_AXIS))
        {
          Grob *t = maxh;
          maxh = minh;
@@ -46,11 +46,11 @@ Ambitus::print (SCM smob)
       Real pad = 0.35;
       Real pmax = maxh->extent (common, Y_AXIS)[DOWN] - pad;
       Real pmin = minh->extent (common, Y_AXIS)[UP] + pad;
-      
+
       if (pmin < pmax)
        {
          Real linethickness = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"))
-           * robust_scm2double (me->get_property ("thickness"), 1.0); 
+           * robust_scm2double (me->get_property ("thickness"), 1.0);
          Real blotdiameter = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
          Interval x_extent = 0.5 * linethickness *Interval (-1, 1);
          Interval y_extent = Interval (pmin, pmax);
@@ -58,7 +58,7 @@ Ambitus::print (SCM smob)
 
          Stencil line = Lookup::round_filled_box (line_box, blotdiameter);
          line.translate_axis (- me-> relative_coordinate (common, Y_AXIS),
-                                  Y_AXIS);
+                              Y_AXIS);
          return line.smobbed_copy ();
        }
     }
@@ -67,5 +67,5 @@ Ambitus::print (SCM smob)
 }
 
 ADD_INTERFACE (Ambitus, "ambitus-interface",
-  "The line between note heads for a pitch range.",
-  "thickness note-heads join-heads");
+              "The line between note heads for a pitch range.",
+              "thickness note-heads join-heads");
index ddb00b9df1edefab2d811847efdb18d97b66bdc6..6f69bbc7b8e8843177122d3c51183d5db6897b70 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   apply-context-iterator.cc -- implement Apply_context_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "simple-music-iterator.hh"
@@ -13,8 +12,8 @@
 #include "input.hh"
 
 /**
-  Iterate a property.  
- */
+   Iterate a property.
+*/
 class Apply_context_iterator : public Simple_music_iterator
 {
 public:
@@ -23,7 +22,6 @@ protected:
   virtual void process (Moment);
 };
 
-
 void
 Apply_context_iterator::process (Moment m)
 {
@@ -32,10 +30,10 @@ Apply_context_iterator::process (Moment m)
   if (ly_c_procedure_p (proc))
     scm_call_1 (proc, get_outlet ()->self_scm ());
   else
-    get_music ()->origin ()->warning (_("\\applycontext argument is not a procedure"));
-  
+    get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure"));
+
   Simple_music_iterator::process (m);
 }
 
 IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator);
-  
+
index d6667e098d83f098cce82130faedf36ca3b177d1..08682dd674cace34696059191bd66f56422a64a8 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   arpeggio-engraver.cc -- implement Arpeggio_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "engraver.hh"
 #include "group-interface.hh"
@@ -18,14 +18,14 @@ class Arpeggio_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Arpeggio_engraver);
-  
+
 protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void process_music ();
   virtual void stop_translation_timestep ();
   virtual bool try_music (Music *);
 private:
-  Item *arpeggio_; 
+  Item *arpeggio_;
   Music *arpeggio_req_;
 };
 
@@ -52,14 +52,14 @@ Arpeggio_engraver::acknowledge_grob (Grob_info info)
     {
       if (Stem::has_interface (info.grob_))
        {
-         if (!arpeggio_->get_parent  (Y_AXIS))
+         if (!arpeggio_->get_parent (Y_AXIS))
            arpeggio_->set_parent (info.grob_, Y_AXIS);
-      
+
          Pointer_group_interface::add_grob (arpeggio_,
                                             ly_symbol2scm ("stems"),
                                             info.grob_);
        }
-      
+
       /*
        We can't catch local key items (accidentals) from Voice context,
        see Local_key_engraver
@@ -68,7 +68,7 @@ Arpeggio_engraver::acknowledge_grob (Grob_info info)
        {
          Side_position_interface::add_support (arpeggio_, info.grob_);
        }
-      else if (Note_column::has_interface (info.grob_ ))
+      else if (Note_column::has_interface (info.grob_))
        {
          info.grob_->set_property ("arpeggio", arpeggio_->self_scm ());
        }
@@ -92,9 +92,9 @@ Arpeggio_engraver::stop_translation_timestep ()
 }
 
 ADD_TRANSLATOR (Arpeggio_engraver,
-/* descr */       "Generate an Arpeggio from a Arpeggio_req",
-/* creats*/       "Arpeggio",
-/* accepts */     "arpeggio-event",
-/* acks  */       "stem-interface rhythmic-head-interface note-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Generate an Arpeggio from a Arpeggio_req",
+               /* creats*/ "Arpeggio",
+               /* accepts */ "arpeggio-event",
+               /* acks  */ "stem-interface rhythmic-head-interface note-column-interface",
+               /* reads */ "",
+               /* write */ "");
index 3ecd5716752abb508c70b5e4e860d2954fdf9f0f..0d432a41898227461ead843371b94df7d5019f7d 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   arpeggio.cc -- implement Arpeggio
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "arpeggio.hh"
 
 #include "font-interface.hh"
 #include "lookup.hh"
 
-
 MAKE_SCHEME_CALLBACK (Arpeggio, print, 1);
-SCM 
-Arpeggio::print (SCM smob) 
+SCM
+Arpeggio::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  
-  Grob * common = me;
+
+  Grob *common = me;
   for (SCM s = me->get_property ("stems"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * stem =  unsmob_grob (scm_car (s));
-      common =  common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
-                                Y_AXIS);
+      Grob *stem = unsmob_grob (scm_car (s));
+      common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
+                                       Y_AXIS);
     }
 
   /*
     TODO:
-    
+
     Using stems here is not very convenient; should store noteheads
     instead, and also put them into the support. Now we will mess up
     in vicinity of a collision.
@@ -41,14 +40,14 @@ Arpeggio::print (SCM smob)
   */
   Interval heads;
   Real my_y = me->relative_coordinate (common, Y_AXIS);
-      
+
   for (SCM s = me->get_property ("stems"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * stem = unsmob_grob (scm_car (s));
-      Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
+      Grob *stem = unsmob_grob (scm_car (s));
+      Grob *ss = Staff_symbol_referencer::get_staff_symbol (stem);
       Interval iv = Stem::head_positions (stem);
-      iv *= Staff_symbol::staff_space (ss)/2.0;
-      
+      iv *= Staff_symbol::staff_space (ss) / 2.0;
+
       heads.unite (iv + ss->relative_coordinate (common, Y_AXIS)
                   - my_y);
     }
@@ -59,7 +58,7 @@ Arpeggio::print (SCM smob)
        Dumb blonde error
 
        :-)
-       */
+      */
       programming_error ("Huh, no heads for arpeggio found.");
       return SCM_EOL;
     }
@@ -70,69 +69,68 @@ Arpeggio::print (SCM smob)
     {
       dir = to_dir (ad);
     }
-  
+
   Stencil mol;
   Font_metric *fm = Font_interface::get_default_font (me);
   Stencil squiggle = fm->find_by_name ("scripts.arpeggio");
 
-  Stencil arrow ;  
+  Stencil arrow;
   if (dir)
     {
       arrow = fm->find_by_name ("scripts.arpeggio.arrow." + to_string (dir));
       heads[dir] -= dir * arrow.extent (Y_AXIS).length ();
     }
-  
-  for (Real  y = heads[LEFT] ; y < heads[RIGHT];
+
+  for (Real y = heads[LEFT]; y < heads[RIGHT];
        y+= squiggle. extent (Y_AXIS).length ())
-      mol.add_at_edge (Y_AXIS, UP, squiggle, 0.0, 0);
+    mol.add_at_edge (Y_AXIS, UP, squiggle, 0.0, 0);
 
   mol.translate_axis (heads[LEFT], Y_AXIS);
   if (dir)
     mol.add_at_edge (Y_AXIS, dir, arrow, 0, 0);
-  
-  return mol.smobbed_copy () ;
+
+  return mol.smobbed_copy ();
 }
 
-/* Draws a vertical bracket to the left of a chord 
+/* Draws a vertical bracket to the left of a chord
    Chris Jackson <chris@fluffhouse.org.uk> */
 
 MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_bracket, 1);
-SCM 
-Arpeggio::brew_chord_bracket (SCM smob) 
+SCM
+Arpeggio::brew_chord_bracket (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  
-  Grob * common = me;
+
+  Grob *common = me;
   for (SCM s = me->get_property ("stems"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * stem =  unsmob_grob (scm_car (s));
-      common =  common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
-                                Y_AXIS);
+      Grob *stem = unsmob_grob (scm_car (s));
+      common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
+                                       Y_AXIS);
     }
 
   Interval heads;
   Real my_y = me->relative_coordinate (common, Y_AXIS);
-      
+
   for (SCM s = me->get_property ("stems"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * stem = unsmob_grob (scm_car (s));
-      Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
+      Grob *stem = unsmob_grob (scm_car (s));
+      Grob *ss = Staff_symbol_referencer::get_staff_symbol (stem);
       Interval iv = Stem::head_positions (stem);
-      iv *= Staff_symbol::staff_space (ss)/2.0;      
-      heads.unite (iv  +  ss->relative_coordinate (common, Y_AXIS)  -  my_y);
+      iv *= Staff_symbol::staff_space (ss) / 2.0;
+      heads.unite (iv + ss->relative_coordinate (common, Y_AXIS) - my_y);
     }
 
-  Real lt =  me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+  Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
   Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
   Real dy = heads.length () + sp;
   Real x = 0.7;
 
   Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt));
-  mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS);
+  mol.translate_axis (heads[LEFT] - sp / 2.0, Y_AXIS);
   return mol.smobbed_copy ();
 }
 
-
 /*
   We have to do a callback, because print () triggers a
   vertical alignment if it is cross-staff.
@@ -141,7 +139,7 @@ MAKE_SCHEME_CALLBACK (Arpeggio, width_callback, 2);
 SCM
 Arpeggio::width_callback (SCM smob, SCM axis)
 {
-  Grob * me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
   Axis a = (Axis)scm_to_int (axis);
   assert (a == X_AXIS);
   Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts.arpeggio");
@@ -149,8 +147,7 @@ Arpeggio::width_callback (SCM smob, SCM axis)
   return ly_interval2scm (arpeggio.extent (X_AXIS));
 }
 
-
 ADD_INTERFACE (Arpeggio, "arpeggio-interface",
-  "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.",
-  "stems arpeggio-direction");
+              "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.",
+              "stems arpeggio-direction");
 
index 197f2e649e379ffa5f4aaa421ccb0b1a9447abbd..a37704ea835cc0a6ad9631c18387f63d952afdec 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "audio-column.hh"
 
@@ -17,10 +17,10 @@ Audio_column::Audio_column (Moment at_mom)
 }
 
 void
-Audio_column::add_audio_item (Audio_iteml)
+Audio_column::add_audio_item (Audio_item *l)
 {
   audio_items_.push (l);
-  l->audio_column_ = this; 
+  l->audio_column_ = this;
 }
 
 Moment
@@ -29,4 +29,3 @@ Audio_column::at_mom () const
   return at_mom_;
 }
 
-
index e3cd21d538aad915353300dcfa8d9f9106cb7ea2..22bde52662f98d1de2e979e581fcbc5f74a268bf 100644 (file)
 #include "translator-group.hh"
 #include "context.hh"
 
-Audio_element_info::Audio_element_info (Audio_element*s, Music *r)
+Audio_element_info::Audio_element_info (Audio_element *s, Music *r)
 {
   elem_ = s;
   origin_trans_ = 0;
   event_ = r;
 }
 
-
 Audio_element_info::Audio_element_info ()
 {
   elem_ = 0;
@@ -26,16 +25,17 @@ Audio_element_info::Audio_element_info ()
   origin_trans_ = 0;
 }
 
-
 Link_array<Context>
-Audio_element_info::origin_contexts (Translatorend) const
+Audio_element_info::origin_contexts (Translator *end) const
 {
-  Context * t = origin_trans_->context ();
+  Context *t = origin_trans_->context ();
   Link_array<Context> r;
-  do {
-    r.push (t);
-    t = t->get_parent_context ();
-  } while (t && t != end->context ());
-  
+  do
+    {
+      r.push (t);
+      t = t->get_parent_context ();
+    }
+  while (t && t != end->context ());
+
   return r;
 }
index 84d56be3fbd85ecd28d35094fa633120dbfd465b..c0dfcc22f106bb73b7e18b4dd2598bf13fa9f002 100644 (file)
@@ -16,7 +16,7 @@ Audio_element::~Audio_element ()
 {
 }
 
-char const * 
+char const *
 Audio_element::name () const
 {
   return classname (this);
index 21d867a4a9c5737f98857b297393d378a4f5bedb..3774f732e9fa964e8cf9b3738bcd33b1f5b21cf6 100644 (file)
@@ -30,17 +30,16 @@ Audio_note::Audio_note (Pitch p, Moment m, int transposing_i)
 }
 
 void
-Audio_note::tie_to (Audio_notet)
+Audio_note::tie_to (Audio_note *t)
 {
   tied_ = t;
-  Audio_notefirst = t;
+  Audio_note *first = t;
   while (first->tied_)
     first = first->tied_;
   first->length_mom_ += length_mom_;
   length_mom_ = 0;
 }
 
-                   
 Audio_key::Audio_key (int acc, bool major)
 {
   accidentals_ = acc;
index 7c3c944a289d11db6cd8ef406c6bc72308eff1e9..b7508b8c2559374a849dd5b27a7c25726ada7145 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "audio-staff.hh"
 
 #include "midi-walker.hh"
 
 void
-Audio_staff::add_audio_item (Audio_iteml)
+Audio_staff::add_audio_item (Audio_item *l)
 {
   audio_items_.push (l);
 }
 
-
 void
-Audio_staff::output (Midi_streammidi_stream_r, int track_i)
+Audio_staff::output (Midi_stream &midi_stream_r, int track_i)
 {
   Midi_track midi_track;
   midi_track.number_ = track_i;
@@ -30,4 +29,3 @@ Audio_staff::output (Midi_stream& midi_stream_r, int track_i)
   midi_stream_r << midi_track;
 }
 
-
index 94e49d549d961fa43ea6a858bd2c68a33953f1a3..9164df8a74cf3a1b5e0fafd56c22c493e13b82c0 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   auto-beam-engraver.cc -- implement Auto_beam_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "beaming.hh"
@@ -26,7 +25,7 @@ protected:
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
   virtual void process_music ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
   virtual void process_acknowledged_grobs ();
@@ -35,39 +34,38 @@ private:
   bool test_moment (Direction, Moment);
   void consider_begin (Moment);
   void consider_end (Moment);
-  Spannercreate_beam ();
+  Spanner *create_beam ();
   void begin_beam ();
   void end_beam ();
   void junk_beam ();
-  bool is_same_grace_state (Grobe);
+  bool is_same_grace_state (Grob *e);
   void typeset_beam ();
 
   Music *forbid_;
   /*
     shortest_mom is the shortest note in the beam.
-   */
+  */
   Moment shortest_mom_;
   Spanner *finished_beam_;
   Link_array<Item>* stems_;
 
-
   int count_;
   Moment last_add_mom_;
   /*
     Projected ending of the  beam we're working on.
-   */
+  */
   Moment extend_mom_;
   Moment beam_start_moment_;
   Moment beam_start_location_;
 
   bool subdivide_beams_;
   Moment beat_length_;
-  
+
   // We act as if beam were created, and start a grouping anyway.
-  Beaming_info_list*grouping_;
-  SCM beam_settings_ ;         // ugh. should protect ? 
-  
-  Beaming_info_list*finished_grouping_;
+  Beaming_info_list *grouping_;
+  SCM beam_settings_         // ugh. should protect ? 
+
+  Beaming_info_list *finished_grouping_;
 };
 
 void
@@ -86,7 +84,6 @@ Auto_beam_engraver::process_music ()
     }
 }
 
-
 Auto_beam_engraver::Auto_beam_engraver ()
 {
   forbid_ = 0;
@@ -96,14 +93,13 @@ Auto_beam_engraver::Auto_beam_engraver ()
   finished_beam_ = 0;
   finished_grouping_ = 0;
   grouping_ = 0;
-  beam_settings_ = SCM_EOL;  
+  beam_settings_ = SCM_EOL;
 }
 
-
 bool
-Auto_beam_engraver::try_music (Music*m)
+Auto_beam_engraver::try_music (Music *m)
 {
-  if (m->is_mus_type  ("beam-forbid-event"))
+  if (m->is_mus_type ("beam-forbid-event"))
     {
       forbid_ = m;
       return true;
@@ -115,26 +111,25 @@ Auto_beam_engraver::try_music (Music*m)
 /*
   Determine end moment for auto beaming (or begin moment, but mostly
   0== anywhere) In order of increasing priority:
-  
+
   i.   begin anywhere, end at every beat
   ii.  end   *    <num> <den>
   iii. end <type> <num> <den>
-  
+
   iv.  end   *      *     *
   v.   end <type>   *     *
-  
-  
+
+
   Rationale:
-  
+
   [to be defined in config file]
   i.   easy catch-all rule
   ii.  exceptions for time signature
   iii. exceptions for time signature, for specific duration type
-  
+
   [user override]
   iv.  generic override
   v.   override for specific duration type
-  
 */
 bool
 Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
@@ -145,44 +140,44 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
     {
       return false;
     }
-  
+
   SCM wild = scm_list_n (ly_symbol2scm ("*"), ly_symbol2scm ("*"), SCM_UNDEFINED);
   SCM function;
   if (dir == START)
     function = scm_list_n (ly_symbol2scm ("begin"), SCM_UNDEFINED);
   else
     function = scm_list_n (ly_symbol2scm ("end"), SCM_UNDEFINED);
-  
+
   Moment beat_length (1, 4);
-  if (Moment * m = unsmob_moment (get_property ("beatLength")))
+  if (Moment *m = unsmob_moment (get_property ("beatLength")))
     {
       beat_length = *m;
     }
   Moment measure_length (1, 1);
   int num = 4;
-  if (Momentm = unsmob_moment (get_property ("measureLength")))
+  if (Moment *m = unsmob_moment (get_property ("measureLength")))
     {
       num = int ((*m / beat_length).main_part_);
     }
-  
+
   int den = beat_length.den ();
   SCM time = scm_list_n (scm_int2num (num), scm_int2num (den), SCM_UNDEFINED);
 
   SCM type = scm_list_n (scm_int2num (test_mom.num ()),
-                     scm_int2num (test_mom.den ()), SCM_UNDEFINED);
+                        scm_int2num (test_mom.den ()), SCM_UNDEFINED);
 
   /*
     UGH UGH.
     settings aren't grob-properties.
-   */
+  */
   SCM settings = get_property ("autoBeamSettings");
-  
+
   /* first guess */
-  
+
   /* begin beam at any position
- (and fallback for end) */
    (and fallback for end) */
   Moment moment (0);
-  
+
   /* end beam at end of beat */
   if (dir == STOP)
     {
@@ -191,43 +186,43 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
 
   /* second guess: property generic time exception */
   SCM m = scm_assoc (ly_append3 (function, wild, time), settings);
-  
+
   if (m != SCM_BOOL_F && unsmob_moment (scm_cdr (m)))
-    moment = * unsmob_moment (scm_cdr (m));
+    moment = *unsmob_moment (scm_cdr (m));
 
   /* third guess: property time exception, specific for duration type */
   m = scm_assoc (ly_append3 (function, type, time), settings);
   if (m != SCM_BOOL_F && unsmob_moment (scm_cdr (m)))
-    moment = * unsmob_moment (scm_cdr (m));
+    moment = *unsmob_moment (scm_cdr (m));
 
   /* fourth guess [user override]: property plain generic */
   m = scm_assoc (ly_append3 (function, wild, wild), settings);
   if (m != SCM_BOOL_F && unsmob_moment (scm_cdr (m)))
-    moment = * unsmob_moment (scm_cdr (m));
+    moment = *unsmob_moment (scm_cdr (m));
 
   /* fifth guess [user override]: property plain, specific for duration type */
   m = scm_assoc (ly_append3 (function, type, wild), settings);
   if (m != SCM_BOOL_F && unsmob_moment (scm_cdr (m)))
-    moment = * unsmob_moment (scm_cdr (m));
-  
+    moment = *unsmob_moment (scm_cdr (m));
+
   Rational r;
   if (moment.to_bool ())
     {
       /* Ugh? measurePosition can be negative, when \partial
         We may have to fix this elsewhere (timing translator)
-       r = unsmob_moment (get_property ("measurePosition"))->mod_rat (moment);
+        r = unsmob_moment (get_property ("measurePosition"))->mod_rat (moment);
       */
       Moment pos (0);
-      if (Moment  *m = unsmob_moment (get_property ("measurePosition")))
+      if (Moment *m = unsmob_moment (get_property ("measurePosition")))
        {
          pos = *m;
        }
-         
+
       if (pos < Moment (0))
        {
-         Moment length(1);
+         Moment length (1);
 
-         if ( Moment *m =  unsmob_moment (get_property ("measureLength")))
+         if (Moment *m = unsmob_moment (get_property ("measureLength")))
            {
              length = *m;
            }
@@ -279,13 +274,13 @@ Auto_beam_engraver::create_beam ()
 {
   if (to_boolean (get_property ("skipTypesetting")))
     return 0;
-  
+
   Spanner *beam = new Spanner (beam_settings_, context ()->get_grob_key ("Beam"));
   for (int i = 0; i < stems_->size (); i++)
     {
       /*
        watch out for stem tremolos and abbreviation beams
-       */
+      */
       if (Stem::get_beam ((*stems_)[i]))
        {
          scm_gc_unprotect_object (beam->self_scm ());
@@ -293,7 +288,7 @@ Auto_beam_engraver::create_beam ()
        }
       Beam::add_stem (beam, (*stems_)[i]);
     }
-  
+
   announce_grob (beam, (*stems_)[0]->self_scm ());
 
   return beam;
@@ -302,35 +297,35 @@ Auto_beam_engraver::create_beam ()
 void
 Auto_beam_engraver::begin_beam ()
 {
-  if (stems_ || grouping_ )
+  if (stems_ || grouping_)
     {
       programming_error ("already have autobeam");
-      return; 
+      return;
     }
-  
+
   stems_ = new Link_array<Item>;
   grouping_ = new Beaming_info_list;
   beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
-  
+
   beam_start_moment_ = now_mom ();
-  beam_start_location_ =
-    robust_scm2moment (get_property ("measurePosition"), Moment(0));
+  beam_start_location_
+    = robust_scm2moment (get_property ("measurePosition"), Moment (0));
   subdivide_beams_ = ly_scm2bool (get_property ("subdivideBeams"));
-  beat_length_ = robust_scm2moment (get_property ("beatLength"), Moment(1, 4));
+  beat_length_ = robust_scm2moment (get_property ("beatLength"), Moment (1, 4));
 }
 
 void
-Auto_beam_engraver::junk_beam () 
+Auto_beam_engraver::junk_beam ()
 {
   if (!stems_)
-    return ;
-  
+    return;
+
   delete stems_;
   stems_ = 0;
   delete grouping_;
   grouping_ = 0;
   beam_settings_ = SCM_EOL;
-  
+
   shortest_mom_ = Moment (Rational (1, 8));
 }
 
@@ -363,7 +358,7 @@ Auto_beam_engraver::typeset_beam ()
       finished_grouping_->beamify (beat_length_, subdivide_beams_);
       Beam::set_beaming (finished_beam_, finished_grouping_);
       finished_beam_ = 0;
-    
+
       delete finished_grouping_;
       finished_grouping_ = 0;
     }
@@ -375,7 +370,7 @@ Auto_beam_engraver::start_translation_timestep ()
   count_ = 0;
   /*
     don't beam over skips
-   */
+  */
   if (stems_)
     {
       Moment now = now_mom ();
@@ -403,21 +398,20 @@ Auto_beam_engraver::finalize ()
     junk_beam ();
 }
 
-
 void
 Auto_beam_engraver::acknowledge_grob (Grob_info info)
 {
   /*
     Duplicated from process_music(), since
     Repeat_acknowledge_engraver::process_music() may also set whichBar
-   */
+  */
   if (scm_is_string (get_property ("whichBar"))
-      && beam_start_moment_ < now_mom())
+      && beam_start_moment_ < now_mom ())
     {
       consider_end (shortest_mom_);
       junk_beam ();
     }
-  
+
   if (stems_)
     {
       if (Beam::has_interface (info.grob_))
@@ -433,20 +427,20 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
          end_beam ();
        }
     }
-  
+
   if (Stem::has_interface (info.grob_))
     {
-      Itemstem = dynamic_cast<Item *> (info.grob_);
-      Musicm = info.music_cause ();
+      Item *stem = dynamic_cast<Item *> (info.grob_);
+      Music *m = info.music_cause ();
       if (!m->is_mus_type ("rhythmic-event"))
        {
          programming_error ("Stem must have rhythmic structure");
          return;
        }
-      
+
       /*
        Don't (start) auto-beam over empty stems; skips or rests
-       */
+      */
       if (!Stem::head_count (stem))
        {
          if (stems_)
@@ -458,11 +452,11 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
        {
          if (stems_)
            junk_beam ();
-         return ;
+         return;
        }
-             
-      int durlog  = unsmob_duration (m->get_property ("duration"))->duration_log ();
-      
+
+      int durlog = unsmob_duration (m->get_property ("duration"))->duration_log ();
+
       if (durlog <= 2)
        {
          if (stems_)
@@ -470,23 +464,21 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
          return;
        }
 
-
       /*
        ignore grace notes.
-       */
+      */
       if (bool (beam_start_location_.grace_part_) != bool (now_mom ().grace_part_))
-       return ;
-       
-      
+       return;
+
       Moment dur = unsmob_duration (m->get_property ("duration"))->get_length ();
       /* FIXME:
 
-       This comment has been here since long:
+      This comment has been here since long:
 
-          if shortest duration would change
-           consider ending and beginning beam first. 
+      if shortest duration would change
+      consider ending and beginning beam first.
 
-       but the code didn't match: */
+      but the code didn't match: */
 #if 1
       consider_end (dur);
       consider_begin (dur);
@@ -507,11 +499,11 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
 
       if (!stems_)
        return;
-      
+
       Moment now = now_mom ();
-      
+
       grouping_->add_stem (now - beam_start_moment_ + beam_start_location_,
-                            durlog - 2);
+                          durlog - 2);
       stems_->push (stem);
       last_add_mom_ = now;
       extend_mom_ = (extend_mom_ >? now) + m->get_length ();
@@ -540,21 +532,20 @@ Auto_beam_engraver::process_acknowledged_grobs ()
            {
              junk_beam ();
            }
-       }    
+       }
     }
-  
-  count_ ++;
+
+  count_++;
 }
 
 ADD_TRANSLATOR (Auto_beam_engraver,
-/* descr */       "Generate beams based on measure characteristics and observed "
-"Stems.  Uses beatLength, measureLength and measurePosition to decide "
-"when to start and stop a beam.  Overriding beaming is done through "
-"@ref{Stem_engraver} properties @code{stemLeftBeamCount} and "
-"@code{stemRightBeamCount}. "
-,
-/* creats*/       "Beam",
-/* accepts */     "beam-forbid-event",
-/* acks  */      "stem-interface rest-interface beam-interface bar-line-interface",
-/* reads */       "autoBeaming autoBeamSettings beatLength subdivideBeams",
-/* write */       "");
+               /* descr */ "Generate beams based on measure characteristics and observed "
+               "Stems.  Uses beatLength, measureLength and measurePosition to decide "
+               "when to start and stop a beam.  Overriding beaming is done through "
+               "@ref{Stem_engraver} properties @code{stemLeftBeamCount} and "
+               "@code{stemRightBeamCount}. ",
+               /* creats*/ "Beam",
+               /* accepts */ "beam-forbid-event",
+               /* acks  */ "stem-interface rest-interface beam-interface bar-line-interface",
+               /* reads */ "autoBeaming autoBeamSettings beatLength subdivideBeams",
+               /* write */ "");
index 6098d05c7618e1dd2efe686e86d3dc6e147adce1..1fb472a1b5a45905c1201166455c2fdec307c12f 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   auto-change-iterator.cc -- implement  Auto_change_iterator
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "context.hh"
 #include "event.hh"
@@ -16,18 +15,18 @@ class Auto_change_iterator : public Music_wrapper_iterator
 {
 public:
   DECLARE_SCHEME_CALLBACK (constructor, ());
-  
+
   Auto_change_iterator ();
 
 protected:
   virtual void do_quit ();
   virtual void construct_children ();
-  virtual void process (Moment);  
+  virtual void process (Moment);
   Array<Pitch> pending_pitch (Moment) const;
 private:
   SCM split_list_;
   Direction where_dir_;
-  void change_to (Music_iterator, SCM, String);
+  void change_to (Music_iterator *, SCM, String);
   Moment start_moment_;
 
   Interpretation_context_handle up_;
@@ -35,25 +34,23 @@ private:
 
 };
 
-
-
 void
 Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
                                 String to_id)
 {
-  Context * current = it->get_outlet ();
-  Context * last = 0;
+  Context *current = it->get_outlet ();
+  Context *last = 0;
 
   /*
     Cut & Paste from Change_iterator (ugh).
 
-    TODO: abstract this function 
-   */
-  
+    TODO: abstract this function
+  */
+
   /* find the type  of translator that we're changing.
-     
-     If \translator Staff = bass, then look for Staff = *
-   */
+
+  If \translator Staff = bass, then look for Staff = *
+  */
   while (current && !current->is_alias (to_type_sym))
     {
       last = current;
@@ -65,25 +62,24 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
       String msg;
       msg += _ ("Can't switch translators, I'm there already");
     }
-  
-  if (current) 
+
+  if (current)
     if (last)
       {
-       Context * dest = 
-         it->get_outlet ()->find_create_context (to_type_sym, to_id, SCM_EOL);
+       Context *dest
+         it->get_outlet ()->find_create_context (to_type_sym, to_id, SCM_EOL);
        current->remove_context (last);
        dest->add_context (last);
       }
     else
       {
        /*
-         We could change the current translator's id, but that would make 
+         We could change the current translator's id, but that would make
          errors hard to catch
-         
+
        */
       }
-  else
-    ;
+  else;
 
 }
 
@@ -91,23 +87,23 @@ void
 Auto_change_iterator::process (Moment m)
 {
   Music_wrapper_iterator::process (m);
-  
+
   Moment now = get_outlet ()->now_mom ();
   Moment *splitm = 0;
-  
+
   for (; scm_is_pair (split_list_); split_list_ = scm_cdr (split_list_))
     {
       splitm = unsmob_moment (scm_caar (split_list_));
       if ((*splitm + start_moment_) > now)
-       break ;
+       break;
 
       SCM tag = scm_cdar (split_list_);
-      Direction d = to_dir  (tag);
-      
+      Direction d = to_dir (tag);
+
       if (d && d != where_dir_)
        {
          where_dir_ = d;
-         String to_id = (d >= 0) ?  "up" : "down";
+         String to_id = (d >= 0) ? "up" : "down";
          change_to (child_iter_,
                     ly_symbol2scm ("Staff"),
                     to_id);
@@ -124,32 +120,32 @@ Auto_change_iterator::Auto_change_iterator ()
 void
 Auto_change_iterator::construct_children ()
 {
-  split_list_ =  get_music ()->get_property ("split-list");
+  split_list_ = get_music ()->get_property ("split-list");
   start_moment_ = get_outlet ()->now_mom ();
 
-  SCM props = get_outlet()->get_property ("trebleStaffProperties");
-  Context *up = get_outlet()->find_create_context (ly_symbol2scm ("Staff"),
-                                                  "up", props);
+  SCM props = get_outlet ()->get_property ("trebleStaffProperties");
+  Context *up = get_outlet ()->find_create_context (ly_symbol2scm ("Staff"),
+                                                   "up", props);
+
+  props = get_outlet ()->get_property ("bassStaffProperties");
+  Context *down = get_outlet ()->find_create_context (ly_symbol2scm ("Staff"),
+                                                     "down", props);
 
-  props = get_outlet()->get_property ("bassStaffProperties");
-  Context *down = get_outlet()->find_create_context (ly_symbol2scm ("Staff"),
-                                                  "down", props);
-  
   up_.set_context (up);
   down_.set_context (down);
 
   Context *voice = up->find_create_context (ly_symbol2scm ("Voice"),
-                                          "", SCM_EOL);
+                                           "", SCM_EOL);
   set_context (voice);
   Music_wrapper_iterator::construct_children ();
 
 }
 
 void
-Auto_change_iterator::do_quit()
+Auto_change_iterator::do_quit ()
 {
   up_.set_context (0);
   down_.set_context (0);
-  
+
 }
 IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator);
index 5f646b3ee609ea0448292ddc0e10e83d1d9d632d..946914e6555de1d38efbde77fcbff1fe263d835d 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   axis-group-engraver.cc -- implement Axis_group_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #include "spanner.hh"
 #include "paper-column.hh"
@@ -15,8 +15,8 @@
 
 /**
    Put stuff in a Spanner with an Axis_group_interface.
-   Use as last element of a context. 
- */
+   Use as last element of a context.
+*/
 class Axis_group_engraver : public Engraver
 {
 protected:
@@ -26,9 +26,9 @@ protected:
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
   virtual void process_acknowledged_grobs ();
-  virtual Spanner* get_spanner () ;
-  virtual void add_element (Grob*) ;
-public:  
+  virtual Spanner *get_spanner ();
+  virtual void add_element (Grob *);
+public:
   TRANSLATOR_DECLARATIONS (Axis_group_engraver);
 };
 
@@ -44,42 +44,42 @@ Axis_group_engraver::process_music ()
   if (!staffline_)
     {
       staffline_ = get_spanner ();
-      Grob *  it = unsmob_grob (get_property ("currentCommandColumn"));
+      Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
       staffline_->set_bound (LEFT, it);
     }
-} 
+}
 
-Spanner*
-Axis_group_engraver::get_spanner () 
+Spanner *
+Axis_group_engraver::get_spanner ()
 {
   return make_spanner ("VerticalAxisGroup", SCM_EOL);
 }
 
 /*
-  TODO: should we junk minimumVerticalExtent/extraVerticalExtent ?  
- */
+  TODO: should we junk minimumVerticalExtent/extraVerticalExtent ?
+*/
 
 void
 Axis_group_engraver::finalize ()
 {
   if (!staffline_)
-    return ;
-  
+    return;
+
   String type = context ()->context_name ();
   SCM dims = get_property ("verticalExtent");
-  
+
   if (is_number_pair (dims))
     staffline_->set_extent (dims, Y_AXIS);
 
   dims = get_property ("minimumVerticalExtent");
-  if (is_number_pair (dims) )
+  if (is_number_pair (dims))
     staffline_->set_property ("minimum-Y-extent", dims);
 
   dims = get_property ("extraVerticalExtent");
   if (is_number_pair (dims))
     staffline_->set_property ("extra-Y-extent", dims);
 
-  Grob *  it = unsmob_grob (get_property ("currentCommandColumn"));
+  Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
 
   staffline_->set_bound (RIGHT, it);
 
@@ -99,30 +99,30 @@ Axis_group_engraver::acknowledge_grob (Grob_info i)
 void
 Axis_group_engraver::process_acknowledged_grobs ()
 {
-  if (!staffline_) 
-    return ;
-  
+  if (!staffline_)
+    return;
+
   for (int i = 0; i < elts_.size (); i++)
     {
-      if  (!unsmob_grob (elts_[i]->get_property ("axis-group-parent-Y")))
+      if (!unsmob_grob (elts_[i]->get_property ("axis-group-parent-Y")))
        {
          if (staffline_->get_parent (Y_AXIS)
              && staffline_->get_parent (Y_AXIS) == elts_[i])
            {
-             String msg = _("Axis_group_engraver: vertical group already has a parent.\n"
-                            "Do you have two Axis_group_engravers?\n"
-                            "Killing this vertical group.");
+             String msg = _ ("Axis_group_engraver: vertical group already has a parent.\n"
+                             "Do you have two Axis_group_engravers?\n"
+                             "Killing this vertical group.");
              staffline_->warning (msg);
              staffline_->suicide ();
              staffline_ = 0;
-             break ;
+             break;
            }
          else if (elts_[i]->is_empty (Y_AXIS))
            {
              /*
                We have to do _something_, otherwise staff objects will
-               end up with System as parent.  
-             
+               end up with System as parent.
+
              */
              elts_[i]->set_parent (staffline_, Y_AXIS);
            }
@@ -134,7 +134,7 @@ Axis_group_engraver::process_acknowledged_grobs ()
 }
 
 void
-Axis_group_engraver::add_element (Grob*e)
+Axis_group_engraver::add_element (Grob *e)
 {
   Axis_group_interface::add_element (staffline_, e);
 }
@@ -142,10 +142,8 @@ Axis_group_engraver::add_element (Grob*e)
 /****************************************************************/
 
 /*
-  
- maybenot such a good idea after all., to put class declarations in
- .cc
+  maybenot such a good idea after all., to put class declarations in
+  .cc
 */
 
 #include "hara-kiri-group-spanner.hh"
@@ -154,7 +152,7 @@ Axis_group_engraver::add_element (Grob*e)
 class Hara_kiri_engraver : public Axis_group_engraver
 {
 protected:
-  virtual Spanner*get_spanner ();
+  virtual Spanner *get_spanner ();
   virtual void acknowledge_grob (Grob_info);
   virtual void add_element (Grob *e);
 public:
@@ -162,17 +160,16 @@ public:
 };
 
 void
-Hara_kiri_engraver::add_element (Grob*e)
+Hara_kiri_engraver::add_element (Grob *e)
 {
   Hara_kiri_group_spanner::add_element (staffline_, e);
 }
 
-
-Spanner*
-Hara_kiri_engraver::get_spanner () 
+Spanner *
+Hara_kiri_engraver::get_spanner ()
 {
-  Spanner * sp = make_spanner ("RemoveEmptyVerticalGroup", SCM_EOL);
-  
+  Spanner *sp = make_spanner ("RemoveEmptyVerticalGroup", SCM_EOL);
+
   return sp;
 }
 
@@ -182,31 +179,29 @@ Hara_kiri_engraver::acknowledge_grob (Grob_info i)
   Axis_group_engraver::acknowledge_grob (i);
   if (staffline_
       && (i.grob_->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface"))
-         || i.grob_->internal_has_interface (ly_symbol2scm ("lyric-interface")))
-      )
+         || i.grob_->internal_has_interface (ly_symbol2scm ("lyric-interface"))))
     {
       Hara_kiri_group_spanner::add_interesting_item (staffline_, i.grob_);
     }
 }
 
-
 Hara_kiri_engraver::Hara_kiri_engraver ()
 {
 }
 
 ADD_TRANSLATOR (Hara_kiri_engraver,
-/* descr */       "Like Axis_group_engraver, but make a hara-kiri spanner, and add "
-"interesting items (ie. note heads, lyric syllables and normal rests) ",
-/* creats*/       "RemoveEmptyVerticalGroup",
-/* accepts */     "",
-/* acks  */      "grob-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Like Axis_group_engraver, but make a hara-kiri spanner, and add "
+               "interesting items (ie. note heads, lyric syllables and normal rests) ",
+               /* creats*/ "RemoveEmptyVerticalGroup",
+               /* accepts */ "",
+               /* acks  */ "grob-interface",
+               /* reads */ "",
+               /* write */ "");
 
 ADD_TRANSLATOR (Axis_group_engraver,
-/* descr */       "Group all objects created in this context in a VerticalAxisGroup spanner.",
-/* creats*/       "VerticalAxisGroup",
-/* accepts */     "",
-/* acks  */      "grob-interface",
-/* reads */       "verticalExtent minimumVerticalExtent extraVerticalExtent",
-/* write */       "");
+               /* descr */ "Group all objects created in this context in a VerticalAxisGroup spanner.",
+               /* creats*/ "VerticalAxisGroup",
+               /* accepts */ "",
+               /* acks  */ "grob-interface",
+               /* reads */ "verticalExtent minimumVerticalExtent extraVerticalExtent",
+               /* write */ "");
index 842641d18166b176d2d85d715e60e6f1cb671698..dde37ac72e0152a667ba319ad587f6aa01b14243 100644 (file)
@@ -1,44 +1,42 @@
-/*   
+/*
   axis-group-interface.cc -- implement Axis_group_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "axis-group-interface.hh"
 #include "hara-kiri-group-spanner.hh"
 
 void
-Axis_group_interface::add_element (Grob*me, Grob *e)
+Axis_group_interface::add_element (Grob *me, Grob *e)
 {
-  for (SCM ax = me->get_property ("axes"); ax != SCM_EOL ; ax = scm_cdr (ax))
+  for (SCM ax = me->get_property ("axes"); ax != SCM_EOL; ax = scm_cdr (ax))
     {
       Axis a = (Axis) scm_to_int (scm_car (ax));
-      
+
       if (!e->get_parent (a))
        e->set_parent (me, a);
 
       e->internal_set_property ((a == X_AXIS)
                                ? ly_symbol2scm ("axis-group-parent-X")
                                : ly_symbol2scm ("axis-group-parent-Y"),
-                               me->self_scm ()
-                               );
+                               me->self_scm ());
     }
-    
+
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), e);
   me->add_dependency (e);
 }
 
 bool
-Axis_group_interface::has_axis (Grob*me, Axis a)
+Axis_group_interface::has_axis (Grob *me, Axis a)
 {
   /*
     urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary?
-   */
-  return me->has_extent_callback (group_extent_callback_proc, a) ||
- (me->has_extent_callback (Hara_kiri_group_spanner::y_extent_proc, a));
+  */
+  return me->has_extent_callback (group_extent_callback_proc, a)
   || (me->has_extent_callback (Hara_kiri_group_spanner::y_extent_proc, a));
 }
 
 Interval
@@ -47,7 +45,7 @@ Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
   Interval r;
   for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * se = unsmob_grob (scm_car (s));
+      Grob *se = unsmob_grob (scm_car (s));
       Interval dims = se->extent (common, a);
       if (!dims.is_empty ())
        r.unite (dims);
@@ -63,7 +61,7 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
   Axis a = (Axis) scm_to_int (scm_axis);
 
   SCM elts = me->get_property ("elements");
-  Grob * common = common_refpoint_of_list (elts, me, a);
+  Grob *common = common_refpoint_of_list (elts, me, a);
 
   Real my_coord = me->relative_coordinate (common, a);
   Interval r (relative_group_extent (a, common, elts));
@@ -72,13 +70,13 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
 }
 
 void
-Axis_group_interface::set_axes (Grob*me, Axis a1, Axis a2)
+Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2)
 {
   SCM sa1= scm_int2num (a1);
   SCM sa2 = scm_int2num (a2);
 
   SCM axes = me->get_property ("axes");
-  
+
   if (!scm_is_pair (axes)
       || scm_c_memq (sa1, axes) == SCM_BOOL_F
       || scm_c_memq (sa2, axes) == SCM_BOOL_F)
@@ -95,35 +93,33 @@ Axis_group_interface::set_axes (Grob*me, Axis a1, Axis a2)
     me->set_extent (SCM_EOL, Y_AXIS);
 
   /*
-    why so convoluted ? (fixme/documentme?) 
-   */
+    why so convoluted ? (fixme/documentme?)
+  */
   if (me->has_extent_callback (Grob::stencil_extent_proc, a1))
     me->set_extent_callback (Axis_group_interface::group_extent_callback_proc, a1);
   if (me->has_extent_callback (Grob::stencil_extent_proc, a2))
     me->set_extent_callback (Axis_group_interface::group_extent_callback_proc, a2);
 }
 
-Link_array<Grob> 
-Axis_group_interface::get_children (Grob*me)
+Link_array<Grob>
+Axis_group_interface::get_children (Grob *me)
 {
   Link_array<Grob> childs;
-  childs.push (me) ;
+  childs.push (me);
 
   if (!has_interface (me))
     return childs;
-  
+
   for (SCM ep = me->get_property ("elements"); scm_is_pair (ep); ep = scm_cdr (ep))
     {
-      Grobe = unsmob_grob (scm_car (ep));
+      Grob *e = unsmob_grob (scm_car (ep));
       if (e)
        childs.concat (Axis_group_interface::get_children (e));
     }
-  
+
   return childs;
 }
 
-
-
 ADD_INTERFACE (Axis_group_interface, "axis-group-interface",
-  "An object that groups other layout objects.",
-  "axes elements");
+              "An object that groups other layout objects.",
+              "axes elements");
index 52154535588d58e823d21369594ca18e5fa1d3b7..2a2594ee92f7be678644dcc5262d6b7afe47aad8 100644 (file)
@@ -19,12 +19,12 @@ class Balloon_interface
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 MAKE_SCHEME_CALLBACK (Balloon_interface, print, 1);
 SCM
-Balloon_interface::print (SCM smob) 
+Balloon_interface::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
@@ -54,16 +54,16 @@ Balloon_interface::print (SCM smob)
   Stencil fr = Lookup::frame (box_extent, 0.1, 0.05);
 
   fr.add_stencil (*s);
-  
+
   SCM bt = me->get_property ("balloon-text");
   SCM chain = Font_interface::text_font_alist_chain (me);
   chain = scm_cons (me->get_property ("balloon-text-props"), chain);
 
   SCM text = Text_interface::interpret_markup (me->get_layout ()->self_scm (),
-                                         chain, bt);
+                                              chain, bt);
 
   Stencil *text_stil = unsmob_stencil (text);
+
   Offset z1;
   for (int i = X_AXIS; i < NO_AXES; i++)
     {
@@ -73,12 +73,12 @@ Balloon_interface::print (SCM smob)
     }
 
   Offset z2 = z1 + off;
+
   fr.add_stencil (Line_interface::line (me, z1, z2));
 
   text_stil->translate (z2);
   fr.add_stencil (*text_stil);
+
   fr = Stencil (orig_extent, fr.expr ());
   return fr.smobbed_copy ();
 }
index fe203f16ec8c3518934a1656722322e27ea883df..660272cd90c12300d7e0e0932d9acd97674d9435 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   bar-check-iterator.cc -- implement Bar_check_iterator
 
   source file of the GNU LilyPond music typesetter
 /*
   Check bar checks. We do this outside the engravers so that you can
   race through the score using skipTypesetting to correct durations.
- */
+*/
 class Bar_check_iterator : Simple_music_iterator
 {
 public:
   virtual void process (Moment);
-  Bar_check_iterator ( );
+  Bar_check_iterator ();
   DECLARE_SCHEME_CALLBACK (constructor, ());
 };
 
@@ -39,10 +39,10 @@ Bar_check_iterator::process (Moment m)
       SCM mp = tr->get_property ("measurePosition");
       SCM sync = tr->get_property ("barCheckSynchronize");
 
-      Moment * where = unsmob_moment (mp);
+      Moment *where = unsmob_moment (mp);
       if (!where)
        return;
-      
+
       if (where->main_part_)
        {
          bool warn = true;
@@ -63,8 +63,8 @@ Bar_check_iterator::process (Moment m)
            }
 
          if (warn)
-           get_music ()->origin ()->warning (_f ("barcheck failed at: %s", 
-                                             where->to_string ()));
+           get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
+                                                 where->to_string ()));
        }
     }
-}    
+}
index f4bb0e5894d3b3353f70c45107302f455c90ef8b..dad72a4fe4f7648f1125d65df46ea1e2d4569b36 100644 (file)
 
 /*
   generate bars. Either user ("|:"), or default (new measure)
-
-  */
+*/
 class Bar_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Bar_engraver);
   void request_bar (String type_string);
-    
+
 protected:
   virtual void finalize ();
   virtual void stop_translation_timestep ();
@@ -31,7 +30,7 @@ private:
   void typeset_bar ();
   void create_bar ();
 
-  Item * bar_;
+  Item *bar_;
 };
 
 Bar_engraver::Bar_engraver ()
@@ -47,7 +46,7 @@ Bar_engraver::create_bar ()
       bar_ = make_item ("BarLine", SCM_EOL);
       SCM gl = get_property ("whichBar");
       if (scm_equal_p (gl, bar_->get_property ("glyph")) != SCM_BOOL_T)
-         bar_->set_property ("glyph", gl);
+       bar_->set_property ("glyph", gl);
     }
 }
 
@@ -58,7 +57,7 @@ Bar_engraver::finalize ()
 }
 
 /*
-  Bar_engraver should come *after* any engravers that  
+  Bar_engraver should come *after* any engravers that
   modify whichBar
 
   This is a little hairy : whichBar may be set by
@@ -66,7 +65,6 @@ Bar_engraver::finalize ()
   context. This means that grobs could should be created after
   process_music. We do stuff process_acknowledged_grobs (), just to be
   on the safe side.
-     
 */
 
 void
@@ -83,9 +81,9 @@ Bar_engraver::typeset_bar ()
 }
 
 /*
-  lines may only be broken if there is a barline in all staves 
+  lines may only be broken if there is a barline in all staves
 */
-void 
+void
 Bar_engraver::stop_translation_timestep ()
 {
   if (!bar_)
@@ -95,12 +93,11 @@ Bar_engraver::stop_translation_timestep ()
     typeset_bar ();
 }
 
-
 ADD_TRANSLATOR (Bar_engraver,
-/* descr */       "Create barlines. This engraver is controlled through the "
-"@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
-/* creats*/       "BarLine",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "whichBar",
-/* write */       "");
+               /* descr */ "Create barlines. This engraver is controlled through the "
+               "@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
+               /* creats*/ "BarLine",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "whichBar",
+               /* write */ "");
index de9c1a2a9458dca90dd93d400f5f79dc79d15d72..cd5729a02eaf5ed0884ecd9e3961cb45f0163a72 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #include <math.h>
 
 #include "bar-line.hh"
 
 MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
 
-SCM 
-Bar_line::print (SCM smob) 
+SCM
+Bar_line::print (SCM smob)
 {
-  Grob * me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   SCM s = me->get_property ("glyph");
   SCM barsiz_proc = me->get_property ("bar-size-procedure");
   if (scm_is_string (s) && ly_c_procedure_p (barsiz_proc))
     {
-      String str  = ly_scm2string (s);
+      String str = ly_scm2string (s);
       SCM siz = scm_call_1 (barsiz_proc, me->self_scm ());
       Real sz = robust_scm2double (siz, 0);
       if (sz <= 0)
        return SCM_EOL;
-      
+
       return compound_barline (me, str, sz).smobbed_copy ();
     }
   return SCM_EOL;
 }
 
-
 Stencil
-Bar_line::compound_barline (Grob*me, String str, Real h)
+Bar_line::compound_barline (Grob *me, String str, Real h)
 {
   Real kern = robust_scm2double (me->get_property ("kern"), 1);
   Real thinkern = robust_scm2double (me->get_property ("thin-kern"), 1);
@@ -61,22 +59,22 @@ Bar_line::compound_barline (Grob*me, String str, Real h)
   Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
 
   int lines = Staff_symbol_referencer::line_count (me);
-  Real dist 
+  Real dist
     = ((lines & 1 || lines == 0)
        ? 1
-       : (staff_space < 2 ? 2 : .5) ) * staff_space;
+       : (staff_space < 2 ? 2 : .5)) * staff_space;
   Stencil colon (dot);
   colon.translate_axis (dist, Y_AXIS);
   colon.add_stencil (dot);
-  colon.translate_axis (-dist/2, Y_AXIS);
+  colon.translate_axis (-dist / 2, Y_AXIS);
 
   Stencil m;
   if (str == "||:")
     str = "|:";
-  
+
   if (str == "")
     {
-      return Lookup::blank (Box (Interval (0, 0), Interval (-h/2, h/2)));
+      return Lookup::blank (Box (Interval (0, 0), Interval (-h / 2, h / 2)));
     }
   else if (str == "|")
     {
@@ -84,8 +82,8 @@ Bar_line::compound_barline (Grob*me, String str, Real h)
     }
   else if (str == "|." || (h == 0 && str == ":|"))
     {
-      m.add_at_edge (X_AXIS, LEFT, thick, 0, 0);      
-      m.add_at_edge (X_AXIS, LEFT, thin, kern, 0 );
+      m.add_at_edge (X_AXIS, LEFT, thick, 0, 0);
+      m.add_at_edge (X_AXIS, LEFT, thin, kern, 0);
     }
   else if (str == ".|" || (h == 0 && str == "|:"))
     {
@@ -96,20 +94,20 @@ Bar_line::compound_barline (Grob*me, String str, Real h)
     {
       m.add_at_edge (X_AXIS, LEFT, thick, 0, 0);
       m.add_at_edge (X_AXIS, LEFT, thin, kern, 0);
-      m.add_at_edge (X_AXIS, LEFT, colon, kern, 0);      
+      m.add_at_edge (X_AXIS, LEFT, colon, kern, 0);
     }
   else if (str == "|:")
     {
       m.add_at_edge (X_AXIS, RIGHT, thick, 0, 0);
       m.add_at_edge (X_AXIS, RIGHT, thin, kern, 0);
-      m.add_at_edge (X_AXIS, RIGHT, colon, kern, 0);      
+      m.add_at_edge (X_AXIS, RIGHT, colon, kern, 0);
     }
   else if (str == ":|:")
     {
       m.add_at_edge (X_AXIS, LEFT, thick, thinkern, 0);
       m.add_at_edge (X_AXIS, LEFT, colon, kern, 0);
       m.add_at_edge (X_AXIS, RIGHT, thick, kern, 0);
-      m.add_at_edge (X_AXIS, RIGHT, colon, kern, 0);      
+      m.add_at_edge (X_AXIS, RIGHT, colon, kern, 0);
     }
   else if (str == ".|.")
     {
@@ -128,10 +126,10 @@ Bar_line::compound_barline (Grob*me, String str, Real h)
   else if (str == ":")
     {
       int c = (Staff_symbol_referencer::line_count (me));
-      
-      for (int i = 0 ; i < c - 1; i++)
+
+      for (int i = 0; i < c - 1; i++)
        {
-         Real y = (- (c-1.0) / 2 + 0.5  +   i * staff_space);
+         Real y = (- (c - 1.0) / 2 + 0.5 + i * staff_space);
          Stencil d (dot);
 
          d. translate_axis (y, Y_AXIS);
@@ -144,21 +142,21 @@ Bar_line::compound_barline (Grob*me, String str, Real h)
 Stencil
 Bar_line::simple_barline (Grob *me,
                          Real w,
-                         Real h) 
+                         Real h)
 {
   Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
-  
-  return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h/2, h/2)), blot);
+
+  return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h / 2, h / 2)), blot);
 }
 
-MAKE_SCHEME_CALLBACK (Bar_line, before_line_breaking , 1);
+MAKE_SCHEME_CALLBACK (Bar_line, before_line_breaking, 1);
 
 SCM
 Bar_line::before_line_breaking (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
-  Item * item = dynamic_cast<Item*> (me);
-  
+  Grob *me = unsmob_grob (smob);
+  Item *item = dynamic_cast<Item *> (me);
+
   SCM g = me->get_property ("glyph");
   SCM orig = g;
   Direction bsd = item->break_status_dir ();
@@ -167,7 +165,7 @@ Bar_line::before_line_breaking (SCM smob)
       SCM proc = me->get_property ("break-glyph-function");
       g = scm_call_2 (proc, g, scm_int2num (bsd));
     }
-  
+
   if (!scm_is_string (g))
     {
       me->set_property ("print-function", SCM_EOL);
@@ -180,15 +178,13 @@ Bar_line::before_line_breaking (SCM smob)
 
   return SCM_UNSPECIFIED;
 }
-  
-
 
 
 MAKE_SCHEME_CALLBACK (Bar_line, get_staff_bar_size, 1);
 SCM
-Bar_line::get_staff_bar_size (SCM smob) 
+Bar_line::get_staff_bar_size (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
   Real ss = Staff_symbol_referencer::staff_space (me);
   SCM size = me->get_property ("bar-size");
   if (scm_is_number (size))
@@ -201,28 +197,26 @@ Bar_line::get_staff_bar_size (SCM smob)
        barline so we return 0.0 in the next alternative.
       */
       Real ysize = (Staff_symbol_referencer::line_count (me) -1);
-      ysize = ysize * ss  + Staff_symbol_referencer::line_thickness (me);
+      ysize = ysize * ss + Staff_symbol_referencer::line_thickness (me);
       return scm_make_real (ysize);
     }
   else
     return scm_int2num (0);
 }
 
-
-
 ADD_INTERFACE (Bar_line, "bar-line-interface",
-  "Bar line.\n"
-"\n"
-"Print a special bar symbol. It replaces the \n"
-"regular bar symbol with a special\n"
-"symbol.  The argument @var{bartype} is a string which specifies the\n"
-"kind of bar to print.  Options are @code{:|}, \n"
-"@code{|:}, @code{:|:},\n"
-"@code{||}, @code{|.},\n"
-"@code{.|}, and @code{.|.}. \n"
-"\n"
-"These produce, respectively, a right repeat, a left repeat, a double\n"
-"repeat, a double bar, a start bar, an end bar, and a thick double bar.\n"
-"If @var{bartype} is set to @code{empty} then nothing is printed,\n"
-"but a line break is allowed at that spot.\n",
-  "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function");
+              "Bar line.\n"
+              "\n"
+              "Print a special bar symbol. It replaces the \n"
+              "regular bar symbol with a special\n"
+              "symbol.  The argument @var{bartype} is a string which specifies the\n"
+              "kind of bar to print.  Options are @code{:|}, \n"
+              "@code{|:}, @code{:|:},\n"
+              "@code{||}, @code{|.},\n"
+              "@code{.|}, and @code{.|.}. \n"
+              "\n"
+              "These produce, respectively, a right repeat, a left repeat, a double\n"
+              "repeat, a double bar, a start bar, an end bar, and a thick double bar.\n"
+              "If @var{bartype} is set to @code{empty} then nothing is printed,\n"
+              "but a line break is allowed at that spot.\n",
+              "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function");
index 6ef193e2ebde5fa40abb8547ced1638df00e7e17..80b431c2141721006857a40fb2b81068c3a2a80c 100644 (file)
 #include "context.hh"
 
 /*
-  
-TODO: detect the top staff (stavesFound), and acknowledge staff-group
-system-start-delims. If we find these, and the top staff is in the
-staff-group, add padding to the bar number.
-
+  TODO: detect the top staff (stavesFound), and acknowledge staff-group
+  system-start-delims. If we find these, and the top staff is in the
+  staff-group, add padding to the bar number.
 */
 
-
 class Bar_number_engraver : public Engraver
 {
 protected:
-  Itemtext_;
+  Item *text_;
 protected:
   virtual void stop_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
   virtual void process_music ();
   void create_items ();
-  TRANSLATOR_DECLARATIONS (Bar_number_engraver );
+  TRANSLATOR_DECLARATIONS (Bar_number_engraver);
 };
 
-
 void
 Bar_number_engraver::process_music ()
 {
   // todo include (&&!time->cadenza_b_)
 
   SCM wb = get_property ("whichBar");
-  
+
   if (scm_is_string (wb))
     {
       Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0)));
@@ -49,7 +45,7 @@ Bar_number_engraver::process_music ()
          SCM bn = get_property ("currentBarNumber");
          SCM proc = get_property ("barNumberVisibility");
          if (scm_is_number (bn) && ly_c_procedure_p (proc)
-             && to_boolean (scm_call_1(proc, bn)))
+             && to_boolean (scm_call_1 (proc, bn)))
            {
              create_items ();
              // guh.
@@ -61,20 +57,17 @@ Bar_number_engraver::process_music ()
 
 }
 
-
-
 Bar_number_engraver::Bar_number_engraver ()
 {
   text_ = 0;
 }
 
-                                              
 void
 Bar_number_engraver::acknowledge_grob (Grob_info inf)
 {
-  Grob * s = inf.grob_;
+  Grob *s = inf.grob_;
   if (text_
-      && dynamic_cast<Item*> (s)
+      && dynamic_cast<Item *> (s)
       && s->get_property ("break-align-symbol") == ly_symbol2scm ("left-edge"))
     {
       /*
@@ -84,18 +77,17 @@ Bar_number_engraver::acknowledge_grob (Grob_info inf)
     }
 }
 
-void 
+void
 Bar_number_engraver::stop_translation_timestep ()
 {
   if (text_)
     {
       text_->set_property ("side-support-elements", get_property ("stavesFound"));
-      
+
       text_ = 0;
     }
 }
 
-
 void
 Bar_number_engraver::create_items ()
 {
@@ -107,14 +99,13 @@ Bar_number_engraver::create_items ()
 }
 
 ADD_TRANSLATOR (Bar_number_engraver,
-/* descr */       "A bar number is created whenever measurePosition is zero. It is\n"
-                  "put on top of all staves, and appears only at  left side of the staff. "
-                  "The staves are taken from @code{stavesFound}, which is maintained by "
-                  "@code{@ref{Staff_collecting_engraver}}. "
-                  ,
-                  
-/* creats*/       "BarNumber",
-/* accepts */     "",
-/* acks  */      "break-aligned-interface",
-/* reads */       "currentBarNumber stavesFound barNumberVisibility" ,
-/* write */       "");
+               /* descr */ "A bar number is created whenever measurePosition is zero. It is\n"
+               "put on top of all staves, and appears only at  left side of the staff. "
+               "The staves are taken from @code{stavesFound}, which is maintained by "
+               "@code{@ref{Staff_collecting_engraver}}. ",
+
+               /* creats*/ "BarNumber",
+               /* accepts */ "",
+               /* acks  */ "break-aligned-interface",
+               /* reads */ "currentBarNumber stavesFound barNumberVisibility",
+               /* write */ "");
index 0f2cb2fb9c896174f4e3f2fa259d36dc310deef5..d7ea7638e8d284b335eb2e6d3eb619c8bce99c5a 100644 (file)
@@ -1,6 +1,6 @@
 /*
-   Determine whether a beam is concave.
- */
+  Determine whether a beam is concave.
+*/
 
 #include <math.h>
 
@@ -20,38 +20,37 @@ is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
   bool above = false;
   bool below = false;
   bool concave = false;
-  
+
   /*
     notes above and below the interval covered by 1st and last note.
-   */
+  */
   for (int i = 1; i < positions.size () - 1; i++)
     {
       above = above || (positions[i] > covering[UP]);
       below = below || (positions[i] < covering[DOWN]);
     }
 
-
   concave = concave || (above && below);
   /*
     A note as close or closer to the beam than begin and end, but the
     note is reached in the opposite direction as the last-first dy
-   */
-  int dy = positions.top() - positions[0];
-  int closest = (beam_dir * positions.top()) >? (beam_dir *positions[0]);
+  */
+  int dy = positions.top () - positions[0];
+  int closest = (beam_dir * positions.top ()) >? (beam_dir *positions[0]);
   for (int i = 2; !concave && i < positions.size () - 1; i++)
     {
-      int inner_dy = positions[i] - positions[i-1];
+      int inner_dy = positions[i] - positions[i - 1];
       if (sign (inner_dy) != sign (dy)
          && (beam_dir * positions[i] >= closest
-             || beam_dir * positions[i-1] >= closest))
+             || beam_dir * positions[i - 1] >= closest))
        concave = true;
     }
-  
-  bool all_closer = true; 
-  for (int i = 1; all_closer && i < positions.size ()-1; i++)
+
+  bool all_closer = true;
+  for (int i = 1; all_closer && i < positions.size () - 1; i++)
     {
-      all_closer = all_closer &&
-       (beam_dir * positions[i] > closest);
+      all_closer = all_closer
+       && (beam_dir * positions[i] > closest);
     }
 
   concave = concave || all_closer;
@@ -62,16 +61,16 @@ Real
 calc_concaveness (Array<int> const &positions, Direction beam_dir)
 {
   Real dy = positions.top () - positions[0];
-  Real slope = dy / Real (positions.size() - 1);
+  Real slope = dy / Real (positions.size () - 1);
   Real concaveness = 0.0;
-  for (int i = 1; i < positions.size() - 1; i++)
+  for (int i = 1; i < positions.size () - 1; i++)
     {
       Real line_y = slope * i + positions[0];
 
       concaveness += (beam_dir * (positions[i] - line_y)) >? 0.0;
     }
 
-  concaveness /= positions.size () ;
+  concaveness /= positions.size ();
 
   /*
     Normalize. For dy = 0, the slope ends up as 0 anyway, so the
@@ -88,14 +87,14 @@ Beam::check_concave (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  Link_array<Grob> stems = 
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
 
   if (is_knee (me))
     return SCM_UNSPECIFIED;
-  
+
   Direction beam_dir = CENTER;
-  for (int i = stems.size (); i--; )
+  for (int i = stems.size (); i--;)
     {
       if (Stem::is_invisible (stems[i]))
        stems.del (i);
@@ -105,11 +104,10 @@ Beam::check_concave (SCM smob)
            beam_dir = dir;
        }
     }
-  
+
   if (stems.size () <= 2)
     return SCM_UNSPECIFIED;
 
-
   Array<int> close_positions;
   Array<int> far_positions;
   for (int i = 0; i < stems.size (); i++)
@@ -120,15 +118,15 @@ Beam::check_concave (SCM smob)
        Hmmm.. wait, for the beams in the last measure of morgenlied,
        this doesn't look so good. Let's try the heads farthest from
        the beam.
-       
-       */
+
+      */
       Interval posns = Stem::head_positions (stems[i]);
-      
+
       close_positions.push ((int) rint (posns[beam_dir]));
       far_positions.push ((int) rint (posns[-beam_dir]));
     }
 
-  if (is_concave_single_notes (far_positions, beam_dir)) 
+  if (is_concave_single_notes (far_positions, beam_dir))
     {
       Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
       Real r = linear_combination (pos, 0.0);
@@ -140,11 +138,10 @@ Beam::check_concave (SCM smob)
   else
     {
       Real concaveness = (calc_concaveness (far_positions, beam_dir)
-                         + calc_concaveness (close_positions, beam_dir))/2;
-      
+                         + calc_concaveness (close_positions, beam_dir)) / 2;
 
       me->set_property ("concaveness", scm_from_double (concaveness));
     }
-  
+
   return SCM_UNSPECIFIED;
 }
index 22cf46cfb560714761ba7976228257d0b40ddbdb..def3e6a66ba9d895ec1f72496fee4b22296e4690 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   beam-engraver.cc -- implement Beam_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "beam.hh"
 
 class Beam_engraver : public Engraver
 {
-protected:  
-  Music * start_ev_;
-  
+protected:
+  Music *start_ev_;
+
   Spanner *finished_beam_;
   Spanner *beam_;
-  Music * prev_start_ev_;
+  Music *prev_start_ev_;
+
+  Music *now_stop_ev_;
 
-  Music * now_stop_ev_;
-  
-  Beaming_info_list * beam_info_;
-  Beaming_info_list * finished_beam_info_;  
+  Beaming_info_list *beam_info_;
+  Beaming_info_list *finished_beam_info_;
 
   /// location  within measure where beam started.
   Moment beam_start_location_;
@@ -51,21 +50,20 @@ protected:
   virtual void finalize ();
 
   virtual void acknowledge_grob (Grob_info);
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void process_music ();
 
   virtual bool valid_start_point ();
   virtual bool valid_end_point ();
-  
+
 public:
   TRANSLATOR_DECLARATIONS (Beam_engraver);
 };
 
-
 /*
   Hmm. this isn't necessary, since grace beams and normal beams are
   always nested.
- */
+*/
 bool
 Beam_engraver::valid_start_point ()
 {
@@ -146,15 +144,14 @@ Beam_engraver::process_music ()
 
       beam_start_location_ = mp;
       beam_start_mom_ = now_mom ();
-      
+
       beam_info_ = new Beaming_info_list;
-      
+
       /* urg, must copy to Auto_beam_engraver too */
     }
 
 }
 
-
 void
 Beam_engraver::typeset_beam ()
 {
@@ -162,7 +159,7 @@ Beam_engraver::typeset_beam ()
     {
       finished_beam_info_->beamify (beat_length_, subdivide_beams_);
       Beam::set_beaming (finished_beam_, finished_beam_info_);
-      
+
       delete finished_beam_info_;
       finished_beam_info_ = 0;
       finished_beam_ = 0;
@@ -173,11 +170,11 @@ void
 Beam_engraver::start_translation_timestep ()
 {
   start_ev_ = 0;
-  
+
   if (beam_)
     {
       set_melisma (true);
-      
+
       subdivide_beams_ = to_boolean (get_property ("subdivideBeams"));
       beat_length_ = robust_scm2moment (get_property ("beatLength"), Moment (1, 4));
     }
@@ -187,7 +184,7 @@ void
 Beam_engraver::stop_translation_timestep ()
 {
   typeset_beam ();
-  if (now_stop_ev_ )
+  if (now_stop_ev_)
     {
       finished_beam_ = beam_;
       finished_beam_info_ = beam_info_;
@@ -230,13 +227,13 @@ Beam_engraver::acknowledge_grob (Grob_info info)
          Moment now = now_mom ();
 
          if (!valid_start_point ())
-           return ;
-         
-         Item *stem = dynamic_cast<Item*> (info.grob_);
+           return;
+
+         Item *stem = dynamic_cast<Item *> (info.grob_);
          if (Stem::get_beam (stem))
            return;
 
-         Musicm = info.music_cause ();
+         Music *m = info.music_cause ();
          if (!m->is_mus_type ("rhythmic-event"))
            {
              String s = _ ("stem must have Rhythmic structure");
@@ -244,13 +241,12 @@ Beam_engraver::acknowledge_grob (Grob_info info)
                info.music_cause ()->origin ()->warning (s);
              else
                ::warning (s);
-         
+
              return;
            }
 
-
          last_stem_added_at_ = now;
-         int durlog  = unsmob_duration (m->get_property ("duration"))-> duration_log ();
+         int durlog = unsmob_duration (m->get_property ("duration"))-> duration_log ();
          if (durlog <= 2)
            {
              m->origin ()->warning (_ ("stem doesn't fit in beam"));
@@ -263,33 +259,29 @@ Beam_engraver::acknowledge_grob (Grob_info info)
            }
 
          stem->set_property ("duration-log",
-                                   scm_int2num (durlog));
+                             scm_int2num (durlog));
          Moment stem_location = now - beam_start_mom_ + beam_start_location_;
          beam_info_->add_stem (stem_location,
- (durlog- 2) >? 0);
                              (durlog- 2) >? 0);
          Beam::add_stem (beam_, stem);
        }
     }
 }
 
 
-
-
-
 ADD_TRANSLATOR (Beam_engraver,
-/* descr */       "Handles Beam events by engraving Beams.    If omitted, then notes will be "
-"printed with flags instead of beams.",
-/* creats*/       "Beam",
-/* accepts */     "beam-event",
-/* acks  */      "stem-interface rest-interface",
-/* reads */       "beamMelismaBusy beatLength subdivideBeams",
-/* write */       "");
-
+               /* descr */ "Handles Beam events by engraving Beams.    If omitted, then notes will be "
+               "printed with flags instead of beams.",
+               /* creats*/ "Beam",
+               /* accepts */ "beam-event",
+               /* acks  */ "stem-interface rest-interface",
+               /* reads */ "beamMelismaBusy beatLength subdivideBeams",
+               /* write */ "");
 
 class Grace_beam_engraver : public Beam_engraver
 {
 public:
-  TRANSLATOR_DECLARATIONS (Grace_beam_engraver);  
+  TRANSLATOR_DECLARATIONS (Grace_beam_engraver);
 
 protected:
   virtual bool valid_start_point ();
@@ -308,23 +300,19 @@ Grace_beam_engraver::valid_start_point ()
   return n.grace_part_ != Rational (0);
 }
 
-
 bool
 Grace_beam_engraver::valid_end_point ()
 {
   return beam_ && valid_start_point ();
 }
 
-
-
 ADD_TRANSLATOR (Grace_beam_engraver,
-/* descr */       "Handles Beam events by engraving Beams.  If omitted, then notes will "
-"be printed with flags instead of beams. Only engraves beams when we "
-" are at grace points in time. "
-,
-/* creats*/       "Beam",
-/* accepts */     "beam-event",
-/* acks  */      "stem-interface rest-interface",
-/* reads */       "beamMelismaBusy beatLength allowBeamBreak subdivideBeams",
-/* write */       "");
+               /* descr */ "Handles Beam events by engraving Beams.  If omitted, then notes will "
+               "be printed with flags instead of beams. Only engraves beams when we "
+               " are at grace points in time. ",
+               /* creats*/ "Beam",
+               /* accepts */ "beam-event",
+               /* acks  */ "stem-interface rest-interface",
+               /* reads */ "beamMelismaBusy beatLength allowBeamBreak subdivideBeams",
+               /* write */ "");
 
index d8ba6b240dcda932e43e79d54ad28e7fa3587580..a7cd2547b1ca64053f0dda0f1405b685206c1eae 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "performer.hh"
 #include "audio-item.hh"
 #include "global-context.hh"
 #include "warn.hh"
 
-class Beam_performer : public Performer {
+class Beam_performer : public Performer
+{
 public:
   TRANSLATOR_DECLARATIONS (Beam_performer);
-  
+
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
   virtual void start_translation_timestep ();
   virtual void process_music ();
   void set_melisma (bool);
@@ -34,7 +35,7 @@ Beam_performer::Beam_performer ()
   now_stop_ev_ = 0;
 }
 
-void 
+void
 Beam_performer::process_music ()
 {
   if (now_stop_ev_)
@@ -50,13 +51,12 @@ Beam_performer::process_music ()
     }
 }
 
-
 void
 Beam_performer::set_melisma (bool ml)
 {
   SCM b = get_property ("autoBeaming");
   if (!to_boolean (b))
-context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+    context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
 }
 
 void
@@ -65,7 +65,7 @@ Beam_performer::start_translation_timestep ()
   start_ev_ = 0;
   now_stop_ev_ = 0;
 }
+
 bool
 Beam_performer::try_music (Music *m)
 {
@@ -87,5 +87,5 @@ Beam_performer::try_music (Music *m)
 }
 
 ADD_TRANSLATOR (Beam_performer, "", "",
-                 "beam-event", "", "", "");
+               "beam-event", "", "", "");
 
index a3197932f69089bc663223039a5652f3b10f416e..c18c5c4cfe29df26f1a12039c260b27debfa286e 100644 (file)
@@ -1,11 +1,10 @@
 /*
   beam-quanting.cc -- implement Beam quanting functions
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
-  
 */
 
 #include <math.h>
 #include "align-interface.hh"
 
 const int INTER_QUANT_PENALTY = 1000;
-const Real SECONDARY_BEAM_DEMERIT  = 10.0;
+const Real SECONDARY_BEAM_DEMERIT = 10.0;
 const int STEM_LENGTH_DEMERIT_FACTOR = 5;
 
 /*
   threshold to combat rounding errors.
- */
-const Real BEAM_EPS = 1e-3; 
+*/
+const Real BEAM_EPS = 1e-3;
 
 // possibly ridiculous, but too short stems just won't do
 const int STEM_LENGTH_LIMIT_PENALTY = 5000;
@@ -40,7 +39,6 @@ shrink_extra_weight (Real x, Real fac)
   return fabs (x) * ((x < 0) ? fac : 1.0);
 }
 
-
 struct Quant_score
 {
   Real yl;
@@ -52,21 +50,19 @@ struct Quant_score
 #endif
 };
 
-
 /*
   TODO:
-  
-   - Make all demerits customisable
 
-   - One sensible check per demerit (what's this --hwn)
+  - Make all demerits customisable
 
-   - Add demerits for quants per se, as to forbid a specific quant
-     entirely
+  - One sensible check per demerit (what's this --hwn)
 
+  - Add demerits for quants per se, as to forbid a specific quant
+  entirely
 */
 
 int
-best_quant_score_idx (Array<Quant_score>  const & qscores)
+best_quant_score_idx (Array<Quant_score> const &qscores)
 {
   Real best = 1e6;
   int best_idx = -1;
@@ -74,7 +70,7 @@ best_quant_score_idx (Array<Quant_score>  const & qscores)
     {
       if (qscores[i].demerits < best)
        {
-         best = qscores [i].demerits ;
+         best = qscores [i].demerits;
          best_idx = i;
        }
     }
@@ -84,11 +80,10 @@ best_quant_score_idx (Array<Quant_score>  const & qscores)
       programming_error ("Huh? No best beam quant score?");
       best_idx = 0;
     }
-  
-    
+
   return best_idx;
 }
-  
+
 MAKE_SCHEME_CALLBACK (Beam, quanting, 1);
 SCM
 Beam::quanting (SCM smob)
@@ -99,14 +94,13 @@ Beam::quanting (SCM smob)
   Real yl = scm_to_double (scm_car (s));
   Real yr = scm_to_double (scm_cdr (s));
 
-
   /*
     Calculations are relative to a unit-scaled staff, i.e. the quants are
     divided by the current staff_space.
-    
-   */
+
+  */
   Real ss = Staff_symbol_referencer::staff_space (me);
-  Real thickness = Beam::get_thickness (me) / ss ;
+  Real thickness = Beam::get_thickness (me) / ss;
   Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
 
   Real dy_mus = robust_scm2double (me->get_property ("least-squares-dy"), 0);
@@ -116,9 +110,7 @@ Beam::quanting (SCM smob)
   Real hang = 1.0 - (thickness - slt) / 2;
   Real quants [] = {straddle, sit, inter, hang };
 
-
-  
-  int num_quants = int (sizeof (quants)/sizeof (Real));
+  int num_quants = int (sizeof (quants) / sizeof (Real));
   Array<Real> quantsl;
   Array<Real> quantsr;
 
@@ -127,28 +119,26 @@ Beam::quanting (SCM smob)
     wtk1-fugue2.
 
 
-    (result indexes between 70 and 575)  ? --hwn. 
+    (result indexes between 70 and 575)  ? --hwn.
 
   */
 
-
-  
   /*
     Do stem computations.  These depend on YL and YR linearly, so we can
     precompute for every stem 2 factors.
-   */
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  */
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
   Array<Stem_info> stem_infos;
   Array<Real> base_lengths;
-  Array<Real> stem_xposns;  
+  Array<Real> stem_xposns;
 
   Drul_array<bool> dirs_found (0, 0);
   Grob *common[2];
   for (int a = 2; a--;)
     common[a] = common_refpoint_of_array (stems, me, Axis (a));
 
-  Grob * fvs = first_visible_stem (me);
+  Grob *fvs = first_visible_stem (me);
   Grob *lvs = last_visible_stem (me);
   Real xl = fvs ? fvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
   Real xr = fvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
@@ -159,11 +149,11 @@ Beam::quanting (SCM smob)
     Sometimes my head is screwed on backwards.  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.
-    
-   */
+
+  */
   for (int i = 0; i < stems.size (); i++)
     {
-      Grob*s = stems[i];
+      Grob *s = stems[i];
 
       Stem_info si (Stem::get_stem_info (s));
       si.scale (1 / ss);
@@ -171,7 +161,7 @@ Beam::quanting (SCM smob)
       dirs_found[stem_infos.top ().dir_] = true;
 
       bool f = to_boolean (s->get_property ("french-beaming"))
-        && s != lvs && s != fvs;
+       && s != lvs && s != fvs;
 
       base_lengths.push (calc_stem_y (me, s, common, xl, xr,
                                      Interval (0, 0), f) / ss);
@@ -184,23 +174,22 @@ Beam::quanting (SCM smob)
       Grob *commony = fvs->common_refpoint (lvs, Y_AXIS);
       xstaff = Align_interface::has_interface (commony);
     }
-  
+
   Direction ldir = Direction (stem_infos[0].dir_);
   Direction rdir = Direction (stem_infos.top ().dir_);
   bool is_knee = dirs_found[LEFT] && dirs_found[RIGHT];
 
-
   int region_size = REGION_SIZE;
   /*
-    Knees are harder, lets try some more possibilities for knees. 
-   */
+    Knees are harder, lets try some more possibilities for knees.
+  */
   if (is_knee)
     region_size += 2;
 
   /*
     Asymetry ? should run to <= region_size ?
-   */
-  for (int i = -region_size ; i < region_size; i++)
+  */
+  for (int i = -region_size; i < region_size; i++)
     for (int j = 0; j < num_quants; j++)
       {
        quantsl.push (i + quants[j] + int (yl));
@@ -208,15 +197,15 @@ Beam::quanting (SCM smob)
       }
 
   Array<Quant_score> qscores;
-  
-  for (int l = 0; l < quantsl.size (); l++)  
+
+  for (int l = 0; l < quantsl.size (); l++)
     for (int r = 0; r < quantsr.size (); r++)
       {
        Quant_score qs;
        qs.yl = quantsl[l];
        qs.yr = quantsr[r];
        qs.demerits = 0.0;
-       
+
        qscores.push (qs);
       }
 
@@ -226,10 +215,10 @@ Beam::quanting (SCM smob)
      parameters outside of the loop, we can save a lot of time. */
   for (int i = qscores.size (); i--;)
     {
-      Real d =  score_slopes_dy (qscores[i].yl, qscores[i].yr,
-                                dy_mus, yr- yl, 
-                                xr - xl,
-                                xstaff);
+      Real d = score_slopes_dy (qscores[i].yl, qscores[i].yr,
+                               dy_mus, yr- yl,
+                               xr - xl,
+                               xstaff);
       qscores[i].demerits += d;
 
 #if DEBUG_QUANTING
@@ -239,9 +228,9 @@ Beam::quanting (SCM smob)
 
   Real rad = Staff_symbol_referencer::staff_radius (me);
   Drul_array<int> edge_beam_counts
-    (Stem::beam_multiplicity (stems[0]).length  () + 1,
-     Stem::beam_multiplicity (stems.top ()).length  () + 1);
-  
+    (Stem::beam_multiplicity (stems[0]).length () + 1,
+     Stem::beam_multiplicity (stems.top ()).length () + 1);
+
   Real beam_translation = get_beam_translation (me) / ss;
 
   Real reasonable_score = (is_knee) ? 200000 : 100;
@@ -250,7 +239,7 @@ Beam::quanting (SCM smob)
       {
        Real d = score_forbidden_quants (qscores[i].yl, qscores[i].yr,
                                         rad, slt, thickness, beam_translation,
-                                        edge_beam_counts, ldir, rdir); 
+                                        edge_beam_counts, ldir, rdir);
        qscores[i].demerits += d;
 
 #if DEBUG_QUANTING
@@ -262,11 +251,11 @@ Beam::quanting (SCM smob)
     if (qscores[i].demerits < reasonable_score)
       {
        Real d = score_stem_lengths (stems, stem_infos,
-                                base_lengths, stem_xposns,
-                                xl, xr,
-                                is_knee,
-                                qscores[i].yl, qscores[i].yr);
-       qscores[i].demerits +=  d;
+                                    base_lengths, stem_xposns,
+                                    xl, xr,
+                                    is_knee,
+                                    qscores[i].yl, qscores[i].yr);
+       qscores[i].demerits += d;
 
 #if DEBUG_QUANTING
        qscores[i].score_card_ += to_string (" L %.2f", d);
@@ -285,7 +274,7 @@ Beam::quanting (SCM smob)
       int i = 0;
 
       Real mindist = 1e6;
-      for (; i < qscores.size (); i ++)
+      for (; i < qscores.size (); i++)
        {
          Real d = fabs (qscores[i].yl- ins[LEFT]) + fabs (qscores[i].yr - ins[RIGHT]);
          if (d < mindist)
@@ -298,7 +287,7 @@ Beam::quanting (SCM smob)
        programming_error ("Could not find quant.");
     }
 #endif
-  
+
   me->set_property ("positions",
                    ly_interval2scm (Drul_array<Real> (qscores[best_idx].yl,
                                                       qscores[best_idx].yr)));
@@ -306,7 +295,7 @@ Beam::quanting (SCM smob)
   if (to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))))
     {
       qscores[best_idx].score_card_ += to_string ("i%d", best_idx);
-      
+
       // debug quanting
       me->set_property ("quant-score",
                        scm_makfrom0str (qscores[best_idx].score_card_.to_str0 ()));
@@ -321,53 +310,53 @@ Beam::score_stem_lengths (Link_array<Grob> const &stems,
                          Array<Stem_info> const &stem_infos,
                          Array<Real> const &base_stem_ys,
                          Array<Real> const &stem_xs,
-                         Real xl, Real xr, 
-                         bool knee, 
+                         Real xl, Real xr,
+                         bool knee,
                          Real yl, Real yr)
 {
   Real limit_penalty = STEM_LENGTH_LIMIT_PENALTY;
   Drul_array<Real> score (0, 0);
   Drul_array<int> count (0, 0);
-  
+
   for (int i = 0; i < stems.size (); i++)
     {
-      Grobs = stems[i];
+      Grob *s = stems[i];
       if (Stem::is_invisible (s))
        continue;
 
       Real x = stem_xs[i];
-      Real dx = xr-xl;
-      Real beam_y = dx ? yr *(x - xl)/dx + yl * ( xr - x)/dx : (yr + yl)/2;
+      Real dx = xr - xl;
+      Real beam_y = dx ? yr * (x - xl) / dx + yl * (xr - x) / dx : (yr + yl) / 2;
       Real current_y = beam_y + base_stem_ys[i];
       Real length_pen = STEM_LENGTH_DEMERIT_FACTOR;
-      
+
       Stem_info info = stem_infos[i];
       Direction d = info.dir_;
 
       score[d] += limit_penalty * (0 >? (d * (info.shortest_y_ - current_y)));
-      
+
       Real ideal_diff = d * (current_y - info.ideal_y_);
       Real ideal_score = shrink_extra_weight (ideal_diff, 1.5);
-      
+
       /* We introduce a power, to make the scoring strictly
          convex. Otherwise a symmetric knee beam (up/down/up/down)
          does not have an optimum in the middle. */
       if (knee)
        ideal_score = pow (ideal_score, 1.1);
-      
+
       score[d] += length_pen * ideal_score;
 
-      count[d] ++;
+      count[d]++;
     }
 
   Direction d = DOWN;
   do
-    { 
+    {
       score[d] /= (count[d] >? 1);
     }
   while (flip (&d) != DOWN);
 
-  return score[LEFT]+score[RIGHT];
+  return score[LEFT] + score[RIGHT];
 }
 
 Real
@@ -385,42 +374,39 @@ Beam::score_slopes_dy (Real yl, Real yr,
 
     TODO: find a way to incorporate the complexity of the beam in this
     penalty.
-   */
-  if (fabs (dy/dx) > ROUND_TO_ZERO_SLOPE
+  */
+  if (fabs (dy / dx) > ROUND_TO_ZERO_SLOPE
       && sign (dy_damp) != sign (dy))
     {
       dem += DAMPING_DIRECTION_PENALTY;
     }
 
-   dem += MUSICAL_DIRECTION_FACTOR * (0 >? (fabs (dy) - fabs (dy_mus)));
-
+  dem += MUSICAL_DIRECTION_FACTOR *(0 >? (fabs (dy) - fabs (dy_mus)));
 
-   Real slope_penalty = IDEAL_SLOPE_FACTOR;
+  Real slope_penalty = IDEAL_SLOPE_FACTOR;
 
-   /* Xstaff beams tend to use extreme slopes to get short stems. We
-      put in a penalty here. */
-   if (xstaff)
-     slope_penalty *= 10;
+  /* Xstaff beams tend to use extreme slopes to get short stems. We
+     put in a penalty here. */
+  if (xstaff)
+    slope_penalty *= 10;
 
-   /* Huh, why would a too steep beam be better than a too flat one ? */
-   dem += shrink_extra_weight (fabs (dy_damp) - fabs (dy), 1.5)
-     * slope_penalty;
+  /* Huh, why would a too steep beam be better than a too flat one ? */
+  dem += shrink_extra_weight (fabs (dy_damp) - fabs (dy), 1.5)
+    * slope_penalty;
 
-   return dem;
+  return dem;
 }
 
-
 static Real
 my_modf (Real x)
 {
   return x - floor (x);
 }
 
-
 /*
   TODO: The fixed value SECONDARY_BEAM_DEMERIT is probably flawed:
-   because for 32nd and 64th beams the forbidden quants are relatively
-   more important than stem lengths.
+  because for 32nd and 64th beams the forbidden quants are relatively
+  more important than stem lengths.
 */
 Real
 Beam::score_forbidden_quants (Real yl, Real yr,
@@ -433,12 +419,11 @@ Beam::score_forbidden_quants (Real yl, Real yr,
   Real dy = yr - yl;
   Drul_array<Real> y (yl, yr);
   Drul_array<Direction> dirs (ldir, rdir);
-  
+
   Real extra_demerit = SECONDARY_BEAM_DEMERIT / (beam_counts[LEFT] >? beam_counts[RIGHT]);
 
   Direction d = LEFT;
   Real dem = 0.0;
-  
 
   do
     {
@@ -452,32 +437,31 @@ Beam::score_forbidden_quants (Real yl, Real yr,
            will be in the gap of the (2, sit) quant, leading to a
            false demerit.
          */
-         Real gap1 = y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2.2 );
-         Real gap2 = y[d] - stem_dir * (j * beam_translation - thickness / 2 + slt/2.2);
+         Real gap1 = y[d] - stem_dir * ((j - 1) * beam_translation + thickness / 2 - slt / 2.2);
+         Real gap2 = y[d] - stem_dir * (j * beam_translation - thickness / 2 + slt / 2.2);
 
          Interval gap;
          gap.add_point (gap1);
          gap.add_point (gap2);
 
-         for (Real k = - radius ;
-              k <= radius + BEAM_EPS; k += 1.0) 
+         for (Real k = -radius;
+              k <= radius + BEAM_EPS; k += 1.0)
            if (gap.contains (k))
              {
-               Real dist = fabs (gap[UP]-k) <? fabs (gap[DOWN] - k);
+               Real dist = fabs (gap[UP] - k) <? fabs (gap[DOWN] - k);
 
                /*
                  this parameter is tuned to grace-stem-length.ly
                */
                Real fixed_demerit = 0.4;
-               
+
                dem += extra_demerit
-                 * (fixed_demerit +
-                    (1-fixed_demerit) * (dist / gap.length())* 2);
+                 * (fixed_demerit
+                    + (1 - fixed_demerit) * (dist / gap.length ())* 2);
              }
        }
     }
-  while ((flip (&d))!= LEFT); 
-
+  while ((flip (&d))!= LEFT);
 
   if ((beam_counts[LEFT] >? beam_counts[RIGHT]) >= 2)
     {
@@ -486,7 +470,6 @@ Beam::score_forbidden_quants (Real yl, Real yr,
       Real inter = 0.5;
       Real hang = 1.0 - (thickness - slt) / 2;
 
-
       Direction d = LEFT;
       do
        {
@@ -496,7 +479,7 @@ Beam::score_forbidden_quants (Real yl, Real yr,
              if (dirs[d] == UP && dy <= BEAM_EPS
                  && fabs (my_modf (y[d]) - sit) < BEAM_EPS)
                dem += extra_demerit;
-         
+
              if (dirs[d] == DOWN && dy >= BEAM_EPS
                  && fabs (my_modf (y[d]) - hang) < BEAM_EPS)
                dem += extra_demerit;
@@ -508,7 +491,7 @@ Beam::score_forbidden_quants (Real yl, Real yr,
              if (dirs[d] == UP && dy <= BEAM_EPS
                  && fabs (my_modf (y[d]) - straddle) < BEAM_EPS)
                dem += extra_demerit;
-             
+
              if (dirs[d] == DOWN && dy >= BEAM_EPS
                  && fabs (my_modf (y[d]) - straddle) < BEAM_EPS)
                dem += extra_demerit;
@@ -516,8 +499,7 @@ Beam::score_forbidden_quants (Real yl, Real yr,
        }
       while (flip (&d) != LEFT);
     }
-  
+
   return dem;
 }
 
-  
index 3880f691bd4b56fc991f147a6d085d33eac7ca99..dbe22733dee2d3734d3ae9d0f963f082aa63b6df 100644 (file)
@@ -1,31 +1,28 @@
 /*
   beam.cc -- implement Beam
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 /*
-TODO:
+  TODO:
 
   - Determine auto knees based on positions if it's set by the user.
 
   - the code is littered with * and / staff_space calls for
-    #'positions. Consider moving to real-world coordinates?
+  #'positions. Consider moving to real-world coordinates?
 
-    Problematic issue is user tweaks (user tweaks are in staff-coordinates.) 
-  
-Notes:
+  Problematic issue is user tweaks (user tweaks are in staff-coordinates.)
 
- - Stems run to the Y-center of the beam.
-  
- - beam_translation is the offset between Y centers of the beam.
-
-*/
+  Notes:
 
+  - Stems run to the Y-center of the beam.
 
+  - beam_translation is the offset between Y centers of the beam.
+*/
 
 #include <math.h> // tanh.
 
@@ -44,29 +41,26 @@ Notes:
 #include "spanner.hh"
 #include "warn.hh"
 
-
 #if DEBUG_QUANTING
-#include "text-item.hh"  // debug output.
-#include "font-interface.hh"  // debug output.
+#include "text-item.hh" // debug output.
+#include "font-interface.hh" // debug output.
 #endif
 
-
 void
 Beam::add_stem (Grob *me, Grob *s)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("stems"), s);
-  
+
   s->add_dependency (me);
 
   assert (!Stem::get_beam (s));
   s->set_property ("beam", me->self_scm ());
 
-  add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*> (s));
+  add_bound_item (dynamic_cast<Spanner *> (me), dynamic_cast<Item *> (s));
 }
 
-
 Real
-Beam::get_thickness (Grob * me)
+Beam::get_thickness (Grob *me)
 {
   return robust_scm2double (me->get_property ("thickness"), 0)
     * Staff_symbol_referencer::staff_space (me);
@@ -91,7 +85,7 @@ Beam::get_beam_translation (Grob *me)
 
 /* Maximum beam_count. */
 int
-Beam::get_beam_count (Grob *me) 
+Beam::get_beam_count (Grob *me)
 {
   int m = 0;
   for (SCM s = me->get_property ("stems"); scm_is_pair (s); s = scm_cdr (s))
@@ -102,28 +96,26 @@ Beam::get_beam_count (Grob *me)
   return m;
 }
 
-
 /*
   Space return space between beams.
- */
+*/
 MAKE_SCHEME_CALLBACK (Beam, space_function, 2);
 SCM
 Beam::space_function (SCM smob, SCM beam_count)
 {
   Grob *me = unsmob_grob (smob);
-  
+
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Real line = Staff_symbol_referencer::line_thickness (me);
   Real thickness = get_thickness (me);
-  
+
   Real beam_translation = scm_to_int (beam_count) < 4
     ? (2*staff_space + line - thickness) / 2.0
     : (3*staff_space + line - thickness) / 3.0;
-  
+
   return scm_make_real (beam_translation);
 }
 
-
 /* After pre-processing all directions should be set.
    Several post-processing routines (stem, slur, script) need stem/beam
    direction.
@@ -134,15 +126,15 @@ MAKE_SCHEME_CALLBACK (Beam, before_line_breaking, 1);
 SCM
 Beam::before_line_breaking (SCM smob)
 {
-  Grob *me =  unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   /* Beams with less than 2 two stems don't make much sense, but could happen
      when you do
-     
+
      [r8 c8 r8].
-     
-    For a beam that  only has one stem, we try to do some disappearance magic:
-    we revert the flag, and move on to The Eternal Engraving Fields. */
+
+     For a beam that  only has one stem, we try to do some disappearance magic:
+     we revert the flag, and move on to The Eternal Engraving Fields. */
 
   int count = visible_stem_count (me);
   if (count < 2)
@@ -162,7 +154,7 @@ Beam::before_line_breaking (SCM smob)
       else if (scm_ilength (stems) == 0)
        {
          me->suicide ();
-         return SCM_UNSPECIFIED;         
+         return SCM_UNSPECIFIED;
        }
     }
   if (count >= 1)
@@ -180,21 +172,18 @@ Beam::before_line_breaking (SCM smob)
   return SCM_EOL;
 }
 
-
 /*
   We want a maximal number of shared beams, but if there is choice, we
   take the one that is closest to the end of the stem. This is for situations like
 
-       x
-      |
-      |
+  x
+  |
+  |
   |===|
   |=
   |
   x
-
-  
- */
+*/
 int
 position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming,
                                    Direction left_dir,
@@ -205,19 +194,19 @@ position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming,
   int best_count = 0;
   int best_start = 0;
   for (int i = lslice[-left_dir];
-       (i - lslice[left_dir])* left_dir <= 0 ; i+= left_dir) 
+       (i - lslice[left_dir])* left_dir <= 0; i+= left_dir)
     {
       int count = 0;
-      for ( SCM s = scm_car (right_beaming); scm_is_pair (s); s = scm_cdr (s))
+      for (SCM s = scm_car (right_beaming); scm_is_pair (s); s = scm_cdr (s))
        {
-         int k = - right_dir * scm_to_int (scm_car (s)) + i;
+         int k = -right_dir * scm_to_int (scm_car (s)) + i;
          if (scm_c_memq (scm_int2num (k), left_beaming) != SCM_BOOL_F)
-           count ++;
+           count++;
        }
 
       if (count >= best_count)
        {
-         best_count = count; 
+         best_count = count;
          best_start = i;
        }
     }
@@ -228,8 +217,8 @@ position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming,
 void
 Beam::connect_beams (Grob *me)
 {
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
 
   Slice last_int;
   last_int.set_empty ();
@@ -246,39 +235,38 @@ Beam::connect_beams (Grob *me)
          int start_point = position_with_maximal_common_beams
            (last_beaming, this_beaming,
             last_dir, this_dir);
-         
+
          Direction d = LEFT;
-         Slice new_slice ; 
+         Slice new_slice;
          do
            {
-             if (d == RIGHT && i == stems.size ()-1)
+             if (d == RIGHT && i == stems.size () - 1)
                continue;
-             
+
              new_slice.set_empty ();
              SCM s = index_get_cell (this_beaming, d);
              for (; scm_is_pair (s); s = scm_cdr (s))
                {
-                 int new_beam_pos =
-                   start_point - this_dir * scm_to_int (scm_car (s));
+                 int new_beam_pos
+                   start_point - this_dir * scm_to_int (scm_car (s));
 
                  new_slice.add_point (new_beam_pos);
                  scm_set_car_x (s, scm_int2num (new_beam_pos));
                }
 
-
            }
          while (flip (&d) != LEFT);
 
          if (!new_slice.is_empty ())
-           last_int =  new_slice;
+           last_int = new_slice;
        }
       else
        {
-         scm_set_car_x ( this_beaming, SCM_EOL);
+         scm_set_car_x (this_beaming, SCM_EOL);
          SCM s = scm_cdr (this_beaming);
          for (; scm_is_pair (s); s = scm_cdr (s))
            {
-             int np = - this_dir * scm_to_int (scm_car (s));
+             int np = -this_dir * scm_to_int (scm_car (s));
              scm_set_car_x (s, scm_int2num (np));
              last_int.add_point (np);
            }
@@ -295,22 +283,21 @@ Beam::connect_beams (Grob *me)
          last_dir = this_dir;
        }
     }
- }
-
+}
 
 /*
   TODO: should not make beams per stem, but per Y-level.
- */
+*/
 MAKE_SCHEME_CALLBACK (Beam, print, 1);
 SCM
 Beam::print (SCM grob)
 {
   Spanner *me = unsmob_spanner (grob);
   position_beam (me);
-  
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
-  Grobxcommon = common_refpoint_of_array (stems, me, X_AXIS);
+
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Grob *xcommon = common_refpoint_of_array (stems, me, X_AXIS);
 
   xcommon = me->get_bound (LEFT)->common_refpoint (xcommon, X_AXIS);
   xcommon = me->get_bound (RIGHT)->common_refpoint (xcommon, X_AXIS);
@@ -338,42 +325,42 @@ Beam::print (SCM grob)
   else
     pos = ly_scm2realdrul (posns);
 
-  scale_drul (&pos,  Staff_symbol_referencer::staff_space (me));
-  
+  scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
+
   Real dy = pos[RIGHT] - pos[LEFT];
-  Real slope = (dy && dx) ? dy/dx : 0;
-  
+  Real slope = (dy && dx) ? dy / dx : 0;
+
   Real thick = get_thickness (me);
   Real bdy = get_beam_translation (me);
 
   SCM last_beaming = SCM_EOL;
   Real last_xposn = -1;
-  Real last_stem_width = -1 ;
+  Real last_stem_width = -1;
 
   Real gap_length = robust_scm2double (me->get_property ("gap"), 0.0);
-  
+
   Stencil the_beam;
   Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
-  
+
   for (int i = 0; i<= stems.size (); i++)
     {
-      Grob * st = (i < stems.size ()) ? stems[i] : 0;
-      
+      Grob *st = (i < stems.size ()) ? stems[i] : 0;
+
       SCM this_beaming = st ? st->get_property ("beaming") : SCM_EOL;
       Real xposn = st ? st->relative_coordinate (xcommon, X_AXIS) : 0.0;
-      Real stem_width = st ? robust_scm2double (st->get_property ("thickness"), 1.0) *lt : 0 ;
+      Real stem_width = st ? robust_scm2double (st->get_property ("thickness"), 1.0) *lt : 0;
       Direction stem_dir = st ? to_dir (st->get_property ("direction")) : CENTER;
       /*
        We do the space left of ST, with lfliebertjes pointing to the
        right from the left stem, and rfliebertjes pointing left from
        right stem.
-       */
+      */
       SCM left = (i > 0) ? scm_cdr (last_beaming) : SCM_EOL;
       SCM right = st ? scm_car (this_beaming) : SCM_EOL;
 
       Array<int> full_beams;
       Array<int> lfliebertjes;
-      Array<int> rfliebertjes;   
+      Array<int> rfliebertjes;
 
       for (SCM s = left;
           scm_is_pair (s); s = scm_cdr (s))
@@ -385,7 +372,7 @@ Beam::print (SCM grob)
            }
          else
            {
-             lfliebertjes.push (b); 
+             lfliebertjes.push (b);
            }
        }
       for (SCM s = right;
@@ -400,7 +387,7 @@ Beam::print (SCM grob)
 
       /*
        how much to stick out for beams across linebreaks
-       */
+      */
       Real break_overshoot = 3.0;
       Real w = (i > 0 && st) ? (xposn - last_xposn) : break_overshoot;
 
@@ -412,8 +399,7 @@ Beam::print (SCM grob)
        }
 
       if (st)
-       w += stem_width/ 2 ;
-      
+       w += stem_width/ 2;
 
       Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
       Stencil whole = Lookup::beam (slope, w, thick, blot);
@@ -434,25 +420,25 @@ Beam::print (SCM grob)
       for (int j = full_beams.size (); j--;)
        {
          Stencil b (whole);
-         
+
          if (k++ < gap_count)
            {
              b = gapped;
              b.translate_axis (gap_length, X_AXIS);
            }
-         b.translate_axis (last_xposn -  x0 + stem_offset, X_AXIS);
+         b.translate_axis (last_xposn - x0 + stem_offset, X_AXIS);
          b.translate_axis (slope * (last_xposn - x0) + bdy * full_beams[j], Y_AXIS);
 
-         the_beam.add_stencil (b);           
+         the_beam.add_stencil (b);
        }
-         
+
       if (lfliebertjes.size () || rfliebertjes.size ())
        {
          Real nw_f;
 
          if (st)
            {
-             int t = Stem::duration_log (st); 
+             int t = Stem::duration_log (st);
 
              SCM proc = me->get_property ("flag-width-function");
              SCM result = scm_call_1 (proc, scm_int2num (t));
@@ -460,22 +446,22 @@ Beam::print (SCM grob)
            }
          else
            nw_f = break_overshoot / 2;
-             
+
          /* Half beam should be one note-width,
             but let's make sure two half-beams never touch */
          Real lw = nw_f;
          Real rw = nw_f;
          if (i > 0)
-           rw = nw_f <? ( (xposn - last_xposn) / 2);
+           rw = nw_f <? ((xposn - last_xposn) / 2);
          else
            /*
              TODO: 0.5 is a guess.
            */
            rw = xposn - me->get_bound (LEFT)->extent (xcommon, X_AXIS)[RIGHT]
              - 0.5;
-         
+
          if (st)
-           lw = nw_f <? ( (xposn - last_xposn) / 2);
+           lw = nw_f <? ((xposn - last_xposn) / 2);
          else
            lw = me->get_bound (RIGHT)->relative_coordinate (xcommon, X_AXIS)
              - last_xposn;
@@ -485,20 +471,19 @@ Beam::print (SCM grob)
          for (int j = lfliebertjes.size (); j--;)
            {
              Stencil b (lhalf);
-             b.translate_axis (last_xposn -  x0, X_AXIS);
-             b.translate_axis (slope * (last_xposn-x0) + bdy * lfliebertjes[j], Y_AXIS);
-             the_beam.add_stencil (b);       
+             b.translate_axis (last_xposn - x0, X_AXIS);
+             b.translate_axis (slope * (last_xposn - x0) + bdy * lfliebertjes[j], Y_AXIS);
+             the_beam.add_stencil (b);
            }
          for (int j = rfliebertjes.size (); j--;)
            {
              Stencil b (rhalf);
-             b.translate_axis (xposn -  x0 - rw , X_AXIS);
-             b.translate_axis (slope * (xposn-x0 -rw) + bdy * rfliebertjes[j], Y_AXIS);
-             the_beam.add_stencil (b);       
+             b.translate_axis (xposn - x0 - rw, X_AXIS);
+             b.translate_axis (slope * (xposn - x0 -rw) + bdy * rfliebertjes[j], Y_AXIS);
+             the_beam.add_stencil (b);
            }
        }
 
-
       last_xposn = xposn;
       last_stem_width = stem_width;
       last_beaming = this_beaming;
@@ -512,7 +497,7 @@ Beam::print (SCM grob)
   if (to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
       && scm_is_string (quant_score))
     {
-      
+
       /*
        This code prints the demerits for each beam. Perhaps this
        should be switchable for those who want to twiddle with the
@@ -521,62 +506,61 @@ Beam::print (SCM grob)
       String str;
       SCM properties = Font_interface::text_font_alist_chain (me);
 
-      Direction stem_dir = stems.size() ? to_dir (stems[0]->get_property ("direction")) : UP;
-    
+      Direction stem_dir = stems.size () ? to_dir (stems[0]->get_property ("direction")) : UP;
+
       Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
-        (me->get_layout ()->self_scm (), properties, quant_score));
+                                   (me->get_layout ()->self_scm (), properties, quant_score));
       the_beam.add_at_edge (Y_AXIS, stem_dir, tm, 1.0, 0);
     }
 #endif
-  
+
   return the_beam.smobbed_copy ();
 }
-  
-
 
 
 Direction
-Beam::get_default_dir (Grob *me) 
+Beam::get_default_dir (Grob *me)
 {
   Drul_array<int> total;
-  total[UP]  = total[DOWN] = 0;
-  Drul_array<int> count; 
-  count[UP]  = count[DOWN] = 0;
+  total[UP] = total[DOWN] = 0;
+  Drul_array<int> count;
+  count[UP] = count[DOWN] = 0;
   Direction d = DOWN;
 
-  Link_array<Grob> stems =
-       extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    = extract_grob_array (me, ly_symbol2scm ("stems"));
 
   for (int i = 0; i < stems.size (); i++)
-    do {
-      Grob *s = stems[i];
-      Direction sd = get_grob_direction (s);
-
-      int center_distance = int (- d * Stem::head_positions (s) [-d]) >? 0;
-      int current = sd ? (1 + d * sd)/2 : center_distance;
+    do
+      {
+       Grob *s = stems[i];
+       Direction sd = get_grob_direction (s);
+
+       int center_distance = int (- d * Stem::head_positions (s) [-d]) >? 0;
+       int current = sd ? (1 + d * sd) / 2 : center_distance;
+
+       if (current)
+         {
+           total[d] += current;
+           count[d]++;
+         }
+      }
+    while (flip (&d) != DOWN);
 
-      if (current)
-       {
-         total[d] += current;
-         count[d] ++;
-       }
-    } while (flip (&d) != DOWN);
-  
   SCM func = me->get_property ("dir-function");
   SCM s = scm_call_2 (func,
-                   scm_cons (scm_int2num (count[UP]),
-                            scm_int2num (count[DOWN])),
-                   scm_cons (scm_int2num (total[UP]),
-                            scm_int2num (total[DOWN])));
+                     scm_cons (scm_int2num (count[UP]),
+                               scm_int2num (count[DOWN])),
+                     scm_cons (scm_int2num (total[UP]),
+                               scm_int2num (total[DOWN])));
 
   if (scm_is_number (s) && scm_to_int (s))
     return to_dir (s);
-  
+
   /* If dir is not determined: get default */
   return to_dir (me->get_property ("neutral-direction"));
 }
 
-
 /* Set all stems with non-forced direction to beam direction.
    Urg: non-forced should become `without/with unforced' direction,
    once stem gets cleaned-up. */
@@ -585,14 +569,14 @@ Beam::set_stem_directions (Grob *me, Direction d)
 {
   Link_array<Grob> stems
     = extract_grob_array (me, ly_symbol2scm ("stems"));
-  
+
   for (int i = 0; i <stems.size (); i++)
     {
       Grob *s = stems[i];
-  
+
       SCM forcedir = s->get_property ("direction");
       if (!to_dir (forcedir))
-       set_grob_direction (s,  d);
+       set_grob_direction (s, d);
     }
 }
 
@@ -601,28 +585,28 @@ Beam::set_stem_directions (Grob *me, Direction d)
   anything else is possible here, since we don't know funky-beaming
   settings, or X-distances (slopes!)  People that want sloped
   knee-beams, should set the directions manually.
- */
+*/
 void
-Beam::consider_auto_knees (Grobme)
+Beam::consider_auto_knees (Grob *me)
 {
   SCM scm = me->get_property ("auto-knee-gap");
   if (!scm_is_number (scm))
-    return ;
+    return;
 
   Interval_set gaps;
 
   gaps.set_full ();
 
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
-  
-  Grob *common = common_refpoint_of_array (stems, me,  Y_AXIS);
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
+
+  Grob *common = common_refpoint_of_array (stems, me, Y_AXIS);
   Real staff_space = Staff_symbol_referencer::staff_space (me);
-  
-  Array<Interval> head_positions_array;  
+
+  Array<Interval> head_positions_array;
   for (int i = 0; i < stems.size (); i++)
     {
-      Grobstem = stems[i];
+      Grob *stem = stems[i];
       if (Stem::is_invisible (stem))
        continue;
 
@@ -630,20 +614,20 @@ Beam::consider_auto_knees (Grob* me)
       if (!head_positions.is_empty ())
        {
          head_positions[LEFT] += -1;
-         head_positions[RIGHT] += 1; 
-         head_positions *= staff_space * 0.5 ;
+         head_positions[RIGHT] += 1;
+         head_positions *= staff_space * 0.5;
 
          /*
            We could subtract beam Y position, but this routine only
            sets stem directions, a constant shift does not have an
            influence.
-          */
+         */
          head_positions += stem->relative_coordinate (common, Y_AXIS);
 
          if (to_dir (stem->get_property ("direction")))
            {
              Direction stemdir = to_dir (stem->get_property ("direction"));
-             head_positions[-stemdir] = - stemdir * infinity_f;
+             head_positions[-stemdir] = -stemdir * infinity_f;
            }
        }
       head_positions_array.push (head_positions);
@@ -654,16 +638,16 @@ Beam::consider_auto_knees (Grob* me)
   Interval max_gap;
   Real max_gap_len = 0.0;
 
-  for (int i  = gaps.allowed_regions_.size () -1;  i >=  0 ; i--)
+  for (int i = gaps.allowed_regions_.size () -1; i >= 0; i--)
     {
       Interval gap = gaps.allowed_regions_[i];
 
       /*
        the outer gaps are not knees.
-       */
+      */
       if (isinf (gap[LEFT]) || isinf (gap[RIGHT]))
        continue;
-      
+
       if (gap.length () >= max_gap_len)
        {
          max_gap_len = gap.length ();
@@ -673,55 +657,51 @@ Beam::consider_auto_knees (Grob* me)
 
   Real beam_translation = get_beam_translation (me);
   Real beam_thickness = Beam::get_thickness (me);
-  int beam_count = Beam::get_beam_count (me);  
+  int beam_count = Beam::get_beam_count (me);
   Real height_of_beams = beam_thickness / 2
     + (beam_count - 1) * beam_translation;
-  Real threshold = scm_to_double (scm) +  height_of_beams;
-  
+  Real threshold = scm_to_double (scm) + height_of_beams;
+
   if (max_gap_len > threshold)
     {
       int j = 0;
       for (int i = 0; i < stems.size (); i++)
        {
-         Grobstem = stems[i];
+         Grob *stem = stems[i];
          if (Stem::is_invisible (stem))
            continue;
 
          Interval head_positions = head_positions_array[j++];
 
+         Direction d = (head_positions.center () < max_gap.center ()) ?
+           UP : DOWN;
 
-         Direction d =  (head_positions.center () < max_gap.center ()) ?
-           UP : DOWN ;
-         
          stem->set_property ("direction", scm_int2num (d));
-         
+
          head_positions.intersect (max_gap);
-         assert (head_positions.is_empty () || head_positions.length () < 1e-6 );
+         assert (head_positions.is_empty () || head_positions.length () < 1e-6);
        }
     }
 }
 
-
-
 /* Set stem's shorten property if unset.
 
- TODO:
-   take some y-position (chord/beam/nearest?) into account
-   scmify forced-fraction
-  This is done in beam because the shorten has to be uniform over the
-  entire beam.
+TODO:
+take some y-position (chord/beam/nearest?) into account
+scmify forced-fraction
 
+This is done in beam because the shorten has to be uniform over the
+entire beam.
 */
 void
 Beam::set_stem_shorten (Grob *me)
 {
   /*
     shortening looks silly for x staff beams
-   */
+  */
   if (is_knee (me))
-    return ;
-  
+    return;
+
   Real forced_fraction = 1.0 * forced_stem_count (me)
     / visible_stem_count (me);
 
@@ -732,9 +712,9 @@ Beam::set_stem_shorten (Grob *me)
     return;
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
-  
-  SCM shorten_elt =
-    robust_list_ref (beam_count -1, shorten_list);
+
+  SCM shorten_elt
+    robust_list_ref (beam_count -1, shorten_list);
   Real shorten_f = scm_to_double (shorten_elt) * staff_space;
 
   /* your similar cute comment here */
@@ -746,7 +726,6 @@ Beam::set_stem_shorten (Grob *me)
 
 /*  Call list of y-dy-callbacks, that handle setting of
     grob-properties
-
 */
 MAKE_SCHEME_CALLBACK (Beam, after_line_breaking, 1);
 SCM
@@ -762,9 +741,9 @@ void
 Beam::position_beam (Grob *me)
 {
   if (!me->is_live ())
-    return ;
+    return;
   if (to_boolean (me->get_property ("positioning-done")))
-    return ;
+    return;
 
   me->set_property ("positioning-done", SCM_BOOL_T);
 
@@ -780,36 +759,35 @@ Beam::position_beam (Grob *me)
        scm_call_1 (scm_car (i), me->self_scm ());
     }
 
-  set_stem_lengths (me);  
+  set_stem_lengths (me);
 }
 
-
 void
-set_minimum_dy (Grob *me, Real * dy)
+set_minimum_dy (Grob *me, Real *dy)
 {
   if (*dy)
     {
       /*
        If dy is smaller than the smallest quant, we
-       get absurd direction-sign penalties. 
+       get absurd direction-sign penalties.
       */
-         
+
       Real ss = Staff_symbol_referencer::staff_space (me);
-      Real thickness = Beam::get_thickness (me) / ss ;
+      Real thickness = Beam::get_thickness (me) / ss;
       Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
       Real sit = (thickness - slt) / 2;
       Real inter = 0.5;
       Real hang = 1.0 - (thickness - slt) / 2;
-         
+
       *dy = sign (*dy) * (fabs (*dy)
-                       >?
-                       (sit <? inter <? hang));
+                         >?
+                         (sit <? inter <? hang));
     }
 }
 
 /*
   Compute  a first approximation to the beam slope.
- */
+*/
 MAKE_SCHEME_CALLBACK (Beam, least_squares, 1);
 SCM
 Beam::least_squares (SCM smob)
@@ -818,45 +796,43 @@ Beam::least_squares (SCM smob)
 
   int count = visible_stem_count (me);
   Interval pos (0, 0);
-  
+
   if (count < 1)
     {
       me->set_property ("positions", ly_interval2scm (pos));
       return SCM_UNSPECIFIED;
     }
 
-
-  Array<Real> x_posns ;
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Array<Real> x_posns;
+  Link_array<Grob> stems
+    = extract_grob_array (me, ly_symbol2scm ("stems"));
   Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS);
-  Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);  
+  Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);
 
   Real my_y = me->relative_coordinate (commony, Y_AXIS);
-  
-  Grob *fvs  = first_visible_stem (me);
-  Grob *lvs  = last_visible_stem (me);
-  
+
+  Grob *fvs = first_visible_stem (me);
+  Grob *lvs = last_visible_stem (me);
+
   Interval ideal (Stem::get_stem_info (fvs).ideal_y_
                  + fvs->relative_coordinate (commony, Y_AXIS) -my_y,
                  Stem::get_stem_info (lvs).ideal_y_
                  + lvs->relative_coordinate (commony, Y_AXIS) - my_y);
-  
+
   Real x0 = first_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
   for (int i = 0; i < stems.size (); i++)
     {
-      Grobs = stems[i];
+      Grob *s = stems[i];
 
       Real x = s->relative_coordinate (commonx, X_AXIS) - x0;
       x_posns.push (x);
     }
   Real dx = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS) - x0;
 
-  
-  Real y = 0;  
+  Real y = 0;
   Real slope = 0;
   Real dy = 0;
-  
+
   if (!ideal.delta ())
     {
       Interval chord (Stem::chord_start_y (first_visible_stem (me)),
@@ -864,7 +840,7 @@ Beam::least_squares (SCM smob)
 
       /* Simple beams (2 stems) on middle line should be allowed to be
         slightly sloped.
-        
+
         However, if both stems reach middle line,
         ideal[LEFT] == ideal[RIGHT] and ideal.delta () == 0.
 
@@ -874,7 +850,7 @@ Beam::least_squares (SCM smob)
          /* FIXME. -> UP */
          Direction d = (Direction) (sign (chord.delta ()) * UP);
          pos[d] = get_thickness (me) / 2;
-         pos[-d] = - pos[d];
+         pos[-d] = -pos[d];
        }
       else
        {
@@ -894,7 +870,7 @@ Beam::least_squares (SCM smob)
       Array<Offset> ideals;
       for (int i = 0; i < stems.size (); i++)
        {
-         Grobs = stems[i];
+         Grob *s = stems[i];
          if (Stem::is_invisible (s))
            continue;
          ideals.push (Offset (x_posns[i],
@@ -902,34 +878,32 @@ Beam::least_squares (SCM smob)
                               + s->relative_coordinate (commony, Y_AXIS)
                               - my_y));
        }
-      
+
       minimise_least_squares (&slope, &y, ideals);
 
       dy = slope * dx;
 
       set_minimum_dy (me, &dy);
       me->set_property ("least-squares-dy", scm_make_real (dy));
-      pos = Interval (y, (y+dy));
+      pos = Interval (y, (y + dy));
     }
 
   /*
     "position" is relative to the staff.
-   */
-  scale_drul (&pos,  1/ Staff_symbol_referencer::staff_space (me)); 
-  
+  */
+  scale_drul (&pos, 1/ Staff_symbol_referencer::staff_space (me));
+
   me->set_property ("positions", ly_interval2scm (pos));
+
   return SCM_UNSPECIFIED;
 }
 
-
 /*
   We can't combine with previous function, since check concave and
   slope damping comes first.
 
   TODO: we should use the concaveness to control the amount of damping
   applied.
-  
 */
 MAKE_SCHEME_CALLBACK (Beam, shift_region_to_valid, 1);
 SCM
@@ -938,22 +912,22 @@ Beam::shift_region_to_valid (SCM grob)
   Grob *me = unsmob_grob (grob);
   /*
     Code dup.
-   */
-  Array<Real> x_posns ;
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  */
+  Array<Real> x_posns;
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
   Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS);
-  Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);  
+  Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);
 
   Grob *fvs = first_visible_stem (me);
 
   if (!fvs)
     return SCM_UNSPECIFIED;
-    
+
   Real x0 = fvs->relative_coordinate (commonx, X_AXIS);
   for (int i = 0; i < stems.size (); i++)
     {
-      Grobs = stems[i];
+      Grob *s = stems[i];
 
       Real x = s->relative_coordinate (commonx, X_AXIS) - x0;
       x_posns.push (x);
@@ -962,51 +936,50 @@ Beam::shift_region_to_valid (SCM grob)
   Grob *lvs = last_visible_stem (me);
   if (!lvs)
     return SCM_UNSPECIFIED;
-  
+
   Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0;
 
-  Drul_array<Real> pos = ly_scm2interval ( me->get_property ("positions"));
+  Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
+
+  scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
 
-  scale_drul (&pos,  Staff_symbol_referencer::staff_space (me));
-  
   Real dy = pos[RIGHT] - pos[LEFT];
   Real y = pos[LEFT];
-  Real slope = dy/dx;
+  Real slope = dy / dx;
 
-  
   /*
     Shift the positions so that we have a chance of finding good
     quants (i.e. no short stem failures.)
-   */
+  */
   Interval feasible_left_point;
   feasible_left_point.set_full ();
   for (int i = 0; i < stems.size (); i++)
     {
-      Grobs = stems[i];
+      Grob *s = stems[i];
       if (Stem::is_invisible (s))
        continue;
 
       Direction d = Stem::get_direction (s);
 
-      Real left_y =
-       Stem::get_stem_info (s).shortest_y_
+      Real left_y
+       Stem::get_stem_info (s).shortest_y_
        - slope * x_posns [i];
 
       /*
        left_y is now relative to the stem S. We want relative to
        ourselves, so translate:
-       */
-      left_y += 
-       + s->relative_coordinate (commony, Y_AXIS)
+      */
+      left_y
+       += + s->relative_coordinate (commony, Y_AXIS)
        - me->relative_coordinate (commony, Y_AXIS);
 
-      Interval flp ;
+      Interval flp;
       flp.set_full ();
       flp[-d] = left_y;
 
       feasible_left_point.intersect (flp);
     }
-      
+
   if (feasible_left_point.is_empty ())
     warning (_ ("no viable initial configuration found: may not find good beam slope"));
   else if (!feasible_left_point.contains (y))
@@ -1018,10 +991,10 @@ Beam::shift_region_to_valid (SCM grob)
       else
        y = feasible_left_point.center ();
     }
-  
-  pos = Drul_array<Real> (y, (y+dy));
+
+  pos = Drul_array<Real> (y, (y + dy));
   scale_drul (&pos, 1/ Staff_symbol_referencer::staff_space (me));
-  
+
   me->set_property ("positions", ly_interval2scm (pos));
   return SCM_UNSPECIFIED;
 }
@@ -1038,40 +1011,39 @@ Beam::slope_damping (SCM smob)
   if (visible_stem_count (me) <= 1)
     return SCM_UNSPECIFIED;
 
-  SCM s = me->get_property ("damping"); 
+  SCM s = me->get_property ("damping");
   Real damping = scm_to_double (s);
 
   if (damping)
     {
       Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
-      scale_drul (&pos,  Staff_symbol_referencer::staff_space (me));
-      
+      scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
+
       Real dy = pos[RIGHT] - pos[LEFT];
 
-      Grob *fvs  = first_visible_stem (me);
-      Grob *lvs  = last_visible_stem (me);
+      Grob *fvs = first_visible_stem (me);
+      Grob *lvs = last_visible_stem (me);
 
       Grob *commonx = fvs->common_refpoint (lvs, X_AXIS);
 
-
       Real dx = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS)
        - first_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
 
-      Real slope = dy && dx ? dy/dx : 0;
+      Real slope = dy && dx ? dy / dx : 0;
 
       Real concaveness = robust_scm2double (me->get_property ("concaveness"), 0.0);
-      
+
       slope = 0.6 * tanh (slope) / (damping + concaveness);
 
       Real damped_dy = slope * dx;
 
       set_minimum_dy (me, &damped_dy);
-      
+
       pos[LEFT] += (dy - damped_dy) / 2;
       pos[RIGHT] -= (dy - damped_dy) / 2;
 
-      scale_drul (&pos, 1/Staff_symbol_referencer::staff_space (me));
-      
+      scale_drul (&pos, 1 / Staff_symbol_referencer::staff_space (me));
+
       me->set_property ("positions", ly_interval2scm (pos));
     }
   return SCM_UNSPECIFIED;
@@ -1080,16 +1052,16 @@ Beam::slope_damping (SCM smob)
 /*
   Report slice containing the numbers that are both in (car BEAMING)
   and (cdr BEAMING)
- */
+*/
 Slice
 where_are_the_whole_beams (SCM beaming)
 {
-  Slice l; 
-  
-  for ( SCM s = scm_car (beaming); scm_is_pair (s) ; s = scm_cdr (s))
+  Slice l;
+
+  for (SCM s = scm_car (beaming); scm_is_pair (s); s = scm_cdr (s))
     {
       if (scm_c_memq (scm_car (s), scm_cdr (beaming)) != SCM_BOOL_F)
-       
+
        l.add_point (scm_to_int (scm_car (s)));
     }
 
@@ -1099,13 +1071,12 @@ where_are_the_whole_beams (SCM beaming)
 /* Return the Y position of the stem-end, given the Y-left, Y-right
    in POS for stem S.  This Y position is relative to S. */
 Real
-Beam::calc_stem_y (Grob *me, Grobs, Grob ** common,
+Beam::calc_stem_y (Grob *me, Grob *s, Grob ** common,
                   Real xl, Real xr,
-                  Drul_array<Real> pos, bool french) 
+                  Drul_array<Real> pos, bool french)
 {
   Real beam_translation = get_beam_translation (me);
 
-    
   Real r = s->relative_coordinate (common[X_AXIS], X_AXIS) - xl;
   Real dy = pos[RIGHT] - pos[LEFT];
   Real dx = xr - xl;
@@ -1113,10 +1084,10 @@ Beam::calc_stem_y (Grob *me, Grob* s, Grob ** common,
                       ? r / dx
                       * dy
                       : 0) + pos[LEFT];
-  
+
   Direction my_dir = get_grob_direction (s);
   SCM beaming = s->get_property ("beaming");
+
   Real stem_y = stem_y_beam0;
   if (french)
     {
@@ -1130,10 +1101,10 @@ Beam::calc_stem_y (Grob *me, Grob* s, Grob ** common,
       if (!bm.is_empty ())
        stem_y += bm[my_dir] * beam_translation;
     }
-  
+
   Real id = me->relative_coordinate (common[Y_AXIS], Y_AXIS)
     - s->relative_coordinate (common[Y_AXIS], Y_AXIS);
-  
+
   return stem_y + id;
 }
 
@@ -1144,19 +1115,19 @@ Beam::calc_stem_y (Grob *me, Grob* s, Grob ** common,
 void
 Beam::set_stem_lengths (Grob *me)
 {
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
 
   if (!stems.size ())
     return;
-  
+
   Grob *common[2];
   for (int a = 2; a--;)
     common[a] = common_refpoint_of_array (stems, me, Axis (a));
-  
+
   Drul_array<Real> pos = ly_scm2realdrul (me->get_property ("positions"));
   Real staff_space = Staff_symbol_referencer::staff_space (me);
-  scale_drul (&pos,  staff_space);
+  scale_drul (&pos, staff_space);
 
   bool gap = false;
   Real thick = 0.0;
@@ -1166,17 +1137,17 @@ Beam::set_stem_lengths (Grob *me)
       gap = true;
       thick = get_thickness (me);
     }
-      
+
   // ugh -> use commonx
-  Grob * fvs = first_visible_stem (me);
+  Grob *fvs = first_visible_stem (me);
   Grob *lvs = last_visible_stem (me);
-    
+
   Real xl = fvs ? fvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
   Real xr = lvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
-  
+
   for (int i = 0; i < stems.size (); i++)
     {
-      Grobs = stems[i];
+      Grob *s = stems[i];
       if (Stem::is_invisible (s))
        continue;
 
@@ -1188,7 +1159,7 @@ Beam::set_stem_lengths (Grob *me)
       /*
        Make the stems go up to the end of the beam. This doesn't matter
        for normal beams, but for tremolo beams it looks silly otherwise.
-       */
+      */
       if (gap)
        stem_y += thick * 0.5 * get_grob_direction (s);
 
@@ -1199,34 +1170,34 @@ Beam::set_stem_lengths (Grob *me)
 void
 Beam::set_beaming (Grob *me, Beaming_info_list *beaming)
 {
-  Link_array<Grob> stems =
-    extract_grob_array (me, ly_symbol2scm ("stems"));
-  
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
+
   Direction d = LEFT;
-  for (int i = 0; i  < stems.size (); i++)
+  for (int i = 0; i < stems.size (); i++)
     {
       /*
        Don't overwrite user settings.
-       */
-      
+      */
+
       do
        {
-         /* Don't set beaming for outside of outer stems */      
-         if ( (d == LEFT && i == 0)
+         /* Don't set beaming for outside of outer stems */
+         if ((d == LEFT && i == 0)
              || (d == RIGHT && i == stems.size () -1))
            continue;
 
-         Grob *st =  stems[i];
+         Grob *st = stems[i];
          SCM beaming_prop = st->get_property ("beaming");
-         if (beaming_prop == SCM_EOL ||
-             index_get_cell (beaming_prop, d) == SCM_EOL)
+         if (beaming_prop == SCM_EOL
+             || index_get_cell (beaming_prop, d) == SCM_EOL)
            {
              int b = beaming->infos_.elem (i).beams_i_drul_[d];
-             if (i>0
+             if (i > 0
                  && i < stems.size () -1
                  && Stem::is_invisible (st))
                b = b <? beaming->infos_.elem (i).beams_i_drul_[-d];
-             
+
              Stem::set_beaming (st, b, d);
            }
        }
@@ -1235,10 +1206,10 @@ Beam::set_beaming (Grob *me, Beaming_info_list *beaming)
 }
 
 int
-Beam::forced_stem_count (Grob *me) 
+Beam::forced_stem_count (Grob *me)
 {
-  Link_array<Grob>stems = 
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
   int f = 0;
   for (int i = 0; i < stems.size (); i++)
     {
@@ -1250,66 +1221,63 @@ Beam::forced_stem_count (Grob *me)
       /* I can imagine counting those boundaries as a half forced stem,
         but let's count them full for now. */
       if (abs (Stem::chord_start_y (s)) > 0.1
-        && (Stem::get_direction (s) != Stem::get_default_dir (s)))
-        f++;
+         && (Stem::get_direction (s) != Stem::get_default_dir (s)))
+       f++;
     }
   return f;
 }
 
 
-
-
 int
-Beam::visible_stem_count (Grob *me) 
+Beam::visible_stem_count (Grob *me)
 {
-  Link_array<Grob>stems = 
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
   int c = 0;
   for (int i = stems.size (); i--;)
     {
       if (!Stem::is_invisible (stems[i]))
-        c++;
+       c++;
     }
   return c;
 }
 
-Grob*
-Beam::first_visible_stem (Grob *me) 
+Grob *
+Beam::first_visible_stem (Grob *me)
 {
-  Link_array<Grob>stems = 
-    extract_grob_array (me, ly_symbol2scm ("stems"));
-  
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
+
   for (int i = 0; i < stems.size (); i++)
     {
       if (!Stem::is_invisible (stems[i]))
-        return stems[i];
+       return stems[i];
     }
   return 0;
 }
 
-Grob*
-Beam::last_visible_stem (Grob *me) 
+Grob *
+Beam::last_visible_stem (Grob *me)
 {
-  Link_array<Grob>stems = 
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
   for (int i = stems.size (); i--;)
     {
       if (!Stem::is_invisible (stems[i]))
-        return stems[i];
+       return stems[i];
     }
   return 0;
 }
 
-
 /*
   [TODO]
-  
+
   handle rest under beam (do_post: beams are calculated now)
   what about combination of collisions and rest under beam.
 
   Should lookup
-    
-    rest -> stem -> beam -> interpolate_y_position ()
+
+  rest -> stem -> beam -> interpolate_y_position ()
 */
 MAKE_SCHEME_CALLBACK (Beam, rest_collision_callback, 2);
 SCM
@@ -1320,7 +1288,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
 
   if (scm_is_number (rest->get_property ("staff-position")))
     return scm_int2num (0);
-  
+
   assert (a == Y_AXIS);
 
   Grob *st = unsmob_grob (rest->get_property ("stem"));
@@ -1340,27 +1308,26 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   Real staff_space = Staff_symbol_referencer::staff_space (rest);
 
   scale_drul (&pos, staff_space);
-  
 
   Real dy = pos[RIGHT] - pos[LEFT];
-  
+
   // ugh -> use commonx
   Real x0 = first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
   Real dx = last_visible_stem (beam)->relative_coordinate (0, X_AXIS) - x0;
-  Real slope = dy && dx ? dy/dx : 0;
-  
+  Real slope = dy && dx ? dy / dx : 0;
+
   Direction d = Stem::get_direction (stem);
   Real stem_y = pos[LEFT] + (stem->relative_coordinate (0, X_AXIS) - x0) * slope;
-  
+
   Real beam_translation = get_beam_translation (beam);
   Real beam_thickness = Beam::get_thickness (beam);
 
   /*
-    TODO: this is not strictly correct for 16th knee beams. 
-   */
-  int beam_count = 
-    Stem::beam_multiplicity (stem).length() + 1;
-  
+    TODO: this is not strictly correct for 16th knee beams.
+  */
+  int beam_count
+    = Stem::beam_multiplicity (stem).length () + 1;
+
   Real height_of_my_beams = beam_thickness / 2
     + (beam_count - 1) * beam_translation;
   Real beam_y = stem_y - d * height_of_my_beams;
@@ -1368,11 +1335,11 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   Grob *common_y = rest->common_refpoint (beam, Y_AXIS);
 
   Real rest_dim = rest->extent (common_y, Y_AXIS)[d];
-  Real minimum_distance =
-    + staff_space * (robust_scm2double (stem->get_property ("stemlet-length"), 0.0)
-                    + robust_scm2double (rest->get_property ("minimum-distance"), 0.0));
+  Real minimum_distance
+    + staff_space * (robust_scm2double (stem->get_property ("stemlet-length"), 0.0)
+                      + robust_scm2double (rest->get_property ("minimum-distance"), 0.0));
 
-  Real shift = d * ( ((beam_y - d * minimum_distance) - rest_dim) * d  <? 0.0);
+  Real shift = d * (((beam_y - d * minimum_distance) - rest_dim) * d <? 0.0);
 
   shift /= staff_space;
   Real rad = Staff_symbol_referencer::line_count (rest) * staff_space / 2;
@@ -1381,7 +1348,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   shift = ceil (fabs (shift * 2.0)) / 2.0 * sign (shift);
 
   /* Inside staff, move by whole spaces*/
-  if ( (rest->extent (common_y, Y_AXIS)[d] + staff_space * shift) * d
+  if ((rest->extent (common_y, Y_AXIS)[d] + staff_space * shift) * d
       < rad
       || (rest->extent (common_y, Y_AXIS)[-d] + staff_space * shift) * -d
       < rad)
@@ -1391,7 +1358,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
 }
 
 bool
-Beam::is_knee (Grobme)
+Beam::is_knee (Grob *me)
 {
   SCM k = me->get_property ("knee");
   if (scm_is_bool (k))
@@ -1409,41 +1376,38 @@ Beam::is_knee (Grob* me)
        }
       d = dir;
     }
-  
+
   me->set_property ("knee", ly_bool2scm (knee));
 
   return knee;
 }
 
 int
-Beam::get_direction_beam_count (Grob *me, Direction d )
+Beam::get_direction_beam_count (Grob *me, Direction d)
 {
-  Link_array<Grob>stems = 
-    extract_grob_array (me, ly_symbol2scm ("stems"));
+  Link_array<Grob> stems
+    extract_grob_array (me, ly_symbol2scm ("stems"));
   int bc = 0;
-  
+
   for (int i = stems.size (); i--;)
     {
       /*
        Should we take invisible stems into account?
-       */
+      */
       if (Stem::get_direction (stems[i]) == d)
-        bc = bc >? (Stem::beam_multiplicity (stems[i]).length () + 1);
+       bc = bc >? (Stem::beam_multiplicity (stems[i]).length () + 1);
     }
 
   return bc;
 }
 
-
 ADD_INTERFACE (Beam, "beam-interface",
               "A beam. \n\n"
               "The @code{thickness} property is the weight of beams, and is measured "
-              "in  staffspace"
-              ,
+              "in  staffspace",
               "knee positioning-done position-callbacks "
               "concaveness dir-function quant-score auto-knee-gap gap "
               "gap-count chord-tremolo beamed-stem-shorten shorten least-squares-dy "
               "damping inspect-quants flag-width-function neutral-direction positions space-function "
               "thickness");
 
-
index 6e3841330cd51afb2293e5844a88970def7d2694..1e2f3f4f4deea677ad4f331ae248a1d6bd6b2347 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-     beaming-info.cc -- implement Beaming_info, Beaming_info_list
-  
+/*
+  beaming-info.cc -- implement Beaming_info, Beaming_info_list
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "beaming.hh"
 
@@ -13,14 +12,14 @@ Beaming_info::Beaming_info ()
 {
   start_mom_ = 0;
   beams_i_drul_[LEFT] = 0;
-  beams_i_drul_[RIGHT] = 0;  
+  beams_i_drul_[RIGHT] = 0;
 }
 
 Beaming_info::Beaming_info (Moment m, int i)
 {
   start_mom_ = m;
   beams_i_drul_[LEFT] = i;
-  beams_i_drul_[RIGHT] = i;  
+  beams_i_drul_[RIGHT] = i;
 }
 
 const int infinity_i = INT_MAX;        // guh.
@@ -37,7 +36,7 @@ Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) c
     {
       beat_pos = infos_[i].start_mom_ / beat_length;
       int den = beat_pos.den ();
-      if (infos_[i].beams_i_drul_[LEFT] == infos_[i-1].beams_i_drul_[RIGHT] && !subdivide)
+      if (infos_[i].beams_i_drul_[LEFT] == infos_[i - 1].beams_i_drul_[RIGHT] && !subdivide)
        den *= 2;
       if (den < minden)
        {
@@ -46,7 +45,7 @@ Beaming_info_list::best_splitpoint_index (Moment &beat_length, bool subdivide) c
        }
     }
 
-  return minidx|(minden ==1 && subdivide ? at_beat : 0);
+  return minidx| (minden ==1 && subdivide ? at_beat : 0);
 }
 
 int
@@ -55,9 +54,9 @@ Beaming_info_list::beam_extend_count (Direction d) const
   if (infos_.size () == 1)
     return infos_[0].beams_i_drul_[d];
 
-  Beaming_info thisbeam  = infos_.boundary (d, 0);
-  Beaming_info next  = infos_.boundary (d, 1);
-  
+  Beaming_info thisbeam = infos_.boundary (d, 0);
+  Beaming_info next = infos_.boundary (d, 1);
+
   return thisbeam.beams_i_drul_[-d] <? next.beams_i_drul_[d];
 }
 
@@ -66,15 +65,15 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide)
 {
   if (infos_.size () <= 1)
     return;
-      
+
   Drul_array<Beaming_info_list> splits;
   int m = best_splitpoint_index (beat_length, subdivide);
-  bool split = subdivide && (m & at_beat);  m = m & ~at_beat;
+  bool split = subdivide && (m & at_beat); m = m & ~at_beat;
   splits[LEFT].infos_ = infos_.slice (0, m);
   splits[RIGHT].infos_ = infos_.slice (m, infos_.size ());
 
   Direction d = LEFT;
+
   do
     {
       splits[d].beamify (beat_length, subdivide);
index c7a26d9424a9fb4f01cc815d0a6984db3f01d862..6ef641134cd9fdad36c62cfae5fa7b952ac2b018 100644 (file)
 #include "misc.hh"
 #include "bezier.hh"
 
-
 static Real
 F0_1 (Real x)
 {
-  return 2 / M_PI * atan (M_PI * x / 2);
+  return 2 / M_PI *atan (M_PI *x / 2);
 }
 
 Real
@@ -24,17 +23,15 @@ slur_height (Real width, Real h_inf, Real r_0)
   return F0_1 (width * r_0 / h_inf) * h_inf;
 }
 
-  /*
-
-
-  ^              x                    x                  
+/*
+  ^              x                    x
   |
-height   <indent>
+  height   <indent>
   |
   v      x                                    x
 
-  
-  
+
+
   For small w, the height should be proportional to w, for w ->
   infinity, the height should rise to a limit asymptotically.
 
@@ -45,7 +42,7 @@ height   <indent>
 
   h = h_infinity * F (x * r_0 / h_infinity)
 
-  
+
   Examples:
 
   * F (x) = 2/pi * atan (pi x/2)
@@ -72,7 +69,7 @@ height   <indent>
 
   w -> 0,  G(w) -> .33 w
 
-  
+
   (due to derivative constraints, we cannot have indent > len/3)
 
   w -> inf, G(w) -> 2*h_inf
@@ -84,27 +81,25 @@ height   <indent>
 
   solve from
 
-   G(w) = r  + p/(w+q)
+  G(w) = r  + p/(w+q)
 
   yields
 
-   G(w) = 2 h_inf - max_fraction * q^2/ (w + q)
+  G(w) = 2 h_inf - max_fraction * q^2/ (w + q)
 
-  with q = 2 h_inf 
-  
-  
-  */
+  with q = 2 h_inf
+*/
 
 void
 get_slur_indent_height (Real *indent, Real *height,
                        Real width, Real h_inf, Real r_0)
 {
   Real max_fraction = 1.0 / 3.1;
-  *height =  slur_height (width, h_inf, r_0);
+  *height = slur_height (width, h_inf, r_0);
 
-  Real q = 2 * h_inf / max_fraction; 
-  *indent =
-    2 *h_inf - sqr (q) * max_fraction / (width + q);
+  Real q = 2 * h_inf / max_fraction;
+  *indent
+    2 *h_inf - sqr (q) * max_fraction / (width + q);
 }
 
 Bezier
@@ -112,9 +107,9 @@ slur_shape (Real width, Real h_inf, Real r_0)
 {
   Real indent;
   Real height;
-  
+
   get_slur_indent_height (&indent, &height,
-                         width,  h_inf,  r_0);
+                         width, h_inf, r_0);
 
   Bezier curve;
   curve.control_[0] = Offset (0, 0);
index de47a3b0de205e6e17c4243d4c2fef1372d46fcf..f28e18a7abaf9933925462e5d81d2cdd90256e04 100644 (file)
@@ -13,7 +13,7 @@
 #include "libc-extension.hh"
 
 Real
-binomial_coefficient (Real over , int under)
+binomial_coefficient (Real over, int under)
 {
   Real x = 1.0;
 
@@ -21,14 +21,14 @@ binomial_coefficient (Real over , int under)
     {
       x *= over / Real (under);
 
-      over  -= 1.0;
-      under --;
+      over -= 1.0;
+      under--;
     }
   return x;
 }
 
 void
-scale (Array<Offset>* array, Real x , Real y)
+scale (Array<Offset>* array, Real x, Real y)
 {
   for (int i = 0; i < array->size (); i++)
     {
@@ -53,17 +53,16 @@ translate (Array<Offset>* array, Offset o)
 }
 
 /*
-
   Formula of the bezier 3-spline
 
   sum_{j = 0}^3 (3 over j) z_j (1-t)^ (3-j)  t^j
 
 
   A is the axis of X coordinate.
- */
+*/
 
 Real
-Bezier::get_other_coordinate (Axis a,  Real x) const
+Bezier::get_other_coordinate (Axis a, Real x) const
 {
   Axis other = Axis ((a +1)%NO_AXES);
   Array<Real> ts = solve_point (a, x);
@@ -73,50 +72,48 @@ Bezier::get_other_coordinate (Axis a,  Real x) const
       programming_error ("No solution found for Bezier intersection.");
       return 0.0;
     }
-  
+
   Offset c = curve_point (ts[0]);
 
   if (fabs (c[a] - x) > 1e-8)
     programming_error ("Bezier intersection not correct?");
-  
+
   return c[other];
 }
 
-
 Offset
 Bezier::curve_point (Real t) const
 {
   Real tj = 1;
-  Real one_min_tj = (1-t)* (1-t)* (1-t);
+  Real one_min_tj = (1 - t)* (1 - t)* (1 - t);
 
   Offset o;
-  for (int j = 0 ; j < 4; j++)
+  for (int j = 0; j < 4; j++)
     {
       o += control_[j] * binomial_coefficient (3, j)
-       * pow (t, j) * pow (1-t, 3-j);
+       * pow (t, j) * pow (1 - t, 3 - j);
 
       tj *= t;
-      if (1-t)
-       one_min_tj /= (1-t);
+      if (1 - t)
+       one_min_tj /= (1 - t);
     }
 
 #ifdef PARANOID
   assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t))< 1e-8);
   assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t))< 1e-8);
 #endif
-  
+
   return o;
 }
 
-
 Polynomial
 Bezier::polynomial (Axis a) const
 {
   Polynomial p (0.0);
   for (int j = 0; j <= 3; j++)
     {
-      p +=
-       (control_[j][a] * binomial_coefficient (3, j))
+      p
+       += (control_[j][a] * binomial_coefficient (3, j))
        * Polynomial::power (j, Polynomial (0, 1))
        * Polynomial::power (3 - j, Polynomial (1, -1));
     }
@@ -126,7 +123,7 @@ Bezier::polynomial (Axis a) const
 
 /**
    Remove all numbers outside [0, 1] from SOL
- */
+*/
 Array<Real>
 filter_solutions (Array<Real> sol)
 {
@@ -138,7 +135,7 @@ filter_solutions (Array<Real> sol)
 
 /**
    find t such that derivative is proportional to DERIV
- */
+*/
 Array<Real>
 Bezier::solve_derivative (Offset deriv) const
 {
@@ -146,39 +143,38 @@ Bezier::solve_derivative (Offset deriv) const
   Polynomial yp = polynomial (Y_AXIS);
   xp.differentiate ();
   yp.differentiate ();
-  
+
   Polynomial combine = xp * deriv[Y_AXIS] - yp * deriv [X_AXIS];
 
   return filter_solutions (combine.solve ());
 }
-  
 
 /*
   Find t such that curve_point (t)[AX] == COORDINATE
 */
-Array<Real> 
+Array<Real>
 Bezier::solve_point (Axis ax, Real coordinate) const
 {
   Polynomial p (polynomial (ax));
   p.coefs_[0] -= coordinate;
-  
+
   Array<Real> sol (p.solve ());
   return filter_solutions (sol);
 }
 
 /**
    Compute the bounding box dimensions in direction of A.
- */
+*/
 Interval
 Bezier::extent (Axis a) const
 {
-  int o = (a+1)%NO_AXES;
+  int o = (a + 1)%NO_AXES;
   Offset d;
   d[Axis (o)] =1.0;
   Interval iv;
   Array<Real> sols (solve_derivative (d));
   sols.push (1.0);
-  sols.push (0.0);  
+  sols.push (0.0);
   for (int i = sols.size (); i--;)
     {
       Offset o (curve_point (sols[i]));
@@ -189,7 +185,7 @@ Bezier::extent (Axis a) const
 
 /**
    Flip around axis A
- */
+*/
 void
 Bezier::scale (Real x, Real y)
 {
@@ -228,6 +224,6 @@ Bezier::reverse ()
 {
   Bezier b2;
   for (int i = 0; i < CONTROL_COUNT; i++)
-    b2.control_[CONTROL_COUNT-i-1] = control_[i];
+    b2.control_[CONTROL_COUNT - i - 1] = control_[i];
   *this = b2;
 }
index cdd9bd621d90d25f7925c16cd6a29ad5ae17ce5c..3b5affd6c2d02f97e3edc0a69cb29792b5520544 100644 (file)
@@ -11,7 +11,7 @@
 #include "binary-source-file.hh"
 #include "string-convert.hh"
 
-Binary_source_file::Binary_source_file (Stringfile_name_string)
+Binary_source_file::Binary_source_file (String &file_name_string)
   : Source_file (file_name_string)
 {
 }
@@ -21,20 +21,20 @@ Binary_source_file::~Binary_source_file ()
 }
 
 String
-Binary_source_file::error_string (char constpos_str0) const
+Binary_source_file::error_string (char const *pos_str0) const
 {
   assert (this);
   if (!contains (pos_str0))
     return "";
 
-  char constbegin_str0 = pos_str0 - 8 >? to_str0 ();
-  char constend_str0 = pos_str0 + 7 <? to_str0 () + length ();
+  char const *begin_str0 = pos_str0 - 8 >? to_str0 ();
+  char const *end_str0 = pos_str0 + 7 <? to_str0 () + length ();
 
-  String pre_string ((Byte const*)begin_str0, pos_str0 - begin_str0);
+  String pre_string ((Byte const *)begin_str0, pos_str0 - begin_str0);
   pre_string = String_convert::bin2hex (pre_string);
   for (int i = 2; i < pre_string.length (); i += 3)
     pre_string = pre_string.left_string (i) + " " + pre_string.cut_string (i, INT_MAX);
-  String post_string ((Byte const*)pos_str0, end_str0 - pos_str0);
+  String post_string ((Byte const *)pos_str0, end_str0 - pos_str0);
   post_string = String_convert::bin2hex (post_string);
   for (int i = 2; i < post_string.length (); i += 3)
     post_string = post_string.left_string (i) + " " + post_string.cut_string (i, INT_MAX);
@@ -75,13 +75,13 @@ Binary_source_file::get_U16 ()
 
 /*
   naming is wrong. This is a UNIX-endian-32 (as opposed to xinu or ixun)
- */
+*/
 
 U32
 Binary_source_file::get_U32 ()
 {
   U32 b;
-  
+
   b = get_U8 () << 24;
   b |= get_U8 () << 16;
   b |= get_U8 () << 8;
@@ -90,4 +90,3 @@ Binary_source_file::get_U32 ()
   return b;
 }
 
-
index 058be63a9ecea87bd5e682938270c32134cc8eda..5c86770e3f69648ccd88af4be95b2e3012f74122 100644 (file)
 #include "score.hh"
 #include "ly-module.hh"
 
-LY_DEFINE(ly_make_book, "ly:make-book",
-         2, 0, 1, (SCM paper, SCM header, SCM scores),
-         "Make a \\book of @var{paper} and @var{header} (which may be #f as well)  "
-         "containing @code{\\scores}.")
+LY_DEFINE (ly_make_book, "ly:make-book",
+          2, 0, 1, (SCM paper, SCM header, SCM scores),
+          "Make a \\book of @var{paper} and @var{header} (which may be #f as well)  "
+          "containing @code{\\scores}.")
 {
-  Output_def * odef = unsmob_output_def (paper);
+  Output_def *odef = unsmob_output_def (paper);
   SCM_ASSERT_TYPE (odef, paper,
                   SCM_ARG1, __FUNCTION__, "Output_def");
 
index 4d764f3be35865d6e4971366b8111d0613f44032..7e3d29b77827cb9f772f61df521be4c194a713e9 100644 (file)
@@ -44,11 +44,11 @@ IMPLEMENT_DEFAULT_EQUAL_P (Book);
 SCM
 Book::mark_smob (SCM s)
 {
-  Book *book = (Book*) SCM_CELL_WORD_1 (s);
+  Book *book = (Book *) SCM_CELL_WORD_1 (s);
 
 #if 0
   if (book->key_)
-    scm_gc_mark (book->key_->self_scm());
+    scm_gc_mark (book->key_->self_scm ());
 #endif
 
   if (book->paper_)
@@ -83,15 +83,15 @@ Book::process (String outname, Output_def *default_def)
 
   Paper_book *paper_book = new Paper_book ();
   Real scale = scm_to_double (paper_->c_variable ("outputscale"));
-  Output_def * scaled_bookdef = scale_output_def (paper_, scale);
+  Output_def *scaled_bookdef = scale_output_def (paper_, scale);
 
-  Object_key * key = new Lilypond_general_key (0, user_key_, 0);
-  SCM  scm_key = key->self_scm();
+  Object_key *key = new Lilypond_general_key (0, user_key_, 0);
+  SCM scm_key = key->self_scm ();
   scm_gc_unprotect_object (scm_key);
-  
+
   paper_book->paper_ = scaled_bookdef;
-  scm_gc_unprotect_object (scaled_bookdef->self_scm());
-  
+  scm_gc_unprotect_object (scaled_bookdef->self_scm ());
+
   paper_book->header_ = header_;
 
   /* Render in order of parsing.  */
@@ -101,7 +101,7 @@ Book::process (String outname, Output_def *default_def)
        {
          SCM systems = score
            ->book_rendering (outname, paper_book->paper_, default_def, key);
-      
+
          /* If the score is empty, generate no output.  Should we do
             titling? */
          if (scm_is_vector (systems))
index 312252112d3748d850ebfbd63c58ad8854cabb89..bd15a691f9aeeda9a5483874d54e3d068dc05dbf 100644 (file)
@@ -24,17 +24,17 @@ Box::unite (Box b)
 }
 
 /**
-  Initialize to empty.
- */
+   Initialize to empty.
+*/
 Box::Box ()
-{        
+{
 }
 
 void
 Box::set_empty ()
 {
   interval_a_[X_AXIS].set_empty ();
-  interval_a_[Y_AXIS].set_empty (); 
+  interval_a_[Y_AXIS].set_empty ();
 }
 
 Box::Box (Interval ix, Interval iy)
@@ -66,14 +66,14 @@ void
 Box::add_point (Offset o)
 {
   interval_a_[X_AXIS].add_point (o[X_AXIS]);
-  interval_a_[Y_AXIS].add_point (o[Y_AXIS]);  
+  interval_a_[Y_AXIS].add_point (o[Y_AXIS]);
 }
 
 Offset
 Box::center () const
 {
   return Offset (interval_a_[X_AXIS].center (),
-                interval_a_[Y_AXIS].center ()); 
+                interval_a_[Y_AXIS].center ());
 }
 
 void
index e112e0a19d5d64551b49fdf01e594929c21526a2..4575d8410e826f11a1ba26814c87d77015a14cd8 100644 (file)
@@ -50,30 +50,30 @@ Break_algorithm::find_breaks () const
   return retval;
 }
 
-Simple_spacer_wrapper*
+Simple_spacer_wrapper *
 Break_algorithm::generate_spacing_problem (Link_array<Grob> const &curline,
                                           Interval line) const
 {
-  Simple_spacer_wrapper * spw =  new Simple_spacer_wrapper;
-  Simple_spacer * sp =  spw->spacer_;
-  
+  Simple_spacer_wrapper *spw = new Simple_spacer_wrapper;
+  Simple_spacer *sp = spw->spacer_;
+
   /*
     this is hardcoded, but this shouldn't happen anyway.
-    used to be get_dimension (ly_symbol2scm ("loose_column_distance"));        
-   */
+    used to be get_dimension (ly_symbol2scm ("loose_column_distance"));
+  */
   sp->default_space_ = 1.0;
   sp->indent_ = line[LEFT];
 
   /*
     sort out how interfacing this should work;
-   */
+  */
   if (line.is_empty ())
     {
-     sp->line_len_ = -1;
+      sp->line_len_ = -1;
     }
   else
     sp->line_len_ = line.length ();
-  
+
   spw->add_columns (curline);
   return spw;
 }
@@ -85,7 +85,7 @@ Break_algorithm::Break_algorithm ()
 }
 
 void
-Break_algorithm::set_pscore (Paper_score*s)
+Break_algorithm::set_pscore (Paper_score *s)
 {
   pscore_ = s;
   linewidth_ = s->layout_->get_dimension (ly_symbol2scm ("linewidth"));
@@ -95,7 +95,7 @@ Array<Column_x_positions>
 Break_algorithm::solve () const
 {
   Array<Column_x_positions> h= do_solve ();
-  
+
   return h;
 }
 
index 9903580b4a74804efaa49a922934d1130d9f1ce9..7309342dd690a96f59f52c67079010728d1bf671 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   break-align-engraver.cc -- implement Break_align_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 #include "engraver.hh"
 #include "protected-scm.hh"
 #include "break-align-interface.hh"
@@ -20,13 +19,13 @@ class Break_align_engraver : public Engraver
   SCM column_alist_;
   Item *left_edge_;
 
-  void add_to_group (SCM, Item*);
+  void add_to_group (SCM, Item *);
 protected:
   virtual void acknowledge_grob (Grob_info i);
   virtual void stop_translation_timestep ();
   virtual void derived_mark () const;
   void add_column (SCM);
-  
+
 public:
   TRANSLATOR_DECLARATIONS (Break_align_engraver);
 };
@@ -34,9 +33,9 @@ public:
 void
 Break_align_engraver::add_column (SCM smob)
 {
-  Grob * e = unsmob_grob (smob);
+  Grob *e = unsmob_grob (smob);
   Break_align_interface::add_element (align_, e);
-  
+
 }
 
 void
@@ -53,7 +52,6 @@ Break_align_engraver::stop_translation_timestep ()
   left_edge_ = 0;
 }
 
-
 Break_align_engraver::Break_align_engraver ()
 {
   column_alist_ = SCM_EOL;
@@ -70,58 +68,58 @@ Break_align_engraver::derived_mark () const
 void
 Break_align_engraver::acknowledge_grob (Grob_info inf)
 {
-  if (Item * item = dynamic_cast <Item *> (inf.grob_))
+  if (Item *item = dynamic_cast<Item *> (inf.grob_))
     {
       /*
        Removed check for item->empty (X_AXIS). --hwn 20/1/04
-       */
+      */
       if (item->get_parent (X_AXIS))
        return;
 
       SCM bp = item->get_property ("breakable");
       bool breakable = (to_boolean (bp));
       if (!breakable)
-       return ;
+       return;
 
       SCM align_name = item->get_property ("break-align-symbol");
       if (!scm_is_symbol (align_name))
-       return ;
+       return;
 
       if (!align_)
        {
          align_ = make_item ("BreakAlignment", SCM_EOL);
 
-         Context*origin = inf.origin_contexts (this)[0];
-         left_edge_ = make_item_from_properties (dynamic_cast<Engraver*> (origin->implementation ()),
+         Context *origin = inf.origin_contexts (this)[0];
+         left_edge_ = make_item_from_properties (dynamic_cast<Engraver *> (origin->implementation ()),
                                                  ly_symbol2scm ("LeftEdge"),
                                                  SCM_EOL,
                                                  "LeftEdge");
          add_to_group (left_edge_->get_property ("break-align-symbol"),
                        left_edge_);
        }
-      
+
       add_to_group (align_name, item);
     }
 }
 
 void
-Break_align_engraver::add_to_group (SCM align_name, Item*item)
+Break_align_engraver::add_to_group (SCM align_name, Item *item)
 {
   SCM s = scm_assoc (align_name, column_alist_);
-  Item * group = 0;
+  Item *group = 0;
 
   if (s != SCM_BOOL_F)
     {
-      Grob *e =  unsmob_grob (scm_cdr (s));
-      group = dynamic_cast<Item*> (e);
+      Grob *e = unsmob_grob (scm_cdr (s));
+      group = dynamic_cast<Item *> (e);
     }
   else
     {
-      group = make_item ("BreakAlignGroup", item->self_scm () );
+      group = make_item ("BreakAlignGroup", item->self_scm ());
 
       group->set_property ("break-align-symbol", align_name);
       group->set_parent (align_, Y_AXIS);
-         
+
       column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
 
     }
@@ -129,12 +127,11 @@ Break_align_engraver::add_to_group (SCM align_name, Item*item)
 }
 
 ADD_TRANSLATOR (Break_align_engraver,
-                  "Align grobs with corresponding @code{break-align-symbols} into "
-                  "groups, and order the groups according to @code{breakAlignOrder}. "
-                  "The left edge of the alignment gets a separate group, with a symbol @code{left-edge}. "
-                  ,
-                  /* creats*/       "BreakAlignment BreakAlignGroup LeftEdge",
-                  /* accepts */     "",
-                  /* acks  */       "break-aligned-interface",
-                  /* reads */       "",
-                  /* write */       "");
+               "Align grobs with corresponding @code{break-align-symbols} into "
+               "groups, and order the groups according to @code{breakAlignOrder}. "
+               "The left edge of the alignment gets a separate group, with a symbol @code{left-edge}. ",
+               /* creats*/ "BreakAlignment BreakAlignGroup LeftEdge",
+               /* accepts */ "",
+               /* acks  */ "break-aligned-interface",
+               /* reads */ "",
+               /* write */ "");
index 36966bcd139a95c2e26b0913b3a2bbca2a1ec92a..1b3daecdb32ec39cc35aa5bcb34ec51a08aaa9db 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #include <math.h>
 
 #include "break-align-interface.hh"
@@ -47,7 +46,7 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
   Axis a = (Axis) scm_to_int (axis);
   assert (a == X_AXIS);
 
-  Item* item = dynamic_cast<Item*> (me);
+  Item *item = dynamic_cast<Item *> (me);
   Direction bsd = item->break_status_dir ();
   if (bsd == LEFT)
     {
@@ -56,31 +55,29 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
 
   /*
     Force break alignment itself to be done first, in the case
-   */
+  */
   return Self_alignment_interface::aligned_on_self (element_smob, axis);
 }
 
-
 /*
   This is tricky: we cannot modify 'elements, since callers are
   iterating the same list. Reordering the list in-place, or resetting
   'elements will skip elements in the loops of callers.
 
   So we return the correct order as an array.
- */
+*/
 Link_array<Grob>
 Break_align_interface::ordered_elements (Grob *grob)
 {
-  Item *me = dynamic_cast<Item*> (grob);
+  Item *me = dynamic_cast<Item *> (grob);
   SCM elts = me->get_property ("elements");
   SCM order_vec = me->get_property ("break-align-orders");
   if (!scm_is_vector (order_vec)
       || scm_c_vector_length (order_vec) < 3)
-    return  extract_grob_array (me, ly_symbol2scm ("elements"));
+    return extract_grob_array (me, ly_symbol2scm ("elements"));
   SCM order = scm_vector_ref (order_vec,
                              scm_int2num (me->break_status_dir () + 1));
 
-
   /*
     Copy in order specified in BREAK-ALIGN-ORDER.
   */
@@ -111,8 +108,7 @@ Break_align_interface::add_element (Grob *me, Grob *toadd)
 void
 Break_align_interface::do_alignment (Grob *grob)
 {
-  Item * me = dynamic_cast<Item*> (grob);
-
+  Item *me = dynamic_cast<Item *> (grob);
 
   Link_array<Grob> elems = ordered_elements (me);
   Array<Interval> extents;
@@ -126,23 +122,22 @@ Break_align_interface::do_alignment (Grob *grob)
        last_nonempty = i;
     }
 
-  int idx  = 0;
-  while (idx < extents.size  () && extents[idx].is_empty ())
+  int idx = 0;
+  while (idx < extents.size () && extents[idx].is_empty ())
     idx++;
 
   Array<Real> offsets;
   offsets.set_size (elems.size ());
-  for (int i = 0; i < offsets.size ();i ++)
+  for (int i = 0; i < offsets.size ();i++)
     offsets[i] = 0.0;
 
-
   Real extra_right_space = 0.0;
   int edge_idx = -1;
   while (idx < elems.size ())
     {
-      int next_idx = idx+1;
-      while (next_idx < elems.size () &&
-            extents[next_idx].is_empty () )
+      int next_idx = idx + 1;
+      while (next_idx < elems.size ()
+            && extents[next_idx].is_empty ())
        next_idx++;
 
       Grob *l = elems[idx];
@@ -153,27 +148,26 @@ Break_align_interface::do_alignment (Grob *grob)
 
       SCM alist = SCM_EOL;
 
-
       /*
        Find the first grob with a space-alist entry.
-       */
+      */
       for (SCM s = l->get_property ("elements");
-          scm_is_pair (s) ; s = scm_cdr (s))
-         {
-           Grob *elt = unsmob_grob (scm_car (s));
-
-           if (edge_idx < 0
-               && elt->get_property ("break-align-symbol")
-               == ly_symbol2scm ( "left-edge"))
-             edge_idx = idx;
-
-           SCM l = elt->get_property ("space-alist");
-           if (scm_is_pair (l))
-             {
-               alist = l;
-               break;
-             }
-         }
+          scm_is_pair (s); s = scm_cdr (s))
+       {
+         Grob *elt = unsmob_grob (scm_car (s));
+
+         if (edge_idx < 0
+             && elt->get_property ("break-align-symbol")
+             == ly_symbol2scm ("left-edge"))
+           edge_idx = idx;
+
+         SCM l = elt->get_property ("space-alist");
+         if (scm_is_pair (l))
+           {
+             alist = l;
+             break;
+           }
+       }
 
       SCM rsym = r ? SCM_EOL : ly_symbol2scm ("right-edge");
 
@@ -185,12 +179,12 @@ Break_align_interface::do_alignment (Grob *grob)
       for (SCM s = r ? r->get_property ("elements") : SCM_EOL;
           !scm_is_symbol (rsym) && scm_is_pair (s); s = scm_cdr (s))
        {
-         Grob * elt = unsmob_grob (scm_car (s));
+         Grob *elt = unsmob_grob (scm_car (s));
 
          rsym = elt->get_property ("break-align-symbol");
        }
 
-      if (rsym  == ly_symbol2scm ("left-edge"))
+      if (rsym == ly_symbol2scm ("left-edge"))
        edge_idx = next_idx;
 
       SCM entry = SCM_EOL;
@@ -204,13 +198,13 @@ Break_align_interface::do_alignment (Grob *grob)
          if (scm_is_symbol (rsym))
            sym_string = ly_symbol2string (rsym);
 
-         String orig_string ;
+         String orig_string;
          if (unsmob_grob (l->get_property ("cause")))
            orig_string = unsmob_grob (l->get_property ("cause"))->name ();
 
          programming_error (_f ("No spacing entry from %s to `%s'",
-                               orig_string.to_str0 (),
-                               sym_string.to_str0 ()));
+                                orig_string.to_str0 (),
+                                sym_string.to_str0 ()));
        }
 
       Real distance = 1.0;
@@ -221,7 +215,7 @@ Break_align_interface::do_alignment (Grob *grob)
          entry = scm_cdr (entry);
 
          distance = scm_to_double (scm_cdr (entry));
-         type = scm_car (entry) ;
+         type = scm_car (entry);
        }
 
       if (r)
@@ -245,7 +239,7 @@ Break_align_interface::do_alignment (Grob *grob)
   Interval total_extent;
 
   Real alignment_off = 0.0;
-  for (int i = 0 ; i < offsets.size (); i++)
+  for (int i = 0; i < offsets.size (); i++)
     {
       here += offsets[i];
       if (i == edge_idx)
@@ -253,23 +247,21 @@ Break_align_interface::do_alignment (Grob *grob)
       total_extent.unite (extents[i] + here);
     }
 
-
   if (me->break_status_dir () == LEFT)
     {
-      alignment_off = - total_extent[RIGHT] - extra_right_space;
+      alignment_off = -total_extent[RIGHT] - extra_right_space;
     }
   else if (edge_idx < 0)
     alignment_off = -total_extent[LEFT];
 
   here = alignment_off;
-  for (int i = 0 ; i < offsets.size (); i++)
+  for (int i = 0; i < offsets.size (); i++)
     {
       here += offsets[i];
       elems[i]->translate_axis (here, X_AXIS);
     }
 }
 
-
 ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
               "Items that are aligned in prefatory matter.\n"
               "\n"
@@ -299,5 +291,3 @@ ADD_INTERFACE (Break_align_interface, "break-alignment-interface",
               "The object that performs break aligment. See @ref{break-aligned-interface}.",
               "positioning-done break-align-orders");
 
-
-
index 8c28b6fe8e6e9fa4817dd1c16a603d29b03c849e..9afd8f13eaa40e1681718283beb6943448dc28dd 100644 (file)
@@ -4,7 +4,7 @@
 #include "item.hh"
 #include "system.hh"
 
-static SCM break_criterion; 
+static SCM break_criterion;
 void
 set_break_subsititution (SCM criterion)
 {
@@ -12,14 +12,14 @@ set_break_subsititution (SCM criterion)
 }
 
 /*
-  Perform the substitution for a single grob.   
- */
+  Perform the substitution for a single grob.
+*/
 SCM
 substitute_grob (Grob *sc)
 {
   if (scm_is_integer (break_criterion))
     {
-      Item * i = dynamic_cast<Item*> (sc);
+      Item *i = dynamic_cast<Item *> (sc);
       Direction d = to_dir (break_criterion);
       if (i && i->break_status_dir () != d)
        {
@@ -29,14 +29,14 @@ substitute_grob (Grob *sc)
     }
   else
     {
-      System * line
-       = dynamic_cast<System*> (unsmob_grob (break_criterion));
+      System *line
+       = dynamic_cast<System *> (unsmob_grob (break_criterion));
       if (sc->get_system () != line)
        {
          sc = sc->find_broken_piece (line);
 
        }
-         
+
       /* now: !sc || (sc && sc->get_system () == line) */
       if (!sc)
        return SCM_UNDEFINED;
@@ -53,7 +53,7 @@ substitute_grob (Grob *sc)
 
        - it forces us to mark the parents of a grob, leading to
        a huge recursion in the GC routine.
-       */
+      */
 
       if (sc->common_refpoint (line, X_AXIS)
          && sc->common_refpoint (line, Y_AXIS))
@@ -66,8 +66,6 @@ substitute_grob (Grob *sc)
   return sc->self_scm ();
 }
 
-
-
 /*
   Do break substitution in S, using CRITERION. Return new value.
   CRITERION is either a SMOB pointer to the desired line, or a number
@@ -86,7 +84,7 @@ SCM
 do_break_substitution (SCM src)
 {
  again:
+
   if (unsmob_grob (src))
     return substitute_grob (unsmob_grob (src));
   else if (scm_is_vector (src))
@@ -97,28 +95,28 @@ do_break_substitution (SCM src)
        {
          SCM si = scm_int2num (i);
          scm_vector_set_x (nv, si,
-                           do_break_substitution (scm_vector_ref (src, si))); 
+                           do_break_substitution (scm_vector_ref (src, si)));
        }
     }
-  else if (scm_is_pair (src)) 
+  else if (scm_is_pair (src))
     {
       /*
        UGH! breaks on circular lists.
       */
       SCM newcar = do_break_substitution (scm_car (src));
       SCM oldcdr = scm_cdr (src);
-      
+
       if (newcar == SCM_UNDEFINED
          && (scm_is_pair (oldcdr) || oldcdr == SCM_EOL))
        {
          /*
-           This is tail-recursion, ie. 
-           
+           This is tail-recursion, ie.
+
            return do_break_substution (cdr);
 
            We don't want to rely on the compiler to do this.  Without
            tail-recursion, this easily crashes with a stack overflow.  */
-         src =  oldcdr;
+         src = oldcdr;
          goto again;
        }
 
@@ -130,17 +128,16 @@ do_break_substitution (SCM src)
   return src;
 }
 
-
 /*
   Perform substitution on GROB_LIST using a constant amount of stack.
- */
+*/
 SCM
 substitute_grob_list (SCM grob_list)
 {
   SCM l = SCM_EOL;
-  SCM * tail = &l;
+  SCM *tail = &l;
 
-  for (SCM s = grob_list; scm_is_pair (s); s =  scm_cdr (s))
+  for (SCM s = grob_list; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM n = substitute_grob (unsmob_grob (scm_car (s)));
 
@@ -158,9 +155,9 @@ substitute_grob_list (SCM grob_list)
   We don't do
 
   forall b in broken-childs:
-     forall p in properties:
-        forall g in p (if grob-list):
-         g := substitute (g)
+  forall p in properties:
+  forall g in p (if grob-list):
+  g := substitute (g)
 
   for spanners since this is O (SYSTEMCOUNT * GROBCOUNT), and SYSTEMCOUNT =
   O (GROBCOUNT), we have a quadratic algorithm. --for a single spanner
@@ -169,54 +166,51 @@ substitute_grob_list (SCM grob_list)
   significant; especially all-elements in System, can become huge. For
   a typical 50 page score, it requires running through a 100k list 50
   times.
-  
+
   Instead:
 
   forall p in properties:
-     (if grob list)  
+  (if grob list)
 
-     put  grob list in array,
+  put  grob list in array,
 
-     reorder array so spanners are separate -- O (grobcount)
-     
-     find first and last indexes of grobs on a specific system
+  reorder array so spanners are separate -- O (grobcount)
 
-     for items this is O (itemcount)
+  find first and last indexes of grobs on a specific system
 
-     for spanners this is O (sum-of spanner-system-ranges)
+  for items this is O (itemcount)
 
-     perform the substitution O (sum-of spanner-system-ranges)
+  for spanners this is O (sum-of spanner-system-ranges)
+
+  perform the substitution O (sum-of spanner-system-ranges)
 
 
   The complexity is harder to determine, but should be subquadratic;
 
   For the situation above, we run through the entire 100k list once,
   and also (more or less) once through the item part of the 100k (say
-  98k elements) of the list. 
+  98k elements) of the list.
 
 
-These timings were measured without -O2.
+  These timings were measured without -O2.
 
-  lehre, before 28.98 seconds, after: 27.91 seconds, 3.5 %. 
+  lehre, before 28.98 seconds, after: 27.91 seconds, 3.5 %.
 
   coriolan, before 2:30, after:  1:59. Increase of 20%.
 
   moz-k498-p1, before 24.10, after: 19.790s, Increase of 18%
-
-  
 */
 
-
 Slice
-spanner_system_range (Spannersp)
+spanner_system_range (Spanner *sp)
 {
   Slice rv;
-  
-  if (System*st = sp->get_system ())
+
+  if (System *st = sp->get_system ())
     {
       rv = Slice (st->rank_, st->rank_);
     }
-  else 
+  else
     {
       if (sp->broken_intos_.size ())
        rv = Slice (sp->broken_intos_[0]->get_system ()->rank_,
@@ -226,9 +220,9 @@ spanner_system_range (Spanner* sp)
 }
 
 Slice
-item_system_range (Itemit)
+item_system_range (Item *it)
 {
-  if (System*st = it->get_system ())
+  if (System *st = it->get_system ())
     return Slice (st->rank_, st->rank_);
 
   Slice sr;
@@ -240,30 +234,28 @@ item_system_range (Item* it)
        sr.add_point (bi->get_system ()->rank_);
     }
   while (flip (&d)!= LEFT);
-  
+
   return sr;
 }
 
 Slice
 grob_system_range (Grob *g)
 {
if (Spanner*s = dynamic_cast<Spanner*>(g))
-   return spanner_system_range (s);
else if (Item* it = dynamic_cast<Item*> (g))
-   return item_system_range (it);
- else
-   return Slice ();
 if (Spanner *s = dynamic_cast<Spanner *> (g))
+    return spanner_system_range (s);
 else if (Item *it = dynamic_cast<Item *> (g))
+    return item_system_range (it);
 else
+    return Slice ();
 }
 
-
-
 struct Substitution_entry
 {
-  Grob * grob_;
+  Grob *grob_;
   short left_;
   short right_;
-  
-  void set (Grob*g, Slice sr)
+
+  void set (Grob *g, Slice sr)
   {
     grob_ = g;
     /*
@@ -273,7 +265,7 @@ struct Substitution_entry
       {
        /*
          overflow if we don't treat this specially.
-        */
+       */
        left_ = 1;
        right_ = -1;
       }
@@ -288,25 +280,23 @@ struct Substitution_entry
     grob_ = 0;
     left_ = right_ = -2;
   }
-  
-  int length () { return right_ - left_ ; }
+
+  int length () { return right_ - left_; }
   static int
-  item_compare (void const * a , void const * b)
+  item_compare (void const *a, void const *b)
   {
-    return ((Substitution_entry*)a)->left_ -
-      ((Substitution_entry*)b)->left_;
+    return ((Substitution_entry *)a)->left_
+      - ((Substitution_entry *)b)->left_;
   }
+
   static int
-  spanner_compare (void const * a , void const * b)
+  spanner_compare (void const *a, void const *b)
   {
-    return ((Substitution_entry*)a)->length () -
-      ((Substitution_entry*)b)->length ();
+    return ((Substitution_entry *)a)->length ()
+      - ((Substitution_entry *)b)->length ();
   }
 };
-  
 
-    
 bool
 Spanner::fast_fubstitute_grob_list (SCM sym,
                                    SCM grob_list)
@@ -317,24 +307,23 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
     Only do this complicated thing for large lists. This has the added
     advantage that we won't screw up the ordering for elements in
     alignments (which typically don't have more than 10 grobs.)
-   */
-  
+  */
+
   if (len < 300)
     return false;
 
-
   /*
-    TODO : should not free it some time? 
-   */
-  static Substitution_entry * vec;
+    TODO : should not free it some time?
+  */
+  static Substitution_entry *vec;
   static int vec_room;
 
   if (vec_room < len)
     {
-      vec = (Substitution_entry*) realloc (vec, sizeof (Substitution_entry) * len);
+      vec = (Substitution_entry *) realloc (vec, sizeof (Substitution_entry) * len);
       vec_room = len;
     }
-  
+
   Slice system_range = spanner_system_range (this);
 
   Array<Slice> it_indices;
@@ -344,23 +333,22 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
       it_indices.push (Slice (len, 0));
       sp_indices.push (Slice (len, 0));
     }
-  
-  
+
   int sp_index = len;
   int it_index = 0;
   for (SCM s = grob_list; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * g = unsmob_grob (scm_car (s));
+      Grob *g = unsmob_grob (scm_car (s));
 
       Slice sr = grob_system_range (g);
       sr.intersect (system_range);
 
       int idx = 0;
-      if (dynamic_cast<Spanner*>(g))
+      if (dynamic_cast<Spanner *> (g))
        {
          idx =--sp_index;
        }
-      else if (dynamic_cast<Item*> (g))
+      else if (dynamic_cast<Item *> (g))
        {
          idx = it_index++;
        }
@@ -371,58 +359,58 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
   qsort (vec, it_index,
         sizeof (Substitution_entry), &Substitution_entry::item_compare);
 
- Array<Slice> *arrs[] = {
-       &it_indices, &sp_indices
- };
-        
- for (int i = 0; i < it_index ;i++)
-   {
-     for (int j = vec[i].left_; j <= vec[i].right_; j++)
-       {
-        it_indices[j - system_range[LEFT]].add_point (i);
-       }
-   }
-
- /*
-   sorting vec[sp_index.. len]
-   is a waste of time -- the staff-spanners screw up the
-   ordering, since they go across the entire score.
- */
- for (int i = sp_indices.size (); i--;)
-   sp_indices[i]= Slice (sp_index, len-1);
-
+  Array<Slice> *arrs[]
+    = {
+    &it_indices, &sp_indices
+  };
+
+  for (int i = 0; i < it_index;i++)
+    {
+      for (int j = vec[i].left_; j <= vec[i].right_; j++)
+       {
+         it_indices[j - system_range[LEFT]].add_point (i);
+       }
+    }
+
+  /*
+    sorting vec[sp_index.. len]
+    is a waste of time -- the staff-spanners screw up the
+    ordering, since they go across the entire score.
+  */
+  for (int i = sp_indices.size (); i--;)
+    sp_indices[i]= Slice (sp_index, len - 1);
+
   assert (it_index <= sp_index);
 
-  assert (broken_intos_.size () == system_range.length () + 1); 
+  assert (broken_intos_.size () == system_range.length () + 1);
   for (int i = 0; i < broken_intos_.size (); i++)
     {
-      Grob * sc = broken_intos_[i];
-      System * l = sc->get_system ();
+      Grob *sc = broken_intos_[i];
+      System *l = sc->get_system ();
       set_break_subsititution (l ? l->self_scm (): SCM_UNDEFINED);
 
       SCM newval = SCM_EOL;
-      SCM * tail = &newval;
+      SCM *tail = &newval;
 
-     for (int k = 0; k < 2;k++)
+      for (int k = 0; k < 2;k++)
        for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++)
          {
            SCM subs = substitute_grob (vec[j].grob_);
            if (subs!= SCM_UNDEFINED)
              {
                *tail = scm_cons (subs, SCM_EOL);
-               
+
                tail = SCM_CDRLOC (*tail);
              }
 
          }
-             
+
 #ifdef PARANOIA
-     
+
       printf ("%d (%d), sp %d (%d)\n",
              it_indices [i].length (), it_index,
-             sp_indices[i].length () , len -sp_index);
-             
+             sp_indices[i].length (), len -sp_index);
+
       {
        SCM l1 = substitute_grob_list (grob_list);
        assert (scm_ilength (l1) == scm_ilength (newval));
@@ -431,12 +419,12 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
 
       /*
        see below.
-       */
+      */
       if (sym == ly_symbol2scm ("all-elements"))
-         sc->mutable_property_alist_
-           = scm_assq_remove_x (sc->mutable_property_alist_,
-                            ly_symbol2scm ("all-elements"));
-      
+       sc->mutable_property_alist_
+         = scm_assq_remove_x (sc->mutable_property_alist_,
+                              ly_symbol2scm ("all-elements"));
+
       sc->mutable_property_alist_ = scm_acons (sym, newval,
                                               sc->mutable_property_alist_);
     }
@@ -444,7 +432,6 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
   return true;
 }
 
-
 /*
   Although the substitution can be written as
 
@@ -457,7 +444,7 @@ Spanner::fast_fubstitute_grob_list (SCM sym,
 
   This becomes a problem if lily is linked against guile with
   pthreads. pthreads impose small limits on the stack size.
- */
+*/
 SCM
 substitute_mutable_property_alist (SCM alist)
 {
@@ -476,13 +463,12 @@ substitute_mutable_property_alist (SCM alist)
       else
        val = do_break_substitution (val);
 
-
       if (val != SCM_UNDEFINED)
        {
          /*
            for ly:grob? properties, SCM_UNDEFINED could leak out
            through ly:grob-property
-          */
+         */
          *tail = scm_cons (scm_cons (sym, val), SCM_EOL);
          tail = SCM_CDRLOC (*tail);
        }
@@ -490,24 +476,23 @@ substitute_mutable_property_alist (SCM alist)
   return l;
 }
 
-
 void
 Spanner::substitute_one_mutable_property (SCM sym,
                                          SCM val)
 {
   SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?"));
-  Spanner*s = this;
-  
+  Spanner *s = this;
+
   bool fast_done = false;
   SCM grob_list_p = ly_lily_module_constant ("grob-list?");
   if (type == grob_list_p)
     fast_done = s->fast_fubstitute_grob_list (sym, val);
 
-  if (!fast_done)  
+  if (!fast_done)
     for (int i = 0; i < s->broken_intos_ .size (); i++)
       {
-       Grob * sc = s->broken_intos_[i];
-       System * l = sc->get_system ();
+       Grob *sc = s->broken_intos_[i];
+       System *l = sc->get_system ();
        set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
 
        SCM newval = (type == grob_list_p)
@@ -529,10 +514,10 @@ Spanner::substitute_one_mutable_property (SCM sym,
        if (sym == ly_symbol2scm ("all-elements"))
          sc->mutable_property_alist_
            = scm_assq_remove_x (sc->mutable_property_alist_,
-                            ly_symbol2scm ("all-elements"));
-       
+                                ly_symbol2scm ("all-elements"));
+
        sc->mutable_property_alist_ = scm_cons (scm_cons (sym, newval),
                                                sc->mutable_property_alist_);
       }
 }
-                                      
+
index e7a70c4301f263cf37e7d2f65cf700959e334491..ba23eede6d3179b589000798c7cabcb1e9950278 100644 (file)
@@ -5,12 +5,11 @@
 
   written for the GNU LilyPond music typesetter
 
-TODO:
+  TODO:
 
   . Cancel any beams running through the breathing sign
- ([e8 \breathe f e f] should become [e8] \breathe [f e f])
 ([e8 \breathe f e f] should become [e8] \breathe [f e f])
   . Spacing is not yet completely pretty
-
 */
 
 #include "staff-symbol-referencer.hh"
@@ -18,19 +17,19 @@ TODO:
 #include "engraver-group-engraver.hh"
 #include "item.hh"
 
-
-class Breathing_sign_engraver : public Engraver {
+class Breathing_sign_engraver : public Engraver
+{
 public:
   TRANSLATOR_DECLARATIONS (Breathing_sign_engraver);
-  
+
 protected:
   virtual bool try_music (Music *req);
   virtual void process_acknowledged_grobs ();
   virtual void stop_translation_timestep ();
 
 private:
-  Music * breathing_sign_req_;
-  Grob * breathing_sign_;
+  Music *breathing_sign_req_;
+  Grob *breathing_sign_;
 };
 
 Breathing_sign_engraver::Breathing_sign_engraver ()
@@ -40,7 +39,7 @@ Breathing_sign_engraver::Breathing_sign_engraver ()
 }
 
 bool
-Breathing_sign_engraver::try_music (Music*r)
+Breathing_sign_engraver::try_music (Music *r)
 {
   breathing_sign_req_ = r;
   return true;
@@ -56,18 +55,17 @@ Breathing_sign_engraver::process_acknowledged_grobs ()
     }
 }
 
-void 
+void
 Breathing_sign_engraver::stop_translation_timestep ()
 {
   breathing_sign_ = 0;
   breathing_sign_req_ = 0;
 }
 
-
 ADD_TRANSLATOR (Breathing_sign_engraver,
-/* descr */       "",
-/* creats*/       "BreathingSign",
-/* accepts */     "breathing-event",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "BreathingSign",
+               /* accepts */ "breathing-event",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
index ff34cc61133d93bc7ba1e2ebada35c29e4df11ab..e5814b4fac52b61142ab1a36671df5c971151ef8 100644 (file)
 
 /*
   TODO: thickness should be a grob property (unit: linethickness)
- rather than hardwired to (staff_space / 6).
- */
-
-  
+  rather than hardwired to (staff_space / 6).
+*/
 
 /*
   UGH : this is full of C&P code. Consolidate!  --hwn
@@ -35,9 +33,9 @@
 /*
   Gregorian chant divisio minima.  (Actually, this was the original
   breathing sign by Michael. -- jr)
- */
+*/
 MAKE_SCHEME_CALLBACK (Breathing_sign, divisio_minima, 1);
-SCM 
+SCM
 Breathing_sign::divisio_minima (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
@@ -68,9 +66,9 @@ Breathing_sign::divisio_minima (SCM smob)
 
 /*
   Gregorian chant divisio maior.
- */
+*/
 MAKE_SCHEME_CALLBACK (Breathing_sign, divisio_maior, 1);
-SCM 
+SCM
 Breathing_sign::divisio_maior (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
@@ -108,9 +106,9 @@ Breathing_sign::divisio_maior (SCM smob)
 
 /*
   Gregorian chant divisio maxima.
- */
+*/
 MAKE_SCHEME_CALLBACK (Breathing_sign, divisio_maxima, 1);
-SCM 
+SCM
 Breathing_sign::divisio_maxima (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
@@ -138,9 +136,9 @@ Breathing_sign::divisio_maxima (SCM smob)
 
 /*
   Gregorian chant finalis.
- */
+*/
 MAKE_SCHEME_CALLBACK (Breathing_sign, finalis, 1);
-SCM 
+SCM
 Breathing_sign::finalis (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
@@ -175,7 +173,7 @@ SCM
 Breathing_sign::offset_callback (SCM element_smob, SCM)
 {
   Grob *me = unsmob_grob (element_smob);
-  
+
   Direction d = get_grob_direction (me);
   if (!d)
     {
@@ -183,11 +181,11 @@ Breathing_sign::offset_callback (SCM element_smob, SCM)
       set_grob_direction (me, d);
     }
 
-  Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
-  int sz = Staff_symbol_referencer::line_count (me)-1;
+  Real inter_f = Staff_symbol_referencer::staff_space (me) / 2;
+  int sz = Staff_symbol_referencer::line_count (me) - 1;
   return scm_make_real (inter_f * sz * d);
 }
 
 ADD_INTERFACE (Breathing_sign, "breathing-sign-interface",
-             "A breathing sign.",
-             "direction");
+              "A breathing sign.",
+              "direction");
index 5099f8bdf62ed70dc572021a26e8d6dff622cb78..5a71519e5f62ac2413054d7bb2633ebcb2258f53 100644 (file)
@@ -19,13 +19,13 @@ Change_iterator::error (String reason)
   String to_type = ly_symbol2string (get_music ()->get_property ("change-to-type"));
   String to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
 
-  String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id) 
+  String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
     + ": " + reason;
 
   /*
     GUHG!
-   */
-  String warn2= "Change_iterator::process (): " 
+  */
+  String warn2= "Change_iterator::process (): "
     + get_outlet ()->context_name () + " = `"
     + get_outlet ()->id_string () + "': ";
   warning (warn2);
@@ -34,21 +34,20 @@ Change_iterator::error (String reason)
 
 /*
   move to construct_children ?
- */
+*/
 void
 Change_iterator::process (Moment m)
 {
-  Context * current = get_outlet ();
-  Context * last = 0;
+  Context *current = get_outlet ();
+  Context *last = 0;
 
   SCM to_type = get_music ()->get_property ("change-to-type");
-  String to_id =  ly_scm2string (get_music ()->get_property ("change-to-id"));
-
+  String to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
 
   /* find the type  of translator that we're changing.
-     
-     If \translator Staff = bass, then look for Staff = *
-   */
+
+  If \translator Staff = bass, then look for Staff = *
+  */
   while (current && !current->is_alias (to_type))
     {
       last = current;
@@ -60,18 +59,18 @@ Change_iterator::process (Moment m)
       String msg;
       msg += _ ("Can't switch translators, I'm there already");
     }
-  
-  if (current) 
+
+  if (current)
     if (last)
       {
-       Context * dest = 0;
-       Context * where = get_outlet ();
+       Context *dest = 0;
+       Context *where = get_outlet ();
        while (!dest && where)
          {
            dest = find_context_below (where, to_type, to_id);
            where = where->get_parent_context ();
          }
-       
+
        if (dest)
          {
            current->remove_context (last);
@@ -79,16 +78,16 @@ Change_iterator::process (Moment m)
          }
        else
          {
-           get_music ()->origin ()->warning  ("could not find context to switch to.");
+           get_music ()->origin ()->warning ("could not find context to switch to.");
          }
       }
     else
       {
        /*
-         We could change the current translator's id, but that would make 
+         We could change the current translator's id, but that would make
          errors hard to catch
-         
-          last->translator_id_string ()  = get_change ()->change_to_id_string ();
+
+         last->translator_id_string ()  = get_change ()->change_to_id_string ();
        */
        error (_ ("I'm one myself"));
       }
@@ -98,6 +97,4 @@ Change_iterator::process (Moment m)
   Simple_music_iterator::process (m);
 }
 
-
-
 IMPLEMENT_CTOR_CALLBACK (Change_iterator);
index af854701de11c8a35d7d7e9ead8bac5585a23868..73b3251b8fb137a9406ed226d84599c63f61600b 100644 (file)
@@ -17,9 +17,9 @@
 #include "context.hh"
 #include "warn.hh"
 
-class Chord_name_engraver : public Engraver 
+class Chord_name_engraver : public Engraver
 {
-  TRANSLATOR_DECLARATIONS ( Chord_name_engraver);
+  TRANSLATOR_DECLARATIONS (Chord_name_engraver);
 protected:
   virtual void stop_translation_timestep ();
   virtual void process_music ();
@@ -28,22 +28,20 @@ protected:
   virtual void derived_mark () const;
 private:
   void add_note (Music *);
-  
-  Itemchord_name_;
+
+  Item *chord_name_;
   Link_array<Music> notes_;
-  
+
   SCM last_chord_;
 };
 
-
-
 void
 Chord_name_engraver::finalize ()
 {
 }
 
 void
-Chord_name_engraver::derived_mark() const
+Chord_name_engraver::derived_mark () const
 {
   scm_gc_mark (last_chord_);
 }
@@ -55,7 +53,7 @@ Chord_name_engraver::Chord_name_engraver ()
 }
 
 void
-Chord_name_engraver::add_note (Music * n)
+Chord_name_engraver::add_note (Music *n)
 {
   notes_.push (n);
 }
@@ -63,21 +61,21 @@ Chord_name_engraver::add_note (Music * n)
 void
 Chord_name_engraver::process_music ()
 {
-  if (!notes_.size () )
+  if (!notes_.size ())
     return;
-  
+
   SCM bass = SCM_EOL;
   SCM inversion = SCM_EOL;
   SCM pitches = SCM_EOL;
 
-  Musicinversion_event = 0;
-  for (int i = 0 ; i < notes_.size (); i++)
+  Music *inversion_event = 0;
+  for (int i = 0; i < notes_.size (); i++)
     {
       Music *n = notes_[i];
       SCM p = n->get_property ("pitch");
       if (!unsmob_pitch (p))
        continue;
-      
+
       if (n->get_property ("inversion") == SCM_BOOL_T)
        {
          inversion_event = n;
@@ -95,9 +93,9 @@ Chord_name_engraver::process_music ()
       if (scm_is_number (oct))
        {
          Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
-         int octavation =  scm_to_int (oct);
+         int octavation = scm_to_int (oct);
          Pitch orig = p->transposed (Pitch (-octavation, 0, 0));
-         
+
          pitches = scm_cons (orig.smobbed_copy (), pitches);
        }
       else
@@ -111,15 +109,15 @@ Chord_name_engraver::process_music ()
                           context ()->self_scm ());
 
   /*
-    Ugh. 
-   */
+    Ugh.
+  */
   SCM chord_as_scm = scm_cons (pitches, scm_cons (bass, inversion));
-  
+
   chord_name_ = make_item ("ChordName", notes_[0]->self_scm ());
   chord_name_->set_property ("text", markup);
 
   SCM s = get_property ("chordChanges");
-  if (to_boolean (s) && scm_is_pair (last_chord_) 
+  if (to_boolean (s) && scm_is_pair (last_chord_)
       && ly_c_equal_p (chord_as_scm, last_chord_))
     chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
 
@@ -127,11 +125,11 @@ Chord_name_engraver::process_music ()
 }
 
 bool
-Chord_name_engraver::try_music (Musicm)
+Chord_name_engraver::try_music (Music *m)
 {
   /*
-    hmm. Should check? 
-   */
+    hmm. Should check?
+  */
   if (m->is_mus_type ("note-event"))
     {
       add_note (m);
@@ -152,11 +150,11 @@ Chord_name_engraver::stop_translation_timestep ()
   which properties are read depend on the chord naming function active.
 */
 ADD_TRANSLATOR (Chord_name_engraver,
-/* descr */       "Catch note-events "
-"and generate the appropriate chordname.",
-/* creats*/       "ChordName",
-/* accepts */     "note-event",
-/* acks  */      "",
-/* reads */       "chordChanges chordNameExceptions chordNameFunction "
-"chordNoteNamer chordRootNamer chordNameExceptions majorSevenSymbol",
-/* write */       "");
+               /* descr */ "Catch note-events "
+               "and generate the appropriate chordname.",
+               /* creats*/ "ChordName",
+               /* accepts */ "note-event",
+               /* acks  */ "",
+               /* reads */ "chordChanges chordNameExceptions chordNameFunction "
+               "chordNoteNamer chordRootNamer chordNameExceptions majorSevenSymbol",
+               /* write */ "");
index b5cb1e98dc73fdd5522f702d67ceaaee2c32a464..360edb564813c3aed5394165a2db6cf4cc40bf94 100644 (file)
@@ -19,19 +19,19 @@ MAKE_SCHEME_CALLBACK (Chord_name, after_line_breaking, 1);
 SCM
 Chord_name::after_line_breaking (SCM smob)
 {
-  Itemme = unsmob_item (smob);
+  Item *me = unsmob_item (smob);
   assert (me);
-    
+
   SCM s = me->get_property ("begin-of-line-visible");
   if (to_boolean (s))
     {
-      if (Paper_column::get_rank (me->get_column ()) -
-         me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
+      if (Paper_column::get_rank (me->get_column ())
+         me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
        me->suicide ();
     }
   return SCM_UNSPECIFIED;
 }
 
 ADD_INTERFACE (Chord_name, "chord-name-interface",
-  "A chord name.",
-  "begin-of-line-visible");
+              "A chord name.",
+              "begin-of-line-visible");
index 0e566b23c8ace5d12d7201cf503d53672adba204..bb84edc4bcb3007dd9df591e83ee870efb4954b6 100644 (file)
@@ -1,10 +1,9 @@
-/*   
-     chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver
-  
-     source file of the GNU LilyPond music typesetter
-  
-     (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
+/*
+  chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "beam.hh"
@@ -19,7 +18,7 @@
 #include "item.hh"
 #include "chord-tremolo-iterator.hh"
 #include "stem-tremolo.hh"
-#include "math.h"           // ceil
+#include "math.h" // ceil
 
 /**
 
@@ -34,31 +33,30 @@ create dependencies between engravers, which is bad.
 - create dots if appropriate.
 
 - create TremoloBeam iso Beam?
-
 */
 class Chord_tremolo_engraver : public Engraver
 {
   void typeset_beam ();
   TRANSLATOR_DECLARATIONS (Chord_tremolo_engraver);
 protected:
-  Music * repeat_;
+  Music *repeat_;
 
   /// moment (global time) where beam started.
   Moment start_mom_;
   Moment stop_mom_;
-  int flags_ ;
+  int flags_;
   int total_duration_flags_;
-  
+
   /// location  within measure where beam started.
   Moment beam_start_location_;
 
   bool body_is_sequential_;
-  Spanner * beam_;
-  Spanner * finished_beam_;
-  Item * stem_tremolo_;
+  Spanner *beam_;
+  Spanner *finished_beam_;
+  Item *stem_tremolo_;
 protected:
   virtual void finalize ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
@@ -67,7 +65,7 @@ protected:
 
 Chord_tremolo_engraver::Chord_tremolo_engraver ()
 {
-  beam_  = finished_beam_ = 0;
+  beam_ = finished_beam_ = 0;
   repeat_ = 0;
   flags_ = 0;
   stem_tremolo_ = 0;
@@ -75,18 +73,17 @@ Chord_tremolo_engraver::Chord_tremolo_engraver ()
 }
 
 bool
-Chord_tremolo_engraver::try_music (Music * m)
+Chord_tremolo_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("repeated-music")
       && m->get_property ("iterator-ctor") == Chord_tremolo_iterator::constructor_proc
-      && !repeat_) 
+      && !repeat_)
     {
       Moment l = m->get_length ();
       repeat_ = m;
       start_mom_ = now_mom ();
       stop_mom_ = start_mom_ + l;
 
-
       Music *body = Repeated_music::body (m);
       body_is_sequential_ = body->is_mus_type ("sequential-music");
 
@@ -99,14 +96,14 @@ Chord_tremolo_engraver::try_music (Music * m)
 
       if (elt_count <= 0)
        elt_count = 1;
-         
+
       Rational total_dur = l.main_part_;
       Rational note_dur = total_dur / Rational (elt_count * Repeated_music::repeat_count (repeat_));
 
       total_duration_flags_ = 0 >? (intlog2 (total_dur.den ()) - 2);
-      
-      flags_ = intlog2 (note_dur.den ()) -2 ;
-      
+
+      flags_ = intlog2 (note_dur.den ()) -2;
+
       return true;
     }
 
@@ -147,13 +144,13 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
 {
   if (beam_ && Stem::has_interface (info.grob_))
     {
-      Grob * s = info.grob_;
+      Grob *s = info.grob_;
 
       if (start_mom_ == now_mom ())
        Stem::set_beaming (s, flags_, RIGHT);
       else
        Stem::set_beaming (s, flags_, LEFT);
-         
+
       if (Stem::duration_log (s) != 1)
        {
          beam_->set_property ("gap-count", scm_int2num (flags_ - total_duration_flags_));
@@ -172,8 +169,8 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
            ::warning (s);
        }
     }
-  else if (repeat_ &&
-          flags_ && !body_is_sequential_ && Stem::has_interface (info.grob_))
+  else if (repeat_
+          && flags_ && !body_is_sequential_ && Stem::has_interface (info.grob_))
     {
       stem_tremolo_ = make_item ("StemTremolo", repeat_->self_scm ());
       stem_tremolo_->set_property ("flag-count",
@@ -184,7 +181,6 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
     }
 }
 
-
 void
 Chord_tremolo_engraver::start_translation_timestep ()
 {
@@ -196,7 +192,6 @@ Chord_tremolo_engraver::start_translation_timestep ()
     }
 }
 
-
 void
 Chord_tremolo_engraver::stop_translation_timestep ()
 {
@@ -211,12 +206,10 @@ Chord_tremolo_engraver::stop_translation_timestep ()
   typeset_beam ();
 }
 
-
-
 ADD_TRANSLATOR (Chord_tremolo_engraver,
-/* descr */       "Generates beams for  tremolo repeats.",
-/* creats*/       "Beam",
-/* accepts */     "repeated-music",
-/* acks  */      "stem-interface note-head-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Generates beams for  tremolo repeats.",
+               /* creats*/ "Beam",
+               /* accepts */ "repeated-music",
+               /* acks  */ "stem-interface note-head-interface",
+               /* reads */ "",
+               /* write */ "");
index 04590805ad81f5abb0b5954c494d4382ecf7baec..7301066d5ba164fa1bc984cc405cb8e640f9bcb5 100644 (file)
@@ -1,17 +1,15 @@
-/*   
+/*
   chord-tremolo-iterator.cc -- implement Chord_tremolo_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
 
+  (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 /*
   this is culled from various other iterators, but sharing code by
   subclassing proved to be too difficult.
- */
+*/
 
 #include "chord-tremolo-iterator.hh"
 
@@ -21,9 +19,9 @@
 void
 Chord_tremolo_iterator::construct_children ()
 {
-  Music *m = get_music();
-  
-  factor_  = Moment (Rational (1, 1));
+  Music *m = get_music ();
+
+  factor_ = Moment (Rational (1, 1));
   child_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (m)));
 }
 
@@ -48,7 +46,7 @@ Chord_tremolo_iterator::derived_mark () const
 }
 
 void
-Chord_tremolo_iterator::derived_substitute (Context *f, Context *t) 
+Chord_tremolo_iterator::derived_substitute (Context *f, Context *t)
 {
   if (child_iter_)
     child_iter_->substitute_outlet (f, t);
@@ -57,7 +55,7 @@ Chord_tremolo_iterator::derived_substitute (Context *f, Context *t)
 void
 Chord_tremolo_iterator::process (Moment m)
 {
-  if (!m.to_bool () )
+  if (!m.to_bool ())
     {
       Music_iterator *yeah = try_music (get_music ());
       if (yeah)
@@ -81,8 +79,8 @@ Chord_tremolo_iterator::ok () const
   return child_iter_ && child_iter_->ok ();
 }
 
-Music_iterator*
-Chord_tremolo_iterator::try_music_in_children (Music  *m) const
+Music_iterator *
+Chord_tremolo_iterator::try_music_in_children (Music *m) const
 {
   return child_iter_->try_music (m);
 }
index 0bdb8443c10b72d88ec0b222ed4b8580b028b5eb..86aa555336d2672b3e4f1861ab3f8fc6b30db3e9 100644 (file)
@@ -17,7 +17,7 @@
 #include "direction.hh"
 #include "side-position-interface.hh"
 
-class Clef_engraver : public  Engraver
+class Clef_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Clef_engraver);
@@ -29,8 +29,8 @@ protected:
   virtual void process_music ();
   virtual void acknowledge_grob (Grob_info);
 private:
-  Item * clef_;
-  Item * octavate_;
+  Item *clef_;
+  Item *octavate_;
 
   SCM prev_glyph_;
   SCM prev_cpos_;
@@ -48,7 +48,7 @@ Clef_engraver::Clef_engraver ()
 
   /*
     will trigger a clef at the start since #f != ' ()
-   */
+  */
   prev_cpos_ = prev_glyph_ = SCM_BOOL_F;
 }
 
@@ -59,25 +59,25 @@ Clef_engraver::set_glyph ()
   SCM glyph = get_property ("clefGlyph");
 
   SCM basic = ly_symbol2scm ("Clef");
-  
+
   execute_pushpop_property (context (), basic, glyph_sym, SCM_UNDEFINED);
   execute_pushpop_property (context (), basic, glyph_sym, glyph);
 }
 
-/** 
-  Generate a clef at the start of a measure. (when you see a Bar,
-  ie. a breakpoint) 
-  */
+/**
+   Generate a clef at the start of a measure. (when you see a Bar,
+   ie. a breakpoint)
+*/
 void
 Clef_engraver::acknowledge_grob (Grob_info info)
 {
-  Item * item = dynamic_cast <Item *> (info.grob_);
+  Item *item = dynamic_cast<Item *> (info.grob_);
   if (item)
     {
       if (Bar_line::has_interface (info.grob_)
          && scm_is_string (get_property ("clefGlyph")))
        create_clef ();
-    } 
+    }
 }
 
 void
@@ -86,7 +86,6 @@ Clef_engraver::create_clef ()
   if (!clef_)
     {
       Item *c = make_item ("Clef", SCM_EOL);
-      
 
       clef_ = c;
       SCM cpos = get_property ("clefPosition");
@@ -94,28 +93,28 @@ Clef_engraver::create_clef ()
       if (scm_is_number (cpos))
        clef_->set_property ("staff-position", cpos);
 
-      SCM oct =  get_property ("clefOctavation");
+      SCM oct = get_property ("clefOctavation");
       if (scm_is_number (oct) && scm_to_int (oct))
        {
-         Item * g = make_item ("OctavateEight", SCM_EOL);
+         Item *g = make_item ("OctavateEight", SCM_EOL);
 
-         int abs_oct = scm_to_int (oct) ;
+         int abs_oct = scm_to_int (oct);
          int dir = sign (abs_oct);
-         abs_oct = abs (abs_oct)  + 1;
+         abs_oct = abs (abs_oct) + 1;
 
          SCM txt = scm_number_to_string (scm_int2num (abs_oct),
                                          scm_from_int (10));
 
          g->set_property ("text",
                           scm_list_n (ly_lily_module_constant ("vcenter-markup"),
-                                      txt,  SCM_UNDEFINED));
-         Side_position_interface::add_support (g, clef_);      
+                                      txt, SCM_UNDEFINED));
+         Side_position_interface::add_support (g, clef_);
 
          g->set_parent (clef_, Y_AXIS);
          g->set_parent (clef_, X_AXIS);
          g->set_property ("direction", scm_int2num (dir));
          octavate_ = g;
-         
+
        }
     }
 }
@@ -132,7 +131,7 @@ Clef_engraver::inspect_clef_properties ()
   SCM clefpos = get_property ("clefPosition");
   SCM octavation = get_property ("clefOctavation");
   SCM force_clef = get_property ("forceClef");
-  
+
   if (clefpos == SCM_EOL
       || scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F
       || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F
@@ -151,18 +150,17 @@ Clef_engraver::inspect_clef_properties ()
 
   if (to_boolean (force_clef))
     {
-      Context * w = context ()->where_defined (ly_symbol2scm ("forceClef"));
+      Context *w = context ()->where_defined (ly_symbol2scm ("forceClef"));
       w->set_property ("forceClef", SCM_EOL);
     }
 }
 
-
 void
 Clef_engraver::stop_translation_timestep ()
 {
   if (clef_)
     {
-      SCM vis = 0; 
+      SCM vis = 0;
       if (to_boolean (clef_->get_property ("non-default")))
        {
          vis = get_property ("explicitClefVisibility");
@@ -177,19 +175,17 @@ Clef_engraver::stop_translation_timestep ()
 
            }
        }
-      
+
       clef_ = 0;
 
       octavate_ = 0;
     }
 }
 
-
-
 ADD_TRANSLATOR (Clef_engraver,
-/* descr */       "Determine and set reference point for pitches",
-/* creats*/       "Clef OctavateEight",
-/* accepts */     "",
-/* acks  */      "bar-line-interface",
-/* reads */       "clefPosition clefGlyph middleCPosition clefOctavation explicitClefVisibility forceClef",
-/* write */       "");
+               /* descr */ "Determine and set reference point for pitches",
+               /* creats*/ "Clef OctavateEight",
+               /* accepts */ "",
+               /* acks  */ "bar-line-interface",
+               /* reads */ "clefPosition clefGlyph middleCPosition clefOctavation explicitClefVisibility forceClef",
+               /* write */ "");
index 4f08375f2c0509fcdbfa5c621da26c8025672718..dafb09d4e54debc8b3cd1aa986baaf59d973f61a 100644 (file)
@@ -14,7 +14,7 @@
 #include "font-interface.hh"
 
 /*
- FIXME: should use symbol for #'style.
 FIXME: should use symbol for #'style.
 */
 MAKE_SCHEME_CALLBACK (Clef, before_line_breaking, 1);
 SCM
@@ -34,7 +34,7 @@ Clef::before_line_breaking (SCM smob)
          && !to_boolean (s->get_property ("full-size-change")))
        {
          str += "_change";
-         s->set_property ("glyph-name", scm_makfrom0str (str.to_str0 ()));     
+         s->set_property ("glyph-name", scm_makfrom0str (str.to_str0 ()));
        }
     }
 
@@ -42,7 +42,7 @@ Clef::before_line_breaking (SCM smob)
 }
 
 MAKE_SCHEME_CALLBACK (Clef, print, 1)
-SCM
+  SCM
 Clef::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
@@ -59,6 +59,6 @@ Clef::print (SCM smob)
 }
 
 ADD_INTERFACE (Clef, "clef-interface",
-  "A clef sign",
-  "non-default full-size-change glyph-name");
+              "A clef sign",
+              "non-default full-size-change glyph-name");
 
index ec65f0ef386140316958654907e6d71705b5fabf..02c7613cbcb8f699fb656a31f5bf173fe1e0170e 100644 (file)
@@ -18,17 +18,17 @@ class Cluster_spanner_engraver : public Engraver
 protected:
   TRANSLATOR_DECLARATIONS (Cluster_spanner_engraver);
   virtual bool try_music (Music *);
-  virtual void process_music ();  
+  virtual void process_music ();
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual void finalize ();
 private:
   Link_array<Music> cluster_notes_;
-  Itembeacon_;
+  Item *beacon_;
 
   void typeset_grobs ();
   Spanner *spanner_;
-  Spanner *finished_spanner_ ;
+  Spanner *finished_spanner_;
 };
 
 Cluster_spanner_engraver::Cluster_spanner_engraver ()
@@ -64,7 +64,7 @@ Cluster_spanner_engraver::try_music (Music *m)
     }
   else if (m->is_mus_type ("busy-playing-event"))
     return cluster_notes_.size ();
-  
+
   return false;
 }
 
@@ -75,31 +75,31 @@ Cluster_spanner_engraver::process_music ()
     {
       SCM c0scm = get_property ("middleCPosition");
 
-      int c0 =  scm_is_number (c0scm) ? scm_to_int (c0scm) : 0;
+      int c0 = scm_is_number (c0scm) ? scm_to_int (c0scm) : 0;
       int pmax = INT_MIN;
       int pmin = INT_MAX;
-      
+
       for (int i = 0; i <cluster_notes_.size (); i++)
        {
          Pitch *pit = unsmob_pitch (cluster_notes_[i]->get_property ("pitch"));
 
-         int p =pit ? pit->steps () : 0) + c0;
+         int p = (pit ? pit->steps () : 0) + c0;
 
          pmax = pmax >? p;
          pmin = pmin <? p;
        }
-      
+
       beacon_ = make_item ("ClusterSpannerBeacon", cluster_notes_[0]->self_scm ());
       beacon_->set_property ("positions",
-                                 scm_cons (scm_int2num (pmin),
-                                           scm_int2num (pmax)));
+                            scm_cons (scm_int2num (pmin),
+                                      scm_int2num (pmax)));
     }
 
   if (beacon_ && !spanner_)
-    {    
-      spanner_ = make_spanner ("ClusterSpanner", cluster_notes_[0]->self_scm () );
+    {
+      spanner_ = make_spanner ("ClusterSpanner", cluster_notes_[0]->self_scm ());
     }
-  
+
   if (beacon_ && spanner_)
     {
       add_bound_item (spanner_, beacon_);
@@ -107,7 +107,6 @@ Cluster_spanner_engraver::process_music ()
     }
 }
 
-
 void
 Cluster_spanner_engraver::stop_translation_timestep ()
 {
@@ -126,10 +125,10 @@ Cluster_spanner_engraver::acknowledge_grob (Grob_info info)
 }
 
 ADD_TRANSLATOR (Cluster_spanner_engraver,
-/* descr */    "Engraves a cluster using Spanner notation ",
-/* creats*/    "ClusterSpanner ClusterSpannerBeacon",
-/* accepts */  "cluster-note-event busy-playing-event",
-/* acks  */    "note-column-interface",
-/* reads */    "",
-/* write */    "");
+               /* descr */     "Engraves a cluster using Spanner notation ",
+               /* creats*/     "ClusterSpanner ClusterSpannerBeacon",
+               /* accepts */   "cluster-note-event busy-playing-event",
+               /* acks  */     "note-column-interface",
+               /* reads */     "",
+               /* write */     "");
 
index aec236de96c61cebb8cfa6361e6b0df34a34a6f1..945a7ad51dd79a670badcb8b89d296223b89dcad 100644 (file)
@@ -6,7 +6,6 @@
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
 
   Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
 */
 
 #include "cluster.hh"
 #include "output-def.hh"
 #include "warn.hh"
 
-
 /*
-   TODO: Add support for cubic spline segments.
-
- */
+  TODO: Add support for cubic spline segments.
+*/
 Stencil
 brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_points)
 {
-  Real blotdiameter = Staff_symbol_referencer::staff_space (me)/2;
+  Real blotdiameter = Staff_symbol_referencer::staff_space (me) / 2;
 
-  Real padding = robust_scm2double ( me->get_property ("padding"), 0.0);
+  Real padding = robust_scm2double (me->get_property ("padding"), 0.0);
 
   Offset vpadding = Offset (0, padding);
   Offset hpadding = Offset (0.5 * blotdiameter, 0);
@@ -48,10 +45,9 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
     {
       programming_error ("#'style should be symbol.");
       me->suicide ();
-      return  Stencil ();
+      return Stencil ();
     }
 
-
   Stencil out;
   Array<Offset> points;
   points.clear ();
@@ -63,7 +59,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
          Box box;
          box.add_point (bottom_points[i] - hvpadding);
          box.add_point (Offset (top_points[i + 1][X_AXIS],
-                               top_points[i][Y_AXIS]) + hvpadding);
+                                top_points[i][Y_AXIS]) + hvpadding);
          out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
        }
     }
@@ -73,7 +69,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
        {
          Box box;
          box.add_point (Offset (bottom_points[i][X_AXIS],
-                               bottom_points[i + 1][Y_AXIS]) - hvpadding);
+                                bottom_points[i + 1][Y_AXIS]) - hvpadding);
          box.add_point (top_points[i + 1] + hvpadding);
          out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
        }
@@ -83,22 +79,22 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
       Real left_xmid = bottom_points[0][X_AXIS];
       for (int i = 0; i < size - 1; i++)
        {
-         Real right_xmid =
-           0.5 * (bottom_points[i][X_AXIS] + bottom_points[i + 1][X_AXIS]);
+         Real right_xmid
+           0.5 * (bottom_points[i][X_AXIS] + bottom_points[i + 1][X_AXIS]);
          Box box;
-         box.add_point (Offset (left_xmid, bottom_points[i][Y_AXIS]) -
-                        hvpadding);
-         box.add_point (Offset (right_xmid, top_points[i][Y_AXIS]) +
-                        hvpadding);
+         box.add_point (Offset (left_xmid, bottom_points[i][Y_AXIS])
+                        hvpadding);
+         box.add_point (Offset (right_xmid, top_points[i][Y_AXIS])
+                        hvpadding);
          out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
          left_xmid = right_xmid;
        }
       Real right_xmid = bottom_points[size - 1][X_AXIS];
       Box box;
-      box.add_point (Offset (left_xmid, bottom_points[size - 1][Y_AXIS]) -
-                    hvpadding);
-      box.add_point (Offset (right_xmid, top_points[size - 1][Y_AXIS]) +
-                    hvpadding);
+      box.add_point (Offset (left_xmid, bottom_points[size - 1][Y_AXIS])
+                    hvpadding);
+      box.add_point (Offset (right_xmid, top_points[size - 1][Y_AXIS])
+                    hvpadding);
       out.add_stencil (Lookup::round_filled_box (box, blotdiameter));
     }
   else if (String::compare (shape, "ramp") == 0)
@@ -130,7 +126,7 @@ Cluster::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  Spanner *spanner = dynamic_cast<Spanner*> (me);
+  Spanner *spanner = dynamic_cast<Spanner *> (me);
   if (!spanner)
     {
       me->programming_error ("Cluster::print (): not a spanner");
@@ -141,32 +137,31 @@ Cluster::print (SCM smob)
   Item *right_bound = spanner->get_bound (RIGHT);
 
   Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS);
-  SCM cols  = me->get_property ("columns");
+  SCM cols = me->get_property ("columns");
 
   if (!scm_is_pair (cols))
     {
       me->warning ("junking empty cluster");
       me->suicide ();
-      
+
       return SCM_EOL;
     }
-  
+
   commonx = common_refpoint_of_list (cols, commonx, X_AXIS);
-  Grob * commony = common_refpoint_of_list (cols, me, Y_AXIS);
+  Grob *commony = common_refpoint_of_list (cols, me, Y_AXIS);
   Array<Offset> bottom_points;
   Array<Offset> top_points;
 
-
   Real left_coord = left_bound->relative_coordinate (commonx, X_AXIS);
 
   /*
     TODO: should we move the cluster a little to the right to be in
     line with the center of the note heads?
-    
-   */
+
+  */
   for (SCM s = cols; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * col = unsmob_grob (scm_car (s));
+      Grob *col = unsmob_grob (scm_car (s));
       Interval yext = col->extent (commony, Y_AXIS);
 
       Real x = col->relative_coordinate (commonx, X_AXIS) - left_coord;
@@ -176,23 +171,23 @@ Cluster::print (SCM smob)
 
   /*
     Across a line break we anticipate on the next pitches.
-   */
+  */
   if (spanner->original_)
     {
-      Spanner *orig = dynamic_cast<Spanner*> (spanner->original_);
-      
-      if (spanner->get_break_index () < orig->broken_intos_.size ()-1)
+      Spanner *orig = dynamic_cast<Spanner *> (spanner->original_);
+
+      if (spanner->get_break_index () < orig->broken_intos_.size () - 1)
        {
-         Spanner * next = orig->broken_intos_[spanner->get_break_index () + 1];
+         Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1];
          SCM cols = next->get_property ("columns");
          if (scm_is_pair (cols))
            {
              Grob *next_commony = common_refpoint_of_list (cols, next, Y_AXIS);
-             Grob * col = unsmob_grob (scm_car (scm_last_pair (cols)));
+             Grob *col = unsmob_grob (scm_car (scm_last_pair (cols)));
 
              Interval v = col->extent (next_commony, Y_AXIS);
              Real x = right_bound->relative_coordinate (commonx, X_AXIS) - left_coord;
-             
+
              bottom_points.insert (Offset (x, v[DOWN]), 0);
              top_points.insert (Offset (x, v[UP]), 0);
            }
@@ -208,17 +203,14 @@ Cluster::print (SCM smob)
 }
 
 ADD_INTERFACE (Cluster, "cluster-interface",
-              "A graphically drawn musical cluster. " 
+              "A graphically drawn musical cluster. "
               "\n\n"
               "@code{padding} adds to the vertical extent of the shape (top and "
               "bottom). \n\n"
               "The property @code{style} controls the shape of cluster segments.  Valid values "
               "include @code{leftsided-stairs}, @code{rightsided-stairs}, @code{centered-stairs}, "
-              "and @code{ramp}.\n"
-,
-  "style padding columns");
-
-
+              "and @code{ramp}.\n",
+              "style padding columns");
 
 struct Cluster_beacon
 {
@@ -237,10 +229,8 @@ Cluster_beacon::height (SCM g, SCM)
   return ly_interval2scm (Staff_symbol_referencer::staff_space (me) * 0.5 * v);
 }
 
-
-
-ADD_INTERFACE(Cluster_beacon,
-             "cluster-beacon-interface",
-             "A place holder for the cluster spanner to determine the vertical "
-             "extents of a cluster spanner at this X position.",
-             "positions");
+ADD_INTERFACE (Cluster_beacon,
+              "cluster-beacon-interface",
+              "A place holder for the cluster spanner to determine the vertical "
+              "extents of a cluster spanner at this X position.",
+              "positions");
index 6e4dbd80ad1ee8da9c3f59c41ce13ae4fb0da3a9..d4ae786cb50dada8493879af1710628c344e3e00 100644 (file)
@@ -1,10 +1,10 @@
 /*
   coherent-ligature-engraver.cc -- implement Coherent_ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
- */
+*/
 
 #include "coherent-ligature-engraver.hh"
 
  * add it to the spacing spanner code.
  */
 #if 0 // experimental code to collapse spacing after ligature
-      SCM incr_scm = lc->get_property ("forced-spacing");
-      if (incr_scm != SCM_EOL) /* (Paper_column::is_musical (l)) */
-       {
-         me->warning (_f ("gotcha: ptr=%ul", lc));//debug
-         ly_display_scm (lc->self_scm ());
-         Real distance;
-         if (incr_scm != SCM_EOL)
-           {
-             distance = scm_to_double (incr_scm);
-           }
-         else
-           {
-             me->warning ("distance undefined, assuming 0.1");
-             distance = 0.1;
-           }
-         me->warning (_f ("distance=%f", distance));//debug
-         Real strength = 1.0;
-         Spaceable_grob::add_spring (lc, rc, distance, strength);
-         if (Item *rb = r->find_prebroken_piece (LEFT))
-           Spaceable_grob::add_spring (lc, rb, distance, strength);
+SCM incr_scm = lc->get_property ("forced-spacing");
+if (incr_scm != SCM_EOL) /* (Paper_column::is_musical (l)) */
+  {
+    me->warning (_f ("gotcha: ptr=%ul", lc));//debug
+    ly_display_scm (lc->self_scm ());
+    Real distance;
+    if (incr_scm != SCM_EOL)
+      {
+       distance = scm_to_double (incr_scm);
+      }
+    else
+      {
+       me->warning ("distance undefined, assuming 0.1");
+       distance = 0.1;
+      }
+    me->warning (_f ("distance=%f", distance));//debug
+    Real strength = 1.0;
+    Spaceable_grob::add_spring (lc, rc, distance, strength);
+    if (Item *rb = r->find_prebroken_piece (LEFT))
+      Spaceable_grob::add_spring (lc, rb, distance, strength);
 
-         continue;
-       }
+    continue;
+  }
 #endif
 
 Coherent_ligature_engraver::Coherent_ligature_engraver ()
@@ -113,7 +113,7 @@ Coherent_ligature_engraver::Coherent_ligature_engraver ()
 void
 Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column)
 {
-  Item *parent = dynamic_cast<Item*> (item->get_parent (X_AXIS));
+  Item *parent = dynamic_cast<Item *> (item->get_parent (X_AXIS));
   if (!parent)
     {
       programming_error ("failed tweaking paper column in ligature");
@@ -131,8 +131,8 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column)
           tail = scm_cdr (tail))
        {
          Item *sibling = unsmob_item (scm_car (tail));
-         if ((sibling) &&
-             (Staff_symbol_referencer::get_staff_symbol (sibling) == sl))
+         if ((sibling)
+             && (Staff_symbol_referencer::get_staff_symbol (sibling) == sl))
            {
 #if 0 // experimental code to collapse spacing after ligature
              Grob *sibling_parent = sibling->get_parent (X_AXIS);
@@ -140,7 +140,7 @@ Coherent_ligature_engraver::get_set_column (Item *item, Paper_column *column)
                                           "setting `spacing-increment="
                                           "0.01': ptr=%ul", parent));
              sibling_parent->set_property ("forced-spacing",
-                                             scm_make_real (0.01));
+                                           scm_make_real (0.01));
 #endif
              sibling->set_parent (column, X_AXIS);
            }
@@ -175,20 +175,21 @@ compute_delta_pitches (Array<Grob_info> primitives)
   int prev_pitch = 0;
   int delta_pitch = 0;
   Item *prev_primitive = 0, *primitive = 0;
-  for (int i = 0; i < primitives.size (); i++) {
-    primitive = dynamic_cast<Item*> (primitives[i].grob_);
-    Music *music_cause = primitives[i].music_cause ();
-    int pitch =
-      unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
-    if (prev_primitive)
-      {
-       delta_pitch = pitch - prev_pitch;
-       prev_primitive->set_property ("delta-pitch",
-                                          scm_int2num (delta_pitch));
-      }
-    prev_pitch = pitch;
-    prev_primitive = primitive;
-  }
+  for (int i = 0; i < primitives.size (); i++)
+    {
+      primitive = dynamic_cast<Item *> (primitives[i].grob_);
+      Music *music_cause = primitives[i].music_cause ();
+      int pitch
+       = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
+      if (prev_primitive)
+       {
+         delta_pitch = pitch - prev_pitch;
+         prev_primitive->set_property ("delta-pitch",
+                                       scm_int2num (delta_pitch));
+       }
+      prev_pitch = pitch;
+      prev_primitive = primitive;
+    }
   primitive->set_property ("delta-pitch", scm_int2num (0));
 }
 
@@ -214,9 +215,9 @@ Coherent_ligature_engraver::typeset_ligature (Spanner *ligature,
 }
 
 ADD_TRANSLATOR (Coherent_ligature_engraver,
-/* descr */       "This is an abstract class.  Subclasses such as Gregorian_ligature_engraver handle ligatures by glueing special ligature heads together.",
-/* creats*/       "",
-/* accepts */     "ligature-event",
-/* acks  */      "note-head-interface rest-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "This is an abstract class.  Subclasses such as Gregorian_ligature_engraver handle ligatures by glueing special ligature heads together.",
+               /* creats*/ "",
+               /* accepts */ "ligature-event",
+               /* acks  */ "note-head-interface rest-interface",
+               /* reads */ "",
+               /* write */ "");
index 22cfd55171103e379f78115736ddc8bfd105dc8f..a277540df3aceb8c6ebbd621166404f40b135181 100644 (file)
@@ -14,7 +14,7 @@
 
 class Collision_engraver : public Engraver
 {
-  Item * col_;
+  Item *col_;
   Link_array<Grob> note_columns_;
 
 protected:
@@ -25,18 +25,17 @@ public:
   TRANSLATOR_DECLARATIONS (Collision_engraver);
 };
 
-
 void
 Collision_engraver::process_acknowledged_grobs ()
 {
   if (col_ || note_columns_.size () < 2)
-    return ;
-  if (!col_) 
+    return;
+  if (!col_)
     {
       col_ = make_item ("NoteCollision", SCM_EOL);
-      
+
     }
-  
+
   for (int i = 0; i< note_columns_.size (); i++)
     Note_collision_interface::add_column (col_, note_columns_[i]);
 }
@@ -48,7 +47,7 @@ Collision_engraver::acknowledge_grob (Grob_info i)
     {
       /*should check Y axis? */
       if (Note_column::has_rests (i.grob_) || i.grob_->get_parent (X_AXIS))
-       return ;
+       return;
 
       note_columns_.push (i.grob_);
     }
@@ -67,12 +66,10 @@ Collision_engraver::Collision_engraver ()
 }
 
 
-
-
 ADD_TRANSLATOR (Collision_engraver,
-/* descr */       "Collect NoteColumns, and as soon as there are two or more, put them in a NoteCollision object.",
-/* creats*/       "NoteCollision",
-/* accepts */     "",
-/* acks  */      "note-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Collect NoteColumns, and as soon as there are two or more, put them in a NoteCollision object.",
+               /* creats*/ "NoteCollision",
+               /* accepts */ "",
+               /* acks  */ "note-column-interface",
+               /* reads */ "",
+               /* write */ "");
index 9d17deaf624be77df9401b216922100a1c3e9af4..0c9631afab2eee92fcca4738c2fae41762de5d88 100644 (file)
 #include "global-context.hh"
 
 /*
-TODO: make matching rest engraver.
+  TODO: make matching rest engraver.
 */
 
 /*
-
   How does this work?
 
   When we catch the note, we predict the end of the note. We keep the
@@ -34,7 +33,7 @@ TODO: make matching rest engraver.
   figure out how long the note to typeset should be. It should be no
   longer than what's specified, than what is left to do and it should
   not cross barlines.
-  
+
   We copy the reqs into scratch note reqs, to make sure that we get
   all durations exactly right.
 */
@@ -44,7 +43,7 @@ class Completion_heads_engraver : public Engraver
   Link_array<Item> notes_;
   Link_array<Item> prev_notes_;
   Link_array<Grob> ties_;
-  
+
   Link_array<Item> dots_;
   Link_array<Music> note_reqs_;
   Link_array<Music> scratch_note_reqs_;
@@ -53,17 +52,17 @@ class Completion_heads_engraver : public Engraver
   bool is_first_;
   Rational left_to_do_;
   Rational do_nothing_until_;
-  
+
   Moment next_barline_moment ();
   Duration find_nearest_duration (Rational length);
-  
+
 public:
   TRANSLATOR_DECLARATIONS (Completion_heads_engraver);
 
 protected:
   virtual void initialize ();
   virtual void start_translation_timestep ();
-  virtual bool try_music (Music *req) ;
+  virtual bool try_music (Music *req);
   virtual void process_music ();
   virtual void stop_translation_timestep ();
 };
@@ -75,7 +74,7 @@ Completion_heads_engraver::initialize ()
 }
 
 bool
-Completion_heads_engraver::try_music (Music *m) 
+Completion_heads_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
@@ -87,28 +86,28 @@ Completion_heads_engraver::try_music (Music *m)
 
       if (now_mom ().grace_part_)
        {
-         musiclen.grace_part_ = musiclen.main_part_ ;
+         musiclen.grace_part_ = musiclen.main_part_;
          musiclen.main_part_ = Rational (0, 1);
        }
-      note_end_mom_  = note_end_mom_ >? (now + musiclen);
+      note_end_mom_ = note_end_mom_ >? (now + musiclen);
       do_nothing_until_ = Rational (0, 0);
-      
+
       return true;
     }
-  else if  (m->is_mus_type ("busy-playing-event"))
+  else if (m->is_mus_type ("busy-playing-event"))
     {
-      return note_reqs_.size() && is_first_;
+      return note_reqs_.size () && is_first_;
     }
-  
+
   return false;
-  
+
 }
 
 /*
   The duration _until_ the next barline.
- */
+*/
 Moment
-Completion_heads_engraver::next_barline_moment ( )
+Completion_heads_engraver::next_barline_moment ()
 {
   Moment *e = unsmob_moment (get_property ("measurePosition"));
   Moment *l = unsmob_moment (get_property ("measureLength"));
@@ -121,7 +120,7 @@ Completion_heads_engraver::next_barline_moment ( )
   return (*l - *e);
 }
 
-Duration  
+Duration
 Completion_heads_engraver::find_nearest_duration (Rational length)
 {
   int log_limit = 6;
@@ -152,7 +151,7 @@ Completion_heads_engraver::find_nearest_duration (Rational length)
       // scale up.
       d = d.compressed (length / d.get_length ());
     }
-  
+
   return d;
 }
 
@@ -160,14 +159,14 @@ void
 Completion_heads_engraver::process_music ()
 {
   if (!is_first_ && !left_to_do_)
-    return ;
-  
+    return;
+
   is_first_ = false;
 
-  Moment now =  now_mom ();
+  Moment now = now_mom ();
   if (do_nothing_until_ > now.main_part_)
-    return ;
-  
+    return;
+
   Duration note_dur;
   Duration *orig = 0;
   if (left_to_do_)
@@ -186,7 +185,7 @@ Completion_heads_engraver::process_music ()
 
       Moment next = now;
       next.main_part_ += note_dur.get_length ();
-      
+
       get_global_context ()->add_moment_to_process (next);
       do_nothing_until_ = next.main_part_;
     }
@@ -201,37 +200,36 @@ Completion_heads_engraver::process_music ()
       if (!scratch_note_reqs_.size ())
        for (int i = 0; i < note_reqs_.size (); i++)
          {
-           Music * m = note_reqs_[i]->clone ();
+           Music *m = note_reqs_[i]->clone ();
            scratch_note_reqs_.push (m);
          }
     }
 
-  
   for (int i = 0;
        left_to_do_ && i < note_reqs_.size (); i++)
     {
-      Music * req =  note_reqs_[i];
+      Music *req = note_reqs_[i];
       if (scratch_note_reqs_.size ())
        {
          req = scratch_note_reqs_[i];
          SCM pits = note_reqs_[i]->get_property ("pitch");
          req->set_property ("pitch", pits);
        }
-      
+
       req->set_property ("duration", note_dur.smobbed_copy ());
 
-      Item *note  = make_item ("NoteHead", req->self_scm ());
+      Item *note = make_item ("NoteHead", req->self_scm ());
       note->set_property ("duration-log",
                          scm_int2num (note_dur.duration_log ()));
-      
+
       int dots = note_dur.dot_count ();
       if (dots)
        {
-         Item * d = make_item ("Dots", SCM_EOL);
+         Item *d = make_item ("Dots", SCM_EOL);
          Rhythmic_head::set_dots (note, d);
 
          /*
-          measly attempt to save an eeny-weenie bit of memory.
+           measly attempt to save an eeny-weenie bit of memory.
          */
          if (dots != scm_to_int (d->get_property ("dot-count")))
            d->set_property ("dot-count", scm_int2num (dots));
@@ -247,22 +245,22 @@ Completion_heads_engraver::process_music ()
       if (scm_is_number (c0))
        pos += scm_to_int (c0);
 
-      note->set_property ("staff-position",   scm_int2num (pos));
+      note->set_property ("staff-position", scm_int2num (pos));
       notes_.push (note);
     }
-  
+
   if (prev_notes_.size () == notes_.size ())
     {
       for (int i = 0; i < notes_.size (); i++)
        {
-         Grob * p = make_spanner ("Tie", SCM_EOL);
+         Grob *p = make_spanner ("Tie", SCM_EOL);
          Tie::set_interface (p); // cannot remove yet!
-         
+
          Tie::set_head (p, LEFT, prev_notes_[i]);
          Tie::set_head (p, RIGHT, notes_[i]);
-         
+
          ties_.push (p);
-         
+
        }
     }
 
@@ -270,30 +268,30 @@ Completion_heads_engraver::process_music ()
 
   /*
     don't do complicated arithmetic with grace notes.
-   */
+  */
   if (orig
-      &&  now_mom ().grace_part_ )
+      && now_mom ().grace_part_)
     {
       left_to_do_ = Rational (0, 0);
     }
 }
+
 void
 Completion_heads_engraver::stop_translation_timestep ()
 {
   ties_.clear ();
-  
+
   if (notes_.size ())
     prev_notes_ = notes_;
   notes_.clear ();
-  
+
   dots_.clear ();
 
   for (int i = scratch_note_reqs_.size (); i--;)
     {
-      scm_gc_unprotect_object (scratch_note_reqs_[i]->self_scm () );
+      scm_gc_unprotect_object (scratch_note_reqs_[i]->self_scm ());
     }
-  
+
   scratch_note_reqs_.clear ();
 }
 
@@ -313,11 +311,11 @@ Completion_heads_engraver::Completion_heads_engraver ()
 }
 
 ADD_TRANSLATOR (Completion_heads_engraver,
-/* descr */       "This engraver replaces "
-"@code{Note_heads_engraver}. It plays some trickery to "
-"break long notes and automatically tie them into the next measure.",
-/* creats*/       "NoteHead Dots Tie",
-/* accepts */     "busy-playing-event note-event",
-/* acks  */      "",
-/* reads */       "middleCPosition measurePosition measureLength",
-/* write */       "");
+               /* descr */ "This engraver replaces "
+               "@code{Note_heads_engraver}. It plays some trickery to "
+               "break long notes and automatically tie them into the next measure.",
+               /* creats*/ "NoteHead Dots Tie",
+               /* accepts */ "busy-playing-event note-event",
+               /* acks  */ "",
+               /* reads */ "middleCPosition measurePosition measureLength",
+               /* write */ "");
index cbab27ba57678ababf1b046e2bb163cd0a40f7df..b049215ddb77634450cd842f7d7a1381d6dd2c42 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   translator-def.cc -- implement Context_def
 
   source file of the GNU LilyPond music typesetter
@@ -33,17 +33,17 @@ Context_def::Context_def ()
   context_name_ = ly_symbol2scm ("");
 }
 
-Context_def::Context_def (Context_def const & s)
+Context_def::Context_def (Context_def const &s)
   : Input (s)
 {
   context_aliases_ = SCM_EOL;
   translator_group_type_ = SCM_EOL;
-  accept_mods_ = SCM_EOL;   
+  accept_mods_ = SCM_EOL;
   translator_mods_ = SCM_EOL;
   property_ops_ = SCM_EOL;
   context_name_ = SCM_EOL;
   description_ = SCM_EOL;
-  
+
   smobify_self ();
   description_ = s.description_;
 
@@ -66,7 +66,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Context_def);
 int
 Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
 {
-  Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
+  Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob);
 
   scm_puts ("#<Context_def ", port);
   scm_display (me->context_name_, port);
@@ -77,13 +77,13 @@ Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
 SCM
 Context_def::mark_smob (SCM smob)
 {
-  Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
+  Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob);
 
   scm_gc_mark (me->description_);
   scm_gc_mark (me->context_aliases_);
   scm_gc_mark (me->accept_mods_);
   scm_gc_mark (me->translator_mods_);
-  scm_gc_mark (me->property_ops_);  
+  scm_gc_mark (me->property_ops_);
   scm_gc_mark (me->translator_group_type_);
 
   return me->context_name_;
@@ -102,7 +102,7 @@ Context_def::add_context_mod (SCM mod)
   SCM sym = scm_cadr (mod);
   if (scm_is_string (sym))
     sym = scm_string_to_symbol (sym);
-  
+
   if (ly_symbol2scm ("consists") == tag
       || ly_symbol2scm ("consists-end") == tag
       || ly_symbol2scm ("remove") == tag)
@@ -115,7 +115,7 @@ Context_def::add_context_mod (SCM mod)
     }
   else if (ly_symbol2scm ("accepts") == tag
           || ly_symbol2scm ("denies") == tag)
-    accept_mods_ = scm_cons (scm_list_2 (tag, sym), accept_mods_); 
+    accept_mods_ = scm_cons (scm_list_2 (tag, sym), accept_mods_);
   else if (ly_symbol2scm ("poppush") == tag
           || ly_symbol2scm ("pop") == tag
           || ly_symbol2scm ("push") == tag
@@ -124,9 +124,9 @@ Context_def::add_context_mod (SCM mod)
     property_ops_ = scm_cons (mod, property_ops_);
   else if (ly_symbol2scm ("alias") == tag)
     context_aliases_ = scm_cons (sym, context_aliases_);
-  else if (ly_symbol2scm ("translator-type")  == tag)
+  else if (ly_symbol2scm ("translator-type") == tag)
     translator_group_type_ = sym;
-  else if (ly_symbol2scm ("context-name")  == tag)
+  else if (ly_symbol2scm ("context-name") == tag)
     context_name_ = sym;
   else
     programming_error ("Unknown context mod tag.");
@@ -159,7 +159,7 @@ Link_array<Context_def>
 Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
 {
   assert (scm_is_symbol (type_sym));
-  
+
   SCM accepted = get_accepted (SCM_EOL);
 
   Link_array<Context_def> accepteds;
@@ -183,7 +183,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
   int best_depth = INT_MAX;
   for (int i = 0; i < accepteds.size (); i++)
     {
-      Context_def * g = accepteds[i];
+      Context_def *g = accepteds[i];
 
       Link_array<Context_def> result
        = g->path_to_acceptable_context (type_sym, odef);
@@ -207,7 +207,7 @@ Context_def::get_translator_names (SCM user_mod) const
   SCM l1 = SCM_EOL;
 
   SCM mods = scm_reverse_x (scm_list_copy (translator_mods_), user_mod);
-  
+
   for (SCM s = mods; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM tag = scm_caar (s);
@@ -215,7 +215,7 @@ Context_def::get_translator_names (SCM user_mod) const
 
       if (scm_is_string (arg))
        arg = scm_string_to_symbol (arg);
-      
+
       if (ly_symbol2scm ("consists") == tag)
        l1 = scm_cons (arg, l1);
       else if (ly_symbol2scm ("remove") == tag)
@@ -232,11 +232,11 @@ filter_performers (SCM ell)
 {
   for (SCM *tail = &ell; scm_is_pair (*tail); tail = SCM_CDRLOC (*tail))
     {
-      if (dynamic_cast<Performer*> (unsmob_translator (scm_car (*tail))))
+      if (dynamic_cast<Performer *> (unsmob_translator (scm_car (*tail))))
        {
          *tail = scm_cdr (*tail);
          if (!scm_is_pair (*tail))
-           break ;
+           break;
        }
     }
   return ell;
@@ -245,24 +245,23 @@ filter_performers (SCM ell)
 SCM
 filter_engravers (SCM ell)
 {
-  SCM *tail = &ell;  
-  for (; scm_is_pair (*tail) ; tail = SCM_CDRLOC (*tail))
+  SCM *tail = &ell;
+  for (; scm_is_pair (*tail); tail = SCM_CDRLOC (*tail))
     {
-      if (dynamic_cast<Engraver*> (unsmob_translator (scm_car (*tail))))
+      if (dynamic_cast<Engraver *> (unsmob_translator (scm_car (*tail))))
        {
          *tail = scm_cdr (*tail);
          if (!scm_is_pair (*tail))
-           break ;
+           break;
        }
     }
   return ell;
 }
 
-
 Context *
 Context_def::instantiate (SCM ops, Object_key const *key)
 {
-  Context *tg =  0;
+  Context *tg = 0;
 
   if (context_name_ == ly_symbol2scm ("Score"))
     tg = new Score_context (key);
@@ -271,15 +270,15 @@ Context_def::instantiate (SCM ops, Object_key const *key)
 
   tg->definition_ = self_scm ();
 
-  SCM trans_names = get_translator_names (ops); 
+  SCM trans_names = get_translator_names (ops);
 
-  Translator_group *g = dynamic_cast<Translator_group*>
+  Translator_group *g = dynamic_cast<Translator_group *>
     (get_translator (translator_group_type_));
-  g = dynamic_cast<Translator_group*> (g->clone ());
+  g = dynamic_cast<Translator_group *> (g->clone ());
 
   SCM trans_list = SCM_EOL;
-  
-  for (SCM s = trans_names; scm_is_pair (s) ; s = scm_cdr (s))
+
+  for (SCM s = trans_names; scm_is_pair (s); s = scm_cdr (s))
     {
       Translator *t = get_translator (scm_car (s));
       if (!t)
@@ -306,20 +305,20 @@ Context_def::instantiate (SCM ops, Object_key const *key)
          scm_gc_unprotect_object (str);
        }
     }
-  
-  g->simple_trans_list_ =  trans_list;
+
+  g->simple_trans_list_ = trans_list;
 
   tg->implementation_ = g->self_scm ();
-  if (dynamic_cast<Engraver*> (g))
+  if (dynamic_cast<Engraver *> (g))
     g->simple_trans_list_ = filter_performers (g->simple_trans_list_);
-  else if (dynamic_cast<Performer*> (g))
+  else if (dynamic_cast<Performer *> (g))
     g->simple_trans_list_ = filter_engravers (g->simple_trans_list_);
-       
+
   g->daddy_context_ = tg;
-  tg->aliases_ = context_aliases_ ;
-  
+  tg->aliases_ = context_aliases_;
+
   scm_gc_unprotect_object (g->self_scm ());
-  
+
   tg->accepts_list_ = get_accepted (ops);
 
   return tg;
@@ -367,7 +366,7 @@ Context_def::to_alist () const
 
   if (scm_is_symbol (translator_group_type_))
     ell = scm_cons (scm_cons (ly_symbol2scm ("group-type"),
-                             translator_group_type_), ell);    
-  return ell;  
+                             translator_group_type_), ell);
+  return ell;
 }
 
index a4c7ecd70e310e232ae7ba5743783714b6518a48..a649ef02f22586cff82e4222721406a83bc5772f 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   interpretation-context-handle.cc -- implement Interpretation_context_handle
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #include "interpretation-context-handle.hh"
 #include "context.hh"
@@ -14,37 +14,36 @@ Interpretation_context_handle::Interpretation_context_handle ()
   outlet_ = 0;
 }
 
-Interpretation_context_handle::Interpretation_context_handle (Interpretation_context_handle const&s)
+Interpretation_context_handle::Interpretation_context_handle (Interpretation_context_handle const &s)
 {
   outlet_ = 0;
   if (s.outlet_)
     up (s.outlet_);
 }
 
-
 Interpretation_context_handle::~Interpretation_context_handle ()
 {
   /*
     Don't do
 
     if (outlet_)
-      down ();
+    down ();
 
     with GC, this is asynchronous.
-   */
+  */
 }
 
 void
 Interpretation_context_handle::up (Context *t)
 {
   outlet_ = t;
-  t->iterator_count_ ++;
+  t->iterator_count_++;
 }
 
 void
 Interpretation_context_handle::down ()
 {
-  outlet_->iterator_count_ --;
+  outlet_->iterator_count_--;
   outlet_ = 0;
 }
 
@@ -53,7 +52,7 @@ Interpretation_context_handle::quit ()
 {
   if (outlet_)
     {
-      outlet_->iterator_count_ --;
+      outlet_->iterator_count_--;
       outlet_ = 0;
     }
 }
@@ -65,7 +64,7 @@ Interpretation_context_handle::try_music (Music *m)
 }
 
 void
-Interpretation_context_handle::operator = (Interpretation_context_handle const &s)
+Interpretation_context_handle::operator= (Interpretation_context_handle const &s)
 {
   set_context (s.outlet_);
 }
@@ -84,12 +83,12 @@ Interpretation_context_handle::set_context (Context *trans)
 Context *
 Interpretation_context_handle::get_outlet () const
 {
-  
+
   return outlet_;
 }
 
 int
 Interpretation_context_handle::get_count () const
 {
-  return outlet_->iterator_count_ ;
+  return outlet_->iterator_count_;
 }
index ee031b4b84a8d9d1ccbd0d0a177967ab4f866cf1..48418e514167fe9e35414ae081a22adc8078974c 100644 (file)
@@ -1,10 +1,10 @@
 /*
-   context-property.cc -- implement manipulation of immutable Grob
-   property lists.
+  context-property.cc -- implement manipulation of immutable Grob
+  property lists.
 
-   source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "context.hh"
   represented as a (ALIST . BASED-ON) pair, where BASED-ON is the
   alist defined in a parent context. BASED-ON should always be a tail
   of ALIST.
-  
-  */
+*/
 
 /*
   Push or pop (depending on value of VAL) a single entry (ELTPROP . VAL)
   entry from a translator property list by name of PROP
 */
 
-
 void
-execute_pushpop_property (Context * trg,
+execute_pushpop_property (Context *trg,
                          SCM prop, SCM eltprop, SCM val)
 {
   if (scm_is_symbol (prop) && scm_is_symbol (eltprop))
@@ -37,37 +35,37 @@ execute_pushpop_property (Context * trg,
       if (val != SCM_UNDEFINED)
        {
          SCM prev = SCM_EOL;
-         Context * where = trg->where_defined (prop);
+         Context *where = trg->where_defined (prop);
 
          /*
            Don't mess with MIDI.
-          */
+         */
          if (!where)
-           return ;
-         
+           return;
+
          if (where != trg)
            {
              SCM base = updated_grob_properties (trg, prop);
-             prev = scm_cons (base, base); 
+             prev = scm_cons (base, base);
              trg->internal_set_property (prop, prev);
            }
          else
            prev = trg->internal_get_property (prop);
-         
+
          if (!scm_is_pair (prev))
            {
              programming_error ("Grob definition should be cons.");
-             return ;
+             return;
            }
 
          SCM prev_alist = scm_car (prev);
-         
+
          if (scm_is_pair (prev_alist) || prev_alist == SCM_EOL)
            {
              bool ok = type_check_assignment (eltprop, val, ly_symbol2scm ("backend-type?"));
 
              /*
-              tack onto alist:
+               tack onto alist:
              */
              if (ok)
                scm_set_car_x (prev, scm_acons (eltprop, val, prev_alist));
@@ -82,7 +80,7 @@ execute_pushpop_property (Context * trg,
          SCM prev = trg->internal_get_property (prop);
          SCM prev_alist = scm_car (prev);
          SCM daddy = scm_cdr (prev);
-         
+
          SCM new_alist = SCM_EOL;
          SCM *tail = &new_alist;
 
@@ -91,10 +89,9 @@ execute_pushpop_property (Context * trg,
              if (ly_c_equal_p (scm_caar (prev_alist), eltprop))
                {
                  prev_alist = scm_cdr (prev_alist);
-                 break ;
+                 break;
                }
 
-             
              *tail = scm_cons (scm_car (prev_alist), SCM_EOL);
              tail = SCM_CDRLOC (*tail);
              prev_alist = scm_cdr (prev_alist);
@@ -119,7 +116,7 @@ execute_pushpop_property (Context * trg,
 
 /*
   PRE_INIT_OPS is in the order specified, and hence must be reversed.
- */
+*/
 void
 apply_property_operations (Context *tg, SCM pre_init_ops)
 {
@@ -128,8 +125,8 @@ apply_property_operations (Context *tg, SCM pre_init_ops)
     {
       SCM entry = scm_car (s);
       SCM type = scm_car (entry);
-      entry = scm_cdr (entry); 
-      
+      entry = scm_cdr (entry);
+
       if (type == ly_symbol2scm ("push") || type == ly_symbol2scm ("poppush"))
        {
          SCM val = scm_cddr (entry);
@@ -146,23 +143,23 @@ apply_property_operations (Context *tg, SCM pre_init_ops)
 
 /*
   Return the object alist for SYM, checking if its base in enclosing
-  contexts has changed. The alist is updated if necessary. 
-   */
+  contexts has changed. The alist is updated if necessary.
+*/
 SCM
-updated_grob_properties (Context * tg, SCM sym)
+updated_grob_properties (Context *tg, SCM sym)
 {
   assert (scm_is_symbol (sym));
-  
+
   tg = tg->where_defined (sym);
   if (!tg)
     return SCM_EOL;
-  
+
   SCM daddy_props
     = (tg->get_parent_context ())
     ? updated_grob_properties (tg->get_parent_context (), sym)
     : SCM_EOL;
-  
-  SCM props  = tg->internal_get_property (sym);
+
+  SCM props = tg->internal_get_property (sym);
 
   if (!scm_is_pair (props))
     {
@@ -180,13 +177,13 @@ updated_grob_properties (Context * tg, SCM sym)
       SCM copy = daddy_props;
       SCM *tail = &copy;
       SCM p = scm_car (props);
-      while  (p != based_on)
+      while (p != based_on)
        {
          *tail = scm_cons (scm_car (p), daddy_props);
          tail = SCM_CDRLOC (*tail);
          p = scm_cdr (p);
        }
-      
+
       scm_set_car_x (props, copy);
       scm_set_cdr_x (props, daddy_props);
 
@@ -195,21 +192,21 @@ updated_grob_properties (Context * tg, SCM sym)
 }
 
 Item *
-make_item_from_properties (Engraver *tr, SCM x, SCM cause, const char * name)
+make_item_from_properties (Engraver *tr, SCM x, SCM cause, const char *name)
 {
   Context *context = tr->context ();
-  
+
   SCM props = updated_grob_properties (context, x);
 
-  Object_key const*key = context->get_grob_key (name);
+  Object_key const *key = context->get_grob_key (name);
   Item *it = new Item (props, key);
 
-  dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
+  dynamic_cast<Engraver *> (tr)->announce_grob (it, cause);
 
   return it;
 }
 
-Spanner*
+Spanner *
 make_spanner_from_properties (Engraver *tr, SCM x, SCM cause, const char *name)
 {
   Context *context = tr->context ();
@@ -217,7 +214,7 @@ make_spanner_from_properties (Engraver *tr, SCM x, SCM cause, const char *name)
   SCM props = updated_grob_properties (context, x);
   Spanner *it = new Spanner (props, context->get_grob_key (name));
 
-  dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
+  dynamic_cast<Engraver *> (tr)->announce_grob (it, cause);
 
   return it;
 }
index b7af85dd28587b5b77f2845dacc02f18bc3e89c4..3d26ef368c50f1b6853bf7d175acd2c6d1cffb02 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "context.hh"
@@ -12,7 +12,7 @@
 
 LY_DEFINE (ly_context_id, "ly:context-id",
           1, 0, 0, (SCM context),
-         "Return the id string of @var{context}, "
+          "Return the id string of @var{context}, "
           "i.e. for @code{\\context Voice = one .. } "
           "return the string @code{one}.")
 {
@@ -30,7 +30,7 @@ LY_DEFINE (ly_context_name, "ly:context-name",
 {
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
-  return ly_symbol2scm (tr->context_name ().to_str0 ()); 
+  return ly_symbol2scm (tr->context_name ().to_str0 ());
 }
 
 LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
@@ -42,11 +42,9 @@ LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
   SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
-    
   return updated_grob_properties (tr, name);
 }
 
-
 LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
           3, 1, 0, (SCM context, SCM grob, SCM eltprop, SCM val),
           "Do a single @code{\\override} or @code{\\revert} operation "
@@ -66,10 +64,10 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
 
 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}")
+          "Return the value of @var{name} from context @var{c}")
 {
   Context *t = unsmob_context (c);
-  Context * tr = (t);
+  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");
 
@@ -125,7 +123,7 @@ LY_DEFINE (ly_context_parent, "ly:context-parent",
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
 
-  tr = tr->get_parent_context () ;
+  tr = tr->get_parent_context ();
   if (tr)
     return tr->self_scm ();
   else
@@ -141,15 +139,14 @@ LY_DEFINE (ly_context_find, "ly:context-find",
   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)
     {
       if (tr->is_alias (name))
        return tr->self_scm ();
-      tr =  tr->get_parent_context () ;
+      tr = tr->get_parent_context ();
     }
-  
+
   return SCM_BOOL_F;
 }
 
-
index 6fc2b4b5be42100e90c320238a90424d1f451e42..b639e3b7e44bd0eb87ed5ede63ce19e418789869 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   context-specced-music-iterator.cc -- implement
-    Context_specced_music_iterator
+  Context_specced_music_iterator
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
 */
 
 #include "music-wrapper-iterator.hh"
@@ -28,8 +27,8 @@ Context_specced_music_iterator::construct_children ()
   if (scm_is_string (ci))
     c_id = ly_scm2string (ci);
   SCM ops = get_music ()->get_property ("property-operations");
-  
-  Context * a = 0;
+
+  Context *a = 0;
 
   if (c_id == "$uniqueContextId")
     a = get_outlet ()->create_unique_context (ct, ops);
@@ -37,10 +36,10 @@ Context_specced_music_iterator::construct_children ()
     a = get_outlet ()->find_create_context (ct, c_id, ops);
 
   if (a
-       && to_boolean (get_music ()->get_property ("descend-only"))
+      && to_boolean (get_music ()->get_property ("descend-only"))
       && !is_child_context (get_outlet (), a))
     a = 0;
-  
+
   if (a)
     set_context (a);
 
index 96597c7e48751f8f5a3e3d4a33db43b26a9d3d27..7d7eddfc1966980978fffc9e3b26f4fa4af86959 100644 (file)
@@ -1,10 +1,9 @@
-/*   
+/*
   context.cc -- implement Context
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "context.hh"
@@ -22,8 +21,8 @@
 bool
 Context::is_removable () const
 {
-  return context_list_ == SCM_EOL && ! iterator_count_ &&
-         !dynamic_cast<Score_context const*> (this);
+  return context_list_ == SCM_EOL && ! iterator_count_
+    && !dynamic_cast < Score_context const *> (this);
 }
 
 void
@@ -42,7 +41,7 @@ Context::check_removal ()
     }
 }
 
-Context::Context (Context const&)
+Context::Context (Context const &)
 {
   assert (false);
 }
@@ -59,7 +58,7 @@ Context::add_context (Context *t)
   SCM ts = t->self_scm ();
   context_list_ = ly_append2 (context_list_,
                              scm_cons (ts, SCM_EOL));
-  
+
   t->daddy_context_ = this;
   if (!t->init_)
     {
@@ -78,25 +77,25 @@ Context::add_context (Context *t)
     }
 }
 
-Object_key const*
+Object_key const *
 Context::get_key () const
 {
   return key_;
 }
 
-Context::Context (Object_key constkey)
+Context::Context (Object_key const *key)
 {
   key_ = key;
   daddy_context_ = 0;
   init_ = false;
   aliases_ = SCM_EOL;
-  iterator_count_  = 0;
+  iterator_count_ = 0;
   implementation_ = SCM_EOL;
   properties_scm_ = SCM_EOL;
   accepts_list_ = SCM_EOL;
   context_list_ = SCM_EOL;
   definition_ = SCM_EOL;
-  
+
   smobify_self ();
   properties_scm_ = (new Scheme_hash_table)->self_scm ();
   scm_gc_unprotect_object (properties_scm_);
@@ -105,26 +104,26 @@ Context::Context (Object_key const* key)
 
 /*
   TODO:  this shares code with find_create_context().
- */
-Context*
+*/
+Context *
 Context::create_unique_context (SCM n, SCM operations)
 {
   /*
     Don't create multiple score contexts.
-   */
-  if (dynamic_cast<Global_context*> (this)
-      && dynamic_cast<Global_context*> (this)->get_score_context ())
+  */
+  if (dynamic_cast<Global_context *> (this)
+      && dynamic_cast<Global_context *> (this)->get_score_context ())
     return get_score_context ()->create_unique_context (n, operations);
 
   /*
     TODO: use accepts_list_.
-   */
+  */
   Link_array<Context_def> path
     = unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ());
 
   if (path.size ())
     {
-      Context * current = this;
+      Context *current = this;
 
       // start at 1.  The first one (index 0) will be us.
       for (int i = 0; i < path.size (); i++)
@@ -133,7 +132,7 @@ Context::create_unique_context (SCM n, SCM operations)
 
          current = current->create_context (path[i],
                                             "\\new",
-                                            ops); 
+                                            ops);
        }
 
       return current;
@@ -142,9 +141,9 @@ Context::create_unique_context (SCM n, SCM operations)
   /*
     Don't go up to Global_context, because global goes down to
     Score_context
-   */
+  */
   Context *ret = 0;
-  if (daddy_context_ && !dynamic_cast<Global_context*> (daddy_context_))
+  if (daddy_context_ && !dynamic_cast<Global_context *> (daddy_context_))
     ret = daddy_context_->create_unique_context (n, operations);
   else
     {
@@ -155,15 +154,14 @@ Context::create_unique_context (SCM n, SCM operations)
   return ret;
 }
 
-
 Context *
 Context::find_create_context (SCM n, String id, SCM operations)
 {
   /*
     Don't create multiple score contexts.
-   */
-  if (dynamic_cast<Global_context*> (this)
-      && dynamic_cast<Global_context*> (this)->get_score_context ())
+  */
+  if (dynamic_cast<Global_context *> (this)
+      && dynamic_cast<Global_context *> (this)->get_score_context ())
     return get_score_context ()->find_create_context (n, id, operations);
 
   if (Context *existing = find_context_below (this, n, id))
@@ -171,19 +169,19 @@ Context::find_create_context (SCM n, String id, SCM operations)
 
   if (n == ly_symbol2scm ("Bottom"))
     {
-      Contexttg = get_default_interpreter ();
+      Context *tg = get_default_interpreter ();
       return tg;
     }
 
   /*
     TODO: use accepts_list_.
-   */
+  */
   Link_array<Context_def> path
     = unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ());
 
   if (path.size ())
     {
-      Context * current = this;
+      Context *current = this;
 
       // start at 1.  The first one (index 0) will be us.
       for (int i = 0; i < path.size (); i++)
@@ -196,10 +194,9 @@ Context::find_create_context (SCM n, String id, SCM operations)
              this_id = id;
            }
 
-
          current = current->create_context (path[i],
                                             this_id,
-                                            ops); 
+                                            ops);
        }
 
       return current;
@@ -208,9 +205,9 @@ Context::find_create_context (SCM n, String id, SCM operations)
   /*
     Don't go up to Global_context, because global goes down to
     Score_context
-   */
+  */
   Context *ret = 0;
-  if (daddy_context_ && !dynamic_cast<Global_context*> (daddy_context_))
+  if (daddy_context_ && !dynamic_cast<Global_context *> (daddy_context_))
     ret = daddy_context_->find_create_context (n, id, operations);
   else
     {
@@ -221,17 +218,16 @@ Context::find_create_context (SCM n, String id, SCM operations)
   return ret;
 }
 
-
-Context*
-Context::create_context (Context_def * cdef,
+Context *
+Context::create_context (Context_def *cdef,
                         String id,
                         SCM ops)
 {
-  String type = ly_symbol2string (cdef->get_context_name());
+  String type = ly_symbol2string (cdef->get_context_name ());
   Object_key const *key = get_context_key (type, id);
-  Context * new_group
+  Context *new_group
     = cdef->instantiate (ops, key);
-         
+
   new_group->id_string_ = id;
   add_context (new_group);
   apply_property_operations (new_group, ops);
@@ -239,9 +235,7 @@ Context::create_context (Context_def * cdef,
   return new_group;
 }
 
-
-
-Object_key const*
+Object_key const *
 Context::get_context_key (String type, String id)
 {
   String now_key = type + "@" + id;
@@ -253,16 +247,15 @@ Context::get_context_key (String type, String id)
     }
 
   context_counts_[now_key] = disambiguation_count + 1;
-  
-  
+
   return new Lilypond_context_key (get_key (),
-                                  now_mom(),
+                                  now_mom (),
                                   type, id,
                                   disambiguation_count);
 }
 
-Object_key const*
-Context::get_grob_key (String name) 
+Object_key const *
+Context::get_grob_key (String name)
 {
   int disambiguation_count = 0;
   if (grob_counts_.find (name) != grob_counts_.end ())
@@ -271,16 +264,14 @@ Context::get_grob_key (String name)
     }
   grob_counts_[name] = disambiguation_count + 1;
 
-  Object_key * k = new Lilypond_grob_key (get_key(),
-                                         now_mom(),
-                                         name,
-                                         disambiguation_count);
+  Object_key *k = new Lilypond_grob_key (get_key (),
+                                        now_mom (),
+                                        name,
+                                        disambiguation_count);
 
-  return k;                                      
+  return k;
 }
 
-
-
 /*
   Default child context as a SCM string, or something else if there is
   none.
@@ -293,14 +284,13 @@ Context::default_child_context_name () const
     : SCM_EOL;
 }
 
-
 bool
 Context::is_bottom_context () const
 {
   return !scm_is_symbol (default_child_context_name ());
 }
 
-Context*
+Context *
 Context::get_default_interpreter ()
 {
   if (!is_bottom_context ())
@@ -327,13 +317,13 @@ Context::get_default_interpreter ()
 
 /*
   PROPERTIES
- */
-Context*
+*/
+Context *
 Context::where_defined (SCM sym) const
 {
   if (properties_dict ()->contains (sym))
     {
-      return (Context*)this;
+      return (Context *)this;
     }
 
   return (daddy_context_) ? daddy_context_->where_defined (sym) : 0;
@@ -351,7 +341,7 @@ Context::internal_get_property (SCM sym) const
 
   if (daddy_context_)
     return daddy_context_->internal_get_property (sym);
-  
+
   return val;
 }
 
@@ -363,7 +353,7 @@ Context::is_alias (SCM sym) const
     return true;
   if (sym == unsmob_context_def (definition_)->get_context_name ())
     return true;
-  
+
   return scm_c_memq (sym, aliases_) != SCM_BOOL_F;
 }
 
@@ -373,8 +363,6 @@ Context::add_alias (SCM sym)
   aliases_ = scm_cons (sym, aliases_);
 }
 
-
-
 void
 Context::internal_set_property (SCM sym, SCM val)
 {
@@ -382,13 +370,13 @@ Context::internal_set_property (SCM sym, SCM val)
   if (do_internal_type_checking_global)
     assert (type_check_assignment (sym, val, ly_symbol2scm ("translation-type?")));
 #endif
-  
+
   properties_dict ()->set (sym, val);
 }
 
 /*
-  TODO: look up to check whether we have inherited var? 
- */
+  TODO: look up to check whether we have inherited var?
+*/
 void
 Context::unset_property (SCM sym)
 {
@@ -397,9 +385,9 @@ Context::unset_property (SCM sym)
 
 /**
    Remove a context from the hierarchy.
- */
+*/
 Context *
-Context::remove_context (Context*trans)
+Context::remove_context (Context *trans)
 {
   assert (trans);
 
@@ -410,9 +398,9 @@ Context::remove_context (Context*trans)
 
 /*
   ID == "" means accept any ID.
- */
+*/
 Context *
-find_context_below (Context * where,
+find_context_below (Context *where,
                    SCM type, String id)
 {
   if (where->is_alias (type))
@@ -420,7 +408,7 @@ find_context_below (Context * where,
       if (id == "" || where->id_string () == id)
        return where;
     }
-  
+
   Context *found = 0;
   for (SCM s = where->children_contexts ();
        !found && scm_is_pair (s); s = scm_cdr (s))
@@ -430,7 +418,7 @@ find_context_below (Context * where,
       found = find_context_below (tr, type, id);
     }
 
-  return found; 
+  return found;
 }
 
 SCM
@@ -452,10 +440,10 @@ Context::context_name () const
   return ly_symbol2string (context_name_symbol ());
 }
 
-Score_context*
+Score_context *
 Context::get_score_context () const
 {
-  if (Score_context *sc = dynamic_cast<Score_context*> ((Context*) this))
+  if (Score_context *sc = dynamic_cast<Score_context *> ((Context *) this))
     return sc;
   else if (daddy_context_)
     return daddy_context_->get_score_context ();
@@ -471,7 +459,7 @@ Context::get_output_def () const
 
 Context::~Context ()
 {
-  
+
 }
 
 Moment
@@ -484,7 +472,7 @@ int
 Context::print_smob (SCM s, SCM port, scm_print_state *)
 {
   Context *sc = (Context *) SCM_CELL_WORD_1 (s);
-     
+
   scm_puts ("#<", port);
   scm_puts (classname (sc), port);
   if (Context_def *d = unsmob_context_def (sc->definition_))
@@ -498,25 +486,24 @@ Context::print_smob (SCM s, SCM port, scm_print_state *)
       scm_puts ("=", port);
       scm_puts (td->id_string_.to_str0 (), port);
     }
-  
 
   scm_puts (" ", port);
 
   scm_display (sc->context_list_, port);
   scm_puts (" >", port);
-  
+
   return 1;
 }
 
 SCM
 Context::mark_smob (SCM sm)
 {
-  Context *me = (Context*) SCM_CELL_WORD_1 (sm);
-  scm_gc_mark (me->key_->self_scm ());  
+  Context *me = (Context *) SCM_CELL_WORD_1 (sm);
+  scm_gc_mark (me->key_->self_scm ());
   scm_gc_mark (me->context_list_);
   scm_gc_mark (me->aliases_);
-  scm_gc_mark (me->definition_);  
-  scm_gc_mark (me->properties_scm_);  
+  scm_gc_mark (me->definition_);
+  scm_gc_mark (me->properties_scm_);
   scm_gc_mark (me->accepts_list_);
   scm_gc_mark (me->implementation_);
 
@@ -528,12 +515,12 @@ IMPLEMENT_DEFAULT_EQUAL_P (Context);
 IMPLEMENT_TYPE_P (Context, "ly:context?");
 
 bool
-Context::try_music (Musicm)
+Context::try_music (Music *m)
 {
-  Translator*  t = implementation ();
+  Translator *t = implementation ();
   if (!t)
     return false;
-  
+
   bool b = t->try_music (m);
   if (!b && daddy_context_)
     b = daddy_context_->try_music (m);
@@ -541,12 +528,11 @@ Context::try_music (Music* m)
   return b;
 }
 
-
-Global_context*
+Global_context *
 Context::get_global_context () const
 {
-  if (dynamic_cast<Global_context *>((Context*) this))
-    return dynamic_cast<Global_context *> ((Context*) this);
+  if (dynamic_cast<Global_context *> ((Context *) this))
+    return dynamic_cast<Global_context *> ((Context *) this);
 
   if (daddy_context_)
     return daddy_context_->get_global_context ();
@@ -555,25 +541,25 @@ Context::get_global_context () const
   return 0;
 }
 
-Context*
+Context *
 Context::get_parent_context () const
 {
   return daddy_context_;
 }
 
-Translator_group*
+Translator_group *
 Context::implementation () const
 {
-  return dynamic_cast<Translator_group*> (unsmob_translator (implementation_));
+  return dynamic_cast<Translator_group *> (unsmob_translator (implementation_));
 }
 
 void
 Context::clear_key_disambiguations ()
 {
-  grob_counts_.clear();
-  context_counts_.clear();
+  grob_counts_.clear ();
+  context_counts_.clear ();
   for (SCM s = context_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      unsmob_context (scm_car (s))->clear_key_disambiguations();
+      unsmob_context (scm_car (s))->clear_key_disambiguations ();
     }
 }
index 78342bbfed5351a2ead9293539525f1329627831..70b5bb92650f6b776b953a056aefa3eac529c657 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2005 Juergen Reuter <reuter@ipd.uka.de>,
-                  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "engraver.hh"
@@ -30,9 +30,8 @@ public:
   virtual void stop_translation_timestep ();
   virtual void finalize ();
 
-
 private:
-  Item * create_custos ();
+  Item *create_custos ();
   bool custos_permitted;
   Link_array<Grob> custodes_;
   Array<Pitch> pitches_;
@@ -43,13 +42,12 @@ Custos_engraver::Custos_engraver ()
   custos_permitted = false;
 }
 
-
 void
 Custos_engraver::stop_translation_timestep ()
 {
   /*
     delay typeset until we're at the next moment, so we can silence custodes at the end of the piece.
-   */
+  */
   pitches_.clear ();
 
   custos_permitted = false;
@@ -61,14 +59,13 @@ Custos_engraver::start_translation_timestep ()
   custodes_.clear ();
 }
 
-
 void
 Custos_engraver::acknowledge_grob (Grob_info info)
 {
-  Item *item = dynamic_cast <Item *> (info.grob_);
+  Item *item = dynamic_cast<Item *> (info.grob_);
   if (item)
     {
-      Music * m = info.music_cause ();
+      Music *m = info.music_cause ();
       if (Bar_line::has_interface (info.grob_))
        custos_permitted = true;
       else if (Note_head::has_interface (info.grob_)
@@ -84,7 +81,7 @@ Custos_engraver::acknowledge_grob (Grob_info info)
            don't look at the staff-position, since we can't be sure
            whether Clef_engraver already applied a vertical shift.
          */
-           pitches_.push (*unsmob_pitch (m->get_property ("pitch")));
+         pitches_.push (*unsmob_pitch (m->get_property ("pitch")));
        }
     }
 }
@@ -94,7 +91,7 @@ Custos_engraver::process_acknowledged_grobs ()
 {
   if (scm_is_string (get_property ("whichBar")))
     custos_permitted = true;
-  
+
   if (custos_permitted)
     {
       for (int i = pitches_.size (); i--;)
@@ -106,24 +103,22 @@ Custos_engraver::process_acknowledged_grobs ()
          if (scm_is_number (c0))
            p += scm_to_int (c0);
 
-         
          c->set_property ("staff-position",
-                               scm_int2num (p));
-         
+                          scm_int2num (p));
+
        }
 
       pitches_.clear ();
     }
 }
 
-Item
+Item *
 Custos_engraver::create_custos ()
 {
-  Item* custos = make_item ("Custos", SCM_EOL);
-  
-  
+  Item *custos = make_item ("Custos", SCM_EOL);
+
   custodes_.push (custos);
-  
+
   return custos;
 }
 
@@ -137,12 +132,10 @@ Custos_engraver::finalize ()
   custodes_.clear ();
 }
 
-
-
 ADD_TRANSLATOR (Custos_engraver,
-/* descr */       "",
-/* creats*/       "Custos",
-/* accepts */     "",
-/* acks  */      "bar-line-interface note-head-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "Custos",
+               /* accepts */ "",
+               /* acks  */ "bar-line-interface note-head-interface",
+               /* reads */ "",
+               /* write */ "");
index d45974f9e23d8c04fa14da2d3c3959d252e25fb7..55bad6226bcf734393e06ec85dd0dbf1b9264fe1 100644 (file)
@@ -8,10 +8,9 @@
 
 /* TODO:
 
- - do not show if a clef change immediately follows in the next line
-
- - decide: do or do not print custos if the next line starts with a rest
+- do not show if a clef change immediately follows in the next line
 
+- decide: do or do not print custos if the next line starts with a rest
 */
 
 #include <cstdio>
@@ -47,14 +46,14 @@ Custos::print (SCM smob)
    * staffline or not, or shall we use individual font characters
    * for both cases?
    */
-  bool adjust = true; 
+  bool adjust = true;
 
   int neutral_pos = robust_scm2int (me->get_property ("neutral-position"), 0);
-  Direction neutral_direction =
-    to_dir (me->get_property ("neutral-direction"));
+  Direction neutral_direction
+    to_dir (me->get_property ("neutral-direction"));
 
   int pos = Staff_symbol_referencer::get_rounded_position (me);
-  int sz = Staff_symbol_referencer::line_count (me)-1;
+  int sz = Staff_symbol_referencer::line_count (me) - 1;
 
   String font_char = "custodes." + style + ".";
   if (pos < neutral_pos)
@@ -89,5 +88,5 @@ Custos::print (SCM smob)
 }
 
 ADD_INTERFACE (Custos, "custos-interface",
-  "A custos object.",
-  "style neutral-position neutral-direction");
+              "A custos object.",
+              "style neutral-position neutral-direction");
index eeb363c34df86f02ff0972960fab47edc02c0e89..1102d918939060205db08178e653b4dff226d6f8 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   dimension-cache.cc -- implement Dimension_cache
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
 
+  (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include <math.h>
 
@@ -21,7 +20,7 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d)
   offset_ = d.offset_;
   offset_callbacks_ = d.offset_callbacks_;
   offsets_left_ = d.offsets_left_;
-  parent_ = d.parent_;  
+  parent_ = d.parent_;
 }
 
 Dimension_cache::Dimension_cache ()
@@ -33,18 +32,14 @@ void
 Dimension_cache::init ()
 {
   dimension_ = SCM_EOL;
-  dimension_callback_ = SCM_EOL; 
+  dimension_callback_ = SCM_EOL;
 
   offsets_left_ = 0;
   offset_callbacks_ = SCM_EOL;
   offset_ = 0.0;
-  
+
   parent_ = 0;
 }
 
 
 
-
-
-
-
index 1979e576f0ea4a122c45343c41a398511a5ba02b..451bf5ef3bb90f23d67370efb0bbf0884700c98f 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "lily-guile.hh"
 #include "warn.hh"
 
 LY_DEFINE (ly_pt, "ly:pt",
-           1, 0, 0, (SCM num),
-           "@var{num} printer points")
+          1, 0, 0, (SCM num),
+          "@var{num} printer points")
 {
-  SCM_ASSERT_TYPE(scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                 "number");
+  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
+                  "number");
   return scm_from_double (point_constant
                          * scm_to_double (num));
 }
 
 LY_DEFINE (ly_cm, "ly:cm",
-           1, 0, 0, (SCM num),
-           "@var{num} cm")
+          1, 0, 0, (SCM num),
+          "@var{num} cm")
 {
-  SCM_ASSERT_TYPE(scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                 "number");
+  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
+                  "number");
   return scm_from_double (cm_constant
                          * scm_to_double (num));
 }
 
 LY_DEFINE (ly_inch, "ly:inch",
-           1, 0, 0, (SCM num),
-           "@var{num} inches")
+          1, 0, 0, (SCM num),
+          "@var{num} inches")
 {
-  SCM_ASSERT_TYPE(scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                 "number");
+  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
+                  "number");
   return scm_from_double (inch_constant
                          * scm_to_double (num));
 }
 
 LY_DEFINE (ly_mm, "ly:mm",
-           1, 0, 0, (SCM num),
-           "@var{num} mm")
+          1, 0, 0, (SCM num),
+          "@var{num} mm")
 {
-  SCM_ASSERT_TYPE(scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                 "number");
+  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
+                  "number");
   return scm_from_double (mm_constant
                          * scm_to_double (num));
 }
 
 LY_DEFINE (ly_bp, "ly:bp",
-           1, 0, 0, (SCM num),
-           "@var{num} bigpoints (1/72th inch)")
+          1, 0, 0, (SCM num),
+          "@var{num} bigpoints (1/72th inch)")
 {
-  SCM_ASSERT_TYPE(scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
-                 "number");
+  SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
+                  "number");
   return scm_from_double (bigpoint_constant
                          * scm_to_double (num));
 }
index bd8a43119c6f999afaf91d4657c948fb60c45e10..5ab19596a72016a6788debe62ca8c7d4f9270392 100644 (file)
@@ -1,26 +1,25 @@
-/*   
+/*
   directional-element-interface.cc -- implement Directional_element
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "directional-element-interface.hh"
 
 Direction
-get_grob_direction (Grob*me) 
+get_grob_direction (Grob *me)
 {
   SCM d = me->get_property ("direction");
   if (!is_direction (d))
     return CENTER;
-      
+
   return to_dir (d);
 }
 
 void
-set_grob_direction (Grob*me, Direction d) 
+set_grob_direction (Grob *me, Direction d)
 {
   SCM sd = scm_int2num (d);
   me->set_property ("direction", sd);
index 53f1bdc62e68a135ebd1f7ce1abcc4e67902fb77..79f3a276863a1e96f6d51f8926752aa6af422935 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   dot-column-engraver.cc -- implement Dot_column_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "rhythmic-head.hh"
 #include "dot-column.hh"
 
 class Dot_column_engraver : public Engraver
 {
-  Grob *dotcol_ ;
-  Grob * stem_;
+  Grob *dotcol_;
+  Grob *stem_;
   Link_array<Item> heads_;
 public:
-  TRANSLATOR_DECLARATIONS (Dot_column_engraver );
-  
+  TRANSLATOR_DECLARATIONS (Dot_column_engraver);
+
 protected:
   virtual void acknowledge_grob (Grob_info);
-  virtual void stop_translation_timestep ();  
+  virtual void stop_translation_timestep ();
 };
 
-
 Dot_column_engraver::Dot_column_engraver ()
 {
   dotcol_ = 0;
@@ -43,7 +41,7 @@ Dot_column_engraver::stop_translation_timestep ()
   */
   if (stem_ && dotcol_)
     dotcol_->set_property ("stem", stem_->self_scm ());
-      
+
   dotcol_ = 0;
   heads_.clear ();
   stem_ = 0;
@@ -58,7 +56,7 @@ Dot_column_engraver::acknowledge_grob (Grob_info info)
       if (!dotcol_)
        {
          dotcol_ = make_item ("DotColumn", SCM_EOL);
-         
+
        }
 
       Dot_column::add_head (dotcol_, info.grob_);
@@ -70,13 +68,11 @@ Dot_column_engraver::acknowledge_grob (Grob_info info)
 }
 
 
-
-
 ADD_TRANSLATOR (Dot_column_engraver,
-/* descr */       "Engraves dots on dotted notes shifted to the right of the note.\n"
-"If omitted, then dots appear on top of the notes.",
-/* creats*/       "DotColumn",
-/* accepts */     "",
-/* acks  */      "rhythmic-head-interface dot-column-interface stem-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Engraves dots on dotted notes shifted to the right of the note.\n"
+               "If omitted, then dots appear on top of the notes.",
+               /* creats*/ "DotColumn",
+               /* accepts */ "",
+               /* acks  */ "rhythmic-head-interface dot-column-interface stem-interface",
+               /* reads */ "",
+               /* write */ "");
index 48e325e133083c142375560f9f9cf193b9fc6dbb..ec981b63bc9c5957640297a4e1937d7c12a3a24a 100644 (file)
@@ -22,7 +22,7 @@
 
 /*
   TODO: let Dot_column communicate with stem via Note_column.
- */
+*/
 
 MAKE_SCHEME_CALLBACK (Dot_column, force_shift_callback, 2);
 SCM
@@ -36,7 +36,7 @@ Dot_column::force_shift_callback (SCM element_smob, SCM axis)
   if (!to_boolean (me->get_property ("positioning-done")))
     {
       me->set_property ("positioning-done", SCM_BOOL_T);
-  
+
       do_shifts (me);
     }
   return scm_make_real (0.0);
@@ -50,25 +50,22 @@ Dot_column::side_position (SCM element_smob, SCM axis)
   Axis a = (Axis) scm_to_int (axis);
   assert (a == X_AXIS);
 
-  Grob * stem = unsmob_grob (me->get_property ("stem"));
+  Grob *stem = unsmob_grob (me->get_property ("stem"));
   if (stem
       && !Stem::get_beam (stem)
       && Stem::duration_log (stem) > 2
-      && !Stem::is_invisible (stem)
-      )
+      && !Stem::is_invisible (stem))
     {
       /*
        trigger stem end & direction calculation.
 
        This will add the stem to the support if a flag collision happens.
-       */
-      Stem::stem_end_position (stem); 
+      */
+      Stem::stem_end_position (stem);
     }
   return Side_position_interface::aligned_side (element_smob, axis);
 }
 
-
-
 struct Dot_position
 {
   int pos_;
@@ -76,7 +73,6 @@ struct Dot_position
   Grob *dot_;
   bool extremal_head_;
 
-  
   Dot_position ()
   {
     dot_ = 0;
@@ -85,15 +81,13 @@ struct Dot_position
   }
 };
 
-
-typedef std::map<int, Dot_position> Dot_configuration;
+typedef std::map < int, Dot_position> Dot_configuration;
 
 /*
   Value CFG according.
-
 */
 int
-dot_config_badness (Dot_configuration const  &cfg)
+dot_config_badness (Dot_configuration const &cfg)
 {
   int t = 0;
   for (Dot_configuration::const_iterator i (cfg.begin ());
@@ -106,18 +100,18 @@ dot_config_badness (Dot_configuration const  &cfg)
       if (i->second.extremal_head_)
        {
          if (i->second.dir_
-             &&  dot_move_dir != i->second.dir_)
+             && dot_move_dir != i->second.dir_)
            demerit += 3;
          else if (dot_move_dir != UP)
            demerit += 2;
        }
       else if (dot_move_dir != UP)
        demerit += 1;
-      
+
       t += demerit;
     }
 
-  return t;  
+  return t;
 }
 
 void
@@ -126,7 +120,7 @@ print_dot_configuration (Dot_configuration const &cfg)
   printf ("dotconf { ");
   for (Dot_configuration::const_iterator i (cfg.begin ());
        i != cfg.end (); i++)
-    printf ("%d, " , i->first);
+    printf ("%d, ", i->first);
   printf ("} \n");
 }
 
@@ -134,7 +128,7 @@ print_dot_configuration (Dot_configuration const &cfg)
   Shift K and following (preceding) entries up (down) as necessary to
   prevent staffline collisions if D is up (down).
 
-  If K is in CFG, then do nothing.  
+  If K is in CFG, then do nothing.
 */
 
 Dot_configuration
@@ -143,7 +137,7 @@ shift_one (Dot_configuration const &cfg,
 {
   Dot_configuration new_cfg;
   int offset = 0;
-  
+
   if (d > 0)
     {
       for (Dot_configuration::const_iterator i (cfg.begin ());
@@ -153,13 +147,13 @@ shift_one (Dot_configuration const &cfg,
          if (p == k)
            {
              if (Staff_symbol_referencer::on_staffline (i->second.dot_, p))
-               p += d ;
+               p += d;
              else
                p += 2* d;
 
              offset = 2*d;
 
-             new_cfg[p] = i->second; 
+             new_cfg[p] = i->second;
            }
          else
            {
@@ -176,19 +170,19 @@ shift_one (Dot_configuration const &cfg,
       Dot_configuration::const_iterator i (cfg.end ());
       do
        {
-         i --;
+         i--;
 
          int p = i->first;
          if (p == k)
            {
              if (Staff_symbol_referencer::on_staffline (i->second.dot_, p))
-               p += d ;
+               p += d;
              else
                p += 2* d;
 
              offset = 2*d;
 
-             new_cfg[p] = i->second; 
+             new_cfg[p] = i->second;
            }
          else
            {
@@ -202,14 +196,14 @@ shift_one (Dot_configuration const &cfg,
        }
       while (i != cfg.begin ());
     }
-  
+
   return new_cfg;
 }
 
 /*
   Remove the collision in CFG either by shifting up or down, whichever
   is best.
- */
+*/
 void
 remove_collision (Dot_configuration &cfg, int p)
 {
@@ -219,64 +213,64 @@ remove_collision (Dot_configuration &cfg, int p)
     {
       Dot_configuration cfg_up = shift_one (cfg, p, UP);
       Dot_configuration cfg_down = shift_one (cfg, p, DOWN);
-      
-      int b_up =  dot_config_badness (cfg_up);
+
+      int b_up = dot_config_badness (cfg_up);
       int b_down = dot_config_badness (cfg_down);
 
-      cfg =  (b_up < b_down) ? cfg_up : cfg_down;
+      cfg = (b_up < b_down) ? cfg_up : cfg_down;
     }
 }
 
 SCM
-Dot_column::do_shifts (Grob*me)
+Dot_column::do_shifts (Grob *me)
 {
-  Link_array<Grob> dots =
-    extract_grob_array (me, ly_symbol2scm ("dots"));
+  Link_array<Grob> dots
+    extract_grob_array (me, ly_symbol2scm ("dots"));
 
   { /*
       Trigger note collision resolution first, since that may kill off
       dots when merging.
-     */
-    Grob * c = 0;
-    for (int i = dots.size (); i-- ; )
+    */
+    Grob *c = 0;
+    for (int i = dots.size (); i--;)
       {
-       Grob * n = dots[i]->get_parent (Y_AXIS);
+       Grob *n = dots[i]->get_parent (Y_AXIS);
        if (c)
          c = n->common_refpoint (c, X_AXIS);
        else
          c = n;
       }
-    for (int i = dots.size (); i-- ; )
+    for (int i = dots.size (); i--;)
       {
-       Grob * n = dots[i]->get_parent (Y_AXIS);
-       n->relative_coordinate (c ,  X_AXIS);
+       Grob *n = dots[i]->get_parent (Y_AXIS);
+       n->relative_coordinate (c, X_AXIS);
       }
   }
-  
+
   dots.sort (compare_position);
   for (int i = dots.size (); i--;)
     if (!dots[i]->is_live ())
       dots.del (i);
-  
+
   Dot_configuration cfg;
   for (int i = 0;i < dots.size (); i++)
     {
       Dot_position dp;
       dp.dot_ = dots[i];
 
-      Grob * note = dots[i]->get_parent (Y_AXIS);
+      Grob *note = dots[i]->get_parent (Y_AXIS);
       if (note)
        {
          Grob *stem = unsmob_grob (note->get_property ("stem"));
          if (stem)
            dp.extremal_head_ = Stem::first_head (stem) == note;
        }
-      
+
       int p = Staff_symbol_referencer::get_rounded_position (dp.dot_);
       dp.pos_ = p;
 
       if (dp.extremal_head_)
-       dp.dir_ = to_dir (dp.dot_->get_property  ("direction"));
+       dp.dir_ = to_dir (dp.dot_->get_property ("direction"));
 
       remove_collision (cfg, p);
       cfg[p] = dp;
@@ -287,32 +281,29 @@ Dot_column::do_shifts (Grob*me)
   for (Dot_configuration::const_iterator i (cfg.begin ());
        i != cfg.end (); i++)
     {
-      Staff_symbol_referencer::set_position (i->second.dot_, i->first);  
+      Staff_symbol_referencer::set_position (i->second.dot_, i->first);
     }
 
   return SCM_UNSPECIFIED;
 }
 
 void
-Dot_column::add_head (Grob * me, Grob *rh)
+Dot_column::add_head (Grob *me, Grob *rh)
 {
-  Grob * d = unsmob_grob (rh->get_property ("dot"));
+  Grob *d = unsmob_grob (rh->get_property ("dot"));
   if (d)
     {
       Side_position_interface::add_support (me, rh);
 
       Pointer_group_interface::add_grob (me, ly_symbol2scm ("dots"), d);
-      d->add_offset_callback (Dot_column::force_shift_callback_proc , Y_AXIS);
+      d->add_offset_callback (Dot_column::force_shift_callback_proc, Y_AXIS);
       Axis_group_interface::add_element (me, d);
     }
 }
 
 
-
-
 ADD_INTERFACE (Dot_column, "dot-column-interface",
               "Groups dot objects so they form a column, and position dots so they do not "
-              "clash with staff lines "
-              ,
+              "clash with staff lines ",
               "positioning-done direction stem");
 
index cb5bfdd487c4ada0359c238d3ee43c636c9e0240..44eb51802fdc4bb827e12dd4050bded27d91bd19 100644 (file)
 #include "directional-element-interface.hh"
 
 MAKE_SCHEME_CALLBACK (Dots, print, 1);
-SCM  
+SCM
 Dots::print (SCM d)
 {
   Grob *sc = unsmob_grob (d);
   Stencil mol;
-  
+
   SCM c = sc->get_property ("dot-count");
 
   if (scm_is_number (c))
     {
       Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots.dot"));
       Real dw = d.extent (X_AXIS).length ();
-      
 
       /*
        we need to add a real blank box, to assure that
@@ -36,10 +35,10 @@ Dots::print (SCM d)
 
       /*
        TODO: this should  be handled by side-position padding.
-       */
+      */
       mol = Lookup::blank (Box (Interval (0, 0),
                                Interval (0, 0)));
-  
+
       for (int i = scm_to_int (c); i--;)
        {
          d.translate_axis (2*dw, X_AXIS);
@@ -50,12 +49,9 @@ Dots::print (SCM d)
 }
 
 
-
-
 ADD_INTERFACE (Dots, "dots-interface",
               "The dots to go with a notehead or rest."
               "@code{direction} sets the preferred direction to move in case of staff "
               "line collisions.",
               "direction dot-count");
 
-
index a526088c3aceb720de92da0dc27c119509cd9a52..d58a889d9d6cd552b4e1ef132ae313b5c42874ac 100644 (file)
@@ -1,6 +1,6 @@
 /*
   drum-note-engraver.cc
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
@@ -25,9 +25,9 @@ public:
   TRANSLATOR_DECLARATIONS (Drum_notes_engraver);
 
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
   virtual void process_music ();
-  virtual void acknowledge_grob (Grob_info); 
+  virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
 };
 
@@ -36,7 +36,7 @@ Drum_notes_engraver::Drum_notes_engraver ()
 }
 
 bool
-Drum_notes_engraver::try_music (Music *m) 
+Drum_notes_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
@@ -45,11 +45,10 @@ Drum_notes_engraver::try_music (Music *m)
     }
   else if (m->is_mus_type ("busy-playing-event"))
     return events_.size ();
-  
+
   return false;
 }
 
-
 void
 Drum_notes_engraver::process_music ()
 {
@@ -58,41 +57,41 @@ Drum_notes_engraver::process_music ()
     {
       if (!tab)
        tab = get_property ("drumStyleTable");
-      
-      Music * ev = events_[i];
+
+      Music *ev = events_[i];
       Item *note = make_item ("NoteHead", ev->self_scm ());
-      
+
       Duration dur = *unsmob_duration (ev->get_property ("duration"));
 
       note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
 
       if (dur.dot_count ())
        {
-         Item * d = make_item ("Dots", ev->self_scm ());
+         Item *d = make_item ("Dots", ev->self_scm ());
          Rhythmic_head::set_dots (note, d);
-         
+
          if (dur.dot_count ()
              != robust_scm2int (d->get_property ("dot-count"), 0))
            d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
 
          d->set_parent (note, Y_AXIS);
-         
+
          dots_.push (d);
        }
 
-      SCM drum_type =  ev->get_property ("drum-type");
+      SCM drum_type = ev->get_property ("drum-type");
 
       SCM defn = SCM_EOL;
 
       if (scm_hash_table_p (tab) == SCM_BOOL_T)
        defn = scm_hashq_ref (tab, drum_type, SCM_EOL);
-      
+
       if (scm_is_pair (defn))
        {
          SCM pos = scm_caddr (defn);
          SCM style = scm_car (defn);
          SCM script = scm_cadr (defn);
-         
+
          if (scm_integer_p (pos) == SCM_BOOL_T)
            note->set_property ("staff-position", pos);
          if (scm_is_symbol (style))
@@ -100,7 +99,7 @@ Drum_notes_engraver::process_music ()
 
          if (scm_is_string (script))
            {
-             Item *p  = make_item ("Script", ev->self_scm ());
+             Item *p = make_item ("Script", ev->self_scm ());
              bool follow;
              make_script_from_event (p, &follow,
                                      context (), script,
@@ -108,10 +107,9 @@ Drum_notes_engraver::process_music ()
 
              if (p->get_property ("follow-into-staff"))
                p->set_property ("staff-padding", SCM_EOL);
-             
 
              p->set_parent (note, Y_AXIS);
-             Side_position_interface::add_support (p, note); 
+             Side_position_interface::add_support (p, note);
              scripts_.push (p);
            }
        }
@@ -127,26 +125,26 @@ Drum_notes_engraver::acknowledge_grob (Grob_info inf)
     {
       for (int i = 0; i < scripts_.size (); i++)
        {
-         Grob*e = scripts_[i];
+         Grob *e = scripts_[i];
 
          if (to_dir (e->get_property ("side-relative-direction")))
            e->set_property ("direction-source", inf.grob_->self_scm ());
 
          /*
-           add dep ? 
-          */
+           add dep ?
+         */
          e->add_dependency (inf.grob_);
          Side_position_interface::add_support (e, inf.grob_);
        }
     }
-   else if (Note_column::has_interface (inf.grob_))
+  else if (Note_column::has_interface (inf.grob_))
     {
       for (int i = 0; i < scripts_.size (); i++)
        {
          Grob *e = scripts_[i];
-         
-         if (!e->get_parent (X_AXIS) &&
-             Side_position_interface::get_axis (e) == Y_AXIS)
+
+         if (!e->get_parent (X_AXIS)
+             && Side_position_interface::get_axis (e) == Y_AXIS)
            {
              e->set_parent (inf.grob_, X_AXIS);
            }
@@ -155,24 +153,21 @@ Drum_notes_engraver::acknowledge_grob (Grob_info inf)
 
 }
 
-
 void
 Drum_notes_engraver::stop_translation_timestep ()
 {
   notes_.clear ();
   dots_.clear ();
   scripts_.clear ();
-  
+
   events_.clear ();
 }
 
-
-
 ADD_TRANSLATOR (Drum_notes_engraver,
-/* descr */       "Generate noteheads.",
-/* creats*/       "NoteHead Dots Script",
-/* accepts */     "note-event busy-playing-event",
-/* acks  */       "stem-interface note-column-interface",
-/* reads */       "drumStyleTable",
-/* write */       "");
+               /* descr */ "Generate noteheads.",
+               /* creats*/ "NoteHead Dots Script",
+               /* accepts */ "note-event busy-playing-event",
+               /* acks  */ "stem-interface note-column-interface",
+               /* reads */ "drumStyleTable",
+               /* write */ "");
 
index e2f8c697eded5e72b6f047e3ff61c939dba7bb38..aa867c44e7cb861d88b108c3345df84662b8cca3 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "performer.hh"
 #include "audio-item.hh"
 #include "global-context.hh"
 #include "warn.hh"
 
-class Drum_note_performer : public Performer {
+class Drum_note_performer : public Performer
+{
 public:
   TRANSLATOR_DECLARATIONS (Drum_note_performer);
-  
+
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
   virtual void stop_translation_timestep ();
   virtual void create_audio_elements ();
 
@@ -26,31 +27,31 @@ private:
   Link_array<Audio_note> notes_;
 };
 
-void 
+void
 Drum_note_performer::create_audio_elements ()
 {
   SCM tab = 0;
   if (!tab) tab = get_property ("drumPitchTable");
-  
+
   while (note_evs_.size ())
     {
-      Musicn = note_evs_.pop ();
+      Music *n = note_evs_.pop ();
       SCM sym = n->get_property ("drum-type");
       SCM defn = SCM_EOL;
 
       if (scm_is_symbol (sym)
-         &&  (scm_hash_table_p (tab) == SCM_BOOL_T))
+         && (scm_hash_table_p (tab) == SCM_BOOL_T))
        defn = scm_hashq_ref (tab, sym, SCM_EOL);
-      
-      if (Pitch * pit = unsmob_pitch (defn))
+
+      if (Pitch *pit = unsmob_pitch (defn))
        {
-         Audio_note* p = new Audio_note (*pit,  n->get_length (), 0);
+         Audio_note *p = new Audio_note (*pit, n->get_length (), 0);
          Audio_element_info info (p, n);
          announce_element (info);
          notes_.push (p);
        }
     }
-  
+
   note_evs_.clear ();
 }
 
@@ -67,9 +68,9 @@ Drum_note_performer::stop_translation_timestep ()
   notes_.clear ();
   note_evs_.clear ();
 }
+
 bool
-Drum_note_performer::try_music (Musicev)
+Drum_note_performer::try_music (Music *ev)
 {
   if (ev->is_mus_type ("note-event"))
     {
@@ -78,13 +79,13 @@ Drum_note_performer::try_music (Music* ev)
     }
   else if (ev->is_mus_type ("busy-playing-event"))
     return note_evs_.size ();
-  
+
   return false;
 }
 
 ADD_TRANSLATOR (Drum_note_performer,
-                 "Play drum notes.", "",
-                 "note-event busy-playing-event", "", "", "");
+               "Play drum notes.", "",
+               "note-event busy-playing-event", "", "", "");
 
 Drum_note_performer::Drum_note_performer ()
 {
index 0ecf130acfa361f49ae48c76be3490949e5e4cd2..1d840a753e2e9649005ad69ec6cd9f5acdf3fa31 100644 (file)
@@ -4,8 +4,7 @@
   source file of the LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "duration.hh"
@@ -26,7 +25,7 @@ Duration::less_p (SCM p1, SCM p2)
 
 LY_DEFINE (ly_duration_less_p, "ly:duration<?",
           2, 0, 0, (SCM p1, SCM p2),
-         "Is @var{p1} shorter than @var{p2}?")
+          "Is @var{p1} shorter than @var{p2}?")
 {
   Duration *a = unsmob_duration (p1);
   Duration *b = unsmob_duration (p2);
@@ -91,7 +90,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
 
 LY_DEFINE (ly_duration_log, "ly:duration-log",
           1, 0, 0, (SCM dur),
-         "Extract the duration log from @var{dur}")
+          "Extract the duration log from @var{dur}")
 {
   SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
   return scm_int2num (unsmob_duration (dur)->duration_log ());
@@ -99,7 +98,7 @@ LY_DEFINE (ly_duration_log, "ly:duration-log",
 
 LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
           1, 0, 0, (SCM dur),
-         "Extract the dot count from @var{dur}")
+          "Extract the dot count from @var{dur}")
 {
   SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
   return scm_int2num (unsmob_duration (dur)->dot_count ());
@@ -107,7 +106,7 @@ LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
 
 LY_DEFINE (ly_intlog2, "ly:intlog2",
           1, 0, 0, (SCM d),
-         "The 2-logarithm of 1/@var{d}.")
+          "The 2-logarithm of 1/@var{d}.")
 {
   SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG1, __FUNCTION__, "integer");
   int log = intlog2 (scm_to_int (d));
@@ -116,7 +115,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
 
 LY_DEFINE (ly_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
-         "Extract the compression factor from @var{dur}. Return as a pair.")
+          "Extract the compression factor from @var{dur}. Return as a pair.")
 {
   SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
   Rational r = unsmob_duration (dur)->factor ();
index 80ba74e84c83de41a8c6508d60d4256b4830b164..08a5bbb78c8e609b11713b1280a658bd60d43ec5 100644 (file)
@@ -4,8 +4,7 @@
   source file of the LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "duration.hh"
@@ -66,8 +65,8 @@ Duration::to_string () const
 {
   String s;
 
-  if (durlog_ < 0  )
-    s = "log = "  + ::to_string (durlog_);
+  if (durlog_ < 0)
+    s = "log = " + ::to_string (durlog_);
   else
     s = ::to_string (1 << durlog_);
 
@@ -77,7 +76,6 @@ Duration::to_string () const
   return s;
 }
 
-
 IMPLEMENT_TYPE_P (Duration, "ly:duration?");
 
 SCM
@@ -90,7 +88,7 @@ IMPLEMENT_SIMPLE_SMOBS (Duration);
 int
 Duration::print_smob (SCM s, SCM port, scm_print_state *)
 {
-  Duration  *r = (Duration *) SCM_CELL_WORD_1 (s);
+  Duration *r = (Duration *) SCM_CELL_WORD_1 (s);
 
   scm_puts ("#<Duration ", port);
   scm_display (scm_makfrom0str (r->to_string ().to_str0 ()), port);
@@ -100,10 +98,10 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *)
 }
 
 SCM
-Duration::equal_p (SCM a , SCM b)
+Duration::equal_p (SCM a, SCM b)
 {
-  Duration  *p = (Duration *) SCM_CELL_WORD_1 (a);
-  Duration  *q = (Duration *) SCM_CELL_WORD_1 (b);
+  Duration *p = (Duration *) SCM_CELL_WORD_1 (a);
+  Duration *q = (Duration *) SCM_CELL_WORD_1 (b);
 
   bool eq = p->dots_ == q->dots_
     && p->durlog_ == q->durlog_
@@ -112,7 +110,6 @@ Duration::equal_p (SCM a , SCM b)
   return eq ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-
 int
 Duration::duration_log () const
 {
index 45c9c355c5807135a6d9c56e2aff1d04f37f5cef..9396c97f9a5498765a84f7019435a68328eca26d 100644 (file)
 
   - TODO: the line-spanner is not killed after the (de)crescs are
   finished.
-
 */
 
 /**
    print text & hairpin dynamics.
- */
+*/
 class Dynamic_engraver : public Engraver
 {
   Item *script_;
@@ -48,27 +47,25 @@ class Dynamic_engraver : public Engraver
 
   Music *script_ev_;
   Music *current_cresc_ev_;
-  
-  Drul_array<Music*> accepted_spanreqs_drul_;
+
+  Drul_array<Music *> accepted_spanreqs_drul_;
 
   Link_array<Note_column> pending_columns_;
   Link_array<Grob> pending_elements_;
-  
+
   void typeset_all ();
 
   TRANSLATOR_DECLARATIONS (Dynamic_engraver);
-  
+
 protected:
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
   virtual bool try_music (Music *req);
   virtual void stop_translation_timestep ();
-  virtual void process_music ();  
+  virtual void process_music ();
 };
 
 
-
-
 Dynamic_engraver::Dynamic_engraver ()
 {
   script_ = 0;
@@ -114,14 +111,14 @@ Dynamic_engraver::process_music ()
     {
       if (!line_spanner_)
        {
-         Music * rq = accepted_spanreqs_drul_[START];
-         line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm (): SCM_EOL );
+         Music *rq = accepted_spanreqs_drul_[START];
+         line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm (): SCM_EOL);
 
          if (script_ev_)
-           rq =  script_ev_;
+           rq = script_ev_;
        }
     }
-  
+
   /*
     During a (de)crescendo, pending event will not be cleared,
     and a line-spanner will always be created, as \< \! are already
@@ -130,7 +127,6 @@ Dynamic_engraver::process_music ()
     Note: line-spanner must always have at least same duration
     as (de)crecsendo, b.o. line-breaking.
   */
-  
 
   /*
     maybe we should leave dynamic texts to the text-engraver and
@@ -142,7 +138,6 @@ Dynamic_engraver::process_music ()
       script_->set_property ("text",
                             script_ev_->get_property ("text"));
 
-      
       if (Direction d = to_dir (script_ev_->get_property ("direction")))
        set_grob_direction (line_spanner_, d);
 
@@ -157,18 +152,16 @@ Dynamic_engraver::process_music ()
       /*
        finish side position alignment if the (de)cresc ends here, and
        there are no new dynamics.
-       */
-
+      */
 
       if (cresc_)
        {
          assert (!finished_cresc_ && cresc_);
 
          cresc_->set_bound (RIGHT, script_
-                              ? script_
-                              : unsmob_grob (get_property ("currentMusicalColumn")));
+                            ? script_
+                            : unsmob_grob (get_property ("currentMusicalColumn")));
          add_bound_item (line_spanner_, cresc_->get_bound (RIGHT));
-         
 
          finished_cresc_ = cresc_;
          cresc_ = 0;
@@ -179,9 +172,9 @@ Dynamic_engraver::process_music ()
          accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
          stop_ev = 0;
        }
-      
+
     }
-  
+
   if (accepted_spanreqs_drul_[START])
     {
       if (current_cresc_ev_)
@@ -191,7 +184,7 @@ Dynamic_engraver::process_music ()
            msg = _ ("already have a crescendo");
 
          accepted_spanreqs_drul_[START]->origin ()->warning (msg);
-         current_cresc_ev_->origin ()->warning (_("Cresc started here"));
+         current_cresc_ev_->origin ()->warning (_ ("Cresc started here"));
        }
       else
        {
@@ -204,8 +197,8 @@ Dynamic_engraver::process_music ()
            TODO: Use symbols.
          */
 
-         String start_type = 
-           ly_symbol2string (current_cresc_ev_->get_property ("name"));
+         String start_type
+           ly_symbol2string (current_cresc_ev_->get_property ("name"));
 
          /*
            ugh. Use push/pop?
@@ -214,17 +207,17 @@ Dynamic_engraver::process_music ()
            start_type = "decrescendo";
          else if (start_type == "CrescendoEvent")
            start_type = "crescendo";
-         
+
          SCM s = get_property ((start_type + "Spanner").to_str0 ());
          if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin"))
            {
-             cresc_  = make_spanner ("Hairpin", accepted_spanreqs_drul_[START]->self_scm ());
+             cresc_ = make_spanner ("Hairpin", accepted_spanreqs_drul_[START]->self_scm ());
              if (finished_cresc_)
                {
                  Pointer_group_interface::add_grob (finished_cresc_,
                                                     ly_symbol2scm ("adjacent-hairpins"),
                                                     cresc_);
-                 
+
                  Pointer_group_interface::add_grob (cresc_,
                                                     ly_symbol2scm ("adjacent-hairpins"),
                                                     finished_cresc_);
@@ -232,10 +225,9 @@ Dynamic_engraver::process_music ()
              cresc_->set_property ("grow-direction",
                                    scm_int2num ((start_type == "crescendo")
                                                 ? BIGGER : SMALLER));
-             
+
            }
 
-         
          /*
            This is a convenient (and legacy) interface to TextSpanners
            for use in (de)crescendi.
@@ -243,7 +235,7 @@ Dynamic_engraver::process_music ()
          */
          else
            {
-             cresc_  = make_spanner ("DynamicTextSpanner", accepted_spanreqs_drul_[START]->self_scm ());
+             cresc_ = make_spanner ("DynamicTextSpanner", accepted_spanreqs_drul_[START]->self_scm ());
              cresc_->set_property ("style", s);
              context ()->set_property ((start_type
                                         + "Spanner").to_str0 (), SCM_EOL);
@@ -265,7 +257,7 @@ Dynamic_engraver::process_music ()
              cresc_->set_bound (LEFT, script_);
              add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
            }
-         
+
          Axis_group_interface::add_element (line_spanner_, cresc_);
        }
     }
@@ -287,7 +279,7 @@ Dynamic_engraver::stop_translation_timestep ()
       cresc_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
       add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
     }
-  
+
   script_ev_ = 0;
   accepted_spanreqs_drul_[START] = 0;
   accepted_spanreqs_drul_[STOP] = 0;
@@ -297,7 +289,7 @@ void
 Dynamic_engraver::finalize ()
 {
   typeset_all ();
-  
+
   if (line_spanner_
       && !line_spanner_->is_live ())
     line_spanner_ = 0;
@@ -328,21 +320,21 @@ Dynamic_engraver::typeset_all ()
          finished_cresc_->set_bound (RIGHT, script_
                                      ? script_
                                      : unsmob_grob (get_property ("currentMusicalColumn")));
-         
+
          if (finished_line_spanner_)
            add_bound_item (finished_line_spanner_,
                            finished_cresc_->get_bound (RIGHT));
        }
       finished_cresc_ = 0;
     }
-  
+
   script_ = 0;
   if (finished_line_spanner_)
     {
       /*
        We used to have
-       
-            extend-spanner-over-elements (finished_line_spanner_);
+
+       extend-spanner-over-elements (finished_line_spanner_);
 
        but this is rather kludgy, since finished_line_spanner_
        typically has a staff-symbol field set , extending it over the
@@ -350,8 +342,8 @@ Dynamic_engraver::typeset_all ()
 
       */
 
-      Grob * l = finished_line_spanner_->get_bound (LEFT);
-      Grob * r = finished_line_spanner_->get_bound (RIGHT);      
+      Grob *l = finished_line_spanner_->get_bound (LEFT);
+      Grob *r = finished_line_spanner_->get_bound (RIGHT);
       if (!r && l)
        finished_line_spanner_->set_bound (RIGHT, l);
       else if (!l && r)
@@ -361,13 +353,13 @@ Dynamic_engraver::typeset_all ()
          /*
            This is a isolated dynamic apparently, and does not even have
            any interesting support item.
-          */
-         Grob * cc = unsmob_grob (get_property ("currentMusicalColumn"));
-         Item * ci = dynamic_cast<Item*>(cc);
+         */
+         Grob *cc = unsmob_grob (get_property ("currentMusicalColumn"));
+         Item *ci = dynamic_cast<Item *> (cc);
          finished_line_spanner_->set_bound (RIGHT, ci);
-         finished_line_spanner_->set_bound (LEFT, ci);   
+         finished_line_spanner_->set_bound (LEFT, ci);
        }
-       
+
       finished_line_spanner_ = 0;
     }
 }
@@ -385,24 +377,22 @@ Dynamic_engraver::acknowledge_grob (Grob_info info)
          && line_spanner_->is_live ())
        {
          Side_position_interface::add_support (line_spanner_, info.grob_);
-         add_bound_item (line_spanner_, dynamic_cast<Item*> (info.grob_));
+         add_bound_item (line_spanner_, dynamic_cast<Item *> (info.grob_));
        }
 
       if (script_ && !script_->get_parent (X_AXIS))
        {
          SCM head = scm_last_pair (info.grob_->get_property ("note-heads"));
          if (scm_is_pair (head))
-           script_->set_parent (unsmob_grob (scm_car (head)),  X_AXIS);
+           script_->set_parent (unsmob_grob (scm_car (head)), X_AXIS);
        }
 
-
-
       if (cresc_ && !cresc_->get_bound (LEFT))
        {
          cresc_->set_bound (LEFT, info.grob_);
          add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
        }
-        
+
     }
   else if (Script_interface::has_interface (info.grob_) && script_)
     {
@@ -412,7 +402,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info info)
        UGH.
 
        DynamicText doesn't really have a script-priority field.
-       */
+      */
       if (scm_is_number (p)
          && scm_to_int (p)
          < scm_to_int (script_->get_property ("script-priority")))
@@ -421,14 +411,13 @@ Dynamic_engraver::acknowledge_grob (Grob_info info)
 }
 
 ADD_TRANSLATOR (Dynamic_engraver,
-/* descr */       
-"This engraver creates hairpins, dynamic texts, and their vertical\n"
-"alignments.  The symbols are collected onto a DynamicLineSpanner grob\n"
-"which takes care of vertical positioning.  "
-,
-                 
-/* creats*/       "DynamicLineSpanner DynamicText Hairpin TextSpanner",
-/* accepts */     "absolute-dynamic-event crescendo-event decrescendo-event",
-/* acks  */      "note-column-interface script-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */
+               "This engraver creates hairpins, dynamic texts, and their vertical\n"
+               "alignments.  The symbols are collected onto a DynamicLineSpanner grob\n"
+               "which takes care of vertical positioning.  ",
+
+               /* creats*/ "DynamicLineSpanner DynamicText Hairpin TextSpanner",
+               /* accepts */ "absolute-dynamic-event crescendo-event decrescendo-event",
+               /* acks  */ "note-column-interface script-interface",
+               /* reads */ "",
+               /* write */ "");
index 93f3144b04475753638f84e51a3bf3e1553ea0be..71ce23fb7415fd9b39b130aa4655da7a3eb79bac 100644 (file)
 
 /*
   TODO:
-  
-    handle multiple events
 
-    perform absolute (text) dynamics
- */
+  handle multiple events
+
+  perform absolute (text) dynamics
+*/
 class Dynamic_performer : public Performer
 {
 public:
   TRANSLATOR_DECLARATIONS (Dynamic_performer);
 protected:
-  virtual bool try_music (Musicreq);
+  virtual bool try_music (Music *req);
   virtual void stop_translation_timestep ();
   virtual void create_audio_elements ();
 
 private:
-  Musicscript_req_;
-  Audio_dynamicaudio_;
+  Music *script_req_;
+  Audio_dynamic *audio_;
 };
 
 Dynamic_performer::Dynamic_performer ()
@@ -43,18 +43,18 @@ Dynamic_performer::create_audio_elements ()
     {
       SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
 
-      SCM svolume  = SCM_EOL;
+      SCM svolume = SCM_EOL;
       if (ly_c_procedure_p (proc))
        {
          // urg
          svolume = scm_call_1 (proc, script_req_->get_property ("text"));
        }
 
-      Real volume = robust_scm2double (svolume, 0.5); 
+      Real volume = robust_scm2double (svolume, 0.5);
 
       /*
        properties override default equaliser setting
-       */
+      */
       SCM min = get_property ("midiMinimumVolume");
       SCM max = get_property ("midiMaximumVolume");
       if (scm_is_number (min) || scm_is_number (max))
@@ -72,14 +72,13 @@ Dynamic_performer::create_audio_elements ()
            urg, code duplication:: staff_performer
          */
          SCM s = get_property ("midiInstrument");
-         
+
          if (!scm_is_string (s))
            s = get_property ("instrument");
-         
+
          if (!scm_is_string (s))
            s = scm_makfrom0str ("piano");
-         
-         
+
          SCM eq = get_property ("instrumentEqualizer");
          if (ly_c_procedure_p (eq))
            {
@@ -92,7 +91,7 @@ Dynamic_performer::create_audio_elements ()
              volume = iv[MIN] + iv.length () * volume;
            }
        }
-      
+
       audio_ = new Audio_dynamic (volume);
       Audio_element_info info (audio_, script_req_);
       announce_element (info);
@@ -111,7 +110,7 @@ Dynamic_performer::stop_translation_timestep ()
 }
 
 bool
-Dynamic_performer::try_music (Musicr)
+Dynamic_performer::try_music (Music *r)
 {
   if (!script_req_)
     {
@@ -125,9 +124,9 @@ Dynamic_performer::try_music (Music* r)
 }
 
 ADD_TRANSLATOR (Dynamic_performer,
-                 /*descr*/               "",
-                 /* creats*/ "",
-                 /* accepts */     "absolute-dynamic-event",
-                 /* acks */ "",
-                 /*reads */"dynamicAbsoluteVolumeFunction midiMaximumVolume midiMinimumVolume midiInstrument instrumentEqualizer",
-                 /*writes*/"");
+               /*descr*/                "",
+               /* creats*/ "",
+               /* accepts */ "absolute-dynamic-event",
+               /* acks */ "",
+               /*reads */"dynamicAbsoluteVolumeFunction midiMaximumVolume midiMinimumVolume midiInstrument instrumentEqualizer",
+               /*writes*/"");
index 11de092ab34689a52a9b02cf79077f30b661b136..8466dbde7d18eb8d5783a0fe034d67a64398d90d 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
   crescendo-text-spanner.cc -- implement Text_spanner
 
@@ -6,7 +5,7 @@
 
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 
-  Revised over good by Han-Wen. 
+  Revised over good by Han-Wen.
 */
 
 #include "text-item.hh"
 #include "paper-column.hh"
 
 
-
 class Dynamic_text_spanner
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 
-
 /*
   This is a partial C&P from text-spanner.cc
 
@@ -38,28 +35,26 @@ public:
   * does not require bracket functionality.
 
   * should make room for spanning points (mf/f/mp texts).
+
   * In the future, we should  support
 
-   cresc - - - - poco - - - a - - - - poco - - - 
+  cresc - - - - poco - - - a - - - - poco - - -
 
   as well
 
 
   The cut & paste is rather inelegant, but text-spanner was a failed
   and buggy attempt at being generic.
-  
-  
 */
 MAKE_SCHEME_CALLBACK (Dynamic_text_spanner, print, 1);
 SCM
-Dynamic_text_spanner::print (SCM smob) 
+Dynamic_text_spanner::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner *spanner = dynamic_cast<Spanner*> (me);
+  Spanner *spanner = dynamic_cast<Spanner *> (me);
 
   Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
-  Output_def * layout = me->get_layout ();
+  Output_def *layout = me->get_layout ();
 
   Interval span_points;
   Drul_array<bool> broken;
@@ -86,15 +81,14 @@ Dynamic_text_spanner::print (SCM smob)
              encl = -d;
            }
 
-         Interval ext  = b->extent (common, X_AXIS);
-         span_points[d] = -d  * pad
+         Interval ext = b->extent (common, X_AXIS);
+         span_points[d] = -d * pad
            + robust_relative_extent (b, common, X_AXIS)
            .linear_combination (encl);
        }
     }
   while (flip (&d) != LEFT);
 
-
   Stencil m;
   SCM properties = Font_interface::text_font_alist_chain (me);
   SCM edge_text = me->get_property ("edge-text");
@@ -106,12 +100,12 @@ Dynamic_text_spanner::print (SCM smob)
        {
          if (broken[d])
            continue;
-         
+
          SCM text = index_get_cell (edge_text, d);
 
-         if (Text_interface::markup_p (text)) 
+         if (Text_interface::markup_p (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);
        }
@@ -121,22 +115,21 @@ Dynamic_text_spanner::print (SCM smob)
   do
     {
       Interval ext = edge[d].extent (X_AXIS);
-      Real pad = robust_scm2double (me->get_property ("bound-padding"), 0.0);      
+      Real pad = robust_scm2double (me->get_property ("bound-padding"), 0.0);
       if (!ext.is_empty ())
        {
          edge[d].translate_axis (span_points[d], X_AXIS);
          m.add_stencil (edge[d]);
-         span_points[d] += -d *  (ext[-d] + pad);
+         span_points[d] += -d * (ext[-d] + pad);
        }
     }
   while (flip (&d) != LEFT);
 
-  
   if (!span_points.is_empty ())
     {
       Stencil l = Line_spanner::line_stencil (me,
-                                            Offset (span_points[LEFT], 0),
-                                            Offset (span_points[RIGHT], 0));
+                                             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);
index 1994e42df85bfc5a48b7a1506d5d8f7fe804d13f..2f204cec18a8a8cfa5f693c9ee81fa2c7d7beded 100644 (file)
@@ -1,6 +1,6 @@
 /*
   engraver-group-engraver.cc -- implement Engraver_group_engraver
-  
+
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
@@ -21,7 +21,6 @@ Engraver_group_engraver::announce_grob (Grob_info info)
   get_daddy_engraver ()->announce_grob (info);
 }
 
-
 SCM find_acknowledge_engravers (SCM gravlist, SCM meta);
 SCM find_accept_engravers (SCM gravlist, SCM music_descr);
 
@@ -29,17 +28,16 @@ void
 Engraver_group_engraver::acknowledge_grobs ()
 {
   if (!announce_infos_.size ())
-    return ;
-  
+    return;
+
   SCM tab = get_property ("acknowledgeHashTable");
   SCM name_sym = ly_symbol2scm ("name");
-  SCM meta_sym = ly_symbol2scm ("meta");  
+  SCM meta_sym = ly_symbol2scm ("meta");
 
-  
   for (int j = 0; j < announce_infos_.size (); j++)
     {
       Grob_info info = announce_infos_[j];
-      
+
       SCM meta = info.grob_->internal_get_property (meta_sym);
       SCM nm = scm_assoc (name_sym, meta);
       if (scm_is_pair (nm))
@@ -54,10 +52,10 @@ Engraver_group_engraver::acknowledge_grobs ()
 
            We ignore the grob anyway. He who has no name, shall not
            be helped.  */
-         
+
          continue;
        }
+
       SCM acklist = scm_hashq_ref (tab, nm, SCM_UNDEFINED);
       if (acklist == SCM_BOOL_F)
        {
@@ -67,19 +65,18 @@ Engraver_group_engraver::acknowledge_grobs ()
 
       for (SCM p = acklist; scm_is_pair (p); p = scm_cdr (p))
        {
-         Translator * t = unsmob_translator (scm_car (p));
-         Engraver * eng = dynamic_cast<Engraver*> (t);
+         Translator *t = unsmob_translator (scm_car (p));
+         Engraver *eng = dynamic_cast<Engraver *> (t);
          if (eng && eng != info.origin_trans_)
            eng->acknowledge_grob (info);
        }
     }
 }
 
-
 /*
   Ugh. This is slightly expensive. We could/should cache the value of
   the group count?
- */
+*/
 int
 Engraver_group_engraver::pending_grob_count () const
 {
@@ -88,47 +85,47 @@ Engraver_group_engraver::pending_grob_count () const
        scm_is_pair (s); s = scm_cdr (s))
     {
       Context *c = unsmob_context (scm_car (s));
-      Engraver_group_engraver * group
-       = dynamic_cast<Engraver_group_engraver*> (c->implementation ());
+      Engraver_group_engraver *group
+       = dynamic_cast<Engraver_group_engraver *> (c->implementation ());
 
       if (group)
-       count += group->pending_grob_count (); 
+       count += group->pending_grob_count ();
     }
-  return count; 
+  return count;
 }
 
 void
 Engraver_group_engraver::do_announces ()
 {
-  do {
-    for (SCM s = context ()->children_contexts ();
-        scm_is_pair (s); s = scm_cdr (s))
-      {
-       Context *c = unsmob_context (scm_car (s));
-       Engraver_group_engraver * group
-         = dynamic_cast<Engraver_group_engraver*> (c->implementation ());
-       if (group)
-         group->do_announces ();
-      }
-
-    do
-      {
-       engraver_each (get_simple_trans_list (),
-                      &Engraver::process_acknowledged_grobs);
-
-      
-       if (announce_infos_.size () == 0)
-         break;
-
-       acknowledge_grobs ();
-       announce_infos_.clear ();
-      }
-    while (1);
-
-  } while (pending_grob_count () > 0);
-}
+  do
+    {
+      for (SCM s = context ()->children_contexts ();
+          scm_is_pair (s); s = scm_cdr (s))
+       {
+         Context *c = unsmob_context (scm_car (s));
+         Engraver_group_engraver *group
+           = dynamic_cast<Engraver_group_engraver *> (c->implementation ());
+         if (group)
+           group->do_announces ();
+       }
 
+      do
+       {
+         engraver_each (get_simple_trans_list (),
+                        &Engraver::process_acknowledged_grobs);
 
+         if (announce_infos_.size () == 0)
+           break;
+
+         acknowledge_grobs ();
+         announce_infos_.clear ();
+       }
+      while (1);
+
+    }
+  while (pending_grob_count () > 0);
+
+}
 
 void
 Engraver_group_engraver::initialize ()
@@ -142,20 +139,17 @@ Engraver_group_engraver::initialize ()
 Engraver_group_engraver::Engraver_group_engraver () {}
 
 ADD_TRANSLATOR (Engraver_group_engraver,
-/* descr */       "A group of engravers taken together",
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
-
-
+               /* descr */ "A group of engravers taken together",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
 
 /*****************/
 
-
 bool
-engraver_valid (Translator*tr, SCM ifaces)
+engraver_valid (Translator *tr, SCM ifaces)
 {
   SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description ());
   ack_ifs = scm_cdr (ack_ifs);
@@ -165,33 +159,29 @@ engraver_valid (Translator*tr, SCM ifaces)
   return false;
 }
 
-
-
 SCM
 find_acknowledge_engravers (SCM gravlist, SCM meta_alist)
 {
   SCM ifaces = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta_alist));
 
   SCM l = SCM_EOL;
-  for (SCM s = gravlist; scm_is_pair (s);  s = scm_cdr (s))
+  for (SCM s = gravlist; scm_is_pair (s); s = scm_cdr (s))
     {
-      Translatortr = unsmob_translator (scm_car (s));
+      Translator *tr = unsmob_translator (scm_car (s));
       if (engraver_valid (tr, ifaces))
-       l = scm_cons (tr->self_scm (), l); 
+       l = scm_cons (tr->self_scm (), l);
     }
   l = scm_reverse_x (l, SCM_EOL);
 
   return l;
 }
 
-
 /* c&p engraver-group.cc */
 void
-recurse_down_engravers (Context * c, Engraver_method ptr, bool context_first)
+recurse_down_engravers (Context *c, Engraver_method ptr, bool context_first)
 {
-  Engraver_group_engraver * tg
-    = dynamic_cast<Engraver_group_engraver*> (c->implementation ());
-
+  Engraver_group_engraver *tg
+    = dynamic_cast<Engraver_group_engraver *> (c->implementation ());
 
   if (!context_first)
     {
@@ -201,7 +191,7 @@ recurse_down_engravers (Context * c, Engraver_method ptr, bool context_first)
       (tg->*ptr) ();
     }
 
-  for (SCM s = c->children_contexts () ; scm_is_pair (s);
+  for (SCM s = c->children_contexts (); scm_is_pair (s);
        s = scm_cdr (s))
     {
       recurse_down_engravers (unsmob_context (scm_car (s)), ptr, context_first);
@@ -215,13 +205,12 @@ recurse_down_engravers (Context * c, Engraver_method ptr, bool context_first)
     }
 }
 
-
 void
 engraver_each (SCM list, Engraver_method method)
 {
   for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
     {
-      Engraver * e = dynamic_cast<Engraver*>(unsmob_translator (scm_car (p)));
+      Engraver *e = dynamic_cast<Engraver *> (unsmob_translator (scm_car (p)));
       if (e)
        (e->*method) ();
     }
index 952afbf110b0ae02162eea413c87c8605ebcf4f6..bfd30de8988d278d01e59c8c0bb226afada4cc52 100644 (file)
 #include "score-context.hh"
 #include "lilypond-key.hh"
 
-Engraver_group_engraver*
+Engraver_group_engraver *
 Engraver::get_daddy_engraver () const
 {
-  return dynamic_cast<Engraver_group_engraver*> (get_daddy_translator ());
+  return dynamic_cast<Engraver_group_engraver *> (get_daddy_translator ());
 }
 
 void
@@ -29,13 +29,12 @@ Engraver::announce_grob (Grob_info inf)
   get_daddy_engraver ()->announce_grob (inf);
 }
 
-
 /*
   CAUSE is the object (typically a Music object)  that
   was the reason for making E.
- */
+*/
 void
-Engraver::announce_grob (Grobe, SCM cause)
+Engraver::announce_grob (Grob *e, SCM cause)
 {
   if (unsmob_music (cause) || unsmob_grob (cause))
     e->set_property ("cause", cause);
@@ -45,29 +44,24 @@ Engraver::announce_grob (Grob* e, SCM cause)
   if (!i.origin_trans_)
     i.origin_trans_ = this;
 
-  Engraver * g = get_daddy_engraver ();
+  Engraver *g = get_daddy_engraver ();
   if (g)
     g->announce_grob (i);
 }
 
 
-
-
 Engraver::Engraver ()
 {
 }
 
-
-Score_engraver* 
+Score_engraver *
 Engraver::get_score_engraver () const
 {
-  return dynamic_cast<Score_engraver*> (get_score_context ()->implementation ());
+  return dynamic_cast<Score_engraver *> (get_score_context ()->implementation ());
 }
 
-
 ADD_TRANSLATOR (Engraver,
-                  "", "",
-                 "",
-                 "", "", "");
+               "", "",
+               "",
+               "", "", "");
 
index d65ce82507aeea23da8b57eeba610d579b531d65..b48074905c90ffbf0851e50aeaae89a8e11600a3 100644 (file)
@@ -34,20 +34,19 @@ Event_chord_iterator::construct_children ()
   get_req_translator ();
 }
 
-Event_chord*
+Event_chord *
 Event_chord_iterator::get_elt () const
 {
-  return (Event_chord*) get_music ();
+  return (Event_chord *) get_music ();
 }
 
-
 void
 Event_chord_iterator::process (Moment m)
 {
   if (last_processed_mom_ < Moment (0))
     {
       for (SCM s = get_music ()->get_property ("elements");
-          scm_is_pair (s);  s = scm_cdr (s))
+          scm_is_pair (s); s = scm_cdr (s))
        {
          Music *mus = unsmob_music (scm_car (s));
 
index bdadc3283c686c0be4bab3abe3cdcdbe8eb1e135..314ed194d611d4674af1619aab9a5cc2264c654d 100644 (file)
@@ -9,11 +9,11 @@
 #include "event.hh"
 #include "warn.hh"
 
-MAKE_SCHEME_CALLBACK(Event, length_callback, 1);
+MAKE_SCHEME_CALLBACK (Event, length_callback, 1);
 SCM
 Event::length_callback (SCM m)
 {
-  Musicme = unsmob_music (m);
+  Music *me = unsmob_music (m);
   Duration *d = unsmob_duration (me->get_property ("duration"));
 
   Moment mom;
@@ -21,9 +21,9 @@ Event::length_callback (SCM m)
     {
       mom = d->get_length ();
     }
-  return mom.smobbed_copy();
+  return mom.smobbed_copy ();
 }
-  
+
 Event::Event (SCM i)
   : Music (i)
 {
@@ -35,5 +35,3 @@ Event::Event (SCM i)
 
 ADD_MUSIC (Event);
 
-
-
index 6ec00234b76ae4d11b7b0677ec336ef29e57e857..6058843e875a1f2de716214b78de8af13cc09cbe 100644 (file)
@@ -2,10 +2,10 @@
   extender-engraver.cc -- implement Extender_engraver
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Glen Prideaux <glenprideaux@iname.com>,
-                  Han-Wen Nienhuys <hanwen@cs.uu.nl>,
-                  Jan Nieuwenhuizen <janneke@gnu.org>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>,
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "context.hh"
@@ -30,12 +30,11 @@ public:
 protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void finalize ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void process_music ();
 };
 
-
 Extender_engraver::Extender_engraver ()
 {
   extender_ = 0;
@@ -64,7 +63,7 @@ Extender_engraver::process_music ()
 void
 Extender_engraver::acknowledge_grob (Grob_info i)
 {
-  Item *item = dynamic_cast<Item*> (i.grob_);
+  Item *item = dynamic_cast<Item *> (i.grob_);
 
   if (item
       && item->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
@@ -96,14 +95,14 @@ Extender_engraver::stop_translation_timestep ()
              Pointer_group_interface::add_grob (extender_,
                                                 ly_symbol2scm ("heads"), h);
            }
-         
+
          if (pending_extender_)
            {
              Pointer_group_interface::add_grob (pending_extender_,
                                                 ly_symbol2scm ("heads"), h);
            }
        }
-      
+
       if (extender_)
        {
          pending_extender_ = extender_;
@@ -122,7 +121,7 @@ completize_extender (Spanner *sp)
       SCM heads = sp->get_property ("heads");
       if (scm_is_pair (heads))
        {
-         Item *it = dynamic_cast<Item*> (unsmob_grob (scm_car (heads)));
+         Item *it = dynamic_cast<Item *> (unsmob_grob (scm_car (heads)));
          if (it)
            sp->set_bound (RIGHT, it);
        }
@@ -151,11 +150,10 @@ Extender_engraver::finalize ()
     }
 }
 
-
 ADD_TRANSLATOR (Extender_engraver,
-/* descr */       "Create lyric extenders",
-/* creats*/       "LyricExtender",
-/* accepts */     "extender-event",
-/* acks  */       "lyric-syllable-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create lyric extenders",
+               /* creats*/ "LyricExtender",
+               /* accepts */ "extender-event",
+               /* acks  */ "lyric-syllable-interface",
+               /* reads */ "",
+               /* write */ "");
index f2b849f132f1b6980eb68a1b3b3e2adc489a8887..8c001bb4dbc6795f464d6690580ce05001ed17fc 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-figured-bass-engraver.cc -- implement Figured_bass_engraver
+/*
+  figured-bass-engraver.cc -- implement Figured_bass_engraver
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "engraver.hh"
 #include "text-item.hh"
@@ -17,16 +16,15 @@ class Figured_bass_engraver : public Engraver
   TRANSLATOR_DECLARATIONS (Figured_bass_engraver);
 protected:
   Link_array<Music> figures_;
-  Music * rest_req_;
+  Music *rest_req_;
+
+  Grob *figure_;
 
-  Grob * figure_;
-  
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void process_music ();
 };
 
-
 Figured_bass_engraver::Figured_bass_engraver ()
 {
   figure_ = 0;
@@ -43,7 +41,7 @@ Figured_bass_engraver::stop_translation_timestep ()
 }
 
 bool
-Figured_bass_engraver::try_music (Music*m)
+Figured_bass_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("bass-figure-event"))
     {
@@ -64,15 +62,15 @@ Figured_bass_engraver::process_music ()
   if (rest_req_)
     {
       figure_ = make_item ("BassFigure", rest_req_->self_scm ());
-      figure_->set_property ("text" , scm_makfrom0str ("-"));
+      figure_->set_property ("text", scm_makfrom0str ("-"));
     }
   else if (figures_.size ())
     {
       SCM proc = get_property ("bassFigureFormatFunction");
-      if (ly_c_procedure_p (proc)) 
+      if (ly_c_procedure_p (proc))
        {
          SCM l = SCM_EOL;
-         SCM * t = &l;
+         SCM *t = &l;
          for (int i = 0; i < figures_.size (); i++)
            {
              *t = scm_cons (figures_[i]->self_scm (), SCM_EOL);
@@ -85,11 +83,10 @@ Figured_bass_engraver::process_music ()
     }
 }
 
-  
 ADD_TRANSLATOR (Figured_bass_engraver,
-/* descr */       "Make figured bass numbers.",
-/* creats*/       "BassFigure",
-/* accepts */     "rest-event bass-figure-event",
-/* acks  */      "",
-/* reads */       "bassFigureFormatFunction",
-/* write */       "");
+               /* descr */ "Make figured bass numbers.",
+               /* creats*/ "BassFigure",
+               /* accepts */ "rest-event bass-figure-event",
+               /* acks  */ "",
+               /* reads */ "bassFigureFormatFunction",
+               /* write */ "");
index 503138b3e091da973480976d7dc3595125ae1dbc..bcfb63a711e9d8dc2cf2cffc25f1644599310142 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   fingering-engraver.cc -- implement Fingering_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "side-position-interface.hh"
@@ -21,14 +20,14 @@ class Fingering_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (Fingering_engraver);
 protected:
-  virtual bool try_music (Musicm);
+  virtual bool try_music (Music *m);
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
   virtual void process_music ();
   virtual void acknowledge_grob (Grob_info);
 
 private:
-  void make_script (Direction, Music*, int);
+  void make_script (Direction, Music *, int);
 };
 
 bool
@@ -56,7 +55,7 @@ Fingering_engraver::acknowledge_grob (Grob_info inf)
     {
       for (int i = 0; i < fingerings_.size (); i++)
        {
-         Grob*t = fingerings_[i];
+         Grob *t = fingerings_[i];
          Side_position_interface::add_support (t, inf.grob_);
          if (!t->get_parent (X_AXIS))
            t->set_parent (inf.grob_, X_AXIS);
@@ -74,7 +73,6 @@ Fingering_engraver::process_music ()
     }
 }
 
-
 void
 Fingering_engraver::make_script (Direction d, Music *r, int i)
 {
@@ -86,14 +84,14 @@ Fingering_engraver::make_script (Direction d, Music *r, int i)
     Huh, what's this for? --hwn.
 
     junkme.
-   */
+  */
   SCM pitch = r->get_property ("pitch");
   if (unsmob_pitch (pitch))
     fingering->set_property ("pitch", pitch);
 
   /*
     We can't fold these definitions into define-grobs since
-    fingerings for chords need different settings. 
+    fingerings for chords need different settings.
   */
   Side_position_interface::set_axis (fingering, a);
   fingering->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, other);
@@ -104,22 +102,21 @@ Fingering_engraver::make_script (Direction d, Music *r, int i)
   SCM s = fingering->get_property ("script-priority");
   if (scm_is_number (s))
     priority = scm_to_int (s);
-  
+
   /* See script-engraver.cc */
   priority += i;
 
   fingering->set_property ("script-priority", scm_int2num (priority));
 
-
   if (!is_direction (fingering->get_property ("direction")))
     {
       if (d)
        fingering->set_property ("direction", scm_int2num (d));
       else
-       fingering->set_property ("direction",  scm_int2num (RIGHT));
+       fingering->set_property ("direction", scm_int2num (RIGHT));
     }
 
-  SCM dig =  r->get_property ("digit");
+  SCM dig = r->get_property ("digit");
   fingering->set_property ("text", scm_number_to_string (dig, scm_int2num (10)));
 
   fingerings_.push (fingering);
@@ -130,7 +127,7 @@ Fingering_engraver::stop_translation_timestep ()
 {
   if (!fingerings_.size ())
     return;
-  
+
   fingerings_.clear ();
 }
 
@@ -146,9 +143,9 @@ Fingering_engraver::Fingering_engraver ()
 }
 
 ADD_TRANSLATOR (Fingering_engraver,
-/* descr */       "Create fingering-scripts",
-/* creats*/       "Fingering",
-/* accepts */     "fingering-event",
-/* acks  */      "rhythmic-head-interface stem-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create fingering-scripts",
+               /* creats*/ "Fingering",
+               /* accepts */ "fingering-event",
+               /* acks  */ "rhythmic-head-interface stem-interface",
+               /* reads */ "",
+               /* write */ "");
index fd1aaa67703e148204769aec3c7a88d0b49b1c70..3963c5dd4b719b9407cd4854eb103d93a53be04f 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-     folded-repeat-iterator.cc -- implement Folded_repeat_iterator
-  
+/*
+  folded-repeat-iterator.cc -- implement Folded_repeat_iterator
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "folded-repeat-iterator.hh"
 
@@ -46,7 +45,7 @@ Folded_repeat_iterator::pending_moment () const
 void
 Folded_repeat_iterator::construct_children ()
 {
-  Music  *mus = get_music ();
+  Music *mus = get_music ();
   main_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (mus)));
   if (!main_iter_->ok ())
     {
@@ -58,13 +57,13 @@ Folded_repeat_iterator::construct_children ()
 void
 Folded_repeat_iterator::process (Moment m)
 {
-  if (!m.to_bool () )
+  if (!m.to_bool ())
     {
       bool success = try_music (get_music ());
       if (!success)
        get_music ()->origin ()->warning (_ ("no one to print a repeat brace"));
     }
-  
+
   if (main_iter_)
     {
       main_iter_->process (m);
@@ -76,7 +75,7 @@ Folded_repeat_iterator::process (Moment m)
     {
       enter_alternative ();
     }
-  
+
   if (alternative_iter_)
     {
       alternative_iter_->process (m - main_length_mom_);
@@ -95,22 +94,22 @@ Folded_repeat_iterator::leave_body ()
 
   main_iter_->quit ();
   main_iter_ = 0;
-  main_length_mom_ +=  Repeated_music::body (mus)->get_length ();
+  main_length_mom_ += Repeated_music::body (mus)->get_length ();
 }
 
 void
 Folded_repeat_iterator::enter_alternative ()
 {
-  Music *mus = get_music (); 
+  Music *mus = get_music ();
   if (scm_is_pair (Repeated_music::alternatives (mus)))
     {
       /*
        ugh.
-      */ 
-      Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
+      */
+      Simultaneous_music_iterator *s = new Simultaneous_music_iterator;
       s->create_separate_contexts_ = true;
       s->init_translator (mus, get_outlet ());
-      
+
       alternative_iter_ = s;
       alternative_iter_->construct_children ();
 
@@ -118,9 +117,8 @@ Folded_repeat_iterator::enter_alternative ()
     }
 }
 
-
-Music_iterator*
-Folded_repeat_iterator::try_music_in_children (Music * m) const
+Music_iterator *
+Folded_repeat_iterator::try_music_in_children (Music *m) const
 {
   if (main_iter_)
     {
@@ -140,7 +138,7 @@ Folded_repeat_iterator::derived_mark () const
 }
 
 void
-Folded_repeat_iterator::derived_substitute (Context *f, Context *t) 
+Folded_repeat_iterator::derived_substitute (Context *f, Context *t)
 {
   if (main_iter_)
     main_iter_->substitute_outlet (f, t);
index f46beaffd2442ee876e23f2ec51e69c9e79064b1..ca6253fc997e01b819d2028f49d4717a186fa79c 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "config.hh"
@@ -30,13 +29,13 @@ init_fontconfig ()
   dirs.push (prefix_directory + "/mf/out/");
   dirs.push (prefix_directory + "/fonts/type1/");
   dirs.push (prefix_directory + "/fonts/cff/");
-  
+
   for (int i = 0; i < dirs.size (); i++)
     {
       String dir = dirs[i];
-      if (!FcConfigAppFontAddDir (fcc, (FcChar8*)dir.to_str0 ()))
+      if (!FcConfigAppFontAddDir (fcc, (FcChar8 *)dir.to_str0 ()))
        error (_f ("Failed to add lilypond directory %s", dir));
-    }     
+    }
 }
 
 #else
index e48f8e0116669eab582d6923cbeea52714ca6b51..878c3031a413fc42c2866dcfae9f890cecf712d4 100644 (file)
@@ -1,6 +1,6 @@
 /*
   font-interface.cc -- implement Font_interface
-  
+
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
@@ -21,17 +21,17 @@ Font_interface::get_default_font (Grob *me)
   if (!fm)
     {
       SCM chain = music_font_alist_chain (me);
-      
+
       fm = select_font (me->get_layout (), chain);
       me->set_property ("font", fm->self_scm ());
     }
-  
+
   return fm;
 }
 
 LY_DEFINE (ly_font_interface_get_default_font, "ly:get-default-font",
-         , 0, 0, (SCM grob),
-         "Return the default font for grob @var{gr}.")
+          1, 0, 0, (SCM grob),
+          "Return the default font for grob @var{gr}.")
 {
   Grob *gr = unsmob_grob (grob);
   SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
@@ -39,7 +39,6 @@ LY_DEFINE (ly_font_interface_get_default_font, "ly:get-default-font",
   return Font_interface::get_default_font (gr)->self_scm ();
 }
 
-
 SCM
 Font_interface::music_font_alist_chain (Grob *g)
 {
index fa1d9be03b9683ad16661939756071f6f8fcba87..6b7c606423662bba1ff131bbfeddaea8fb45f5c2 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "stencil.hh"
@@ -13,7 +12,7 @@
 
 LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph",
           2, 0, 0,
-         (SCM font, SCM name),
+          (SCM font, SCM name),
           "Return a Stencil from @var{font} for the glyph named @var{name}.  "
           "@var{font} must be available as an AFM file.  If the glyph "
           "is not available, return @code{#f}.")
@@ -30,7 +29,7 @@ LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph",
 
 LY_DEFINE (ly_get_glyph, "ly:get-glyph",
           2, 0, 0,
-         (SCM font, SCM index),
+          (SCM font, SCM index),
           "Retrieve a Stencil for the glyph numbered @var{index} "
           "in @var{font}.")
 {
@@ -43,7 +42,7 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph",
 
 LY_DEFINE (ly_font_glyph_name_to_index, "ly:font-glyph-name-to-index",
           2, 0, 0,
-         (SCM font, SCM name),
+          (SCM font, SCM name),
           "Return the index for @var{name} in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
@@ -55,7 +54,7 @@ LY_DEFINE (ly_font_glyph_name_to_index, "ly:font-glyph-name-to-index",
 
 LY_DEFINE (ly_font_index_to_charcode, "ly:font-index-to-charcode",
           2, 0, 0,
-         (SCM font, SCM index),
+          (SCM font, SCM index),
           "Return the character code for @var{index} @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
@@ -67,7 +66,7 @@ LY_DEFINE (ly_font_index_to_charcode, "ly:font-index-to-charcode",
 
 LY_DEFINE (ly_font_glyph_name_to_charcode, "ly:font-glyph-name-to-charcode",
           2, 0, 0,
-         (SCM font, SCM name),
+          (SCM font, SCM name),
           "Return the character code for glyph @var{name} in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
@@ -82,15 +81,15 @@ LY_DEFINE (ly_font_glyph_name_to_charcode, "ly:font-glyph-name-to-charcode",
 
 LY_DEFINE (ly_text_dimension, "ly:text-dimension",
           2, 0, 0,
-         (SCM font, SCM text),
-         "Given the font metric in @var{font} and the string @var{text}, "
+          (SCM font, SCM text),
+          "Given the font metric in @var{font} and the string @var{text}, "
           "compute the extents of that text in that font.  "
           "The return value is a pair of number-pairs.")
 {
   Box b;
-  Modified_font_metric*fm = dynamic_cast<Modified_font_metric*>
+  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");
   Stencil stc (fm->text_stencil (ly_scm2string (text)));
@@ -106,10 +105,9 @@ LY_DEFINE (ly_font_file_name, "ly:font-file-name",
 {
   Font_metric *fm = unsmob_metrics (font);
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  return fm->font_file_name();
+  return fm->font_file_name ();
 }
 
-
 LY_DEFINE (ly_font_name, "ly:font-name",
           1, 0, 0,
           (SCM font),
@@ -117,13 +115,13 @@ LY_DEFINE (ly_font_name, "ly:font-name",
           "return the corresponding name.")
 {
   Font_metric *fm = unsmob_metrics (font);
-      
+
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  return scm_makfrom0str (fm->font_name().to_str0 ());
+  return scm_makfrom0str (fm->font_name ().to_str0 ());
 }
 
 LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
-         (SCM font),
+          (SCM font),
           "Given the font metric @var{font}, return the "
           "magnification, relative to the current outputscale.")
 {
@@ -133,7 +131,7 @@ LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
 }
 
 LY_DEFINE (ly_font_design_size, "ly:font-design-size", 1, 0, 0,
-         (SCM font),
+          (SCM font),
           "Given the font metric @var{font}, return the "
           "design size, relative to the current outputscale.")
 {
index 73743ab5b23172a8a97197ada23fb9857a45498c..a08589fe815261380fb99e3efc72c2d74a46f001 100644 (file)
@@ -1,11 +1,11 @@
-/*   
+/*
   font-metric.cc -- implement Font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
-    Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
+  Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
 */
 
 #include "font-metric.hh"
@@ -28,24 +28,22 @@ Font_metric::design_size () const
   return 1.0 * point_constant;
 }
 
-
 Stencil
 Font_metric::find_by_name (String s) const
 {
   s.substitute_char ('-', "M");
   int idx = name_to_index (s);
   Box b;
-  
+
   SCM expr = SCM_EOL;
   if (idx >= 0)
     {
       expr = scm_list_3 (ly_symbol2scm ("named-glyph"),
                         self_scm (),
-                        scm_makfrom0str (s.to_str0 ())
-                        );
+                        scm_makfrom0str (s.to_str0 ()));
       b = get_indexed_char (idx);
     }
-  
+
   Stencil q (b, expr);
   return q;
 }
@@ -61,7 +59,6 @@ Font_metric::Font_metric (Font_metric const &)
 {
 }
 
-
 Font_metric::~Font_metric ()
 {
 }
@@ -72,13 +69,13 @@ Font_metric::count () const
   return 0;
 }
 
-Box 
+Box
 Font_metric::get_ascii_char (int) const
 {
   return Box (Interval (0, 0), Interval (0, 0));
 }
 
-Box 
+Box
 Font_metric::get_indexed_char (int k) const
 {
   return get_ascii_char (k);
@@ -104,7 +101,7 @@ Font_metric::derived_mark () const
 SCM
 Font_metric::mark_smob (SCM s)
 {
-  Font_metric *m = (Font_metric*) SCM_CELL_WORD_1 (s);
+  Font_metric *m = (Font_metric *) SCM_CELL_WORD_1 (s);
   m->derived_mark ();
   return m->description_;
 }
@@ -121,14 +118,11 @@ Font_metric::print_smob (SCM s, SCM port, scm_print_state *)
   return 1;
 }
 
-
-
 IMPLEMENT_SMOBS (Font_metric);
 IMPLEMENT_DEFAULT_EQUAL_P (Font_metric);
 IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?");
 
-
-SCM 
+SCM
 Font_metric::font_file_name () const
 {
   return scm_car (description_);
@@ -143,7 +137,6 @@ Font_metric::font_name () const
 
 #include "afm.hh"
 
-
 int
 Font_metric::index_to_ascii (int i) const
 {
@@ -174,7 +167,6 @@ Font_metric::get_indexed_char_stencil (int code) const
   return Stencil (b, at);
 }
 
-
 Offset
 Font_metric::attachment_point (String) const
 {
@@ -193,7 +185,7 @@ Font_metric::text_stencil (String str) const
   SCM lst = scm_list_3 (ly_symbol2scm ("text"),
                        this->self_scm (),
                        scm_makfrom0str (str.to_str0 ()));
-  
+
   Box b = text_dimension (str);
   return Stencil (b, lst);
 }
index 262930983e3ff82919c39cbdae9f96c3fd99e9c1..9b5257c9c11a63f75aa1a94541f542a2ca83a902 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  font-select.cc -- implement property -> font_metric routines. 
+  font-select.cc -- implement property -> font_metric routines.
 
   source file of the GNU LilyPond music typesetter
 
@@ -16,7 +16,6 @@
 #include "pango-font.hh"
 #include "main.hh"
 
-
 Font_metric *
 get_font_by_design_size (Output_def *layout, Real requested,
                         SCM font_vector)
@@ -31,7 +30,7 @@ get_font_by_design_size (Output_def *layout, Real requested,
   for (; i < n; i++)
     {
       SCM entry = scm_c_vector_ref (font_vector, i);
-      
+
       if (scm_promise_p (entry) == SCM_BOOL_T)
        {
          Font_metric *fm = unsmob_metrics (scm_force (entry));
@@ -47,7 +46,7 @@ get_font_by_design_size (Output_def *layout, Real requested,
            = scm_cdr (entry);
        }
 #endif
-      
+
       if (size > requested)
        break;
       last_size = size;
@@ -65,7 +64,7 @@ get_font_by_design_size (Output_def *layout, Real requested,
          pango_description_string = last_pango_description_string;
        }
     }
-  
+
   Font_metric *fm = 0;
   if (scm_is_string (pango_description_string))
     {
@@ -74,7 +73,7 @@ get_font_by_design_size (Output_def *layout, Real requested,
                              pango_description_string,
                              requested / size);
 #else
-      error ("Trying to retrieve pango font without HAVE_PANGO_FT2."); 
+      error ("Trying to retrieve pango font without HAVE_PANGO_FT2.");
 #endif
     }
   else
@@ -128,12 +127,12 @@ select_encoded_font (Output_def *layout, SCM chain)
                     ? robust_scm2double (scm_cdr (mag), 1.0)
                     : 1);
        Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
-               
+
        return find_scaled_font (layout, fm, rmag);
       }
     else if (scm_instance_p (name))
       {
-       SCM base_size  = scm_slot_ref (name, ly_symbol2scm ("default-size"));
+       SCM base_size = scm_slot_ref (name, ly_symbol2scm ("default-size"));
        SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector"));
 
        SCM font_size = ly_chain_assoc (ly_symbol2scm ("font-size"), chain);
index 2b09d6087d2278e0fa7af2220fa93a591048549f..6d02eab213bdc304a8014c1e55c381f60aace933 100644 (file)
@@ -1,25 +1,23 @@
-/*   
+/*
   font-size-engraver.cc -- implement Font_size_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "grob.hh"
 #include "engraver.hh"
 
 class Font_size_engraver : public Engraver
 {
-  
+
   TRANSLATOR_DECLARATIONS (Font_size_engraver);
 protected:
   virtual void acknowledge_grob (Grob_info gi);
 private:
 };
 
-
 Font_size_engraver::Font_size_engraver ()
 {
 
@@ -32,24 +30,23 @@ Font_size_engraver::acknowledge_grob (Grob_info gi)
 
   /*
     We only want to process a grob once.
-   */
+  */
   if (gi.origin_trans_->context () != context ())
-    return ;
-  
+    return;
+
   if (scm_is_number (sz) && scm_to_double (sz))
     {
       Real font_size = scm_to_double (sz);
-      
-      font_size +=  robust_scm2double (gi.grob_->get_property ("font-size"), 0);
+
+      font_size += robust_scm2double (gi.grob_->get_property ("font-size"), 0);
       gi.grob_->set_property ("font-size", scm_make_real (font_size));
     }
 }
 
-
 ADD_TRANSLATOR (Font_size_engraver,
-/* descr */       "Puts fontSize into font-relative-size grob property.",
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "font-interface",
-/* reads */       "fontSize",
-/* write */       "");
+               /* descr */ "Puts fontSize into font-relative-size grob property.",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "font-interface",
+               /* reads */ "fontSize",
+               /* write */ "");
index 66d78a666031ee192483a73d02c1f814ff1e6460..fa4138bc48739631c785ea60cbfe94725b350182 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2002--_2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 #include "rhythmic-head.hh"
 #include "grob.hh"
@@ -24,14 +23,13 @@ Forbid_line_break_engraver::start_translation_timestep ()
 {
   /*
     Check for running note heads. This should probably be done elsewhere.
-   */
+  */
   SCM busy = get_property ("busyGrobs");
 
   Moment now = now_mom ();
   while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_)
     busy = scm_cdr (busy);
 
-  
   while (scm_is_pair (busy))
     {
       Grob *g = unsmob_grob (scm_cdar (busy));
@@ -43,11 +41,10 @@ Forbid_line_break_engraver::start_translation_timestep ()
     }
 }
 
-
 ADD_TRANSLATOR (Forbid_line_break_engraver,
-/* descr */       "Forbid line breaks when note heads are still playing at some point.",
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "busyGrobs",
-/* write */       "");
+               /* descr */ "Forbid line breaks when note heads are still playing at some point.",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "busyGrobs",
+               /* write */ "");
index 57db56909cb385af15343d2a3f4bd3a5251a81fb..d8a0029ba1a6c0696f2f522d71330977b0105473 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "freetype.hh"
 
 FT_Library freetype2_library;
 
-
 void
-init_freetype()
+init_freetype ()
 {
-  int errorcode = FT_Init_FreeType( &freetype2_library );
+  int errorcode = FT_Init_FreeType (&freetype2_library);
   if (errorcode)
     {
-      error("Could  not initialize freetype");
+      error ("Could  not initialize freetype");
     }
 }
 
index 5e57203fc2e55902e654d99e79ef1f5589c1f8ce..8daf4baf0cf73f87cbbfa508a91817f27400ccd8 100644 (file)
@@ -1,10 +1,9 @@
-/*   
+/*
   function-documentation.cc -- Scheme doc strings.
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include <cstring>
 #include "protected-scm.hh"
 #include "string.hh"
 
-static Protected_scm doc_hash_table ;
+static Protected_scm doc_hash_table;
 
 void ly_add_function_documentation (SCM func,
-                                   char const * fname,
-                                   char const * varlist,
-                                   char const * doc)
+                                   char const *fname,
+                                   char const *varlist,
+                                   char const *doc)
 {
   if (!strlen (doc))
     return;
-    
+
   if (!scm_is_vector (doc_hash_table))
     doc_hash_table = scm_make_vector (scm_int2num (59), SCM_EOL);
 
   String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist
-    + "\n" + doc ;
+    + "\n" + doc;
 
   scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
                                scm_makfrom0str (s.to_str0 ()));
@@ -34,10 +33,9 @@ void ly_add_function_documentation (SCM func,
   scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
 }
 
-
 LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
-         0, 0, 0, (),
-         "Get a hash table with all lilypond Scheme extension functions.")
+          0, 0, 0, (),
+          "Get a hash table with all lilypond Scheme extension functions.")
 {
   return doc_hash_table;
 }
index c47934c7ba1476c569f3feab019a3eeabe4ad1a4..d01961985252681729911af9c1f5e956183c507e 100644 (file)
@@ -2,21 +2,21 @@
 #include "paper-column.hh"
 
 extern "C" {
-// thanks to GDBs wonderful casting abilities, we need these:
-Item*
-to_item (Grob* g)
-{
-  return dynamic_cast<Item*> (g);
-}
-Spanner*
-to_spanner (Grob*g)
-{
-  return dynamic_cast<Spanner*> (g);
-}
+  // thanks to GDBs wonderful casting abilities, we need these:
+  Item *
+  to_item (Grob *g)
+  {
+    return dynamic_cast<Item *> (g);
+  }
+  Spanner *
+  to_spanner (Grob *g)
+  {
+    return dynamic_cast<Spanner *> (g);
+  }
 
-Paper_column*
-to_pc (Grob* g)
-{
-  return dynamic_cast<Paper_column*> (g);
-}
+  Paper_column *
+  to_pc (Grob *g)
+  {
+    return dynamic_cast<Paper_column *> (g);
+  }
 }
index eab9d896de1e9439b5ac0cd524289bc74c8de835..ba66ad8715c8489ab688b85cdd98094331671965 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "config.hh"
@@ -33,8 +33,6 @@ inline int my_isinf (Real r) { return isinf (r); }
 inline int my_isnan (Real r) { return isnan (r); }
 #endif
 
-
-
 LY_DEFINE (ly_find_file, "ly:find-file",
           1, 0, 0, (SCM name),
           "Return the absolute file name of @var{name}, "
@@ -46,14 +44,14 @@ LY_DEFINE (ly_find_file, "ly:find-file",
   String file_name = global_path.find (nm);
   if (file_name.is_empty ())
     return SCM_BOOL_F;
-  
+
   return scm_makfrom0str (file_name.to_str0 ());
 }
 
 /*
   Ugh. Gulped file is copied twice. (maybe thrice if you count stdio
   buffering.)
- */
+*/
 LY_DEFINE (ly_gulp_file, "ly:gulp-file",
           1, 0, 0, (SCM name),
           "Read the file @var{name}, and return its contents in a string.  "
@@ -92,14 +90,14 @@ LY_DEFINE (ly_programming_error, "ly:programming-error",
 
 LY_DEFINE (ly_dir_p, "ly:dir?",
           1, 0, 0, (SCM s),
-         "type predicate. A direction is @code{-1}, @code{0} or "
+          "type predicate. A direction is @code{-1}, @code{0} or "
           "@code{1}, where @code{-1} represents "
-         "left or down and @code{1} represents right or up.")
+          "left or down and @code{1} represents right or up.")
 {
   if (scm_is_number (s))
     {
       int i = scm_to_int (s);
-      return (i>= -1 && i <= 1)  ? SCM_BOOL_T : SCM_BOOL_F; 
+      return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
     }
   return SCM_BOOL_F;
 }
@@ -114,7 +112,7 @@ LY_DEFINE (ly_assoc_get, "ly:assoc-get",
 
   if (default_value == SCM_UNDEFINED)
     default_value = SCM_BOOL_F;
-  
+
   if (scm_is_pair (handle))
     return scm_cdr (handle);
   else
@@ -135,12 +133,12 @@ LY_DEFINE (ly_number2string, "ly:number->string",
 #ifdef __APPLE__
       if (my_isinf (r) || my_isnan (r))
 #else
-      if (isinf (r) || isnan (r))
+       if (isinf (r) || isnan (r))
 #endif
-       {
-         programming_error ("Infinity or NaN encountered while converting Real number; setting to zero.");
-         r = 0.0;
-       }
+         {
+           programming_error ("Infinity or NaN encountered while converting Real number; setting to zero.");
+           r = 0.0;
+         }
 
       snprintf (str, sizeof (str), "%08.4f", r);
     }
@@ -151,32 +149,32 @@ LY_DEFINE (ly_number2string, "ly:number->string",
 }
 
 LY_DEFINE (ly_version, "ly:version", 0, 0, 0, (),
-         "Return the current lilypond version as a list, e.g. @code{(1 3 127 uu1)}. ")
+          "Return the current lilypond version as a list, e.g. @code{(1 3 127 uu1)}. ")
 {
-  char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " "  PATCH_LEVEL " " MY_PATCH_LEVEL ")" ;
-  
-  return scm_c_eval_string ((char*)vs);
+  char const *vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")";
+
+  return scm_c_eval_string ((char *)vs);
 }
 
 LY_DEFINE (ly_unit, "ly:unit", 0, 0, 0, (),
-         "Return the unit used for lengths as a string.")
+          "Return the unit used for lengths as a string.")
 {
   return scm_makfrom0str (INTERNAL_UNIT);
 }
 
 LY_DEFINE (ly_dimension_p, "ly:dimension?", 1, 0, 0, (SCM d),
-         "Return @var{d} is a number. Used to distinguish length "
-         "variables from normal numbers.")
+          "Return @var{d} is a number. Used to distinguish length "
+          "variables from normal numbers.")
 {
   return scm_number_p (d);
 }
 
 /*
   Debugging mem leaks:
- */
+*/
 LY_DEFINE (ly_protects, "ly:protects",
           0, 0, 0, (),
-         "Return hash of protected objects.")
+          "Return hash of protected objects.")
 {
   return scm_protects;
 }
@@ -191,16 +189,16 @@ LY_DEFINE (ly_gettext, "ly:gettext",
 }
 
 LY_DEFINE (ly_output_backend, "ly:output-backend",
-           0, 0, 0, (),
-           "Return name of output backend.")
+          0, 0, 0, (),
+          "Return name of output backend.")
 {
   return scm_makfrom0str (output_backend_global.to_str0 ());
 }
 
 LY_DEFINE (ly_output_formats, "ly:output-formats",
-           0, 0, 0, (),
-           "Formats passed to --format as a list of strings, "
-           "used for the output.")
+          0, 0, 0, (),
+          "Formats passed to --format as a list of strings, "
+          "used for the output.")
 {
   Array<String> output_formats = split_string (output_format_global, ',');
 
index 5f2a295ba7cdc15df0344be9f1c0dbac8b470e2d..5c339149b3683488c9919495b02b24d44c99a96f 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   note-head-line-engraver.cc -- implement Note_head_line_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "warn.hh"
 #include "spanner.hh"
@@ -27,9 +27,9 @@ protected:
   virtual bool try_music (Music *);
   virtual void process_music ();
 private:
-  Spanner *line_; 
-  Spanner *last_line_; 
-  Musicevent_;
+  Spanner *line_;
+  Spanner *last_line_;
+  Music *event_;
 };
 
 Glissando_engraver::Glissando_engraver ()
@@ -39,7 +39,7 @@ Glissando_engraver::Glissando_engraver ()
 }
 
 bool
-Glissando_engraver::try_music (Musicm)
+Glissando_engraver::try_music (Music *m)
 {
   if (!event_)
     {
@@ -58,22 +58,20 @@ Glissando_engraver::process_music ()
     }
 }
 
-
 void
 Glissando_engraver::acknowledge_grob (Grob_info info)
 {
   if (Rhythmic_head::has_interface (info.grob_))
     {
-      Grob * g = info.grob_;
+      Grob *g = info.grob_;
       if (line_)
        line_->set_bound (LEFT, g);
 
       if (last_line_)
        last_line_->set_bound (RIGHT, g);
-    }    
+    }
 }
 
-
 void
 Glissando_engraver::stop_translation_timestep ()
 {
@@ -83,7 +81,7 @@ Glissando_engraver::stop_translation_timestep ()
     }
   if (line_)
     {
-      if ( last_line_)
+      if (last_line_)
        programming_error ("Overwriting glissando.");
       last_line_ = line_;
     }
@@ -96,24 +94,22 @@ Glissando_engraver::finalize ()
 {
   if (line_)
     {
-      String msg = _("Unterminated glissando.");
-      
+      String msg = _ ("Unterminated glissando.");
+
       if (event_)
        event_->origin ()->warning (msg);
       else
        warning (msg);
-      
+
       line_->suicide ();
       line_ = 0;
     }
 }
 
-
-
 ADD_TRANSLATOR (Glissando_engraver,
-/* descr */       "Engrave a glissandi",
-/* creats*/       "Glissando",
-/* accepts */     "glissando-event",
-/* acks  */       "rhythmic-head-interface",
-/* reads */       "followVoice",
-/* write */       "");
+               /* descr */ "Engrave a glissandi",
+               /* creats*/ "Glissando",
+               /* accepts */ "glissando-event",
+               /* acks  */ "rhythmic-head-interface",
+               /* reads */ "followVoice",
+               /* write */ "");
index c543d736484723f836c9373d2fa8f1380afd67c1..bf633f546023e1315b5b7b63f4441d182023ad35 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "warn.hh"
@@ -20,9 +19,9 @@
 LY_DEFINE (ly_format_output, "ly:format-output",
           2, 0, 0, (SCM context, SCM outname),
           "Given a Global context in its final state, "
-           "process it and return the (rendered) result.")
+          "process it and return the (rendered) result.")
 {
-  Global_context *g = dynamic_cast<Global_context*> (unsmob_context (context));
+  Global_context *g = dynamic_cast<Global_context *> (unsmob_context (context));
   SCM_ASSERT_TYPE (g, context, SCM_ARG1, __FUNCTION__, "Global context");
   SCM_ASSERT_TYPE (scm_is_string (outname), outname, SCM_ARG2, __FUNCTION__, "output file name");
 
@@ -32,8 +31,7 @@ LY_DEFINE (ly_format_output, "ly:format-output",
   return output->process (ly_scm2string (outname));
 }
 
-
-LY_DEFINE (ly_run_translator, "ly:run-translator", 
+LY_DEFINE (ly_run_translator, "ly:run-translator",
           2, 1, 0, (SCM mus, SCM output_def, SCM key),
           "Process @var{mus} according to @var{output_def}. \n"
           "An interpretation context is set up,\n"
@@ -52,15 +50,15 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
       warning (_ ("Need music in a score"));
       return SCM_BOOL_F;
     }
-  
+
   SCM_ASSERT_TYPE (music, mus, SCM_ARG1,
                   __FUNCTION__, "Music");
   SCM_ASSERT_TYPE (odef, output_def, SCM_ARG2, __FUNCTION__,
                   "Output definition");
-  
+
   Cpu_timer timer;
-  
-  Global_context *trans = new Global_context (odef, music->get_length (), unsmob_key (key) );
+
+  Global_context *trans = new Global_context (odef, music->get_length (), unsmob_key (key));
   if (!trans)
     {
       programming_error ("no toplevel translator");
@@ -68,9 +66,9 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
     }
 
   progress_indication (_ ("Interpreting music... "));
-  
+
   SCM protected_iter = Music_iterator::get_static_get_iterator (music);
-  Music_iterator * iter = unsmob_iterator (protected_iter);
+  Music_iterator *iter = unsmob_iterator (protected_iter);
   iter->init_translator (music, trans);
 
   iter->construct_children ();
@@ -88,7 +86,7 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
   trans->finish ();
 
   if (be_verbose_global)
-    progress_indication (_f ("elapsed time: %.2f seconds",  timer.read ()));
-  
+    progress_indication (_f ("elapsed time: %.2f seconds", timer.read ()));
+
   return scm_gc_unprotect_object (trans->self_scm ());
 }
index 37e9612a0d249aaa18f1e1b35e69eeb00ada050a..ceafb4672cb9d9a60557fe02feee83a05dd18c49 100644 (file)
 #include "lilypond-key.hh"
 
 Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
-  : Context (new Lilypond_context_key(key,
-                                     Moment(0),
-                                     "Global", "", 0))
+  : Context (new Lilypond_context_key (key,
+                                      Moment (0),
+                                      "Global", "", 0))
 {
   output_def_ = o;
   final_mom_ = final;
   definition_ = find_context_def (o, ly_symbol2scm ("Global"));
 
-  Context_def *globaldef  =  unsmob_context_def (definition_);
+  Context_def *globaldef = unsmob_context_def (definition_);
   if (!globaldef)
     {
       programming_error ("No `Global' context found.");
@@ -37,7 +37,7 @@ Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
   accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
 }
 
-Output_def
+Output_def *
 Global_context::get_output_def () const
 {
   return output_def_;
@@ -51,8 +51,8 @@ Global_context::add_moment_to_process (Moment m)
 
   if (m < now_mom_)
     programming_error ("Trying to freeze in time.");
-  
-  for (int i = 0; i <  extra_mom_pq_.size (); i++)
+
+  for (int i = 0; i < extra_mom_pq_.size (); i++)
     if (extra_mom_pq_[i] == m)
       return;
   extra_mom_pq_.insert (m);
@@ -75,13 +75,13 @@ Global_context::get_moments_left () const
 void
 Global_context::prepare (Moment m)
 {
-  prev_mom_  = now_mom_;
+  prev_mom_ = now_mom_;
   now_mom_ = m;
 
   clear_key_disambiguations ();
   if (get_score_context ())
     get_score_context ()->prepare (m);
-  
+
 }
 
 Moment
@@ -90,15 +90,15 @@ Global_context::now_mom () const
   return now_mom_;
 }
 
-Score_context*
+Score_context *
 Global_context::get_score_context () const
 {
   return (scm_is_pair (context_list_))
-    ? dynamic_cast<Score_context*> (unsmob_context (scm_car (context_list_)))
+    ? dynamic_cast<Score_context *> (unsmob_context (scm_car (context_list_)))
     : 0;
 }
 
-Music_output*
+Music_output *
 Global_context::get_output ()
 {
   return get_score_context ()->get_output ();
@@ -120,7 +120,7 @@ Global_context::finish ()
 }
 
 void
-Global_context::run_iterator_on_me (Music_iterator * iter)
+Global_context::run_iterator_on_me (Music_iterator *iter)
 {
   if (iter-> ok ())
     prev_mom_ = now_mom_ = iter->pending_moment ();
@@ -137,27 +137,26 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
 
       w = sneaky_insert_extra_moment (w);
       if (w.main_part_.is_infinity ())
-       break ;
-      
+       break;
+
       if (first)
-        {
+       {
          /*
            Need this to get grace notes at start of a piece correct.
-          */
-          first = false;
-          set_property ("measurePosition", w.smobbed_copy ());
-        }
-
+         */
+         first = false;
+         set_property ("measurePosition", w.smobbed_copy ());
+       }
 
       prepare (w);
 
       if (iter->ok ())
        iter->process (w);
 
-      if (!get_score_context ()) 
+      if (!get_score_context ())
        {
          SCM sym = ly_symbol2scm ("Score");
-         Context_def * t = unsmob_context_def (find_context_def (get_output_def (), sym));
+         Context_def *t = unsmob_context_def (find_context_def (get_output_def (), sym));
          if (!t)
            error (_f ("can't find `%s' context", "Score"));
 
@@ -165,10 +164,10 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
          Context *c = t->instantiate (SCM_EOL, key);
          add_context (c);
 
-         Score_context *sc = dynamic_cast<Score_context*> (c);
+         Score_context *sc = dynamic_cast<Score_context *> (c);
          sc->prepare (w);
        }
-      
+
       one_time_step ();
     }
 }
@@ -189,7 +188,7 @@ Global_context::add_finalization (SCM x)
 {
   SCM lst = get_property ("finalizations");
   lst = scm_cons (x, lst);
-  set_property ("finalizations", lst); 
+  set_property ("finalizations", lst);
 }
 
 Moment
index eef6cbfd9708637073e6f145fbfbcbe409f36692..d6214275560764c06e3d755fec6e19c1bd75c1e8 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   global-ctor.cc -- implement global constructors
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "global-ctor.hh"
 
index 531c8701456f0305f176bf22d4c4eb5d39c0225b..3c988c6e0fc2fd1f455971cabb6760746229ee36 100644 (file)
 const int HAPPY_DOTS_I = 3;
 
 /**
-  Helper to trace back an optimal path 
- */
-struct Break_node {
+   Helper to trace back an optimal path
+*/
+struct Break_node
+{
   /** this was the previous. If negative, this break should not be
-    considered: this path has infinite energy
-    
-    */
+      considered: this path has infinite energy
+
+  */
   int prev_break_;
   /**
      Which system number so far?
-   */
+  */
   int line_;
 
   Real demerits_;
   Column_x_positions line_config_;
-  
-  Break_node () 
+
+  Break_node ()
   {
     prev_break_ = -1;
     line_ = 0;
@@ -54,76 +55,75 @@ struct Break_node {
 };
 
 void
-print_break_nodes (Array<Break_node> const & arr)
+print_break_nodes (Array<Break_node> const &arr)
 {
   for (int i = 0; i < arr.size (); i++)
     {
-      printf ( "node %d: ", i); 
+      printf ("node %d: ", i);
       arr[i].print ();
-    }      
+    }
 }
 
 /**
-  This algorithms is adapted from the OSU Tech report on breaking lines.
+   This algorithms is adapted from the OSU Tech report on breaking lines.
 
-  this function is longish, but not very complicated.
+   this function is longish, but not very complicated.
 
-  TODO: should rewrite. See the function in scm/page-layout.scm for
-  inspiration.
-  
- */
+   TODO: should rewrite. See the function in scm/page-layout.scm for
+   inspiration.
+*/
 Array<Column_x_positions>
 Gourlay_breaking::do_solve () const
 {
   Array<Break_node> optimal_paths;
-  Link_array<Grob> all =
-    pscore_->system_->columns ();
-  
+  Link_array<Grob> all
+    pscore_->system_->columns ();
+
   Array<int> breaks = find_break_indices ();
-  
-  Break_node first_node ;
+
+  Break_node first_node;
   optimal_paths.push (first_node);
 
   bool ragged_right = to_boolean (pscore_->layout_->c_variable ("raggedright"));
   bool ragged_last = to_boolean (pscore_->layout_->c_variable ("raggedlast"));
 
   Real worst_force = 0.0;
-  for (int break_idx = 1; break_idx< breaks.size (); break_idx++) 
+  for (int break_idx = 1; break_idx< breaks.size (); break_idx++)
     {
       /*
-       start with a short line, add measures. At some point 
-       the line becomes infeasible. Then we don't try to add more 
-       */
+       start with a short line, add measures. At some point
+       the line becomes infeasible. Then we don't try to add more
+      */
       int minimal_start_idx = -1;
       Column_x_positions minimal_sol;
       Column_x_positions backup_sol;
-      
+
       Real minimal_demerits = infinity_f;
 
       for (int start_idx = break_idx; start_idx--;)
        {
-         Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
-  
-         line[0]     = dynamic_cast<Item*> (line[0])->find_prebroken_piece (RIGHT);
-         line.top () = dynamic_cast<Item*> (line.top ())->find_prebroken_piece (LEFT);
-           
+         Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx] + 1);
+
+         line[0] = dynamic_cast<Item *> (line[0])->find_prebroken_piece (RIGHT);
+         line.top () = dynamic_cast<Item *> (line.top ())->find_prebroken_piece (LEFT);
+
          Column_x_positions cp;
          cp.cols_ = line;
 
          Interval line_dims
            = line_dimensions_int (pscore_->layout_, optimal_paths[start_idx].line_);
-         Simple_spacer_wrapper * sp = generate_spacing_problem (line, line_dims);
-         bool last_line = break_idx == breaks.size ()-1;
+         Simple_spacer_wrapper *sp = generate_spacing_problem (line, line_dims);
+         bool last_line = break_idx == breaks.size () - 1;
          bool ragged = ragged_right
            || (last_line && ragged_last);
-         
+
          sp->solve (&cp, ragged);
-         
+
          delete sp;
 
          if (ragged && last_line)
            cp.force_ = 0.0;
-         
+
          if (fabs (cp.force_) > worst_force)
            worst_force = fabs (cp.force_);
 
@@ -132,7 +132,7 @@ Gourlay_breaking::do_solve () const
            solution", in case everything fucks up.  */
          if (start_idx == break_idx - 1)
            backup_sol = cp;
-                 
+
          Real this_demerits;
 
          if (optimal_paths[start_idx].demerits_ >= infinity_f)
@@ -141,7 +141,7 @@ Gourlay_breaking::do_solve () const
            this_demerits = combine_demerits (optimal_paths[start_idx].line_config_, cp)
              + optimal_paths[start_idx].demerits_;
 
-         if (this_demerits < minimal_demerits) 
+         if (this_demerits < minimal_demerits)
            {
              minimal_start_idx = start_idx;
              minimal_sol = cp;
@@ -153,18 +153,17 @@ Gourlay_breaking::do_solve () const
            if we add more columns, so we get on with the next one
          */
          if (!cp.satisfies_constraints_)
-           break ; 
+           break;
        }
 
-
       Break_node bnod;
-      if (minimal_start_idx < 0) 
+      if (minimal_start_idx < 0)
        {
          bnod.demerits_ = infinity_f;
          bnod.line_config_ = backup_sol;
-         bnod.prev_break_ = break_idx - 1;       
+         bnod.prev_break_ = break_idx - 1;
        }
-      else 
+      else
        {
          bnod.prev_break_ = minimal_start_idx;
          bnod.demerits_ = minimal_demerits;
@@ -172,14 +171,14 @@ Gourlay_breaking::do_solve () const
        }
       bnod.line_ = optimal_paths[bnod.prev_break_].line_ + 1;
       optimal_paths.push (bnod);
-      
+
       if (! (break_idx % HAPPY_DOTS_I))
        progress_indication (String ("[") + to_string (break_idx) + "]");
     }
 
   /* do the last one */
   if (breaks.size () % HAPPY_DOTS_I)
-    progress_indication (String ("[") + to_string (breaks.size ()) + "]");    
+    progress_indication (String ("[") + to_string (breaks.size ()) + "]");
 
   progress_indication ("\n");
 
@@ -187,7 +186,7 @@ Gourlay_breaking::do_solve () const
   Array<Column_x_positions> lines;
 
   /* skip 0-th element, since it is a "dummy" elt*/
-  for (int i = optimal_paths.size ()-1; i> 0;) 
+  for (int i = optimal_paths.size () - 1; i> 0;)
     {
       final_breaks.push (i);
       int prev = optimal_paths[i].prev_break_;
@@ -200,14 +199,14 @@ Gourlay_breaking::do_solve () const
       progress_indication (_f ("Optimal demerits: %f",
                               optimal_paths.top ().demerits_) + "\n");
     }
-  
+
   if (optimal_paths.top ().demerits_ >= infinity_f)
     warning (_ ("No feasible line breaking found"));
-  
+
   for (int i = final_breaks.size (); i--;)
     {
       Column_x_positions cp (optimal_paths[final_breaks[i]].line_config_);
-      
+
       lines.push (cp);
       if (!cp.satisfies_constraints_)
        warning ("Could not find line breaking that satisfies constraints.");
@@ -215,26 +214,23 @@ Gourlay_breaking::do_solve () const
   return lines;
 }
 
-
 Gourlay_breaking::Gourlay_breaking ()
 {
 }
 
-
-
 /*
   TODO: uniformity parameter to control rel. importance of spacing differences.
 
   TODO:
 
   mixing break penalties and constraint-failing solutions is confusing.
- */
+*/
 Real
 Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
                                    Column_x_positions const &this_one) const
 {
   Real break_penalties = 0.0;
-  Grob * pc = this_one.cols_.top ();
+  Grob *pc = this_one.cols_.top ();
   if (pc->original_)
     {
       SCM pen = pc->get_property ("penalty");
@@ -253,25 +249,25 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
     becoming denser, the uniformity requirement makes lines go from
     cramped to even more cramped (because going from cramped
     3meas/line to relatively loose 2meas/line is such a big step.
-    
-   */
 
-  Real demerit = abs (this_one.force_) +  abs (prev.force_ - this_one.force_)
+  */
+
+  Real demerit = abs (this_one.force_) + abs (prev.force_ - this_one.force_)
     + break_penalties;
-  
+
   if (!this_one.satisfies_constraints_)
-     {
-       /*
-        If it doesn't satisfy constraints, we make this one
-        really unattractive.
-
-        add 20000 to the demerits, so that a break penalty
-        of -10000 won't change the result */
-       demerit = (demerit + 20000) >? 2000;
-       
-       demerit *= 10;
-     }
-
-   return demerit;
+    {
+      /*
+       If it doesn't satisfy constraints, we make this one
+       really unattractive.
+
+       add 20000 to the demerits, so that a break penalty
+       of -10000 won't change the result */
+      demerit = (demerit + 20000) >? 2000;
+
+      demerit *= 10;
+    }
+
+  return demerit;
 }
 
index d820ff5924982aeb6bc285ad38e51792f570243e..be09cb4fe5d3784a3ba2abc0e28e7ed378b3be12 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   grace-engraver.cc -- implement Grace_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "engraver.hh"
@@ -16,15 +15,14 @@ class Grace_engraver : public Engraver
 protected:
   virtual void start_translation_timestep ();
   virtual void derived_mark ();
-  
+
   TRANSLATOR_DECLARATIONS (Grace_engraver);
   Moment last_moment_;
   SCM grace_settings_;
 public:
 };
 
-
-Grace_engraver::Grace_engraver()
+Grace_engraver::Grace_engraver ()
 {
   grace_settings_ = SCM_EOL;
 }
@@ -68,23 +66,23 @@ Grace_engraver::start_translation_timestep ()
          SCM val = scm_cadr (scm_cddr (entry));
 
          Context *c = context ();
-         while (c  
+         while (c
                 && c->context_name_symbol () != context_name)
            {
-             c = c->get_parent_context ();           
+             c = c->get_parent_context ();
            }
 
-         if (c) 
+         if (c)
            {
              execute_pushpop_property (c,
                                        grob, sym, val);
              grace_settings_
-               = scm_cons (scm_cons (c->self_scm(), entry),  grace_settings_);
+               = scm_cons (scm_cons (c->self_scm (), entry), grace_settings_);
            }
          else
            {
              programming_error ("Cannot find context");
-             scm_display (context_name, scm_current_error_port());
+             scm_display (context_name, scm_current_error_port ());
            }
        }
     }
@@ -92,11 +90,10 @@ Grace_engraver::start_translation_timestep ()
   last_moment_ = now;
 }
 
-
 ADD_TRANSLATOR (Grace_engraver,
-                  /* descr */       "Set font size and other properties for grace notes.",
-                  /* creats*/       "",
-                  /* accepts */     "",
-                  /* acks  */      "",
-                  /* reads */       "graceSettings",
-                  /* write */       "");
+               /* descr */ "Set font size and other properties for grace notes.",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "graceSettings",
+               /* write */ "");
index 8ef15c7cf98f0fb1c9cef0de9fd3255751404f46..35961f4a07bccf3e54abd0823f4a0f4cad931941 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   grace-music.cc -- implement Grace_music
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "grace-iterator.hh"
 #include "global-context.hh"
@@ -15,7 +14,7 @@ void
 Grace_iterator::process (Moment m)
 {
   Moment main;
-  main.main_part_ = - start_mom_.grace_part_ + m.grace_part_;
+  main.main_part_ = -start_mom_.grace_part_ + m.grace_part_;
   Music_wrapper_iterator::process (main);
 
   /* We can safely do this, since \grace should always be inside
@@ -29,10 +28,9 @@ Grace_iterator::pending_moment () const
   Moment cp = Music_wrapper_iterator::pending_moment ();
 
   Moment pending;
-  pending.grace_part_ =  start_mom_.grace_part_ + cp.main_part_;
+  pending.grace_part_ = start_mom_.grace_part_ + cp.main_part_;
 
   return pending;
 }
 
-
 IMPLEMENT_CTOR_CALLBACK (Grace_iterator);
index 382efcf8bcb14ce824ffd47f4d2af79d5976dbe6..b6ae587881241c4e6b4bc12e7413a343aca2a7e6 100644 (file)
@@ -1,10 +1,9 @@
-/*   
-     grace-music.cc -- implement Grace_music
-  
-     source file of the GNU LilyPond music typesetter
-  
-     (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
+/*
+  grace-music.cc -- implement Grace_music
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "music.hh"
 class Grace_music
 {
 public:
-  DECLARE_SCHEME_CALLBACK(start_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (start_callback, (SCM));
 };
 
-MAKE_SCHEME_CALLBACK(Grace_music, start_callback, 1);
+MAKE_SCHEME_CALLBACK (Grace_music, start_callback, 1);
 SCM
-Grace_music::start_callback (SCM m) 
+Grace_music::start_callback (SCM m)
 {
   Moment *l = unsmob_moment (Music_wrapper::length_callback (m));
   Moment gl;
-  gl.grace_part_ = -(l->main_part_ + l->grace_part_ );
+  gl.grace_part_ = -(l->main_part_ + l->grace_part_);
   return gl.smobbed_copy ();
 }
index 9a9ac434f921480897a220d5177ec4d40e93221d..96c960b1c4ad4dc7869cbdc2099c6df9149da7a8 100644 (file)
@@ -1,10 +1,10 @@
 /*
   gregorian-ligature-engraver.cc -- implement Gregorian_ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
- */
+*/
 
 #include "gregorian-ligature-engraver.hh"
 
@@ -87,107 +87,106 @@ void check_and_fix_all_prefixes (Array<Grob_info> primitives)
   /* Check for illegal head modifier combinations */
   for (int i = 0; i < primitives.size (); i++)
     {
-    Grob *primitive = primitives[i].grob_;
+      Grob *primitive = primitives[i].grob_;
 
-    /* compute head prefix set by inspecting primitive grob properties */
-    int prefix_set =
-      (VIRGA * to_boolean (primitive->get_property ("virga"))) |
-      (STROPHA * to_boolean (primitive->get_property ("stropha"))) |
-      (INCLINATUM * to_boolean (primitive->get_property ("inclinatum"))) |
-      (AUCTUM * to_boolean (primitive->get_property ("auctum"))) |
-      (DESCENDENS * to_boolean (primitive->get_property ("descendens"))) |
-      (ASCENDENS * to_boolean (primitive->get_property ("ascendens"))) |
-      (ORISCUS * to_boolean (primitive->get_property ("oriscus"))) |
-      (QUILISMA * to_boolean (primitive->get_property ("quilisma"))) |
-      (DEMINUTUM * to_boolean (primitive->get_property ("deminutum"))) |
-      (CAVUM * to_boolean (primitive->get_property ("cavum"))) |
-      (LINEA * to_boolean (primitive->get_property ("linea"))) |
-      (PES_OR_FLEXA * to_boolean (primitive->get_property ("pes-or-flexa")));
+      /* compute head prefix set by inspecting primitive grob properties */
+      int prefix_set
+       = (VIRGA *to_boolean (primitive->get_property ("virga"))) |
+       (STROPHA *to_boolean (primitive->get_property ("stropha"))) |
+       (INCLINATUM *to_boolean (primitive->get_property ("inclinatum"))) |
+       (AUCTUM *to_boolean (primitive->get_property ("auctum"))) |
+       (DESCENDENS *to_boolean (primitive->get_property ("descendens"))) |
+       (ASCENDENS *to_boolean (primitive->get_property ("ascendens"))) |
+       (ORISCUS *to_boolean (primitive->get_property ("oriscus"))) |
+       (QUILISMA *to_boolean (primitive->get_property ("quilisma"))) |
+       (DEMINUTUM *to_boolean (primitive->get_property ("deminutum"))) |
+       (CAVUM *to_boolean (primitive->get_property ("cavum"))) |
+       (LINEA *to_boolean (primitive->get_property ("linea"))) |
+       (PES_OR_FLEXA *to_boolean (primitive->get_property ("pes-or-flexa")));
 
-    /* check: ascendens and descendens exclude each other; same with
-       auctum and deminutum */
-    if (prefix_set & DESCENDENS)
-      {
-       fix_prefix_set (&prefix_set,
-                       prefix_set & ~ASCENDENS,
-                       prefix_set & ~ASCENDENS,
-                       primitive);
-      }
-    if (prefix_set & AUCTUM)
-      {
-       fix_prefix_set (&prefix_set,
-                       prefix_set & ~DEMINUTUM,
-                       prefix_set & ~DEMINUTUM,
-                       primitive);
-      }
-
-    /* check: virga, quilisma and oriscus can not be combined with any
-       other prefix, but may be part of a pes or flexa */
-    if (prefix_set & VIRGA)
-      {
-       fix_prefix_set (&prefix_set,
-                       VIRGA,
-                       VIRGA | PES_OR_FLEXA,
-                       primitive);
-      }
-    if (prefix_set & QUILISMA)
-      {
-       fix_prefix_set (&prefix_set,
-                       QUILISMA,
-                       QUILISMA | PES_OR_FLEXA,
-                       primitive);
-      }
-    if (prefix_set & ORISCUS)
-      {
-       fix_prefix_set (&prefix_set,
-                       ORISCUS,
-                       ORISCUS | PES_OR_FLEXA,
-                       primitive);
-      }
+      /* check: ascendens and descendens exclude each other; same with
+        auctum and deminutum */
+      if (prefix_set & DESCENDENS)
+       {
+         fix_prefix_set (&prefix_set,
+                         prefix_set & ~ASCENDENS,
+                         prefix_set & ~ASCENDENS,
+                         primitive);
+       }
+      if (prefix_set & AUCTUM)
+       {
+         fix_prefix_set (&prefix_set,
+                         prefix_set & ~DEMINUTUM,
+                         prefix_set & ~DEMINUTUM,
+                         primitive);
+       }
 
-    /* check: auctum is the only valid optional prefix for stropha */
-    if (prefix_set & STROPHA)
-      {
-       fix_prefix_set (&prefix_set,
-                       STROPHA,
-                       STROPHA | AUCTUM,
-                       primitive);
-      }
+      /* check: virga, quilisma and oriscus can not be combined with any
+        other prefix, but may be part of a pes or flexa */
+      if (prefix_set & VIRGA)
+       {
+         fix_prefix_set (&prefix_set,
+                         VIRGA,
+                         VIRGA | PES_OR_FLEXA,
+                         primitive);
+       }
+      if (prefix_set & QUILISMA)
+       {
+         fix_prefix_set (&prefix_set,
+                         QUILISMA,
+                         QUILISMA | PES_OR_FLEXA,
+                         primitive);
+       }
+      if (prefix_set & ORISCUS)
+       {
+         fix_prefix_set (&prefix_set,
+                         ORISCUS,
+                         ORISCUS | PES_OR_FLEXA,
+                         primitive);
+       }
 
+      /* check: auctum is the only valid optional prefix for stropha */
+      if (prefix_set & STROPHA)
+       {
+         fix_prefix_set (&prefix_set,
+                         STROPHA,
+                         STROPHA | AUCTUM,
+                         primitive);
+       }
 
-    /* check: inclinatum may be prefixed with auctum or deminutum only */
-    if (prefix_set & INCLINATUM)
-      {
-       fix_prefix_set (&prefix_set,
-                       INCLINATUM,
-                       INCLINATUM | AUCTUM | DEMINUTUM,
-                       primitive);
-      }
-    /* check: semivocalis (deminutum but not inclinatum) must occur in
-       combination with and only with pes or flexa */
-    else if (prefix_set & DEMINUTUM)
-      {
-       fix_prefix_set (&prefix_set,
-                       DEMINUTUM | PES_OR_FLEXA,
-                       DEMINUTUM | PES_OR_FLEXA,
-                       primitive);
-      }
+      /* check: inclinatum may be prefixed with auctum or deminutum only */
+      if (prefix_set & INCLINATUM)
+       {
+         fix_prefix_set (&prefix_set,
+                         INCLINATUM,
+                         INCLINATUM | AUCTUM | DEMINUTUM,
+                         primitive);
+       }
+      /* check: semivocalis (deminutum but not inclinatum) must occur in
+        combination with and only with pes or flexa */
+      else if (prefix_set & DEMINUTUM)
+       {
+         fix_prefix_set (&prefix_set,
+                         DEMINUTUM | PES_OR_FLEXA,
+                         DEMINUTUM | PES_OR_FLEXA,
+                         primitive);
+       }
 
-    /* check: cavum and linea (either or both) may be applied only
-       upon core punctum */
-    if (prefix_set & (CAVUM | LINEA))
-      {
-       fix_prefix_set (&prefix_set,
-                       0,
-                       CAVUM | LINEA,
-                       primitive);
-      }
+      /* check: cavum and linea (either or both) may be applied only
+        upon core punctum */
+      if (prefix_set & (CAVUM | LINEA))
+       {
+         fix_prefix_set (&prefix_set,
+                         0,
+                         CAVUM | LINEA,
+                         primitive);
+       }
 
-    /* all other combinations should be valid (unless I made a
-       mistake) */
+      /* all other combinations should be valid (unless I made a
+        mistake) */
 
-    primitive->set_property ("prefix-set", scm_int2num (prefix_set));
-  }
+      primitive->set_property ("prefix-set", scm_int2num (prefix_set));
+    }
 }
 
 /*
@@ -200,50 +199,51 @@ provide_context_info (Array<Grob_info> primitives)
   int prev_prefix_set = 0;
   int prev_context_info = 0;
   int prev_pitch = 0;
-  for (int i = 0; i < primitives.size (); i++) {
-    Grob *primitive = primitives[i].grob_;
-    Music *music_cause = primitives[i].music_cause ();
-    int context_info = 0;
-    int pitch = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
-    int prefix_set = scm_to_int (primitive->get_property ("prefix-set"));
+  for (int i = 0; i < primitives.size (); i++)
+    {
+      Grob *primitive = primitives[i].grob_;
+      Music *music_cause = primitives[i].music_cause ();
+      int context_info = 0;
+      int pitch = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
+      int prefix_set = scm_to_int (primitive->get_property ("prefix-set"));
 
-    if (prefix_set & PES_OR_FLEXA)
-      if (!i) // ligature may not start with 2nd head of pes or flexa
+      if (prefix_set & PES_OR_FLEXA)
+       if (!i) // ligature may not start with 2nd head of pes or flexa
          {
            primitive->warning ("may not apply `\\~' on first head of "
                                "ligature; ignoring `\\~'");
          }
-      else if (pitch > prev_pitch) // pes
-       {
-         prev_context_info |= PES_LOWER;
-         context_info |= PES_UPPER;
-       }
-      else if (pitch < prev_pitch) // flexa
-       {
-         prev_context_info |= FLEXA_LEFT;
-         context_info |= FLEXA_RIGHT;
-       }
-      else // (pitch == prev_pitch)
+       else if (pitch > prev_pitch) // pes
+         {
+           prev_context_info |= PES_LOWER;
+           context_info |= PES_UPPER;
+         }
+       else if (pitch < prev_pitch) // flexa
+         {
+           prev_context_info |= FLEXA_LEFT;
+           context_info |= FLEXA_RIGHT;
+         }
+       else // (pitch == prev_pitch)
+         {
+           primitive->warning ("may not apply `\\~' on heads with "
+                               "identical pitch; ignoring `\\~'");
+         }
+      if (prev_prefix_set & DEMINUTUM)
        {
-         primitive->warning ("may not apply `\\~' on heads with "
-                             "identical pitch; ignoring `\\~'");
+         context_info |= AFTER_DEMINUTUM;
        }
-    if (prev_prefix_set & DEMINUTUM)
-      {
-       context_info |= AFTER_DEMINUTUM;
-      }
 
-    if (prev_primitive)
-      prev_primitive->set_property ("context-info",
-                                        scm_int2num (prev_context_info));
-    prev_primitive = primitive;
-    prev_prefix_set = prefix_set;
-    prev_context_info = context_info;
-    prev_pitch = pitch;
-  }
+      if (prev_primitive)
+       prev_primitive->set_property ("context-info",
+                                     scm_int2num (prev_context_info));
+      prev_primitive = primitive;
+      prev_prefix_set = prefix_set;
+      prev_context_info = context_info;
+      prev_pitch = pitch;
+    }
   if (prev_primitive)
     prev_primitive->set_property ("context-info",
-                                      scm_int2num (prev_context_info));
+                                 scm_int2num (prev_context_info));
 }
 
 void
@@ -275,9 +275,9 @@ Gregorian_ligature_engraver::stop_translation_timestep ()
 }
 
 ADD_TRANSLATOR (Gregorian_ligature_engraver,
-/* descr */       "This is an abstract class.  Subclasses such as Vaticana_ligature_engraver handle ligatures by glueing special ligature heads together.",
-/* creats*/       "",
-/* accepts */     "ligature-event",
-/* acks  */      "note-head-interface rest-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "This is an abstract class.  Subclasses such as Vaticana_ligature_engraver handle ligatures by glueing special ligature heads together.",
+               /* creats*/ "",
+               /* accepts */ "ligature-event",
+               /* acks  */ "note-head-interface rest-interface",
+               /* reads */ "",
+               /* write */ "");
index 3adfe2045e58b201c2de0bba08a49483ebd09489..82a2110bc57041926bdb153e8721f969db63587d 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   gregorian-ligature.cc -- implement Gregorian_ligature
 
   source file of the GNU LilyPond music typesetter
@@ -25,8 +25,8 @@ String
 Gregorian_ligature::prefixes_to_str (Grob *primitive)
 {
   String str;
-  int prefix_set =
-    scm_to_int (primitive->get_property ("prefix-set"));
+  int prefix_set
+    scm_to_int (primitive->get_property ("prefix-set"));
   check_prefix ("virga", VIRGA, prefix_set, &str);
   check_prefix ("stropha", STROPHA, prefix_set, &str);
   check_prefix ("inclinatum", INCLINATUM, prefix_set, &str);
@@ -48,7 +48,7 @@ Gregorian_ligature::prefixes_to_str (Grob *primitive)
   by code of GregorianLigatureEngraver that is virtually invoked by a
   subclass like VaticanaLigatureEngraver.  The property is lateron
   read by the associated item class, such as VaticanaLigature.--jr
- */
+*/
 ADD_INTERFACE (Gregorian_ligature, "gregorian-ligature-interface",
               "A gregorian ligature",
               "virga stropha inclinatum auctum descendens ascendens "
index d4a0acc0cec2a6506374c2ce215d929a805a0a8c..38d074dde677a189672b8ab3b74f0766c6272e52 100644 (file)
@@ -19,23 +19,25 @@ Grob_info::Grob_info ()
   origin_trans_ = 0;
 }
 
-Music*
+Music *
 Grob_info::music_cause ()
 {
-  SCM cause = grob_->get_property ("cause"); 
+  SCM cause = grob_->get_property ("cause");
   return unsmob_music (cause);
 }
 
 Link_array<Context>
-Grob_info::origin_contexts (Translatorend) const
+Grob_info::origin_contexts (Translator *end) const
 {
-  Context * t = origin_trans_->context ();
+  Context *t = origin_trans_->context ();
   Link_array<Context> r;
-  do {
-    r.push (t);
-    t = t->get_parent_context ();
-  } while (t && t != end->context ());
-  
+  do
+    {
+      r.push (t);
+      t = t->get_parent_context ();
+    }
+  while (t && t != end->context ());
+
   return r;
 }
-  
+
index 44829c0facac85eb91e96bea845120faaf6fb2e2..b58699520992ea51e7e62f12155cd3c714b79460 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "lily-guile.hh"
 Protected_scm all_ifaces;
 
 LY_DEFINE (ly_add_interface, "ly:add-interface", 3, 0, 0, (SCM a, SCM b, SCM c),
-         "Add an interface description.")
+          "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 (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string");
   SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
   if (!scm_is_vector (all_ifaces))
     all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL);
@@ -29,10 +28,9 @@ LY_DEFINE (ly_add_interface, "ly:add-interface", 3, 0, 0, (SCM a, SCM b, SCM c),
   return SCM_UNSPECIFIED;
 }
 
-
 LY_DEFINE (ly_all_grob_interfaces, "ly:all-grob-interfaces",
-         0, 0, 0, (),
-         "Get a hash table with all interface descriptions.")
+          0, 0, 0, (),
+          "Get a hash table with all interface descriptions.")
 {
   return all_ifaces;
 }
index 7e1641016395d2d722fe8e4902e69fbf41155a5a..6e155aa68bde961d800f28fb915dffc066c7be49 100644 (file)
@@ -12,9 +12,9 @@
 #include "grob.hh"
 #include "warn.hh"
 
-void add_interface (const char * symbol,
-                   const char * descr,
-                   const char * vars)
+void add_interface (const char *symbol,
+                   const char *descr,
+                   const char *vars)
 {
   SCM s = ly_symbol2scm (symbol);
   SCM d = scm_makfrom0str (descr);
@@ -23,8 +23,6 @@ void add_interface (const char * symbol,
   ly_add_interface (s, d, l);
 }
 
-
-
 void
 check_interfaces_for_property (Grob const *me, SCM sym)
 {
@@ -32,8 +30,8 @@ check_interfaces_for_property (Grob const *me, SCM sym)
     {
       /*
        otherwise we get in a nasty recursion loop.
-       */
-      return ;
+      */
+      return;
 
     }
   SCM ifs = me->get_property ("interfaces");
@@ -42,7 +40,7 @@ check_interfaces_for_property (Grob const *me, SCM sym)
   bool found = false;
   for (; !found && scm_is_pair (ifs); ifs = scm_cdr (ifs))
     {
-      SCM iface = scm_hashq_ref (all_ifaces , scm_car (ifs), SCM_BOOL_F);
+      SCM iface = scm_hashq_ref (all_ifaces, scm_car (ifs), SCM_BOOL_F);
       if (iface == SCM_BOOL_F)
        {
          String msg = to_string (_f ("Unknown interface `%s'",
index 7aa301dfd972e245c076dc732d6a4bf9dabd5922..6f175b9cf5127799dfe8cdcd915b4edf39acbff6 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-grob-pitch-tuple.cc -- implement Grob_pitch_tuple
-
-source file of the GNU LilyPond music typesetter
+/*
+  grob-pitch-tuple.cc -- implement Grob_pitch_tuple
 
-(c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  source file of the GNU LilyPond music typesetter
 
- */
+  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "grob-pitch-tuple.hh"
 
@@ -17,8 +16,6 @@ int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b)
 }
 
 
-
-
 Grob_pitch_tuple::Grob_pitch_tuple ()
 {
   head_ = 0;
@@ -33,18 +30,18 @@ Grob_pitch_tuple::Grob_pitch_tuple (Grob *h, Music *m, Moment mom)
 }
 
 /*
-  signed compare, should use pitch<? 
- */
+  signed compare, should use pitch<?
+*/
 int
 Grob_pitch_tuple::pitch_compare (Grob_pitch_tuple const &h1,
-                                   Grob_pitch_tuple const &h2)
+                                Grob_pitch_tuple const &h2)
 {
   return Pitch::compare (h1.pitch_, h2.pitch_);
 }
 
 int
-Grob_pitch_tuple::time_compare (Grob_pitch_tuple const&h1,
-                                  Grob_pitch_tuple const &h2)
+Grob_pitch_tuple::time_compare (Grob_pitch_tuple const &h1,
+                               Grob_pitch_tuple const &h2)
 {
-  return Moment::compare (h1.end_,  h2.end_);
+  return Moment::compare (h1.end_, h2.end_);
 }
index 8dbad9488d43f3e67d926c35dd311c408cae20d4..94b7b8f5a69b923aef32cda317a41b7528358f8f 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   grob-pq-engraver.cc -- implement Grob_pq_engraver
 
   source file of the GNU LilyPond music typesetter
@@ -22,7 +22,6 @@ protected:
   virtual void stop_translation_timestep ();
 };
 
-
 Grob_pq_engraver::Grob_pq_engraver ()
 {
 }
@@ -30,12 +29,12 @@ Grob_pq_engraver::Grob_pq_engraver ()
 void
 Grob_pq_engraver::initialize ()
 {
-  context ()->set_property ("busyGrobs", SCM_EOL); 
+  context ()->set_property ("busyGrobs", SCM_EOL);
 }
 
 LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
-         2, 0 , 0, (SCM a, SCM b), 
-         "Compare 2 grob priority queue entries. Internal")
+          2, 0, 0, (SCM a, SCM b),
+          "Compare 2 grob priority queue entries. Internal")
 {
   if (Moment::compare (*unsmob_moment (scm_car (a)),
                       *unsmob_moment (scm_car (b))) < 0)
@@ -43,11 +42,11 @@ LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
   else
     return SCM_BOOL_F;
 }
-         
+
 void
 Grob_pq_engraver::acknowledge_grob (Grob_info gi)
 {
-  Music  * m = gi.music_cause ();
+  Music *m = gi.music_cause ();
 
   if (m
       && !gi.grob_->internal_has_interface (ly_symbol2scm ("multi-measure-interface")))
@@ -56,8 +55,8 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi)
       Moment l = m->get_length ();
 
       if (!l.to_bool ())
-       return ;
-      
+       return;
+
       if (n.grace_part_)
        {
          l.grace_part_ = l.main_part_;
@@ -66,8 +65,8 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi)
 
       Moment end = n + l;
       SCM lst = scm_acons (end.smobbed_copy (),
-                        gi.grob_->self_scm (),
-                        SCM_EOL);
+                          gi.grob_->self_scm (),
+                          SCM_EOL);
 
       SCM busy = get_property ("busyGrobs");
       busy = scm_merge_x (lst, busy, ly_grob_pq_less_p_proc);
@@ -75,7 +74,6 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi)
     }
 }
 
-
 void
 Grob_pq_engraver::stop_translation_timestep ()
 {
@@ -103,7 +101,7 @@ Grob_pq_engraver::start_translation_timestep ()
       /*
        The grob-pq-engraver is not water tight, and stuff like
        tupletSpannerDuration confuses it.
-       */
+      */
       busy = scm_cdr (busy);
     }
 
@@ -111,16 +109,15 @@ Grob_pq_engraver::start_translation_timestep ()
     context ()->set_property ("busyGrobs", busy);
 }
 
-
 ADD_TRANSLATOR (Grob_pq_engraver,
 
-/* descr */       "Administrate when certain grobs (eg. note heads) stop playing; this \
+               /* descr */ "Administrate when certain grobs (eg. note heads) stop playing; this \
 engraver is a sort-of a failure, since it doesn't handle all sorts of \
 borderline cases very well. \
-",                                                                                               \
-                 
-/* creats*/       "",                                                                            \
-/* accepts */     "",                                                                            \
-/* acks  */      "grob-interface",                                                               \
-/* reads */       "busyGrobs",                                                                           \
-/* write */       "busyGrobs");
+",
+
+               /* creats*/ "",\
+               /* accepts */ "",\
+               /* acks  */ "grob-interface",\
+               /* reads */ "busyGrobs",\
+               /* write */ "busyGrobs");
index d912621dac89f105b2269b6de042f3669dc9001a..67401f226e881a1e19fccf28377aec6d8f309bd6 100644 (file)
@@ -1,6 +1,6 @@
 /*
   Implement storage and manipulation of grob properties.
- */
+*/
 
 #include <cstring>
 #include <math.h>
@@ -16,7 +16,6 @@
 #include "misc.hh"
 #include "item.hh"
 
-
 SCM
 Grob::get_property_alist_chain (SCM def) const
 {
@@ -26,21 +25,18 @@ Grob::get_property_alist_chain (SCM def) const
                     SCM_UNDEFINED);
 }
 
-
-
 /*
   This special add_thing routine is slightly more efficient than
 
-    set_prop (name, cons (thing, get_prop (name)))
+  set_prop (name, cons (thing, get_prop (name)))
 
   since it can reuse the handle returned by scm_assq ().
 */
 void
-Grob::add_to_list_property (SCM sym, SCM thing) 
+Grob::add_to_list_property (SCM sym, SCM thing)
 {
   SCM handle
-    = scm_sloppy_assq (sym, mutable_property_alist_)
-    ;
+    = scm_sloppy_assq (sym, mutable_property_alist_);
 
   if (handle != SCM_BOOL_F)
     {
@@ -57,11 +53,10 @@ Grob::add_to_list_property (SCM sym, SCM thing)
       SCM val = scm_cons (thing, tail);
 
       mutable_property_alist_ = scm_cons (scm_cons (sym, val),
-                                        mutable_property_alist_);
+                                         mutable_property_alist_);
     }
 }
 
-
 extern void check_interfaces_for_property (Grob const *me, SCM sym);
 
 void
@@ -81,7 +76,6 @@ Grob::internal_set_property (SCM s, SCM v)
   mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
 }
 
-
 SCM
 Grob::internal_get_property (SCM sym) const
 {
@@ -90,7 +84,7 @@ Grob::internal_get_property (SCM sym) const
     return scm_cdr (s);
 
   s = scm_sloppy_assq (sym, immutable_property_alist_);
-  
+
   if (do_internal_type_checking_global && scm_is_pair (s))
     {
       if (!type_check_assignment (sym, scm_cdr (s),
@@ -100,7 +94,7 @@ Grob::internal_get_property (SCM sym) const
       check_interfaces_for_property (this, sym);
     }
 
-  return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s); 
+  return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
 }
 
 void
@@ -110,7 +104,6 @@ Grob::substitute_mutable_properties (SCM crit, SCM orig)
   mutable_property_alist_ = substitute_mutable_property_alist (orig);
 }
 
-
 bool
 Grob::is_live () const
 {
index 309f086dac2492721c5ceaeed2de1c0edf5d8bb2..d892e6c443f82899a963c481ab3b78af9d3f7698 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "warn.hh"
@@ -29,11 +29,10 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
 
 LY_DEFINE (ly_grob_property, "ly:grob-property",
           2, 0, 0, (SCM grob, SCM sym),
-         "Return the value of a value in grob @var{g} of property @var{sym}. "
+          "Return the value of a value in grob @var{g} of property @var{sym}. "
           "It will return @code{' ()} (end-of-list) "
           "if  @var{sym} is undefined in @var{g}."
-          "\n\n"
-          )
+          "\n\n")
 {
   Grob *sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
@@ -47,7 +46,7 @@ LY_DEFINE (ly_spanner_get_bound, "ly:spanner-get-bound",
           "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));
+  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 ();
@@ -59,7 +58,7 @@ LY_DEFINE (ly_grob_layout, "ly:grob-layout",
           1, 0, 0, (SCM g),
           "Get @code{\\layout} definition from grob @var{g}.")
 {
-  Grob * sc = unsmob_grob (g);
+  Grob *sc = unsmob_grob (g);
   SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
 
   return sc->get_layout ()->self_scm ();
@@ -92,7 +91,7 @@ LY_DEFINE (ly_get_extent, "ly:grob-extent",
   SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
-  return ly_interval2scm ( sc->extent (ref, Axis (scm_to_int (axis))));
+  return ly_interval2scm (sc->extent (ref, Axis (scm_to_int (axis))));
 }
 
 LY_DEFINE (ly_grob_parent, "ly:grob-parent",
@@ -158,7 +157,7 @@ LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into",
           1, 0, 0, (SCM spanner),
           "Return broken-into list for @var{spanner}.")
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (spanner));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (spanner));
   SCM_ASSERT_TYPE (me, spanner, SCM_ARG1, __FUNCTION__, "spanner");
 
   SCM s = SCM_EOL;
@@ -196,7 +195,7 @@ LY_DEFINE (ly_spanner_p, "ly:spanner?",
           "Is  @var{g} a spanner object?")
 {
   Grob *me = unsmob_grob (g);
-  bool b = dynamic_cast<Spanner*> (me);
+  bool b = dynamic_cast<Spanner *> (me);
 
   return ly_bool2scm (b);
 }
@@ -206,7 +205,7 @@ LY_DEFINE (ly_item_p, "ly:item?",
           "Is @var{g} an @code{Item} object?")
 {
   Grob *me = unsmob_grob (g);
-  bool b = dynamic_cast<Item*> (me);
+  bool b = dynamic_cast<Item *> (me);
   return ly_bool2scm (b);
 }
 
@@ -215,17 +214,15 @@ 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));
+  Item *me = dynamic_cast<Item *> (unsmob_grob (it));
   SCM_ASSERT_TYPE (me, it, SCM_ARG1, __FUNCTION__, "Item");
   return scm_int2num (me->break_status_dir ());
 }
 
-
-LY_DEFINE(ly_grob_key, "ly:grob-key",
-         1, 0, 0,
-         (SCM grob),
-         "Return the object-key for @var{grob}."
-         )
+LY_DEFINE (ly_grob_key, "ly:grob-key",
+          1, 0, 0,
+          (SCM grob),
+          "Return the object-key for @var{grob}.")
 {
   Grob *me = unsmob_grob (grob);
   SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "Grob");
index 2ca648430ce3467ad428e5804046ae7fdce3429b..0594582d79ad343231f0307163a0b1a58081f8d8 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "ly-smobs.icc"
 
-Grob * 
+Grob *
 Grob::clone (int count) const
 {
   return new Grob (*this, count);
@@ -36,14 +36,14 @@ Grob::clone (int count) const
 
 /* TODO:
 
-  - remove dynamic_cast<Spanner, Item> and put this code into respective
-    subclass.  */
+- remove dynamic_cast<Spanner, Item> and put this code into respective
+subclass.  */
 
 #define HASH_SIZE 3
 #define INFINITY_MSG "Infinity or NaN encountered"
 
 Grob::Grob (SCM basicprops,
-           Object_key constkey)
+           Object_key const *key)
 {
   key_ = key;
   /* FIXME: default should be no callback.  */
@@ -51,7 +51,7 @@ Grob::Grob (SCM basicprops,
   pscore_ = 0;
   status_ = 0;
   original_ = 0;
-  immutable_property_alist_ =  basicprops;
+  immutable_property_alist_ = basicprops;
   mutable_property_alist_ = SCM_EOL;
 
   /* We do smobify_self () as the first step.  Since the object lives
@@ -61,7 +61,7 @@ Grob::Grob (SCM basicprops,
 
   /*
     We always get a new key object for a new grob.
-   */
+  */
   scm_gc_unprotect_object (key_->self_scm ());
   SCM meta = get_property ("meta");
   if (scm_is_pair (meta))
@@ -77,14 +77,14 @@ Grob::Grob (SCM basicprops,
 
   /* TODO:
 
-    - destill this into a function, so we can re-init the immutable
-      properties with a new BASICPROPS value after
-      creation. Convenient eg. when using \override with
-      StaffSymbol.  */
+  - destill this into a function, so we can re-init the immutable
+  properties with a new BASICPROPS value after
+  creation. Convenient eg. when using \override with
+  StaffSymbol.  */
 
-  char const*onames[] = {"X-offset-callbacks", "Y-offset-callbacks"};
-  char const*xnames[] = {"X-extent", "Y-extent"};
-  char const*enames[] = {"X-extent-callback", "Y-extent-callback"};
+  char const *onames[] = {"X-offset-callbacks", "Y-offset-callbacks"};
+  char const *xnames[] = {"X-extent", "Y-extent"};
+  char const *enames[] = {"X-extent-callback", "Y-extent-callback"};
 
   for (int a = X_AXIS; a <= Y_AXIS; a++)
     {
@@ -103,7 +103,7 @@ Grob::Grob (SCM basicprops,
        {
          dim_cache_[a].dimension_ = SCM_BOOL_F;
        }
-      
+
       SCM xt = get_property (xnames[a]);
       if (is_number_pair (xt))
        {
@@ -120,10 +120,10 @@ Grob::Grob (SCM basicprops,
 }
 
 Grob::Grob (Grob const &s, int copy_index)
-   : dim_cache_ (s.dim_cache_)
+  : dim_cache_ (s.dim_cache_)
 {
   key_ = new Copied_key (s.key_, copy_index);
-  original_ = (Grob*) &s;
+  original_ = (Grob *) &s;
   self_scm_ = SCM_EOL;
 
   immutable_property_alist_ = s.immutable_property_alist_;
@@ -156,26 +156,24 @@ Grob::stencil_extent (SCM element_smob, SCM scm_axis)
   return ly_interval2scm (e);
 }
 
-
 Interval
-robust_relative_extent (Grob*me, Grob*refp, Axis a)
+robust_relative_extent (Grob *me, Grob *refp, Axis a)
 {
-  Interval ext =  me->extent  (refp, a);
-  if (ext.is_empty())
+  Interval ext = me->extent (refp, a);
+  if (ext.is_empty ())
     {
       ext.add_point (me->relative_coordinate (refp, a));
     }
 
-  return ext;      
+  return ext;
 }
 
 Output_def *
 Grob::get_layout () const
 {
- return pscore_ ? pscore_->layout_ : 0;
 return pscore_ ? pscore_->layout_ : 0;
 }
 
-
 /* Recursively track all dependencies of this Grob.  The status_ field
    is used as a mark-field.  It is marked with BUSY during execution
    of this function, and marked with FINAL when finished.
@@ -207,7 +205,7 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname)
 }
 
 Stencil *
-Grob::get_stencil ()  const
+Grob::get_stencil () const
 {
   if (!is_live ())
     return 0;
@@ -219,7 +217,7 @@ Grob::get_stencil ()  const
   stil = get_uncached_stencil ();
   if (is_live ())
     {
-      Grob *me = (Grob*) this;
+      Grob *me = (Grob *) this;
       me->set_property ("stencil", stil);
     }
 
@@ -236,12 +234,12 @@ Grob::get_uncached_stencil () const
     stil = scm_apply_0 (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
 
   if (Stencil *m = unsmob_stencil (stil))
-     {
+    {
       if (to_boolean (get_property ("transparent")))
        stil = Stencil (m->extent_box (), SCM_EOL).smobbed_copy ();
       else
        {
-         SCM expr = scm_list_3 (ly_symbol2scm ("grob-cause"), self_scm(),
+         SCM expr = scm_list_3 (ly_symbol2scm ("grob-cause"), self_scm (),
                                 m->expr ());
          stil = Stencil (m->extent_box (), expr). smobbed_copy ();
        }
@@ -255,16 +253,16 @@ Grob::get_uncached_stencil () const
                                 color,
                                 m->expr ());
 
-         stil = Stencil (m->extent_box (), expr).smobbed_copy();
+         stil = Stencil (m->extent_box (), expr).smobbed_copy ();
        }
-     }
+    }
 
   return stil;
 }
 
 /*
   VIRTUAL STUBS
- */
+*/
 void
 Grob::do_break_processing ()
 {
@@ -289,7 +287,7 @@ Grob::add_dependency (Grob *e)
 void
 Grob::handle_broken_dependencies ()
 {
-  Spanner *sp = dynamic_cast<Spanner*> (this);
+  Spanner *sp = dynamic_cast<Spanner *> (this);
   if (original_ && sp)
     return;
 
@@ -308,7 +306,7 @@ Grob::handle_broken_dependencies ()
     substitute_mutable_properties (system
                                   ? system->self_scm () : SCM_UNDEFINED,
                                   mutable_property_alist_);
-  else if (dynamic_cast <System*> (this))
+  else if (dynamic_cast<System *> (this))
     substitute_mutable_properties (SCM_UNDEFINED, mutable_property_alist_);
   else
     /* THIS element is `invalid'; it has been removed from all
@@ -353,7 +351,7 @@ Grob::handle_prebroken_dependencies ()
      mutable_property_alist_ centralized.  */
   if (original_)
     {
-      Item *it = dynamic_cast<Item*> (this);
+      Item *it = dynamic_cast<Item *> (this);
       substitute_mutable_properties (scm_int2num (it->break_status_dir ()),
                                     original_->mutable_property_alist_);
     }
@@ -375,7 +373,6 @@ Grob::translate_axis (Real y, Axis a)
     dim_cache_[a].offset_ += y;
 }
 
-
 /* Find the offset relative to D.  If D equals THIS, then it is 0.
    Otherwise, it recursively defd as
 
@@ -398,14 +395,14 @@ Grob::relative_coordinate (Grob const *refp, Axis a) const
 Real
 Grob::get_offset (Axis a) const
 {
-  Grob *me = (Grob*) this;
+  Grob *me = (Grob *) this;
   while (dim_cache_[a].offsets_left_)
     {
       int l = --me->dim_cache_[a].offsets_left_;
       SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, scm_int2num (l));
       SCM retval = scm_call_2 (cb, self_scm (), scm_int2num (a));
 
-      Real r =  scm_to_double (retval);
+      Real r = scm_to_double (retval);
       if (isinf (r) || isnan (r))
        {
          programming_error (INFINITY_MSG);
@@ -426,15 +423,14 @@ Grob::is_empty (Axis a) const
 void
 Grob::flush_extent_cache (Axis axis)
 {
-  Dimension_cache * d = &dim_cache_[axis];
+  Dimension_cache *d = &dim_cache_[axis];
   if (ly_c_procedure_p (d->dimension_callback_)
       && scm_is_pair (d->dimension_))
     {
       d->dimension_ = SCM_EOL;
 
-
       if (get_parent (axis))
-       get_parent(axis)->flush_extent_cache (axis);
+       get_parent (axis)->flush_extent_cache (axis);
     }
 }
 
@@ -447,8 +443,7 @@ Grob::extent (Grob *refp, Axis a) const
   Interval ext;
 
   SCM dimpair = d->dimension_;
-  if (scm_is_pair (dimpair))
-    ;
+  if (scm_is_pair (dimpair));
   else if (ly_c_procedure_p (d->dimension_callback_)
           && d->dimension_ == SCM_EOL)
     d->dimension_ = scm_call_2 (d->dimension_callback_, self_scm (), scm_int2num (a));
@@ -493,7 +488,7 @@ Grob::common_refpoint (Grob const *s, Axis a) const
   for (Grob const *c = this; c; c = c->dim_cache_[a].parent_)
     for (Grob const *d = s; d; d = d->dim_cache_[a].parent_)
       if (d == c)
-       return (Grob*) d;
+       return (Grob *) d;
 
   return 0;
 }
@@ -516,7 +511,7 @@ common_refpoint_of_list (SCM elist, Grob *common, Axis a)
 Grob *
 common_refpoint_of_array (Link_array<Grob> const &arr, Grob *common, Axis a)
 {
-  for (int i = arr.size (); i--; )
+  for (int i = arr.size (); i--;)
     if (Grob *s = arr[i])
       {
        if (common)
@@ -541,11 +536,11 @@ void
 Grob::add_offset_callback (SCM cb, Axis a)
 {
   if (!has_offset_callback (cb, a))
-  {
-    dim_cache_[a].offset_callbacks_
-      = scm_cons (cb, dim_cache_[a].offset_callbacks_);
-    dim_cache_[a].offsets_left_ ++;
-  }
+    {
+      dim_cache_[a].offset_callbacks_
+       = scm_cons (cb, dim_cache_[a].offset_callbacks_);
+      dim_cache_[a].offsets_left_++;
+    }
 }
 
 bool
@@ -583,7 +578,7 @@ SCM
 Grob::fixup_refpoint (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  for (int a = X_AXIS; a < NO_AXES; a ++)
+  for (int a = X_AXIS; a < NO_AXES; a++)
     {
       Axis ax = (Axis)a;
       Grob *parent = me->get_parent (ax);
@@ -597,13 +592,13 @@ Grob::fixup_refpoint (SCM smob)
          me->set_parent (newparent, ax);
        }
 
-      if (Item *i = dynamic_cast<Item*> (me))
+      if (Item *i = dynamic_cast<Item *> (me))
        {
-         Item *parenti = dynamic_cast<Item*> (parent);
+         Item *parenti = dynamic_cast<Item *> (parent);
 
          if (parenti && i)
            {
-             Direction  my_dir = i->break_status_dir () ;
+             Direction my_dir = i->break_status_dir ();
              if (my_dir!= parenti->break_status_dir ())
                {
                  Item *newparent = parenti->find_prebroken_piece (my_dir);
@@ -635,10 +630,9 @@ Grob::programming_error (String s) const
   warning (s);
 }
 
-
 /****************************************************
   SMOB funcs
- ****************************************************/
+****************************************************/
 
 IMPLEMENT_SMOBS (Grob);
 IMPLEMENT_DEFAULT_EQUAL_P (Grob);
@@ -646,10 +640,10 @@ IMPLEMENT_DEFAULT_EQUAL_P (Grob);
 SCM
 Grob::mark_smob (SCM ses)
 {
-  Grob *s = (Grob*) SCM_CELL_WORD_1 (ses);
+  Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
   scm_gc_mark (s->immutable_property_alist_);
   scm_gc_mark (s->key_->self_scm ());
-  for (int a = 0 ; a < 2; a++)
+  for (int a = 0; a < 2; a++)
     {
       scm_gc_mark (s->dim_cache_[a].offset_callbacks_);
       scm_gc_mark (s->dim_cache_[a].dimension_);
@@ -702,13 +696,12 @@ Grob::internal_has_interface (SCM k)
   return scm_c_memq (k, ifs) != SCM_BOOL_F;
 }
 
-Grob*
+Grob *
 Grob::get_parent (Axis a) const
 {
   return dim_cache_[a].parent_;
 }
 
-
 /** Return Array of Grobs in SCM list LST */
 Link_array<Grob>
 ly_scm2grobs (SCM lst)
@@ -737,34 +730,33 @@ ly_grobs2scm (Link_array<Grob> a)
 {
   SCM s = SCM_EOL;
   for (int i = a.size (); i; i--)
-    s = scm_cons (a[i-1]->self_scm (), s);
+    s = scm_cons (a[i - 1]->self_scm (), s);
 
   return s;
 }
 
-
 IMPLEMENT_TYPE_P (Grob, "ly:grob?");
 
 ADD_INTERFACE (Grob, "grob-interface",
               "A grob represents a piece of music notation\n"
               "\n"
-"All grobs have an X and Y-position on the page.  These X and Y positions\n"
-"are stored in a relative format, so they can easily be combined by\n"
-"stacking them, hanging one grob to the side of another, and coupling\n"
-"them into a grouping objects.\n"
-"\n"
-"Each grob has a reference point (a.k.a.  parent): the position of a grob\n"
-"is stored relative to that reference point. For example the X-reference\n"
-"point of a staccato dot usually is the note head that it applies\n"
-"to. When the note head is moved, the staccato dot moves along\n"
-"automatically.\n"
-"\n"
-"A grob is often associated with a symbol, but some grobs do not print\n"
-"any symbols. They take care of grouping objects. For example, there is a\n"
-"separate grob that stacks staves vertically. The @ref{NoteCollision}\n"
-"is also an abstract grob: it only moves around chords, but doesn't print\n"
-"anything.\n"
-"\n"
+              "All grobs have an X and Y-position on the page.  These X and Y positions\n"
+              "are stored in a relative format, so they can easily be combined by\n"
+              "stacking them, hanging one grob to the side of another, and coupling\n"
+              "them into a grouping objects.\n"
+              "\n"
+              "Each grob has a reference point (a.k.a.  parent): the position of a grob\n"
+              "is stored relative to that reference point. For example the X-reference\n"
+              "point of a staccato dot usually is the note head that it applies\n"
+              "to. When the note head is moved, the staccato dot moves along\n"
+              "automatically.\n"
+              "\n"
+              "A grob is often associated with a symbol, but some grobs do not print\n"
+              "any symbols. They take care of grouping objects. For example, there is a\n"
+              "separate grob that stacks staves vertically. The @ref{NoteCollision}\n"
+              "is also an abstract grob: it only moves around chords, but doesn't print\n"
+              "anything.\n"
+              "\n"
               "Grobs have a properties: Scheme variables, that can be read and set. "
               "They have two types. Immutable variables "
               "define the default style and behavior.  They are shared between  many objects. "
@@ -773,9 +765,7 @@ ADD_INTERFACE (Grob, "grob-interface",
               "Mutable properties are variables that are specific to one grob. Typically, "
               "lists of other objects, or results from computations are stored in"
               "mutable properties: every call to set-grob-property (or its C++ equivalent) "
-              "sets a mutable property. "
-
-,
+              "sets a mutable property. ",
               "X-offset-callbacks Y-offset-callbacks X-extent-callback stencil cause "
               "Y-extent-callback print-function extra-offset spacing-procedure "
               "context staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
@@ -784,8 +774,5 @@ ADD_INTERFACE (Grob, "grob-interface",
               "axis-group-parent-X "
               "axis-group-parent-Y "
               "after-line-breaking-callback extra-Y-extent minimum-X-extent "
-              "minimum-Y-extent transparent tweak-count tweak-rank"
-              );
-
-
+              "minimum-Y-extent transparent tweak-count tweak-rank");
 
index eccb1210da2ae3f95be1c1580a9ac6bb1603fe6a..9fbd329e7cf15aacabab9acdca993c4f0a81a57b 100644 (file)
@@ -1,37 +1,32 @@
-/*   
+/*
   group-interface.cc -- implement Group_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "group-interface.hh"
 #include "item.hh"
 
 void
-Group_interface::add_thing (Grob*me, SCM sym, SCM thing)
+Group_interface::add_thing (Grob *me, SCM sym, SCM thing)
 {
   me->add_to_list_property (sym, thing);
 }
 
-
 int
 Group_interface::count (Grob *me, SCM sym)
 {
   return scm_ilength (me->internal_get_property (sym));
 }
 
-
 void
-Pointer_group_interface::add_grob (Grob*me, SCM name, Grob*p) 
+Pointer_group_interface::add_grob (Grob *me, SCM name, Grob *p)
 {
   Group_interface::add_thing (me, name, p->self_scm ());
 }
 
-
-
 Link_array<Grob>
 extract_grob_array (Grob const *elt, SCM symbol)
 {
@@ -47,7 +42,6 @@ extract_grob_array (Grob const *elt, SCM symbol)
   return arr;
 }
 
-
 Link_array<Item>
 extract_item_array (Grob const *elt, SCM symbol)
 {
@@ -55,7 +49,7 @@ extract_item_array (Grob const *elt, SCM symbol)
   for (SCM s = elt->internal_get_property (symbol); scm_is_pair (s); s = scm_cdr (s))
     {
       SCM e = scm_car (s);
-      arr.push (dynamic_cast<Item*> (unsmob_grob (e)));
+      arr.push (dynamic_cast<Item *> (unsmob_grob (e)));
     }
 
   arr.reverse ();
index 5e7aa98720df10e21684f21118e7fe23df5f5dc7..b3e5c6edce0d9889a25f2b0f48a4d124a1a43b80 100644 (file)
 MAKE_SCHEME_CALLBACK (Hairpin, print, 1);
 
 SCM
-Hairpin::print (SCM smob) 
+Hairpin::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner *spanner = dynamic_cast<Spanner*> (me);
+  Spanner *spanner = dynamic_cast<Spanner *> (me);
 
   SCM s = me->get_property ("grow-direction");
   if (!is_direction (s))
@@ -33,12 +33,12 @@ Hairpin::print (SCM smob)
       me->suicide ();
       return SCM_EOL;
     }
-  
+
   Direction grow_dir = to_dir (s);
   Real padding = robust_scm2double (me->get_property ("bound-padding"), 0.5);
 
   Drul_array<bool> broken;
-  Drul_array<Item*> bounds ;
+  Drul_array<Item *> bounds;
   Direction d = LEFT;
   do
     {
@@ -48,8 +48,8 @@ Hairpin::print (SCM smob)
   while (flip (&d) != LEFT);
 
   Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
-  Drul_array<Real> x_points ;
-  
+  Drul_array<Real> x_points;
+
   do
     {
       Item *b = bounds[d];
@@ -57,7 +57,7 @@ Hairpin::print (SCM smob)
       if (broken [d])
        {
          if (d == LEFT)
-           x_points[d] = b->extent (common, X_AXIS)[RIGHT] ;
+           x_points[d] = b->extent (common, X_AXIS)[RIGHT];
        }
       else
        {
@@ -70,7 +70,7 @@ Hairpin::print (SCM smob)
          else
            {
              bool neighbor_found = false;
-             for (SCM  adj = me->get_property ("adjacent-hairpins");
+             for (SCM adj = me->get_property ("adjacent-hairpins");
                   scm_is_pair (adj); adj = scm_cdr (adj))
                {
                  /*
@@ -78,28 +78,27 @@ Hairpin::print (SCM smob)
                    notes in other voices. Need to look at note-columns
                    in the current staff/voice.
                  */
-                 
+
                  Spanner *pin = unsmob_spanner (scm_car (adj));
                  if (pin
-                     && (pin->get_bound (LEFT)->get_column() == b->get_column ()
-                         || pin->get_bound (RIGHT)->get_column() == b->get_column() ))
-                   neighbor_found = true; 
+                     && (pin->get_bound (LEFT)->get_column () == b->get_column ()
+                         || pin->get_bound (RIGHT)->get_column () == b->get_column ()))
+                   neighbor_found = true;
                }
-             
+
              /*
                If we're hung on a paper column, that means we're not
                adjacent to a text-dynamic, and we may move closer. We
                make the padding a little smaller, here.
              */
              Interval e = robust_relative_extent (b, common, X_AXIS);
-             x_points[d] =
-               neighbor_found ? e.center() - d * padding / 3 : e[d];
+             x_points[d]
+               = neighbor_found ? e.center () - d * padding / 3 : e[d];
            }
        }
     }
   while (flip (&d) != LEFT);
 
-
   Real width = x_points[RIGHT] - x_points[LEFT];
   if (width < 0)
     {
@@ -116,11 +115,11 @@ Hairpin::print (SCM smob)
   if (grow_dir < 0)
     {
       starth = height;
-      endh = continued ? height/2 : 0.0;
+      endh = continued ? height / 2 : 0.0;
     }
   else
     {
-      starth = continued ? height/2 : 0.0;
+      starth = continued ? height / 2 : 0.0;
       endh = height;
     }
 
@@ -129,7 +128,7 @@ Hairpin::print (SCM smob)
   */
 
   Stencil mol;
-  mol  = Line_interface::line (me, Offset (0, starth), Offset (width, endh));
+  mol = Line_interface::line (me, Offset (0, starth), Offset (width, endh));
   mol.add_stencil (Line_interface::line (me,
                                         Offset (0, -starth),
                                         Offset (width, -endh)));
@@ -140,9 +139,7 @@ Hairpin::print (SCM smob)
   return mol.smobbed_copy ();
 }
 
-
-
 ADD_INTERFACE (Hairpin, "hairpin-interface",
-  "A hairpin (de)crescendo.",
-  "grow-direction height bound-padding adjacent-hairpins");
+              "A hairpin (de)crescendo.",
+              "grow-direction height bound-padding adjacent-hairpins");
 
index e5e778b9d2e95d90c92aae3793c7aef65f9df4be..c3b4d5cd98002ae5ba6a2a0d1b8129d031d852fd 100644 (file)
@@ -23,37 +23,33 @@ Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
 
   assert (a == Y_AXIS);
   consider_suicide (me);
-  return  Axis_group_interface::group_extent_callback (me->self_scm (), scm_axis);
+  return Axis_group_interface::group_extent_callback (me->self_scm (), scm_axis);
 }
 
-
 void
-Hara_kiri_group_spanner::consider_suicide (Grob*me)
+Hara_kiri_group_spanner::consider_suicide (Grob *me)
 {
-  Spanner*sp = dynamic_cast<Spanner*> (me);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
   SCM worth = me->get_property ("items-worth-living");
   if (scm_is_pair (worth))
-    return ;
+    return;
 
   if (!to_boolean (me->get_property ("remove-first"))
       && broken_spanner_index (sp) == 0)
     {
-      return ;
+      return;
     }
-  
+
   Link_array<Grob> childs = Axis_group_interface::get_children (me);
   for (int i = 0; i < childs.size (); i++)
     childs[i]->suicide ();
 
-
   /*
     very appropriate name here :-)
-   */
+  */
   me->suicide ();
 }
 
-
-
 /*
   We can't rely on offsets and dimensions of elements in a hara-kiri
   group. Use a callback to make sure that hara-kiri has been done
@@ -69,7 +65,6 @@ Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis)
   return scm_make_real (0.0);
 }
 
-
 MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, force_hara_kiri_in_parent_callback, 2);
 SCM
 Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, SCM axis)
@@ -82,28 +77,23 @@ Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, S
 }
 
 void
-Hara_kiri_group_spanner::add_element (Grob * me, Grob *e)
+Hara_kiri_group_spanner::add_element (Grob *me, Grob *e)
 {
   //  e->add_offset_callback (force_hara_kiri_in_parent_callback, Y_AXIS);
   Axis_group_interface::add_element (me, e);
 }
 
 
-
-
-
-void 
-Hara_kiri_group_spanner::add_interesting_item (Grob* me, Grob* n)
+void
+Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n)
 {
   me->add_dependency (n);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("items-worth-living"), n);
 }
 
-
 ADD_INTERFACE (Hara_kiri_group_spanner, "hara-kiri-group-interface",
               "A group spanner that  keeps track of interesting items.  If it "
               "doesn't contain any after linebreaking, then it "
-              "will remove itself and all its children."
-              ,
+              "will remove itself and all its children.",
               "items-worth-living remove-first");
 
index 748871f5838f4477068635b4997ca52b8473bd74..232c3e9aec601055addcd7d35c3479f8c8d6d2c1 100644 (file)
@@ -1,12 +1,11 @@
-/*   
+/*
   horizontal-bracket-engraver.cc -- implement
-    Horizontal_bracket_engraver
+  Horizontal_bracket_engraver
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "engraver.hh"
 #include "side-position-interface.hh"
@@ -22,19 +21,19 @@ public:
   int pop_count_;
   int push_count_;
 
-  virtual  bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
-  virtual  void process_music ();
-  virtual  void acknowledge_grob (Grob_info);
+  virtual void process_music ();
+  virtual void acknowledge_grob (Grob_info);
 };
 
 ADD_TRANSLATOR (Horizontal_bracket_engraver,
-                 "Create horizontal brackets over notes for musical analysis purposes.",
-                 "HorizontalBracket",
-                 "note-grouping-event",
-                 "note-column-interface",
-                 "",
-                 "");
+               "Create horizontal brackets over notes for musical analysis purposes.",
+               "HorizontalBracket",
+               "note-grouping-event",
+               "note-column-interface",
+               "",
+               "");
 
 Horizontal_bracket_engraver::Horizontal_bracket_engraver ()
 {
@@ -42,28 +41,27 @@ Horizontal_bracket_engraver::Horizontal_bracket_engraver ()
   push_count_ = 0;
 }
 
-
 bool
 Horizontal_bracket_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-grouping-event"))
     {
       Direction d = to_dir (m->get_property ("span-direction"));
-      
+
       if (d == STOP)
        {
-         pop_count_ ++;
+         pop_count_++;
          if (pop_count_ > bracket_stack_.size ())
-           m->origin ()->warning (_("Don't have that many brackets."));
+           m->origin ()->warning (_ ("Don't have that many brackets."));
        }
       else
        {
          push_count_++;
          events_.push (m);
        }
-      
+
       if (pop_count_ && push_count_)
-       m->origin ()->warning (_("Conflicting note group events."));
+       m->origin ()->warning (_ ("Conflicting note group events."));
 
       return true;
     }
@@ -75,13 +73,13 @@ Horizontal_bracket_engraver::acknowledge_grob (Grob_info gi)
 {
   if (Note_column::has_interface (gi.grob_))
     {
-      for (int i = 0;  i < bracket_stack_.size (); i++)
+      for (int i = 0; i < bracket_stack_.size (); i++)
        {
          Side_position_interface::add_support (bracket_stack_[i], gi.grob_);
          Pointer_group_interface::add_grob (bracket_stack_[i],
                                             ly_symbol2scm ("columns"), gi.grob_);
          add_bound_item (bracket_stack_[i],
-                                            gi.grob_);
+                         gi.grob_);
        }
     }
 }
@@ -89,22 +87,21 @@ Horizontal_bracket_engraver::acknowledge_grob (Grob_info gi)
 void
 Horizontal_bracket_engraver::process_music ()
 {
-  for  (int k = 0; k < push_count_; k++)
+  for (int k = 0; k < push_count_; k++)
     {
-      Spanner * sp = make_spanner ("HorizontalBracket", events_[k]->self_scm ());
+      Spanner *sp = make_spanner ("HorizontalBracket", events_[k]->self_scm ());
 
       for (int i = 0; i < bracket_stack_.size (); i++)
        {
          /*
            sp is the smallest, it should be added to the bigger brackets.
-          */
+         */
          Side_position_interface::add_support (bracket_stack_[i], sp);
        }
       bracket_stack_.push (sp);
     }
 }
 
-
 void
 Horizontal_bracket_engraver::stop_translation_timestep ()
 {
@@ -117,4 +114,3 @@ Horizontal_bracket_engraver::stop_translation_timestep ()
   push_count_ = 0;
 }
 
-
index 1abe992ae4b72135a5cac94856501fbdb47d9cff..654a1e0015857a41cf59f4213867518ac2f19252 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   horizontal-bracket.cc -- implement  Horizontal_bracket
 
   source file of the GNU LilyPond music typesetter
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "side-position-interface.hh"
 #include "lookup.hh"
 struct Horizontal_bracket
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
-
 /*
   TODO:
 
@@ -34,8 +32,8 @@ MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
 SCM
 Horizontal_bracket::print (SCM smob)
 {
-  Grob * me = unsmob_grob (smob);
-  Spanner *sp = dynamic_cast<Spanner*> (me);
+  Grob *me = unsmob_grob (smob);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
   Link_array<Grob> gs = extract_grob_array (me, ly_symbol2scm ("columns"));
 
   if (!gs.size ())
@@ -43,7 +41,7 @@ Horizontal_bracket::print (SCM smob)
       me->suicide ();
       return SCM_EOL;
     }
-  Grob * cx = common_refpoint_of_array (gs, me, X_AXIS);
+  Grob *cx = common_refpoint_of_array (gs, me, X_AXIS);
   cx = cx->common_refpoint (sp->get_bound (LEFT), X_AXIS);
   cx = cx->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
 
@@ -53,7 +51,6 @@ Horizontal_bracket::print (SCM smob)
   Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
                                                      Interval (1.0, 1.0));
 
-  
   Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare"),
                                                Interval (0, 0));
 
@@ -64,13 +61,13 @@ Horizontal_bracket::print (SCM smob)
   Stencil b
     = Tuplet_bracket::make_bracket (me, Y_AXIS, Offset (ext.length (), 0),
                                    edge_height, empty, flare, shorten);
-    
+
   b.translate_axis (ext[LEFT] - sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS);
 
-  return b.smobbed_copy ();  
+  return b.smobbed_copy ();
 }
 
 ADD_INTERFACE (Horizontal_bracket, "horizontal-bracket-interface",
-  "A horizontal bracket encompassing notes.",
-  "columns bracket-flare shorten-pair edge-height");
+              "A horizontal bracket encompassing notes.",
+              "columns bracket-flare shorten-pair edge-height");
 
index 4e12f6d533fbc53be1770653a1ac656de4b74459..aa647816ba989e5d9073a2249b6a1d298a23f660 100644 (file)
@@ -2,10 +2,10 @@
   hyphen-engraver.cc -- implement Hyphen_engraver
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Glen Prideaux <glenprideaux@iname.com>,
-                  Han-Wen Nienhuys <hanwen@cs.uu.nl>,
-                  Jan Nieuwenhuizen <janneke@gnu.org>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>,
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "warn.hh"
@@ -17,14 +17,14 @@ class Hyphen_engraver : public Engraver
 {
   Music *ev_;
   Spanner *hyphen_;
-  Spanner *finished_hyphen_;  
+  Spanner *finished_hyphen_;
 public:
   TRANSLATOR_DECLARATIONS (Hyphen_engraver);
 
 protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void finalize ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void process_music ();
 private:
@@ -32,8 +32,6 @@ private:
 };
 
 
-
-
 Hyphen_engraver::Hyphen_engraver ()
 {
   hyphen_ = 0;
@@ -44,7 +42,7 @@ Hyphen_engraver::Hyphen_engraver ()
 void
 Hyphen_engraver::acknowledge_grob (Grob_info i)
 {
-  Item * item =  dynamic_cast<Item*> (i.grob_);
+  Item *item = dynamic_cast<Item *> (i.grob_);
   // -> Text_item
   if (item && item->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
     {
@@ -56,9 +54,8 @@ Hyphen_engraver::acknowledge_grob (Grob_info i)
     }
 }
 
-
 bool
-Hyphen_engraver::try_music (Musicr)
+Hyphen_engraver::try_music (Music *r)
 {
   if (ev_)
     return false;
@@ -68,22 +65,20 @@ Hyphen_engraver::try_music (Music* r)
 }
 
 void
-completize_hyphen (Spannersp)
+completize_hyphen (Spanner *sp)
 {
   if (!sp->get_bound (RIGHT))
     {
       SCM heads = sp->get_property ("heads");
       if (scm_is_pair (heads))
        {
-         Item* it = dynamic_cast<Item*> (unsmob_grob (scm_car (heads)));
+         Item *it = dynamic_cast<Item *> (unsmob_grob (scm_car (heads)));
          if (it)
            sp->set_bound (RIGHT, it);
        }
     }
 }
 
-  
-
 void
 Hyphen_engraver::finalize ()
 {
@@ -106,7 +101,7 @@ Hyphen_engraver::finalize ()
 
       if (!finished_hyphen_->get_bound (RIGHT))
        {
-         finished_hyphen_->warning (_("unterminated hyphen; removing"));
+         finished_hyphen_->warning (_ ("unterminated hyphen; removing"));
          finished_hyphen_->suicide ();
        }
       finished_hyphen_ = 0;
@@ -118,12 +113,10 @@ Hyphen_engraver::process_music ()
 {
   if (ev_)
     {
-      hyphen_ = make_spanner ("LyricHyphen", ev_->self_scm ()
-);
+      hyphen_ = make_spanner ("LyricHyphen", ev_->self_scm ());
     }
 }
 
-
 void
 Hyphen_engraver::stop_translation_timestep ()
 {
@@ -137,7 +130,7 @@ Hyphen_engraver::stop_translation_timestep ()
       programming_error ("Haven't finished hyphen yet.");
       finished_hyphen_ = 0;
     }
-  
+
   if (hyphen_)
     finished_hyphen_ = hyphen_;
   hyphen_ = 0;
@@ -146,12 +139,10 @@ Hyphen_engraver::stop_translation_timestep ()
 }
 
 
-
-
 ADD_TRANSLATOR (Hyphen_engraver,
-/* descr */       "Create lyric hyphens",
-/* creats*/       "LyricHyphen",
-/* accepts */     "hyphen-event",
-/* acks  */      "lyric-syllable-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create lyric hyphens",
+               /* creats*/ "LyricHyphen",
+               /* accepts */ "hyphen-event",
+               /* acks  */ "lyric-syllable-interface",
+               /* reads */ "",
+               /* write */ "");
index 51803ce10f592c4da20b09e7e18882efa26a99ec..fc5fb17f4fe5862866cb2e52f3525f807a4bb84f 100644 (file)
@@ -39,7 +39,7 @@ unpack_identifier (SCM box)
 {
   if (SCM_IMP (box) || SCM_CELL_TYPE (box) != package_tag)
     return SCM_UNDEFINED;
-  
+
   return SCM_CELL_OBJECT_1 (box);
 }
 
@@ -51,4 +51,4 @@ init_box_type (void)
   scm_set_smob_print (package_tag, print_box);
 }
 
-ADD_SCM_INIT_FUNC (package, init_box_type); 
+ADD_SCM_INIT_FUNC (package, init_box_type);
index 73fe726ee46edb1dfa4792128ac9c89008cca5cf..2f5280de612930a78e97879361668ee5e4f8cdce 100644 (file)
 #endif
 
 #ifndef YY_START
-#define YY_START\
- ((yy_start - 1) / 2)
+#define YY_START                               \
 ((yy_start - 1) / 2)
 #define YYSTATE YY_START
 #endif
 
 /* Flex >= 2.5.29 has include stack; but we don't use that yet.  */
 #if !HAVE_FLEXLEXER_YY_CURRENT_BUFFER
-#define yy_current_buffer \
+#define yy_current_buffer                                              \
   (yy_buffer_stack != 0 ? yy_buffer_stack[yy_buffer_stack_top] : 0)
 #endif
 
@@ -50,7 +50,7 @@ Includable_lexer::new_input (String name, Sources *sources)
       LexerError (_ ("include files are not allowed in safe mode").to_str0 ());
       return;
     }
-  
+
   Source_file *file = sources->get_file (name);
   if (!file)
     {
@@ -70,13 +70,13 @@ Includable_lexer::new_input (String name, Sources *sources)
 
   if (be_verbose_global)
     progress_indication (String ("[") + name);
-       
+
   include_stack_.push (file);
 
   /* Ugh. We'd want to create a buffer from the bytes directly.
 
-    Whoops.  The size argument to yy_create_buffer is not the
-    filelength but a BUFFERSIZE.  Maybe this is why reading stdin fucks up.  */
+  Whoops.  The size argument to yy_create_buffer is not the
+  filelength but a BUFFERSIZE.  Maybe this is why reading stdin fucks up.  */
   yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
 }
 
@@ -99,8 +99,8 @@ Includable_lexer::new_input (String name, String data, Sources *sources)
 }
 
 /** pop the inputstack.  conceptually this is a destructor, but it
-  does not destruct the Source_file that Includable_lexer::new_input
-  creates.  */
+    does not destruct the Source_file that Includable_lexer::new_input
+    creates.  */
 bool
 Includable_lexer::close_input ()
 {
@@ -109,21 +109,21 @@ Includable_lexer::close_input ()
   if (be_verbose_global)
     progress_indication ("]");
   yy_delete_buffer (yy_current_buffer);
-#if HAVE_FLEXLEXER_YY_CURRENT_BUFFER  
+#if HAVE_FLEXLEXER_YY_CURRENT_BUFFER
   yy_current_buffer = 0;
-#endif  
+#endif
   if (state_stack_.is_empty ())
     {
-#if HAVE_FLEXLEXER_YY_CURRENT_BUFFER  
+#if HAVE_FLEXLEXER_YY_CURRENT_BUFFER
       yy_current_buffer = 0;
-#endif  
+#endif
       return false;
     }
   yy_switch_to_buffer (state_stack_.pop ());
   return true;
 }
 
-char const*
+char const *
 Includable_lexer::here_str0 () const
 {
   if (include_stack_.is_empty ())
@@ -139,7 +139,7 @@ Includable_lexer::~Includable_lexer ()
     }
 }
 
-Source_file*
+Source_file *
 Includable_lexer::get_source_file () const
 {
   if (include_stack_.is_empty ())
index 2b8aabfc129b01fee39d28b8e8d3a660e5b1f7cf..835762d320a6921b0d40355198f9da0cdd7652b9 100644 (file)
@@ -1,8 +1,8 @@
 /*
   accidental-interface.hh -- declare  Accidental_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-
 class Accidental_interface
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));  
-  static bool has_interface (Grob*);
-  
-  static String get_fontcharname(String style, int alteration);
-  static Array<Box> Accidental_interface::accurate_boxes (Grob *me, Grob**common);
-};
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  static bool has_interface (Grob *);
 
+  static String get_fontcharname (String style, int alteration);
+  static Array<Box> Accidental_interface::accurate_boxes (Grob *me, Grob **common);
+};
 
 #endif
index a288aeb3915d79888ea5793bfc14f7e37feadd8e..3e75259af4914b72ef9ed3ddf81669472900201d 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-accidental-placement.hh -- declare  Accidental_placement
+/*
+  accidental-placement.hh -- declare  Accidental_placement
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef ACCIDENTAL_PLACEMENT_HH
 #define ACCIDENTAL_PLACEMENT_HH
@@ -16,17 +15,17 @@ class Accidental_placement
 {
 public:
   DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
-  static void add_accidental (Grob *, Grob);
+  static void add_accidental (Grob *, Grob *);
 
   static Interval get_relevant_accidental_extent (Grob *me,
                                                  Item *item_col,
                                                  Grob *acc);
-  static void split_accidentals (Grob * accs,
-                         Link_array<Grob> *break_reminder,
-                         Link_array<Grob> *real_acc);
-  
-  static SCM position_accidentals (Grob);
-  static bool has_interface (Grob*);
+  static void split_accidentals (Grob *accs,
+                                Link_array<Grob> *break_reminder,
+                                Link_array<Grob> *real_acc);
+
+  static SCM position_accidentals (Grob *);
+  static bool has_interface (Grob *);
 };
 #endif /* ACCIDENTAL_PLACEMENT_HH */
 
index adafed8d6d29927775798f31817de478ae499b07..7db3cbcf374fa1cb205518b9ecacd8b0da38b5b7 100644 (file)
@@ -1,12 +1,11 @@
 
-/*   
+/*
   afm.hh -- declare Adobe_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef AFM_HH
 #define AFM_HH
@@ -32,22 +31,22 @@ public:
   virtual Box get_ascii_char (int) const;
   virtual Box get_indexed_char (int) const;
   virtual Offset get_indexed_wxwy (int) const;
-  static SCM make_afm (AFM_Font_info*, unsigned, Real);
+  static SCM make_afm (AFM_Font_info *, unsigned, Real);
   virtual Real design_size () const;
-  virtual String font_name () const; 
+  virtual String font_name () const;
 
 protected:
   AFM_CharMetricInfo const *find_char_metric (String name) const;
-  AFM_CharMetricInfo const *find_ascii_metric (int) const;  
+  AFM_CharMetricInfo const *find_ascii_metric (int) const;
 
   Array<int> ascii_to_metric_idx_;
-  std::map<String, int> name_to_metric_dict_;
+  std::map < String, int> name_to_metric_dict_;
 
-  Adobe_font_metric (AFM_Font_info*);
+  Adobe_font_metric (AFM_Font_info *);
 };
 
 SCM read_afm_file (String);
 Box afm_bbox_to_box (AFM_BBox);
-  
+
 #endif /* AFM_HH */
 
index 279c1b6a3db90d7eddfbfdb0c3f79a7cf53d0ec6..8ac3503a4bf04789e1b87a20bb8bcb1f2e65c8f2 100644 (file)
@@ -1,11 +1,10 @@
 /*
   align-interface.hh -- declare Align_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef ALIGN_INTERFACE_HH
 #define ALIGN_INTERFACE_HH
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
-struct Align_interface {
+struct Align_interface
+{
   DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (fixed_distance_alignment_callback, (SCM element, SCM axis));
-  static void align_to_fixed_distance (Grob*, Axis a);
-  static void align_elements_to_extents (Grob*, Axis a);
-  static void set_axis (Grob*, Axis);
-  static Axis axis (Grob*) ;
-  static void add_element (Grob*, Grob*, SCM callback);
-  static int get_count (Grob*, Grob*);
-
-  static bool has_interface (Grob*);
+  static void align_to_fixed_distance (Grob *, Axis a);
+  static void align_elements_to_extents (Grob *, Axis a);
+  static void set_axis (Grob *, Axis);
+  static Axis axis (Grob *);
+  static void add_element (Grob *, Grob *, SCM callback);
+  static int get_count (Grob *, Grob *);
+
+  static bool has_interface (Grob *);
 };
 
-Grob *find_fixed_alignment_parent  (Grob *g);
-
+Grob *find_fixed_alignment_parent (Grob *g);
 
 #endif /* ALIGN_INTERFACE_HH */
 
index 5f027fbe017c72f8eff615556b9188282b8be8ac..f7af1bb4b94103cccbd41fe35eaa6f3ca4c4767e 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   all-fonts.hh -- declare All_font_metrics
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef ALL_FONTS_HH
 #define ALL_FONTS_HH
@@ -21,7 +20,7 @@
 
 /**
    Interface to all .afm files living in the filesystem.
- */
+*/
 class All_font_metrics
 {
   Scheme_hash_table *afm_dict_;
@@ -34,22 +33,22 @@ class All_font_metrics
   Scheme_hash_table *pango_dict_;
   int pango_dpi_;
 #endif
-  
-  All_font_metrics (All_font_metrics const&);
+
+  All_font_metrics (All_font_metrics const &);
 public:
   All_font_metrics (String search_path);
   ~All_font_metrics ();
-  
+
 #ifdef HAVE_PANGO_FT2
-  Pango_font *find_pango_font (PangoFontDescription*description,
+  Pango_font *find_pango_font (PangoFontDescription *description,
                               Real magnification,
                               Real scale);
 #endif
-  
+
   Adobe_font_metric *find_afm (String name);
   Tex_font_metric *find_tfm (String);
-  Font_metric *find_font (String name);  
-  Open_type_font *find_otf (String name);  
+  Font_metric *find_font (String name);
+  Open_type_font *find_otf (String name);
   SCM font_descriptions () const;
 };
 
index 924b3e87eef088686d71437a65d0a1dbd282b4a3..ea80b286217acae57d85e8f8c2c2cb10e1c95fd5 100644 (file)
@@ -16,9 +16,9 @@ class Grob;
 struct Ambitus
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM smob));
-  static bool has_interface (Grob*);
-  static Slice get_positions (Grob*);
-  static Interval head_width (Grob* me, Grob * common);
+  static bool has_interface (Grob *);
+  static Slice get_positions (Grob *);
+  static Interval head_width (Grob *me, Grob *common);
 };
 
 #endif // AMBITUS_HH
index 2eb368bba891d4bdef30a197441bd20c0da432b8..aa2e36260e1d1b367a8c705d95e1d8dee5a9e483 100644 (file)
@@ -1,6 +1,6 @@
 /*
   arpegio.hh -- declare Arpeggio
-  
+
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
@@ -18,7 +18,7 @@ public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
   DECLARE_SCHEME_CALLBACK (width_callback, (SCM, SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 #endif /* ARPEGGIO_HH */
index 75a5bcfeb5d51420190acf00c9a8c6b0dae97b09..3f99af98d6c4974db201f307523e4ad73ff43c4b 100644 (file)
@@ -2,7 +2,7 @@
   audio-column.hh -- declare Audio_column
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef AUDIO_COLUMN_HH
 #define AUDIO_COLUMN_HH
 #include "audio-element.hh"
 
 /**
-    generic audio grouped vertically.
- */
+   generic audio grouped vertically.
+*/
 
-class Audio_column : public Audio_element  { 
+class Audio_column : public Audio_element
+{
 public:
   Audio_column (Moment at_mom);
 
-  void add_audio_item (Audio_itemi);
+  void add_audio_item (Audio_item *i);
   Moment at_mom () const;
 
   Link_array<Audio_item> audio_items_;
 
 private:
-  Audio_column (Audio_column const&);
+  Audio_column (Audio_column const &);
 
   Moment at_mom_;
 };
 
-
 #endif // AUDIO_COLUMN_HH
index 4ab9feb891dbdc632265ae80538ae5b3c42426ff..54604a330ee0206522e9a7dff5fa6ad471724328 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   audio-item-info.hh -- declare Audio_item_info
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef AUDIO_ITEM_INFO_HH
 #define AUDIO_ITEM_INFO_HH
 #include "parray.hh"
 
 /**
-  Data container for broadcasts 
-  */
-class Audio_element_info {
+   Data container for broadcasts
+*/
+class Audio_element_info
+{
 public:
-  Audio_element * elem_;
+  Audio_element *elem_;
   Music *event_;
   Translator *origin_trans_;
 
-  Link_array<Context> origin_contexts (Translator*) const;  
+  Link_array<Context> origin_contexts (Translator *) const;
 
-  Audio_element_info (Audio_element*, Music*);
+  Audio_element_info (Audio_element *, Music *);
   Audio_element_info ();
 };
 
-
 #endif
index 2ebcee4291ac6fbad62ea79594ae9f1a877c4080..39cd369d38dc6cd68961432e7ab22515aec17f5b 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef AUDIO_ELEMENT_HH
 #define AUDIO_ELEMENT_HH
 
@@ -17,7 +16,7 @@ class Audio_element
 public:
   Audio_element ();
   virtual ~Audio_element ();
-  virtual const charname () const;
+  virtual const char *name () const;
 protected:
 };
 
index 2dae497bdc3c1ead6696065f0207727c37d20686..1ab00fd9158a2847b7b9310999b13c501efdbf19 100644 (file)
@@ -2,7 +2,7 @@
   audio-item.hh -- declare Audio_items
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef AUDIO_ITEM_HH
 #define AUDIO_ITEM_HH
 #include "pitch.hh"
 
 /**
-   
-  Any piece of audio information.  We need virtual constructors, let's
-  try decentralised factory for specific audio implemenations.
- */
+
+Any piece of audio information.  We need virtual constructors, let's
+try decentralised factory for specific audio implemenations.
+*/
 class Audio_item : public Audio_element
 {
 public:
   Audio_item ();
-  Audio_columnaudio_column_;
-  
+  Audio_column *audio_column_;
+
 private:
-  Audio_item (Audio_item const&);
-  Audio_item& operator = ( Audio_item const&);
+  Audio_item (Audio_item const &);
+  Audio_item &operator= (Audio_item const &);
 };
 
 class Audio_dynamic : public Audio_item
@@ -51,18 +51,18 @@ public:
 
   String str_;
 };
-                                      
+
 class Audio_note : public Audio_item
 {
-public:  
+public:
   Audio_note (Pitch p, Moment m, int transposing_i = 0);
 
-  void tie_to (Audio_note*);
+  void tie_to (Audio_note *);
 
   Pitch pitch_;
   Moment length_mom_;
   int transposing_;
-  Audio_notetied_;
+  Audio_note *tied_;
 };
 
 class Audio_piano_pedal : public Audio_item
@@ -75,11 +75,12 @@ public:
 class Audio_text : public Audio_item
 {
 public:
-  enum Type { 
-    TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
-    MARKER, CUE_POINT
-  };
-  
+  enum Type
+    {
+      TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
+      MARKER, CUE_POINT
+    };
+
   Audio_text (Audio_text::Type type, String text_string);
 
   Type type_;
index 64152e8ada652838783f564de4faaca7505e8179..a8823ba120a1345ca6058a8f47eef110bd053d00 100644 (file)
@@ -2,7 +2,7 @@
   audio-staff.hh -- declare Audio_staff
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef AUDIO_STAFF_HH
 #define AUDIO_STAFF_HH
@@ -13,8 +13,8 @@
 
 struct Audio_staff : public Audio_element
 {
-  void add_audio_item (Audio_item*  l);
-  void output (Midi_streammidi_stream_r, int track_i);
+  void add_audio_item (Audio_item *l);
+  void output (Midi_stream &midi_stream_r, int track_i);
 
   Link_array<Audio_item> audio_items_;
   int channel_;
index aee77390170a064a4bca6cac5f8020563969dbf6..6792372c0984564677ef8446790597dc80a585fd 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   axis-group-interface.hh -- declare Axis_group_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef AXIS_GROUP_INTERFACE_HH
 #define AXIS_GROUP_INTERFACE_HH
 #include "group-interface.hh"
 
 /**
-
-*/
-struct Axis_group_interface 
+ */
+struct Axis_group_interface
 {
   DECLARE_SCHEME_CALLBACK (group_extent_callback, (SCM smob, SCM axis));
-  static Interval relative_group_extent (Axis, Grob * common, SCM list);
-
-  static void add_element (Grob* me, Grob*);
-  static void set_axes (Grob*, Axis, Axis);
-  static bool has_axis (Grob*, Axis);
-  static Link_array<Grob> get_children (Grob*);
-  static bool has_interface (Grob*);
-  
-  
+  static Interval relative_group_extent (Axis, Grob *common, SCM list);
+
+  static void add_element (Grob *me, Grob *);
+  static void set_axes (Grob *, Axis, Axis);
+  static bool has_axis (Grob *, Axis);
+  static Link_array<Grob> get_children (Grob *);
+  static bool has_interface (Grob *);
+
 };
 
 #endif /* AXIS_GROUP_INTERFACE_HH */
index 57b0a4c525252dcc999e3fc2f194b4d894dbf7e6..657d95a4935e3302282dff619d8e70b6e59ded67 100644 (file)
 #include "lily-proto.hh"
 
 /**
-  A vertical bar.
- */
+   A vertical bar.
+*/
 class Bar_line
 {
 public:
-  static bool has_interface (Grob*);
-  
-  static Stencil compound_barline (Grob*, String, Real height) ;
-  static Stencil simple_barline (Grob*, Real wid, Real height) ;      
-  DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
+  static bool has_interface (Grob *);
+
+  static Stencil compound_barline (Grob *, String, Real height);
+  static Stencil simple_barline (Grob *, Real wid, Real height);
+  DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
 };
 #endif // BAR_HH
 
index d455d2f16caf1ffd87c8aa7848af154dc70f3134..96be5257a464d26bb3d84693d0e3d4e72763556e 100644 (file)
 #include "lily-proto.hh"
 
 /**
-  A vertical bar.
- */
+   A vertical bar.
+*/
 class Bar
 {
 public:
-  static bool has_interface (Grob*);
-  
-  static Stencil compound_barline (Grob*, String, Real height) ;
-  static Stencil simple_barline (Grob*, Real wid, Real height) ;      
-  DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
+  static bool has_interface (Grob *);
+
+  static Stencil compound_barline (Grob *, String, Real height);
+  static Stencil simple_barline (Grob *, Real wid, Real height);
+  DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
 };
 #endif // BAR_HH
 
index 94c4a64fd1ad91f5c5879d81a51eb5f67fa6cb96..746d7e14581f024b8d1367932aae200470d8fa70 100644 (file)
 #include "lily-guile.hh"
 #include "stem-info.hh"
 
-
 class Beam
 {
 public:
-  static int visible_stem_count (Grob*);
-  static Grob* first_visible_stem (Grob*);
-  static Grob* last_visible_stem (Grob*);
-  static bool has_interface (Grob*);
+  static int visible_stem_count (Grob *);
+  static Grob *first_visible_stem (Grob *);
+  static Grob *last_visible_stem (Grob *);
+  static bool has_interface (Grob *);
   DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
   Beam (SCM);
-  static void add_stem (Grob*, Grob*);
-  static bool is_knee (Grob*);
-  static void set_beaming (Grob*, Beaming_info_list *);
-  static void set_stemlens (Grob*);
-  static int get_beam_count (Grob*me);
-  static void position_beam (Grobme);
-  static Real get_beam_translation (Grob*me);
-  static Real get_thickness (Grob*me);
+  static void add_stem (Grob *, Grob *);
+  static bool is_knee (Grob *);
+  static void set_beaming (Grob *, Beaming_info_list *);
+  static void set_stemlens (Grob *);
+  static int get_beam_count (Grob *me);
+  static void position_beam (Grob *me);
+  static Real get_beam_translation (Grob *me);
+  static Real get_thickness (Grob *me);
 
-  static void connect_beams (Grob*me);
+  static void connect_beams (Grob *me);
   DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
-  
+
   /* position callbacks */
   DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
   DECLARE_SCHEME_CALLBACK (check_concave, (SCM));
   DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
-  DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));  
+  DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));
   DECLARE_SCHEME_CALLBACK (quanting, (SCM));
   static Real score_slopes_dy (Real, Real, Real, Real, Real, bool);
 
@@ -51,25 +50,24 @@ public:
                                  Array<Stem_info> const &stem_infos,
                                  Array<Real> const &base_stem_ys,
                                  Array<Real> const &stem_xs,
-                                 Real xl, Real xr, 
-                                 bool knee, 
+                                 Real xl, Real xr,
+                                 bool knee,
                                  Real yl, Real yr);
   static Real score_forbidden_quants (Real, Real,
                                      Real, Real, Real, Real,
                                      Drul_array<int>, Direction, Direction);
-  
 
   static int get_direction_beam_count (Grob *me, Direction d);
 private:
-  static Direction get_default_dir (Grob*);
-  static void set_stem_directions (Grob*, Direction );
-  static void consider_auto_knees (Grob*);
-  static void set_stem_shorten (Grob*);
-  static Real calc_stem_y (Grob*, Grob* s, Grob**c,
+  static Direction get_default_dir (Grob *);
+  static void set_stem_directions (Grob *, Direction);
+  static void consider_auto_knees (Grob *);
+  static void set_stem_shorten (Grob *);
+  static Real calc_stem_y (Grob *, Grob *s, Grob **c,
                           Real, Real,
                           Drul_array<Real> pos, bool french);
-  static void set_stem_lengths (Grob*);
-  static int forced_stem_count (Grob*);
+  static void set_stem_lengths (Grob *);
+  static int forced_stem_count (Grob *);
 };
 
 const int REGION_SIZE = 2;
index 44b7df2a59c8895581460f94dd155e2856cb8a74..0200d55a68ef5353773b21fb1db841a100aa361e 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   beaming.hh -- declare beaming.hh
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef BEAMING_HH
 #define BEAMING_HH
@@ -37,5 +36,4 @@ struct Beaming_info_list
   void add_stem (Moment d, int beams);
 };
 
-
 #endif /* BEAMING_HH */
index 4b449c6b42bcda714845d25f765ca393113fec4a..a564dbeb1f190e622829f69dae6784cef4cb75ea 100644 (file)
@@ -7,14 +7,13 @@
 #ifndef BEZIER_HH
 #define BEZIER_HH
 
-
 #include "interval.hh"
 #include "offset.hh"
 #include "polynomial.hh"
 
 /**
-  Simple bezier curve
- */
+   Simple bezier curve
+*/
 class Bezier
 {
 public:
@@ -38,7 +37,6 @@ public:
     Array<> gives unnecessary overhead, and makes debugging a royal
     pain.  */
 
-  
   Offset control_[4];
 };
 
@@ -46,12 +44,10 @@ void scale (Array<Offset>* array, Real xscale, Real yscale);
 void rotate (Array<Offset>* array, Real phi);
 void translate (Array<Offset>* array, Offset o);
 
-
-
 Bezier slur_shape (Real width, Real height_limit,
                   Real height_proportion);
-Real slur_height (Real width, Real height_limit, Real height_proportion); 
-void get_slur_indent_height (Real * indent, Real *height, Real width, Real h_inf, Real r_0);
+Real slur_height (Real width, Real height_limit, Real height_proportion);
+void get_slur_indent_height (Real *indent, Real *height, Real width, Real h_inf, Real r_0);
 
 #endif // BEZIER_HH
 
index 4d1dd197def9874ded5403276414a8a275fc5cec..b47caf9270cab1dc5c6936966a59f5bf307a57d7 100644 (file)
 class Binary_source_file : public Source_file
 {
 public:
-  Binary_source_file (String& file_name_string );
+  Binary_source_file (String &file_name_string);
   virtual ~Binary_source_file ();
 
-  U8 get_U8 (); 
+  U8 get_U8 ();
   U16 get_U16 ();
   U32 get_U32 ();
   Byte get_Byte () {return get_U8 (); }
   int get_int () { return get_U32 (); }
-  
-  virtual String error_string (char const* pos_str0 ) const;
-  virtual int get_line (char const* pos_str0 ) const;
+
+  virtual String error_string (char const *pos_str0) const;
+  virtual int get_line (char const *pos_str0) const;
 };
 
 #endif // BINARY_SOURCE_FILE_HH
index 0d4fa66147decdc23f87f5a04f5cf3ecb141a340..88b9207c3e23730005826f23e7365979bcad9f7f 100644 (file)
@@ -27,7 +27,7 @@ public:
 
   Book ();
   void add_score (SCM);
-  Paper_book* process (String, Output_def*);
+  Paper_book *process (String, Output_def *);
   void set_keys ();
 };
 
index 901987f1ad381d8ff83ec97fb9a5e5b3270ab77c..85173e0b5277ed15190661e8a7318457e0e42568 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    some 2D geometrical concepts
+  some 2D geometrical concepts
 */
 
 #ifndef BOXES_HH
@@ -11,7 +11,7 @@
 struct Box
 {
   Interval interval_a_[NO_AXES];
-    
+
   Interval &x () {return interval_a_[X_AXIS]; }
   Interval &y (){ return interval_a_[Y_AXIS]; }
   Interval x () const{ return interval_a_[X_AXIS]; }
@@ -20,7 +20,7 @@ struct Box
   Interval &operator[] (Axis a);
 
   Offset center () const;
-    
+
   void translate (Offset o);
   /// smallest box enclosing #b#
   void set_empty ();
@@ -32,5 +32,4 @@ struct Box
   Box (Interval ix, Interval iy);
 };
 
-
 #endif
index 82d648cd61fd7c16517887c5e9f99820481ca9dc..a891c7c140fa87e9f0dab79bde512e0c40d87cf0 100644 (file)
@@ -6,38 +6,36 @@
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef BREAK_HH
 #define BREAK_HH
 
 #include "interval.hh"
 #include "column-x-positions.hh"
 
-
 /** Class representation of an algorithm which decides where to put
-  the column, and where to break lines.
+    the column, and where to break lines.
 
-  JUNKME.
-  
-  */
-class Break_algorithm {
+    JUNKME.
+*/
+class Break_algorithm
+{
 protected:
   Paper_score *pscore_;
   Real linewidth_;
 
   Link_array<Grob> find_breaks () const;
   Array<int> find_break_indices () const;
-  void solve_line (Column_x_positions*) const;
+  void solve_line (Column_x_positions *) const;
   bool feasible (Link_array<Grob> const &) const;
 
-  Simple_spacer_wrappergenerate_spacing_problem (Link_array<Grob> const &, Interval) const;
+  Simple_spacer_wrapper *generate_spacing_problem (Link_array<Grob> const &, Interval) const;
 
   virtual Array<Column_x_positions> do_solve () const = 0;
 
 public:
-  Simple_spacer(*get_line_spacer) ();
+  Simple_spacer *(*get_line_spacer) ();
   Break_algorithm ();
-  void set_pscore (Paper_score*);
+  void set_pscore (Paper_score *);
   Array<Column_x_positions> solve () const;
 };
 
index 0d20385b9a1d3f09631d9948c17354c3352969e9..96aec1122d0d6695e62561d4901be59e8f805505 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef BREAK_ALIGN_INTERFACE_HH
 #define BREAK_ALIGN_INTERFACE_HH
 
 class Break_align_interface
 {
 public:
-  static void do_alignment (Grob*);
+  static void do_alignment (Grob *);
   static Link_array<Grob> ordered_elements (Grob *me);
-  static bool has_interface (Grob*);
-  static void add_element (Grob*me, Grob*add);
+  static bool has_interface (Grob *);
+  static void add_element (Grob *me, Grob *add);
   DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis));
-  
+
 };
 struct Break_aligned_interface
 {
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
-
 #endif // BREAK_ALIGN_INTERFACE_HH
index f29069ab63ea45fb27fc081483ea938aa59e2ae0..acff1ea3cbbc6fffc06dbaaeb096a7969ba4af05 100644 (file)
@@ -4,7 +4,6 @@
   Copyright (c) 1999--2005 Michael Krause
 
   written for the GNU LilyPond music typesetter
-
 */
 
 #ifndef BREATHING_SIGN_HH
@@ -21,15 +20,15 @@ class Grob;
 class Breathing_sign
 {
 public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  DECLARE_SCHEME_CALLBACK (railtracks, (SCM ));
-  DECLARE_SCHEME_CALLBACK (divisio_minima, (SCM ));
-  DECLARE_SCHEME_CALLBACK (divisio_maior, (SCM ));
-  DECLARE_SCHEME_CALLBACK (divisio_maxima, (SCM ));
-  DECLARE_SCHEME_CALLBACK (finalis, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (railtracks, (SCM));
+  DECLARE_SCHEME_CALLBACK (divisio_minima, (SCM));
+  DECLARE_SCHEME_CALLBACK (divisio_maior, (SCM));
+  DECLARE_SCHEME_CALLBACK (divisio_maxima, (SCM));
+  DECLARE_SCHEME_CALLBACK (finalis, (SCM));
   DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element, SCM axis));
-  
-  static bool has_interface (Grob*);
+
+  static bool has_interface (Grob *);
 };
 
 #endif // BREATHING_SIGN_HH
index 12de3af076d25fd5d2d7073b16c9b7269c582802..1a6cd217280f1188d9c4de62684be4dc8b5d5f44 100644 (file)
@@ -6,22 +6,20 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef CHANGE_ITERATOR_HH
 #define CHANGE_ITERATOR_HH
 
 #include "simple-music-iterator.hh"
 
-
 class Change_iterator : public Simple_music_iterator
 {
 public:
   /* constructor is public */
   virtual void process (Moment);
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 
 private:
-  void  error (String);
+  void error (String);
 };
 
 #endif
index b0cd786ef5f93eb90251c636dedf2743b60f7b44..966db88c91bef8f8d043356e496e0276c3c48bd5 100644 (file)
 
 #include "stencil.hh"
 
-
 class Chord_name
 {
 public:
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-  static bool has_interface (Grob*);
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  static bool has_interface (Grob *);
 };
 
 #endif // CHORD_NAME_HH
index bf899963985eaa01f6c68103866388dd73bf1066..5cc0513971522c67894586912704ba253e8f67b5 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   chord-tremolo-iterator.hh -- declare Chord_tremolo_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef CHORD_TREMOLO_ITERATOR_HH
 #define CHORD_TREMOLO_ITERATOR_HH
 class Chord_tremolo_iterator : public Music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Chord_tremolo_iterator ();
-  Chord_tremolo_iterator (Chord_tremolo_iterator const & );
+  Chord_tremolo_iterator (Chord_tremolo_iterator const &);
 protected:
-  virtual void derived_substitute (Context *f, Context *t) ;
+  virtual void derived_substitute (Context *f, Context *t);
 
   virtual void derived_mark () const;
   virtual Moment pending_moment () const;
-  virtual void do_quit(); 
-  virtual void construct_children () ;
+  virtual void do_quit ();
+  virtual void construct_children ();
   virtual bool ok () const;
-  virtual void process (Moment) ;
+  virtual void process (Moment);
   virtual Music_iterator *try_music_in_children (Music *) const;
 private:
   Moment factor_;
-  Music_iterator * child_iter_;
+  Music_iterator *child_iter_;
 };
 
-
 #endif /* CHORD_TREMOLO_ITERATOR_HH */
 
index 4abc16a1ed24458447c444b6ef3deb84e1ae2883..ec80108af6b0d6ac461427a9fd3a6762bc5e0eea 100644 (file)
@@ -1,24 +1,22 @@
-/*   
+/*
   clef.hh -- declare Clef
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef CLEF_HH
 #define CLEF_HH
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-struct Clef 
+struct Clef
 {
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  static bool has_interface (Grob*);
+  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  static bool has_interface (Grob *);
 };
 
-
 #endif /* CLEF_HH */
 
index f300c1bc18c98e5e58f7246b63ec58e2792403c8..c44f74c7eafe0e1804b8305e3637173e7da38497 100644 (file)
@@ -14,7 +14,7 @@
 class Cluster
 {
 public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
   //  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
   static bool has_interface (Grob *);
   // DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
index 11e647608f615d7cd092e48edbd919db91128749..c90677aac736961647ae2f1e984fc1cdd1fa60e1 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   coherent-ligature-engraver.hh -- declare Coherent_ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
-  
- */
+*/
 #ifndef COHERENT_LIGATURE_ENGRAVER_HH
 #define COHERENT_LIGATURE_ENGRAVER_HH
 
@@ -14,7 +13,7 @@
 class Coherent_ligature_engraver : public Ligature_engraver
 {
 public:
-  TRANSLATOR_DECLARATIONS(Coherent_ligature_engraver);
+  TRANSLATOR_DECLARATIONS (Coherent_ligature_engraver);
 
 protected:
   virtual void build_ligature (Spanner *ligature,
index 60f85cfc3467fae46cdc5494683f5acebc619ba5..4d0fd6b9b01cc9b8e5e53c46d04ef027fe466a41 100644 (file)
 #include "parray.hh"
 #include "lily-proto.hh"
 
-
 struct Column_x_positions
 {
   Link_array<Grob> cols_;
   Link_array<Grob> loose_cols_;
-  
+
   Array<Real> config_;
   Real force_;
   bool satisfies_constraints_;
@@ -23,6 +22,5 @@ struct Column_x_positions
   Column_x_positions ();
 };
 
-
 #endif // COLUMN_X_POSITIONS_HH
 
index 744cd1f8ac22b05fd7eba46b61921bee0af3726b..5d45e6c0883651fb363e389bea87ae6c9bc2ae9a 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   context-def.hh -- declare Context_def
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef CONTEXT_DEF_HH
 #define CONTEXT_DEF_HH
@@ -31,7 +30,7 @@ private:
   SCM context_name_;
   SCM context_aliases_;
   SCM translator_group_type_;
-  
+
 public:
   void add_context_mod (SCM);
   SCM default_child_context_name ();
@@ -42,19 +41,19 @@ public:
   void set_acceptor (SCM accepts, bool add);
 
   Link_array<Context_def> path_to_acceptable_context (SCM type_string,
-                                                     Output_def*) const;
-  Context * instantiate (SCM extra_ops, Object_key const*);
+                                                     Output_def *) const;
+  Context *instantiate (SCM extra_ops, Object_key const *);
 
   SCM to_alist () const;
   static SCM make_scm ();
 
   SCM clone_scm () const;
-  void apply_default_property_operations (Context*);
+  void apply_default_property_operations (Context *);
 
 private:
   DECLARE_SMOBS (Context_def, foo);
   Context_def ();
-  Context_def (Context_def const&);
+  Context_def (Context_def const &);
 };
 
 DECLARE_UNSMOB (Context_def, context_def);
index f6a29923e2a2104e90012e01db715c59e886133b..0981bc536a4ec49c07a69e2004cc406ece50a24e 100644 (file)
@@ -1,8 +1,8 @@
 /*
   context.hh -- declare  Context
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "moment.hh"
 #include "lily-proto.hh"
 
-
 class Context
 {
   Scheme_hash_table *properties_dict () const;
   Context (Context const &src);
-  
+
   DECLARE_SMOBS (Context, dummy);
 
   void terminate ();
@@ -29,12 +28,12 @@ private:
   int iterator_count_;
   bool init_;
 
-  std::map<String, int> grob_counts_;
-  std::map<String, int> context_counts_;
+  std::map < String, int> grob_counts_;
+  std::map < String, int> context_counts_;
 
 protected:
-  Object_key const * key_;
-  Context * daddy_context_;
+  Object_key const *key_;
+  Context *daddy_context_;
   SCM definition_;
   SCM properties_scm_;
   SCM context_list_;
@@ -51,37 +50,36 @@ public:
   Object_key const *get_grob_key (String);
   Object_key const *get_context_key (String, String);
 
-  Context *create_context (Context_def*, String, SCM); 
-  String id_string () const { return id_string_; } 
+  Context *create_context (Context_def *, String, SCM);
+  String id_string () const { return id_string_; }
   SCM children_contexts () const { return context_list_; }
   SCM default_child_context_name () const;
 
-  Translator_groupimplementation () const;
+  Translator_group *implementation () const;
   Context *get_parent_context () const;
-  Context (Object_key const*);
-  
+  Context (Object_key const *);
+
   /* properties:  */
   void execute_pushpop_property (SCM prop, SCM sym, SCM val);
   SCM internal_get_property (SCM name_sym) const;
   SCM properties_as_alist () const;
-  void internal_set_property (SCM var_sym, SCM value);  
+  void internal_set_property (SCM var_sym, SCM value);
   Context *where_defined (SCM name_sym) const;
   void unset_property (SCM var_sym);
 
-  
   Context *remove_context (Context *trans);
   void check_removal ();
   String context_name () const;
   SCM context_name_symbol () const;
   Global_context *get_global_context () const;
-  
-  virtual Score_context * get_score_context () const;  
+
+  virtual Score_context *get_score_context () const;
   virtual Output_def *get_output_def () const;
   virtual Moment now_mom () const;
   virtual Context *get_default_interpreter ();
 
   bool is_alias (SCM) const;
-  void add_alias (SCM); 
+  void add_alias (SCM);
   void add_context (Context *trans);
   bool is_bottom_context () const;
   bool is_removable () const;
@@ -90,27 +88,27 @@ public:
   Context *find_create_context (SCM context_name,
                                String id, SCM ops);
   Context *create_unique_context (SCM context_name,
-                                  SCM ops);
+                                 SCM ops);
   Link_array<Context> path_to_acceptable_context (SCM alias,
-                                                 Output_def*) const;
+                                                 Output_def *) const;
 
 };
 
 /*
-  Context arg? 
- */
+  Context arg?
+*/
 
 void apply_property_operations (Context *tg, SCM pre_init_ops);
 void execute_pushpop_property (Context *trg, SCM prop, SCM eltprop, SCM val);
 SCM updated_grob_properties (Context *tg, SCM sym);
 Context *find_context_below (Context *where,
-                             SCM type_sym, String id);
+                            SCM type_sym, String id);
 bool melisma_busy (Context *);
 
 Context *get_voice_to_lyrics (Context *lyrics);
 Grob *get_current_note_head (Context *voice);
 Grob *get_current_rest (Context *voice);
-DECLARE_UNSMOB(Context, context);
+DECLARE_UNSMOB (Context, context);
 
 #endif /* CONTEXT_HH */
 
index 1844c752c1c1ea94aca9f1af8c85c5a8cdd8b10a..5c706e8154a87269d18b8bded4e41acb45a706bf 100644 (file)
@@ -16,12 +16,12 @@ class Stencil;
 
 struct Custos
 {
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  static bool has_interface (Grob*);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  static bool has_interface (Grob *);
 
 private:
-  static void add_streepjes (Grob* me, int pos, int interspaces, Stencil* custos_);
-  static Stencil create_ledger_line (Interval x_extent, Grob *me) ;
+  static void add_streepjes (Grob *me, int pos, int interspaces, Stencil *custos_);
+  static Stencil create_ledger_line (Interval x_extent, Grob *me);
 
 };
 
index ff9ea00c6088580fcc0eaee4b5980959211cbe01..40ef9128441acfc0a30877c16a47e84b4e09fe40 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-  dimension-cache-callback.hh -- declare 
-  
+/*
+  dimension-cache-callback.hh -- declare
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef DIMENSION_CACHE_CALLBACK_HH
 #define DIMENSION_CACHE_CALLBACK_HH
index 0abb7f6c37ef5f8f546b37deedde6e9ce5242f5a..86c3a663d0f1af096ac1836818917f6d9aaeeb58 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   dimension-cache.hh -- declare Dimension_cache
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef DIMENSION_CACHE_HH
 #define DIMENSION_CACHE_HH
 #include "lily-guile.hh"
 
 /**
-  Adminstration of offset dimension info.
+   Adminstration of offset dimension info.
 */
 struct Dimension_cache
 {
   /*
     Multi typed:
 
-     - cons: interval
-     - procedure: callback     
-     - else: empty
-   */
+    - cons: interval
+    - procedure: callback
+    - else: empty
+  */
   SCM dimension_;
   SCM dimension_callback_;
 
   /**
-    The offset wrt. to the center of #parent_#
-   */
+     The offset wrt. to the center of #parent_#
+  */
 
   Real offset_;
   SCM offset_callbacks_;
-  
+
   char offsets_left_;
 
   /**
-     What to call to find extent.  Nil means empty. 
-   */
-  Grob * parent_;
+     What to call to find extent.  Nil means empty.
+  */
+  Grob *parent_;
 
-  Dimension_cache (Dimension_cache const&);
+  Dimension_cache (Dimension_cache const &);
   Dimension_cache ();
   void init ();
 };
 
-
 #endif /* DIMENSION_CACHE_HH */
 
index bc93a975ae590015457352db62bb3f9bd9ba450c..84f8c2884b9caeccad199cb6ce39be1ac6e5d2ba 100644 (file)
@@ -4,7 +4,6 @@
 #include "real.hh"
 class String;
 
-
 const Real INCH_TO_PT = 72.270;
 const Real CM_TO_PT = (INCH_TO_PT / 2.54);
 const Real MM_TO_PT = (CM_TO_PT / 10);
@@ -18,23 +17,23 @@ const Real PT_TO_MM = (1.0 / MM_TO_PT);
 
 #define INTERNAL_UNIT "pt"
 
-#define PT * (PT_TO_PT)
-#define MM * (MM_TO_PT)
-#define CM  * (CM_TO_PT)
-#define INCH * (INCH_TO_PT)
-#define BIGPOINT * (BIGPOINT_TO_POINT)
-#define CHAR * (CHAR_TO_PT)
+#define PT *(PT_TO_PT)
+#define MM *(MM_TO_PT)
+#define CM *(CM_TO_PT)
+#define INCH *(INCH_TO_PT)
+#define BIGPOINT *(BIGPOINT_TO_POINT)
+#define CHAR *(CHAR_TO_PT)
 
-#else  // mm
+#else // mm
 
 #define INTERNAL_UNIT "mm"
 
-#define PT * (PT_TO_PT * PT_TO_MM)
-#define MM * (MM_TO_PT * PT_TO_MM)
-#define CM * (CM_TO_PT *PT_TO_MM)
-#define INCH * (INCH_TO_PT * PT_TO_MM)
-#define BIGPOINT * (BIGPOINT_TO_POINT * PT_TO_MM)
-#define CHAR * (CHAR_TO_PT * PT_TO_MM)
+#define PT *(PT_TO_PT *PT_TO_MM)
+#define MM *(MM_TO_PT *PT_TO_MM)
+#define CM *(CM_TO_PT *PT_TO_MM)
+#define INCH *(INCH_TO_PT *PT_TO_MM)
+#define BIGPOINT *(BIGPOINT_TO_POINT *PT_TO_MM)
+#define CHAR *(CHAR_TO_PT *PT_TO_MM)
 
 #endif
 
index 23d8e9e399e883f44935d265dd7eef425f87edea..67a5ea74c112451a21934519854858a3729fe09a 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   directional-element.hh -- declare Directional_element
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef DIRECTIONAL_ELEMENT_HH
 #define DIRECTIONAL_ELEMENT_HH
@@ -13,8 +12,8 @@
 #include "grob.hh"
 
 // what is the advantage not having these two as STATICs of GROB -- jcn
-void set_grob_direction (Grob*, Direction);
-Direction get_grob_direction (Grob*);
+void set_grob_direction (Grob *, Direction);
+Direction get_grob_direction (Grob *);
 
 #endif /* DIRECTIONAL_ELEMENT_HH */
 
index 81a373edf22b2ba2c6c296426cf44f6af411f833..ac9bbc488c65d8e27b708c776a3c418975c47d24 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef DOT_COLUMN_HH
 #define DOT_COLUMN_HH
 
 class Grob;
 
 /**
-  Group dots.  This is needed because, the dots have to be aligned per voice
- */
-class Dot_column               // interface
+   Group dots.  This is needed because, the dots have to be aligned per voice
+*/
+class Dot_column // interface
 {
 public:
-  static int compare (Grob * const&, Grob * const&);
-  static void add_head (Grob * dotcol, Grob* rh );
+  static int compare (Grob *const &, Grob *const &);
+  static void add_head (Grob *dotcol, Grob *rh);
 
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM , SCM));
-  DECLARE_SCHEME_CALLBACK (side_position, (SCM , SCM));  
-  static SCM do_shifts (Grob*);
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (side_position, (SCM, SCM));
+  static SCM do_shifts (Grob *);
 };
 #endif // DOT_COLUMN_HH
index 0d298f057107f5ea1d939f10fe61bc326a549fa9..a6b10298712fe45ff1ab109b726a28280bd0da38 100644 (file)
@@ -6,20 +6,17 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef DOTS_HH
 #define DOTS_HH
 
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
-
-
 class Dots
 {
 public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  bool has_interface (Grob*);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  bool has_interface (Grob *);
 };
 
 #endif // DOTS_HH
index 931fdab7c9aae1fd0efb3be63c7821692e80bf4e..4b7926d7a743255b55a01744c403c258fb134b50 100644 (file)
@@ -1,10 +1,9 @@
 /*
   duration.hh -- declare Duration
-  
+
   source file of the LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-
 */
 
 #ifndef DURATION_HH
 
 /**
    A musical duration.
-  */
-struct Duration {
+*/
+struct Duration
+{
 public:
-  
+
   Duration ();
   Duration (int, int);
   String to_string () const;
 
   Duration compressed (Rational) const;
-  Rational get_length () const ;
+  Rational get_length () const;
   Rational factor () const { return factor_; }
   int duration_log () const;
   int dot_count () const;
 
-  static int compare (Duration const&, Duration const&);
+  static int compare (Duration const &, Duration const &);
 
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
-  DECLARE_SIMPLE_SMOBS (Duration, );
+  DECLARE_SIMPLE_SMOBS (Duration,);
 
 private:
   /// Logarithm of the base duration.
index be4e7d9a30dc96dc1170d9f9e9866659c37d822d..7d58562c3a20f949769e4b1a2bc886280ed2d457 100644 (file)
@@ -7,22 +7,20 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef ENGRAVERGROUP_HH
 #define ENGRAVERGROUP_HH
 
 #include "engraver.hh"
 #include "translator-group.hh"
 
-
 class Engraver_group_engraver : public virtual Engraver,
                                public virtual Translator_group
 {
 protected:
   Array<Grob_info> announce_infos_;
-  
+
 public:
-  TRANSLATOR_DECLARATIONS(Engraver_group_engraver);
+  TRANSLATOR_DECLARATIONS (Engraver_group_engraver);
 
   virtual void initialize ();
   virtual void do_announces ();
index 9b89eea5f1eed9dcf3594513795ab3b0879bdb7f..3a44301b3ebc23a7afe19650655ffe3cd8f79a03 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef ENGRAVER_HH
 #define ENGRAVER_HH
 
 #include "translator.hh"
 
 /**
-  a struct which processes events, and creates the #Grob#s.
-  It may use derived classes. 
-  */
-class Engraver : public virtual Translator {
-    
+   a struct which processes events, and creates the #Grob#s.
+   It may use derived classes.
+*/
+class Engraver : public virtual Translator
+{
+
   friend class Engraver_group_engraver;
 protected:
   /*
@@ -27,37 +27,35 @@ protected:
     put item in spanner. Adjust local key; etc.
 
     Default: ignore the info
-    */
+  */
   virtual void acknowledge_grob (Grob_info) {}
 
   /** Do things with stuff found in acknowledge_grob. Ugh. Should
-     be looped with acknowledge_grob.
-     
-   */
+      be looped with acknowledge_grob.
+
+  */
   virtual void process_acknowledged_grobs () {}
 
   virtual void announce_grob (Grob_info);
-  Engraver_group_engraver*get_daddy_engraver () const;
-  
+  Engraver_group_engraver *get_daddy_engraver () const;
+
 public:
   /**
-    Announce element. Default: pass on to daddy. Utility
-    */
-  void announce_grob (Grob*, SCM cause);
-  
-  Score_engraver * get_score_engraver () const;
+     Announce element. Default: pass on to daddy. Utility
+  */
+  void announce_grob (Grob *, SCM cause);
+
+  Score_engraver *get_score_engraver () const;
   /**
-    override other ctor
-   */
-  TRANSLATOR_DECLARATIONS(Engraver);
+     override other ctor
+  */
+  TRANSLATOR_DECLARATIONS (Engraver);
 };
 
 #define make_item(x, cause) make_item_from_properties (this, ly_symbol2scm (x), cause, x)
 #define make_spanner(x, cause) make_spanner_from_properties (this, ly_symbol2scm (x), cause, x)
-Item* make_item_from_properties (Engraver * tg, SCM x, SCM cause, const char *name);
-Spanner* make_spanner_from_properties (Engraver * tg, SCM x, SCM cause, const char*name);
-
-
+Item *make_item_from_properties (Engraver *tg, SCM x, SCM cause, const char *name);
+Spanner *make_spanner_from_properties (Engraver *tg, SCM x, SCM cause, const char *name);
 
 
 #endif // ENGRAVER_HH
index 461c4f79b7d749f857a9f15a013385ea78a47d30..e0f2635923c841e9336d7e4abd410214f8e81a09 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef EVENT_ITER_HH
 #define EVENT_ITER_HH
 
 
 /**
    Walk through a Event_chord
- */
+*/
 class Event_chord_iterator : public Simple_music_iterator
 {
-  Event_chord * get_elt () const;
+  Event_chord *get_elt () const;
   /**
      Find a bottom notation context to deliver events to.
-   */
-  virtual Context * get_req_translator ();
-
+  */
+  virtual Context *get_req_translator ();
 
   /*
     Since Event_chord_iterator has no list-cursor internally, we
     must use a status variable to adminstrate where we are */
-  
-  enum { NONE_DONE, START_DONE, END_DONE }  status_;
+
+  enum { NONE_DONE, START_DONE, END_DONE }
+    status_;
+
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Event_chord_iterator ();
-  Event_chord_iterator (Event_chord_iterator const&);
+  Event_chord_iterator (Event_chord_iterator const &);
 
 protected:
   virtual void process (Moment);
   virtual void construct_children ();
 };
 
-
 #endif // EVENT_ITER_HH
index 4f981fb01a53734d7920c20f50518cdc38528c51..6878eb4e613053165a4d36adeb752bfaed216936 100644 (file)
@@ -9,24 +9,20 @@
 #ifndef EVENT_HH
 #define EVENT_HH
 
-
 #include "input.hh"
 #include "music.hh"
 #include "duration.hh"
 #include "pitch.hh"
 
 /* An atom of musical information.  This is an abstract class for any
-  piece of music that does not contain other Music.  */
+   piece of music that does not contain other Music.  */
 class Event : public Music
 {
 public:
   Event (SCM);
   VIRTUAL_COPY_CONSTRUCTOR (Music, Event);
-  DECLARE_SCHEME_CALLBACK(length_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (length_callback, (SCM));
 };
 
 
-
-
-
 #endif
index ab9217f0af384cb81c13699a433623eab448eca7..12b904f7598b3093b61a703b5e17b0b3e4b15bf0 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   folded-repeat-iterator.hh -- declare Folded_repeat_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef FOLDED_REPEAT_ITERATOR_HH
 #define FOLDED_REPEAT_ITERATOR_HH
 /**
    Iterate through a repeated section: first do the body, then
    all alternatives in parallel.
- */
+*/
 class Folded_repeat_iterator : public Music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 
   Folded_repeat_iterator (Folded_repeat_iterator const &src);
   Folded_repeat_iterator ();
   virtual void derived_mark () const;
-  virtual void derived_substitute (Context *f, Context *t) ;
-
+  virtual void derived_substitute (Context *f, Context *t);
 
   virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit(); 
+  virtual void do_quit ();
   virtual bool ok () const;
 
 protected:
   void enter_alternative ();
   void leave_body ();
-  
+
   virtual void process (Moment);
   virtual Music_iterator *try_music_in_children (Music *) const;
 
 private:
-  Music_iterator * main_iter_;
-  Music_iterator * alternative_iter_;
+  Music_iterator *main_iter_;
+  Music_iterator *alternative_iter_;
 
   Moment main_length_mom_;
 };
index 28ac73349e0370acff28847030ca1322b03fa884..fce817ba87d9f5bf1bd0536cea2a5530ef37e87b 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   font-interface.hh -- declare Font_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef FONT_INTERFACE_HH
 #define FONT_INTERFACE_HH
 
 struct Font_interface
 {
-  static SCM text_font_alist_chain (Grob*);
-  static SCM music_font_alist_chain (Grob*);
-  static Font_metric * get_default_font (Grob*);
-  static bool has_interface (Grob*);
+  static SCM text_font_alist_chain (Grob *);
+  static SCM music_font_alist_chain (Grob *);
+  static Font_metric *get_default_font (Grob *);
+  static bool has_interface (Grob *);
 };
 
 #endif /* FONT_INTERFACE_HH */
index c94fa2bb986340960dcd401b566c3e0ce91020ec..48d16b83168c8f20e3138b8438830863fe13851b 100644 (file)
@@ -1,11 +1,9 @@
 /*
-
   font-metric.hh -- declare Font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
 */
 
 #ifndef FONT_METRIC_HH
@@ -37,12 +35,12 @@ public:
   virtual Stencil get_indexed_char_stencil (int k) const;
   virtual Stencil get_ascii_char_stencil (int k) const;
   virtual SCM sub_fonts () const;
-  virtual SCM font_file_name () const; 
-  DECLARE_SMOBS (Font_metric, );
+  virtual SCM font_file_name () const;
+  DECLARE_SMOBS (Font_metric,);
 
 private:
   /* No copying, no implicit copy constructor.  */
-  Font_metric (Font_metric const&);
+  Font_metric (Font_metric const &);
 
 protected:
   virtual void derived_mark () const;
index d23bba1f7d50360263755bc1120dd4cc57135535..ec20ab932d7e2a921ad9f1592f5de4b3de4c8d6d 100644 (file)
@@ -4,16 +4,15 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef FREETYPE_HH
 #define FREETYPE_HH
 
 #include <ft2build.h>
-#include FT_FREETYPE_H 
+#include FT_FREETYPE_H
 
-void init_freetype();
+void init_freetype ();
 extern FT_Library freetype2_library;
 
 #endif /* FREETYPE_HH */
index 181ee87703f19c42ab0d5af3f530553bba6081a7..a51859f3a5e9d6850b78eed0d774c9549b6ba4b7 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef GLOBAL_CONTEXT_HH
 #define GLOBAL_CONTEXT_HH
 
 class Global_context : public virtual Context
 {
   PQueue<Moment> extra_mom_pq_;
-  Output_def*  output_def_;
-  
+  Output_def *output_def_;
+
   friend class Output_def;
 public:
-  Global_context (Output_def*, Moment final, Object_key *key);
+  Global_context (Output_def *, Moment final, Object_key *key);
   int get_moments_left () const;
   Moment sneaky_insert_extra_moment (Moment);
   void add_moment_to_process (Moment);
-  void run_iterator_on_me (Music_iterator*);
-  virtual Score_context*get_score_context () const;
-  
+  void run_iterator_on_me (Music_iterator *);
+  virtual Score_context *get_score_context () const;
+
   void apply_finalizations ();
   void add_finalization (SCM);
 
-  virtual Music_output *get_output ();     
+  virtual Music_output *get_output ();
   virtual void prepare (Moment);
   virtual void one_time_step ();
   virtual void finish ();
-  virtual Output_def* get_output_def () const; 
+  virtual Output_def *get_output_def () const;
   virtual Moment now_mom () const;
   virtual Context *get_default_interpreter ();
 
-
   Moment previous_moment () const;
 protected:
   Moment final_mom_;
index ed56a38edf4bd0e49cda2ecd29f2d5019d116d64..c187ac8f847c2b63b74a1b1a7333cd6f88aa93b2 100644 (file)
@@ -1,30 +1,28 @@
-/*   
+/*
   global-ctor.hh -- declare Global construction stuff.
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef GLOBAL_CTOR_HH
 #define GLOBAL_CTOR_HH
 
-
-#define ADD_GLOBAL_CTOR_WITHNAME(y, x)\
-class Global_ctor_ ## y  \
-{\
-public:        \
-  Global_ctor_ ## y () {               \
-    add_constructor (x);       \
-  }                            \
-}  _ ## y ## _ctor_init;       \
-
+#define ADD_GLOBAL_CTOR_WITHNAME(y, x)         \
+  class Global_ctor_ ## y                      \
+  {                                            \
+  public:                                      \
+    Global_ctor_ ## y ()                       \
+      {                                                \
+       add_constructor (x);                    \
+      }                                                \
+  }                                            \
+    _ ## y ## _ctor_init;
 
 #define ADD_GLOBAL_CTOR(x) ADD_GLOBAL_CTOR_WITHNAME (x, x);
 
-
-typedef void (* Global_ctor ) ();
+typedef void (* Global_ctor) ();
 void add_constructor (Global_ctor ctor);
 void call_constructors ();
 
index c35174cdc04c13d0b91cb55f1d57c2fb24a43a32..b019e3dc723b06df161efafc9b24be88a099d66e 100644 (file)
@@ -6,19 +6,18 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef GOURLAY_BREAKING_HH
 #define GOURLAY_BREAKING_HH
 
 #include "break-algorithm.hh"
 
 /**
-  A dynamic programming solution to breaking scores into lines
- */
+   A dynamic programming solution to breaking scores into lines
+*/
 struct Gourlay_breaking : public Break_algorithm
 {
   Array<Column_x_positions> do_solve () const;
   Gourlay_breaking ();
-  Real combine_demerits (Column_x_positions const&, Column_x_positions const&) const;
+  Real combine_demerits (Column_x_positions const &, Column_x_positions const &) const;
 };
 #endif // GOURLAY_BREAKING_HH
index 180fc4f2c2e591f7f8572396861e12152c04a50c..571a5d4bfccba2e03c1d4bb28ab2d208fc3438ec 100644 (file)
@@ -1,10 +1,9 @@
-/*   
-     grace-fixup.hh -- declare Grace_fixup
-
-     source file of the GNU LilyPond music typesetter
+/*
+  grace-fixup.hh -- declare Grace_fixup
 
-     (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  source file of the GNU LilyPond music typesetter
 
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #ifndef GRACE_FIXUP_HH
 #include "moment.hh"
 
 /*
-
   This is a lookahead list for grace notes.
 
-   {  ... X \grace Y  Z ... }
+  {  ... X \grace Y  Z ... }
 
-   normally, the ending of X is the start of Z. In case of a grace
-   note, we take off a little at the end of X. What is stored: START
-   (start point of X), LENGTH (length of X), GRACE_START (start_music
-   of Y), and the next fixup element.
+  normally, the ending of X is the start of Z. In case of a grace
+  note, we take off a little at the end of X. What is stored: START
+  (start point of X), LENGTH (length of X), GRACE_START (start_music
+  of Y), and the next fixup element.
 
   This is also done for nested musics, i.e.
 
   voiceB = \notes { c'2 \voiceA }
 
   the iterator for voiceB will contain a fixup entry with (START = 0/1,
-  LENGTH =2/1, GRACE_START =(0G-1/16) ) 
-   
+  LENGTH =2/1, GRACE_START =(0G-1/16) )
+
   Graces at the start of a sequential music iterator are handled
   by initting here_mom_ with Music::start_music (); no fixups are needed.
-
 */
-struct Grace_fixup 
+struct Grace_fixup
 {
   Moment start_;
   Moment length_;
 
   Rational grace_start_;
 
-  Grace_fixup * next_;
+  Grace_fixup *next_;
 };
 
 #endif /* GRACE_FIXUP_HH */
index 7e966dc71c3cf505307dcf37a171e78b0e549a61..cb7ace32dfd278ee297658405411ce51a3582466 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   grace-iterator.hh -- declare Grace_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef NEWGRACE_ITERATOR_HH
 #define NEWGRACE_ITERATOR_HH
@@ -16,12 +15,9 @@ class Grace_iterator : public Music_wrapper_iterator
 {
 public:
   virtual void process (Moment);
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Moment pending_moment () const;
 };
 
-
-
 #endif /* GRACE_ITERATOR_HH */
 
-
index 01e4c6053aae4d0c1b20962975de4b9984ac0730..5ac0dd4e91e36c0c7e0cd953a449f7ac4cc57608 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   gregorian-ligature-engraver.hh -- declare Gregorian_ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
-  
- */
+*/
 #ifndef GREGORIAN_LIGATURE_ENGRAVER_HH
 #define GREGORIAN_LIGATURE_ENGRAVER_HH
 
@@ -16,7 +15,7 @@ class Gregorian_ligature_engraver : public Coherent_ligature_engraver
   Music *pes_or_flexa_req_;
 
 public:
-  TRANSLATOR_DECLARATIONS(Gregorian_ligature_engraver);
+  TRANSLATOR_DECLARATIONS (Gregorian_ligature_engraver);
 
 protected:
   virtual bool try_music (Music *);
index 7243ea3bb300eabee59053086ffdbe75921b2f89..80f123e2e20940f91710de594ef5dc0e58012f71 100644 (file)
@@ -2,7 +2,7 @@
   gregorian-ligature.hh -- part of GNU LilyPond
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
 */
 
@@ -12,7 +12,8 @@
 class Grob;
 class String;
 
-class Gregorian_ligature {
+class Gregorian_ligature
+{
 public:
   static bool has_interface (Grob *);
   static String prefixes_to_str (Grob *);
@@ -27,17 +28,17 @@ public:
  * treated like a prefix for the head that follows the operator, but
  * does not affect the head that precedes the operator, if any.
  */
-#define VIRGA        0x0001 // attribute "\virga"
-#define STROPHA      0x0002 // attribute "\stropha"
-#define INCLINATUM   0x0004 // attribute "\inclinatum"
-#define AUCTUM       0x0008 // attribute "\auctum"
-#define DESCENDENS   0x0010 // attribute "\descendens"
-#define ASCENDENS    0x0020 // attribute "\ascendens"
-#define ORISCUS      0x0040 // attribute "\oriscus"
-#define QUILISMA     0x0080 // attribute "\quilisma"
-#define DEMINUTUM    0x0100 // attribute "\deminutum"
-#define CAVUM        0x0200 // attribute "\cavum"
-#define LINEA        0x0400 // attribute "\linea"
+#define VIRGA 0x0001 // attribute "\virga"
+#define STROPHA 0x0002 // attribute "\stropha"
+#define INCLINATUM 0x0004 // attribute "\inclinatum"
+#define AUCTUM 0x0008 // attribute "\auctum"
+#define DESCENDENS 0x0010 // attribute "\descendens"
+#define ASCENDENS 0x0020 // attribute "\ascendens"
+#define ORISCUS 0x0040 // attribute "\oriscus"
+#define QUILISMA 0x0080 // attribute "\quilisma"
+#define DEMINUTUM 0x0100 // attribute "\deminutum"
+#define CAVUM 0x0200 // attribute "\cavum"
+#define LINEA 0x0400 // attribute "\linea"
 #define PES_OR_FLEXA 0x0800 // operator "\~"
 
 /*
@@ -47,14 +48,14 @@ public:
  * These definitions may be extended by more specific Gregorian
  * ligatures such as vaticana-ligature.hh.
  */
-#define PES_LOWER       0x0001 // this is a head before "\~" in an
-                              // ascending melody
-#define PES_UPPER       0x0002 // this is a head after "\~" in an
-                              // ascending melody
-#define FLEXA_LEFT      0x0004 // this is a head before "\~" in a
-                              // descending melody
-#define FLEXA_RIGHT     0x0008 // this is a head after "\~" in a
-                              // descending melody
+#define PES_LOWER 0x0001 // this is a head before "\~" in an
+                        // ascending melody
+#define PES_UPPER 0x0002 // this is a head after "\~" in an
+                        // ascending melody
+#define FLEXA_LEFT 0x0004 // this is a head before "\~" in a
+// descending melody
+#define FLEXA_RIGHT 0x0008 // this is a head after "\~" in a
+// descending melody
 #define AFTER_DEMINUTUM 0x0020 // previous head was a deminutum
 
 #endif /* GREGORIAN_LIGATURE_HH */
index 4b8b700ef236e76774fb3543e5d2d2968f250303..4ebc0b2999ac38bb6e83752db4c2810f7605bb35 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef STAFFELEMINFO_HH
 #define STAFFELEMINFO_HH
 
 
 /*
   Data container for broadcasts.
-  */
-struct Grob_info {
-  Translator * origin_trans_;
+*/
+struct Grob_info
+{
+  Translator *origin_trans_;
   friend class Engraver;
 
-  Grob * grob_;
+  Grob *grob_;
 
 public:
-  Music * music_cause ();
-  Link_array<Context> origin_contexts (Translator*) const;
+  Music *music_cause ();
+  Link_array<Context> origin_contexts (Translator *) const;
   Grob_info ();
 };
 
index 3f4bcfdbe186d701634a444ba77e2f49c7919ec3..82121e7b7f5e67608a21c7dff14fded33639ce79 100644 (file)
@@ -1,37 +1,33 @@
-/*   
-  interface.hh -- declare Interface 
+/*
+  interface.hh -- declare Interface
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+*/
 
 #ifndef INTERFACE_HH
 #define INTERFACE_HH
 
 #include <libguile.h> /* SCM */
 
-
-
-#define ADD_INTERFACE(cl, a, b, c) \
-bool cl::has_interface(Grob*me)\
-{\
-  return me->internal_has_interface (ly_symbol2scm (a));\
-}\
-void cl ## _init_ifaces() {\
-  add_interface(a, b, c);\
-}\
-ADD_SCM_INIT_FUNC(cl ## ifaces, cl ## _init_ifaces);\
-
-
-
-void add_interface (const char * symbol,
-                   const char * descr,
-                   const char * vars);
-
-SCM ly_add_interface (SCM, SCM, SCM); 
-SCM ly_all_grob_interfaces();
+#define ADD_INTERFACE(cl, a, b, c)                             \
+  bool cl::has_interface (Grob *me)                            \
+  {                                                            \
+    return me->internal_has_interface (ly_symbol2scm (a));     \
+  }                                                            \
+  void cl ## _init_ifaces ()                                   \
+  {                                                            \
+    add_interface (a, b, c);                                   \
+  }                                                            \
+  ADD_SCM_INIT_FUNC (cl ## ifaces, cl ## _init_ifaces);
+
+void add_interface (const char *symbol,
+                   const char *descr,
+                   const char *vars);
+
+SCM ly_add_interface (SCM, SCM, SCM);
+SCM ly_all_grob_interfaces ();
 
 #endif /* INTERFACE_HH */
 
index d9a824ad1f974a8f3a198c404df5485763c6d818..89a2e7df6555a2c08fbd532bf1b85a560b9f335d 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-grob-pitch-tuple.hh -- declare Grob_pitch_tuple
+/*
+  grob-pitch-tuple.hh -- declare Grob_pitch_tuple
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef GROB_PITCH_TUPLE_HH
 #define GROB_PITCH_TUPLE_HH
@@ -13,19 +12,19 @@ source file of the GNU LilyPond music typesetter
 #include "pitch.hh"
 #include "moment.hh"
 
-struct Grob_pitch_tuple {
+struct Grob_pitch_tuple
+{
   Pitch pitch_;
   Grob *head_;
   Moment end_;
 
   Grob_pitch_tuple ();
-  Grob_pitch_tuple (Grob*, Music*, Moment);
+  Grob_pitch_tuple (Grob *, Music *, Moment);
   static int pitch_compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);
-  static int time_compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);  
+  static int time_compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);
 };
 
-int compare (Grob_pitch_tuple const &, Grob_pitch_tuple const&);
-
+int compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);
 
 #endif /* GROB_PITCH_TUPLE_HH */
 
index 150325bf2d52631ae697df7494be471740625ec2..6511dc7565c5e43a87277c2a1d9ee064294f278f 100644 (file)
@@ -2,7 +2,7 @@
   grob.hh -- declare Grob
 
   source file of the LilyPond music typesetter
-  
+
   (c) 1996--2005 Han-Wen Nienhuys
 */
 
 /**
    for administration of what was done already
 */
-enum Grob_status {
-  ORPHAN = 0,                  // not yet added to Paper_score
-  PRECALCING,
-  PRECALCED,           // calcs before spacing done
-  POSTCALCING,                 // busy calculating. This is used to trap cyclic deps.
-  POSTCALCED,          // after spacing calcs done
-};
+enum Grob_status
+  {
+    ORPHAN = 0, // not yet added to Paper_score
+    PRECALCING,
+    PRECALCED, // calcs before spacing done
+    POSTCALCING, // busy calculating. This is used to trap cyclic deps.
+    POSTCALCED, // after spacing calcs done
+  };
 
 typedef void (Grob::*Grob_method_pointer) (void);
 
@@ -37,25 +38,25 @@ typedef void (Grob::*Grob_method_pointer) (void);
  **/
 class Grob
 {
-private:  
+private:
   DECLARE_SMOBS (Grob, foo);
   void init ();
 protected:
-  Object_key const * key_;
+  Object_key const *key_;
   SCM immutable_property_alist_;
   SCM mutable_property_alist_;
-  
+
   /* BARF */
   friend class Spanner;
   friend SCM ly_grob_properties (SCM);
   friend SCM ly_grob_basic_properties (SCM);
-  
+
   void substitute_mutable_properties (SCM, SCM);
   char status_;
-  
+
 public:
   Object_key const *get_key () const;
-  
+
   Grob *original_;
 
   /* TODO: junk this member. */
@@ -64,35 +65,34 @@ public:
   Dimension_cache dim_cache_[NO_AXES];
 
   Grob (SCM basic_props, Object_key const *);
-  Grob (Grob const&, int copy_count);
+  Grob (Grob const &, int copy_count);
 
   virtual Grob *clone (int count) const;
   DECLARE_SCHEME_CALLBACK (stencil_extent, (SCM smob, SCM axis));
+
   String name () const;
   /*
     Properties
-   */
+  */
   SCM internal_get_property (SCM) const;
   void internal_set_property (SCM, SCM val);
   void add_to_list_property (SCM, SCM);
 
   SCM get_property_alist_chain (SCM) const;
   static SCM ly_grob_set_property (SCM, SCM, SCM);
-  static SCM ly_grob_property (SCM, SCM);  
+  static SCM ly_grob_property (SCM, SCM);
 
   void warning (String) const;
   void programming_error (String) const;
-  
+
   Output_def *get_layout () const;
-  void add_dependency (Grob*);    
+  void add_dependency (Grob *);
   virtual System *get_system () const;
 
   void calculate_dependencies (int final, int busy, SCM funcname);
 
-
   virtual void do_break_processing ();
-  virtual Grob *find_broken_piece (System*) const;
+  virtual Grob *find_broken_piece (System *) const;
   virtual void discretionary_processing ();
   virtual SCM do_derived_mark () const;
 
@@ -102,15 +102,15 @@ public:
   void suicide ();
   bool is_live () const;
   bool is_empty (Axis a) const;
-  
+
   bool internal_has_interface (SCM intf);
   static bool has_interface (Grob *me);
 
   virtual void handle_broken_dependencies ();
   virtual void handle_prebroken_dependencies ();
 
-  Interval extent (Grob * refpoint, Axis) const;
+  Interval extent (Grob *refpoint, Axis) const;
+
   void translate_axis (Real, Axis);
   Real relative_coordinate (Grob const *refp, Axis) const;
   Grob *common_refpoint (Grob const *s, Axis a) const;
@@ -123,8 +123,8 @@ public:
   void set_extent (SCM, Axis);
   void set_extent_callback (SCM, Axis);
   Real get_offset (Axis a) const;
-  
-  void set_parent (Grobe, Axis);
+
+  void set_parent (Grob *e, Axis);
 
   // URG
   Grob *get_parent (Axis a) const;
@@ -136,7 +136,7 @@ Spanner *unsmob_spanner (SCM);
 Item *unsmob_item (SCM);
 
 Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
-Grob *common_refpoint_of_array (Link_array<Grob> const&, Grob *, Axis a);
+Grob *common_refpoint_of_array (Link_array<Grob> const &, Grob *, Axis a);
 
 void set_break_subsititution (SCM criterion);
 SCM substitute_mutable_property_alist (SCM alist);
@@ -144,6 +144,6 @@ SCM substitute_mutable_property_alist (SCM alist);
 Link_array<Grob> ly_scm2grobs (SCM ell);
 SCM ly_grobs2scm (Link_array<Grob> a);
 
-Interval robust_relative_extent (Grob*, Grob*, Axis); 
+Interval robust_relative_extent (Grob *, Grob *, Axis);
 
 #endif /* GROB_HH */
index 6471007845f6f2a282cea7733e27db265c821dfb..55e541755da5cf7b3d46bccf95e85dbf2040d449 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   group-interface.hh -- declare Group_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef GROUP_INTERFACE_HH
 #define GROUP_INTERFACE_HH
 struct Group_interface
 {
 public:
-  static int count (Grob*, SCM);
-  static void add_thing (Grob*, SCM, SCM);
+  static int count (Grob *, SCM);
+  static void add_thing (Grob *, SCM, SCM);
 };
 
-struct Pointer_group_interface : public Group_interface {
+struct Pointer_group_interface : public Group_interface
+{
 public:
-  static void add_grob (Grob*, SCM nm, Grob*e);
+  static void add_grob (Grob *, SCM nm, Grob *e);
 };
 
 Link_array<Grob> extract_grob_array (Grob const *elt, SCM symbol);
 Link_array<Item> extract_item_array (Grob const *elt, SCM symbol);
 
 
-
-
 #endif /* GROUP_INTERFACE_HH */
 
index 6053375355527e71abcb9894cdc82d5223a3c3f9..66c41193e31e13e78bbe12cc7007eeff8e5c526d 100644 (file)
@@ -6,20 +6,19 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef HAIRPIN_HH
 #define HAIRPIN_HH
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 /**
-  The hairpin symbol. 
- */
+   The hairpin symbol.
+*/
 struct Hairpin
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 #endif // HAIRPIN_HH
index efaf83f65b1a551f68dd843f0fc89359d81af913..5baed0f3b030967710490f97cffe0679152dec8b 100644 (file)
@@ -6,24 +6,22 @@
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
 #ifndef HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
 #define HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-class Hara_kiri_group_spanner 
+class Hara_kiri_group_spanner
 {
 public:
-  DECLARE_SCHEME_CALLBACK (force_hara_kiri_callback, (SCM , SCM));
+  DECLARE_SCHEME_CALLBACK (force_hara_kiri_callback, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob, SCM axis));
-  DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_parent_callback, (SCM , SCM));
+  DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_parent_callback, (SCM, SCM));
   static void add_element (Grob *me, Grob *e);
-  static bool has_interface (Grob*);
-  static void consider_suicide (Grob*me);
-  static void add_interesting_item (Grob * me , Grob* n);
+  static bool has_interface (Grob *);
+  static void consider_suicide (Grob *me);
+  static void add_interesting_item (Grob *me, Grob *n);
 };
 
-
 #endif // HARA_KIRI_VERTICAL_GROUP_SPANNER_HH
index c4a53b62e613d3fd3a96f0aaae498d3cad548378..76085fd7c8b318408439bfe86c7f24cab6fa82b6 100644 (file)
@@ -1,18 +1,16 @@
-/*   
-identifier-smob.hh -- declare identifier smob.
+/*
+  identifier-smob.hh -- declare identifier smob.
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef IDENTIFIER_SMOB_HH
 #define IDENTIFIER_SMOB_HH
 
 #include "lily-guile.hh"
 
-
 SCM package_identifier (SCM);
 bool identifier_smob_p (SCM);
 SCM unpack_identifier (SCM);
index 82a557016c1d54965421852f37e4302073e02e2c..b7edcbb29e8debac5b597dcfde53dcefecba3474 100644 (file)
@@ -22,32 +22,31 @@ using namespace std;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
 /**
-  an yyFlexLexer child with provisions for inclusion.
- */
-class Includable_lexer : public yyFlexLexer 
+   an yyFlexLexer child with provisions for inclusion.
+*/
+class Includable_lexer : public yyFlexLexer
 {
   Array<YY_BUFFER_STATE> state_stack_;
 
 protected:
-  bool  close_input ();
+  bool close_input ();
   Link_array<Source_file> include_stack_;
   Array<int> char_count_stack_;
 
 public:
   bool allow_includes_b_;
-  
+
   Includable_lexer ();
   ~Includable_lexer ();
 
   /// store dependencies for Makefile stuff.
   Array<String> file_name_strings_;
 
-  Source_fileget_source_file () const;
-  void new_input (String s, Sources*);
-  void new_input (String name, String data, Sources*);
+  Source_file *get_source_file () const;
+  void new_input (String s, Sources *);
+  void new_input (String name, String data, Sources *);
 
-  char const * here_str0 () const;
+  char const *here_str0 () const;
 };
 
-
 #endif // INCLUDABLE_LEXER_HH
index 1dc5cb97001ef48aa4ae67cb6bfb7464da8f6b54..1ccb8575d90c76585c243d0fa6b24973f00dbf39 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   input-smob.hh -- declare input smob
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef INPUT_SMOB_HH
 #define INPUT_SMOB_HH
@@ -14,7 +13,7 @@
 #include "smobs.hh"
 
 SCM make_input (Input spot);
-Input *unsmob_input(SCM);
+Input *unsmob_input (SCM);
 
 extern Input dummy_input_global;
 
index efb358a8fbb2f0cd5b8bffc6fa65b797095ad5d2..75bc07249d0f01c46e24968617bbc6305ee9bb20 100644 (file)
 #include "flower-proto.hh"
 
 /**
-  Base class for anything that records its poisition in the parse file.
- */
-class Input {
+   Base class for anything that records its poisition in the parse file.
+*/
+class Input
+{
 public:
   char const *start_;
   char const *end_;
-  Source_file * source_file_;
-    
+  Source_file *source_file_;
+
   void warning (String) const; // should use member func?
   void non_fatal_error (String) const;
   void error (String) const;
@@ -31,14 +32,12 @@ public:
   String location_string () const;
   String line_number_string () const;
 
-
   String file_string ()const;
   int line_number ()const;
   int column_number ()const;
   int end_line_number ()const;
   int end_column_number ()const;
 
-  
   Input (Input const &i);
   Input ();
 };
index 944b5127e7696a048d2f865eae299c7b71ed6035..86928e632463f286a1f9751ed6dd699dd0857b17 100644 (file)
@@ -1,20 +1,19 @@
-/*   
+/*
   interpretation-context-handle.hh -- declare  Interpretation_context_handle
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef INTERPRETATION_CONTEXT_HANDLE_HH
 #define INTERPRETATION_CONTEXT_HANDLE_HH
 #include "lily-proto.hh"
 
 /*
-RENAME ME to Context_handle.
+  RENAME ME to Context_handle.
 */
-   
+
 class Interpretation_context_handle
 {
 public:
@@ -23,14 +22,14 @@ public:
 
   void set_context (Context *);
   bool try_music (Music *);
-  void operator = (Interpretation_context_handle const&);
-  Interpretation_context_handle (Interpretation_context_handle const&);
-  Context * get_outlet () const;
+  void operator= (Interpretation_context_handle const &);
+  Interpretation_context_handle (Interpretation_context_handle const &);
+  Context *get_outlet () const;
 
   int get_count () const;
   void quit ();
 private:
-  Context * outlet_;
+  Context *outlet_;
   void down ();
   void up (Context *);
 };
index 9749f85cd9af92f0ea3bf4b966d1cd8d2045af3b..aa8bcb4b664dd7b2d36581a3c5411070467d42bb 100644 (file)
@@ -8,35 +8,32 @@
 #ifndef ITEM_HH
 #define ITEM_HH
 
-
 #include "box.hh"
 #include "grob.hh"
 
-
 /**
-  A horizontally fixed size element of the score.
-
-  Item is the datastructure for printables whose width is known
-  before the spacing is calculated
+   A horizontally fixed size element of the score.
 
+   Item is the datastructure for printables whose width is known
+   before the spacing is calculated
 */
 class Item : public Grob
 {
-  Drul_array<Item*> broken_to_drul_;
+  Drul_array<Item *> broken_to_drul_;
 
 public:
-  Item (SCM, Object_key const*);
+  Item (SCM, Object_key const *);
   Item (Item const &, int count);
-  
+
   virtual Grob *clone (int count) const;
 
   static bool is_breakable (Grob *);
   bool is_broken () const;
-  
+
   Direction break_status_dir () const;
-  
+
   Item *find_prebroken_piece (Direction) const;
-  Grob *find_broken_piece (System *) const;    
+  Grob *find_broken_piece (System *) const;
   virtual System *get_system () const;
   virtual Paper_column *get_column () const;
   virtual void handle_prebroken_dependencies ();
@@ -47,6 +44,4 @@ protected:
   virtual SCM do_derived_mark () const;
 };
 
-
-
 #endif
index 9725951936088d7c85d48d5d58ec77b031b34503..98445d7a2ded3fb23b233c787580c65fe96661cf 100644 (file)
 struct Keyword_ent
 {
   char const *name_;
-  int     tokcode_;
+  int tokcode_;
 };
 
 /*
   junkme, use  hash table.
- */
+*/
 struct Keyword_table
 {
   Array<Keyword_ent> table_;
 
   Keyword_table (Keyword_ent *);
-  int     lookup (char const *s) const;
+  int lookup (char const *s) const;
 };
 
-
 #endif // KEYWORD_HH
 
index 1b91cac7d71a0324343261d38ea93b6dc6b18415..312a7f5fd2cbae9594bcba25615dd44f172862f7 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   kpath.hh -- declare kpathsea functions.
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+*/
 
 #ifndef KPATH_HH
 #define KPATH_HH
index 96da7d531406236cbdd872899eed6f08696362bf..4e15632e04cce6cd545d2c0f509e570aefc91e70 100644 (file)
@@ -9,11 +9,10 @@
 #include "array.hh"
 #include "offset.hh"
 
-
 /**
-  Least squares minimisation in 2 variables.
-  */
-void minimise_least_squares (Real * coef, Real * offset, Array<Offset> const &);
+   Least squares minimisation in 2 variables.
+*/
+void minimise_least_squares (Real *coef, Real *offset, Array<Offset> const &);
 
 #endif // LEASTSQUARE_HH
 
index 413f1fe8333bcba346e4e0cee9cb30ce0cdf5699..fe3bcb052d929390dd27c975bdf9206f76074a5c 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   ligature-engraver.hh -- declare Ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
-  
- */
+*/
 #ifndef LIGATURE_ENGRAVER_HH
 #define LIGATURE_ENGRAVER_HH
 
@@ -33,7 +32,7 @@ protected:
   virtual void finalize ();
 
   virtual void acknowledge_grob (Grob_info);
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void process_music ();
   virtual Spanner *create_ligature_spanner (); /* abstract method */
   virtual void typeset_ligature (Spanner *ligature,
@@ -42,11 +41,11 @@ protected:
   SCM brew_ligature_primitive_proc;
 
 public:
-  TRANSLATOR_DECLARATIONS(Ligature_engraver);
+  TRANSLATOR_DECLARATIONS (Ligature_engraver);
 
 private:
-  Drul_array<Music*> reqs_drul_;
-  
+  Drul_array<Music *> reqs_drul_;
+
   Spanner *ligature_;
   Array<Grob_info> primitives_;
 
index 221bcef76c4b31cde794e950096b604eddf28988..5bf69473ec94b1c974f73244b09ca196c00ff5fe 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef LILY_GUILE_MACROS_HH
@@ -22,7 +21,6 @@
 #define SCM_UNPACK(x) (x)
 #endif
 
-
 #if (__GNUC__ > 2)
 /* Unreliable with gcc-2.x
    FIXME: should add check for x86 as well?  */
 #ifdef CACHE_SYMBOLS
 
 /* Using this trick we cache the value of scm_str2symbol ("fooo") where
-  "fooo" is a constant string. This is done at the cost of one static
-  variable per ly_symbol2scm() use, and one boolean evaluation for
-  every call.
-
-  The overall speedup of lily is about 5% on a run of wtk1-fugue2.  */
-#define ly_symbol2scm(x) \
-({ \
-  static SCM cached; \
-  /* We store this one locally, since G++ -O2 fucks up else */ \
-  SCM value = cached; \
-  if ( __builtin_constant_p ((x))) \
-    { \
-      if (!cached) \
-        value = cached =  scm_gc_protect_object (scm_str2symbol ((x))); \
-    } \
-  else \
-    value = scm_str2symbol ((char*) (x)); \
-  value; \
-})
+   "fooo" is a constant string. This is done at the cost of one static
+   variable per ly_symbol2scm() use, and one boolean evaluation for
+   every call.
+
+   The overall speedup of lily is about 5% on a run of wtk1-fugue2.  */
+#define ly_symbol2scm(x)                                               \
+  ({                                                                   \
+    static SCM cached;                                                 \
+    /* We store this one locally, since G++ -O2 fucks up else */       \
+    SCM value = cached;                                                        \
+    if (__builtin_constant_p ((x)))                                    \
+      {                                                                        \
+       if (!cached)                                                    \
+         value = cached = scm_gc_protect_object (scm_str2symbol ((x))); \
+      }                                                                        \
+    else                                                               \
+      value = scm_str2symbol ((char *) (x));                           \
+    value;                                                             \
+  })
 #else
-inline SCM ly_symbol2scm(char const* x) { return scm_str2symbol ((x)); }
+inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); }
 #endif
 
-
 /*
   TODO: rename me to ly_c_lily_module_eval
- */
-#define ly_lily_module_constant(x) \
-({ \
-  static SCM cached; \
-  /* We store this one locally, since G++ -O2 fucks up else */ \
-  SCM value = cached; \
-  if ( __builtin_constant_p ((x))) \
-    { \
-      if (!cached) \
-        value = cached = scm_gc_protect_object (scm_eval (scm_str2symbol (x), \
-                                               global_lily_module)); \
-    } \
-  else \
-    value = scm_eval (scm_str2symbol (x), global_lily_module); \
-  value; \
-})
-
-
+*/
+#define ly_lily_module_constant(x)                                     \
+  ({                                                                   \
+    static SCM cached;                                                 \
+    /* We store this one locally, since G++ -O2 fucks up else */       \
+    SCM value = cached;                                                        \
+    if (__builtin_constant_p ((x)))                                    \
+      {                                                                        \
+       if (!cached)                                                    \
+         value = cached = scm_gc_protect_object (scm_eval (scm_str2symbol (x), \
+                                                           global_lily_module)); \
+      }                                                                        \
+    else                                                               \
+      value = scm_eval (scm_str2symbol (x), global_lily_module);       \
+    value;                                                             \
+  })
 
 /*
   Adds the NAME as a Scheme function, and a variable to store the SCM
   version of the function in the static variable NAME_proc
- */
-#define DECLARE_SCHEME_CALLBACK(NAME, ARGS) \
-       static SCM NAME ARGS; \
-       static SCM NAME ## _proc
+*/
+#define DECLARE_SCHEME_CALLBACK(NAME, ARGS)    \
+  static SCM NAME ARGS;                                \
+  static SCM NAME ## _proc
 
 /*
   Make TYPE::FUNC available as a Scheme function.
- */
-#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \
-SCM TYPE :: FUNC ## _proc; \
-void \
-TYPE ## _ ## FUNC ## _init_functions () \
-{ \
-  TYPE :: FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \
-                                             (ARGCOUNT), 0, 0, \
-                         (Scheme_function_unknown)TYPE :: FUNC); \
-  scm_c_export (#TYPE "::" #FUNC, NULL); \
-} \
- \
-ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback, \
-                  TYPE ## _ ## FUNC ## _init_functions);
-
+*/
+#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT)                     \
+  SCM TYPE :: FUNC ## _proc;                                           \
+  void                                                                 \
+  TYPE ## _ ## FUNC ## _init_functions ()                              \
+  {                                                                    \
+    TYPE :: FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC,      \
+                                               (ARGCOUNT), 0, 0,       \
+                                               (Scheme_function_unknown)TYPE :: FUNC); \
+    scm_c_export (#TYPE "::" #FUNC, NULL);                             \
+  }                                                                    \
+                                                                       \
+  ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback,                   \
+                    TYPE ## _ ## FUNC ## _init_functions);
 
 void
 ly_add_function_documentation (SCM proc, char const *fname,
                               char const *varlist,
                               char const *doc);
 
-#define ADD_SCM_INIT_FUNC(name, func) \
-class name ## _scm_initter \
-{ \
-public: \
-  name ## _scm_initter () \
-  { \
-    add_scm_init_func (func); \
-  } \
-} _ ## name ## _scm_initter; \
+#define ADD_SCM_INIT_FUNC(name, func)          \
+  class name ## _scm_initter                   \
+  {                                            \
+  public:                                      \
+    name ## _scm_initter ()                    \
+    {                                          \
+      add_scm_init_func (func);                        \
+    }                                          \
+  }                                            \
+    _ ## name ## _scm_initter;
+
 /* end define */
 
 #define LY_DEFINE_WITHOUT_DECL(INITPREFIX, FNAME, PRIMNAME, REQ, OPT, VAR, \
-                              ARGLIST, DOCSTRING) \
-SCM FNAME ## _proc; \
-void \
-INITPREFIX ## init () \
-{ \
-  FNAME ## _proc = scm_c_define_gsubr (PRIMNAME, REQ, OPT, VAR, \
-                                       (Scheme_function_unknown) FNAME); \
-  ly_add_function_documentation (FNAME ## _proc, PRIMNAME, #ARGLIST, \
-                                DOCSTRING); \
-  scm_c_export (PRIMNAME, NULL); \
-} \
-ADD_SCM_INIT_FUNC (INITPREFIX ## init_unique_prefix, INITPREFIX ## init); \
-SCM \
-FNAME ARGLIST
-
-
-#define LY_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
-SCM FNAME ARGLIST; \
-LY_DEFINE_WITHOUT_DECL (FNAME, FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, \
-                       DOCSTRING)
+                              ARGLIST, DOCSTRING)                      \
+  SCM FNAME ## _proc;                                                  \
+  void                                                                 \
+  INITPREFIX ## init ()                                                        \
+  {                                                                    \
+    FNAME ## _proc = scm_c_define_gsubr (PRIMNAME, REQ, OPT, VAR,      \
+                                        (Scheme_function_unknown) FNAME); \
+    ly_add_function_documentation (FNAME ## _proc, PRIMNAME, #ARGLIST, \
+                                  DOCSTRING);                          \
+    scm_c_export (PRIMNAME, NULL);                                     \
+  }                                                                    \
+  ADD_SCM_INIT_FUNC (INITPREFIX ## init_unique_prefix, INITPREFIX ## init); \
+  SCM                                                                  \
+  FNAME ARGLIST
+
+#define LY_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING)  \
+  SCM FNAME ARGLIST;                                                   \
+  LY_DEFINE_WITHOUT_DECL (FNAME, FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, \
+                         DOCSTRING)
 
 #define LY_DEFINE_MEMBER_FUNCTION(CLASS, FNAME, PRIMNAME, REQ, OPT, VAR, \
-                                 ARGLIST, DOCSTRING) \
-SCM FNAME ARGLIST; \
-LY_DEFINE_WITHOUT_DECL (CLASS ## FNAME, CLASS::FNAME, PRIMNAME, REQ, OPT, \
-                       VAR, ARGLIST, DOCSTRING)
+                                 ARGLIST, DOCSTRING)                   \
+  SCM FNAME ARGLIST;                                                   \
+  LY_DEFINE_WITHOUT_DECL (CLASS ## FNAME, CLASS::FNAME, PRIMNAME, REQ, OPT, \
+                         VAR, ARGLIST, DOCSTRING)
 
 #define get_property(x) internal_get_property (ly_symbol2scm (x))
 #define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)
index b71535aa1dc14668eb9e7112bf6a3bf78be7cdb6..ec63fdcce864c5ecd3b420b49277839343ba56f5 100644 (file)
@@ -16,7 +16,6 @@
 #include "lily-guile-macros.hh"
 #include "ly-module.hh"
 
-
 /** Conversion functions follow the GUILE naming convention, i.e.
     A ly_B2A (B b);  */
 
@@ -53,51 +52,55 @@ Interval robust_scm2interval (SCM, Drul_array<Real>);
 Offset robust_scm2offset (SCM, Offset);
 
 SCM ly_quote_scm (SCM s);
-bool type_check_assignment (SCM val, SCM sym,  SCM type_symbol) ;
+bool type_check_assignment (SCM val, SCM sym, SCM type_symbol);
 String print_scm_val (SCM val);
 SCM ly_number2string (SCM s);
 
 SCM parse_symbol_list (char const *);
-SCM robust_list_ref(int i, SCM l);
+SCM robust_list_ref (int i, SCM l);
 SCM alist_to_hashq (SCM);
 
 SCM ly_alist_vals (SCM alist);
 SCM ly_hash2alist (SCM tab);
 
 /* inserts at front, removing dublicates */
-inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val)
+inline SCM ly_assoc_front_x (SCM alist, SCM key, SCM val)
 {
-  return scm_acons(key, val, scm_assoc_remove_x (alist, key));
+  return scm_acons (key, val, scm_assoc_remove_x (alist, key));
 }
 inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
 inline bool ly_c_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
-inline bool ly_c_equal_p (SCM x, SCM y) {
+inline bool ly_c_equal_p (SCM x, SCM y)
+{
   return SCM_NFALSEP (scm_equal_p (x, y));
 }
 
-
 inline bool ly_scm2bool (SCM x) { return SCM_NFALSEP (x); }
-inline char ly_scm2char (SCM x) { return SCM_CHAR(x); }
-inline unsigned long ly_length (SCM x) {
+inline char ly_scm2char (SCM x) { return SCM_CHAR (x); }
+inline unsigned long ly_length (SCM x)
+{
   return scm_num2ulong (scm_length (x), 0, "ly_length");
 }
 inline SCM ly_bool2scm (bool x) { return SCM_BOOL (x); }
 
-inline SCM ly_append2 (SCM x1, SCM x2) {
+inline SCM ly_append2 (SCM x1, SCM x2)
+{
   return scm_append (scm_listify (x1, x2, SCM_UNDEFINED));
 }
-inline SCM ly_append3 (SCM x1, SCM x2, SCM x3) {
+inline SCM ly_append3 (SCM x1, SCM x2, SCM x3)
+{
   return scm_append (scm_listify (x1, x2, x3, SCM_UNDEFINED));
 }
-inline SCM ly_append4 (SCM x1, SCM x2, SCM x3, SCM x4) {
+inline SCM ly_append4 (SCM x1, SCM x2, SCM x3, SCM x4)
+{
   return scm_append (scm_listify (x1, x2, x3, x4, SCM_UNDEFINED));
 }
 
 /*
   display and print newline.
- */
+*/
 extern "C" {
-void ly_display_scm (SCM s);
+  void ly_display_scm (SCM s);
 }
 
 void read_lily_scm_file (String);
@@ -126,23 +129,23 @@ SCM ly_split_list (SCM s, SCM lst);
 SCM ly_unique (SCM lst);
 SCM ly_list_qsort_uniq_x (SCM lst);
 
-SCM ly_output_formats();
+SCM ly_output_formats ();
 SCM ly_kpathsea_find_file (SCM);
 
 /*
   snarfing.
- */
+*/
 void add_scm_init_func (void (*) ());
 
 extern "C" {
-typedef SCM (*Scheme_function_unknown) ();
+  typedef SCM (*Scheme_function_unknown) ();
 }
 
 #if __GNUC__ > 2 || __GNUC_MINOR__ >= 96
 typedef SCM (*Scheme_function_0) ();
 typedef SCM (*Scheme_function_1) (SCM);
-typedef SCM (*Scheme_function_2) (SCM, SCM);   
-typedef SCM (*Scheme_function_3) (SCM, SCM, SCM);      
+typedef SCM (*Scheme_function_2) (SCM, SCM);
+typedef SCM (*Scheme_function_3) (SCM, SCM, SCM);
 #else
 typedef SCM (*Scheme_function_0) (...);
 typedef SCM (*Scheme_function_1) (...);
index fbc06b63676b85adf17fbfad9ce208fede807921..37e25fa10176dfef285d04c9bd9e30b6492bc123 100644 (file)
@@ -19,12 +19,12 @@ bool busy_parsing ();
 void kill_lexer ();
 void set_lexer ();
 
-class Lily_lexer : public Includable_lexer 
+class Lily_lexer : public Includable_lexer
 {
-  DECLARE_SMOBS(Lily_lexer, );
+  DECLARE_SMOBS (Lily_lexer,);
 public:
   SCM scopes_;
-  
+
 private:
   int lookup_keyword (String);
   int scan_bare_word (String);
@@ -40,8 +40,8 @@ public:
   void *lexval;
   Input *lexloc;
   bool is_main_input_;
-  
-  Sources *sources_; 
+
+  Sources *sources_;
 
   /* Scheme hash tables with (oct name acc)  values, and symbol keys.  */
   SCM chordmodifier_tab_;
@@ -50,19 +50,19 @@ public:
   int error_level_;
   Input last_input_;
 
-  Lily_lexer (Sources*);
-  Lily_lexer (Lily_lexer const&);
+  Lily_lexer (Sources *);
+  Lily_lexer (Lily_lexer const &);
   int yylex ();
 
   void add_lexed_char (int);
 
   void prepare_for_next_token ();
-  int try_special_identifiers (SCM, SCM);
+  int try_special_identifiers (SCM *, SCM);
   Input here_input () const;
-  
+
   void add_scope (SCM);
   SCM remove_scope ();
-  
+
   void start_main_input ();
 
   SCM lookup_identifier (String s);
index c6833fd87c73f4bf580d7cf2b909f46c3b9ad121..2f8810b37beb91954223226774db7252d0be1027 100644 (file)
 
    TODO: interface is too complicated
 */
-class Lily_parser 
+class Lily_parser
 {
-  DECLARE_SMOBS (Lily_parser, );
-  friend int yyparse (void*);
+  DECLARE_SMOBS (Lily_parser,);
+  friend int yyparse (void *);
 
   Array<Input> define_spots_;
 
-  char consthere_str0 () const;
+  char const *here_str0 () const;
   Simultaneous_music *get_chord (Pitch tonic,
                                 Array<Pitch> *adds, Array<Pitch> *subs,
-                                Pitch *inversion, Pitchbass, Duration d);
+                                Pitch *inversion, Pitch *bass, Duration d);
   void set_chord_tremolo (int type_i);
   void set_last_duration (Duration const *);
   void set_last_pitch (Pitch const *);
@@ -50,17 +50,17 @@ public:
   SCM last_beam_start_;
 
   Lily_parser (Sources *sources);
-  Lily_parser (Lily_parser const&);
+  Lily_parser (Lily_parser const &);
 
   DECLARE_SCHEME_CALLBACK (layout_description, ());
 
-  void beam_check (SCM); 
+  void beam_check (SCM);
   void do_init_file ();
   void do_yyparse ();
   void parse_file (String init, String name, String out_name);
   void parse_string (String ly_code);
   void parser_error (String);
-  void parser_error (Input const&, String);
+  void parser_error (Input const &, String);
   void set_yydebug (bool);
 };
 
index 4b222a9346d058bb8ea9bd17ca5f6124b2b52507..c71d7c53ee7ff34f35ac19e2176a498e1339d9bd 100644 (file)
@@ -1,7 +1,7 @@
 /*
- lily-proto.hh -- declare class names.
 lily-proto.hh -- declare class names.
 
- source file of the GNU LilyPond music typesetter
 source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
@@ -11,8 +11,6 @@
 #include "flower-proto.hh"
 
 
-
-
 class Adobe_font_metric;
 class All_font_metrics;
 class Audio_column;
index a949c752c83aaf71dc3c1d7e67f5d86492eeabd5..1fc8becb15842c924af0ea1f9528bfbda6358b75 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   lily-version.hh -- declare version strings
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+*/
 
 #ifndef LILY_VERSION_HH
 #define LILY_VERSION_HH
index 4e22ae3a337c91ffa25aa527b56eeeee95f214a6..4fb1bc547d67146e6d738380df90176f1e3975c3 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-
 */
 
 #ifndef LILYPOND_VERSION_HH
@@ -12,7 +11,7 @@
 
 #include "string.hh"
 
-struct Lilypond_version 
+struct Lilypond_version
 {
   Lilypond_version (int major, int minor, int patch);
   Lilypond_version (String str);
index 24d0a3f36bfe9217f1a73103801f509ed8f27a33..2b8ad9ddf91ca76c9485cb725bf5558b5374d586 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef LILYPOND_KEY_HH
@@ -29,8 +28,8 @@ public:
   static Object_key *from_scheme (SCM);
 protected:
   virtual int get_type () const;
-  virtual void derived_mark () const; 
-  virtual int do_compare (Object_key consta) const;
+  virtual void derived_mark () const;
+  virtual int do_compare (Object_key const *a) const;
   virtual SCM as_scheme () const;
 };
 
@@ -43,17 +42,17 @@ class Lilypond_context_key : public Object_key
   int disambiguation_count_;
 
 public:
-  Lilypond_context_key (Object_key const * parent,
+  Lilypond_context_key (Object_key const *parent,
                        Moment start,
                        String type,
                        String id,
-                       int count);
+                       int count);
 
   static Object_key *from_scheme (SCM);
 protected:
   virtual int get_type () const;
-  virtual int do_compare (Object_key consta) const;
-  virtual void derived_mark () const; 
+  virtual int do_compare (Object_key const *a) const;
+  virtual void derived_mark () const;
   virtual SCM as_scheme () const;
 };
 
@@ -69,8 +68,8 @@ public:
   static Object_key *from_scheme (SCM);
 protected:
   virtual int get_type () const;
-  virtual int do_compare (Object_key consta) const;
-  virtual void derived_mark () const; 
+  virtual int do_compare (Object_key const *a) const;
+  virtual void derived_mark () const;
   virtual SCM as_scheme () const;
 };
 
index 5b2b9d4e365de664419ac28c7a03e1f970593f1e..92b6f8a2698a0bdd0f90e75a972bd3043405c618 100644 (file)
@@ -6,29 +6,27 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef LINE_GROUP_GRAV_HH
 #define LINE_GROUP_GRAV_HH
 
 #include "engraver-group-engraver.hh"
 
 /**
-  Engravers put elements on the same or lowel level in a line.
+   Engravers put elements on the same or lowel level in a line.
 
-  DEPRECATED.
-  */
+   DEPRECATED.
+*/
 class Line_group_engraver_group : public Engraver_group_engraver
 {
 protected:
-  Spanner *staffline_;   
+  Spanner *staffline_;
 
   virtual void create_line_spanner ();
   virtual void initialize ();
   virtual void finalize ();
 public:
-  TRANSLATOR_DECLARATIONS(Line_group_engraver_group);
+  TRANSLATOR_DECLARATIONS (Line_group_engraver_group);
 };
 
-
 #endif // LINE_GROUP_GRAV_HH
 
index f763b7c42ccb1de855f423b7cf9fa8cf4919f580..bb4a763b144f1f3a9dd4b026d1407ef69b3233b0 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-line-interface.hh -- declare 
+/*
+  line-interface.hh -- declare
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #ifndef LINE_INTERFACE_HH
 #define LINE_INTERFACE_HH
@@ -15,11 +14,10 @@ source file of the GNU LilyPond music typesetter
 struct Line_interface
 {
   static Stencil line (Grob *me, Offset from, Offset to);
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
   static Stencil make_dashed_line (Real th, Offset from, Offset to, Real, Real);
   static Stencil make_line (Real th, Offset from, Offset to);
 };
 
 #endif /* LINE_INTERFACE_HH */
 
-
index 3ae31c1a1b04285001324c85067f161733c66f33..6bd7e630d91b556a9af4be20b38d15f17afa25d8 100644 (file)
@@ -6,7 +6,6 @@
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
 #ifndef LINE_SPANNER_HH
 #define LINE_SPANNER_HH
 
@@ -19,9 +18,9 @@ class Line_spanner
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM));  
-  static Stencil line_stencil (Grobme, Offset f, Offset t);
-  static bool has_interface (Grob*);
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  static Stencil line_stencil (Grob *me, Offset f, Offset t);
+  static bool has_interface (Grob *);
 
 private:
   static Offset get_broken_offset (Grob *me, Direction dir);
index bf53592937784f05fe8c6033c36634d350def44f..b4aab56817f67670471b91d0aac46af06cf494f2 100644 (file)
@@ -16,7 +16,7 @@ struct Lookup
 {
   static Stencil dot (Offset p, Real radius);
   static Stencil bracket (Axis a, Interval iv, Real thick, Real protude, Real blot);
-  static Stencil accordion (SCM arg, Real interline_f, Font_metric*fm);
+  static Stencil accordion (SCM arg, Real interline_f, Font_metric *fm);
   static Stencil round_filled_polygon (Array<Offset> points, Real blotdiameter);
   static Stencil frame (Box b, Real thick, Real blot);
   static Stencil slur (Bezier controls, Real cthick, Real thick);
index fbfa7c35007345112c5d02ab02fb710a86da5856..52371605766c95e1908168c7dff1e5c7b362cf23 100644 (file)
@@ -1,10 +1,10 @@
 /*
-  ly-module.hh -- declare  module related helper functions 
+  ly-module.hh -- declare  module related helper functions
 
   source file of the GNU LilyPond music typesetter
 
- (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
 (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 #ifndef LY_MODULE_HH
 #define LY_MODULE_HH
 
@@ -16,8 +16,8 @@ SCM ly_module2alist (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);
-void  ly_reexport_module (SCM mod);
-inline bool ly_c_module_p (SCM x) { return SCM_MODULEP(x); }
+void ly_reexport_module (SCM mod);
+inline bool ly_c_module_p (SCM x) { return SCM_MODULEP (x); }
 void ly_clear_anonymous_modules ();
 SCM ly_use_module (SCM mod, SCM used);
 
index d134564495a1f781a2735ca070b18ffbeb21fb88..45ba7ebf2d1e58d4fbf441706c3f37052c63559d 100644 (file)
   source file of the GNU LilyPond music typesetter
 
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #ifndef LY_SMOBS_ICC
 #define LY_SMOBS_ICC
 
 #include "smobs.hh"
 
-#define IMPLEMENT_TYPE_P(CL, FUNCNAME) \
-SCM CL ## _type_p_proc; \
-void init_type_ ## CL () \
-{ \
-  SCM subr = scm_c_define_gsubr (FUNCNAME, 1, 0, 0, \
-                                (Scheme_function_unknown) CL::smob_p); \
-  CL ## _type_p_proc = subr; \
-  ly_add_function_documentation (subr, FUNCNAME, "(SCM x)", \
-                                "Is @var{x} a @code{" #CL "} object?"); \
-  scm_c_export (FUNCNAME, NULL); \
-} \
-ADD_SCM_INIT_FUNC (init_type_ ## CL, init_type_ ## CL)
+#define IMPLEMENT_TYPE_P(CL, FUNCNAME)                                 \
+  SCM CL ## _type_p_proc;                                              \
+  void init_type_ ## CL ()                                             \
+  {                                                                    \
+    SCM subr = scm_c_define_gsubr (FUNCNAME, 1, 0, 0,                  \
+                                  (Scheme_function_unknown) CL::smob_p); \
+    CL ## _type_p_proc = subr;                                         \
+    ly_add_function_documentation (subr, FUNCNAME, "(SCM x)",          \
+                                  "Is @var{x} a @code{" #CL "} object?"); \
+    scm_c_export (FUNCNAME, NULL);                                     \
+  }                                                                    \
+  ADD_SCM_INIT_FUNC (init_type_ ## CL, init_type_ ## CL)
 
+#define IMPLEMENT_BASE_SMOBS(CL)                                       \
+  scm_t_bits CL::smob_tag_;                                            \
+  SCM                                                                  \
+  CL::smob_p (SCM s)                                                   \
+  {                                                                    \
+    if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_)                        \
+      return SCM_BOOL_T;                                               \
+    else                                                               \
+      return SCM_BOOL_F;                                               \
+                                                                       \
+  }                                                                    \
+                                                                       \
+  void                                                                 \
+  CL::init_smobs ()                                                    \
+  {                                                                    \
+    smob_tag_ = scm_make_smob_type (#CL, 0);                           \
+    scm_set_smob_mark (smob_tag_, CL::mark_smob);                      \
+    scm_set_smob_free (smob_tag_, CL::free_smob);                      \
+    scm_set_smob_print (smob_tag_, CL::print_smob);                    \
+    scm_set_smob_equalp (smob_tag_, CL::equal_p);                      \
+  }                                                                    \
+                                                                       \
+  size_t                                                               \
+  CL::free_smob (SCM ses)                                              \
+  {                                                                    \
+    CL *s = (CL *) SCM_CELL_WORD_1 (ses);                              \
+    delete s;                                                          \
+    scm_gc_unregister_collectable_memory (s, sizeof (CL), #CL " smob");        \
+    return SMOB_FREE_RETURN_VAL (CL);                                  \
+  }                                                                    \
+                                                                       \
+  ADD_SCM_INIT_FUNC (CL, CL::init_smobs)
 
-#define IMPLEMENT_BASE_SMOBS(CL) \
-scm_t_bits CL::smob_tag_; \
-SCM \
-CL::smob_p (SCM s) \
-{ \
-  if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \
-    return SCM_BOOL_T; \
-  else \
-    return SCM_BOOL_F; \
- \
-} \
-  \
-void \
-CL::init_smobs () \
-{ \
-  smob_tag_ = scm_make_smob_type (#CL, 0); \
-  scm_set_smob_mark (smob_tag_, CL::mark_smob); \
-  scm_set_smob_free (smob_tag_, CL::free_smob); \
-  scm_set_smob_print (smob_tag_, CL::print_smob); \
-  scm_set_smob_equalp (smob_tag_, CL::equal_p); \
-} \
-  \
-size_t \
-CL::free_smob (SCM ses) \
-{ \
-  CL *s = (CL*) SCM_CELL_WORD_1 (ses); \
-  delete s; \
-  scm_gc_unregister_collectable_memory (s, sizeof (CL), #CL " smob"); \
-  return SMOB_FREE_RETURN_VAL(CL); \
-} \
-  \
-ADD_SCM_INIT_FUNC (CL, CL::init_smobs)
+#define IMPLEMENT_SIMPLE_SMOBS(CL)                                     \
+  IMPLEMENT_BASE_SMOBS (CL);                                           \
+  SCM CL::smobbed_copy () const                                                \
+  {                                                                    \
+    CL *ptr = new CL (*this);                                          \
+    SCM s;                                                             \
+    s = scm_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr));           \
+    scm_gc_register_collectable_memory ((CL *)this, sizeof (CL), #CL " smob"); \
+                                                                       \
+    return s;                                                          \
+  }
 
-#define IMPLEMENT_SIMPLE_SMOBS(CL) \
-IMPLEMENT_BASE_SMOBS(CL); \
-SCM CL::smobbed_copy () const \
-{ \
-  CL *ptr = new CL (*this); \
-  SCM s; \
-  s = scm_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr)); \
-  scm_gc_register_collectable_memory ((CL*)this, sizeof (CL), #CL " smob"); \
- \
-  return s; \
-} \
-
-
-#define IMPLEMENT_SMOBS(CL) \
-IMPLEMENT_BASE_SMOBS (CL) \
-void \
-CL::smobify_self () \
-{ \
-  SCM s = unprotected_smobify_self (); \
-  scm_gc_protect_object (s); \
-} \
-  \
-SCM \
-CL::unprotected_smobify_self () \
-{ \
-  /* \
-    This is local. We don't assign to self_scm_ directly, to assure \
-    that S isn't GC-ed from under us. \
-    \
-    We don't use smobbed_self () to ensure that mark_smob () doesn't have to \
-    deal half-initialized objects: scm_done_malloc ( ) might trigger GC. \
-    the warning in smobs.hh is just to be doubleplus goodly sure \
-   */ \
-  SCM s; \
-  SCM_NEWSMOB (s, CL::smob_tag_, this); \
-  self_scm_ = s; \
- scm_gc_register_collectable_memory (this, sizeof (CL), #CL " smob"); \
-  return s; \
-}
-
-#define IMPLEMENT_DEFAULT_EQUAL_P(CL) \
-SCM \
-CL::equal_p (SCM a , SCM b) \
-{ \
-  return a == b ? SCM_BOOL_T : SCM_BOOL_F; \
-} \
+#define IMPLEMENT_SMOBS(CL)                                            \
+  IMPLEMENT_BASE_SMOBS (CL)                                            \
+    void                                                               \
+  CL::smobify_self ()                                                  \
+  {                                                                    \
+    SCM s = unprotected_smobify_self ();                               \
+    scm_gc_protect_object (s);                                         \
+  }                                                                    \
+                                                                       \
+  SCM                                                                  \
+  CL::unprotected_smobify_self ()                                      \
+  {                                                                    \
+    /*                                                                 \
+      This is local. We don't assign to self_scm_ directly, to assure  \
+      that S isn't GC-ed from under us.                                        \
+                                                                       \
+                                                                       We don't use smobbed_self () to ensure that mark_smob () doesn't have to \
+                                                                       deal half-initialized objects: scm_done_malloc ( ) might trigger GC. \
+                                                                       the warning in smobs.hh is just to be doubleplus goodly sure \
+    */                                                                 \
+    SCM s;                                                             \
+    SCM_NEWSMOB (s, CL::smob_tag_, this);                              \
+    self_scm_ = s;                                                     \
+    scm_gc_register_collectable_memory (this, sizeof (CL), #CL " smob"); \
+    return s;                                                          \
+  }
 
+#define IMPLEMENT_DEFAULT_EQUAL_P(CL)          \
+  SCM                                          \
+  CL::equal_p (SCM a, SCM b)                   \
+  {                                            \
+    return a == b ? SCM_BOOL_T : SCM_BOOL_F;   \
+  }
 
 #endif /* LY_SMOBS_ICC */
 
-
index 63284cb42ac14a5f6ed2e17ff30c2bc807f9d18c..361afa81f34723bc3d95688f06a0d33036c66d8c 100644 (file)
@@ -11,7 +11,6 @@
 #include "spanner.hh"
 
 /*
-
   Extenders must be entered manually for now.
 
   Although it would be possible for Lily to determine where to
   for on a word's last syllable.  The extender should be aligned
   with the left side of the last note of the melissima, and not
   extend beond, lasting the whole duration of the melissima
-
- */
+*/
 
 class Lyric_extender
 {
 public:
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
 };
 
 #endif // EXTENDER_SPANNER_HH
index ba3cb67a88992a6bc5c6b9b5fd2b4292d285d2bd..c0604715636389d65c2281d44d09a5c6863970af 100644 (file)
@@ -9,12 +9,12 @@
 
 #include "spanner.hh"
 
-struct Hyphen_spanner 
+struct Hyphen_spanner
 {
 public:
-  DECLARE_SCHEME_CALLBACK(set_spacing_rods, (SCM));
-  bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
+  bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
 };
 
 #endif // HYPHEN_SPANNER_HH
index 8d12c49adbcc10360018ab40cbb0b3b2698145af..c7fcad21d02007bc6bfdba787c778e9620cb6e14 100644 (file)
@@ -15,14 +15,13 @@ void debug_init ();
 void set_debug (bool);
 void do_scores ();
 void clear_scores ();
-void add_score (Scores);
+void add_score (Score *s);
 void set_default_output (String s);
 String find_file (String);
 void call_constructors ();
 Array<String> get_inclusion_names ();
 void set_inclusion_names (Array<String>);
 
-
 extern String init_name_global;
 
 /* options */
@@ -37,8 +36,8 @@ extern bool is_TeX_format_global;
 extern String prefix_directory;
 
 /*
-  todo: collect in Output_option struct? 
- */
+  todo: collect in Output_option struct?
+*/
 extern String output_format_global;
 
 extern bool make_preview;
@@ -51,7 +50,7 @@ extern File_path global_path;
 
 /*
   Debugging options
- */
+*/
 
 #ifndef NDEBUG
 #define DEBUG_SLUR_SCORING 1
index e0e3740335eca5573dba90f05b4b8887aa15b7ef..a98f833c5393e42332ce614591af59a559128cec 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-measure-grouping-spanner.hh -- declare 
+/*
+  measure-grouping-spanner.hh -- declare
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef MEASURE_GROUPING_SPANNER_HH
 #define MEASURE_GROUPING_SPANNER_HH
@@ -15,11 +14,10 @@ source file of the GNU LilyPond music typesetter
 class Measure_grouping
 {
 public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  static bool has_interface (Grob*);
-};
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
 
+  static bool has_interface (Grob *);
+};
 
 #endif /* MEASURE_GROUPING_SPANNER_HH */
 
index 2626134ecdf3d0b729f592a0e25d243d18050cbf..55c06256673379992df6f5b942016d8344f3de21 100644 (file)
@@ -2,9 +2,9 @@
   mensural-ligature.hh -- part of GNU LilyPond
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>,
-                Pal Benko <benkop@freestart.hu>
+  Pal Benko <benkop@freestart.hu>
 */
 
 #ifndef MENSURAL_LIGATURE_HH
  * These are all possible mensural ligature primitives.
  */
 
-#define MLP_NONE       0x00 // no output
-#define MLP_UP         0x01 // ligatura ascendens
-#define MLP_DOWN       0x02 // ligatura descendens
-#define MLP_BREVIS     0x04 // mensural brevis head
-#define MLP_LONGA      0x08 // mensural brevis head with right cauda
-#define MLP_MAXIMA     0x10 // mensural maxima head without stem
-#define MLP_FLEXA      0x20
+#define MLP_NONE 0x00 // no output
+#define MLP_UP 0x01 // ligatura ascendens
+#define MLP_DOWN 0x02 // ligatura descendens
+#define MLP_BREVIS 0x04 // mensural brevis head
+#define MLP_LONGA 0x08 // mensural brevis head with right cauda
+#define MLP_MAXIMA 0x10 // mensural maxima head without stem
+#define MLP_FLEXA 0x20
 
-#define MLP_STEM       (MLP_UP | MLP_DOWN)
-#define MLP_SINGLE_HEAD        (MLP_BREVIS | MLP_LONGA | MLP_MAXIMA)
-#define MLP_ANY                (MLP_FLEXA | MLP_SINGLE_HEAD)
+#define MLP_STEM (MLP_UP | MLP_DOWN)
+#define MLP_SINGLE_HEAD (MLP_BREVIS | MLP_LONGA | MLP_MAXIMA)
+#define MLP_ANY (MLP_FLEXA | MLP_SINGLE_HEAD)
 
 struct Mensural_ligature
 {
-  DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  static bool has_interface (Grob*);
+  DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  static bool has_interface (Grob *);
 };
 
 #endif /* MENSURAL_LIGATURE_HH */
index ec5964c78566a32effa14ac5080935bd5773e12d..6c102329185e891c4f8934e55ddf9c691744339c 100644 (file)
@@ -2,7 +2,7 @@
   midi-item.hh -- declare Midi items
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef MIDI_ITEM_HH
 #define MIDI_ITEM_HH
 #include "audio-item.hh"
 
 /**
-  Any piece of midi information.
+   Any piece of midi information.
 
-  Maybe use base classes for RIFF files?
- */
+   Maybe use base classes for RIFF files?
+*/
 class Midi_item
 {
 public:
@@ -22,7 +22,7 @@ public:
   virtual ~Midi_item ();
 
   /// factory
-  static Midi_item* get_midi (Audio_item* a);
+  static Midi_item *get_midi (Audio_item *a);
 
   static String i2varint_string (int i);
 
@@ -32,21 +32,21 @@ public:
 };
 
 /**
-  timed MIDI event
- */
+   timed MIDI event
+*/
 class Midi_event
 {
 public:
-  Midi_event (Moment delta_mom, Midi_itemmidi);
+  Midi_event (Moment delta_mom, Midi_item *midi);
 
   Moment delta_mom_;
-  Midi_itemmidi_;
+  Midi_item *midi_;
   String to_string () const;
 };
 
 /**
-  variable sized MIDI data
- */
+   variable sized MIDI data
+*/
 class Midi_chunk : public Midi_item
 {
 public:
@@ -76,116 +76,116 @@ public:
 };
 
 /**
-  Change instrument event
- */
+   Change instrument event
+*/
 class Midi_instrument : public Midi_item
 {
 public:
-  Midi_instrument (Audio_instrument*);
+  Midi_instrument (Audio_instrument *);
 
   virtual String to_string () const;
 
-  Audio_instrumentaudio_;
+  Audio_instrument *audio_;
 };
-                                      
 
 class Midi_key : public Midi_item
 {
 public:
-  Midi_key (Audio_key*);
-       
+  Midi_key (Audio_key *);
+
   virtual String to_string () const;
 
-  Audio_keyaudio_;
+  Audio_key *audio_;
 };
 
 class Midi_time_signature : public Midi_item
 {
 public:
-  Midi_time_signature (Audio_time_signature*);
-  
+  Midi_time_signature (Audio_time_signature *);
+
   virtual String to_string () const;
 
-  Audio_time_signatureaudio_;
+  Audio_time_signature *audio_;
   int clocks_per_1_;
 };
 
 /**
-  Turn a note on.
- */
+   Turn a note on.
+*/
 class Midi_note : public Midi_item
 {
 public:
-  Midi_note (Audio_note*);
+  Midi_note (Audio_note *);
 
   Moment get_length () const;
   int get_pitch () const;
   int get_fine_tuning () const;
   virtual String to_string () const;
 
-  Audio_noteaudio_;
+  Audio_note *audio_;
 
   static int const c0_pitch_i_ = 60;
   Byte dynamic_byte_;
 };
 
 /**
-  Turn a note off 
- */
+   Turn a note off
+*/
 class Midi_note_off : public Midi_note
 {
 public:
-  Midi_note_off (Midi_note*); 
+  Midi_note_off (Midi_note *);
 
   virtual String to_string () const;
 
-  Midi_noteon_;
+  Midi_note *on_;
   Byte aftertouch_byte_;
 };
 
 class Midi_text : public Midi_item
 {
 public:
-  enum Type { 
-    TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
-    MARKER, CUE_POINT
-  };
+  enum Type
+    {
+      TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
+      MARKER, CUE_POINT
+    };
+
+  Midi_text (Audio_text *);
 
-  Midi_text (Audio_text*);
-    
   virtual String to_string () const;
 
-  Audio_textaudio_;
+  Audio_text *audio_;
 };
 
 class Midi_dynamic : public Midi_item
 {
 public:
-  Midi_dynamic (Audio_dynamic*);
-  
+  Midi_dynamic (Audio_dynamic *);
+
   virtual String to_string () const;
 
-  Audio_dynamicaudio_;
+  Audio_dynamic *audio_;
 };
 
 class Midi_piano_pedal : public Midi_item
 {
 public:
-  Midi_piano_pedal (Audio_piano_pedal*);
-  
+  Midi_piano_pedal (Audio_piano_pedal *);
+
   virtual String to_string () const;
 
-  Audio_piano_pedalaudio_;
+  Audio_piano_pedal *audio_;
 };
 
 class Midi_tempo : public Midi_item
 {
 public:
-  Midi_tempo (Audio_tempo*);
-  
+  Midi_tempo (Audio_tempo *);
+
   virtual String to_string () const;
 
-  Audio_tempoaudio_;
+  Audio_tempo *audio_;
 };
 
 class Midi_track : public Midi_chunk
@@ -195,12 +195,12 @@ public:
 
   /*
     Compensate for starting grace notes.
-   */
+  */
   Cons_list<Midi_event> event_p_list_;
-  
+
   Midi_track ();
 
-  void add (Moment delta_time_mom, Midi_itemmidi);
+  void add (Moment delta_time_mom, Midi_item *midi);
   virtual String data_string () const;
 };
 
index 06de819877c5029057c69f934e5a5fe0d66a9efc..c4512f82ec1ae14470e069bea51aec1687639a3e 100644 (file)
@@ -2,7 +2,7 @@
   midi-stream.hh -- declare Midi_stream
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef MIDI_STREAM_HH
 #define MIDI_STREAM_HH
 class Midi_item;
 
 /// Midi outputfile
-struct Midi_stream {
+struct Midi_stream
+{
   Midi_stream (String file_name_string);
   ~Midi_stream ();
 
-  Midi_stream& operator << ( String str);
-  Midi_stream& operator << ( Midi_item const& midi_c_r);
-  Midi_stream& operator << ( int i);
+  Midi_stream &operator<< (String str);
+  Midi_stream &operator<< (Midi_item const &midi_c_r);
+  Midi_stream &operator<< (int i);
 
   void open ();
 
index 7a2c7d5be9d87d90775c7b025f5ca524a94e4162..5f9e9e602f9db967a57f1a7ff34c5221e2fff2b3 100644 (file)
@@ -2,8 +2,8 @@
   midi-walker.hh -- declare Midi_walker
 
   (c) 1996--2005 Han-Wen Nienhuys  <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #ifndef MIDI_WALKER_HH
 #define MIDI_WALKER_HH
 #include "lily-proto.hh"
 #include "moment.hh"
 
-struct Midi_note_event : PQueue_ent<Moment, Midi_note*>
+struct Midi_note_event : PQueue_ent < Moment, Midi_note *>
 {
   bool ignore_b_;
   Midi_note_event ();
 };
 
-int compare (Midi_note_event const& left, Midi_note_event const& right);
+int compare (Midi_note_event const &left, Midi_note_event const &right);
 
 /**
-  walk audio and output midi
-  */
+   walk audio and output midi
+*/
 class Midi_walker
 {
 public:
-  Midi_walker (Audio_staff* audio_staff, Midi_track* midi_track);
+  Midi_walker (Audio_staff *audio_staff, Midi_track *midi_track);
   ~Midi_walker ();
 
   void process ();
-  void operator ++ (int);
+  void operator++ (int);
   bool ok () const;
 
 private:
-  void do_start_note (Midi_notenote);
+  void do_start_note (Midi_note *note);
   void do_stop_notes (Moment now_mom);
-  void output_event (Moment now_mom, Midi_iteml);
-  
-  Midi_tracktrack_;
-  Audio_staffstaff_;
+  void output_event (Moment now_mom, Midi_item *l);
+
+  Midi_track *track_;
+  Audio_staff *staff_;
   int index_;
   Link_array<Audio_item> * items_;
   PQueue<Midi_note_event> stop_note_queue;
   Moment last_mom_;
 };
 
-
 #endif // MIDI_WALKER_HH
index ef9f58f4ed934861874bb8957c63085acfd30b68..5476f10af9d0618f7c384f135ec36c3e0ca14ded 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef MINTERVAL_HH
 #define MINTERVAL_HH
 
index 72da2c90e969341fd16cdd30fbea94aacd0c0179..b40e936e9ef67dce20abca556281d629190a8b9a 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef MISC_HH
 #include "array.hh"
 #include "interval.hh"
 
-double log_2 (double x) ;
+double log_2 (double x);
 int intlog2 (int d);
 
 inline int
 sign (int i)
 {
-  if (i<0)
+  if (i < 0)
     return -1;
   else if (i)
     return 1;
@@ -31,10 +30,10 @@ sign (int i)
 Array<String> split_string (String s, char c);
 
 inline Real
-linear_interpolate (Real x, Real x1, Real x2,  Real y1, Real  y2)
+linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2)
 {
-  return (x2 - x) / (x2 - x1) * y1 +
-    (x - x1) / (x2 - x1) * y2 ;
+  return (x2 - x) / (x2 - x1) * y1
+    + (x - x1) / (x2 - x1) * y2;
 }
 
 #endif
index 1f3b380aee105d6c5a12161c693c3a460be76ad4..66a0ab9e3d1ddde36b267621c2ef3dca42448bf8 100644 (file)
@@ -1,8 +1,8 @@
-/*   
+/*
   modified-font-metric.hh -- declare Font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
@@ -17,24 +17,24 @@ struct Modified_font_metric : public Font_metric
 public:
   virtual Box text_dimension (String) const;
   virtual Stencil text_stencil (String) const;
-  
+
   static SCM make_scaled_font_metric (Font_metric *fm, Real magnification);
   virtual int count () const;
   virtual Offset get_indexed_wxwy (int) const;
   virtual Offset attachment_point (String) const;
   virtual int name_to_index (String) const;
   virtual unsigned index_to_charcode (int) const;
-  Font_metric*original_font () const;
-  
+  Font_metric *original_font () const;
+
 protected:
   Font_metric *orig_;
   Real magnification_;
-    
+
   Modified_font_metric (Font_metric *fm, Real magnification);
   virtual SCM sub_fonts () const;
   virtual String font_name () const;
   virtual Real design_size () const;
-  virtual void derived_mark () const; 
+  virtual void derived_mark () const;
   virtual Box get_indexed_char (int) const;
   virtual int index_to_ascii (int) const;
   virtual Box get_ascii_char (int) const;
index 953a89a0083e549754b13e51317d634dbf7307af..e7f5499646822e05278d124b3a58ca0022556b20 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   moment.hh -- declare Moment
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef MOMENT_HH
 #define MOMENT_HH
@@ -19,7 +18,7 @@
 */
 class Moment
 {
-  DECLARE_SIMPLE_SMOBS (Moment, );
+  DECLARE_SIMPLE_SMOBS (Moment,);
 public:
   Moment ();
   Moment (int m);
@@ -27,13 +26,13 @@ public:
   Moment (Rational, Rational);
   Moment (Rational m);
 
-  Moment operator - () const;
-  
-  void operator += (Moment const &m);
-  void operator -= (Moment const &m);  
+  Moment operator- () const;
 
-  void operator *= (Moment const &m);
-  void operator /= (Moment const &m);  
+  void operator+= (Moment const &m);
+  void operator-= (Moment const &m);
+
+  void operator*= (Moment const &m);
+  void operator/= (Moment const &m);
 
   Rational main_part_;
   Rational grace_part_;
@@ -45,25 +44,24 @@ public:
   int num () const;
   /*
     Deliver a copy of THIS as a smobified SCM
-   */
+  */
   String to_string () const;
-  static int compare (Moment const&, Moment const&);
+  static int compare (Moment const &, Moment const &);
   SCM as_scheme () const;
 };
-IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
-IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - );
-IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
-IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * );
-
+IMPLEMENT_ARITHMETIC_OPERATOR (Moment, +);
+IMPLEMENT_ARITHMETIC_OPERATOR (Moment, -);
+IMPLEMENT_ARITHMETIC_OPERATOR (Moment, /);
+IMPLEMENT_ARITHMETIC_OPERATOR (Moment, *);
 
-DECLARE_UNSMOB(Moment, moment);
-int compare (Moment const&, Moment const&);
-INSTANTIATE_COMPARE (Moment const&, Moment::compare);
+DECLARE_UNSMOB (Moment, moment);
+int compare (Moment const &, Moment const &);
+INSTANTIATE_COMPARE (Moment const &, Moment::compare);
 
 Moment robust_scm2moment (SCM, Moment);
 
 #ifdef STREAM_SUPPORT
-std::ostream & operator << (std::ostream &, Moment const &);
+std::ostream & operator<< (std::ostream &, Moment const &);
 #endif
 
 bool moment_less (SCM a, SCM b);
index e277539be13bd22e3356282d3809a3372d0863cf..4492945b06f6158c23fe58ea8e0db851dc1c6d38 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   multi-measure-rest.hh -- declare Multi_measure_rest
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+*/
 
 #ifndef MULTI_MEASURE_REST_HH
 #define MULTI_MEASURE_REST_HH
 class Multi_measure_rest
 {
 public:
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (percent, (SCM));
-  static  void add_column (Grob*, Item*);
-  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
-  DECLARE_SCHEME_CALLBACK (centered_stencil, (SCM ));
-  
-  static Stencil big_rest (Grob*, Real);
-  static Stencil symbol_stencil (Grob*, Real);  
-  static Stencil church_rest (Grob*, Font_metric*, int, Real);
+  static void add_column (Grob *, Item *);
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
+  DECLARE_SCHEME_CALLBACK (centered_stencil, (SCM));
+
+  static Stencil big_rest (Grob *, Real);
+  static Stencil symbol_stencil (Grob *, Real);
+  static Stencil church_rest (Grob *, Font_metric *, int, Real);
 };
 
 #endif /* MULTI_MEASURE_REST_HH */
index b646b2b6bb10375b0440d10ed3f4616f2535ea14..efeb4332327e4863e2612232b9e248f01a86b18f 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-constructor.hh -- declare Music_constructor
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef MUSIC_CONSTRUCTOR_HH
 #define MUSIC_CONSTRUCTOR_HH
 #include "string.hh"
 #include "global-ctor.hh"
 
-#define ADD_MUSIC(type) \
-Music * _ ## type ## _ctor (SCM init)\
-{\
-  return new type (init);\
-}\
-static void  _ ## type ## _adder () {\
-      add_music_ctor (#type, & _ ## type ## _ctor);\
-}\
-ADD_SCM_INIT_FUNC( _ ## type ## _adder_prefix,  _ ## type ## _adder);
+#define ADD_MUSIC(type)                                                        \
+  Music *_ ## type ## _ctor (SCM init)                                 \
+  {                                                                    \
+    return new type (init);                                            \
+  }                                                                    \
+  static void _ ## type ## _adder ()                                   \
+  {                                                                    \
+    add_music_ctor (#type, & _ ## type ## _ctor);                      \
+  }                                                                    \
+  ADD_SCM_INIT_FUNC (_ ## type ## _adder_prefix, _ ## type ## _adder);
 
 typedef Music *(*Music_ctor) (SCM);
 void add_music_ctor (String, Music_ctor);
-Music*make_music (String, SCM);
-
-
-
+Music *make_music (String, SCM);
 
 
 #endif /* MUSIC_CONSTRUCTOR_HH */
index 3cd73d65587b54e9a0cff355f6379d7ac3261958..66b91e7b976051ef7bc463310beae02a0277af98 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   music-head.hh -- declare music_function
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #ifndef MUSIC_FUNCTION_HH
index cc5da19c392e719e954e5333202d900e6d985b6e..7b395e8a2c49c55e9a1d12175a4a5112d7aefee7 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef MUSIC_ITERATOR_HH
 #define MUSIC_ITERATOR_HH
 
 
 
    ---
-       
-  Conceptually a music-iterator operates on a queue of musical events
-  that are pending. This queue does not actually exist, but it is a
-  way of viewing and traversing music-expressions.
 
-  
-  ok () -- events left ?
+   Conceptually a music-iterator operates on a queue of musical events
+   that are pending. This queue does not actually exist, but it is a
+   way of viewing and traversing music-expressions.
+
+
+   ok () -- events left ?
+
+   pending_mom () -- time tag of the next event to be processed.
+   PRECONDITION: this->ok () holds.
 
-  pending_mom () -- time tag of the next event to be processed.
-    PRECONDITION: this->ok () holds.
-  
-  process (M) -- process all at M (Precondition: no events exist
-    before M, this->ok () holds).  Side-effects:
-    
-    * This removes all events at M from the pending queue.
+   process (M) -- process all at M (Precondition: no events exist
+   before M, this->ok () holds).  Side-effects:
 
-    * Typically this reports the music to an interpretation context,
-    thus changing the state of the interpretation context.
+   * This removes all events at M from the pending queue.
 
+   * Typically this reports the music to an interpretation context,
+   thus changing the state of the interpretation context.
 
-  TODO:
 
-  merge pending_moment and process?
-  
+   TODO:
+
+   merge pending_moment and process?
 */
 class Music_iterator
 {
@@ -56,9 +54,9 @@ protected:
   Moment start_mom_;
 
   DECLARE_SMOBS (Music_iterator, dummy);
-  Music_iterator (Music_iterator const&);
+  Music_iterator (Music_iterator const &);
 public:
-  
+
   Moment music_get_length () const;
   Moment music_start_mom () const;
   Music_iterator ();
@@ -67,67 +65,67 @@ public:
      Do the reporting.  Will try MUSIC_L_ in its own translator first,
      then its children. Returns the iterator that succeeded
   */
-  Music_iterator *  try_music (Music  *) const;
-  
+  Music_iterator *try_music (Music *) const;
+
   /**
-    The translation unit that we this iterator is reporting  to now.
-   */
-  Context * get_outlet () const;
+     The translation unit that we this iterator is reporting  to now.
+  */
+  Context *get_outlet () const;
 
   void set_context (Context *);
-  
+
   /** Get an iterator matching the type of MUS, and use TRANS to find
-    an accompanying translation unit
-   */
-  static SCM get_static_get_iterator (Music * mus);
-  void init_translator (Music  *, Context *); 
+      an accompanying translation unit
+  */
+  static SCM get_static_get_iterator (Music *mus);
+  void init_translator (Music *, Context *);
   void quit ();
-  void substitute_outlet (Context * from, Context *to);
+  void substitute_outlet (Context *from, Context *to);
   virtual void derived_substitute (Context *, Context *);
   virtual Moment pending_moment () const;
   virtual bool ok () const;
 
-  virtual bool run_always () const; 
+  virtual bool run_always () const;
   virtual void process (Moment until);
   virtual void derived_mark () const;
   virtual void construct_children ();
-  
+
   /**
-    Construct sub-iterators, and set the translator to 
-    report to.
-   */
+     Construct sub-iterators, and set the translator to
+     report to.
+  */
+
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 
-  DECLARE_SCHEME_CALLBACK(constructor, ());
-  
   /**
-    Get an iterator for MUS, inheriting the translation unit from THIS.
-   */
+     Get an iterator for MUS, inheriting the translation unit from THIS.
+  */
   SCM get_iterator (Music *) const;
 
-  virtual Music_iteratortry_music_in_children (Music *) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 
-  Music * get_music () const;
+  Music *get_music () const;
 protected:
-  virtual void do_quit();
-  void descend_to_child (Context*);
+  virtual void do_quit ();
+  void descend_to_child (Context *);
 private:
   Interpretation_context_handle handle_;
-  Music  * music_;
+  Music *music_;
 };
 
 bool is_child_context (Context *me, Context *child);
 
-#define IMPLEMENT_CTOR_CALLBACK(Class)         \
-LY_DEFINE_MEMBER_FUNCTION(Class, constructor, #Class "::constructor", \
-         0, 0, 0, \
-         (), \
-         "")\
-{                                              \
-  SCM val = (new Class)->self_scm();   \
-  scm_gc_unprotect_object (val);\
-  return val ;                         \
-}                                              \
-
-DECLARE_UNSMOB(Music_iterator, iterator);
+#define IMPLEMENT_CTOR_CALLBACK(Class)                                 \
+  LY_DEFINE_MEMBER_FUNCTION (Class, constructor, #Class "::constructor", \
+                            0, 0, 0,                                   \
+                            (),                                        \
+                            "")                                        \
+  {                                                                    \
+    SCM val = (new Class)->self_scm ();                                        \
+    scm_gc_unprotect_object (val);                                     \
+    return val;                                                                \
+  }
+
+DECLARE_UNSMOB (Music_iterator, iterator);
 
 #endif // MUSIC_ITERATOR_HH
index 250893c919a8e57b1af93be57083f0903b6d1e27..db8619f21daf09a8415763f1a2309ddba87531ca 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef MUSIC_OUTPUT_HH
 #define MUSIC_OUTPUT_HH
 
@@ -14,7 +13,7 @@
 #include "lily-proto.hh"
 #include "protected-scm.hh"
 
-class Music_output 
+class Music_output
 {
 public:
   virtual SCM process (String) {return SCM_EOL;}
index 28d99eb022c77c16c0f36f8e43c16499028e0e0b..6ea7711555b305e0e664b2c413f9e062ed6af46a 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-sequence.hh -- declare Music_sequence
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef MUSIC_SEQUENCE_HH
 #define MUSIC_SEQUENCE_HH
 struct Music_sequence
 {
 public:
-  DECLARE_SCHEME_CALLBACK(cumulative_length_callback, (SCM));
-  DECLARE_SCHEME_CALLBACK(maximum_length_callback, (SCM));
-  DECLARE_SCHEME_CALLBACK(minimum_start_callback, (SCM));
-  DECLARE_SCHEME_CALLBACK(first_start_callback, (SCM));
-  DECLARE_SCHEME_CALLBACK(simultaneous_relative_callback, (SCM, SCM));
-  DECLARE_SCHEME_CALLBACK(event_chord_relative_callback, (SCM, SCM));
-  
+  DECLARE_SCHEME_CALLBACK (cumulative_length_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (maximum_length_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (minimum_start_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (first_start_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (simultaneous_relative_callback, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (event_chord_relative_callback, (SCM, SCM));
+
   Pitch do_relative_octave (Pitch p, bool b);
-  
-  static Moment cumulative_length (SCM) ;
-  static Moment maximum_length (SCM) ;
-  static Moment first_start (SCM list) ;
+
+  static Moment cumulative_length (SCM);
+  static Moment maximum_length (SCM);
+  static Moment first_start (SCM list);
   static Moment minimum_start (SCM list);
 };
 
 SCM ly_transpose_key_alist (SCM l, SCM pit);
 Pitch music_list_to_relative (SCM l, Pitch p, bool ret_first);
-void transpose_music_list (SCM , Pitch);
+void transpose_music_list (SCM, Pitch);
 void compress_music_list (SCM, Moment);
 
 #endif
index db9fff1afe2dfda1793aaa3ce0de04a6ff409a6a..660ab140ab51e1714457784315e8aba135ed2843 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-wrapper-iterator.hh -- declare Music_wrapper_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef MUSIC_WRAPPER_ITERATOR_HH
 #define MUSIC_WRAPPER_ITERATOR_HH
 #include "music.hh"
 #include "music-iterator.hh"
 
-/** 
-  The iterator for a #Music_wrapper#.  Since #Music_wrapper# essentially
-  does nothing, this iterator creates a child iterator and delegates
-  all work to that child.
- */
+/**
+   The iterator for a #Music_wrapper#.  Since #Music_wrapper# essentially
+   does nothing, this iterator creates a child iterator and delegates
+   all work to that child.
+*/
 class Music_wrapper_iterator : public Music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());  
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Music_wrapper_iterator ();
 
-  virtual void derived_substitute (Context *f, Context *t) ;
+  virtual void derived_substitute (Context *f, Context *t);
   virtual void derived_mark () const;
-  virtual void construct_children () ;
+  virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit(); 
+  virtual void do_quit ();
   virtual bool ok () const;
   virtual bool run_always () const;
 protected:
@@ -40,5 +39,3 @@ protected:
 
 #endif /* MUSIC_WRAPPER_ITERATOR_HH */
 
-
-
index 0d41c41d28cab11d5816527f2ce61496c4d3e7a3..05ba1ae390b01ad31b819ccc8b22a148fbb17d8c 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-wrapper.hh -- declare Music_wrapper
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef MUSIC_WRAPPER_HH
 #define MUSIC_WRAPPER_HH
 #include "pitch.hh"
 
 /** A Music that modifies an existing Music.  This data structure
-  corresponds to a production that takes a single Music argument,
-  
-  Music: STUFF Music 
+    corresponds to a production that takes a single Music argument,
 
-  */
+    Music: STUFF Music
+*/
 class Music_wrapper : public Music
 {
 public:
   Music_wrapper (SCM);
   VIRTUAL_COPY_CONSTRUCTOR (Music, Music_wrapper);
-  DECLARE_SCHEME_CALLBACK(length_callback, (SCM));
-  DECLARE_SCHEME_CALLBACK(start_callback, (SCM));
-  
+  DECLARE_SCHEME_CALLBACK (length_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (start_callback, (SCM));
+
   Music *element () const;
 };
 
index 973b65ac876f0bafaccdd4ce4b3d37a2a44ba9fc..aeb36a40c7da345b0074fd1ef682fc81199f9652 100644 (file)
@@ -15,7 +15,6 @@
 
 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
 
-
 class Music
 {
 public:
@@ -23,18 +22,18 @@ public:
   Music (Music const &m);
   VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
 
-  Input *origin () const; 
+  Input *origin () const;
   void set_spot (Input);
 
   SCM internal_get_property (SCM) const;
-  void internal_set_property (SCM , SCM val);
+  void internal_set_property (SCM, SCM val);
   SCM get_property_alist (bool mutble) const;
   bool internal_is_music_type (SCM) const;
   int duration_log () const;
-  
-  DECLARE_SCHEME_CALLBACK(relative_callback, (SCM, SCM));
+
+  DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
   Pitch to_relative_octave (Pitch);
-  Pitch generic_to_relative_octave (Pitch);  
+  Pitch generic_to_relative_octave (Pitch);
   String name () const;
   Moment get_length () const;
   Moment start_mom () const;
@@ -42,12 +41,12 @@ public:
 
   /// Transpose, with the interval central C to #p#
   void transpose (Pitch p);
-  
+
   /// Scale the music in time by #factor#.
   void compress (Moment factor);
-  
+
 protected:
-  DECLARE_SMOBS (Music, );
+  DECLARE_SMOBS (Music,);
   SCM immutable_property_alist_;
   SCM mutable_property_alist_;
 protected:
@@ -56,8 +55,8 @@ protected:
   friend SCM ly_extended_make_music (SCM, SCM);
 };
 
-DECLARE_TYPE_P(Music);
-DECLARE_UNSMOB(Music, music);
+DECLARE_TYPE_P (Music);
+DECLARE_UNSMOB (Music, music);
 
 Music *make_music_by_name (SCM sym);
 SCM ly_music_deep_copy (SCM);
index 82329d6328bdd40101b1d86b41883a48d3969a96..de6d4dd290b69374d4a8f1da90967d435db75106 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef COLLISION_HH
 #define COLLISION_HH
 
 #include "parray.hh"
 
 /**
-  Resolve conflicts between various Note_columns (chords).
-  
-  TODO 
+   Resolve conflicts between various Note_columns (chords).
 
-  * multistaff support (see Chlapik: equal noteheads should be on the
-  same hpos.)  
+   TODO
 
-  * Make interface of this, similar to align-interface.
-  
-*/
+   * multistaff support (see Chlapik: equal noteheads should be on the
+   same hpos.)
+
+   * Make interface of this, similar to align-interface.
+   */
 class Note_collision_interface
 {
 public:
-  static SCM automatic_shift (Grob*, Drul_array< Link_array <Grob>  >);
-  static SCM forced_shift (Grob*);
-  
-  static Drul_array< Link_array <Grob>  > get_clash_groups (Grob *me);
+  static SCM automatic_shift (Grob *, Drul_array< Link_array<Grob> >);
+  static SCM forced_shift (Grob *);
+
+  static Drul_array< Link_array<Grob> > get_clash_groups (Grob *me);
   DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
-  static void do_shifts (Grob*);
-  static void add_column (Grob*me, Grob*ncol);
-  static bool has_interface(Grob*);
+  static void do_shifts (Grob *);
+  static void add_column (Grob *me, Grob *ncol);
+  static bool has_interface (Grob *);
 };
 #endif // COLLISION_HH
index 32eec6af311825d390ca528de12a3a5a75331b56..a6abdb3324a0f071caa8323b7b84b2e77609eb63 100644 (file)
@@ -6,36 +6,34 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef NOTE_COLUMN_HH
 #define NOTE_COLUMN_HH
 
 #include "item.hh"
 
 /** a struct for treating a group of noteheads (noteheads, stem
- (chord) and scripts) as a single entity.
-
-  UGR. Junkme.  refpoint should be the notehead, dir should come from stem.
+    (chord) and scripts) as a single entity.
 
+    UGR. Junkme.  refpoint should be the notehead, dir should come from stem.
 */
 class Note_column
 {
 public:
-  static int shift_compare (Grob *const &, Grob*const&);
-  static Direction dir (Grob*me);
-  static Grob * accidentals (Grob*me);
-  static Slice head_positions_interval (Grobme);
-  static Direction static_dir (Grob*);
-  static void translate_rests (Grob*me, int dy);
-  static Grob *first_head (Grob*me);
-  static Grob *get_rest (Grob*me);
-  static void set_stem (Grob*me, Grob*);
-  static void set_dotcol (Grob*me, Grob*);
-  static void add_head (Grob*me, Grob*);
-  static bool has_rests (Grob*me);
-  static bool has_interface (Grob*);
-  
-  static Item *get_stem (Grob*);
+  static int shift_compare (Grob *const &, Grob *const &);
+  static Direction dir (Grob *me);
+  static Grob *accidentals (Grob *me);
+  static Slice head_positions_interval (Grob *me);
+  static Direction static_dir (Grob *);
+  static void translate_rests (Grob *me, int dy);
+  static Grob *first_head (Grob *me);
+  static Grob *get_rest (Grob *me);
+  static void set_stem (Grob *me, Grob *);
+  static void set_dotcol (Grob *me, Grob *);
+  static void add_head (Grob *me, Grob *);
+  static bool has_rests (Grob *me);
+  static bool has_interface (Grob *);
+
+  static Item *get_stem (Grob *);
 };
 
 #endif // NOTE_COLUMN_HH
index 0033f7866e84ff3633013c36e6eddbc1f82a0532..1c7e12dd843d8bf1f4442791eb6eed7c7d121796 100644 (file)
 
 /** ball at the end of the stem. Also takes care of ledger lines.
 
-    NoteHead is a kind of RhythmicHead, see there.
+NoteHead is a kind of RhythmicHead, see there.
 
-  Read-only:
+Read-only:
 */
 
-class Note_head 
+class Note_head
 {
 public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM));
   DECLARE_SCHEME_CALLBACK (extent, (SCM, SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
   static Real stem_attachment_coordinate (Grob *, Axis a);
-  static int get_balltype (Grob*) ;  
+  static int get_balltype (Grob *);
 };
 #endif // NOTEHEAD_HH
 
index c9bcf8c4787e9935f24789b4b0f4acf20107ff12..fdf358965e7bde4b54ede3770e8c5c2c83bfa535 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-note-spacing.hh -- declare Note_spacing
+/*
+  note-spacing.hh -- declare Note_spacing
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef NOTE_SPACING_HH
 #define NOTE_SPACING_HH
@@ -15,13 +14,13 @@ source file of the GNU LilyPond music typesetter
 class Note_spacing
 {
 public:
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 
-  static void get_spacing (Grob *me, Item* , Real, Real, Real*, Real*);
-  static void stem_dir_correction (Grob *me, Item * next_col, Real incr,
-                                  Real*, Real*);
-  static Item * right_column (Grob*);
-  static Item * left_column (Grob*);  
+  static void get_spacing (Grob *me, Item *, Real, Real, Real *, Real *);
+  static void stem_dir_correction (Grob *me, Item *next_col, Real incr,
+                                  Real *, Real *);
+  static Item *right_column (Grob *);
+  static Item *left_column (Grob *);
 };
 
 #endif /* NOTE_SPACING_HH */
index 5ee61408e910a5886bfd442ee0e29d9b608edca8..ad7507a04e4ccd393b2bc2cc2b590bf455d239c6 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef OBJECT_KEY_DUMPER_HH
@@ -14,9 +13,9 @@
 
 #include "object-key.hh"
 
-typedef std::map<Object_key const*, Object_key const*, Object_key_less> Key_to_key_map;
-typedef std::map<Object_key const*, int> Pointer_to_int_map;
-typedef std::map<int, Object_key const *> Int_to_key_map;
+typedef std::map < Object_key const *, Object_key const *, Object_key_less> Key_to_key_map;
+typedef std::map < Object_key const *, int> Pointer_to_int_map;
+typedef std::map < int, Object_key const *> Int_to_key_map;
 
 class Object_key_dumper
 {
@@ -24,17 +23,17 @@ class Object_key_dumper
   Key_to_key_map serialized_keys_;
   Pointer_to_int_map key_serial_numbers_;
   int next_available_;
-  
+
   SCM key_serial (int);
   SCM serialize_key (Object_key const *);
-  DECLARE_SMOBS (Object_key_dumper, );
+  DECLARE_SMOBS (Object_key_dumper,);
 public:
-  Object_key_dumper (); 
+  Object_key_dumper ();
   SCM get_file_contents () const;
   SCM dump_key (Object_key const *);
 };
 
-DECLARE_UNSMOB(Object_key_dumper, key_dumper);
+DECLARE_UNSMOB (Object_key_dumper, key_dumper);
 
 #endif /* OBJECT_KEY_DUMPER_HH */
 
index 95af156eec289cfa5241425ed090948046805545..e74976a898e54873eed9d85ce82b9e65098c0b8f 100644 (file)
@@ -4,26 +4,25 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef OBJECT_KEY_UNDUMPER_HH
 #define OBJECT_KEY_UNDUMPER_HH
 
 #include <map>
-#include "object-key.hh" 
+#include "object-key.hh"
 
-typedef std::map<int, Object_key const *> Int_to_key_map;
+typedef std::map < int, Object_key const *> Int_to_key_map;
 
 struct Object_key_undumper
 {
-  DECLARE_SMOBS(Object_key_undumper, );
+  DECLARE_SMOBS (Object_key_undumper,);
   Int_to_key_map keys_;
 public:
   void parse_contents (SCM);
   Object_key_undumper ();
   Object_key const *get_key (int k);
 };
-DECLARE_UNSMOB(Object_key_undumper, key_undumper);
+DECLARE_UNSMOB (Object_key_undumper, key_undumper);
 
 #endif
index 755b72f1228b8ad5c8d35f06572eed2a4f3ee96f..d8ebf33eb6eb023f80966688a2602fe7fd1c2461 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef OBJECT_KEY_HH
 
   In the future, they might also act as handles for external processes
   requesting notation to be drawn.
- */
+*/
 class Object_key
 {
-  DECLARE_SMOBS(Object_key, );
+  DECLARE_SMOBS (Object_key,);
 
 protected:
-  Object_key();
+  Object_key ();
   virtual void derived_mark () const;
   virtual int get_type () const;
-  virtual int do_compare (Object_key const * other) const;
+  virtual int do_compare (Object_key const *other) const;
   virtual SCM as_scheme () const;
 public:
   static Object_key *from_scheme (SCM);
@@ -36,40 +35,41 @@ public:
   SCM dump () const;
 };
 
-enum Object_key_type {
-  BASE_KEY,
-  COPIED_KEY,
-  GENERAL_KEY, 
-  GROB_KEY,
-  CONTEXT_KEY,
-  KEY_COUNT,
-};
+enum Object_key_type
+  {
+    BASE_KEY,
+    COPIED_KEY,
+    GENERAL_KEY,
+    GROB_KEY,
+    CONTEXT_KEY,
+    KEY_COUNT,
+  };
 
 class Copied_key : public Object_key
 {
 
 private:
-  Object_key const * original_;
+  Object_key const *original_;
   int copy_count_;
 
 protected:
   virtual void derived_mark () const;
   virtual int get_type () const;
-  virtual int do_compare (Object_key const * other) const;
+  virtual int do_compare (Object_key const *other) const;
   virtual SCM as_scheme () const;
 public:
   static Object_key *from_scheme (SCM);
-  Copied_key (Object_key const*, int); 
+  Copied_key (Object_key const *, int);
 };
 
-DECLARE_UNSMOB(Object_key, key);
+DECLARE_UNSMOB (Object_key, key);
 
-struct Object_key_less {
-  bool operator () (Object_key const *const &t1, Object_key const *const &t2) const
+struct Object_key_less
+{
+  bool operator() (Object_key const *const &t1, Object_key const *const &t2) const
   {
     return t1->compare (t2);
   }
 };
 
-
 #endif /* OBJECT_KEY_HH */
index 7b9d05a1acda248ff219154724ab0adf08f5bea0..b58f6dcf895f45dd6ea8b1c9213f2f9433a13e7f 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef OPEN_TYPE_FONT_HH
 #include "freetype.hh"
 #include "font-metric.hh"
 
-typedef std::map<FT_UInt, FT_ULong> Index_to_charcode_map;
+typedef std::map < FT_UInt, FT_ULong> Index_to_charcode_map;
 Index_to_charcode_map make_index_to_charcode_map (FT_Face face);
 
 class Open_type_font : public Font_metric
 {
-  /* handle to face object */  
+  /* handle to face object */
   FT_Face face_;
 
-  SCM lily_subfonts_; 
-  SCM lily_character_table_; 
+  SCM lily_subfonts_;
+  SCM lily_character_table_;
   SCM lily_global_table_;
   Index_to_charcode_map index_to_charcode_map_;
   Open_type_font (FT_Face);
@@ -32,10 +31,10 @@ public:
   SCM get_subfonts () const;
   SCM get_global_table () const;
   SCM get_char_table () const;
-  
+
   static SCM make_otf (String);
   virtual String font_name () const;
-  virtual ~Open_type_font();
+  virtual ~Open_type_font ();
   virtual Offset attachment_point (String) const;
   virtual int count () const;
   virtual Box get_indexed_char (int) const;
index 31b858f14343c9782360360509722175adcd412c..68a55f65b883addf008c948bfe83d8f8f2412711 100644 (file)
 class Pango_font : public Font_metric
 {
   PangoContext *context_;
-  PangoFontDescription *pango_description_; 
+  PangoFontDescription *pango_description_;
   PangoAttrList *attribute_list_;
   Real scale_;
   SCM physical_font_tab_;
 
 public:
-  SCM physical_font_tab () const; 
+  SCM physical_font_tab () const;
   Pango_font (PangoFT2FontMap *,
              Direction leftright,
              PangoFontDescription *,
@@ -38,7 +38,7 @@ public:
   SCM font_file_name () const;
   void register_font_file (String, String);
   Stencil text_stencil (String) const;
-  Stencil pango_item_string_stencil (PangoItem*, String, Real) const;
+  Stencil pango_item_string_stencil (PangoItem *, String, Real) const;
 
   virtual void derived_mark () const;
 };
index 1b783fd5fa6d049b2aaa534ade4a1414de471d86..982d5f241fd4c26089ff6c532875f6f1d5b0111d 100644 (file)
@@ -21,7 +21,7 @@ class Stencil;
 
 class Paper_book
 {
-  DECLARE_SMOBS (Paper_book, );
+  DECLARE_SMOBS (Paper_book,);
 
   SCM systems_;
   SCM pages_;
@@ -31,7 +31,7 @@ public:
   SCM header_0_;
   SCM scores_;
   Output_def *paper_;
-  
+
   Paper_book ();
 
   void add_score (SCM);
index 630d0acaf911a3b196a59929946e20c5e2183974..bb9cdfefb131a92af9802878ce50fe5b43207e5e 100644 (file)
@@ -6,42 +6,40 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef PAPER_COLUMN_HH
 #define PAPER_COLUMN_HH
 
 #include "item.hh"
 #include "rod.hh"
 
-
 class Paper_column : public Item
-{ 
+{
 public:
-  int  rank_;
+  int rank_;
   /// if lines are broken then this column is in #line#
   System *system_;
 
-  Paper_column (SCM, Object_key const*);
-  Paper_column (Paper_column const&, int count);
-  
+  Paper_column (SCM, Object_key const *);
+  Paper_column (Paper_column const &, int count);
+
   virtual Grob *clone (int count) const;
 
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
   virtual void do_break_processing ();
   virtual Paper_column *get_column () const;
   virtual System *get_system () const;
-  
-  static int get_rank (Grob*);
-  
+
+  static int get_rank (Grob *);
+
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
-  
+
   static bool is_musical (Grob *);
-  static Moment when_mom (Grob*);
+  static Moment when_mom (Grob *);
 
-  static bool is_used (Grob*) ;
+  static bool is_used (Grob *);
   void set_rank (int);
 };
-     
+
 #endif // PAPER_COLUMN_HH
 
index 95b8fc038abc5153be9eb73c6de1e49fd7fc8e83..77963e84495630177a5e05242b5b97c09d3c7cd8 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef PAPER_OUTPUTTER_HH
 #define PAPER_OUTPUTTER_HH
 
@@ -26,9 +25,8 @@ class Paper_outputter
   String file_name_;
   SCM file_;
 
-
 public:
-  DECLARE_SMOBS (Paper_outputter, );
+  DECLARE_SMOBS (Paper_outputter,);
 
 public:
   SCM file ();
@@ -37,7 +35,7 @@ public:
   Paper_outputter (String nm, String format);
   SCM scheme_to_string (SCM);
   void output_stencil (Stencil);
-  void close();
+  void close ();
 };
 
 Paper_outputter *get_paper_outputter (String, String);
index f20b1b34ef4b0dddeb930ce7dabd1727d738ed75..bd90ec1de26f030a5e163bfd31f34cbd94fe08ff 100644 (file)
@@ -22,8 +22,8 @@ public:
   Paper_score ();
 
   int find_col_idx (Paper_column const *) const;
-  Link_array<Item> broken_col_range (Item const*, Item const*) const;
-  void typeset_line (System*);
+  Link_array<Item> broken_col_range (Item const *, Item const *) const;
+  void typeset_line (System *);
   void output ();
 
 protected:
index 5a7ff284460358dc06f3bd4a652a1e3e907a1ebe..2c4930b36378ced4f9df08f78c9c9873d4839931 100644 (file)
   To save memory, we don't keep around the System grobs, but put the
   formatted content of the grob is put into a
   Paper_system. Page-breaking handles Paper_system objects.
-  
- */
+*/
 class Paper_system
 {
-  DECLARE_SMOBS (Paper_system, );
+  DECLARE_SMOBS (Paper_system,);
   Stencil stencil_;
   bool is_title_;
 public:
@@ -29,7 +28,7 @@ public:
   int number_;
 
   Paper_system (Stencil, bool);
-  
+
   Stencil to_stencil () const;
   SCM stencils () const;
   bool is_title () const;
index dc71ad7402a7d11d08fb27c2a2d45c75c6efb0e5..54895931896edadb62d523df29af3c32da660c2b 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
 */
 
 #ifndef PARSE_SCM_HH
@@ -17,7 +16,7 @@ extern bool parse_protect_global;
 
 struct Parse_start
 {
-  char conststr;
+  char const *str;
   int nchars;
   Input start_location_;
   bool safe_;
index 6d6cf637c5a17276ec019d167decf99ad24d3417..4983a20728e6bc40a3ad7a583ac7480ace13a7f5 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   percent-repeat-item.hh -- declare Percent_repeat_item_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef PERCENT_REPEAT_ITEM_HH
 #define PERCENT_REPEAT_ITEM_HH
 class Percent_repeat_item_interface
 {
 public:
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (beat_slash, (SCM ));  
-  DECLARE_SCHEME_CALLBACK (double_percent, (SCM ));
-  static Stencil x_percent (Grob*, int, Real, Real );
-  static Stencil brew_slash (Grob*);
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (beat_slash, (SCM));
+  DECLARE_SCHEME_CALLBACK (double_percent, (SCM));
+  static Stencil x_percent (Grob *, int, Real, Real);
+  static Stencil brew_slash (Grob *);
 };
 
 #endif /* PERCENT_REPEAT_ITEM_HH */
index 618b9fd33e2c10a585e430341ee9ad0c57917d4c..733ab0c537ef216bdef0097386fb6a813e40bb94 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   percent-repeat-iterator.hh -- declare Percent_repeat_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef PERCENT_REPEAT_ITERATOR_HH
 #define PERCENT_REPEAT_ITERATOR_HH
 class Percent_repeat_iterator : public Music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Percent_repeat_iterator ();
 protected:
-  virtual void derived_substitute (Context *f, Context *t) ;
+  virtual void derived_substitute (Context *f, Context *t);
 
   virtual void derived_mark () const;
   virtual Moment pending_moment () const;
-  virtual void do_quit(); 
-  virtual void construct_children () ;
+  virtual void do_quit ();
+  virtual void construct_children ();
   virtual bool ok () const;
-  virtual void process (Moment) ;
+  virtual void process (Moment);
   virtual Music_iterator *try_music_in_children (Music *) const;
 
 private:
-  Music_iterator * child_iter_;
+  Music_iterator *child_iter_;
   Moment finish_mom_;
 };
 
-
 #endif /* PERCENT_REPEAT_ITERATOR_HH */
index 5d13dab3d3f9bf8c2b0c05a59f980d55c3a712f9..596e8777751ed9dfc6883c0f355995a3e6b3f63e 100644 (file)
@@ -2,7 +2,7 @@
   performance.hh -- declare Performance
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef PERFORMANCE_HH
 #define PERFORMANCE_HH
@@ -18,10 +18,10 @@ public:
   Performance ();
   ~Performance ();
 
-  void add_element (Audio_element*p);
-    
-  void output (Midi_streammidi_stream_r);
-  void output_header_track (Midi_streammidi_stream_r);
+  void add_element (Audio_element *p);
+
+  void output (Midi_stream &midi_stream_r);
+  void output_header_track (Midi_stream &midi_stream_r);
 
   void print () const;
   SCM process (String);
index b12d91295d14f5a9efa1bbbadb5e49d924e00d11..f2e4d449226320cd0cbe95e297db18efa6b03152 100644 (file)
@@ -2,8 +2,8 @@
   performer-group-performer.hh -- declare Performer_group_performer
 
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #ifndef PERFORMER_GROUP_PERFORMER_HH
 #define PERFORMER_GROUP_PERFORMER_HH
 
 typedef void (Performer::*Performer_method) (void);
 
-class Performer_group_performer : public Performer, public virtual Translator_group {
+class Performer_group_performer : public Performer, public virtual Translator_group
+{
 public:
-  TRANSLATOR_DECLARATIONS(Performer_group_performer);
-  
+  TRANSLATOR_DECLARATIONS (Performer_group_performer);
+
   virtual void do_announces ();
   virtual void announce_element (Audio_element_info);
 protected:
index b97d35e553ca5ee848144f336ba5aec7680ee487..b912cd720c80d5161edd8625a1102d682a59ac73 100644 (file)
@@ -2,8 +2,8 @@
   performer.hh -- declare Performer
 
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #ifndef PERFORMER_HH
 #define PERFORMER_HH
@@ -19,17 +19,16 @@ class Performer : public virtual Translator
 {
 public:
   VIRTUAL_COPY_CONSTRUCTOR (Translator, Performer);
-  friend class Performer_group_performer;  
-  Performer_group_performerget_daddy_performer () const;
+  friend class Performer_group_performer;
+  Performer_group_performer *get_daddy_performer () const;
 
 protected:
   virtual void announce_element (Audio_element_info);
   virtual void acknowledge_audio_element (Audio_element_info);
   virtual void create_audio_elements ();
   virtual int get_tempo () const;
-  virtual void play_element (Audio_element * elem );
+  virtual void play_element (Audio_element *elem);
 };
 
-
 #endif /* PERFORMER_HH */
 
index 0b621c3c5cd6b40272b0845e2ffd349dea5c056d..9a762d370d02456862c70762b14c17b45fdb84bc 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   pitch-interval.hh -- declare Pitch_interval
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #ifndef PITCH_INTERVAL_HH
 
 #include "pitch.hh"
 
-class Pitch_interval : public Drul_array<Pitch> 
+class Pitch_interval : public Drul_array<Pitch>
 {
 public:
-  Pitch_interval();
-  Pitch_interval(Pitch, Pitch);
+  Pitch_interval ();
+  Pitch_interval (Pitch, Pitch);
   void add_point (Pitch);
   bool is_empty () const;
 };
index 8be2dc3404db55d531e44101c48c97bedc83d056..6c36392a9df1218b93a16e1cefb36481e439361d 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   pitch.hh -- declare Pitch
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef MUSICAL_PITCH_HH
 #define MUSICAL_PITCH_HH
 #include "smobs.hh"
 
 /** A "tonal" pitch. This is a pitch used in diatonal western music
-   (24 quartertones in an octave), as opposed to a frequency in Hz or a
-   integer number of semitones.
+    (24 quartertones in an octave), as opposed to a frequency in Hz or a
+    integer number of semitones.
 
-  Pitch is lexicographically ordered by (octave, notename,
-    alteration).    
-  
+    Pitch is lexicographically ordered by (octave, notename,
+    alteration).
 
-   TODO:
 
-   - add indeterminate octaves, so it can be used as a key in keySigature
+    TODO:
 
+    - add indeterminate octaves, so it can be used as a key in keySigature
 */
 class Pitch
 {
 private:                               // fixme
   /*
     TODO: use SCM
-   */
+  */
 
   int notename_;
   int alteration_;
   int octave_;
+
   void transpose (Pitch);
   void up_to (int);
   void down_to (int);
   void normalise ();
 
 public:
-  
+
   int get_octave () const;
   int get_notename () const;
   int get_alteration () const;
@@ -54,39 +52,39 @@ public:
   Pitch transposed (Pitch) const;
   Pitch to_relative_octave (Pitch) const;
 
-  static int compare (Pitch const&, Pitch const&);
+  static int compare (Pitch const &, Pitch const &);
 
   int steps () const;
-  int semitone_pitch () const; 
-  int quartertone_pitch () const; 
+  int semitone_pitch () const;
+  int quartertone_pitch () const;
   String to_string () const;
 
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
-  DECLARE_SIMPLE_SMOBS (Pitch, );
-};
-
-enum {
-  DOUBLE_FLAT = -4,
-  THREE_Q_FLAT,
-  FLAT ,
-  SEMI_FLAT,
-  NATURAL,
-  SEMI_SHARP,
-  SHARP ,
-  THREE_Q_SHARP,
-  DOUBLE_SHARP,
+  DECLARE_SIMPLE_SMOBS (Pitch,);
 };
 
-SCM ly_pitch_diff (SCM pitch, SCM  root);
+enum
+  {
+    DOUBLE_FLAT = -4,
+    THREE_Q_FLAT,
+    FLAT,
+    SEMI_FLAT,
+    NATURAL,
+    SEMI_SHARP,
+    SHARP,
+    THREE_Q_SHARP,
+    DOUBLE_SHARP,
+  };
+
+SCM ly_pitch_diff (SCM pitch, SCM root);
 SCM ly_pitch_transpose (SCM p, SCM delta);
-DECLARE_UNSMOB(Pitch, pitch);
+DECLARE_UNSMOB (Pitch, pitch);
 
 INSTANTIATE_COMPARE (Pitch, Pitch::compare);
 
 int compare (Array<Pitch>*, Array<Pitch>*);
 extern SCM pitch_less_proc;
-Pitch pitch_interval (Pitch const & from , Pitch const & to );
+Pitch pitch_interval (Pitch const &from, Pitch const &to);
 
 #endif /* MUSICAL_PITCH_HH */
 
-
index ecd7eb3c40673a272d4c45383ec1760b9060eaae..81c480422956b774dc8e23f754a810b767191b08 100644 (file)
@@ -6,39 +6,34 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef PROPERTY_ITERATOR_HH
 #define PROPERTY_ITERATOR_HH
 
 #include "simple-music-iterator.hh"
 
 
-
-
 /**
-  Iterate a property.  
- */
+   Iterate a property.
+*/
 class Property_iterator : public Simple_music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
-  DECLARE_SCHEME_CALLBACK(once_finalization, (SCM, SCM ));
+  DECLARE_SCHEME_CALLBACK (constructor, ());
+  DECLARE_SCHEME_CALLBACK (once_finalization, (SCM, SCM));
 
 protected:
-  virtual void do_quit();
+  virtual void do_quit ();
   virtual void process (Moment);
 };
 
 
-
-
 /**
-  Iterate a property.  
- */
+   Iterate a property.
+*/
 class Property_unset_iterator : public Simple_music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 protected:
   virtual void process (Moment);
 };
@@ -46,20 +41,19 @@ protected:
 class Push_property_iterator : public Simple_music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());  
-  DECLARE_SCHEME_CALLBACK(once_finalization, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (constructor, ());
+  DECLARE_SCHEME_CALLBACK (once_finalization, (SCM, SCM));
 protected:
   virtual void process (Moment);
-  virtual void do_quit();
+  virtual void do_quit ();
 };
 
 class Pop_property_iterator : public Simple_music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 protected:
   virtual void process (Moment);
 };
 
-
 #endif // PROPERTY_ITERATOR_HH
index 81ff41f1da4768a8c5c7b9e94e492565cb65ecd8..0bb88dd2376d539c23076c0533aee3701aefc8ab 100644 (file)
@@ -1,21 +1,19 @@
-/*   
+/*
   protected-scm.hh -- declare Protected_scm
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef PROTECTED_SCM_HH
 #define PROTECTED_SCM_HH
 
-
 #include "lily-guile.hh"
 
 /*
-  Mix GUILE GC with C++ ctors and dtors. 
- */
+  Mix GUILE GC with C++ ctors and dtors.
+*/
 class Protected_scm
 {
   SCM object_;
@@ -24,8 +22,8 @@ public:
   Protected_scm (SCM);
   Protected_scm (Protected_scm const &);
   ~Protected_scm ();
-  Protected_scm &operator = (SCM);
-  Protected_scm &operator = ( Protected_scm const&);
+  Protected_scm &operator= (SCM);
+  Protected_scm &operator= (Protected_scm const &);
   operator SCM () const;
   SCM to_SCM () const;
 };
index ce702fa2af0da2aba67af49b3395f5c1f4b4c8b7..d62042f0e4f1416ce15b87c2d99b0611bb376936 100644 (file)
@@ -1,18 +1,16 @@
-/*   
+/*
   repeated-music.hh -- declare Repeated_music
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef REPEATED_MUSIC_HH
 #define REPEATED_MUSIC_HH
 
 #include "music.hh"
 
-
 /**
    Musical repeats.
 
    There are three modes of representing this  music:
 
    BODY A
-        B
-       C
+   B
+   C
 
    is called "folded". Mostly used for lyrics.
 
-   
+
    BODY A B C
 
    is called volta.  This is common notation
 
    If the number of repeats is bigger than the number of alternatives, then
    the first alternative is assumed to be repeated.
-   
 */
 class Repeated_music
 {
 public:
-  static Music *body (Music*);
-  static SCM alternatives (Music*);
+  static Music *body (Music *);
+  static SCM alternatives (Music *);
 
   /* How often do we repeat? */
-  static int repeat_count (Music*);
-  DECLARE_SCHEME_CALLBACK(relative_callback, (SCM, SCM));
+  static int repeat_count (Music *);
+  DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
 
-  static Moment body_get_length (Music*);
+  static Moment body_get_length (Music *);
   static Moment alternatives_get_length (Music *, bool fold);
-  static Moment alternatives_volta_get_length (Music *);  
+  static Moment alternatives_volta_get_length (Music *);
 
   DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM));
   DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM));
-  DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM));    
+  DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM));
   DECLARE_SCHEME_CALLBACK (minimum_start, (SCM));
-  DECLARE_SCHEME_CALLBACK (first_start, (SCM));    
+  DECLARE_SCHEME_CALLBACK (first_start, (SCM));
 };
 
-
 #endif /* REPEATED_MUSIC_HH */
index a54a526a7701e5fbd73c1f4729737cf9921bc9c1..a0897dff64b48bead63f87bdadd0035e528f7582 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef REST_COLLISION_HH
 #define REST_COLLISION_HH
 
 #include "lily-guile.hh"
 
 
-
-
 class Rest_collision
 {
 public:
-  static void add_column (Grob*me, Grob*);
-  
-  static bool has_interface (Grob*);
+  static void add_column (Grob *me, Grob *);
+
+  static bool has_interface (Grob *);
   DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (force_shift_callback_rest, (SCM element, SCM axis));
-  static SCM do_shift (Grob*);
+  static SCM do_shift (Grob *);
 };
 #endif // REST_COLLISION_HH
index 9513d8c82ad0fa4fd25fb9ff73b2a083e65ef93a..22be2d4b5b7c53628a8932c5748e3b8f38d0dd64 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef REST_HH
 #define REST_HH
 
 
 class Grob;
 
-class  Rest
+class Rest
 {
 public:
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-  static bool has_interface (Grob*);
-  static String glyph_name (Grob*, int, String, bool); 
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  static bool has_interface (Grob *);
+  static String glyph_name (Grob *, int, String, bool);
   static SCM brew_internal_stencil (SCM, bool);
   DECLARE_SCHEME_CALLBACK (extent_callback, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (polyphonic_offset_callback, (SCM, SCM));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
 };
 #endif // REST_HH
index 12cbf575a0ec10fea73afe463c0d0f0ac00f89c8..10b69b3ef95417e7f32e2fa9e3166c9f141a488b 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef RHYTHMIC_HEAD_HH
 #define RHYTHMIC_HEAD_HH
 
 class Rhythmic_head
 {
 public:
-  static int duration_log (Grob*);
-  static void set_dots (Grob*, Item *);
-  static Item * get_stem (Grob*) ;
-  static Item * get_dots (Grob*) ;
-  static int dot_count (Grob*) ;
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-  static bool has_interface (Grob*);
-  
+  static int duration_log (Grob *);
+  static void set_dots (Grob *, Item *);
+  static Item *get_stem (Grob *);
+  static Item *get_dots (Grob *);
+  static int dot_count (Grob *);
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  static bool has_interface (Grob *);
+
 };
 
 #endif // RHYTHMIC_HEAD_HH
index d334db2a37ae91a806a3f66fdc3387096396d1ba..4916f1e4447edb0d11828d6905b075b2e4a92943 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   rod.hh -- declare Rod, Column_rod
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef ROD_HH
 #define ROD_HH
 
 struct Rod
 {
-  Drul_array <Item*> item_drul_;
+  Drul_array<Item *> item_drul_;
   Real distance_;
 
   /**
-    translate the rod so as to refer to Paper_columns  
-   */
+     translate the rod so as to refer to Paper_columns
+  */
   void columnize ();
-  
+
   void add_to_cols ();
 
   Rod ();
index f3134127faca6bf5f4b86afa608b862439248105..8dd635f67dbe78a54a88c178ed98a6174808d495 100644 (file)
@@ -1,43 +1,39 @@
-/*   
+/*
   scm-hash.hh -- declare Scheme hasher.
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SCM_HASH_HH
 #define SCM_HASH_HH
 
-
 #include "smobs.hh"
 
-
 /**
-   auto resizing hash table. 
+   auto resizing hash table.
 
    1. ALWAYS USE THIS AS VIA A POINTER, i.e.
 
    class Foo {
-    Scheme_hash_table * tab;
+   Scheme_hash_table * tab;
    };
 
    and NOT
 
    class Foo {
-    Scheme_hash_table tab;
+   Scheme_hash_table tab;
    }
 
 
    2. UPON DESTRUCTION, DO
 
    scm_gc_unprotect_object (tab->self_scm_);
-
- */
+*/
 
 class Scheme_hash_table
-{  
+{
 public:
   bool try_retrieve (SCM key, SCM *val);
   bool contains (SCM key) const;
@@ -46,10 +42,10 @@ public:
      WARNING: putting something in assumes responsibility for cleaning
      up.  */
   void set (SCM k, SCM v);
-  SCM get (SCM k) const; 
+  SCM get (SCM k) const;
   void remove (SCM k);
   Scheme_hash_table ();
-  void operator = (Scheme_hash_table const &); 
+  void operator= (Scheme_hash_table const &);
   Scheme_hash_table (Scheme_hash_table const &);
 
   SCM to_alist () const;
@@ -57,10 +53,9 @@ public:
 private:
   SCM hash_tab_;
   unsigned elt_count_;
-  
+
   DECLARE_SMOBS (Scheme_hash_table, foo);
 };
 
-
 #endif /* SCM_HASH_HH */
 
index 6fc57aa690051f79e68f64858d63e4ad3d88b018..f22038a841a26425f8a5849a2882efc91c6b7089 100644 (file)
@@ -1,8 +1,8 @@
 /*
   score-context.hh -- declare Score_context
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 #ifndef SCORE_CONTEXT_HH
 
 class Score_context : public Context
 {
- public:
-  Score_context (Object_key const*);
-  
-  virtual Music_output *get_output ();     
+public:
+  Score_context (Object_key const *);
+
+  virtual Music_output *get_output ();
   virtual void prepare (Moment);
   virtual void finish ();
   virtual void one_time_step ();
index 0f8deada9c338a574b37d75b323ad86f7c1eccbd..a790b5f967e863c93b194ae27c5a43ccf727bb64 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef SCORE_ENGRAVER_HH
 #define SCORE_ENGRAVER_HH
 
@@ -18,33 +17,33 @@ class Score_engraver : public virtual Score_translator,
 {
   System *system_;
   int breaks_;                 // used for stat printing
-  
+
   Link_array<Grob> elems_;
-  Paper_columncommand_column_;
-  Paper_columnmusical_column_;
-  Paper_score * pscore_;
+  Paper_column *command_column_;
+  Paper_column *musical_column_;
+  Paper_score *pscore_;
 
   void make_columns ();
-  void set_columns (Paper_column*, Paper_column*);
+  void set_columns (Paper_column *, Paper_column *);
   void typeset_all ();
 protected:
   /* Score_translator */
   virtual void finish ();
   virtual void prepare (Moment);
   virtual void one_time_step ();
-  
+
   /* Engraver_group_engraver interface */
   virtual void acknowledge_grob (Grob_info);
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void initialize ();
   virtual void finalize ();
   virtual void announce_grob (Grob_info);
   virtual void stop_translation_timestep ();
 
 public:
-  TRANSLATOR_DECLARATIONS(Score_engraver);
+  TRANSLATOR_DECLARATIONS (Score_engraver);
   void forbid_breaks ();
-  virtual Music_output *get_output ();  
+  virtual Music_output *get_output ();
 };
 
 #endif /* SCORE_ENGRAVER_HH */
index 9b4303e5c2ed3a79c3ef3fb68cedb0d09e90a249..9c36525db8d2aab79c8f47be8c654fe05ad045bb 100644 (file)
@@ -2,8 +2,8 @@
   score-performer.hh -- declare Score_performer
 
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #ifndef SCORE_PERFORMER_HH
 #define SCORE_PERFORMER_HH
 #include "score-translator.hh"
 
 /**
-  Top level performer. Completely takes care of MIDI output
- */
+   Top level performer. Completely takes care of MIDI output
+*/
 class Score_performer : public Score_translator, public virtual Performer_group_performer
 {
 public:
-  TRANSLATOR_DECLARATIONS(Score_performer);
+  TRANSLATOR_DECLARATIONS (Score_performer);
   ~Score_performer ();
   Performance *performance_;
-  
+
 protected:
   virtual void prepare (Moment mom);
   virtual void finish ();
@@ -28,12 +28,12 @@ protected:
   virtual void initialize ();
   virtual void announce_element (Audio_element_info);
   virtual int get_tempo () const;
-  virtual void play_element (Audio_elementp);
+  virtual void play_element (Audio_element *p);
   virtual Music_output *get_output ();
 private:
-  void header (Midi_stream&);
+  void header (Midi_stream &);
 
-  Audio_columnaudio_column_;
+  Audio_column *audio_column_;
 };
 
 #endif // SCORE_PERFORMER_HH
index 39823bf13d1e4c1e37649b3cf8c22c3ef5131ebe..532ef943483253caa9cadc1219503a6f79a514bd 100644 (file)
@@ -1,28 +1,25 @@
-/*   
+/*
   score-translator.hh -- declare Score_translator
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #ifndef SCORE_TRANSLATOR_HH
 #define SCORE_TRANSLATOR_HH
 
-#include "translator-group.hh" 
+#include "translator-group.hh"
 
-class Score_translator : public virtual Translator_group 
+class Score_translator : public virtual Translator_group
 {
   friend class Score_context;
- protected:
-  virtual Music_outputget_output ();
+protected:
+  virtual Music_output *get_output ();
   virtual void prepare (Moment);
   virtual void finish ();
   virtual void one_time_step ();
 };
 
-
 #endif /* SCORE_TRANSLATOR_HH */
 
-
index bb879e9841dd7c6b4dc885f24643100889ebb9e7..f1c42fb1a6a7bc9041c0ca919ee27e27417c4e52 100644 (file)
@@ -29,13 +29,13 @@ public:
   SCM header_;
   SCM texts_;
   bool error_found_;
-  
+
   Score ();
-  Score (Score const&);
+  Score (Score const &);
 
   SCM get_music () const;
   void set_music (SCM music, SCM parser);
-  SCM book_rendering (String, Output_def*, Output_def*, Object_key*);
+  SCM book_rendering (String, Output_def *, Output_def *, Object_key *);
 };
 
 DECLARE_UNSMOB (Score, score);
index 0d8417fb8d7ef878830a3a237901968943c1ad7f..0bbb6625663f81dbad05a4def57dde9ffebfabe3 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   g-script-column.hh -- declare Script_column
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef Script_COLUMN_HH
 #define Script_COLUMN_HH
 class Script_column
 {
 public:
-  static void add_staff_sided (Grob*, Item*);
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
-    static bool has_interface (Grob*);
+  static void add_staff_sided (Grob *, Item *);
+  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+  static bool has_interface (Grob *);
 
 };
 
-
 #endif /* Script_COLUMN_HH */
 
-
index 4f2defdb23f406d2b50f207e8c86e3a3d1153334..74efaaf06c998f484755b7ef898f41375adfaeed 100644 (file)
@@ -1,5 +1,5 @@
-/*   
-  script-interface.hh -- 
+/*
+  script-interface.hh --
 
   source file of the GNU LilyPond music typesetter
 
@@ -22,7 +22,7 @@ class Script_interface
 public:
   static Stencil get_stencil (Grob *, Direction d);
   static bool has_interface (Grob *);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
 };
 
index 6f3d63de9c6034cea8e9411cf394eeef970c854c..aa47c7af76b692735bc998a5941262a2ada6b04f 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   side-position-interface.hh -- declare Side_position_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SELF_ALIGNMENT_INTERFACE_HH
 #define SELF_ALIGNMENT_INTERFACE_HH
@@ -14,7 +13,7 @@
 
 struct Self_alignment_interface
 {
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
   DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (aligned_on_parent, (SCM element, SCM axis));
index 40c14892188b9a622a022f0387bc7b3b5de85ea2..8a082b8f4ed7707db15aea2b0ce2c85288000abc 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   separating-group-spanner.hh -- declare Separating_group_spanner
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SEPARATING_GROUP_SPANNER_HH
 #define SEPARATING_GROUP_SPANNER_HH
 
 class Separating_group_spanner
 {
-  static void find_rods (Item*, SCM, Real);
+  static void find_rods (Item *, SCM, Real);
 public:
-  static void add_spacing_unit (Grob*me, Item*);
-  
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+  static void add_spacing_unit (Grob *me, Item *);
+
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
 };
 
 #endif /* SEPARATING_GROUP_SPANNER_HH */
index 5573e133688a5a3017ac873a97096356d8d73f7b..882bf5d9346e9aafcb617ffa26c5321e0a365968 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   single-malt-grouping-item.hh -- declare Separation_item
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SINGLE_MALT_GROUPING_ITEM_HH
 #define SINGLE_MALT_GROUPING_ITEM_HH
 
 struct Separation_item
 {
-  static bool has_interface (Grob*);
-  static Interval conditional_width (Grob*, Grob*) ;
-  static Interval width (Grob*) ;
-  static Interval relative_width (Grob*, Grob*) ;
-  static Grob*extremal_break_aligned_grob (Grob*, Direction, Interval*);
-  static void add_item (Grob*, Item*);
-  static void add_conditional_item (Grob*, Grob*);  
+  static bool has_interface (Grob *);
+  static Interval conditional_width (Grob *, Grob *);
+  static Interval width (Grob *);
+  static Interval relative_width (Grob *, Grob *);
+  static Grob *extremal_break_aligned_grob (Grob *, Direction, Interval *);
+  static void add_item (Grob *, Item *);
+  static void add_conditional_item (Grob *, Grob *);
 };
 
 #endif /* SINGLE_MALT_GROUPING_ITEM_HH */
index aceb9259360b3419714eae2e92aaaa0464784619..b1e6d45c2931b7b4061a77b44ac34e5530f49092 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   sequential-iterator.hh -- declare Sequential_iterator
 
   source file of the GNU LilyPond music typesetter
 #include "music-iterator.hh"
 #include "protected-scm.hh"
 
-
 /** Sequential_music iteration: walk each element in turn, and
-  construct an iterator for every element.
-  
- */
-class Sequential_iterator :  public Music_iterator
+    construct an iterator for every element.
+*/
+class Sequential_iterator : public Music_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Sequential_iterator ();
-  Sequential_iterator (Sequential_iterator const&);
-  virtual void derived_substitute (Context *f, Context *t) ;
+  Sequential_iterator (Sequential_iterator const &);
+  virtual void derived_substitute (Context *f, Context *t);
 
   virtual void derived_mark () const;
 
   virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit(); 
+  virtual void do_quit ();
   virtual bool ok () const;
 
 protected:
@@ -37,20 +35,19 @@ protected:
   virtual Music_iterator *try_music_in_children (Music *) const;
   virtual bool run_always () const;
 protected:
-  Music_iterator * iter_;
+  Music_iterator *iter_;
   virtual SCM get_music_list ()const;
   virtual void next_element (bool side_effect);
 
-
   Grace_fixup *get_grace_fixup () const;
   void next_grace_fixup ();
-  
+
 private:
   Moment last_mom_;
   Moment here_mom_;
   SCM cursor_;
-  Grace_fixup * grace_fixups_;
-  
+  Grace_fixup *grace_fixups_;
+
 };
 
 #endif /* SEQUENTIAL_ITERATOR_HH */
index c84b24906c15d80f8eb4ca7be30e008f06032163..f43c5a6a59868ef30be2d7f3f8c37fc269171fb5 100644 (file)
 #include "sequential-iterator.hh"
 
 /** Sequential_music iteration: walk each element in turn, and
-  construct an iterator for every element.
-  
- */
-class Sequential_music_iterator :  public Sequential_iterator
+    construct an iterator for every element.
+*/
+class Sequential_music_iterator : public Sequential_iterator
 {
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ());
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 private:
-  virtual SCM get_music_list()const;
+  virtual SCM get_music_list ()const;
 };
 
 #endif // SEQUENTIAL_MUSIC_ITERATOR_HH
index 5bf8c02f82dc1e84c5a5901d61f02da9aa620eea..ff16b0c386c97004cd1d902258bf2d259bc43873 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   side-position-interface.hh -- declare Side_position_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SIDE_POSITION_INTERFACE_HH
 #define SIDE_POSITION_INTERFACE_HH
@@ -23,21 +22,19 @@ struct Side_position_interface
 public:
   DECLARE_SCHEME_CALLBACK (aligned_on_support_extents, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (aligned_on_support_refpoints, (SCM element, SCM axis));
-  
-  DECLARE_SCHEME_CALLBACK (aligned_side, (SCM element, SCM axis));  
+
+  DECLARE_SCHEME_CALLBACK (aligned_side, (SCM element, SCM axis));
 
   DECLARE_SCHEME_CALLBACK (quantised_position, (SCM element, SCM axis));
 
-  static SCM general_side_position (Grob*, Axis, bool);
-  static Axis get_axis (Grob*) ;
-  static void set_axis (Grob*,  Axis) ;
-  static bool has_interface (Grob*) ;
-  static void add_support (Grob*, Grob*);
-  static void add_staff_support (Grob*);
-  static Direction get_direction (Grob*);
+  static SCM general_side_position (Grob *, Axis, bool);
+  static Axis get_axis (Grob *);
+  static void set_axis (Grob *, Axis);
+  static bool has_interface (Grob *);
+  static void add_support (Grob *, Grob *);
+  static void add_staff_support (Grob *);
+  static Direction get_direction (Grob *);
 };
 
-
-
 #endif /* SIDE_POSITION_INTERFACE_HH */
 
index 92d275bb37b6a8d8b3b1ef7d927bbb3ff3d0ff7b..29710cfa860dde094fa1574acaa3c7495180dee2 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   simple-music-iterator.hh -- declare Simple_music_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #ifndef SIMPLE_MUSIC_ITERATOR_HH
 #define SIMPLE_MUSIC_ITERATOR_HH
 /*
   Iterator for atomic music objects: events are generated at the
   beginning and at the end of the music.
-  
- */
+*/
 class Simple_music_iterator : public Music_iterator
 {
 protected:
 
   Moment last_processed_mom_;
 public:
-  DECLARE_SCHEME_CALLBACK(constructor, ()); 
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   Simple_music_iterator ();
   virtual void process (Moment);
   virtual bool ok ()const;
index 55795dc71597ff2afdc482e1cba60190d0f9ebb7..9ffdc175fa5a18853ab458e45ee1106eabfdbc28 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   simple-spacer.hh -- declare Simple_spacer
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SIMPLE_SPACER_HH
 #define SIMPLE_SPACER_HH
@@ -38,8 +37,7 @@ public:
   int active_count_;
 
   Simple_spacer ();
-  
-  
+
   void my_solve_linelen ();
   void my_solve_natural_len ();
   Real active_springs_stiffness () const;
@@ -52,10 +50,9 @@ public:
   void set_active_states ();
   bool is_active () const;
 
-  DECLARE_SIMPLE_SMOBS(Simple_spacer, );
+  DECLARE_SIMPLE_SMOBS (Simple_spacer,);
 };
 
-
 struct Simple_spacer_wrapper
 {
   Simple_spacer *spacer_;
@@ -65,9 +62,9 @@ struct Simple_spacer_wrapper
   Simple_spacer_wrapper ();
   void add_columns (Link_array<Grob> const &);
   void solve (Column_x_positions *, bool);
-  ~Simple_spacer_wrapper();
+  ~Simple_spacer_wrapper ();
 private:
-  Simple_spacer_wrapper(Simple_spacer_wrapper const&);
+  Simple_spacer_wrapper (Simple_spacer_wrapper const &);
 };
 
 #endif /* SIMPLE_SPACER_HH */
index f1b70b6da6c06c8c4b436b76ddf42f1eec370b6f..7e8118bc52319519000083d43bf5b7f76cb9b25d 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef SIMULTANEOUS_MUSIC_ITERATOR_HH
 #define SIMULTANEOUS_MUSIC_ITERATOR_HH
 
@@ -16,20 +15,20 @@ class Simultaneous_music_iterator : public Music_iterator
 {
 public:
   Simultaneous_music_iterator ();
-  Simultaneous_music_iterator (Simultaneous_music_iterator const&);
-  virtual void derived_substitute (Context *f, Context *t) ;
+  Simultaneous_music_iterator (Simultaneous_music_iterator const &);
+  virtual void derived_substitute (Context *f, Context *t);
   virtual void derived_mark () const;
-  DECLARE_SCHEME_CALLBACK(constructor, ());
-  
+  DECLARE_SCHEME_CALLBACK (constructor, ());
+
   /// make a new context for every child.
   bool create_separate_contexts_;
 
   virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit(); 
+  virtual void do_quit ();
   virtual bool ok () const;
   virtual bool run_always () const;
-  
+
 protected:
   virtual void process (Moment);
   virtual Music_iterator *try_music_in_children (Music *) const;
index c8077e3cd11783ae47ebc9c6a15ee4302bfa977e..458a2f7cb09ae2b16152f53e931776b75231fcfe 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   skyline.hh -- declare Skyline_entry and funcbs.
 
   source file of the GNU LilyPond music typesetter
@@ -16,25 +16,22 @@ struct Skyline_entry
 {
   Interval width_;
   Real height_;
-  Skyline_entry();
+  Skyline_entry ();
   Skyline_entry (Interval, Real);
 };
 
-
-
 void
-merge_skyline (Array<Skyline_entry> *a1, Array<Skyline_entry> const  & a2,
+merge_skyline (Array<Skyline_entry> *a1, Array<Skyline_entry> const &a2,
               Direction);
 void insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
                                 Direction d);
 Array<Skyline_entry>
-extents_to_skyline (Array<Box> const & extents, Axis a, Direction d);
+extents_to_skyline (Array<Box> const &extents, Axis a, Direction d);
 Array<Skyline_entry> empty_skyline (Direction d);
 void heighten_skyline (Array<Skyline_entry> *buildings, Real ground);
 Real
 skyline_meshing_distance (Array<Skyline_entry> const &buildings,
                          Array<Skyline_entry> const &clouds);
 
-
 #endif /* SKYLINE_HH */
 
index 23f9cd558684c92660f4eb55c942133bcd0f12b6..81854868bb36ffe49a4503b887faeabd88949810 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   slur-configuration.hh -- declare Slur_configuration
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #ifndef SLUR_CONFIGURATION_HH
@@ -21,9 +20,9 @@ public:
   Real score_;
   Bezier curve_;
   Real height_;
-  
+
   int index_;
-  
+
 #if DEBUG_SLUR_SCORING
   String score_card_;
 #endif
@@ -31,12 +30,12 @@ public:
   Slur_configuration ();
 
   void generate_curve (Slur_score_state const &state, Real r0, Real h_inf);
-  void score (Slur_score_state const&);
+  void score (Slur_score_state const &);
 protected:
-  void score_extra_encompass (Slur_score_state const&);
-  void score_slopes  (Slur_score_state const&);
-  void score_edges (Slur_score_state const&);
-  void score_encompass (Slur_score_state const&);
+  void score_extra_encompass (Slur_score_state const &);
+  void score_slopes (Slur_score_state const &);
+  void score_edges (Slur_score_state const &);
+  void score_encompass (Slur_score_state const &);
 };
 
 #endif /* SLUR_CONFIGURATION_HH */
index ca0f114282b81893468094e813d0ca7bbe63a025..5b4634115eaab57b05ec54fa172dd4cf1e99e6c3 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   slur-scoring.hh -- declare Slur_score_parameters
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #ifndef SLUR_SCORING_HH
@@ -40,14 +39,12 @@ struct Slur_score_parameters
   void fill (Grob *him);
 };
 
-
-
 struct Extra_collision_info
 {
   Real idx_;
   Box extents_;
   Real penalty_;
-  Grob * grob_;
+  Grob *grob_;
 
   Extra_collision_info (Grob *g, Real idx, Interval x, Interval y, Real p)
   {
@@ -65,7 +62,6 @@ struct Extra_collision_info
   }
 };
 
-
 struct Encompass_info
 {
   Real x_;
@@ -116,12 +112,12 @@ struct Slur_score_state
   bool edge_has_beams_;
   bool is_broken_;
   bool has_same_beam_;
-  
+
   Real musical_dy_;
   Link_array<Grob> columns_;
   Array<Encompass_info> encompass_infos_;
   Array<Extra_collision_info> extra_encompass_infos_;
-  
+
   Direction dir_;
   Slur_score_parameters parameters_;
   Drul_array<Bound_info> extremes_;
@@ -129,26 +125,25 @@ struct Slur_score_state
   Link_array<Slur_configuration> configurations_;
   Real staff_space_;
   Real thickness_;
-  
-  Slur_score_state();
-  ~Slur_score_state();
+
+  Slur_score_state ();
+  ~Slur_score_state ();
 
   Bezier get_best_curve ();
-  void fill (Grob*);
+  void fill (Grob *);
   void set_next_direction ();
-  
+
   Drul_array<Bound_info> get_bound_info () const;
-  void generate_curves () const; 
+  void generate_curves () const;
   Link_array<Slur_configuration> enumerate_attachments (Drul_array<Real> end_ys) const;
-  Drul_array<Offset> get_base_attachments() const;
-  Drul_array<Real> get_y_attachment_range() const;
+  Drul_array<Offset> get_base_attachments () const;
+  Drul_array<Real> get_y_attachment_range () const;
   Encompass_info get_encompass_info (Grob *col) const;
   Array<Extra_collision_info> get_extra_encompass_infos () const;
   Real move_away_from_staffline (Real y, Grob *on_staff) const;
   int get_closest_index (SCM inspect_quants) const;
 };
 
-
 void set_slur_control_points (Grob *me);
 
 #endif /* SLUR_SCORING_HH */
index 242251c1b82432997d9876409f6b963788ea8cc7..6fe85ccd0dcdd74bb29f1c9594a8ef00bd36e609 100644 (file)
@@ -1,8 +1,8 @@
 /*
   slur.hh -- declare Slur
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
@@ -22,7 +22,7 @@ public:
   DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
   static bool has_interface (Grob *);
-  static Bezier get_curve (Grob*me);
+  static Bezier get_curve (Grob *me);
 };
 
 #endif /* SLUR_HH */
index b091bc3800b3a95dcd07deb6d30ab93656ad1386..c563f6df19aff2121c26c75c3f0b9fe36d7791be 100644 (file)
@@ -1,18 +1,16 @@
-/*   
+/*
   smobs.hh -- declare smob related stuff.
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SMOBS_HH
 #define SMOBS_HH
 
 #include "lily-guile.hh"
 
-
 /*
   Smobs are GUILEs mechanism of exporting C(++) objects to the Scheme
   world.  They are documented in the GUILE manual.
   There are two types of smob objects.
 
   1. Simple smobs are intended for simple objects like numbers:
-   immutable objects that can be copied without change of meaning.
+  immutable objects that can be copied without change of meaning.
 
-   To obtain an SCM version of a simple smob, use the member function
-   SCM smobbed_copy ().
+  To obtain an SCM version of a simple smob, use the member function
+  SCM smobbed_copy ().
 
-   Simple smobs are created by adding the
-   DECLARE_SIMPLE_SMOBS(Classname, ) to the declaration
+  Simple smobs are created by adding the
+  DECLARE_SIMPLE_SMOBS(Classname, ) to the declaration
 
   2. Complex smobs are objects that have an identity. These objects
-   carry this identity in the form of a self_scm () method, which is a
-   SCM pointer to the object itself.
+  carry this identity in the form of a self_scm () method, which is a
+  SCM pointer to the object itself.
+
+  The constructor for a complex smob should have 3 steps:
+
+  * initialize all SCM members to a non-immediate value (like SCM_EOL)
+
+  * call smobify_self ()
+
+  * initialize SCM members
 
-   The constructor for a complex smob should have 3 steps:
+  For example,
 
-   * initialize all SCM members to a non-immediate value (like SCM_EOL)
+  Complex_smob::Complex_smob () {
+  scm_member_ = SCM_EOL;
+  smobify_self ();
+  scm_member_ = <..what you want to store..>
+  }
 
-   * call smobify_self ()
+  after construction, the self_scm () field of a complex smob is
+  protected from Garbage Collection.  This protection should be
+  removed once the object is put into another (reachable) Scheme data
+  structure, i.e.
 
-   * initialize SCM members
+  Complex_smob *p = new Complex_smob;
+  list = scm_cons (p->self_scm (), list);
+  scm_gc_unprotect_object (p->self_scm ());
 
-   For example,
+  Complex smobs are made with DECLARE_SMOBS (Classname, ) in the class
+  declaration.
 
-     Complex_smob::Complex_smob () {
-       scm_member_ = SCM_EOL;
-       smobify_self ();
-       scm_member_ = <..what you want to store..>
-     }
-   
-   after construction, the self_scm () field of a complex smob is
-   protected from Garbage Collection.  This protection should be
-   removed once the object is put into another (reachable) Scheme data
-   structure, i.e.
+  CALLING INTERFACE
 
-      Complex_smob *p = new Complex_smob;
-      list = scm_cons (p->self_scm (), list);
-      scm_gc_unprotect_object (p->self_scm ());
+  Common public methods to C++ smob objects:
 
-   Complex smobs are made with DECLARE_SMOBS (Classname, ) in the class
-   declaration.
+  unsmob (SCM x)  - unpacks X and returns pointer to the C++ object, or 0
+  if it has the wrong type.
 
-   CALLING INTERFACE
-   
-   Common public methods to C++ smob objects:
+  SCM equal_p (SCM a, SCM b) - compare A and B. Returns a Scheme boolean
 
-   unsmob (SCM x)  - unpacks X and returns pointer to the C++ object, or 0
-     if it has the wrong type.
 
-   SCM equal_p (SCM a, SCM b) - compare A and B. Returns a Scheme boolean
+  IMPLEMENTATION
 
-   
-   IMPLEMENTATION
-   
-   For implementating a class, the following should be provided
+  For implementating a class, the following should be provided
 
-   - an equal_p () function (a default is in the
-     IMPLEMENT_DEFAULT_EQUAL_P macro in ly-smobs.icc)
+  - an equal_p () function (a default is in the
+  IMPLEMENT_DEFAULT_EQUAL_P macro in ly-smobs.icc)
 
-   - mark_smob () function, that calls scm_gc_mark () on all Scheme
-     objects in the class
+  - mark_smob () function, that calls scm_gc_mark () on all Scheme
+  objects in the class
 
-   - a print_smob () function, that displays a representation for
-     debugging purposes
+  - a print_smob () function, that displays a representation for
+  debugging purposes
 
-   - A call to one of the IMPLEMENT_SMOBS or IMPLEMENT_SIMPLE_SMOBS macros
-     from file "ly-smobs.icc"
+  - A call to one of the IMPLEMENT_SMOBS or IMPLEMENT_SIMPLE_SMOBS macros
+  from file "ly-smobs.icc"
 */
 
-#define DECLARE_SIMPLE_SMOBS(CL, dummy) \
-public: \
-       SCM smobbed_copy () const; \
-DECLARE_BASE_SMOBS(CL)
-
-
-#define DECLARE_BASE_SMOBS(CL) \
-       friend class Non_existent_class; \
-private: \
-       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){\
-  if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_)          \
-    return (CL*) SCM_CELL_WORD_1 (s);                          \
-  else                                                         \
-    return 0;                                                  \
-}                                                              \
-       static SCM smob_p (SCM);\
-       static void init_smobs ();                              \
-private:
-
-
-#define DECLARE_SMOBS(CL, dummy)                                       \
-       DECLARE_BASE_SMOBS (CL) \
-protected:\
-       virtual ~CL ();\
-       SCM unprotected_smobify_self ();\
-private: \
-       void smobify_self ();                                   \
-       SCM self_scm_; \
-public: \
-       SCM self_scm () const { return self_scm_; } \
-private:
-
-#define DECLARE_UNSMOB(CL, name) \
-inline CL *                                            \
-unsmob_ ## name (SCM s)                        \
-{                                              \
-return  CL::unsmob (s);                                \
-}
+#define DECLARE_SIMPLE_SMOBS(CL, dummy)                \
+  public:                                      \
+  SCM smobbed_copy () const;                   \
+  DECLARE_BASE_SMOBS (CL)
+
+#define DECLARE_BASE_SMOBS(CL)                                 \
+  friend class Non_existent_class;                             \
+  private:                                                     \
+  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)                                    \
+  {                                                            \
+    if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_)                \
+      return (CL *) SCM_CELL_WORD_1 (s);                       \
+    else                                                       \
+      return 0;                                                        \
+  }                                                            \
+  static SCM smob_p (SCM);                                     \
+  static void init_smobs ();                                   \
+  private:
+
+#define DECLARE_SMOBS(CL, dummy)               \
+  DECLARE_BASE_SMOBS (CL)                      \
+    protected:                                 \
+  virtual ~CL ();                              \
+  SCM unprotected_smobify_self ();             \
+  private:                                     \
+  void smobify_self ();                                \
+  SCM self_scm_;                               \
+  public:                                      \
+  SCM self_scm () const { return self_scm_; }  \
+  private:
+
+#define DECLARE_UNSMOB(CL, name)               \
+  inline CL *                                  \
+  unsmob_ ## name (SCM s)                      \
+  {                                            \
+    return CL::unsmob (s);                     \
+  }
 
 #define DECLARE_TYPE_P(CL) extern SCM CL ## _type_p_proc
 
index 7f13b9b492e474127e7697148b31656b258dda09..759bb78425b5e22149d626aba5c489bcf1e8bae0 100644 (file)
@@ -1,8 +1,8 @@
-/*   
+/*
   source-file.hh -- declare Source_file
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "parray.hh"
 
 /**
-  class for reading and mapping a file. 
+   class for reading and mapping a file.
 
-  duplicates a lot of Data_file and Text_stream.
-  should look at including Data_file's functionality:
-  get_line (), get_word () here.
+   duplicates a lot of Data_file and Text_stream.
+   should look at including Data_file's functionality:
+   get_line (), get_word () here.
 */
 
 class Source_file
 {
 public:
   Source_file (String fn);
-  Source_file (String, String );
+  Source_file (String, String);
 
   virtual ~Source_file ();
 
-  char constto_str0 () const;
-  virtual String error_string (char const* pos_str0 ) const;
+  char const *to_str0 () const;
+  virtual String error_string (char const *pos_str0) const;
   std::istream * get_istream ();
-  bool contains (char const* pos_str0 ) const;
+  bool contains (char const *pos_str0) const;
   int length () const;
-  virtual int get_line (char const* pos_str0 ) const;
+  virtual int get_line (char const *pos_str0) const;
   String name_string () const;
-  String file_line_column_string (char const* str0 ) const;
+  String file_line_column_string (char const *str0) const;
 
   // return start + n
-  char constseek_str0 (int n);
+  char const *seek_str0 (int n);
 
   int tell () const;
   // return here + n bytes
-  char constforward_str0 (int n);
-  char constpos_str0 () { return pos_str0_; }
+  char const *forward_str0 (int n);
+  char const *pos_str0 () { return pos_str0_; }
   String get_string (int n);
-  void set_pos (char const * pos_str0);
+  void set_pos (char const *pos_str0);
 public:
-  Slice line_slice (char constpos_str0) const;
-  String line_string (char constpos_str0) const;
-  int get_column (char constpos_str0) const;
-  int get_char (char constpos_str0) const;
+  Slice line_slice (char const *pos_str0) const;
+  String line_string (char const *pos_str0) const;
+  int get_column (char const *pos_str0) const;
+  int get_char (char const *pos_str0) const;
 
   /*
     JUNKME.
 
     This thing doubles as a file-storage/file-iterator object.
-   */
-  char constpos_str0_;
+  */
+  char const *pos_str0_;
 
   SCM get_port () const { return str_port_; }
   String name_;
 
 private:
-  Link_array<char> newline_locations_; 
+  Link_array<char> newline_locations_;
   std::istream* istream_;
-  char  * contents_str0_;
+  char *contents_str0_;
   int length_;
   void load_stdin ();
   void init_port ();
-  
+
   Protected_scm str_port_;
 };
 
index 6420ca9165dd31d6aa2a4caed6c61192e7d39955..ffc1f0f83bc8775937be1c91e62a0595ec11bcf2 100644 (file)
@@ -10,9 +10,9 @@
 #include "flower-proto.hh"
 
 /*   A set of sourcefiles.  */
-class Sources 
+class Sources
 {
-  Sources (Sources const&) {}
+  Sources (Sources const &) {}
   Cons<Source_file> *sourcefile_list_;
   bool is_binary_;
 
@@ -20,15 +20,13 @@ public:
   Sources ();
   ~Sources ();
 
-  Source_file *get_file (String &file_name );
-  Source_file *get_sourcefile (char const*);
-  void add (Source_file* sourcefile );
-  void set_path (File_path*);
+  Source_file *get_file (String &file_name);
+  Source_file *get_sourcefile (char const *);
+  void add (Source_file *sourcefile);
+  void set_path (File_path *);
   void set_binary (bool);
 
   const File_path *path_;
 };
 
-
-
 #endif /* SOURCE_HH */
index a3389217109ae382234fd2d282b04107c58c35d9..0fa6356cd0e7faa4100f71d44f98bb3a53a874a2 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   spaceable-grob.hh -- declare Spaceable_grob
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SPACEABLE_GROB_HH
 #define SPACEABLE_GROB_HH
 struct Spaceable_grob
 {
   /// set a minimum distance
-  static void add_rod (Grob*me, Grob * to, Real distance);
-  static void add_spring (Grob*me, Grob * to, Real dist, Real strength);
-  static bool has_interface (Grob*);
-  static void remove_interface (Grob*);
-  static SCM get_minimum_distances (Grob*);
-  static SCM get_ideal_distances (Grob*);
+  static void add_rod (Grob *me, Grob *to, Real distance);
+  static void add_spring (Grob *me, Grob *to, Real dist, Real strength);
+  static bool has_interface (Grob *);
+  static void remove_interface (Grob *);
+  static SCM get_minimum_distances (Grob *);
+  static SCM get_ideal_distances (Grob *);
 };
 
 #endif /* SPACEABLE_GROB_HH */
index 96bcfbcccb235be73ec416798b6d3300a7557d3d..13bd018cadf5129aa8234e33f2fed31df06eb659 100644 (file)
@@ -1,13 +1,13 @@
-/*   
+/*
   spacing-interface.hh -- declare Spacing_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
-struct Spacing_interface {
-  static bool has_interface (Grob*);
+struct Spacing_interface
+{
+  static bool has_interface (Grob *);
 };
 
index 4b3f0b3d24bb9ab9ca54ee93c43d6b4309cdb5b1..7154f303656463eb18641af730857d2e9003f24b 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef SPAN_BAR_HH
 #define SPAN_BAR_HH
 
 class Span_bar
 {
 public:
-  
-  static bool has_interface (Grob*);  
-  static Interval get_spanned_interval (Grob*);
-  static void add_bar (Grob*, Grob*);
-  static void evaluate_glyph (Grob*);
-  static void evaluate_empty (Grob*);
+
+  static bool has_interface (Grob *);
+  static Interval get_spanned_interval (Grob *);
+  static void add_bar (Grob *, Grob *);
+  static void evaluate_glyph (Grob *);
+  static void evaluate_empty (Grob *);
   DECLARE_SCHEME_CALLBACK (width_callback, (SCM smob, SCM axis));
-  DECLARE_SCHEME_CALLBACK (get_bar_size, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
+  DECLARE_SCHEME_CALLBACK (get_bar_size, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
   DECLARE_SCHEME_CALLBACK (center_on_spanned_callback, (SCM element, SCM axis));
 };
 
index e7745cb528ba70214ddc82065855d3d11b6d5f6e..6c0fc1cbed436b0a4bebb5dcefc381663033df00 100644 (file)
 #include "rod.hh"
 
 /** A symbol which is attached between two columns. A spanner is a
-  symbol which spans across several columns, so its final appearance
-  can only be calculated after the breaking problem is solved.
+    symbol which spans across several columns, so its final appearance
+    can only be calculated after the breaking problem is solved.
 
-  Examples
+    Examples
 
-  * (de)crescendo
-  * slur
-  * beam
-  * bracket
+    * (de)crescendo
+    * slur
+    * beam
+    * bracket
 
-  Spanner should know about the items which it should consider:
-  e.g. slurs should be steep enough to "enclose" all those items. This
-  is absolutely necessary for beams, since they have to adjust the
-  length of stems of notes they encompass.
-
-  */
-class Spanner : public  Grob {
-  Drul_array<Item*> spanned_drul_;
+    Spanner should know about the items which it should consider:
+    e.g. slurs should be steep enough to "enclose" all those items. This
+    is absolutely necessary for beams, since they have to adjust the
+    length of stems of notes they encompass.
+*/
+class Spanner : public Grob
+{
+  Drul_array<Item *> spanned_drul_;
   int break_index_;
-  
+
 public:
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
-  
+
   Link_array<Spanner> broken_intos_;
 
   int get_break_index () const;
   // todo: move to somewhere else.
   Real get_broken_left_end_align () const;
-  void substitute_one_mutable_property (SCM sym, SCM val)  ;
+  void substitute_one_mutable_property (SCM sym, SCM val);
   bool fast_fubstitute_grob_list (SCM sym, SCM grob_list);
   // TODO: make virtual and do this for Items as well.
   Interval_t<int> spanned_rank_iv ();
-  void set_bound (Direction d, Grob*);
+  void set_bound (Direction d, Grob *);
   Item *get_bound (Direction d) const;
-  
-  Spanner (SCM, Object_key const*);
+
+  Spanner (SCM, Object_key const *);
   Spanner (Spanner const &, int copy_count);
   bool is_broken () const;
   void do_break ();
   Real spanner_length () const;
 
-  static int compare (Spanner * const &, Spanner * const &);
-  virtual Grob* find_broken_piece (System*) const;
+  static int compare (Spanner *const &, Spanner *const &);
+  virtual Grob *find_broken_piece (System *) const;
   virtual SCM do_derived_mark () const;
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
   virtual System *get_system () const;
 
 protected:
@@ -64,8 +64,8 @@ protected:
   virtual void do_break_processing ();
 };
 
-void add_bound_item (Spanner*, Grob*);
+void add_bound_item (Spanner *, Grob *);
 
-bool spanner_less ( Spanner *s1, Spanner* s2);
-int broken_spanner_index (Spanner * sp);
+bool spanner_less (Spanner *s1, Spanner *s2);
+int broken_spanner_index (Spanner *sp);
 #endif
index 2efb1105fda8a3145598e6d27ab1eb53fe9c4004..c3ef5bd027493879c36a757469a9764ee9fd6ba2 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   spring.hh -- declare Spring, Column_spring
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SPRING_HH
 #define SPRING_HH
@@ -19,16 +18,16 @@ struct Spring_smob
   Real distance_;
   bool expand_only_b_;
   Real strength_;
-  
-  DECLARE_SIMPLE_SMOBS(Spring_smob, dummy);
+
+  DECLARE_SIMPLE_SMOBS (Spring_smob, dummy);
 public:
-  Spring_smob();
+  Spring_smob ();
 };
-DECLARE_UNSMOB(Spring_smob, spring);
+DECLARE_UNSMOB (Spring_smob, spring);
 
 struct Spring
 {
-  Drul_array<Item*> item_drul_;
+  Drul_array<Item *> item_drul_;
   Real distance_;
   bool expand_only_b_;
 
@@ -41,6 +40,5 @@ struct Spring
   Spring ();
 };
 
-
 #endif /* SPRING_HH */
 
index 1c90670de8fba7244f370fe0da73bbda83ad4555..eb271be1568ebad6183751cbf935890cb6c131a0 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-staff-spacing.hh -- declare Staff_spacing
+/*
+  staff-spacing.hh -- declare Staff_spacing
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef STAFF_SPACING_HH
 #define STAFF_SPACING_HH
@@ -15,12 +14,12 @@ source file of the GNU LilyPond music typesetter
 class Staff_spacing
 {
 public:
-  static Real next_notes_correction (Grob*, Grob*);
-  static Real next_note_correction (Grob*, Grob*, Interval);  
-  static bool has_interface (Grob*);
-  static void get_spacing_params (Grob*, Real*, Real*);
+  static Real next_notes_correction (Grob *, Grob *);
+  static Real next_note_correction (Grob *, Grob *, Interval);
+  static bool has_interface (Grob *);
+  static void get_spacing_params (Grob *, Real *, Real *);
 
-  static Interval bar_y_positions (Grob*);
+  static Interval bar_y_positions (Grob *);
 };
 
 #endif /* STAFF_SPACING_HH */
index 6b5ec9e8c38844d5d40bf63d1c0d8227e2d3cde3..2502f50baab2ac019f3f20fa1030503bdb326817 100644 (file)
@@ -1,46 +1,43 @@
-/* 
- staff-sym-referencer.hh -- declare staff_symbol_referencer
- source file of the GNU LilyPond music typesetter
+/*
 staff-sym-referencer.hh -- declare staff_symbol_referencer
+
 source file of the GNU LilyPond music typesetter
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #ifndef STAFF_SYMBOL_REFERENCER_HH
 #define STAFF_SYMBOL_REFERENCER_HH
 
 #include "grob.hh"
 
-
 /**
- A notation object that needs access to variables of the staff (no
- lines, leading).
- */
-class Staff_symbol_referencer 
+   A notation object that needs access to variables of the staff (no
+   lines, leading).
+*/
+class Staff_symbol_referencer
 {
 public:
-  static bool has_interface (Grob*);
-  static bool ugly_hack (Grob*);  
-  static void set_position (Grob*, Real);
+  static bool has_interface (Grob *);
+  static bool ugly_hack (Grob *);
+  static void set_position (Grob *, Real);
   DECLARE_SCHEME_CALLBACK (callback, (SCM element, SCM axis));
 
   /**
      Leading are the lead strips between the sticks (lines) of
      typeface. ie. leading is vertical space.
   */
-  static Real line_thickness (Grob*);
-  static Real staff_space (Grob*);
-  static Grob *get_staff_symbol (Grob*);
-  static bool on_staffline (Grob*);
-  static bool on_staffline (Grob*, int);
-  static int line_count (Grob*);
-  static Real get_position (Grob*);
-  static Real staff_radius (Grob*);
-  static int get_rounded_position (Grob*);
+  static Real line_thickness (Grob *);
+  static Real staff_space (Grob *);
+  static Grob *get_staff_symbol (Grob *);
+  static bool on_staffline (Grob *);
+  static bool on_staffline (Grob *, int);
+  static int line_count (Grob *);
+  static Real get_position (Grob *);
+  static Real staff_radius (Grob *);
+  static int get_rounded_position (Grob *);
 };
 
-int compare_position (Grob *const&, Grob *const&); 
+int compare_position (Grob *const &, Grob *const &);
 #endif /* STAFF_SYMBOL_REFERENCER_HH */
 
index 4289fada49a5bf1eeab1c6b53e21abdb8e0cb822..5e67b668b26988d32f10cdc00e9737e279972905 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef STAFF_SYMBOL_HH
 #define STAFF_SYMBOL_HH
 
 #include "lily-proto.hh"
 
 /**
-  TODO: add linethickness as parameter.
-  */
-class Staff_symbol 
+   TODO: add linethickness as parameter.
+*/
+class Staff_symbol
 {
 public:
-  static Real staff_space (Grob*) ;
-  static Real get_line_thickness (Grob*);
-  static Real get_ledger_line_thickness (Grob*);
-    
-  static int get_steps (Grob*) ;
-  static int line_count (Grob*);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  static bool has_interface (Grob*);
-  
+  static Real staff_space (Grob *);
+  static Real get_line_thickness (Grob *);
+  static Real get_ledger_line_thickness (Grob *);
+
+  static int get_steps (Grob *);
+  static int line_count (Grob *);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  static bool has_interface (Grob *);
+
 };
 #endif // STAFF_SYMBOL_HH
index 3a47067455f7505228bc8b92f924a9de6cc8597d..0240c65d7792073373dd847d0964845d3a51765f 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
 #ifndef STEM_INFO_HH
 #define STEM_INFO_HH
 
 /*
   Parameters for a stem, (multiply with stemdirection, to get real values
   for a downstem.)
- */
-struct Stem_info 
+*/
+struct Stem_info
 {
   Direction dir_;
   Real ideal_y_;
   Real shortest_y_;
-  Stem_info();
-void  scale (Real);
+  Stem_info ();
+  void scale (Real);
 };
 
 #endif // STEM_INFO_HH
index 8c68e3b8230c4bda9c26a3e0bc3b9f0963ad8898..d143bd08cb0dc67d5f669bc5e7022f16765a8c07 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   stem-tremolo.hh -- declare Abbreviation
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef ABBREV_HH
 #define ABBREV_HH
 class Stem_tremolo
 {
 public:
-  
-  static bool has_interface (Grob*);
+
+  static bool has_interface (Grob *);
   DECLARE_SCHEME_CALLBACK (dim_callback, (SCM smob, SCM axis));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
-  static Stencil raw_stencil (Grob*);
+  static Stencil raw_stencil (Grob *);
 };
 
 #endif /* ABBREV_HH */
index 1c0616d2aec786b888685bd570e5669cc745fb70..6c97b11311dc37e4a26c213a219df7c89d775d6a 100644 (file)
@@ -11,7 +11,7 @@
 #include "lily-guile.hh"
 #include "stem-info.hh"
 
-class Stem 
+class Stem
 {
 public:
   static Array<int> note_head_positions (Grob *);
@@ -21,8 +21,8 @@ public:
   static Spanner *get_beam (Grob *);
   static Grob *first_head (Grob *);
   static Grob *last_head (Grob *);
-  static Drul_array<Grob*> extremal_heads (Grob *);
-  static Grob *support_head (Grob *) ;
+  static Drul_array<Grob *> extremal_heads (Grob *);
+  static Grob *support_head (Grob *);
   static void add_head (Grob *me, Grob *n);
   static Stem_info get_stem_info (Grob *);
   static Real chord_start_y (Grob *);
@@ -30,17 +30,17 @@ public:
   static void set_stemend (Grob *, Real);
   static Direction get_default_dir (Grob *);
   static Slice Stem::beam_multiplicity (Grob *);
-  static Real thickness (Grob*);
+  static Real thickness (Grob *);
   static int head_count (Grob *);
-  static bool is_invisible (Grob *) ;
+  static bool is_invisible (Grob *);
   static Interval head_positions (Grob *);
-  static Real get_default_stem_end_position (Grob*me);
+  static Real get_default_stem_end_position (Grob *me);
   static void position_noteheads (Grob *);
   static Real stem_end_position (Grob *);
   static Stencil flag (Grob *);
   static bool has_interface (Grob *);
   static void set_spacing_hints (Grob *);
-  
+
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
index 23621ecf8ffe4bba40df4a504812e480770b8a63..29abe4e2bb3512945d14080064085dc448c20afb 100644 (file)
 
     It is implemented as a "tree" of scheme expressions, as in
 
-     Expr = combine Expr-list
-            | translate Offset Expr
-           | origin (ORIGIN) Expr
-           | no-origin Expr
-           | (SCHEME)
-           ;
+    Expr = combine Expr-list
+    | translate Offset Expr
+    | origin (ORIGIN) Expr
+    | no-origin Expr
+    | (SCHEME)
+    ;
 
     SCHEME is a Scheme expression that --when eval'd-- produces the
-    desired output.  
+    desired output.
 
     Notes:
-    
+
     * Because of the way that Stencil is implemented, it is the most
     efficient to add "fresh" stencils to what you're going to build.
 
     * Do not create Stencil objects on the heap. That includes passing
     around Stencil* which are produced by unsmob_stencil(). Either
     copy Stencil objects, or use SCM references.
-    
+
     * Empty stencils have empty dimensions.  If add_at_edge is used to
     init the stencil, we assume that
 
-      DIMENSIONS = (Interval (0, 0), Interval (0, 0)
+    DIMENSIONS = (Interval (0, 0), Interval (0, 0)
 */
 class Stencil
 {
@@ -51,16 +51,16 @@ class Stencil
     This provides the reference point of the symbol, for example with
     characters, it is on the base line of the character. Usually,
     ORIGIN is inside DIM_
-   */
+  */
   Offset origin_;
   Box dim_;
   SCM expr_;
-  
-  DECLARE_SIMPLE_SMOBS (Stencil, );  
+
+  DECLARE_SIMPLE_SMOBS (Stencil,);
 public:
   Stencil (Box, SCM s);
   Stencil ();
-  
+
   Offset origin () const;
   SCM expr () const;
 
@@ -76,7 +76,7 @@ public:
   void translate (Offset);
   void align_to (Axis a, Real x);
   void translate_axis (Real, Axis);
-  
+
   Interval extent (Axis) const;
   Box extent_box () const;
   bool is_empty () const;
@@ -86,14 +86,13 @@ public:
   static SCM ly_stencil_combined_at_edge (SCM, SCM, SCM, SCM, SCM);
 };
 
-
-DECLARE_UNSMOB(Stencil, stencil);
-SCM fontify_atom (Font_metric const*, SCM atom);
+DECLARE_UNSMOB (Stencil, stencil);
+SCM fontify_atom (Font_metric const *, SCM atom);
 
 void interpret_stencil_expression (SCM expr,
-                        void (*func) (void*, SCM),
-                        void *func_arg,
-                        Offset o);
+                                  void (*func) (void *, SCM),
+                                  void *func_arg,
+                                  Offset o);
 
 Stencil create_stencil (SCM print);
 SCM find_expression_fonts (SCM expr);
index 5c58945936589578d606332e13cfa55f56152193..c3a26f108cf9084d3c5f650fdf99092ce1b16d3d 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-stream.hh -- declare compatibility glue for gcc 3.
+/*
+  stream.hh -- declare compatibility glue for gcc 3.
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef STREAM_HH
 #define STREAM_HH
@@ -23,6 +22,5 @@ std::ostream *open_file_stream (String file_name, int mode = ios::out);
 #endif
 void close_file_stream (std::ostream *os);
 
-
 #endif /* STREAM_HH */
 
index 5b2d6ebfab92c41363fc8c93ebd0fc4f7a5d6ebe..ff6c1b7612deebc6d617ce6eb8a15b0481951281 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef SWALLOW_PERF_HH
 #define SWALLOW_PERF_HH
 
@@ -16,9 +15,9 @@ class Swallow_performer : public Performer
 {
 public:
   VIRTUAL_COPY_CONS (Translator);
-  
+
 protected:
-  virtual bool try_music (Music*) { return true; }
+  virtual bool try_music (Music *) { return true; }
 };
 
 #endif // SWALLOW_PERF_HH
index dfa2c60a57201d8f8e41eeaeb65d4a3e6b27d3ed..8468de947bff13f402be29a7a028ba2b4c763fea 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   System-start-delimiter.hh -- declare System_start_delimiter
-     
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef SYSTEM_START_DELIMITER_HH
 #define SYSTEM_START_DELIMITER_HH
 
 /*
   Braces/brackets across staves.
- */
+*/
 class System_start_delimiter
 {
 public:
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  
-  
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-  static void try_collapse (Grob*);
-  static Stencil staff_bracket (Grob*, Real) ;
-  static Stencil staff_brace (Grob*, Real) ;
-  static Stencil simple_bar (Grob*, Real) ;
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  static void try_collapse (Grob *);
+  static Stencil staff_bracket (Grob *, Real);
+  static Stencil staff_brace (Grob *, Real);
+  static Stencil simple_bar (Grob *, Real);
 };
 
 #endif /* SYSTEM_START_DELIMITER_HH */
index d8aa5a087f9d20a9c2a03ac7b9c0ba936a07f056..5eaa2bed66d2c5b5364a721dbbfba78463f9589f 100644 (file)
@@ -8,17 +8,14 @@
 #ifndef SYSTEM_HH
 #define SYSTEM_HH
 
-
 #include "column-x-positions.hh"
 #include "spanner.hh"
 
 /*
   If you keep following offset reference points, you will always end
-up at the root object. This root object is called @ref{System}, and it
-represents a system (i.e. a line of music).
-
-
- */
+  up at the root object. This root object is called @ref{System}, and it
+  represents a system (i.e. a line of music).
+*/
 class System : public Spanner
 {
 public:
@@ -27,27 +24,26 @@ public:
   SCM get_line ();
   SCM get_lines ();
 
-  System (SCM, Object_key const*);
-  System (System const&, int);
+  System (SCM, Object_key const *);
+  System (System const &, int);
   virtual Grob *clone (int count) const;
-  
+
   int element_count () const;
   int spanner_count () const;
 
-  void break_into_pieces (Array<Column_x_positions> const&);
-  static bool has_interface (Grob*);
-  
-  Link_array<Item> broken_col_range (Item const*, Item const*) const;
+  void break_into_pieces (Array<Column_x_positions> const &);
+  static bool has_interface (Grob *);
+
+  Link_array<Item> broken_col_range (Item const *, Item const *) const;
   Link_array<Grob> columns () const;
-  
-  void add_column (Paper_column*);
-  void typeset_grob (Grob*);
+
+  void add_column (Paper_column *);
+  void typeset_grob (Grob *);
   void pre_processing ();
 
 protected:
 };
 
-
-void set_loose_columns (System* which, Column_x_positions const *posns);
+void set_loose_columns (System *which, Column_x_positions const *posns);
 #endif /* SYSTEM_HH */
 
index b66a63b7bba313cfe56eab1521cee1e48a7b9a06..4f442b59cc48fd5cc224bf530a4fa3a082dac78b 100644 (file)
@@ -1,16 +1,15 @@
-/*   
+/*
   text-item.hh -- declare markup functions
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #ifndef TEXT_ITEM
 #define TEXT_ITEM
 
-
 #include "stencil.hh"
 
 class Text_interface
@@ -19,8 +18,8 @@ public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (interpret_markup, (SCM, SCM, SCM));
   DECLARE_SCHEME_CALLBACK (interpret_string, (SCM, SCM, SCM));
-  static bool has_interface (Grob*);
-  static bool markup_p (SCM) ;
+  static bool has_interface (Grob *);
+  static bool markup_p (SCM);
 };
 
 #endif /* TEXT_ITEM */
index 1a334880a63a2cf69cd71cbf99b70ec42803d9c2..b353e2880e833d7c44250f7d7e5262a65a644409 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef TEXT_METRICS_HH
@@ -16,7 +15,7 @@
 void try_load_text_metrics (String);
 SCM ly_load_text_dimensions (SCM);
 Box lookup_tex_text_dimension (Font_metric *font,
-                          SCM text);
+                              SCM text);
 
 #endif /* TEXT_METRICS_HH */
 
index e8b66dcf0e1a1bf660454a195e29606fd6a49258..d4dcad85484efec65e64bf852632d9a05f4ff318 100644 (file)
@@ -6,7 +6,6 @@
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
 #ifndef TEXT_SPANNER_HH
 #define TEXT_SPANNER_HH
 
@@ -18,7 +17,7 @@ class Text_spanner
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 #endif /* TEXT_SPANNER_HH */
index 099e6184bc29649535c3c7b855c7b8fe13a444e1..4c826d162e68331aef059a0baa414a9760ae7d80 100644 (file)
@@ -1,14 +1,13 @@
-/*   
+/*
   tfm-reader.hh -- declare Tex_font_metric_reader
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
   revamped code from GNU Fontutils-0.6
-
- */
+*/
 
 #ifndef TFM_READER_HH
 #define TFM_READER_HH
@@ -28,12 +27,12 @@ private:
   Tex_font_char_metric read_char_metric (Char_code code);
   Tex_font_char_metric read_char ();
   void read_lig_kern_program (Array<Tfm_ligature>* ligatures,
-                             Array <Tfm_kern>* kerns);
+                             Array<Tfm_kern>* kerns);
 
   Binary_source_file input_;
 
 public:
-  Tex_font_metric_reader ( String name);
+  Tex_font_metric_reader (String name);
 
   Tfm_info info_;
   Tfm_header header_;
index 8dba46d3e52a7e0dd57a6f03296b5608bb55a7af..32f1222589475a09b36ae0ab3ed274d95e26cf79 100644 (file)
@@ -1,14 +1,13 @@
-/*   
+/*
   tfm.hh -- declare Tex_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
   revamped code from GNU Fontutils-0.6
-
- */
+*/
 
 /*
   TODO: aren't there standard libs?  Ideally it is better to just link
@@ -138,10 +137,9 @@ struct Tex_font_char_metric
 
   Tex_font_char_metric ();
 
-  Box dimensions () const; 
+  Box dimensions () const;
 };
 
-
 class Tex_font_metric : public Simple_font_metric
 {
 public:
@@ -155,7 +153,7 @@ public:
   virtual String font_name () const;
 
   Tfm_info const &info () const;
-  
+
 protected:
   Tfm_info info_;
   Tfm_header header_;
@@ -168,6 +166,5 @@ private:
   Tex_font_metric ();
 };
 
-
 #endif /* TFM_HH */
 
index 9bce382846597bb71e2c907f492baab25b433ba0..17797e9d963c38a592fdcb91b1cce47a1187d1a6 100644 (file)
@@ -1,12 +1,11 @@
 
-/*   
+/*
   tie-column.hh -- declare Tie_column
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef TIE_COLUMN_HH
 #define TIE_COLUMN_HH
 class Tie_column
 {
 public:
-  static bool has_interface (Grob*);
-  static void add_tie (Grob*me, Grob*);
+  static bool has_interface (Grob *);
+  static void add_tie (Grob *me, Grob *);
   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
-  static void set_directions (Grob*me);
-  static void werner_directions (Grob*me);
+  static void set_directions (Grob *me);
+  static void werner_directions (Grob *me);
 };
 
 #endif /* TIE_COLUMN_HH */
index 06fba20065d3392c313e7fe393e4f516e52a33f0..d7c4312e7bae442e8ebd2a2d2f4b77c9b2af9f8d 100644 (file)
@@ -6,28 +6,26 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef TIE_HH
 #define TIE_HH
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
 
-
 class Tie
 {
 public:
-  static void set_head (Grob*, Direction, Grob*head);
-  static void set_interface (Grob*);
-  static bool has_interface (Grob*);
-  static void set_direction (Grob*);
-  static Grob *head (Grob*, Direction) ;
-  static int get_column_rank (Grob*, Direction);
-  static Real get_position (Grob*) ;
-  static Direction get_default_dir (Grob*) ;
+  static void set_head (Grob *, Direction, Grob *head);
+  static void set_interface (Grob *);
+  static bool has_interface (Grob *);
+  static void set_direction (Grob *);
+  static Grob *head (Grob *, Direction);
+  static int get_column_rank (Grob *, Direction);
+  static Real get_position (Grob *);
+  static Direction get_default_dir (Grob *);
   static SCM get_control_points (SCM);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
 };
 
 #endif // TIE_HH
index d22f92816824dd281a3f385c5e004f60f0cc3fb6..5d0224861d32b8449f085857dae94f74a6a09872 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   compressed-music-iterator.hh -- declare Time_scaled_music_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #ifndef Time_scaled_music_ITERATOR_HH
 #define Time_scaled_music_ITERATOR_HH
 
 class Time_scaled_music_iterator : public Music_wrapper_iterator
 {
-public:  
-  DECLARE_SCHEME_CALLBACK(constructor, ()); 
+public:
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   /* construction */
 protected:
   virtual void process (Moment);
 };
 
-
 #endif /* Time_scaled_music_ITERATOR_HH */
 
index 449d1ece1ed84f6ee356f8b363f43f8dae5c72e8..b41672364ac8ebefb35c7b665f3fac62bd48dcdb 100644 (file)
    TODO:
 
    2+3+2/8 time_signatures
-  
- */
+*/
 struct Time_signature
 {
-  static bool has_interface (Grob*);
-  static Stencil special_time_signature (Grob*, SCM, int, int) ;
-  static Stencil numbered_time_signature (Grob*, int, int);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  static bool has_interface (Grob *);
+  static Stencil special_time_signature (Grob *, SCM, int, int);
+  static Stencil numbered_time_signature (Grob *, int, int);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
 };
 #endif // METER_HH
 
index ee67f93d2b6763b3ec6651f11662cd7fca4d9c6a..f58489ea48328f38a44706a0c14fe62d81959261 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef TIMING_TRANSLATOR_HH
 #define TIMING_TRANSLATOR_HH
 
 class Timing_translator : public virtual Translator
 {
 public:
-  TRANSLATOR_DECLARATIONS(Timing_translator);
-
+  TRANSLATOR_DECLARATIONS (Timing_translator);
 
-protected: 
+protected:
   virtual void initialize ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
 
 public:
   Moment measure_position () const;
-  Rational measure_length () const;  
+  Rational measure_length () const;
 };
 #endif // TIMING_TRANSLATOR_HH
index 7a41f6e2ed5845f23a81ceff7f92c0442135c1c8..e31766ad2e5caf6859acd18b68c069fd153c5a9b 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef TRANSLATOR_GROUP_HH
 #define TRANSLATOR_GROUP_HH
 
@@ -19,9 +18,9 @@ class Translator_group : public virtual Translator
 {
 public:
   VIRTUAL_COPY_CONSTRUCTOR (Translator, Translator_group);
-  virtual Translator_groupget_daddy_translator ()const;
+  virtual Translator_group *get_daddy_translator ()const;
   virtual SCM get_simple_trans_list ();
-  virtual bool try_music (Music* req);       
+  virtual bool try_music (Music *req);
   virtual void initialize ();
   Translator_group ();
 
@@ -31,9 +30,8 @@ protected:
   virtual void derived_mark () const;
 };
 
-SCM names_to_translators (SCM namelist, Context*tg);
-void recurse_over_translators (Context * c, Translator_method ptr, Direction);
+SCM names_to_translators (SCM namelist, Context *tg);
+void recurse_over_translators (Context *c, Translator_method ptr, Direction);
 void translator_each (SCM list, Translator_method method);
 
-
 #endif // TRANSLATOR_GROUP_HH
index f7dcdf8e7fe064362f14f001ef25eb1a2c4d2105..6173536b463a33def48fcd20fbeb6f0b1eb0f16a 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef TRANSLATOR_HH
 #define TRANSLATOR_HH
 
@@ -23,7 +22,7 @@
 #endif
 
 #define TRANSLATOR_DECLARATIONS(NAME)                  \
-public:                                                        \
+  public:                                              \
   NAME ();                                             \
   VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME);         \
   static SCM static_description_;                      \
@@ -42,91 +41,87 @@ protected:
 
 public:
   bool must_be_last () const;
-  
-  Context * context () const { return daddy_context_; }
-  
+
+  Context *context () const { return daddy_context_; }
+
   Translator (Translator const &);
 
   SCM internal_get_property (SCM symbol) const;
-  
+
   virtual Output_def *get_output_def () const;
-  virtual Translator_groupget_daddy_translator ()const;
-  virtual Moment now_mom () const;  
+  virtual Translator_group *get_daddy_translator ()const;
+  virtual Moment now_mom () const;
   virtual bool try_music (Music *req);
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
-  virtual void initialize () ;
+  virtual void initialize ();
   virtual void process_music ();
   virtual void do_announces ();
   virtual void finalize ();
-  
-  Score_context * get_score_context () const;
-  Global_context * get_global_context () const;
 
-  
-  TRANSLATOR_DECLARATIONS(Translator);
+  Score_context *get_score_context () const;
+  Global_context *get_global_context () const;
+
+  TRANSLATOR_DECLARATIONS (Translator);
   DECLARE_SMOBS (Translator, dummy);
 protected:                     // should be private.
-  Context * daddy_context_ ;
+  Context *daddy_context_;
   virtual void derived_mark () const;
-  
+
   friend class Context_def;
   friend class Context;
 };
 
 /**
-  A macro to automate administration of translators.
- */
-#define ADD_THIS_TRANSLATOR(T)                         \
-SCM T::static_description_ = SCM_EOL;\
-static void  _ ## T ## _adder () {\
-      T *t = new T;\
-      T::static_description_ = t->static_translator_description ();\
-      scm_permanent_object (T::static_description_);\
-      add_translator (t);\
-}\
-SCM T::translator_description() const\
-{ \
-  return static_description_;\
-}\
-ADD_GLOBAL_CTOR (_ ## T ## _adder);
-
-
-
-
-#define ADD_TRANSLATOR(classname, desc, grobs, accepted, acked, read, write)                                           \
-ADD_THIS_TRANSLATOR (classname);\
-SCM                                                                                            \
-classname::static_translator_description () const \
-{                                                                                              \
-  SCM  static_properties = SCM_EOL;                                                            \
-  /*  static_properties = acons (name , gh_str02scm (Translator::name (self_scm ())),          \
-                             static_properties_);                                              \
-  */                                                                                           \
-  static_properties = scm_acons (ly_symbol2scm ("grobs-created"),                              \
-                             parse_symbol_list (grobs), static_properties);    \
-                                                                                               \
-  static_properties = scm_acons (ly_symbol2scm ("description"),                                        \
-                             scm_makfrom0str (desc), static_properties);                               \
-                                                                                               \
-  static_properties = scm_acons (ly_symbol2scm ("interfaces-acked"),                           \
-                             parse_symbol_list (acked), static_properties);                    \
-  static_properties = scm_acons (ly_symbol2scm ("events-accepted"),                            \
-                             parse_symbol_list (accepted), static_properties);                 \
-                                                                                               \
-  static_properties = scm_acons (ly_symbol2scm ("properties-read"),                            \
-                             parse_symbol_list (read), static_properties);                     \
-                                                                                               \
-  static_properties = scm_acons (ly_symbol2scm ("properties-written"),                                 \
-                               parse_symbol_list (write), static_properties);                  \
-                                                                                               \
-  return static_properties;                                                                    \
-}
-
-
-
-void add_translator (Translator*trans);
-
-Translator*get_translator (SCM s);
-DECLARE_UNSMOB(Translator, translator);
+   A macro to automate administration of translators.
+*/
+#define ADD_THIS_TRANSLATOR(T)                                         \
+  SCM T::static_description_ = SCM_EOL;                                        \
+  static void _ ## T ## _adder ()                                      \
+  {                                                                    \
+    T *t = new T;                                                      \
+    T::static_description_ = t->static_translator_description ();      \
+    scm_permanent_object (T::static_description_);                     \
+    add_translator (t);                                                        \
+  }                                                                    \
+  SCM T::translator_description () const                               \
+  {                                                                    \
+    return static_description_;                                                \
+  }                                                                    \
+  ADD_GLOBAL_CTOR (_ ## T ## _adder);
+
+
+#define ADD_TRANSLATOR(classname, desc, grobs, accepted, acked, read, write) \
+  ADD_THIS_TRANSLATOR (classname);                                     \
+  SCM                                                                  \
+  classname::static_translator_description () const                    \
+  {                                                                    \
+    SCM static_properties = SCM_EOL;                                   \
+    /*  static_properties = acons (name , gh_str02scm (Translator::name (self_scm ())),        \
+       static_properties_);                                            \
+    */                                                                 \
+    static_properties = scm_acons (ly_symbol2scm ("grobs-created"),    \
+                                  parse_symbol_list (grobs), static_properties); \
+                                                                       \
+    static_properties = scm_acons (ly_symbol2scm ("description"),      \
+                                  scm_makfrom0str (desc), static_properties); \
+                                                                       \
+    static_properties = scm_acons (ly_symbol2scm ("interfaces-acked"), \
+                                  parse_symbol_list (acked), static_properties); \
+    static_properties = scm_acons (ly_symbol2scm ("events-accepted"),  \
+                                  parse_symbol_list (accepted), static_properties); \
+                                                                       \
+    static_properties = scm_acons (ly_symbol2scm ("properties-read"),  \
+                                  parse_symbol_list (read), static_properties); \
+                                                                       \
+    static_properties = scm_acons (ly_symbol2scm ("properties-written"), \
+                                  parse_symbol_list (write), static_properties); \
+                                                                       \
+    return static_properties;                                          \
+  }
+
+void add_translator (Translator *trans);
+
+Translator *get_translator (SCM s);
+DECLARE_UNSMOB (Translator, translator);
 #endif // TRANSLATOR_HH
index ebedc328e0646e5eda2c956a06b56dd3678acce6..4d1963b76135f3966d3d191a17df5a527ba45114 100644 (file)
 class Tuplet_bracket
 {
 public:
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  
-  static bool has_interface (Grob*);
-  static void add_column (Grob*me, Item*);
-  static void add_beam (Grob*me, Grob*);
-  static Grob *parallel_beam (Grob *me, Link_array<Grob> const&cols, bool *equally_long);
-  static void calc_position_and_height (Grob*, Real*, Real *dy);
-  static Stencil make_bracket (Grob *me,  Axis protusion_axis,
-                               Offset dz,  Drul_array<Real> height,
-                               Interval gap, Drul_array<Real> widen,
-                               Drul_array<Real> shorten);
-  static Direction get_default_dir (Grob*);
+  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+
+  static bool has_interface (Grob *);
+  static void add_column (Grob *me, Item *);
+  static void add_beam (Grob *me, Grob *);
+  static Grob *parallel_beam (Grob *me, Link_array<Grob> const &cols, bool *equally_long);
+  static void calc_position_and_height (Grob *, Real *, Real *dy);
+  static Stencil make_bracket (Grob *me, Axis protusion_axis,
+                              Offset dz, Drul_array<Real> height,
+                              Interval gap, Drul_array<Real> widen,
+                              Drul_array<Real> shorten);
+  static Direction get_default_dir (Grob *);
 };
 
 #endif // Tuplet_bracket_HH
index 8846c543320fdbd628b31a59b89271916aa88e7d..77a154c69508b955e7ce1ec71119655d9a432bd7 100644 (file)
@@ -4,33 +4,32 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #ifndef TWEAK_REGISTRATION_HH
 #define TWEAK_REGISTRATION_HH
 
-#include  <map>
+#include <map>
 
 #include "lily-proto.hh"
 #include "object-key.hh"
 
-typedef std::map<Object_key const*, SCM, Object_key_less> Tweak_map;
+typedef std::map < Object_key const *, SCM, Object_key_less> Tweak_map;
 
 class Tweak_registry
 {
   Tweak_map tweaks_;
   Object_key_undumper *undumper_;
 
-  DECLARE_SMOBS(Tweak_registry, );
-  
+  DECLARE_SMOBS (Tweak_registry,);
+
 public:
   Tweak_registry ();
 
-  Object_key_undumper *undumper() const;
+  Object_key_undumper *undumper () const;
   void clear ();
-  void insert_grob_tweak (Grob*, SCM);
-  void replace_grob_tweak (Grob*, SCM);
+  void insert_grob_tweak (Grob *, SCM);
+  void replace_grob_tweak (Grob *, SCM);
   SCM get_tweaks (Grob *);
   SCM list_tweaks ();
   void insert_tweak_from_file (SCM);
index 55a520d91af27107484a347ccc798ca2c7a64c99..83b9506c2fa35e5fc9c6c6b6bf58b8e35ea9035b 100644 (file)
@@ -6,37 +6,38 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef TYPESWALLOW_GRAV_HH
 #define TYPESWALLOW_GRAV_HH
 
 #include "translator.hh"
 
 /** eat a certain type of event
- (Duh, it's good for your skin)
- */
   (Duh, it's good for your skin)
+*/
 class Type_swallow_translator : public virtual Translator
 {
 protected:
   String swallow_string_;
-  bool try_music (Music*);
-public:  
+  bool try_music (Music *);
+public:
   VIRTUAL_COPY_CONS (Translator);
 };
 
 #define DECLARE_EVENT_SWALLOWER(TYPE)                                  \
-struct TYPE ## _swallow_translator : public Type_swallow_translator {  \
-  TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator);  \
-};                                                                     \
-  TYPE ## _swallow_translator :: TYPE ## _swallow_translator() {\
-      swallow_string_ =  #TYPE;                                                \
+  struct TYPE ## _swallow_translator : public Type_swallow_translator  \
+  {                                                                    \
+    TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator);             \
+  };                                                                   \
+  TYPE ## _swallow_translator :: TYPE ## _swallow_translator ()                \
+  {                                                                    \
+    swallow_string_ = #TYPE;                                           \
   }                                                                    \
-ADD_TRANSLATOR(TYPE ## _swallow_translator,                            \
-                 "Swallow events of " #TYPE " type.",          \
-                 "",                                                   \
-       "general-music", \
-                 "",                                                   \
-                 "",                                                   \
+  ADD_TRANSLATOR (TYPE ## _swallow_translator,                         \
+                 "Swallow events of " #TYPE " type.",                  \
+                 "",                                                   \
+                 "general-music",                                      \
+                 "",                                                   \
+                 "",                                                   \
                  "");
 
 #endif // TYPESWALLOW_GRAV_HH
index cfc5f4b3af81ada680e7f158daf3d19bc1fafc2c..235fa1e1ea9878eddc083f4c40d59c6eb15c0ef4 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
- (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
 (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
 */
 
 #ifndef VATICANA_LIGATURE_HH
@@ -13,8 +13,8 @@
 
 struct Vaticana_ligature
 {
-  DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM ));
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
   static bool has_interface (Grob *);
 };
 
@@ -24,6 +24,6 @@ struct Vaticana_ligature
  *
  * The below definition extends those in gregorian-ligature.hh.
  */
-#define STACKED_HEAD    0x0100 // this head is stacked on the previous one
+#define STACKED_HEAD 0x0100 // this head is stacked on the previous one
 
 #endif // VATICANA_LIGATURE_HH
index 0a41ef30dd87eb670485a40f8402ad58386f929c..227c09dce6d1c39159940b64760898c65be18af0 100644 (file)
@@ -7,16 +7,15 @@
 #ifndef VOLTA_SPANNER_HH
 #define VOLTA_SPANNER_HH
 
-
 #include "spanner.hh"
 
 class Volta_bracket_interface
 {
 public:
-  static bool has_interface (Grob*);
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  static void add_column (Grob*, Grob*col);
-  static void add_bar (Grob*me, Item*bar);
+  static bool has_interface (Grob *);
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  static void add_column (Grob *, Grob *col);
+  static void add_bar (Grob *me, Item *bar);
 };
 
 #endif // VOLTA_SPANNER_HH
index 58c4eb338f29b2f68f0085cc7a8ed51f29aa4dfc..4c771f0049b538ad63b90dc6d341fa9a74304ee3 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "string.hh"
@@ -20,7 +19,7 @@ LY_DEFINE (ly_input, "ly:input-location?", 1, 0, 0,
 }
 
 LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg),
-         "Print @var{msg} as a GNU compliant error message, pointing to the"
+          "Print @var{msg} as a GNU compliant error message, pointing to the"
           "location in @var{sip}.\n")
 {
   Input *ip = unsmob_input (sip);
@@ -34,7 +33,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg),
 }
 
 LY_DEFINE (ly_input_file_line_column, "ly:input-file-line-column", 1, 0, 0, (SCM sip),
-         "Return input location in @var{sip} as (file-name line column).")
+          "Return input location in @var{sip} as (file-name line column).")
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
@@ -44,7 +43,7 @@ LY_DEFINE (ly_input_file_line_column, "ly:input-file-line-column", 1, 0, 0, (SCM
 }
 
 LY_DEFINE (ly_input_both_locations, "ly:input-both-locations", 1, 0, 0, (SCM sip),
-         "Return input location in @var{sip} as (file-name first-line first-column last-line last-column).")
+          "Return input location in @var{sip} as (file-name first-line first-column last-line last-column).")
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
index cd4c468637889febf993816e831b599e5bbc348f..a543f52a9be25a5541d2fd38bb3bc02141015cd4 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   input-smob.cc -- implement Input smob
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "input-smob.hh"
 
@@ -27,7 +26,7 @@ SCM mark_smob (SCM)
 static int
 print_smob (SCM s, SCM port, scm_print_state *)
 {
-  String str = "#<location " +  unsmob_input (s)->location_string () + ">";
+  String str = "#<location " + unsmob_input (s)->location_string () + ">";
   scm_puts (str.to_str0 (), port);
   return 1;
 }
@@ -39,7 +38,6 @@ free_smob (SCM s)
   return 0;
 }
 
-
 static void
 start_input_smobs ()
 {
@@ -55,22 +53,21 @@ make_input (Input ip)
 {
   Input *nip = new Input (ip);
   SCM z;
-  
+
   SCM_NEWSMOB (z, input_tag, nip);
   return z;
 }
 
-Input *                                                
+Input *
 unsmob_input (SCM s)
 {
   if (SCM_IMP (s))
     return 0;
   if (SCM_CAR (s) == (SCM)input_tag) // ugh.
-    return (Input*) SCM_CDR (s);
-  else                                         
-    return 0;                                  
+    return (Input *) SCM_CDR (s);
+  else
+    return 0;
 }
 
-
 ADD_SCM_INIT_FUNC (input, start_input_smobs);
 
index 83ae50a43c3257b53f52d66f7fe9cb2e70104da4..f833937a18e594227bef88be0e4615abb0f4abc1 100644 (file)
@@ -1,7 +1,7 @@
 /*
- input.cc -- implement Input
 input.cc -- implement Input
 
- source file of the LilyPond music typesetter
 source file of the LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
@@ -43,8 +43,8 @@ void
 Input::step_forward ()
 {
   if (end_ == start_)
-    end_ ++;
-  start_ ++;
+    end_++;
+  start_++;
 }
 
 void
@@ -58,43 +58,42 @@ Input::set_location (Input const &i_start, Input const &i_end)
 /*
   Produce GNU-compliant error message.  Correcting lilypond source is
   such a breeze if you ('re edidor) know (s) the error column too
-  
-  Format:
 
-    [file:line:column:][warning:]message
+  Format:
 
- */
+  [file:line:column:][warning:]message
+*/
 void
 Input::message (String message_string) const
 {
   String str;
-  
+
   /*
-    marked "Work in prgress" in GNU iostream 
-      libg++ 2.7.2.8
-      libstdc++ 2.8.1
+    marked "Work in prgress" in GNU iostream
+    libg++ 2.7.2.8
+    libstdc++ 2.8.1
 
-    why not just return always -1 (unknown), 
+    why not just return always -1 (unknown),
     iso breaking the interface?
 
-  int col = cerr.rdbuf ()->column ();
+    int col = cerr.rdbuf ()->column ();
 
-   */
+  */
 
   // well, we don't want to loose first warning...
   int col = 1;
   if (col > 0)
     str += "\n";
-  
+
   if (source_file_)
     str += location_string () + String (": ");
 
   str += message_string;
   if (source_file_)
-   {
-    str += ":\n";
-    str += source_file_->error_string (start_);
-   }
+    {
+      str += ":\n";
+      str += source_file_->error_string (start_);
+    }
   fprintf (stderr, "%s\n", str.to_str0 ());
   fflush (stderr);
 }
@@ -142,7 +141,6 @@ Input::file_string () const
     return "";
 }
 
-
 int
 Input::line_number () const
 {
index 74bb0b21a40e946c7cfb08d3d85a5fc0b9560ae3..1ae35630c6a5b12661c227c03f7a37e20b48be52 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   instrument-name-engraver.cc -- implement Instrument_name_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "bar-line.hh"
@@ -18,7 +17,7 @@
 
 class Instrument_name_engraver : public Engraver
 {
-  
+
 public:
   TRANSLATOR_DECLARATIONS (Instrument_name_engraver);
 
@@ -40,7 +39,7 @@ Instrument_name_engraver::Instrument_name_engraver ()
 void
 Instrument_name_engraver::initialize ()
 {
-  context ()->set_property ("instrumentSupport", SCM_EOL); 
+  context ()->set_property ("instrumentSupport", SCM_EOL);
 }
 
 void
@@ -58,24 +57,23 @@ void
 Instrument_name_engraver::create_text ()
 {
   if (text_)
-    return ;
-  
+    return;
+
   SCM txt = get_property ("instrument");
-  
+
   if (now_mom () > Moment (0))
     txt = get_property ("instr");
   /*
     UGH.
   */
   if (txt == SCM_EOL)
-    return ;
+    return;
 
-  
   text_ = make_item ("InstrumentName", SCM_EOL);
-      
+
   if (text_->get_property ("text") != txt)
     text_->set_property ("text", txt);
-  
+
 }
 
 void
@@ -88,11 +86,10 @@ Instrument_name_engraver::acknowledge_grob (Grob_info i)
 
   /*
     Ugh - typechecking for pedal and dynamic sucks.
-   */
-  if (dynamic_cast<Spanner*> (i.grob_)
+  */
+  if (dynamic_cast<Spanner *> (i.grob_)
       && (i.grob_->internal_has_interface (ly_symbol2scm ("dynamic-interface"))
-         || i.grob_->internal_has_interface (ly_symbol2scm ("piano-pedal-interface")))
-         )
+         || i.grob_->internal_has_interface (ly_symbol2scm ("piano-pedal-interface"))))
     return;
 
   /*
@@ -104,13 +101,13 @@ Instrument_name_engraver::acknowledge_grob (Grob_info i)
     We could also just use stavesFound, but lets keep this working
     without staffs as well.
   */
-  if (dynamic_cast<Spanner*> (i.grob_)
+  if (dynamic_cast<Spanner *> (i.grob_)
       && ((Axis_group_interface::has_interface (i.grob_)
           && Axis_group_interface::has_axis (i.grob_, Y_AXIS)))
       && !Align_interface::has_interface (i.grob_))
     {
       SCM nl = scm_cons (i.grob_->self_scm (),
-                       get_property ("instrumentSupport"));
+                        get_property ("instrumentSupport"));
 
       context ()->set_property ("instrumentSupport", nl);
     }
@@ -121,25 +118,24 @@ Instrument_name_engraver::process_music ()
 {
   /*
     Also create text if barlines in other groups. This allows
-    a name to be attached to lyrics or chords. 
-   */
+    a name to be attached to lyrics or chords.
+  */
   if (scm_is_string (get_property ("whichBar")))
     create_text ();
 }
 
 ADD_TRANSLATOR (Instrument_name_engraver,
-/* descr */       " Prints the name of the instrument (specified by "
-" @code{Staff.instrument} and @code{Staff.instr}) "
-"at the left of the staff. ",
-/* creats*/       "InstrumentName",
-/* accepts */     "",
-/* acks  */      "bar-line-interface axis-group-interface",
-/* reads */       "instrument instr",
-/* write */       "");
+               /* descr */ " Prints the name of the instrument (specified by "
+               " @code{Staff.instrument} and @code{Staff.instr}) "
+               "at the left of the staff. ",
+               /* creats*/ "InstrumentName",
+               /* accepts */ "",
+               /* acks  */ "bar-line-interface axis-group-interface",
+               /* reads */ "instrument instr",
+               /* write */ "");
 
 /****************************************************************/
 
-
 class Vocal_name_engraver : public Instrument_name_engraver
 {
 public:
@@ -147,20 +143,18 @@ public:
   virtual void create_text ();
 };
 
-
 Vocal_name_engraver::Vocal_name_engraver ()
 {
 }
 
-
 void
 Vocal_name_engraver::create_text ()
 {
   if (text_)
-    return ;
-  
+    return;
+
   SCM txt = get_property ("vocalName");
-  
+
   if (now_mom () > Moment (0))
     txt = get_property ("vocNam");
 
@@ -168,23 +162,21 @@ Vocal_name_engraver::create_text ()
     UGH.
   */
   if (txt == SCM_EOL)
-    return ;
-  
+    return;
+
   text_ = make_item ("VocalName", SCM_EOL);
-      
+
   if (text_->get_property ("text") != txt)
     text_->set_property ("text", txt);
-  
-}
-
 
+}
 
 ADD_TRANSLATOR (Vocal_name_engraver,
-/* descr */       " Prints the name of the a lyric voice (specified by "
-" @code{Staff.vocalName} and @code{Staff.vocNam}) "
-"at the left of the staff. ",
-/* creats*/       "VocalName",
-/* accepts */     "",
-/* acks  */      "bar-line-interface axis-group-interface",
-/* reads */       "vocNam vocalName",
-/* write */       "");
+               /* descr */ " Prints the name of the a lyric voice (specified by "
+               " @code{Staff.vocalName} and @code{Staff.vocNam}) "
+               "at the left of the staff. ",
+               /* creats*/ "VocalName",
+               /* accepts */ "",
+               /* acks  */ "bar-line-interface axis-group-interface",
+               /* reads */ "vocNam vocalName",
+               /* write */ "");
index a6c3577a6f2d9224190ea92925ff72ef9f40d110..e94b5bc26762862fd4e38a8a4406bfc5c590b690 100644 (file)
 #include "system.hh"
 #include "group-interface.hh"
 
-Grob * 
+Grob *
 Item::clone (int count) const
 {
   return new Item (*this, count);
 }
 
-
 Item::Item (SCM s, Object_key const *key)
   : Grob (s, key)
 {
@@ -38,24 +37,23 @@ Item::Item (Item const &s, int copy_count)
   broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] = 0;
 }
 
-
 bool
-Item::is_breakable (Grob*me) 
+Item::is_breakable (Grob *me)
 {
   if (me->original_)
     return false;
 
-  if (!dynamic_cast<Item*> (me))
+  if (!dynamic_cast<Item *> (me))
     me->programming_error ("only items can be breakable.");
-  
-  Item * i = dynamic_cast<Item*> (me->get_parent (X_AXIS));
+
+  Item *i = dynamic_cast<Item *> (me->get_parent (X_AXIS));
   return (i) ? Item::is_breakable (i) : to_boolean (me->get_property ("breakable"));
 }
 
 Paper_column *
 Item::get_column () const
 {
-  Item *parent = dynamic_cast<Item*> (get_parent (X_AXIS));
+  Item *parent = dynamic_cast<Item *> (get_parent (X_AXIS));
   return parent ? parent->get_column () : 0;
 }
 
@@ -63,20 +61,19 @@ System *
 Item::get_system () const
 {
   Grob *g = get_parent (X_AXIS);
-  return g ?  g->get_system () : 0;
+  return g ? g->get_system () : 0;
 }
 
-
 void
 Item::copy_breakable_items ()
 {
   Drul_array<Item *> new_copies;
   Direction i = LEFT;
   int count = 0;
-  do 
+  do
     {
-      Grob * dolly = clone (count ++);
-      Item * item = dynamic_cast<Item*> (dolly);
+      Grob *dolly = clone (count++);
+      Item *item = dynamic_cast<Item *> (dolly);
       pscore_->system_->typeset_grob (item);
       new_copies[i] = item;
     }
@@ -84,17 +81,15 @@ Item::copy_breakable_items ()
   broken_to_drul_ = new_copies;
 }
 
-
 bool
 Item::is_broken () const
 {
   return broken_to_drul_[LEFT] || broken_to_drul_[RIGHT];
 }
 
-
 /*
   Generate items for begin and end-of line.
- */
+*/
 void
 Item::discretionary_processing ()
 {
@@ -105,40 +100,39 @@ Item::discretionary_processing ()
     copy_breakable_items ();
 }
 
-Grob*
-Item::find_broken_piece (System*l) const
+Grob *
+Item::find_broken_piece (System *l) const
 {
-  if (get_system () == l) 
-    return (Item*) (this);
+  if (get_system () == l)
+    return (Item *) (this);
 
   Direction d = LEFT;
-  do {
-    Grob *s = broken_to_drul_[d];
-    if (s && s->get_system () == l)
-      return s;
-  }
+  do
+    {
+      Grob *s = broken_to_drul_[d];
+      if (s && s->get_system () == l)
+       return s;
+    }
   while (flip (&d) != LEFT);
 
   return 0;
 }
 
-
-Item*
+Item *
 Item::find_prebroken_piece (Direction d) const
 {
-  Item * me = (Item *) (this); 
+  Item *me = (Item *) (this);
   if (!d)
     return me;
-  return dynamic_cast<Item*> (broken_to_drul_[d]);
+  return dynamic_cast<Item *> (broken_to_drul_[d]);
 }
 
-
 Direction
 Item::break_status_dir () const
 {
   if (original_)
     {
-      Item * i = dynamic_cast<Item*> (original_);
+      Item *i = dynamic_cast<Item *> (original_);
 
       return (i->broken_to_drul_[LEFT] == this) ? LEFT : RIGHT;
     }
@@ -150,7 +144,7 @@ void
 Item::handle_prebroken_dependencies ()
 {
   Grob::handle_prebroken_dependencies ();
-  
+
   /*
     Can't do this earlier, because try_visibility_lambda () might set
     the elt property transparent, which would then be copied.
@@ -167,7 +161,7 @@ Item::handle_prebroken_dependencies ()
       SCM result = scm_apply_0 (vis, args);
       bool trans = ly_scm2bool (scm_car (result));
       bool empty = ly_scm2bool (scm_cdr (result));
-      
+
       if (empty && trans)
        suicide ();
       else if (empty)
@@ -190,47 +184,45 @@ Item::do_derived_mark () const
   return SCM_EOL;
 }
 
-Item*
-unsmob_item (SCM s )
+Item *
+unsmob_item (SCM s)
 {
-  return dynamic_cast<Item*> (unsmob_grob (s));
+  return dynamic_cast<Item *> (unsmob_grob (s));
 }
 
-
 ADD_INTERFACE (Item,
-             "item-interface",
-             "\n"
-             "\n"
-             "Grobs can be distinguished in their role in the horizontal spacing.\n"
-             "Many grobs define constraints on the spacing by their sizes. For\n"
-             "example, note heads, clefs, stems, and all other symbols with a fixed\n"
-             "shape.  These grobs form a subtype called @code{Item}.\n"
-             "\n"
-             "\n"
-             "Some items need special treatment for line breaking. For example, a\n"
-             "clef is normally only printed at the start of a line (i.e. after a\n"
-             "line break).  To model this, `breakable' items (clef, key signature,\n"
-             "bar lines, etc.) are copied twice. Then we have three versions of each\n"
-             "breakable item: one version if there is no line break, one version\n"
-             "that is printed before the line break (at the end of a system), one\n"
-             "version that is printed after the line break.\n"
-             "\n"
-             "Whether these versions are visible and take up space, is determined by\n"
-             "the outcome of the @code{break-visibility}. This grob property is a\n"
-             "function taking a direction (-1, 0 or 1) as argument. It returns a\n"
-             "cons of booleans, signifying whether this grob should be transparent\n"
-             "and have no extent.\n"
-             "\n"
-             "The following variables for break-visibility are predefined:\n"
-             "@example\n"
-             "           grob will show:   before  no     after\n"
-             "                             break   break  break\n"
-             "  all-invisible              no      no     no\n"
-             "  begin-of-line-visible      no      no     yes\n"
-             "  end-of-line-visible        yes     no     no\n"
-             "  all-visible                yes     yes    yes\n"
-             "  begin-of-line-invisible    yes     yes    no\n"
-             "  end-of-line-invisible      no      yes    yes\n"
-             "@end example\n"
-             ,
-             "no-spacing-rods break-visibility breakable")
+              "item-interface",
+              "\n"
+              "\n"
+              "Grobs can be distinguished in their role in the horizontal spacing.\n"
+              "Many grobs define constraints on the spacing by their sizes. For\n"
+              "example, note heads, clefs, stems, and all other symbols with a fixed\n"
+              "shape.  These grobs form a subtype called @code{Item}.\n"
+              "\n"
+              "\n"
+              "Some items need special treatment for line breaking. For example, a\n"
+              "clef is normally only printed at the start of a line (i.e. after a\n"
+              "line break).  To model this, `breakable' items (clef, key signature,\n"
+              "bar lines, etc.) are copied twice. Then we have three versions of each\n"
+              "breakable item: one version if there is no line break, one version\n"
+              "that is printed before the line break (at the end of a system), one\n"
+              "version that is printed after the line break.\n"
+              "\n"
+              "Whether these versions are visible and take up space, is determined by\n"
+              "the outcome of the @code{break-visibility}. This grob property is a\n"
+              "function taking a direction (-1, 0 or 1) as argument. It returns a\n"
+              "cons of booleans, signifying whether this grob should be transparent\n"
+              "and have no extent.\n"
+              "\n"
+              "The following variables for break-visibility are predefined:\n"
+              "@example\n"
+              "           grob will show:   before  no     after\n"
+              "                             break   break  break\n"
+              "  all-invisible              no      no     no\n"
+              "  begin-of-line-visible      no      no     yes\n"
+              "  end-of-line-visible        yes     no     no\n"
+              "  all-visible                yes     yes    yes\n"
+              "  begin-of-line-invisible    yes     yes    no\n"
+              "  end-of-line-invisible      no      yes    yes\n"
+              "@end example\n",
+              "no-spacing-rods break-visibility breakable")
index 531eb9b346dd9fdf25f93f23d9bc535d9159008c..3f5d722c0ba0282222a4b3e6646bdc8456ffe60f 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  */
+*/
 
 #include "item.hh"
 #include "bar-line.hh"
 
 /*
   TODO: The representation  of key sigs is all fucked.
- */
+*/
 
 /**
-  Make the key signature.
- */
+   Make the key signature.
+*/
 class Key_engraver : public Engraver
 {
   void create_key (bool);
-  void read_ev (Music const * r);
+  void read_ev (Music const *r);
 
   Music *key_ev_;
   Item *item_;
@@ -42,13 +42,11 @@ protected:
   virtual void acknowledge_grob (Grob_info);
 };
 
-
 void
 Key_engraver::finalize ()
 {
 }
 
-
 Key_engraver::Key_engraver ()
 {
   key_ev_ = 0;
@@ -56,11 +54,10 @@ Key_engraver::Key_engraver ()
   cancellation_ = 0;
 }
 
-
 void
 Key_engraver::create_key (bool def)
 {
-  if (!item_) 
+  if (!item_)
     {
       item_ = make_item ("KeySignature", key_ev_ ? key_ev_->self_scm () : SCM_EOL);
 
@@ -75,23 +72,22 @@ Key_engraver::create_key (bool def)
          cancellation_ = make_item ("KeyCancellation", key_ev_ ? key_ev_->self_scm () : SCM_EOL);
          cancellation_->set_property ("old-accidentals", last);
          cancellation_->set_property ("c0-position",
-                          get_property ("middleCPosition"));
-      
+                                      get_property ("middleCPosition"));
+
        }
       item_->set_property ("new-accidentals", key);
     }
 
   if (!def)
     {
-      SCM vis = get_property ("explicitKeySignatureVisibility"); 
+      SCM vis = get_property ("explicitKeySignatureVisibility");
       if (ly_c_procedure_p (vis))
        item_->set_property ("break-visibility", vis);
     }
-}      
-
+}
 
 bool
-Key_engraver::try_music (Music * ev)
+Key_engraver::try_music (Music *ev)
 {
   if (ev->is_mus_type ("key-change-event"))
     {
@@ -102,17 +98,16 @@ Key_engraver::try_music (Music * ev)
          read_ev (key_ev_);
        }
       return true;
-    }   
-  return  false;
+    }
+  return false;
 }
 
-
 void
 Key_engraver::acknowledge_grob (Grob_info info)
 {
   if (Clef::has_interface (info.grob_))
     {
-      SCM c =  get_property ("createKeyOnClefChange");
+      SCM c = get_property ("createKeyOnClefChange");
       if (to_boolean (c))
        {
          create_key (false);
@@ -125,27 +120,24 @@ Key_engraver::acknowledge_grob (Grob_info info)
     }
 }
 
-
 void
 Key_engraver::process_music ()
 {
-  if (key_ev_ ||
-      get_property ("lastKeySignature") != get_property ("keySignature"))
+  if (key_ev_
+      || get_property ("lastKeySignature") != get_property ("keySignature"))
     create_key (false);
 }
 
-
 void
 Key_engraver::stop_translation_timestep ()
 {
   item_ = 0;
   context ()->set_property ("lastKeySignature", get_property ("keySignature"));
-  cancellation_ = 0; 
+  cancellation_ = 0;
 }
 
-
 void
-Key_engraver::read_ev (Music const * r)
+Key_engraver::read_ev (Music const *r)
 {
   SCM p = r->get_property ("pitch-alist");
   if (!scm_is_pair (p))
@@ -162,24 +154,22 @@ Key_engraver::read_ev (Music const * r)
          n = scm_delete_x (scm_car (s), n);
        }
     }
-  
-  for (SCM s = n ; scm_is_pair (s); s = scm_cdr (s))
+
+  for (SCM s = n; scm_is_pair (s); s = scm_cdr (s))
     if (scm_to_int (scm_cdar (s)))
       accs = scm_cons (scm_car (s), accs);
 
   context ()->set_property ("keySignature", accs);
-  context ()->set_property ("tonic" ,
+  context ()->set_property ("tonic",
                            r->get_property ("tonic"));
 }
 
-
 void
 Key_engraver::start_translation_timestep ()
 {
   key_ev_ = 0;
 }
 
-
 void
 Key_engraver::initialize ()
 {
@@ -191,11 +181,10 @@ Key_engraver::initialize ()
 
 }
 
-
 ADD_TRANSLATOR (Key_engraver,
-/* descr */       "",
-/* creats*/       "KeySignature",
-/* accepts */     "key-change-event",
-/* acks  */      "bar-line-interface clef-interface",
-/* reads */       "keySignature printKeyCancellation lastKeySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature",
-/* write */       "lastKeySignature tonic keySignature");
+               /* descr */ "",
+               /* creats*/ "KeySignature",
+               /* accepts */ "key-change-event",
+               /* acks  */ "bar-line-interface clef-interface",
+               /* reads */ "keySignature printKeyCancellation lastKeySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature",
+               /* write */ "lastKeySignature tonic keySignature");
index e96c713ca2dc5cfc8a0f67972747f6a2bf8d108b..9c05a1bb4dc3eb20912a7579cc0f835bca3d35ee 100644 (file)
@@ -18,13 +18,13 @@ public:
   ~Key_performer ();
 
 protected:
-  virtual bool try_music (Musicev);
+  virtual bool try_music (Music *ev);
   virtual void create_audio_elements ();
   virtual void stop_translation_timestep ();
 
 private:
-  Eventkey_ev_;
-  Audio_keyaudio_;
+  Event *key_ev_;
+  Audio_key *audio_;
 };
 
 Key_performer::Key_performer ()
@@ -40,19 +40,19 @@ Key_performer::~Key_performer ()
 void
 Key_performer::create_audio_elements ()
 {
-  if (key_ev_) 
+  if (key_ev_)
     {
       SCM pitchlist = key_ev_->get_property ("pitch-alist");
       SCM proc = ly_lily_module_constant ("alterations-in-key");
-      
+
       SCM acc = scm_call_1 (proc, pitchlist);
-      
-      Pitch key_do (0, 
+
+      Pitch key_do (0,
                    scm_to_int (scm_caar (pitchlist)),
                    scm_to_int (scm_cdar (pitchlist)));
 
       Pitch c_do (0, 0, 0);
-                 
+
       SCM c_pitchlist
        = ly_transpose_key_alist (pitchlist,
                                  pitch_interval (key_do, c_do).smobbed_copy ());
@@ -80,9 +80,9 @@ Key_performer::stop_translation_timestep ()
 }
 
 bool
-Key_performer::try_music (Musicev)
+Key_performer::try_music (Music *ev)
 {
-  if (Event *kc = dynamic_cast <Event *> (ev))
+  if (Event *kc = dynamic_cast<Event *> (ev))
     {
       if (key_ev_)
        warning (_ ("FIXME: key change merge"));
@@ -95,6 +95,6 @@ Key_performer::try_music (Music* ev)
 }
 
 ADD_TRANSLATOR (Key_performer,
-                 "", "",
-                 "key-change-event",
-                 "", "", "");
+               "", "",
+               "key-change-event",
+               "", "", "");
index 8c4ca9134a44dd2ac03aae4d1498f988360a52e0..9d776d9dced43db842e25da46195bd647437b660 100644 (file)
 
 struct Key_signature_interface
 {
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
 
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
-
 /*
   FIXME: too much hardcoding here.
- */
+*/
 const int FLAT_TOP_PITCH =2; /* fes, ges, as and bes typeset in lower octave */
 const int SHARP_TOP_PITCH =4; /*  ais and bis typeset in lower octave */
 
 /*
-  TODO: look this up. I'm not sure where the naturals ought to go. 
- */
-const int NATURAL_TOP_PITCH = 4;  
-
-
+  TODO: look this up. I'm not sure where the naturals ought to go.
+*/
+const int NATURAL_TOP_PITCH = 4;
 
 
 /*
@@ -43,11 +40,10 @@ const int NATURAL_TOP_PITCH = 4;
 
   - TODO: put this in Scheme
 
-  TODO: can  we do without c0pos? it's partly musical. 
-
+  TODO: can  we do without c0pos? it's partly musical.
 */
 int
-alteration_pos  (SCM what, int alter, int c0p)
+alteration_pos (SCM what, int alter, int c0p)
 {
   if (scm_is_pair (what))
     return scm_to_int (scm_car (what)) * 7 + scm_to_int (scm_cdr (what)) + c0p;
@@ -60,41 +56,40 @@ alteration_pos  (SCM what, int alter, int c0p)
   from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
   int c0 = from_bottom_pos - 4;
 
-    
-  if ((alter <0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1))
-      || (alter >0 && ((p > SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))
-      || (alter == 0 && ((p > NATURAL_TOP_PITCH) || (p + c0>5)) && (p + c0>2)))
+  if ((alter <0 && ((p > FLAT_TOP_PITCH) || (p + c0 > 4)) && (p + c0 > 1))
+      || (alter >0 && ((p > SHARP_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2))
+      || (alter == 0 && ((p > NATURAL_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2)))
     {
       p -= 7; /* Typeset below c_position */
     }
-  
-  /* Provide for the four cases in which there's a glitch 
-       it's a hack, but probably not worth  
-       the effort of finding a nicer solution.
-       --dl. */
-  if (c0==2 && alter >0 && p ==3)
+
+  /* Provide for the four cases in which there's a glitch
+     it's a hack, but probably not worth
+     the effort of finding a nicer solution.
+     --dl. */
+  if (c0 == 2 && alter >0 && p ==3)
     p -= 7;
-  if (c0==-3 && alter>0 && p ==-1)
+  if (c0==-3 && alter > 0 && p ==-1)
     p += 7;
-  if (c0==-4 && alter<0 && p ==-1)
+  if (c0==-4 && alter < 0 && p ==-1)
     p += 7;
-  if (c0==-2 && alter<0 && p ==-3)
+  if (c0==-2 && alter < 0 && p ==-3)
     p += 7;
-    
+
   return p + c0;
 }
 
 /*
   TODO
   - space the `natural' signs wider
- */
+*/
 MAKE_SCHEME_CALLBACK (Key_signature_interface, print, 1);
 SCM
 Key_signature_interface::print (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
-  Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
+  Real inter = Staff_symbol_referencer::staff_space (me) / 2.0;
 
   SCM scm_style = me->get_property ("style");
   String style;
@@ -107,7 +102,7 @@ Key_signature_interface::print (SCM smob)
       style = "";
     }
 
-  SCM newas = me->get_property ("new-accidentals");  
+  SCM newas = me->get_property ("new-accidentals");
   Stencil mol;
 
   SCM c0s = me->get_property ("c0-position");
@@ -124,8 +119,8 @@ Key_signature_interface::print (SCM smob)
   for (SCM s = newas; scm_is_pair (s); s = scm_cdr (s))
     {
       int alteration = scm_to_int (scm_cdar (s));
-      String font_char =
-       Accidental_interface::get_fontcharname (style, alteration);
+      String font_char
+       Accidental_interface::get_fontcharname (style, alteration);
       Stencil acc (fm->find_by_name ("accidentals." + font_char));
 
       if (acc.is_empty ())
@@ -141,20 +136,19 @@ Key_signature_interface::print (SCM smob)
        }
     }
 
-  Item *it = dynamic_cast<Item*> (me) ;
+  Item *it = dynamic_cast<Item *> (me);
   if (it->break_status_dir () != RIGHT)
     {
       SCM old = me->get_property ("old-accidentals");
-      
+
       Stencil natural;
       if (scm_is_pair (old))
        natural = Font_interface::get_default_font (me)->
-           find_by_name (String ("accidentals.") + style + String ("0"));
-      
+         find_by_name (String ("accidentals.") + style + String ("0"));
 
       int last_pos = -100;
       for (; scm_is_pair (old); old = scm_cdr (old))
-        {
+       {
          SCM found = scm_assoc (scm_caar (old), newas);
          if (found == SCM_BOOL_F
              || scm_cdr (found) != scm_cdar (old))
@@ -164,29 +158,29 @@ Key_signature_interface::print (SCM smob)
              int pos = alteration_pos (what, alteration, c0p);
 
              Stencil m = natural;
-              m.translate_axis (pos* inter, Y_AXIS);
+             m.translate_axis (pos* inter, Y_AXIS);
 
              /*
                The natural sign (unlike flat & sharp)
                has vertical edges on both sides. A little padding is
                needed to prevent collisions.
-              */
+             */
              Real padding = 0.0;
              if (last_pos < pos + 2
-                 &&  last_pos> pos - 6)
+                 && last_pos> pos - 6)
                padding = 0.3;
-             
+
              mol.add_at_edge (X_AXIS, LEFT, m, padding, 0);
              last_pos = pos;
-            }
-        }
+           }
+       }
     }
 
   mol.align_to (X_AXIS, LEFT);
-  
+
   return mol.smobbed_copy ();
 }
 
 ADD_INTERFACE (Key_signature_interface, "key-signature-interface",
-  "A group of accidentals, to be printed as signature sign.",
-  "style c0-position old-accidentals new-accidentals");
+              "A group of accidentals, to be printed as signature sign.",
+              "style c0-position old-accidentals new-accidentals");
index 418542cd2566237b3d9a254ff4969c7bb3e2751f..378ad4e1683cfc9057b185d5647ef153faace639 100644 (file)
@@ -1,6 +1,6 @@
 /*
   keyword.cc -- keywords and identifiers
- */
+*/
 
 #include "keyword.hh"
 
@@ -8,7 +8,7 @@
 #include <cstdlib>
 
 /* for qsort */
-int tabcmp (Keyword_ent  const &p1, Keyword_ent const &p2)
+int tabcmp (Keyword_ent const &p1, Keyword_ent const &p2)
 {
   return strcmp (p1.name_, p2.name_);
 }
@@ -26,8 +26,8 @@ Keyword_table::Keyword_table (Keyword_ent *tab)
 int
 Keyword_table::lookup (char const *s) const
 {
-  Keyword_ent e ;
-  e.name_ =  s;
+  Keyword_ent e;
+  e.name_ = s;
   int idx = binary_search (table_, e, tabcmp);
   if (idx >= 0)
     return table_[idx].tokcode_;
index d589ea06fcf348f2b74f98f49fbdc18f95b52a79..e7f6b3058499bac455b5d39559a11e885d2ad591 100644 (file)
@@ -1,18 +1,17 @@
-/*   
+/*
   least-squares.cc -- implement minimise_least_squares
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "least-squares.hh"
 
 #include "warn.hh"
 
 void
-minimise_least_squares (Real * coef, Real * offset,
+minimise_least_squares (Real *coef, Real *offset,
                        Array<Offset> const &input)
 {
   Real sx = 0.0;
@@ -20,7 +19,7 @@ minimise_least_squares (Real * coef, Real * offset,
   Real sqx = 0.0;
   Real sxy = 0.0;
 
-  for (int i = 0; i < input.size ();i++) 
+  for (int i = 0; i < input.size ();i++)
     {
       Real x = input[i][X_AXIS];
       Real y = input[i][Y_AXIS];
@@ -33,18 +32,18 @@ minimise_least_squares (Real * coef, Real * offset,
 
   *coef = 0.0;
   *offset = 0.;
-  
-  Real den = (N*sqx - sqr (sx));
+
+  Real den = (N *sqx - sqr (sx));
   if (!N || !den)
     {
       programming_error ("minimise_least_squares ():  Nothing to minimise");
       *coef = 0.0;
-      *offset = N ? sy/N : 0.0;
+      *offset = N ? sy / N : 0.0;
     }
   else
     {
-      *coef = (N * sxy - sx*sy)/den;
-      *offset = (sy - (*coef) * sx)/N;
+      *coef = (N *sxy - sx*sy) / den;
+      *offset = (sy - (*coef) * sx) / N;
     }
 }
 
index 9cd1741fab1953616ec103a48bf3452326d823e1..b077ff33799dab901439f4c28ae3fb4edac25367 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   ledger-line-engraver.cc -- implement Ledger_line_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "group-interface.hh"
@@ -13,7 +12,7 @@
 
 class Ledger_line_engraver : public Engraver
 {
-  Spanner * span_;
+  Spanner *span_;
 
 public:
   TRANSLATOR_DECLARATIONS (Ledger_line_engraver);
@@ -24,7 +23,7 @@ protected:
   virtual void acknowledge_grob (Grob_info);
 };
 
-Ledger_line_engraver::Ledger_line_engraver()
+Ledger_line_engraver::Ledger_line_engraver ()
 {
   span_ = 0;
 }
@@ -34,8 +33,8 @@ Ledger_line_engraver::process_music ()
 {
   if (!span_)
     {
-      span_ = make_spanner("LedgerLineSpanner", SCM_EOL);
-  
+      span_ = make_spanner ("LedgerLineSpanner", SCM_EOL);
+
       span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
     }
 }
@@ -47,7 +46,6 @@ Ledger_line_engraver::finalize ()
     span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
 }
 
-
 void
 Ledger_line_engraver::acknowledge_grob (Grob_info s)
 {
@@ -56,9 +54,9 @@ Ledger_line_engraver::acknowledge_grob (Grob_info s)
                                       s.grob_);
 }
 ADD_TRANSLATOR (Ledger_line_engraver,
-                  "Creates the spanner to draw ledger lines, and notices objects that need ledger lines",
-                  /* creats*/       "LedgerLineSpanner",
-                  /* accepts */     "",
-                  /* acks  */      "ledgered-interface", // ledgered-interface? 
-                  /* reads */       "",
-                  /* write */       "")
+               "Creates the spanner to draw ledger lines, and notices objects that need ledger lines",
+               /* creats*/ "LedgerLineSpanner",
+               /* accepts */ "",
+               /* acks  */ "ledgered-interface", // ledgered-interface? 
+               /* reads */ "",
+               /* write */ "")
index 903a97bb1f88d3c46f450f02e4463944862e6809..186f976fd78e77f104d28011c0fc7f30a0a33584 100644 (file)
@@ -1,28 +1,27 @@
-/* 
+/*
   ledger-line-spanner.cc -- implement Ledger_line_spanner
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include <map>
 #include <set>
 
 #include "item.hh"
-#include "note-head.hh" 
-#include "staff-symbol-referencer.hh" 
-#include "staff-symbol.hh" 
-#include "lookup.hh" 
-#include "spanner.hh" 
-#include "group-interface.hh" 
+#include "note-head.hh"
+#include "staff-symbol-referencer.hh"
+#include "staff-symbol.hh"
+#include "lookup.hh"
+#include "spanner.hh"
+#include "group-interface.hh"
 #include "paper-column.hh"
 
 struct Ledger_line_spanner
 {
-  DECLARE_SCHEME_CALLBACK (print, (SCM ));
-  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
   static Stencil brew_ledger_lines (Grob *me,
                                    int pos,
                                    int interspaces,
@@ -30,10 +29,9 @@ struct Ledger_line_spanner
                                    Interval x_extent,
                                    Real left_shorten);
 
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
-
 Stencil
 Ledger_line_spanner::brew_ledger_lines (Grob *staff,
                                        int pos,
@@ -50,68 +48,65 @@ Ledger_line_spanner::brew_ledger_lines (Grob *staff,
   if (line_count)
     {
       Real blotdiameter = ledgerlinethickness;
-      Interval y_extent =
-       Interval (-0.5*(ledgerlinethickness),
-                 +0.5*(ledgerlinethickness));
-      Stencil proto_ledger_line =
-       Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter);
+      Interval y_extent
+       = Interval (-0.5* (ledgerlinethickness),
+                   +0.5* (ledgerlinethickness));
+      Stencil proto_ledger_line
+       Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter);
 
       x_extent[LEFT] += left_shorten;
-      Stencil proto_first_line =
-       Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter);
+      Stencil proto_first_line
+       Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter);
 
       Direction dir = (Direction)sign (pos);
       Real offs = (Staff_symbol_referencer::on_staffline (staff, pos))
-        ? 0.0
-        : -dir * halfspace;
-
+       ? 0.0
+       : -dir * halfspace;
 
       offs += pos * halfspace;
       for (int i = 0; i < line_count; i++)
-        {
-          Stencil ledger_line ((i == 0) 
-                               ? proto_first_line
-                               : proto_ledger_line
-                               );
-          ledger_line.translate_axis (-dir * halfspace * i * 2 + offs, Y_AXIS);
-          stencil.add_stencil (ledger_line);
-        }
+       {
+         Stencil ledger_line ((i == 0)
+                              ? proto_first_line
+                              : proto_ledger_line);
+         ledger_line.translate_axis (-dir * halfspace * i * 2 + offs, Y_AXIS);
+         stencil.add_stencil (ledger_line);
+       }
     }
 
   return stencil;
 }
 
-
-typedef std::map<int, Drul_array<Interval> > Head_extents_map;
-typedef std::map<int, Grob*> Column_map;
+typedef std::map < int, Drul_array<Interval> > Head_extents_map;
+typedef std::map < int, Grob *> Column_map;
 
 MAKE_SCHEME_CALLBACK (Ledger_line_spanner, set_spacing_rods, 1);
 SCM
 Ledger_line_spanner::set_spacing_rods (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (smob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
 
   // find size of note heads.
-  Grob * staff = Staff_symbol_referencer::get_staff_symbol (me);
+  Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
   if (!staff)
     return SCM_EOL;
 
   Link_array<Grob> heads (extract_grob_array (me, ly_symbol2scm ("note-heads")));
-  
+
   if (heads.is_empty ())
     return SCM_EOL;
-  
+
   Real min_length_fraction
     = robust_scm2double (me->get_property ("minimum-length-fraction"), 0.15);
-  
+
   Head_extents_map head_extents;
   Column_map columns;
-  
-  int interspaces = Staff_symbol::line_count (staff)-1;
-  for (int i = heads.size (); i--; )
+
+  int interspaces = Staff_symbol::line_count (staff) - 1;
+  for (int i = heads.size (); i--;)
     {
-      Item *h = dynamic_cast<Item*> (heads[i]);
-      
+      Item *h = dynamic_cast<Item *> (heads[i]);
+
       int pos = Staff_symbol_referencer::get_rounded_position (h);
       if (pos
          && abs (pos) > interspaces)
@@ -123,47 +118,47 @@ Ledger_line_spanner::set_spacing_rods (SCM smob)
          Direction vdir = Direction (sign (pos));
          if (!vdir)
            continue;
-         
-         Interval prev_extent; 
+
+         Interval prev_extent;
 
          Head_extents_map::iterator j = head_extents.find (rank);
          if (j != head_extents.end ())
            prev_extent = (*j).second[vdir];
          else
            columns[rank] = column;
-         
+
          prev_extent.unite (head_extent);
          head_extents[rank][vdir] = prev_extent;
        }
     }
 
-  for (Column_map::const_iterator c (columns.begin()); c != columns.end(); c++)
+  for (Column_map::const_iterator c (columns.begin ()); c != columns.end (); c++)
     {
       Grob *column = (*c).second;
       int rank = (*c).first;
 
       int next_rank = rank + 2;
-      
+
       if (head_extents.find (next_rank) != head_extents.end ())
        {
-         Drul_array<Interval> extents_left = head_extents[rank]; 
-         Drul_array<Interval> extents_right = head_extents[next_rank]; 
+         Drul_array<Interval> extents_left = head_extents[rank];
+         Drul_array<Interval> extents_right = head_extents[next_rank];
 
          Direction d = DOWN;
          do
            {
              if (!extents_right[d].is_empty () && !extents_right[d].is_empty ())
                {
-                 Real l1 = extents_right[d].length() * min_length_fraction;
-                 Real l2 = extents_left[d].length() * min_length_fraction;
+                 Real l1 = extents_right[d].length () * min_length_fraction;
+                 Real l2 = extents_left[d].length () * min_length_fraction;
 
                  Rod rod;
-                 rod.distance_ = l1 + l2 + (l1+ l2)/2.0
+                 rod.distance_ = l1 + l2 + (l1+ l2) / 2.0
                    + extents_left[d][RIGHT]
                    - extents_right[d][LEFT];
-                 
-                 rod.item_drul_[LEFT] = dynamic_cast<Item*> (column);
-                 rod.item_drul_[RIGHT] = dynamic_cast<Item*> (columns[next_rank]);
+
+                 rod.item_drul_[LEFT] = dynamic_cast<Item *> (column);
+                 rod.item_drul_[RIGHT] = dynamic_cast<Item *> (columns[next_rank]);
                  rod.add_to_cols ();
                }
            }
@@ -174,66 +169,64 @@ Ledger_line_spanner::set_spacing_rods (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
-
 struct Ledger_request
 {
   Interval ledger_extent_;
   Interval head_extent_;
   int position_;
   bool excentric_;
-  Ledger_request () {
+  Ledger_request ()
+  {
     ledger_extent_.set_empty ();
     head_extent_.set_empty ();
     position_ = 0;
   }
 };
 
-typedef std::map<int, Drul_array<Ledger_request> > Ledger_requests;
-
+typedef std::map < int, Drul_array<Ledger_request> > Ledger_requests;
 
 /*
   TODO: ledger share a lot of info. Lots of room to optimize away common
   use of objects/variables.
- */
+*/
 MAKE_SCHEME_CALLBACK (Ledger_line_spanner, print, 1);
 SCM
 Ledger_line_spanner::print (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (smob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
   Link_array<Grob> heads (extract_grob_array (me, ly_symbol2scm ("note-heads")));
 
   if (heads.is_empty ())
     return SCM_EOL;
-  
+
   // find size of note heads.
-  Grob * staff = Staff_symbol_referencer::get_staff_symbol (me);
+  Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
   if (!staff)
     return SCM_EOL;
-  
-    
+
   Real length_fraction
     = robust_scm2double (me->get_property ("length-fraction"), 0.25);
 
   Stencil ledgers;
   Stencil default_ledger;
 
-  Grob * common[NO_AXES];
-  
-  for (int i = X_AXIS;  i < NO_AXES; i++)
+  Grob *common[NO_AXES];
+
+  for (int i = X_AXIS; i < NO_AXES; i++)
     {
       Axis a = Axis (i);
       common[a] = common_refpoint_of_array (heads, me, a);
-      for (int i = heads.size (); i--; )
-       if (Grob * g = unsmob_grob (me->get_property ("accidental-grob")))
+      for (int i = heads.size (); i--;)
+       if (Grob *g = unsmob_grob (me->get_property ("accidental-grob")))
          common[a] = common[a]->common_refpoint (g, a);
     }
 
-  int interspaces = Staff_symbol::line_count (staff)-1;
+  int interspaces = Staff_symbol::line_count (staff) - 1;
   Ledger_requests reqs;
-  for (int i = heads.size (); i--; )
+  for (int i = heads.size (); i--;)
     {
-      Item *h = dynamic_cast<Item*> (heads[i]);
-      
+      Item *h = dynamic_cast<Item *> (heads[i]);
+
       int pos = Staff_symbol_referencer::get_rounded_position (h);
       if (pos
          && abs (pos) > interspaces)
@@ -244,11 +237,11 @@ Ledger_line_spanner::print (SCM smob)
 
          Direction vdir = Direction (sign (pos));
          int rank = Paper_column::get_rank (h->get_column ());
-         
+
          reqs[rank][vdir].ledger_extent_.unite (ledger_extent);
          reqs[rank][vdir].head_extent_.unite (head_extent);
-         reqs[rank][vdir].position_ =
-           vdir * ((vdir* reqs[rank][vdir].position_) >? (vdir *pos));
+         reqs[rank][vdir].position_
+           vdir * ((vdir* reqs[rank][vdir].position_) >? (vdir *pos));
        }
     }
 
@@ -262,16 +255,16 @@ Ledger_line_spanner::print (SCM smob)
        {
          continue;
        }
-      
+
       Direction d = DOWN;
       do
        {
          if (abs (last->second[d].position_) > interspaces
              && abs (i->second[d].position_) > interspaces)
            {
-             Real center =  
-               (last->second[d].head_extent_[RIGHT]
-                + i->second[d].head_extent_[LEFT] )/2;
+             Real center
+               (last->second[d].head_extent_[RIGHT]
+                  + i->second[d].head_extent_[LEFT]) / 2;
 
              Direction which = LEFT;
              do
@@ -279,28 +272,28 @@ Ledger_line_spanner::print (SCM smob)
                  Ledger_request &lr = ((which == LEFT) ? *last : *i).second[d];
 
                  // due tilt of quarter note-heads
-                 bool both =
-                    (abs (last->second[d].position_) > interspaces + 1
-                     && abs (i->second[d].position_) > interspaces + 1);
+                 bool both
+                   = (abs (last->second[d].position_) > interspaces + 1
+                      && abs (i->second[d].position_) > interspaces + 1);
 
-                 Real limit = (center + (both? which * gap/2 : 0));
+                 Real limit = (center + (both? which * gap / 2 : 0));
                  lr.ledger_extent_.elem_ref (-which)
-                   = which  * (which * lr.ledger_extent_[-which] >? which * limit);
+                   = which * (which * lr.ledger_extent_[-which] >? which * limit);
                }
-             while (flip (&which) != LEFT); 
+             while (flip (&which) != LEFT);
            }
        }
-      while (flip (&d) != DOWN); 
+      while (flip (&d) != DOWN);
     }
 
   // create  ledgers for note heads
-  Real ledgerlinethickness =
-    Staff_symbol::get_ledger_line_thickness (staff);
-  Real halfspace = Staff_symbol::staff_space (staff)/2;
-  for (int i = heads.size (); i--; )
+  Real ledgerlinethickness
+    Staff_symbol::get_ledger_line_thickness (staff);
+  Real halfspace = Staff_symbol::staff_space (staff) / 2;
+  for (int i = heads.size (); i--;)
     {
-      Item *h = dynamic_cast<Item*> (heads[i]);
-      
+      Item *h = dynamic_cast<Item *> (heads[i]);
+
       int pos = Staff_symbol_referencer::get_rounded_position (h);
       if (abs (pos) > interspaces + 1)
        {
@@ -308,25 +301,25 @@ Ledger_line_spanner::print (SCM smob)
          Interval ledger_size = head_size;
          ledger_size.widen (ledger_size.length ()* length_fraction);
 
-         Interval max_size = reqs[Paper_column::get_rank (h->get_column ())][Direction (sign(pos))].ledger_extent_;
+         Interval max_size = reqs[Paper_column::get_rank (h->get_column ())][Direction (sign (pos))].ledger_extent_;
 
          ledger_size.intersect (max_size);
          Real left_shorten = 0.0;
-         if (Grob * g = unsmob_grob (h->get_property ("accidental-grob")))
+         if (Grob *g = unsmob_grob (h->get_property ("accidental-grob")))
            {
              Interval accidental_size = g->extent (common[X_AXIS], X_AXIS);
-             Real d =
-               linear_combination (Drul_array<Real> (accidental_size[RIGHT],
-                                                     head_size[LEFT]),                                 
-                                   0.0);
+             Real d
+               linear_combination (Drul_array<Real> (accidental_size[RIGHT],
+                                                       head_size[LEFT]),
+                                     0.0);
 
-             left_shorten =  (-ledger_size[LEFT] + d) >?  0 ;
+             left_shorten = (-ledger_size[LEFT] + d) >? 0;
 
              /*
                TODO: shorten 2 ledger lines for the case natural +
                downstem.
              */
-             
+
            }
 
          ledgers.add_stencil (brew_ledger_lines (staff, pos, interspaces,
@@ -339,7 +332,7 @@ Ledger_line_spanner::print (SCM smob)
 
   ledgers.translate_axis (-me->relative_coordinate (common[X_AXIS], X_AXIS),
                          X_AXIS);
-  
+
   return ledgers.smobbed_copy ();
 }
 
@@ -348,9 +341,9 @@ ADD_INTERFACE (Ledger_line_spanner,
               "This spanner draws the ledger lines of a staff, for note heads that stick out. ",
               "note-heads thickness minimum-length-fraction length-fraction gap");
 
-
-struct Ledgered_interface { 
-  static bool has_interface (Grob*);
+struct Ledgered_interface
+{
+  static bool has_interface (Grob *);
 };
 
 ADD_INTERFACE (Ledgered_interface,
index 1cd45912240950ad6ad96c45f33f7b753c16409c..eec8ff0cfa8b3b9a6dd3b26e688f15c8b463b79d 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   ligature-bracket-engraver.cc -- implement Ligature_bracket_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
-  
- */
+*/
 
 #include "ligature-engraver.hh"
 #include "note-column.hh"
@@ -27,7 +26,6 @@ public:
   TRANSLATOR_DECLARATIONS (Ligature_bracket_engraver);
 };
 
-
 Ligature_bracket_engraver::Ligature_bracket_engraver ()
 {
 }
@@ -38,7 +36,6 @@ Ligature_bracket_engraver::create_ligature_spanner ()
   return make_spanner ("LigatureBracket", SCM_EOL);
 }
 
-
 void
 Ligature_bracket_engraver::acknowledge_grob (Grob_info info)
 {
@@ -47,16 +44,16 @@ Ligature_bracket_engraver::acknowledge_grob (Grob_info info)
       if (Note_column::has_interface (info.grob_))
        {
          Tuplet_bracket::add_column (current_ligature (),
-                                     dynamic_cast<Item*> (info.grob_));
+                                     dynamic_cast<Item *> (info.grob_));
        }
       else Ligature_engraver::acknowledge_grob (info);
     }
 }
 
 ADD_TRANSLATOR (Ligature_bracket_engraver,
-/* descr */       "Handles Ligature_events by engraving Ligature brackets.",
-/* creats*/       "TupletBracket",
-/* accepts */     "ligature-event",
-/* acks  */      "rest-interface note-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Handles Ligature_events by engraving Ligature brackets.",
+               /* creats*/ "TupletBracket",
+               /* accepts */ "ligature-event",
+               /* acks  */ "rest-interface note-column-interface",
+               /* reads */ "",
+               /* write */ "");
index 29d177d6a5db93def6826d4f28dbba8c70f7489a..666c01cf1144565c1d00d26b61a4fa50b1db0659 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   ligature-engraver.cc -- implement Ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>
-  
- */
+*/
 
 #include "ligature-engraver.hh"
 
@@ -188,8 +187,8 @@ Ligature_engraver::process_music ()
 
       prev_start_req_ = reqs_drul_[START];
       ligature_ = create_ligature_spanner ();
-      brew_ligature_primitive_proc =
-       ligature_->get_property ("ligature-primitive-callback");
+      brew_ligature_primitive_proc
+       ligature_->get_property ("ligature-primitive-callback");
       if (brew_ligature_primitive_proc == SCM_EOL)
        {
          warning ("Ligature_engraver: ligature-primitive-callback undefined");
@@ -274,7 +273,7 @@ Ligature_engraver::acknowledge_grob (Grob_info info)
        {
          primitives_.push (info);
          info.grob_->set_property ("print-function",
-                                        brew_ligature_primitive_proc);
+                                   brew_ligature_primitive_proc);
        }
       if (Rest::has_interface (info.grob_))
        {
@@ -287,9 +286,9 @@ Ligature_engraver::acknowledge_grob (Grob_info info)
 }
 
 ADD_TRANSLATOR (Ligature_engraver,
-/* descr */       "Abstract class; a concrete subclass handles Ligature_events by engraving Ligatures in a concrete style.",
-/* creats */      "",
-/* accepts */     "ligature-event",
-/* acks  */      "note-head-interface rest-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Abstract class; a concrete subclass handles Ligature_events by engraving Ligatures in a concrete style.",
+               /* creats */ "",
+               /* accepts */ "ligature-event",
+               /* acks  */ "note-head-interface rest-interface",
+               /* reads */ "",
+               /* write */ "");
index 9cb3f082c46796151c2be80981da3774d1ca8b73..0547aef254ed2e98b70533d5ac5586feee71beaa 100644 (file)
@@ -4,10 +4,9 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #include <cstdio>
 #include <cstdlib>
 #include <cstring> /* strdup, strchr */
@@ -52,13 +51,13 @@ ly_last (SCM list)
 SCM
 ly_write2scm (SCM s)
 {
-  SCM port = scm_mkstrport (SCM_INUM0, 
+  SCM port = scm_mkstrport (SCM_INUM0,
                            scm_make_string (SCM_INUM0, SCM_UNDEFINED),
                            SCM_OPN | SCM_WRTNG,
                            "ly_write2string");
   //  SCM write = scm_eval_3 (ly_symbol2scm ("write"), s, SCM_EOL);
   SCM write = scm_primitive_eval (ly_symbol2scm ("write"));
-  
+
   // scm_apply (write, port, SCM_EOL);
   scm_call_2 (write, s, port);
   return scm_strport_to_string (port);
@@ -75,7 +74,7 @@ ly_symbol2string (SCM s)
 {
   /*
     Ugh. this is not very efficient.
-   */
+  */
   SCM str = scm_symbol_to_string (s);
   return ly_scm2string (str);
 }
@@ -102,32 +101,30 @@ gulp_file_to_string (String fn, bool must_exist)
 
   int n;
   char *str = gulp_file (s, &n);
-  String result ((Byte*) str, n);
+  String result ((Byte *) str, n);
   delete[] str;
-  
+
   if (be_verbose_global)
     progress_indication ("]");
 
   return result;
 }
 
-
-
 extern "C" {
   // maybe gdb 5.0 becomes quicker if it doesn't do fancy C++ typing?
-void
-ly_display_scm (SCM s)
-{
-  scm_display (s, scm_current_output_port ());
-  scm_newline (scm_current_output_port ());
-}
+  void
+  ly_display_scm (SCM s)
+  {
+    scm_display (s, scm_current_output_port ());
+    scm_newline (scm_current_output_port ());
+  }
 };
 
 String
 ly_scm2string (SCM str)
 {
   assert (scm_is_string (str));
-  return String ((Byte*)scm_i_string_chars (str),
+  return String ((Byte *)scm_i_string_chars (str),
                 (int) scm_i_string_length (str));
 }
 
@@ -191,13 +188,13 @@ extern "C" {
   void initialize_kpathsea ();
 }
 #endif
-    
+
 void
 ly_init_ly_module (void *)
 {
-  for (int i = scm_init_funcs_->size () ; i--;)
+  for (int i = scm_init_funcs_->size (); i--;)
     (scm_init_funcs_->elem (i)) ();
+
   if (be_verbose_global)
     progress_indication ("\n");
 
@@ -207,7 +204,7 @@ ly_init_ly_module (void *)
       initialize_kpathsea ();
     }
 #endif
-  
+
   scm_primitive_load_path (scm_makfrom0str ("lily.scm"));
 }
 
@@ -232,7 +229,7 @@ is_direction (SCM s)
   if (scm_is_number (s))
     {
       int i = scm_to_int (s);
-      return i>= -1 && i <= 1; 
+      return i>= -1 && i <= 1;
     }
   return false;
 }
@@ -286,7 +283,7 @@ appendable_list ()
 {
   SCM s = scm_cons (SCM_EOL, SCM_EOL);
   scm_set_car_x (s, s);
-  
+
   return s;
 }
 
@@ -294,8 +291,8 @@ void
 appendable_list_append (SCM l, SCM elt)
 {
   SCM newcons = scm_cons (elt, SCM_EOL);
-  
-  scm_set_cdr_x (scm_car (l), newcons);      
+
+  scm_set_cdr_x (scm_car (l), newcons);
   scm_set_car_x (l, newcons);
 }
 
@@ -321,10 +318,10 @@ ly_deep_copy (SCM src)
     {
       int len = scm_c_vector_length (src);
       SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
-      for (int i = 0 ;i < len ; i++)
+      for (int i = 0;i < len; i++)
        {
          SCM si = scm_int2num (i);
-         scm_vector_set_x (nv, si, ly_deep_copy (scm_vector_ref (src, si))); 
+         scm_vector_set_x (nv, si, ly_deep_copy (scm_vector_ref (src, si)));
        }
     }
   return src;
@@ -365,19 +362,16 @@ ly_chain_assoc (SCM key, SCM achain)
    Returns first match found, i.e.
 
    alist = ((1 . 10)
-                   ((1 . 2) . 11)
-                   ((2 . 1) . 12)
-                   ((3 . 0) . 13)
-                   ((4 . 1) . 14) )
-
-I would like (ly_assoc_cdr 1) to return 12 - because it's the first
-element with the cdr of the key = 1.  In other words (alloc_cdr key)
-corresponds to call
-
-(alloc (anything . key))
-
+   ((1 . 2) . 11)
+   ((2 . 1) . 12)
+   ((3 . 0) . 13)
+   ((4 . 1) . 14) )
 
+   I would like (ly_assoc_cdr 1) to return 12 - because it's the first
+   element with the cdr of the key = 1.  In other words (alloc_cdr key)
+   corresponds to call
 
+   (alloc (anything . key))
 */
 SCM
 ly_assoc_cdr (SCM key, SCM alist)
@@ -402,11 +396,11 @@ parse_symbol_list (char const *lst)
   char *orig = s;
   SCM create_list = SCM_EOL;
 
-  char * e = s + strlen (s) - 1;
+  char *e = s + strlen (s) - 1;
   while (e >= s && isspace (*e))
     *e-- = 0;
 
-  for (char * p = s; *p; p++)
+  for (char *p = s; *p; p++)
     if (*p == '\n')
       *p = ' ';
   
@@ -453,11 +447,11 @@ print_scm_val (SCM val)
     realval = realval.left_string (100)
       + "\n :\n :\n"
       + realval.right_string (100);
-  return realval;       
+  return realval;
 }
 
 bool
-type_check_assignment (SCM sym, SCM val,  SCM type_symbol) 
+type_check_assignment (SCM sym, SCM val, SCM type_symbol)
 {
   bool ok = true;
 
@@ -466,7 +460,7 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
 
 
     TODO: should remove #f from allowed vals?
-   */
+  */
   if (val == SCM_EOL || val == SCM_BOOL_F)
     return ok;
 
@@ -480,26 +474,26 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
     TODO: deprecate the use of \override and \revert for
     autoBeamSettings?
 
-    or use a symbol autoBeamSettingS?  
-   */
-  return true; 
+    or use a symbol autoBeamSettingS?
+  */
+  return true;
 #endif
-  
+
   SCM type = scm_object_property (sym, type_symbol);
 
   if (type != SCM_EOL && !ly_c_procedure_p (type))
-      {
-       warning (_f ("Can't find property type-check for `%s' (%s).",
-                    ly_symbol2string (sym).to_str0 (),
-                    ly_symbol2string (type_symbol).to_str0 ())
-                + "  " + _ ("Perhaps you made a typing error?"));
-
-       /* Be strict when being anal :) */
-       if (do_internal_type_checking_global)
-         abort ();
-       
-       warning (_ ("Doing assignment anyway."));
-      }
+    {
+      warning (_f ("Can't find property type-check for `%s' (%s).",
+                  ly_symbol2string (sym).to_str0 (),
+                  ly_symbol2string (type_symbol).to_str0 ())
+              + "  " + _ ("Perhaps you made a typing error?"));
+
+      /* Be strict when being anal :) */
+      if (do_internal_type_checking_global)
+       abort ();
+
+      warning (_ ("Doing assignment anyway."));
+    }
   else
     {
       if (val != SCM_EOL
@@ -511,24 +505,21 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
          SCM typefunc = ly_lily_module_constant ("type-name");
          SCM type_name = scm_call_1 (typefunc, type);
 
-        
          scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'",
                        ly_symbol2string (sym).to_str0 (),
                        print_scm_val (val),
                        ly_scm2string (type_name).to_str0 ()).to_str0 (),
                    errport);
-         scm_puts ("\n", errport);                   
+         scm_puts ("\n", errport);
        }
     }
   return ok;
 }
 
-
 /* some SCM abbrevs
 
-   zijn deze nou handig?
-   zijn ze er al in scheme, maar heten ze anders? */
-
+zijn deze nou handig?
+zijn ze er al in scheme, maar heten ze anders? */
 
 /* Remove doubles from (sorted) list */
 SCM
@@ -544,12 +535,11 @@ ly_unique (SCM list)
   return scm_reverse_x (unique, SCM_EOL);
 }
 
-
 static int
 scm_default_compare (void const *a, void const *b)
 {
-  SCM pa = *(SCM*) a;
-  SCM pb = *(SCM*) b;
+  SCM pa = *(SCM *) a;
+  SCM pb = *(SCM *) b;
   if (pa == pb)
     return 0;
   return pa < pb ? -1 : 1;
@@ -579,10 +569,9 @@ ly_list_qsort_uniq_x (SCM lst)
   *tail = SCM_EOL;
   delete[] arr;
 
-  return lst; 
+  return lst;
 }
 
-
 /* tail add */
 SCM
 ly_snoc (SCM s, SCM list)
@@ -605,22 +594,21 @@ ly_split_list (SCM s, SCM list)
        break;
       before = scm_cons (i, before);
     }
-  return scm_cons ( scm_reverse_x (before, SCM_EOL),  after);
-  
-}
+  return scm_cons (scm_reverse_x (before, SCM_EOL), after);
 
+}
 
 void
 taint (SCM *)
 {
   /*
     nop.
-   */
+  */
 }
 
 /*
   display stuff without using stack
- */
+*/
 SCM
 display_list (SCM s)
 {
@@ -630,7 +618,7 @@ display_list (SCM s)
   for (; scm_is_pair (s); s = scm_cdr (s))
     {
       scm_display (scm_car (s), p);
-      scm_puts (" ", p);      
+      scm_puts (" ", p);
     }
   scm_puts (")", p);
   return SCM_UNSPECIFIED;
@@ -643,13 +631,13 @@ int_list_to_slice (SCM l)
   s.set_empty ();
   for (; scm_is_pair (l); l = scm_cdr (l))
     if (scm_is_number (scm_car (l)))
-      s.add_point (scm_to_int (scm_car (l))); 
+      s.add_point (scm_to_int (scm_car (l)));
   return s;
 }
 
 /* Return I-th element, or last elt L. If I < 0, then we take the first
    element.
-   
+
    PRE: length (L) > 0  */
 SCM
 robust_list_ref (int i, SCM l)
@@ -708,17 +696,16 @@ alist_to_hashq (SCM alist)
   int i = scm_ilength (alist);
   if (i < 0)
     return scm_c_make_hash_table (0);
-         
+
   SCM tab = scm_c_make_hash_table (i);
   for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM pt = scm_cdar (s);
       scm_hashq_set_x (tab, scm_caar (s), pt);
     }
-  return tab; 
+  return tab;
 }
 
-
 bool
 alist_equal_p (SCM a, SCM b)
 {
@@ -730,15 +717,13 @@ alist_equal_p (SCM a, SCM b)
       SCM l = scm_assoc (key, b);
 
       if (l == SCM_BOOL_F
-         || !ly_c_equal_p ( scm_cdr (l), val))
+         || !ly_c_equal_p (scm_cdr (l), val))
 
        return false;
     }
   return true;
 }
 
-
-
 SCM
 ly_alist_vals (SCM alist)
 {
@@ -757,5 +742,3 @@ ly_hash2alist (SCM tab)
   return scm_call_1 (func, tab);
 }
 
-
-
index bc748f1f2da39d7d710673eab5493bb1c2d45560..1840e54f17e0dbfc07743250bfa58ca43b2ba707 100644 (file)
@@ -20,7 +20,8 @@
 #include "main.hh"
 #include "moment.hh"
 
-static Keyword_ent the_key_tab[] = {
+static Keyword_ent the_key_tab[]
+= {
   {"accepts", ACCEPTS},
   {"addquote", ADDQUOTE},
   {"addlyrics", ADDLYRICS},
@@ -82,19 +83,18 @@ static Keyword_ent the_key_tab[] = {
   {0, 0}
 };
 
-
 Lily_lexer::Lily_lexer (Sources *sources)
 {
   keytable_ = new Keyword_table (the_key_tab);
   chordmodifier_tab_ = SCM_EOL;
-  pitchname_tab_stack_ = SCM_EOL; 
+  pitchname_tab_stack_ = SCM_EOL;
   sources_ = sources;
   scopes_ = SCM_EOL;
-  error_level_ = 0; 
+  error_level_ = 0;
   is_main_input_ = false;
 
   smobify_self ();
-  
+
   add_scope (ly_make_anonymous_module (false));
   push_note_state (scm_c_make_hash_table (0));
   chordmodifier_tab_ = scm_make_vector (scm_int2num (1), SCM_EOL);
@@ -107,14 +107,14 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src)
   chordmodifier_tab_ = src.chordmodifier_tab_;
   pitchname_tab_stack_ = src.pitchname_tab_stack_;
   sources_ = src.sources_;
-  
-  error_level_ = src.error_level_; 
+
+  error_level_ = src.error_level_;
   is_main_input_ = src.is_main_input_;
 
   scopes_ = SCM_EOL;
-  
+
   smobify_self ();
-  
+
   SCM scopes = SCM_EOL;
   SCM *tail = &scopes;
   for (SCM s = src.scopes_; scm_is_pair (s); s = scm_cdr (s))
@@ -124,8 +124,8 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src)
       *tail = scm_cons (newmod, SCM_EOL);
       tail = SCM_CDRLOC (*tail);
     }
-  
-  scopes_ =  scopes;
+
+  scopes_ = scopes;
   push_note_state (scm_c_make_hash_table (0));
 }
 
@@ -156,7 +156,6 @@ Lily_lexer::remove_scope ()
   return sc;
 }
 
-
 int
 Lily_lexer::lookup_keyword (String s)
 {
@@ -187,7 +186,7 @@ Lily_lexer::start_main_input ()
 {
   // yy_flex_debug = 1;
   new_input (main_input_name_, sources_);
-  
+
   /* Do not allow \include in --safe-mode */
   allow_includes_b_ = allow_includes_b_ && !be_safe_global;
 
@@ -201,14 +200,14 @@ Lily_lexer::set_identifier (SCM name, SCM s)
 {
   SCM sym = name;
   if (scm_is_string (name))
-    sym =  scm_string_to_symbol (name);
-  
+    sym = scm_string_to_symbol (name);
+
   if (scm_is_symbol (sym))
     {
       if (lookup_keyword (ly_symbol2string (sym)) >= 0)
        {
-         String symstr = ly_symbol2string (sym); 
-         warning (_f ("Identifier name is a keyword: `%s'", symstr.to_str0()));
+         String symstr = ly_symbol2string (sym);
+         warning (_f ("Identifier name is a keyword: `%s'", symstr.to_str0 ()));
        }
 
       SCM mod = scm_car (scopes_);
@@ -264,9 +263,9 @@ Lily_lexer::prepare_for_next_token ()
 }
 
 /**
-  Since we don't create the buffer state from the bytes directly, we
-  don't know about the location of the lexer. Add this as a
-  YY_USER_ACTION */
+   Since we don't create the buffer state from the bytes directly, we
+   don't know about the location of the lexer. Add this as a
+   YY_USER_ACTION */
 void
 Lily_lexer::add_lexed_char (int count)
 {
@@ -276,7 +275,6 @@ Lily_lexer::add_lexed_char (int count)
   char_count_stack_.top () += count;
 }
 
-
 #include "ly-smobs.icc"
 
 IMPLEMENT_SMOBS (Lily_lexer);
@@ -286,7 +284,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Lily_lexer);
 SCM
 Lily_lexer::mark_smob (SCM s)
 {
-  Lily_lexer *lexer = (Lily_lexer*) SCM_CELL_WORD_1 (s);
+  Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s);
 
   scm_gc_mark (lexer->chordmodifier_tab_);
   scm_gc_mark (lexer->pitchname_tab_stack_);
index 69c90478b18f282c5a0349d95b96edd5e42dbe65..4a46421089164013065170f7fceca1a84678b787 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "file-name.hh"
@@ -13,7 +12,7 @@
 #include "lily-parser.hh"
 #include "warn.hh"
 #include "source.hh"
-#include "lily-lexer.hh" 
+#include "lily-lexer.hh"
 #include "score.hh"
 #include "lilypond-key.hh"
 #include "ly-module.hh"
@@ -48,14 +47,14 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
   File_name out_file_name (file_name);
 
   global_path.append (out_file_name.dir_);
-  
+
   out_file_name.ext_ = "";
   out_file_name.root_ = "";
   out_file_name.dir_ = "";
 
   if (!output_name_global.is_empty ())
     out_file_name = File_name (output_name_global);
-  
+
   String init;
   if (!init_name_global.is_empty ())
     init = init_name_global;
@@ -82,7 +81,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
     {
       Sources sources;
       sources.set_path (&global_path);
-  
+
       progress_indication (_f ("Processing `%s'", file_name.to_str0 ()));
       progress_indication ("\n");
 
@@ -107,7 +106,7 @@ LY_DEFINE (ly_parse_string, "ly:parse-string",
           "Upon failure, throw @code{ly-file-failed} key.")
 {
   SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string");
-  
+
   Sources sources;
   sources.set_path (&global_path);
   Lily_parser *parser = new Lily_parser (&sources);
@@ -116,13 +115,13 @@ LY_DEFINE (ly_parse_string, "ly:parse-string",
   parser->parse_string (ly_scm2string (ly_code));
   scm_gc_unprotect_object (parser->self_scm ());
   parser = 0;
-  
+
   return SCM_UNSPECIFIED;
 }
 
 LY_DEFINE (ly_clone_parser, "ly:clone-parser",
-           1, 0, 0, (SCM parser_smob),
-           "Return a clone of PARSER_SMOB.")
+          1, 0, 0, (SCM parser_smob),
+          "Return a clone of PARSER_SMOB.")
 {
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   Lily_parser *clone = new Lily_parser (*parser);
@@ -137,7 +136,7 @@ LY_DEFINE (ly_parser_define, "ly:parser-define",
 {
   Lily_parser *parser = unsmob_my_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");  
+  SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");
 
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
   return SCM_UNSPECIFIED;
@@ -151,7 +150,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
   Lily_parser *parser = unsmob_my_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");  
+  SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");
 
   SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
   if (val != SCM_UNDEFINED)
@@ -169,9 +168,9 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
 
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
   SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string");
-  
+
   parser->parse_string (ly_scm2string (ly_code));
-  
+
   return SCM_UNSPECIFIED;
 }
 
@@ -185,17 +184,17 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   Score *score = unsmob_score (score_smob);
 
-  Object_key * key = new Lilypond_general_key (0, score->user_key_, 0);
-  
+  Object_key *key = new Lilypond_general_key (0, score->user_key_, 0);
+
   if (score->error_found_)
     return SCM_UNSPECIFIED;
-  
+
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
   SCM_ASSERT_TYPE (score, score_smob, SCM_ARG2, __FUNCTION__, "score");
 
   SCM header = ly_c_module_p (score->header_) ? score->header_
     : parser->lexer_->lookup_identifier ("$globalheader");
-  
+
   File_name outname (parser->output_basename_);
   int *c = &parser->book_count_;
   if (*c)
@@ -211,7 +210,7 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   if (score->defs_.is_empty ())
     {
       Output_def *layout = get_layout (parser);
-      default_rendering (score->get_music(), layout->self_scm (),
+      default_rendering (score->get_music (), layout->self_scm (),
                         get_paper (parser)->self_scm (),
                         header, os, key->self_scm ());
       scm_gc_unprotect_object (layout->self_scm ());
@@ -221,8 +220,6 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   return SCM_UNSPECIFIED;
 }
 
-
-
 LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names",
           2, 0, 0, (SCM parser, SCM names),
           "Replace current note names in @var{parser}. "
@@ -230,7 +227,7 @@ LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names",
           "This only has effect if the current mode is notes.")
 {
   Lily_parser *p = unsmob_my_lily_parser (parser);
-  SCM_ASSERT_TYPE(p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
+  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
 
   if (p->lexer_->is_note_state ())
     {
@@ -248,13 +245,13 @@ LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   Book *book = unsmob_book (book_smob);
   Output_def *bp = unsmob_output_def (parser->lexer_->lookup_identifier ("$defaultpaper"));
-  
+
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "Lilypond parser");
   SCM_ASSERT_TYPE (book, book_smob, SCM_ARG2, __FUNCTION__, "Book");
-  
+
   /*  ugh. changing argument.*/
   book->paper_ = bp;
-  
+
   File_name outname (parser->output_basename_);
   int *c = &parser->book_count_;
   if (*c)
@@ -262,8 +259,8 @@ LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
   (*c)++;
 
   Output_def *layout = get_layout (parser);
-  Paper_bookpb = book->process (outname.to_string (), layout);
-  
+  Paper_book *pb = book->process (outname.to_string (), layout);
+
   if (pb)
     {
       pb->output (outname.to_string ());
index 2a7a43e3c73880f90cae466633d7685cd275d658..2ef34f43d56183dc926056e7e73ebcbcd0fae2d6 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-       Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "lily-parser.hh"
@@ -66,7 +66,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Lily_parser);
 SCM
 Lily_parser::mark_smob (SCM s)
 {
-  Lily_parser *parser = (Lily_parser*) SCM_CELL_WORD_1 (s);
+  Lily_parser *parser = (Lily_parser *) SCM_CELL_WORD_1 (s);
   return (parser->lexer_) ? parser->lexer_->self_scm () : SCM_EOL;
 }
 
@@ -74,29 +74,28 @@ int
 Lily_parser::print_smob (SCM s, SCM port, scm_print_state*)
 {
   scm_puts ("#<my_lily_parser ", port);
-  Lily_parser *parser = (Lily_parser*) SCM_CELL_WORD_1 (s);
+  Lily_parser *parser = (Lily_parser *) SCM_CELL_WORD_1 (s);
   (void) parser;
   scm_puts (" >", port);
   return 1;
 }
 
-
 /* Process one .ly file, or book.  */
 void
 Lily_parser::parse_file (String init, String name, String out_name)
 {
   if (output_backend_global == "tex")
     {
-      try_load_text_metrics (out_name); 
+      try_load_text_metrics (out_name);
     }
-  
+
   lexer_ = new Lily_lexer (sources_);
   scm_gc_unprotect_object (lexer_->self_scm ());
   // TODO: use $parser 
   lexer_->set_identifier (ly_symbol2scm ("parser"),
                          self_scm ());
   output_basename_ = out_name;
-  
+
   lexer_->main_input_name_ = name;
 
   progress_indication (_ ("Parsing..."));
@@ -128,30 +127,29 @@ Lily_parser::parse_file (String init, String name, String out_name)
 void
 Lily_parser::parse_string (String ly_code)
 {
-  Lily_lexer * parent = lexer_;
+  Lily_lexer *parent = lexer_;
   lexer_ = (parent == 0 ? new Lily_lexer (sources_)
            : new Lily_lexer (*parent));
   scm_gc_unprotect_object (lexer_->self_scm ());
 
-
   SCM oldmod = scm_current_module ();
   scm_set_current_module (scm_car (lexer_->scopes_));
-  
+
   // TODO: use $parser 
   lexer_->set_identifier (ly_symbol2scm ("parser"),
                          self_scm ());
-  
+
   lexer_->main_input_name_ = "<string>";
   lexer_->is_main_input_ = true;
 
   set_yydebug (0);
   lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
   do_yyparse ();
-  
+
   if (!define_spots_.is_empty ())
     {
-      if (define_spots_.is_empty()
-         && !error_level_ )
+      if (define_spots_.is_empty ()
+         && !error_level_)
        programming_error ("define_spots_ don't match, but error_level_ not set.");
     }
 
@@ -175,7 +173,7 @@ Lily_parser::parser_error (String s)
 }
 
 void
-Lily_parser::parser_error (Input consti, String s)
+Lily_parser::parser_error (Input const &i, String s)
 {
   i.error (s);
   error_level_ = 1;
@@ -183,8 +181,7 @@ Lily_parser::parser_error (Input const& i, String s)
 
 /****************************************************************/
 
-
-Output_def*
+Output_def *
 get_layout (Lily_parser *parser)
 {
   SCM id = parser->lexer_->lookup_identifier ("$defaultlayout");
@@ -195,8 +192,7 @@ get_layout (Lily_parser *parser)
   return layout;
 }
 
-
-Output_def*
+Output_def *
 get_midi (Lily_parser *parser)
 {
   SCM id = parser->lexer_->lookup_identifier ("$defaultmidi");
@@ -206,14 +202,13 @@ get_midi (Lily_parser *parser)
   return layout;
 }
 
-
-Output_def*
+Output_def *
 get_paper (Lily_parser *parser)
 {
   SCM id = parser->lexer_->lookup_identifier ("$defaultpaper");
   Output_def *layout = unsmob_output_def (id);
 
-  layout = layout ? dynamic_cast<Output_def*> (layout->clone ()) : new Output_def;
+  layout = layout ? dynamic_cast<Output_def *> (layout->clone ()) : new Output_def;
   layout->set_variable (ly_symbol2scm ("is-paper"), SCM_BOOL_T);
   return layout;
 }
index 98fbb27e3804c9bcebd45c494e6fb3a33885d408..2524e9bb5e4715201923a8101bec1d1a5e9d928a 100644 (file)
 String
 version_string ()
 {
-  String str = MAJOR_VERSION "." MINOR_VERSION "."  PATCH_LEVEL;
+  String str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL;
   String mpl ("." MY_PATCH_LEVEL);
   if (mpl != ".")
     str += mpl;
   return str;
 }
 
-String 
+String
 gnu_lilypond_string ()
 {
   String str = "GNU LilyPond";
   return str;
 }
 
-String 
+String
 gnu_lilypond_version_string ()
 {
   String str = gnu_lilypond_string () + " " + version_string ();
index cfe6a06caf0ea908445f67244570355068b8ec58..af4a521880688684769b3cf576a4f37ca6080084 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "lilypond-key.hh"
@@ -28,15 +27,15 @@ Lilypond_grob_key::derived_mark () const
 
 // todo: reverse order of comparison for efficiency reasons.
 int
-Lilypond_grob_key::do_compare (Object_key constkey) const
+Lilypond_grob_key::do_compare (Object_key const *key) const
 {
-  Lilypond_grob_key const * other = dynamic_cast<Lilypond_grob_key const*> (key); 
+  Lilypond_grob_key const *other = dynamic_cast < Lilypond_grob_key const *> (key);
   int c;
 
   c = context_->compare (other->context_);
   if (c)
     return c;
-  
+
   c = Moment::compare (creation_moment_, other->creation_moment_);
   if (c)
     return c;
@@ -45,41 +44,37 @@ Lilypond_grob_key::do_compare (Object_key const* key) const
   if (c)
     return c;
 
-  c = sign (disambiguation_count_ - other->disambiguation_count_); 
+  c = sign (disambiguation_count_ - other->disambiguation_count_);
   if (c)
     return c;
-  
+
   return 0;
 }
 
-
 int
 Lilypond_grob_key::get_type () const
 {
   return GROB_KEY;
 }
 
-
 SCM
 Lilypond_grob_key::as_scheme () const
 {
-  return scm_list_4 (context_ ? context_->self_scm() : SCM_BOOL_F,
-                    creation_moment_.smobbed_copy(),
-                    scm_makfrom0str (grob_name_.to_str0()),
-                    scm_from_int (disambiguation_count_)); 
+  return scm_list_4 (context_ ? context_->self_scm () : SCM_BOOL_F,
+                    creation_moment_.smobbed_copy (),
+                    scm_makfrom0str (grob_name_.to_str0 ()),
+                    scm_from_int (disambiguation_count_));
 }
 
-
 Object_key *
-Lilypond_grob_key::from_scheme (SCM a) 
+Lilypond_grob_key::from_scheme (SCM a)
 {
   return new Lilypond_grob_key (unsmob_key (scm_car (a)),
                                *unsmob_moment (scm_cadr (a)),
-                               ly_scm2string  (scm_caddr (a)),
-                               scm_to_int  (scm_list_ref (a, scm_from_int (3))));
+                               ly_scm2string (scm_caddr (a)),
+                               scm_to_int (scm_list_ref (a, scm_from_int (3))));
 }
 
-
 /****************************************************************/
 
 void
@@ -102,12 +97,11 @@ Lilypond_context_key::Lilypond_context_key (Object_key const *parent,
   id_ = id;
 }
 
-
 int
 Lilypond_context_key::do_compare (Object_key const *key) const
 {
-  Lilypond_context_key const * other
-    = dynamic_cast<Lilypond_context_key const*> (key); 
+  Lilypond_context_key const *other
+    = dynamic_cast < Lilypond_context_key const *> (key);
 
   int c;
   if (parent_context_ && other->parent_context_)
@@ -117,11 +111,10 @@ Lilypond_context_key::do_compare (Object_key const *key) const
        return c;
     }
   else if (parent_context_)
-    return -1 ;
+    return -1;
   else if (other->parent_context_)
     return 1;
-  
-  
+
   c = Moment::compare (start_moment_, other->start_moment_);
   if (c)
     return c;
@@ -137,7 +130,7 @@ Lilypond_context_key::do_compare (Object_key const *key) const
   c = sign (disambiguation_count_ - other->disambiguation_count_);
   if (c)
     return c;
-  
+
   return 0;
 }
 
@@ -147,28 +140,26 @@ Lilypond_context_key::get_type () const
   return CONTEXT_KEY;
 }
 
-
 SCM
 Lilypond_context_key::as_scheme () const
 {
-  return scm_list_5 (parent_context_ ? parent_context_->self_scm() : SCM_BOOL_F,
-                    start_moment_.smobbed_copy(),
-                    scm_makfrom0str (context_name_.to_str0()),
-                    scm_makfrom0str (id_.to_str0()),
-                    scm_from_int (disambiguation_count_)); 
+  return scm_list_5 (parent_context_ ? parent_context_->self_scm () : SCM_BOOL_F,
+                    start_moment_.smobbed_copy (),
+                    scm_makfrom0str (context_name_.to_str0 ()),
+                    scm_makfrom0str (id_.to_str0 ()),
+                    scm_from_int (disambiguation_count_));
 }
 
 Object_key *
-Lilypond_context_key::from_scheme (SCM a) 
+Lilypond_context_key::from_scheme (SCM a)
 {
   return new Lilypond_context_key (unsmob_key (scm_car (a)),
                                   *unsmob_moment (scm_cadr (a)),
-                                  ly_scm2string  (scm_list_ref (a, scm_from_int (2))),
-                                  ly_scm2string  (scm_list_ref (a, scm_from_int (3))),
-                                  scm_to_int  (scm_list_ref (a, scm_from_int (4))));
+                                  ly_scm2string (scm_list_ref (a, scm_from_int (2))),
+                                  ly_scm2string (scm_list_ref (a, scm_from_int (3))),
+                                  scm_to_int (scm_list_ref (a, scm_from_int (4))));
 }
 
-
 /****************************************************************/
 
 int
@@ -184,26 +175,25 @@ Lilypond_general_key::derived_mark () const
     scm_gc_mark (parent_->self_scm ());
 }
 
-Lilypond_general_key::Lilypond_general_key (Object_key const*parent,
+Lilypond_general_key::Lilypond_general_key (Object_key const *parent,
                                            String name,
                                            int count)
 {
   parent_ = parent;
   name_ = name;
-  disambiguation_count_ = count; 
+  disambiguation_count_ = count;
 }
 
-
 int
-Lilypond_general_key::do_compare (Object_key constkey)const
+Lilypond_general_key::do_compare (Object_key const *key)const
 {
-  Lilypond_general_key constother
-    = dynamic_cast<Lilypond_general_key const*> (key);
+  Lilypond_general_key const *other
+    = dynamic_cast < Lilypond_general_key const *> (key);
 
   if (parent_ && other->parent_)
     parent_->compare (other->parent_);
   else if (parent_)
-    return -1 ;
+    return -1;
   else if (other->parent_)
     return 1;
 
@@ -215,21 +205,21 @@ Lilypond_general_key::do_compare (Object_key const* key)const
   if (c)
     return c;
 
-  return 0;  
+  return 0;
 }
 
 SCM
 Lilypond_general_key::as_scheme () const
 {
-  return scm_list_3 (parent_ ? parent_->self_scm() : SCM_BOOL_F,
-                    scm_makfrom0str (name_.to_str0()),
-                    scm_from_int (disambiguation_count_)); 
+  return scm_list_3 (parent_ ? parent_->self_scm () : SCM_BOOL_F,
+                    scm_makfrom0str (name_.to_str0 ()),
+                    scm_from_int (disambiguation_count_));
 }
 
 Object_key *
-Lilypond_general_key::from_scheme (SCM a) 
+Lilypond_general_key::from_scheme (SCM a)
 {
   return new Lilypond_general_key (unsmob_key (scm_car (a)),
-                                  ly_scm2string  (scm_list_ref (a, scm_from_int (1))),
-                                  scm_to_int  (scm_list_ref (a, scm_from_int (2))));
+                                  ly_scm2string (scm_list_ref (a, scm_from_int (1))),
+                                  scm_to_int (scm_list_ref (a, scm_from_int (2))));
 }
index 95d4c083af26a3c2266a114af807ead97e1e0a08..3996b42c5ebfe8252f720725d963bd9115575e5f 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-
 */
 
 #include "lilypond-input-version.hh"
@@ -41,7 +40,7 @@ Lilypond_version::to_string () const
 
 Lilypond_version::operator int () const
 {
-    // ugh
+  // ugh
   return 100000 * major_ + 1000 * minor_ + patch_;
 }
 
index 82843d912c290247f2173d5645fdb38f9f76bb69..a5c17c5ce9946e4804a7957e09e66999cc9ae065 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-line-interface.cc -- implement Line_interface
+/*
+  line-interface.cc -- implement Line_interface
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #include "line-interface.hh"
 
@@ -15,26 +14,26 @@ source file of the GNU LilyPond music typesetter
 
 Stencil
 Line_interface::make_dashed_line (Real thick, Offset from, Offset to,
-                            Real dash_period, Real dash_fraction)
+                                 Real dash_period, Real dash_fraction)
 {
   dash_fraction = (dash_fraction >? 0) <? 1.0;
-  Real on = dash_fraction * dash_period + thick; 
+  Real on = dash_fraction * dash_period + thick;
   Real off = dash_period - on;
-  
+
   SCM at = scm_list_n (ly_symbol2scm ("dashed-line"),
-                       scm_make_real (thick), 
-                       scm_make_real (on),
-                       scm_make_real (off),
-                       scm_make_real (to[X_AXIS] - from[X_AXIS]),
-                       scm_make_real (to[Y_AXIS] - from[Y_AXIS]),
-                       SCM_UNDEFINED);
-  
+                      scm_make_real (thick),
+                      scm_make_real (on),
+                      scm_make_real (off),
+                      scm_make_real (to[X_AXIS] - from[X_AXIS]),
+                      scm_make_real (to[Y_AXIS] - from[Y_AXIS]),
+                      SCM_UNDEFINED);
+
   Box box;
   box.add_point (Offset (0, 0));
   box.add_point (to - from);
 
-  box[X_AXIS].widen (thick/2);
-  box[Y_AXIS].widen (thick/2);  
+  box[X_AXIS].widen (thick / 2);
+  box[Y_AXIS].widen (thick / 2);
 
   Stencil m = Stencil (box, at);
   m.translate (from);
@@ -45,19 +44,19 @@ Stencil
 Line_interface::make_line (Real th, Offset from, Offset to)
 {
   SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
-                       scm_make_real (th), 
-                       scm_make_real (from[X_AXIS]),
-                       scm_make_real (from[Y_AXIS]),
-                       scm_make_real (to[X_AXIS]),
-                       scm_make_real (to[Y_AXIS]),
-                       SCM_UNDEFINED);
+                      scm_make_real (th),
+                      scm_make_real (from[X_AXIS]),
+                      scm_make_real (from[Y_AXIS]),
+                      scm_make_real (to[X_AXIS]),
+                      scm_make_real (to[Y_AXIS]),
+                      SCM_UNDEFINED);
 
   Box box;
   box.add_point (from);
   box.add_point (to);
 
-  box[X_AXIS].widen (th/2);
-  box[Y_AXIS].widen (th/2);  
+  box[X_AXIS].widen (th / 2);
+  box[Y_AXIS].widen (th / 2);
 
   return Stencil (box, at);
 }
@@ -67,25 +66,25 @@ Line_interface::line (Grob *me, Offset from, Offset to)
 {
   Real thick = Staff_symbol_referencer::line_thickness (me)
     * robust_scm2double (me->get_property ("thickness"), 1);
-  
+
   SCM type = me->get_property ("style");
 
   SCM dash_fraction = me->get_property ("dash-fraction");
   if (scm_is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
     {
-      
+
       Real fraction
        = type == ly_symbol2scm ("dotted-line")
        ? 0.0
        : robust_scm2double (dash_fraction, 0.4);
-      
+
       fraction = (fraction >? 0) <? 1.0;
       Real period = Staff_symbol_referencer::staff_space (me)
        * robust_scm2double (me->get_property ("dash-period"), 1.0);
 
       if (period < 0)
        return Stencil ();
-  
+
       return make_dashed_line (thick, from, to, period, fraction);
     }
   else
@@ -95,11 +94,11 @@ Line_interface::line (Grob *me, Offset from, Offset to)
 }
 
 ADD_INTERFACE (Line_interface, "line-interface",
-             "Generic line objects. Any object using lines supports this.  Normally, "
-             "you get a straight line. If @code{dash-period} is defined, a dashed line is "
-             "produced; the length of the dashes is tuned with " 
-             "@code{dash-fraction}. If the latter is set to 0, a dotted line is "
-             "produced. If @code{dash-fraction} is negative, the line is made "
-             "transparent.",
-             
-             "dash-period dash-fraction thickness style")
+              "Generic line objects. Any object using lines supports this.  Normally, "
+              "you get a straight line. If @code{dash-period} is defined, a dashed line is "
+              "produced; the length of the dashes is tuned with "
+              "@code{dash-fraction}. If the latter is set to 0, a dotted line is "
+              "produced. If @code{dash-fraction} is negative, the line is made "
+              "transparent.",
+
+              "dash-period dash-fraction thickness style")
index fe5dd3e1278d21ef0f7f89b57c5ee03b619f20b0..c7b2677f5d478ddda5d0d7e0cd2b8ad4e50e5dcc 100644 (file)
@@ -21,9 +21,9 @@
 #include "line-interface.hh"
 
 Stencil
-zigzag_stencil (Grob *me, 
-                Offset from,
-                Offset to)
+zigzag_stencil (Grob *me,
+               Offset from,
+               Offset to)
 {
   Offset dz = to -from;
   Real dx = dz[X_AXIS];
@@ -31,36 +31,36 @@ zigzag_stencil (Grob *me,
 
   Real thick = Staff_symbol_referencer::line_thickness (me);
   thick *= robust_scm2double (me->get_property ("thickness"), 1.0); // todo: staff sym referencer? 
-  
+
   Real staff_space = Staff_symbol_referencer::staff_space (me);
 
   double w = robust_scm2double (me->get_property ("zigzag-width"), 1)*staff_space;
-  double l = robust_scm2double ( me->get_property ("zigzag-length"), 1)* w;
-  double h = l>w/2 ? sqrt (l*l-w*w/4) : 0;
-  
+  double l = robust_scm2double (me->get_property ("zigzag-length"), 1)* w;
+  double h = l > w / 2 ? sqrt (l*l - w*w / 4) : 0;
+
   SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
-                     ly_bool2scm (true),
-                     scm_make_real (w),
-                     scm_make_real (h),
-                     scm_make_real (thick),
-                     scm_make_real (dx),
-                     scm_make_real (dy),
-                     SCM_UNDEFINED);
+                        ly_bool2scm (true),
+                        scm_make_real (w),
+                        scm_make_real (h),
+                        scm_make_real (thick),
+                        scm_make_real (dx),
+                        scm_make_real (dy),
+                        SCM_UNDEFINED);
   Box b;
   b.add_point (Offset (0, 0));
   b.add_point (dz);
-  b[X_AXIS].widen (thick/2);
-  b[Y_AXIS].widen (thick/2);
-     
+  b[X_AXIS].widen (thick / 2);
+  b[Y_AXIS].widen (thick / 2);
+
   return Stencil (b, list);
 }
 
 MAKE_SCHEME_CALLBACK (Line_spanner, after_line_breaking, 1);
 SCM
-Line_spanner::after_line_breaking (SCM  g)
+Line_spanner::after_line_breaking (SCM g)
 {
-  Grob *me  = unsmob_grob (g);
-  Spanner*sp = dynamic_cast<Spanner*> (me);
+  Grob *me = unsmob_grob (g);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
 
   /*
     We remove the line at the start of the line.  For piano voice
@@ -75,36 +75,35 @@ Line_spanner::after_line_breaking (SCM  g)
     space left of a note at the start of a line is very small.
 
     --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 ("print-function", SCM_EOL);
-      
+
     }
   return SCM_EOL;
 }
 
-
 Stencil
-Line_spanner::line_stencil (Grob *me, 
-                            Offset from,
-                            Offset to)
+Line_spanner::line_stencil (Grob *me,
+                           Offset from,
+                           Offset to)
 {
-  Offset dz = to -from ; 
+  Offset dz = to -from;
   SCM type = me->get_property ("style");
   if (scm_is_symbol (type)
       && (type == ly_symbol2scm ("line")
          || type == ly_symbol2scm ("dashed-line")
          || type == ly_symbol2scm ("dotted-line")
-         || type == ly_symbol2scm ("zigzag") 
+         || type == ly_symbol2scm ("zigzag")
          || (type == ly_symbol2scm ("trill") && dz[Y_AXIS] != 0)))
     {
-      return  (type == ly_symbol2scm ("zigzag"))
+      return (type == ly_symbol2scm ("zigzag"))
        ? zigzag_stencil (me, from, to)
        : Line_interface::line (me, from, to);
     }
@@ -113,12 +112,12 @@ Line_spanner::line_stencil (Grob *me,
     {
       SCM alist_chain = Font_interface::text_font_alist_chain (me);
       SCM style_alist = scm_list_n (scm_cons (ly_symbol2scm ("font-encoding"),
-                                            ly_symbol2scm ("fetaMusic")),
+                                             ly_symbol2scm ("fetaMusic")),
                                    SCM_UNDEFINED);
-      
+
       Font_metric *fm = select_font (me->get_layout (),
                                     scm_cons (style_alist,
-                                             alist_chain));
+                                              alist_chain));
       Stencil m = fm->find_by_name ("scripts.trill_element");
       Stencil mol;
 
@@ -130,10 +129,10 @@ Line_spanner::line_stencil (Grob *me,
 
       /*
        FIXME: should center element on x/y
-       */
+      */
       mol.translate_axis (m.extent (X_AXIS).length () / 2, X_AXIS);
-      mol.translate_axis (-(mol.extent (Y_AXIS)[DOWN]
-                           + mol.extent (Y_AXIS).length ())/2, Y_AXIS);
+      mol.translate_axis (- (mol.extent (Y_AXIS)[DOWN]
+                            + mol.extent (Y_AXIS).length ()) / 2, Y_AXIS);
 
       mol.translate (from);
       return mol;
@@ -144,11 +143,11 @@ Line_spanner::line_stencil (Grob *me,
 /*
   Find a common Y parent, which --if found-- should be the
   fixed-distance alignment.
- */
+*/
 Grob *
 line_spanner_common_parent (Grob *me)
 {
-  Grob * common = find_fixed_alignment_parent (me);
+  Grob *common = find_fixed_alignment_parent (me);
   if (!common)
     {
       common = Staff_symbol_referencer::get_staff_symbol (me);
@@ -164,33 +163,28 @@ line_spanner_common_parent (Grob *me)
 /*
   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
 (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::print (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (smob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
 
-  Drul_array<Item*>  bound (me->get_bound (LEFT),
+  Drul_array<Item *> bound (me->get_bound (LEFT),
                            me->get_bound (RIGHT));
-  
-  
+
   Real gap = robust_scm2double (me->get_property ("gap"), 0.0);
 
   Offset ofxy (gap, 0); /*offset from start point to start of line*/
-  Offset dxy ;
+  Offset dxy;
   Offset my_off;
   Offset his_off;
-  
 
   if (bound[RIGHT]->break_status_dir ())
     {
@@ -208,10 +202,10 @@ Line_spanner::print (SCM smob)
        heads are on different systems, there is no common parent
        anymore. We have to find the piano-staff object.
       */
-      
+
       int k = broken_spanner_index (me);
-      Spanner *parent_sp = dynamic_cast<Spanner*> (me->original_);
-      Spanner *next_sp  = parent_sp->broken_intos_ [k+1];
+      Spanner *parent_sp = dynamic_cast<Spanner *> (me->original_);
+      Spanner *next_sp = parent_sp->broken_intos_ [k + 1];
       Item *next_bound = next_sp->get_bound (RIGHT);
 
       if (next_bound->break_status_dir ())
@@ -221,83 +215,79 @@ Line_spanner::print (SCM smob)
          me->suicide ();
          return SCM_EOL;
        }
-            
+
       Grob *commonx = bound[LEFT]->common_refpoint (bound[RIGHT], X_AXIS);
       commonx = me->common_refpoint (commonx, X_AXIS);
-      
+
       Grob *next_common_y = line_spanner_common_parent (next_bound);
       Grob *this_common_y = line_spanner_common_parent (bound[LEFT]);
 
       Grob *all_common_y = me->common_refpoint (this_common_y, Y_AXIS);
-      
-      Interval next_ext  = next_bound->extent (next_common_y, Y_AXIS);
-      Interval this_ext  = bound[LEFT]->extent (this_common_y, Y_AXIS);
+
+      Interval next_ext = next_bound->extent (next_common_y, Y_AXIS);
+      Interval this_ext = bound[LEFT]->extent (this_common_y, Y_AXIS);
 
       Real yoff = this_common_y->relative_coordinate (all_common_y, Y_AXIS);
-      
+
       Offset p1 (bound[LEFT]->extent (commonx, X_AXIS)[RIGHT],
-                this_ext.center ()  + yoff); 
+                this_ext.center () + yoff);
       Offset p2 (bound[RIGHT]->extent (commonx, X_AXIS)[LEFT],
                 next_ext.center () + yoff);
-      
+
       Offset dz (p2 -p1);
       Real len = dz.length ();
 
-      Offset dir  = dz *(1/ len);
+      Offset dir = dz * (1/ len);
       dz = (dz.length () - 2*gap) *dir;
-      
-  
+
       Stencil l (line_stencil (me, Offset (0, 0), dz));
 
-      l.translate (dir * gap +  p1
+      l.translate (dir * gap + p1
                   - Offset (me->relative_coordinate (commonx, X_AXIS),
                             me->relative_coordinate (all_common_y, Y_AXIS)));
 
-      return l.smobbed_copy (); 
+      return l.smobbed_copy ();
     }
   else
     {
       Grob *common[] = { me, me };
-      for (int a = X_AXIS;  a < NO_AXES; a++)
+      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));
        }
 
       // distance from center to start of line      
-      Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length ()*3)/4);
+      Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length ()*3) / 4);
 
       for (int a = X_AXIS; a < NO_AXES; a++)
        {
          Axis ax = (Axis)a;
-         dxy[ax] =
-           + bound[RIGHT]->extent (common[X_AXIS], ax).center ()
+         dxy[ax]
+           + bound[RIGHT]->extent (common[X_AXIS], ax).center ()
            - bound[LEFT]->extent (common[X_AXIS], ax).center ();
 
          my_off[ax] = me->relative_coordinate (common[a], ax);
          his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax);
-         
+
        }
 
-      ofxy = dxy * (off/dxy.length ());
+      ofxy = dxy * (off / dxy.length ());
       dxy -= 2*ofxy;
-  
+
       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_axis (bound[LEFT]->extent (bound[LEFT], X_AXIS).length () / 2, X_AXIS);
       line.translate (ofxy - my_off + his_off);
       return line.smobbed_copy ();
     }
 }
 
-
 ADD_INTERFACE (Line_spanner, "line-spanner-interface",
               "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"
-              ,
+              "\n",
               "gap zigzag-width zigzag-length thickness");
 
-
index f012ca6930259a173d3964d9b6941ac6e4502b1f..df15d3d1ed729a5264fc562a222a82fb10ed41f9 100644 (file)
@@ -37,8 +37,6 @@ Lookup::dot (Offset p, Real radius)
   return Stencil (box, at);
 }
 
-
-
 /*
  * Horizontal Slope:
  *
@@ -56,85 +54,80 @@ Lookup::dot (Offset p, Real radius)
  *       <----->
  *        width
  */
-Stencil 
-Lookup::beam (Real slope, Real width, Real thick, Real blot) 
+Stencil
+Lookup::beam (Real slope, Real width, Real thick, Real blot)
 {
-  Real height = slope * width; 
-  Real min_y = (0 <? height) - thick/2;
-  Real max_y = (0 >? height) + thick/2;
+  Real height = slope * width;
+  Real min_y = (0 <? height) - thick / 2;
+  Real max_y = (0 >? height) + thick / 2;
 
   Box b (Interval (0, width),
         Interval (min_y, max_y));
-  
+
   SCM at = scm_list_n (ly_symbol2scm ("beam"),
-                   scm_make_real (width),
-                   scm_make_real (slope),
-                   scm_make_real (thick),
-                   scm_make_real (blot),
-                   SCM_UNDEFINED);
+                      scm_make_real (width),
+                      scm_make_real (slope),
+                      scm_make_real (thick),
+                      scm_make_real (blot),
+                      SCM_UNDEFINED);
   return Stencil (b, at);
 }
 
-  
 Stencil
 Lookup::dashed_slur (Bezier b, Real thick, Real dash_period, Real dash_fraction)
 {
   SCM l = SCM_EOL;
-  
-  Real on = dash_fraction * dash_period; 
-  Real off = dash_period - on; 
-  for (int i = 4; i -- ;)
+
+  Real on = dash_fraction * dash_period;
+  Real off = dash_period - on;
+
+  for (int i = 4; i--;)
     {
       l = scm_cons (ly_offset2scm (b.control_[i]), l);
     }
 
   SCM at = (scm_list_n (ly_symbol2scm ("dashed-slur"),
-                       scm_make_real (thick), 
+                       scm_make_real (thick),
                        scm_make_real (on),
                        scm_make_real (off),
                        ly_quote_scm (l),
                        SCM_UNDEFINED));
 
   Box box (Interval (0, 0), Interval (0, 0));
-  return   Stencil (box, at);
+  return Stencil (box, at);
 }
 
-
-
 Stencil
 Lookup::horizontal_line (Interval w, Real th)
 {
   SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
-                      scm_make_real (w[LEFT]), 
+                      scm_make_real (w[LEFT]),
                       scm_make_real (w[RIGHT]),
                       scm_make_real (th),
                       SCM_UNDEFINED);
 
-
-  Box box ;
+  Box box;
   box[X_AXIS] = w;
-  box[Y_AXIS] = Interval (-th/2, th/2);
+  box[Y_AXIS] = Interval (-th / 2, th / 2);
 
   return Stencil (box, at);
 }
 
-
 Stencil
-Lookup::blank (Box b) 
+Lookup::blank (Box b)
 {
   return Stencil (b, scm_makfrom0str (""));
 }
 
 Stencil
-Lookup::filled_box (Box b) 
+Lookup::filled_box (Box b)
 {
-  SCM  at  = (scm_list_n (ly_symbol2scm ("filledbox"),
-                    scm_make_real (-b[X_AXIS][LEFT]),
-                    scm_make_real (b[X_AXIS][RIGHT]),                 
-                    scm_make_real (-b[Y_AXIS][DOWN]),
-                    scm_make_real (b[Y_AXIS][UP]),                    
-                    SCM_UNDEFINED));
+  SCM at = (scm_list_n (ly_symbol2scm ("filledbox"),
+                       scm_make_real (-b[X_AXIS][LEFT]),
+                       scm_make_real (b[X_AXIS][RIGHT]),
+                       scm_make_real (-b[Y_AXIS][DOWN]),
+                       scm_make_real (b[Y_AXIS][UP]),
+                       SCM_UNDEFINED));
 
   return Stencil (b, at);
 }
@@ -189,8 +182,6 @@ Lookup::round_filled_box (Box b, Real blotdiameter)
   return Stencil (b, at);
 }
 
-         
-
 /*
  * Create Stencil that represents a filled polygon with round edges.
  *
@@ -324,10 +315,9 @@ Lookup::round_filled_polygon (Array<Offset> points, Real blotdiameter)
   return polygon;
 }
 
-
 /*
   TODO: deprecate?
- */
+*/
 Stencil
 Lookup::frame (Box b, Real thick, Real blot)
 {
@@ -335,14 +325,14 @@ Lookup::frame (Box b, Real thick, Real blot)
   Direction d = LEFT;
   for (Axis a = X_AXIS; a < NO_AXES; a = Axis (a + 1))
     {
-      Axis o = Axis ((a+1)%NO_AXES);
+      Axis o = Axis ((a + 1)%NO_AXES);
       do
        {
          Box edges;
          edges[a] = b[a][d] + 0.5 * thick * Interval (-1, 1);
-         edges[o][DOWN] = b[o][DOWN] - thick/2;
-         edges[o][UP] = b[o][UP] + thick/2;      
-         
+         edges[o][DOWN] = b[o][DOWN] - thick / 2;
+         edges[o][UP] = b[o][UP] + thick / 2;
+
          m.add_stencil (round_filled_box (edges, blot));
        }
       while (flip (&d) != LEFT);
@@ -351,45 +341,44 @@ Lookup::frame (Box b, Real thick, Real blot)
 }
 
 /*
-  Make a smooth curve along the points 
- */
+  Make a smooth curve along the points
+*/
 Stencil
-Lookup::slur (Bezier curve, Real curvethick, Real linethick) 
+Lookup::slur (Bezier curve, Real curvethick, Real linethick)
 {
   Real alpha = (curve.control_[3] - curve.control_[0]).arg ();
   Bezier back = curve;
-  Offset perp = curvethick * complex_exp (Offset (0, alpha + M_PI/2)) * 0.5;
+  Offset perp = curvethick * complex_exp (Offset (0, alpha + M_PI / 2)) * 0.5;
   back.reverse ();
   back.control_[1] += perp;
   back.control_[2] += perp;
 
   curve.control_[1] -= perp;
   curve.control_[2] -= perp;
-  
+
   SCM scontrols[8];
 
   for (int i =4; i--;)
     scontrols[ i ] = ly_offset2scm (back.control_[i]);
-  for (int i =4 ; i--;)
-    scontrols[i+4] = ly_offset2scm (curve.control_[i]);
+  for (int i =4; i--;)
+    scontrols[i + 4] = ly_offset2scm (curve.control_[i]);
 
   /*
-    Need the weird order b.o. the way PS want its arguments  
-   */
+    Need the weird order b.o. the way PS want its arguments
+  */
   int indices[]= {5, 6, 7, 4, 1, 2, 3, 0};
   SCM list = SCM_EOL;
   for (int i = 8; i--;)
     {
       list = scm_cons (scontrols[indices[i]], list);
     }
-  
-  
+
   SCM at = (scm_list_n (ly_symbol2scm ("bezier-sandwich"),
-                    ly_quote_scm (list),
-                    scm_make_real (linethick),
-                    SCM_UNDEFINED));
+                       ly_quote_scm (list),
+                       scm_make_real (linethick),
+                       SCM_UNDEFINED));
   Box b (curve.extent (X_AXIS),
-       curve.extent (Y_AXIS));
+        curve.extent (Y_AXIS));
 
   b[X_AXIS].unite (back.extent (X_AXIS));
   b[Y_AXIS].unite (back.extent (Y_AXIS));
@@ -424,8 +413,8 @@ Stencil
 Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
 {
   /*
-    Need the weird order b.o. the way PS want its arguments  
-   */
+    Need the weird order b.o. the way PS want its arguments
+  */
   SCM list = SCM_EOL;
   list = scm_cons (ly_offset2scm (bottom_curve.control_[3]), list);
   list = scm_cons (ly_offset2scm (bottom_curve.control_[0]), list);
@@ -452,9 +441,9 @@ Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve)
 
 /*
   TODO: junk me.
- */
+*/
 Stencil
-Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) 
+Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
 {
   Stencil m;
   String sym = ly_scm2string (scm_car (s));
@@ -469,28 +458,28 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       int eflag = 0x00;
       if (reg.left_string (3) == "EEE")
        {
          eflag = 0x07;
-         reg = reg.right_string (reg.length ()-3);
+         reg = reg.right_string (reg.length () - 3);
        }
       else if (reg.left_string (2) == "EE")
        {
          eflag = 0x05;
-         reg = reg.right_string (reg.length ()-2);
+         reg = reg.right_string (reg.length () - 2);
        }
       else if (reg.left_string (2) == "Eh")
        {
          eflag = 0x04;
-         reg = reg.right_string (reg.length ()-2);
+         reg = reg.right_string (reg.length () - 2);
        }
       else if (reg.left_string (1) == "E")
        {
          eflag = 0x02;
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (eflag & 0x02)
        {
@@ -520,14 +509,14 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          m.add_stencil (d);
          d.translate_axis (-0.8 * staff_space PT, X_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-2);
+         reg = reg.right_string (reg.length () - 2);
        }
       if (reg.left_string (1) == "S")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (0.5 * staff_space PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
     }
   else if (sym == "Freebase")
@@ -539,7 +528,7 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (reg == "E")
        {
@@ -557,7 +546,7 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       /* include 4' reed just for completeness. You don't want to use this. */
       if (reg.left_string (1) == "F")
@@ -565,7 +554,7 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (reg.left_string (2) == "EE")
        {
@@ -575,14 +564,14 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          m.add_stencil (d);
          d.translate_axis (-0.8 * staff_space PT, X_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-2);
+         reg = reg.right_string (reg.length () - 2);
        }
       if (reg.left_string (1) == "E")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
     }
   else if (sym == "Stdbase")
@@ -594,14 +583,14 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 3.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (reg.left_string (1) == "F")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (reg.left_string (1) == "M")
        {
@@ -609,21 +598,21 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
          d.translate_axis (staff_space * 2 PT, Y_AXIS);
          d.translate_axis (staff_space PT, X_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (reg.left_string (1) == "E")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
       if (reg.left_string (1) == "S")
        {
          Stencil d = fm->find_by_name ("accordion.accDot");
          d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
          m.add_stencil (d);
-         reg = reg.right_string (reg.length ()-1);
+         reg = reg.right_string (reg.length () - 1);
        }
     }
   /* ugh maybe try to use regular font for S.B. and B.B and only use one font
@@ -648,7 +637,7 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
       Stencil r = fm->find_by_name ("accordion.accOldEES");
       m.add_stencil (r);
     }
-  return m;  
+  return m;
 }
 
 Stencil
@@ -660,25 +649,24 @@ Lookup::repeat_slash (Real w, Real s, Real t)
   SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"),
                               wid, sl, thick, SCM_UNDEFINED);
 
-  Box b (Interval (0, w + sqrt (sqr (t/s) + sqr (t))),
+  Box b (Interval (0, w + sqrt (sqr (t / s) + sqr (t))),
         Interval (0, w * s));
 
   return Stencil (b, slashnodot); //  http://slashnodot.org
 }
 
-
 Stencil
 Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot)
 {
   Box b;
-  Axis other = Axis ((a+1)%2);
+  Axis other = Axis ((a + 1)%2);
   b[a] = iv;
   b[other] = Interval (-1, 1) * thick * 0.5;
-  
+
   Stencil m = round_filled_box (b, blot);
 
   b[a] = Interval (iv[UP] - thick, iv[UP]);
-  Interval oi = Interval (-thick/2, thick/2 + fabs (protude));
+  Interval oi = Interval (-thick / 2, thick / 2 + fabs (protude));
   oi *= sign (protude);
   b[other] = oi;
   m.add_stencil (round_filled_box (b, blot));
@@ -691,18 +679,17 @@ Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot)
 Stencil
 Lookup::triangle (Interval iv, Real thick, Real protude)
 {
-  Box b ;
-  b[X_AXIS] = Interval (0, iv.length());
-  b[Y_AXIS] = Interval (0 <? protude , 0 >? protude);
-
+  Box b;
+  b[X_AXIS] = Interval (0, iv.length ());
+  b[Y_AXIS] = Interval (0 <? protude, 0 >? protude);
 
-  Offset z1(iv[LEFT], 0);
-  Offset z2(iv[RIGHT], 0);
-  Offset z3((z1 + z2)[X_AXIS]/2, protude);
+  Offset z1 (iv[LEFT], 0);
+  Offset z2 (iv[RIGHT], 0);
+  Offset z3 ((z1 + z2)[X_AXIS] / 2, protude);
 
   /*
     TODO: move Triangle to Line_interface ?
-   */
+  */
   Stencil tri = Line_interface::make_line (thick, z1, z2);
   tri.add_stencil (Line_interface::make_line (thick, z2, z3));
   tri.add_stencil (Line_interface::make_line (thick, z3, z1));
index 082c7d04dfdfe933e84d48fb1f3013023c2f6cd2..e3b876967f7aaa5bc1200c5b624b837ef2b931a5 100644 (file)
@@ -27,7 +27,7 @@ ly_make_anonymous_module (bool safe)
   SCM mod = SCM_EOL;
   if (!safe)
     {
-      String s = "*anonymous-ly-" + to_string (module_count++) +  "*";
+      String s = "*anonymous-ly-" + to_string (module_count++) + "*";
       mod = scm_c_define_module (s.to_str0 (), ly_init_anonymous_module, 0);
       ly_use_module (mod, global_lily_module);
     }
@@ -47,7 +47,7 @@ ly_use_module (SCM mod, SCM used)
                  mod,
                  scm_list_2 (ly_symbol2scm ("module-public-interface"),
                              used));
-  
+
   return scm_eval (expr, global_lily_module);
 }
 
@@ -64,19 +64,19 @@ module_define_closure_func (void *closure, SCM key, SCM val, SCM result)
 }
 
 /* Ugh signature of scm_internal_hash_fold () is inaccurate.  */
-typedef SCM (*Hash_cl_func)();
+typedef SCM (*Hash_cl_func) ();
 
 /*
   If a variable in changed in SRC, we DEST doesn't see the
   definitions.
- */
+*/
 LY_DEFINE (ly_module_copy, "ly:module-copy",
           2, 0, 0, (SCM dest, SCM src),
           "Copy all bindings from module SRC into DEST.")
 {
   SCM_VALIDATE_MODULE (1, src);
   scm_internal_hash_fold ((Hash_cl_func) &module_define_closure_func,
-                         (void*) dest,
+                         (void *) dest,
                          SCM_EOL, SCM_MODULE_OBARRAY (src));
   return SCM_UNSPECIFIED;
 }
@@ -93,23 +93,23 @@ SCM
 ly_module_symbols (SCM mod)
 {
   SCM_VALIDATE_MODULE (1, mod);
-  
+
   SCM obarr = SCM_MODULE_OBARRAY (mod);
   return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol,
-                                NULL, SCM_EOL, obarr); 
+                                NULL, SCM_EOL, obarr);
 }
 
 static SCM
 entry_to_alist (void *closure, SCM key, SCM val, SCM result)
 {
   (void) closure;
-  if (scm_variable_bound_p  (val) == SCM_BOOL_T)
+  if (scm_variable_bound_p (val) == SCM_BOOL_T)
     {
       return scm_cons (scm_cons (key, scm_variable_ref (val)), result);
     }
   else
     {
-      programming_error ("Unbound variable in module."); 
+      programming_error ("Unbound variable in module.");
       return result;
     }
 }
@@ -121,7 +121,7 @@ LY_DEFINE (ly_module2alist, "ly:module->alist",
   SCM_VALIDATE_MODULE (1, mod);
   SCM obarr = SCM_MODULE_OBARRAY (mod);
 
-  return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr); 
+  return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr);
 }
 
 /* Lookup SYM, but don't give error when it is not defined.  */
@@ -149,7 +149,7 @@ LY_DEFINE (ly_modules_lookup, "ly:modules-lookup",
       SCM mod = scm_car (s);
       SCM v = ly_module_lookup (mod, sym);
       if (SCM_VARIABLEP (v) && SCM_VARIABLE_REF (v) != SCM_UNDEFINED)
-       return scm_variable_ref(v);
+       return scm_variable_ref (v);
     }
 
   if (def != SCM_UNDEFINED)
@@ -163,7 +163,7 @@ ly_export (SCM module, SCM namelist)
   static SCM export_function;
   if (!export_function)
     export_function = scm_permanent_object (scm_c_lookup ("module-export!"));
-  
+
   scm_call_2 (SCM_VARIABLE_REF (export_function), module, namelist);
 }
 
index 5855ebc8f84bd26573d0032c9a7abe6c458722b4..09fe51c2932e468bed19bc3bed435203a1ad133c 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   lyric-combine-music-iterator.cc -- implement Lyric_combine_music_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "context.hh"
 #include "event.hh"
@@ -17,32 +16,30 @@ class Lyric_combine_music_iterator : public Music_iterator
 {
 public:
   Lyric_combine_music_iterator ();
-  Lyric_combine_music_iterator (Lyric_combine_music_iterator const&src);
+  Lyric_combine_music_iterator (Lyric_combine_music_iterator const &src);
   DECLARE_SCHEME_CALLBACK (constructor, ());
 protected:
   virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit (); 
+  virtual void do_quit ();
   virtual void process (Moment);
   virtual Music_iterator *try_music_in_children (Music *) const;
 
   virtual bool ok () const;
   virtual void derived_mark () const;
-  virtual void derived_substitute (Context *, Context *) ;
+  virtual void derived_substitute (Context *, Context *);
 private:
-  bool get_busy_status ()const ;
-  bool melisma_busy (); 
-  Music* get_combine_lyrics () const;
-  Music* get_combine_music () const;
-
-  
-  Music_iterator * music_iter_;
-  Music_iterator * lyric_iter_;
-};
+  bool get_busy_status ()const;
+  bool melisma_busy ();
+  Music *get_combine_lyrics () const;
+  Music *get_combine_music () const;
 
+  Music_iterator *music_iter_;
+  Music_iterator *lyric_iter_;
+};
 
 bool
-melisma_busy (Contexttr)
+melisma_busy (Context *tr)
 {
   SCM melisma_properties = tr->get_property ("melismaBusyProperties");
   bool busy = false;
@@ -54,11 +51,9 @@ melisma_busy (Context* tr)
   return busy;
 }
 
-
-
 /*
   Ugh, why static?
- */
+*/
 Music *busy_req;
 Music *melisma_playing_req;
 
@@ -99,7 +94,7 @@ Lyric_combine_music_iterator::derived_mark ()const
 }
 
 void
-Lyric_combine_music_iterator::derived_substitute (Context *f, Context * t)
+Lyric_combine_music_iterator::derived_substitute (Context *f, Context *t)
 {
   if (music_iter_)
     music_iter_->substitute_outlet (f, t);
@@ -107,7 +102,7 @@ Lyric_combine_music_iterator::derived_substitute (Context *f, Context * t)
     lyric_iter_->substitute_outlet (f, t);
 }
 
-Music*
+Music *
 Lyric_combine_music_iterator::get_combine_music () const
 {
   SCM l = get_music ()->get_property ("elements");
@@ -116,7 +111,7 @@ Lyric_combine_music_iterator::get_combine_music () const
   return unsmob_music (scm_car (l));
 }
 
-Music*
+Music *
 Lyric_combine_music_iterator::get_combine_lyrics () const
 {
   SCM l = get_music ()->get_property ("elements");
@@ -128,7 +123,6 @@ Lyric_combine_music_iterator::get_combine_lyrics () const
   return unsmob_music (scm_car (l));
 }
 
-
 void
 Lyric_combine_music_iterator::construct_children ()
 {
@@ -145,17 +139,16 @@ Lyric_combine_music_iterator::get_busy_status () const
     instant.  */
   if (try_music (busy_req))
     return true;
-  
-  Context * tr = music_iter_->get_outlet ();
+
+  Context *tr = music_iter_->get_outlet ();
 
   SCM grobs = tr->get_property ("busyGrobs");
   Moment now = tr->now_mom ();
   for (; scm_is_pair (grobs); grobs = scm_cdr (grobs))
     {
       SCM grob = scm_cdar (grobs);
-      Moment end  =*unsmob_moment (scm_caar (grobs));
+      Moment end =*unsmob_moment (scm_caar (grobs));
 
-      
       /*
        This is slightly ugh: we are now confunding the frontend
        (iterators) and the backend (note heads) */
@@ -167,7 +160,6 @@ Lyric_combine_music_iterator::get_busy_status () const
   return false;
 }
 
-
 bool
 Lyric_combine_music_iterator::melisma_busy ()
 {
@@ -175,7 +167,7 @@ Lyric_combine_music_iterator::melisma_busy ()
     We can not read the property, since music_iter_->get_outlet () might
     not be the context that sets the melisma properties, but rather a
     parent context.
-   */
+  */
   return music_iter_->try_music (melisma_playing_req);
 }
 
@@ -185,7 +177,7 @@ Lyric_combine_music_iterator::process (Moment m)
   Moment my_next = music_iter_->pending_moment ();
   if (my_next > m)
     return;
-  
+
   music_iter_->process (m);
 
   if (get_busy_status () && !melisma_busy () && lyric_iter_->ok ())
@@ -204,15 +196,14 @@ Lyric_combine_music_iterator::do_quit ()
     lyric_iter_->quit ();
 }
 
-Music_iterator*
+Music_iterator *
 Lyric_combine_music_iterator::try_music_in_children (Music *m) const
 {
-  Music_iterator * i =  music_iter_->try_music (m);
+  Music_iterator *i = music_iter_->try_music (m);
   if (i)
     return i;
   else
     return lyric_iter_->try_music (m);
 }
 
-
 IMPLEMENT_CTOR_CALLBACK (Lyric_combine_music_iterator);
index 440e0b231987805424ef46dc04ab888a1490f28a..5b2764d894aa0462010195277f3ca6463f8dffdb 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   lyric-combine-music.cc -- implement Lyric_combine_music
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "music.hh"
 #include "pitch.hh"
 struct Lyric_combine_music
 {
 public:
-  DECLARE_SCHEME_CALLBACK(length_callback, (SCM));
+  DECLARE_SCHEME_CALLBACK (length_callback, (SCM));
 };
 
-
-MAKE_SCHEME_CALLBACK(Lyric_combine_music, length_callback, 1);
+MAKE_SCHEME_CALLBACK (Lyric_combine_music, length_callback, 1);
 SCM
 Lyric_combine_music::length_callback (SCM m)
 {
-  Music * me = unsmob_music (m);
+  Music *me = unsmob_music (m);
   Music *melody = unsmob_music (scm_car (me->get_property ("elements")));
   return melody->get_length ().smobbed_copy ();
 }
index 8bf3a209e993a3cc5d36a1153695aa80ff182f39..340a5d914cdff0e1cab9149d9b53ccc57e2d908a 100644 (file)
@@ -18,7 +18,7 @@
 /**
    Generate texts for lyric syllables.  We only do one lyric at a time.
    Multiple copies of this engraver should be used to do multiple voices.
- */
+*/
 class Lyric_engraver : public Engraver
 {
 protected:
@@ -43,7 +43,7 @@ Lyric_engraver::Lyric_engraver ()
 }
 
 bool
-Lyric_engraver::try_music (Music*r)
+Lyric_engraver::try_music (Music *r)
 {
   if (!event_)
     {
@@ -63,12 +63,11 @@ Lyric_engraver::process_music ()
     }
 }
 
-
-Context*
+Context *
 get_voice_to_lyrics (Context *lyrics)
 {
   SCM avc = lyrics->get_property ("associatedVoiceContext");
-  if  (Context *c = unsmob_context (avc))
+  if (Context *c = unsmob_context (avc))
     return c;
 
   SCM voice_name = lyrics->get_property ("associatedVoice");
@@ -111,13 +110,13 @@ get_current_note_head (Context *voice)
   for (SCM s = voice->get_property ("busyGrobs");
        scm_is_pair (s); s = scm_cdr (s))
     {
-      Item *g = dynamic_cast<Item*> (unsmob_grob (scm_cdar (s)));
-       
+      Item *g = dynamic_cast<Item *> (unsmob_grob (scm_cdar (s)));
+
       if (g && !g->get_column ()
          && Note_head::has_interface (g))
        return g;
     }
-       
+
   return 0;
 }
 
@@ -145,11 +144,10 @@ Lyric_engraver::stop_translation_timestep ()
   event_ = 0;
 }
 
-
 ADD_TRANSLATOR (Lyric_engraver,
-/* descr */       "",
-/* creats*/       "LyricText",
-/* accepts */     "lyric-event",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "LyricText",
+               /* accepts */ "lyric-event",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
index b71d4337c38fcc4c7eabc9b75237d6c043ab611a..53090bcafb53d0554d5a078afef83bcc176570a9 100644 (file)
 #include "group-interface.hh"
 
 MAKE_SCHEME_CALLBACK (Lyric_extender, print, 1)
-SCM 
-Lyric_extender::print (SCM smob) 
+  SCM
+Lyric_extender::print (SCM smob)
 {
   Spanner *me = unsmob_spanner (smob);
   Item *left_edge = me->get_bound (LEFT);
   Item *right_text = unsmob_item (me->get_property ("next"));
-  
+
   Grob *common = left_edge;
 
   if (right_text)
     common = common->common_refpoint (right_text, X_AXIS);
-  
+
   common = common->common_refpoint (me->get_bound (RIGHT), X_AXIS);
-  Real sl = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));  
+  Real sl = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
   Link_array<Grob> heads (extract_grob_array (me, ly_symbol2scm ("heads")));
 
   if (!heads.size ())
     return SCM_EOL;
 
   common = common_refpoint_of_array (heads, common, X_AXIS);
-  
+
   Real left_point = 0.0;
   if (left_edge->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
     left_point = left_edge->extent (common, X_AXIS)[RIGHT];
@@ -54,7 +54,7 @@ Lyric_extender::print (SCM smob)
      note head, but haven't found a pattern in it yet. --hwn 1/1/04  */
   SCM minlen = me->get_property ("minimum-length");
   Real right_point
-    = left_point + (robust_scm2double  (minlen, 0));
+    = left_point + (robust_scm2double (minlen, 0));
 
   if (heads.size ())
     right_point = right_point >? heads.top ()->extent (common, X_AXIS)[RIGHT];
@@ -68,22 +68,21 @@ Lyric_extender::print (SCM smob)
   /* run to end of line. */
   if (me->get_bound (RIGHT)->break_status_dir ())
     right_point = right_point >? (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - pad);
-  
+
   left_point += pad;
   Real w = right_point - left_point;
 
   if (w < 1.5 * h)
     return SCM_EOL;
-  
-  Stencil  mol (Lookup::round_filled_box (Box (Interval (0, w),
-                                              Interval (0, h)),
-                                         0.8 * h));
+
+  Stencil mol (Lookup::round_filled_box (Box (Interval (0, w),
+                                             Interval (0, h)),
+                                        0.8 * h));
   mol.translate_axis (left_point - me->relative_coordinate (common, X_AXIS),
                      X_AXIS);
   return mol.smobbed_copy ();
 }
 
-
 ADD_INTERFACE (Lyric_extender, "lyric-extender-interface",
               "The extender is a simple line at the baseline of the lyric "
               "that helps show the length of a melissima (tied/slurred note).",
index 07a393e7d24752ce28a33ae59d61f69296e43d7c..8dd88dc0c1e8d3228fece144a7c6d8b439c67730 100644 (file)
 #include "moment.hh"
 
 MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1)
-SCM 
+  SCM
 Hyphen_spanner::print (SCM smob)
 {
-  Spanner * me = unsmob_spanner (smob);
-  Drul_array<Item*> bounds (me->get_bound (LEFT),
-                           me->get_bound (RIGHT));
+  Spanner *me = unsmob_spanner (smob);
+  Drul_array<Item *> bounds (me->get_bound (LEFT),
+                            me->get_bound (RIGHT));
 
   if (bounds[LEFT]->break_status_dir ()
       && Paper_column::when_mom (bounds[LEFT]) == Paper_column::when_mom (bounds[RIGHT]->get_column ()))
     return SCM_EOL;
-  
-  Grob * common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
+
+  Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
 
   Interval span_points;
   Direction d = LEFT;
@@ -40,37 +40,37 @@ Hyphen_spanner::print (SCM smob)
        : iv[-d];
     }
   while (flip (&d) != LEFT);
-  
+
   Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
-  Real th = robust_scm2double (me->get_property ("thickness"), 1) * lt ;
+  Real th = robust_scm2double (me->get_property ("thickness"), 1) * lt;
   Real h = robust_scm2double (me->get_property ("height"), 0.5);
 
   // interval?
-  
+
   Real dp = robust_scm2double (me->get_property ("dash-period"), 1.0);
-  Real dl = robust_scm2double (me->get_property ("length"), .5 );
+  Real dl = robust_scm2double (me->get_property ("length"), .5);
 
   if (dp < dl)
     dp = 1.5 * dl;
 
   Real l = span_points.length ();
-  int n = int (ceil (l/dp - 0.5));
+  int n = int (ceil (l / dp - 0.5));
   if (n <= 0)
     n = 1;
 
-  Real space_left = l - dl - (n-1)* dp;
+  Real space_left = l - dl - (n - 1)* dp;
 
   /*
     If there is not enough space, the hyphen should disappear, but not
     at the end of the line.
-   */
+  */
   if (space_left < 0.0
       && !bounds[RIGHT]->break_status_dir ())
     return SCM_EOL;
 
   space_left = space_left >? 0.0;
-  
-  Box b (Interval (0, dl), Interval (h, h+th));
+
+  Box b (Interval (0, dl), Interval (h, h + th));
   Stencil dash_mol (Lookup::round_filled_box (b, 0.8 * lt));
 
   Stencil total;
@@ -81,21 +81,20 @@ Hyphen_spanner::print (SCM smob)
       total.add_stencil (m);
     }
 
-  total.translate_axis ( -me->relative_coordinate (common, X_AXIS), X_AXIS);
+  total.translate_axis (-me->relative_coordinate (common, X_AXIS), X_AXIS);
   return total.smobbed_copy ();
 }
 
-
 MAKE_SCHEME_CALLBACK (Hyphen_spanner, set_spacing_rods, 1);
 SCM
 Hyphen_spanner::set_spacing_rods (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   Rod r;
-  Spanner*sp = dynamic_cast<Spanner*> (me);
-  r.distance_ =
-    robust_scm2double (me->get_property ("minimum-length"), 0);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
+  r.distance_
+    robust_scm2double (me->get_property ("minimum-length"), 0);
 
   Direction d = LEFT;
   do
@@ -109,7 +108,7 @@ Hyphen_spanner::set_spacing_rods (SCM smob)
   if (r.item_drul_[LEFT]
       && r.item_drul_[RIGHT])
     r.add_to_cols ();
-  
+
   return SCM_UNSPECIFIED;
 }
 
@@ -117,4 +116,3 @@ ADD_INTERFACE (Hyphen_spanner, "lyric-hyphen-interface",
               "A centred hyphen is a simple line between lyrics used to divide syllables",
               "thickness height dash-period minimum-length length");
 
-
index 82e9ff6fddf585d44d51cada0e83889e708dd1af..7c2aa33c9b59d84343762184d20a28ed7095477f 100644 (file)
@@ -9,29 +9,27 @@
 #include "audio-item.hh"
 #include "performer.hh"
 
-class Lyric_performer : public Performer {
+class Lyric_performer : public Performer
+{
 public:
   TRANSLATOR_DECLARATIONS (Lyric_performer);
 protected:
 
-  virtual bool try_music (Musicreq);
+  virtual bool try_music (Music *req);
   virtual void stop_translation_timestep ();
   virtual void create_audio_elements ();
 
 private:
   Link_array<Music> lreqs_;
-  Audio_textaudio_;
+  Audio_text *audio_;
 };
 
 
-
-
 Lyric_performer::Lyric_performer ()
 {
   audio_ = 0;
 }
 
-
 void
 Lyric_performer::create_audio_elements ()
 {
@@ -41,7 +39,7 @@ Lyric_performer::create_audio_elements ()
       && ly_scm2string (lreqs_[0]->get_property ("text")).length ())
     {
       audio_ = new Audio_text (Audio_text::LYRIC,
-                                ly_scm2string (lreqs_[0]->get_property ("text")));
+                              ly_scm2string (lreqs_[0]->get_property ("text")));
       Audio_element_info info (audio_, lreqs_[0]);
       announce_element (info);
     }
@@ -60,7 +58,7 @@ Lyric_performer::stop_translation_timestep ()
 }
 
 bool
-Lyric_performer::try_music (Musicreq)
+Lyric_performer::try_music (Music *req)
 {
   if (req->is_mus_type ("lyric-event"))
     {
index 2cd13eb5b05d368a91a0a860b46ffa29555791cc..a5a3d3afc9269c071cb61e7015c4c71f860e282b 100644 (file)
@@ -5,7 +5,7 @@
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+
 #include "main.hh"
 
 #include <cassert>
@@ -72,44 +72,42 @@ String init_scheme_code_string = "(begin #t ";
 bool make_preview = false;
 bool make_pages = true;
 
-
 /*
  * Miscellaneous global stuff.
  */
 File_path global_path;
 
-
 /*
  * File globals.
  */
 
-static char const *AUTHORS =
-"  Han-Wen Nienhuys <hanwen@cs.uu.nl>\n"
-"  Jan Nieuwenhuizen <janneke@gnu.org>\n";
+static char const *AUTHORS
+"  Han-Wen Nienhuys <hanwen@cs.uu.nl>\n"
+  "  Jan Nieuwenhuizen <janneke@gnu.org>\n";
 
 static char const *PROGRAM_NAME = "lilypond";
 static char const *PROGRAM_URL = "http://lilypond.org";
 
-static char const *NOTICE =
-_i("This program is free software.  It is covered by the GNU General Public\n"
-   "License and you are welcome to change it and/or distribute copies of it\n"
-   "under certain conditions.  Invoke as `%s --warranty' for more\n"
-   "information.\n");
-  
-static char const *WARRANTY =
-_i("    This program is free software; you can redistribute it and/or\n"
-   "modify it under the terms of the GNU General Public License version 2\n"
-   "as published by the Free Software Foundation.\n"
-   "\n"
-   "    This program is distributed in the hope that it will be useful,\n"
-   "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-   "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
-   "General Public License for more details.\n"
-   "\n"
-   "    You should have received a copy (refer to the file COPYING) of the\n"
-   "GNU General Public License along with this program; if not, write to\n"
-   "the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
-   "Boston, MA 02111-1307, USA.\n");
+static char const *NOTICE
+= _i ("This program is free software.  It is covered by the GNU General Public\n"
+      "License and you are welcome to change it and/or distribute copies of it\n"
+      "under certain conditions.  Invoke as `%s --warranty' for more\n"
+      "information.\n");
+
+static char const *WARRANTY
+= _i ("    This program is free software; you can redistribute it and/or\n"
+      "modify it under the terms of the GNU General Public License version 2\n"
+      "as published by the Free Software Foundation.\n"
+      "\n"
+      "    This program is distributed in the hope that it will be useful,\n"
+      "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+      "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
+      "General Public License for more details.\n"
+      "\n"
+      "    You should have received a copy (refer to the file COPYING) of the\n"
+      "GNU General Public License along with this program; if not, write to\n"
+      "the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
+      "Boston, MA 02111-1307, USA.\n");
 
 /* Where the init files live.  Typically:
    LILYPOND_DATADIR = /usr/share/lilypond
@@ -123,47 +121,47 @@ String jail_spec;
 static Getopt_long *option_parser = 0;
 
 /* Internationalisation kludge in two steps:
  * use _i () to get entry in POT file
  * call gettext () explicitely for actual "translation"  */
-
-static Long_option_init options_static[] =
-  {
-    {_i ("EXT"), "backend", 'b', _i ("select backend to use")},
-    {_i ("EXPR"), "evaluate", 'e',
-     _i ("set option, use -e '(ly:option-usage)' for help")},
-    /* Bug in option parser: --output =foe is taken as an abbreviation
-       for --output-format.  */
-    {_i ("EXTs"), "formats", 'f', _i ("list of formats to dump")},
-    {0, "help", 'h',  _i ("print this help")},
-    {_i ("FIELD"), "header", 'H',  _i ("write header field to BASENAME.FIELD")},
-    {_i ("DIR"), "include", 'I',  _i ("add DIR to search path")},
-    {_i ("FILE"), "init", 'i',  _i ("use FILE as init file")},
-    {_i ("FILE"), "output", 'o',  _i ("write output to FILE (suffix will be added)")},
-    {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP and cd into DIR")},
-    {0, "preview", 'p',  _i ("generate a preview")},
-    {0, "no-pages", 0,  _i ("don't generate full pages")},
-    {0, "png", 0,  _i ("generate PNG")},
-    {0, "ps", 0,  _i ("generate PostScript")},
-    {0, "dvi", 0,  _i ("generate DVI")},
-    {0, "pdf", 0,  _i ("generate PDF (default)")},
-    {0, "tex", 0,  _i ("generate TeX")},
-    {0, "safe-mode", 's',  _i ("run in safe mode")},
-    {0, "version", 'v',  _i ("print version number")},
-    {0, "verbose", 'V', _i ("be verbose")},
-    {0, "warranty", 'w',  _i ("show warranty and copyright")},
-    {0, 0, 0, 0}
-  };
+ * use _i () to get entry in POT file
+ * call gettext () explicitely for actual "translation"  */
+
+static Long_option_init options_static[]
+= {
+  {_i ("EXT"), "backend", 'b', _i ("select backend to use")},
+  {_i ("EXPR"), "evaluate", 'e',
+   _i ("set option, use -e '(ly:option-usage)' for help")},
+  /* Bug in option parser: --output =foe is taken as an abbreviation
+     for --output-format.  */
+  {_i ("EXTs"), "formats", 'f', _i ("list of formats to dump")},
+  {0, "help", 'h',  _i ("print this help")},
+  {_i ("FIELD"), "header", 'H',  _i ("write header field to BASENAME.FIELD")},
+  {_i ("DIR"), "include", 'I',  _i ("add DIR to search path")},
+  {_i ("FILE"), "init", 'i',  _i ("use FILE as init file")},
+  {_i ("FILE"), "output", 'o',  _i ("write output to FILE (suffix will be added)")},
+  {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP and cd into DIR")},
+  {0, "preview", 'p',  _i ("generate a preview")},
+  {0, "no-pages", 0, _i ("don't generate full pages")},
+  {0, "png", 0, _i ("generate PNG")},
+  {0, "ps", 0, _i ("generate PostScript")},
+  {0, "dvi", 0, _i ("generate DVI")},
+  {0, "pdf", 0, _i ("generate PDF (default)")},
+  {0, "tex", 0, _i ("generate TeX")},
+  {0, "safe-mode", 's',  _i ("run in safe mode")},
+  {0, "version", 'v',  _i ("print version number")},
+  {0, "verbose", 'V', _i ("be verbose")},
+  {0, "warranty", 'w',  _i ("show warranty and copyright")},
+  {0, 0, 0, 0}
+};
 
 static void
 dir_info (FILE *out)
 {
   fputs ("\n", out);
   fprintf (out, "LILYPOND_DATADIR=\"%s\"\n", LILYPOND_DATADIR);
-  if (char const * env = getenv ("LILYPONDPREFIX"))
-    fprintf (out, "LILYPONDPREFIX=\"%s\"\n",  env);
+  if (char const *env = getenv ("LILYPONDPREFIX"))
+    fprintf (out, "LILYPONDPREFIX=\"%s\"\n", env);
   fprintf (out, "LOCALEDIR=\"%s\"\n", LOCALEDIR);
 
-  fprintf (out, "\nEffective prefix: \"%s\"\n", prefix_directory.to_str0());
+  fprintf (out, "\nEffective prefix: \"%s\"\n", prefix_directory.to_str0 ());
 }
 
 static void
@@ -181,7 +179,7 @@ identify (FILE *out)
   fputs (gnu_lilypond_version_string ().to_str0 (), out);
   fputs ("\n", out);
 }
+
 static void
 notice ()
 {
@@ -226,7 +224,7 @@ static void
 setup_paths ()
 {
   prefix_directory = LILYPOND_DATADIR;
-  if (char const * env = getenv ("LILYPONDPREFIX"))
+  if (char const *env = getenv ("LILYPONDPREFIX"))
     prefix_directory = env;
 
   global_path.append ("");
@@ -267,7 +265,7 @@ do_chroot_jail ()
     {
       USER_NAME, GROUP_NAME, JAIL, DIR, JAIL_MAX
     };
-  
+
   Array<String> components = String_convert::split (jail_spec, ',');
   if (components.size () != JAIL_MAX)
     {
@@ -286,10 +284,10 @@ do_chroot_jail ()
     {
       if (errno == 0)
        error (_f ("no such user: %s", components[USER_NAME]));
-      else 
-       error(_f ("can't get user id from user name: %s: %s",
-                 components[USER_NAME],
-                 strerror (errno)));
+      else
+       error (_f ("can't get user id from user name: %s: %s",
+                  components[USER_NAME],
+                  strerror (errno)));
       exit (3);
     }
 
@@ -301,9 +299,9 @@ do_chroot_jail ()
     gid = group->gr_gid;
   else
     {
-      if (errno == 0) 
+      if (errno == 0)
        error (_f ("no such group: %s", components[GROUP_NAME]));
-      else 
+      else
        error (_f ("can't get group id from group name: %s: ",
                   components[GROUP_NAME],
                   strerror (errno)));
@@ -337,7 +335,7 @@ do_chroot_jail ()
     }
 }
 
-void test_pango();
+void test_pango ();
 
 static void
 main_with_guile (void *, int, char **)
@@ -354,19 +352,18 @@ main_with_guile (void *, int, char **)
                          || output_backend_global == "texstr");
 
   is_pango_format_global = !is_TeX_format_global;
-    
 
   ly_c_init_guile ();
   call_constructors ();
   init_global_tweak_registry ();
   init_fontconfig ();
-  
+
   init_freetype ();
 
   all_fonts_global = new All_font_metrics (global_path.to_string ());
 
   init_scheme_code_string += ")";
-  scm_c_eval_string ((char*) init_scheme_code_string.to_str0 ());
+  scm_c_eval_string ((char *) init_scheme_code_string.to_str0 ());
 
   /* We accept multiple independent music files on the command line to
      reduce compile time when processing lots of small files.
@@ -391,8 +388,8 @@ main_with_guile (void *, int, char **)
       exit (2);
     }
 
-  if (! jail_spec.is_empty ()) 
-     do_chroot_jail ();
+  if (! jail_spec.is_empty ())
+    do_chroot_jail ();
 
   SCM result = scm_call_1 (ly_lily_module_constant ("lilypond-main"), files);
   (void) result;
@@ -407,11 +404,11 @@ setup_localisation ()
 #if HAVE_GETTEXT
   /* Enable locales */
   setlocale (LC_ALL, "");
-  
+
   /* FIXME: check if this is still true.
-    Disable localisation of float values.  This breaks TeX output.  */
+     Disable localisation of float values.  This breaks TeX output.  */
   setlocale (LC_NUMERIC, "C");
-  
+
   String name (PACKAGE);
   name.to_lower ();
   bindtextdomain (name.to_str0 (), LOCALEDIR);
@@ -450,7 +447,7 @@ parse_argv (int argc, char **argv)
          else if (String (opt->longname_str0_) == "no-pages")
            make_pages = false;
          break;
-         
+
        case 'v':
          notice ();
          exit (0);
index 0213ff3440cce0e09e0e91957845e1698e490da8..cc62a17d7fd82e86f00f20fa04aa5531c02f77bf 100644 (file)
@@ -16,9 +16,9 @@
 #include "text-item.hh"
 
 /**
-  put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
-  rehearsal marks.
- */
+   put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
+   rehearsal marks.
+*/
 class Mark_engraver : public Engraver
 {
 public:
@@ -28,18 +28,15 @@ protected:
 protected:
   virtual void stop_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
-  void create_items (Music*);
+  void create_items (Music *);
   virtual bool try_music (Music *ev);
   virtual void process_music ();
-  
+
 private:
-  Music * mark_ev_;
+  Music *mark_ev_;
 };
 
 
-
-
-
 Mark_engraver::Mark_engraver ()
 {
   text_ = 0;
@@ -49,31 +46,30 @@ Mark_engraver::Mark_engraver ()
 void
 Mark_engraver::acknowledge_grob (Grob_info inf)
 {
-  Grob * s = inf.grob_;
+  Grob *s = inf.grob_;
   if (text_ && Bar_line::has_interface (s))
     {
       /*
-      TODO: make this configurable. RehearsalMark cannot be
-      break-aligned, since the width of the object should not be taken
-      into alignment considerations.
+       TODO: make this configurable. RehearsalMark cannot be
+       break-aligned, since the width of the object should not be taken
+       into alignment considerations.
       */
       text_->set_parent (s, X_AXIS);
     }
 }
 
-void 
+void
 Mark_engraver::stop_translation_timestep ()
 {
   if (text_)
     {
       SCM lst = get_property ("stavesFound");
-      text_->set_property ("side-support-elements" , lst);
+      text_->set_property ("side-support-elements", lst);
       text_ = 0;
     }
   mark_ev_ = 0;
 }
 
-
 void
 Mark_engraver::create_items (Music *ev)
 {
@@ -83,15 +79,13 @@ Mark_engraver::create_items (Music *ev)
   text_ = make_item ("RehearsalMark", ev->self_scm ());
 }
 
-
 bool
-Mark_engraver::try_music (Musicr)
+Mark_engraver::try_music (Music *r)
 {
   mark_ev_ = r;
   return true;
 }
 
-
 /*
   TODO: make the increment function in Scheme.
 */
@@ -104,24 +98,23 @@ Mark_engraver::process_music ()
 
       /*
        automatic marks.
-       */
+      */
 
-      
       SCM m = mark_ev_->get_property ("label");
       SCM proc = get_property ("markFormatter");
-      if (!Text_interface::markup_p (m) &&
-         ly_c_procedure_p (proc))
+      if (!Text_interface::markup_p (m)
+         && ly_c_procedure_p (proc))
        {
-         if (!scm_is_number (m)) 
-           m =  get_property ("rehearsalMark");
+         if (!scm_is_number (m))
+           m = get_property ("rehearsalMark");
 
          if (scm_integer_p (m) == SCM_BOOL_T
              && scm_exact_p (m) == SCM_BOOL_T)
            {
              int mark_count = scm_to_int (m);
-             mark_count ++;
+             mark_count++;
              context ()->set_property ("rehearsalMark",
-                                           scm_int2num (mark_count));
+                                       scm_int2num (mark_count));
            }
 
          if (scm_is_number (m))
@@ -138,15 +131,14 @@ Mark_engraver::process_music ()
 }
 
 ADD_TRANSLATOR (Mark_engraver,
-/* descr */       "This engraver will create RehearsalMark objects. "
-                  "It puts them on top of all staves (which is taken from "
-                  "the property @code{stavesFound}). If moving this engraver "
-                  "to a different context, "
-                  "@ref{Staff_collecting_engraver} must move along, otherwise all marks"
-                  "end up on the same Y-location"
-                  ,
-/* creats*/       "RehearsalMark",
-/* accepts */     "mark-event",
-/* acks  */       "bar-line-interface",
-/* reads */       "rehearsalMark markFormatter stavesFound",
-/* write */       "");
+               /* descr */ "This engraver will create RehearsalMark objects. "
+               "It puts them on top of all staves (which is taken from "
+               "the property @code{stavesFound}). If moving this engraver "
+               "to a different context, "
+               "@ref{Staff_collecting_engraver} must move along, otherwise all marks"
+               "end up on the same Y-location",
+               /* creats*/ "RehearsalMark",
+               /* accepts */ "mark-event",
+               /* acks  */ "bar-line-interface",
+               /* reads */ "rehearsalMark markFormatter stavesFound",
+               /* write */ "");
index 4dd57300a37aebfcd856d028802367fad8e65f1d..05ce7072a7f691bb7fc8d556886bd31327183b68 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   measure-grouping-engraver.cc -- implement Measure_grouping_engraver
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
+*/
 
 #include "warn.hh"
 #include "side-position-interface.hh"
@@ -17,7 +17,7 @@ public:
   TRANSLATOR_DECLARATIONS (Measure_grouping_engraver);
 
 protected:
-  Spanner * grouping_;
+  Spanner *grouping_;
   Rational stop_grouping_mom_;
 
   virtual void process_music ();
@@ -36,7 +36,6 @@ Measure_grouping_engraver::finalize ()
     }
 }
 
-
 void
 Measure_grouping_engraver::acknowledge_grob (Grob_info gi)
 {
@@ -54,27 +53,26 @@ Measure_grouping_engraver::process_music ()
     {
       grouping_->set_bound (RIGHT,
                            unsmob_grob (get_property ("currentMusicalColumn")));
-      
+
       grouping_ = 0;
     }
-  
+
   if (now.grace_part_)
-    return; 
-  
+    return;
+
   SCM grouping = get_property ("beatGrouping");
   if (scm_is_pair (grouping))
     {
       Moment *measpos = unsmob_moment (get_property ("measurePosition"));
       Rational mp = measpos->main_part_;
-      
-      Moment * beatlen = unsmob_moment (get_property ("beatLength"));
+
+      Moment *beatlen = unsmob_moment (get_property ("beatLength"));
       Rational bl = beatlen->main_part_;
-       
+
       Rational where (0);
       for (SCM s = grouping; scm_is_pair (s);
           where += Rational ((int) scm_to_int (scm_car (s))) * bl,
-          s = scm_cdr (s)
-          )
+            s = scm_cdr (s))
        {
          int grouplen = scm_to_int (scm_car (s));
          if (where == mp)
@@ -84,21 +82,19 @@ Measure_grouping_engraver::process_music ()
                  programming_error ("Huh, last grouping not finished yet.");
                  continue;
                }
-             
+
              grouping_ = make_spanner ("MeasureGrouping", SCM_EOL);
              grouping_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
-             
 
-
-             stop_grouping_mom_ = now.main_part_ + Rational (grouplen - 1) * bl ;
+             stop_grouping_mom_ = now.main_part_ + Rational (grouplen - 1) * bl;
              get_global_context ()->add_moment_to_process (Moment (stop_grouping_mom_));
 
              if (grouplen == 3)
                grouping_->set_property ("style", ly_symbol2scm ("triangle"));
              else
                grouping_->set_property ("style", ly_symbol2scm ("bracket"));
-             
-             break ; 
+
+             break;
            }
        }
     }
@@ -109,9 +105,9 @@ Measure_grouping_engraver::Measure_grouping_engraver ()
 }
 
 ADD_TRANSLATOR (Measure_grouping_engraver,
-/* descr */       "Creates MeasureGrouping to indicate beat subdivision.",
-/* creats*/       "MeasureGrouping",
-/* accepts */     "",
-/* acks  */      "note-column-interface",
-/* reads */       "beatGrouping beatLength measurePosition currentMusicalColumn",
-/* write */       "");
+               /* descr */ "Creates MeasureGrouping to indicate beat subdivision.",
+               /* creats*/ "MeasureGrouping",
+               /* accepts */ "",
+               /* acks  */ "note-column-interface",
+               /* reads */ "beatGrouping beatLength measurePosition currentMusicalColumn",
+               /* write */ "");
index cb23c7c68c90092a414cdd99ead001baa5371230..9918b5051b05a2c81e42e6d0c9282000f98e09ad 100644 (file)
@@ -1,45 +1,42 @@
-/*   
-       measure-grouping-spanner.cc -- implement Measure_grouping
+/*
+  measure-grouping-spanner.cc -- implement Measure_grouping
 
-       source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-       (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "measure-grouping-spanner.hh"
 
 #include "output-def.hh"
 #include "spanner.hh"
-#include "lookup.hh" 
+#include "lookup.hh"
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
 
 MAKE_SCHEME_CALLBACK (Measure_grouping, print, 1);
-SCM 
+SCM
 Measure_grouping::print (SCM grob)
 {
-  Spanner * me = dynamic_cast<Spanner*> (unsmob_grob (grob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (grob));
 
   SCM which = me->get_property ("style");
   Real height = robust_scm2double (me->get_property ("height"), 1);
 
   Real t = Staff_symbol_referencer::line_thickness (me) * robust_scm2double (me->get_property ("thickness"), 1);
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT),
-                                                      X_AXIS);
+                                                       X_AXIS);
 
   Real right_point = robust_relative_extent (me->get_bound (RIGHT),
                                             common, X_AXIS).linear_combination (CENTER);
   Real left_point = me->get_bound (LEFT)->relative_coordinate (common, X_AXIS);
 
-
-  
   Interval iv (left_point, right_point);
   Stencil m;
-  
+
   /*
     TODO: use line interface
-   */
+  */
   if (which == ly_symbol2scm ("bracket"))
     {
       m = Lookup::bracket (X_AXIS, iv, t, -height, t);
@@ -59,4 +56,3 @@ ADD_INTERFACE (Measure_grouping, "measure-grouping-interface",
               "Valid choices for @code{style} are @code{bracket} and @code{triangle}.",
               "thickness style height");
 
-  
index 8ce5ef7cb7c3fe3573e9e3300d51fd24f2cd356d..9afeeabf8d58a1da91790a93a6cf3a231f65dee5 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   melisma-engraver.cc -- implement Melisma_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "grob.hh"
@@ -13,7 +12,7 @@
 
 /**
    Signal existence of melismas.
- */
+*/
 class Melisma_translator : public Translator
 {
 public:
@@ -22,12 +21,11 @@ protected:
   virtual bool try_music (Music *);
   virtual void process_music ();
   virtual void start_translation_timestep ();
-  Music * event_;
+  Music *event_;
 };
 
-
 bool
-Melisma_translator::try_music (Music *m) 
+Melisma_translator::try_music (Music *m)
 {
   if (m->is_mus_type ("melisma-playing-event"))
     {
@@ -54,7 +52,7 @@ Melisma_translator::process_music ()
       else
        context ()->unset_property (ly_symbol2scm ("melismaBusy"));
     }
-      
+
 }
 
 void
@@ -62,16 +60,16 @@ Melisma_translator::start_translation_timestep ()
 {
   event_ = 0;
 }
-  
+
 Melisma_translator::Melisma_translator ()
 {
   event_ = 0;
 }
 
 ADD_TRANSLATOR (Melisma_translator,
-/* descr */       "This translator collects melisma information about ties, beams, and user settings (@code{melismaBusy}, and signals it to the @code{\addlyrics} code.  ",
-/* creats*/       "",
-/* accepts */     "melisma-playing-event melisma-span-event",
-/* acks  */      "",
-/* reads */       "melismaBusy melismaBusyProperties slurMelismaBusy tieMelismaBusy beamMelismaBusy",
-/* write */       "");
+               /* descr */ "This translator collects melisma information about ties, beams, and user settings (@code{melismaBusy}, and signals it to the @code{\addlyrics} code.  ",
+               /* creats*/ "",
+               /* accepts */ "melisma-playing-event melisma-span-event",
+               /* acks  */ "",
+               /* reads */ "melismaBusy melismaBusyProperties slurMelismaBusy tieMelismaBusy beamMelismaBusy",
+               /* write */ "");
index 1fe6e0730e4b69aacebefc3825003856f7c1ba3c..4825d45b945c2d3a2f65a3688bc8412fd917f6a4 100644 (file)
@@ -1,11 +1,11 @@
 /*
   mensural-ligature-engraver.cc -- implement Mensural_ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>,
-                Pal Benko <benkop@freestart.hu>
- */
+  Pal Benko <benkop@freestart.hu>
+*/
 
 #include "coherent-ligature-engraver.hh"
 #include "mensural-ligature.hh"
@@ -56,7 +56,6 @@ private:
   void fold_up_primitives (Array<Grob_info> primitives);
 };
 
-
 Mensural_ligature_engraver::Mensural_ligature_engraver ()
 {
 }
@@ -85,196 +84,197 @@ Mensural_ligature_engraver::transform_heads (Array<Grob_info> primitives)
   bool prev_semibrevis = false;
   Item *prev_primitive = NULL;
 
-  for (int i = 0, s = primitives.size (); i < s; i++) {
-    Grob_info info = primitives[i];
-    Item *primitive = dynamic_cast<Item *> (info.grob_);
-    int duration_log = Note_head::get_balltype (primitive);
-
-    Music *nr = info.music_cause ();
-    
-    /*
-      ugh. why not simply check for pitch? 
-    */
-    if (!nr->is_mus_type ("note-event"))
-      {
-       nr->origin ()->warning
-         (_f ("can not determine pitch of ligature primitive -> skipping"));
-       at_beginning = true;
-       continue;
-      }
-
-    int pitch = unsmob_pitch (nr->get_property ("pitch"))->steps ();
-    int delta_pitch = 0;
-
-    if (at_beginning)
-      {
-       if (i == s - 1)
-         {
-           // we can get here after invalid input
-           nr->origin ()->warning
-             (_f ("single note ligature - skipping"));
-           break;
-         }
-       prev_semibrevis = prev_brevis_shape = false;
-       prev_primitive = NULL;
-      }
-    else
-      {
-       delta_pitch = pitch - prev_pitch;
-       if (delta_pitch == 0)
-         {
-           nr->origin ()->warning
-             (_f ("prime interval within ligature -> skipping"));
-           at_beginning = true;
-           primitive->set_property ("primitive",
-                                    scm_int2num (MLP_NONE));
-           continue;
-         }
-      }
-
-    if (duration_log < -3 // is this possible at all???
-       || duration_log > 0)
-      {
-       nr->origin ()->warning
-         (_f ("mensural ligature: duration none of Mx, L, B, S -> skipping"));
-       primitive->set_property ("primitive",
-                                scm_int2num (MLP_NONE));
-       at_beginning = true;
-       continue;
-      }
-
-    // apply_transition replacement begins
-    bool general_case = true;
-
-    // first check special cases
-    // 1. beginning
-    if (at_beginning)
-      {
-       // a. semibreves
-       if (duration_log == 0)
-         {
-           primitive->set_property ("primitive",
-                                    scm_int2num (MLP_UP | MLP_BREVIS));
-           prev_semibrevis = prev_brevis_shape = true;
-           general_case = false;
-         }
-       // b. descendens longa or brevis
-       else if (i < s - 1
-                && (unsmob_pitch (primitives[i + 1].music_cause ()
-                                  ->get_property ("pitch"))->steps () < pitch)
-                && duration_log > -3)
-         {
-           int left_stem = duration_log == -1 ? MLP_DOWN : 0;
-
-           primitive->set_property ("primitive",
-                                    scm_int2num (left_stem | MLP_BREVIS));
-           prev_brevis_shape = true;
-           prev_semibrevis = general_case = false;
-         }
-      }
-    // 2. initial semibrevis must be followed by another one
-    else if (prev_semibrevis)
-      {
-       prev_semibrevis = false;
-       if (duration_log == 0)
-         {
-           primitive->set_property ("primitive", scm_int2num(MLP_BREVIS));
-           general_case = false;
-         }
-       else
-         {
-           nr->origin ()->warning
-             (_f ("semibrevis must be followed by another one -> skipping"));
-           primitive->set_property ("primitive",
-                                    scm_int2num (MLP_NONE));
-           at_beginning = true;
-           continue;
-         }
-      }
-    // 3. semibreves are otherwise not allowed
-    else if (duration_log == 0)
-      {
-       nr->origin ()->warning
-         (_f ("semibreves can only appear at the beginning of a ligature,\n"
-              "and there may be only zero or two of them"));
-       primitive->set_property ("primitive",
-                                scm_int2num (MLP_NONE));
-       at_beginning = true;
-       continue;
-      }
-    // 4. end, descendens
-    else if (i == s - 1 && delta_pitch < 0)
-      {
-       // brevis; previous note must be turned into flexa
-       if (duration_log == -1)
-         {
-           if (prev_brevis_shape)
-             {
-               prev_primitive->set_property
-                 ("primitive",
-                  scm_int2num
-                  (MLP_FLEXA
-                   | (scm_to_int (prev_primitive->get_property ("primitive"))
-                      & MLP_DOWN)));
-               primitive->set_property ("primitive", scm_int2num (MLP_NONE));
-               break; // no more notes, no join
-             }
-           else
-             {
-               nr->origin ()->warning
-                 (_f ("invalid ligatura ending:\n"
-                      "when the last note is a descending brevis,\n"
-                      "the penultimate note must be another one,\n"
-                      "or the ligatura must be LB or SSB"));
-               primitive->set_property ("primitive", scm_int2num (MLP_NONE));
-               break;
-             }
-         }
-       // longa
-       else if (duration_log == -2)
-         {
-           primitive->set_property ("primitive", scm_int2num (MLP_BREVIS));
-           general_case = false;
-         }
-       // else maxima; fall through regular case below
-      }
-
-    if (general_case)
-      {
-       static int const shape[3] = {MLP_MAXIMA, MLP_LONGA, MLP_BREVIS};
-
-       primitive->set_property ("primitive",
-                                scm_int2num (shape[duration_log + 3]));
-       prev_brevis_shape = duration_log == -1;
-      }
-
-    // join_primitives replacement
-    if (!at_beginning)
-      {
-       /*
-         if the previous note is longa-shaped and this note is lower,
-         then the joining line may hide the stem, so it is made longer
-         to serve as stem as well
-       */
-       if (delta_pitch < 0
-           && (scm_to_int (prev_primitive->get_property ("primitive"))
-               & MLP_LONGA))
-         {
-           delta_pitch -= 6;
-           // instead of number 6
-           // the legth of the longa stem should be queried something like
-           // Font_interface::get_default_font (ligature)->find_by_name
-           //  ("noteheads.s-2mensural").extent (Y_AXIS).length ()
-         }
-       prev_primitive->set_property ("join-right-amount",
-                                     scm_int2num (delta_pitch));
-       // perhaps set add-join as well
-      }
-    at_beginning = false;
-    prev_primitive = primitive;
-    prev_pitch = pitch;
-    // apply_transition replacement ends
-  }
+  for (int i = 0, s = primitives.size (); i < s; i++)
+    {
+      Grob_info info = primitives[i];
+      Item *primitive = dynamic_cast<Item *> (info.grob_);
+      int duration_log = Note_head::get_balltype (primitive);
+
+      Music *nr = info.music_cause ();
+
+      /*
+       ugh. why not simply check for pitch?
+      */
+      if (!nr->is_mus_type ("note-event"))
+       {
+         nr->origin ()->warning
+           (_f ("can not determine pitch of ligature primitive -> skipping"));
+         at_beginning = true;
+         continue;
+       }
+
+      int pitch = unsmob_pitch (nr->get_property ("pitch"))->steps ();
+      int delta_pitch = 0;
+
+      if (at_beginning)
+       {
+         if (i == s - 1)
+           {
+             // we can get here after invalid input
+             nr->origin ()->warning
+               (_f ("single note ligature - skipping"));
+             break;
+           }
+         prev_semibrevis = prev_brevis_shape = false;
+         prev_primitive = NULL;
+       }
+      else
+       {
+         delta_pitch = pitch - prev_pitch;
+         if (delta_pitch == 0)
+           {
+             nr->origin ()->warning
+               (_f ("prime interval within ligature -> skipping"));
+             at_beginning = true;
+             primitive->set_property ("primitive",
+                                      scm_int2num (MLP_NONE));
+             continue;
+           }
+       }
+
+      if (duration_log < -3 // is this possible at all???
+         || duration_log > 0)
+       {
+         nr->origin ()->warning
+           (_f ("mensural ligature: duration none of Mx, L, B, S -> skipping"));
+         primitive->set_property ("primitive",
+                                  scm_int2num (MLP_NONE));
+         at_beginning = true;
+         continue;
+       }
+
+      // apply_transition replacement begins
+      bool general_case = true;
+
+      // first check special cases
+      // 1. beginning
+      if (at_beginning)
+       {
+         // a. semibreves
+         if (duration_log == 0)
+           {
+             primitive->set_property ("primitive",
+                                      scm_int2num (MLP_UP | MLP_BREVIS));
+             prev_semibrevis = prev_brevis_shape = true;
+             general_case = false;
+           }
+         // b. descendens longa or brevis
+         else if (i < s - 1
+                  && (unsmob_pitch (primitives[i + 1].music_cause ()
+                                    ->get_property ("pitch"))->steps () < pitch)
+                  && duration_log > -3)
+           {
+             int left_stem = duration_log == -1 ? MLP_DOWN : 0;
+
+             primitive->set_property ("primitive",
+                                      scm_int2num (left_stem | MLP_BREVIS));
+             prev_brevis_shape = true;
+             prev_semibrevis = general_case = false;
+           }
+       }
+      // 2. initial semibrevis must be followed by another one
+      else if (prev_semibrevis)
+       {
+         prev_semibrevis = false;
+         if (duration_log == 0)
+           {
+             primitive->set_property ("primitive", scm_int2num (MLP_BREVIS));
+             general_case = false;
+           }
+         else
+           {
+             nr->origin ()->warning
+               (_f ("semibrevis must be followed by another one -> skipping"));
+             primitive->set_property ("primitive",
+                                      scm_int2num (MLP_NONE));
+             at_beginning = true;
+             continue;
+           }
+       }
+      // 3. semibreves are otherwise not allowed
+      else if (duration_log == 0)
+       {
+         nr->origin ()->warning
+           (_f ("semibreves can only appear at the beginning of a ligature,\n"
+                "and there may be only zero or two of them"));
+         primitive->set_property ("primitive",
+                                  scm_int2num (MLP_NONE));
+         at_beginning = true;
+         continue;
+       }
+      // 4. end, descendens
+      else if (i == s - 1 && delta_pitch < 0)
+       {
+         // brevis; previous note must be turned into flexa
+         if (duration_log == -1)
+           {
+             if (prev_brevis_shape)
+               {
+                 prev_primitive->set_property
+                   ("primitive",
+                    scm_int2num
+                    (MLP_FLEXA
+                     | (scm_to_int (prev_primitive->get_property ("primitive"))
+                        & MLP_DOWN)));
+                 primitive->set_property ("primitive", scm_int2num (MLP_NONE));
+                 break; // no more notes, no join
+               }
+             else
+               {
+                 nr->origin ()->warning
+                   (_f ("invalid ligatura ending:\n"
+                        "when the last note is a descending brevis,\n"
+                        "the penultimate note must be another one,\n"
+                        "or the ligatura must be LB or SSB"));
+                 primitive->set_property ("primitive", scm_int2num (MLP_NONE));
+                 break;
+               }
+           }
+         // longa
+         else if (duration_log == -2)
+           {
+             primitive->set_property ("primitive", scm_int2num (MLP_BREVIS));
+             general_case = false;
+           }
+         // else maxima; fall through regular case below
+       }
+
+      if (general_case)
+       {
+         static int const shape[3] = {MLP_MAXIMA, MLP_LONGA, MLP_BREVIS};
+
+         primitive->set_property ("primitive",
+                                  scm_int2num (shape[duration_log + 3]));
+         prev_brevis_shape = duration_log == -1;
+       }
+
+      // join_primitives replacement
+      if (!at_beginning)
+       {
+         /*
+           if the previous note is longa-shaped and this note is lower,
+           then the joining line may hide the stem, so it is made longer
+           to serve as stem as well
+         */
+         if (delta_pitch < 0
+             && (scm_to_int (prev_primitive->get_property ("primitive"))
+                 & MLP_LONGA))
+           {
+             delta_pitch -= 6;
+             // instead of number 6
+             // the legth of the longa stem should be queried something like
+             // Font_interface::get_default_font (ligature)->find_by_name
+             //  ("noteheads.s-2mensural").extent (Y_AXIS).length ()
+           }
+         prev_primitive->set_property ("join-right-amount",
+                                       scm_int2num (delta_pitch));
+         // perhaps set add-join as well
+       }
+      at_beginning = false;
+      prev_primitive = primitive;
+      prev_pitch = pitch;
+      // apply_transition replacement ends
+    }
 }
 
 /*
@@ -295,18 +295,18 @@ void
 Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
                                                  Array<Grob_info> primitives)
 {
-  Real thickness =
-    robust_scm2double (ligature->get_property ("thickness"), 1.4);
-  thickness *=
-    ligature->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+  Real thickness
+    robust_scm2double (ligature->get_property ("thickness"), 1.4);
+  thickness
+    *= ligature->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
 
-  Real head_width =
-    Font_interface::get_default_font (ligature)->
+  Real head_width
+    Font_interface::get_default_font (ligature)->
     find_by_name ("noteheads.s-1mensural").extent (X_AXIS).length ();
-  Real flexa_width =
-    robust_scm2double (ligature->get_property ("flexa-width"), 2);
-  Real maxima_head_width =
-    Font_interface::get_default_font (ligature)->
+  Real flexa_width
+    robust_scm2double (ligature->get_property ("flexa-width"), 2);
+  Real maxima_head_width
+    Font_interface::get_default_font (ligature)->
     find_by_name ("noteheads.s-1neomensural").extent (X_AXIS).length ();
 
   flexa_width *= Staff_symbol_referencer::staff_space (ligature);
@@ -315,35 +315,36 @@ Mensural_ligature_engraver::propagate_properties (Spanner *ligature,
 
   for (int i = 0; i < primitives.size (); i++)
     {
-      Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
+      Item *primitive = dynamic_cast<Item *> (primitives[i].grob_);
       int output = scm_to_int (primitive->get_property ("primitive"));
       primitive->set_property ("thickness",
                               scm_make_real (thickness));
 
-      switch (output & MLP_ANY) {
-      case MLP_NONE:
-       primitive->set_property ("head-width",
-                                scm_make_real (half_flexa_width));
-       break;
-      case MLP_BREVIS:
-      case MLP_LONGA:
-       primitive->set_property ("head-width",
-                                scm_make_real (head_width));
-       break;
-      case MLP_MAXIMA:
-       primitive->set_property ("head-width",
-                                scm_make_real (maxima_head_width));
-       break;
-      case MLP_FLEXA:
-       primitive->set_property ("head-width",
-                                scm_make_real (half_flexa_width));
-       primitive->set_property ("flexa-width",
-                                scm_make_real (flexa_width));
-       break;
-      default:
-       programming_error (_f ("unexpected case fall-through"));
-       break;
-      }
+      switch (output & MLP_ANY)
+       {
+       case MLP_NONE:
+         primitive->set_property ("head-width",
+                                  scm_make_real (half_flexa_width));
+         break;
+       case MLP_BREVIS:
+       case MLP_LONGA:
+         primitive->set_property ("head-width",
+                                  scm_make_real (head_width));
+         break;
+       case MLP_MAXIMA:
+         primitive->set_property ("head-width",
+                                  scm_make_real (maxima_head_width));
+         break;
+       case MLP_FLEXA:
+         primitive->set_property ("head-width",
+                                  scm_make_real (half_flexa_width));
+         primitive->set_property ("flexa-width",
+                                  scm_make_real (flexa_width));
+         break;
+       default:
+         programming_error (_f ("unexpected case fall-through"));
+         break;
+       }
     }
 }
 
@@ -354,7 +355,7 @@ Mensural_ligature_engraver::fold_up_primitives (Array<Grob_info> primitives)
   Real distance = 0;
   for (int i = 0; i < primitives.size (); i++)
     {
-      Item *current = dynamic_cast<Item*> (primitives[i].grob_);
+      Item *current = dynamic_cast<Item *> (primitives[i].grob_);
       if (i == 0)
        {
          first = current;
@@ -367,9 +368,9 @@ Mensural_ligature_engraver::fold_up_primitives (Array<Grob_info> primitives)
          current->translate_axis (distance, X_AXIS);
        }
 
-      distance +=
-       scm_to_double (current->get_property ("head-width")) -
-       scm_to_double (current->get_property ("thickness"));
+      distance
+       += scm_to_double (current->get_property ("head-width"))
+       scm_to_double (current->get_property ("thickness"));
     }
 }
 
@@ -383,9 +384,9 @@ Mensural_ligature_engraver::build_ligature (Spanner *ligature,
 }
 
 ADD_TRANSLATOR (Mensural_ligature_engraver,
-/* descr */       "Handles Mensural_ligature_events by glueing special ligature heads together.",
-/* creats*/       "MensuralLigature",
-/* accepts */     "ligature-event",
-/* acks  */      "note-head-interface rest-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Handles Mensural_ligature_events by glueing special ligature heads together.",
+               /* creats*/ "MensuralLigature",
+               /* accepts */ "ligature-event",
+               /* acks  */ "note-head-interface rest-interface",
+               /* reads */ "",
+               /* write */ "");
index 22138e453cdf844af91397ff28808292fd614005..0975ad73586641ad8d432387c9760c83455ac811 100644 (file)
@@ -1,13 +1,12 @@
 /*
   mensural-ligature.cc -- implement Mensural_ligature
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2002--2005 Juergen Reuter <reuter@ipd.uka.de>,
-                Pal Benko <benkop@freestart.hu>
+  Pal Benko <benkop@freestart.hu>
 */
 
-
 #include <math.h>
 
 #include "mensural-ligature.hh"
@@ -41,33 +40,33 @@ brew_flexa (Grob *me,
   // and right endings due to slope.
   Real ypos_correction = -0.1*staff_space * sign (slope);
   Real slope_correction = 0.2*staff_space * sign (slope);
-  Real corrected_slope = slope + slope_correction/width;
+  Real corrected_slope = slope + slope_correction / width;
 
   if (solid) // this will come handy for colorated flexae
     {
-      Stencil solid_head =
-       Lookup::beam (corrected_slope, width, height, 0.0);
+      Stencil solid_head
+       Lookup::beam (corrected_slope, width, height, 0.0);
       stencil.add_stencil (solid_head);
     }
   else // outline
     {
-      Stencil left_edge =
-       Lookup::beam (corrected_slope, thickness, height, 0.0);
+      Stencil left_edge
+       Lookup::beam (corrected_slope, thickness, height, 0.0);
       stencil.add_stencil (left_edge);
 
-      Stencil right_edge =
-       Lookup::beam (corrected_slope, thickness, height, 0.0);
-      right_edge.translate_axis (width-thickness, X_AXIS);
-      right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS);
+      Stencil right_edge
+       Lookup::beam (corrected_slope, thickness, height, 0.0);
+      right_edge.translate_axis (width - thickness, X_AXIS);
+      right_edge.translate_axis (corrected_slope * (width - thickness), Y_AXIS);
       stencil.add_stencil (right_edge);
 
-      Stencil bottom_edge =
-       Lookup::beam (corrected_slope, width, thickness, 0.0);
+      Stencil bottom_edge
+       Lookup::beam (corrected_slope, width, thickness, 0.0);
       bottom_edge.translate_axis (-0.5*height, Y_AXIS);
       stencil.add_stencil (bottom_edge);
 
-      Stencil top_edge =
-       Lookup::beam (corrected_slope, width, thickness, 0.0);
+      Stencil top_edge
+       Lookup::beam (corrected_slope, width, thickness, 0.0);
       top_edge.translate_axis (+0.5*height, Y_AXIS);
       stencil.add_stencil (top_edge);
     }
@@ -101,8 +100,8 @@ internal_brew_primitive (Grob *me)
     {
       delta_pitch = robust_scm2int (me->get_property ("delta-pitch"),
                                    0);
-      width =
-       robust_scm2double (me->get_property ("flexa-width"), 2.0 * staff_space);
+      width
+       robust_scm2double (me->get_property ("flexa-width"), 2.0 * staff_space);
     }
   if (primitive & MLP_SINGLE_HEAD)
     {
@@ -134,8 +133,8 @@ internal_brew_primitive (Grob *me)
       return Stencil ();
     }
 
-  Real blotdiameter =
-    (me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")));
+  Real blotdiameter
+    (me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")));
 
   if (primitive & MLP_STEM)
     {
@@ -190,7 +189,7 @@ internal_brew_primitive (Grob *me)
   if (primitive & MLP_FLEXA)
     {
       pos += delta_pitch;
-      add_ledger_lines(me, &out, pos, 0.5*delta_pitch, ledger_take_space);
+      add_ledger_lines (me, &out, pos, 0.5*delta_pitch, ledger_take_space);
     }
 #endif
 
index ea9b3893a56dd9a43c9a95765835f1e176900184..b59d3c962fb90b3ee2d1cc36beac2abaeaff9871 100644 (file)
@@ -15,9 +15,9 @@
 #include "context.hh"
 
 /**
-  put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
-  rehearsal marks.
- */
+   put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
+   rehearsal marks.
+*/
 class Metronome_mark_engraver : public Engraver
 {
 public:
@@ -26,8 +26,8 @@ protected:
   Item *text_;
   Grob *bar_line_;
   Music *mark_ev_;
-  
-  void create_items (Music*);
+
+  void create_items (Music *);
 protected:
   virtual void stop_translation_timestep ();
   virtual bool try_music (Music *ev);
@@ -40,34 +40,32 @@ Metronome_mark_engraver::Metronome_mark_engraver ()
   mark_ev_ = 0;
 }
 
-void 
+void
 Metronome_mark_engraver::stop_translation_timestep ()
 {
   if (text_)
     {
-      Grob*mc = unsmob_grob (get_property( "currentMusicalColumn"));
+      Grob *mc = unsmob_grob (get_property ("currentMusicalColumn"));
       text_->set_parent (mc, X_AXIS);
-      text_->set_property ("side-support-elements" , get_property ("stavesFound"));
-      
+      text_->set_property ("side-support-elements", get_property ("stavesFound"));
+
       text_ = 0;
     }
   mark_ev_ = 0;
 }
 
-
 void
 Metronome_mark_engraver::create_items (Music *rq)
 {
   if (text_)
     return;
 
-  text_ = make_item ("MetronomeMark", rq->self_scm () );
+  text_ = make_item ("MetronomeMark", rq->self_scm ());
 
 }
 
-
 bool
-Metronome_mark_engraver::try_music (Musicr)
+Metronome_mark_engraver::try_music (Music *r)
 {
   mark_ev_ = r;
   return true;
@@ -82,22 +80,20 @@ Metronome_mark_engraver::process_music ()
 
       SCM proc = get_property ("metronomeMarkFormatter");
       SCM result = scm_call_2 (proc, mark_ev_->self_scm (),
-                             context ()->self_scm ()); 
-      
+                              context ()->self_scm ());
+
       text_->set_property ("text", result);
     }
 }
 
 ADD_TRANSLATOR (Metronome_mark_engraver,
-/* descr */       "Engrave metro nome marking. This delegates the formatting work "
-                  "to the function in the metronomeMarkFormatter property. "
-                  "The mark is put over all staves. "
-                  "The staves are taken from the @code{stavesFound} property, "
-                  "which is maintained by @code{@ref{Staff_collecting_engraver}}. "
-       
-                  ,
-/* creats*/       "MetronomeMark",
-/* accepts */     "metronome-change-event",
-                  /* acks  */       "",
-/* reads */       "stavesFound metronomeMarkFormatter",
-/* write */       "");
+               /* descr */ "Engrave metro nome marking. This delegates the formatting work "
+               "to the function in the metronomeMarkFormatter property. "
+               "The mark is put over all staves. "
+               "The staves are taken from the @code{stavesFound} property, "
+               "which is maintained by @code{@ref{Staff_collecting_engraver}}. ",
+               /* creats*/ "MetronomeMark",
+               /* accepts */ "metronome-change-event",
+               /* acks  */ "",
+               /* reads */ "stavesFound metronomeMarkFormatter",
+               /* write */ "");
index bc0bc0b4e042d6555df7f97d03c79e1c35020dc5..4d712f7ed3b37bc649d36d88d2ca768216ccdf9e 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-
 */
 
 #include <math.h>
 #include "scm-hash.hh"
 
 int
-get_tempo (Output_def * def,
+get_tempo (Output_def *def,
           Moment one_beat_mom)
 {
-  SCM wis  = ly_symbol2scm ("whole-in-seconds");
+  SCM wis = ly_symbol2scm ("whole-in-seconds");
   Moment *w = unsmob_moment (def->lookup_variable (wis));
 
   Moment wholes_per_min = Moment (60);
   if (!w)
     {
-      programming_error  ("wholes-in-seconds not set.");
+      programming_error ("wholes-in-seconds not set.");
       wholes_per_min /= 4;
     }
   else
     {
-      wholes_per_min /= *w; 
+      wholes_per_min /= *w;
     }
-  
-  int beats_per_min =  int ((wholes_per_min / one_beat_mom).main_part_);
+
+  int beats_per_min = int ((wholes_per_min / one_beat_mom).main_part_);
   return int (beats_per_min);
 }
 
 void
-set_tempo (Output_def * def,
+set_tempo (Output_def *def,
           Moment one_beat_mom,
           int beats_per_minute_i)
 {
   Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
 
-  Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom);
+  Moment m = Moment (1) / Moment (beats_per_second * one_beat_mom);
   def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
 }
 
index 60d711e11be51845566e9798f8ee065c1903b808..564b5057c07c49f5590409d8e45afedb682cebdb 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "midi-item.hh"
 
 #include "scm-option.hh"
 #include "killing-cons.tcc"
 
-#define PITCH_WHEEL_TOP    0x3FFF
+#define PITCH_WHEEL_TOP 0x3FFF
 #define PITCH_WHEEL_CENTER 0x2000
 #define PITCH_WHEEL_BOTTOM 0x0000
-#define PITCH_WHEEL_RANGE  (PITCH_WHEEL_TOP - PITCH_WHEEL_BOTTOM)
+#define PITCH_WHEEL_RANGE (PITCH_WHEEL_TOP - PITCH_WHEEL_BOTTOM)
 
-Midi_item*
-Midi_item::get_midi (Audio_itema)
+Midi_item *
+Midi_item::get_midi (Audio_item *a)
 {
-  if (Audio_key* i = dynamic_cast<Audio_key*> (a))
+  if (Audio_key *i = dynamic_cast<Audio_key *> (a))
     return new Midi_key (i);
-  else if (Audio_instrument* i = dynamic_cast<Audio_instrument*> (a))
+  else if (Audio_instrument *i = dynamic_cast<Audio_instrument *> (a))
     return i->str_.length () ? new Midi_instrument (i) : 0;
-  else if (Audio_note* i = dynamic_cast<Audio_note*> (a))
+  else if (Audio_note *i = dynamic_cast<Audio_note *> (a))
     return new Midi_note (i);
-  else if (Audio_dynamic* i = dynamic_cast<Audio_dynamic*> (a))
+  else if (Audio_dynamic *i = dynamic_cast<Audio_dynamic *> (a))
     return new Midi_dynamic (i);
-  else if (Audio_piano_pedal* i = dynamic_cast<Audio_piano_pedal*> (a))
+  else if (Audio_piano_pedal *i = dynamic_cast<Audio_piano_pedal *> (a))
     return new Midi_piano_pedal (i);
-  else if (Audio_tempo* i = dynamic_cast<Audio_tempo*> (a))
+  else if (Audio_tempo *i = dynamic_cast<Audio_tempo *> (a))
     return new Midi_tempo (i);
-  else if (Audio_time_signature* i = dynamic_cast<Audio_time_signature*> (a))
+  else if (Audio_time_signature *i = dynamic_cast<Audio_time_signature *> (a))
     return new Midi_time_signature (i);
-  else if (Audio_text* i = dynamic_cast<Audio_text*> (a))
+  else if (Audio_text *i = dynamic_cast<Audio_text *> (a))
     //return i->text_string_.length () ? new Midi_text (i) : 0;
     return new Midi_text (i);
   else
@@ -56,7 +56,7 @@ Midi_chunk::set (String header_string, String data_string, String footer_string)
   footer_string_ = footer_string;
   header_string_ = header_string;
 }
-  
+
 String
 Midi_chunk::data_string () const
 {
@@ -68,8 +68,8 @@ Midi_chunk::to_string () const
 {
   String str = header_string_;
   String dat = data_string ();
-  String length_string = String_convert::int2hex (dat.length () 
-    + footer_string_.length (), 8, '0');
+  String length_string = String_convert::int2hex (dat.length ()
+                                                 + footer_string_.length (), 8, '0');
   length_string = String_convert::hex2bin (length_string);
   str += length_string;
   str += dat;
@@ -88,7 +88,7 @@ Midi_duration::to_string () const
   return String ("<duration: ") + ::to_string (seconds_) + ">";
 }
 
-Midi_event::Midi_event (Moment delta_mom, Midi_itemmidi)
+Midi_event::Midi_event (Moment delta_mom, Midi_item *midi)
 {
   delta_mom_ = delta_mom;
   midi_ = midi;
@@ -96,12 +96,12 @@ Midi_event::Midi_event (Moment delta_mom, Midi_item* midi)
 
 /*
   ugh. midi output badly broken since grace note hackage.
- */
+*/
 String
 Midi_event::to_string () const
 {
-  Rational rat_dt = (delta_mom_.main_part_ * Rational (384) +
-    delta_mom_.grace_part_ * Rational (100))*Rational (4);
+  Rational rat_dt = (delta_mom_.main_part_ * Rational (384)
+                    + delta_mom_.grace_part_ * Rational (100))*Rational (4);
   int delta_i = int (rat_dt);
 
   String delta_string = Midi_item::i2varint_string (delta_i);
@@ -110,11 +110,10 @@ Midi_event::to_string () const
   return delta_string + midi_string;
 }
 
-
 Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
 {
   String str;
-       
+
   String format_string = String_convert::int2hex (format_i, 4, '0');
   str += String_convert::hex2bin (format_string);
        
@@ -127,7 +126,7 @@ Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
   set ("MThd", str, "");
 }
 
-Midi_instrument::Midi_instrument (Audio_instrumenta)
+Midi_instrument::Midi_instrument (Audio_instrument *a)
 {
   audio_ = a;
   audio_->str_.to_lower ();
@@ -141,14 +140,14 @@ Midi_instrument::to_string () const
 
   /*
     UGH. don't use eval.
-   */
+  */
   SCM proc = ly_lily_module_constant ("midi-program");
   SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
   found = (program != SCM_BOOL_F);
   if (found)
     program_byte = scm_to_int (program);
   else
-      warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
+    warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
 
   String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz
   str += ::to_string ((char)program_byte);
@@ -168,7 +167,7 @@ String
 Midi_item::i2varint_string (int i)
 {
   int buffer_i = i & 0x7f;
-  while ((i >>= 7) > 0) 
+  while ((i >>= 7) > 0)
     {
       buffer_i <<= 8;
       buffer_i |= 0x80;
@@ -176,7 +175,7 @@ Midi_item::i2varint_string (int i)
     }
 
   String str;
-  while (1) 
+  while (1)
     {
       str += ::to_string ((char)buffer_i);
       if (buffer_i & 0x80)
@@ -187,7 +186,7 @@ Midi_item::i2varint_string (int i)
   return str;
 }
 
-Midi_key::Midi_key (Audio_key*a)
+Midi_key::Midi_key (Audio_key *a)
 {
   audio_ = a;
 }
@@ -254,7 +253,7 @@ Midi_note::get_pitch () const
     {
       warning (_ ("silly pitch"));
       p = 0;
-     }
+    }
   return p;
 }
 
@@ -268,13 +267,13 @@ Midi_note::to_string () const
   // print warning if fine tuning was needed, HJJ
   if (get_fine_tuning () != 0)
     {
-      warning (_f ("Experimental: temporarily fine tuning (of %d cents) a channel.", 
-           get_fine_tuning ()));
+      warning (_f ("Experimental: temporarily fine tuning (of %d cents) a channel.",
+                  get_fine_tuning ()));
 
       finetune = PITCH_WHEEL_CENTER;
       // Move pitch wheel to a shifted position.
       // The pitch wheel range (of 4 semitones) is multiplied by the cents.
-      finetune += (PITCH_WHEEL_RANGE * get_fine_tuning ()) / (4 * 100);
+      finetune += (PITCH_WHEEL_RANGE *get_fine_tuning ()) / (4 * 100);
 
       str += ::to_string ((char) (0xE0 + channel_));
       str += ::to_string ((char) (finetune & 0x7F));
@@ -289,7 +288,7 @@ Midi_note::to_string () const
   return str;
 }
 
-Midi_note_off::Midi_note_off (Midi_noten)
+Midi_note_off::Midi_note_off (Midi_note *n)
   : Midi_note (n->audio_)
 {
   on_ = n;
@@ -298,7 +297,7 @@ Midi_note_off::Midi_note_off (Midi_note* n)
   // Anybody who hears any difference, or knows how this works?
   //  0 should definitely be avoided, notes stick on some sound cards.
   // 64 is supposed to be neutral
-  
+
   aftertouch_byte_ = 64;
 }
 
@@ -316,14 +315,14 @@ Midi_note_off::to_string () const
       // Move pitch wheel back to the central position.
       str += ::to_string ((char) 0x00);
       str += ::to_string ((char) (0xE0 + channel_));
-      str += ::to_string ((char) (PITCH_WHEEL_CENTER & 0x7F));
+      str += ::to_string ((char) (PITCH_WHEEL_CENTER &0x7F));
       str += ::to_string ((char) (PITCH_WHEEL_CENTER >> 7));
     }
 
   return str;
 }
 
-Midi_dynamic::Midi_dynamic (Audio_dynamica)
+Midi_dynamic::Midi_dynamic (Audio_dynamic *a)
 {
   audio_ = a;
 }
@@ -338,9 +337,9 @@ Midi_dynamic::to_string () const
     Main volume controller (per channel):
     07 MSB
     27 LSB
-   */
+  */
   static Real const full_scale = 127;
-  
+
   int volume = (int) (audio_->volume_*full_scale);
   if (volume <= 0)
     volume = 1;
@@ -352,7 +351,7 @@ Midi_dynamic::to_string () const
   return str;
 }
 
-Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedala)
+Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedal *a)
 {
   audio_ = a;
 }
@@ -375,7 +374,7 @@ Midi_piano_pedal::to_string () const
   return str;
 }
 
-Midi_tempo::Midi_tempo (Audio_tempoa)
+Midi_tempo::Midi_tempo (Audio_tempo *a)
 {
   audio_ = a;
 }
@@ -411,19 +410,19 @@ Midi_track::Midi_track ()
   //                00 00 00 3B     chunk length (59)
   //        00      FF 58 04 04 02 18 08    time signature
   //        00      FF 51 03 07 A1 20       tempo
-// FF 59 02 sf mi  Key Signature
-//         sf = -7:  7 flats
-//         sf = -1:  1 flat
-//         sf = 0:  key of C
-//         sf = 1:  1 sharp
-//         sf = 7: 7 sharps
-//         mi = 0:  major key
-//         mi = 1:  minor key
+
+  // FF 59 02 sf mi  Key Signature
+  //         sf = -7:  7 flats
+  //         sf = -1:  1 flat
+  //         sf = 0:  key of C
+  //         sf = 1:  1 sharp
+  //         sf = 7: 7 sharps
+  //         mi = 0:  major key
+  //         mi = 1:  minor key
 
   number_ = 0;
-       
-  char constdata_str0 = ""
+
+  char const *data_str0 = ""
     //        "00" "ff58" "0404" "0218" "08"
     // "00" "ff51" "0307" "a120"
     // why a key at all, in midi?
@@ -431,24 +430,24 @@ Midi_track::Midi_track ()
     // "00" "ff59" "02" "00" "00"
     // key: F (scsii-menuetto)
     //                           "00" "ff59" "02" "ff" "00"
-       ;
+    ;
 
   String data_string;
   // only for format 0 (currently using format 1)?
   data_string += String_convert::hex2bin (data_str0);
 
-  char constfooter_str0 = "00" "ff2f" "00";
+  char const *footer_str0 = "00" "ff2f" "00";
   String footer_string = String_convert::hex2bin (footer_str0);
 
   set ("MTrk", data_string, footer_string);
 }
 
-void 
-Midi_track::add (Moment delta_time_mom, Midi_itemmidi)
+void
+Midi_track::add (Moment delta_time_mom, Midi_item *midi)
 {
   assert (delta_time_mom >= Moment (0));
 
-  Midi_event * e = new Midi_event (delta_time_mom, midi);
+  Midi_event *e = new Midi_event (delta_time_mom, midi);
   event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
 }
 
@@ -458,11 +457,11 @@ Midi_track::data_string () const
   String str = Midi_chunk::data_string ();
   if (midi_debug_global_b)
     str += "\n";
-  for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_) 
+  for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
     {
       str += i->car_->to_string ();
       if (midi_debug_global_b)
-        str += "\n";
+       str += "\n";
     }
   return str;
 }
index bd385c0a4cd180cafcb96af6813d103402488f54..aa1619e2c44e1ffe66383c8b7dd5ed641719a920 100644 (file)
@@ -19,7 +19,7 @@
 Midi_stream::Midi_stream (String file_name)
 {
   file_name_string_ = file_name;
-  out_file_ = fopen (file_name.to_str0(), "wb");
+  out_file_ = fopen (file_name.to_str0 (), "wb");
 }
 
 Midi_stream::~Midi_stream ()
@@ -27,8 +27,8 @@ Midi_stream::~Midi_stream ()
   fclose (out_file_);
 }
 
-Midi_stream&
-Midi_stream::operator << (String str)
+Midi_stream &
+Midi_stream::operator<< (String str)
 {
   size_t sz = sizeof (Byte);
   size_t n = str.length ();
@@ -41,8 +41,8 @@ Midi_stream::operator << (String str)
   return *this;
 }
 
-Midi_stream&
-Midi_stream::operator << (Midi_item const& midi_c_r)
+Midi_stream &
+Midi_stream::operator<< (Midi_item const &midi_c_r)
 {
   String str = midi_c_r.to_string ();
 
index 744230b36b659179f3fa2be6da9fa93c7ed17e7f..1223133d13294e087343769cfa038de2565d7947 100644 (file)
@@ -4,8 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-         Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #include "midi-walker.hh"
 
 #include "midi-stream.hh"
 #include "warn.hh"
 
-Midi_note_event::Midi_note_event () 
-{ 
+Midi_note_event::Midi_note_event ()
+{
   ignore_b_ = false;
 }
 
 int
-compare (Midi_note_event const& left, Midi_note_event const& right)
+compare (Midi_note_event const &left, Midi_note_event const &right)
 {
-  Moment m =   (left.key - right.key);
+  Moment m = (left.key - right.key);
 
-  if (m<0)
+  if (m < 0)
     return -1;
   else if (m > 0)
     return 1;
@@ -33,7 +33,7 @@ compare (Midi_note_event const& left, Midi_note_event const& right)
     return 0;
 }
 
-Midi_walker::Midi_walker (Audio_staff* audio_staff, Midi_track* track)
+Midi_walker::Midi_walker (Audio_staff *audio_staff, Midi_track *track)
 {
   track_ = track;
   index_ = 0;
@@ -43,30 +43,30 @@ Midi_walker::Midi_walker (Audio_staff* audio_staff, Midi_track* track)
 }
 
 Midi_walker::~Midi_walker ()
-{ 
+{
   // ugh
   do_stop_notes (last_mom_ + Moment (Rational (10, 1)));
 }
 
 /**
-  Find out if start_note event is needed, and do it if needed.
- */
-void 
-Midi_walker::do_start_note (Midi_notenote)
+   Find out if start_note event is needed, and do it if needed.
+*/
+void
+Midi_walker::do_start_note (Midi_note *note)
 {
-  Audio_itemptr = (*items_)[index_];
+  Audio_item *ptr = (*items_)[index_];
   Moment stop_mom = note->get_length () + ptr->audio_column_->at_mom ();
 
   bool play_start = true;
-  for (int i = 0; i < stop_note_queue.size (); i++) 
+  for (int i = 0; i < stop_note_queue.size (); i++)
     {
       /* if this pith already in queue */
-      if (stop_note_queue[i].val->get_pitch () == note->get_pitch ()) 
+      if (stop_note_queue[i].val->get_pitch () == note->get_pitch ())
        {
          if (stop_note_queue[i].key < stop_mom)
            {
              /* let stopnote in queue be ignored,
-              new stop note wins */
+                new stop note wins */
              stop_note_queue[i].ignore_b_ = true;
              /* don't replay start note, */
              play_start = false;
@@ -79,7 +79,7 @@ Midi_walker::do_start_note (Midi_note* note)
              delete note;
              note = 0;
              break;
-         }
+           }
        }
     }
 
@@ -96,12 +96,12 @@ Midi_walker::do_start_note (Midi_note* note)
 }
 
 /**
-  Output note events for all notes which end before #max_mom#
- */
+   Output note events for all notes which end before #max_mom#
+*/
 void
 Midi_walker::do_stop_notes (Moment max_mom)
 {
-  while (stop_note_queue.size () && stop_note_queue.front ().key <= max_mom) 
+  while (stop_note_queue.size () && stop_note_queue.front ().key <= max_mom)
     {
       Midi_note_event e = stop_note_queue.get ();
       if (e.ignore_b_)
@@ -109,47 +109,46 @@ Midi_walker::do_stop_notes (Moment max_mom)
          delete e.val;
          continue;
        }
-      
+
       Moment stop_mom = e.key;
-      Midi_notenote = e.val;
-       
+      Midi_note *note = e.val;
+
       output_event (stop_mom, note);
     }
 }
 
-/** 
-  Advance the track to #now#, output the item, and adjust current "moment". 
- */
+/**
+   Advance the track to #now#, output the item, and adjust current "moment".
+*/
 void
-Midi_walker::output_event (Moment now_mom, Midi_iteml)
+Midi_walker::output_event (Moment now_mom, Midi_item *l)
 {
-  Moment delta_t = now_mom - last_mom_ ;
+  Moment delta_t = now_mom - last_mom_;
   last_mom_ = now_mom;
 
   /*
     this is not correct, but at least it doesn't crash when you
     start with graces
-   */
+  */
   if (delta_t < Moment (0))
     {
       delta_t = Moment (0);
     }
 
-  
   track_->add (delta_t, l);
 }
 
 void
 Midi_walker::process ()
 {
-  Audio_itemaudio = (*items_)[index_];
+  Audio_item *audio = (*items_)[index_];
   do_stop_notes (audio->audio_column_->at_mom ());
 
-  if (Midi_itemmidi = Midi_item::get_midi (audio))
+  if (Midi_item *midi = Midi_item::get_midi (audio))
     {
       midi->channel_ = track_->channel_;
       //midi->channel_ = track_->number_;
-      if (Midi_note* note = dynamic_cast<Midi_note*> (midi))
+      if (Midi_note *note = dynamic_cast<Midi_note *> (midi))
        {
          if (note->get_length ().to_bool ())
            do_start_note (note);
@@ -166,7 +165,7 @@ Midi_walker::ok () const
 }
 
 void
-Midi_walker::operator ++ (int)
+Midi_walker::operator++ (int)
 {
   assert (ok ());
   index_++;
index 7199cac19742872239384e5520c4df35ca850089..0d1144ec13f67771a6fee106936108ca01597fb8 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-    Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include <math.h>
 #include "misc.hh"
 #include "string.hh"
 
-
 /*
-  Return the 2-log, rounded down 
- */
+  Return the 2-log, rounded down
+*/
 int
 intlog2 (int d)
 {
   assert (d);
   int i = 0;
-  while ((d != 1)) 
+  while ((d != 1))
     {
       d /= 2;
       i++;
     }
-  
-  assert (! (d/2));
+
+  assert (! (d / 2));
   return i;
 }
 
 double
 log_2 (double x)
 {
-  return log (x)  /log (2.0);
+  return log (x) /log (2.0);
 }
 
 Array<String>
 split_string (String s, char c)
 {
-  Array<String> rv; 
+  Array<String> rv;
   while (s.length ())
     {
       int i = s.index (c);
-      
+
       if (i == 0)
        {
          s = s.nomid_string (0, 1);
          continue;
        }
-      
+
       if (i < 0)
-       i = s.length () ;
+       i = s.length ();
 
       rv.push (s.cut_string (0, i));
       s = s.nomid_string (0, i);
index 79ff5ea2f1c12cbe623276f10215daceded7719b..3218a0ae8beb3d1ee2319c5d2932da03d2024a2d 100644 (file)
@@ -1,8 +1,8 @@
 /*
   modified-font-metric.cc -- declare Modified_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include <cctype>
@@ -19,12 +19,12 @@ Modified_font_metric::Modified_font_metric (Font_metric *fm,
                                            Real magnification)
 {
   magnification_ = magnification;
-  
+
   SCM desc = fm->description_;
 
   Real total_mag = magnification * scm_to_double (scm_cdr (desc));
   assert (total_mag);
-  
+
   description_ = scm_cons (scm_car (desc), scm_make_real (total_mag));
   orig_ = fm;
 }
@@ -42,21 +42,20 @@ Modified_font_metric::design_size () const
   return orig_->design_size ();
 }
 
-
-Box 
+Box
 Modified_font_metric::get_indexed_char (int i) const
 {
   Box b = orig_->get_indexed_char (i);
   b.scale (magnification_);
-  return b;  
+  return b;
 }
 
-Box 
+Box
 Modified_font_metric::get_ascii_char (int i) const
 {
   Box b = orig_->get_ascii_char (i);
   b.scale (magnification_);
-  return b;  
+  return b;
 }
 
 int
@@ -102,30 +101,30 @@ Modified_font_metric::derived_mark () const
 {
 }
 
-/* TODO: put this klutchness behind ly:option switch.  */  
+/* TODO: put this klutchness behind ly:option switch.  */
 Box
 Modified_font_metric::tex_kludge (String text) const
 {
   Interval ydims;
   Real w = 0;
-  for (int i = 0; i < text.length (); i++) 
+  for (int i = 0; i < text.length (); i++)
     {
-      switch (text[i]) 
+      switch (text[i])
        {
        case '\\':
          /* Accent marks use width of base letter */
-         if (i +1 < text.length ())
-          {
-            if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"'
-                || text[i+1]=='^')
-              {
-                i++;
-                break;
-              }
-            /* For string width \\ is a \ and \_ is a _. */
-            if (text[i+1]=='\\' || text[i+1]=='_')        
-                break;
-          }
+         if (i +1 < text.length ())
+           {
+             if (text[i + 1]=='\'' || text[i + 1]=='`' || text[i+1]=='"'
+                 || text[i+1]=='^')
+               {
+                 i++;
+                 break;
+               }
+             /* For string width \\ is a \ and \_ is a _. */
+             if (text[i + 1]=='\\' || text[i+1]=='_')        
+               break;
+           }
          
          for (i++; (i < text.length ()) && !isspace (text[i]) 
                 && text[i]!='{' && text[i]!='}'; i++)
@@ -143,7 +142,7 @@ Modified_font_metric::tex_kludge (String text) const
          Box b = get_ascii_char ((unsigned char)text[i]);
          
          /* Use the width of 'x' for unknown characters */
-         if (b[X_AXIS].length () == 0) 
+         if (b[X_AXIS].length () == 0)
            b = get_ascii_char ((unsigned char)'x');
          
          w += b[X_AXIS].length ();
@@ -197,21 +196,21 @@ Modified_font_metric::text_dimension (String text) const
 
   Real w = 0.0;
 
-  for (int i = 0; i < text.length (); i++) 
+  for (int i = 0; i < text.length (); i++)
     {
       Box b = get_ascii_char ((unsigned char)text[i]);
-    
+
       w += b[X_AXIS].length ();
-      ydims.unite (b[Y_AXIS]); 
+      ydims.unite (b[Y_AXIS]);
     }
   if (ydims.is_empty ())
     ydims = Interval (0, 0);
 
-  b = Box(Interval(0, w), ydims);
+  b = Box (Interval (0, w), ydims);
   return b;
 }
 
-Font_metric*
+Font_metric *
 Modified_font_metric::original_font () const
 {
   return orig_;
@@ -220,11 +219,11 @@ Modified_font_metric::original_font () const
 SCM
 Modified_font_metric::sub_fonts () const
 {
-  return orig_->sub_fonts();
+  return orig_->sub_fonts ();
 }
-  
+
 String
 Modified_font_metric::font_name () const
 {
-  return original_font ()->font_name();
+  return original_font ()->font_name ();
 }
index a9ba114ed8c0b9b9050baeaa386163bd7a219dda..865431c6da63b9f84bfd7135c324c1355d31eaea 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   moment.cc -- implement Moment bindings
 
   source file of the GNU LilyPond music typesetter
@@ -8,7 +8,6 @@
 
 #include "moment.hh"
 
-
 /* TODO: add optional factor argument. */
 LY_DEFINE (ly_make_moment, "ly:make-moment",
           2, 2, 0, (SCM n, SCM d, SCM gn, SCM gd),
@@ -83,7 +82,7 @@ LY_DEFINE (ly_moment_main_numerator, "ly:moment-main-numerator",
   Moment *ma = unsmob_moment (mom);
   SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
 
-  return scm_from_int (ma->main_part_.numerator ()); 
+  return scm_from_int (ma->main_part_.numerator ());
 }
 
 LY_DEFINE (ly_moment_main_denominator, "ly:moment-main-denominator",
@@ -93,7 +92,7 @@ LY_DEFINE (ly_moment_main_denominator, "ly:moment-main-denominator",
   Moment *ma = unsmob_moment (mom);
   SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
 
-  return scm_from_int (ma->main_part_.denominator ()); 
+  return scm_from_int (ma->main_part_.denominator ());
 }
 
 LY_DEFINE (ly_moment_less_p, "ly:moment<?",
@@ -104,6 +103,6 @@ LY_DEFINE (ly_moment_less_p, "ly:moment<?",
   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);
+  return ly_bool2scm (*ma < *mb);
 }
 
index b2d1941a65f540d7ad442514cc21d5dbc735fb27..c892d5f459d4183dc579408b35530d64b2cdd8df 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   moment.cc -- implement Moment
 
   source file of the GNU LilyPond music typesetter
@@ -17,7 +17,7 @@ Moment::Moment ()
 Moment::Moment (int m)
 {
   main_part_ = Rational (m);
-  grace_part_ = Rational ( 0);
+  grace_part_ = Rational (0);
 }
 
 Moment::Moment (Rational m, Rational g)
@@ -45,13 +45,13 @@ Moment::mark_smob (SCM)
 int
 Moment::print_smob (SCM s, SCM port, scm_print_state *)
 {
-  Moment  *r = (Moment *) SCM_CELL_WORD_1 (s);
-     
+  Moment *r = (Moment *) SCM_CELL_WORD_1 (s);
+
   scm_puts ("#<Mom ", port);
   String str = r->to_string ();
   scm_puts ((char *)str.to_str0 (), port);
   scm_puts (">", port);
-  
+
   return 1;
 }
 
@@ -59,19 +59,18 @@ SCM
 Moment::as_scheme () const
 {
   return scm_list_5 (ly_symbol2scm ("ly:make-moment"),
-                    scm_from_int (main_part_.num()),
-                    scm_from_int (main_part_.den()),
-                    scm_from_int (grace_part_.num()),
-                    scm_from_int (grace_part_.den()));
+                    scm_from_int (main_part_.num ()),
+                    scm_from_int (main_part_.den ()),
+                    scm_from_int (grace_part_.num ()),
+                    scm_from_int (grace_part_.den ()));
 }
 
-
 SCM
 Moment::equal_p (SCM a, SCM b)
 {
   Moment *m1 = unsmob_moment (a);
   Moment *m2 = unsmob_moment (b);
-      
+
   return (*m1 == *m2) ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
@@ -92,15 +91,15 @@ Moment::compare (Moment const &a, Moment const &b)
 }
 
 void
-Moment::operator += (Moment const &src)
+Moment::operator+= (Moment const &src)
 {
-  main_part_ += src.main_part_ ;
+  main_part_ += src.main_part_;
   grace_part_ += src.grace_part_;
 }
 void
-Moment::operator -= (Moment const &src)
+Moment::operator-= (Moment const &src)
 {
-  main_part_ -= src.main_part_ ;
+  main_part_ -= src.main_part_;
   grace_part_ -= src.grace_part_;
 }
 
@@ -108,9 +107,9 @@ Moment::operator -= (Moment const &src)
   only take the main part of SRC for multiplication.
 */
 void
-Moment::operator *= (Moment const &src)
+Moment::operator*= (Moment const &src)
 {
-  main_part_ *= src.main_part_ ;
+  main_part_ *= src.main_part_;
   grace_part_ *= src.main_part_;
 }
 
@@ -118,9 +117,9 @@ Moment::operator *= (Moment const &src)
   only take the main part of SRC for multiplication.
 */
 void
-Moment::operator /= (Moment const &src)
+Moment::operator/= (Moment const &src)
 {
-  main_part_ /= src.main_part_ ;
+  main_part_ /= src.main_part_;
   grace_part_ /= src.main_part_;
 }
 
@@ -151,7 +150,7 @@ Moment::set_infinite (int k)
 String
 Moment::to_string () const
 {
-  String s =  main_part_.to_string ();
+  String s = main_part_.to_string ();
   if (grace_part_)
     {
       s += "G" + grace_part_.to_string ();
@@ -160,18 +159,17 @@ Moment::to_string () const
 }
 
 Moment
-Moment::operator - () const
+Moment::operator- () const
 {
   Moment m;
-  m.grace_part_ = - grace_part_;
-  m. main_part_ = - main_part_ ;
+  m.grace_part_ = -grace_part_;
+  m. main_part_ = -main_part_;
   return m;
 }
 
-
 #ifdef STREAM_SUPPORT
 std::ostream &
-operator << (std::ostream &os, Moment const &m)
+operator<< (std::ostream &os, Moment const &m)
 {
   os << m.to_string ();
   return os;
@@ -188,7 +186,6 @@ robust_scm2moment (SCM m, Moment d)
     return *p;
 }
 
-
 bool
 moment_less (SCM a, SCM b)
 {
index ab27e6cd06b278a6da43dc7e9d07a8a63f0ff4b2..a078e4db1e1c4cf68fe87b07e92a6b0337b419fa 100644 (file)
@@ -2,7 +2,7 @@
   multi_measure_rest-engraver.cc -- implement Multi_measure_rest_engraver
 
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-       Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "multi-measure-rest.hh"
@@ -13,7 +13,7 @@
 #include "moment.hh"
 
 /**
-   The name says it all: make multi measure rests 
+   The name says it all: make multi measure rests
 */
 class Multi_measure_rest_engraver : public Engraver
 {
@@ -21,21 +21,21 @@ public:
   TRANSLATOR_DECLARATIONS (Multi_measure_rest_engraver);
 
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void process_music ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
   virtual void finalize ();
 
 private:
-  Music * rest_ev_;
+  Music *rest_ev_;
   Link_array<Music> text_events_;
   int start_measure_;
   Rational last_main_moment_;
   Moment stop_moment_;
-  
+
   bool bar_seen_;
-  Item *last_command_item_ ;
+  Item *last_command_item_;
   Spanner *last_rest_;
   Spanner *mmrest_;
 
@@ -54,13 +54,13 @@ Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
 }
 
 bool
-Multi_measure_rest_engraver::try_music (Musicreq)
+Multi_measure_rest_engraver::try_music (Music *req)
 {
   if (req->is_mus_type ("multi-measure-rest-event"))
     {
       rest_ev_ = req;
       stop_moment_ = now_mom () + rest_ev_->get_length ();
-      
+
       return true;
     }
   else if (req->is_mus_type ("multi-measure-text-event"))
@@ -80,7 +80,7 @@ Multi_measure_rest_engraver::process_music ()
       mmrest_ = make_spanner ("MultiMeasureRest", rest_ev_->self_scm ());
 
       Spanner *sp
-       = make_spanner ("MultiMeasureRestNumber", rest_ev_->self_scm () );
+       = make_spanner ("MultiMeasureRestNumber", rest_ev_->self_scm ());
       numbers_.push (sp);
 
       if (text_events_.size ())
@@ -88,42 +88,45 @@ Multi_measure_rest_engraver::process_music ()
          for (int i = 0; i < text_events_.size (); i++)
            {
 
-             Musice = text_events_[i];
+             Music *e = text_events_[i];
              Spanner *sp
-               = make_spanner ("MultiMeasureRestText", e->self_scm () );
+               = make_spanner ("MultiMeasureRestText", e->self_scm ());
              SCM t = e->get_property ("text");
              SCM dir = e->get_property ("direction");
              sp->set_property ("text", t);
              if (is_direction (dir))
                sp->set_property ("direction", dir);
-             
+
              numbers_.push (sp);
            }
 
          /*
            Stack different scripts.
-          */
-         Direction d = DOWN; 
-         do {
-           Grob *last = 0;
-           for (int i = 0; i <numbers_.size (); i++)
-             {
-               if (scm_int2num (d) == numbers_[i]->get_property ("direction"))
-                 {
-                   if (last)
-                     Side_position_interface::add_support (numbers_[i], last);
-                   last = numbers_[i];
-                 }
-             }
-         } while (flip (&d) != DOWN);
+         */
+         Direction d = DOWN;
+         do
+           {
+             Grob *last = 0;
+             for (int i = 0; i <numbers_.size (); i++)
+               {
+                 if (scm_int2num (d) == numbers_[i]->get_property ("direction"))
+                   {
+                     if (last)
+                       Side_position_interface::add_support (numbers_[i], last);
+                     last = numbers_[i];
+                   }
+               }
+           }
+         while (flip (&d) != DOWN);
+
        }
 
-      for (int i = 0 ; i < numbers_.size (); i++)
+      for (int i = 0; i < numbers_.size (); i++)
        {
          Side_position_interface::add_support (numbers_[i], mmrest_);
          numbers_[i]->set_parent (mmrest_, Y_AXIS);
        }
-      
+
       start_measure_
        = scm_to_int (get_property ("currentBarNumber"));
     }
@@ -137,7 +140,7 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
   /*
     We can not do this earlier, as breakableSeparationItem is not yet there.
   */
-  
+
   if (bar_seen_)
     {
       Grob *cmc = unsmob_grob (get_property ("breakableSeparationItem"));
@@ -146,11 +149,11 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
 
       /*
        Ugh, this is a kludge - need this for multi-measure-rest-grace.ly
-       */
-      last_command_item_ = dynamic_cast<Item*> (cmc);
+      */
+      last_command_item_ = dynamic_cast<Item *> (cmc);
     }
 
-  if (last_command_item_ &&  (mmrest_ || last_rest_))
+  if (last_command_item_ && (mmrest_ || last_rest_))
     {
       if (last_rest_)
        {
@@ -168,8 +171,8 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
          last_command_item_ = 0;
        }
     }
-  
-  Moment mp(robust_scm2moment (get_property ("measurePosition"),  Moment (0)));
+
+  Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0)));
   if (last_rest_)
     {
       last_rest_ = 0;
@@ -189,7 +192,7 @@ Multi_measure_rest_engraver::start_translation_timestep ()
 
   bar_seen_ = false;
 
-  Moment mp (robust_scm2moment (get_property ("measurePosition"),  Moment (0)));
+  Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0)));
 
   Moment now = now_mom ();
   if (mmrest_
@@ -198,7 +201,7 @@ Multi_measure_rest_engraver::start_translation_timestep ()
     {
       last_rest_ = mmrest_;
       last_numbers_ = numbers_;
-      
+
       int cur = scm_to_int (get_property ("currentBarNumber"));
       int num = cur - start_measure_;
 
@@ -217,18 +220,18 @@ Multi_measure_rest_engraver::start_translation_timestep ()
 
       mmrest_ = 0;
       numbers_.clear ();
-      
-      Grob * last = last_numbers_.size () ? last_numbers_[0] : 0;
+
+      Grob *last = last_numbers_.size () ? last_numbers_[0] : 0;
       if (last && last->get_property ("text") == SCM_EOL)
        {
          SCM thres = get_property ("restNumberThreshold");
          int t = 1;
          if (scm_is_number (thres))
            t = scm_to_int (thres);
-      
+
          if (num <= t)
            last->suicide ();
-         else 
+         else
            {
              SCM text
                = scm_number_to_string (scm_int2num (num), scm_from_int (10));
@@ -246,14 +249,13 @@ Multi_measure_rest_engraver::finalize ()
 }
 
 ADD_TRANSLATOR (Multi_measure_rest_engraver,
-/* descr */
-                 "Engraves multi-measure rests that are produced with @code{R}.  Reads "
-"measurePosition and currentBarNumber to determine what number to print "
-"over the MultiMeasureRest.  Reads measureLength to determine if it "
-"should use a whole rest or a breve rest to represent 1 measure "
-                 ,
-/* creats*/       "MultiMeasureRest MultiMeasureRestNumber MultiMeasureRestText",
-/* accepts */     "multi-measure-rest-event multi-measure-text-event",
-/* acks  */      "",
-/* reads */       "currentBarNumber restNumberThreshold breakableSeparationItem currentCommandColumn measurePosition measureLength",
-/* write */       "");
+               /* descr */
+               "Engraves multi-measure rests that are produced with @code{R}.  Reads "
+               "measurePosition and currentBarNumber to determine what number to print "
+               "over the MultiMeasureRest.  Reads measureLength to determine if it "
+               "should use a whole rest or a breve rest to represent 1 measure ",
+               /* creats*/ "MultiMeasureRest MultiMeasureRestNumber MultiMeasureRestText",
+               /* accepts */ "multi-measure-rest-event multi-measure-text-event",
+               /* acks  */ "",
+               /* reads */ "currentBarNumber restNumberThreshold breakableSeparationItem currentCommandColumn measurePosition measureLength",
+               /* write */ "");
index f2298a92de21d9e497dc29e3f6a30802976a7af7..1cc6d2b0311cf8c79c4f8f444f1d6a7c0d3d2acf 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   multi-measure-rest.cc -- implement Multi_measure_rest
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+*/
 
 #include "multi-measure-rest.hh"
 
@@ -27,49 +26,48 @@ SCM
 Multi_measure_rest::percent (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner *sp = dynamic_cast<Spanner*> (me);
-  
-  Stencil r = Percent_repeat_item_interface::x_percent (me, 1,  0.75, 1.6);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
+
+  Stencil r = Percent_repeat_item_interface::x_percent (me, 1, 0.75, 1.6);
 
   // ugh copy & paste.
-  
+
   Interval sp_iv;
   Direction d = LEFT;
   do
     {
-      Item * col = sp->get_bound (d)->get_column ();
+      Item *col = sp->get_bound (d)->get_column ();
 
       Interval coldim = col->extent (0, X_AXIS);
 
-      sp_iv[d] = coldim[-d]  ;
+      sp_iv[d] = coldim[-d];
     }
   while ((flip (&d)) != LEFT);
   Real x_off = 0.0;
 
-  Real rx  = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
+  Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
   /*
     we gotta stay clear of sp_iv, so move a bit to the right if
     needed.
-   */
-  x_off += (sp_iv[LEFT] -  rx) >? 0;
+  */
+  x_off += (sp_iv[LEFT] - rx) >? 0;
 
   /*
     center between stuff.
-   */
+  */
   x_off += sp_iv.length ()/ 2;
 
   r.translate_axis (x_off, X_AXIS);
 
-  
   return r.smobbed_copy ();
 }
 
 MAKE_SCHEME_CALLBACK (Multi_measure_rest, print, 1);
 SCM
-Multi_measure_rest::print (SCM smob) 
+Multi_measure_rest::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner * sp = dynamic_cast<Spanner*> (me);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
 
   Interval sp_iv;
   Direction d = LEFT;
@@ -77,25 +75,24 @@ Multi_measure_rest::print (SCM smob)
   Grob *common = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
   do
     {
-      Item * b = sp->get_bound (d);
+      Item *b = sp->get_bound (d);
 
-      Interval coldim =  (Separation_item::has_interface (b))
+      Interval coldim = (Separation_item::has_interface (b))
        ? Separation_item::relative_width (b, common)
        : b->extent (common, X_AXIS);
 
-      sp_iv[d] = coldim.is_empty () ?   b->relative_coordinate (common, X_AXIS) : coldim[-d];
+      sp_iv[d] = coldim.is_empty () ? b->relative_coordinate (common, X_AXIS) : coldim[-d];
     }
   while ((flip (&d)) != LEFT);
 
   Real space = sp_iv.length ();
 
-  Real rx  = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
+  Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
   /*
     we gotta stay clear of sp_iv, so move a bit to the right if
     needed.
-   */
-  Real x_off = (sp_iv[LEFT] -  rx) >? 0;
-
+  */
+  Real x_off = (sp_iv[LEFT] - rx) >? 0;
 
   Stencil mol;
   mol.add_stencil (symbol_stencil (me, space));
@@ -111,8 +108,6 @@ Multi_measure_rest::print (SCM smob)
   return mol.smobbed_copy ();
 }
 
-
-
 Stencil
 Multi_measure_rest::symbol_stencil (Grob *me, Real space)
 {
@@ -124,14 +119,13 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
     }
   if (measures <= 0)
     return Stencil ();
-  
 
   SCM limit = me->get_property ("expand-limit");
   if (measures > scm_to_int (limit))
     {
-      Real padding = 0.15;  
-      Stencil s =  big_rest (me, (1.0 - 2*padding) * space);
-      s.translate_axis (padding * space,  X_AXIS); 
+      Real padding = 0.15;
+      Stencil s = big_rest (me, (1.0 - 2*padding) * space);
+      s.translate_axis (padding * space, X_AXIS);
       return s;
     }
 
@@ -148,8 +142,8 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
        {
          Stencil s = musfont->find_by_name (Rest::glyph_name (me, -1, "", false));
 
-         s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS);
-      
+         s.translate_axis ((space - s.extent (X_AXIS).length ()) / 2, X_AXIS);
+
          return s;
        }
       else
@@ -158,59 +152,57 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
 
          /*
            ugh.
-          */
+         */
          if (Staff_symbol_referencer::get_position (me) == 0.0)
            s.translate_axis (staff_space, Y_AXIS);
 
-         s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS);
-      
-         return s ;
-        }
+         s.translate_axis ((space - s.extent (X_AXIS).length ()) / 2, X_AXIS);
+
+         return s;
+       }
     }
   else
     {
-      return  church_rest (me, musfont, measures, space);
+      return church_rest (me, musfont, measures, space);
     }
 }
 
-
 /*
   WIDTH can also be 0 to determine the minimum size of the object.
- */
+*/
 Stencil
 Multi_measure_rest::big_rest (Grob *me, Real width)
 {
   Real thick_thick = robust_scm2double (me->get_property ("thick-thickness"), 1.0);
   Real hair_thick = robust_scm2double (me->get_property ("hair-thickness"), .1);
 
-
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real slt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
-  Real y = slt * thick_thick/2 * ss;
+  Real y = slt * thick_thick / 2 * ss;
   Real ythick = hair_thick * slt * ss;
-  Box b (Interval (0,  0 >? (width - 2 * ythick)), Interval (-y, y));
-  
+  Box b (Interval (0, 0 >? (width - 2 * ythick)), Interval (-y, y));
+
   Real blot = width ? (.8 * (y <? ythick)) : 0.0;
-  
-  Stencil m =  Lookup::round_filled_box (b, blot);
+
+  Stencil m = Lookup::round_filled_box (b, blot);
   Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss)), blot);
 
   m.add_at_edge (X_AXIS, RIGHT, yb, 0, 0);
   m.add_at_edge (X_AXIS, LEFT, yb, 0, 0);
 
   m.align_to (X_AXIS, LEFT);
-  
+
   return m;
 }
 
 /*
   Kirchenpause (?)
- */
+*/
 Stencil
 Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures,
                                 Real space)
 {
-  SCM mols = SCM_EOL; 
+  SCM mols = SCM_EOL;
 
   /* See Wanske pp. 125  */
   int l = measures;
@@ -239,7 +231,7 @@ Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures,
          symbols_width += r.extent (X_AXIS).length ();
          mols = scm_cons (r.smobbed_copy (), mols);
        }
-       else
+      else
        {
          int k;
          if (l >= 4)
@@ -267,21 +259,20 @@ Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures,
          symbols_width += r.extent (X_AXIS).length ();
          mols = scm_cons (r.smobbed_copy (), mols);
        }
-      count ++;
+      count++;
     }
 
-  
- /* Make outer padding this much bigger.  */
+  /* Make outer padding this much bigger.  */
   Real outer_padding_factor = 1.5;
   Real inner_padding = (space - symbols_width)
-    / (2 * outer_padding_factor + (count-1)); 
+    / (2 * outer_padding_factor + (count - 1));
   if (inner_padding < 0)
     inner_padding = 1.0;
-  
-  Stencil mol; 
-  for (SCM  s = mols; scm_is_pair (s); s = scm_cdr (s))
-      mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (scm_car (s)),
-                      inner_padding, 0);
+
+  Stencil mol;
+  for (SCM s = mols; scm_is_pair (s); s = scm_cdr (s))
+    mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (scm_car (s)),
+                    inner_padding, 0);
   mol.align_to (X_AXIS, LEFT);
   mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS);
 
@@ -291,7 +282,7 @@ Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures,
 void
 Multi_measure_rest::add_column (Grob *me, Item *c)
 {
-  add_bound_item (dynamic_cast<Spanner*> (me), c);
+  add_bound_item (dynamic_cast<Spanner *> (me), c);
 }
 
 MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods, 1);
@@ -300,8 +291,8 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  Spanner*sp = dynamic_cast<Spanner*> (me);
-  if (!(sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
+  Spanner *sp = dynamic_cast<Spanner *> (me);
+  if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
     {
       programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
       return SCM_UNSPECIFIED;
@@ -310,15 +301,15 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
   Item *li = sp->get_bound (LEFT)->get_column ();
   Item *ri = sp->get_bound (RIGHT)->get_column ();
   Item *lb = li->find_prebroken_piece (RIGHT);
-  Item *rb = ri->find_prebroken_piece (LEFT);      
-  
+  Item *rb = ri->find_prebroken_piece (LEFT);
+
   Item *combinations[4][2] = {{li, ri},
                              {lb, ri},
                              {li, rb},
                              {lb, rb}};
 
   Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length ();
-  
+
   for (int i = 0; i < 4; i++)
     {
       Item *li = combinations[i][0];
@@ -334,8 +325,8 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
       rod.distance_ = li->extent (li, X_AXIS)[BIGGER]
        - ri->extent (ri, X_AXIS)[SMALLER]
        /* 2.0 = magic! */
-       + sym_width  + 2.0;
-  
+       + sym_width + 2.0;
+
       Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0);
       rod.distance_ = max (rod.distance_, minlen);
       rod.add_to_cols ();
index 3443cccfe174dd640e60f2ad32050233632b0368..c576580048728ac3bfb3a27d661c9b1b1ced5775 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-constructor.cc -- implement Music_constructor
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "music-constructor.hh"
 
 
 #include "warn.hh"
 
-static std::map<String, Music_ctor> *ctors_map_;
+static std::map < String, Music_ctor> *ctors_map_;
 
 void
 add_music_ctor (String s, Music_ctor c)
 {
   if (!ctors_map_)
-    ctors_map_ = new std::map<String, Music_ctor>;
-  
- (*ctors_map_)[s] = c;
+    ctors_map_ = new std::map < String, Music_ctor>;
+
 (*ctors_map_)[s] = c;
 }
 
 Music_ctor
@@ -34,14 +33,14 @@ get_music_ctor (String s)
   return (*ctors_map_)[s];
 }
 
-Music * 
+Music *
 make_music (String s, SCM init)
 {
   Music_ctor c = get_music_ctor (s);
   if (!c)
     programming_error (String ("No constructor for music: ") + s);
   assert (c);
-  
+
   return (*c) (init);
 }
 
index 0113c6543cdd1480085a98c22fcf8664e6b6c5af..b1b3bba0bb2246e33e3a22745f98f89dfcb9a087 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   music-function.cc -- implement music_function
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "music-function.hh"
@@ -27,10 +26,9 @@ print_music_function (SCM b, SCM port, scm_print_state *)
   return 1;
 }
 
-
 LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
           (SCM signature, SCM func),
-         "Make a function to process music, to be used for the "
+          "Make a function to process music, to be used for the "
           "parser. @code{func} is the function, and @code{signature} describes "
           "Its arguments. @code{signature} is a list containing either "
           "@code{ly:music?} predicates or other type predicates.")
@@ -40,10 +38,10 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
     {
       if (str != "")
        str += "-";
-      
+
       if (scm_car (s) == Music_type_p_proc)
        str += "music";
-      else if (scm_car (s) == ly_lily_module_constant("markup?"))
+      else if (scm_car (s) == ly_lily_module_constant ("markup?"))
        str += "markup";
       else if (ly_c_procedure_p (scm_car (s)))
        str += "scm";
@@ -51,10 +49,10 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
   if (str == "") str = "noarg";
   scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature"),
                             signature);
-  
+
   scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature-keyword"),
                             ly_symbol2scm (str.to_str0 ()));
-    
+
   SCM_RETURN_NEWSMOB (music_function_tag, func);
 }
 
@@ -64,13 +62,12 @@ is_music_function (SCM music_function)
   return (SCM_NIMP (music_function) && SCM_CELL_TYPE (music_function) == music_function_tag);
 }
 
-
 SCM
 get_music_function_transform (SCM music_function)
 {
   if (!is_music_function (music_function))
     return SCM_UNDEFINED;
-  
+
   return SCM_CELL_OBJECT_1 (music_function);
 }
 
@@ -82,4 +79,4 @@ init_music_function (void)
   scm_set_smob_print (music_function_tag, print_music_function);
 }
 
-ADD_SCM_INIT_FUNC (music_function_tag, init_music_function); 
+ADD_SCM_INIT_FUNC (music_function_tag, init_music_function);
index 58e8597905d106f9fe6cff521e79585a6f0e81c4..6e836ea933b5381337ff21515c0ac06704619720 100644 (file)
@@ -8,7 +8,7 @@
 
 /*
   UGH. too many includes.
- */
+*/
 
 #include "music-iterator.hh"
 
@@ -28,7 +28,7 @@ Music_iterator::Music_iterator ()
   smobify_self ();
 }
 
-Music_iterator::Music_iterator (Music_iterator const)
+Music_iterator::Music_iterator (Music_iterator const &)
 {
   assert (false);
 }
@@ -37,7 +37,7 @@ Music_iterator::~Music_iterator ()
 {
 }
 
-Context * 
+Context *
 Music_iterator::get_outlet () const
 {
   return handle_.get_outlet ();
@@ -71,14 +71,12 @@ Music_iterator::ok () const
   return false;
 }
 
-
-
 SCM
 Music_iterator::get_static_get_iterator (Music *m)
 {
-  Music_iterator * p = 0;
+  Music_iterator *p = 0;
 
-  SCM ctor = m->get_property ("iterator-ctor") ;
+  SCM ctor = m->get_property ("iterator-ctor");
   SCM iter = SCM_EOL;
   if (ly_c_procedure_p (ctor))
     {
@@ -100,11 +98,10 @@ Music_iterator::get_static_get_iterator (Music *m)
   assert (m);
   p->music_length_ = m->get_length ();
   p->start_mom_ = m->start_mom ();
-  
+
   return iter;
 }
 
-
 Moment
 Music_iterator::music_get_length () const
 {
@@ -143,10 +140,10 @@ SCM
 Music_iterator::get_iterator (Music *m) const
 {
   SCM ip = get_static_get_iterator (m);
-  Music_iterator*p = unsmob_iterator (ip);
-  
+  Music_iterator *p = unsmob_iterator (ip);
+
   p->init_translator (m, get_outlet ());
-  
+
   p->construct_children ();
   return ip;
 }
@@ -154,19 +151,18 @@ Music_iterator::get_iterator (Music *m) const
 /*
   TODO: rename to prevent confusion between Context::try_music and
   Iterator::try_music
-  
- */
-Music_iterator*
+*/
+Music_iterator *
 Music_iterator::try_music (Music *m) const
 {
-  bool b = get_outlet ()->try_music ((Music*)m); // ugh
-  Music_iterator * it = b ? (Music_iterator*) this : 0;        // ugh
+  bool b = get_outlet ()->try_music ((Music *)m); // ugh
+  Music_iterator *it = b ? (Music_iterator *) this : 0;        // ugh
   if (!it)
     it = try_music_in_children (m);
   return it;
 }
 
-Music_iterator*
+Music_iterator *
 Music_iterator::try_music_in_children (Music *) const
 {
   return 0;
@@ -189,24 +185,23 @@ IMPLEMENT_DEFAULT_EQUAL_P (Music_iterator);
 SCM
 Music_iterator::mark_smob (SCM smob)
 {
-  Music_iterator * mus = (Music_iterator *)SCM_CELL_WORD_1 (smob);
+  Music_iterator *mus = (Music_iterator *)SCM_CELL_WORD_1 (smob);
 
   mus->derived_mark ();
   /*
     Careful with GC, although we intend the following as pointers
     only, we _must_ mark them.
-   */
+  */
   if (mus->get_outlet ())
     scm_gc_mark (mus->get_outlet ()->self_scm ());
   if (mus->music_)
     scm_gc_mark (mus->music_->self_scm ());
-  
 
   return SCM_EOL;
 }
 
 int
-Music_iterator::print_smob (SCM sm , SCM port, scm_print_state*)
+Music_iterator::print_smob (SCM sm, SCM port, scm_print_state*)
 {
   char s[1000];
 
@@ -239,7 +234,6 @@ Music_iterator::run_always ()const
   return false;
 }
 
-
 bool
 is_child_context (Context *me, Context *child)
 {
@@ -247,18 +241,18 @@ is_child_context (Context *me, Context *child)
     {
       child = child->get_parent_context ();
     }
-  
+
   return child == me;
 }
 
 /*
   move to context of child iterator if it is deeper down in the
   hierarchy.
-  */
+*/
 void
-Music_iterator::descend_to_child (Context * child_report)
+Music_iterator::descend_to_child (Context *child_report)
 {
-  Context * me_report = get_outlet ();
+  Context *me_report = get_outlet ();
   if (is_child_context (me_report, child_report))
     set_context (child_report);
 }
index dc01ff7e4c8260e8ba5268a0b3787c60ed6ca438..a666c87aecf44a4daa1f24f3b58bb4249007df26 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "duration.hh"
@@ -14,7 +13,7 @@
 
 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.")
+          "Get the length of music expression @var{mus}, and return as a @code{Moment} object.")
 {
   Music *sc = unsmob_music (mus);
   SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
@@ -22,11 +21,11 @@ LY_DEFINE (ly_music_length, "ly:music-length",
 }
 
 LY_DEFINE (ly_music_property,
-         "ly:music-property", 2, 0, 0, (SCM mus, SCM sym),
-         "Get the property @var{sym} of music expression @var{mus}.\n"
-         "If @var{sym} is undefined, return @code{' ()}.\n" )
+          "ly:music-property", 2, 0, 0, (SCM mus, SCM sym),
+          "Get the property @var{sym} of music expression @var{mus}.\n"
+          "If @var{sym} is undefined, return @code{' ()}.\n")
 {
-  Music * sc = unsmob_music (mus);
+  Music *sc = unsmob_music (mus);
   SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
   SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
@@ -34,10 +33,10 @@ LY_DEFINE (ly_music_property,
 }
 
 LY_DEFINE (ly_music_set_property, "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}.")
+          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);
+  Music *sc = unsmob_music (mus);
   SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
   SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
@@ -55,7 +54,7 @@ LY_DEFINE (ly_music_name, "ly:music-name",
           "Return the name of @var{music}.")
 {
   Music *m = unsmob_music (mus);
-  SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__ , "music");
+  SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "music");
 
   char const *nm = classname (m);
   return scm_makfrom0str (nm);
@@ -64,13 +63,12 @@ LY_DEFINE (ly_music_name, "ly:music-name",
 /* todo:  property args */
 LY_DEFINE (ly_extended_make_music, "ly:make-bare-music",
           2, 0, 0, (SCM type, SCM props),
-         "Make a C++ music object of type @var{type}, initialize with\n"
-         "@var{props}. \n\n"
-         ""
-         "This function is for internal use, and is only called by "
-         "@code{make-music}, which is the preferred interface "
-         "for creating music objects. "
-         )
+          "Make a C++ music object of type @var{type}, initialize with\n"
+          "@var{props}. \n\n"
+          ""
+          "This function is for internal use, and is only called by "
+          "@code{make-music}, which is the preferred interface "
+          "for creating music objects. ")
 {
   SCM_ASSERT_TYPE (scm_is_string (type), type, SCM_ARG1, __FUNCTION__, "string");
   SCM s = make_music (ly_scm2string (type), props)->self_scm ();
@@ -80,10 +78,10 @@ LY_DEFINE (ly_extended_make_music, "ly:make-bare-music",
 
 /* todo: property args */
 LY_DEFINE (ly_music_mutable_properties, "ly:music-mutable-properties",
-         1, 0, 0, (SCM mus),
-         "Return an alist containing the mutable properties of @var{mus}.\n"
-         "The immutable properties are not available, since "
-         "they are constant and initialized by the "
+          1, 0, 0, (SCM mus),
+          "Return an alist containing the mutable properties of @var{mus}.\n"
+          "The immutable properties are not available, since "
+          "they are constant and initialized by the "
           "@code{make-music} function.\n")
 {
   Music *m = unsmob_music (mus);
@@ -108,8 +106,8 @@ LY_DEFINE (ly_music_list_p, "ly:music-list?",
 }
 
 LY_DEFINE (ly_music_deep_copy, "ly:music-deep-copy",
-         1, 0, 0, (SCM m),
-         "Copy @var{m} and all sub expressions of @var{m}")
+          1, 0, 0, (SCM m),
+          "Copy @var{m} and all sub expressions of @var{m}")
 {
   SCM copy = m;
   if (unsmob_music (m))
@@ -119,17 +117,17 @@ LY_DEFINE (ly_music_deep_copy, "ly:music-deep-copy",
     }
   else if (scm_is_pair (m))
     copy = scm_cons (ly_music_deep_copy (scm_car (m)),
-                   ly_music_deep_copy (scm_cdr (m)));
+                    ly_music_deep_copy (scm_cdr (m)));
   return copy;
 }
 
 LY_DEFINE (ly_music_transpose, "ly:music-transpose",
-         2, 0, 0, (SCM m, SCM p),
-         "Transpose @var{m} such that central C is mapped to @var{p}. "
-         "Return @var{m}.")
+          2, 0, 0, (SCM m, SCM p),
+          "Transpose @var{m} such that central C is mapped to @var{p}. "
+          "Return @var{m}.")
 {
-  Music * sc = unsmob_music (m);
-  Pitch * sp = unsmob_pitch (p);
+  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");
 
@@ -140,74 +138,70 @@ LY_DEFINE (ly_music_transpose, "ly:music-transpose",
 
 /*
   TODO: should take moment factor?
- */
+*/
 LY_DEFINE (ly_music_compress, "ly:music-compress",
-         2, 0, 0, (SCM m, SCM factor),
-         "Compress music object @var{m} by moment @var{factor}."
-          )
+          2, 0, 0, (SCM m, SCM factor),
+          "Compress music object @var{m} by moment @var{factor}.")
 {
-  Music * sc = unsmob_music (m);
+  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");
-  
+
   sc->compress (*unsmob_moment (factor));
   return sc->self_scm ();
 }
 
 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.")
+          (SCM mus),
+          "Extract the duration field from @var{mus}, and return the length.")
 {
-  Music* m =   unsmob_music (mus);
+  Music *m = unsmob_music (mus);
   SCM_ASSERT_TYPE (m, mus, SCM_ARG1, __FUNCTION__, "Music");
-  
+
   Duration *d = unsmob_duration (m->get_property ("duration"));
 
-  Moment l ;
-  
+  Moment l;
+
   if (d)
     {
-      l = d->get_length ();  
+      l = d->get_length ();
     }
   else
     programming_error ("Music has no duration");
   return l.smobbed_copy ();
-  
-}
 
+}
 
 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}.")
+          (SCM mus, SCM fact),
+          "Compress @var{mus} by factor @var{fact}, which is a @code{Moment}.")
 {
-  Music* m =   unsmob_music (mus);
-  Moment * f = unsmob_moment (fact);
+  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)
     m->set_property ("duration", d->compressed (f->main_part_).smobbed_copy ());
   return SCM_UNSPECIFIED;
 }
 
-
-
 /*
   This is hairy, since the scale in a key-change event may contain
   octaveless notes.
 
 
-  TODO: this should use ly:pitch. 
- */
+  TODO: this should use ly:pitch.
+*/
 LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist",
-         2, 0, 0, (SCM l, SCM pit),
-         "Make a new key alist of @var{l} transposed by pitch @var{pit}")
+          2, 0, 0, (SCM l, SCM pit),
+          "Make a new key alist of @var{l} transposed by pitch @var{pit}")
 {
   SCM newlist = SCM_EOL;
   Pitch *p = unsmob_pitch (pit);
-  
+
   for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM key = scm_caar (s);
@@ -221,10 +215,10 @@ LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist",
          orig = orig.transposed (*p);
 
          SCM key = scm_cons (scm_int2num (orig.get_octave ()),
-                            scm_int2num (orig.get_notename ()));
+                             scm_int2num (orig.get_notename ()));
 
          newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
-                            newlist);
+                             newlist);
        }
       else if (scm_is_number (key))
        {
index 84a8c63a976830a935100266df8018064b719d91..555e2e3afb084df344f6e05e6d0985df6789b501 100644 (file)
@@ -1,8 +1,8 @@
-/*   
+/*
   music-sequence.cc -- implement Music_sequence
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 void
 transpose_music_list (SCM lst, Pitch rq)
 {
-  for (SCM s = lst; scm_is_pair (s);  s = scm_cdr (s))
-    unsmob_music (scm_car (s))->transpose (rq);    
+  for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s))
+    unsmob_music (scm_car (s))->transpose (rq);
 }
 
 Moment
-Music_sequence::cumulative_length (SCM l) 
+Music_sequence::cumulative_length (SCM l)
 {
   Moment cumulative;
-  Moment last_len; 
+  Moment last_len;
 
-  for (SCM s = l; scm_is_pair (s);  s = scm_cdr (s))
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
       Moment l = unsmob_music (scm_car (s))->get_length ();
       if (last_len.grace_part_ && l.main_part_)
@@ -39,16 +39,16 @@ Music_sequence::cumulative_length (SCM l)
   last_len.grace_part_ = Rational (0);
   cumulative += last_len;
 
-  return  cumulative;
+  return cumulative;
 }
 
 Moment
 Music_sequence::maximum_length (SCM l)
 {
   Moment dur = 0;
-  for (SCM s = l; scm_is_pair (s);  s = scm_cdr (s))
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
-      Music * m = unsmob_music (scm_car (s));
+      Music *m = unsmob_music (scm_car (s));
       Moment l = m->get_length ();
       dur = dur >? l;
     }
@@ -56,37 +56,36 @@ Music_sequence::maximum_length (SCM l)
   return dur;
 }
 
-MAKE_SCHEME_CALLBACK(Music_sequence, maximum_length_callback, 1);
+MAKE_SCHEME_CALLBACK (Music_sequence, maximum_length_callback, 1);
 SCM
 Music_sequence::maximum_length_callback (SCM m)
 {
-  Musicme = unsmob_music (m);
-  return maximum_length (me->get_property ("elements")).smobbed_copy();
+  Music *me = unsmob_music (m);
+  return maximum_length (me->get_property ("elements")).smobbed_copy ();
 }
 
-MAKE_SCHEME_CALLBACK(Music_sequence, cumulative_length_callback, 1);
+MAKE_SCHEME_CALLBACK (Music_sequence, cumulative_length_callback, 1);
 SCM
 Music_sequence::cumulative_length_callback (SCM m)
 {
-  Musicme = unsmob_music (m);
-  return cumulative_length (me->get_property ("elements")).smobbed_copy();
+  Music *me = unsmob_music (m);
+  return cumulative_length (me->get_property ("elements")).smobbed_copy ();
 }
 
-
-MAKE_SCHEME_CALLBACK(Music_sequence, minimum_start_callback, 1);
+MAKE_SCHEME_CALLBACK (Music_sequence, minimum_start_callback, 1);
 SCM
 Music_sequence::minimum_start_callback (SCM m)
 {
-  Musicme = unsmob_music (m);
-  return minimum_start (me->get_property ("elements")).smobbed_copy();
+  Music *me = unsmob_music (m);
+  return minimum_start (me->get_property ("elements")).smobbed_copy ();
 }
 
-MAKE_SCHEME_CALLBACK(Music_sequence, first_start_callback, 1);
+MAKE_SCHEME_CALLBACK (Music_sequence, first_start_callback, 1);
 SCM
 Music_sequence::first_start_callback (SCM m)
 {
-  Musicme = unsmob_music (m);
-  return first_start (me->get_property ("elements")).smobbed_copy();
+  Music *me = unsmob_music (m);
+  return first_start (me->get_property ("elements")).smobbed_copy ();
 }
 
 Pitch
@@ -96,12 +95,12 @@ music_list_to_relative (SCM l, Pitch p, bool ret_first)
   int count = 0;
 
   Pitch last = p;
-  for (SCM s = l; scm_is_pair (s);  s = scm_cdr (s))
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
       if (Music *m = unsmob_music (scm_car (s)))
        {
          last = m->to_relative_octave (last);
-         if (!count ++)
+         if (!count++)
            first = last;
        }
     }
@@ -109,11 +108,10 @@ music_list_to_relative (SCM l, Pitch p, bool ret_first)
   return (ret_first) ? first : last;
 }
 
-
 void
 compress_music_list (SCM l, Moment m)
 {
-  for (SCM s = l; scm_is_pair (s);  s = scm_cdr (s))
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     unsmob_music (scm_car (s))->compress (m);
 }
 
@@ -121,8 +119,8 @@ Moment
 Music_sequence::minimum_start (SCM l)
 {
   Moment m;
-  
-  for (SCM s = l; scm_is_pair (s);  s = scm_cdr (s))
+
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
       m = m <? unsmob_music (scm_car (s))->start_mom ();
     }
@@ -130,13 +128,13 @@ Music_sequence::minimum_start (SCM l)
 }
 
 Moment
-Music_sequence::first_start (SCM l) 
+Music_sequence::first_start (SCM l)
 {
   Moment m;
-  
-  for (SCM s = l; scm_is_pair (s);  s = scm_cdr (s))
+
+  for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
-      Music * mus = unsmob_music (scm_car (s));
+      Music *mus = unsmob_music (scm_car (s));
       Moment l = mus->get_length ();
       Moment s = mus->start_mom ();
       if (l.to_bool () || s.to_bool ())
@@ -145,7 +143,7 @@ Music_sequence::first_start (SCM l)
   return m;
 }
 
-MAKE_SCHEME_CALLBACK(Music_sequence, simultaneous_relative_callback, 2);
+MAKE_SCHEME_CALLBACK (Music_sequence, simultaneous_relative_callback, 2);
 SCM
 Music_sequence::simultaneous_relative_callback (SCM music, SCM pitch)
 {
@@ -158,10 +156,10 @@ Music_sequence::simultaneous_relative_callback (SCM music, SCM pitch)
     copied = ly_music_deep_copy (elts);
 
   Pitch retval = music_list_to_relative (elts, p, false);
-  
+
   if (lily_1_8_relative)
     {
-      
+
       Pitch retval_1_8 = music_list_to_relative (copied, p, true);
       if (retval_1_8 != retval)
        lily_1_8_compatibility_used = true;
@@ -172,8 +170,7 @@ Music_sequence::simultaneous_relative_callback (SCM music, SCM pitch)
   return retval.smobbed_copy ();
 }
 
-
-MAKE_SCHEME_CALLBACK(Music_sequence, event_chord_relative_callback, 2);
+MAKE_SCHEME_CALLBACK (Music_sequence, event_chord_relative_callback, 2);
 SCM
 Music_sequence::event_chord_relative_callback (SCM music, SCM pitch)
 {
@@ -182,4 +179,4 @@ Music_sequence::event_chord_relative_callback (SCM music, SCM pitch)
   return music_list_to_relative (me->get_property ("elements"),
                                 p, true).smobbed_copy ();
 }
-  
+
index 9af125955bff821062219c8039b195ed19ba1871..ed29db0fb03e0ebadf6819312280057cc8328e83 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-wrapper-iterator.cc -- implement Music_wrapper_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- */
 
+  (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "music-wrapper-iterator.hh"
 
@@ -30,7 +29,7 @@ Music_wrapper_iterator::derived_mark () const
 }
 
 void
-Music_wrapper_iterator::derived_substitute (Context *f, Context *t) 
+Music_wrapper_iterator::derived_substitute (Context *f, Context *t)
 {
   if (child_iter_)
     child_iter_->substitute_outlet (f, t);
@@ -39,7 +38,7 @@ Music_wrapper_iterator::derived_substitute (Context *f, Context *t)
 void
 Music_wrapper_iterator::construct_children ()
 {
-  Music * m =  dynamic_cast<Music_wrapper const*> (get_music ())-> element ();  
+  Music *m = dynamic_cast < Music_wrapper const *> (get_music ())-> element ();
   child_iter_ = unsmob_iterator (get_iterator (m));
 }
 
@@ -49,21 +48,19 @@ Music_wrapper_iterator::ok () const
   return child_iter_ && child_iter_->ok ();
 }
 
-
 void
 Music_wrapper_iterator::process (Moment m)
 {
   child_iter_->process (m);
 }
 
-
 Moment
 Music_wrapper_iterator::pending_moment () const
 {
   return child_iter_->pending_moment ();
 }
 
-Music_iterator*
+Music_iterator *
 Music_wrapper_iterator::try_music_in_children (Music *m) const
 {
   return child_iter_->try_music (m);
index 0779476b0e57fb8bb2609863534fc1b5a1544f3c..7106707d5a4abe8f2f6e23df8959cb801a664253 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   music-wrapper.cc -- implement Music_wrapper
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "music-wrapper.hh"
 
@@ -13,12 +12,12 @@ Music_wrapper::Music_wrapper (SCM x)
   : Music (x)
 {
   if (!ly_c_procedure_p (length_callback_))
-    length_callback_ = length_callback_proc; 
+    length_callback_ = length_callback_proc;
   if (!ly_c_procedure_p (start_callback_))
-    start_callback_ = length_callback_proc; 
+    start_callback_ = length_callback_proc;
 }
 
-MAKE_SCHEME_CALLBACK(Music_wrapper, start_callback, 1);
+MAKE_SCHEME_CALLBACK (Music_wrapper, start_callback, 1);
 SCM
 Music_wrapper::start_callback (SCM m)
 {
@@ -27,21 +26,20 @@ Music_wrapper::start_callback (SCM m)
   return elt->start_mom ().smobbed_copy ();
 }
 
-MAKE_SCHEME_CALLBACK(Music_wrapper, length_callback, 1);
+MAKE_SCHEME_CALLBACK (Music_wrapper, length_callback, 1);
 SCM
 Music_wrapper::length_callback (SCM m)
 {
-  Music * me = unsmob_music (m);
+  Music *me = unsmob_music (m);
   Music *elt = unsmob_music (me->get_property ("element"));
   return elt->get_length ().smobbed_copy ();
 }
 
-Music*
+Music *
 Music_wrapper::element () const
 {
   return unsmob_music (get_property ("element"));
 }
 
-
 ADD_MUSIC (Music_wrapper);
 
index d57a36bb1d679bc3edc7f6fa2d51bb2df4249503..3317ba3c764d24ddfdc91dc6875fc7ed9d55bdda 100644 (file)
@@ -19,9 +19,9 @@
 /*
   Music is anything that has duration and supports both time compression
   and transposition.
-  
+
   In Lily, everything that can be thought to have a length and a pitch
- (which has a duration which can be transposed) is considered "music",
 (which has a duration which can be transposed) is considered "music",
 */
 bool
 Music::internal_is_music_type (SCM k) const
@@ -87,7 +87,7 @@ Music::get_property_alist (bool m) const
 SCM
 Music::mark_smob (SCM m)
 {
-  Music *mus = (Music*) SCM_CELL_WORD_1 (m);
+  Music *mus = (Music *) SCM_CELL_WORD_1 (m);
   scm_gc_mark (mus->immutable_property_alist_);
   scm_gc_mark (mus->mutable_property_alist_);
   return SCM_EOL;
@@ -106,7 +106,7 @@ Music::get_length () const
       return *unsmob_moment (res);
     }
 
-  return Moment(0);
+  return Moment (0);
 }
 
 Moment
@@ -140,7 +140,7 @@ int
 Music::print_smob (SCM s, SCM p, scm_print_state*)
 {
   scm_puts ("#<Music ", p);
-  Musicm = unsmob_music (s);
+  Music *m = unsmob_music (s);
 
   SCM nm = m->get_property ("name");
   if (scm_is_symbol (nm) || scm_is_string (nm))
@@ -167,8 +167,8 @@ Music::generic_to_relative_octave (Pitch last)
       new_pit = new_pit.to_relative_octave (last);
 
       SCM check = get_property ("absolute-octave");
-      if (scm_is_number (check) &&
-         new_pit.get_octave () != scm_to_int (check))
+      if (scm_is_number (check)
+         && new_pit.get_octave () != scm_to_int (check))
        {
          Pitch expected_pit (scm_to_int (check),
                              new_pit.get_notename (),
@@ -178,9 +178,9 @@ Music::generic_to_relative_octave (Pitch last)
                                  new_pit.to_string ()));
          new_pit = expected_pit;
        }
-      
+
       set_property ("pitch", new_pit.smobbed_copy ());
-  
+
       last = new_pit;
     }
 
@@ -197,7 +197,7 @@ Music::to_relative_octave (Pitch last)
   SCM callback = get_property ("to-relative-callback");
   if (ly_c_procedure_p (callback))
     {
-      Pitch * p = unsmob_pitch (scm_call_2 (callback, self_scm(), last.smobbed_copy ()));
+      Pitch *p = unsmob_pitch (scm_call_2 (callback, self_scm (), last.smobbed_copy ()));
       return *p;
     }
 
@@ -213,7 +213,7 @@ Music::compress (Moment factor)
     m->compress (factor);
 
   compress_music_list (get_property ("elements"), factor);
-  Duration *d =  unsmob_duration (get_property ("duration"));
+  Duration *d = unsmob_duration (get_property ("duration"));
   if (d)
     set_property ("duration", d ->compressed (factor.main_part_).smobbed_copy ());
 }
@@ -222,16 +222,16 @@ void
 Music::transpose (Pitch delta)
 {
   if (to_boolean (get_property ("untransposable")))
-    return ;
-  
+    return;
+
   for (SCM s = this->get_property_alist (true); scm_is_pair (s); s = scm_cdr (s))
     {
       SCM entry = scm_car (s);
       SCM val = scm_cdr (entry);
 
-      if (Pitch * p = unsmob_pitch (val))
+      if (Pitch *p = unsmob_pitch (val))
        {
-         Pitch transposed =  p->transposed (delta);
+         Pitch transposed = p->transposed (delta);
          scm_set_cdr_x (entry, transposed.smobbed_copy ());
 
          if (abs (transposed.get_alteration ()) > DOUBLE_SHARP)
@@ -241,16 +241,16 @@ Music::transpose (Pitch delta)
            }
        }
     }
+
   SCM elt = get_property ("element");
 
-  if (Musicm = unsmob_music (elt))
+  if (Music *m = unsmob_music (elt))
     m->transpose (delta);
 
   transpose_music_list (get_property ("elements"), delta);
 
   /*
-    UGH - how do this more generically? 
+    UGH - how do this more generically?
   */
   SCM pa = get_property ("pitch-alist");
   if (scm_is_pair (pa))
@@ -291,7 +291,7 @@ Music::set_spot (Input ip)
   set_property ("origin", make_input (ip));
 }
 
-Input*
+Input *
 Music::origin () const
 {
   Input *ip = unsmob_input (get_property ("origin"));
@@ -306,7 +306,7 @@ Music::duration_log () const
   return 0;
 }
 
-Music*
+Music *
 make_music_by_name (SCM sym)
 {
   SCM make_music_proc = ly_lily_module_constant ("make-music");
index a0641750c7e0ca4cf7595c47c50e09fe8eb9cebb..f1b02a3509b2f68f7470548dc7c14c697ef9280a 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   fingering-engraver.cc -- implement New_fingering_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "warn.hh"
 #include "engraver.hh"
@@ -32,11 +31,11 @@ struct Finger_tuple
     note_event_ = finger_event_ = 0;
     follow_into_staff_ = false;
   }
-  static int compare (Finger_tuple const & c1, Finger_tuple const & c2)
+  static int compare (Finger_tuple const &c1, Finger_tuple const &c2)
   {
-    return c1.position_-  c2.position_;
+    return c1.position_- c2.position_;
   }
-              
+
 };
 
 class New_fingering_engraver : public Engraver
@@ -45,14 +44,14 @@ class New_fingering_engraver : public Engraver
   Array<Finger_tuple> articulations_;
   Link_array<Grob> heads_;
   Grob *stem_;
-  
+
 public:
   TRANSLATOR_DECLARATIONS (New_fingering_engraver);
 protected:
   virtual void stop_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
-  void add_fingering (Grob*, Music*, Music*);
-  void add_script  (Grob*, Music*, Music*);
+  void add_fingering (Grob *, Music *, Music *);
+  void add_script (Grob *, Music *, Music *);
   void position_scripts ();
 };
 
@@ -61,23 +60,22 @@ New_fingering_engraver::acknowledge_grob (Grob_info inf)
 {
   if (Rhythmic_head::has_interface (inf.grob_))
     {
-      Music * note_ev = inf.music_cause ();
+      Music *note_ev = inf.music_cause ();
       if (!note_ev)
        return;
-      
+
       SCM arts = note_ev->get_property ("articulations");
 
-      for (SCM s = arts; scm_is_pair (s); s = scm_cdr  (s))
+      for (SCM s = arts; scm_is_pair (s); s = scm_cdr (s))
        {
-         Music * m = unsmob_music (scm_car (s));
+         Music *m = unsmob_music (scm_car (s));
 
          if (!m)
            continue;
-         
 
          if (m->is_mus_type ("fingering-event"))
            {
-             add_fingering (inf.grob_ , m, note_ev);
+             add_fingering (inf.grob_, m, note_ev);
            }
          else if (m->is_mus_type ("text-script-event"))
            {
@@ -90,9 +88,9 @@ New_fingering_engraver::acknowledge_grob (Grob_info inf)
          else if (m->is_mus_type ("harmonic-event"))
            {
              inf.grob_->set_property ("style", ly_symbol2scm ("harmonic"));
-             Grob * d = unsmob_grob (inf.grob_->get_property ("dot"));
+             Grob *d = unsmob_grob (inf.grob_->get_property ("dot"));
              if (d)
-               d->suicide ();  
+               d->suicide ();
            }
        }
 
@@ -105,56 +103,55 @@ New_fingering_engraver::acknowledge_grob (Grob_info inf)
 }
 
 void
-New_fingering_engraver::add_script (Grob * head,
-                                   Music * event,
-                                   Music * )
+New_fingering_engraver::add_script (Grob *head,
+                                   Music *event,
+                                   Music *)
 {
-  Finger_tuple ft ;
+  Finger_tuple ft;
 
-  Grob * g =  make_item ("Script", event->self_scm () );
+  Grob *g = make_item ("Script", event->self_scm ());
   make_script_from_event (g, &ft.follow_into_staff_, context (),
                          event->get_property ("articulation-type"), 0);
   if (g)
     {
-      ft.script_ = g ;
-      
+      ft.script_ = g;
+
       articulations_.push (ft);
+
       ft.script_->set_parent (head, X_AXIS);
     }
-}                                  
-                                   
+}
 
 void
-New_fingering_engraver::add_fingering (Grob * head,
-                                      Music * event,
+New_fingering_engraver::add_fingering (Grob *head,
+                                      Music *event,
                                       Music *hevent)
 {
   Finger_tuple ft;
 
-  ft.script_ = make_item ("Fingering", event->self_scm () );
-  
+  ft.script_ = make_item ("Fingering", event->self_scm ());
+
   Side_position_interface::add_support (ft.script_, head);
 
   int d = scm_to_int (event->get_property ("digit"));
-  
+
   /*
     TODO:
-    
+
     Should add support for thumb.  It's a little involved, since
     the thumb lives in a different font. Maybe it should be moved?
-    
-   */
+
+  */
   if (d > 5)
     {
       /*
-       music for the softenon children? 
-       */
-      event->origin ()->warning (_("music for the martians."));
+       music for the softenon children?
+      */
+      event->origin ()->warning (_ ("music for the martians."));
     }
-  SCM sstr = scm_number_to_string (scm_int2num (d), scm_int2num (10)) ;
+  SCM sstr = scm_number_to_string (scm_int2num (d), scm_int2num (10));
   ft.script_->set_property ("text", sstr);
-       
+
   ft.finger_event_ = event;
   ft.note_event_ = hevent;
   ft.head_ = head;
@@ -176,25 +173,25 @@ New_fingering_engraver::position_scripts ()
     positioning the fingerings, setting both X and Y coordinates.
   */
   for (int i = 0; i < fingerings_.size (); i++)
-    {      
-      fingerings_[i].position_ = scm_to_int (fingerings_[i].head_ -> get_property ( "staff-position"));
+    {
+      fingerings_[i].position_ = scm_to_int (fingerings_[i].head_ -> get_property ("staff-position"));
     }
 
   for (int i = fingerings_.size (); i--;)
-    for (int j = heads_.size () ; j--;)
+    for (int j = heads_.size (); j--;)
       Side_position_interface::add_support (fingerings_[i].script_, heads_[j]);
-    
+
   Array<Finger_tuple> up, down, horiz;
   for (int i = fingerings_.size (); i--;)
     {
       SCM d = fingerings_[i].finger_event_->get_property ("direction");
       if (to_dir (d))
        {
-         ((to_dir (d) == UP) ? up : down ).push (fingerings_[i]);
+         ((to_dir (d) == UP) ? up : down).push (fingerings_[i]);
          fingerings_.del (i);
        }
     }
-  
+
   fingerings_.sort (&Finger_tuple::compare);
   SCM orientations = get_property ("fingeringOrientations");
 
@@ -234,11 +231,11 @@ New_fingering_engraver::position_scripts ()
       down.concat (fingerings_);
       fingerings_.clear ();
     }
-  
+
   for (int i = 0; i < horiz.size (); i++)
     {
       Finger_tuple ft = horiz[i];
-      Grobf = ft.script_;
+      Grob *f = ft.script_;
       f->set_parent (ft.head_, X_AXIS);
       f->set_parent (ft.head_, Y_AXIS);
       f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, Y_AXIS);
@@ -252,25 +249,25 @@ New_fingering_engraver::position_scripts ()
   for (int i = 0; i < up.size (); i++)
     {
       Finger_tuple ft = up[i];
-      Grobf = ft.script_;
+      Grob *f = ft.script_;
       f->set_parent (ft.head_, X_AXIS);
       f->set_property ("script-priority",
-                           scm_int2num (finger_prio + i));
+                      scm_int2num (finger_prio + i));
       f->add_offset_callback (Side_position_interface::aligned_side_proc, Y_AXIS);
       f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
       f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
-      
+
       f->set_property ("direction", scm_int2num (UP));
 
     }
-  
+
   for (int i = 0; i < down.size (); i++)
     {
       Finger_tuple ft = down[i];
-      Grobf = ft.script_;
+      Grob *f = ft.script_;
       f->set_parent (ft.head_, X_AXIS);
       f->set_property ("script-priority",
-                           scm_int2num (finger_prio + down.size () - i));
+                      scm_int2num (finger_prio + down.size () - i));
 
       f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
       f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
@@ -284,31 +281,30 @@ New_fingering_engraver::stop_translation_timestep ()
 {
   if (fingerings_.size ())
     {
-      for (int i = 0;  i < fingerings_.size(); i++)
+      for (int i = 0; i < fingerings_.size (); i++)
        if (stem_ && to_boolean (fingerings_[i].script_->get_property ("add-stem-support")))
          Side_position_interface::add_support (fingerings_[i].script_, stem_);
       position_scripts ();
       fingerings_.clear ();
     }
-  
-  for (int i =  articulations_.size (); i--;)
+
+  for (int i = articulations_.size (); i--;)
     {
       Grob *script = articulations_[i].script_;
-   
-      for (int j = heads_.size () ; j--;)
+
+      for (int j = heads_.size (); j--;)
        Side_position_interface::add_support (script, heads_[j]);
 
       if (stem_ && to_dir (script->get_property ("side-relative-direction")))
        script->set_property ("direction-source", stem_->self_scm ());
 
-
       if (stem_ && to_boolean (script->get_property ("add-stem-support")))
        Side_position_interface::add_support (script, stem_);
-      
+
       if (articulations_[i].follow_into_staff_)
        {
          script->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
-         script->set_property ("staff-padding" , SCM_EOL);
+         script->set_property ("staff-padding", SCM_EOL);
        }
     }
 
@@ -317,18 +313,17 @@ New_fingering_engraver::stop_translation_timestep ()
   articulations_.clear ();
 }
 
-
 New_fingering_engraver::New_fingering_engraver ()
 {
-  stem_ = 0;  
+  stem_ = 0;
 }
 
 ADD_TRANSLATOR (New_fingering_engraver,
-/* descr */       "Create fingering-scripts for notes in a new chord.  "
-                 "This engraver is ill-named, since it "
-                 "also takes care of articulations and harmonic note heads",
-/* creats*/       "Fingering",
-/* accepts */     "",
-/* acks  */       "rhythmic-head-interface stem-interface",
-/* reads */       "fingeringOrientations",
-/* write */       "");
+               /* descr */ "Create fingering-scripts for notes in a new chord.  "
+               "This engraver is ill-named, since it "
+               "also takes care of articulations and harmonic note heads",
+               /* creats*/ "Fingering",
+               /* accepts */ "",
+               /* acks  */ "rhythmic-head-interface stem-interface",
+               /* reads */ "fingeringOrientations",
+               /* write */ "");
index 105d78ef75e5ca69fbaaa83ec7444e89219afde1..0144e9e5e1ed7426cb9882fbda687d5465fb7700 100644 (file)
@@ -1,8 +1,8 @@
 /*
   new-lyric-combine-iterator.cc -- implement New_lyric_combine_music_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
@@ -15,12 +15,12 @@ class New_lyric_combine_music_iterator : public Music_iterator
 {
 public:
   New_lyric_combine_music_iterator ();
-  New_lyric_combine_music_iterator (New_lyric_combine_music_iterator const&src);
+  New_lyric_combine_music_iterator (New_lyric_combine_music_iterator const &src);
   DECLARE_SCHEME_CALLBACK (constructor, ());
 protected:
   virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit (); 
+  virtual void do_quit ();
   virtual void process (Moment);
   virtual Music_iterator *try_music_in_children (Music *) const;
   virtual bool run_always ()const;
@@ -28,7 +28,7 @@ protected:
   virtual void derived_mark () const;
   virtual void derived_substitute (Context *, Context *);
 private:
-  bool start_new_syllable () ;
+  bool start_new_syllable ();
   void find_voice ();
 
   bool music_found_;
@@ -36,13 +36,13 @@ private:
   Context *lyrics_context_;
   Context *music_context_;
   SCM lyricsto_voice_name_;
-  
-  Music_iterator * lyric_iter_;
+
+  Music_iterator *lyric_iter_;
 };
 
 /*
   Ugh, why static?
- */
+*/
 static Music *busy_ev;
 static Music *start_ev;
 static Music *melisma_playing_ev;
@@ -57,7 +57,7 @@ New_lyric_combine_music_iterator::New_lyric_combine_music_iterator ()
 
   /*
     Ugh. out of place here.
-   */
+  */
   if (!busy_ev)
     {
       busy_ev
@@ -73,20 +73,20 @@ bool
 New_lyric_combine_music_iterator::start_new_syllable ()
 {
   bool b = music_context_->try_music (busy_ev);
-  
+
   if (!b)
     return false;
 
   if (!lyrics_context_)
     return false;
-  
+
   if (!to_boolean (lyrics_context_->get_property ("ignoreMelismata")))
     {
       bool m = music_context_->try_music (melisma_playing_ev);
       if (m)
        return false;
     }
-  
+
   return true;
 }
 
@@ -96,7 +96,7 @@ New_lyric_combine_music_iterator::pending_moment () const
   Moment m;
 
   m.set_infinite (1);
-    
+
   return m;
 }
 
@@ -131,10 +131,9 @@ New_lyric_combine_music_iterator::derived_substitute (Context *f, Context *t)
   if (lyrics_context_ && lyrics_context_ == f)
     lyrics_context_ = t;
   if (music_context_ && music_context_ == f)
-    music_context_ = t; 
+    music_context_ = t;
 }
 
-
 void
 New_lyric_combine_music_iterator::construct_children ()
 {
@@ -143,9 +142,8 @@ New_lyric_combine_music_iterator::construct_children ()
 
   lyricsto_voice_name_ = get_music ()->get_property ("associated-context");
 
-  
   find_voice ();
-  
+
   if (lyric_iter_)
     lyrics_context_ = find_context_below (lyric_iter_->get_outlet (),
                                          ly_symbol2scm ("Lyrics"), "");
@@ -154,7 +152,7 @@ New_lyric_combine_music_iterator::construct_children ()
     We do not create a Lyrics context, because the user might
     create one with a different name, and then we will not find that
     one.
-   */
+  */
 }
 
 void
@@ -167,16 +165,16 @@ New_lyric_combine_music_iterator::find_voice ()
     voice_name = running;
 
   if (scm_is_string (voice_name)
-      && (!music_context_ || ly_scm2string (voice_name) != music_context_->id_string ()))    
+      && (!music_context_ || ly_scm2string (voice_name) != music_context_->id_string ()))
     {
       /*
        (spaghettini).
-       
+
        Need to set associatedVoiceContext again
-       */
+      */
       if (music_context_)
        made_association_ = false;
-      
+
       Context *t = get_outlet ();
       while (t && t->get_parent_context ())
        t = t->get_parent_context ();
@@ -184,7 +182,6 @@ New_lyric_combine_music_iterator::find_voice ()
       String name = ly_scm2string (voice_name);
       Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
 
-      
       if (voice)
        music_context_ = voice;
     }
@@ -193,7 +190,7 @@ New_lyric_combine_music_iterator::find_voice ()
     {
       if (!made_association_)
        {
-         made_association_ = true; 
+         made_association_ = true;
          lyrics_context_->set_property ("associatedVoiceContext",
                                         music_context_->self_scm ());
        }
@@ -201,31 +198,31 @@ New_lyric_combine_music_iterator::find_voice ()
 }
 
 void
-New_lyric_combine_music_iterator::process (Moment )
+New_lyric_combine_music_iterator::process (Moment)
 {
   find_voice ();
   if (!music_context_)
-    return ;
-  
+    return;
+
   if (!music_context_->get_parent_context ())
     {
       /*
        The melody has died.
        We die too.
-       */
+      */
       if (lyrics_context_)
        lyrics_context_->unset_property (ly_symbol2scm ("associatedVoiceContext"));
       lyric_iter_ = 0;
       music_context_ = 0;
     }
-  
+
   if (music_context_
       && start_new_syllable () && lyric_iter_->ok ())
     {
       Moment m = lyric_iter_->pending_moment ();
       lyric_iter_->process (m);
 
-      music_found_ = true; 
+      music_found_ = true;
     }
 }
 
@@ -248,13 +245,10 @@ New_lyric_combine_music_iterator::do_quit ()
     lyric_iter_->quit ();
 }
 
-
-
-Music_iterator*
+Music_iterator *
 New_lyric_combine_music_iterator::try_music_in_children (Music *m) const
 {
   return lyric_iter_->try_music (m);
 }
 
-
 IMPLEMENT_CTOR_CALLBACK (New_lyric_combine_music_iterator);
index 0354950a535f3856234e47a4e7904b2800cc9c09..0eece029aedb99559648632054ee3f4494d68711 100644 (file)
@@ -28,29 +28,28 @@ Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) scm_to_int (axis);
   assert (a == X_AXIS);
-  
-   me = me->get_parent (a);
 
-   if (! to_boolean (me->get_property ("positioning-done")))
+  me = me->get_parent (a);
+
+  if (! to_boolean (me->get_property ("positioning-done")))
     {
       me->set_property ("positioning-done", SCM_BOOL_T);
       do_shifts (me);
     }
-  
+
   return scm_make_real (0.0);
 }
 
-
 void
 check_meshing_chords (Grob *me,
-                     Drul_array< Array < Real > > *offsets,
-                     Drul_array< Array < Slice > > const &extents,
-                     Drul_array<Link_array<Grob> > const &clash_groups)
-       
+                     Drul_array< Array<Real> > *offsets,
+                     Drul_array< Array<Slice> > const &extents,
+                     Drul_array < Link_array<Grob> > const &clash_groups)
+
 {
   if (!extents[UP].size () || ! extents[DOWN].size ())
     return;
-  
+
   Grob *cu = clash_groups[UP][0];
   Grob *cd = clash_groups[DOWN][0];
 
@@ -66,21 +65,19 @@ check_meshing_chords (Grob *me,
 
   /* Too far apart to collide.  */
   if (ups[0] > dps.top () + 1)
-    return; 
+    return;
 
   // FIXME: what's this?
   bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
 
-
-
   /* Do not merge notes typeset in different style. */
-  if ( !ly_c_equal_p (nu->get_property ("style"),
-                    nd->get_property ("style") ) )
+  if (!ly_c_equal_p (nu->get_property ("style"),
+                    nd->get_property ("style")))
     merge_possible = false;
-  
+
   int upball_type = Note_head::get_balltype (nu);
   int dnball_type = Note_head::get_balltype (nd);
-  
+
   /* Do not merge whole notes (or longer, like breve, longa, maxima).  */
   if (merge_possible && (upball_type <= 0 || dnball_type <= 0))
     merge_possible = false;
@@ -103,80 +100,78 @@ check_meshing_chords (Grob *me,
       && ((Rhythmic_head::duration_log (nu) == 1
           && Rhythmic_head::duration_log (nd) == 2)
          || (Rhythmic_head::duration_log (nu) == 2
-            && Rhythmic_head::duration_log (nd) == 1)))
+             && Rhythmic_head::duration_log (nd) == 1)))
     merge_possible = false;
 
-
   /*
-    this case (distant half collide), 
-    
-        |
-      x |
-     | x
-     |
+    this case (distant half collide),
 
-   the noteheads may be closer than this case (close half collide)
+    |
+    x |
+    | x
+    |
+
+    the noteheads may be closer than this case (close half collide)
 
-       |
-       |
-      x 
-     x
     |
     |
-    
-   */
-  
+    x
+    x
+    |
+    |
+
+  */
+
   /* TODO: filter out the 'o's in this configuration, since they're no
-  part in the collision.
+     part in the collision.
 
      |
-    x|o
-    x|o
-    x
-    
-   */
-  
+     x|o
+     x|o
+     x
+
+  */
+
   bool close_half_collide = false;
-  bool distant_half_collide = false;  
-  bool full_collide = false;  
+  bool distant_half_collide = false;
+  bool full_collide = false;
 
   int i = 0, j = 0;
   while (i < ups.size () && j < dps.size ())
-  {
-    if (abs (ups[i] - dps[j]) == 1)
-      {
+    {
+      if (abs (ups[i] - dps[j]) == 1)
+       {
+         merge_possible = false;
+         if (ups[i] > dps[j])
+           close_half_collide = true;
+         else
+           distant_half_collide = true;
+       }
+      else if (ups[i]== dps[j])
+       full_collide = true;
+      else if (ups[i] >dps[0] && ups[i] < dps.top ())
+       merge_possible = false;
+      else if (dps[j] >ups[0] && dps[j] < ups.top ())
        merge_possible = false;
-       if (ups[i] > dps[j])
-         close_half_collide = true;
-       else
-         distant_half_collide = true;
-      }
-    else if (ups[i]== dps[j])
-      full_collide = true;
-    else if (ups[i] >dps[0] && ups[i] < dps.top ())
-      merge_possible = false;
-    else if (dps[j] >ups[0] && dps[j] < ups.top ())
-      merge_possible = false;
-    
-    if (ups[i] < dps[j])
-      i++;
-    else if (ups[i] > dps[j])
-      j++;
-    else
-      {
+
+      if (ups[i] < dps[j])
        i++;
+      else if (ups[i] > dps[j])
        j++;
-      }
-  }
+      else
+       {
+         i++;
+         j++;
+       }
+    }
 
   full_collide = full_collide || (close_half_collide
                                  && distant_half_collide);
-  
+
   Drul_array<Real> center_note_shifts;
   center_note_shifts[LEFT] = 0.0;
   center_note_shifts[RIGHT] = 0.0;
 
-  
   Real shift_amount = 1;
 
   bool touch = (ups[0] >= dps.top ());
@@ -191,18 +186,17 @@ check_meshing_chords (Grob *me,
       shift_amount = 1;
     else if (Rhythmic_head::dot_count (nu) < Rhythmic_head::dot_count (nd))
       stem_to_stem = true;
-  
+
   if (merge_possible)
     {
       shift_amount = 0;
 
-
       /* If possible, don't wipe any heads. Else, wipe shortest head,
         or head with smallest amount of dots.  Note: when merging
         different heads, dots on the smaller one disappear. */
       Grob *wipe_ball = 0;
       Grob *dot_wipe_head = nu;
-      
+
       if (upball_type == dnball_type)
        {
          if (Rhythmic_head::dot_count (nd) < Rhythmic_head::dot_count (nu))
@@ -236,7 +230,7 @@ check_meshing_chords (Grob *me,
          if (Grob *d = unsmob_grob (dot_wipe_head->get_property ("dot")))
            d->suicide ();
        }
-      
+
       if (wipe_ball && wipe_ball->is_live ())
        {
          wipe_ball->set_property ("transparent", SCM_BOOL_T);
@@ -246,14 +240,14 @@ check_meshing_chords (Grob *me,
   /* TODO: these numbers are magic; should devise a set of grob props
      to tune this behavior.  */
   else if (stem_to_stem)
-    shift_amount = -abs (shift_amount) * 0.65; 
+    shift_amount = -abs (shift_amount) * 0.65;
   else if (close_half_collide && !touch)
     shift_amount *= 0.52;
   else if (distant_half_collide && !touch)
     shift_amount *= 0.4;
   else if (distant_half_collide || close_half_collide || full_collide)
     shift_amount *= 0.5;
-  
+
   /* we're meshing.  */
   else if (Rhythmic_head::dot_count (nu) || Rhythmic_head::dot_count (nd))
     shift_amount *= 0.1;
@@ -269,15 +263,14 @@ check_meshing_chords (Grob *me,
       Grob *d = unsmob_grob (nd->get_property ("dot"));
       Grob *parent = d->get_parent (X_AXIS);
 
-
       /*
        FIXME:
-        
-              |
-        x . o
+
+       |
+       x . o
        |
 
-       
+
        the . is put right of o which is erroneous o force-shifted
        far to the right.
       */
@@ -295,45 +288,45 @@ check_meshing_chords (Grob *me,
 }
 
 void
-Note_collision_interface::do_shifts (Grobme)
+Note_collision_interface::do_shifts (Grob *me)
 {
-  Drul_array< Link_array <Grob>  > cg = get_clash_groups (me);
+  Drul_array< Link_array<Grob> > cg = get_clash_groups (me);
 
   SCM autos (automatic_shift (me, cg));
   SCM hand (forced_shift (me));
-  
+
   Direction d = UP;
   Real wid = 0.0;
   do
     {
       if (cg[d].size ())
        {
-         Grob  *h = cg[d][0];
-         wid = Note_column::first_head (h)->extent (h, X_AXIS).length () ;
+         Grob *h = cg[d][0];
+         wid = Note_column::first_head (h)->extent (h, X_AXIS).length ();
        }
     }
   while (flip (&d) != UP);
-  
+
   Link_array<Grob> done;
   Real left_most = 1e6;
-  
+
   Array<Real> amounts;
   for (; scm_is_pair (hand); hand = scm_cdr (hand))
     {
-      Grob * s = unsmob_grob (scm_caar (hand));
+      Grob *s = unsmob_grob (scm_caar (hand));
       Real amount = scm_to_double (scm_cdar (hand)) * wid;
 
       done.push (s);
       amounts.push (amount);
       if (amount < left_most)
        left_most = amount;
-      
+
     }
   for (; scm_is_pair (autos); autos = scm_cdr (autos))
     {
-      Grob * s = unsmob_grob (scm_caar (autos));
+      Grob *s = unsmob_grob (scm_caar (autos));
       Real amount = scm_to_double (scm_cdar (autos)) *wid;
-      
+
       if (!done.find (s))
        {
          done.push (s);
@@ -343,27 +336,27 @@ Note_collision_interface::do_shifts (Grob* me)
        }
     }
 
-  for (int i = 0; i < amounts.size(); i++)
+  for (int i = 0; i < amounts.size (); i++)
     {
       done[i]->translate_axis (amounts[i] - left_most, X_AXIS);
     }
 }
 
-Drul_array< Link_array <Grob>  >
-Note_collision_interface::get_clash_groups (Grob *me)
+Drul_array< Link_array<Grob>
+Note_collision_interface::get_clash_groups (Grob *me)
 {
-  Drul_array<Link_array<Grob> > clash_groups;
+  Drul_array < Link_array<Grob> > clash_groups;
+
   SCM s = me->get_property ("elements");
   for (; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM car = scm_car (s);
 
-      Grob * se = unsmob_grob (car);
+      Grob *se = unsmob_grob (car);
       if (Note_column::has_interface (se))
        clash_groups[Note_column::dir (se)].push (se);
     }
-  
+
   Direction d = UP;
   do
     {
@@ -376,19 +369,18 @@ Note_collision_interface::get_clash_groups (Grob *me)
 }
 
 /** This complicated routine moves note columns around horizontally to
-  ensure that notes don't clash.
+    ensure that notes don't clash.
 
-  This should be put into Scheme.  
-  */
+    This should be put into Scheme.
+*/
 SCM
 Note_collision_interface::automatic_shift (Grob *me,
-                           Drul_array< Link_array <Grob> > 
-                           clash_groups)
+                                          Drul_array< Link_array<Grob>
+                                          > clash_groups)
 {
-  Drul_array<Array<int> > shifts;
-  SCM  tups = SCM_EOL;
+  Drul_array < Array<int> > shifts;
+  SCM tups = SCM_EOL;
 
-  
   Direction d = UP;
   do
     {
@@ -405,10 +397,10 @@ Note_collision_interface::automatic_shift (Grob *me,
          else
            shift.push (0);
        }
-      
+
       for (int i =1; i < shift.size (); i++)
        {
-         if (shift[i-1] == shift[i])
+         if (shift[i - 1] == shift[i])
            {
              clashes[0]->warning (_ ("Too many clashing notecolumns.  Ignoring them."));
              return tups;
@@ -417,15 +409,15 @@ Note_collision_interface::automatic_shift (Grob *me,
     }
   while ((flip (&d))!= UP);
 
-  Drul_array< Array < Slice > > extents;
-  Drul_array< Array < Real > > offsets;
+  Drul_array< Array<Slice> > extents;
+  Drul_array< Array<Real> > offsets;
   d = UP;
   do
     {
       for (int i = 0; i < clash_groups[d].size (); i++)
        {
          Slice s (Note_column::head_positions_interval (clash_groups[d][i]));
-         s[LEFT] --;
+         s[LEFT]--;
          s[RIGHT]++;
          extents[d].push (s);
          offsets[d].push (d * 0.5 * i);
@@ -434,82 +426,77 @@ Note_collision_interface::automatic_shift (Grob *me,
   while ((flip (&d))!= UP);
 
   /*
-    do horizontal shifts of each direction 
-
-       | 
-      x||
-       x||
-        x|
-   */
-  
+    do horizontal shifts of each direction
+
+    |
+    x||
+    x||
+    x|
+  */
+
   do
     {
       for (int i =1; i < clash_groups[d].size (); i++)
        {
-         Slice prev = extents[d][i-1];
+         Slice prev = extents[d][i - 1];
          prev.intersect (extents[d][i]);
-         if (prev.length ()> 0 ||
- (extents[-d].size () && d * (extents[d][i][-d] - extents[-d][0][d]) < 0))
-           for (int j = i; j <  clash_groups[d].size (); j++)
+         if (prev.length ()> 0
            || (extents[-d].size () && d * (extents[d][i][-d] - extents[-d][0][d]) < 0))
+           for (int j = i; j < clash_groups[d].size (); j++)
              offsets[d][j] += d * 0.5;
        }
-    }  
+    }
   while ((flip (&d))!= UP);
 
-
   /*
     Check if chords are meshing
-   */
+  */
 
   check_meshing_chords (me, &offsets, extents, clash_groups);
-  
+
   do
     {
       for (int i = 0; i < clash_groups[d].size (); i++)
        tups = scm_cons (scm_cons (clash_groups[d][i]->self_scm (),
-                                scm_make_real (offsets[d][i])),
-                       tups);
+                                  scm_make_real (offsets[d][i])),
+                        tups);
     }
   while (flip (&d) != UP);
   return tups;
 }
 
-
 SCM
 Note_collision_interface::forced_shift (Grob *me)
 {
   SCM tups = SCM_EOL;
-  
+
   SCM s = me->get_property ("elements");
   for (; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * se = unsmob_grob (scm_car (s));
+      Grob *se = unsmob_grob (scm_car (s));
 
-      SCM force =  se->get_property ("force-hshift");
+      SCM force = se->get_property ("force-hshift");
       if (scm_is_number (force))
        {
          tups = scm_cons (scm_cons (se->self_scm (), force),
-                         tups);
+                          tups);
        }
     }
   return tups;
 }
 
 void
-Note_collision_interface::add_column (Grob*me, Grob* ncol)
+Note_collision_interface::add_column (Grob *me, Grob *ncol)
 {
   ncol->add_offset_callback (Note_collision_interface::force_shift_callback_proc, X_AXIS);
   Axis_group_interface::add_element (me, ncol);
   me->add_dependency (ncol);
 }
 
-
 ADD_INTERFACE (Note_collision_interface, "note-collision-interface",
-              "An object that handles collisions between notes with different stem " 
+              "An object that handles collisions between notes with different stem "
               "directions and horizontal shifts. Most of the interesting properties "
               "are to be set in @ref{note-column-interface}: these are "
-              "@code{force-hshift} and @code{horizontal-shift}."
+              "@code{force-hshift} and @code{horizontal-shift}.",
 
-              ,
-              
               "merge-differently-dotted merge-differently-headed positioning-done");
index 7e0b80d3f461d60b3d34852d3ae5122592a7bdcc..fa8e70768f553065a41de13ebb7d9f91ccc5d435 100644 (file)
 /*
   TODO: figure out if we can prune this class. This is just an
   annoying layer between (rest)collision & (note-head + stem)
- */
+*/
 
 bool
-Note_column::has_rests (Grob*me) 
+Note_column::has_rests (Grob *me)
 {
   return unsmob_grob (me->get_property ("rest"));
 }
 
 int
-Note_column::shift_compare (Grob *const &p1, Grob *const&p2)
+Note_column::shift_compare (Grob *const &p1, Grob *const &p2)
 {
   SCM s1 = p1->get_property ("horizontal-shift");
   SCM s2 = p2->get_property ("horizontal-shift");
 
-  int h1 = (scm_is_number (s1))?  scm_to_int (s1) :0;
+  int h1 = (scm_is_number (s1))? scm_to_int (s1) :0;
   int h2 = (scm_is_number (s2)) ? scm_to_int (s2):0;
   return h1 - h2;
 }
 
 Item *
-Note_column::get_stem (Grob*me) 
+Note_column::get_stem (Grob *me)
 {
   SCM s = me->get_property ("stem");
-  return  unsmob_item (s);
+  return unsmob_item (s);
 }
-  
+
 Slice
 Note_column::head_positions_interval (Grob *me)
 {
-  Slice  iv;
+  Slice iv;
 
   iv.set_empty ();
 
@@ -59,7 +59,7 @@ Note_column::head_positions_interval (Grob *me)
   for (; scm_is_pair (h); h = scm_cdr (h))
     {
       Grob *se = unsmob_grob (scm_car (h));
-      
+
       int j = Staff_symbol_referencer::get_rounded_position (se);
       iv.unite (Slice (j, j));
     }
@@ -67,7 +67,7 @@ Note_column::head_positions_interval (Grob *me)
 }
 
 Direction
-Note_column::dir (Grob*  me)
+Note_column::dir (Grob *me)
 {
   Grob *stem = unsmob_grob (me->get_property ("stem"));
   if (stem && Stem::has_interface (stem))
@@ -79,24 +79,22 @@ Note_column::dir (Grob*  me)
   return CENTER;
 }
 
-
 void
-Note_column::set_stem (Grob*me, Grob * stem)
+Note_column::set_stem (Grob *me, Grob *stem)
 {
   me->set_property ("stem", stem->self_scm ());
   me->add_dependency (stem);
   Axis_group_interface::add_element (me, stem);
 }
 
-
-Grob*
-Note_column::get_rest (Grob*me)
+Grob *
+Note_column::get_rest (Grob *me)
 {
   return unsmob_grob (me->get_property ("rest"));
 }
-  
+
 void
-Note_column::add_head (Grob*me, Grob *h)
+Note_column::add_head (Grob *me, Grob *h)
 {
   bool both = false;
   if (Rest::has_interface (h))
@@ -120,50 +118,46 @@ Note_column::add_head (Grob*me, Grob *h)
 }
 
 /**
-  translate the rest symbols vertically by amount DY, but only if
-  they have no staff-position set.
+   translate the rest symbols vertically by amount DY, but only if
+   they have no staff-position set.
 */
 void
-Note_column::translate_rests (Grob*me, int dy)
+Note_column::translate_rests (Grob *me, int dy)
 {
-  Grob * r = unsmob_grob (me->get_property ("rest"));
+  Grob *r = unsmob_grob (me->get_property ("rest"));
   if (r && !scm_is_number (r->get_property ("staff-position")))
     {
-      r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
+      r->translate_axis (dy * Staff_symbol_referencer::staff_space (r) / 2.0, Y_AXIS);
       Grob *p = r->get_parent (Y_AXIS);
       p->flush_extent_cache (Y_AXIS);
     }
 }
 
-
 void
-Note_column::set_dotcol (Grob*me, Grob *d)
+Note_column::set_dotcol (Grob *me, Grob *d)
 {
   Axis_group_interface::add_element (me, d);
 }
 
 
-
-
-Grob*
-Note_column::first_head (Grob*me) 
+Grob *
+Note_column::first_head (Grob *me)
 {
-  Grob * st = get_stem (me);
-  return st?  Stem::first_head (st): 0; 
+  Grob *st = get_stem (me);
+  return st? Stem::first_head (st): 0;
 }
 
-
 /*
-  Return the first Accidentals grob that we find in a note-head. 
- */
-Grob
+  Return the first Accidentals grob that we find in a note-head.
+*/
+Grob *
 Note_column::accidentals (Grob *me)
 {
   SCM heads = me->get_property ("note-heads");
-  Grob * acc = 0;
+  Grob *acc = 0;
   for (;scm_is_pair (heads); heads = scm_cdr (heads))
     {
-      Grob * h = unsmob_grob (scm_car (heads));
+      Grob *h = unsmob_grob (scm_car (heads));
       acc = h ? unsmob_grob (h->get_property ("accidental-grob")) : 0;
       if (acc)
        break;
@@ -171,17 +165,15 @@ Note_column::accidentals (Grob *me)
 
   if (!acc)
     return 0;
-  
+
   if (Accidental_placement::has_interface (acc->get_parent (X_AXIS)))
     return acc->get_parent (X_AXIS);
 
   /* compatibility. */
-  return  acc;
+  return acc;
 }
 
-
-
 ADD_INTERFACE (Note_column, "note-column-interface",
-  "Stem and noteheads combined",
-  "arpeggio note-heads rest-collision rest horizontal-shift stem accidentals force-hshift");
+              "Stem and noteheads combined",
+              "arpeggio note-heads rest-collision rest horizontal-shift stem accidentals force-hshift");
 
index 717c056ac9aa86a5629d0e9d8f2d2f7f060cccb6..cc9decc52a65e81436fd906474da1ef5765e895f 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   note-head-line-engraver.cc -- implement Note_head_line_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "engraver.hh"
 #include "group-interface.hh"
@@ -19,7 +19,6 @@
 
    TODO: have the line commit suicide if the notes are connected with
    either slur or beam.
-
 */
 class Note_head_line_engraver : public Engraver
 {
@@ -32,11 +31,11 @@ protected:
   virtual void stop_translation_timestep ();
 
 private:
-  Spanner* line_; 
-  Contextlast_staff_;
+  Spanner *line_;
+  Context *last_staff_;
   bool follow_;
-  Grobhead_;
-  Groblast_head_;
+  Grob *head_;
+  Grob *last_head_;
 };
 
 Note_head_line_engraver::Note_head_line_engraver ()
@@ -56,9 +55,9 @@ Note_head_line_engraver::acknowledge_grob (Grob_info info)
       head_ = info.grob_;
       if (to_boolean (get_property ("followVoice")))
        {
-         Context * tr = context ();
-         while (tr && !tr->is_alias (ly_symbol2scm ( "Staff")))
-           tr = tr->get_parent_context () ;
+         Context *tr = context ();
+         while (tr && !tr->is_alias (ly_symbol2scm ("Staff")))
+           tr = tr->get_parent_context ();
 
          if (tr
              && tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_)
@@ -71,7 +70,6 @@ Note_head_line_engraver::acknowledge_grob (Grob_info info)
     }
 }
 
-
 void
 Note_head_line_engraver::process_acknowledged_grobs ()
 {
@@ -79,15 +77,14 @@ Note_head_line_engraver::process_acknowledged_grobs ()
     {
       /* TODO: Don't follow if there's a beam.
 
-        We can't do beam-stuff here, since beam doesn't exist yet.
-        Should probably store follow_ in line_, and suicide at some
-        later point */
+      We can't do beam-stuff here, since beam doesn't exist yet.
+      Should probably store follow_ in line_, and suicide at some
+      later point */
       if (follow_)
        line_ = make_spanner ("VoiceFollower", head_->self_scm ());
-         
+
       line_->set_bound (LEFT, last_head_);
       line_->set_bound (RIGHT, head_);
-      
 
       follow_ = false;
     }
@@ -103,13 +100,11 @@ Note_head_line_engraver::stop_translation_timestep ()
 }
 
 
-
-
 ADD_TRANSLATOR (Note_head_line_engraver,
-/* descr */       "Engrave a line between two note heads, for example a glissando.  If "
-" followVoice is set, staff switches also generate a line.",
-/* creats*/       "Glissando VoiceFollower",
-/* accepts */     "glissando-event",
-/* acks  */       "rhythmic-head-interface",
-/* reads */       "followVoice",
-/* write */       "");
+               /* descr */ "Engrave a line between two note heads, for example a glissando.  If "
+               " followVoice is set, staff switches also generate a line.",
+               /* creats*/ "Glissando VoiceFollower",
+               /* accepts */ "glissando-event",
+               /* acks  */ "rhythmic-head-interface",
+               /* reads */ "followVoice",
+               /* write */ "");
index a2521a75ff6f6f7a42d187ee7f8544c62e487e07..ba5903c8ac241170568873f47c36dac145567e95 100644 (file)
@@ -27,9 +27,9 @@
   clean up the mess left by ledger line handling.
 */
 static Stencil
-internal_print (Grob *me, String * font_char)
+internal_print (Grob *me, String *font_char)
 {
-  SCM style  = me->get_property ("style");
+  SCM style = me->get_property ("style");
   if (!scm_is_symbol (style))
     {
       return Stencil ();
@@ -39,7 +39,7 @@ internal_print (Grob *me, String * font_char)
   SCM proc = me->get_property ("glyph-name-procedure");
   SCM scm_font_char = scm_call_2 (proc, log, style);
 
-  Font_metric * fm = Font_interface::get_default_font (me);
+  Font_metric *fm = Font_interface::get_default_font (me);
 
   Direction stem_dir = CENTER;
   if (Grob *stem = unsmob_grob (me->get_property ("stem")))
@@ -50,20 +50,20 @@ internal_print (Grob *me, String * font_char)
          programming_error ("Must have stem dir for note head");
        }
     }
-  
+
   Stencil out;
 
   String prefix = "noteheads.";
-  String idx =
-    prefix + ((stem_dir == UP) ? "u" : "d")  + ly_scm2string (scm_font_char);
+  String idx
+    = prefix + ((stem_dir == UP) ? "u" : "d") + ly_scm2string (scm_font_char);
   out = fm->find_by_name (idx);
   if (out.is_empty ())
     {
       idx = prefix + "s" + ly_scm2string (scm_font_char);
       out = fm->find_by_name (idx);
     }
-  
-  if (out.is_empty())
+
+  if (out.is_empty ())
     {
       me->warning (_f ("note head `%s' not found", idx.to_str0 ()));
     }
@@ -75,10 +75,9 @@ internal_print (Grob *me, String * font_char)
   return out;
 }
 
-
 MAKE_SCHEME_CALLBACK (Note_head, print, 1);
 SCM
-Note_head::print (SCM smob)  
+Note_head::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
@@ -86,7 +85,6 @@ Note_head::print (SCM smob)
   return internal_print (me, &idx).smobbed_copy ();
 }
 
-
 MAKE_SCHEME_CALLBACK (Note_head, brew_ez_stencil, 1);
 SCM
 Note_head::brew_ez_stencil (SCM smob)
@@ -98,14 +96,14 @@ Note_head::brew_ez_stencil (SCM smob)
 
   SCM cause = me->get_property ("cause");
   SCM spitch = unsmob_music (cause)->get_property ("pitch");
-  Pitch* pit =  unsmob_pitch (spitch);
+  Pitch *pit = unsmob_pitch (spitch);
 
   SCM idx = scm_int2num (pit->get_notename ());
   SCM names = me->get_property ("note-names");
   SCM charstr = SCM_EOL;
   if (scm_is_vector (names))
     charstr = scm_vector_ref (names, idx);
-  else 
+  else
     {
       char s[2] = "a";
       s[0] = (pit->get_notename () + 2)%7 + 'a';
@@ -116,7 +114,7 @@ Note_head::brew_ez_stencil (SCM smob)
   SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
                       charstr,
                       scm_int2num (b),
-                      scm_int2num (1-b),
+                      scm_int2num (1 - b),
                       SCM_UNDEFINED);
   Box bx (Interval (0, 1.0), Interval (-0.5, 0.5));
   Stencil m (bx, at);
@@ -124,19 +122,18 @@ Note_head::brew_ez_stencil (SCM smob)
   return m.smobbed_copy ();
 }
 
-
 Real
 Note_head::stem_attachment_coordinate (Grob *me, Axis a)
 {
   SCM brewer = me->get_property ("print-function");
-  Font_metric * fm  = Font_interface::get_default_font (me);
-  
+  Font_metric *fm = Font_interface::get_default_font (me);
+
   if (brewer == Note_head::print_proc)
     {
       String key;
       internal_print (me, &key);
 
-      int k = fm->name_to_index (key) ;
+      int k = fm->name_to_index (key);
       if (k >= 0)
        {
          Box b = fm->get_indexed_char (k);
@@ -146,31 +143,31 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
            return 2 * (wxwy[a] - v.center ()) / v.length ();
        }
     }
-  
+
   /*
     Fallback
-   */
+  */
   SCM v = me->get_property ("stem-attachment-function");
   if (!ly_c_procedure_p (v))
     return 0.0;
-  
+
   SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
   if (!scm_is_pair (result))
     return 0.0;
 
   result = (a == X_AXIS) ? scm_car (result) : scm_cdr (result);
-  
+
   return robust_scm2double (result, 0);
 }
 
 int
-Note_head::get_balltype (Grob*me) 
+Note_head::get_balltype (Grob *me)
 {
   SCM s = me->get_property ("duration-log");
   return scm_is_number (s) ? scm_to_int (s) <? 2 : 0;
 }
 
 ADD_INTERFACE (Note_head, "note-head-interface",
-  "Note head",
-  "note-names glyph-name-procedure accidental-grob style stem-attachment-function");
+              "Note head",
+              "note-names glyph-name-procedure accidental-grob style stem-attachment-function");
 
index c0b4d75ead629adac449410110ff4f1e5c74c815..4d4ddd8010b77fd316c00f5bdabf9af8c1668637 100644 (file)
@@ -25,7 +25,7 @@ public:
   TRANSLATOR_DECLARATIONS (Note_heads_engraver);
 
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
   virtual void process_music ();
 
   virtual void stop_translation_timestep ();
@@ -36,7 +36,7 @@ Note_heads_engraver::Note_heads_engraver ()
 }
 
 bool
-Note_heads_engraver::try_music (Music *m) 
+Note_heads_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
@@ -45,34 +45,33 @@ Note_heads_engraver::try_music (Music *m)
     }
   else if (m->is_mus_type ("busy-playing-event"))
     return note_evs_.size ();
-  
+
   return false;
 }
 
-
 void
 Note_heads_engraver::process_music ()
 {
   for (int i = 0; i < note_evs_.size (); i++)
     {
 
-      Music * ev = note_evs_[i];
+      Music *ev = note_evs_[i];
       Item *note = make_item ("NoteHead", ev->self_scm ());
-      
+
       Duration dur = *unsmob_duration (ev->get_property ("duration"));
 
       note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
       if (dur.dot_count ())
        {
-         Item * d = make_item ("Dots", note->self_scm ());
+         Item *d = make_item ("Dots", note->self_scm ());
          Rhythmic_head::set_dots (note, d);
-         
+
          if (dur.dot_count ()
              != robust_scm2int (d->get_property ("dot-count"), 0))
            d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
 
          d->set_parent (note, Y_AXIS);
-         
+
          dots_.push (d);
        }
 
@@ -83,21 +82,21 @@ Note_heads_engraver::process_music ()
       if (scm_is_number (c0))
        pos += scm_to_int (c0);
 
-      note->set_property ("staff-position",   scm_int2num (pos));
+      note->set_property ("staff-position", scm_int2num (pos));
 
       /*
        Shaped note heads change on step of the scale.
-       */
+      */
       SCM shape_vector = get_property ("shapeNoteStyles");
       if (scm_is_vector (shape_vector))
        {
          SCM scm_tonic = get_property ("tonic");
-         Pitch tonic (0, 0, 0); 
+         Pitch tonic (0, 0, 0);
          if (unsmob_pitch (scm_tonic))
            tonic = *unsmob_pitch (scm_tonic);
-      
-         unsigned int delta = (pit->get_notename() - tonic.get_notename() + 7) % 7;
-         
+
+         unsigned int delta = (pit->get_notename () - tonic.get_notename () + 7) % 7;
+
          SCM style = SCM_EOL;
          if (scm_c_vector_length (shape_vector) > delta
              && scm_is_symbol (scm_vector_ref (shape_vector, scm_from_int (delta))))
@@ -109,7 +108,7 @@ Note_heads_engraver::process_music ()
              note->set_property ("style", style);
            }
        }
-      
+
       notes_.push (note);
     }
 }
@@ -122,12 +121,10 @@ Note_heads_engraver::stop_translation_timestep ()
   note_evs_.clear ();
 }
 
-
-
 ADD_TRANSLATOR (Note_heads_engraver,
-/* descr */       "Generate noteheads.",
-/* creats*/       "NoteHead Dots",
-/* accepts */     "note-event busy-playing-event",
-/* acks  */      "",
-/* reads */       "middleCPosition",
-/* write */       "");
+               /* descr */ "Generate noteheads.",
+               /* creats*/ "NoteHead Dots",
+               /* accepts */ "note-event busy-playing-event",
+               /* acks  */ "",
+               /* reads */ "middleCPosition",
+               /* write */ "");
index 2c99cc724c1d0dbd40661883dec94429903ae6be..0a3814f477791903f22dcd93a1454f04e57a2b5a 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   note-name-engraver.cc -- implement Note_name_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "item.hh"
@@ -17,7 +16,7 @@ public:
 
   Link_array<Music> events_;
   Link_array<Item> texts_;
-  virtual bool  try_music (Music*m);
+  virtual bool try_music (Music *m);
   virtual void process_music ();
   virtual void stop_translation_timestep ();
 };
@@ -36,7 +35,7 @@ Note_name_engraver::try_music (Music *m)
 void
 Note_name_engraver::process_music ()
 {
-  String s ;
+  String s;
   for (int i = 0; i < events_.size (); i++)
     {
       if (i)
@@ -44,13 +43,13 @@ Note_name_engraver::process_music ()
       Pitch p = *unsmob_pitch (events_[i]->get_property ("pitch"));
 
       if (!to_boolean (get_property ("printOctaveNames")))
-         p = Pitch (-1, p.get_notename (), p.get_alteration ());
-         
+       p = Pitch (-1, p.get_notename (), p.get_alteration ());
+
       s += p.to_string ();
     }
   if (s.length ())
     {
-      Item * t = make_item ("NoteName", events_[0]->self_scm () );
+      Item *t = make_item ("NoteName", events_[0]->self_scm ());
       t->set_property ("text", scm_makfrom0str (s.to_str0 ()));
       texts_.push (t);
     }
@@ -59,19 +58,18 @@ Note_name_engraver::process_music ()
 void
 Note_name_engraver::stop_translation_timestep ()
 {
-  texts_.clear () ;
+  texts_.clear ();
   events_.clear ();
 }
 
-
 Note_name_engraver::Note_name_engraver ()
 {
 }
 
 ADD_TRANSLATOR (Note_name_engraver,
-/* descr */       "",
-/* creats*/       "NoteName",
-/* accepts */     "note-event",
-/* acks  */      "",
-/* reads */       "printOctaveNames",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "NoteName",
+               /* accepts */ "note-event",
+               /* acks  */ "",
+               /* reads */ "printOctaveNames",
+               /* write */ "");
index 531b4788d6fd801390a0cefe54d180054f3ae191..3bdbcb0df33d4396c6e86dc0c92ca4d672b8801a 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "performer.hh"
 #include "audio-item.hh"
 #include "warn.hh"
 
 /**
-Convert evs to audio notes.
+   Convert evs to audio notes.
 */
-class Note_performer : public Performer {
+class Note_performer : public Performer
+{
 public:
   TRANSLATOR_DECLARATIONS (Note_performer);
-  
+
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
 
   virtual void stop_translation_timestep ();
   virtual void create_audio_elements ();
+
 private:
   Link_array<Music> note_evs_;
   Link_array<Audio_note> notes_;
 };
 
-void 
+void
 Note_performer::create_audio_elements ()
 {
   if (note_evs_.size ())
@@ -38,17 +39,17 @@ Note_performer::create_audio_elements ()
       int transposing = 0;
 
       SCM prop = get_property ("instrumentTransposition");
-      if (unsmob_pitch (prop)) 
+      if (unsmob_pitch (prop))
        transposing = unsmob_pitch (prop)->semitone_pitch ();
 
       while (note_evs_.size ())
        {
-         Musicn = note_evs_.pop ();
-         SCM pit =  n->get_property ("pitch");
+         Music *n = note_evs_.pop ();
+         SCM pit = n->get_property ("pitch");
 
-         if (Pitch * pitp = unsmob_pitch (pit))
+         if (Pitch *pitp = unsmob_pitch (pit))
            {
-             Audio_note* p = new Audio_note (*pitp,  n->get_length (),  - transposing);
+             Audio_note *p = new Audio_note (*pitp, n->get_length (), - transposing);
              Audio_element_info info (p, n);
              announce_element (info);
              notes_.push (p);
@@ -58,7 +59,6 @@ Note_performer::create_audio_elements ()
     }
 }
 
-
 void
 Note_performer::stop_translation_timestep ()
 {
@@ -72,9 +72,9 @@ Note_performer::stop_translation_timestep ()
   notes_.clear ();
   note_evs_.clear ();
 }
+
 bool
-Note_performer::try_music (Musicev)
+Note_performer::try_music (Music *ev)
 {
   if (ev->is_mus_type ("note-event"))
     {
@@ -83,12 +83,12 @@ Note_performer::try_music (Music* ev)
     }
   else if (ev->is_mus_type ("busy-playing-event"))
     return note_evs_.size ();
-  
+
   return false;
 }
 
 ADD_TRANSLATOR (Note_performer, "", "",
-                 "note-event busy-playing-event", "", "", "");
+               "note-event busy-playing-event", "", "", "");
 
 Note_performer::Note_performer ()
 {
index f8924576e2699bed1a183bef8e55e1cd7eaeab9a..b4d85287d20dbd53b2c6e76cbb9ce40d5f919f5e 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   note-spacing.cc -- implement Note_spacing
 
   source file of the GNU LilyPond music typesetter
 #include "output-def.hh"
 
 /*
-
-TODO: detect hshifts due to collisions, and account for them in
-spacing?
-
-*/ 
+  TODO: detect hshifts due to collisions, and account for them in
+  spacing?
+*/
 
 void
-Note_spacing::get_spacing (Grob *me, Itemright_col,
+Note_spacing::get_spacing (Grob *me, Item *right_col,
                           Real base_space, Real increment, Real *space, Real *fixed)
 {
 
   Drul_array<SCM> props (me->get_property ("left-items"),
-                       me->get_property ("right-items"));
+                        me->get_property ("right-items"));
   Direction d = LEFT;
-  Direction col_dir =  right_col->break_status_dir ();
+  Direction col_dir = right_col->break_status_dir ();
   Drul_array<Interval> extents;
 
-  Interval left_head_wid; 
+  Interval left_head_wid;
   do
     {
-      for (SCM  s = props[d]; scm_is_pair (s); s = scm_cdr (s))
+      for (SCM s = props[d]; scm_is_pair (s); s = scm_cdr (s))
        {
-         Item * it = dynamic_cast<Item*> (unsmob_grob (scm_car (s)));
-         
+         Item *it = dynamic_cast<Item *> (unsmob_grob (scm_car (s)));
+
          if (d == RIGHT && it->break_status_dir () != col_dir)
            {
              it = it -> find_prebroken_piece (col_dir);
@@ -51,14 +49,14 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
          /*
            some kind of mismatch, eg. a note column, that is behind a
            linebreak.
-          */
+         */
          if (!it)
-           continue; 
+           continue;
 
          Item *it_col = it->get_column ();
          if (d == RIGHT && right_col != it_col)
            continue;
-         
+
          if (Separation_item::has_interface (it))
            {
              extents[d].unite (Separation_item::width (it));
@@ -68,30 +66,30 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
          if (d == LEFT)
            {
              SCM r = it->get_property ("rest");
-             Grob * g = unsmob_grob (r);
+             Grob *g = unsmob_grob (r);
              if (!g)
-               g =  Note_column::first_head (it);
+               g = Note_column::first_head (it);
 
              /*
                Ugh. If Stem is switched off, we don't know what the
                first note head will be.
-              */
+             */
              if (g)
                left_head_wid = g->extent (it_col, X_AXIS);
            }
-         
+
          extents[d].unite (it->extent (it_col, X_AXIS));
          if (d == RIGHT)
            {
-             Grob * accs = Note_column::accidentals (it);
+             Grob *accs = Note_column::accidentals (it);
              if (!accs)
                accs = Note_column::accidentals (it->get_parent (X_AXIS));
-             
+
              if (accs)
                {
-                 Interval v =
-                   Accidental_placement::get_relevant_accidental_extent (accs, it_col, me);
-                   
+                 Interval v
+                   Accidental_placement::get_relevant_accidental_extent (accs, it_col, me);
+
                  extents[d].unite (v);
                }
            }
@@ -102,7 +100,6 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
     }
   while (flip (&d) != LEFT);
 
-
   /*
     We look at the width of the note head, since smaller heads get less space
     eg. a quarter rest gets almost 0.5 ss less horizontal space than a note.
@@ -112,30 +109,30 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
 
     FIXED also includes the left part of the right object.
   */
-  *fixed =
-    (left_head_wid.is_empty () ? increment :
-     /*
-       Size of the head:
-      */
-     (left_head_wid[RIGHT]+
+  *fixed
+    (left_head_wid.is_empty () ? increment :
+       /*
+        Size of the head:
+       */
+       (left_head_wid[RIGHT]+
 
-      /*
-       What's sticking out of the head, eg. a flag: 
-      */
-      (extents[LEFT][RIGHT] - left_head_wid[RIGHT])/2))
+       /*
+         What's sticking out of the head, eg. a flag:
+       */
+       (extents[LEFT][RIGHT] - left_head_wid[RIGHT]) / 2))
 
     /*
       What is sticking out of the right note:
-     */
-    + (extents[RIGHT].is_empty () ?  0.0 : - extents[RIGHT][LEFT] / 2);
+    */
+    + (extents[RIGHT].is_empty () ? 0.0 : - extents[RIGHT][LEFT] / 2);
 
   /*
     We don't do complicated stuff: (base_space - increment) is the
     normal amount of white, which also determines the amount of
     stretch. Upon (extreme) stretching, notes with accidentals should
     stretch as much as notes without accidentals.
-   */
-  *space = (base_space - increment) + *fixed ;
+  */
+  *space = (base_space - increment) + *fixed;
 
   if (!extents[RIGHT].is_empty ()
       && (Item::is_breakable (right_col)
@@ -149,12 +146,12 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
        Since we only take half of the right-object space above, the
        barline will bump into the notes preceding it, if the right
        thing is big. We add the rest of the extents here:
-       */
-      
+      */
+
       *space += -extents[RIGHT][LEFT] / 2;
       *fixed += -extents[RIGHT][LEFT] / 2;
     }
-  
+
   stem_dir_correction (me, right_col, increment, space, fixed);
 }
 
@@ -163,33 +160,32 @@ Note_spacing::left_column (Grob *me)
 {
   if (!me->is_live ())
     return 0;
-  
-  return dynamic_cast<Item*> (me)->get_column ();
+
+  return dynamic_cast<Item *> (me)->get_column ();
 }
 
 /*
   Compute the column of the right-items.  This is a big function,
-since RIGHT-ITEMS may span more columns (eg. if a clef if inserted,
-this will add a new columns to RIGHT-ITEMS. Here we look at the
-columns, and return the left-most. If there are multiple columns, we
-prune RIGHT-ITEMS.
-   
- */
+  since RIGHT-ITEMS may span more columns (eg. if a clef if inserted,
+  this will add a new columns to RIGHT-ITEMS. Here we look at the
+  columns, and return the left-most. If there are multiple columns, we
+  prune RIGHT-ITEMS.
+*/
 Item *
-Note_spacing::right_column (Grob*me)
+Note_spacing::right_column (Grob *me)
 {
   if (!me->is_live ())
     return 0;
-  
+
   SCM right = me->get_property ("right-items");
   Item *mincol = 0;
   int min_rank = INT_MAX;
   bool prune = false;
-  for (SCM s = right ; scm_is_pair (s) ; s = scm_cdr (s))
+  for (SCM s = right; scm_is_pair (s); s = scm_cdr (s))
     {
-      Item * ri = unsmob_item (scm_car (s));
+      Item *ri = unsmob_item (scm_car (s));
 
-      Item * col = ri->get_column ();
+      Item *col = ri->get_column ();
       int rank = Paper_column::get_rank (col);
 
       if (rank < min_rank)
@@ -201,12 +197,12 @@ Note_spacing::right_column (Grob*me)
          mincol = col;
        }
     }
-  
+
   if (prune)
     {
       // I'm a lazy bum. We could do this in-place.
-      SCM newright  = SCM_EOL;
-      for (SCM s = right ; scm_is_pair (s) ; s = scm_cdr (s))
+      SCM newright = SCM_EOL;
+      for (SCM s = right; scm_is_pair (s); s = scm_cdr (s))
        {
          if (unsmob_item (scm_car (s))->get_column () == mincol)
            newright = scm_cons (scm_car (s), newright);
@@ -214,12 +210,12 @@ Note_spacing::right_column (Grob*me)
 
       me->set_property ("right-items", newright);
     }
-  
+
   if (!mincol)
     {
       /*
-      int r = Paper_column::get_rank (dynamic_cast<Item*>(me)->get_column ());
-      programming_error (_f ("Spacing wish column %d has no right item.", r));
+       int r = Paper_column::get_rank (dynamic_cast<Item*>(me)->get_column ());
+       programming_error (_f ("Spacing wish column %d has no right item.", r));
       */
 
       return 0;
@@ -234,40 +230,39 @@ Note_spacing::right_column (Grob*me)
    down-stem + up-stem less.
 
    TODO: have to check wether the stems are in the same staff.
-
 */
 void
-Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
+Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
                                   Real increment,
-                                  Real * space, Real *fixed)  
+                                  Real *space, Real *fixed)
 {
   Drul_array<Direction> stem_dirs (CENTER, CENTER);
   Drul_array<Interval> stem_posns;
-  Drul_array<Interval> head_posns;  
+  Drul_array<Interval> head_posns;
   Drul_array<SCM> props (me->get_property ("left-items"),
-                       me->get_property ("right-items"));
+                        me->get_property ("right-items"));
+
+  Drul_array<Spanner *> beams_drul (0, 0);
+  Drul_array<Grob *> stems_drul (0, 0);
 
-  Drul_array<Spanner*> beams_drul (0, 0);
-  Drul_array<Grob*> stems_drul (0, 0);
-  
   stem_dirs[LEFT] = stem_dirs[RIGHT] = CENTER;
   Interval intersect;
   Interval bar_xextent;
-  Interval bar_yextent;  
-  
+  Interval bar_yextent;
+
   bool correct_stem_dirs = true;
   Direction d = LEFT;
   bool acc_right = false;
-  
+
   do
     {
-      for (SCM  s = props[d]; scm_is_pair (s); s = scm_cdr (s))
+      for (SCM s = props[d]; scm_is_pair (s); s = scm_cdr (s))
        {
-         Item * it = dynamic_cast<Item*> (unsmob_grob (scm_car (s)));
+         Item *it = dynamic_cast<Item *> (unsmob_grob (scm_car (s)));
 
          if (d == RIGHT)
            acc_right = acc_right || Note_column::accidentals (it);
-         
+
          Grob *stem = Note_column::get_stem (it);
 
          if (!stem || !stem->is_live ())
@@ -278,7 +273,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
                    {
                      it = it->find_prebroken_piece (rcolumn->break_status_dir ());
                    }
-                 
+
                  Grob *last = Separation_item::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
 
                  if (last)
@@ -287,9 +282,9 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
                  break;
                }
 
-             return ;
+             return;
            }
-         
+
          if (Stem::is_invisible (stem))
            {
              correct_stem_dirs = false;
@@ -298,7 +293,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
 
          stems_drul[d] = stem;
          beams_drul[d] = Stem::get_beam (stem);
-         
+
          Direction sd = Stem::get_direction (stem);
          if (stem_dirs[d] && stem_dirs[d] != sd)
            {
@@ -310,52 +305,51 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
          /*
            Correction doesn't seem appropriate  when there is a large flag
            hanging from the note.
-          */
+         */
          if (d == LEFT
-             && Stem::duration_log (stem) > 2  && !Stem::get_beam (stem))
+             && Stem::duration_log (stem) > 2 && !Stem::get_beam (stem))
            {
              correct_stem_dirs = false;
            }
-         
-         Interval hp  = Stem::head_positions (stem);
-         if (!hp.is_empty())
+
+         Interval hp = Stem::head_positions (stem);
+         if (!hp.is_empty ())
            {
-             Real chord_start = hp[sd];          
+             Real chord_start = hp[sd];
              Real stem_end = Stem::stem_end_position (stem);
-         
+
              stem_posns[d] = Interval (chord_start <? stem_end, chord_start>? stem_end);
              head_posns[d].unite (hp);
            }
        }
     }
   while (flip (&d) != LEFT);
-  
 
   /*
     don't correct if accidentals are sticking out of the right side.
   */
   if (acc_right)
-    return ;
+    return;
 
   Real correction = 0.0;
 
   if (!bar_yextent.is_empty ())
     {
-      stem_dirs[RIGHT] = - stem_dirs[LEFT];
+      stem_dirs[RIGHT] = -stem_dirs[LEFT];
       stem_posns[RIGHT] = bar_yextent;
     }
-  
+
   if (correct_stem_dirs && stem_dirs[LEFT] *stem_dirs[RIGHT] == -1)
     {
       if (beams_drul[LEFT] && beams_drul[LEFT] == beams_drul[RIGHT])
        {
-         
+
          /*
            this is a knee: maximal correction.
          */
          Real note_head_width = increment;
-         Grob * st = stems_drul[RIGHT];
-         Grob * head = st ? Stem::support_head (st)  : 0;
+         Grob *st = stems_drul[RIGHT];
+         Grob *head = st ? Stem::support_head (st) : 0;
 
          Interval head_extent;
          if (head)
@@ -379,7 +373,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
        }
       else
        {
-         intersect = stem_posns[LEFT];  
+         intersect = stem_posns[LEFT];
          intersect.intersect (stem_posns[RIGHT]);
          correct_stem_dirs = correct_stem_dirs && !intersect.is_empty ();
 
@@ -387,16 +381,15 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
            {
              correction = abs (intersect.length ());
 
-      
              /*
                Ugh. 7 is hardcoded.
              */
-             correction = (correction/7) <? 1.0;
-             correction *= stem_dirs[LEFT] ;
-             correction *=
-               robust_scm2double (me->get_property ("stem-spacing-correction"), 0);
+             correction = (correction / 7) <? 1.0;
+             correction *= stem_dirs[LEFT];
+             correction
+               *= robust_scm2double (me->get_property ("stem-spacing-correction"), 0);
            }
-         
+
          if (!bar_yextent.is_empty ())
            {
              correction *= 0.5;
@@ -408,36 +401,35 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
       /*
        Correct for the following situation:
 
-        X      X
-       |      | 
+       X      X
+       |      |
        |      |
        |   X  |
        |  |   |
        ========
 
-           ^ move the center one to the left.
-       
+       ^ move the center one to the left.
+
 
        this effect seems to be much more subtle than the
        stem-direction stuff (why?), and also does not scale with the
        difference in stem length.
-       
-       */
 
-      
+      */
+
       Interval hp = head_posns[LEFT];
-      hp.intersect  (head_posns[RIGHT]);
+      hp.intersect (head_posns[RIGHT]);
       if (!hp.is_empty ())
-       return ;
+       return;
 
-      Direction lowest =
-       (head_posns[LEFT][DOWN] > head_posns[RIGHT][UP]) ? RIGHT : LEFT;
+      Direction lowest
+       (head_posns[LEFT][DOWN] > head_posns[RIGHT][UP]) ? RIGHT : LEFT;
 
-      Real delta = head_posns[-lowest][DOWN] - head_posns[lowest][UP] ;
+      Real delta = head_posns[-lowest][DOWN] - head_posns[lowest][UP];
       Real corr = robust_scm2double (me->get_property ("stem-spacing-correction"), 0);
-      corr =  (delta <= 1) ? 0.0 : 0.25;
-      
-      correction =  -lowest * corr ;
+      corr = (delta <= 1) ? 0.0 : 0.25;
+
+      correction = -lowest * corr;
     }
 
   *space += correction;
@@ -447,11 +439,9 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
   */
 
 }
-
 
 
 ADD_INTERFACE (Note_spacing, "note-spacing-interface",
-  "This object calculates spacing wishes for individual voices.",
-  "left-items right-items stem-spacing-correction knee-spacing-correction");
+              "This object calculates spacing wishes for individual voices.",
+              "left-items right-items stem-spacing-correction knee-spacing-correction");
 
index 6524285231677bc4e47c4500ad135e6baaf75e96..3a3d77575c04a1e3b0e2c24875da6d788f8e7e03 100644 (file)
@@ -4,45 +4,41 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "object-key-dumper.hh"
 
 #include "moment.hh"
 
-LY_DEFINE(ly_make_dumper, "ly:make-dumper",
-         0, 0, 0,
-         (),
-         "Create a key dumper. "
-         )
+LY_DEFINE (ly_make_dumper, "ly:make-dumper",
+          0, 0, 0,
+          (),
+          "Create a key dumper. ")
 {
   Object_key_dumper *u = new Object_key_dumper ();
-  SCM x = u->self_scm();
+  SCM x = u->self_scm ();
   scm_gc_unprotect_object (x);
   return x;
 }
 
-LY_DEFINE(ly_dumper_definitions, "ly:dumper-definitions",
-         1, 0, 0,
-         (SCM dumper),
-         "Return list of key definitions. "
-         )
+LY_DEFINE (ly_dumper_definitions, "ly:dumper-definitions",
+          1, 0, 0,
+          (SCM dumper),
+          "Return list of key definitions. ")
 {
   Object_key_dumper *u = unsmob_key_dumper (dumper);
-  SCM_ASSERT_TYPE(u, dumper, SCM_ARG1, __FUNCTION__, "dumper");
-  return u->get_file_contents();
+  SCM_ASSERT_TYPE (u, dumper, SCM_ARG1, __FUNCTION__, "dumper");
+  return u->get_file_contents ();
 }
 
-LY_DEFINE(ly_dumper_key_serial, "ly:dumper-key-serial",
-         2, 0, 0,
-         (SCM dumper, SCM key),
-         "Return the  key serial number @var{key}. "
-         )
+LY_DEFINE (ly_dumper_key_serial, "ly:dumper-key-serial",
+          2, 0, 0,
+          (SCM dumper, SCM key),
+          "Return the  key serial number @var{key}. ")
 {
-  Object_key_dumperu = unsmob_key_dumper (dumper);
+  Object_key_dumper *u = unsmob_key_dumper (dumper);
   Object_key *k = unsmob_key (key);
-  SCM_ASSERT_TYPE(u, dumper, SCM_ARG1, __FUNCTION__, "dumper");
-  SCM_ASSERT_TYPE(k, key, SCM_ARG2, __FUNCTION__, "key");
+  SCM_ASSERT_TYPE (u, dumper, SCM_ARG1, __FUNCTION__, "dumper");
+  SCM_ASSERT_TYPE (k, key, SCM_ARG2, __FUNCTION__, "key");
   return u->dump_key (k);
 }
index e3a1ef53224177c11ea75d21732b1965dc9f3a23..4a29c9c7aec8ccf3b72e387cb47a40295e13c449 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "object-key-dumper.hh"
 #include "ly-smobs.icc"
 
 SCM
-Object_key_dumper::mark_smob (SCM smob )
+Object_key_dumper::mark_smob (SCM smob)
 {
-  Object_key_dumper * dumper = (Object_key_dumper*) SCM_CELL_WORD_1 (smob);
-  
+  Object_key_dumper *dumper = (Object_key_dumper *) SCM_CELL_WORD_1 (smob);
+
   for (Key_to_key_map::const_iterator i (dumper->serialized_keys_.begin ());
-       i != dumper->serialized_keys_.end();
+       i != dumper->serialized_keys_.end ();
        i++)
     {
-      scm_gc_mark ((*i).first->self_scm());
+      scm_gc_mark ((*i).first->self_scm ());
     }
   return SCM_EOL;
 }
@@ -34,8 +33,8 @@ Object_key_dumper::print_smob (SCM, SCM port, scm_print_state*)
   return 1;
 }
 
-IMPLEMENT_DEFAULT_EQUAL_P(Object_key_dumper);
-IMPLEMENT_SMOBS(Object_key_dumper);
+IMPLEMENT_DEFAULT_EQUAL_P (Object_key_dumper);
+IMPLEMENT_SMOBS (Object_key_dumper);
 
 Object_key_dumper::Object_key_dumper ()
 {
@@ -54,10 +53,10 @@ Object_key_dumper::key_serial (int k)
 SCM
 Object_key_dumper::serialize_key (Object_key const *key)
 {
-  SCM skey = key->dump();
-  for (SCM s = skey ; scm_is_pair (s) ; s = scm_cdr (s))
+  SCM skey = key->dump ();
+  for (SCM s = skey; scm_is_pair (s); s = scm_cdr (s))
     {
-      if (Object_key const * sub_key = unsmob_key (scm_car (s)))
+      if (Object_key const *sub_key = unsmob_key (scm_car (s)))
        {
          scm_set_car_x (s, dump_key (sub_key));
        }
@@ -65,11 +64,11 @@ Object_key_dumper::serialize_key (Object_key const *key)
        {
          scm_set_car_x (s,
                         scm_list_2 (ly_symbol2scm ("unquote"),
-                                    mom->as_scheme()));
+                                    mom->as_scheme ()));
        }
     }
 
-  file_contents_ = scm_cons (scm_list_3 (ly_symbol2scm("define-key"),
+  file_contents_ = scm_cons (scm_list_3 (ly_symbol2scm ("define-key"),
                                         scm_from_int (next_available_),
                                         skey),
                             file_contents_);
@@ -77,7 +76,7 @@ Object_key_dumper::serialize_key (Object_key const *key)
   serialized_keys_[key] = key;
   key_serial_numbers_[key] = next_available_;
   SCM retval = key_serial (next_available_);
-  next_available_ ++;
+  next_available_++;
 
   return retval;
 }
@@ -93,7 +92,7 @@ Object_key_dumper::dump_key (Object_key const *key)
     {
       return key_serial (key_serial_numbers_[ serialized_keys_ [serialized] ]);
     }
-  
+
   return serialize_key (key);
 }
 
@@ -103,6 +102,6 @@ Object_key_dumper::get_file_contents () const
   return scm_reverse (file_contents_);
 }
 
-Object_key_dumper::~Object_key_dumper()
+Object_key_dumper::~Object_key_dumper ()
 {
 }
index 5a01f1d009902b996acec4b8acad6bb1d9a304ae..713659eea449418fbe2194acbda5f8978c6ed546 100644 (file)
@@ -4,49 +4,43 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "object-key-undumper.hh"
 
-LY_DEFINE(ly_undumper_read_keys, "ly:undumper-read-keys",
-         2, 0, 0,
-         (SCM undumper, SCM keys),
-         "Read serialized @var{keys} into @var{undumper}."
-         )
+LY_DEFINE (ly_undumper_read_keys, "ly:undumper-read-keys",
+          2, 0, 0,
+          (SCM undumper, SCM keys),
+          "Read serialized @var{keys} into @var{undumper}.")
 {
   Object_key_undumper *u = unsmob_key_undumper (undumper);
-  SCM_ASSERT_TYPE(u, undumper, SCM_ARG1, __FUNCTION__, "Undumper");
+  SCM_ASSERT_TYPE (u, undumper, SCM_ARG1, __FUNCTION__, "Undumper");
 
   u->parse_contents (keys);
   return SCM_UNSPECIFIED;
 }
 
-LY_DEFINE(ly_make_undumper, "ly:make-undumper",
-         0, 0, 0,
-         (),
-         "Create a key undumper. "
-         )
+LY_DEFINE (ly_make_undumper, "ly:make-undumper",
+          0, 0, 0,
+          (),
+          "Create a key undumper. ")
 {
   Object_key_undumper *u = new Object_key_undumper ();
-  SCM x = u->self_scm();
+  SCM x = u->self_scm ();
   scm_gc_unprotect_object (x);
   return x;
 }
 
+LY_DEFINE (ly_undumper_lookup, "ly:undumper-lookup",
+          2, 0, 0,
+          (SCM undumper, SCM serial),
+          "Return the object key for number @var{serial}. ")
 
-LY_DEFINE(ly_undumper_lookup, "ly:undumper-lookup",
-         2, 0, 0,
-         (SCM undumper, SCM serial),
-         "Return the object key for number @var{serial}. "
-         )
-  
 {
-  Object_key_undumperu = unsmob_key_undumper (undumper);
+  Object_key_undumper *u = unsmob_key_undumper (undumper);
 
-  SCM_ASSERT_TYPE(u, undumper, SCM_ARG1, __FUNCTION__, "undumper");
-  SCM_ASSERT_TYPE(scm_is_integer(serial), serial, SCM_ARG2, __FUNCTION__, "integer");
-  return u->get_key (scm_to_int (serial))->self_scm();
+  SCM_ASSERT_TYPE (u, undumper, SCM_ARG1, __FUNCTION__, "undumper");
+  SCM_ASSERT_TYPE (scm_is_integer (serial), serial, SCM_ARG2, __FUNCTION__, "integer");
+  return u->get_key (scm_to_int (serial))->self_scm ();
 }
 
-
index 52032e43cfa1ac63e2604dd6eb25d7039e21cad2..f904646b385916d34d3a0274561bcf7c6ede3115 100644 (file)
@@ -4,22 +4,21 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "object-key-undumper.hh"
 
 #include "ly-smobs.icc"
 
-IMPLEMENT_SMOBS(Object_key_undumper);
-IMPLEMENT_DEFAULT_EQUAL_P(Object_key_undumper);
+IMPLEMENT_SMOBS (Object_key_undumper);
+IMPLEMENT_DEFAULT_EQUAL_P (Object_key_undumper);
 
 SCM
 Object_key_undumper::mark_smob (SCM smob)
 {
-  Object_key_undumper * undumper = (Object_key_undumper*) SCM_CELL_WORD_1(smob);
-  for (Int_to_key_map::const_iterator i (undumper->keys_.begin());
-       i != undumper->keys_.end(); i++)
+  Object_key_undumper *undumper = (Object_key_undumper *) SCM_CELL_WORD_1 (smob);
+  for (Int_to_key_map::const_iterator i (undumper->keys_.begin ());
+       i != undumper->keys_.end (); i++)
     {
       scm_gc_mark ((*i).second->self_scm ());
     }
@@ -30,18 +29,16 @@ Object_key_undumper::mark_smob (SCM smob)
 int
 Object_key_undumper::print_smob (SCM s, SCM port, scm_print_state*)
 {
-  (void) s; 
+  (void) s;
   scm_puts ("#<Object_key_undumper>", port);
   return 1;
 }
 
-
 Object_key_undumper::Object_key_undumper ()
 {
-  smobify_self();
+  smobify_self ();
 }
 
-
 void
 Object_key_undumper::parse_contents (SCM contents)
 {
@@ -51,7 +48,6 @@ Object_key_undumper::parse_contents (SCM contents)
       if (scm_car (entry) != ly_symbol2scm ("define-key"))
        continue;
 
-      
       int number = scm_to_int (scm_cadr (entry));
       SCM skey = scm_caddr (entry);
 
@@ -65,31 +61,31 @@ Object_key_undumper::parse_contents (SCM contents)
            {
              int index = scm_to_int (scm_cadr (item));
              Object_key const *key = get_key (index);
-             *tail = scm_cons (key->self_scm(), SCM_EOL);
+             *tail = scm_cons (key->self_scm (), SCM_EOL);
            }
          else
            {
              *tail = scm_cons (item, SCM_EOL);
            }
-         tail = SCM_CDRLOC(*tail);
+         tail = SCM_CDRLOC (*tail);
        }
 
       Object_key *k = Object_key::undump (new_key);
       keys_[number] = k;
-      scm_gc_unprotect_object (k->self_scm());
+      scm_gc_unprotect_object (k->self_scm ());
     }
-  
+
 }
 
-Object_key const
+Object_key const *
 Object_key_undumper::get_key (int idx)
 {
   Int_to_key_map::const_iterator i (keys_.find (idx));
-  assert (i != keys_.end());
+  assert (i != keys_.end ());
 
   return (*i).second;
 }
 
-Object_key_undumper::~Object_key_undumper()
+Object_key_undumper::~Object_key_undumper ()
 {
 }
index d912b3d088a60a95963b1a4e0e244d6866d6cfb4..134ff7fb232a3b757e0bc34b3306574bcf59023d 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "lilypond-key.hh"
 SCM
 Object_key::mark_smob (SCM key)
 {
-  Object_key* k = (Object_key*) SCM_CELL_WORD_1 (key);
-  k->derived_mark();
+  Object_key *k = (Object_key *) SCM_CELL_WORD_1 (key);
+  k->derived_mark ();
   return SCM_EOL;
 }
 
 void
 Object_key::derived_mark () const
 {
-  
+
 }
 
-Object_key::~Object_key()
+Object_key::~Object_key ()
 {
 }
 
@@ -37,9 +36,9 @@ Object_key::get_type () const
 int
 Object_key::print_smob (SCM smob, SCM port, scm_print_state*)
 {
-  Object_key* k = (Object_key*) SCM_CELL_WORD_1 (smob);
+  Object_key *k = (Object_key *) SCM_CELL_WORD_1 (smob);
   scm_puts ("#<Object_key ", port);
-  scm_display (scm_from_int (k->get_type()), port);
+  scm_display (scm_from_int (k->get_type ()), port);
   scm_puts (">", port);
   return 1;
 }
@@ -54,8 +53,8 @@ Object_key::compare (Object_key const *other) const
 {
   if (this == other)
     return 0;
-  
-  int c = sign (get_type () -  other->get_type());
+
+  int c = sign (get_type () - other->get_type ());
   if (c)
     return c;
   else
@@ -65,11 +64,11 @@ Object_key::compare (Object_key const *other) const
 IMPLEMENT_SMOBS (Object_key);
 
 SCM
-Object_key::equal_p (SCM a , SCM b) 
+Object_key::equal_p (SCM a, SCM b)
 {
   Object_key *ka = unsmob_key (a);
   Object_key *kb = unsmob_key (b);
-  
+
   return (ka->compare (kb)) ? SCM_BOOL_F : SCM_BOOL_T;
 }
 
@@ -79,34 +78,33 @@ Object_key::do_compare (Object_key const *) const
   return 0;
 }
 
-
 SCM
 Object_key::dump () const
 {
-  return scm_cons (scm_from_int (get_type()),
-                  as_scheme());
+  return scm_cons (scm_from_int (get_type ()),
+                  as_scheme ());
 }
 
-
-
 SCM
 Object_key::as_scheme () const
 {
-  return SCM_EOL;  
+  return SCM_EOL;
 }
 
-Object_key*
+Object_key *
 Object_key::from_scheme (SCM)
 {
-  return new Object_key();
+  return new Object_key ();
 }
 
-struct Object_dumper_table_entry {
+struct Object_dumper_table_entry
+{
   Object_key_type type_;
-  Object_key* (*ctor_)(SCM);
+  Object_key *(*ctor_) (SCM);
 };
 
-static Object_dumper_table_entry undumpers[] = {
+static Object_dumper_table_entry undumpers[]
+= {
   {BASE_KEY, Object_key::from_scheme},
   {COPIED_KEY, Copied_key::from_scheme},
   {GENERAL_KEY, Lilypond_general_key::from_scheme},
@@ -120,12 +118,12 @@ Object_key::undump (SCM scm_key)
 {
   int t = scm_to_int (scm_car (scm_key));
   assert (t == undumpers[t].type_);
-  return (undumpers[t].ctor_)(scm_cdr (scm_key)); 
+  return (undumpers[t].ctor_) (scm_cdr (scm_key));
 }
 
 /****************************************************************/
 
-Copied_key::Copied_key (Object_key constkey, int count)
+Copied_key::Copied_key (Object_key const *key, int count)
 {
   copy_count_ = count;
   original_ = key;
@@ -140,8 +138,8 @@ Copied_key::get_type () const
 int
 Copied_key::do_compare (Object_key const *key) const
 {
-  Copied_key const *other = dynamic_cast<Copied_key const*> (key);
-  
+  Copied_key const *other = dynamic_cast < Copied_key const *> (key);
+
   int c = original_->compare (other->original_);
   if (c)
     return c;
@@ -158,13 +156,12 @@ Copied_key::derived_mark () const
 SCM
 Copied_key::as_scheme () const
 {
-  return scm_list_2 (original_ ? original_->self_scm() : SCM_BOOL_F, scm_from_int (copy_count_));
+  return scm_list_2 (original_ ? original_->self_scm () : SCM_BOOL_F, scm_from_int (copy_count_));
 }
 
-
 Object_key *
-Copied_key::from_scheme (SCM a) 
+Copied_key::from_scheme (SCM a)
 {
   return new Copied_key (unsmob_key (scm_car (a)),
-                        scm_to_int  (scm_list_ref (a, scm_from_int (1))));
+                        scm_to_int (scm_list_ref (a, scm_from_int (1))));
 }
index 241ffac057191c613ec5785bad72c277dee4d1b1..4430d144382f7620cbcccaf8239a849b07a43b92 100644 (file)
@@ -10,7 +10,7 @@
 #include "open-type-font.hh"
 
 LY_DEFINE (ly_font_sub_fonts, "ly:font-sub-fonts", 1, 0, 0,
-         (SCM font),
+          (SCM font),
           "Given the font metric @var{font} of an OpenType font, return the "
           "names of the subfonts within @var{font}.")
 {
@@ -20,13 +20,13 @@ LY_DEFINE (ly_font_sub_fonts, "ly:font-sub-fonts", 1, 0, 0,
 }
 
 LY_DEFINE (ly_otf_font_glyph_info, "ly:otf-font-glyph-info", 2, 0, 0,
-         (SCM font, SCM glyph),
+          (SCM font, SCM glyph),
           "Given the font metric @var{font} of an OpenType font, return the "
           "information about named glyph @var{glyph} (a string)")
 {
-  Modified_font_metric * fm
-    = dynamic_cast<Modified_font_metric*> (unsmob_metrics (font));
-  Open_type_font * otf = dynamic_cast<Open_type_font*> (fm->original_font ());
+  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");
index b47a53612e0fcab853a223cc2e86a676c444fb9b..386a618a9c5a1728f71d028676d253ef7b3a7a28 100644 (file)
@@ -24,11 +24,11 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length)
   int error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
   if (!error_code)
     {
-      FT_Byte *buffer = (FT_Byte*) malloc (*length);
+      FT_Byte *buffer = (FT_Byte *) malloc (*length);
       if (buffer == NULL)
        error (_f ("Cannot allocate %d bytes", *length));
 
-      error_code = FT_Load_Sfnt_Table (face, tag, 0, buffer, length );
+      error_code = FT_Load_Sfnt_Table (face, tag, 0, buffer, length);
       if (error_code)
        error (_f ("Could not load %s font table", tag_str));
 
@@ -47,8 +47,8 @@ load_scheme_table (char const *tag_str, FT_Face face)
   SCM tab = SCM_EOL;
   if (buffer)
     {
-      String contents ((Byte const*)buffer, length);
-      contents = "(quote (" +  contents + "))";
+      String contents ((Byte const *)buffer, length);
+      contents = "(quote (" + contents + "))";
 
       tab = scm_c_eval_string (contents.to_str0 ());
       free (buffer);
@@ -56,7 +56,7 @@ load_scheme_table (char const *tag_str, FT_Face face)
   return tab;
 }
 
-Index_to_charcode_map 
+Index_to_charcode_map
 make_index_to_charcode_map (FT_Face face)
 {
   Index_to_charcode_map m;
@@ -69,7 +69,7 @@ make_index_to_charcode_map (FT_Face face)
   return m;
 }
 
-Open_type_font::~Open_type_font()
+Open_type_font::~Open_type_font ()
 {
   FT_Done_Face (face_);
 }
@@ -78,7 +78,7 @@ SCM
 Open_type_font::make_otf (String str)
 {
   FT_Face face;
-  int error_code = FT_New_Face(freetype2_library, str.to_str0 (), 0, &face);
+  int error_code = FT_New_Face (freetype2_library, str.to_str0 (), 0, &face);
 
   if (error_code == FT_Err_Unknown_File_Format)
     {
@@ -101,7 +101,7 @@ Open_type_font::Open_type_font (FT_Face face)
   lily_character_table_ = SCM_EOL;
   lily_global_table_ = SCM_EOL;
   lily_subfonts_ = SCM_EOL;
-  
+
   lily_character_table_ = alist_to_hashq (load_scheme_table ("LILC", face_));
   lily_global_table_ = alist_to_hashq (load_scheme_table ("LILY", face_));
   lily_subfonts_ = load_scheme_table ("LILF", face_);
@@ -128,7 +128,7 @@ Open_type_font::attachment_point (String glyph_name) const
 
   SCM char_alist = entry;
   SCM att_scm = scm_cdr (scm_assq (ly_symbol2scm ("attachment"), char_alist));
-  
+
   return point_constant * ly_scm2offset (att_scm);
 }
 
@@ -142,14 +142,14 @@ Open_type_font::get_indexed_char (int signed_idx) const
       int code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
       if (code)
        warning (_f ("FT_Get_Glyph_Name() returned error: %d", code));
-       
+
       SCM sym = ly_symbol2scm (name);
       SCM alist = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F);
-      
+
       if (alist != SCM_BOOL_F)
        {
          SCM bbox = scm_cdr (scm_assq (ly_symbol2scm ("bbox"), alist));
-      
+
          Box b;
          b[X_AXIS][LEFT] = scm_to_double (scm_car (bbox));
          bbox = scm_cdr (bbox);
@@ -164,7 +164,7 @@ Open_type_font::get_indexed_char (int signed_idx) const
          return b;
        }
     }
-  
+
   FT_UInt idx = signed_idx;
   FT_Load_Glyph (face_,
                 idx,
@@ -176,14 +176,14 @@ Open_type_font::get_indexed_char (int signed_idx) const
   Box b (Interval (-hb, m.width - hb),
         Interval (-vb, m.height - vb));
 
-  b.scale (design_size ()  / Real (face_->units_per_EM));
+  b.scale (design_size () / Real (face_->units_per_EM));
   return b;
 }
 
 int
 Open_type_font::name_to_index (String nm) const
 {
-  char *nm_str = (char*) nm.to_str0 ();
+  char *nm_str = (char *) nm.to_str0 ();
   if (int idx = FT_Get_Name_Index (face_, nm_str))
     return idx;
   return -1;
@@ -192,13 +192,13 @@ Open_type_font::name_to_index (String nm) const
 unsigned
 Open_type_font::index_to_charcode (int i) const
 {
-  return ((Open_type_font*) this)->index_to_charcode_map_[i];
+  return ((Open_type_font *) this)->index_to_charcode_map_[i];
 }
 
 int
 Open_type_font::count () const
 {
-  return ((Open_type_font*) this)->index_to_charcode_map_.size ();
+  return ((Open_type_font *) this)->index_to_charcode_map_.size ();
 }
 
 Real
@@ -212,12 +212,11 @@ Open_type_font::design_size () const
                               non-design-size fonts. I vote for 1 -
                               which will trip errors more
                               quickly. --hwn.
-                             */
+                            */
                             scm_from_int (1));
   return scm_to_double (entry) * Real (point_constant);
 }
 
-
 SCM
 Open_type_font::sub_fonts () const
 {
index ff4fb00b795666d343e4d8d1ea62f9bb6679801b..9a02f4b63746ca1da674123015ac62647110aeea 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   ottava-bracket.cc -- implement Ottava_bracket
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+*/
 
 #include "text-item.hh"
 #include "line-spanner.hh"
 struct Ottava_bracket
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
-
 /*
   TODO: the string for ottava shoudl depend on the available space, ie.
-  
-  Long: 15ma        Short: 15ma    Empty: 15
-         8va                8va            8
-         8va bassa          8ba            8
 
+  Long: 15ma        Short: 15ma    Empty: 15
+  8va                8va            8
+  8va bassa          8ba            8
 */
 MAKE_SCHEME_CALLBACK (Ottava_bracket, print, 1);
 SCM
 Ottava_bracket::print (SCM smob)
 {
-  Spanner*me  = dynamic_cast<Spanner*> (unsmob_grob (smob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
   Interval span_points;
-  
+
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
-  Output_def * layout = me->get_layout ();
-  
+  Output_def *layout = me->get_layout ();
+
   Drul_array<bool> broken;
   Direction d = LEFT;
   do
@@ -59,8 +56,8 @@ Ottava_bracket::print (SCM smob)
          common = common_refpoint_of_list (heads, common, X_AXIS);
          for (SCM s = heads; scm_is_pair (s); s = scm_cdr (s))
            {
-             Grob * h = unsmob_grob (scm_car (s));
-             Grob * dots = Rhythmic_head::get_dots (h);
+             Grob *h = unsmob_grob (scm_car (s));
+             Grob *dots = Rhythmic_head::get_dots (h);
              if (dots)
                common = dots->common_refpoint (common, X_AXIS);
            }
@@ -71,18 +68,16 @@ Ottava_bracket::print (SCM smob)
   SCM properties = Font_interface::text_font_alist_chain (me);
   SCM markup = me->get_property ("text");
   Stencil text;
-  if (Text_interface::markup_p (markup)) 
+  if (Text_interface::markup_p (markup))
     text = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), properties, markup));
 
-
   Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
                                                  Interval (0, 0));
 
-
   /*
     TODO: we should check if there are ledgers, and modify length of
     the spanner to that.
-   */
+  */
   do
     {
       Item *b = me->get_bound (d);
@@ -92,17 +87,17 @@ Ottava_bracket::print (SCM smob)
        {
          for (SCM s = b->get_property ("note-heads"); scm_is_pair (s); s = scm_cdr (s))
            {
-             Grob * h = unsmob_grob (scm_car (s));
+             Grob *h = unsmob_grob (scm_car (s));
              ext.unite (h->extent (common, X_AXIS));
-             Grob * dots = Rhythmic_head::get_dots (h);
+             Grob *dots = Rhythmic_head::get_dots (h);
 
              if (dots && d == RIGHT)
                {
-                 ext.unite (dots->extent (common, X_AXIS));  
+                 ext.unite (dots->extent (common, X_AXIS));
                }
            }
        }
-      
+
       if (ext.is_empty ())
        {
          ext = robust_relative_extent (b, common, X_AXIS);
@@ -113,46 +108,42 @@ Ottava_bracket::print (SCM smob)
          span_points[d] = b->extent (common, X_AXIS)[RIGHT];
          shorten[d] = 0.;
        }
-           
+
       else
        span_points[d] = ext[d];
     }
   while (flip (&d) != LEFT);
 
-
   /*
-    0.3 is ~ italic correction. 
-   */
-  Real text_size =  text.extent (X_AXIS).is_empty ()
-    ? 0.0 : text.extent (X_AXIS)[RIGHT] +  0.3;
-  
+    0.3 is ~ italic correction.
+  */
+  Real text_size = text.extent (X_AXIS).is_empty ()
+    ? 0.0 : text.extent (X_AXIS)[RIGHT] + 0.3;
+
   span_points[LEFT] = span_points[LEFT]
     <? (span_points[RIGHT] - text_size
-       - robust_scm2double (me->get_property ("minimum-length"), -1.0)); 
-  
+       - robust_scm2double (me->get_property ("minimum-length"), -1.0));
+
   Interval bracket_span_points = span_points;
   bracket_span_points[LEFT] += text_size;
-  
+
   Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
                                                      Interval (1.0, 1.0));
 
-  
   Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare"),
                                                Interval (0, 0));
 
-
-
   edge_height[LEFT] = 0.0;
-  edge_height[RIGHT] *=  - get_grob_direction (me);
+  edge_height[RIGHT] *= -get_grob_direction (me);
   if (broken[RIGHT])
     edge_height[RIGHT] = 0.0;
-  
+
   Stencil b;
   Interval empty;
   if (!bracket_span_points.is_empty () && bracket_span_points.length () > 0.001)
     b = Tuplet_bracket::make_bracket (me,
                                      Y_AXIS, Offset (bracket_span_points.length (), 0),
-                                      edge_height,
+                                     edge_height,
                                      empty,
                                      flare, shorten);
 
@@ -160,31 +151,30 @@ Ottava_bracket::print (SCM smob)
     The vertical lines should not take space, for the following scenario:
 
     8 -----+
-        o  |
-       |
-       |
-       
+    o  |
+    |
+    |
+
 
     Just a small amount, yes.  In tight situations, it is even
     possible to center the `8' directly below the note, dropping the
     ottava line completely...
 
   */
-  
+
   b = Stencil (Box (b.extent (X_AXIS),
-                    Interval (0.1, 0.1)),
-               b.expr ());
-  
+                   Interval (0.1, 0.1)),
+              b.expr ());
+
   b.translate_axis (bracket_span_points[LEFT], X_AXIS);
   text.translate_axis (span_points[LEFT], X_AXIS);
   text.align_to (Y_AXIS, CENTER);
   b.add_stencil (text);
-  
+
   b.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS);
-  
-  return b.smobbed_copy ();  
-}
 
+  return b.smobbed_copy ();
+}
 
 ADD_INTERFACE (Ottava_bracket, "ottava-bracket-interface",
               "An ottava bracket",
index a987b147e59d087a0be43195d4d600ee0c9ed6dd..1975eb0ca7ae469bc40c2734647b78224e3254a9 100644 (file)
@@ -14,7 +14,7 @@
 class Ottava_spanner_engraver : public Engraver
 {
 public:
-  TRANSLATOR_DECLARATIONS (Ottava_spanner_engraver);  
+  TRANSLATOR_DECLARATIONS (Ottava_spanner_engraver);
 protected:
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
@@ -24,16 +24,16 @@ protected:
 private:
   Spanner *span_;
   Spanner *finished_;
-  
+
   SCM last_ottavation_;
-  
+
   void typeset_all ();
 };
 
 void
 Ottava_spanner_engraver::derived_mark () const
 {
-  scm_gc_mark (last_ottavation_ );
+  scm_gc_mark (last_ottavation_);
 }
 
 Ottava_spanner_engraver::Ottava_spanner_engraver ()
@@ -53,9 +53,8 @@ Ottava_spanner_engraver::process_music ()
       span_ = 0;
       if (scm_is_string (ott))
        {
-         span_  = make_spanner ("OttavaBracket", SCM_EOL);
+         span_ = make_spanner ("OttavaBracket", SCM_EOL);
          span_->set_property ("text", ott);
-         
 
          SCM c0 (get_property ("middleCPosition"));
          SCM oc0 (get_property ("originalCentralCPosition"));
@@ -69,7 +68,7 @@ Ottava_spanner_engraver::process_music ()
 void
 Ottava_spanner_engraver::acknowledge_grob (Grob_info info)
 {
-  Item *it = dynamic_cast<Item*> (info.grob_);
+  Item *it = dynamic_cast<Item *> (info.grob_);
   if (span_ && it && Note_column::has_interface (info.grob_))
     {
       Side_position_interface::add_support (span_, it);
@@ -82,7 +81,7 @@ Ottava_spanner_engraver::acknowledge_grob (Grob_info info)
 
 void
 Ottava_spanner_engraver::typeset_all ()
-{  
+{
   if (finished_)
     {
       Direction d = LEFT;
@@ -90,12 +89,12 @@ Ottava_spanner_engraver::typeset_all ()
        {
          if (!finished_->get_bound (RIGHT))
            {
-             Grobe = unsmob_grob (get_property ("currentMusicalColumn"));
+             Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
              finished_->set_bound (d, e);
            }
        }
       while (flip (&d) != LEFT);
-      
+
       finished_ = 0;
     }
 }
@@ -105,7 +104,7 @@ Ottava_spanner_engraver::stop_translation_timestep ()
 {
   if (span_ && !span_->get_bound (LEFT))
     {
-      Grobe = unsmob_grob (get_property ("currentMusicalColumn"));
+      Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
       span_->set_bound (LEFT, e);
     }
 
@@ -123,9 +122,9 @@ Ottava_spanner_engraver::finalize ()
 }
 
 ADD_TRANSLATOR (Ottava_spanner_engraver,
-/* descr */       "Create a text spanner when the ottavation property changes..",
-/* creats*/       "OttavaBracket",
-/* accepts */     "",
-/* acks  */      "note-column-interface",
-/* reads */       "ottavation",
-/* write */       "");
+               /* descr */ "Create a text spanner when the ottavation property changes..",
+               /* creats*/ "OttavaBracket",
+               /* accepts */ "",
+               /* acks  */ "note-column-interface",
+               /* reads */ "ottavation",
+               /* write */ "");
index 606ea1f8d40e2da5dd432fede5dd97342165599e..a230c68ea6b2bdd50bf43961bd7e4fcda13b28ce 100644 (file)
@@ -4,10 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
-
 #define PANGO_ENABLE_BACKEND // ugh, why necessary?
 
 #include <pango/pangoft2.h>
 #include "warn.hh"
 
 #if HAVE_PANGO_FT2
-#include "stencil.hh" 
-
+#include "stencil.hh"
 
 LY_DEFINE (ly_pango_font_p, "ly:pango-font?",
           1, 0, 0,
           (SCM f),
           "Is @var{f} a pango font?")
 {
-  return scm_from_bool (dynamic_cast<Pango_font*> (unsmob_metrics (f)));
+  return scm_from_bool (dynamic_cast<Pango_font *> (unsmob_metrics (f)));
 }
 
-
-
 LY_DEFINE (ly_pango_font_physical_fonts, "ly:pango-font-physical-fonts",
           1, 0, 0,
           (SCM f),
           "Return alist of  (PSNAME . FILENAME) tuples.")
 {
-  Pango_font *pf = dynamic_cast<Pango_font*> (unsmob_metrics (f));
+  Pango_font *pf = dynamic_cast<Pango_font *> (unsmob_metrics (f));
 
   SCM alist = SCM_EOL;
   if (pf)
index 3fce9d55b30e010ec29b3d9e47a9499279fd82d3..d5d01499d5a53d2887c1fb4e4c97a4fa4127d52c 100644 (file)
@@ -4,10 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
-
 #define PANGO_ENABLE_BACKEND // ugh, why necessary?
 
 #include <pango/pangoft2.h>
@@ -21,7 +19,6 @@
 #if HAVE_PANGO_FT2
 #include "stencil.hh"
 
-
 Pango_font::Pango_font (PangoFT2FontMap *fontmap,
                        Direction dir,
                        PangoFontDescription *description,
@@ -36,15 +33,14 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap,
 
   pango_description_ = pango_font_description_copy (description);
   //  context_ = pango_ft2_font_map_create_context (fontmap);
-  attribute_list_= pango_attr_list_new();
-
+  attribute_list_= pango_attr_list_new ();
 
   /*
     urgh. I don't understand this. Why isn't this 1/(scale *
     resolution * output_scale)
 
     --hwn
-   */
+  */
   scale_ = INCH_TO_BP / (Real (PANGO_SCALE) * Real (PANGO_RESOLUTION) * output_scale);
 
   /*
@@ -91,9 +87,9 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
   PangoRectangle ink_rect;
   pango_glyph_string_extents (pgs, pa->font, &ink_rect, &logical_rect);
 
-  PangoFcFont *fcfont = G_TYPE_CHECK_INSTANCE_CAST(pa->font,
-                                                  PANGO_TYPE_FC_FONT,
-                                                  PangoFcFont);
+  PangoFcFont *fcfont = G_TYPE_CHECK_INSTANCE_CAST (pa->font,
+                                                   PANGO_TYPE_FC_FONT,
+                                                   PangoFcFont);
 
   FT_Face ftface = pango_fc_font_lock_face (fcfont);
   Box b (Interval (PANGO_LBEARING (ink_rect),
@@ -123,7 +119,7 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
 
   PangoFontDescription *descr = pango_font_describe (pa->font);
   Real size = pango_font_description_get_size (descr)
-    /  (Real (PANGO_SCALE));
+    / (Real (PANGO_SCALE));
 
   FcPattern *fcpat = fcfont->font_pattern;
   char *filename = 0;
@@ -152,8 +148,8 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
       name = name.left_string (idx);
 
       int slash_idx = name.index_last ('/');   // UGh. What's happens on windows?
-      if (slash_idx >=  0)
-       name = name.right_string (name.length() - slash_idx - 1);
+      if (slash_idx >= 0)
+       name = name.right_string (name.length () - slash_idx - 1);
 
       String initial = name.cut_string (0, 1);
       initial.to_upper ();
@@ -179,7 +175,7 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
   else
     {
       warning (_ ("FreeType face has no PostScript font name."));
-      return Stencil();
+      return Stencil ();
     }
 }
 
@@ -202,7 +198,7 @@ Pango_font::text_stencil (String str) const
   Real x = 0.0;
   while (ptr)
     {
-      PangoItem *item = (PangoItem*) ptr->data;
+      PangoItem *item = (PangoItem *) ptr->data;
 
       Stencil item_stencil = pango_item_string_stencil (item, str, x);
 
@@ -216,13 +212,13 @@ Pango_font::text_stencil (String str) const
   /*
     UGH. Should have flags per output format signifying supported
     options.
-   */
+  */
   if (output_backend_global != "ps"
       && output_backend_global != "eps")
     {
       /*
        For Pango based backends, we take a shortcut.
-       */
+      */
       char *descr_string = pango_font_description_to_string (pango_description_);
       SCM exp
        = scm_list_3 (ly_symbol2scm ("utf8-string"),
@@ -248,65 +244,58 @@ Pango_font::text_stencil (String str) const
   return dest;
 }
 
-
 SCM
 Pango_font::font_file_name () const
 {
   return SCM_BOOL_F;
 }
 
-
 #endif
 
-
-
 #if 0
 void test_pango ()
 {
   int dpi = 1200;
 
-  char * font_family = "Emmentaler";
-  PangoContext * pango_context =
-    pango_ft2_get_context (dpi, dpi);
+  char *font_family = "Emmentaler";
+  PangoContext *pango_context
+    pango_ft2_get_context (dpi, dpi);
   PangoFontDescription *font_description;
   font_description = pango_font_description_new ();
   pango_font_description_set_family (font_description, g_strdup (font_family));
   pango_font_description_set_style (font_description, (PangoStyle) 20);
   pango_context_set_font_description (pango_context, font_description);
 
-
-  PangoAttrList *attr_list = pango_attr_list_new();
+  PangoAttrList *attr_list = pango_attr_list_new ();
   char *str = "sfz";
   GList *items = pango_itemize (pango_context, str, 0, strlen (str),
                                attr_list, NULL);
 
-
   GList *ptr = items;
   while (ptr)
     {
-      PangoItem *item = (PangoItem*)ptr->data;
-      printf"off %d len %d num %d\n", item->offset, item->length, item->num_chars);
+      PangoItem *item = (PangoItem *)ptr->data;
+      printf ("off %d len %d num %d\n", item->offset, item->length, item->num_chars);
 
       PangoAnalysis paobj = item->analysis;
-      PangoAnalysis * pa = &paobj;
+      PangoAnalysis *pa = &paobj;
 
       PangoFontDescription *descr = pango_font_describe (pa->font);
       //      assert (font_description == descr);
       printf ("font descr string '%s' fname '%s'",
              pango_font_description_to_string (descr),
-             pango_font_description_to_filename (descr)
-             );
+             pango_font_description_to_filename (descr));
 
       printf ("type name %s\n", g_type_name (G_TYPE_FROM_INSTANCE (pa->font)));
-      PangoFcFont * fcfont = G_TYPE_CHECK_INSTANCE_CAST (pa->font,
-                                                        PANGO_TYPE_FC_FONT,
-                                                        PangoFcFont);
+      PangoFcFont *fcfont = G_TYPE_CHECK_INSTANCE_CAST (pa->font,
+                                                       PANGO_TYPE_FC_FONT,
+                                                       PangoFcFont);
 
       FcPattern *fcpat = fcfont->font_pattern;
       FcPatternPrint (fcpat);
       char *retval ="bla";
 
-      FcPatternGetString(fcpat, FC_FILE, 0, (FcChar8 **) &retval);
+      FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) &retval);
       printf ("retval %s\n", retval);
 
       FT_Face ftface = pango_fc_font_lock_face (fcfont);
@@ -327,7 +316,7 @@ void test_pango ()
          PangoGlyphGeometry ggeo = pgi->geometry;
 
          printf ("c %d w %d x %d y %d\n", pg, ggeo.width, ggeo.x_offset,
-                 ggeo.y_offset );
+                 ggeo.y_offset);
 
          char str[1024];
          FT_Get_Glyph_Name (ftface, pg, str, 1024);
index 734fa7a88526f9b460f2f5f347e6d08158cb5397..1ae597c236450b017ec1a446feb65bcb341d9b12 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "config.hh"
 #if HAVE_PANGO_FT2
 #include "pango-font.hh"
 
-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}.")
+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");
+  SCM_ASSERT_TYPE (scm_is_number (size), size, SCM_ARG1, __FUNCTION__, "number");
   PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size));
   char *str = pango_font_description_to_string (pfd);
 
@@ -25,5 +24,5 @@ LY_DEFINE(ly_make_pango_description_string, "ly:make-pango-description-string",
   pango_font_description_free (pfd);
   return scm_str;
 }
-         
+
 #endif
index 879985052089758e5525ab05335dc117e4ba378e..dea3b9d40b42e85d708c492d2336cb6c79f72d7a 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 #include <math.h>
 
@@ -13,7 +12,6 @@
 #include "output-def.hh"
 #include "pango-font.hh"
 
-
 PangoFontDescription *
 properties_to_pango_description (SCM chain, Real text_size)
 {
@@ -31,12 +29,12 @@ properties_to_pango_description (SCM chain, Real text_size)
                                       SCM_BOOL_F);
       SCM variant = ly_chain_assoc_get (ly_symbol2scm ("font-shape"), chain,
                                        SCM_BOOL_F);
-       
+
       SCM style = ly_chain_assoc_get (ly_symbol2scm ("font-shape"), chain,
                                      SCM_BOOL_F);
       SCM weight = ly_chain_assoc_get (ly_symbol2scm ("font-series"), chain,
                                       SCM_BOOL_F);
-      
+
       description
        = symbols_to_pango_font_description (family, style, variant, weight,
                                             SCM_BOOL_F);
@@ -44,7 +42,7 @@ properties_to_pango_description (SCM chain, Real text_size)
 
   Real step = robust_scm2double (ly_symbol2scm ("font-size"), 0.0);
   Real size = text_size * pow (2.0, step / 6.0);
-  
+
   pango_font_description_set_size (description,
                                   gint (size * PANGO_SCALE));
   return description;
@@ -56,10 +54,10 @@ select_pango_font (Output_def *layout, SCM chain)
   PangoFontDescription *pfd = properties_to_pango_description (chain,
                                                               point_constant * layout->get_dimension (ly_symbol2scm ("text-font-size")));
 
-  char * str = pango_font_description_to_string (pfd);
+  char *str = pango_font_description_to_string (pfd);
   SCM scm_str = scm_makfrom0str (str);
   g_free (str);
-    
+
   return find_pango_font (layout, scm_str, 1.0);
 }
 
@@ -72,8 +70,7 @@ symbol_to_pango_style (SCM style)
       pstyle = PANGO_STYLE_ITALIC;
     }
   else if (style == ly_symbol2scm ("oblique")
-          || style == ly_symbol2scm ("slanted")
-          )
+          || style == ly_symbol2scm ("slanted"))
     {
       pstyle = PANGO_STYLE_OBLIQUE;
     }
@@ -92,7 +89,6 @@ symbol_to_pango_variant (SCM variant)
   return pvariant;
 }
 
-
 PangoWeight
 symbol_to_pango_weight (SCM weight)
 {
@@ -127,31 +123,29 @@ symbol_to_pango_stretch (SCM) //  stretch)
   PangoStretch ps = PANGO_STRETCH_NORMAL;
 
   /*
-    // TODO
-    
+  // TODO
+
   PANGO_STRETCH_ULTRA_CONDENSED,
   PANGO_STRETCH_EXTRA_CONDENSED,
   PANGO_STRETCH_CONDENSED,
   PANGO_STRETCH_SEMI_CONDENSED,
-  
+
   PANGO_STRETCH_SEMI_EXPANDED,
   PANGO_STRETCH_EXPANDED,
   PANGO_STRETCH_EXTRA_EXPANDED,
   PANGO_STRETCH_ULTRA_EXPANDED
-  */ 
+  */
   return ps;
 }
 
-
-
-PangoFontDescription* 
-symbols_to_pango_font_description(SCM family,
-                                 SCM style,
-                                 SCM variant,
-                                 SCM weight,
-                                 SCM stretch)
+PangoFontDescription *
+symbols_to_pango_font_description (SCM family,
+                                  SCM style,
+                                  SCM variant,
+                                  SCM weight,
+                                  SCM stretch)
 {
-  PangoFontDescription * description = pango_font_description_new ();
+  PangoFontDescription *description = pango_font_description_new ();
 
   String family_str = "roman";
   if (scm_is_symbol (family))
index 811b7319dc88f93ccf62536eea2711b43c48b12a..8b5d6c866e0d30f99ec379d6ac881383f5146bac 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "paper-book.hh"
 #include "output-def.hh"
 
 LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
-         1, 0, 0, (SCM pb),
-         "Return pages in book PB.")
+          1, 0, 0, (SCM pb),
+          "Return pages in book PB.")
 {
-  return unsmob_paper_book(pb)->pages ();
+  return unsmob_paper_book (pb)->pages ();
 }
 
 LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
-         1, 0, 0, (SCM book),
-         "Return pages in layout book @var{book}.")
+          1, 0, 0, (SCM book),
+          "Return pages in layout book @var{book}.")
 {
-  Paper_book *pb = unsmob_paper_book(book);
-  SCM_ASSERT_TYPE(pb, book, SCM_ARG1, __FUNCTION__, "Paper_book");
-  
+  Paper_book *pb = unsmob_paper_book (book);
+  SCM_ASSERT_TYPE (pb, book, SCM_ARG1, __FUNCTION__, "Paper_book");
+
   SCM scopes = SCM_EOL;
   if (ly_c_module_p (pb->header_))
     scopes = scm_cons (pb->header_, scopes);
-  
+
   return scopes;
 }
 
@@ -40,8 +39,8 @@ LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
 }
 
 LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
-         1, 0, 0, (SCM pb),
-         "Return pages in book PB.")
+          1, 0, 0, (SCM pb),
+          "Return pages in book PB.")
 {
   return unsmob_paper_book (pb)->paper_->self_scm ();
 }
index 0ad8a14be7dae14d570941756ff13dcb51845ca3..ea7c044417063db43700a3c80acbaa816b56cd77 100644 (file)
@@ -24,7 +24,7 @@ Paper_book::Paper_book ()
   pages_ = SCM_BOOL_F;
   scores_ = SCM_EOL;
   systems_ = SCM_BOOL_F;
-  
+
   paper_ = 0;
   smobify_self ();
 }
@@ -35,12 +35,12 @@ Paper_book::~Paper_book ()
 
 IMPLEMENT_DEFAULT_EQUAL_P (Paper_book);
 IMPLEMENT_SMOBS (Paper_book)
-IMPLEMENT_TYPE_P (Paper_book, "ly:paper-book?")
+  IMPLEMENT_TYPE_P (Paper_book, "ly:paper-book?")
 
-SCM
+  SCM
 Paper_book::mark_smob (SCM smob)
 {
-  Paper_book *b = (Paper_book*) SCM_CELL_WORD_1 (smob);
+  Paper_book *b = (Paper_book *) SCM_CELL_WORD_1 (smob);
   if (b->paper_)
     scm_gc_mark (b->paper_->self_scm ());
   scm_gc_mark (b->header_);
@@ -53,8 +53,8 @@ Paper_book::mark_smob (SCM smob)
 int
 Paper_book::print_smob (SCM smob, SCM port, scm_print_state*)
 {
-  Paper_book *b = (Paper_book*) SCM_CELL_WORD_1 (smob);
-     
+  Paper_book *b = (Paper_book *) SCM_CELL_WORD_1 (smob);
+
   scm_puts ("#<", port);
   scm_puts (classname (b), port);
   scm_puts (" ", port);
@@ -66,7 +66,7 @@ SCM
 dump_fields ()
 {
   SCM fields = SCM_EOL;
-  for (int i = dump_header_fieldnames_global.size (); i--; )
+  for (int i = dump_header_fieldnames_global.size (); i--;)
     fields
       = scm_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()),
                  fields);
@@ -87,11 +87,11 @@ Paper_book::output (String outname)
 
   /* Generate all stencils to trigger font loads.  */
   pages ();
-  
+
   SCM scopes = SCM_EOL;
   if (ly_c_module_p (header_))
     scopes = scm_cons (header_, scopes);
-  
+
   String mod_nm = "scm framework-" + output_backend_global;
 
   SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
@@ -106,7 +106,7 @@ Paper_book::output (String outname)
                                     dump_fields (),
                                     SCM_UNDEFINED));
     }
-      
+
   if (make_preview)
     {
       SCM func = scm_c_module_lookup (mod, "output-preview-framework");
@@ -135,10 +135,9 @@ Paper_book::classic_output (String outname)
 
   String format = output_backend_global;
   String mod_nm = "scm framework-" + format;
-      
+
   SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
   SCM func = scm_c_module_lookup (mod, "output-classic-framework");
 
   func = scm_variable_ref (func);
   scm_apply_0 (func, scm_list_n (scm_makfrom0str (outname.to_str0 ()),
@@ -150,7 +149,6 @@ Paper_book::classic_output (String outname)
   progress_indication ("\n");
 }
 
-
 /* TODO: resurrect more complex user-tweaks for titling?  */
 Stencil
 Paper_book::book_title ()
@@ -162,19 +160,18 @@ Paper_book::book_title ()
   if (ly_c_module_p (header_))
     scopes = scm_cons (header_, scopes);
 
   SCM tit = SCM_EOL;
   if (ly_c_procedure_p (title_func))
     tit = scm_call_2 (title_func,
-                    paper_->self_scm (),
-                    scopes);
+                     paper_->self_scm (),
+                     scopes);
 
   if (unsmob_stencil (tit))
     title = *unsmob_stencil (tit);
 
   if (!title.is_empty ())
     title.align_to (Y_AXIS, UP);
-  
+
   return title;
 }
 
@@ -195,34 +192,34 @@ Paper_book::score_title (SCM header)
   SCM tit = SCM_EOL;
   if (ly_c_procedure_p (title_func))
     tit = scm_call_2 (title_func,
-                    paper_->self_scm (),
-                    scopes);
+                     paper_->self_scm (),
+                     scopes);
 
   if (unsmob_stencil (tit))
     title = *unsmob_stencil (tit);
 
   if (!title.is_empty ())
     title.align_to (Y_AXIS, UP);
-  
+
   return title;
 }
 
 void
-set_system_penalty (Paper_system * ps, SCM header)
+set_system_penalty (Paper_system *ps, SCM header)
 {
   if (ly_c_module_p (header))
     {
       SCM force = ly_module_lookup (header, ly_symbol2scm ("breakbefore"));
-      if (SCM_VARIABLEP(force)
-         && scm_is_bool (SCM_VARIABLE_REF(force)))
+      if (SCM_VARIABLEP (force)
+         && scm_is_bool (SCM_VARIABLE_REF (force)))
        {
-         ps->break_before_penalty_ = to_boolean (SCM_VARIABLE_REF(force))
+         ps->break_before_penalty_ = to_boolean (SCM_VARIABLE_REF (force))
            ? -10000
            : 10000;
        }
     }
 }
-           
+
 SCM
 Paper_book::systems ()
 {
@@ -236,7 +233,7 @@ Paper_book::systems ()
     {
       Paper_system *ps = new Paper_system (title, true);
       set_system_penalty (ps, header_);
-      
+
       systems_ = scm_cons (ps->self_scm (), systems_);
       scm_gc_unprotect_object (ps->self_scm ());
     }
@@ -267,7 +264,7 @@ Paper_book::systems ()
              set_system_penalty (ps, header);
            }
          header = SCM_EOL;
-      
+
          SCM system_list = scm_vector_to_list (scm_car (s));
          system_list = scm_reverse (system_list);
          systems_ = scm_append (scm_list_2 (system_list, systems_));
@@ -287,9 +284,9 @@ Paper_book::systems ()
       else
        assert (0);
     }
-  
+
   systems_ = scm_reverse (systems_);
-  
+
   int i = 0;
   Paper_system *last = 0;
   for (SCM s = systems_; s != SCM_EOL; s = scm_cdr (s))
@@ -303,7 +300,7 @@ Paper_book::systems ()
        ps->break_before_penalty_ = 10000;
       last = ps;
     }
-  
+
   return systems_;
 }
 
index 8cf2a108f2880f5a4d268fb324d882f49cd38ec5..14de60d2dcebd156f0607748ea43beb23c8364e7 100644 (file)
 #include "font-interface.hh"
 #include "output-def.hh"
 
-Grob * 
+Grob *
 Paper_column::clone (int count) const
 {
   return new Paper_column (*this, count);
 }
 
-
 ADD_INTERFACE (Paper_column, "paper-column-interface",
               "@code{Paper_column} objects form the top-most X-parents for items. "
               "  The are two types of columns: musical columns, where are attached to, and "
@@ -37,8 +36,7 @@ ADD_INTERFACE (Paper_column, "paper-column-interface",
               "  Since many columns go unused, you should only use the rank field to\n"
               "  get ordering information.  Two adjacent columns may have\n"
               "  non-adjacent numbers.\n"
-              "\n"
-              ,
+              "\n",
               "between-cols when bounded-by-me "
               "page-penalty shortest-playing-duration shortest-starter-duration");
 
@@ -49,41 +47,38 @@ Paper_column::do_break_processing ()
   Item::do_break_processing ();
 }
 
-
 int
-Paper_column::get_rank (Grob*me) 
+Paper_column::get_rank (Grob *me)
 {
-  return dynamic_cast<Paper_column*> (me)->rank_;
+  return dynamic_cast<Paper_column *> (me)->rank_;
 }
 
-System*
+System *
 Paper_column::get_system () const
 {
   return system_;
 }
 
-Paper_column*
+Paper_column *
 Paper_column::get_column () const
 {
-  return (Paper_column*) (this);
+  return (Paper_column *) (this);
 }
 
-Paper_column::Paper_column (SCM l, Object_key const*key)
+Paper_column::Paper_column (SCM l, Object_key const *key)
   : Item (l, key)              // guh.?
 {
   system_ = 0;
   rank_ = -1;
 }
 
-
-Paper_column::Paper_column (Paper_column const& src, int count)
+Paper_column::Paper_column (Paper_column const &src, int count)
   : Item (src, count)
 {
   system_ = 0;
   rank_ = src.rank_;
 }
 
-
 Moment
 Paper_column::when_mom (Grob *me)
 {
@@ -104,19 +99,17 @@ Paper_column::is_musical (Grob *me)
     }
   return s != Moment (0);
 }
-  
 
 bool
-Paper_column::is_used (Grob*me)
+Paper_column::is_used (Grob *me)
 {
-  return scm_is_pair (me->get_property ("elements")) ||  Item::is_breakable (me)
-    || scm_is_pair (me->get_property ("bounded-by-me"))
-    ;
+  return scm_is_pair (me->get_property ("elements")) || Item::is_breakable (me)
+    || scm_is_pair (me->get_property ("bounded-by-me"));
 }
 
 /*
-  Print a vertical line and  the rank number, to aid debugging.  
- */
+  Print a vertical line and  the rank number, to aid debugging.
+*/
 
 MAKE_SCHEME_CALLBACK (Paper_column, print, 1);
 SCM
@@ -128,17 +121,17 @@ Paper_column::print (SCM p)
   SCM properties = Font_interface::text_font_alist_chain (me);
 
   SCM scm_mol = Text_interface::interpret_markup (me->get_layout ()->self_scm (),
-                                            properties,
-                                            scm_makfrom0str (r.to_str0 ()));
+                                                 properties,
+                                                 scm_makfrom0str (r.to_str0 ()));
   Stencil t = *unsmob_stencil (scm_mol);
   t.align_to (X_AXIS, CENTER);
   t.align_to (Y_AXIS, DOWN);
-  
+
   Stencil l = Lookup::filled_box (Box (Interval (-0.01, 0.01),
                                       Interval (-2, -1)));
 
   t.add_stencil (l);
-  return t.smobbed_copy ();                                            
+  return t.smobbed_copy ();
 }
 
 /*
@@ -146,8 +139,8 @@ Paper_column::print (SCM p)
   columns are kept "alive". Unfortunately, when spanners are suicided,
   this falls apart again. (sigh.)
 
-  THIS IS BROKEN KLUDGE. WE SHOULD INVENT SOMETHING BETTER. 
- */
+  THIS IS BROKEN KLUDGE. WE SHOULD INVENT SOMETHING BETTER.
+*/
 MAKE_SCHEME_CALLBACK (Paper_column, before_line_breaking, 1);
 SCM
 Paper_column::before_line_breaking (SCM grob)
@@ -159,7 +152,7 @@ Paper_column::before_line_breaking (SCM grob)
 
   while (scm_is_pair (*ptrptr))
     {
-      Grob * g = unsmob_grob (scm_car (*ptrptr));
+      Grob *g = unsmob_grob (scm_car (*ptrptr));
 
       if (!g || !g->is_live ())
        {
index 62b585bb5ab192f5403adbf7d90b61cdd22cef5f..2048ec2170b94cf54215d8db88b77b9debb828ef 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
   paper-def.cc -- implement Paper_def
 
   source file of the GNU LilyPond music typesetter
@@ -12,7 +12,6 @@
 #include "pango-font.hh"
 #include "all-font-metrics.hh"
 
-
 Real
 output_scale (Output_def *od)
 {
@@ -49,31 +48,31 @@ find_scaled_font (Output_def *mod, Font_metric *f, Real m)
 {
   if (mod->parent_)
     return find_scaled_font (mod->parent_, f, m);
-  
+
   Real lookup_mag = m / output_scale (mod);
-  
+
   SCM font_table = get_font_table (mod);
   SCM sizes = scm_hashq_ref (font_table, f->self_scm (), SCM_EOL);
   SCM handle = scm_assoc (scm_make_real (lookup_mag), sizes);
   if (scm_is_pair (handle))
     return unsmob_metrics (scm_cdr (handle));
-  
+
   SCM val = Modified_font_metric::make_scaled_font_metric (f, lookup_mag);
-  
+
   sizes = scm_acons (scm_make_real (lookup_mag), val, sizes);
   scm_gc_unprotect_object (val);
   scm_hashq_set_x (font_table, f->self_scm (), sizes);
   return unsmob_metrics (val);
 }
 
-Font_metric*
-find_pango_font (Output_def *layout,  SCM descr, Real factor)
+Font_metric *
+find_pango_font (Output_def *layout, SCM descr, Real factor)
 {
   if (layout->parent_)
     return find_pango_font (layout->parent_, descr, factor);
-  
+
   SCM table = get_pango_font_table (layout);
-  SCM sizes =  scm_hash_ref (table, descr, SCM_EOL);
+  SCM sizes = scm_hash_ref (table, descr, SCM_EOL);
   SCM size_key = scm_from_double (factor);
   SCM handle = scm_assoc (size_key, sizes);
   if (scm_is_pair (handle))
@@ -87,7 +86,7 @@ find_pango_font (Output_def *layout,  SCM descr, Real factor)
                                                       factor,
                                                       output_scale (layout));
 
-  sizes = scm_acons (size_key,  fm->self_scm(), sizes);
+  sizes = scm_acons (size_key, fm->self_scm (), sizes);
   scm_hash_set_x (table, descr, sizes);
 
   return fm;
@@ -96,7 +95,7 @@ find_pango_font (Output_def *layout,  SCM descr, Real factor)
 /* TODO: this is a nasty interface. During formatting,
    the Output_def should be scaled to the output_scale_
    specified in the toplevel Output_def.  */
-Output_def * 
+Output_def *
 scale_output_def (Output_def *o, Real amount)
 {
   SCM proc = ly_lily_module_constant ("scale-layout");
index f9ed6adf7fe459fa246e333d178541651a5903b2..c0208297a8a75c37889e84d531fe08c39452467f 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "paper-outputter.hh"
@@ -16,11 +15,11 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
           "Create an outputter that evaluates within "
           "@code{output-}@var{format}, writing to file @var{outname}.")
 {
-  SCM_ASSERT_TYPE(scm_is_string (outname), outname, SCM_ARG1, __FUNCTION__,
-                 "String");
-  SCM_ASSERT_TYPE(scm_is_string (format), format, SCM_ARG2, __FUNCTION__,
-                 "String");
-  
+  SCM_ASSERT_TYPE (scm_is_string (outname), outname, SCM_ARG1, __FUNCTION__,
+                  "String");
+  SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__,
+                  "String");
+
   String outname_str = ly_scm2string (outname);
   String f = ly_scm2string (format);
 
@@ -55,18 +54,17 @@ LY_DEFINE (ly_outputter_dump_string, "ly:outputter-dump-string",
   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);
 }
 
-
 LY_DEFINE (ly_outputter_port, "ly:outputter-port",
           1, 0, 0, (SCM outputter),
           "Return output port for @var{outputter}.")
 {
   Paper_outputter *po = unsmob_outputter (outputter);
   SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
-  
+
   return po->file ();
 }
 
index d74b0606b75abaf219d769e1ab481780c7fd716d..5da3ca0607ed7b1981632248a261f480f77e0ce3 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "paper-outputter.hh"
@@ -32,7 +32,7 @@ Paper_outputter::Paper_outputter (String file_name, String format)
   file_ = SCM_EOL;
   output_module_ = SCM_EOL;
   smobify_self ();
-  
+
   file_name_ = file_name;
   String module_name = "scm output-" + format;
   output_module_ = scm_c_resolve_module (module_name.to_str0 ());
@@ -42,14 +42,13 @@ Paper_outputter::~Paper_outputter ()
 {
 }
 
-
 IMPLEMENT_SMOBS (Paper_outputter);
 IMPLEMENT_DEFAULT_EQUAL_P (Paper_outputter);
 
 SCM
 Paper_outputter::mark_smob (SCM x)
 {
-  Paper_outputter *p = (Paper_outputter*) SCM_CELL_WORD_1(x);
+  Paper_outputter *p = (Paper_outputter *) SCM_CELL_WORD_1 (x);
   scm_gc_mark (p->output_module_);
   return p->file_;
 }
@@ -67,7 +66,7 @@ Paper_outputter::file ()
 {
   if (file_ == SCM_EOL)
     if (file_name_ == "-")
-      file_ = scm_current_output_port();
+      file_ = scm_current_output_port ();
     else
       file_ = scm_open_file (scm_makfrom0str (file_name_.to_str0 ()),
                             scm_makfrom0str ("w"));
@@ -95,7 +94,7 @@ Paper_outputter::output_scheme (SCM scm)
 void
 paper_outputter_dump (void *po, SCM x)
 {
-  Paper_outputter *me = (Paper_outputter*) po;
+  Paper_outputter *me = (Paper_outputter *) po;
   me->output_scheme (x);
 }
 
@@ -103,7 +102,7 @@ void
 Paper_outputter::output_stencil (Stencil stil)
 {
   interpret_stencil_expression (stil.expr (), paper_outputter_dump,
-                                (void*) this, Offset (0, 0));
+                               (void *) this, Offset (0, 0));
 }
 
 void
index a3a30d094a6d9fc4f990f6867755c347db70972b..b8bc7d318fd405d91ae1628c3fcc927304514f63 100644 (file)
@@ -51,7 +51,7 @@ Paper_score::calc_breaking ()
   Break_algorithm *algorithm = 0;
   Array<Column_x_positions> sol;
 
-  algorithm = new Gourlay_breaking ;
+  algorithm = new Gourlay_breaking;
   algorithm->set_pscore (this);
   sol = algorithm->solve ();
   delete algorithm;
@@ -71,14 +71,14 @@ Paper_score::process (String)
 
   /* FIXME: Check out why we need this - removing gives assertion failures
      down the road.
-     
+
      doubly, also done in Score_engraver */
   Link_array<Grob> pc (system_->columns ());
   pc[0]->set_property ("breakable", SCM_BOOL_T);
   pc.top ()->set_property ("breakable", SCM_BOOL_T);
-    
+
   system_->pre_processing ();
+
   Array<Column_x_positions> breaking = calc_breaking ();
   system_->break_into_pieces (breaking);
   SCM lines = system_->get_lines ();
@@ -86,9 +86,9 @@ Paper_score::process (String)
   /* gourlay:do_solve also prints newline.  */
   progress_indication ("\n");
 #endif
-  
+
   /* Only keep result stencils in lines_, *title_; delete all grobs.  */
   systems_ = SCM_EOL;
-  
+
   return lines;
 }
index e065091e8f568edd333189901a5418afa4b1ca17..e6da5d276b25caec42c147dcf4dc265c349d1880 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "paper-system.hh"
@@ -17,11 +16,9 @@ LY_DEFINE (ly_paper_system_height, "ly:paper-system-extent",
   SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
   Axis ax = (Axis)scm_to_int (axis);
-  return ly_interval2scm (ps->to_stencil().extent (ax));
+  return ly_interval2scm (ps->to_stencil ().extent (ax));
 }
 
-
-
 LY_DEFINE (ly_paper_system_title_p, "ly:paper-system-title?",
           1, 0, 0, (SCM system),
           "Is  @var{system} a title system?")
@@ -58,8 +55,6 @@ LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
   return ps->to_stencil ().smobbed_copy ();
 }
 
-
-
 LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents",
           1, 0, 0, (SCM system),
           "Return the top and bottom staff refpoint.")
index c614d9710efe048e5f3b920a9d3b7d3f2959d312..c519404a65d0f104a656a5fb5af82f89dfa98535 100644 (file)
@@ -16,8 +16,6 @@ IMPLEMENT_SMOBS (Paper_system);
 IMPLEMENT_TYPE_P (Paper_system, "ly:paper-system?");
 IMPLEMENT_DEFAULT_EQUAL_P (Paper_system);
 
-
-
 Paper_system::Paper_system (Stencil s, bool is_title)
 {
   is_title_ = is_title;
@@ -25,7 +23,7 @@ Paper_system::Paper_system (Stencil s, bool is_title)
   break_before_penalty_ = 0;
   smobify_self ();
   stencil_ = s;
-  staff_refpoints_ = Interval(0, 0);
+  staff_refpoints_ = Interval (0, 0);
 }
 
 Paper_system::~Paper_system ()
@@ -35,14 +33,14 @@ Paper_system::~Paper_system ()
 SCM
 Paper_system::mark_smob (SCM smob)
 {
-  Paper_system *system = (Paper_system*) SCM_CELL_WORD_1 (smob);
+  Paper_system *system = (Paper_system *) SCM_CELL_WORD_1 (smob);
   return system-> stencil_.expr ();
 }
 
 int
 Paper_system::print_smob (SCM smob, SCM port, scm_print_state*)
 {
-  Paper_system *p = (Paper_system*) SCM_CELL_WORD_1 (smob);
+  Paper_system *p = (Paper_system *) SCM_CELL_WORD_1 (smob);
   scm_puts ("#<", port);
   scm_puts (classname (p), port);
   scm_puts ("n ", port);
index b1619d9afd0a699edd04d2f7a1e7f5e6428953a0..78a3c52865fa33c768a04911493aaffa56428e8d 100644 (file)
 
 /* Pass string to scm parser, evaluate one expression.
    Return result value and #chars read.
-   
+
    Thanks to Gary Houston <ghouston@freewire.co.uk>  */
 SCM
-internal_ly_parse_scm (Parse_start * ps)
+internal_ly_parse_scm (Parse_start *ps)
 {
   Source_file *sf = ps->start_location_.source_file_;
   SCM port = sf->get_port ();
 
   int off = ps->start_location_.start_ - sf->to_str0 ();
-  
+
   scm_seek (port, scm_long2num (off), scm_long2num (SEEK_SET));
   SCM from = scm_ftell (port);
 
@@ -48,7 +48,7 @@ internal_ly_parse_scm (Parse_start * ps)
       else
        answer = scm_primitive_eval (form);
     }
+
   /* Reset read_buf for scm_ftell.
      Shouldn't scm_read () do this for us?  */
   scm_fill_input (port);
@@ -67,18 +67,18 @@ internal_ly_parse_scm (Parse_start * ps)
 SCM
 catch_protected_parse_body (void *p)
 {
-  Parse_start *ps = (Parse_start*) p;
-  
+  Parse_start *ps = (Parse_start *) p;
+
   return internal_ly_parse_scm (ps);
 }
 
-SCM 
+SCM
 parse_handler (void *data, SCM tag, SCM args)
 {
-  Parse_startps = (Parse_start *) data;
+  Parse_start *ps = (Parse_start *) data;
   (void) tag;
-  
-  ps->start_location_.error (_("GUILE signaled an error for the expression beginning here"));
+
+  ps->start_location_.error (_ ("GUILE signaled an error for the expression beginning here"));
 
   if (scm_ilength (args) > 2)
     scm_display_error_message (scm_cadr (args), scm_caddr (args), scm_current_error_port ());
@@ -86,22 +86,21 @@ parse_handler (void *data, SCM tag, SCM args)
   /*
     The following is a kludge; we should probably search for
     [a-z][0-9] (a note), and start before that.
-   */
+  */
   ps->nchars = 1;
-    
+
   return SCM_UNDEFINED;
 }
 
 /*
   Do some magical incantations: if not, lily will exit on the first
-  GUILE error, leaving no location trace. 
- */
-
+  GUILE error, leaving no location trace.
+*/
 
 #if GUILE_MINOR_VERSION < 7
-  #define READ_ERROR "misc-error"
-  #else
-  #define READ_ERROR "read-error"
+#define READ_ERROR "misc-error"
+#else
+#define READ_ERROR "read-error"
 #endif
 
 SCM
@@ -109,11 +108,11 @@ protected_ly_parse_scm (Parse_start *ps)
 {
   return scm_internal_catch (ly_symbol2scm (READ_ERROR),
                             &catch_protected_parse_body,
-                            (void*) ps,
-                            &parse_handler, (void*) ps);
+                            (void *) ps,
+                            &parse_handler, (void *) ps);
 }
 
-bool parse_protect_global = true; 
+bool parse_protect_global = true;
 
 /* Try parsing.  Upon failure return SCM_UNDEFINED.
    FIXME: shouldn't we return SCM_UNSCPECIFIED -- jcn  */
@@ -124,11 +123,11 @@ ly_parse_scm (char const *s, int *n, Input i, bool safe)
   ps.str = s;
   ps.start_location_ = i;
   ps.safe_ = safe;
-  
+
   SCM ans = parse_protect_global ? protected_ly_parse_scm (&ps)
     : internal_ly_parse_scm (&ps);
   *n = ps.nchars;
 
-  return ans;  
+  return ans;
 }
 
index 2712a2a150976517628d675afe3a91eb2842abb9..b32b83236fd820d8504d702f59a5c2630a9fba65 100644 (file)
@@ -2,11 +2,10 @@
   part-combine-engraver.cc -- implement PC-engraver
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 
   Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "engraver.hh"
@@ -31,7 +30,7 @@ private:
 };
 
 bool
-Part_combine_engraver::try_music (Music*m)
+Part_combine_engraver::try_music (Music *m)
 {
   event_ = m;
   return true;
@@ -40,7 +39,7 @@ Part_combine_engraver::try_music (Music*m)
 Part_combine_engraver::Part_combine_engraver ()
 {
   text_ = 0;
-  event_  = 0;
+  event_ = 0;
 }
 
 void
@@ -60,7 +59,7 @@ Part_combine_engraver::process_music ()
 
       if (Text_interface::markup_p (text))
        {
-         text_ =  make_item ("CombineTextScript", event_->self_scm () );
+         text_ = make_item ("CombineTextScript", event_->self_scm ());
          text_->set_property ("text", text);
        }
     }
@@ -73,7 +72,7 @@ Part_combine_engraver::acknowledge_grob (Grob_info i)
     {
       if (Note_head::has_interface (i.grob_))
        {
-         Grob*t = text_;
+         Grob *t = text_;
          Side_position_interface::add_support (t, i.grob_);
          if (Side_position_interface::get_axis (t) == X_AXIS
              && !t->get_parent (Y_AXIS))
@@ -86,19 +85,19 @@ Part_combine_engraver::acknowledge_grob (Grob_info i)
     }
 }
 
-void 
+void
 Part_combine_engraver::stop_translation_timestep ()
 {
-      text_ = 0;
+  text_ = 0;
   event_ = 0;
 }
 
 ADD_TRANSLATOR (Part_combine_engraver,
-/* descr */       "Part combine engraver for orchestral scores:                "
-                 "Print markings a2, Solo, Solo II, and unisono ",
-/* creats*/       "CombineTextScript",
-/* accepts */     "part-combine-event",
-/* acks  */       "multi-measure-rest-interface "
-"slur-interface stem-interface note-head-interface",
-/* reads */       "printPartCombineTexts",
-/* write */       "");
+               /* descr */ "Part combine engraver for orchestral scores:               "
+               "Print markings a2, Solo, Solo II, and unisono ",
+               /* creats*/ "CombineTextScript",
+               /* accepts */ "part-combine-event",
+               /* acks  */ "multi-measure-rest-interface "
+               "slur-interface stem-interface note-head-interface",
+               /* reads */ "printPartCombineTexts",
+               /* write */ "");
index 5555d17e496270a840b497c72259c7335eb273ff..70086010b798e81633abc4b3643f36f50de24302 100644 (file)
@@ -1,9 +1,9 @@
-/*   
-     new-part-combine-music-iterator.cc -- implement Part_combine_iterator
+/*
+  new-part-combine-music-iterator.cc -- implement Part_combine_iterator
 
-     source file of the GNU LilyPond music typesetter
-  
-     (c) 2004--2005 Han-Wen Nienhuys
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2004--2005 Han-Wen Nienhuys
 */
 
 #include "context.hh"
@@ -18,15 +18,15 @@ class Part_combine_iterator : public Music_iterator
 public:
   Part_combine_iterator ();
 
-  DECLARE_SCHEME_CALLBACK (constructor, ()); 
+  DECLARE_SCHEME_CALLBACK (constructor, ());
 protected:
-  virtual void derived_substitute (Context *f, Context *t) ;
+  virtual void derived_substitute (Context *f, Context *t);
   virtual void derived_mark () const;
   Part_combine_iterator (Part_combine_iterator const &);
 
   virtual void construct_children ();
   virtual Moment pending_moment () const;
-  virtual void do_quit (); 
+  virtual void do_quit ();
   virtual void process (Moment);
 
   virtual Music_iterator *try_music_in_children (Music *) const;
@@ -34,39 +34,40 @@ protected:
   virtual bool ok () const;
 
 private:
-  Music_iterator * first_iter_;
-  Music_iterator * second_iter_;
+  Music_iterator *first_iter_;
+  Music_iterator *second_iter_;
   Moment start_moment_;
-  
+
   SCM split_list_;
 
-  enum Status  {
-    APART,
-    TOGETHER,
-    SOLO1,
-    SOLO2,
-    UNISONO,
-    UNISILENCE,
-  };
+  enum Status
+    {
+      APART,
+      TOGETHER,
+      SOLO1,
+      SOLO2,
+      UNISONO,
+      UNISILENCE,
+    };
   Status state_;
   Status playing_state_;
 
   /*
     Should be SOLO1 or SOLO2
-   */
+  */
   Status last_playing_;
 
   /*
-    TODO: this is getting of hand... 
-   */
+    TODO: this is getting of hand...
+  */
   Interpretation_context_handle one_;
   Interpretation_context_handle two_;
   Interpretation_context_handle null_;
   Interpretation_context_handle shared_;
   Interpretation_context_handle solo_;
-  
-  void substitute_both (Context * to1,
-                       Context * to2);
+
+  void substitute_both (Context *to1,
+                       Context *to2);
 
   void kill_mmrest (Context *);
   void chords_together ();
@@ -76,7 +77,6 @@ private:
   void unisono (bool silent);
 };
 
-
 static Music *busy_playing_event;
 
 void
@@ -102,7 +102,7 @@ Part_combine_iterator::Part_combine_iterator ()
   split_list_ = SCM_EOL;
   state_ = APART;
   playing_state_ = APART;
-  
+
   if (!busy_playing_event)
     {
       busy_playing_event
@@ -121,7 +121,7 @@ Part_combine_iterator::derived_mark () const
 
 void
 Part_combine_iterator::derived_substitute (Context *f,
-                                    Context *t)
+                                          Context *t)
 {
   if (first_iter_)
     first_iter_->substitute_outlet (f, t);
@@ -161,11 +161,10 @@ Part_combine_iterator::chords_together ()
     }
 }
 
-
 void
-Part_combine_iterator::kill_mmrest (Context * tg)
+Part_combine_iterator::kill_mmrest (Context *tg)
 {
-  static Music * mmrest;
+  static Music *mmrest;
   if (!mmrest)
     {
       mmrest = make_music_by_name (ly_symbol2scm ("MultiMeasureRestEvent"));
@@ -185,13 +184,13 @@ Part_combine_iterator::solo1 ()
       state_ = SOLO1;
       substitute_both (solo_.get_outlet (),
                       null_.get_outlet ());
-      
+
       kill_mmrest (two_.get_outlet ());
       kill_mmrest (shared_.get_outlet ());
 
       if (playing_state_ != SOLO1)
        {
-         static Musicevent;
+         static Music *event;
          if (!event)
            event = make_music_by_name (ly_symbol2scm ("SoloOneEvent"));
 
@@ -202,50 +201,50 @@ Part_combine_iterator::solo1 ()
 }
 
 void
-Part_combine_iterator::substitute_both (Context * to1,
-                                       Context * to2)
+Part_combine_iterator::substitute_both (Context *to1,
+                                       Context *to2)
 {
-  Context *tos[]  = {to1, to2};
-  Music_iterator *mis[] = {first_iter_, second_iter_}; 
-  Interpretation_context_handle *hs[] = {
+  Context *tos[] = {to1, to2};
+  Music_iterator *mis[] = {first_iter_, second_iter_};
+  Interpretation_context_handle *hs[]
+    = {
     &null_,
     &one_, &two_,
-    &shared_,  &solo_,
+    &shared_, &solo_,
     0
   };
-  
-  for (int i = 0; i < 2 ; i++)
+
+  for (int i = 0; i < 2; i++)
     {
-      for (int j =  0; hs[j]; j++)
+      for (int j = 0; hs[j]; j++)
        if (hs[j]->get_outlet () != tos[i])
-         mis[i]->substitute_outlet (hs[j]->get_outlet (), tos[i]); 
+         mis[i]->substitute_outlet (hs[j]->get_outlet (), tos[i]);
     }
 
-  for (int j =  0; hs[j]; j++)
+  for (int j = 0; hs[j]; j++)
     {
-      Context * t = hs[j]->get_outlet ();
+      Context *t = hs[j]->get_outlet ();
       if (t != to1 && t != to2)
        kill_mmrest (t);
     }
 }
 
-
 void
 Part_combine_iterator::unisono (bool silent)
 {
   Status newstate = (silent) ? UNISILENCE : UNISONO;
-  
+
   if (newstate == state_)
-    return; 
+    return;
   else
     {
       /*
        If we're coming from SOLO2 state, we might have kill mmrests
-       in the 1st voice, so in that case, we use the second voice 
+       in the 1st voice, so in that case, we use the second voice
        as a basis for events.
-       */
-      Context *c1 = (last_playing_ == SOLO2) ? null_.get_outlet() : shared_.get_outlet();
-      Context *c2 = (last_playing_ == SOLO2) ? shared_.get_outlet() : null_.get_outlet();
+      */
+      Context *c1 = (last_playing_ == SOLO2) ? null_.get_outlet () : shared_.get_outlet ();
+      Context *c2 = (last_playing_ == SOLO2) ? shared_.get_outlet () : null_.get_outlet ();
       substitute_both (c1, c2);
       kill_mmrest ((last_playing_ == SOLO2)
                   ? one_.get_outlet () : two_.get_outlet ());
@@ -254,12 +253,12 @@ Part_combine_iterator::unisono (bool silent)
       if (playing_state_ != UNISONO
          && newstate == UNISONO)
        {
-         static Musicevent;
+         static Music *event;
          if (!event)
            event = make_music_by_name (ly_symbol2scm ("UnisonoEvent"));
 
          (last_playing_ == SOLO2 ? second_iter_ : first_iter_)
-           ->try_music_in_children (event);      
+           ->try_music_in_children (event);
          playing_state_ = UNISONO;
        }
       state_ = newstate;
@@ -274,12 +273,12 @@ Part_combine_iterator::solo2 ()
   else
     {
       state_ = SOLO2;
-      
+
       substitute_both (null_.get_outlet (), solo_.get_outlet ());
-      
+
       if (playing_state_ != SOLO2)
        {
-         static Musicevent;
+         static Music *event;
          if (!event)
            event = make_music_by_name (ly_symbol2scm ("SoloTwoEvent"));
 
@@ -304,66 +303,63 @@ Part_combine_iterator::apart (bool silent)
     }
 }
 
-
 void
 Part_combine_iterator::construct_children ()
 {
   start_moment_ = get_outlet ()->now_mom ();
-  split_list_ =  get_music ()->get_property ("split-list");
-  SCM lst =  get_music ()->get_property ("elements");
+  split_list_ = get_music ()->get_property ("split-list");
+  SCM lst = get_music ()->get_property ("elements");
 
   SCM props = scm_list_n (/*
                            used to have tweaks here.
-                          */
-                         
+                         */
+
                          SCM_UNDEFINED);
 
   Context *tr
-    =  get_outlet ()->find_create_context (ly_symbol2scm ("Voice"),
-                                            "shared", props);
+    = get_outlet ()->find_create_context (ly_symbol2scm ("Voice"),
+                                         "shared", props);
 
   shared_.set_context (tr);
 
   /*
     If we don't, we get a new staff for every Voice.
-   */
+  */
   set_context (tr);
 
   Context *solo_tr
-    =  get_outlet ()->find_create_context (ly_symbol2scm ("Voice"),
-                                             "solo", props);
+    = get_outlet ()->find_create_context (ly_symbol2scm ("Voice"),
+                                         "solo", props);
 
   solo_ .set_context (solo_tr);
 
   Context *null
-    =  get_outlet ()->find_create_context (ly_symbol2scm ("Devnull"),
-                                            "", SCM_EOL);
+    = get_outlet ()->find_create_context (ly_symbol2scm ("Devnull"),
+                                         "", SCM_EOL);
 
   if (!null)
     programming_error ("No Devnull found?");
-  
+
   null_.set_context (null);
 
   Context *one = tr->find_create_context (ly_symbol2scm ("Voice"),
-                                                     "one", props);
+                                         "one", props);
 
   one_.set_context (one);
 
   set_context (one);
   first_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_car (lst))));
 
-
   Context *two = tr->find_create_context (ly_symbol2scm ("Voice"),
-                                                     "two", props);
+                                         "two", props);
   two_.set_context (two);
   set_context (two);
   second_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_cadr (lst))));
 
-
   set_context (tr);
 
-
-  char const * syms[] = {
+  char const *syms[]
+    = {
     "Stem",
     "DynamicLineSpanner",
     "Tie",
@@ -374,12 +370,12 @@ Part_combine_iterator::construct_children ()
     "Script",
     0
   };
-  
-  for (char const**p = syms; *p; p++)
+
+  for (char const **p = syms; *p; p++)
     {
       SCM sym = ly_symbol2scm (*p);
       execute_pushpop_property (one, sym,
-                                    ly_symbol2scm ("direction"), scm_int2num (1));
+                               ly_symbol2scm ("direction"), scm_int2num (1));
 
       execute_pushpop_property (two, sym,
                                ly_symbol2scm ("direction"), scm_int2num (-1));
@@ -392,15 +388,15 @@ Part_combine_iterator::process (Moment m)
 {
   Moment now = get_outlet ()->now_mom ();
   Moment *splitm = 0;
-  
+
   for (; scm_is_pair (split_list_); split_list_ = scm_cdr (split_list_))
     {
       splitm = unsmob_moment (scm_caar (split_list_));
       if (splitm && *splitm + start_moment_ > now)
-       break ;
+       break;
 
       SCM tag = scm_cdar (split_list_);
-      
+
       if (tag == ly_symbol2scm ("chords"))
        chords_together ();
       else if (tag == ly_symbol2scm ("apart")
@@ -417,8 +413,8 @@ Part_combine_iterator::process (Moment m)
        solo2 ();
       else if (scm_is_symbol (tag))
        {
-         String s =  "Unknown split directive: "
-           + (scm_is_symbol (tag) ? ly_symbol2string (tag) : String ("not a symbol")); 
+         String s = "Unknown split directive: "
+           + (scm_is_symbol (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
          programming_error (s);
        }
     }
@@ -429,7 +425,7 @@ Part_combine_iterator::process (Moment m)
       if (first_iter_->try_music_in_children (busy_playing_event))
        last_playing_ = SOLO1;
     }
-  
+
   if (second_iter_->ok ())
     {
       second_iter_->process (m);
@@ -438,10 +434,10 @@ Part_combine_iterator::process (Moment m)
     }
 }
 
-Music_iterator*
+Music_iterator *
 Part_combine_iterator::try_music_in_children (Music *m) const
 {
-  Music_iterator * i =  first_iter_->try_music (m);
+  Music_iterator *i = first_iter_->try_music (m);
   if (i)
     return i;
   else
index d3433dbfdfe6c57a691d78eb38ff1c674a8ef466..99d440e9fba3059ad0a90b1565f914cf8e3fdecf 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   new-chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "repeated-music.hh"
 #include "global-context.hh"
 #include "score-engraver.hh"
 
 /**
-  This acknowledges repeated music with "percent" style.  It typesets
-  a % sign.  
+   This acknowledges repeated music with "percent" style.  It typesets
+   a % sign.
 
-  TODO:
+   TODO:
 
-  - BEAT case: Create items for single beat repeats, i.e. c4 / / /
+   - BEAT case: Create items for single beat repeats, i.e. c4 / / /
 
-  - DOUBLE_MEASURE case: attach a % to an appropriate barline.
-  
+   - DOUBLE_MEASURE case: attach a % to an appropriate barline.
 */
 class Percent_repeat_engraver : public Engraver
 {
@@ -45,18 +43,20 @@ protected:
   Moment next_moment_;
   Moment body_length_;
 
-  enum {
-    UNKNOWN,
-    MEASURE,
-    DOUBLE_MEASURE,
-  } repeat_sign_type_ ;
+  enum
+    {
+      UNKNOWN,
+      MEASURE,
+      DOUBLE_MEASURE,
+    }
+    repeat_sign_type_;
 
-  Item * double_percent_;
-  Spanner * perc_;
-  Spanner * finished_perc_;
+  Item *double_percent_;
+  Spanner *perc_;
+  Spanner *finished_perc_;
 protected:
   virtual void finalize ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
   virtual void process_music ();
@@ -64,7 +64,7 @@ protected:
 
 Percent_repeat_engraver::Percent_repeat_engraver ()
 {
-  perc_  = 0;
+  perc_ = 0;
   finished_perc_ = 0;
   repeat_ = 0;
 
@@ -72,16 +72,16 @@ Percent_repeat_engraver::Percent_repeat_engraver ()
 }
 
 bool
-Percent_repeat_engraver::try_music (Music * m)
+Percent_repeat_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("repeated-music")
       && m->get_property ("iterator-ctor")
-         == Percent_repeat_iterator::constructor_proc
+      == Percent_repeat_iterator::constructor_proc
       && !repeat_)
     {
       body_length_ = Repeated_music::body_get_length (m);
       int count = Repeated_music::repeat_count (m);
-      
+
       Moment now = now_mom ();
       start_mom_ = now;
       stop_mom_ = start_mom_ + Moment (count) * body_length_;
@@ -93,7 +93,7 @@ Percent_repeat_engraver::try_music (Music * m)
       else if (Moment (2)* meas_len == body_length_)
        {
          repeat_sign_type_ = DOUBLE_MEASURE;
-         next_moment_ += meas_len ;
+         next_moment_ += meas_len;
        }
       else
        {
@@ -103,20 +103,19 @@ Percent_repeat_engraver::try_music (Music * m)
 
       repeat_ = m;
 
-      
       Global_context *global = get_global_context ();
-      for (int i = 0; i < count; i++)  
+      for (int i = 0; i < count; i++)
        {
          global->add_moment_to_process (next_moment_ + Moment (i) * body_length_);
 
          /*
            bars between % too.
-          */
+         */
          if (repeat_sign_type_ == DOUBLE_MEASURE)
            global->add_moment_to_process (next_moment_ + meas_len + Moment (i) * body_length_);
-         
+
        }
-  
+
       return true;
     }
 
@@ -139,9 +138,9 @@ Percent_repeat_engraver::process_music ()
       else if (repeat_sign_type_ == DOUBLE_MEASURE)
        {
          double_percent_ = make_item ("DoublePercentRepeat", repeat_->self_scm ());
-      /*
-       forbid breaks on a % line. Should forbid all breaks, really.
-       */
+         /*
+           forbid breaks on a % line. Should forbid all breaks, really.
+         */
 
          get_score_engraver ()->forbid_breaks ();      // guh. Use properties!      
        }
@@ -176,8 +175,6 @@ Percent_repeat_engraver::typeset_perc ()
 }
 
 
-
-
 void
 Percent_repeat_engraver::start_translation_timestep ()
 {
@@ -194,7 +191,6 @@ Percent_repeat_engraver::start_translation_timestep ()
     }
 }
 
-
 void
 Percent_repeat_engraver::stop_translation_timestep ()
 {
@@ -202,12 +198,10 @@ Percent_repeat_engraver::stop_translation_timestep ()
 }
 
 
-
-
 ADD_TRANSLATOR (Percent_repeat_engraver,
-/* descr */       "Make whole bar and double bar repeats.",
-/* creats*/       "PercentRepeat DoublePercentRepeat",
-/* accepts */     "repeated-music",
-/* acks  */      "",
-/* reads */       "measureLength currentCommandColumn",
-/* write */       "");
+               /* descr */ "Make whole bar and double bar repeats.",
+               /* creats*/ "PercentRepeat DoublePercentRepeat",
+               /* accepts */ "repeated-music",
+               /* acks  */ "",
+               /* reads */ "measureLength currentCommandColumn",
+               /* write */ "");
index 51b3f81a16fe95629af9ebfc4a045d6431361e88..8dad52aba35278ca3685808d62a62f1f221d100b 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   percent-repeat-item.cc -- implement Percent_repeat_item_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "percent-repeat-item.hh"
 
 #include "font-interface.hh"
 
 Stencil
-Percent_repeat_item_interface::brew_slash ( Grob *me)
+Percent_repeat_item_interface::brew_slash (Grob *me)
 {
   Real slope = robust_scm2double (me->get_property ("slope"), 1);
   Real wid = 2.0 / slope;
 
   /*
     todo: check out if in staff-rule thickness normally.
-   */
+  */
   Real thick = robust_scm2double (me->get_property ("thickness"), 1);
   Stencil m = Lookup::repeat_slash (wid, slope, thick);
   m.translate_axis (-m.extent (Y_AXIS).center (), Y_AXIS);
@@ -31,24 +30,24 @@ Percent_repeat_item_interface::brew_slash ( Grob *me)
 
 /*
   todo: use grob props for dot_neg_kern, slash_neg_kern?
- */
+*/
 Stencil
 Percent_repeat_item_interface::x_percent (Grob *me, int count,
                                          Real dot_neg_kern,
                                          Real slash_neg_kern)
 {
-  Stencil m ;
+  Stencil m;
   Stencil s = brew_slash (me);
 
-  for (int i  = count; i--;)
+  for (int i = count; i--;)
     {
       m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern, 0);
     }
   Stencil d1 = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
-  Stencil d2  =  d1;
-  d1.translate_axis (0.5, Y_AXIS );
+  Stencil d2 = d1;
+  d1.translate_axis (0.5, Y_AXIS);
   d2.translate_axis (-0.5, Y_AXIS);
-  
+
   m.add_at_edge (X_AXIS, LEFT, d1, -dot_neg_kern, 0);
   m.add_at_edge (X_AXIS, RIGHT, d2, -dot_neg_kern, 0);
 
@@ -76,8 +75,6 @@ Percent_repeat_item_interface::beat_slash (SCM grob)
 }
 
 ADD_INTERFACE (Percent_repeat_item_interface, "percent-repeat-interface",
-  "Repeats that look like percent signs",
-  "slope thickness");
-
-
+              "Repeats that look like percent signs",
+              "slope thickness");
 
index 791ebe492a18eebd7d654e19521b298f1eabfe1b..a3049f737c241c33a09a46b70390078f662bd565 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   percent-repeat-iterator.cc -- implement Percent_repeat_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "percent-repeat-iterator.hh"
 
@@ -14,7 +13,6 @@
 
 IMPLEMENT_CTOR_CALLBACK (Percent_repeat_iterator);
 
-
 Percent_repeat_iterator::Percent_repeat_iterator ()
 {
   child_iter_ = 0;
@@ -41,7 +39,6 @@ Percent_repeat_iterator::construct_children ()
   child_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (mus)));
 }
 
-
 void
 Percent_repeat_iterator::process (Moment m)
 {
@@ -51,15 +48,15 @@ Percent_repeat_iterator::process (Moment m)
       if (yeah)
        set_context (yeah->get_outlet ());
       else
-       get_music ()->origin ()->warning ( _ ("no one to print a percent"));
+       get_music ()->origin ()->warning (_ ("no one to print a percent"));
     }
-  
+
   if (child_iter_->ok ())
     child_iter_->process (m);
 
-  if (finish_mom_ <= m )
+  if (finish_mom_ <= m)
     {
-      child_iter_->quit (); 
+      child_iter_->quit ();
       child_iter_ = 0;
     }
 }
@@ -70,10 +67,10 @@ Percent_repeat_iterator::pending_moment ()const
   if (child_iter_->ok ())
     return child_iter_->pending_moment ();
   else
-    return finish_mom_ ;
+    return finish_mom_;
 }
 
-Music_iterator*
+Music_iterator *
 Percent_repeat_iterator::try_music_in_children (Music *m) const
 {
   return child_iter_->try_music (m);
@@ -87,7 +84,7 @@ Percent_repeat_iterator::derived_mark ()const
 }
 
 void
-Percent_repeat_iterator::derived_substitute (Context *f, Context *t )
+Percent_repeat_iterator::derived_substitute (Context *f, Context *t)
 {
   if (child_iter_)
     child_iter_->substitute_outlet (f, t);
index 0a6d10486ca42194765326e3b5fce10dafc3a7db..88ba2c8b8ee6a4958f74111e80f4092f8ecdbd12 100644 (file)
@@ -29,14 +29,13 @@ Performance::Performance ()
   audio_elem_p_list_ = 0;
 }
 
-
 Performance::~Performance ()
 {
   delete audio_elem_p_list_;
 }
 
 void
-Performance::output (Midi_streammidi_stream)
+Performance::output (Midi_stream &midi_stream)
 {
   int tracks_i = audio_staffs_.size () + 1;
 
@@ -52,36 +51,34 @@ Performance::output (Midi_stream& midi_stream)
     {
       Audio_staff *s = audio_staffs_[i];
       if (be_verbose_global)
-       progress_indication ("[" + to_string (i)) ;
+       progress_indication ("[" + to_string (i));
 
       /*
        MIDI players tend to ignore instrument settings on
        channel 10, the percussion channel by default.
-       */
+      */
       if (channel % 16 == 9)
-        channel++;
-
+       channel++;
 
       /*
        Huh? Why does each staff also have a separate channel? We
        should map channels to voices, not staves. --hwn.
-       */
+      */
       if (s->channel_ < 0)
        {
          s->channel_ = channel % 16;
          if (channel > 15)
            warning ("MIDI channel wrapped around. Remapping modulo 16.");
        }
-      
+
       s->output (midi_stream, channel++);
       if (be_verbose_global)
        progress_indication ("]");
     }
 }
 
-
 void
-Performance::output_header_track (Midi_streammidi_stream)
+Performance::output_header_track (Midi_stream &midi_stream)
 {
   Midi_track midi_track;
 
@@ -96,7 +93,7 @@ Performance::output_header_track (Midi_stream& midi_stream)
   /*
     This seems silly, but in fact the audio elements should
     be generated elsewhere: not midi-specific.
-   */
+  */
   Audio_text creator_a (Audio_text::TEXT, str);
   Midi_text creator (&creator_a);
   midi_track.add (Moment (0), &creator);
@@ -104,22 +101,21 @@ Performance::output_header_track (Midi_stream& midi_stream)
   /* Better not translate this */
   str = "Generated automatically by: ";
   str += id_string;
-  
+
   Audio_text generate_a (Audio_text::TEXT, str);
   Midi_text generate (&generate_a);
   midi_track.add (Moment (0), &generate);
-  
+
   str = _ ("at ");
   time_t t (time (0));
   str += ctime (&t);
   str = str.left_string (str.length () - 1);
   str = String_convert::pad_to (str, 60);
-  
+
   Audio_text at_a (Audio_text::TEXT, str);
   Midi_text at (&at_a);
   midi_track.add (Moment (0), &at);
 
-
   // TODO:
   //  str = _f ("from musical definition: %s", origin_string_);
 
@@ -144,7 +140,7 @@ Performance::output_header_track (Midi_stream& midi_stream)
 void
 Performance::add_element (Audio_element *p)
 {
-  if (Audio_staff*s = dynamic_cast<Audio_staff *> (p)) 
+  if (Audio_staff *s = dynamic_cast<Audio_staff *> (p))
     {
       audio_staffs_.push (s);
     }
@@ -156,12 +152,12 @@ Performance::process (String out)
 {
   if (out == "-")
     out = "lelie.midi";
-  
+
   /* Maybe a bit crude, but we had this before */
   File_name file_name (out);
   file_name.ext_ = "midi";
   out = file_name.to_string ();
-  
+
   Midi_stream midi_stream (out);
   progress_indication (_f ("MIDI output to `%s'...", out));
 
index 64e596e5afc9299ffce21454e6d7f50f4b416d4c..39d6ccc7c5bc92cb814b12d28b50e348e7193239 100644 (file)
@@ -4,8 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-               Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #include "performer-group-performer.hh"
 
 #include "warn.hh"
 
 ADD_TRANSLATOR (Performer_group_performer,
-/* descr */       "",
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
-
-
+               /* descr */ "",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
 
 void
 Performer_group_performer::announce_element (Audio_element_info info)
@@ -30,7 +28,7 @@ Performer_group_performer::announce_element (Audio_element_info info)
   Translator *t
     = context ()->get_parent_context ()->implementation ();
 
-  if (Performer_group_performer * eg = dynamic_cast<Performer_group_performer*> (t))
+  if (Performer_group_performer *eg = dynamic_cast<Performer_group_performer *> (t))
     eg->announce_element (info);
 }
 
@@ -43,8 +41,8 @@ Performer_group_performer::acknowledge_audio_elements ()
 
       for (SCM p = get_simple_trans_list (); scm_is_pair (p); p = scm_cdr (p))
        {
-         Translator * t = unsmob_translator (scm_car (p));
-         Performer * eng = dynamic_cast<Performer*> (t);
+         Translator *t = unsmob_translator (scm_car (p));
+         Performer *eng = dynamic_cast<Performer *> (t);
          if (eng && eng!= info.origin_trans_)
            eng->acknowledge_audio_element (info);
        }
@@ -59,10 +57,10 @@ Performer_group_performer::do_announces ()
       create_audio_elements ();
       performer_each (get_simple_trans_list (),
                      &Performer::create_audio_elements);
-  
+
       if (!announce_infos_.size ())
-       break ;
-      
+       break;
+
       acknowledge_audio_elements ();
       announce_infos_.clear ();
     }
@@ -72,13 +70,12 @@ Performer_group_performer::Performer_group_performer ()
 {
 }
 
-
 void
 performer_each (SCM list, Performer_method method)
 {
   for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
     {
-      Performer * e = dynamic_cast<Performer*>(unsmob_translator (scm_car (p)));
+      Performer *e = dynamic_cast<Performer *> (unsmob_translator (scm_car (p)));
       if (e)
        (e->*method) ();
     }
index d7d501d4e8453f46294c20f4df56c2e35e741c8a..260c5d7154ade8a0996cf7d75807074bc820397e 100644 (file)
@@ -4,17 +4,17 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-               Jan Nieuwenhuizen <janneke@gnu.org>
- */
+  Jan Nieuwenhuizen <janneke@gnu.org>
+*/
 
 #include "context.hh"
 #include "performer-group-performer.hh"
 #include "warn.hh"
 
-void 
-Performer::play_element (Audio_element* p) 
-{ 
-  get_daddy_performer ()->play_element (p); 
+void
+Performer::play_element (Audio_element *p)
+{
+  get_daddy_performer ()->play_element (p);
 }
 
 int
@@ -23,7 +23,7 @@ Performer::get_tempo () const
   return get_daddy_performer ()->get_tempo ();
 }
 
-Performer_group_performer*
+Performer_group_performer *
 Performer::get_daddy_performer () const
 {
   return
@@ -40,7 +40,6 @@ Performer::create_audio_elements ()
 {
 }
 
-
 void
 Performer::announce_element (Audio_element_info i)
 {
index 99495d1b21f6078662b6225d84a5d8e4c3e20bc1..0967358f1f8b6d6c95ba4a5184656ad7fc8bd4b2 100644 (file)
@@ -28,17 +28,17 @@ pfb2pfa (Byte const *pfb, int length)
 
       Byte type = *p++;
       if (type == 3)
-       break ;
+       break;
 
-      unsigned seglen =
-       p[0] | (p[1] << 8)
+      unsigned seglen
+       p[0] | (p[1] << 8)
        | (p[2] << 16) | (p[3] << 24);
 
       p += 4;
       if (type == 1)
        {
-         out = (char*)realloc (out, olen + seglen + 1);
-         char *outp = out + olen ;
+         out = (char *)realloc (out, olen + seglen + 1);
+         char *outp = out + olen;
          memcpy (outp, p, seglen);
          olen += seglen;
          p += seglen;
@@ -47,16 +47,16 @@ pfb2pfa (Byte const *pfb, int length)
        {
          unsigned outlength = (seglen * 2) + (seglen / 32) + 2;
 
-         out = (char*)realloc (out, olen + outlength + 1);
+         out = (char *)realloc (out, olen + outlength + 1);
 
          char *outp = out + olen;
          for (int i = seglen; i--;)
            {
              sprintf (outp, "%02x", *p++);
              outp += 2;
-             if (!(i % 32))
+             if (! (i % 32))
                {
-                 *outp ++ = '\n';
+                 *outp++ = '\n';
                }
            }
 
@@ -71,8 +71,7 @@ pfb2pfa (Byte const *pfb, int length)
 
 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."
-          )
+          "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");
@@ -80,7 +79,7 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
   String file_name = ly_scm2string (pfb_file_name);
   int len;
   char *str = gulp_file (file_name, &len);
-  char *pfa = pfb2pfa ((Byte*)str, len);
+  char *pfa = pfb2pfa ((Byte *)str, len);
 
   SCM pfa_scm = scm_makfrom0str (pfa);
   free (pfa);
@@ -91,12 +90,11 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
 LY_DEFINE (ly_ttf_to_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."
-          )
+          " a string.")
 {
   SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
                   SCM_ARG1, __FUNCTION__, "string");
-  
+
   String file_name = ly_scm2string (ttf_file_name);
 
   Memory_out_stream stream;
index 9509bae468b2575de1f5c2db300a4da3feb36580..7eda8473f3538d2b17d9abdf970b72de6ec61bc4 100644 (file)
 class Phrasing_slur_engraver : public Engraver
 {
   Drul_array<Music *> events_;
-  Music * running_slur_start_;
+  Music *running_slur_start_;
   Link_array<Grob> slurs_;
   Link_array<Grob> end_slurs_;
 
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual void finalize ();
@@ -59,7 +59,7 @@ Phrasing_slur_engraver::try_music (Music *m)
        {
          if (slurs_.is_empty ())
            return false;
-         
+
          events_[STOP] = m;
          return true;
        }
@@ -67,16 +67,15 @@ Phrasing_slur_engraver::try_music (Music *m)
   return false;
 }
 
-
 void
 Phrasing_slur_engraver::acknowledge_grob (Grob_info info)
 {
   Grob *e = info.grob_;
   if (Note_column::has_interface (info.grob_))
     {
-      for (int i = slurs_.size (); i--; )
+      for (int i = slurs_.size (); i--;)
        Slur::add_column (slurs_[i], e);
-      for (int i = end_slurs_.size (); i-- ; )
+      for (int i = end_slurs_.size (); i--;)
        Slur::add_column (end_slurs_[i], e);
     }
   else
@@ -89,21 +88,21 @@ Phrasing_slur_engraver::acknowledge_grob (Grob_info info)
          || Slur::has_interface (e)
          || to_boolean (inside))
        {
-         for (int i = slurs_.size (); i--; )
+         for (int i = slurs_.size (); i--;)
            Slur::add_extra_encompass (slurs_[i], e);
-         for (int i = end_slurs_.size (); i--; )
+         for (int i = end_slurs_.size (); i--;)
            Slur::add_extra_encompass (end_slurs_[i], e);
        }
       else if (inside == SCM_BOOL_F)
        {
-         Grob *slur = slurs_.size()?slurs_[0] : 0;
-         slur =  (end_slurs_.size () && !slur)
+         Grob *slur = slurs_.size ()?slurs_[0] : 0;
+         slur = (end_slurs_.size () && !slur)
            ? end_slurs_[0] : slur;
 
          if (slur)
            {
              e->add_offset_callback (Slur::outside_slur_callback_proc, Y_AXIS);
-             e->set_property ("slur", slur->self_scm());
+             e->set_property ("slur", slur->self_scm ());
            }
        }
     }
@@ -124,12 +123,12 @@ Phrasing_slur_engraver::process_music ()
       end_slurs_ = slurs_;
       slurs_.clear ();
     }
-  
+
   if (events_[START] && slurs_.is_empty ())
     {
       Music *ev = events_[START];
 
-      Grob * slur = make_spanner ("PhrasingSlur", events_[START]->self_scm ());
+      Grob *slur = make_spanner ("PhrasingSlur", events_[START]->self_scm ());
       Direction updown = to_dir (ev->get_property ("direction"));
       if (updown)
        set_grob_direction (slur, updown);
@@ -145,11 +144,10 @@ Phrasing_slur_engraver::stop_translation_timestep ()
   events_[START] = events_[STOP] = 0;
 }
 
-
 ADD_TRANSLATOR (Phrasing_slur_engraver,
-/* descr */       "Print phrasing slurs. Similar to @ref{Slur_engraver}",
-/* creats*/       "PhrasingSlur",
-/* accepts */     "phrasing-slur-event",
-/* acks  */       "note-column-interface tie-interface fingering-interface script-interface slur-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Print phrasing slurs. Similar to @ref{Slur_engraver}",
+               /* creats*/ "PhrasingSlur",
+               /* accepts */ "phrasing-slur-event",
+               /* acks  */ "note-column-interface tie-interface fingering-interface script-interface slur-interface",
+               /* reads */ "",
+               /* write */ "");
index 9d20e7aa544097b656798c197a6eda7f5f8428f8..75caaea3db1ffd39c8084a2e1ab185506507871f 100644 (file)
@@ -1,10 +1,9 @@
-/*   
+/*
   piano-pedal-bracket.cc -- implement  Piano_pedal_bracket
 
-source file of the GNU LilyPond music typesetter
-
-(c) 2003--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  source file of the GNU LilyPond music typesetter
 
+  (c) 2003--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "stencil.hh"
@@ -15,17 +14,16 @@ source file of the GNU LilyPond music typesetter
 struct Piano_pedal_bracket
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
-
 MAKE_SCHEME_CALLBACK (Piano_pedal_bracket, print, 1);
 SCM
 Piano_pedal_bracket::print (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (smob));
-  Spanner *orig = dynamic_cast<Spanner*> (me->original_); 
-  
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
+  Spanner *orig = dynamic_cast<Spanner *> (me->original_);
+
   Drul_array<bool> broken (false, false);
   Drul_array<Real> height = robust_scm2drul
     (me->get_property ("edge-height"), Interval (0, 0));
@@ -50,35 +48,34 @@ Piano_pedal_bracket::print (SCM smob)
       if (broken[d])
        {
          if (orig
-             && ((d == RIGHT && me->get_break_index () != orig->broken_intos_.size()-1)
+             && ((d == RIGHT && me->get_break_index () != orig->broken_intos_.size () - 1)
                  || (d == LEFT && me->get_break_index ())))
            height[d] = 0.0;
          else
-           flare[d] = 0.0; 
+           flare[d] = 0.0;
        }
-      
-      Interval ext   = robust_relative_extent (b, common,  X_AXIS);
-      span_points[d] = ext [broken[d] ?  RIGHT : LEFT];
+
+      Interval ext = robust_relative_extent (b, common, X_AXIS);
+      span_points[d] = ext [broken[d] ? RIGHT : LEFT];
     }
   while (flip (&d) != LEFT);
 
-  
   /* For 'Mixed' style pedals, i.e.  a bracket preceded by text:  Ped._____|
-   need to shorten by the extent of the text grob
+     need to shorten by the extent of the text grob
   */
   if (textbit)
     {
       height[LEFT] = 0;
-      
+
       Real padding = robust_scm2double (me->get_property ("bound-padding"), 0);
-      
+
       span_points[LEFT] = padding
        + robust_relative_extent (textbit, common, X_AXIS)[RIGHT];
     }
 
-  Stencil m ;
-  if (!span_points.is_empty () &&
-      span_points.length () > 0.001)
+  Stencil m;
+  if (!span_points.is_empty ()
+      && span_points.length () > 0.001)
     {
       m = Tuplet_bracket::make_bracket (me, Y_AXIS,
                                        Offset (span_points.length (), 0),
@@ -91,8 +88,6 @@ Piano_pedal_bracket::print (SCM smob)
   return m.smobbed_copy ();
 }
 
-
-
 ADD_INTERFACE (Piano_pedal_bracket, "piano-pedal-bracket-interface",
               "The bracket of the piano pedal.  It can be tuned through the regular "
               "bracket properties.",
index 646fd1dd9c10f1b116d71c0718596b94316a0590..e8ee2a12e6468e0987a324a71e8017c4080c3947 100644 (file)
@@ -1,12 +1,12 @@
-/*   
-     piano-pedal-engraver.cc -- implement Piano_pedal_engraver
-  
-     source file of the GNU LilyPond music typesetter
-  
-     (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
-     Chris Jackson <chris@fluffhouse.org.uk> - extended to support
-     bracketed pedals.
+/*
+  piano-pedal-engraver.cc -- implement Piano_pedal_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+
+  Chris Jackson <chris@fluffhouse.org.uk> - extended to support
+  bracketed pedals.
 */
 
 #include "engraver.hh"
 
 struct Pedal_info
 {
-  char const * name_;
+  char const *name_;
 
   /*
     Event for currently running pedal.
   */
-  Musiccurrent_bracket_ev_;
+  Music *current_bracket_ev_;
 
   /*
     Event for currently starting pedal, (necessary?
-    
+
     distinct from current_bracket_ev_, since current_bracket_ev_ only
     necessary for brackets, not for text style.
   */
-  Musicstart_ev_;
+  Music *start_ev_;
 
-
-  
   /*
     Events that were found in this timestep.
   */
-  Drul_array<Music*> event_drul_;
-  Itemitem_;
-  Spanner* bracket_;     // A single portion of a pedal bracket
-  Spannerfinished_bracket_;
+  Drul_array<Music *> event_drul_;
+  Item *item_;
+  Spanner *bracket_; // A single portion of a pedal bracket
+  Spanner *finished_bracket_;
 
   /*
     This grob contains all the pedals of the same type on the same staff
   */
-  Spannerline_spanner_;
-  Spannerfinished_line_spanner_;
+  Spanner *line_spanner_;
+  Spanner *finished_line_spanner_;
 };
 
-
 class Piano_pedal_engraver : public Engraver
 {
 public:
@@ -66,7 +63,7 @@ public:
 protected:
   virtual void initialize ();
   virtual void finalize ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
   virtual void process_music ();
@@ -79,16 +76,15 @@ private:
     Record a stack of the current pedal spanners, so if more than one pedal
     occurs simultaneously then extra space can be added between them.
   */
-  
+
   Link_array<Spanner> previous_;
-  void del_linespanner (Spanner*);
-  
+  void del_linespanner (Spanner *);
+
   void create_text_grobs (Pedal_info *p, bool);
   void create_bracket_grobs (Pedal_info *p, bool);
-  void typeset_all (Pedal_info*p);
+  void typeset_all (Pedal_info *p);
 };
 
-
 Piano_pedal_engraver::Piano_pedal_engraver ()
 {
   info_list_ = 0;
@@ -97,12 +93,12 @@ Piano_pedal_engraver::Piano_pedal_engraver ()
 void
 Piano_pedal_engraver::initialize ()
 {
-  char * names [] = { "Sostenuto", "Sustain", "UnaCorda", 0  };
+  char *names [] = { "Sostenuto", "Sustain", "UnaCorda", 0 };
 
-  info_list_ = new Pedal_info[sizeof (names)/ sizeof (const char*)]; 
+  info_list_ = new Pedal_info[sizeof (names)/ sizeof (const char *)];
   Pedal_info *p = info_list_;
 
-  char **np = names ;
+  char **np = names;
   do
     {
       p->name_ = *np;
@@ -118,7 +114,7 @@ Piano_pedal_engraver::initialize ()
 
       p++;
     }
-  while (* (np ++));
+  while (* (np++));
 }
 
 Piano_pedal_engraver::~Piano_pedal_engraver ()
@@ -133,7 +129,7 @@ Piano_pedal_engraver::~Piano_pedal_engraver ()
 void
 Piano_pedal_engraver::acknowledge_grob (Grob_info info)
 {
-  for (Pedal_info*p = info_list_; p && p->name_; p ++)
+  for (Pedal_info *p = info_list_; p && p->name_; p++)
     {
       if (Note_column::has_interface (info.grob_))
        {
@@ -141,11 +137,11 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info)
            {
              Side_position_interface::add_support (p->line_spanner_, info.grob_);
              add_bound_item (p->line_spanner_, info.grob_);
-           }     
+           }
          if (p->bracket_)
            add_bound_item (p->bracket_, info.grob_);
          if (p->finished_bracket_)
-           add_bound_item (p->finished_bracket_, info.grob_);            
+           add_bound_item (p->finished_bracket_, info.grob_);
        }
     }
 }
@@ -155,11 +151,11 @@ Piano_pedal_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("pedal-event"))
     {
-      for (Pedal_info*p = info_list_; p->name_; p ++)
+      for (Pedal_info *p = info_list_; p->name_; p++)
        {
          String nm = p->name_ + String ("Event");
-         if (ly_c_equal_p (m->get_property ("name") ,
-                         scm_str2symbol(nm.to_str0())))
+         if (ly_c_equal_p (m->get_property ("name"),
+                           scm_str2symbol (nm.to_str0 ())))
            {
              Direction d = to_dir (m->get_property ("span-direction"));
              p->event_drul_[d] = m;
@@ -173,20 +169,18 @@ Piano_pedal_engraver::try_music (Music *m)
 void
 Piano_pedal_engraver::process_music ()
 {
-  for (Pedal_info*p = info_list_; p && p->name_; p ++)
+  for (Pedal_info *p = info_list_; p && p->name_; p++)
     {
       if (p->event_drul_[STOP] || p->event_drul_[START])
        {
          if (!p->line_spanner_)
            {
-             String name  = String (p->name_) + "PedalLineSpanner";
-             Music * rq = (p->event_drul_[START]  ?  p->event_drul_[START]  :  p->event_drul_[STOP]);
+             String name = String (p->name_) + "PedalLineSpanner";
+             Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
              p->line_spanner_ = make_spanner (name.to_str0 (), rq->self_scm ());
 
-
-             
            }
-      
+
          /* Choose the appropriate grobs to add to the line spanner
             These can be text items or text-spanners
          */
@@ -200,8 +194,7 @@ Piano_pedal_engraver::process_music ()
            mixed:   Ped. _____/\____|
          */
 
-
-         String prop = String ("pedal")  + p->name_ + "Style";
+         String prop = String ("pedal") + p->name_ + "Style";
          SCM style = get_property (prop.to_str0 ());
 
          bool mixed = style == ly_symbol2scm ("mixed");
@@ -209,7 +202,7 @@ Piano_pedal_engraver::process_music ()
                          || style == ly_symbol2scm ("bracket"));
          bool text = (style == ly_symbol2scm ("text")
                       || mixed);
-         
+
          if (text && !p->item_)
            create_text_grobs (p, mixed);
          if (bracket)
@@ -222,11 +215,11 @@ void
 Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
 {
   SCM s = SCM_EOL;
-  SCM strings = get_property ( ("pedal" + String (p->name_) + "Strings").to_str0 ());
+  SCM strings = get_property (("pedal" + String (p->name_) + "Strings").to_str0 ());
 
   if (scm_ilength (strings) < 3)
     {
-      Music * m =       p->event_drul_[START]; 
+      Music *m = p->event_drul_[START];
       if (!m) m = p->event_drul_ [STOP];
 
       String msg = _ ("Need 3 strings for piano pedals. No pedal made. ");
@@ -234,17 +227,17 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
        m->origin ()->warning (msg);
       else
        warning (msg);
-      
-      return ;
+
+      return;
     }
-  
-  if (p->event_drul_[STOP] && p->event_drul_[START]) 
+
+  if (p->event_drul_[STOP] && p->event_drul_[START])
     {
       if (!mixed)
        {
          if (!p->start_ev_)
            {
-             p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'",  p->name_));
+             p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_));
            }
          else
            {
@@ -254,7 +247,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
        }
     }
   else if (p->event_drul_[STOP])
-    { 
+    {
       if (!mixed)
        {
          if (!p->start_ev_)
@@ -284,7 +277,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
          previous_.push (p->line_spanner_);
        }
     }
-      
+
   if (scm_is_string (s))
     {
       String propname = String (p->name_) + "Pedal";
@@ -296,7 +289,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
       p->item_->set_property ("text", s);
       Axis_group_interface::add_element (p->line_spanner_, p->item_);
     }
-  
+
   if (!mixed)
     {
       p->event_drul_[START] = 0;
@@ -304,7 +297,6 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
     }
 }
 
-
 void
 Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
 {
@@ -312,12 +304,12 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
     {
       String msg = _f ("can't find start of piano pedal bracket: `%s'", p->name_);
       p->event_drul_[STOP]->origin ()->warning (msg);
-      p->event_drul_[STOP] =  0;
+      p->event_drul_[STOP] = 0;
     }
 
   if (p->event_drul_[STOP])
     {
-      assert (!p->finished_bracket_); 
+      assert (!p->finished_bracket_);
 
       Grob *cmc = unsmob_grob (get_property ("currentMusicalColumn"));
 
@@ -346,7 +338,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
       p->start_ev_ = p->event_drul_[START];
       p->current_bracket_ev_ = p->event_drul_[START];
 
-      p->bracket_  = make_spanner ("PianoPedalBracket", p->event_drul_[START]->self_scm ());
+      p->bracket_ = make_spanner ("PianoPedalBracket", p->event_drul_[START]->self_scm ());
 
       /*
        Set properties so that the stencil-creating function will
@@ -359,8 +351,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
          p->bracket_->set_property ("bracket-flare", scm_cons (scm_make_real (0), scm_cdr (flare)));
        }
 
-
-      /* Set this property for 'mixed style' pedals,    Ped._______/\ ,  
+      /* Set this property for 'mixed style' pedals,    Ped._______/\ ,
         so the stencil function will shorten the ____ line by the length of the Ped. text.
       */
 
@@ -379,7 +370,6 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
            p->bracket_->set_property ("pedal-text", p->item_->self_scm ());
        }
 
-
       /*
        We do not use currentMusicalColumn for the left span-point.
        If the column as accidentals (eg on a different stave), the
@@ -392,9 +382,9 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
        TODO:
 
        what about the right span point?
-       
+
       */
-      Axis_group_interface::add_element (p->line_spanner_, p->bracket_);             
+      Axis_group_interface::add_element (p->line_spanner_, p->bracket_);
 
       if (!p->event_drul_[STOP])
        {
@@ -404,10 +394,10 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
 
            // position new pedal spanner below the current one
            */
-         if (previous_.size ()) 
+         if (previous_.size ())
            Side_position_interface::add_support (p->line_spanner_, previous_.top ());
 
-         previous_.push (p->line_spanner_);    
+         previous_.push (p->line_spanner_);
        }
     }
 
@@ -417,8 +407,8 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
 
 void
 Piano_pedal_engraver::finalize ()
-{  
-  for (Pedal_info*p = info_list_; p && p->name_; p ++)
+{
+  for (Pedal_info *p = info_list_; p && p->name_; p++)
     {
       /*
        suicide?
@@ -426,11 +416,11 @@ Piano_pedal_engraver::finalize ()
       if (p->line_spanner_
          && !p->line_spanner_->is_live ())
        p->line_spanner_ = 0;
-      
+
       if (p->bracket_
          && !p->bracket_->is_live ())
        p->bracket_ = 0;
-      
+
       if (p->bracket_)
        {
          SCM cc = get_property ("currentCommandColumn");
@@ -467,7 +457,7 @@ Piano_pedal_engraver::del_linespanner (Spanner *g)
 void
 Piano_pedal_engraver::stop_translation_timestep ()
 {
-  for (Pedal_info*p = info_list_; p && p->name_; p ++)
+  for (Pedal_info *p = info_list_; p && p->name_; p++)
     {
       if (!p->bracket_)
        {
@@ -475,24 +465,22 @@ Piano_pedal_engraver::stop_translation_timestep ()
          p->line_spanner_ = 0;
          del_linespanner (p->finished_line_spanner_);
        }
-      
+
       typeset_all (p);
     }
-  
 
-  for (Pedal_info*p = info_list_; p->name_; p ++)
+  for (Pedal_info *p = info_list_; p->name_; p++)
     {
       p->event_drul_[STOP] = 0;
       p->event_drul_[START] = 0;
     }
 }
 
-
 void
-Piano_pedal_engraver::typeset_all (Pedal_info * p)
+Piano_pedal_engraver::typeset_all (Pedal_info *p)
 {
   /*
-    Handle suicide. 
+    Handle suicide.
   */
   if (p->finished_line_spanner_
       && !p->finished_line_spanner_->is_live ())
@@ -501,15 +489,14 @@ Piano_pedal_engraver::typeset_all (Pedal_info * p)
       && !p->finished_bracket_->is_live ())
     p->finished_bracket_ = 0;
 
-
   if (p->item_)
     {
       p->item_ = 0;
     }
-      
+
   if (p->finished_bracket_)
     {
-      Grob * r = p->finished_bracket_->get_bound (RIGHT);      
+      Grob *r = p->finished_bracket_->get_bound (RIGHT);
       if (!r)
        {
          p->finished_bracket_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
@@ -520,31 +507,31 @@ Piano_pedal_engraver::typeset_all (Pedal_info * p)
 
   if (p->finished_line_spanner_)
     {
-      Grob * l = p->finished_line_spanner_->get_bound (LEFT);
-      Grob * r = p->finished_line_spanner_->get_bound (RIGHT);      
+      Grob *l = p->finished_line_spanner_->get_bound (LEFT);
+      Grob *r = p->finished_line_spanner_->get_bound (RIGHT);
       if (!r && l)
        p->finished_line_spanner_->set_bound (RIGHT, l);
       else if (!l && r)
        p->finished_line_spanner_->set_bound (LEFT, r);
       else if (!r && !l)
        {
-         Grob * cc = unsmob_grob (get_property ("currentMusicalColumn"));
-         Item * ci = dynamic_cast<Item*> (cc);
+         Grob *cc = unsmob_grob (get_property ("currentMusicalColumn"));
+         Item *ci = dynamic_cast<Item *> (cc);
          p->finished_line_spanner_->set_bound (RIGHT, ci);
-         p->finished_line_spanner_->set_bound (LEFT, ci);        
+         p->finished_line_spanner_->set_bound (LEFT, ci);
        }
-      
+
       p->finished_line_spanner_ = 0;
     }
 }
 
 ADD_TRANSLATOR (Piano_pedal_engraver,
-                  /* descr */       "Engrave piano pedal symbols and brackets.",
-                  /* creats*/       "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
-                  /* accepts */     "pedal-event",
-                  /* acks  */       "note-column-interface",
-                  /* reads */       "currentCommandColumn "
-                  "pedalSostenutoStrings pedalSustainStrings "
-                  "pedalUnaCordaStrings pedalSostenutoStyle "
-                  "pedalSustainStyle pedalUnaCordaStyle",
-                  /* write */       "");
+               /* descr */ "Engrave piano pedal symbols and brackets.",
+               /* creats*/ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
+               /* accepts */ "pedal-event",
+               /* acks  */ "note-column-interface",
+               /* reads */ "currentCommandColumn "
+               "pedalSostenutoStrings pedalSustainStrings "
+               "pedalUnaCordaStrings pedalSostenutoStyle "
+               "pedalSustainStyle pedalUnaCordaStyle",
+               /* write */ "");
index e423e01106ecb2e615d3a9a1b433dd3cae1a1698..82c5f9b21b3e21bb698c9aab173f27cd1f7eeb43 100644 (file)
 
 /**
    perform Piano pedals
- */
+*/
 class Piano_pedal_performer : public Performer
 {
   struct Pedal_info
   {
     char const *name_;
-    Musicstart_req_;
-    Drul_array<Music*> req_drul_;
+    Music *start_req_;
+    Drul_array<Music *> req_drul_;
   };
 
 public:
   TRANSLATOR_DECLARATIONS (Piano_pedal_performer);
   ~Piano_pedal_performer ();
-  
+
 protected:
   virtual void initialize ();
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void create_audio_elements ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
 
 private:
   Link_array<Audio_piano_pedal> audios_;
-  Pedal_info * info_alist_;
+  Pedal_info *info_alist_;
 };
 
 Piano_pedal_performer::Piano_pedal_performer ()
@@ -53,8 +53,8 @@ Piano_pedal_performer::initialize ()
   info_alist_ = new Pedal_info[4];
   Pedal_info *p = info_alist_;
 
-  char * names [] = { "Sostenuto", "Sustain", "UnaCorda", 0  };
-  char **np = names ;
+  char *names [] = { "Sostenuto", "Sustain", "UnaCorda", 0 };
+  char **np = names;
   do
     {
       p->name_ = *np;
@@ -64,14 +64,14 @@ Piano_pedal_performer::initialize ()
 
       p++;
     }
-  while (* (np ++));
+  while (* (np++));
 }
 
 void
 Piano_pedal_performer::create_audio_elements ()
 {
-  for (Pedal_info*p = info_alist_; p && p->name_; p ++)
+  for (Pedal_info *p = info_alist_; p && p->name_; p++)
+
     {
       if (p->req_drul_[STOP])
        {
@@ -81,7 +81,7 @@ Piano_pedal_performer::create_audio_elements ()
            }
          else
            {
-             Audio_piano_pedala = new Audio_piano_pedal;
+             Audio_piano_pedal *a = new Audio_piano_pedal;
              a->type_string_ = String (p->name_);
              a->dir_ = STOP;
              audios_.push (a);
@@ -92,7 +92,7 @@ Piano_pedal_performer::create_audio_elements ()
       if (p->req_drul_[START])
        {
          p->start_req_ = p->req_drul_[START];
-         Audio_piano_pedala = new Audio_piano_pedal;
+         Audio_piano_pedal *a = new Audio_piano_pedal;
          a->type_string_ = String (p->name_);
          a->dir_ = START;
          audios_.push (a);
@@ -113,7 +113,7 @@ Piano_pedal_performer::stop_translation_timestep ()
 void
 Piano_pedal_performer::start_translation_timestep ()
 {
-  for (Pedal_info*p = info_alist_; p && p->name_; p ++)
+  for (Pedal_info *p = info_alist_; p && p->name_; p++)
     {
       p->req_drul_[STOP] = 0;
       p->req_drul_[START] = 0;
@@ -121,15 +121,15 @@ Piano_pedal_performer::start_translation_timestep ()
 }
 
 bool
-Piano_pedal_performer::try_music (Musicr)
+Piano_pedal_performer::try_music (Music *r)
 {
if  (r->is_mus_type ("pedal-event"))
 if (r->is_mus_type ("pedal-event"))
     {
-      for (Pedal_info*p = info_alist_; p->name_; p ++)
+      for (Pedal_info *p = info_alist_; p->name_; p++)
        {
          String nm = p->name_ + String ("Event");
-         if (ly_c_equal_p (r->get_property ("name") ,
-                         scm_str2symbol (nm.to_str0())))
+         if (ly_c_equal_p (r->get_property ("name"),
+                           scm_str2symbol (nm.to_str0 ())))
            {
              Direction d = to_dir (r->get_property ("span-direction"));
              p->req_drul_[d] = r;
@@ -141,5 +141,5 @@ Piano_pedal_performer::try_music (Music* r)
 }
 
 ADD_TRANSLATOR (Piano_pedal_performer, "", "",
-                  "pedal-event",
-                  "", "", "" );
+               "pedal-event",
+               "", "", "");
index 3787d322e5343cf5827db448be1b0a911255bf41..73c619e1bfd31125c7efddffecf27d79c6728b89 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   pitch-interval.cc -- implement Pitch_interval
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "pitch-interval.hh"
 
 Pitch_interval::Pitch_interval (Pitch p1, Pitch p2)
 {
-  elem_ref(LEFT) =  p1;
-  elem_ref(RIGHT) =  p2;
+  elem_ref (LEFT) = p1;
+  elem_ref (RIGHT) = p2;
 }
 
-
 Pitch_interval::Pitch_interval ()
 {
-  elem_ref(LEFT) =  Pitch (100, 0, 0);
-  elem_ref(RIGHT) =  Pitch (-100, 0, 0);
+  elem_ref (LEFT) = Pitch (100, 0, 0);
+  elem_ref (RIGHT) = Pitch (-100, 0, 0);
 }
 
-
 bool
 Pitch_interval::is_empty () const
 {
-  return elem(LEFT) > elem(RIGHT);
+  return elem (LEFT) > elem (RIGHT);
 }
 
-
 void
 Pitch_interval::add_point (Pitch p)
 {
-  if (elem_ref(LEFT) >  p)
-    elem_ref(LEFT) = p;
-  if (elem_ref(RIGHT) < p)
-    elem_ref(RIGHT) = p;
+  if (elem_ref (LEFT) > p)
+    elem_ref (LEFT) = p;
+  if (elem_ref (RIGHT) < p)
+    elem_ref (RIGHT) = p;
 }
index 035f6f2c089a49f2be76d27ddccbbcc0bcf948e2..c417c850f0481a9d3ca24ac5be2d856dd9ecf904 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "pitch.hh"
@@ -14,7 +13,7 @@ LY_DEFINE (ly_pitch_transpose, "ly:pitch-transpose",
           "Transpose @var{p} by the amount @var{delta}, "
           "where @var{delta} is relative to middle C.")
 {
-  Pitcht = unsmob_pitch (p);
+  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");
@@ -31,7 +30,7 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch",
           "The @var{alter} is zero for a natural, negative for "
           "flats, or positive for sharps. ")
 {
-  SCM_ASSERT_TYPE (scm_integer_p (octave)== SCM_BOOL_T , octave, SCM_ARG1, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE (scm_integer_p (octave)== SCM_BOOL_T, octave, SCM_ARG1, __FUNCTION__, "integer");
   SCM_ASSERT_TYPE (scm_integer_p (note)== SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer");
   SCM_ASSERT_TYPE (scm_integer_p (alter)== SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer");
 
@@ -116,9 +115,9 @@ LY_DEFINE (ly_pitch_less_p, "ly:pitch<?",
 }
 
 LY_DEFINE (ly_pitch_diff, "ly:pitch-diff",
-          2 , 0, 0, (SCM pitch, SCM  root),
+          2, 0, 0, (SCM pitch, SCM root),
           "Return pitch @var{delta} such that @code{pitch} transposed by "
-          "@var{delta} equals @var{root}" )
+          "@var{delta} equals @var{root}")
 {
   Pitch *p = unsmob_pitch (pitch);
   Pitch *r = unsmob_pitch (root);
index a58e8f2c134fa1f5f72d7735f1273a6ae0194e5c..0ccf797d46a679f129b55a4dfb96130a990e4a64 100644 (file)
@@ -1,23 +1,22 @@
-/*   
+/*
   pitch-squash-engraver.cc -- implement Pitch_squash_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 #include "staff-symbol-referencer.hh"
 #include "note-head.hh"
 #include "rhythmic-head.hh"
 #include "engraver.hh"
 
-class Pitch_squash_engraver : public Engraver {
+class Pitch_squash_engraver : public Engraver
+{
 public:
   TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
   virtual void acknowledge_grob (Grob_info);
 };
 
-
 void
 Pitch_squash_engraver::acknowledge_grob (Grob_info i)
 {
@@ -29,22 +28,20 @@ Pitch_squash_engraver::acknowledge_grob (Grob_info i)
     }
 }
 
-
-
 Pitch_squash_engraver::Pitch_squash_engraver ()
 {
 }
 
 ADD_TRANSLATOR (Pitch_squash_engraver,
-/* descr */       
-                 "Set the vertical position of noteheads to "
-                 "@code{squashedPosition}, if that "
-                 "property is set. "
-                 "This can be used to make  a single line staff "
-                 "demonstrating the rhythm of a melody.",
-
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "note-head-interface",
-/* reads */       "squashedPosition",
-/* write */       "");
+               /* descr */
+               "Set the vertical position of noteheads to "
+               "@code{squashedPosition}, if that "
+               "property is set. "
+               "This can be used to make  a single line staff "
+               "demonstrating the rhythm of a melody.",
+
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "note-head-interface",
+               /* reads */ "squashedPosition",
+               /* write */ "");
index 23c69bc7ecf59d24d0d5c8c3a10a75af92bd83b6..01bb70d5b1bc69eaac6cb15ff0bf7491c246fb7b 100644 (file)
@@ -31,7 +31,7 @@ Pitch::Pitch ()
 int
 Pitch::compare (Pitch const &m1, Pitch const &m2)
 {
-  int o =  m1.octave_ - m2.octave_;
+  int o = m1.octave_ - m2.octave_;
   int n = m1.notename_ - m2.notename_;
   int a = m1.alteration_ - m2.alteration_;
 
@@ -47,12 +47,11 @@ Pitch::compare (Pitch const &m1, Pitch const &m2)
 int
 Pitch::steps () const
 {
-  return  notename_ + octave_*7;
+  return notename_ + octave_*7;
 }
 
 /* Should be settable from input?  */
-static Byte diatonic_scale_semitones[  ] = { 0, 2, 4, 5, 7, 9, 11 };
-
+static Byte diatonic_scale_semitones[ ] = { 0, 2, 4, 5, 7, 9, 11 };
 
 /* Calculate pitch height in 12th octave steps.  Don't assume
    normalised pitch as this function is used to normalise the pitch.  */
@@ -64,7 +63,7 @@ Pitch::semitone_pitch () const
   while (n < 0)
     {
       n += 7;
-      o --;
+      o--;
     }
 
   if (alteration_ % 2)
@@ -83,7 +82,7 @@ Pitch::quartertone_pitch () const
   while (n < 0)
     {
       n += 7;
-      o --;
+      o--;
     }
 
   return ((o + n / 7) * 24
@@ -140,7 +139,7 @@ Pitch::normalise ()
 void
 Pitch::transpose (Pitch delta)
 {
-  int new_semi = quartertone_pitch ()  +delta.quartertone_pitch ();
+  int new_semi = quartertone_pitch () +delta.quartertone_pitch ();
   octave_ += delta.octave_;
   notename_ += delta.notename_;
   alteration_ += new_semi - quartertone_pitch ();
@@ -149,9 +148,9 @@ Pitch::transpose (Pitch delta)
 }
 
 Pitch
-pitch_interval (Pitch const & from , Pitch const & to )
+pitch_interval (Pitch const &from, Pitch const &to)
 {
-  int sound = to.quartertone_pitch ()  - from.quartertone_pitch ();
+  int sound = to.quartertone_pitch () - from.quartertone_pitch ();
   Pitch pt (to.get_octave () - from.get_octave (),
            to.get_notename () - from.get_notename (),
 
@@ -160,11 +159,10 @@ pitch_interval (Pitch const & from , Pitch const & to )
   return pt.transposed (Pitch (0, 0, sound - pt.quartertone_pitch ()));
 }
 
-
 /* FIXME
    Merge with *pitch->text* funcs in chord-name.scm  */
 char const *accname[] = {"eses", "eseh", "es", "eh", "",
-                        "ih", "is" , "isih",  "isis"};
+                        "ih", "is", "isih", "isis"};
 
 String
 Pitch::to_string () const
@@ -196,7 +194,7 @@ Pitch
 Pitch::to_relative_octave (Pitch p) const
 {
   /* account for c' = octave 1 iso. 0 4 */
-  int oct_mod = octave_  + 1;
+  int oct_mod = octave_ + 1;
   Pitch up_pitch (p);
   Pitch down_pitch (p);
 
@@ -222,7 +220,7 @@ Pitch::up_to (int notename)
 {
   if (notename_ > notename)
     octave_++;
-  notename_  = notename;
+  notename_ = notename;
 }
 
 void
@@ -253,7 +251,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *)
 }
 
 SCM
-Pitch::equal_p (SCM a , SCM b)
+Pitch::equal_p (SCM a, SCM b)
 {
   Pitch *p = (Pitch *) SCM_CELL_WORD_1 (a);
   Pitch *q = (Pitch *) SCM_CELL_WORD_1 (b);
@@ -265,7 +263,6 @@ Pitch::equal_p (SCM a , SCM b)
   return eq ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-
 MAKE_SCHEME_CALLBACK (Pitch, less_p, 2);
 SCM
 Pitch::less_p (SCM p1, SCM p2)
@@ -279,7 +276,6 @@ Pitch::less_p (SCM p1, SCM p2)
     return SCM_BOOL_F;
 }
 
-
 int
 Pitch::get_octave () const
 {
index 56ec9998874ec397427f0236719b7eb6516dda0b..9ff020881b234aa10f55832fafdcbb7219896b00 100644 (file)
@@ -38,7 +38,7 @@ void
 Property_unset_iterator::process (Moment m)
 {
   SCM sym = get_music ()->get_property ("symbol");
-  type_check_assignment (sym, SCM_EOL, ly_symbol2scm ("translation-type?"));  
+  type_check_assignment (sym, SCM_EOL, ly_symbol2scm ("translation-type?"));
   get_outlet ()->unset_property (sym);
 
   Simple_music_iterator::process (m);
@@ -46,10 +46,10 @@ Property_unset_iterator::process (Moment m)
 
 MAKE_SCHEME_CALLBACK (Property_iterator, once_finalization, 2);
 SCM
-Property_iterator::once_finalization (SCM translator, SCM music )
+Property_iterator::once_finalization (SCM translator, SCM music)
 {
-  Music * m = unsmob_music (music);
-  Context * tg
+  Music *m = unsmob_music (music);
+  Context *tg
     = dynamic_cast<Context *> (unsmob_context (translator));
   SCM sym = m->get_property ("symbol");
 
@@ -60,24 +60,23 @@ Property_iterator::once_finalization (SCM translator, SCM music )
 void
 Property_iterator::do_quit ()
 {
-  if (to_boolean (get_music ()->get_property  ("once")))
+  if (to_boolean (get_music ()->get_property ("once")))
     {
       SCM trans = get_outlet ()->self_scm ();
       SCM music = get_music ()->self_scm ();
 
-      Global_context * tg = get_outlet ()->get_global_context ();
+      Global_context *tg = get_outlet ()->get_global_context ();
       tg->add_finalization (scm_list_n (once_finalization_proc,
                                        trans, music, SCM_UNDEFINED));
     }
 }
 
-
 SCM list_p = 0;
 
 /*
   This is a rather crude check: we merely check if the translator
   property is a list.
- */
+*/
 bool
 check_grob (Music *mus, SCM sym)
 {
@@ -85,16 +84,15 @@ check_grob (Music *mus, SCM sym)
     {
       list_p = scm_c_eval_string ("list?");
     }
-  
-  
+
   SCM type = scm_object_property (sym, ly_symbol2scm ("translation-type?"));
   bool ok = type == list_p;
 
   if (!ok)
     {
-      mus->origin ()->warning (_f ("Not a grob name, `%s'." , ly_symbol2string (sym)));
+      mus->origin ()->warning (_f ("Not a grob name, `%s'.", ly_symbol2string (sym)));
     }
-  return  ok;
+  return ok;
 }
 
 void
@@ -119,14 +117,14 @@ MAKE_SCHEME_CALLBACK (Push_property_iterator, once_finalization, 2);
 SCM
 Push_property_iterator::once_finalization (SCM trans, SCM music)
 {
-  Music * mus = unsmob_music (music);
-  Context * tg = dynamic_cast<Context *> (unsmob_context (trans));
-    
+  Music *mus = unsmob_music (music);
+  Context *tg = dynamic_cast<Context *> (unsmob_context (trans));
+
   SCM sym = mus->get_property ("symbol");
   if (check_grob (mus, sym))
     {
       SCM eprop = mus->get_property ("grob-property");
-  
+
       execute_pushpop_property (tg, sym, eprop, SCM_UNDEFINED);
     }
   return SCM_UNSPECIFIED;
@@ -135,12 +133,12 @@ Push_property_iterator::once_finalization (SCM trans, SCM music)
 void
 Push_property_iterator::do_quit ()
 {
-  if (to_boolean (get_music ()->get_property  ("once")))
+  if (to_boolean (get_music ()->get_property ("once")))
     {
       SCM trans = get_outlet ()->self_scm ();
       SCM music = get_music ()->self_scm ();
 
-      Global_context * tg =  get_outlet ()->get_global_context ();
+      Global_context *tg = get_outlet ()->get_global_context ();
       tg->add_finalization (scm_list_n (once_finalization_proc,
                                        trans, music, SCM_UNDEFINED));
     }
@@ -150,17 +148,15 @@ void
 Pop_property_iterator::process (Moment m)
 {
   SCM sym = get_music ()->get_property ("symbol");
-  
+
   if (check_grob (get_music (), sym))
     {
       SCM eprop = get_music ()->get_property ("grob-property");
-execute_pushpop_property (get_outlet (), sym, eprop, SCM_UNDEFINED);
+      execute_pushpop_property (get_outlet (), sym, eprop, SCM_UNDEFINED);
     }
   Simple_music_iterator::process (m);
 }
 
-
-
 IMPLEMENT_CTOR_CALLBACK (Pop_property_iterator);
 IMPLEMENT_CTOR_CALLBACK (Push_property_iterator);
 IMPLEMENT_CTOR_CALLBACK (Property_iterator);
index 7b5307daf9f632522414b5a1867fca3cf03af1de..976563ac8971feaef05f3f49f0fb699f3bd2da91 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   protected-scm.cc -- implement Protected_scm
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "protected-scm.hh"
 
@@ -31,12 +30,12 @@ Protected_scm::~Protected_scm ()
     scm_gc_unprotect_object (object_);
 }
 
-Protected_scm & 
-Protected_scm::operator = (SCM s)
+Protected_scm &
+Protected_scm::operator= (SCM s)
 {
   if (object_ == s)
     return *this;
-  
+
   if (SCM_NIMP (object_))
     scm_gc_unprotect_object (object_);
 
@@ -44,10 +43,10 @@ Protected_scm::operator = (SCM s)
   return *this;
 }
 
-Protected_scm&
-Protected_scm::operator = (Protected_scm const &s)
+Protected_scm &
+Protected_scm::operator= (Protected_scm const &s)
 {
-  return operator = (s.object_);
+  return operator= (s.object_);
 }
 
 Protected_scm::operator SCM () const
@@ -55,7 +54,7 @@ Protected_scm::operator SCM () const
   return object_;
 }
 
-SCM 
+SCM
 Protected_scm::to_SCM () const
 {
   return object_;
index 89785ea4b97baa44bf5a1000f2b8198a7c67a45e..ab7a206ce1a7b90aab03fbb76bd70975c6778a90 100644 (file)
@@ -1,10 +1,9 @@
-/*   
+/*
   quote-iterator.cc -- implement Quote_iterator
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "context.hh"
@@ -25,13 +24,13 @@ public:
   Moment stop_moment_;
   SCM event_vector_;
   int event_idx_;
-  int end_idx_ ;
+  int end_idx_;
 
   SCM transposed_musics_;
-  
-  DECLARE_SCHEME_CALLBACK (constructor, ()); 
+
+  DECLARE_SCHEME_CALLBACK (constructor, ());
   bool quote_ok () const;
-  bool accept_music_type (Music*) const;
+  bool accept_music_type (Music *) const;
 protected:
   virtual void derived_mark () const;
   virtual void construct_children ();
@@ -43,9 +42,9 @@ protected:
 bool
 Quote_iterator::accept_music_type (Music *mus) const
 {
-  SCM accept = get_outlet()->get_property ("quotedEventTypes");
-  for (SCM s =  mus->get_property ("types");
-       scm_is_pair (s);  s = scm_cdr (s))
+  SCM accept = get_outlet ()->get_property ("quotedEventTypes");
+  for (SCM s = mus->get_property ("types");
+       scm_is_pair (s); s = scm_cdr (s))
     {
       if (scm_memq (scm_car (s), accept) != SCM_BOOL_F)
        return true;
@@ -54,11 +53,10 @@ Quote_iterator::accept_music_type (Music *mus) const
   return false;
 }
 
-
 void
 Quote_iterator::derived_mark () const
 {
-  scm_gc_mark (transposed_musics_ );
+  scm_gc_mark (transposed_musics_);
 }
 
 Quote_iterator::Quote_iterator ()
@@ -69,31 +67,29 @@ Quote_iterator::Quote_iterator ()
   end_idx_ = 0;
 }
 
-
 int
-binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a, SCM b))
+binsearch_scm_vector (SCM vec, SCM key, bool (*is_less) (SCM a, SCM b))
 {
   int lo = 0;
   int hi = scm_c_vector_length (vec);
 
   /* binary search */
   do
-  {
-    int cmp = (lo + hi) / 2;
+    {
+      int cmp = (lo + hi) / 2;
 
       SCM when = scm_caar (scm_c_vector_ref (vec, cmp));
-      bool result =  (*is_less) (key, when);
+      bool result = (*is_less) (key, when);
       if (result)
-          hi = cmp;
+       hi = cmp;
       else
-          lo = cmp;
+       lo = cmp;
     }
   while (hi - lo > 1);
 
   return lo;
 }
 
-
 void
 Quote_iterator::construct_children ()
 {
@@ -105,32 +101,30 @@ Quote_iterator::construct_children ()
   if (scm_is_string (id)
       && scm_is_symbol (name))
     {
-      Context *cue_context = get_outlet()->find_create_context (name,
-                                                               ly_scm2string (id), SCM_EOL);
+      Context *cue_context = get_outlet ()->find_create_context (name,
+                                                                ly_scm2string (id), SCM_EOL);
       quote_outlet_.set_context (cue_context);
     }
   else
     {
       quote_outlet_.set_context (get_outlet ());
     }
-  
 
   event_vector_ = get_music ()->get_property ("quoted-events");
-  
+
   /*
     We have to delay initting event_idx_ , since we have to
-    take starting grace notes into account. Those may offset 
+    take starting grace notes into account. Those may offset
     event_idx_.
   */
   event_idx_ = -1;
 }
 
-
 bool
 Quote_iterator::ok () const
 {
   return
-    Music_wrapper_iterator::ok()
+    Music_wrapper_iterator::ok ()
     || quote_ok ();
 }
 
@@ -143,9 +137,8 @@ Quote_iterator::quote_ok () const
 
          /*
            Don't quote the grace notes leading to an unquoted note.
-          */
-         && vector_moment (event_idx_).main_part_ < stop_moment_.main_part_
-         );
+         */
+         && vector_moment (event_idx_).main_part_ < stop_moment_.main_part_);
 }
 
 Moment
@@ -155,13 +148,13 @@ Quote_iterator::pending_moment () const
   infty.set_infinite (1);
   Moment m (infty);
 
-  if (Music_wrapper_iterator::ok())
-    m = m <? Music_wrapper_iterator::pending_moment();
+  if (Music_wrapper_iterator::ok ())
+    m = m <? Music_wrapper_iterator::pending_moment ();
 
   /*
     In case event_idx_ < 0, we're not initted yet, and the wrapped
     music expression determines the starting moment.
-   */
+  */
   if (quote_ok ())
     m = m <? vector_moment (event_idx_) - start_moment_;
 
@@ -178,34 +171,34 @@ Quote_iterator::vector_moment (int idx) const
 void
 Quote_iterator::process (Moment m)
 {
-  if (Music_wrapper_iterator::ok())
+  if (Music_wrapper_iterator::ok ())
     Music_wrapper_iterator::process (m);
 
   if (!scm_is_vector (event_vector_))
-    return ;
-  
+    return;
+
   if (event_idx_ < 0)
     {
       event_idx_ = binsearch_scm_vector (event_vector_,
                                         get_outlet ()->now_mom ().smobbed_copy (),
                                         &moment_less);
-      start_moment_ = get_outlet ()->now_mom () - music_start_mom();
-      stop_moment_ = start_moment_ + get_music()->get_length ();
-      
+      start_moment_ = get_outlet ()->now_mom () - music_start_mom ();
+      stop_moment_ = start_moment_ + get_music ()->get_length ();
+
       end_idx_ = binsearch_scm_vector (event_vector_,
                                       stop_moment_.smobbed_copy (),
                                       &moment_less);
     }
-  
+
   m += start_moment_;
   while (event_idx_ <= end_idx_)
     {
       Moment em = vector_moment (event_idx_);
       if (em > m)
-       return ;
+       return;
 
       if (em == m)
-       break ;
+       break;
 
       event_idx_++;
     }
@@ -213,18 +206,18 @@ Quote_iterator::process (Moment m)
   if (quote_ok ())
     {
       SCM entry = scm_c_vector_ref (event_vector_, event_idx_);
-      Pitch * quote_pitch = unsmob_pitch (scm_cdar (entry));
+      Pitch *quote_pitch = unsmob_pitch (scm_cdar (entry));
 
       /*
        The pitch that sounds like central C
-       */
-      Pitch * me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
-      
+      */
+      Pitch *me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
+
       for (SCM s = scm_cdr (entry); scm_is_pair (s); s = scm_cdr (s))
        {
          SCM ev_acc = scm_car (s);
 
-         Music * mus = unsmob_music (scm_car (ev_acc));
+         Music *mus = unsmob_music (scm_car (ev_acc));
          if (!mus)
            programming_error ("need music in quote.");
          else if (accept_music_type (mus))
@@ -241,18 +234,18 @@ Quote_iterator::process (Moment m)
 
                  SCM copy = ly_music_deep_copy (mus->self_scm ());
                  mus = unsmob_music (copy);
-                 
+
                  transposed_musics_ = scm_cons (copy, transposed_musics_);
                  mus->transpose (diff);
                }
-             
+
              bool b = quote_outlet_.get_outlet ()->try_music (mus);
              if (!b)
                mus->origin ()->warning (_f ("In quotation: junking event %s", mus->name ()));
            }
        }
-      
-      event_idx_ ++; 
+
+      event_idx_++;
     }
 }
 
index be0fe66da7c0adee29cc665ef30b61cccf7accd2..5b98ba672dff822ac075818d3842ea3e0cbb41f3 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   recording-group-engraver.cc -- implement Recording_group_engraver
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2003--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+*/
 
 #include "context.hh"
 #include "engraver-group-engraver.hh"
@@ -28,7 +27,7 @@ public:
 void
 Recording_group_engraver::derived_mark () const
 {
-  Engraver_group_engraver::derived_mark();
+  Engraver_group_engraver::derived_mark ();
   scm_gc_mark (now_events_);
   scm_gc_mark (accumulator_);
 }
@@ -51,14 +50,13 @@ Recording_group_engraver::add_music (SCM music, SCM success)
   now_events_ = scm_cons (scm_cons (music, success), now_events_);
 }
 
-
 void
 Recording_group_engraver::stop_translation_timestep ()
 {
   Engraver_group_engraver::stop_translation_timestep ();
 
   accumulator_ = scm_acons (scm_cons (now_mom ().smobbed_copy (),
-                                    get_property ("instrumentTransposition")),
+                                     get_property ("instrumentTransposition")),
                            now_events_,
                            accumulator_);
   now_events_ = SCM_EOL;
@@ -71,11 +69,11 @@ Recording_group_engraver::finalize ()
   SCM proc = get_property ("recordEventSequence");
 
   if (ly_c_procedure_p (proc))
-    scm_call_2  (proc, context ()->self_scm (), scm_cdr (accumulator_));
+    scm_call_2 (proc, context ()->self_scm (), scm_cdr (accumulator_));
 }
 
 bool
-Recording_group_engraver::try_music (Music  *m)
+Recording_group_engraver::try_music (Music *m)
 {
   bool retval = Translator_group::try_music (m);
 
@@ -83,13 +81,12 @@ Recording_group_engraver::try_music (Music  *m)
   return retval;
 }
 
-
 ADD_TRANSLATOR (Recording_group_engraver,
-                 "Engraver_group_engraver that records all music events "
-                 "for this context. Calls the procedure "
-                 "in @code{recordEventSequence} when finished.",
-                 "",
-                 "",
-                 "",
-                 "recordEventSequence",
-                 "");
+               "Engraver_group_engraver that records all music events "
+               "for this context. Calls the procedure "
+               "in @code{recordEventSequence} when finished.",
+               "",
+               "",
+               "",
+               "recordEventSequence",
+               "");
index 96b19eda3f418bb500f66a28c3aef99924732d84..81d4c73cd6b3293e39b03f632ef648a0a298df25 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "music.hh"
 class Relative_octave_check
 {
 public:
-  DECLARE_SCHEME_CALLBACK(relative_callback, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
 };
 
-
-MAKE_SCHEME_CALLBACK(Relative_octave_check, relative_callback, 2)
-SCM
+MAKE_SCHEME_CALLBACK (Relative_octave_check, relative_callback, 2)
+  SCM
 Relative_octave_check::relative_callback (SCM music, SCM last_pitch)
 {
   Pitch p = *unsmob_pitch (last_pitch);
-  Music *m = unsmob_music (music); 
+  Music *m = unsmob_music (music);
   Pitch *check_p = unsmob_pitch (m->get_property ("pitch"));
-  
+
   int delta_oct = 0;
   if (check_p)
     {
@@ -37,15 +35,15 @@ Relative_octave_check::relative_callback (SCM music, SCM last_pitch)
 
       if (result != *check_p)
        {
-         String s = _("Failed octave check, got: ");
+         String s = _ ("Failed octave check, got: ");
          s += result.to_string ();
-         
+
          m->origin ()->warning (s);
-         
+
          delta_oct = check_p->get_octave () - result.get_octave ();
        }
     }
-  
+
   return Pitch (p.get_octave () + delta_oct,
                p.get_notename (), p.get_alteration ()).smobbed_copy ();
 }
index 01ddcc0b37f720b28f60daa04519b84d90f665c7..a04b735cbf5fae3d87221557f31eab6534141297 100644 (file)
@@ -1,35 +1,33 @@
-/*   
+/*
   relative-music.cc -- implement Relative_octave_music
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "music.hh"
 #include "pitch.hh"
 #include "warn.hh"
 #include "scm-option.hh"
 
-
 class Relative_octave_music
 {
 public:
-  DECLARE_SCHEME_CALLBACK(relative_callback, (SCM, SCM));
-  DECLARE_SCHEME_CALLBACK(no_relative_callback, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (no_relative_callback, (SCM, SCM));
 };
 
-MAKE_SCHEME_CALLBACK(Relative_octave_music, no_relative_callback, 2)
-SCM
+MAKE_SCHEME_CALLBACK (Relative_octave_music, no_relative_callback, 2)
+  SCM
 Relative_octave_music::no_relative_callback (SCM music, SCM pitch)
 {
   (void)music;
   return pitch;
 }
 
-MAKE_SCHEME_CALLBACK(Relative_octave_music, relative_callback, 2)
-SCM
+MAKE_SCHEME_CALLBACK (Relative_octave_music, relative_callback, 2)
+  SCM
 Relative_octave_music::relative_callback (SCM music, SCM pitch)
 {
   Music *me = unsmob_music (music);
@@ -39,15 +37,14 @@ Relative_octave_music::relative_callback (SCM music, SCM pitch)
       /*  last-pitch should be junked some time, when
          we ditch 1.8 compat too.
 
-        When you do, B should start where A left off.
+         When you do, B should start where A left off.
 
-       \relative { A \relative { ...} B }  */
+         \relative { A \relative { ...} B }  */
       SCM last_pitch = me->get_property ("last-pitch");
       Pitch *ptr = unsmob_pitch (last_pitch);
-      return (ptr) ?  last_pitch : pitch;
+      return (ptr) ? last_pitch : pitch;
     }
   else
     return pitch;
 }
 
-
index 5978c0de26f37a57ab8b1b7909d47ca6ba3b9fb2..0fdc7413506074ec77bbad4dfbd8ae6607c151e1 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   repeat-acknowledge-engraver.cc -- implement Repeat_acknowledge_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "translator-group.hh"
   Objective:
 
   -- set and reset repeatCommands, so Unfolded_repeat_iterator knows
-    where to set variables.
+  where to set variables.
 
   -- collect information passed by Unfolded_repeat_iterator for
-   Bar_engraver: writes whichBar property. (TODO: check for
-   interactions with timing engraver.)
-  
- */
+  Bar_engraver: writes whichBar property. (TODO: check for
+  interactions with timing engraver.)
+*/
 class Repeat_acknowledge_engraver : public Engraver
 {
 public:
-  
+
   TRANSLATOR_DECLARATIONS (Repeat_acknowledge_engraver);
 protected:
   virtual void start_translation_timestep ();
@@ -41,7 +39,6 @@ Repeat_acknowledge_engraver::initialize ()
   context ()->set_property ("repeatCommands", SCM_EOL);
 }
 
-
 Repeat_acknowledge_engraver::Repeat_acknowledge_engraver ()
 {
 }
@@ -49,7 +46,7 @@ Repeat_acknowledge_engraver::Repeat_acknowledge_engraver ()
 void
 Repeat_acknowledge_engraver::start_translation_timestep ()
 {
-  Context * tr = context ()->where_defined (ly_symbol2scm ("repeatCommands"));
+  Context *tr = context ()->where_defined (ly_symbol2scm ("repeatCommands"));
   if (!tr)
     tr = context ();
 
@@ -61,12 +58,12 @@ Repeat_acknowledge_engraver::process_music ()
 {
   /*
     At the start of a piece, we don't print any repeat bars.
-   */
+  */
   if (!now_mom ().main_part_)
-    return ; 
-  
+    return;
+
   SCM cs = get_property ("repeatCommands");
-  
+
   String s = "";
   bool start = false;
   bool end = false;
@@ -80,7 +77,7 @@ Repeat_acknowledge_engraver::process_music ()
        end = true;
       else if (scm_is_pair (command) && scm_car (command) == ly_symbol2scm ("volta"))
        volta_found = true;
-      cs = scm_cdr (cs);      
+      cs = scm_cdr (cs);
     }
 
   if (start && end)
@@ -92,14 +89,14 @@ Repeat_acknowledge_engraver::process_music ()
 
   /*
     TODO: line breaks might be allowed if we set whichBar to "".
-   */
+  */
 
   /*
     We only set the barline if we wouldn't overwrite a previously set
     barline.
-   */
+  */
   SCM wb = get_property ("whichBar");
-  SCM db  = get_property ("defaultBarType");
+  SCM db = get_property ("defaultBarType");
   if (!scm_is_string (wb) || ly_c_equal_p (db, wb))
     {
       if (s != "" || (volta_found && !scm_is_string (wb)))
@@ -110,10 +107,10 @@ Repeat_acknowledge_engraver::process_music ()
 }
 
 ADD_TRANSLATOR (Repeat_acknowledge_engraver,
-/* descr */       "Acknowledge repeated music, and convert the contents of "
-"repeatCommands ainto an appropriate setting for whichBar.",
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "repeatCommands whichBar",
-/* write */       "");
+               /* descr */ "Acknowledge repeated music, and convert the contents of "
+               "repeatCommands ainto an appropriate setting for whichBar.",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "repeatCommands whichBar",
+               /* write */ "");
index e5ccef6c0c5e6667f7569136028968485e36d1e2..4a0f7d6e88a8dbc6ac7d34140cbcf5ba3196daad 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   repeated-music.cc -- implement Repeated_music
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "repeated-music.hh"
 #include "music-sequence.hh"
@@ -25,22 +24,22 @@ Repeated_music::alternatives (Music *me)
   return me->get_property ("elements");
 }
 
-MAKE_SCHEME_CALLBACK(Repeated_music, relative_callback, 2);
+MAKE_SCHEME_CALLBACK (Repeated_music, relative_callback, 2);
 SCM
 Repeated_music::relative_callback (SCM music, SCM pitch)
 {
   Pitch p = *unsmob_pitch (pitch);
-  Music *me = unsmob_music (music); 
+  Music *me = unsmob_music (music);
   if (lily_1_8_relative)
     {
       Music *body = unsmob_music (me->get_property ("element"));
       if (body)
        p = body->to_relative_octave (p);
 
-      Pitch last = p ;
+      Pitch last = p;
       SCM alternatives = me->get_property ("elements");
 
-      for (SCM s = alternatives; scm_is_pair (s);  s = scm_cdr (s))
+      for (SCM s = alternatives; scm_is_pair (s); s = scm_cdr (s))
        {
          lily_1_8_compatibility_used = true;
          unsmob_music (scm_car (s))->to_relative_octave (p);
@@ -54,15 +53,14 @@ Repeated_music::relative_callback (SCM music, SCM pitch)
     }
 }
 
-
 Moment
-Repeated_music::alternatives_get_length (Music *me, bool fold) 
+Repeated_music::alternatives_get_length (Music *me, bool fold)
 {
   SCM alternative_list = alternatives (me);
   int len = scm_ilength (alternative_list);
   if (len <= 0)
     return 0;
-  
+
   if (fold)
     return Music_sequence::maximum_length (alternative_list);
 
@@ -74,7 +72,7 @@ Repeated_music::alternatives_get_length (Music *me, bool fold)
   while (scm_is_pair (p) && done < count)
     {
       m = m + unsmob_music (scm_car (p))->get_length ();
-      done ++;
+      done++;
       if (count - done < len)
        p = scm_cdr (p);
     }
@@ -91,10 +89,9 @@ Repeated_music::alternatives_volta_get_length (Music *me)
   return Music_sequence::cumulative_length (alternatives (me));
 }
 
-
 /*
-  Length of the body in THIS. Disregards REPEAT-COUNT. 
- */
+  Length of the body in THIS. Disregards REPEAT-COUNT.
+*/
 Moment
 Repeated_music::body_get_length (Music *me)
 {
@@ -106,7 +103,6 @@ Repeated_music::body_get_length (Music *me)
   return m;
 }
 
-
 MAKE_SCHEME_CALLBACK (Repeated_music, unfolded_music_length, 1);
 
 SCM
@@ -124,12 +120,12 @@ Repeated_music::folded_music_length (SCM m)
 {
   Music *me = unsmob_music (m);
 
-  Moment l =  body_get_length (me) + alternatives_get_length (me, true);
+  Moment l = body_get_length (me) + alternatives_get_length (me, true);
   return l.smobbed_copy ();
 }
 
 int
-Repeated_music::repeat_count (Music *me) 
+Repeated_music::repeat_count (Music *me)
 {
   return scm_to_int (me->get_property ("repeat-count"));
 }
@@ -162,10 +158,10 @@ MAKE_SCHEME_CALLBACK (Repeated_music, first_start, 1);
 SCM
 Repeated_music::first_start (SCM m)
 {
-  Music * me = unsmob_music (m);
-  Music * body = unsmob_music (me->get_property ("element"));
+  Music *me = unsmob_music (m);
+  Music *body = unsmob_music (me->get_property ("element"));
 
-  Moment rv =  (body) ? body->start_mom () :
+  Moment rv = (body) ? body->start_mom () :
     Music_sequence::first_start (me->get_property ("elements"));
 
   return rv.smobbed_copy ();
index 3c5b2632c6d51d99d80c6a5cabd1913a1514ed3a..0a1af49d7a49c5315abfcaa5c91fd7a7c9ba96a5 100644 (file)
 
 class Rest_collision_engraver : public Engraver
 {
-  Itemrest_collision_;
-  int rest_count_; 
+  Item *rest_collision_;
+  int rest_count_;
   Link_array<Grob> note_columns_;
 protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void process_acknowledged_grobs ();
   virtual void stop_translation_timestep ();
 public:
-  TRANSLATOR_DECLARATIONS (Rest_collision_engraver);  
+  TRANSLATOR_DECLARATIONS (Rest_collision_engraver);
 };
 
 Rest_collision_engraver::Rest_collision_engraver ()
@@ -35,14 +35,13 @@ Rest_collision_engraver::process_acknowledged_grobs ()
 {
   if (rest_collision_
       || note_columns_.is_empty ()
-      || !rest_count_ 
+      || !rest_count_
       || (note_columns_.size () == rest_count_
-         && rest_count_  < 2))
+         && rest_count_ < 2))
     return;
 
   rest_collision_ = make_item ("RestCollision", SCM_EOL);
 
-  
   for (int i = 0; i < note_columns_.size (); i++)
     Rest_collision::add_column (rest_collision_, note_columns_[i]);
 }
@@ -54,7 +53,7 @@ Rest_collision_engraver::acknowledge_grob (Grob_info i)
     {
       note_columns_.push (i.grob_);
       if (Note_column::has_rests (i.grob_))
-       rest_count_ ++;
+       rest_count_++;
     }
 }
 
@@ -67,9 +66,9 @@ Rest_collision_engraver::stop_translation_timestep ()
 }
 
 ADD_TRANSLATOR (Rest_collision_engraver,
-/* descr */       "Handles collisions of rests.",
-/* creats*/       "RestCollision",
-/* accepts */     "",
-/* acks  */      "note-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Handles collisions of rests.",
+               /* creats*/ "RestCollision",
+               /* accepts */ "",
+               /* acks  */ "note-column-interface",
+               /* reads */ "",
+               /* write */ "");
index 7dd7c4cc3e5a2392365610ce4e27991a2a0bb263..bcc8a8545a12669111cfc943c4433ff7af0520ab 100644 (file)
@@ -30,19 +30,18 @@ Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
   assert (a == Y_AXIS);
 
   if (Note_column::has_rests (them))
-    {  
-      Grob * rc = unsmob_grob (them->get_property ("rest-collision"));
+    {
+      Grob *rc = unsmob_grob (them->get_property ("rest-collision"));
 
       if (rc && !to_boolean (rc->get_property ("positioning-done")))
        {
          rc->set_property ("positioning-done", SCM_BOOL_T);
          do_shift (rc);
        }
-    }  
+    }
   return scm_make_real (0.0);
 }
 
-
 MAKE_SCHEME_CALLBACK (Rest_collision, force_shift_callback_rest, 2);
 SCM
 Rest_collision::force_shift_callback_rest (SCM rest, SCM axis)
@@ -52,14 +51,13 @@ Rest_collision::force_shift_callback_rest (SCM rest, SCM axis)
 
   Grob *parent = rest_grob->get_parent (X_AXIS);
   if (Note_column::has_interface (parent))
-    return force_shift_callback (parent->self_scm(), axis);
+    return force_shift_callback (parent->self_scm (), axis);
   else
     return scm_make_real (0.0);
 }
 
-
 void
-Rest_collision::add_column (Grob*me, Grob *p)
+Rest_collision::add_column (Grob *me, Grob *p)
 {
   me->add_dependency (p);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), p);
@@ -84,8 +82,7 @@ Rest_collision::add_column (Grob*me, Grob *p)
 /*
   TODO: look at horizontal-shift to determine ordering between rests
   for more than two voices.
-  
- */
+*/
 SCM
 Rest_collision::do_shift (Grob *me)
 {
@@ -96,87 +93,89 @@ Rest_collision::do_shift (Grob *me)
 
   for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * e = unsmob_grob (scm_car (s));
+      Grob *e = unsmob_grob (scm_car (s));
       if (unsmob_grob (e->get_property ("rest")))
        {
          /*
            Ignore rests under beam.
-          */
-         Grobst = unsmob_grob (e->get_property ("stem"));
+         */
+         Grob *st = unsmob_grob (e->get_property ("stem"));
          if (st && unsmob_grob (st->get_property ("beam")))
            continue;
-         
+
          rests.push (e);
        }
       else
        notes.push (e);
     }
 
-  
-  /* 
-     handle rest-rest and rest-note collisions
+  /*
+    handle rest-rest and rest-note collisions
 
-     [todo]
-     * decide not to print rest if too crowded?
-   */
+    [todo]
+    * decide not to print rest if too crowded?
+    */
 
   /*
     no partners to collide with
-   */
+  */
   if (rests.size () + notes.size () < 2)
     return SCM_UNSPECIFIED;
 
-
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   /*
     only rests
   */
-  if (!notes.size ()) 
+  if (!notes.size ())
     {
 
       /*
        This is incomplete: in case of an uneven number of rests, the
        center one should be centered on the staff.
-       */
-      Drul_array< Link_array <Grob > > ordered_rests;
+      */
+      Drul_array< Link_array<Grob> > ordered_rests;
       for (int i = 0; i < rests.size (); i++)
        {
-         Grob * r = Note_column::get_rest (rests[i]);
-         
+         Grob *r = Note_column::get_rest (rests[i]);
+
          Direction d = get_grob_direction (r);
          if (d)
            {
              ordered_rests[d].push (rests[i]);
            }
          else
-           rests[d]->warning (_("rest direction not set.  Cannot resolve collision."));
+           rests[d]->warning (_ ("rest direction not set.  Cannot resolve collision."));
        }
 
-      Direction d =  LEFT;
-      do {
-       ordered_rests[d].sort (Note_column::shift_compare);
-      } while (flip (&d) != LEFT);
-      
-      do {
-       if (ordered_rests[d].size () < 1)
-         {
-           if (ordered_rests[-d].size() > 1)
-             ordered_rests[-d][0]->warning (_ ("too many colliding rests"));
-         
-           return SCM_UNSPECIFIED;
-         }
-      } while (flip (&d) != LEFT);
+      Direction d = LEFT;
+      do
+       {
+         ordered_rests[d].sort (Note_column::shift_compare);
+       }
+      while (flip (&d) != LEFT);
+
+      do
+       {
+         if (ordered_rests[d].size () < 1)
+           {
+             if (ordered_rests[-d].size () > 1)
+               ordered_rests[-d][0]->warning (_ ("too many colliding rests"));
+
+             return SCM_UNSPECIFIED;
+           }
+       }
+      while (flip (&d) != LEFT);
 
       Grob *common = common_refpoint_of_array (ordered_rests[DOWN], me, Y_AXIS);
-      common =  common_refpoint_of_array (ordered_rests[UP], common, Y_AXIS);
+      common = common_refpoint_of_array (ordered_rests[UP], common, Y_AXIS);
 
-      Real diff = 
-       (ordered_rests[DOWN].top ()->extent (common, Y_AXIS)[UP]
-        - ordered_rests[UP].top ()->extent (common, Y_AXIS)[DOWN]) / staff_space;
+      Real diff
+       (ordered_rests[DOWN].top ()->extent (common, Y_AXIS)[UP]
+          - ordered_rests[UP].top ()->extent (common, Y_AXIS)[DOWN]) / staff_space;
 
       if (diff > 0)
        {
-         int amount_down = (int) ceil (diff / 2); 
+         int amount_down = (int) ceil (diff / 2);
          diff -= amount_down;
          Note_column::translate_rests (ordered_rests[DOWN].top (),
                                        -2 * amount_down);
@@ -185,28 +184,31 @@ Rest_collision::do_shift (Grob *me)
                                          2 * int (ceil (diff)));
        }
 
-      do {
-       for (int i = ordered_rests[d].size () -1; i-- > 0;)
-         {
-           Real last_y = ordered_rests[d][i+1]->extent (common, Y_AXIS)[d];
-           Real y = ordered_rests[d][i]->extent (common, Y_AXIS)[-d];
+      do
+       {
+         for (int i = ordered_rests[d].size () -1; i-- > 0;)
+           {
+             Real last_y = ordered_rests[d][i + 1]->extent (common, Y_AXIS)[d];
+             Real y = ordered_rests[d][i]->extent (common, Y_AXIS)[-d];
+
+             Real diff = d * ((last_y - y) /staff_space);
+             if (diff > 0)
+               Note_column::translate_rests (ordered_rests[d][i], d * (int) ceil (diff) * 2);
+           }
+       }
+      while (flip (&d) != LEFT);
 
-           Real diff = d * ((last_y - y) /staff_space);
-           if (diff > 0)
-             Note_column::translate_rests (ordered_rests[d][i], d * (int) ceil (diff) * 2);
-         }
-      } while (flip (&d) != LEFT);
     }
-  else 
+  else
     {
       /*
        Rests and notes.
-       */
+      */
       if (rests.size () > 1)
        {
          warning (_ ("too many colliding rests"));
        }
-      Grob * rcol = 0;
+      Grob *rcol = 0;
       Direction dir = CENTER;
 
       for (int i = rests.size (); !rcol && i--;)
@@ -218,24 +220,24 @@ Rest_collision::do_shift (Grob *me)
 
       if (!rcol)
        return SCM_UNSPECIFIED;
-      
+
       Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
-      
+
       Interval restdim = rcol->extent (common, Y_AXIS);
       if (restdim.is_empty ())
        return SCM_UNSPECIFIED;
-      
+
       Real staff_space = Staff_symbol_referencer::staff_space (rcol);
       Real minimum_dist = robust_scm2double (me->get_property ("minimum-distance"), 1.0) * staff_space;
 
       Interval notedim;
-      for (int i = 0; i < notes.size (); i++) 
+      for (int i = 0; i < notes.size (); i++)
        {
          notedim.unite (notes[i]->extent (common, Y_AXIS));
        }
 
-      Real dist =
-       minimum_dist +  dir * (notedim[dir] - restdim[-dir]) >? 0;
+      Real dist
+       = minimum_dist + dir * (notedim[dir] - restdim[-dir]) >? 0;
 
       int stafflines = Staff_symbol_referencer::line_count (me);
       if (!stafflines)
@@ -243,12 +245,12 @@ Rest_collision::do_shift (Grob *me)
          programming_error ("No staff line count ? ");
          stafflines =5;
        }
-      
+
       // move discretely by half spaces.
       int discrete_dist = int (ceil (dist / (0.5 *staff_space)));
 
       // move by whole spaces inside the staff.
-      if (discrete_dist < stafflines+1)
+      if (discrete_dist < stafflines + 1)
        discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0);
 
       Note_column::translate_rests (rcol, dir * discrete_dist);
@@ -256,7 +258,6 @@ Rest_collision::do_shift (Grob *me)
   return SCM_UNSPECIFIED;
 }
 
-
 ADD_INTERFACE (Rest_collision, "rest-collision-interface",
               "Move around ordinary rests (not multi-measure-rests) to avoid "
               "conflicts.",
index 690f994663d6e8183f806c04312a471c5d5b9398..d6436d6a217bf0eb4c44fbbb959bc5dc136f75cb 100644 (file)
@@ -15,8 +15,8 @@
 class Rest_engraver : public Engraver
 {
   Music *rest_req_;
-  Item * dot_;
-  Grobrest_;
+  Item *dot_;
+  Grob *rest_;
 protected:
   virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
@@ -27,10 +27,9 @@ public:
   TRANSLATOR_DECLARATIONS (Rest_engraver);
 };
 
-
 /*
   Should merge with Note_head_engraver
- */
+*/
 Rest_engraver::Rest_engraver ()
 {
   rest_req_ = 0;
@@ -54,17 +53,17 @@ Rest_engraver::stop_translation_timestep ()
 void
 Rest_engraver::process_music ()
 {
-  if (rest_req_ && !rest_) 
+  if (rest_req_ && !rest_)
     {
       rest_ = make_item ("Rest", rest_req_->self_scm ());
 
-      int durlog  = unsmob_duration (rest_req_->get_property ("duration"))-> duration_log ();
-      
+      int durlog = unsmob_duration (rest_req_->get_property ("duration"))-> duration_log ();
+
       rest_->set_property ("duration-log",
-                                 scm_int2num (durlog));
+                          scm_int2num (durlog));
 
       int dots = unsmob_duration (rest_req_->get_property ("duration"))->dot_count ();
-      
+
       if (dots)
        {
          dot_ = make_item ("Dots", SCM_EOL);
@@ -72,7 +71,7 @@ Rest_engraver::process_music ()
          Rhythmic_head::set_dots (rest_, dot_);
          dot_->set_parent (rest_, Y_AXIS);
          dot_->set_property ("dot-count", scm_int2num (dots));
-         
+
        }
 
       Pitch *p = unsmob_pitch (rest_req_->get_property ("pitch"));
@@ -80,17 +79,17 @@ Rest_engraver::process_music ()
       /*
        This is ridiculous -- rests don't have pitch, but we act as if
        our nose is bleeding.
-       */
+      */
       if (p)
        {
          int pos = p->steps ();
          SCM c0 = get_property ("middleCPosition");
          if (scm_is_number (c0))
            pos += scm_to_int (c0);
-         
+
          rest_->set_property ("staff-position", scm_int2num (pos));
        }
-      
+
     }
 }
 
@@ -106,9 +105,9 @@ Rest_engraver::try_music (Music *m)
 }
 
 ADD_TRANSLATOR (Rest_engraver,
-/* descr */       "",
-/* creats*/       "Rest Dots",
-/* accepts */     "rest-event",
-/* acks  */      "",
-/* reads */       "middleCPosition",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "Rest Dots",
+               /* accepts */ "rest-event",
+               /* acks  */ "",
+               /* reads */ "middleCPosition",
+               /* write */ "");
index 80b473eb101ec6747ccccb247ada80b9837f0cbc..421ab1fdfe06f98091b58c5c96e5e4b109af9cdd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- rest.cc -- implement Rest
 rest.cc -- implement Rest
 
   source file of the GNU LilyPond music typesetter
 
@@ -29,15 +29,15 @@ Rest::after_line_breaking (SCM smob)
     {
       if (bt == 0 && lc > 1)
        {
-         me->translate_axis (ss , Y_AXIS);
+         me->translate_axis (ss, Y_AXIS);
        }
     }
   else
     {
-      me->translate_axis (ss/2 , Y_AXIS);
+      me->translate_axis (ss / 2, Y_AXIS);
     }
 
-  Grob * d = unsmob_grob (me->get_property ("dot"));
+  Grob *d = unsmob_grob (me->get_property ("dot"));
   if (d && bt > 4) // UGH.
     {
       d->set_property ("staff-position",
@@ -53,7 +53,7 @@ Rest::after_line_breaking (SCM smob)
 
 /*
   make this function easily usable in C++
- */
+*/
 String
 Rest::glyph_name (Grob *me, int balltype, String style, bool try_ledgers)
 {
@@ -67,7 +67,7 @@ Rest::glyph_name (Grob *me, int balltype, String style, bool try_ledgers)
        Figure out when the rest is far enough outside the staff. This
        could bemore generic, but hey, we understand this even after
        dinner.
-       */
+      */
       ledgered_b |= (balltype == 0) && (pos >= +rad + 2 || pos < -rad);
       ledgered_b |= (balltype == 1) && (pos <= -rad - 2 || pos > +rad);
     }
@@ -115,21 +115,20 @@ Rest::glyph_name (Grob *me, int balltype, String style, bool try_ledgers)
          + actual_style);
 }
 
-
 MAKE_SCHEME_CALLBACK (Rest, print, 1);
 
 SCM
 Rest::brew_internal_stencil (SCM smob, bool ledgered)
 {
-  Grobme = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   SCM balltype_scm = me->get_property ("duration-log");
   if (!scm_is_number (balltype_scm))
     return Stencil ().smobbed_copy ();
 
   int balltype = scm_to_int (balltype_scm);
-  
-  String style; 
+
+  String style;
   SCM style_scm = me->get_property ("style");
   if (scm_is_symbol (style_scm))
     style = ly_scm2string (scm_symbol_to_string (style_scm));
@@ -143,8 +142,8 @@ Rest::brew_internal_stencil (SCM smob, bool ledgered)
   return out.smobbed_copy ();
 }
 
-SCM 
-Rest::print (SCM smob) 
+SCM
+Rest::print (SCM smob)
 {
   return brew_internal_stencil (smob, true);
 }
@@ -165,7 +164,7 @@ Rest::extent_callback (SCM smob, SCM ax)
 
     consequence: we get too small extents and potential collisions
     with ledgered rests.
-   */
+  */
   SCM m = brew_internal_stencil (smob, a != X_AXIS);
   return ly_interval2scm (unsmob_stencil (m)->extent (a));
 }
@@ -174,12 +173,12 @@ MAKE_SCHEME_CALLBACK (Rest, polyphonic_offset_callback, 2);
 SCM
 Rest::polyphonic_offset_callback (SCM smob, SCM)
 {
-  Grobme = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
   if (scm_is_number (me->get_property ("staff-position")))
     return scm_make_real (0);
 
   Direction d = get_grob_direction (me);
-  Real off = 2 * d ;
+  Real off = 2 * d;
   if (off)
     off *= Staff_symbol_referencer::staff_space (me);
 
@@ -187,6 +186,6 @@ Rest::polyphonic_offset_callback (SCM smob, SCM)
 }
 
 ADD_INTERFACE (Rest, "rest-interface",
-  "A rest symbol.",
-  "style direction minimum-distance");
+              "A rest symbol.",
+              "style direction minimum-distance");
 
index f095ef8e1e069d176fa32f54db56b3385a7b37c1..934e25b9dd97f4f54eee0c0282cef58e168922a6 100644 (file)
@@ -19,7 +19,7 @@
 
   It also generates spacing objects.  Originally, we have tried to
   have the spacing functionality at different levels.
-  
+
   - by simply using the sequence of Separation-item as
   spacing-sequences (at staff level). Unfortunately, this fucks up if
   there are different kinds of tuplets in different voices (8th and
   spacing engraver don't know where to connect the last note of the
   voice on the right with), but we don't complain about those, and let
   the default spacing do its work.
-
- */
-
+*/
 
 class Rhythmic_column_engraver :public Engraver
 {
   Link_array<Grob> rheads_;
-  Grob * stem_;
-  Grob * note_column_;
-  Grob * dotcol_;
+  Grob *stem_;
+  Grob *note_column_;
+  Grob *dotcol_;
+
+  Grob *last_spacing_;
+  Grob *spacing_;
 
-  Grob * last_spacing_;
-  Grob * spacing_;
-  
   TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver);
 protected:
 
@@ -57,19 +55,16 @@ protected:
   virtual void stop_translation_timestep ();
 };
 
-
-
 Rhythmic_column_engraver::Rhythmic_column_engraver ()
 {
-  spacing_ = 0 ;
+  spacing_ = 0;
   last_spacing_ = 0;
-  
+
   stem_ = 0;
   note_column_ = 0;
   dotcol_ = 0;
 }
 
-
 void
 Rhythmic_column_engraver::process_acknowledged_grobs ()
 {
@@ -83,12 +78,10 @@ Rhythmic_column_engraver::process_acknowledged_grobs ()
          spacing_->set_property ("left-items", scm_cons (note_column_->self_scm (), SCM_EOL));
 
 
-         
-
          if (last_spacing_)
            {
              Pointer_group_interface::add_grob (last_spacing_,
-                                                ly_symbol2scm ("right-items" ),
+                                                ly_symbol2scm ("right-items"),
                                                 note_column_);
            }
 
@@ -102,7 +95,6 @@ Rhythmic_column_engraver::process_acknowledged_grobs ()
       rheads_.set_size (0);
     }
 
-  
   if (note_column_)
     {
       if (dotcol_
@@ -124,9 +116,9 @@ Rhythmic_column_engraver::process_acknowledged_grobs ()
 void
 Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
 {
-  Item * item =  dynamic_cast <Item *> (i.grob_);
+  Item *item = dynamic_cast<Item *> (i.grob_);
   if (!item || item->get_parent (X_AXIS))
-    return ; 
+    return;
   if (Stem::has_interface (item))
     {
       stem_ = item;
@@ -144,24 +136,22 @@ Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
 void
 Rhythmic_column_engraver::stop_translation_timestep ()
 {
-      note_column_ = 0;
+  note_column_ = 0;
 
   if (spacing_)
     {
       last_spacing_ = spacing_;
       spacing_ = 0;
     }
-  
+
   dotcol_ = 0;
   stem_ = 0;
 }
 
-
-
 ADD_TRANSLATOR (Rhythmic_column_engraver,
-/* descr */       "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
-/* creats*/       "NoteColumn NoteSpacing",
-/* accepts */     "",
-/* acks  */      "stem-interface rhythmic-head-interface dot-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
+               /* creats*/ "NoteColumn NoteSpacing",
+               /* accepts */ "",
+               /* acks  */ "stem-interface rhythmic-head-interface dot-column-interface",
+               /* reads */ "",
+               /* write */ "");
index d9abe900101090f061f7333957c730aa40f0d2be..7c177452cf290383e9ee96f6086d596e785ce119 100644 (file)
 #include "staff-symbol-referencer.hh"
 #include "item.hh"
 
-Item*
-Rhythmic_head::get_dots (Grob*me) 
+Item *
+Rhythmic_head::get_dots (Grob *me)
 {
   SCM s = me->get_property ("dot");
   return unsmob_item (s);
 }
 
-Item*
-Rhythmic_head::get_stem (Grob*me) 
+Item *
+Rhythmic_head::get_stem (Grob *me)
 {
   SCM s = me->get_property ("stem");
   return unsmob_item (s);
 }
 
 int
-Rhythmic_head::dot_count (Grob*me) 
+Rhythmic_head::dot_count (Grob *me)
 {
   return get_dots (me)
     ? scm_to_int (get_dots (me)->get_property ("dot-count")) : 0;
 }
 
 void
-Rhythmic_head::set_dots (Grob*me, Item *dot)
+Rhythmic_head::set_dots (Grob *me, Item *dot)
 {
   me->set_property ("dot", dot->self_scm ());
 }
 
 int
-Rhythmic_head::duration_log (Grob*me) 
+Rhythmic_head::duration_log (Grob *me)
 {
   SCM s = me->get_property ("duration-log");
   return scm_is_number (s) ? scm_to_int (s) : 0;
 }
 
 ADD_INTERFACE (Rhythmic_head, "rhythmic-head-interface",
-  "Note head or rest",
-  "dot stem duration-log");
+              "Note head or rest",
+              "dot stem duration-log");
 
index 889429a63e8f0b904bd47b204c78569c1d07e2dc..268c5e737ec4d1873bccdf7e8b2217fa1694ba9c 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   rod.cc -- implement Rod, Column_rod
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "rod.hh"
 
@@ -20,21 +19,21 @@ Rod::Rod ()
   item_drul_[LEFT] = item_drul_[RIGHT] = 0;
 }
 
-
-
 void
 Rod::columnize ()
 {
   if (!item_drul_[LEFT]
       || !item_drul_[RIGHT])
-    return ;
-  
+    return;
+
   Direction d = LEFT;
-  do {
-    Paper_column * pc = item_drul_[d]->get_column ();
-    distance_ += - d * item_drul_[d]->relative_coordinate (pc, X_AXIS);
-    item_drul_[d] = pc;
-  } while ((flip (&d))!= LEFT);
+  do
+    {
+      Paper_column *pc = item_drul_[d]->get_column ();
+      distance_ += -d * item_drul_[d]->relative_coordinate (pc, X_AXIS);
+      item_drul_[d] = pc;
+    }
+  while ((flip (&d))!= LEFT);
 
 }
 
index 45845fc7e6ab36201ea079bfefc376f213657843..2e21757f4ca6f8181befa205cb38d5a99049b623 100644 (file)
@@ -14,7 +14,7 @@
 
 /*
   Return: number of objects.
- */
+*/
 int
 copy_scm_hashes (SCM dest, SCM src)
 {
@@ -25,10 +25,9 @@ copy_scm_hashes (SCM dest, SCM src)
        scm_hashq_set_x (dest, scm_caar (s), scm_cdar (s));
        k++;
       }
-  return k ;
+  return k;
 }
 
-
 Scheme_hash_table::Scheme_hash_table ()
 {
   hash_tab_ = SCM_EOL;
@@ -37,7 +36,6 @@ Scheme_hash_table::Scheme_hash_table ()
   elt_count_ = 0;
 }
 
-
 Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src)
 
 {
@@ -45,12 +43,12 @@ Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src)
   elt_count_ = 0;
   smobify_self ();
 
-  hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11 ), SCM_EOL);
+  hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11), SCM_EOL);
   elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_);
 }
 
 void
-Scheme_hash_table::operator = (Scheme_hash_table const & src)
+Scheme_hash_table::operator= (Scheme_hash_table const &src)
 {
   if (&src == this)
     return;
@@ -66,7 +64,7 @@ Scheme_hash_table::~Scheme_hash_table ()
 SCM
 Scheme_hash_table::mark_smob (SCM s)
 {
-  Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s);
+  Scheme_hash_table *me = (Scheme_hash_table *) SCM_CELL_WORD_1 (s);
   scm_gc_mark (me->hash_tab_);
   return SCM_EOL;
 }
@@ -77,7 +75,7 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*)
   assert (unsmob (s));
   char str[1000];
   sprintf (str, "#<Scheme_hash_table 0x%0lx ", SCM_UNPACK (s));
-  Scheme_hash_table *me = (Scheme_hash_table*) SCM_CELL_WORD_1 (s);
+  Scheme_hash_table *me = (Scheme_hash_table *) SCM_CELL_WORD_1 (s);
   scm_display (me->hash_tab_, p);
   scm_puts ("> ", p);
   return 1;
@@ -117,7 +115,7 @@ Scheme_hash_table::set (SCM k, SCM v)
   */
   if (elt_count_ > 2 * scm_c_vector_length (hash_tab_))
     {
-      SCM nh = scm_make_vector (scm_int2num (3* elt_count_+1), SCM_EOL);
+      SCM nh = scm_make_vector (scm_int2num (3* elt_count_ + 1), SCM_EOL);
       elt_count_ = copy_scm_hashes (nh, hash_tab_);
       hash_tab_ = nh;
     }
@@ -129,7 +127,7 @@ Scheme_hash_table::get (SCM k) const
 {
   /*
     42 will stick out like a sore thumb, hopefully.
-   */
+  */
   return scm_hashq_ref (hash_tab_, k, scm_from_int (42));
 }
 
index 7ac4df60a72a88bcf240a6a86faf4d25e4f7681c..d83645137390b6f09649dc7164f9ee2f4e95bc93 100644 (file)
@@ -4,8 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+*/
 
 #include "scm-option.hh"
 
   preferably, also dont use TESTING_LEVEL_GLOBAL, since it defeats
   another purpose of this very versatile interface, which is to
   support multiple debug/testing options concurrently.
-
- */
-
+*/
 
 /* Write midi as formatted ascii stream? */
 bool midi_debug_global_b;
 
 int preview_resolution_global = 90;
 
-
 /* General purpose testing flag */
 int testing_level_global;
 
 /*
   Backwards compatibility.
- */
+*/
 bool lily_1_8_relative = false;
 bool lily_1_8_compatibility_used = false;
 
 /*
   crash if internally the wrong type is used for a grob property.
- */
+*/
 bool do_internal_type_checking_global;
 
-
 /*
-  What is this function for ? 
- */
+  What is this function for ?
+*/
 LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (SCM),
-                 "Print ly:set-option usage")
+          "Print ly:set-option usage")
 {
-  printf ( _("lilypond -e EXPR means:").to_str0 ());
+  printf (("lilypond -e EXPR means:").to_str0 ());
   puts ("");
   printf (_ ("  Evalute the Scheme EXPR before parsing any .ly files.").to_str0 ());
   puts ("");
   printf (_ ("  Multiple -e options may be given, they will be evaluated sequentially.").to_str0 ());
   puts ("");
-  printf (_("  The function ly:set-option allows for access to some internal variables.").to_str0 ());
+  printf (_ ("  The function ly:set-option allows for access to some internal variables.").to_str0 ());
   puts ("\n");
-  printf (_ ("Usage: lilypond -e \"(ly:set-option SYMBOL VAL)\"").to_str0 ());
+  printf (_ ("Usage: lilypond -e \"(ly:set - option SYMBOL VAL)\"").to_str0 ());
   puts ("\n");
   printf (_ ("Use help as  SYMBOL to get online help.").to_str0 ());
 
@@ -79,31 +74,29 @@ don't timestamp the output
 
 @item -t, --test
 Switch on any experimental features.  Not for general public use.
-
 */
 
-
 LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
-           "Set a global option value.  Supported options include\n"
-"\n"
-"@table @code\n"
-"@item help\n"
-"List all options.\n"
-"@item midi-debug\n"
-"If set to true, generate human readable MIDI\n"
-"@item internal-type-checking\n"
-"Set paranoia for property assignments\n"
-"@item parse-protect\n"
-"If protection is switched on, errors in inline scheme are caught in the parser. \n"
-"If off, GUILE will halt on errors, and give a stack trace. Default is protected evaluation. \n"
-"@item old-relative\n"
-"Relative for simultaneous music functions similar to chord syntax\n"
-"@item new-relative\n"
-"Relative for simultaneous music functions similar to sequential music\n"
-"@end table\n"
-"\n"
-"This function is useful to call from the command line: @code{lilypond -e\n"
-"\"(ly:set-option 'midi-debug #t)\"}.\n")
+          "Set a global option value.  Supported options include\n"
+          "\n"
+          "@table @code\n"
+          "@item help\n"
+          "List all options.\n"
+          "@item midi-debug\n"
+          "If set to true, generate human readable MIDI\n"
+          "@item internal-type-checking\n"
+          "Set paranoia for property assignments\n"
+          "@item parse-protect\n"
+          "If protection is switched on, errors in inline scheme are caught in the parser. \n"
+          "If off, GUILE will halt on errors, and give a stack trace. Default is protected evaluation. \n"
+          "@item old-relative\n"
+          "Relative for simultaneous music functions similar to chord syntax\n"
+          "@item new-relative\n"
+          "Relative for simultaneous music functions similar to sequential music\n"
+          "@end table\n"
+          "\n"
+          "This function is useful to call from the command line: @code{lilypond -e\n"
+          "\"(ly:set - option 'midi-debug #t)\"}.\n")
 {
   if (val == SCM_UNDEFINED)
     val = SCM_BOOL_T;
@@ -115,7 +108,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
     midi_debug_global_b = to_boolean (val);
   else if (var == ly_symbol2scm ("testing-level"))
     testing_level_global = scm_to_int (val);
-  else if (var == ly_symbol2scm ("parse-protect" ))
+  else if (var == ly_symbol2scm ("parse-protect"))
     parse_protect_global = to_boolean (val);
   else if (var == ly_symbol2scm ("internal-type-checking"))
     do_internal_type_checking_global = to_boolean (val);
@@ -133,14 +126,14 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
     {
       if (scm_is_symbol (var))
        var = scm_symbol_to_string (var);
-      
+
       warning (_f ("No such internal option: %s", ly_scm2string (var)));
     }
   return SCM_UNSPECIFIED;
 }
 
 LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
-           "Get a global option setting.  Supported options include\n"
+          "Get a global option setting.  Supported options include\n"
           "@table @code\n"
           "@item old-relative-used\n"
           "Report whether old-relative compatibility mode is necessary\n"
@@ -154,16 +147,16 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
           "\n")
 {
   SCM o = SCM_UNSPECIFIED;
-  
+
   if (var == ly_symbol2scm ("safe")) // heavily used; put in front. 
     o = ly_bool2scm (be_safe_global);
-  else  if (var == ly_symbol2scm ("old-relative-used"))
+  else if (var == ly_symbol2scm ("old-relative-used"))
     o = ly_bool2scm (lily_1_8_compatibility_used);
   else if (var == ly_symbol2scm ("old-relative"))
     o = ly_bool2scm (lily_1_8_relative);
   else if (var == ly_symbol2scm ("verbose"))
     o = ly_bool2scm (be_verbose_global);
-  else if ( var == ly_symbol2scm ("resolution"))
+  else if (var == ly_symbol2scm ("resolution"))
     o = scm_from_int (preview_resolution_global);
   else
     {
@@ -171,8 +164,8 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
        var = scm_symbol_to_string (var);
 
       String s = ly_scm2string (var);
-      
-      warning (_f ("No such internal option: %s", s.to_str0() ));
+
+      warning (_f ("No such internal option: %s", s.to_str0 ()));
     }
   return o;
 }
index 4b496db1878758e67a0f20d66396c7b666e11876..c89469d8f9a6d0370004b59e71fc1935a99b7027 100644 (file)
@@ -1,8 +1,8 @@
 /*
   score-context.cc -- implement Score_context
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
@@ -13,8 +13,8 @@
 void
 Score_context::prepare (Moment w)
 {
-  Translator*  t = implementation ();
-  Score_translator * s = dynamic_cast<Score_translator *> (t);
+  Translator *t = implementation ();
+  Score_translator *s = dynamic_cast<Score_translator *> (t);
 
   s->prepare (w);
 }
@@ -22,8 +22,8 @@ Score_context::prepare (Moment w)
 void
 Score_context::finish ()
 {
-  Translator*  t = implementation ();
-  Score_translator * s = dynamic_cast<Score_translator *> (t);
+  Translator *t = implementation ();
+  Score_translator *s = dynamic_cast<Score_translator *> (t);
 
   s->finish ();
 }
@@ -31,12 +31,12 @@ Score_context::finish ()
 void
 Score_context::one_time_step ()
 {
-  Translator*  t = implementation ();
-  Score_translator * s = dynamic_cast<Score_translator *> (t);
+  Translator *t = implementation ();
+  Score_translator *s = dynamic_cast<Score_translator *> (t);
   s->one_time_step ();
 }
 
-Music_output*
+Music_output *
 Score_context::get_output ()
 {
   Translator *t = implementation ();
@@ -44,7 +44,6 @@ Score_context::get_output ()
   return s->get_output ();
 }
 
-
 Score_context::Score_context (Object_key const *key)
   : Context (key)
 {
index 19693e99f96fb909cc48cc8686a51576f1177a64..f7cba549b26c9e35e1d0e3c39f67e41444ee1ea1 100644 (file)
@@ -24,7 +24,7 @@
 
 /*
   TODO: the column creation logic is rather hairy. Revise it.
- */
+*/
 Score_engraver::Score_engraver ()
 {
   system_ = 0;
@@ -39,25 +39,24 @@ Score_engraver::make_columns ()
 {
   /*
     ugh.
-   */
+  */
   if (!command_column_)
     {
       SCM nmp
        = updated_grob_properties (context (),
                                   ly_symbol2scm ("NonMusicalPaperColumn"));
 
-      Object_key const *key1 = context()->get_grob_key ("NonMusicalPaperColumn");
-      
+      Object_key const *key1 = context ()->get_grob_key ("NonMusicalPaperColumn");
+
       SCM pc = updated_grob_properties (context (),
                                        ly_symbol2scm ("PaperColumn"));
-      Object_key const *key2 = context()->get_grob_key ("PaperColumn");      
+      Object_key const *key2 = context ()->get_grob_key ("PaperColumn");
       set_columns (new Paper_column (nmp, key1), new Paper_column (pc, key2));
 
-
       Grob_info i1;
       i1.grob_ = command_column_;
       i1.origin_trans_ = this;
-  
+
       announce_grob (i1);
 
       Grob_info i2;
@@ -73,7 +72,7 @@ Score_engraver::prepare (Moment m)
 {
   /*
     TODO: don't make columns when skipTypesetting is true.
-   */
+  */
   make_columns ();
 
   SCM w = m.smobbed_copy ();
@@ -96,7 +95,7 @@ Score_engraver::finish ()
 
 /*
   use start/finish?
- */
+*/
 void
 Score_engraver::initialize ()
 {
@@ -107,19 +106,19 @@ Score_engraver::initialize ()
             + "\n"
             + _ ("Music font has not been installed properly.")
             + "\n"
-            + _f ("Search path `%s'", global_path.to_string ().to_str0())
+            + _f ("Search path `%s'", global_path.to_string ().to_str0 ())
             + "\n"
-            + _ ("Aborting"));       
+            + _ ("Aborting"));
     }
 
   pscore_ = new Paper_score;
-  pscore_->layout_ = dynamic_cast<Output_def*> (get_output_def ());
+  pscore_->layout_ = dynamic_cast<Output_def *> (get_output_def ());
 
   SCM props = updated_grob_properties (context (), ly_symbol2scm ("System"));
 
-  Object_key const *sys_key = context()->get_grob_key ("System");
+  Object_key const *sys_key = context ()->get_grob_key ("System");
   pscore_->typeset_line (new System (props, sys_key));
-  
+
   system_ = pscore_->system_;
   make_columns ();
   system_->set_bound (LEFT, command_column_);
@@ -128,30 +127,28 @@ Score_engraver::initialize ()
   Engraver_group_engraver::initialize ();
 }
 
-
 void
 Score_engraver::finalize ()
 {
   Score_translator::finalize ();
 
-  Grob * cc
+  Grob *cc
     = unsmob_grob (get_property ("currentCommandColumn"));
   system_->set_bound (RIGHT, cc);
   cc->set_property ("breakable", SCM_BOOL_T);
-  
+
   typeset_all ();
 }
 
-
 void
 Score_engraver::one_time_step ()
 {
   if (!to_boolean (get_property ("skipTypesetting")))
     {
       recurse_over_translators (context (), &Engraver::process_music, UP);
-      Engraver_group_engraver::do_announces();
+      Engraver_group_engraver::do_announces ();
     }
-  
+
   recurse_over_translators (context (), &Translator::stop_translation_timestep, UP);
 }
 
@@ -163,23 +160,19 @@ Score_engraver::announce_grob (Grob_info info)
   elems_.push (info.grob_);
 }
 
-
 void
 Score_engraver::typeset_all ()
 {
-  for (int i = 0; i < elems_.size (); i++) 
+  for (int i = 0; i < elems_.size (); i++)
     {
-      Grob * elem = elems_[i];
+      Grob *elem = elems_[i];
 
-      
-      if (dynamic_cast<Item*> (elem)) 
+      if (dynamic_cast<Item *> (elem))
        {
-         if (
-             (!elem->get_parent (X_AXIS)
-              || !unsmob_grob  (elem->get_property ("axis-group-parent-X")))
+         if ((!elem->get_parent (X_AXIS)
+              || !unsmob_grob (elem->get_property ("axis-group-parent-X")))
              && elem != command_column_
-             && elem != musical_column_
-             )
+             && elem != musical_column_)
            {
              bool br = to_boolean (elem->get_property ("breakable"));
              Axis_group_interface::add_element (br ? command_column_ : musical_column_, elem);
@@ -197,22 +190,21 @@ Score_engraver::stop_translation_timestep ()
 {
   // this generates all items.
   Engraver_group_engraver::stop_translation_timestep ();
-  
+
   typeset_all ();
   if (to_boolean (command_column_->get_property ("breakable")))
     {
-      breaks_ ++;
+      breaks_++;
       if (! (breaks_%8))
        progress_indication ("[" + to_string (breaks_) + "]");
     }
 
-  
   command_column_ = 0;
   musical_column_ = 0;
 }
 
 void
-Score_engraver::set_columns (Paper_column *new_command, 
+Score_engraver::set_columns (Paper_column *new_command,
                             Paper_column *new_musical)
 {
   assert (!command_column_ && !musical_column_);
@@ -221,9 +213,9 @@ Score_engraver::set_columns (Paper_column *new_command,
   musical_column_ = new_musical;
   if (new_command)
     {
-      context ()->set_property ("currentCommandColumn", new_command->self_scm ());  
+      context ()->set_property ("currentCommandColumn", new_command->self_scm ());
     }
-  
+
   if (new_musical)
     {
       context ()->set_property ("currentMusicalColumn", new_musical->self_scm ());
@@ -233,11 +225,11 @@ Score_engraver::set_columns (Paper_column *new_command,
   system_->add_column (musical_column_);
 }
 
-Music_output*
+Music_output *
 Score_engraver::get_output ()
 {
   Music_output *o = pscore_;
-  ///FIXME WTF?  pscore_ = 0;
+  ///FIXME WTF? pscore_ = 0;
   return o;
 }
 
@@ -267,7 +259,7 @@ Score_engraver::try_music (Music *m)
       SCM mpage_pen = m->get_property ("page-penalty");
       if (scm_is_number (mpage_pen))
        total_pp += scm_to_double (mpage_pen);
-      
+
       command_column_->set_property ("page-penalty", scm_make_real (total_pp));
       return true;
     }
@@ -280,7 +272,7 @@ Score_engraver::forbid_breaks ()
   if (command_column_)
     command_column_->set_property ("breakable", SCM_EOL);
 }
-  
+
 void
 Score_engraver::acknowledge_grob (Grob_info gi)
 {
@@ -302,8 +294,8 @@ Score_engraver::acknowledge_grob (Grob_info gi)
     {
       SCM spaceable = get_property ("verticallySpacedContexts");
       Context *orig = gi.origin_contexts (this)[0];
-      
-      if (scm_memq (ly_symbol2scm (orig->context_name ().to_str0()),
+
+      if (scm_memq (ly_symbol2scm (orig->context_name ().to_str0 ()),
                    spaceable) != SCM_BOOL_F)
        {
          Pointer_group_interface::add_grob (system_,
@@ -311,23 +303,20 @@ Score_engraver::acknowledge_grob (Grob_info gi)
                                             gi.grob_);
        }
     }
-  
-}
-
 
+}
 
 ADD_TRANSLATOR (Score_engraver,
-/* descr */       "Top level engraver. Takes care of generating columns and the complete  system (ie. System) "
-"\n\n "
-"This engraver decides whether a column is breakable. The default is "
-"that a column is always breakable. However, when every Bar_engraver "
-"that does not have a barline at a certain point will call "
-"Score_engraver::forbid_breaks to stop linebreaks.  In practice, this "
-"means that you can make a breakpoint by creating a barline (assuming "
-"that there are no beams or notes that prevent a breakpoint.) "
-,
-/* creats*/       "System PaperColumn NonMusicalPaperColumn", 
-/* accepts */     "break-event",
-/* acks  */       "note-spacing-interface staff-spacing-interface axis-group-interface",
-/* reads */       "currentMusicalColumn currentCommandColumn verticallySpacedContexts",
-/* write */       "");
+               /* descr */ "Top level engraver. Takes care of generating columns and the complete  system (ie. System) "
+               "\n\n "
+               "This engraver decides whether a column is breakable. The default is "
+               "that a column is always breakable. However, when every Bar_engraver "
+               "that does not have a barline at a certain point will call "
+               "Score_engraver::forbid_breaks to stop linebreaks.  In practice, this "
+               "means that you can make a breakpoint by creating a barline (assuming "
+               "that there are no beams or notes that prevent a breakpoint.) ",
+               /* creats*/ "System PaperColumn NonMusicalPaperColumn",
+               /* accepts */ "break-event",
+               /* acks  */ "note-spacing-interface staff-spacing-interface axis-group-interface",
+               /* reads */ "currentMusicalColumn currentCommandColumn verticallySpacedContexts",
+               /* write */ "");
index b127d32bdfeee3a4427cea980a3c0cea1bc2110f..31f9ecdade04ba9b4ff72a8c71110e838e665384 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "score-performer.hh"
 
 #include "output-def.hh"
 
 ADD_TRANSLATOR (Score_performer,
-/* descr */       "",
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
-
+               /* descr */ "",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
 
 Score_performer::Score_performer ()
 {
   performance_ = 0;
 }
 
-
 Score_performer::~Score_performer ()
 {
 }
 
 void
-Score_performer::play_element (Audio_element * p)
+Score_performer::play_element (Audio_element *p)
 {
-  if (Audio_item * i = dynamic_cast<Audio_item *> (p)) 
+  if (Audio_item *i = dynamic_cast<Audio_item *> (p))
     {
       audio_column_->add_audio_item (i);
     }
@@ -52,7 +50,7 @@ Score_performer::announce_element (Audio_element_info info)
   announce_infos_.push (info);
 }
 
-void 
+void
 Score_performer::prepare (Moment m)
 {
   audio_column_ = new Audio_column (m);
@@ -65,8 +63,8 @@ Score_performer::finish ()
 {
   recurse_over_translators (context (), &Translator::finalize, UP);
 }
-  
-void 
+
+void
 Score_performer::one_time_step ()
 {
   recurse_over_translators (context (), &Performer::process_music, UP);
@@ -80,11 +78,10 @@ Score_performer::get_tempo () const
   return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
 }
 
-
 Music_output *
 Score_performer::get_output ()
 {
-  Music_output * o = performance_;
+  Music_output *o = performance_;
   performance_ = 0;
   return o;
 }
index d8470132c16b4a3a7d841d08ed7374b9f13851f5..3c7f5c9a274e56e4b3d9ba9d5fd8e3bb04164dcc 100644 (file)
@@ -4,10 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
-
 #include "score.hh"
 #include "music.hh"
 #include "output-def.hh"
@@ -32,19 +30,18 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
           "Run @var{score} through @var{layout}, an output definition, "
           "scaled to correct outputscale already, "
           "return a list of layout-lines. "
-          "\nTake optional Object_key argument."
-          )
+          "\nTake optional Object_key argument.")
 {
-  Score * sc = unsmob_score (score);
+  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;
+  Output_def *score_def = 0;
 
   /* UGR, FIXME, these are default \layout blocks once again.  They
      suck. */
@@ -54,7 +51,7 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
 
   if (!score_def)
     return scm_c_make_vector (0, SCM_EOL);
-      
+
   score_def = score_def->clone ();
   SCM prot = score_def->self_scm ();
   scm_gc_unprotect_object (prot);
@@ -62,11 +59,11 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
   /* TODO: SCORE_DEF should be scaled according to OD->parent_ or OD
      itself. */
   score_def->parent_ = od;
-  
+
   SCM context = ly_run_translator (sc->get_music (), score_def->self_scm (),
                                   key);
   SCM lines = ly_format_output (context, scm_makfrom0str ("<embedded>"));
-  
+
   scm_remember_upto_here_1 (prot);
   return lines;
 }
index 64272aeeb4b86dce98ebb66f3bb5c65ae625a4b7..ceb980d3fb0e749dc8f620a676bdc62dc0373b0f 100644 (file)
@@ -1,10 +1,10 @@
-/*   
+/*
   score-translator.cc -- implement Score_translator
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
- */
+*/
 
 #include "score-translator.hh"
 #include "moment.hh"
@@ -14,7 +14,7 @@ Score_translator::prepare (Moment)
 {
 }
 
-Music_output*
+Music_output *
 Score_translator::get_output ()
 {
   return 0;
index f8747dd660f06d815cacab5043543dd51dbd0aad..e0cb8469a7ae3b4ad63a2d8098d0b9f059a7d84c 100644 (file)
@@ -47,7 +47,7 @@ IMPLEMENT_TYPE_P (Score, "ly:score?");
 SCM
 Score::mark_smob (SCM s)
 {
-  Score *sc = (Score*) SCM_CELL_WORD_1 (s);
+  Score *sc = (Score *) SCM_CELL_WORD_1 (s);
 
   scm_gc_mark (sc->header_);
   scm_gc_mark (sc->texts_);
@@ -57,7 +57,7 @@ Score::mark_smob (SCM s)
 }
 
 int
-Score::print_smob (SCM , SCM p, scm_print_state*)
+Score::print_smob (SCM, SCM p, scm_print_state*)
 {
   scm_puts ("#<Score>", p);
 
@@ -76,7 +76,7 @@ Score::Score (Score const &s)
   Music *m = unsmob_music (s.music_);
   music_ = m ? m->clone ()->self_scm () : SCM_EOL;
   scm_gc_unprotect_object (music_);
-  
+
   for (int i = 0, n = s.defs_.size (); i < n; i++)
     defs_.push (s.defs_[i]->clone ());
 
@@ -87,7 +87,6 @@ Score::Score (Score const &s)
   texts_ = s.texts_;
 }
 
-
 void
 default_rendering (SCM music, SCM outdef,
                   SCM book_outputdef,
@@ -97,27 +96,27 @@ default_rendering (SCM music, SCM outdef,
 {
   SCM scaled_def = outdef;
   SCM scaled_bookdef = book_outputdef;
-  
+
   Output_def *bpd = unsmob_output_def (book_outputdef);
 
   /* ugh.  */
   if (bpd->c_variable ("is-paper") == SCM_BOOL_T)
     {
       Real scale = scm_to_double (bpd->c_variable ("outputscale"));
-      
+
       Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
       scaled_def = def->self_scm ();
 
       scaled_bookdef = scale_output_def (bpd, scale)->self_scm ();
       unsmob_output_def (scaled_def)->parent_
        = unsmob_output_def (scaled_bookdef);
-      
+
       scm_gc_unprotect_object (scaled_bookdef);
       scm_gc_unprotect_object (scaled_def);
     }
-  
+
   SCM context = ly_run_translator (music, scaled_def, key);
-  if (Global_context *g = dynamic_cast<Global_context*>
+  if (Global_context *g = dynamic_cast<Global_context *>
       (unsmob_context (context)))
     {
       SCM systems = ly_format_output (context, outname);
@@ -144,11 +143,10 @@ default_rendering (SCM music, SCM outdef,
 }
 
 /*
-Format score, return systems. OUTNAME is still passed to create a midi
-file.
-
-LAYOUTBOOK should be scaled already.
+  Format score, return systems. OUTNAME is still passed to create a midi
+  file.
 
+  LAYOUTBOOK should be scaled already.
 */
 SCM
 Score::book_rendering (String outname,
@@ -158,21 +156,21 @@ Score::book_rendering (String outname,
 {
   if (error_found_)
     return SCM_EOL;
-   
+
   SCM scaled_bookdef = SCM_EOL;
   Real scale = 1.0;
 
   if (layoutbook && layoutbook->c_variable ("is-paper") == SCM_BOOL_T)
     scale = scm_to_double (layoutbook->c_variable ("outputscale"));
-  
+
   SCM out = scm_makfrom0str (outname.to_str0 ());
   SCM systems = SCM_EOL;
   int outdef_count = defs_.size ();
 
-  Object_key * key = new Lilypond_general_key (book_key, user_key_, 0);
-  SCM scm_key = key->self_scm();
+  Object_key *key = new Lilypond_general_key (book_key, user_key_, 0);
+  SCM scm_key = key->self_scm ();
   scm_gc_unprotect_object (scm_key);
-  
+
   for (int i = 0; !i || i < outdef_count; i++)
     {
       Output_def *def = outdef_count ? defs_[i] : default_def;
@@ -187,7 +185,7 @@ Score::book_rendering (String outname,
 
       /* TODO: fix or junk --no-layout.  */
       SCM context = ly_run_translator (music_, def->self_scm (), scm_key);
-      if (dynamic_cast<Global_context*> (unsmob_context (context)))
+      if (dynamic_cast<Global_context *> (unsmob_context (context)))
        {
          SCM s = ly_format_output (context, out);
          if (s != SCM_UNDEFINED)
@@ -203,9 +201,6 @@ Score::book_rendering (String outname,
 }
 
 
-
-
-
 void
 Score::set_music (SCM music, SCM parser)
 {
@@ -216,20 +211,20 @@ Score::set_music (SCM music, SCM parser)
 
   if (unsmob_music (music_))
     {
-      unsmob_music (music)->origin ()->error (_("Already have music in score"));
-      unsmob_music (music_)->origin ()->error (_("This is the previous music"));
+      unsmob_music (music)->origin ()->error (_ ("Already have music in score"));
+      unsmob_music (music_)->origin ()->error (_ ("This is the previous music"));
     }
-  Music * m = unsmob_music (music);
+  Music *m = unsmob_music (music);
   if (m && to_boolean (m->get_property ("error-found")))
     {
-      m->origin()->error (_("Error found in this music expression. Ignoring it"));
-      
+      m->origin ()->error (_ ("Error found in this music expression. Ignoring it"));
+
       this->error_found_ = this->error_found_ || to_boolean (m->get_property ("error-found"));
-      
+
     }
 
   if (this->error_found_)
-    this->music_ = SCM_EOL; 
+    this->music_ = SCM_EOL;
   else
     this->music_ = music;
 
index 4cb617443974a9a22d50d25112d4a31a36a10d1b..5395e4c3b4f53dcdd92ddc63100a457f882c7506 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   script-column-engraver.cc -- implement Script_column_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "script-column.hh"
@@ -27,7 +26,6 @@ protected:
   virtual void stop_translation_timestep ();
 };
 
-
 Script_column_engraver::Script_column_engraver ()
 {
   scol_ = 0;
@@ -41,9 +39,9 @@ Script_column_engraver::stop_translation_timestep ()
 }
 
 void
-Script_column_engraver::acknowledge_grob (Grob_info inf) 
+Script_column_engraver::acknowledge_grob (Grob_info inf)
 {
-  Item *thing = dynamic_cast<Item*> (inf.grob_);
+  Item *thing = dynamic_cast<Item *> (inf.grob_);
   if (thing && Side_position_interface::has_interface (inf.grob_)) // ugh FIXME
     {
       if (!Item::is_breakable (thing)
@@ -60,7 +58,7 @@ Script_column_engraver::process_acknowledged_grobs ()
   if (!scol_ && scripts_.size () > 1)
     {
       scol_ = make_item ("ScriptColumn", SCM_EOL);
-      
+
     }
 
   if (scol_)
@@ -73,9 +71,9 @@ Script_column_engraver::process_acknowledged_grobs ()
 }
 
 ADD_TRANSLATOR (Script_column_engraver,
-/* descr */       "",
-/* creats*/       "ScriptColumn",
-/* accepts */     "",
-/* acks  */      "side-position-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "ScriptColumn",
+               /* accepts */ "",
+               /* acks  */ "side-position-interface",
+               /* reads */ "",
+               /* write */ "");
index b19952774093a413232b863bfb52df03214c7080..37051bd6a477635116c2ef05d90d1678d703e587 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   script-column.cc -- implement Script_column
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "script-column.hh"
 
@@ -20,14 +19,14 @@ Script_column::add_staff_sided (Grob *me, Item *i)
   if (!scm_is_number (p))
     return;
 
-  Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i);
-  
+  Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), i);
+
   me->add_dependency (i);
 }
 
 LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less",
-         2, 0, 0, (SCM a, SCM b),
-         "Compare two grobs by script priority. For internal use.")
+          2, 0, 0, (SCM a, SCM b),
+          "Compare two grobs by script priority. For internal use.")
 {
   Grob *i1 = unsmob_grob (a);
   Grob *i2 = unsmob_grob (b);
@@ -42,33 +41,33 @@ MAKE_SCHEME_CALLBACK (Script_column, before_line_breaking, 1);
 SCM
 Script_column::before_line_breaking (SCM smob)
 {
-  Grobme = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
   Drul_array<SCM> scripts (SCM_EOL, SCM_EOL);
   Link_array<Grob> staff_sided;
-  
+
   for (SCM s = me->get_property ("scripts"); scm_is_pair (s); s = scm_cdr (s))
     {
       Grob *sc = unsmob_grob (scm_car (s));
 
       /*
        Don't want to consider scripts horizontally next to notes.
-       */
+      */
       if (!sc->has_offset_callback (Side_position_interface::aligned_side_proc,
                                    X_AXIS))
        staff_sided.push (sc);
     }
-  
+
   for (int i = 0; i < staff_sided.size (); i++)
     {
-      Grobg = staff_sided[i];
+      Grob *g = staff_sided[i];
       Direction d = Side_position_interface::get_direction (g);
       if (!d)
        {
-         programming_error ( "No direction for script?");
+         programming_error ("No direction for script?");
          d = DOWN;
          g->set_property ("direction", scm_int2num (d));
        }
-      
+
       scripts[d] = scm_cons (g->self_scm (), scripts[d]);
     }
 
@@ -77,23 +76,24 @@ Script_column::before_line_breaking (SCM smob)
     {
       SCM ss = scm_reverse_x (scripts[d], SCM_EOL);
       ss = scm_stable_sort_x (ss, ly_grob_script_priority_less_proc);
-      
-      Grob * last = 0;
+
+      Grob *last = 0;
       for (SCM s = ss; scm_is_pair (s); s = scm_cdr (s))
        {
          Grob *g = unsmob_grob (scm_car (s));
          if (last)
-           Side_position_interface::add_support (g,last);
-         
+           Side_position_interface::add_support (g, last);
+
          last = g;
        }
-      
-    } while (flip (&d) != DOWN);
+
+    }
+  while (flip (&d) != DOWN);
 
   return SCM_UNSPECIFIED;
 }
 
-ADD_INTERFACE (Script_column,"script-column-interface",
+ADD_INTERFACE (Script_column, "script-column-interface",
               "An interface that sorts scripts "
               "according to their @code{script-priority}",
               "");
index 1afa849ebdeea9cbe58d996541326cf6326b499c..f393128911d0954a8aec55a7108540a2c23ba206 100644 (file)
@@ -38,7 +38,7 @@ class Script_engraver : public Engraver
   Spanner *slur_;
 
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void process_music ();
   virtual void acknowledge_grob (Grob_info);
@@ -87,9 +87,8 @@ copy_property (Grob *g, SCM sym, SCM alist)
 /* Add the properties, one by one for each Script.  A little memory
    could be saved by tacking the props onto the Script grob (i.e. make
    ScriptStaccato , ScriptMarcato, etc. ).
-
 */
-void make_script_from_event (Grob *p, bool * follow, Context *tg,
+void make_script_from_event (Grob *p, bool *follow, Context *tg,
                             SCM art_type, int index)
 {
   SCM alist = tg->get_property ("scriptDefinitions");
@@ -110,15 +109,15 @@ void make_script_from_event (Grob *p, bool * follow, Context *tg,
                              art);
 
   *follow = scm_is_pair (follow_scm) && to_boolean (scm_cdr (follow_scm));
-  bool priority_found = false ; 
-    
-  for (SCM s = art ; scm_is_pair (s); s = scm_cdr (s))
+  bool priority_found = false;
+
+  for (SCM s = art; scm_is_pair (s); s = scm_cdr (s))
     {
       SCM sym = scm_caar (s);
       SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?"));
       if (!ly_c_procedure_p (type))
        continue;
-      
+
       SCM val = scm_cdar (s);
 
       if (sym == ly_symbol2scm ("script-priority"))
@@ -127,9 +126,8 @@ void make_script_from_event (Grob *p, bool * follow, Context *tg,
          /* Make sure they're in order of user input by adding index i.
             Don't use the direction in this priority. Smaller means closer
             to the head.  */
-         int prio  = scm_to_int (val) +  index;
-         
-        
+         int prio = scm_to_int (val) + index;
+
          val = scm_int2num (prio);
        }
       if (p->internal_get_property (sym) == SCM_EOL)
@@ -141,7 +139,7 @@ void make_script_from_event (Grob *p, bool * follow, Context *tg,
       p->set_property ("script-priority",
                       scm_int2num (index));
     }
-  
+
   Side_position_interface::set_axis (p, Y_AXIS);
 
 }
@@ -192,7 +190,7 @@ Script_engraver::acknowledge_grob (Grob_info info)
       for (int i = 0; i < script_count; i++)
        {
          Grob *e = scripts_[i].script_;
-       
+
          if (Side_position_interface::get_axis (e) == X_AXIS
              && !e->get_parent (Y_AXIS))
            {
@@ -205,11 +203,11 @@ Script_engraver::acknowledge_grob (Grob_info info)
   else if (Note_column::has_interface (info.grob_))
     {
       /* Make note column the parent of the script.  That is not
-       correct, but due to seconds in a chord, noteheads may be
-       swapped around horizontally.
+        correct, but due to seconds in a chord, noteheads may be
+        swapped around horizontally.
 
-       As the note head to put it on is not known now, postpone this
-       decision to Script_interface::before_line_breaking ().  */
+        As the note head to put it on is not known now, postpone this
+        decision to Script_interface::before_line_breaking ().  */
       for (int i = 0; i < script_count; i++)
        {
          Grob *e = scripts_[i].script_;
@@ -220,7 +218,7 @@ Script_engraver::acknowledge_grob (Grob_info info)
        }
     }
   else if (Slur::has_interface (info.grob_))
-    slur_ = dynamic_cast<Spanner*> (info.grob_);
+    slur_ = dynamic_cast<Spanner *> (info.grob_);
 }
 
 void
@@ -235,15 +233,15 @@ Script_engraver::stop_translation_timestep ()
                                 ::quantised_position_proc, Y_AXIS);
        sc->set_property ("staff-padding", SCM_EOL);
       }
-  
+
   scripts_.clear ();
 }
 
 ADD_TRANSLATOR (Script_engraver,
-/* descr */       "Handles note scripted articulations.",
-/* creats*/       "Script",
-/* accepts */     "script-event articulation-event",
-/* acks  */       "stem-interface rhythmic-head-interface " 
-                 "slur-interface note-column-interface",
-/* reads */       "scriptDefinitions",
-/* write */       "");
+               /* descr */ "Handles note scripted articulations.",
+               /* creats*/ "Script",
+               /* accepts */ "script-event articulation-event",
+               /* acks  */ "stem-interface rhythmic-head-interface "
+               "slur-interface note-column-interface",
+               /* reads */ "scriptDefinitions",
+               /* write */ "");
index fd42a76b184b79cefb6080fc140818a8e68babca..f2dcbea2c8d6ea0bb5925b71422deaeb80f414e6 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   script-interface.cc -- implement Script_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "directional-element-interface.hh"
 #include "warn.hh"
@@ -85,18 +84,17 @@ Script_interface::print (SCM smob)
 
 struct Text_script
 {
-  static bool has_interface (Grob*);
+  static bool has_interface (Grob *);
 };
 
 ADD_INTERFACE (Text_script, "text-script-interface",
-  "An object that is put above or below a note",
-  "add-stem-support slur script-priority inside-slur");
-
+              "An object that is put above or below a note",
+              "add-stem-support slur script-priority inside-slur");
 
 /*
   Hmm. Where should we put add-stem-support ?
- */
+*/
 ADD_INTERFACE (Script_interface, "script-interface",
-  "An object that is put above or below a note",
-  "add-stem-support slur-padding slur script-priority script-stencil inside-slur");
+              "An object that is put above or below a note",
+              "add-stem-support slur-padding slur script-priority script-stencil inside-slur");
 
index b4d4c77b150dd7249d777a4bf72df42e698c7307..de672c36f7ec624d96989aca1f6c23c43f163527 100644 (file)
@@ -1,8 +1,8 @@
 /*
   self-alignment-interface.cc
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
@@ -19,8 +19,8 @@ Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis)
   Axis a = (Axis) scm_to_int (axis);
   Grob *him = me->get_parent (a);
   Interval he = him->extent (him, a);
-  
-  return  scm_make_real (he.is_empty () ? 0.0 : he.center ());
+
+  return scm_make_real (he.is_empty () ? 0.0 : he.center ());
 }
 
 MAKE_SCHEME_CALLBACK (Self_alignment_interface, aligned_on_parent, 2);
@@ -31,7 +31,7 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
   Axis a = (Axis) scm_to_int (axis);
   Grob *him = me->get_parent (a);
   Interval he = him->extent (him, a);
-  
+
   SCM sym = (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X")
     : ly_symbol2scm ("self-alignment-Y");
   SCM align_prop (me->internal_get_property (sym));
@@ -41,12 +41,12 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
 
   Real x = 0.0;
   Real align = scm_to_double (align_prop);
-      
+
   Interval ext (me->extent (me, a));
   if (ext.is_empty ())
     programming_error ("I'm empty. Can't align on self");
   else
-    x -= ext.linear_combination (align) ;
+    x -= ext.linear_combination (align);
 
   if (!he.is_empty ())
     x += he.linear_combination (align);
@@ -57,15 +57,15 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
 /* Position centered on parent. */
 MAKE_SCHEME_CALLBACK (Self_alignment_interface, centered_on_other_axis_parent, 2);
 SCM
-Self_alignment_interface::centered_on_other_axis_parent (SCM element_smob, 
+Self_alignment_interface::centered_on_other_axis_parent (SCM element_smob,
                                                         SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) scm_to_int (axis);
   Grob *him = me->get_parent (other_axis (a));
   Interval he = him->extent (him, a);
-  
-  return  scm_make_real (he.is_empty () ? 0.0 : he.center ());
+
+  return scm_make_real (he.is_empty () ? 0.0 : he.center ());
 }
 
 /** callback that centers the element on itself
@@ -79,7 +79,7 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
 
   SCM sym = (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X")
     : ly_symbol2scm ("self-alignment-Y");
-  
+
   SCM align (me->internal_get_property (sym));
   if (scm_is_number (align))
     {
@@ -92,7 +92,6 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
   return scm_make_real (0.0);
 }
 
-
 ADD_INTERFACE (Self_alignment_interface, "self-alignment-interface",
               "Position this object on itself and/or on its parent. To this end, the following functions "
               " are provided: \n"
@@ -106,6 +105,6 @@ ADD_INTERFACE (Self_alignment_interface, "self-alignment-interface",
               " extent of the parent \n"
               "@item Self_alignment_interface::centered_on_other_axis_parent\n"
               " For X-axis, center on the Y-parent, and vice versa.\n "
-              "@end table\n", 
+              "@end table\n",
               "self-alignment-X self-alignment-Y");
 
index 7481ee0684135df1eaed9d8e70e2de26b1906454..8192ea7bccd1a6e372140ce660423fa5b3bda9c4 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   separating-group-spanner.cc -- implement Separating_group_spanner
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "separating-group-spanner.hh"
 
@@ -16,7 +15,7 @@
 #include "group-interface.hh"
 
 void
-Separating_group_spanner::find_rods (Item * r, SCM next, Real padding)
+Separating_group_spanner::find_rods (Item *r, SCM next, Real padding)
 {
 
   /*
@@ -26,12 +25,11 @@ Separating_group_spanner::find_rods (Item * r, SCM next, Real padding)
     NEXT, making it linear in most of the cases.
   */
   if (Separation_item::width (r).is_empty ())
-    return; 
-
+    return;
 
   for (; scm_is_pair (next); next = scm_cdr (next))
     {
-      Item *l = dynamic_cast<Item*> (unsmob_grob (scm_car ( next)));
+      Item *l = dynamic_cast<Item *> (unsmob_grob (scm_car (next)));
       Item *lb = l->find_prebroken_piece (RIGHT);
 
       if (lb)
@@ -60,7 +58,7 @@ Separating_group_spanner::find_rods (Item * r, SCM next, Real padding)
          rod.item_drul_[RIGHT]= r;
 
          rod.distance_ = li[RIGHT] - ri[LEFT] + padding;
-       
+
          rod.add_to_cols ();
          break;
        }
@@ -77,18 +75,18 @@ MAKE_SCHEME_CALLBACK (Separating_group_spanner, set_spacing_rods, 1);
 SCM
 Separating_group_spanner::set_spacing_rods (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   /*
     Ugh: padding is added doubly, also for SeparationItem
-   */
+  */
   Real padding = robust_scm2double (me->get_property ("padding"), 0.1);
-  
+
   for (SCM s = me->get_property ("elements"); scm_is_pair (s) && scm_is_pair (scm_cdr (s)); s = scm_cdr (s))
     {
       /*
        Order of elements is reversed!
-       */
+      */
       SCM elt = scm_car (s);
       Item *r = unsmob_item (elt);
 
@@ -96,27 +94,24 @@ Separating_group_spanner::set_spacing_rods (SCM smob)
        continue;
 
       Item *rb
-       = dynamic_cast<Item*> (r->find_prebroken_piece (LEFT));
-      
+       = dynamic_cast<Item *> (r->find_prebroken_piece (LEFT));
+
       find_rods (r, scm_cdr (s), padding);
       if (rb)
        find_rods (rb, scm_cdr (s), padding);
     }
 
-  return SCM_UNSPECIFIED ;
+  return SCM_UNSPECIFIED;
 }
 
 void
-Separating_group_spanner::add_spacing_unit (Grob* me , Item*i)
+Separating_group_spanner::add_spacing_unit (Grob *me, Item *i)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), i);
   me->add_dependency (i);
 }
 
 
-
-
-
 ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface",
               "A spanner that calculates spacing constraints (\"rods\") "
               "using the @code{separation-item-interface} grobs in @code{elements}.",
index 7690c8812dd8f41d3f5e0575b12a5233eeb43225..9d95c17f3919080894ee9f057b55389bf346de35 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-'  separating-line-group-engraver.cc -- implement Separating_line_group_engraver
-  
+/*
+  '  separating-line-group-engraver.cc -- implement Separating_line_group_engraver
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "separating-group-spanner.hh"
 #include "separation-item.hh"
@@ -19,7 +18,7 @@
 
 struct Spacings
 {
-  Item * staff_spacing_;
+  Item *staff_spacing_;
   Link_array<Item> note_spacings_;
 
   Spacings ()
@@ -29,32 +28,32 @@ struct Spacings
 
   bool is_empty () const
   {
-    return !staff_spacing_ && !note_spacings_.size (); 
+    return !staff_spacing_ && !note_spacings_.size ();
   }
-  void clear () {
+  void clear ()
+  {
     staff_spacing_ = 0;
     note_spacings_.clear ();
   }
 };
 
-
 class Separating_line_group_engraver : public Engraver
 {
 protected:
-  Item * break_item_;
-  Item * musical_item_;
-  Item * last_musical_item_;
+  Item *break_item_;
+  Item *musical_item_;
+  Item *last_musical_item_;
 
   Spacings current_spacings_;
   Spacings last_spacings_;
-  
-  Spanner * sep_span_;
-  
+
+  Spanner *sep_span_;
+
   virtual void acknowledge_grob (Grob_info);
   virtual void process_music ();
   virtual void finalize ();
   virtual void stop_translation_timestep ();
-  virtual void start_translation_timestep ();  
+  virtual void start_translation_timestep ();
 public:
   TRANSLATOR_DECLARATIONS (Separating_line_group_engraver);
 };
@@ -74,7 +73,6 @@ Separating_line_group_engraver::process_music ()
     {
       sep_span_ = make_spanner ("SeparatingGroupSpanner", SCM_EOL);
 
-      
       sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
     }
 }
@@ -82,23 +80,23 @@ void
 Separating_line_group_engraver::finalize ()
 {
   if (!sep_span_)
-    return ;
-  
+    return;
+
   SCM ccol = get_property ("currentCommandColumn");
   Grob *column = unsmob_grob (ccol);
-  
+
   sep_span_->set_bound (RIGHT, unsmob_grob (ccol));
   sep_span_ = 0;
 
-  for  (int i = 0 ; i < last_spacings_.note_spacings_.size (); i++)
+  for (int i = 0; i < last_spacings_.note_spacings_.size (); i++)
     {
       Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
-                                        ly_symbol2scm ("right-items" ),
+                                        ly_symbol2scm ("right-items"),
                                         column);
     }
-   
+
   if (last_spacings_.staff_spacing_
-     && last_spacings_.staff_spacing_->get_column () == column)
+      && last_spacings_.staff_spacing_->get_column () == column)
     {
       last_spacings_.staff_spacing_->suicide ();
     }
@@ -107,7 +105,7 @@ Separating_line_group_engraver::finalize ()
 void
 Separating_line_group_engraver::acknowledge_grob (Grob_info i)
 {
-  Item * it = dynamic_cast <Item *> (i.grob_);
+  Item *it = dynamic_cast<Item *> (i.grob_);
   if (!it)
     return;
   if (it->get_parent (X_AXIS)
@@ -115,16 +113,15 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
       ->has_extent_callback (Axis_group_interface::group_extent_callback_proc, X_AXIS))
     return;
 
-  
   if (to_boolean (it->get_property ("no-spacing-rods")))
-    return ;
+    return;
 
-  if (Note_spacing::has_interface (it)) 
+  if (Note_spacing::has_interface (it))
     {
       current_spacings_.note_spacings_.push (it);
-      return ;
+      return;
     }
-  
+
   bool ib = Item::is_breakable (it);
   Item *&p_ref_ (ib ? break_item_
                 : musical_item_);
@@ -138,16 +135,13 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
          p_ref_->set_property ("breakable", SCM_BOOL_T);
          context ()->set_property ("breakableSeparationItem", p_ref_->self_scm ());
        }
-      
 
       if (to_boolean (get_property ("createSpacing"))
          && p_ref_ == break_item_)
        {
-         Item *it  = make_item ("StaffSpacing", SCM_EOL);
+         Item *it = make_item ("StaffSpacing", SCM_EOL);
          current_spacings_.staff_spacing_ = it;
          it->set_property ("left-items", scm_cons (break_item_->self_scm (), SCM_EOL));
-         
-         
 
          if (int i = last_spacings_.note_spacings_.size ())
            {
@@ -155,12 +149,12 @@ Separating_line_group_engraver::acknowledge_grob (Grob_info i)
                Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
                                                   ly_symbol2scm ("right-items"),
                                                   break_item_);
-                                    
+
            }
          else if (last_spacings_.staff_spacing_)
            {
              last_spacings_.staff_spacing_->set_property ("right-items",
-                                                               scm_cons (break_item_->self_scm (), SCM_EOL));
+                                                          scm_cons (break_item_->self_scm (), SCM_EOL));
            }
        }
     }
@@ -186,40 +180,38 @@ Separating_line_group_engraver::stop_translation_timestep ()
     {
       Separating_group_spanner::add_spacing_unit (sep_span_, break_item_);
     }
-  
-  if (Item * sp = current_spacings_.staff_spacing_)
+
+  if (Item *sp = current_spacings_.staff_spacing_)
     {
       /*
        TODO: should really look at the left-items of following
        note-spacing grobs.
-       */
+      */
       if (musical_item_)
        Pointer_group_interface::add_grob (sp, ly_symbol2scm ("right-items"),
                                           musical_item_);
 
     }
 
-  
   if (!current_spacings_.is_empty ())
     {
       last_spacings_ = current_spacings_;
     }
 
   current_spacings_.clear ();
-  
+
   if (musical_item_)
     {
       Separating_group_spanner::add_spacing_unit (sep_span_, musical_item_);
     }
-  
+
   musical_item_ = 0;
 }
 
-
 ADD_TRANSLATOR (Separating_line_group_engraver,
-/* descr */       "Generates objects for computing spacing parameters.",
-/* creats*/       "SeparationItem SeparatingGroupSpanner StaffSpacing",
-/* accepts */     "",
-/* acks  */      "item-interface",
-/* reads */       "createSpacing",
-/* write */       "breakableSeparationItem");
+               /* descr */ "Generates objects for computing spacing parameters.",
+               /* creats*/ "SeparationItem SeparatingGroupSpanner StaffSpacing",
+               /* accepts */ "",
+               /* acks  */ "item-interface",
+               /* reads */ "createSpacing",
+               /* write */ "breakableSeparationItem");
index 7d852f69d7336c3f3c443984eb6359057f5bbe81..68fb40fb2364f805fcdb108e2e27c8cee7b3f777 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-     separation-item.cc -- implement Separation_item
-  
+/*
+  separation-item.cc -- implement Separation_item
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "separation-item.hh"
 
@@ -15,7 +14,7 @@
 #include "accidental-placement.hh"
 
 void
-Separation_item::add_item (Grob*s, Item* i)
+Separation_item::add_item (Grob *s, Item *i)
 {
   assert (i);
   Pointer_group_interface::add_grob (s, ly_symbol2scm ("elements"), i);
@@ -23,7 +22,7 @@ Separation_item::add_item (Grob*s, Item* i)
 }
 
 void
-Separation_item::add_conditional_item (Grob* me , Grob *e)
+Separation_item::add_conditional_item (Grob *me, Grob *e)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("conditional-elements"), e);
 }
@@ -31,28 +30,27 @@ Separation_item::add_conditional_item (Grob* me , Grob *e)
 /*
   Return the width of ME given that we are considering the object on
   the LEFT.
- */
+*/
 Interval
-Separation_item::conditional_width (Grob * me, Grob * left)
+Separation_item::conditional_width (Grob *me, Grob *left)
 {
   Interval w = width (me);
-  
-  Item *item = dynamic_cast<Item*> (me);
-  Paper_column * pc = item->get_column ();
-  
-  
-  for (SCM s =  me->get_property ("conditional-elements"); scm_is_pair (s); s = scm_cdr (s))
+
+  Item *item = dynamic_cast<Item *> (me);
+  Paper_column *pc = item->get_column ();
+
+  for (SCM s = me->get_property ("conditional-elements"); scm_is_pair (s); s = scm_cdr (s))
     {
       SCM elt = scm_car (s);
       if (!unsmob_grob (elt))
        continue;
-      
+
       Item *il = unsmob_item (elt);
       if (pc != il->get_column ())
        {
          /* this shouldn't happen, but let's continue anyway. */
          programming_error (_ ("Separation_item:  I've been drinking too much"));
-         continue;             /*UGH UGH*/ 
+         continue;             /*UGH UGH*/
        }
 
       if (to_boolean (il->get_property ("no-spacing-rods")))
@@ -81,11 +79,11 @@ Separation_item::width (Grob *me)
       return ly_scm2interval (sw);
     }
 
-  Item *item = dynamic_cast<Item*> (me);
-  Paper_column * pc = item->get_column ();
+  Item *item = dynamic_cast<Item *> (me);
+  Paper_column *pc = item->get_column ();
   Interval w;
-  
-  for (SCM s =  me->get_property ("elements"); scm_is_pair (s); s = scm_cdr (s))
+
+  for (SCM s = me->get_property ("elements"); scm_is_pair (s); s = scm_cdr (s))
     {
       SCM elt = scm_car (s);
       if (!unsmob_grob (elt))
@@ -96,7 +94,7 @@ Separation_item::width (Grob *me)
        {
          /* this shouldn't happen, but let's continue anyway. */
          programming_error (_ ("Separation_item:  I've been drinking too much"));
-         continue;             /*UGH UGH*/ 
+         continue;             /*UGH UGH*/
        }
 
       if (to_boolean (il->get_property ("no-spacing-rods")))
@@ -116,35 +114,34 @@ Separation_item::width (Grob *me)
   w.widen (robust_scm2double (pad, 0.0));
 
   me->set_property ("X-extent", ly_interval2scm (w));
-  
+
   return w;
 }
 
 Interval
-Separation_item::relative_width (Grob * me, Grob * common)
+Separation_item::relative_width (Grob *me, Grob *common)
 {
   Interval iv = width (me);
 
-  return dynamic_cast<Item*>(me)->get_column ()->relative_coordinate (common, X_AXIS) + iv ;
+  return dynamic_cast<Item *> (me)->get_column ()->relative_coordinate (common, X_AXIS) + iv;
 }
 
-
 /*
   Try to find the break-aligned symbol in SEPARATION_ITEM that is
   sticking out at direction D. The x size is put in LAST_EXT
 */
-Grob*
+Grob *
 Separation_item::extremal_break_aligned_grob (Grob *separation_item, Direction d,
-                                           Interval * last_ext)
+                                             Interval *last_ext)
 {
-  Grob *col = dynamic_cast<Item*> (separation_item)->get_column ();
+  Grob *col = dynamic_cast<Item *> (separation_item)->get_column ();
   last_ext->set_empty ();
   Grob *last_grob = 0;
   for (SCM s = separation_item->get_property ("elements");
        scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * break_item = unsmob_grob (scm_car (s));
-      
+      Grob *break_item = unsmob_grob (scm_car (s));
+
       if (!scm_is_symbol (break_item->get_property ("break-align-symbol")))
        continue;
 
@@ -153,22 +150,18 @@ Separation_item::extremal_break_aligned_grob (Grob *separation_item, Direction d
       if (ext.is_empty ())
        continue;
       if (!last_grob
-         || (last_grob && d * (ext[d]- (*last_ext)[d]) > 0) )
+         || (last_grob && d * (ext[d]- (*last_ext)[d]) > 0))
        {
          *last_ext = ext;
-         last_grob = break_item; 
+         last_grob = break_item;
        }
     }
 
-  return last_grob;  
+  return last_grob;
 }
 
 
-
-
-
 ADD_INTERFACE (Separation_item, "separation-item-interface",
               "Item that computes widths to generate spacing rods. "
-              "This is done in concert with @ref{separation-spanner-interface}."
-              ,
+              "This is done in concert with @ref{separation-spanner-interface}.",
               "padding X-extent conditional-elements elements");
index 3d619fd287b228cde40c39056a62f26958ee6789..cf88a52d1dd1248b1e2d90b75da654b850f1a4a4 100644 (file)
 #include "grace-fixup.hh"
 
 /*
-  
   TODO: handling of grace notes is exquisite pain.  This handling
   should be formally specified and then the implementation verified.
-
 */
 
 /*
 
 
   if (scm_is_pair (cursor_))
-    iter_->music_ == unsmob_music (scm_car (cursor_))
+  iter_->music_ == unsmob_music (scm_car (cursor_))
   else
-    iter_ == 0;
+  iter_ == 0;
 
   The length of musiclist from start to up to cursor_ (cursor_ not
   including), is summed
 
-  here_mom_  = sum (length (musiclist [start ... cursor>))  %)  
-  
- */
+  here_mom_  = sum (length (musiclist [start ... cursor>))  %)
+*/
 Sequential_iterator::Sequential_iterator ()
 {
   here_mom_ = Moment (0);
-  cursor_ = SCM_EOL; 
+  cursor_ = SCM_EOL;
   grace_fixups_ = 0;
   iter_ = 0;
 }
 
-SCM 
+SCM
 Sequential_iterator::get_music_list () const
 {
   return SCM_EOL;
@@ -56,8 +53,6 @@ Sequential_iterator::do_quit ()
 }
 
 
-
-
 void
 Sequential_iterator::derived_mark () const
 {
@@ -66,7 +61,6 @@ Sequential_iterator::derived_mark () const
   scm_gc_mark (cursor_);
 }
 
-
 void
 Sequential_iterator::derived_substitute (Context *f, Context *t)
 {
@@ -76,7 +70,7 @@ Sequential_iterator::derived_substitute (Context *f, Context *t)
 
 /*
   TODO: this should be made lazily.
- */
+*/
 Grace_fixup *
 create_grace_fixup_list (SCM cursor)
 {
@@ -101,19 +95,19 @@ create_grace_fixup_list (SCM cursor)
              p->grace_start_ = s.grace_part_;
              p->next_ = 0;
              *tail = p;
-             tail = &(*tail)->next_; 
+             tail = &(*tail)->next_;
            }
 
          here.grace_part_ = s.grace_part_;
        }
-      
+
       if (l.to_bool ())
        {
          last = here;
          here += l;
        }
     }
-  
+
   return head;
 }
 
@@ -128,7 +122,7 @@ Sequential_iterator::construct_children ()
       Music *m = unsmob_music (scm_car (cursor_));
       iter_ = unsmob_iterator (get_iterator (m));
     }
-  
+
   while (iter_ && !iter_->ok ())
     {
       next_element (true);
@@ -140,12 +134,11 @@ Sequential_iterator::construct_children ()
 
   /*
     iter_->ok () is tautology, but what the heck.
-   */
-  if (iter_ && iter_->ok ()) 
+  */
+  if (iter_ && iter_->ok ())
     descend_to_child (iter_->get_outlet ());
 }
 
-
 /*
   maintain invariants: change cursor, iter and here_mom_ in one fell
   swoop.
@@ -154,8 +147,8 @@ void
 Sequential_iterator::next_element (bool)
 {
   Moment len = iter_->music_get_length () - iter_->music_start_mom ();
-  assert (!grace_fixups_  || grace_fixups_->start_ >= here_mom_);
-  
+  assert (!grace_fixups_ || grace_fixups_->start_ >= here_mom_);
+
   if (len.main_part_
       && get_grace_fixup ())
     {
@@ -184,7 +177,7 @@ Sequential_iterator::next_element (bool)
       last_mom_ = here_mom_;;
       here_mom_ += len;
     }
-  
+
   cursor_ = scm_cdr (cursor_);
 
   iter_->quit ();
@@ -194,21 +187,19 @@ Sequential_iterator::next_element (bool)
     iter_ = 0;
 }
 
-
-
 void
 Sequential_iterator::process (Moment until)
 {
   while (iter_)
     {
-      Grace_fixup * gf = get_grace_fixup ();
+      Grace_fixup *gf = get_grace_fixup ();
       if (gf
          && gf->start_ + gf->length_
-             + Moment (Rational (0), gf->grace_start_) == until)
+         + Moment (Rational (0), gf->grace_start_) == until)
        {
          /*
            do the stuff/note/rest preceding a grace.
-          */
+         */
          iter_->process (iter_->music_get_length ());
        }
       else
@@ -216,15 +207,15 @@ Sequential_iterator::process (Moment until)
          Moment w = until - here_mom_ + iter_->music_start_mom ();
          iter_->process (w);
        }
-      
+
       /*
        if the iter is still OK, there must be events left that have
-       
-         TIME > LEFT
-         
+
+       TIME > LEFT
+
       */
       if (iter_->ok ())
-       return ;
+       return;
 
       descend_to_child (iter_->get_outlet ());
       next_element (true);
@@ -239,7 +230,7 @@ Sequential_iterator::pending_moment () const
   /*
     Fix-up a grace note halfway in the music.
   */
-  Grace_fixup * gf = get_grace_fixup ();
+  Grace_fixup *gf = get_grace_fixup ();
   if (gf
       && gf->length_ + iter_->music_start_mom () == cp)
     {
@@ -252,16 +243,15 @@ Sequential_iterator::pending_moment () const
   return cp + here_mom_ - iter_->music_start_mom ();
 }
 
-
 bool
 Sequential_iterator::ok () const
 {
   return iter_;
 }
 
-Music_iterator*
+Music_iterator *
 Sequential_iterator::try_music_in_children (Music *m) const
-{ 
+{
   return iter_ ? iter_->try_music (m) : 0;
 }
 
@@ -270,18 +260,18 @@ IMPLEMENT_CTOR_CALLBACK (Sequential_iterator);
 bool
 Sequential_iterator::run_always () const
 {
-  return iter_ ? iter_->run_always () : false; 
+  return iter_ ? iter_->run_always () : false;
 }
 
 void
 Sequential_iterator::next_grace_fixup ()
 {
-  Grace_fixup * n = grace_fixups_->next_;
+  Grace_fixup *n = grace_fixups_->next_;
   delete grace_fixups_;
   grace_fixups_ = n;
 }
 
-Grace_fixup*
+Grace_fixup *
 Sequential_iterator::get_grace_fixup () const
 {
   if (grace_fixups_ && grace_fixups_->start_ == here_mom_)
index bf0f63050948c5c1ee1565ae675ef258771085c2..e8830fb7e4b0d2fda1e50c8f1981656a8bfe3913 100644 (file)
@@ -16,5 +16,5 @@ IMPLEMENT_CTOR_CALLBACK (Sequential_music_iterator);
 SCM
 Sequential_music_iterator::get_music_list ()const
 {
-  return get_music()->get_property ("elements");
+  return get_music ()->get_property ("elements");
 }
index 371f13fe5a8a6c5b79d33707c3c003ffbd52b5d1..c9e3dc6eae103da32ea1a727b7327c04ca08737a 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   side-position-interface.cc -- implement Side_position_interface
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "side-position-interface.hh"
 
 #include "string-convert.hh"
 
 void
-Side_position_interface::add_support (Grob*me, Grob*e)
+Side_position_interface::add_support (Grob *me, Grob *e)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("side-support-elements"), e);
 }
 
 Direction
-Side_position_interface::get_direction (Grob*me)
+Side_position_interface::get_direction (Grob *me)
 {
   SCM d = me->get_property ("direction");
   if (is_direction (d) && to_dir (d))
@@ -40,17 +39,16 @@ Side_position_interface::get_direction (Grob*me)
     {
       relative_dir = to_dir (reldir);
     }
-  
+
   SCM other_elt = me->get_property ("direction-source");
-  Grob * e = unsmob_grob (other_elt);
+  Grob *e = unsmob_grob (other_elt);
   if (e)
     {
       return (Direction) (relative_dir * get_grob_direction (e));
     }
-  
+
   return CENTER;
 }
-  
 
 MAKE_SCHEME_CALLBACK (Side_position_interface, aligned_on_support_extents, 2);
 SCM
@@ -62,7 +60,6 @@ Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
   return general_side_position (me, a, true);
 }
 
-
 /* Put the element next to the support, optionally taking in
    account the extent of the support.  */
 SCM
@@ -71,7 +68,7 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
   Real ss = Staff_symbol_referencer::staff_space (me);
   SCM support = me->get_property ("side-support-elements");
   Grob *common = common_refpoint_of_list (support, me->get_parent (a), a);
-  Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
+  Grob *st = Staff_symbol_referencer::get_staff_symbol (me);
   bool include_staff = (st
                        && a == Y_AXIS
                        && scm_is_number (me->get_property ("staff-padding")));
@@ -82,7 +79,7 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
       common = st->common_refpoint (common, Y_AXIS);
       dim = st->extent (common, Y_AXIS);
     }
-    
+
   for (SCM s = support; s != SCM_EOL; s = scm_cdr (s))
     {
       Grob *e = unsmob_grob (scm_car (s));
@@ -100,9 +97,9 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
     dim = Interval (0, 0);
 
   Direction dir = Side_position_interface::get_direction (me);
-    
+
   Real off = me->get_parent (a)->relative_coordinate (common, a);
-  Real minimum_space = ss * robust_scm2double (me->get_property ("minimum-space"),  -1);
+  Real minimum_space = ss * robust_scm2double (me->get_property ("minimum-space"), -1);
 
   Real total_off = dim.linear_combination (dir) - off;
   total_off += dir * ss * robust_scm2double (me->get_property ("padding"), 0);
@@ -116,10 +113,10 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
   if (fabs (total_off) > 100 CM)
     {
       String msg
-       =  String_convert::form_string ("Improbable offset for grob %s: %f%s",
-                                       me->name ().to_str0 (), total_off,
-                                       INTERNAL_UNIT);
-      
+       = String_convert::form_string ("Improbable offset for grob %s: %f%s",
+                                      me->name ().to_str0 (), total_off,
+                                      INTERNAL_UNIT);
+
       programming_error (msg);
     }
   return scm_make_real (total_off);
@@ -127,7 +124,7 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
 
 /*
   Cut & paste (ugh.)
- */
+*/
 MAKE_SCHEME_CALLBACK (Side_position_interface, aligned_on_support_refpoints, 2);
 SCM
 Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
@@ -135,12 +132,10 @@ Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
   Grob *me = unsmob_grob (smob);
   Axis a = (Axis) scm_to_int (axis);
 
-  return general_side_position (me, a, false); 
+  return general_side_position (me, a, false);
 }
 
 
-
-
 Real
 directed_round (Real f, Direction d)
 {
@@ -161,30 +156,29 @@ SCM
 Side_position_interface::quantised_position (SCM element_smob, SCM)
 {
   Grob *me = unsmob_grob (element_smob);
-  
+
   Direction d = Side_position_interface::get_direction (me);
 
-  Grob * stsym = Staff_symbol_referencer::get_staff_symbol (me);
+  Grob *stsym = Staff_symbol_referencer::get_staff_symbol (me);
   if (stsym)
     {
       Real p = Staff_symbol_referencer::get_position (me);
       Real rp = directed_round (p, d);
-      Real rad = Staff_symbol_referencer::staff_radius (me) *2 ;
+      Real rad = Staff_symbol_referencer::staff_radius (me) *2;
       int ip = int (rp);
 
       Grob *head = me->get_parent (X_AXIS);
-       
+
       if (Staff_symbol_referencer::on_staffline (me, ip)
          && ((abs (ip) <= rad)
              || (Note_head::has_interface (head)
                  && sign (Staff_symbol_referencer::get_position (head))
-                 == -d)
-             ))
+                 == -d)))
        {
          ip += d;
          rp += d;
        }
-      
+
       return scm_make_real ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
     }
   return scm_make_real (0.0);
@@ -192,19 +186,19 @@ Side_position_interface::quantised_position (SCM element_smob, SCM)
 
 /*
   Position next to support, taking into account my own dimensions and padding.
- */
+*/
 MAKE_SCHEME_CALLBACK (Side_position_interface, aligned_side, 2);
 SCM
 Side_position_interface::aligned_side (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) scm_to_int (axis);
-  
+
   Direction d = Side_position_interface::get_direction (me);
-  
+
   Real o = scm_to_double (aligned_on_support_extents (element_smob, axis));
 
-  Interval iv =  me->extent (me, a);
+  Interval iv = me->extent (me, a);
 
   if (!iv.is_empty ())
     {
@@ -213,57 +207,54 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
          programming_error ("Direction unknown, but aligned-side wanted.");
          d = DOWN;
        }
-      o += - iv[-d];
+      o += -iv[-d];
     }
 
   /*
-  Maintain a minimum distance to the staff. This is similar to side
-  position with padding, but it will put adjoining objects on a row if
-  stuff sticks out of the staff a little.
- */
-  Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
+    Maintain a minimum distance to the staff. This is similar to side
+    position with padding, but it will put adjoining objects on a row if
+    stuff sticks out of the staff a little.
 */
+  Grob *st = Staff_symbol_referencer::get_staff_symbol (me);
   if (st && a == Y_AXIS
       && scm_is_number (me->get_property ("staff-padding")))
     {
-      Real padding =
-      Staff_symbol_referencer::staff_space (me)
-      * scm_to_double (me->get_property ("staff-padding"));
-  
+      Real padding
+       = Staff_symbol_referencer::staff_space (me)
+       * scm_to_double (me->get_property ("staff-padding"));
+
       Grob *common = me->common_refpoint (st, Y_AXIS);
-      
+
       Interval staff_size = st->extent (common, Y_AXIS);
-      Real diff =  d*staff_size[d] + padding - d*(o + iv[-d]);
-      o += (d*  (diff >? 0));
+      Real diff = d*staff_size[d] + padding - d* (o + iv[-d]);
+      o += (d* (diff >? 0));
     }
-      
+
   return scm_make_real (o);
 }
 
-
 void
-Side_position_interface::set_axis (Grob*me, Axis a)
+Side_position_interface::set_axis (Grob *me, Axis a)
 {
   me->add_offset_callback (Side_position_interface::aligned_side_proc, a);
 }
 
 // ugh. doesn't catch all variants. 
 Axis
-Side_position_interface::get_axis (Grob*me)
+Side_position_interface::get_axis (Grob *me)
 {
   if (me->has_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS)
-      || me->has_offset_callback (Side_position_interface::aligned_side_proc , X_AXIS))
+      || me->has_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS))
     return X_AXIS;
-  
+
   return Y_AXIS;
 }
 
-
 ADD_INTERFACE (Side_position_interface, "side-position-interface",
               "Position a victim object (this one) next to other objects (the "
               "support).   The property @code{direction} signifies where to put the  "
               "victim object relative to the support (left or right, up or down?)\n\n "
               "The routine also takes the size the staff into account if "
-              "@code{staff-padding} is set. If undefined, the staff symbol is ignored." 
-              ,
+              "@code{staff-padding} is set. If undefined, the staff symbol is ignored.",
               "staff-padding side-support-elements direction-source "
               "direction side-relative-direction minimum-space padding");
index 0ce6b1feb1ae6576fe4900c34ffeec55728c106b..9f62d373fc6049e1ec17ddacc324fbb906a60462 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   simple-music-iterator.cc -- implement Simple_music_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "simple-music-iterator.hh"
 
@@ -30,7 +29,6 @@ Simple_music_iterator::ok ()const
 
   Engravers can detect and event the end-moments to be processed as
   well.
-
 */
 Moment
 Simple_music_iterator::pending_moment ()const
@@ -41,13 +39,12 @@ Simple_music_iterator::pending_moment ()const
     return music_get_length ();
 }
 
-
 void
 Simple_music_iterator::process (Moment m)
 {
   /*
-  don't do try_music (), since it would make the function useless for
-  base classes
+    don't do try_music (), since it would make the function useless for
+    base classes
   */
 
   last_processed_mom_ = m;
index b658d129e508045d7bdebe5005a7283b56a26b9e..5cc4871c0d6aef40a993bdbfd8880d02a56907d6 100644 (file)
@@ -4,10 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
-
 #include <cstdio>
 #include <math.h>
 
 #include "warn.hh"
 #include "simple-spacer.hh"
 
-LY_DEFINE(ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
-         4, 1, 0, (SCM springs, SCM rods, SCM length, SCM ragged),
-         "Solve a spring and rod problem for @var{count} objects, that "
-         "are connected by @var{count-1} springs, and an arbitrary number of rods "
-         "Springs have the format (ideal, hooke) and rods (idx1, idx2, distance) "
-         "@var{length} is a number, @var{ragged} a boolean "
-         "Return: a list containing the force (positive for stretching, "
-         "negative for compressing and #f for non-satisfied constraints) "
-         "followed by the @var{spring-count}+1 positions of the objects. "
-         )
+LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
+          4, 1, 0, (SCM springs, SCM rods, SCM length, SCM ragged),
+          "Solve a spring and rod problem for @var{count} objects, that "
+          "are connected by @var{count-1} springs, and an arbitrary number of rods "
+          "Springs have the format (ideal, hooke) and rods (idx1, idx2, distance) "
+          "@var{length} is a number, @var{ragged} a boolean "
+          "Return: a list containing the force (positive for stretching, "
+          "negative for compressing and #f for non-satisfied constraints) "
+          "followed by the @var{spring-count}+1 positions of the objects. ")
 {
   int len = scm_ilength (springs);
   if (len == 0)
     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");
 
-
-  bool is_ragged = ragged == SCM_BOOL_T; 
-  Simple_spacer spacer; 
+  bool is_ragged = ragged == SCM_BOOL_T;
+  Simple_spacer spacer;
   for (SCM s = springs; scm_is_pair (s); s = scm_cdr (s))
     {
       Real ideal = scm_to_double (scm_caar (s));
@@ -54,13 +50,13 @@ LY_DEFINE(ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
       int l = scm_to_int (scm_car (entry));
       int r = scm_to_int (scm_cadr (entry));
       entry = scm_cddr (entry);
-      
+
       Real distance = scm_to_double (scm_car (entry));
       spacer.add_rod (l, r, distance);
     }
 
   spacer.line_len_ = scm_to_double (length);
-      
+
   if (is_ragged)
     spacer.my_solve_natural_len ();
   else
@@ -68,14 +64,12 @@ LY_DEFINE(ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
 
   Array<Real> posns;
   posns.push (0.0);
-  for (int i = 0; i < spacer.springs_.size(); i++)
+  for (int i = 0; i < spacer.springs_.size (); i++)
     {
       Real l = spacer.springs_[i].length ((is_ragged) ? 0.0 : spacer.force_);
-      posns.push (posns.top() + l);
+      posns.push (posns.top () + l);
     }
 
-
-    
   SCM force_return = SCM_BOOL_F;
   if (!isinf (spacer.force_)
       && (spacer.is_active () || is_ragged))
@@ -90,11 +84,11 @@ LY_DEFINE(ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
     }
 
   SCM retval = SCM_EOL;
-  for (int i = posns.size(); i--;)
+  for (int i = posns.size (); i--;)
     {
-      retval = scm_cons (scm_from_double (posns[i]), retval); 
+      retval = scm_cons (scm_from_double (posns[i]), retval);
     }
 
   retval = scm_cons (force_return, retval);
-  return retval;  
+  return retval;
 }
index ac65a0ce0086b95bc76da9cc3afb59c15df34287..e9afca6cbd5af575e5f24a219238e92f3f5ff368 100644 (file)
@@ -1,16 +1,14 @@
-/*   
+/*
   simple-spacer.cc -- implement Simple_spacer
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
   TODO:
   - add support for different stretch/shrink constants?
-  
 */
 
-
 #include <cstdio>
 #include <math.h>
 
 #include "dimensions.hh"
 
 /*
-   A simple spacing constraint solver. The approach:
+  A simple spacing constraint solver. The approach:
 
-   Stretch the line uniformly until none of the constraints (rods)
-   block.  It then is very wide.
+  Stretch the line uniformly until none of the constraints (rods)
+  block.  It then is very wide.
 
-      Compress until the next constraint blocks,
+  Compress until the next constraint blocks,
 
-      Mark the springs over the constrained part to be non-active.
-      
-   Repeat with the smaller set of non-active constraints, until all
-   constraints blocked, or until the line is as short as desired.
+  Mark the springs over the constrained part to be non-active.
 
-   This is much simpler, and much much faster than full scale
-   Constrained QP. On the other hand, a situation like this will not
-   be typeset as dense as possible, because
+  Repeat with the smaller set of non-active constraints, until all
+  constraints blocked, or until the line is as short as desired.
 
-   c4                   c4           c4                  c4
-   veryveryverylongsyllable2         veryveryverylongsyllable2
-   " "4                 veryveryverylongsyllable2        syllable4
+  This is much simpler, and much much faster than full scale
+  Constrained QP. On the other hand, a situation like this will not
+  be typeset as dense as possible, because
 
+  c4                   c4           c4                  c4
+  veryveryverylongsyllable2         veryveryverylongsyllable2
+  " "4                 veryveryverylongsyllable2        syllable4
 
-   can be further compressed to
 
+  can be further compressed to
 
-   c4    c4                        c4   c4
-   veryveryverylongsyllable2       veryveryverylongsyllable2
-   " "4  veryveryverylongsyllable2      syllable4
 
+  c4    c4                        c4   c4
+  veryveryverylongsyllable2       veryveryverylongsyllable2
+  " "4  veryveryverylongsyllable2      syllable4
 
-   Perhaps this is not a bad thing, because the 1st looks better anyway.  */
 
+  Perhaps this is not a bad thing, because the 1st looks better anyway.  */
 
 /*
-
   positive force = expanding, negative force = compressing.
-  
 */
 
 Simple_spacer::Simple_spacer ()
@@ -88,32 +83,32 @@ Simple_spacer::add_rod (int l, int r, Real dist)
     {
       /*
        If a spring is fixed, we have to do something here:
-       we let the rod override the spring. 
-       */
+       we let the rod override the spring.
+      */
       Real total_dist = 0.;
-      for (int i = l ; i < r; i++)
+      for (int i = l; i < r; i++)
        total_dist += springs_[i].ideal_;
 
       if (total_dist < dist)
-       for (int i = l ; i < r; i++)
-         springs_[i].ideal_ *= dist/total_dist;
+       for (int i = l; i < r; i++)
+         springs_[i].ideal_ *= dist / total_dist;
 
       return;
     }
-  
+
   Real d = range_ideal_len (l, r);
   Real block_stretch = dist - d;
-  
+
   Real block_force = c * block_stretch;
   force_ = force_ >? block_force;
 
   for (int i = l; i < r; i++)
     springs_[i].block_force_ = block_force >?
-      springs_[i].block_force_ ;
+      springs_[i].block_force_;
 }
 
 Real
-Simple_spacer::range_ideal_len (int l, int r)   const
+Simple_spacer::range_ideal_len (int l, int r) const
 {
   Real d = 0.;
   for (int i = l; i < r; i++)
@@ -137,7 +132,7 @@ Simple_spacer::range_stiffness (int l, int r) const
 Real
 Simple_spacer::active_blocking_force () const
 {
-  Real bf = - infinity_f; 
+  Real bf = -infinity_f;
   for (int i = 0; i < springs_.size (); i++)
     if (springs_[i].is_active_)
       {
@@ -149,13 +144,13 @@ Simple_spacer::active_blocking_force () const
 Real
 Simple_spacer::active_springs_stiffness () const
 {
-  Real  stiff =  range_stiffness (0, springs_.size ());
+  Real stiff = range_stiffness (0, springs_.size ());
   if (isinf (stiff))
     {
       /*
        all springs are inactive. Take the stiffness of the
        latest spring to block.
-       */
+      */
 
       Real max_block_force = -infinity_f;
       int max_i = -1;
@@ -168,7 +163,7 @@ Simple_spacer::active_springs_stiffness () const
            }
        }
 
-      stiff = springs_[max_i].hooke_;   
+      stiff = springs_[max_i].hooke_;
     }
   return stiff;
 }
@@ -177,14 +172,14 @@ void
 Simple_spacer::set_active_states ()
 {
   /* float comparison is safe, since force is only copied.  */
-  for (int i = 0 ; i <springs_.size (); i++)
+  for (int i = 0; i <springs_.size (); i++)
     if (springs_[i].is_active_
        && springs_[i].block_force_ >= force_)
       {
        springs_[i].is_active_ = false;
-       active_count_ --; 
+       active_count_--;
       }
-}   
+}
 
 Real
 Simple_spacer::configuration_length () const
@@ -199,7 +194,7 @@ Simple_spacer::configuration_length () const
 bool
 Simple_spacer::is_active () const
 {
-  return active_count_; 
+  return active_count_;
 }
 
 void
@@ -220,12 +215,11 @@ Simple_spacer::my_solve_linelen ()
     }
 }
 
-
 void
 Simple_spacer::my_solve_natural_len ()
 {
   Real line_len_force = 0.0;
-  
+
   while (is_active ())
     {
       force_ = active_blocking_force () >? 0.0;
@@ -235,20 +229,18 @@ Simple_spacer::my_solve_natural_len ()
        {
          line_len_force = force_
            + (line_len_ - conf)
-           * active_springs_stiffness();
+           * active_springs_stiffness ();
        }
-      
+
       if (force_ < 1e-8) // ugh.,
        break;
-      
+
       set_active_states ();
     }
 
   force_ = line_len_force;
 }
 
-         
-         
 /****************************************************************/
 
 Spring_description::Spring_description ()
@@ -259,7 +251,6 @@ Spring_description::Spring_description ()
   block_force_ = 0.0;
 }
 
-
 bool
 Spring_description::is_sane () const
 {
@@ -273,28 +264,25 @@ Spring_description::length (Real f) const
 {
   if (!is_active_)
     f = block_force_;
-  return ideal_ + f / hooke_ ;
+  return ideal_ + f / hooke_;
 }
 /****************************************************************/
 
-
 /*
-  
   TODO: should a add penalty for widely varying spring forces (caused
   by constraints, eg.
 
 
-         =====  
-         |   |
+  =====
+  |   |
   o|o|  x ##x
 
 
   The ## forces the notes apart; we shouldn't allow the O's to touch
   this closely.
-  
- */
+*/
 void
-Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged) 
+Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
 {
   if (ragged)
     spacer_->my_solve_natural_len ();
@@ -302,7 +290,7 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
     spacer_->my_solve_linelen ();
 
   positions->force_ = spacer_->force_;
-  
+
   /*
     We used to have a penalty for compression, no matter what, but that
     fucked up wtk1-fugue2 (taking 3 full pages.)
@@ -310,21 +298,21 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
   positions->config_.push (spacer_->indent_);
   for (int i = 0; i < spacer_->springs_.size (); i++)
     {
-      Real  l = spacer_->springs_[i].length ((ragged) ? 0.0 : spacer_->force_);
+      Real l = spacer_->springs_[i].length ((ragged) ? 0.0 : spacer_->force_);
       positions->config_.push (positions->config_.top () + l);
       /*
-       we have l>= 0 here, up to rounding errors 
+       we have l>= 0 here, up to rounding errors
       */
     }
 
   /*
     For raggedright, we must have a measure of music density: this is
     to prevent lots of short lines (which all have force = 0).
-    */
+  */
   if (ragged)
     {
-      positions->satisfies_constraints_ = 
-       positions->config_.top () < spacer_->line_len_ ;
+      positions->satisfies_constraints_
+       = positions->config_.top () < spacer_->line_len_;
     }
   else
     positions->satisfies_constraints_ = spacer_->is_active ();
@@ -334,24 +322,24 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
 
   /*
     Check if breaking constraints are met.
-   */
+  */
   bool break_satisfy = true;
-  int sz =  positions->cols_.size ();
-  for (int i = sz; i--; )
+  int sz = positions->cols_.size ();
+  for (int i = sz; i--;)
     {
-      SCM p = positions->cols_[i]->get_property ( "penalty");
+      SCM p = positions->cols_[i]->get_property ("penalty");
       if (scm_is_number (p))
        {
          if (scm_to_double (p) < -9999)
            break_satisfy = break_satisfy && (i == 0 || i == sz -1);
          if (scm_to_double (p) > 9999)
-           break_satisfy = break_satisfy && !(i == 0 || i == sz -1);
+           break_satisfy = break_satisfy && ! (i == 0 || i == sz -1);
        }
-      
+
     }
 
-  positions->satisfies_constraints_ =
-    positions->satisfies_constraints_ && break_satisfy;
+  positions->satisfies_constraints_
+    positions->satisfies_constraints_ && break_satisfy;
 }
 
 void
@@ -368,7 +356,7 @@ Simple_spacer::add_spring (Real ideal, Real hooke)
       desc.hooke_ = 1.0;
       desc.ideal_ = 1.0;
     }
-  
+
   if (isinf (hooke))
     {
       desc.is_active_ = false;
@@ -376,34 +364,34 @@ Simple_spacer::add_spring (Real ideal, Real hooke)
   else
     {
       /*
-       desc.is_active_ ? 
+       desc.is_active_ ?
       */
-      desc.block_force_ = - desc.hooke_ * desc.ideal_; // block at distance 0
-      
-      active_count_ ++;
+      desc.block_force_ = -desc.hooke_ * desc.ideal_; // block at distance 0
+
+      active_count_++;
     }
   springs_.push (desc);
 }
 
 static int
-compare_paper_column_rank (Grob  *const &a,
-                          Grob  *const &b)
+compare_paper_column_rank (Grob *const &a,
+                          Grob *const &b)
 {
-  return Paper_column::get_rank (a) - Paper_column::get_rank (b); 
+  return Paper_column::get_rank (a) - Paper_column::get_rank (b);
 }
 
 void
 Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
 {
   Link_array<Grob> cols (icols);
-  
-  for (int i =  cols.size (); i--;)
+
+  for (int i = cols.size (); i--;)
     if (scm_is_pair (cols[i]->get_property ("between-cols")))
       {
        loose_cols_.push (cols[i]);
        cols.del (i);
       }
-  
+
   spaced_cols_ = cols;
   for (int i = 0; i < cols.size () - 1; i++)
     {
@@ -414,29 +402,27 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
           s = scm_cdr (s))
        {
          Spring_smob *sp = unsmob_spring (scm_car (s));
-         
-         
-         if (sp->other_ == cols[i+1])
+
+         if (sp->other_ == cols[i + 1])
            spring = sp;
        }
 
       if (!spring)
        programming_error (_f ("No spring between column %d and next one",
-                              Paper_column::get_rank (cols[i])
-                              ));
+                              Paper_column::get_rank (cols[i])));
 
       Real ideal = (spring) ? spring->distance_ : spacer_->default_space_;
       Real hooke = (spring) ? spring->strength_ : 1.0;
-       
+
       spacer_->add_spring (ideal, hooke);
     }
-  
+
   for (int i = 0; i < cols.size () - 1; i++)
     {
       for (SCM s = Spaceable_grob::get_minimum_distances (cols[i]);
           scm_is_pair (s); s = scm_cdr (s))
        {
-         Grob * other = unsmob_grob (scm_caar (s));
+         Grob *other = unsmob_grob (scm_caar (s));
          int oi = binsearch_links (cols, other, &compare_paper_column_rank);
          if (oi >= 0)
            {
@@ -445,12 +431,12 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
        }
 
       if (i
-         && !to_boolean  (cols[i]->get_property ("allow-outside-line")))
+         && !to_boolean (cols[i]->get_property ("allow-outside-line")))
        {
          Interval e = cols[i]->extent (cols[i], X_AXIS);
-         if (!e.is_empty())
+         if (!e.is_empty ())
            {
-             spacer_->add_rod (i, cols.size()-1, e[RIGHT]);
+             spacer_->add_rod (i, cols.size () - 1, e[RIGHT]);
              spacer_->add_rod (0, i, e[LEFT]);
            }
        }
@@ -467,7 +453,6 @@ Simple_spacer_wrapper::~Simple_spacer_wrapper ()
   delete spacer_;
 }
 
-
-Simple_spacer_wrapper::Simple_spacer_wrapper (Simple_spacer_wrapper const&)
+Simple_spacer_wrapper::Simple_spacer_wrapper (Simple_spacer_wrapper const &)
 {
 }
index c3ba9ed0412fae0e346b7f3b598bddd63bc416db..0c9cead8fe2005e3d7c7a0bfeea30f1181ca0152 100644 (file)
@@ -18,7 +18,6 @@ Simultaneous_music_iterator::Simultaneous_music_iterator ()
   children_list_ = SCM_EOL;
 }
 
-
 void
 Simultaneous_music_iterator::derived_mark () const
 {
@@ -40,19 +39,19 @@ Simultaneous_music_iterator::construct_children ()
   SCM i = get_music ()->get_property ("elements");
 
   children_list_ = SCM_EOL;
-  SCM * tail = &children_list_;
+  SCM *tail = &children_list_;
   for (; scm_is_pair (i); i = scm_cdr (i), j++)
     {
       Music *mus = unsmob_music (scm_car (i));
 
       SCM scm_iter = get_static_get_iterator (mus);
-      Music_iterator * mi = unsmob_iterator (scm_iter);
+      Music_iterator *mi = unsmob_iterator (scm_iter);
 
       /* if create_separate_contexts_ is set, create a new context with the
         number number as name */
 
       SCM name = ly_symbol2scm (get_outlet ()->context_name ().to_str0 ());
-      Context * t = (j && create_separate_contexts_)
+      Context *t = (j && create_separate_contexts_)
        ? get_outlet ()->find_create_context (name, to_string (j), SCM_EOL)
        : get_outlet ();
 
@@ -62,7 +61,7 @@ Simultaneous_music_iterator::construct_children ()
       mi->init_translator (mus, t);
       mi->construct_children ();
 
-      if (mi->ok ()) 
+      if (mi->ok ())
        {
          *tail = scm_cons (scm_iter, *tail);
          tail = SCM_CDRLOC (*tail);
@@ -75,12 +74,12 @@ Simultaneous_music_iterator::construct_children ()
 void
 Simultaneous_music_iterator::process (Moment until)
 {
-  SCM *proc = &children_list_; 
+  SCM *proc = &children_list_;
   while (scm_is_pair (*proc))
     {
-      Music_iterator * i = unsmob_iterator (scm_car (*proc));
+      Music_iterator *i = unsmob_iterator (scm_car (*proc));
       if (i->run_always ()
-         || i->pending_moment () == until) 
+         || i->pending_moment () == until)
        {
          i->process (until);
        }
@@ -101,27 +100,27 @@ Simultaneous_music_iterator::pending_moment () const
 {
   Moment next;
   next.set_infinite (1);
-  
+
   for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      Music_iterator * it = unsmob_iterator (scm_car (s));
+      Music_iterator *it = unsmob_iterator (scm_car (s));
       next = next <? it->pending_moment ();
     }
-  
+
   return next;
 }
 
 bool
 Simultaneous_music_iterator::ok () const
 {
-  bool run_always_ok = false; 
+  bool run_always_ok = false;
   for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      Music_iterator * it = unsmob_iterator (scm_car (s));
+      Music_iterator *it = unsmob_iterator (scm_car (s));
       if (!it->run_always ())
        return true;
       else
-       run_always_ok =  run_always_ok || it->ok ();
+       run_always_ok = run_always_ok || it->ok ();
     }
   return run_always_ok;
 }
@@ -131,17 +130,17 @@ Simultaneous_music_iterator::run_always () const
 {
   for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      Music_iterator * it = unsmob_iterator (scm_car (s));
+      Music_iterator *it = unsmob_iterator (scm_car (s));
       if (it->run_always ())
        return true;
     }
   return false;
 }
 
-Music_iterator*
+Music_iterator *
 Simultaneous_music_iterator::try_music_in_children (Music *m) const
 {
-  Music_iterator * b = 0;
+  Music_iterator *b = 0;
   for (SCM s = children_list_; !b && scm_is_pair (s); s = scm_cdr (s))
     b = unsmob_iterator (scm_car (s))->try_music (m);
   return b;
index 79e9b7fd76fdeb55da8f01073700e909a51ee4a0..bbbf7f55808b15939c796546ee6d341a166cbbd2 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
   skyline.cc -- implement Skyline_entry and funcs.
 
   source file of the GNU LilyPond music typesetter
@@ -6,38 +6,36 @@
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "skyline.hh" 
+#include "skyline.hh"
 
 /*
   A skyline is a shape of the form:
 
 
-                  ----
-                  |  |
-         ---------|  |
-         |           |
-          |          |
-          |          |______
+  ----
+  |  |
+  ---------|  |
+  |          |
+  |          |
+  |          |______
   --------|                 |___
-  
+
 
 
   This file deals with building such skyline structure, and computing
   the minimum distance between two opposing skylines.
-  
-   
+
+
   Invariants for a skyline:
 
   skyline[...].width_ forms a partition of the real interval, where
   the segments are adjacent, and ascending. Hence we have
-  
+
   skyline.top ().width_[RIGHT] = inf
   skyline[0].width_[LEFT] = -inf
-  
- */
-
+*/
 
-const Real EPS = 1e-12;  
+const Real EPS = 1e-12;
 
 /*
   TODO: avoid unnecessary fragmentation.
@@ -52,12 +50,12 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
   Interval extent = b[line_axis];
   if (extent.is_empty ())
     return;
-  
+
   Real stick_out = b[other_axis (line_axis)][d];
 
   /*
-    Intersect each segment of LINE with EXTENT, and if non-empty, insert relevant segments. 
-   */
+    Intersect each segment of LINE with EXTENT, and if non-empty, insert relevant segments.
+  */
   for (int i = line->size (); i--;)
     {
       Interval w = line->elem (i).width_;
@@ -65,32 +63,31 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
 
       if (extent[LEFT] >= w[RIGHT])
        break;
-      
+
       Real my_height = line->elem (i).height_;
 
-      if (!w.is_empty () &&
-         w.length () > EPS
+      if (!w.is_empty ()
+         && w.length () > EPS
          && d* (my_height - stick_out) < 0)
        {
          Interval e1 (line->elem (i).width_[LEFT], extent[LEFT]);
          Interval e3 (extent[RIGHT], line->elem (i).width_[RIGHT]);
 
          if (!e3.is_empty () && e3.length () > EPS)
-           line->insert (Skyline_entry (e3, my_height), i+1);
+           line->insert (Skyline_entry (e3, my_height), i + 1);
 
          line->elem_ref (i).height_ = stick_out;
          line->elem_ref (i).width_ = w;
          if (!e1.is_empty () && e1.length () > EPS)
-           line->insert (Skyline_entry (e1, my_height), i );
+           line->insert (Skyline_entry (e1, my_height), i);
        }
 
-
     }
 }
 
 void
 merge_skyline (Array<Skyline_entry> * a1,
-              Array<Skyline_entry> const  & a2,
+              Array<Skyline_entry> const &a2,
               Direction dir)
 {
   for (int i = 0; i < a2.size (); i++)
@@ -98,13 +95,12 @@ merge_skyline (Array<Skyline_entry> * a1,
       Box b;
       b[X_AXIS] = a2[i].width_;
       b[Y_AXIS][dir] = a2[i].height_;
-      b[Y_AXIS][-dir] = dir * infinity_f ;
+      b[Y_AXIS][-dir] = dir * infinity_f;
 
       insert_extent_into_skyline (a1, b, X_AXIS, dir);
     }
 }
 
-
 Array<Skyline_entry>
 empty_skyline (Direction d)
 {
@@ -115,7 +111,7 @@ empty_skyline (Direction d)
   i.swap ();
   Skyline_entry e;
   e.width_ = i;
-  e.height_ = -d * infinity_f; 
+  e.height_ = -d * infinity_f;
   skyline.push (e);
   return skyline;
 }
@@ -132,46 +128,44 @@ extents_to_skyline (Array<Box> const &extents, Axis a, Direction d)
 
     We could do a lot better (n log (n), using a balanced tree) but
     that seems overkill for now.
-   */
-  for (int j = extents.size (); j--; )
+  */
+  for (int j = extents.size (); j--;)
     insert_extent_into_skyline (&skyline, extents[j], a, d);
 
   return skyline;
 }
 
-
-
 /*
   minimum distance that can be achieved between baselines. "Clouds" is
   a skyline pointing down.
 
   This is an O (n) algorithm.
- */
+*/
 Real
 skyline_meshing_distance (Array<Skyline_entry> const &buildings,
                          Array<Skyline_entry> const &clouds)
 {
   int i = buildings.size () -1;
-  int j  = clouds.size () -1;
+  int j = clouds.size () -1;
+
+  Real distance = -infinity_f;
 
-  Real distance = - infinity_f;
-  
   while (i > 0 || j > 0)
     {
       Interval w = buildings[i].width_;
       w.intersect (clouds[j].width_);
-      
+
       if (!w.is_empty ())
        distance = distance >? (buildings[i].height_ - clouds[j].height_);
 
-      if (i>0 && buildings[i].width_[LEFT] >=  clouds[j].width_[LEFT])
+      if (i > 0 && buildings[i].width_[LEFT] >= clouds[j].width_[LEFT])
        {
          i--;
        }
-      else if (j > 0 && buildings[i].width_[LEFT] <=  clouds[j].width_[LEFT])
+      else if (j > 0 && buildings[i].width_[LEFT] <= clouds[j].width_[LEFT])
        {
          j--;
-       }       
+       }
     }
 
   return distance;
@@ -186,12 +180,12 @@ Skyline_entry::Skyline_entry (Interval i, Real r)
 {
   width_ = i;
   height_ = r;
-  
+
 }
 
 void
 heighten_skyline (Array<Skyline_entry> *buildings, Real ground)
 {
   for (int i = 0; i < buildings->size (); i++)
-    buildings->elem_ref (i).height_ += ground; 
+    buildings->elem_ref (i).height_ += ground;
 }
index 76e3d71f070c0c84d6f07665971b34061a5d5eae..25430d0acee24eb0b37ad475bcfe9d0ed58771c3 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   slash-repeat-engraver.cc -- implement Slash_repeat_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "repeated-music.hh"
 #include "global-context.hh"
 #include "score-engraver.hh"
 
 /**
-  This acknowledges repeated music with "percent" style.  It typesets
-  a % sign.  
+   This acknowledges repeated music with "percent" style.  It typesets
+   a % sign.
 
-  TODO:
+   TODO:
 
-  - BEAT case: Create items for single beat repeats, i.e. c4 / / /
+   - BEAT case: Create items for single beat repeats, i.e. c4 / / /
 
-  - DOUBLE_MEASURE case: attach a % to an appropriate barline.
-  
+   - DOUBLE_MEASURE case: attach a % to an appropriate barline.
 */
 class Slash_repeat_engraver : public Engraver
 {
@@ -44,10 +42,10 @@ protected:
   Moment next_moment_;
   Moment body_length_;
 
-  Item * beat_slash_;
-  Item * double_percent_;
+  Item *beat_slash_;
+  Item *double_percent_;
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
   virtual void process_music ();
@@ -60,7 +58,7 @@ Slash_repeat_engraver::Slash_repeat_engraver ()
 }
 
 bool
-Slash_repeat_engraver::try_music (Music * m)
+Slash_repeat_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("repeated-music")
       && !repeat_
@@ -69,7 +67,7 @@ Slash_repeat_engraver::try_music (Music * m)
     {
       body_length_ = Repeated_music::body_get_length (m);
       int count = Repeated_music::repeat_count (m);
-      
+
       Moment now = now_mom ();
       start_mom_ = now;
       stop_mom_ = start_mom_ + Moment (count) * body_length_;
@@ -77,17 +75,17 @@ Slash_repeat_engraver::try_music (Music * m)
 
       Moment meas_length
        = robust_scm2moment (get_property ("measureLength"), Moment (0));
-      if (body_length_ < meas_length )
+      if (body_length_ < meas_length)
        {
          repeat_ = m;
        }
       else
        return false;
-      
+
       Global_context *global = get_global_context ();
-      for (int i = 0; i < count; i++)  
+      for (int i = 0; i < count; i++)
        global->add_moment_to_process (next_moment_ + Moment (i) * body_length_);
-  
+
       return true;
     }
 
@@ -106,7 +104,6 @@ Slash_repeat_engraver::process_music ()
     }
 }
 
-
 void
 Slash_repeat_engraver::start_translation_timestep ()
 {
@@ -123,12 +120,10 @@ Slash_repeat_engraver::stop_translation_timestep ()
 }
 
 
-
-
 ADD_TRANSLATOR (Slash_repeat_engraver,
-/* descr */       "Make beat repeats.",
-/* creats*/       "RepeatSlash",
-/* accepts */     "repeated-music",
-/* acks  */      "",
-/* reads */       "measureLength",
-/* write */       "");
+               /* descr */ "Make beat repeats.",
+               /* creats*/ "RepeatSlash",
+               /* accepts */ "repeated-music",
+               /* acks  */ "",
+               /* reads */ "measureLength",
+               /* write */ "");
index ec1bb088408c5f384e293a296579e0e4e840cde7..6ab45f334eea6b57c793c3b26c86227abc364cb1 100644 (file)
@@ -1,10 +1,9 @@
-/* 
+/*
   slur-configuration.cc -- implement Slur_configuration
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
 #include "slur-configuration.hh"
@@ -23,7 +22,7 @@
 #include "libc-extension.hh"
 
 Bezier
-avoid_staff_line (Slur_score_state const &state, 
+avoid_staff_line (Slur_score_state const &state,
                  Bezier bez)
 {
   Offset horiz (1, 0);
@@ -48,15 +47,15 @@ avoid_staff_line (Slur_score_state const &state,
          && (int (fabs (my_round (p))) % 2
              != Staff_symbol_referencer::line_count (staff) % 2))
        {
-         Direction resolution_dir =
-        (distance ?  state.dir_ : Direction (sign (p - my_round (p))));
+         Direction resolution_dir
+           = (distance ? state.dir_ : Direction (sign (p - my_round (p))));
 
          // TODO: parameter
          Real newp = my_round (p) + resolution_dir
            * 5 * state.thickness_;
-       
+
          Real dy = (newp - p) * state.staff_space_ / 2.0;
-       
+
          bez.control_[1][Y_AXIS] += dy;
          bez.control_[2][Y_AXIS] += dy;
        }
@@ -66,7 +65,7 @@ avoid_staff_line (Slur_score_state const &state,
 
 Real
 fit_factor (Offset dz_unit, Offset dz_perp,
-           Bezier curve, Direction d,  Array<Offset> const &avoid)
+           Bezier curve, Direction d, Array<Offset> const &avoid)
 {
   Real fit_factor = 0.0;
   Offset x0 = curve.control_[0];
@@ -80,7 +79,7 @@ fit_factor (Offset dz_unit, Offset dz_perp,
 
   for (int i = 0; i < avoid.size (); i++)
     {
-      Offset z = (avoid[i] - x0) ;
+      Offset z = (avoid[i] - x0);
       Offset p (dot_product (z, dz_unit),
                d* dot_product (z, dz_perp));
       if (!curve_xext.contains (p[X_AXIS]))
@@ -94,10 +93,10 @@ fit_factor (Offset dz_unit, Offset dz_perp,
     }
   return fit_factor;
 }
-       
+
 void
 Slur_configuration::generate_curve (Slur_score_state const &state,
-                                   Real r_0, Real h_inf )
+                                   Real r_0, Real h_inf)
 {
   Link_array<Grob> encompasses = state.columns_;
 
@@ -111,15 +110,15 @@ Slur_configuration::generate_curve (Slur_score_state const &state,
       Encompass_info inf (state.get_encompass_info (encompasses[i]));
       Real y = state.dir_ * ((state.dir_ * inf.head_) >? (state.dir_ *inf.stem_));
 
-      avoid.push (Offset (inf.x_,  y + state.dir_ * state.parameters_.free_head_distance_));
+      avoid.push (Offset (inf.x_, y + state.dir_ * state.parameters_.free_head_distance_));
     }
 
   Link_array<Grob> extra_encompasses
     = extract_grob_array (state.slur_, ly_symbol2scm ("encompass-objects"));
-  for (int i = 0;  i < extra_encompasses.size (); i++)
+  for (int i = 0; i < extra_encompasses.size (); i++)
     if (Slur::has_interface (extra_encompasses[i]))
       {
-       Grob * small_slur = extra_encompasses[i];
+       Grob *small_slur = extra_encompasses[i];
        Bezier b = Slur::get_curve (small_slur);
 
        Offset z = b.curve_point (0.5);
@@ -138,34 +137,30 @@ Slur_configuration::generate_curve (Slur_score_state const &state,
   Real indent, height;
   get_slur_indent_height (&indent, &height, dz.length (), h_inf, r_0);
 
-
   Real len = dz.length ();
 
   /* This condition,
 
-     len^2 > 4h^2 +  3 (i + 1/3len)^2  - 1/3 len^2
+  len^2 > 4h^2 +  3 (i + 1/3len)^2  - 1/3 len^2
 
-     is equivalent to:
+  is equivalent to:
 
-     |bez' (0)| < | bez' (.5)|
+  |bez' (0)| < | bez' (.5)|
 
-     when (control2 - control1) has the same direction as
-    (control3 - control0).  */
-
-  
+  when (control2 - control1) has the same direction as
+  (control3 - control0).  */
 
   Real max_indent = len / 3.1;
   indent = indent <? max_indent;
-  
+
   Real a1 = sqr (len) / 3.0;
   Real a2 = 0.75 * sqr (indent + len / 3.0);
   Real max_h = a1 - a2;
 
-  
   if (max_h < 0)
     {
       programming_error ("Slur indent too small.");
-      max_h = len / 3.0 ;
+      max_h = len / 3.0;
     }
   else
     {
@@ -173,10 +168,10 @@ Slur_configuration::generate_curve (Slur_score_state const &state,
     }
 
   Real excentricity = robust_scm2double (state.slur_->get_property ("excentricity"), 0);
-  
+
   Real x1 = (excentricity + indent);
   Real x2 = (excentricity - indent);
-  
+
   Bezier curve;
   curve.control_[0] = attachment_[LEFT];
   curve.control_[1] = attachment_[LEFT] + dz_perp * height * state.dir_
@@ -186,7 +181,7 @@ Slur_configuration::generate_curve (Slur_score_state const &state,
   curve.control_[3] = attachment_[RIGHT];
 
   Real ff = fit_factor (dz_unit, dz_perp, curve, state.dir_, avoid);
-  
+
   height = height >? ((height * ff) <? max_h);
 
   curve.control_[0] = attachment_[LEFT];
@@ -200,15 +195,13 @@ Slur_configuration::generate_curve (Slur_score_state const &state,
   height_ = height;
 }
 
-Slur_configuration::Slur_configuration()
+Slur_configuration::Slur_configuration ()
 {
   score_ = 0.0;
-  index_ = -1; 
+  index_ = -1;
 };
 
 
-
-
 void
 Slur_configuration::score_encompass (Slur_score_state const &state)
 {
@@ -225,13 +218,13 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
       Real x = state.encompass_infos_[j].x_;
 
       bool l_edge = j == 0;
-      bool r_edge = j == state.encompass_infos_.size ()-1;
-      bool edge =  l_edge || r_edge;
+      bool r_edge = j == state.encompass_infos_.size () - 1;
+      bool edge = l_edge || r_edge;
 
       if (! (x < attachment_[RIGHT][X_AXIS]
             && x > attachment_[LEFT][X_AXIS]))
        continue;
-       
+
       Real y = bez.get_other_coordinate (X_AXIS, x);
       if (!edge)
        {
@@ -257,29 +250,26 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
                                            attachment_[RIGHT][Y_AXIS],
                                            attachment_[LEFT][Y_AXIS]);
 
-         if ( 1 ) // state.dir_ * state.encompass_infos_[j].get_point (state.dir_) > state.dir_ *line_y )
+         if (1) // state.dir_ * state.encompass_infos_[j].get_point (state.dir_) > state.dir_ *line_y )
            {
-               
-             Real closest =
-               state.dir_ * (state.dir_ * state.encompass_infos_[j].get_point (state.dir_)
-                             >? state.dir_ *line_y
-                             );
+
+             Real closest
+               = state.dir_ * (state.dir_ * state.encompass_infos_[j].get_point (state.dir_)
+                               >? state.dir_ *line_y);
              Real d = fabs (closest - y);
-       
+
              convex_head_distances.push (d);
            }
        }
-       
-       
 
       if (state.dir_ * (y - state.encompass_infos_[j].stem_) < 0)
        {
-         Real stem_dem = state.parameters_.stem_encompass_penalty_ ;
+         Real stem_dem = state.parameters_.stem_encompass_penalty_;
          if ((l_edge && state.dir_ == UP)
              || (r_edge && state.dir_ == DOWN))
            stem_dem /= 5;
 
-         demerit +=  stem_dem;
+         demerit += stem_dem;
        }
       else if (!edge)
        {
@@ -312,7 +302,7 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
        For slurs over 3 or 4 heads, the average distance is not a
        good normalizer.
       */
-      Real n =  convex_head_distances.size ();
+      Real n = convex_head_distances.size ();
       if (n <= 2)
        {
          Real fact = 1.0;
@@ -327,8 +317,8 @@ Slur_configuration::score_encompass (Slur_score_state const &state)
       avg_distance /= n;
       variance_penalty = state.parameters_.head_slur_distance_max_ratio_;
       if (min_dist > 0.0)
-       variance_penalty =
-         (avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_ ) - 1.0)
+       variance_penalty
+         = (avg_distance / (min_dist + state.parameters_.absolute_closeness_measure_) - 1.0)
          <? variance_penalty;
 
       variance_penalty = variance_penalty >? 0.0;
@@ -359,16 +349,16 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state)
       Direction d = LEFT;
       bool found = false;
       Real y = 0.0;
-       
+
       do
        {
          /*
            We need to check for the bound explicitly, since the
            slur-ending can be almost vertical, making the Y
            coordinate a bad approximation of the object-slur
-           distance.           
+           distance.
          */
-         Item * as_item =  dynamic_cast<Item*> (state.extra_encompass_infos_[j].grob_);
+         Item *as_item = dynamic_cast<Item *> (state.extra_encompass_infos_[j].grob_);
          if ((as_item
               && as_item->get_column ()
               == state.extremes_[d] .bound_->get_column ())
@@ -387,14 +377,14 @@ Slur_configuration::score_extra_encompass (Slur_score_state const &state)
 
          if (!slur_wid.contains (x))
            continue;
-       
+
          y = curve_.get_other_coordinate (X_AXIS, x);
        }
 
       Real dist = state.extra_encompass_infos_[j].extents_[Y_AXIS].distance (y);
-      demerit +=
-       fabs (0 >? (state.parameters_.extra_encompass_free_distance_ - dist)) /
-       state.parameters_.extra_encompass_free_distance_
+      demerit
+       += fabs (0 >? (state.parameters_.extra_encompass_free_distance_ - dist))
+       state.parameters_.extra_encompass_free_distance_
        * state.extra_encompass_infos_[j].penalty_;
     }
 #if DEBUG_SLUR_SCORING
@@ -414,18 +404,17 @@ Slur_configuration::score_edges (Slur_score_state const &state)
     {
       Real y = attachment_[d][Y_AXIS];
       Real dy = fabs (y - state.base_attachments_[d][Y_AXIS]);
-       
+
       Real factor = state.parameters_.edge_attraction_factor_;
       Real demerit = factor * dy;
       if (state.extremes_[d].stem_
          && state.extremes_[d].stem_dir_ == state.dir_
-         && !Stem::get_beaming (state.extremes_[d].stem_, -d)
-         )
+         && !Stem::get_beaming (state.extremes_[d].stem_, -d))
        demerit /= 5;
 
       demerit *= exp (state.dir_ * d * slope
-                     * state.parameters_.edge_slope_exponent_ );
-       
+                     * state.parameters_.edge_slope_exponent_);
+
       score_ += demerit;
 #if DEBUG_SLUR_SCORING
       score_card_ += to_string ("E%.2f", demerit);
@@ -455,7 +444,7 @@ Slur_configuration ::score_slopes (Slur_score_state const &state)
     demerit += state.parameters_.steeper_slope_factor_
       * ((fabs (slur_dy) -max_dy) >? 0);
 
-  demerit += ((fabs (slur_dy/slur_dz[X_AXIS])
+  demerit += ((fabs (slur_dy / slur_dz[X_AXIS])
               - state.parameters_.max_slope_) >? 0)
     * state.parameters_.max_slope_factor_;
 
@@ -478,12 +467,11 @@ Slur_configuration ::score_slopes (Slur_score_state const &state)
   score_ += demerit;
 }
 
-
 void
 Slur_configuration::score (Slur_score_state const &state)
 {
   score_extra_encompass (state);
-  score_slopes  (state);
+  score_slopes (state);
   score_edges (state);
   score_encompass (state);
 }
index 48565f5ee13e954a854b4ea9f34487248aa02cc2..200ad5c0f3a8d82f6265224031c695fcc63ce963 100644 (file)
 class Slur_engraver : public Engraver
 {
   Drul_array<Music *> events_;
-  Music * running_slur_start_;
+  Music *running_slur_start_;
   Link_array<Grob> slurs_;
   Link_array<Grob> end_slurs_;
 
   void set_melisma (bool);
 
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual void finalize ();
@@ -75,9 +75,9 @@ Slur_engraver::acknowledge_grob (Grob_info info)
   Grob *e = info.grob_;
   if (Note_column::has_interface (info.grob_))
     {
-      for (int i = slurs_.size (); i--; )
+      for (int i = slurs_.size (); i--;)
        Slur::add_column (slurs_[i], e);
-      for (int i = end_slurs_.size (); i-- ; )
+      for (int i = end_slurs_.size (); i--;)
        Slur::add_column (end_slurs_[i], e);
     }
   else
@@ -86,21 +86,21 @@ Slur_engraver::acknowledge_grob (Grob_info info)
       if (Tie::has_interface (e)
          || to_boolean (inside))
        {
-         for (int i = slurs_.size (); i--; )
+         for (int i = slurs_.size (); i--;)
            Slur::add_extra_encompass (slurs_[i], e);
-         for (int i = end_slurs_.size (); i--; )
+         for (int i = end_slurs_.size (); i--;)
            Slur::add_extra_encompass (end_slurs_[i], e);
        }
       else if (inside == SCM_BOOL_F)
        {
-         Grob *slur = slurs_.size()?slurs_[0] : 0;
-         slur =  (end_slurs_.size () && !slur)
+         Grob *slur = slurs_.size ()?slurs_[0] : 0;
+         slur = (end_slurs_.size () && !slur)
            ? end_slurs_[0] : slur;
 
          if (slur)
            {
              e->add_offset_callback (Slur::outside_slur_callback_proc, Y_AXIS);
-             e->set_property ("slur", slur->self_scm());
+             e->set_property ("slur", slur->self_scm ());
            }
        }
     }
@@ -110,7 +110,7 @@ void
 Slur_engraver::finalize ()
 {
   if (slurs_.size ())
-    slurs_[0]->warning (_("unterminated slur"));
+    slurs_[0]->warning (_ ("unterminated slur"));
 }
 
 void
@@ -118,22 +118,22 @@ Slur_engraver::process_music ()
 {
   if (events_[STOP])
     {
-      if (slurs_.size() == 0)
+      if (slurs_.size () == 0)
        {
-         events_[STOP]->origin()->warning (_ ("No slur to end"));
+         events_[STOP]->origin ()->warning (_ ("No slur to end"));
        }
-      
+
       end_slurs_ = slurs_;
       slurs_.clear ();
     }
-  
+
   if (events_[START] && slurs_.is_empty ())
     {
       Music *ev = events_[START];
 
       bool double_slurs = to_boolean (get_property ("doubleSlurs"));
 
-      Grob * slur = make_spanner ("Slur", events_[START]->self_scm ());
+      Grob *slur = make_spanner ("Slur", events_[START]->self_scm ());
       Direction updown = to_dir (ev->get_property ("direction"));
       if (updown && !double_slurs)
        set_grob_direction (slur, updown);
@@ -145,7 +145,7 @@ Slur_engraver::process_music ()
          set_grob_direction (slur, DOWN);
          slur = make_spanner ("Slur", events_[START]->self_scm ());
          set_grob_direction (slur, UP);
-         slurs_.push (slur); 
+         slurs_.push (slur);
        }
     }
   set_melisma (slurs_.size ());
@@ -159,9 +159,9 @@ Slur_engraver::stop_translation_timestep ()
 }
 
 ADD_TRANSLATOR (Slur_engraver,
-  /* descr */       "Build slurs grobs from slur events",
-  /* creats*/       "Slur",
-  /* accepts */     "slur-event",
-  /* acks  */      "note-column-interface accidental-interface fingering-interface script-interface tie-interface text-script-interface",
-  /* reads */       "slurMelismaBusy doubleSlurs",
-  /* write */       "");
+               /* descr */ "Build slurs grobs from slur events",
+               /* creats*/ "Slur",
+               /* accepts */ "slur-event",
+               /* acks  */ "note-column-interface accidental-interface fingering-interface script-interface tie-interface text-script-interface",
+               /* reads */ "slurMelismaBusy doubleSlurs",
+               /* write */ "");
index 1c0b9f9ebf982daef4b08f27677ac908de01d123..aa3d4cdc6b8b4264a7baff8f6a3610cb2a206be5 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "performer.hh"
 #include "audio-item.hh"
 
 /*
   this is C&P from beam_performer.
- */
+*/
 
-class Slur_performer : public Performer {
+class Slur_performer : public Performer
+{
 public:
   TRANSLATOR_DECLARATIONS (Slur_performer);
-  
+
 protected:
-  virtual bool try_music (Music *ev) ;
+  virtual bool try_music (Music *ev);
   virtual void start_translation_timestep ();
   virtual void process_music ();
   void set_melisma (bool);
@@ -38,8 +39,7 @@ Slur_performer::Slur_performer ()
   now_stop_ev_ = 0;
 }
 
-
-void 
+void
 Slur_performer::process_music ()
 {
   if (now_stop_ev_)
@@ -55,7 +55,6 @@ Slur_performer::process_music ()
     }
 }
 
-
 void
 Slur_performer::set_melisma (bool ml)
 {
@@ -68,7 +67,7 @@ Slur_performer::start_translation_timestep ()
   start_ev_ = 0;
   now_stop_ev_ = 0;
 }
+
 bool
 Slur_performer::try_music (Music *m)
 {
@@ -90,5 +89,5 @@ Slur_performer::try_music (Music *m)
 }
 
 ADD_TRANSLATOR (Slur_performer, "", "",
-                 "slur-event", "", "", "");
+               "slur-event", "", "", "");
 
index b06a1b019efa16e093a5fe7a3c031e968afc1421..9539ced5c614011b417d10c9cda43ec04c0ec773 100644 (file)
@@ -7,7 +7,6 @@
   Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
 #include <math.h>
 
 #include "slur-scoring.hh"
   - calculate encompass scoring directly after determining slur shape.
 
   - optimize.
-
 */
 struct Slur_score_state;
 
-Slur_score_state::Slur_score_state()
+Slur_score_state::Slur_score_state ()
 {
   musical_dy_ = 0.0;
   valid_ = false;
@@ -130,7 +128,7 @@ broken_trend_y (Slur_score_state const &state, Direction hdir)
   /* A broken slur should maintain the same vertical trend
      the unbroken slur would have had.  */
   Real by = 0.0;
-  if (Spanner *mother = dynamic_cast<Spanner*> (state.slur_->original_))
+  if (Spanner *mother = dynamic_cast<Spanner *> (state.slur_->original_))
     {
       int k = broken_spanner_index (state.slur_);
       int j = k + hdir;
@@ -139,35 +137,34 @@ broken_trend_y (Slur_score_state const &state, Direction hdir)
 
       Grob *neighbor = mother->broken_intos_[j];
       Spanner *common_mother
-       = dynamic_cast<Spanner*> (state.common_[Y_AXIS]->original_);
+       = dynamic_cast<Spanner *> (state.common_[Y_AXIS]->original_);
       int common_k
-       = broken_spanner_index (dynamic_cast<Spanner*> (state.common_[Y_AXIS]));
+       = broken_spanner_index (dynamic_cast<Spanner *> (state.common_[Y_AXIS]));
       int common_j = common_k + hdir;
 
       if (common_j < 0 || common_j >= common_mother->broken_intos_.size ())
        return by;
 
       Grob *common_next_system = common_mother->broken_intos_[common_j];
-      
-      SCM last_point =  scm_car (scm_last_pair (neighbor->get_property ("control-points")));
-      
+
+      SCM last_point = scm_car (scm_last_pair (neighbor->get_property ("control-points")));
+
       return scm_to_double (scm_cdr (last_point))
        + neighbor->relative_coordinate (common_next_system, Y_AXIS);
     }
   return by;
 }
 
-
 /*
   copy slur dir forwards across line break.
 */
 void
-Slur_score_state::set_next_direction () 
+Slur_score_state::set_next_direction ()
 {
   if (extremes_[RIGHT].note_column_)
     return;
-  
-  if (Spanner *mother = dynamic_cast<Spanner*> (slur_->original_))
+
+  if (Spanner *mother = dynamic_cast<Spanner *> (slur_->original_))
     {
       int k = broken_spanner_index (slur_);
       int j = k + 1;
@@ -228,8 +225,6 @@ Slur_score_state::get_encompass_info (Grob *col) const
 }
 
 
-
-
 Drul_array<Bound_info>
 Slur_score_state::get_bound_info () const
 {
@@ -275,26 +270,26 @@ Slur_score_state::get_bound_info () const
 void
 Slur_score_state::fill (Grob *me)
 {
-  slur_ = dynamic_cast<Spanner*> (me);
-  columns_ 
+  slur_ = dynamic_cast<Spanner *> (me);
+  columns_
     = extract_grob_array (me, ly_symbol2scm ("note-columns"));
-  
+
   if (columns_.is_empty ())
     {
       me->suicide ();
-      return ;
+      return;
     }
 
   staff_space_ = Staff_symbol_referencer::staff_space (me);
   Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
-  thickness_ = robust_scm2double (me->get_property ("thickness"), 1.0) *  lt;
-  
+  thickness_ = robust_scm2double (me->get_property ("thickness"), 1.0) * lt;
+
   dir_ = get_grob_direction (me);
   parameters_.fill (me);
-  
+
   SCM eltlist = me->get_property ("note-columns");
   SCM extra_list = me->get_property ("encompass-objects");
-  Spanner *sp = dynamic_cast<Spanner*> (me);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
 
   for (int i = X_AXIS; i < NO_AXES; i++)
     {
@@ -303,38 +298,38 @@ Slur_score_state::fill (Grob *me)
       common_[a] = common_refpoint_of_list (extra_list, common_[a], a);
 
       Direction d = LEFT;
-      do {
-       /*
-         If bound is not in note-columns, we don't want to know about
-         its Y-position
-        */
-       if (a != Y_AXIS) 
-         common_[a] = common_[a]->common_refpoint (sp->get_bound (d), a);
-      }
+      do
+       {
+         /*
+           If bound is not in note-columns, we don't want to know about
+           its Y-position
+         */
+         if (a != Y_AXIS)
+           common_[a] = common_[a]->common_refpoint (sp->get_bound (d), a);
+       }
       while (flip (&d) != LEFT);
     }
 
   extremes_ = get_bound_info ();
   is_broken_ = (!extremes_[LEFT].note_column_
-               || !extremes_[RIGHT].note_column_); 
+               || !extremes_[RIGHT].note_column_);
+
+  has_same_beam_
+    = (extremes_[LEFT].stem_ && extremes_[RIGHT].stem_
+       && Stem::get_beam (extremes_[LEFT].stem_) == Stem::get_beam (extremes_[RIGHT].stem_));
 
-  has_same_beam_ =
-    (extremes_[LEFT].stem_ && extremes_[RIGHT].stem_
-     && Stem::get_beam (extremes_[LEFT].stem_) == Stem::get_beam (extremes_[RIGHT].stem_));
-  
   base_attachments_ = get_base_attachments ();
 
   Drul_array<Real> end_ys
     = get_y_attachment_range ();
 
-  configurations_ = enumerate_attachments ( end_ys);
+  configurations_ = enumerate_attachments (end_ys);
   for (int i = 0; i < columns_.size (); i++)
-    encompass_infos_.push (get_encompass_info ( columns_[i]));
+    encompass_infos_.push (get_encompass_info (columns_[i]));
 
   extra_encompass_infos_ = get_extra_encompass_infos ();
   valid_ = true;
 
-
   musical_dy_ = 0.0;
   Direction d = LEFT;
   do
@@ -344,13 +339,11 @@ Slur_score_state::fill (Grob *me)
          * extremes_[d].slur_head_->relative_coordinate (common_[Y_AXIS], Y_AXIS);
     }
   while (flip (&d) != LEFT);
-  
+
   edge_has_beams_
     = (extremes_[LEFT].stem_ && Stem::get_beam (extremes_[LEFT].stem_))
     || (extremes_[RIGHT].stem_ && Stem::get_beam (extremes_[RIGHT].stem_));
 
-
-  
   set_next_direction ();
 
   if (is_broken_)
@@ -365,7 +358,7 @@ set_slur_control_points (Grob *me)
 
   if (!state.valid_)
     return;
-  
+
   state.generate_curves ();
 
   SCM end_ys = me->get_property ("positions");
@@ -377,7 +370,7 @@ set_slur_control_points (Grob *me)
     }
   else
     {
-      best = state.get_best_curve();
+      best = state.get_best_curve ();
     }
 
   SCM controls = SCM_EOL;
@@ -385,13 +378,12 @@ set_slur_control_points (Grob *me)
     {
       Offset o = best.control_[i]
        - Offset (me->relative_coordinate (state.common_[X_AXIS], X_AXIS),
-                 me->relative_coordinate (state.common_[Y_AXIS], Y_AXIS));
+                 me->relative_coordinate (state.common_[Y_AXIS], Y_AXIS));
       controls = scm_cons (ly_offset2scm (o), controls);
     }
   me->set_property ("control-points", controls);
 }
 
-
 Bezier
 Slur_score_state::get_best_curve ()
 {
@@ -399,7 +391,7 @@ Slur_score_state::get_best_curve ()
     {
       configurations_[i]->score (*this);
     }
-  
+
   Real opt = 1e6;
   int opt_idx = -1;
   for (int i = 0; i < configurations_.size (); i++)
@@ -418,7 +410,7 @@ Slur_score_state::get_best_curve ()
       && scm_is_pair (inspect_quants))
     opt_idx = get_closest_index (inspect_quants);
 
-  configurations_[opt_idx]->score_card_ += to_string ("=%.2f", opt);  
+  configurations_[opt_idx]->score_card_ += to_string ("=%.2f", opt);
   configurations_[opt_idx]->score_card_ += to_string ("i%d", opt_idx);
 
   // debug quanting
@@ -437,7 +429,7 @@ Slur_score_state::get_closest_index (SCM inspect_quants) const
 
   int opt_idx = -1;
   Real mindist = 1e6;
-  for (int i = 0; i < configurations_.size (); i ++)
+  for (int i = 0; i < configurations_.size (); i++)
     {
       Real d = fabs (configurations_[i]->attachment_[LEFT][Y_AXIS] - ins[LEFT])
        + fabs (configurations_[i]->attachment_[RIGHT][Y_AXIS] - ins[RIGHT]);
@@ -455,7 +447,7 @@ Slur_score_state::get_closest_index (SCM inspect_quants) const
 /*
   TODO: should analyse encompasses to determine sensible region, and
   should limit slopes available.
- */
+*/
 
 Drul_array<Real>
 Slur_score_state::get_y_attachment_range () const
@@ -467,9 +459,9 @@ Slur_score_state::get_y_attachment_range () const
       if (extremes_[d].note_column_)
        {
          end_ys[d] = dir_
-           * ((dir_ * (base_attachments_[d][Y_AXIS] +  parameters_.region_size_* dir_))
+           * ((dir_ * (base_attachments_[d][Y_AXIS] + parameters_.region_size_* dir_))
               >? (dir_ * (dir_ + extremes_[d].note_column_->extent (common_[Y_AXIS],
-                                                                Y_AXIS)[dir_]))
+                                                                    Y_AXIS)[dir_]))
               >? (dir_ * base_attachments_[-d][Y_AXIS]));
        }
       else
@@ -481,21 +473,21 @@ Slur_score_state::get_y_attachment_range () const
 }
 
 bool
-spanner_less (Spanner *s1, Spanners2)
+spanner_less (Spanner *s1, Spanner *s2)
 {
   Slice b1, b2;
-  Direction d  = LEFT;
+  Direction d = LEFT;
   do
     {
       b1[d] = s1->get_bound (d)->get_column ()->rank_;
       b2[d] = s2->get_bound (d)->get_column ()->rank_;
-    } while (flip (&d) != LEFT);
+    }
+  while (flip (&d) != LEFT);
 
   return b2[LEFT] <= b1[LEFT] && b2[RIGHT] >= b1[RIGHT]
     && (b2[LEFT] != b1[LEFT] || b2[RIGHT] != b1[RIGHT]);
 }
 
-
 Drul_array<Offset>
 Slur_score_state::get_base_attachments () const
 {
@@ -510,10 +502,10 @@ Slur_score_state::get_base_attachments () const
       Real y = 0.0;
       if (extremes_[d].note_column_)
        {
-        
+
          /*
            fixme: X coord should also be set in this case.
-          */
+         */
          if (stem
              && extremes_[d].stem_dir_ == dir_
              && Stem::get_beaming (stem, -d)
@@ -524,18 +516,18 @@ Slur_score_state::get_base_attachments () const
            y = head->extent (common_[Y_AXIS], Y_AXIS)[dir_];
          y += dir_ * 0.5 * staff_space_;
 
+         y = move_away_from_staffline (y, head);
 
-         y = move_away_from_staffline (y, head); 
-
-         Grob * fh = Note_column::first_head (extremes_[d].note_column_);
-         x =
-        (fh ? fh->extent (common_[X_AXIS], X_AXIS)
-            : extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS))
+         Grob *fh = Note_column::first_head (extremes_[d].note_column_);
+         x
+           = (fh ? fh->extent (common_[X_AXIS], X_AXIS)
+              : extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS))
            .linear_combination (CENTER);
        }
       base_attachment[d] = Offset (x, y);
 
-    } while (flip (&d) != LEFT);
+    }
+  while (flip (&d) != LEFT);
 
   do
     {
@@ -550,13 +542,13 @@ Slur_score_state::get_base_attachments () const
            {
              x = slur_->get_broken_left_end_align ();
            }
-         Grob * col = (d == LEFT) ? columns_[0] : columns_.top();
-             
+         Grob *col = (d == LEFT) ? columns_[0] : columns_.top ();
+
          if (extremes_[-d].bound_ != col)
            {
              y = robust_relative_extent (col, common_[Y_AXIS], Y_AXIS)[dir_];
              y += dir_ * 0.5 * staff_space_;
-             
+
              if (get_grob_direction (col) == dir_
                  && Note_column::get_stem (col)
                  && !Stem::is_invisible (Note_column::get_stem (col)))
@@ -565,10 +557,9 @@ Slur_score_state::get_base_attachments () const
          else
            y = base_attachment[-d][Y_AXIS];
 
-         
          y = move_away_from_staffline (y, col);
-           
-         base_attachment[d] = Offset (x, y);  
+
+         base_attachment[d] = Offset (x, y);
        }
     }
   while (flip (&d) != LEFT);
@@ -582,13 +573,12 @@ Slur_score_state::move_away_from_staffline (Real y,
 {
   Real pos
     = (y - Staff_symbol_referencer::get_staff_symbol (on_staff)->relative_coordinate (common_[Y_AXIS],
-                                                                              Y_AXIS))
+                                                                                     Y_AXIS))
     * 2.0 / staff_space_;
-  
+
   if (fabs (pos - my_round (pos)) < 0.2
       && Staff_symbol_referencer::on_staffline (on_staff, (int) rint (pos))
-      && Staff_symbol_referencer::line_count (on_staff) - 1 >= rint (pos)
-      )
+      && Staff_symbol_referencer::line_count (on_staff) - 1 >= rint (pos))
     y += 1.5 * staff_space_ * dir_ / 10;
 
   return y;
@@ -604,15 +594,12 @@ Slur_score_state::generate_curves () const
 }
 
 
-
-
-Link_array<Slur_configuration> 
+Link_array<Slur_configuration>
 Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
 {
   /*ugh.   */
   Link_array<Slur_configuration> scores;
 
-
   Drul_array<Offset> os;
   os[LEFT] = base_attachments_[LEFT];
   Real minimum_length = staff_space_
@@ -643,19 +630,17 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
                    }
                  else if (dir_ * extremes_[d].stem_extent_[Y_AXIS][dir_]
                           < dir_ * os[d][Y_AXIS]
-                          && !extremes_[d].stem_extent_[X_AXIS].is_empty ()
-                          )
-               
+                          && !extremes_[d].stem_extent_[X_AXIS].is_empty ())
+
                    os[d][X_AXIS] = extremes_[d].stem_extent_[X_AXIS].center ();
                }
            }
          while (flip (&d) != LEFT);
 
-         Offset dz;    
+         Offset dz;
          dz = os[RIGHT] - os[LEFT];
          if (dz[X_AXIS] < minimum_length
-             || fabs (dz[Y_AXIS] / dz[X_AXIS]) > parameters_.max_slope_
-             )
+             || fabs (dz[Y_AXIS] / dz[X_AXIS]) > parameters_.max_slope_)
            {
              do
                {
@@ -676,7 +661,7 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
                {
                  /* Horizontally move tilted slurs a little.  Move
                     more for bigger tilts.
-               
+
                     TODO: parameter */
                  os[d][X_AXIS]
                    -= dir_ * extremes_[d].slur_head_extent_.length ()
@@ -684,12 +669,12 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
                }
            }
          while (flip (&d) != LEFT);
-       
+
          s.attachment_ = os;
          s.index_ = scores.size ();
 
          scores.push (new Slur_configuration (s));
-         
+
          os[RIGHT][Y_AXIS] += dir_ * staff_space_ / 2;
        }
 
@@ -700,18 +685,17 @@ Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
   return scores;
 }
 
-
 Array<Extra_collision_info>
 Slur_score_state::get_extra_encompass_infos () const
 {
   Link_array<Grob> encompasses
     = extract_grob_array (slur_, ly_symbol2scm ("encompass-objects"));
   Array<Extra_collision_info> collision_infos;
-  for (int i = encompasses.size (); i--; )
+  for (int i = encompasses.size (); i--;)
     {
       if (Slur::has_interface (encompasses[i]))
        {
-         Spanner * small_slur = dynamic_cast<Spanner*> (encompasses[i]);
+         Spanner *small_slur = dynamic_cast<Spanner *> (encompasses[i]);
          Bezier b = Slur::get_curve (small_slur);
 
          Offset relative (small_slur->relative_coordinate (common_[X_AXIS], X_AXIS),
@@ -719,7 +703,7 @@ Slur_score_state::get_extra_encompass_infos () const
 
          for (int k = 0; k < 3; k++)
            {
-             Direction hdir =  Direction (k /2 - 1);
+             Direction hdir = Direction (k /2 - 1);
 
              /*
                Only take bound into account if small slur starts
@@ -727,7 +711,7 @@ Slur_score_state::get_extra_encompass_infos () const
              */
              if (hdir && small_slur->get_bound (hdir) != slur_->get_bound (hdir))
                continue;
-       
+
              Offset z = b.curve_point (k / 2.0);
              z += relative;
 
@@ -763,7 +747,7 @@ Slur_score_state::get_extra_encompass_infos () const
                  SCM cstyle = g->get_property ("cautionary-style");
                  parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
                }
-       
+
              SCM accs = g->get_property ("accidentals");
              SCM scm_style = g->get_property ("style");
              if (!scm_is_symbol (scm_style)
@@ -776,10 +760,10 @@ Slur_score_state::get_extra_encompass_infos () const
                    case FLAT:
                    case DOUBLE_FLAT:
                      xp = LEFT;
-                     break ;
+                     break;
                    case SHARP:
                      xp = 0.5 * dir_;
-                     break ;
+                     break;
                    case NATURAL:
                      xp = -dir_;
                      break;
@@ -789,7 +773,7 @@ Slur_score_state::get_extra_encompass_infos () const
 
          ye.widen (thickness_ * 0.5);
          xe.widen (thickness_ * 1.0);
-         Extra_collision_info info (g, xp, xe, ye,  penalty);
+         Extra_collision_info info (g, xp, xe, ye, penalty);
          collision_infos.push (info);
        }
     }
index c219eb06072a109f7537d605c42e56e3a95c908e..a35784eb3d2475e89965aa8375bce045f4454527 100644 (file)
@@ -68,11 +68,11 @@ Slur::print (SCM smob)
   /*
     TODO: replace dashed with generic property.
   */
-  SCM p =  me->get_property ("dash-period");
-  SCM f =  me->get_property ("dash-fraction");
+  SCM p = me->get_property ("dash-period");
+  SCM f = me->get_property ("dash-fraction");
   if (scm_is_number (p) && scm_is_number (f))
-    a = Lookup::dashed_slur (one, thick, robust_scm2double (p, 1.0), 
-            robust_scm2double(f,0));
+    a = Lookup::dashed_slur (one, thick, robust_scm2double (p, 1.0),
+                            robust_scm2double (f, 0));
   else
     a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0,
                      thick);
@@ -97,9 +97,8 @@ Slur::print (SCM smob)
   return a.smobbed_copy ();
 }
 
-
 Bezier
-Slur::get_curve (Grob*me)
+Slur::get_curve (Grob *me)
 {
   Bezier b;
   int i = 0;
@@ -111,21 +110,18 @@ Slur::get_curve (Grob*me)
 }
 
 void
-Slur::add_column (Grob*me, Grob*n)
+Slur::add_column (Grob *me, Grob *n)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n);
-  add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*> (n));
+  add_bound_item (dynamic_cast<Spanner *> (me), dynamic_cast<Item *> (n));
 }
 
-
 void
-Slur::add_extra_encompass (Grob*me, Grob*n)
+Slur::add_extra_encompass (Grob *me, Grob *n)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("encompass-objects"), n);
 }
 
-
-
 MAKE_SCHEME_CALLBACK (Slur, outside_slur_callback, 2);
 SCM
 Slur::outside_slur_callback (SCM grob, SCM axis)
@@ -138,7 +134,7 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
 
   if (!slur)
     return scm_from_int (0);
-  
+
   Grob *cx = script->common_refpoint (slur, X_AXIS);
   Grob *cy = script->common_refpoint (slur, Y_AXIS);
 
@@ -150,12 +146,11 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
   Interval yext = robust_relative_extent (script, cy, Y_AXIS);
   Interval xext = robust_relative_extent (script, cx, X_AXIS);
 
-
   Real slur_padding = robust_scm2double (script->get_property ("slur-padding"),
                                         0.0);  // todo: slur property, script property?
   yext.widen (slur_padding);
   Real EPS = 1e-3;
-  
+
   Interval bezext (curve.control_[0][X_AXIS],
                   curve.control_[3][X_AXIS]);
 
@@ -172,13 +167,13 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
       if (consider[k])
        {
          ys[k]
-           = (fabs(bezext[LEFT] - x) < EPS)
+           = (fabs (bezext[LEFT] - x) < EPS)
            ? curve.control_[0][Y_AXIS]
-           : ((fabs(bezext[RIGHT] - x) < EPS)
+           : ((fabs (bezext[RIGHT] - x) < EPS)
               ? curve.control_[3][Y_AXIS]
               : curve.get_other_coordinate (X_AXIS, x));
          consider[k] = true;
-         
+
          if (yext.contains (ys[k]))
            do_shift = true;
        }
@@ -195,18 +190,18 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
          k++;
        }
     }
-  
+
   return scm_make_real (offset);
 }
 
 static Direction
-get_default_dir (Grob*me)
+get_default_dir (Grob *me)
 {
   Link_array<Grob> encompasses
     = extract_grob_array (me, ly_symbol2scm ("note-columns"));
 
   Direction d = DOWN;
-  for (int i = 0; i < encompasses.size (); i ++)
+  for (int i = 0; i < encompasses.size (); i++)
     {
       if (Note_column::dir (encompasses[i]) < 0)
        {
@@ -217,12 +212,11 @@ get_default_dir (Grob*me)
   return d;
 }
 
-
 MAKE_SCHEME_CALLBACK (Slur, after_line_breaking, 1);
 SCM
 Slur::after_line_breaking (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (smob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
   if (!scm_ilength (me->get_property ("note-columns")))
     {
       me->suicide ();
@@ -242,4 +236,3 @@ ADD_INTERFACE (Slur, "slur-interface",
               "A slur",
               "positions quant-score excentricity encompass-objects control-points dash-period dash-fraction slur-details direction height-limit note-columns ratio thickness");
 
-
index 6957cc19c0217e18e2af538b9d1f8547a789adbb..c20fce8fb50a7e9db63843f40465d0d03a13f083 100644 (file)
@@ -16,7 +16,7 @@
 #include <sstream>
 #else
 #include <strstream>
-#define istringstream(x) istrstream(x, length ()) 
+#define istringstream(x) istrstream (x, length ())
 #endif
 
 #include "warn.hh"
@@ -36,7 +36,7 @@ Source_file::load_stdin ()
   contents_str0_ = chs.remove_array ();
 }
 
-char*
+char *
 gulp_file (String filename, int *filesize)
 {
   /* "b" must ensure to open literally, avoiding text (CR/LF)
@@ -68,7 +68,7 @@ Source_file::Source_file (String filename, String data)
 {
   name_ = filename;
   istream_ = 0;
-  contents_str0_ = data.get_copy_str0();
+  contents_str0_ = data.get_copy_str0 ();
   length_ = data.length ();
   pos_str0_ = to_str0 ();
   init_port ();
@@ -88,7 +88,7 @@ Source_file::Source_file (String filename_string)
     load_stdin ();
   else
     contents_str0_ = gulp_file (filename_string, &length_);
-  
+
   pos_str0_ = to_str0 ();
 
   init_port ();
@@ -153,17 +153,17 @@ Source_file::~Source_file ()
 }
 
 Slice
-Source_file::line_slice (char constpos_str0) const
+Source_file::line_slice (char const *pos_str0) const
 {
   if (!contains (pos_str0))
     return Slice (0, 0);
 
-  char constdata_str0 = to_str0 ();
-  char const * eof_C_ = data_str0 + length ();
+  char const *data_str0 = to_str0 ();
+  char const *eof_C_ = data_str0 + length ();
 
   if (pos_str0 == eof_C_)
-    pos_str0 --;
-  char constbegin_str0 = pos_str0;
+    pos_str0--;
+  char const *begin_str0 = pos_str0;
   while (begin_str0 > data_str0)
     if (*--begin_str0 == '\n')
       {
@@ -189,22 +189,22 @@ Source_file::line_string (char const* pos_str0) const
     return "";
 
   Slice line = line_slice (pos_str0);
-  char constdata_str0 = to_str0 ();
-  return String ((Byte const*)data_str0 + line[LEFT], line.length ());
+  char const *data_str0 = to_str0 ();
+  return String ((Byte const *)data_str0 + line[LEFT], line.length ());
 }
 
 int
-Source_file::get_char (char constpos_str0) const
+Source_file::get_char (char const *pos_str0) const
 {
   if (!contains (pos_str0))
     return 0;
 
-  char constdata_str0 = to_str0 ();
+  char const *data_str0 = to_str0 ();
   return pos_str0 - (line_slice (pos_str0)[SMALLER] + data_str0);
 }
 
 int
-Source_file::get_column (char constpos_str0) const
+Source_file::get_column (char const *pos_str0) const
 {
   if (!contains (pos_str0))
     return 0;
@@ -293,10 +293,10 @@ Source_file::set_pos (char const * pos_str0)
     error (error_string (pos_str0) + "invalid pos");
 }
 
-char const*
+char const *
 Source_file::seek_str0 (int n)
 {
-  char constnew_str0 = to_str0 () + n;
+  char const *new_str0 = to_str0 () + n;
   if (n < 0)
     new_str0 += length ();
   if (contains (new_str0))
@@ -307,15 +307,15 @@ Source_file::seek_str0 (int n)
   return pos_str0_;
 }
 
-char const*
+char const *
 Source_file::forward_str0 (int n)
 {
-  char constold_pos = pos_str0_;
-  char constnew_str0 = pos_str0_ + n;
+  char const *old_pos = pos_str0_;
+  char const *new_str0 = pos_str0_ + n;
   if (contains (new_str0))
     pos_str0_ = new_str0;
   else
-    error (error_string (new_str0)  + "forward past eof");
+    error (error_string (new_str0) + "forward past eof");
 
   return old_pos;
 }
@@ -323,6 +323,6 @@ Source_file::forward_str0 (int n)
 String
 Source_file::get_string (int n)
 {
-  String str = String ((Byte const*)forward_str0 (n), n);
+  String str = String ((Byte const *)forward_str0 (n), n);
   return str;
 }
index b73fa590ac72755bfd31fbdfa1fafe45d6237659..4cf670458a8652e1855e4ebb7403e4c4d01d764d 100644 (file)
@@ -32,30 +32,30 @@ Sources::set_path (File_path *f)
 }
 
 /**
-  open a file
+   open a file
 
-  @param file_string the file to be opened, name might be changed if it
-  is found in a search path. UGH!
+   @param file_string the file to be opened, name might be changed if it
+   is found in a search path. UGH!
 
-  @return 0 if no file found
-  */
-Source_file*
+   @return 0 if no file found
+*/
+Source_file *
 Sources::get_file (String &file_string) //UGH
 {
   if ((file_string != "-") && path_)
     {
-      String file_string_o = path_->find (file_string); 
+      String file_string_o = path_->find (file_string);
       if ((file_string_o == "") && (file_string != ""))
        return 0;
       file_string = file_string_o;
     }
-  Source_file * f = new Source_file (file_string) ;
+  Source_file *f = new Source_file (file_string);
   add (f);
   return f;
 }
 
 void
-Sources::add (Source_filesourcefile)
+Sources::add (Source_file *sourcefile)
 {
   sourcefile_list_ = new Killing_cons<Source_file> (sourcefile, sourcefile_list_);
 }
@@ -65,16 +65,16 @@ Sources::~Sources ()
   delete sourcefile_list_;
 }
 /**
-  search the list for file whose map contains pointer #str0#
+   search the list for file whose map contains pointer #str0#
 
-  @return 0 if not found.
-  */
-Source_file*
-Sources::get_sourcefile (char conststr0)
+   @return 0 if not found.
+*/
+Source_file *
+Sources::get_sourcefile (char const *str0)
 {
 
   for (Cons<Source_file> *i = sourcefile_list_; i; i = i->next_)
-    if (i->car_->contains (str0))      
+    if (i->car_->contains (str0))
       return i->car_;
   return 0;
 }
index 23b2c6cb692dbda3505f80fbc9b797aa0d851609..17d15ba94b66664f2bb3bf1641adab698ae67d47 100644 (file)
@@ -1,15 +1,14 @@
-/*   
+/*
   spaceable-grob.cc -- implement Spaceable_grob
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "spaceable-grob.hh"
 
-#include <cstdio> 
+#include <cstdio>
 #include <math.h>
 
 #include "warn.hh"
@@ -17,7 +16,7 @@
 #include "group-interface.hh"
 
 SCM
-Spaceable_grob::get_minimum_distances (Grob*me)
+Spaceable_grob::get_minimum_distances (Grob *me)
 {
   return me->get_property ("minimum-distances");
 }
@@ -25,11 +24,11 @@ Spaceable_grob::get_minimum_distances (Grob*me)
 /*todo: merge code of spring & rod?
  */
 void
-Spaceable_grob::add_rod (Grob *me , Grob * p, Real d)
+Spaceable_grob::add_rod (Grob *me, Grob *p, Real d)
 {
   //  printf ("rod %lf\n", d);
 
-  
+
   SCM mins = get_minimum_distances (me);
   SCM newdist = scm_make_real (d);
   for (SCM s = mins; scm_is_pair (s); s = scm_cdr (s))
@@ -38,8 +37,8 @@ Spaceable_grob::add_rod (Grob *me , Grob * p, Real d)
       if (scm_car (dist) == p->self_scm ())
        {
          scm_set_cdr_x (dist, scm_max (scm_cdr (dist),
-                                      newdist));
-         return ;
+                                       newdist));
+         return;
        }
     }
 
@@ -48,7 +47,7 @@ Spaceable_grob::add_rod (Grob *me , Grob * p, Real d)
 }
 
 void
-Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength)
+Spaceable_grob::add_spring (Grob *me, Grob *p, Real d, Real strength)
 {
   //  printf ("dist %lf, str %lf\n", d, strength); 
   if (d <= 0.0 || strength <= 0.0)
@@ -57,53 +56,49 @@ Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength)
       d = 1.0;
       strength = 1.0;
     }
-  
-  if (isinf (d) || isnan(d)
+
+  if (isinf (d) || isnan (d)
       || isnan (strength))
     {
       /*
        strength == INF is possible. It means fixed distance.
-       */
+      */
       programming_error ("Insane distance found.");
       d = 1.0;
       strength = 1.0;
     }
-    
+
 #ifndef NDEBUG
   SCM mins = me->get_property ("ideal-distances");
   for (SCM s = mins; scm_is_pair (s); s = scm_cdr (s))
     {
-      Spring_smob * sp = unsmob_spring(scm_car (s));
+      Spring_smob *sp = unsmob_spring (scm_car (s));
       if (sp->other_ == p)
        {
          programming_error ("already have that spring");
-         return ;
+         return;
        }
     }
 #endif
-  
+
   Spring_smob spring;
   spring.strength_ = strength;
   spring.distance_ = d;
   spring.other_ = p;
-  
+
   Group_interface::add_thing (me, ly_symbol2scm ("ideal-distances"), spring.smobbed_copy ());
 }
 
-
 void
-Spaceable_grob::remove_interface (Grob*me)
+Spaceable_grob::remove_interface (Grob *me)
 {
-  me->set_property ("minimum-distances" , SCM_EOL);
+  me->set_property ("minimum-distances", SCM_EOL);
   me->set_property ("spacing-wishes", SCM_EOL);
   me->set_property ("ideal-distances", SCM_EOL);
 }
 
-
-
 ADD_INTERFACE (Spaceable_grob, "spaceable-grob-interface",
-              "A layout object that takes part in the spacing problem. "
-              ,
+              "A layout object that takes part in the spacing problem. ",
               "measure-length spacing-wishes penalty minimum-distances ideal-distances "
               "allow-outside-line left-neighbors right-neighbors");
 
index 14d040e13de2bba68b4ede43d560b225149525dd..ec4b189fa2f5f876634a3d7b8a00422176fd765d 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   spacing-engraver.cc -- implement Spacing_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "paper-column.hh"
 #include "engraver.hh"
@@ -19,16 +18,16 @@ struct Rhythmic_tuple
 {
   Grob_info info_;
   Moment end_;
-  
+
   Rhythmic_tuple ()
-    {
-    }
+  {
+  }
   Rhythmic_tuple (Grob_info i, Moment m)
-    {
-      info_ = i;
-      end_ = m;
-    }
-  static int time_compare (Rhythmic_tuple const &, Rhythmic_tuple const &);  
+  {
+    info_ = i;
+    end_ = m;
+  }
+  static int time_compare (Rhythmic_tuple const &, Rhythmic_tuple const &);
 };
 
 /**
@@ -43,8 +42,8 @@ class Spacing_engraver : public Engraver
   Array<Rhythmic_tuple> now_durations_;
   Array<Rhythmic_tuple> stopped_durations_;
   Moment now_;
-  Spanner * spacing_;
-  
+  Spanner *spacing_;
+
   TRANSLATOR_DECLARATIONS (Spacing_engraver);
 protected:
   virtual void acknowledge_grob (Grob_info);
@@ -78,8 +77,8 @@ Spacing_engraver::process_music ()
   if (!spacing_)
     {
       spacing_ = make_spanner ("SpacingSpanner", SCM_EOL);
-      spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));  
-      
+      spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+
     }
 }
 
@@ -88,8 +87,8 @@ Spacing_engraver::finalize ()
 {
   if (spacing_)
     {
-      Grob * p = unsmob_grob (get_property ("currentCommandColumn"));
-  
+      Grob *p = unsmob_grob (get_property ("currentCommandColumn"));
+
       spacing_->set_bound (RIGHT, p);
       spacing_ = 0;
     }
@@ -100,16 +99,16 @@ Spacing_engraver::acknowledge_grob (Grob_info i)
 {
   if (Note_spacing::has_interface (i.grob_) || Staff_spacing::has_interface (i.grob_))
     {
-      Pointer_group_interface::add_grob (spacing_, ly_symbol2scm  ("wishes"), i.grob_);
+      Pointer_group_interface::add_grob (spacing_, ly_symbol2scm ("wishes"), i.grob_);
     }
-  
+
   if (i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))
       || i.grob_->internal_has_interface (ly_symbol2scm ("multi-measure-event")))
     return;
 
   /*
-    only pay attention to durations that are not grace notes. 
-   */
+    only pay attention to durations that are not grace notes.
+  */
   if (!now_.grace_part_)
     {
       Music *r = i.music_cause ();
@@ -129,7 +128,7 @@ Spacing_engraver::stop_translation_timestep ()
   shortest_playing.set_infinite (1);
   for (int i = 0; i < playing_durations_.size (); i++)
     {
-      Music * mus = playing_durations_[i].info_.music_cause ();
+      Music *mus = playing_durations_[i].info_.music_cause ();
       if (mus)
        {
          Moment m = mus->get_length ();
@@ -150,17 +149,17 @@ Spacing_engraver::stop_translation_timestep ()
        }
     }
   now_durations_.clear ();
-  
+
   shortest_playing = shortest_playing <? starter;
-  
-  Paper_column * sc
-    = dynamic_cast<Paper_column*> (unsmob_grob (get_property ("currentMusicalColumn")));
+
+  Paper_column *sc
+    = dynamic_cast<Paper_column *> (unsmob_grob (get_property ("currentMusicalColumn")));
 
   assert (starter.to_bool ());
   SCM sh = shortest_playing.smobbed_copy ();
   SCM st = starter.smobbed_copy ();
 
-  sc->set_property ("shortest-playing-duration", sh);  
+  sc->set_property ("shortest-playing-duration", sh);
   sc->set_property ("shortest-starter-duration", st);
 }
 
@@ -176,12 +175,10 @@ Spacing_engraver::start_translation_timestep ()
 }
 
 
-
-
 ADD_TRANSLATOR (Spacing_engraver,
-/* descr */       "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes  ",
-/* creats*/       "SpacingSpanner",
-/* accepts */     "",
-/* acks  */      "grob-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes  ",
+               /* creats*/ "SpacingSpanner",
+               /* accepts */ "",
+               /* acks  */ "grob-interface",
+               /* reads */ "",
+               /* write */ "");
index 329a77a7dd0daf425d68950c90ba2bd572519e5b..830657e6f9f5e5f70e0fbea180943d2f972f0ff8 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "system.hh"
 #include "column-x-positions.hh"
 #include "staff-spacing.hh"
 
-
 /* Find the loose columns in POSNS, and drape them around the columns
    specified in BETWEEN-COLS.  */
 void
-set_loose_columns (Systemwhich, Column_x_positions const *posns)
+set_loose_columns (System *which, Column_x_positions const *posns)
 {
   int loose_col_count = posns->loose_cols_.size ();
   for (int i = 0; i < loose_col_count; i++)
     {
       int divide_over = 1;
-      Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
-      Paper_column* col = dynamic_cast<Paper_column*> (loose);
-      
+      Item *loose = dynamic_cast<Item *> (posns->loose_cols_[i]);
+      Paper_column *col = dynamic_cast<Paper_column *> (loose);
+
       if (col->system_)
        continue;
-      
+
       Item *left = 0;
       Item *right = 0;
       while (1)
@@ -36,12 +34,12 @@ set_loose_columns (System* which, Column_x_positions const *posns)
          if (!scm_is_pair (between))
            break;
 
-         Item *le = dynamic_cast<Item*> (unsmob_grob (scm_car (between)));
-         Item *re = dynamic_cast<Item*> (unsmob_grob (scm_cdr (between)));
+         Item *le = dynamic_cast<Item *> (unsmob_grob (scm_car (between)));
+         Item *re = dynamic_cast<Item *> (unsmob_grob (scm_cdr (between)));
 
-         if (!(le && re))
+         if (! (le && re))
            break;
-         
+
          if (!left && le)
            {
              left = le->get_column ();
@@ -55,12 +53,12 @@ set_loose_columns (System* which, Column_x_positions const *posns)
 
       if (!right->get_system ())
        right = right->find_prebroken_piece (LEFT);
-      
+
       Grob *common = right->common_refpoint (left, X_AXIS);
 
       int count = 0;
-      Real total_space = 0.0;  
-      Real total_fixed = 0.0; 
+      Real total_space = 0.0;
+      Real total_fixed = 0.0;
       for (SCM wish = col->get_property ("spacing-wishes"); scm_is_pair (wish); wish = scm_cdr (wish))
        {
          Grob *spacing = unsmob_grob (scm_car (wish));
@@ -72,7 +70,7 @@ set_loose_columns (System* which, Column_x_positions const *posns)
 
              total_fixed += fixed;
              total_space += space;
-             count ++;
+             count++;
            }
        }
 
@@ -96,12 +94,12 @@ set_loose_columns (System* which, Column_x_positions const *posns)
       Real left_point = left->extent (common, X_AXIS)[RIGHT];
 
       Real space_left = ((right_point - left_point) >? 0.0)
-       - (my_extent.is_empty() ? 0.0 : my_extent.length ());
+       - (my_extent.is_empty () ? 0.0 : my_extent.length ());
 
       Real padding = (space_left / 2) <? 1.0;
       /*
-       Put it just left of the right column, with a bit of extra space 
-       */
+       Put it just left of the right column, with a bit of extra space
+      */
 #endif
       Real my_offset = right_point - distance_to_next;
 
index 389593ff93166d2d8e46271ccd6b42316c7a64dd..7e2f21c72d73e92cc6f8f69c0d2d502a1829e1e7 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   spacing-spanner.cc -- implement Spacing_spanner
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include <math.h>
 #include <cstdio>
 /*
   TODO: this file/class is too complex. Should figure out how to chop
   this up even more.
-    
- */
+*/
 
 class Spacing_spanner
 {
 public:
-  static void standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
-                                                Real * fixed, Real * space, Moment);
-  
-
-  static Real default_bar_spacing (Grob*, Grob*, Grob*, Moment);
-  static Real note_spacing (Grob*, Grob*, Grob*, Moment, bool*);
-  static Real get_duration_space (Grob*, Moment dur, Rational shortest, bool*);
-  static Rational find_shortest (Grob *, Link_array<Grob> const &);  
-  static void breakable_column_spacing (Grob*, Item* l, Item *r, Moment);
+  static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
+                                                Real *fixed, Real *space, Moment);
+
+  static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
+  static Real note_spacing (Grob *, Grob *, Grob *, Moment, bool *);
+  static Real get_duration_space (Grob *, Moment dur, Rational shortest, bool *);
+  static Rational find_shortest (Grob *, Link_array<Grob> const &);
+  static void breakable_column_spacing (Grob *, Item *l, Item *r, Moment);
   static void find_loose_columns () {}
-  static void prune_loose_columns (Grob*, Link_array<Grob> *cols, Rational);
+  static void prune_loose_columns (Grob *, Link_array<Grob> *cols, Rational);
   static void find_loose_columns (Link_array<Grob> cols);
   static void set_explicit_neighbor_columns (Link_array<Grob> cols);
   static void set_implicit_neighbor_columns (Link_array<Grob> cols);
-  static void do_measure (Rational, Grob*me, Link_array<Grob> *cols);
-  static void musical_column_spacing (Grob*, Item*, Item*, Real, Rational); 
-  DECLARE_SCHEME_CALLBACK (set_springs, (SCM ));
-  static bool has_interface (Grob*);
+  static void do_measure (Rational, Grob *me, Link_array<Grob> *cols);
+  static void musical_column_spacing (Grob *, Item *, Item *, Real, Rational);
+  DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
+  static bool has_interface (Grob *);
 };
 
 /*
   Return whether COL is fixed to its neighbors by some kind of spacing
   constraint.
 
-  
+
   If in doubt, then we're not loose; the spacing engine should space
   for it, risking suboptimal spacing.
-  
-  (Otherwise, we might risk core dumps, and other weird stuff.)
 
+  (Otherwise, we might risk core dumps, and other weird stuff.)
 */
 static bool
-loose_column (Grob *l, Grob *c, Grob *r) 
+loose_column (Grob *l, Grob *c, Grob *r)
 {
   SCM rns = c->get_property ("right-neighbors");
   SCM lns = c->get_property ("left-neighbors");
 
- /*
 /*
     If this column doesn't have a proper neighbor, we should really
     make it loose, but spacing it correctly is more than we can
     currently can handle.
 
     (this happens in the following situation:
 
-       |
-       |    clef G 
-      *
+    |
+    |    clef G
+    *
 
-       |               |      ||
-       |               |      || 
-      O               O       ||
+    |               |      ||
+    |               |      ||
+    O               O       ||
 
 
     the column containing the clef is really loose, and should be
     attached right to the first column, but that is a lot of work for
     such a borderline case.)
-    
-  */  
+
+  */
   if (!scm_is_pair (lns) || !scm_is_pair (rns))
     return false;
 
-  Item * l_neighbor = dynamic_cast<Item*>  (unsmob_grob (scm_car (lns)));
-  Item * r_neighbor = dynamic_cast<Item*>  (unsmob_grob (scm_car (rns)));
+  Item *l_neighbor = dynamic_cast<Item *> (unsmob_grob (scm_car (lns)));
+  Item *r_neighbor = dynamic_cast<Item *> (unsmob_grob (scm_car (rns)));
 
   if (!l_neighbor || !r_neighbor)
     return false;
 
   l_neighbor = l_neighbor->get_column ();
-  r_neighbor = dynamic_cast<Item*> (Note_spacing::right_column  (r_neighbor));
+  r_neighbor = dynamic_cast<Item *> (Note_spacing::right_column (r_neighbor));
 
   if (l == l_neighbor && r == r_neighbor)
     return false;
@@ -112,28 +108,25 @@ loose_column (Grob *l, Grob *c, Grob *r)
   if (!l_neighbor || !r_neighbor)
     return false;
 
-
-  
   /*
     Only declare loose if the bounds make a little sense.  This means
     some cases (two isolated, consecutive clef changes) won't be
     nicely folded, but hey, then don't do that.
   */
-  if (!  ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor))
-        && (Paper_column::is_musical (r_neighbor) || Item::is_breakable (r_neighbor))) )
+  if (! ((Paper_column::is_musical (l_neighbor) || Item::is_breakable (l_neighbor))
+        && (Paper_column::is_musical (r_neighbor) || Item::is_breakable (r_neighbor))))
     {
       return false;
     }
 
-
   /*
     A rather hairy check, but we really only want to move around clefs. (anything else?)
 
     in any case, we don't want to move bar lines.
-   */
+  */
   for (SCM e = c->get_property ("elements"); scm_is_pair (e); e = scm_cdr (e))
     {
-      Grob * g = unsmob_grob (scm_car (e));
+      Grob *g = unsmob_grob (scm_car (e));
       if (g && Break_align_interface::has_interface (g))
        {
          for (SCM s = g->get_property ("elements"); scm_is_pair (s);
@@ -142,14 +135,14 @@ loose_column (Grob *l, Grob *c, Grob *r)
              Grob *h = unsmob_grob (scm_car (s));
 
              /*
-               ugh. -- fix staff-bar name? 
+               ugh. -- fix staff-bar name?
              */
-             if (h  && h->get_property ("break-align-symbol") == ly_symbol2scm ("staff-bar"))
+             if (h && h->get_property ("break-align-symbol") == ly_symbol2scm ("staff-bar"))
                return false;
            }
        }
     }
-  
+
   return true;
 }
 
@@ -159,11 +152,11 @@ loose_column (Grob *l, Grob *c, Grob *r)
   between.
 */
 void
-Spacing_spanner::prune_loose_columns (Grob*me, Link_array<Grob> *cols, Rational shortest)
+Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols, Rational shortest)
 {
   Link_array<Grob> newcols;
   Real increment = robust_scm2double (me->get_property ("spacing-increment"), 1.2);
-  for (int i = 0; i < cols->size ();  i++)
+  for (int i = 0; i < cols->size (); i++)
     {
       if (Item::is_breakable (cols->elem (i)) || Paper_column::is_musical (cols->elem (i)))
        {
@@ -172,7 +165,7 @@ Spacing_spanner::prune_loose_columns (Grob*me, Link_array<Grob> *cols, Rational
        }
 
       Grob *c = cols->elem (i);
-      if (loose_column (cols->elem (i-1), c, cols->elem (i+1)))
+      if (loose_column (cols->elem (i - 1), c, cols->elem (i + 1)))
        {
          SCM lns = c->get_property ("left-neighbors");
          lns = scm_is_pair (lns) ? scm_car (lns) : SCM_BOOL_F;
@@ -191,17 +184,17 @@ Spacing_spanner::prune_loose_columns (Grob*me, Link_array<Grob> *cols, Rational
          /*
            Set distance constraints for loose columns
          */
-         Drul_array<Grob*> next_door;
+         Drul_array<Grob *> next_door;
          next_door[LEFT] = cols->elem (i - 1);
-         next_door[RIGHT] = cols->elem (i + 1);          
+         next_door[RIGHT] = cols->elem (i + 1);
          Direction d = LEFT;
          Drul_array<Real> dists (0, 0);
 
          do
            {
              dists[d] = 0.0;
-             Item *lc = dynamic_cast<Item*> ((d == LEFT)  ? next_door[LEFT] : c);
-             Item *rc = dynamic_cast<Item*> (d == LEFT  ? c : next_door[RIGHT]);
+             Item *lc = dynamic_cast<Item *> ((d == LEFT) ? next_door[LEFT] : c);
+             Item *rc = dynamic_cast<Item *> (d == LEFT ? c : next_door[RIGHT]);
 
              for (SCM s = lc->get_property ("spacing-wishes");
                   scm_is_pair (s); s = scm_cdr (s))
@@ -220,13 +213,13 @@ Spacing_spanner::prune_loose_columns (Grob*me, Link_array<Grob> *cols, Rational
                      /*
                        The note spacing should be taken from the musical
                        columns.
-                   
+
                      */
                      Real base = note_spacing (me, lc, rc, shortest, &dummy);
                      Note_spacing::get_spacing (sp, rc, base, increment, &space, &fixed);
 
-                     space -= increment; 
-                 
+                     space -= increment;
+
                      dists[d] = dists[d] >? space;
                    }
                  else
@@ -237,15 +230,15 @@ Spacing_spanner::prune_loose_columns (Grob*me, Link_array<Grob> *cols, Rational
 
                      dists[d] = dists[d] >? fixed_space;
                    }
-                 
+
                }
            }
          while (flip (&d) != LEFT);
 
          Rod r;
          r.distance_ = dists[LEFT] + dists[RIGHT];
-         r.item_drul_[LEFT] = dynamic_cast<Item*> (cols->elem (i-1));
-         r.item_drul_[RIGHT] = dynamic_cast<Item*> (cols->elem (i+1));
+         r.item_drul_[LEFT] = dynamic_cast<Item *> (cols->elem (i - 1));
+         r.item_drul_[RIGHT] = dynamic_cast<Item *> (cols->elem (i + 1));
 
          r.add_to_cols ();
        }
@@ -259,7 +252,7 @@ Spacing_spanner::prune_loose_columns (Grob*me, Link_array<Grob> *cols, Rational
 }
 
 /*
-  Set neighboring columns determined by the spacing-wishes grob property.  
+  Set neighboring columns determined by the spacing-wishes grob property.
 */
 void
 Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
@@ -270,21 +263,21 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
       int min_rank = 100000;   // inf.
 
 
-      SCM wishes =  cols[i]->get_property ("spacing-wishes");
+      SCM wishes = cols[i]->get_property ("spacing-wishes");
       for (SCM s = wishes; scm_is_pair (s); s = scm_cdr (s))
        {
-         Item * wish = dynamic_cast<Item*> (unsmob_grob (scm_car (s)));
+         Item *wish = dynamic_cast<Item *> (unsmob_grob (scm_car (s)));
 
-         Item * lc = wish->get_column ();
-         Grob * right = Note_spacing::right_column (wish);
+         Item *lc = wish->get_column ();
+         Grob *right = Note_spacing::right_column (wish);
 
          if (!right)
            continue;
 
-         Item * rc = dynamic_cast<Item*> (right);
+         Item *rc = dynamic_cast<Item *> (right);
 
          int right_rank = Paper_column::get_rank (rc);
-         int left_rank = Paper_column::get_rank (lc);    
+         int left_rank = Paper_column::get_rank (lc);
 
          /*
            update the left column.
@@ -292,8 +285,8 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
          if (right_rank <= min_rank)
            {
              if (right_rank < min_rank)
-               right_neighbors  = SCM_EOL;
-             
+               right_neighbors = SCM_EOL;
+
              min_rank = right_rank;
              right_neighbors = scm_cons (wish->self_scm (), right_neighbors);
            }
@@ -306,7 +299,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
          if (scm_is_pair (left_neighs)
              && unsmob_grob (scm_car (left_neighs)))
            {
-             Item * it = dynamic_cast<Item*> (unsmob_grob (scm_car (left_neighs)));
+             Item *it = dynamic_cast<Item *> (unsmob_grob (scm_car (left_neighs)));
              maxrank = Paper_column::get_rank (it->get_column ());
            }
 
@@ -329,14 +322,14 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
 
 /*
   Set neighboring columns that have no left/right-neighbor set
-  yet. Only do breakable non-musical columns, and musical columns. 
+  yet. Only do breakable non-musical columns, and musical columns.
 */
 void
 Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> cols)
 {
   for (int i = 0; i < cols.size (); i++)
     {
-      Item * it = dynamic_cast<Item*>(cols[i]);
+      Item *it = dynamic_cast<Item *> (cols[i]);
       if (!Item::is_breakable (it) && !Paper_column::is_musical (it))
        continue;
 
@@ -346,20 +339,19 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> cols)
        sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
       */
       SCM ln = cols[i] ->get_property ("left-neighbors");
-      if (!scm_is_pair (ln) && i ) 
+      if (!scm_is_pair (ln) && i)
        {
-         cols[i]->set_property ("left-neighbors", scm_cons (cols[i-1]->self_scm (), SCM_EOL));
+         cols[i]->set_property ("left-neighbors", scm_cons (cols[i - 1]->self_scm (), SCM_EOL));
        }
 
       SCM rn = cols[i] ->get_property ("right-neighbors");
-      if (!scm_is_pair (rn) && i < cols.size () - 1) 
+      if (!scm_is_pair (rn) && i < cols.size () - 1)
        {
          cols[i]->set_property ("right-neighbors", scm_cons (cols[i + 1]->self_scm (), SCM_EOL));
        }
     }
 }
 
-
 MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs, 1);
 SCM
 Spacing_spanner::set_springs (SCM smob)
@@ -388,23 +380,21 @@ Spacing_spanner::set_springs (SCM smob)
   prune_loose_columns (me, &all, global_shortest);
   set_implicit_neighbor_columns (all);
 
-  
   int j = 0;
   for (int i = 1; i < all.size (); i++)
     {
       Grob *sc = all[i];
       if (Item::is_breakable (sc))
-        {
-         Link_array<Grob> measure (all.slice (j, i+1));          
-          do_measure (global_shortest, me, &measure);
+       {
+         Link_array<Grob> measure (all.slice (j, i + 1));
+         do_measure (global_shortest, me, &measure);
          j = i;
-        }
+       }
     }
 
   return SCM_UNSPECIFIED;
 }
 
-
 /*
   We want the shortest note that is also "common" in the piece, so we
   find the shortest in each measure, and take the most frequently
@@ -413,7 +403,6 @@ Spacing_spanner::set_springs (SCM smob)
   This probably gives weird effects with modern music, where every
   note has a different duration, but hey, don't write that kind of
   stuff, then.
-
 */
 Rational
 Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
@@ -421,25 +410,25 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
   /*
     ascending in duration
   */
-  Array<Rational> durations; 
+  Array<Rational> durations;
   Array<int> counts;
-  
+
   Rational shortest_in_measure;
   shortest_in_measure.set_infinite (1);
-  
-  for (int i = 0 ; i < cols.size (); i++)  
+
+  for (int i = 0; i < cols.size (); i++)
     {
       if (Paper_column::is_musical (cols[i]))
        {
-         Moment *when = unsmob_moment (cols[i]->get_property  ("when"));
+         Moment *when = unsmob_moment (cols[i]->get_property ("when"));
 
          /*
            ignore grace notes for shortest notes.
          */
          if (when && when->grace_part_)
            continue;
-         
-         SCM  st = cols[i]->get_property ("shortest-starter-duration");
+
+         SCM st = cols[i]->get_property ("shortest-starter-duration");
          Moment this_shortest = *unsmob_moment (st);
          assert (this_shortest.to_bool ());
          shortest_in_measure = shortest_in_measure <? this_shortest.main_part_;
@@ -469,7 +458,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
              counts.push (1);
            }
 
-         shortest_in_measure.set_infinite (1); 
+         shortest_in_measure.set_infinite (1);
        }
     }
 
@@ -486,13 +475,13 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
       //      printf ("duration %d/%d, count %d\n", durations[i].num (), durations[i].den (), counts[i]);
     }
 
-  SCM  bsd = me->get_property ("base-shortest-duration");
+  SCM bsd = me->get_property ("base-shortest-duration");
   Rational d = Rational (1, 8);
   if (Moment *m = unsmob_moment (bsd))
     d = m->main_part_;
-  
+
   if (max_idx >= 0)
-    d = d <? durations[max_idx] ;
+    d = d <? durations[max_idx];
 
   return d;
 }
@@ -502,35 +491,34 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
   per-measure spacing. Now we have piecewise spacing. We should fix
   this to support "spacing-regions": some regions have different notes
   (different time sigs) than others, and should be spaced differently.
- */
+*/
 void
-Spacing_spanner::do_measure (Rational global_shortest, Grob*me,
-                            Link_array<Grob> *cols) 
+Spacing_spanner::do_measure (Rational global_shortest, Grob *me,
+                            Link_array<Grob> *cols)
 {
 
   Real headwid = robust_scm2double (me->get_property ("spacing-increment"), 1);
   for (int i = 0; i < cols->size () - 1; i++)
     {
-      Item * l = dynamic_cast<Item*> (cols->elem (i));
-      Item * r =  dynamic_cast<Item*> (cols->elem (i+1));
+      Item *l = dynamic_cast<Item *> (cols->elem (i));
+      Item *r = dynamic_cast<Item *> (cols->elem (i + 1));
 
-      Paper_column * lc = dynamic_cast<Paper_column*> (l);
-      Paper_column * rc = dynamic_cast<Paper_column*> (r);
+      Paper_column *lc = dynamic_cast<Paper_column *> (l);
+      Paper_column *rc = dynamic_cast<Paper_column *> (r);
 
       if (!Paper_column::is_musical (l))
        {
          breakable_column_spacing (me, l, r, global_shortest);
 
          /*
-           
            The case that the right part is broken as well is rather
            rare, but it is possible, eg. with a single empty measure,
            or if one staff finishes a tad earlier than the rest.
-           
-          */
+
+         */
          Item *lb = l->find_prebroken_piece (RIGHT);
          Item *rb = r->find_prebroken_piece (LEFT);
-         
+
          if (lb)
            breakable_column_spacing (me, lb, r, global_shortest);
 
@@ -544,16 +532,16 @@ Spacing_spanner::do_measure (Rational global_shortest, Grob*me,
          musical_column_spacing (me, lc, rc, headwid, global_shortest);
          if (Item *rb = r->find_prebroken_piece (LEFT))
            musical_column_spacing (me, lc, rb, headwid, global_shortest);
-       }    
+       }
     }
 }
 
 /*
   Generate the space between two musical columns LC and RC, given
   spacing parameters INCR and SHORTEST.
- */
+*/
 void
-Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real increment, Rational global_shortest)
+Spacing_spanner::musical_column_spacing (Grob *me, Item *lc, Item *rc, Real increment, Rational global_shortest)
 {
   bool expand_only = false;
   Real base_note_space = note_spacing (me, lc, rc, global_shortest, &expand_only);
@@ -561,8 +549,8 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
   Real compound_note_space = 0.0;
   Real compound_fixed_note_space = 0.0;
   int wish_count = 0;
-  
-  SCM seq  = lc->get_property ("right-neighbors");
+
+  SCM seq = lc->get_property ("right-neighbors");
 
   /*
     We adjust the space following a note only if the next note
@@ -571,7 +559,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
   */
   for (SCM s = seq; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * wish = unsmob_grob (scm_car (s));
+      Grob *wish = unsmob_grob (scm_car (s));
 
       Item *wish_rcol = Note_spacing::right_column (wish);
       if (Note_spacing::left_column (wish) != lc
@@ -585,30 +573,29 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
        {
          Real space = 0.0;
          Real fixed = 0.0;
-         
+
          Note_spacing::get_spacing (wish, rc, base_note_space, increment, &space, &fixed);
 
-         
          compound_note_space = compound_note_space + space;
          compound_fixed_note_space = compound_fixed_note_space + fixed;
-         wish_count ++;
-         
+         wish_count++;
+
        }
     }
 
-  if (Paper_column::when_mom (rc).grace_part_ &&
-      !Paper_column::when_mom (lc).grace_part_)
+  if (Paper_column::when_mom (rc).grace_part_
+      && !Paper_column::when_mom (lc).grace_part_)
     {
       /*
        Ugh. 0.8 is arbitrary.
-       */
-      compound_note_space *= 0.8; 
+      */
+      compound_note_space *= 0.8;
     }
-  
+
   if (compound_note_space < 0 || wish_count == 0)
     {
       compound_note_space = base_note_space;
-      compound_fixed_note_space =  increment;
+      compound_fixed_note_space = increment;
     }
   else
     {
@@ -630,7 +617,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
 
   /*
     TODO: make sure that the space doesn't exceed the right margin.
-   */
+  */
   if (packed)
     {
       /*
@@ -651,23 +638,22 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
       distance = compound_note_space;
     }
 
-  Spaceable_grob::add_spring (lc, rc, distance, strength);  
+  Spaceable_grob::add_spring (lc, rc, distance, strength);
 }
 
-
 /*
   The one-size-fits all spacing. It doesn't take into account
   different spacing wishes from one to the next column.
- */
+*/
 void
-Spacing_spanner::standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
-                                  Real * fixed, Real * space,
-                                  Moment shortest)
+Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
+                                                   Real *fixed, Real *space,
+                                                   Moment shortest)
 {
   *fixed = 0.0;
   Direction d = LEFT;
-  Drul_array<Item*> cols (l, r);
-  
+  Drul_array<Item *> cols (l, r);
+
   do
     {
       if (!Paper_column::is_musical (cols[d]))
@@ -675,14 +661,13 @@ Spacing_spanner::standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
          /*
            Tied accidentals over barlines cause problems, so lets see
            what happens if we do this for non musical columns only.
-          */
+         */
          Interval lext = cols[d]->extent (cols [d], X_AXIS);
          if (!lext.is_empty ())
            *fixed += -d * lext[-d];
        }
     }
   while (flip (&d) != LEFT);
-  
 
   if (l->is_breakable (l) && r->is_breakable (r))
     {
@@ -690,10 +675,10 @@ Spacing_spanner::standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
       Moment mlen (1);
       if (dt)
        mlen = *dt;
-      
+
       Real incr = robust_scm2double (me->get_property ("spacing-increment"), 1);
 
-      *space =  *fixed + incr * double (mlen.main_part_ / shortest.main_part_) * 0.8;
+      *space = *fixed + incr * double (mlen.main_part_ / shortest.main_part_) * 0.8;
     }
   else
     {
@@ -704,8 +689,8 @@ Spacing_spanner::standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
          /*
            In this case, Staff_spacing should handle the job,
            using dt when it is 0 is silly.
-          */
-         *space = *fixed + 0.5; 
+         */
+         *space = *fixed + 0.5;
        }
       else
        {
@@ -715,12 +700,11 @@ Spacing_spanner::standard_breakable_column_spacing (Grob * me, Item*l, Item*r,
     }
 }
 
-
 /*
   Read hints from L and generate springs.
 */
 void
-Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r, Moment shortest)
+Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, Moment shortest)
 {
   Real compound_fixed = 0.0;
   Real compound_space = 0.0;
@@ -733,7 +717,7 @@ Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r, Moment sho
       for (SCM s = l->get_property ("spacing-wishes");
           scm_is_pair (s); s = scm_cdr (s))
        {
-         Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (scm_car (s)));
+         Item *spacing_grob = dynamic_cast<Item *> (unsmob_grob (scm_car (s)));
 
          if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
            continue;
@@ -763,13 +747,13 @@ Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r, Moment sho
 
          compound_space += space;
          compound_fixed += fixed_space;
-         wish_count ++ ;
+         wish_count++;
        }
     }
 
   if (compound_space <= 0.0 || !wish_count)
     {
-      standard_breakable_column_spacing (me, l, r, &compound_fixed, &compound_space ,
+      standard_breakable_column_spacing (me, l, r, &compound_fixed, &compound_space,
                                         shortest);
       wish_count = 1;
     }
@@ -782,34 +766,32 @@ Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r, Moment sho
   assert (!isinf (compound_space));
   compound_space = compound_space >? compound_fixed;
 
-  
   /*
     Hmm.  we do 1/0 in the next thing. Perhaps we should check if this
     works on all architectures.
-   */
+  */
 
   /*
     There used to be code that changed spacing depending on
     raggedright setting.  Ugh.
 
-    Do it more cleanly, or rename the property. 
-    
-   */
+    Do it more cleanly, or rename the property.
+
+  */
   Real strength = 1 / (compound_space - compound_fixed);
   Real distance = compound_space;
   Spaceable_grob::add_spring (l, r, distance, strength);
 }
 
-
 /**
-  Get the measure wide ant for arithmetic spacing.
-  */
+   Get the measure wide ant for arithmetic spacing.
+*/
 Real
-Spacing_spanner::get_duration_space (Grob*me, Moment d, Rational shortest, bool * expand_only) 
+Spacing_spanner::get_duration_space (Grob *me, Moment d, Rational shortest, bool *expand_only)
 {
   Real k = robust_scm2double (me->get_property ("shortest-duration-space"), 1);
   Real incr = robust_scm2double (me->get_property ("spacing-increment"), 1);
-  
+
   if (d < shortest)
     {
       /*
@@ -825,39 +807,39 @@ Spacing_spanner::get_duration_space (Grob*me, Moment d, Rational shortest, bool
        mm for 8th. (white space), suggesting that we use
 
        (1.2 / 1.5)^{-log2(duration ratio)}
-       
 
-       */
+
+      */
       Rational ratio = d.main_part_ / shortest;
 
-      return ((k-1) + double (ratio)) * incr;
+      return ((k - 1) + double (ratio)) * incr;
     }
   else
     {
       /*
-         John S. Gourlay. ``Spacing a Line of Music, '' Technical
-         Report OSU-CISRC-10/87-TR35, Department of Computer and
-         Information Science, The Ohio State University, 1987.
-       */
-      Real log =  log_2 (shortest);
+       John S. Gourlay. ``Spacing a Line of Music, '' Technical
+       Report OSU-CISRC-10/87-TR35, Department of Computer and
+       Information Science, The Ohio State University, 1987.
+      */
+      Real log = log_2 (shortest);
       k -= log;
       Rational compdur = d.main_part_ + d.grace_part_ /Rational (3);
-      *expand_only = false;      
-   
+      *expand_only = false;
+
       return (log_2 (compdur) + k) * incr;
     }
 }
 
 Real
-Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
-                              Moment shortest, bool * expand_only) 
+Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
+                              Moment shortest, bool *expand_only)
 {
   Moment shortest_playing_len = 0;
   SCM s = lc->get_property ("shortest-playing-duration");
 
   if (unsmob_moment (s))
     shortest_playing_len = *unsmob_moment (s);
-  
+
   if (! shortest_playing_len.to_bool ())
     {
       programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).to_string ());
@@ -865,7 +847,7 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
     }
 
   Moment lwhen = Paper_column::when_mom (lc);
-  Moment rwhen =  Paper_column::when_mom (rc);
+  Moment rwhen = Paper_column::when_mom (rc);
 
   Moment delta_t = rwhen - lwhen;
   if (!Paper_column::is_musical (rc))
@@ -874,8 +856,8 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
        when toying with mmrests, it is possible to have musical
        column on the left and non-musical on the right, spanning
        several measures.
-       */
-      
+      */
+
       Moment *dt = unsmob_moment (rc->get_property ("measure-length"));
       if (dt)
        {
@@ -884,7 +866,7 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
          /*
            The following is an extra safety measure, such that
            the length of a mmrest event doesn't cause havoc.
-          */
+         */
          shortest_playing_len = shortest_playing_len <? *dt;
        }
     }
@@ -895,8 +877,8 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
     SHORTEST_PLAYING_LEN away. However chord-tremolos do funky faking stuff
     with durations, invalidating this assumption. Here we kludge
     around to get chord tremolos to behave properly.
-    
-   */
+
+  */
   shortest_playing_len = shortest_playing_len >? delta_t;
   if (delta_t.main_part_ && !lwhen.grace_part_)
     {
@@ -916,28 +898,23 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
       dist *= grace_fact;
     }
 
-  
   return dist;
 }
 
-
-
 ADD_INTERFACE (Spacing_spanner, "spacing-spanner-interface",
-"The space taken by a note is dependent on its duration. Doubling a\n"
-"duration adds spacing-increment to the space. The most common shortest\n"
-"note gets @code{shortest-duration-space}. Notes that are even shorter are\n"
-"spaced proportonial to their duration.\n"
-"\n"
-"Typically, the increment is the width of a black note head.  In a\n"
-"piece with lots of 8th notes, and some 16th notes, the eighth note\n"
-"gets 2 note heads width (i.e. the space following a note is 1 note\n"
-"head width) A 16th note is followed by 0.5 note head width. The\n"
-"quarter note is followed by  3 NHW, the half by 4 NHW, etc.\n",
-  "grace-space-factor spacing-increment base-shortest-duration shortest-duration-space common-shortest-duration");
-
-
+              "The space taken by a note is dependent on its duration. Doubling a\n"
+              "duration adds spacing-increment to the space. The most common shortest\n"
+              "note gets @code{shortest-duration-space}. Notes that are even shorter are\n"
+              "spaced proportonial to their duration.\n"
+              "\n"
+              "Typically, the increment is the width of a black note head.  In a\n"
+              "piece with lots of 8th notes, and some 16th notes, the eighth note\n"
+              "gets 2 note heads width (i.e. the space following a note is 1 note\n"
+              "head width) A 16th note is followed by 0.5 note head width. The\n"
+              "quarter note is followed by  3 NHW, the half by 4 NHW, etc.\n",
+              "grace-space-factor spacing-increment base-shortest-duration shortest-duration-space common-shortest-duration");
 
 ADD_INTERFACE (Spacing_interface, "spacing-interface",
-  "Something to do with line breaking and spacing. Kill this one after determining line breaks.",
-  "");
+              "Something to do with line breaking and spacing. Kill this one after determining line breaks.",
+              "");
 
index 267be1b517be248950c88a46a889827ab9babb90..6f3df8c95fcf6ad0428b039d3837fc65255c8471 100644 (file)
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
 
-/** 
-  Make arpeggios that span multiple staves.  Catch arpeggios, and span a
-  Span_arpeggio over them if we find more than two arpeggios.
-  */
+/**
+   Make arpeggios that span multiple staves.  Catch arpeggios, and span a
+   Span_arpeggio over them if we find more than two arpeggios.
+*/
 class Span_arpeggio_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Span_arpeggio_engraver);
-  
+
 protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void process_acknowledged_grobs ();
@@ -33,7 +33,6 @@ private:
   Link_array<Grob> arpeggios_;
 };
 
-
 Span_arpeggio_engraver::Span_arpeggio_engraver ()
 {
   span_arpeggio_ = 0;
@@ -63,20 +62,20 @@ Span_arpeggio_engraver::process_acknowledged_grobs ()
       && to_boolean (get_property ("connectArpeggios")))
     {
       span_arpeggio_ = make_item ("Arpeggio", SCM_EOL);
-            
+
     }
 }
 
 void
 Span_arpeggio_engraver::stop_translation_timestep ()
 {
-  if (span_arpeggio_) 
+  if (span_arpeggio_)
     {
       /*
        we do this very late, to make sure we also catch `extra'
        side-pos support like accidentals.
-       */
-      for (int i = 0; i < arpeggios_.size (); i ++)
+      */
+      for (int i = 0; i < arpeggios_.size (); i++)
        {
          for (SCM s = arpeggios_[i]->get_property ("stems");
               scm_is_pair (s); s = scm_cdr (s))
@@ -91,18 +90,16 @@ Span_arpeggio_engraver::stop_translation_timestep ()
            it transparent.  */
          arpeggios_[i]->set_property ("print-function", SCM_EOL);
        }
-      
+
       span_arpeggio_ = 0;
     }
   arpeggios_.clear ();
 }
 
-
-
 ADD_TRANSLATOR (Span_arpeggio_engraver,
-/* descr */       "",
-/* creats*/       "Arpeggio",
-/* accepts */     "",
-/* acks  */      "arpeggio-interface",
-/* reads */       "connectArpeggios",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "Arpeggio",
+               /* accepts */ "",
+               /* acks  */ "arpeggio-interface",
+               /* reads */ "connectArpeggios",
+               /* write */ "");
index 6bfcd31c2e9b5dec7829c29b9a0e623e2420683c..879477420c9d77b5d18320558cc853bc2da7e02d 100644 (file)
 #include "span-bar.hh"
 #include "engraver.hh"
 
-/** 
+/**
 
-  Make bars that span multiple "staves". Catch bars, and span a
-  Span_bar over them if we find more than 2 bars.  Vertical alignment
-  of staves changes the appearance of spanbars.  It is up to the
-  aligner (Vertical_align_engraver, in this case, to add extra
-  dependencies to the spanbars.
-
-  */
+Make bars that span multiple "staves". Catch bars, and span a
+Span_bar over them if we find more than 2 bars.  Vertical alignment
+of staves changes the appearance of spanbars.  It is up to the
+aligner (Vertical_align_engraver, in this case, to add extra
+dependencies to the spanbars.
+*/
 class Span_bar_engraver : public Engraver
 {
   Item *spanbar_;
@@ -43,15 +42,15 @@ Span_bar_engraver::acknowledge_grob (Grob_info i)
   int depth = i.origin_contexts (this).size ();
   if (depth && Bar_line::has_interface (i.grob_))
     {
-      Item * it = dynamic_cast<Item*> (i.grob_);
+      Item *it = dynamic_cast<Item *> (i.grob_);
       bars_.push (it);
 
-      if (bars_.size () >= 2 && !spanbar_) 
+      if (bars_.size () >= 2 && !spanbar_)
        {
          spanbar_ = make_item ("SpanBar", SCM_EOL);
 
          spanbar_->set_parent (bars_[0], X_AXIS);
-         
+
        }
     }
 }
@@ -59,28 +58,26 @@ Span_bar_engraver::acknowledge_grob (Grob_info i)
 void
 Span_bar_engraver::stop_translation_timestep ()
 {
-  if (spanbar_) 
+  if (spanbar_)
     {
-      for (int i = 0; i < bars_.size () ; i++)
+      for (int i = 0; i < bars_.size (); i++)
        Span_bar::add_bar (spanbar_, bars_[i]);
 
       SCM vissym = ly_symbol2scm ("break-visibility");
-      SCM vis = bars_[0]->internal_get_property (vissym);        
+      SCM vis = bars_[0]->internal_get_property (vissym);
       if (ly_c_equal_p (spanbar_->internal_get_property (vissym), vis))
        spanbar_->internal_set_property (vissym, vis);
 
-      
       spanbar_ = 0;
     }
   bars_.set_size (0);
 }
 
-
 ADD_TRANSLATOR (Span_bar_engraver,
-/* descr */       "This engraver makes cross-staff barlines: It catches all normal "
-"bar lines, and draws a single span-bar across them.",
-/* creats*/       "SpanBar",
-/* accepts */     "",
-/* acks  */      "bar-line-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "This engraver makes cross-staff barlines: It catches all normal "
+               "bar lines, and draws a single span-bar across them.",
+               /* creats*/ "SpanBar",
+               /* accepts */ "",
+               /* acks  */ "bar-line-interface",
+               /* reads */ "",
+               /* write */ "");
index 052808adb97a8d162b5f2845359b9ac9eb824b3b..2d76103c381829c1e82c9fc2b367bb9c223dd80d 100644 (file)
@@ -17,9 +17,9 @@
 #include "bar-line.hh"
 
 void
-Span_bar::add_bar (Grob*me, Grob*b)
+Span_bar::add_bar (Grob *me, Grob *b)
 {
-  Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"),  b);
+  Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), b);
 
   me->add_dependency (b);
 }
@@ -28,24 +28,24 @@ MAKE_SCHEME_CALLBACK (Span_bar, print, 1);
 
 /* Limitations/Bugs:
 
-   (1) Elements from 'me->get_property ("elements")' must be
-   ordered according to their y coordinates relative to their common
-   axis group parent.  Otherwise, the computation goes mad.
+(1) Elements from 'me->get_property ("elements")' must be
+ordered according to their y coordinates relative to their common
+axis group parent.  Otherwise, the computation goes mad.
 
-   (TODO:
-   apply a sort algorithm that ensures this precondition.)  However,
-   until now, I have seen no case where lily has not fulfilled this
-   precondition.
+(TODO:
+apply a sort algorithm that ensures this precondition.)  However,
+until now, I have seen no case where lily has not fulfilled this
+precondition.
 
-   (2) This method depends on bar_engraver not being removed from
-   staff context.  If bar_engraver is removed, the size of the staff
-   lines is evaluated as 0, which results in a solid span bar line
-   with faulty y coordinate. */
+(2) This method depends on bar_engraver not being removed from
+staff context.  If bar_engraver is removed, the size of the staff
+lines is evaluated as 0, which results in a solid span bar line
+with faulty y coordinate. */
 
 /* This routine was originally by Juergen Reuter, but it was a on the
    bulky side. Rewritten by Han-Wen. */
 SCM
-Span_bar::print (SCM smobbed_me) 
+Span_bar::print (SCM smobbed_me)
 {
   Grob *me = unsmob_grob (smobbed_me);
   SCM first_elt = me->get_property ("elements");
@@ -63,10 +63,10 @@ Span_bar::print (SCM smobbed_me)
   SCM glyph = me->get_property ("glyph");
 
   /* glyph may not be a string, when ME is killed by Hara Kiri in
-    between. */
+     between. */
   if (!scm_is_string (glyph))
     return SCM_EOL;
-  
+
   String glyph_string = ly_scm2string (glyph);
 
   /* compose span_bar_mol */
@@ -79,12 +79,12 @@ Span_bar::print (SCM smobbed_me)
       Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
       Interval ext = staff_bar->extent (refp, Y_AXIS);
       if (ext.is_empty ())
-       continue; 
-      
+       continue;
+
       if (!prev_extent.is_empty ())
        {
          Interval l (prev_extent [UP],
-                    ext[DOWN]);
+                     ext[DOWN]);
 
          if (l.is_empty ())
            {
@@ -93,8 +93,8 @@ Span_bar::print (SCM smobbed_me)
          else
            {
              Stencil interbar = Bar_line::compound_barline (staff_bar,
-                                                             glyph_string,
-                                                             l.length ());
+                                                            glyph_string,
+                                                            l.length ());
              interbar.translate_axis (l.center (), Y_AXIS);
              span_bar_mol.add_stencil (interbar);
            }
@@ -104,7 +104,7 @@ Span_bar::print (SCM smobbed_me)
 
   span_bar_mol.translate_axis (- me->relative_coordinate (refp, Y_AXIS),
                               Y_AXIS);
-  
+
   return span_bar_mol.smobbed_copy ();
 }
 
@@ -121,7 +121,7 @@ Span_bar::width_callback (SCM element_smob, SCM scm_axis)
     urg.
   */
   Stencil m = Bar_line::compound_barline (se, gl, 40 PT);
-  
+
   return ly_interval2scm (m.extent (X_AXIS));
 }
 
@@ -129,7 +129,7 @@ MAKE_SCHEME_CALLBACK (Span_bar, before_line_breaking, 1);
 SCM
 Span_bar::before_line_breaking (SCM smob)
 {
-  Grob * g = unsmob_grob (smob);
+  Grob *g = unsmob_grob (smob);
   evaluate_empty (g);
   evaluate_glyph (g);
 
@@ -150,19 +150,19 @@ Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis)
   Interval i (get_spanned_interval (me));
 
   /* Bar_line::print delivers a barline of y-extent (-h/2, h/2), so
-     we have to translate ourselves to be in the center of the 
+     we have to translate ourselves to be in the center of the
      interval that we span. */
   if (i.is_empty ())
     {
       me->suicide ();
       return scm_make_real (0.0);
     }
-  
+
   return scm_make_real (i.center ());
 }
 
 void
-Span_bar::evaluate_empty (Grob*me)
+Span_bar::evaluate_empty (Grob *me)
 {
   /* TODO: filter all hara-kiried out of ELEMENS list, and then
      optionally do suicide. Call this cleanage function from
@@ -174,13 +174,13 @@ Span_bar::evaluate_empty (Grob*me)
 }
 
 void
-Span_bar::evaluate_glyph (Grob*me)
+Span_bar::evaluate_glyph (Grob *me)
 {
   SCM gl = me->get_property ("glyph");
 
   if (scm_is_string (gl))
-    return ;
-  
+    return;
+
   for (SCM s = me->get_property ("elements");
        !scm_is_string (gl) && scm_is_pair (s); s = scm_cdr (s))
     {
@@ -193,9 +193,9 @@ Span_bar::evaluate_glyph (Grob*me)
       me->suicide ();
       return;
     }
-  
+
   String type = ly_scm2string (gl);
-  if (type == "|:") 
+  if (type == "|:")
     {
       type = ".|";
     }
@@ -215,18 +215,17 @@ Span_bar::evaluate_glyph (Grob*me)
 }
 
 Interval
-Span_bar::get_spanned_interval (Grob*me) 
+Span_bar::get_spanned_interval (Grob *me)
 {
   return ly_scm2interval (Axis_group_interface::group_extent_callback
-                         (me->self_scm (), scm_int2num (Y_AXIS))); 
+                         (me->self_scm (), scm_int2num (Y_AXIS)));
 }
 
-
 MAKE_SCHEME_CALLBACK (Span_bar, get_bar_size, 1);
 SCM
 Span_bar::get_bar_size (SCM smob)
 {
-  Grob* me =  unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
   Interval iv (get_spanned_interval (me));
   if (iv.is_empty ())
     {
@@ -237,11 +236,8 @@ Span_bar::get_bar_size (SCM smob)
   return scm_make_real (iv.length ());
 }
 
-
-
 ADD_INTERFACE (Span_bar, "span-bar-interface",
-  "A bar line that spanned between other barlines. This interface is "
+              "A bar line that spanned between other barlines. This interface is "
               " used for  bar lines that connect different staves.",
-  "elements");
-
+              "elements");
 
index 1b11fba6e7d637422d9ecc0b488fa4c558e08ffb..175c1da92f53df049f545fa3fb73fce11dab84df 100644 (file)
 /*
   TODO: fold this into 1 engraver: \< and \> should also stop when
   absdyn is encountered.
- */
+*/
 
 struct Audio_dynamic_tuple
 {
-  Audio_dynamicaudio_;
+  Audio_dynamic *audio_;
   Moment mom_;
 };
 
 /**
    perform span-dynamics
- */
+*/
 class Span_dynamic_performer : public Performer
 {
 public:
   TRANSLATOR_DECLARATIONS (Span_dynamic_performer);
 
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void acknowledge_audio_element (Audio_element_info);
   virtual void process_music ();
   virtual void stop_translation_timestep ();
 
 private:
-  Audio_dynamicaudio_;
+  Audio_dynamic *audio_;
   Real last_volume_;
-  Musicspan_start_event_;
-  Drul_array<Music*> span_events_;
+  Music *span_start_event_;
+  Drul_array<Music *> span_events_;
   Array<Audio_dynamic_tuple> dynamic_tuples_;
   Array<Audio_dynamic_tuple> finished_dynamic_tuples_;
   Direction dir_;
@@ -57,7 +57,7 @@ Span_dynamic_performer::Span_dynamic_performer ()
 void
 Span_dynamic_performer::acknowledge_audio_element (Audio_element_info i)
 {
-  if (Audio_dynamic * d = dynamic_cast <Audio_dynamic*> (i.elem_))
+  if (Audio_dynamic *d = dynamic_cast<Audio_dynamic *> (i.elem_))
     {
       last_volume_ = d->volume_;
     }
@@ -76,7 +76,7 @@ Span_dynamic_performer::process_music ()
       Audio_dynamic_tuple a = { audio_, now_mom () };
       dynamic_tuples_.push (a);
     }
-  
+
   if (span_events_[STOP])
     {
       if (!span_start_event_)
@@ -95,20 +95,20 @@ Span_dynamic_performer::process_music ()
 
   if (span_events_[START])
     {
-      dir_ =  (span_events_[START]->is_mus_type ("crescendo-event"))
+      dir_ = (span_events_[START]->is_mus_type ("crescendo-event"))
        ? RIGHT : LEFT;
       span_start_event_ = span_events_[START];
-      
+
       dynamic_tuples_.clear ();
       Audio_dynamic_tuple a = { audio_, now_mom () };
       dynamic_tuples_.push (a);
     }
 
   if (span_events_[STOP])
-    { 
+    {
       finished_dynamic_tuples_.top ().audio_->volume_ = last_volume_;
     }
-  
+
   if (span_events_[START])
     {
       dynamic_tuples_[0].audio_->volume_ = last_volume_;
@@ -130,26 +130,26 @@ Span_dynamic_performer::stop_translation_timestep ()
        urg.
        Catch and fix the case of:
 
-             |                         |
-           x|                        x|
-            f cresc.  -- -- -- -- --  pp 
+       |                         |
+       x|                        x|
+       f cresc.  -- -- -- -- --  pp
 
-        Actually, we should provide a non-displayed dynamic/volume setting,
-        to set volume to 'ff' just before the pp.
-       */
+       Actually, we should provide a non-displayed dynamic/volume setting,
+       to set volume to 'ff' just before the pp.
+      */
       if (!dv || sign (dv) != finished_dir_)
        {
          // urg.  20%: about two volume steps
          dv = (Real)finished_dir_ * 0.2;
          if (!start_volume)
            start_volume = finished_dynamic_tuples_.top
- ().audio_->volume_ - dv;
            ().audio_->volume_ - dv;
        }
       Moment start_mom = finished_dynamic_tuples_[0].mom_;
       Moment dt = finished_dynamic_tuples_.top ().mom_ - start_mom;
       for (int i = 0; i < finished_dynamic_tuples_.size (); i++)
        {
-         Audio_dynamic_tuplea = &finished_dynamic_tuples_[i];
+         Audio_dynamic_tuple *a = &finished_dynamic_tuples_[i];
          Real volume = start_volume + dv * (Real) (a->mom_ - start_mom).main_part_
            / (Real)dt.main_part_;
          a->audio_->volume_ = volume;
@@ -169,7 +169,7 @@ Span_dynamic_performer::stop_translation_timestep ()
 }
 
 bool
-Span_dynamic_performer::try_music (Musicr)
+Span_dynamic_performer::try_music (Music *r)
 {
   if (r->is_mus_type ("crescendo-event")
       || r->is_mus_type ("decrescendo-event"))
@@ -181,6 +181,6 @@ Span_dynamic_performer::try_music (Music* r)
   return false;
 }
 ADD_TRANSLATOR (Span_dynamic_performer,
-                  "", "",
-                  "crescendo-event decrescendo-event", 
-                  "", "", "");
+               "", "",
+               "crescendo-event decrescendo-event",
+               "", "", "");
index 842d706e6de509d1e7b190c308f06dc2a1cce22a..0a72592b3218c6917758d3637bb72179916ea794 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <math.h>
 
-#include <libc-extension.hh>
+#include <libc - extension.hh>
 
 #include "warn.hh"
 #include "paper-column.hh"
@@ -20,9 +20,7 @@
 #include "system.hh"
 #include "group-interface.hh"
 
-
-
-Grob * 
+Grob *
 Spanner::clone (int count) const
 {
   return new Spanner (*this, count);
@@ -32,29 +30,29 @@ void
 Spanner::do_break_processing ()
 {
   //break_into_pieces
-  Item * left = spanned_drul_[LEFT];
-  Item * right = spanned_drul_[RIGHT];
+  Item *left = spanned_drul_[LEFT];
+  Item *right = spanned_drul_[RIGHT];
 
   if (!left || !right)
     return;
-  
+
   /*
     Check if our parent in X-direction spans equally wide
     or wider than we do.
-   */
-  for (int a = X_AXIS; a < NO_AXES; a ++)
+  */
+  for (int a = X_AXIS; a < NO_AXES; a++)
     {
-      if (Spanner* parent = dynamic_cast<Spanner*> (get_parent ((Axis)a)))
+      if (Spanner *parent = dynamic_cast<Spanner *> (get_parent ((Axis)a)))
        {
          if (!parent->spanned_rank_iv ().superset (this->spanned_rank_iv ()))
            {
              programming_error (to_string ("Spanner `%s' is not fully contained in parent spanner `%s'.",
-                                        name ().to_str0 (),
-                                        parent->name ().to_str0 ()));
+                                           name ().to_str0 (),
+                                           parent->name ().to_str0 ()));
            }
        }
     }
-  
+
   if (get_system () || is_broken ())
     return;
 
@@ -66,16 +64,16 @@ Spanner::do_break_processing ()
       Direction d = LEFT;
       do
        {
-         Itembound = left->find_prebroken_piece (d);
+         Item *bound = left->find_prebroken_piece (d);
          if (!bound)
            programming_error ("no broken bound");
          else if (bound->get_system ())
            {
-             Spanner * span = dynamic_cast<Spanner*> (clone (broken_intos_.size ()));
+             Spanner *span = dynamic_cast<Spanner *> (clone (broken_intos_.size ()));
              span->set_bound (LEFT, bound);
              span->set_bound (RIGHT, bound);
 
-             assert (span->get_system ()); 
+             assert (span->get_system ());
              span->get_system ()->typeset_grob (span);
              broken_intos_.push (span);
            }
@@ -89,10 +87,10 @@ Spanner::do_break_processing ()
       break_points.insert (left, 0);
       break_points.push (right);
 
-      for (int i =1; i < break_points.size (); i++) 
+      for (int i =1; i < break_points.size (); i++)
        {
-         Drul_array<Item*> bounds;
-         bounds[LEFT] = break_points[i-1];
+         Drul_array<Item *> bounds;
+         bounds[LEFT] = break_points[i - 1];
          bounds[RIGHT] = break_points[i];
          Direction d = LEFT;
          do
@@ -102,18 +100,18 @@ Spanner::do_break_processing ()
            }
          while ((flip (&d))!= LEFT);
 
-         if (!bounds[LEFT] ||  ! bounds[RIGHT])
+         if (!bounds[LEFT] || ! bounds[RIGHT])
            {
              programming_error ("bounds of this piece aren't breakable. ");
-             continue; 
+             continue;
            }
 
-         Spanner *span = dynamic_cast<Spanner*> (clone (broken_intos_.size ()));
+         Spanner *span = dynamic_cast<Spanner *> (clone (broken_intos_.size ()));
          span->set_bound (LEFT, bounds[LEFT]);
          span->set_bound (RIGHT, bounds[RIGHT]);
 
-         if (!bounds[LEFT]->get_system () 
-           
+         if (!bounds[LEFT]->get_system ()
+
              || !bounds[RIGHT]->get_system ()
              || bounds[LEFT]->get_system () != bounds[RIGHT]->get_system ())
            {
@@ -142,13 +140,13 @@ void
 Spanner::set_my_columns ()
 {
   Direction i = (Direction) LEFT;
-  do 
+  do
     {
       if (!spanned_drul_[i]->get_system ())
        set_bound (i, spanned_drul_[i]->find_prebroken_piece ((Direction) -i));
-    } 
+    }
   while (flip (&i) != LEFT);
-}       
+}
 
 Interval_t<int>
 Spanner::spanned_rank_iv ()
@@ -162,8 +160,7 @@ Spanner::spanned_rank_iv ()
   return iv;
 }
 
-
-Item*
+Item *
 Spanner::get_bound (Direction d) const
 {
   return spanned_drul_ [d];
@@ -174,21 +171,21 @@ Spanner::get_bound (Direction d) const
   X-axis parent of THIS to S.
 */
 void
-Spanner::set_bound (Direction d, Grob*s)
+Spanner::set_bound (Direction d, Grob *s)
 {
-  Item * i = dynamic_cast<Item*> (s);
+  Item *i = dynamic_cast<Item *> (s);
   if (!i)
     {
       programming_error ("Must have Item for spanner bound.");
       return;
     }
-  
+
   spanned_drul_[d] = i;
 
   /**
      We check for System to prevent the column -> line_of_score
      -> column -> line_of_score -> etc situation */
-  if (d == LEFT && !dynamic_cast<System*> (this))
+  if (d == LEFT && !dynamic_cast<System *> (this))
     {
       set_parent (i, X_AXIS);
     }
@@ -199,15 +196,15 @@ Spanner::set_bound (Direction d, Grob*s)
 
     [maybe we should try keeping all columns alive?, and perhaps
     inherit position from their (non-)musical brother]
-    
+
   */
-  if (dynamic_cast<Paper_column*> (i))
+  if (dynamic_cast<Paper_column *> (i))
     {
-      Pointer_group_interface::add_grob (i, ly_symbol2scm ("bounded-by-me"), this);  
+      Pointer_group_interface::add_grob (i, ly_symbol2scm ("bounded-by-me"), this);
     }
 }
 
-Spanner::Spanner (SCM s, Object_key const*key)
+Spanner::Spanner (SCM s, Object_key const *key)
   : Grob (s, key)
 {
   break_index_ = 0;
@@ -225,14 +222,14 @@ Spanner::Spanner (Spanner const &s, int count)
 
 Real
 Spanner::spanner_length () const
-{  
+{
   Real l = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS);
   Real r = spanned_drul_[RIGHT]->relative_coordinate (0, X_AXIS);
 
   if (r< l)
     programming_error ("spanner with negative length");
 
-  return r-l;
+  return r - l;
 }
 
 System *
@@ -245,23 +242,21 @@ Spanner::get_system () const
   return spanned_drul_[LEFT]->get_system ();
 }
 
-
-Grob*
-Spanner::find_broken_piece (System*l) const
+Grob *
+Spanner::find_broken_piece (System *l) const
 {
-  int idx = binsearch_links (broken_intos_, (Spanner*)l, Spanner::compare);
-  
+  int idx = binsearch_links (broken_intos_, (Spanner *)l, Spanner::compare);
+
   if (idx < 0)
     return 0;
   else
     return broken_intos_ [idx];
 }
 
-
 int
-Spanner::compare (Spanner * const &p1, Spanner * const &p2)
+Spanner::compare (Spanner *const &p1, Spanner *const &p2)
 {
-  return  p1->get_system ()->rank_ - p2->get_system ()->rank_;
+  return p1->get_system ()->rank_ - p2->get_system ()->rank_;
 }
 
 bool
@@ -270,7 +265,6 @@ Spanner::is_broken () const
   return broken_intos_.size ();
 }
 
-
 /*
   If this is a broken spanner, return the amount the left end is to be
   shifted horizontally so that the spanner starts after the initial
@@ -280,14 +274,13 @@ Spanner::is_broken () const
 Real
 Spanner::get_broken_left_end_align () const
 {
-  Paper_column *sc = dynamic_cast<Paper_column*> (spanned_drul_[LEFT]->get_column ());
+  Paper_column *sc = dynamic_cast<Paper_column *> (spanned_drul_[LEFT]->get_column ());
 
   // Relevant only if left span point is first column in line
-  if (sc != NULL &&
-      sc->break_status_dir () == RIGHT)
+  if (sc != NULL
+      && sc->break_status_dir () == RIGHT)
     {
       /*
-       
        We used to do a full search for the Break_align_item.
        But that doesn't make a difference, since the Paper_column
        is likely to contain only a Break_align_item.
@@ -305,28 +298,27 @@ Spanner::do_derived_mark () const
     We'd be fucked if this is called before spanned_drul_[] is inited.  */
   if (status_ == ORPHAN)
     return SCM_EOL;
-  
+
   Direction d = LEFT;
   do
     if (spanned_drul_[d])
       scm_gc_mark (spanned_drul_[d]->self_scm ());
   while (flip (&d) != LEFT);
 
-  for (int i = broken_intos_.size () ; i--;)
+  for (int i = broken_intos_.size (); i--;)
     scm_gc_mark (broken_intos_[i]->self_scm ());
 
   return SCM_EOL;
 }
 
-
 /*
   Set left or right bound to IT.
 
   Warning: caller should ensure that subsequent calls put in ITems
   that are left-to-right ordered.
- */
+*/
 void
-add_bound_item (Spanner* sp, Grob*it)
+add_bound_item (Spanner *sp, Grob *it)
 {
   if (!sp->get_bound (LEFT))
     sp->set_bound (LEFT, it);
@@ -334,48 +326,44 @@ add_bound_item (Spanner* sp, Grob*it)
     sp->set_bound (RIGHT, it);
 }
 
-
 MAKE_SCHEME_CALLBACK (Spanner, set_spacing_rods, 1);
 SCM
 Spanner::set_spacing_rods (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   Rod r;
-  Spanner*sp = dynamic_cast<Spanner*> (me);
+  Spanner *sp = dynamic_cast<Spanner *> (me);
   r.item_drul_[LEFT] = sp->get_bound (LEFT);
   r.item_drul_[RIGHT] = sp->get_bound (RIGHT);
-  r.distance_ =
-    robust_scm2double (me->get_property ("minimum-length"), 0);
+  r.distance_
+    robust_scm2double (me->get_property ("minimum-length"), 0);
 
   r.add_to_cols ();
   return SCM_UNSPECIFIED;
 }
 
-
 /*
-  Return I such that SP == SP->ORIGINAL_->BROKEN_INTOS_[I]. 
- */
+  Return I such that SP == SP->ORIGINAL_->BROKEN_INTOS_[I].
+*/
 int
-broken_spanner_index (Spanner * sp)
+broken_spanner_index (Spanner *sp)
 {
-  Spanner * parent = dynamic_cast<Spanner*> (sp->original_);
+  Spanner *parent = dynamic_cast<Spanner *> (sp->original_);
   return parent->broken_intos_.find_index (sp);
 }
-                     
 
-Spanner*
-unsmob_spanner (SCM s )
+Spanner *
+unsmob_spanner (SCM s)
 {
-  return dynamic_cast<Spanner*> (unsmob_grob (s));
+  return dynamic_cast<Spanner *> (unsmob_grob (s));
 }
 
 ADD_INTERFACE (Spanner,
-             "spanner-interface",
-"Some objects are horizontally spanned between objects. For\n"
-"example, slur, beam, tie, etc. These grobs form a subtype called\n"
-"@code{Spanner}. All spanners have two span-points (these must be\n"
-"@code{Item} objects), one on the left and one on the right. The left bound is\n"
-"also the X-reference point of the spanner.\n"
-,
-             "minimum-length");
+              "spanner-interface",
+              "Some objects are horizontally spanned between objects. For\n"
+              "example, slur, beam, tie, etc. These grobs form a subtype called\n"
+              "@code{Spanner}. All spanners have two span-points (these must be\n"
+              "@code{Item} objects), one on the left and one on the right. The left bound is\n"
+              "also the X-reference point of the spanner.\n",
+              "minimum-length");
index baf3e9eb0e53c46a53fa7cfb20f570cb3c6e8b51..ecbeed1993978ea1a76aca7791d35f16be656dd6 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   spring.cc -- implement Spring
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "spring.hh"
 #include "warn.hh"
@@ -19,7 +18,6 @@ Spring_smob::Spring_smob ()
   other_ = 0;
 }
 
-
 IMPLEMENT_SIMPLE_SMOBS (Spring_smob);
 
 SCM
@@ -33,7 +31,7 @@ Spring_smob::print_smob (SCM, SCM p, scm_print_state *)
 }
 
 SCM
-Spring_smob::equal_p (SCM a , SCM b)
+Spring_smob::equal_p (SCM a, SCM b)
 {
   return a == b? SCM_BOOL_T : SCM_BOOL_F;
 }
index fb9ff7d639f55bd3ce6c0f8fc7e84fdc9d4abe18..ad8ca8546af9166f6c8f18b60e4660362d37dfa6 100644 (file)
@@ -1,11 +1,10 @@
-/*   
-staff-collecting-engraver.cc -- implement Staff_collecting_engraver
+/*
+  staff-collecting-engraver.cc -- implement Staff_collecting_engraver
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "staff-symbol.hh"
 #include "engraver.hh"
@@ -21,7 +20,7 @@ public:
 
 Staff_collecting_engraver::Staff_collecting_engraver ()
 {
-  
+
 }
 
 void
@@ -36,12 +35,11 @@ Staff_collecting_engraver::acknowledge_grob (Grob_info gi)
     }
 }
 
-
 ADD_TRANSLATOR (Staff_collecting_engraver,
-/* descr */       "Maintain the stavesFound variable",
+               /* descr */ "Maintain the stavesFound variable",
 
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "staff-symbol-interface",
-/* reads */       "stavesFound",
-/* write */       "stavesFound");
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "staff-symbol-interface",
+               /* reads */ "stavesFound",
+               /* write */ "stavesFound");
index fda68819a01dc8a8333dff944f91415417274e2e..902744a6cc7c44f22efdad40e28a1dada7be24b4 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- */
+*/
 
 #include "warn.hh"
 #include "audio-column.hh"
 #include "context.hh"
 
 /** Perform a staff. Individual notes should have their instrument
- (staff-wide) set, so we override play_element ()
-
-  */
-class Staff_performer : public Performer_group_performer 
+    (staff-wide) set, so we override play_element ()
+*/
+class Staff_performer : public Performer_group_performer
 {
 public:
   TRANSLATOR_DECLARATIONS (Staff_performer);
@@ -27,23 +26,23 @@ public:
   String instrument_string_;
 
 protected:
-  virtual void play_element (Audio_elementp);
+  virtual void play_element (Audio_element *p);
   virtual void finalize ();
   virtual void initialize ();
   virtual void create_audio_elements ();
   virtual void stop_translation_timestep ();
 
 private:
-  Audio_staffaudio_staff_;
-  Audio_instrumentinstrument_;
-  Audio_textinstrument_name_;
-  Audio_textname_;
-  Audio_tempotempo_;
+  Audio_staff *audio_staff_;
+  Audio_instrument *instrument_;
+  Audio_text *instrument_name_;
+  Audio_text *name_;
+  Audio_tempo *tempo_;
 };
 
 ADD_TRANSLATOR (Staff_performer, "", "",
-                  "",
-                  "", "", "");
+               "",
+               "", "", "");
 
 Staff_performer::Staff_performer ()
 {
@@ -86,7 +85,7 @@ Staff_performer::create_audio_elements ()
 
       /*
        Have to be here before notes arrive into the staff.
-       */
+      */
       play_element (instrument_);
       play_element (instrument_name_);
     }
@@ -97,9 +96,9 @@ void
 Staff_performer::stop_translation_timestep ()
 {
   SCM proc = ly_lily_module_constant ("percussion?");
-  
+
   SCM drums = scm_call_1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
-  audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1 );
+  audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1);
   if (name_)
     {
       play_element (name_);
@@ -123,9 +122,9 @@ Staff_performer::finalize ()
   audio_staff_ = 0;
 }
 
-String 
-Staff_performer::new_instrument_string () 
-{ 
+String
+Staff_performer::new_instrument_string ()
+{
   // mustn't ask Score for instrument: it will return piano!
   SCM minstr = get_property ("midiInstrument");
 
@@ -138,10 +137,10 @@ Staff_performer::new_instrument_string ()
   return instrument_string_;
 }
 
-void 
-Staff_performer::play_element (Audio_elementp)
+void
+Staff_performer::play_element (Audio_element *p)
 {
-  if (Audio_item *ai = dynamic_cast<Audio_item *> (p)) 
+  if (Audio_item *ai = dynamic_cast<Audio_item *> (p))
     {
       audio_staff_->add_audio_item (ai);
     }
index 623e27176634eb69bd6bb7257e37415f8d74f223..124f19d3700331ecd3f2f31bd9d1250f94027cee 100644 (file)
@@ -1,17 +1,16 @@
-/*   
-     staff-spacing.cc -- implement Staff_spacing
-
-     source file of the GNU LilyPond music typesetter
+/*
+  staff-spacing.cc -- implement Staff_spacing
 
-     (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  source file of the GNU LilyPond music typesetter
 
+  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "staff-spacing.hh"
 
 #include <cstdio>
 
-#include "paper-column.hh" 
+#include "paper-column.hh"
 #include "separation-item.hh"
 #include "warn.hh"
 #include "bar-line.hh"
 /*
   Insert some more space for the next note, in case it has a stem in
   the wrong direction
-
- */
+*/
 Real
-Staff_spacing::next_note_correction (Grob * me,
-                                    Grob * g,
+Staff_spacing::next_note_correction (Grob *me,
+                                    Grob *g,
                                     Interval bar_size)
 {
   if (!g || !Note_column::has_interface (g))
     return 0.0;
 
-  Item *col = dynamic_cast<Item*> (g)->get_column ();
+  Item *col = dynamic_cast<Item *> (g)->get_column ();
   Real max_corr = 0. >? (- g->extent (col, X_AXIS)[LEFT]);
 
   /*
     Duh. If this gets out of hand, we should invent something more generic.
-   */
-  if (Grob * a = Note_column::accidentals (g))
+  */
+  if (Grob *a = Note_column::accidentals (g))
     {
       Interval v;
       if (Accidental_placement::has_interface (a))
@@ -48,21 +46,21 @@ Staff_spacing::next_note_correction (Grob * me,
        }
       else
        v = a->extent (col, X_AXIS);
-      
+
       max_corr = max_corr >? (- v[LEFT]);
     }
-  if (Groba = unsmob_grob (g->get_property ("arpeggio")))
+  if (Grob *a = unsmob_grob (g->get_property ("arpeggio")))
     {
       max_corr = max_corr >? (- a->extent (col, X_AXIS)[LEFT]);
     }
-  
+
   /*
     Let's decrease the space a little if the problem is not located
     after a barline.
   */
   if (bar_size.is_empty ())
     max_corr *= 0.75;
-  
+
   if (!bar_size.is_empty ())
     if (Grob *stem = Note_column::get_stem (g))
       {
@@ -70,15 +68,15 @@ Staff_spacing::next_note_correction (Grob * me,
        if (d == DOWN)
          {
            Real stem_start = Stem::head_positions (stem) [DOWN];
-           Real stem_end = Stem::stem_end_position (stem); 
+           Real stem_end = Stem::stem_end_position (stem);
            Interval stem_posns (stem_start <? stem_end,
                                 stem_end >? stem_start);
 
            stem_posns.intersect (bar_size);
 
-           Real corr = abs (stem_posns.length ()/7.) <? 1.0;
-           corr *=
-             robust_scm2double (me->get_property ("stem-spacing-correction"), 1);
+           Real corr = abs (stem_posns.length () / 7.) <? 1.0;
+           corr
+             *= robust_scm2double (me->get_property ("stem-spacing-correction"), 1);
 
            if (d != DOWN)
              corr = 0.0;
@@ -88,7 +86,6 @@ Staff_spacing::next_note_correction (Grob * me,
   return max_corr;
 }
 
-
 /*
   Y-positions that are covered by BAR_GROB, in the case that it is a
   barline.  */
@@ -100,7 +97,7 @@ Staff_spacing::bar_y_positions (Grob *bar_grob)
   if (Bar_line::has_interface (bar_grob))
     {
       SCM glyph = bar_grob->get_property ("glyph");
-      
+
       String glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : "";
       if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".")
        {
@@ -119,44 +116,43 @@ Staff_spacing::bar_y_positions (Grob *bar_grob)
   This is slightly convoluted, since the staffspacing grob gets
   pointers to the separation-items, not the note-columns or
   note-spacings.
-  
- */
+*/
 Real
-Staff_spacing::next_notes_correction (Grob *me, Grob * last_grob)
+Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob)
 {
   Interval bar_size = bar_y_positions (last_grob);
   Real max_corr = 0.0;
 
   for (SCM s = me->get_property ("right-items");
-       scm_is_pair (s);  s = scm_cdr (s))
+       scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * g = unsmob_grob (scm_car (s));
+      Grob *g = unsmob_grob (scm_car (s));
 
-      max_corr = max_corr >?  next_note_correction (me, g,  bar_size);
+      max_corr = max_corr >? next_note_correction (me, g, bar_size);
       for (SCM t = g->get_property ("elements");
-          scm_is_pair (t); t  = scm_cdr (t))
+          scm_is_pair (t); t = scm_cdr (t))
        max_corr = max_corr >? next_note_correction (me, unsmob_grob (scm_car (t)), bar_size);
-      
+
     }
-  
+
   return max_corr;
 }
 
 void
-Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
+Staff_spacing::get_spacing_params (Grob *me, Real *space, Real *fixed)
 {
   *space = 1.0;
   *fixed = 1.0;
 
-  Grob * separation_item = 0;
-  Item * me_item  = dynamic_cast<Item*> (me);
-    
+  Grob *separation_item = 0;
+  Item *me_item = dynamic_cast<Item *> (me);
+
   for (SCM s = me->get_property ("left-items");
        scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * cand = unsmob_grob (scm_car (s));
+      Grob *cand = unsmob_grob (scm_car (s));
       if (cand && Separation_item::has_interface (cand))
-       separation_item = cand ;
+       separation_item = cand;
     }
 
   //  printf ("doing col %d\n" , Paper_column::get_rank (left_col));
@@ -169,30 +165,30 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
 
   Interval last_ext;
   Grob *last_grob = Separation_item::extremal_break_aligned_grob (separation_item, RIGHT,
-                                                &last_ext);
+                                                                 &last_ext);
   if (!last_grob)
     {
       /*
        TODO:
-       
+
        Should  insert a adjustable space here? For excercises, you might want to
-       use a staff without a clef in the beginning. 
-       */
-      
+       use a staff without a clef in the beginning.
+      */
+
       /*
        we used to have a warning here, but it generates a lot of
        spurious error messages.
       */
-      return ;
+      return;
     }
 
   *fixed = last_ext[RIGHT];
   *space = *fixed + 1.0;
-  
+
   SCM alist = last_grob->get_property ("space-alist");
   if (!scm_list_p (alist))
-    return ;
-  
+    return;
+
   SCM space_def = scm_sloppy_assq (ly_symbol2scm ("first-note"), alist);
   if (me_item->break_status_dir () == CENTER)
     {
@@ -200,32 +196,31 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
       if (scm_is_pair (nndef))
        space_def = nndef;
     }
-  
-  
+
   if (!scm_is_pair (space_def))
     {
-      programming_error ("Unknown prefatory spacing. "); 
-      return; 
+      programming_error ("Unknown prefatory spacing. ");
+      return;
     }
 
   space_def = scm_cdr (space_def);
   Real distance = scm_to_double (scm_cdr (space_def));
-  SCM type = scm_car (space_def) ;
+  SCM type = scm_car (space_def);
 
   *fixed = last_ext[RIGHT];
   if (type == ly_symbol2scm ("fixed-space"))
     {
-     *fixed += distance;
-     *space = *fixed;
+      *fixed += distance;
+      *space = *fixed;
     }
-  else if (type == ly_symbol2scm ("extra-space")) 
+  else if (type == ly_symbol2scm ("extra-space"))
     {
       *space = *fixed + distance;
     }
   else if (type == ly_symbol2scm ("semi-fixed-space"))
     {
-      *fixed += distance / 2; 
-      *space =  *fixed + distance/2;
+      *fixed += distance / 2;
+      *space = *fixed + distance / 2;
     }
   else if (type == ly_symbol2scm ("minimum-space"))
     {
@@ -236,13 +231,12 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
       *space = last_ext[LEFT] + (last_ext.length () >? distance);
       *fixed = *space;
     }
-  
+
   *space += next_notes_correction (me, last_grob);
 }
 
-
 ADD_INTERFACE (Staff_spacing, "staff-spacing-interface",
               "This object calculates spacing details from a "
               " breakable symbol (left) to another object. For example, it takes care "
               " of  optical spacing from  a bar lines to a note.",
-  "stem-spacing-correction left-items right-items");
+              "stem-spacing-correction left-items right-items");
index d9d9fb574336323e409fd33995d1224b3ec640e3..1c668ed8feb28a3704797744d118411d6b8dcb56 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #include "score.hh"
 #include "paper-column.hh"
 #include "output-def.hh"
 #include "moment.hh"
 
 /**
-  Manage the staff symbol.
- */
-class Staff_symbol_engraver : public Engraver { 
+   Manage the staff symbol.
+*/
+class Staff_symbol_engraver : public Engraver
+{
 public:
   TRANSLATOR_DECLARATIONS (Staff_symbol_engraver);
-  
+
 protected:
   Spanner *span_;
-  
+
   virtual ~Staff_symbol_engraver ();
   virtual void acknowledge_grob (Grob_info);
   virtual void finalize ();
   virtual void process_music ();
 };
 
-
 Staff_symbol_engraver::~Staff_symbol_engraver ()
 {
   assert (!span_);
@@ -47,10 +46,9 @@ Staff_symbol_engraver::process_music ()
   if (!span_)
     {
       span_ = make_spanner ("StaffSymbol", SCM_EOL);
-  
+
       span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
 
-      
     }
 }
 
@@ -71,20 +69,17 @@ Staff_symbol_engraver::acknowledge_grob (Grob_info s)
 }
 
 
-
-
 ADD_TRANSLATOR (Staff_symbol_engraver,
-/* descr */       "Create the constellation of five (default) "
-"staff lines.",
-/* creats*/       "StaffSymbol",
-/* accepts */     "",
-/* acks  */      "grob-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create the constellation of five (default) "
+               "staff lines.",
+               /* creats*/ "StaffSymbol",
+               /* accepts */ "",
+               /* acks  */ "grob-interface",
+               /* reads */ "",
+               /* write */ "");
 
 /****************************************************************/
 
-
 class Tab_staff_symbol_engraver : public Staff_symbol_engraver
 {
 public:
@@ -111,10 +106,10 @@ Tab_staff_symbol_engraver::Tab_staff_symbol_engraver ()
 }
 
 ADD_TRANSLATOR (Tab_staff_symbol_engraver,
-/* descr */       "Create a staff-symbol, but look at stringTunings for the number of lines."
-"staff lines.",
-/* creats*/       "StaffSymbol",
-/* accepts */     "",
-/* acks  */      "grob-interface",
-/* reads */       "stringTunings",
-/* write */       "");
+               /* descr */ "Create a staff-symbol, but look at stringTunings for the number of lines."
+               "staff lines.",
+               /* creats*/ "StaffSymbol",
+               /* accepts */ "",
+               /* acks  */ "grob-interface",
+               /* reads */ "stringTunings",
+               /* write */ "");
index 376fea6b5dfa2669501d4f7c844e66d3bb929f5d..3bc52e10d6810cc7a52c689217b5120573d82440 100644 (file)
@@ -17,8 +17,8 @@
 int
 Staff_symbol_referencer::line_count (Grob *me)
 {
- Grob *st = get_staff_symbol (me);
- return st ? Staff_symbol::line_count (st) : 0;
 Grob *st = get_staff_symbol (me);
 return st ? Staff_symbol::line_count (st) : 0;
 }
 
 bool
@@ -30,7 +30,7 @@ Staff_symbol_referencer::on_staffline (Grob *me)
 /*
   This does not take size into account.
   maybe rename: on_virtual_staffline, on_staff_or_ledger_line?
- */
+*/
 bool
 Staff_symbol_referencer::on_staffline (Grob *me, int pos)
 {
@@ -38,12 +38,12 @@ Staff_symbol_referencer::on_staffline (Grob *me, int pos)
   return ((pos + sz) % 2) == 0;
 }
 
-Grob*
+Grob *
 Staff_symbol_referencer::get_staff_symbol (Grob *me)
 {
   if (Staff_symbol::has_interface (me))
     return me;
-  
+
   SCM st = me->get_property ("staff-symbol");
   return unsmob_grob (st);
 }
@@ -88,7 +88,7 @@ Staff_symbol_referencer::get_position (Grob *me)
 }
 
 int
-Staff_symbol_referencer::get_rounded_position (Grob*me)
+Staff_symbol_referencer::get_rounded_position (Grob *me)
 {
   return int (rint (get_position (me)));
 }
@@ -108,7 +108,6 @@ LY_DEFINE (ly_grob_staff_position, "ly:grob-staff-position",
     return scm_make_real (pos);
 }
 
-
 /* should use offset callback!  */
 MAKE_SCHEME_CALLBACK (Staff_symbol_referencer, callback, 2);
 SCM
@@ -165,15 +164,14 @@ Staff_symbol_referencer::staff_radius (Grob *me)
 int
 compare_position (Grob *const &a, Grob *const &b)
 {
-  return sign (Staff_symbol_referencer::get_position ((Grob*)a)
-              - Staff_symbol_referencer::get_position ((Grob*) b));
+  return sign (Staff_symbol_referencer::get_position ((Grob *)a)
+              - Staff_symbol_referencer::get_position ((Grob *) b));
 }
 
 ADD_INTERFACE (Staff_symbol_referencer, "staff-symbol-referencer-interface",
               "An object whose Y position is meant relative to a staff "
               "symbol. "
               "These usually have @code{Staff_symbol_referencer::callback} "
-              "in their @code{Y-offset-callbacks}. "
-              ,
+              "in their @code{Y-offset-callbacks}. ",
               "staff-position");
 
index c1634ac4fee4dff6305216f059a56e02a09f63c8..926f1a3bacab5a216759ac697064d2c003e07dfe 100644 (file)
@@ -22,12 +22,11 @@ SCM
 Staff_symbol::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner* sp = dynamic_cast<Spanner*> (me);
-  Grob * common
+  Spanner *sp = dynamic_cast<Spanner *> (me);
+  Grob *common
     = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
-  
+
   Interval span_points (0, 0);
-  
 
   /*
     For raggedright without ragged staffs, simply set width to the linewidth.
@@ -35,10 +34,10 @@ Staff_symbol::print (SCM smob)
     (ok -- lousy UI, since width is in staff spaces)
 
     --hwn.
-   */
+  */
   Real t = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
   t *= robust_scm2double (me->get_property ("thickness"), 1.0);
-  
+
   Direction d = LEFT;
   do
     {
@@ -49,36 +48,35 @@ Staff_symbol::print (SCM smob)
            don't multiply by Staff_symbol_referencer::staff_space (me),
            since that would make aligning staff symbols of different sizes to
            one right margin hell.
-         */      
+         */
          span_points[RIGHT] = scm_to_double (width_scm);
        }
       else
        {
-         Item * x = sp->get_bound (d);
+         Item *x = sp->get_bound (d);
 
-         span_points[d] = x->relative_coordinate (common , X_AXIS);
+         span_points[d] = x->relative_coordinate (common, X_AXIS);
          if (!x->break_status_dir ()
              && !x->extent (x, X_AXIS).is_empty ())
            span_points[d] += x->extent (x, X_AXIS)[d];
        }
 
-      span_points[d] -= d* t/2;
+      span_points[d] -= d* t / 2;
     }
   while (flip (&d) != LEFT);
 
-
   int l = Staff_symbol::line_count (me);
-  
-  Real height = (l-1) * staff_space (me) /2;
-  Stencil a =
-    Lookup::horizontal_line (span_points
-                            -me->relative_coordinate (common, X_AXIS),
-                            t);
+
+  Real height = (l - 1) * staff_space (me) /2;
+  Stencil a
+    Lookup::horizontal_line (span_points
+                              -me->relative_coordinate (common, X_AXIS),
+                              t);
 
   Stencil m;
   for (int i = 0; i < l; i++)
     {
-      Stencil b(a);
+      Stencil b (a);
       b.translate_axis (height - i * staff_space (me), Y_AXIS);
       m.add_stencil (b);
     }
@@ -86,13 +84,13 @@ Staff_symbol::print (SCM smob)
 }
 
 int
-Staff_symbol::get_steps (Grob*me) 
+Staff_symbol::get_steps (Grob *me)
 {
   return line_count (me) * 2;
 }
 
 int
-Staff_symbol::line_count (Grob*me) 
+Staff_symbol::line_count (Grob *me)
 {
   SCM c = me->get_property ("line-count");
   if (scm_is_number (c))
@@ -102,29 +100,28 @@ Staff_symbol::line_count (Grob*me)
 }
 
 Real
-Staff_symbol::staff_space (Grob*me)
+Staff_symbol::staff_space (Grob *me)
 {
   return robust_scm2double (me->get_property ("staff-space"), 1.0);
 }
 
 Real
-Staff_symbol::get_line_thickness (Grobme)
+Staff_symbol::get_line_thickness (Grob *me)
 {
-  Real lt =  me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+  Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
 
   return robust_scm2double (me->get_property ("thickness"), 1.0) * lt;
 }
 
 Real
-Staff_symbol::get_ledger_line_thickness (Grob * me)
+Staff_symbol::get_ledger_line_thickness (Grob *me)
 {
   SCM lt_pair = me->get_property ("ledger-line-thickness");
   Offset z = robust_scm2offset (lt_pair, Offset (1.0, 0.1));
-  
+
   return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS]* staff_space (me);
 }
 
-
 ADD_INTERFACE (Staff_symbol, "staff-symbol-interface",
               "This spanner draws the lines of a staff. "
               "A staff symbol definines a vertical unit, the staff space. "
@@ -132,5 +129,5 @@ ADD_INTERFACE (Staff_symbol, "staff-symbol-interface",
               "The center (i.e. middle line "
               "or space) is position 0. The length of the symbol may be set by hand "
               "through the @code{width} property. ",
-              
-  "ledger-line-thickness width staff-space thickness line-count");
+
+              "ledger-line-thickness width staff-space thickness line-count");
index 2d1d7c5e120f715fbb6e987d7c4036e2aaafbbef..70c95f8746a044be45e718735f54e806c15f5fca 100644 (file)
@@ -1,12 +1,11 @@
 
-/*   
-stanza-number-align-engraver.cc -- implement 
+/*
+  stanza-number-align-engraver.cc -- implement
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-(c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+  (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #include "context.hh"
 #include "engraver.hh"
@@ -17,10 +16,10 @@ source file of the GNU LilyPond music typesetter
 
 class Stanza_number_align_engraver : public Engraver
 {
-public:  
+public:
   TRANSLATOR_DECLARATIONS (Stanza_number_align_engraver);
 
-protected:  
+protected:
   Link_array<Grob> lyrics_;
   Link_array<Grob> stanza_numbers_;
   virtual void acknowledge_grob (Grob_info);
@@ -29,14 +28,14 @@ protected:
 
 Stanza_number_align_engraver::Stanza_number_align_engraver ()
 {
-  
+
 }
 
 void
 Stanza_number_align_engraver::acknowledge_grob (Grob_info gi)
 {
   Grob *h = gi.grob_;
-  
+
   if (h->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
     lyrics_.push (h);
   else if (h->internal_has_interface (ly_symbol2scm ("stanza-number-interface")))
@@ -49,17 +48,16 @@ Stanza_number_align_engraver::stop_translation_timestep ()
   for (int i = lyrics_.size (); i--;)
     for (int j = stanza_numbers_.size (); j--;)
       Side_position_interface::add_support (stanza_numbers_[j], lyrics_[i]);
-  
+
   stanza_numbers_.clear ();
   lyrics_.clear ();
 }
 
-
 ADD_TRANSLATOR (Stanza_number_align_engraver,
-                 "This engraver ensures that stanza numbers are neatly aligned. ",
-                 "",
-                 "",
-                 "stanza-number-interface lyric-syllable-interface ",
-                 "",
-                 "");
+               "This engraver ensures that stanza numbers are neatly aligned. ",
+               "",
+               "",
+               "stanza-number-interface lyric-syllable-interface ",
+               "",
+               "");
 
index d27718a1c0d92246bd344fd6ebc205e7d3018e5f..8d5c8fda19f5e95e3ad1174a0dbb08c0b0c0dc15 100644 (file)
@@ -1,10 +1,9 @@
-/*   
+/*
   lyric-number-engraver.cc -- implement Stanza_number_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>, Glen Prideaux <glenprideaux@iname.com>
 
+  (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>, Glen Prideaux <glenprideaux@iname.com>
 */
 
 #include "engraver.hh"
@@ -18,7 +17,7 @@ class Stanza_number_engraver : public Engraver
     This is naughty, since last_stanza_ may be GCd from under us.  But
     since we don't look at the contents, we are/should be (knock on
     wood) OK.
-   */
+  */
   SCM last_stanza_;
 public:
   TRANSLATOR_DECLARATIONS (Stanza_number_engraver);
@@ -27,12 +26,11 @@ public:
   virtual void acknowledge_grob (Grob_info);
 };
 
-
 /*
   TODO: should make engraver that collects all the stanzas on a higher
   level, and then groups them to the side. Stanza numbers should be
   all aligned.
- */
+*/
 
 Stanza_number_engraver::Stanza_number_engraver ()
 {
@@ -43,18 +41,17 @@ void
 Stanza_number_engraver::process_music ()
 {
   SCM stanza = get_property ("stanza");
-  
+
   if (scm_is_string (stanza) && stanza != last_stanza_)
     {
       last_stanza_ = stanza;
-      
+
       text_ = make_item ("StanzaNumber", SCM_EOL);
       text_->set_property ("text", stanza);
-      
+
     }
 }
 
-
 void
 Stanza_number_engraver::acknowledge_grob (Grob_info inf)
 {
@@ -71,11 +68,10 @@ Stanza_number_engraver::stop_translation_timestep ()
   text_ = 0;
 }
 
-
 ADD_TRANSLATOR (Stanza_number_engraver,
-/* descr */       "",
-/* creats*/       "StanzaNumber",
-/* accepts */     "",
-/* acks  */      "lyric-syllable-interface",
-/* reads */       "stanza",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "StanzaNumber",
+               /* accepts */ "",
+               /* acks  */ "lyric-syllable-interface",
+               /* reads */ "stanza",
+               /* write */ "");
index 63f8d78843ef4a9eb95b59827e696eb5329c5440..b7bb2b0bf08d70113016870cf4ede116f3a4d554 100644 (file)
 #include "stem.hh"
 
 /**
-  Make stems upon receiving noteheads.
- */
+   Make stems upon receiving noteheads.
+*/
 class Stem_engraver : public Engraver
 {
   Grob *stem_;
   Grob *tremolo_;
   Music *rhythmic_ev_;
   Music *tremolo_ev_;
-  
+
   TRANSLATOR_DECLARATIONS (Stem_engraver);
 
 protected:
   void make_stem (Grob_info);
-  
+
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual bool try_music (Music *);
@@ -55,7 +55,7 @@ Stem_engraver::make_stem (Grob_info gi)
   /*
     docme: why do we take duration-log from request, not from note
     head?
-   */
+  */
   int duration_log = gi.music_cause ()->duration_log ();
   stem_->set_property ("duration-log", scm_int2num (duration_log));
 
@@ -85,7 +85,7 @@ Stem_engraver::make_stem (Grob_info gi)
        - (duration_log > 2 ? duration_log - 2 : 0);
       if (tremolo_flags <= 0)
        {
-         tremolo_ev_->origin ()->warning (_("tremolo duration is too long"));
+         tremolo_ev_->origin ()->warning (_ ("tremolo duration is too long"));
          tremolo_flags = 0;
        }
 
@@ -94,7 +94,7 @@ Stem_engraver::make_stem (Grob_info gi)
          tremolo_ = make_item ("StemTremolo", tremolo_ev_->self_scm ());
 
          /* The number of tremolo flags is the number of flags of the
-           tremolo-type minus the number of flags of the note itself.  */
+            tremolo-type minus the number of flags of the note itself.  */
          tremolo_->set_property ("flag-count", scm_int2num (tremolo_flags));
          tremolo_->set_parent (stem_, X_AXIS);
          stem_->set_property ("tremolo-flag", tremolo_->self_scm ());
@@ -111,19 +111,19 @@ Stem_engraver::acknowledge_grob (Grob_info gi)
       if (Rhythmic_head::get_stem (gi.grob_))
        return;
 
-      Music * cause = gi.music_cause ();
+      Music *cause = gi.music_cause ();
       if (!cause)
-       return ;
-      
+       return;
+
       if (!stem_)
        make_stem (gi);
-      
+
       int duration_log = cause->duration_log ();
       if (Stem::duration_log (stem_) != duration_log)
        {
          // FIXME: 
          gi.music_cause ()->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::duration_log (stem_)));
-         
+
          gi.music_cause ()->origin ()->warning (_f ("Don't you want polyphonic voices instead?"));
        }
 
@@ -167,10 +167,10 @@ Stem_engraver::try_music (Music *m)
 }
 
 ADD_TRANSLATOR (Stem_engraver,
-/* descr */       "Create stems and single-stem tremolos.  It also works together with "
-"the beam engraver for overriding beaming.",
-/* creats*/       "Stem StemTremolo",
-/* accepts */     "tremolo-event",
-/* acks  */      "rhythmic-head-interface",
-/* reads */       "tremoloFlags stemLeftBeamCount stemRightBeamCount",
-/* write */       "");
+               /* descr */ "Create stems and single-stem tremolos.  It also works together with "
+               "the beam engraver for overriding beaming.",
+               /* creats*/ "Stem StemTremolo",
+               /* accepts */ "tremolo-event",
+               /* acks  */ "rhythmic-head-interface",
+               /* reads */ "tremoloFlags stemLeftBeamCount stemRightBeamCount",
+               /* write */ "");
index 813d92903b6a835d345d06e06ba36d1b4724c2a9..132a30b3a2b8df26786fe8719cd5153082e2723e 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   stem-tremolo.cc -- implement Stem_tremolo
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "stem-tremolo.hh"
 
@@ -28,7 +27,7 @@ SCM
 Stem_tremolo::dim_callback (SCM e, SCM)
 {
   Grob *se = unsmob_grob (e);
-  
+
   Real space = Staff_symbol_referencer::staff_space (se);
   return ly_interval2scm (Interval (-space, space));
 }
@@ -54,7 +53,7 @@ Stencil
 Stem_tremolo::raw_stencil (Grob *me)
 {
   Grob *stem = unsmob_grob (me->get_property ("stem"));
-  Spanner*beam = Stem::get_beam (stem);
+  Spanner *beam = Stem::get_beam (stem);
   Real dydx;
   if (beam)
     {
@@ -62,10 +61,10 @@ Stem_tremolo::raw_stencil (Grob *me)
       SCM s = beam->get_property ("positions");
       if (is_number_pair (s))
        dy = -scm_to_double (scm_car (s)) +scm_to_double (scm_cdr (s));
-      
+
       Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
        - Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
-      dydx = dx ? dy/dx : 0;
+      dydx = dx ? dy / dx : 0;
     }
   else
     // urg
@@ -78,10 +77,10 @@ Stem_tremolo::raw_stencil (Grob *me)
 
   width *= ss;
   thick *= ss;
-  
+
   Stencil a (Lookup::beam (dydx, width, thick, blot));
   a.translate (Offset (-width * 0.5, width * 0.5 * dydx));
-  
+
   int tremolo_flags = 0;
   SCM s = me->get_property ("flag-count");
   if (scm_is_number (s))
@@ -98,7 +97,7 @@ Stem_tremolo::raw_stencil (Grob *me)
   /* Who the fuck is 0.81 ? --hwn.   */
   Real beam_translation = beam ? Beam::get_beam_translation (beam) : 0.81;
 
-  Stencil mol; 
+  Stencil mol;
   for (int i = 0; i < tremolo_flags; i++)
     {
       Stencil b (a);
@@ -110,7 +109,7 @@ Stem_tremolo::raw_stencil (Grob *me)
 
 MAKE_SCHEME_CALLBACK (Stem_tremolo, print, 1);
 SCM
-Stem_tremolo::print (SCM grob) 
+Stem_tremolo::print (SCM grob)
 {
   Grob *me = unsmob_grob (grob);
   Grob *stem = unsmob_grob (me->get_property ("stem"));
@@ -119,7 +118,7 @@ Stem_tremolo::print (SCM grob)
       programming_error ("No stem for stem-tremolo");
       return SCM_EOL;
     }
-  
+
   Spanner *beam = Stem::get_beam (stem);
   Direction stemdir = Stem::get_direction (stem);
   if (stemdir == 0)
@@ -138,7 +137,7 @@ Stem_tremolo::print (SCM grob)
   int beam_count = beam ? (Stem::beam_multiplicity (stem).length () + 1) : 0;
 
   Real beamthickness = 0.0;
-  SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
+  SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL;
   if (scm_is_number (sbt))
     beamthickness = scm_to_double (sbt) * ss;
 
@@ -171,8 +170,6 @@ Stem_tremolo::print (SCM grob)
   return mol.smobbed_copy ();
 }
 
-
-
 ADD_INTERFACE (Stem_tremolo, "stem-tremolo-interface",
-  "A beam slashing a stem to indicate a tremolo.",
-  "stem beam-width beam-thickness flag-count");
+              "A beam slashing a stem to indicate a tremolo.",
+              "stem beam-width beam-thickness flag-count");
index 07fe67029079a126a353efd7bbf921e1d3f5d543..0f227b4c94483293f16d4590674fdb22031f7afe 100644 (file)
@@ -4,7 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-    Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 
   TODO: This is way too hairy
 
@@ -62,13 +62,12 @@ Stem::get_beaming (Grob *me, Direction d)
   return scm_ilength (lst);
 }
 
-
 Interval
 Stem::head_positions (Grob *me)
 {
   if (head_count (me))
     {
-      Drul_array<Grob*> e (extremal_heads (me));
+      Drul_array<Grob *> e (extremal_heads (me));
       return Interval (Staff_symbol_referencer::get_position (e[DOWN]),
                       Staff_symbol_referencer::get_position (e[UP]));
     }
@@ -162,16 +161,15 @@ Stem::last_head (Grob *me)
   Direction d = get_direction (me);
   if (d)
     return extremal_heads (me)[d];
-  return 0;  
+  return 0;
 }
 
 /*
   START is part where stem reaches `last' head.
 
-  This function returns a drul with (bottom-head, top-head). 
-
+  This function returns a drul with (bottom-head, top-head).
 */
-Drul_array<Grob*>
+Drul_array<Grob *>
 Stem::extremal_heads (Grob *me)
 {
   const int inf = 1000000;
@@ -194,7 +192,9 @@ Stem::extremal_heads (Grob *me)
              exthead[d] = n;
              extpos[d] = p;
            }
-       } while (flip (&d) != DOWN);
+       }
+      while (flip (&d) != DOWN);
+
     }
   return exthead;
 }
@@ -209,7 +209,7 @@ integer_compare (int const &a, int const &b)
 Array<int>
 Stem::note_head_positions (Grob *me)
 {
-  Array<int> ps ;
+  Array<int> ps;
   for (SCM s = me->get_property ("note-heads"); scm_is_pair (s);
        s = scm_cdr (s))
     {
@@ -240,7 +240,7 @@ Stem::is_invisible (Grob *me)
 {
   Real stemlet_length = robust_scm2double (me->get_property ("stemlet-length"),
                                           0.0);
-  
+
   return !((head_count (me)
            || stemlet_length > 0.0)
           && scm_to_int (me->get_property ("duration-log")) >= 1);
@@ -254,8 +254,8 @@ Stem::get_default_dir (Grob *me)
   if (hp.is_empty ())
     return CENTER;
 
-  int udistance = (int) (UP * hp[UP] - staff_center);
-  int ddistance = (int) (DOWN * hp[DOWN] - staff_center);
+  int udistance = (int) (UP *hp[UP] - staff_center);
+  int ddistance = (int) (DOWN *hp[DOWN] - staff_center);
 
   if (sign (ddistance - udistance))
     return Direction (sign (ddistance - udistance));
@@ -315,11 +315,11 @@ Stem::get_default_stem_end_position (Grob *me)
     {
       /* Crude hack: add extra space if tremolo flag is there.
 
-       We can't do this for the beam, since we get into a loop
-       (Stem_tremolo::raw_stencil () looks at the beam.) --hwn  */
+      We can't do this for the beam, since we get into a loop
+      (Stem_tremolo::raw_stencil () looks at the beam.) --hwn  */
 
       Real minlen = 1.0
-       + 2 * Stem_tremolo::raw_stencil (t_flag).extent (Y_AXIS).length  ()
+       + 2 * Stem_tremolo::raw_stencil (t_flag).extent (Y_AXIS).length ()
        / ss;
 
       if (durlog >= 3)
@@ -349,9 +349,9 @@ Stem::get_default_stem_end_position (Grob *me)
   if (!get_beam (me) && dir == UP
       && durlog > 2)
     {
-      Grob * closest_to_flag = extremal_heads (me)[dir];
-      Grob * dots = closest_to_flag
-       ? Rhythmic_head::get_dots (closest_to_flag ) : 0;
+      Grob *closest_to_flag = extremal_heads (me)[dir];
+      Grob *dots = closest_to_flag
+       ? Rhythmic_head::get_dots (closest_to_flag) : 0;
 
       if (dots)
        {
@@ -392,8 +392,8 @@ Stem::position_noteheads (Grob *me)
   if (!head_count (me))
     return;
 
-  Link_array<Grob> heads =
-    extract_grob_array (me, ly_symbol2scm ("note-heads"));
+  Link_array<Grob> heads
+    extract_grob_array (me, ly_symbol2scm ("note-heads"));
 
   heads.sort (compare_position);
   Direction dir = get_direction (me);
@@ -411,16 +411,16 @@ Stem::position_noteheads (Grob *me)
 
   bool parity = true;
   Real lastpos = Real (Staff_symbol_referencer::get_position (heads[0]));
-  for (int i = 1; i < heads.size (); i ++)
+  for (int i = 1; i < heads.size (); i++)
     {
       Real p = Staff_symbol_referencer::get_position (heads[i]);
       Real dy = fabs (lastpos- p);
 
       /*
-       dy should always be 0.5, 0.0, 1.0, but provide safety margin
-       for rounding errors.
+       dy should always be 0.5, 0.0, 1.0, but provide safety margin
+       for rounding errors.
       */
-      if (dy < 1.1)            
+      if (dy < 1.1)
        {
          if (parity)
            {
@@ -444,18 +444,18 @@ Stem::position_noteheads (Grob *me)
                heads[i]->translate_axis (-thick * (2 - reverse_overlap) * d,
                                          X_AXIS);
 
-            /* TODO:
-               
+             /* TODO:
+
              For some cases we should kern some more: when the
              distance between the next or prev note is too large, we'd
              get large white gaps, eg.
-       
-               |
+
+             |
               X|
-              |X  <- kern this.
-              |
+             |X  <- kern this.
+             |
              X
-       
+
              */
            }
          parity = !parity;
@@ -476,13 +476,13 @@ Stem::before_line_breaking (SCM smob)
   /*
     Do the calculations for visible stems, but also for invisible stems
     with note heads (i.e. half notes.)
-   */
+  */
   if (head_count (me))
     {
       stem_end_position (me);  // ugh. Trigger direction calc.
       position_noteheads (me);
     }
-  
+
   return SCM_UNSPECIFIED;
 }
 
@@ -490,7 +490,7 @@ Stem::before_line_breaking (SCM smob)
   ugh.
   When in a beam with tuplet brackets, brew_mol is called early,
   caching a wrong value.
- */
+*/
 MAKE_SCHEME_CALLBACK (Stem, height, 2);
 SCM
 Stem::height (SCM smob, SCM ax)
@@ -520,13 +520,12 @@ Stem::height (SCM smob, SCM ax)
          programming_error ("No stem direction");
          d = UP;
        }
-      iv[d] += d * Beam::get_thickness (b) * 0.5 ;
+      iv[d] += d * Beam::get_thickness (b) * 0.5;
     }
 
   return ly_interval2scm (iv);
 }
 
-
 Stencil
 Stem::flag (Grob *me)
 {
@@ -538,7 +537,7 @@ Stem::flag (Grob *me)
   SCM flag_style_scm = me->get_property ("flag-style");
   if (scm_is_symbol (flag_style_scm))
     flag_style = ly_symbol2string (flag_style_scm);
-  
+
   if (flag_style == "no-flag")
     return Stencil ();
 
@@ -556,9 +555,9 @@ Stem::flag (Grob *me)
     {
       if (adjust)
        {
-         int p = (int)(rint (stem_end_position (me)));
-         staffline_offs =
-           Staff_symbol_referencer::on_staffline (me, p) ? "0" : "1";
+         int p = (int) (rint (stem_end_position (me)));
+         staffline_offs
+           Staff_symbol_referencer::on_staffline (me, p) ? "0" : "1";
        }
       else
        {
@@ -605,21 +604,21 @@ Stem::width_callback (SCM e, SCM ax)
   Grob *me = unsmob_grob (e);
 
   Interval r;
-  
+
   if (is_invisible (me))
     {
       r.set_empty ();
-    }    
+    }
   else if (unsmob_grob (me->get_property ("beam")) || abs (duration_log (me)) <= 2)
     {
       r = Interval (-1, 1);
-      r *= thickness (me)/2; 
+      r *= thickness (me) / 2;
     }
   else
     {
       r = flag (me).extent (X_AXIS)
-       + thickness (me)/2;
-    }  
+       + thickness (me) / 2;
+    }
   return ly_interval2scm (r);
 }
 
@@ -641,11 +640,11 @@ Stem::print (SCM smob)
   Real stemlet_length = robust_scm2double (me->get_property ("stemlet-length"),
                                           0.0);
   bool stemlet = stemlet_length > 0.0;
-  
+
   /* TODO: make the stem start a direction ?
      This is required to avoid stems passing in tablature chords.  */
-  Grob *lh =
-    to_boolean (me->get_property ("avoid-note-head"))
+  Grob *lh
+    to_boolean (me->get_property ("avoid-note-head"))
     ? last_head (me)
     : first_head (me);
   Grob *beam = get_beam (me);
@@ -655,7 +654,7 @@ Stem::print (SCM smob)
 
   if (!lh && stemlet && !beam)
     return SCM_EOL;
-    
+
   if (is_invisible (me))
     return SCM_EOL;
 
@@ -663,7 +662,6 @@ Stem::print (SCM smob)
   Real y1 = y2;
   Real half_space = Staff_symbol_referencer::staff_space (me) * 0.5;
 
-
   if (lh)
     y2 = Staff_symbol_referencer::get_position (lh);
   else if (stemlet)
@@ -684,21 +682,20 @@ Stem::print (SCM smob)
     {
       /*
        must not take ledgers into account.
-       */
+      */
       Interval head_height = hed->extent (hed, Y_AXIS);
       Real y_attach = Note_head::stem_attachment_coordinate (hed, Y_AXIS);
 
       y_attach = head_height.linear_combination (y_attach);
-      stem_y[Direction (-d)] += d * y_attach/half_space;
+      stem_y[Direction (-d)] += d * y_attach / half_space;
     }
 
-
   // URG
   Real stem_width = thickness (me);
-  Real blot =
-       me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+  Real blot
+    = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
 
-  Box b = Box (Interval (-stem_width/2, stem_width/2),
+  Box b = Box (Interval (-stem_width / 2, stem_width / 2),
               Interval (stem_y[DOWN]*half_space, stem_y[UP]*half_space));
 
   Stencil ss = Lookup::round_filled_box (b, blot);
@@ -707,8 +704,8 @@ Stem::print (SCM smob)
   if (!get_beam (me) && abs (duration_log (me)) > 2)
     {
       Stencil fl = flag (me);
-      fl.translate_axis (stem_y[d]*half_space - d * blot/2, Y_AXIS);
-      fl.translate_axis (stem_width/2, X_AXIS);
+      fl.translate_axis (stem_y[d]*half_space - d * blot / 2, Y_AXIS);
+      fl.translate_axis (stem_width / 2, X_AXIS);
       mol.add_stencil (fl);
     }
 
@@ -717,33 +714,33 @@ Stem::print (SCM smob)
 
 /*
   move the stem to right of the notehead if it is up.
- */
+*/
 MAKE_SCHEME_CALLBACK (Stem, offset_callback, 2);
 SCM
 Stem::offset_callback (SCM element_smob, SCM)
 {
   Grob *me = unsmob_grob (element_smob);
   Real r = 0.0;
-  
+
   if (Grob *f = first_head (me))
     {
       Interval head_wid = f->extent (f, X_AXIS);
       Real attach = 0.0;
-       
+
       if (is_invisible (me))
        attach = 0.0;
       else
        attach = Note_head::stem_attachment_coordinate (f, X_AXIS);
-       
+
       Direction d = get_direction (me);
       Real real_attach = head_wid.linear_combination (d * attach);
       r = real_attach;
-       
+
       /* If not centered: correct for stem thickness.  */
       if (attach)
        {
          Real rule_thick = thickness (me);
-         r += - d * rule_thick * 0.5;
+         r += -d * rule_thick * 0.5;
        }
     }
   else
@@ -751,7 +748,7 @@ Stem::offset_callback (SCM element_smob, SCM)
       SCM rests = me->get_property ("rests");
       if (scm_is_pair (rests))
        {
-         Grob * rest = unsmob_grob (scm_car (rests));
+         Grob *rest = unsmob_grob (scm_car (rests));
          r = rest->extent (rest, X_AXIS).center ();
        }
     }
@@ -762,7 +759,7 @@ Spanner *
 Stem::get_beam (Grob *me)
 {
   SCM b = me->get_property ("beam");
-  return dynamic_cast<Spanner*> (unsmob_grob (b));
+  return dynamic_cast<Spanner *> (unsmob_grob (b));
 }
 
 Stem_info
@@ -783,7 +780,6 @@ Stem::get_stem_info (Grob *me)
   return si;
 }
 
-
 /* TODO: add extra space for tremolos!  */
 void
 Stem::calc_stem_info (Grob *me)
@@ -793,7 +789,7 @@ Stem::calc_stem_info (Grob *me)
   if (!my_dir)
     {
       programming_error ("No stem dir set?");
-      my_dir  = UP;
+      my_dir = UP;
     }
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
@@ -802,25 +798,22 @@ Stem::calc_stem_info (Grob *me)
   Real beam_thickness = Beam::get_thickness (beam);
   int beam_count = Beam::get_direction_beam_count (beam, my_dir);
 
-
   /* Simple standard stem length */
   SCM lengths = me->get_property ("beamed-lengths");
-  Real ideal_length =
-    scm_to_double (robust_list_ref (beam_count - 1, lengths))
-               
+  Real ideal_length
+    scm_to_double (robust_list_ref (beam_count - 1, lengths))
+
     * staff_space
     /* stem only extends to center of beam
-    */
-    - 0.5 * beam_thickness
-    ;
+     */
+    - 0.5 * beam_thickness;
 
   /* Condition: sane minimum free stem length (chord to beams) */
   lengths = me->get_property ("beamed-minimum-free-lengths");
-  Real ideal_minimum_free =
-    scm_to_double (robust_list_ref (beam_count - 1, lengths))
+  Real ideal_minimum_free
+    scm_to_double (robust_list_ref (beam_count - 1, lengths))
     * staff_space;
 
-
   /* UGH
      It seems that also for ideal minimum length, we must use
      the maximum beam count (for this direction):
@@ -839,48 +832,46 @@ Stem::calc_stem_info (Grob *me)
   ideal_length = ideal_length >? ideal_minimum_length;
 
   /* Convert to Y position, calculate for dir == UP */
-  Real note_start =
-    /* staff positions */
+  Real note_start
+    =     /* staff positions */
     head_positions (me)[my_dir] * 0.5
     * my_dir * staff_space;
   Real ideal_y = note_start + ideal_length;
 
-
   /* Conditions for Y position */
 
   /* Lowest beam of (UP) beam must never be lower than second staffline
 
-     Reference?
+  Reference?
 
-     Although this (additional) rule is probably correct,
-     I expect that highest beam (UP) should also never be lower
-     than middle staffline, just as normal stems.
+  Although this (additional) rule is probably correct,
+  I expect that highest beam (UP) should also never be lower
+  than middle staffline, just as normal stems.
 
-     Reference?
+  Reference?
 
-     Obviously not for grace beams.
+  Obviously not for grace beams.
 
-     Also, not for knees.  Seems to be a good thing. */
+  Also, not for knees.  Seems to be a good thing. */
   bool no_extend_b = to_boolean (me->get_property ("no-stem-extend"));
   bool is_knee = to_boolean (beam->get_property ("knee"));
   if (!no_extend_b && !is_knee)
     {
       /* Highest beam of (UP) beam must never be lower than middle
         staffline */
-      ideal_y =        ideal_y >? 0;
+      ideal_y = ideal_y >? 0;
       /* Lowest beam of (UP) beam must never be lower than second staffline */
-      ideal_y =        ideal_y >? (-staff_space
+      ideal_y = ideal_y >? (-staff_space
                            - beam_thickness + height_of_my_beams);
     }
 
-
   ideal_y -= robust_scm2double (beam->get_property ("shorten"), 0);
 
-  Real minimum_free =
-    scm_to_double (robust_list_ref
-                  (beam_count - 1,
-                   me->get_property
-                   ("beamed-extreme-minimum-free-lengths")))
+  Real minimum_free
+    scm_to_double (robust_list_ref
+                    (beam_count - 1,
+                     me->get_property
+                     ("beamed-extreme-minimum-free-lengths")))
     * staff_space;
 
   Real minimum_length = minimum_free
@@ -907,7 +898,6 @@ Stem::beam_multiplicity (Grob *stem)
   return le;
 }
 
-
 /* FIXME:  Too many properties  */
 ADD_INTERFACE (Stem, "stem-interface",
               "The stem represent the graphical stem.  "
index 263d06ae52f0a5dcaf7c760e717bb088a845697c..4ef10f4e08914228e30eb05e2632105ce54ed1a3 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <math.h>
 
-#include <libc-extension.hh>   // isinf
+#include <libc - extension.hh> // isinf
 
 #include "font-metric.hh"
 #include "stencil.hh"
 
 /*
   TODO: naming add/combine.
- */
+*/
 /*
   UGH. Junk all mutators.
- */
+*/
 LY_DEFINE (ly_stencil_set_extent_x, "ly:stencil-set-extent!",
           3, 0, 0, (SCM stil, SCM axis, SCM np),
           "Set the extent of @var{stil} "
@@ -51,7 +51,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
   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 ();
@@ -98,7 +98,6 @@ LY_DEFINE (ly_stencil_get_extent, "ly:stencil-extent",
   return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
 }
 
-
 LY_DEFINE (ly_stencil_empty_p, "ly:stencil-empty?",
           1, 0, 0, (SCM stil),
           "Return whether @var{stil} is empty ")
@@ -108,7 +107,6 @@ LY_DEFINE (ly_stencil_empty_p, "ly:stencil-empty?",
   return scm_from_bool (s->is_empty ());
 }
 
-
 LY_DEFINE (ly_stencil_origin, "ly:stencil-origin",
           2, 0, 0, (SCM stil, SCM axis),
           "Return a pair of numbers signifying the origin @var{stil} in "
@@ -118,10 +116,9 @@ LY_DEFINE (ly_stencil_origin, "ly:stencil-origin",
   SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
 
-  return scm_from_double (s->origin()[Axis (scm_to_int (axis))]);
+  return scm_from_double (s->origin ()[Axis (scm_to_int (axis))]);
 }
 
-
 LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
           4, 2, 0, (SCM first, SCM axis, SCM direction, SCM second,
                     SCM padding, SCM minimum),
@@ -130,7 +127,7 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
 {
   /*
     C&P from combine-at-edge.
-   */
+  */
   Stencil *s1 = unsmob_stencil (first);
   Stencil *s2 = unsmob_stencil (second);
   Stencil first_stencil;
@@ -159,16 +156,14 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
                                        Direction (scm_to_int (direction)),
                                        *s2, p, m).smobbed_copy ();
   else
-    return Stencil().smobbed_copy ();
+    return Stencil ().smobbed_copy ();
 }
 
-
-
 LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
-          4, 2, 0,  (SCM first, SCM axis, SCM direction,
-                     SCM second,
-                     SCM padding,
-                     SCM minimum),
+          4, 2, 0, (SCM first, SCM axis, SCM direction,
+                    SCM second,
+                    SCM padding,
+                    SCM minimum),
           "Construct a stencil by putting @var{second} next to @var{first}. "
           "@var{axis} can be 0 (x-axis) or 1 (y-axis), "
           "@var{direction} can be -1 (left or down) or 1 (right or up). "
@@ -181,9 +176,9 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
   Stencil *s2 = unsmob_stencil (second);
   Stencil result;
 
-  SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first  == SCM_EOL,
+  SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first == SCM_EOL,
                   first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
-  SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second  == SCM_EOL,
+  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");
@@ -203,7 +198,7 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
 
   if (s1)
     result = *s1;
-  
+
   if (s2)
     result.add_at_edge (Axis (scm_to_int (axis)),
                        Direction (scm_to_int (direction)), *s2, p, m);
@@ -211,7 +206,7 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
   return result.smobbed_copy ();
 }
 
-LY_DEFINE (ly_stencil_add , "ly:stencil-add",
+LY_DEFINE (ly_stencil_add, "ly:stencil-add",
           0, 0, 1, (SCM args),
           "Combine stencils. Takes any number of arguments.")
 {
@@ -234,7 +229,7 @@ LY_DEFINE (ly_stencil_add , "ly:stencil-add",
 }
 
 LY_DEFINE (ly_make_stencil, "ly:make-stencil",
-          3, 0, 0,  (SCM expr, SCM xext, SCM yext),
+          3, 0, 0, (SCM expr, SCM xext, SCM yext),
           " \n"
           "Stencils are a device independent output expressions."
           "They carry two pieces of information: \n\n"
@@ -251,7 +246,6 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
   return s.smobbed_copy ();
 }
 
-
 LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
           3, 0, 0, (SCM stil, SCM axis, SCM dir),
           "Align @var{stil} using its own extents. "
@@ -267,17 +261,15 @@ LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
   return stil;
 }
 
-
 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}.")
+          " Analyse @var{s}, and return a list of fonts used in @var{s}.")
 {
   Stencil *stil = unsmob_stencil (s);
   SCM_ASSERT_TYPE (stil, s, SCM_ARG1, __FUNCTION__, "Stencil");
   return find_expression_fonts (stil->expr ());
 }
 
-
 struct Stencil_interpret_arguments
 {
   SCM func;
@@ -286,15 +278,15 @@ struct Stencil_interpret_arguments
 
 void stencil_interpret_in_scm (void *p, SCM expr)
 {
-  Stencil_interpret_arguments *ap = (Stencil_interpret_arguments*) p;
+  Stencil_interpret_arguments *ap = (Stencil_interpret_arguments *) p;
   scm_call_2 (ap->func, ap->arg1, expr);
 }
 
 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")
+          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_c_procedure_p(func), func, SCM_ARG1, __FUNCTION__,
+  SCM_ASSERT_TYPE (ly_c_procedure_p (func), func, SCM_ARG1, __FUNCTION__,
                   "procedure");
 
   Stencil_interpret_arguments a;
@@ -302,25 +294,22 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression",
   a.arg1 = arg1;
   Offset o = ly_scm2offset (offset);
 
-  interpret_stencil_expression (expr, stencil_interpret_in_scm, (void*) &a, o);
+  interpret_stencil_expression (expr, stencil_interpret_in_scm, (void *) &a, o);
 
   return SCM_UNSPECIFIED;
 }
 
-
-
-LY_DEFINE (ly_bracket , "ly:bracket",
-         4, 0, 0,
-         (SCM a, SCM iv, SCM t, SCM p),
-         "Make a bracket in direction @var{a}. The extent of the bracket is " 
-         "given by @var{iv}. The wings protude by an amount of @var{p}, which "
-         "may be negative. The thickness is given by @var{t}.")
+LY_DEFINE (ly_bracket, "ly:bracket",
+          4, 0, 0,
+          (SCM a, SCM iv, SCM t, SCM p),
+          "Make a bracket in direction @var{a}. The extent of the bracket is "
+          "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") ;
-
+  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");
 
   return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
                          scm_to_double (t),
@@ -328,19 +317,16 @@ LY_DEFINE (ly_bracket , "ly:bracket",
                          0.95 * scm_to_double (t)).smobbed_copy ();
 }
 
-
-
-LY_DEFINE (ly_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}."
-         )
+LY_DEFINE (ly_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") ;
+  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");
 
   return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
                                   scm_to_double (blot)).smobbed_copy ();
index 688efe2855bea5771efca0e166a9d42676da4a5a..0c314964aea70fa44976ad827e76c76fb94da4a8 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <math.h>
 
-#include <libc-extension.hh>   // isinf
+#include <libc - extension.hh> // isinf
 
 #include "input-smob.hh"
 #include "font-metric.hh"
@@ -43,7 +43,7 @@ Stencil::print_smob (SCM, SCM port, scm_print_state *)
 SCM
 Stencil::mark_smob (SCM smob)
 {
-  Stencil *s = (Stencil*) SCM_CELL_WORD_1 (smob);
+  Stencil *s = (Stencil *) SCM_CELL_WORD_1 (smob);
   return s->expr_;
 }
 
@@ -93,7 +93,7 @@ Stencil::translate (Offset o)
          programming_error (String_convert::form_string ("Improbable offset for stencil: %f staff space", o[a])
                             + "\n"
                             + "Setting to zero.");
-         o[a] =  0.0;
+         o[a] = 0.0;
        }
       incr (a);
     }
@@ -121,8 +121,6 @@ Stencil::add_stencil (Stencil const &s)
   dim_.unite (s.dim_);
 }
 
-
-
 void
 Stencil::set_empty (bool e)
 {
@@ -175,8 +173,8 @@ Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s,
   toadd.translate_axis (offset, a);
 
   if (minimum > 0 && d * (-origin ()[a] + toadd.origin ()[a]) < minimum)
-    toadd.translate_axis ( -toadd.origin ()[a]
-                          + origin ()[a] + d * minimum, a);
+    toadd.translate_axis (-toadd.origin ()[a]
+                         + origin ()[a] + d * minimum, a);
 
   return toadd;
 }
@@ -189,38 +187,36 @@ Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding,
   add_stencil (moved_to_edge (a, d, s, padding, minimum));
 }
 
-
 /****************************************************************/
 
-
 void
 interpret_stencil_expression (SCM expr,
-                             void (*func) (void*, SCM),
+                             void (*func) (void *, SCM),
                              void *func_arg,
                              Offset o)
 {
   while (1)
     {
       if (!scm_is_pair (expr))
-        return;
+       return;
 
       SCM head = scm_car (expr);
 
       if (head == ly_symbol2scm ("translate-stencil"))
-        {
-          o += ly_scm2offset (scm_cadr (expr));
-          expr = scm_caddr (expr);
-        }
+       {
+         o += ly_scm2offset (scm_cadr (expr));
+         expr = scm_caddr (expr);
+       }
       else if (head == ly_symbol2scm ("combine-stencil"))
-        {
-          for (SCM x = scm_cdr (expr); scm_is_pair (x); x = scm_cdr (x))
+       {
+         for (SCM x = scm_cdr (expr); scm_is_pair (x); x = scm_cdr (x))
            interpret_stencil_expression (scm_car (x), func, func_arg, o);
-          return;
-        }
+         return;
+       }
       else if (head == ly_symbol2scm ("grob-cause"))
        {
          SCM grob = scm_cadr (expr);
-       
+
          (*func) (func_arg, scm_list_3 (head,
                                         ly_quote_scm (ly_offset2scm (o)), grob));
          interpret_stencil_expression (scm_caddr (expr), func, func_arg, o);
@@ -228,7 +224,7 @@ interpret_stencil_expression (SCM expr,
          return;
        }
       else if (head == ly_symbol2scm ("color"))
-       { 
+       {
          SCM color = scm_cadr (expr);
          SCM r = scm_car (color);
          SCM g = scm_cadr (color);
@@ -237,22 +233,21 @@ interpret_stencil_expression (SCM expr,
          (*func) (func_arg, scm_list_4 (ly_symbol2scm ("setcolor"), r, g, b));
          interpret_stencil_expression (scm_caddr (expr), func, func_arg, o);
          (*func) (func_arg, scm_list_1 (ly_symbol2scm ("resetcolor")));
-   
+
          return;
-       } 
+       }
       else
-        {
-          (*func) (func_arg,
-                   scm_list_4 (ly_symbol2scm ("placebox"),
-                               scm_make_real (o[X_AXIS]),
-                               scm_make_real (o[Y_AXIS]),
-                               expr));
-           return;
-        }
+       {
+         (*func) (func_arg,
+                  scm_list_4 (ly_symbol2scm ("placebox"),
+                              scm_make_real (o[X_AXIS]),
+                              scm_make_real (o[Y_AXIS]),
+                              expr));
+         return;
+       }
     }
 }
 
-
 struct Font_list
 {
   SCM fonts_;
@@ -261,7 +256,7 @@ struct Font_list
 static void
 find_font_function (void *fs, SCM x)
 {
-  Font_list *me = (Font_list*) fs;
+  Font_list *me = (Font_list *) fs;
 
   if (scm_car (x) == ly_symbol2scm ("placebox"))
     {
@@ -269,13 +264,13 @@ find_font_function (void *fs, SCM x)
       SCM what = scm_caddr (args);
 
       if (scm_is_pair (what))
-        {
-          SCM head = scm_car (what);
-          if (ly_symbol2scm ("text") == head)
-            me->fonts_ = scm_cons (scm_cadr (what), me->fonts_);
-          else if (head == ly_symbol2scm ("char"))
-            me->fonts_ = scm_cons (scm_cadr (what), me->fonts_);
-        }
+       {
+         SCM head = scm_car (what);
+         if (ly_symbol2scm ("text") == head)
+           me->fonts_ = scm_cons (scm_cadr (what), me->fonts_);
+         else if (head == ly_symbol2scm ("char"))
+           me->fonts_ = scm_cons (scm_cadr (what), me->fonts_);
+       }
     }
 }
 
@@ -287,9 +282,8 @@ find_expression_fonts (SCM expr)
   fl.fonts_ = SCM_EOL;
 
   interpret_stencil_expression (expr, &find_font_function,
-                               (void*) &fl, Offset (0, 0));
+                               (void *) &fl, Offset (0, 0));
 
   return fl.fonts_;
 }
 
-
index 99247535925e7e6c3551925ed62b838d690e4b8b..fd87ec4afffab98631dcfe236b252c2df3e7ac77 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "engraver.hh"
@@ -15,12 +14,11 @@ class String_number_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (String_number_engraver);
 protected:
-  virtual bool try_music (Musicm);
+  virtual bool try_music (Music *m);
 };
 
-
 bool
-String_number_engraver::try_music (Music * )
+String_number_engraver::try_music (Music *)
 {
   return true;
 }
@@ -33,17 +31,16 @@ String_number_engraver::String_number_engraver ()
 /*
   TODO: string numbers are printed right of the note circled. This
   engraver should provide this functionality.
-  
- */
+*/
 
 ADD_TRANSLATOR (String_number_engraver,
-/* descr */       "Swallow string-number-events - the purpose of this engraver is to"
-" process tab for normal notation. To provent warnings for unprocessed "
-" string-number-event to obscure real error messages, this engraver "
-" swallows them all.",
-                 
-/* creats*/       "",
-/* accepts */     "string-number-event",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Swallow string-number-events - the purpose of this engraver is to"
+               " process tab for normal notation. To provent warnings for unprocessed "
+               " string-number-event to obscure real error messages, this engraver "
+               " swallows them all.",
+
+               /* creats*/ "",
+               /* accepts */ "string-number-event",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
index 6806ce2c9df07abdbb8e3041f14e41a6e560e9a0..68db12e7608318e0585b7350438a8f245532ef4f 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   sustain-pedal.cc -- implement Sustain_pedal
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 #include "grob.hh"
 #include "stencil.hh"
 #include "font-interface.hh"
   Urg.
   This is almost text
   Problem is:
-    * we have no kerning
-    * symbols are at wrong place in font
+  * we have no kerning
+  * symbols are at wrong place in font
 
 
 
   Properties:
 
   glyph -- text string (TODO: make one large glyph of the Ped symbol, removes need for member_print ())
-
 */
 
-
 /*
-  FIXME. Need to use markup. 
- */
+  FIXME. Need to use markup.
+*/
 struct Sustain_pedal
 {
 public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
 };
 
-
 MAKE_SCHEME_CALLBACK (Sustain_pedal, print, 1);
 SCM
-Sustain_pedal::print (SCM smob) 
+Sustain_pedal::print (SCM smob)
 {
-  Grob * e = unsmob_grob (smob);
-  
+  Grob *e = unsmob_grob (smob);
+
   Stencil mol;
   SCM glyph = e->get_property ("text");
   if (!scm_is_string (glyph))
     return mol.smobbed_copy ();
-  
+
   String text = ly_scm2string (glyph);
 
   for (int i = 0; i < text.length (); i++)
@@ -64,7 +60,7 @@ Sustain_pedal::print (SCM smob)
       if (!m.is_empty ())
        mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
     }
-    
+
   return mol.smobbed_copy ();
 }
 
index 868047126b2edfb9c1adf19d801690544ee61425..e9178e7142526840b740a164453cbde666320b4f 100644 (file)
@@ -13,11 +13,11 @@ class Swallow_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (Swallow_engraver);
 protected:
-  bool try_music (Music*) ;
+  bool try_music (Music *);
 };
 
 bool
-Swallow_engraver::try_music (Music*) 
+Swallow_engraver::try_music (Music *)
 {
   return true;
 }
@@ -27,10 +27,10 @@ Swallow_engraver::Swallow_engraver ()
 }
 
 ADD_TRANSLATOR (Swallow_engraver,
-/* descr */       "This engraver swallows everything given to it silently. The purpose of "
-                 "this is to prevent spurious \"event junked\" warnings.",
-/* creats*/       "",
-/* accepts */     "general-music",
-/* acks  */       "",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "This engraver swallows everything given to it silently. The purpose of "
+               "this is to prevent spurious \"event junked\" warnings.",
+               /* creats*/ "",
+               /* accepts */ "general-music",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
index 173224ec8af09df520949d18de7e75c1875f58a4..92c7c4ba9c0bd971732f25a43d82c7fb9bc1806f 100644 (file)
@@ -13,7 +13,7 @@ class Swallow_performer : public Performer
 public:
   TRANSLATOR_DECLARATIONS (Swallow_performer);
 protected:
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
 };
 
 bool
@@ -23,16 +23,16 @@ Swallow_performer::try_music (Music *m)
       || m->is_mus_type ("melisma-playing-event"))
     return false;
   else
-    return true; 
+    return true;
 }
 
 Swallow_performer::Swallow_performer ()
 {}
 
 ADD_TRANSLATOR (Swallow_performer,
-/* descr */       "",
-/* creats*/       "",
-/* accepts */     "general-music",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "",
+               /* creats*/ "",
+               /* accepts */ "general-music",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
index 7e8adb3d7c98dc67868ce613750f5b2f44691fc4..de89a20764f636c31398f5521f8f1e6349068b0c 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   system-start-delimiter-engraver.cc -- implement System_start_delimiter_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "system-start-delimiter.hh"
 #include "engraver.hh"
@@ -21,14 +20,12 @@ public:
   TRANSLATOR_DECLARATIONS (System_start_delimiter_engraver);
 
 protected:
-  Spanner * delim_;
+  Spanner *delim_;
   virtual void acknowledge_grob (Grob_info);
   virtual void process_music ();
   virtual void finalize ();
 };
 
-
-
 void
 System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
 {
@@ -37,8 +34,8 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
       /*
        don't add as Axis_group_interface::add_element (delim_, ),
        because that would set the parent as well */
-         
-      Pointer_group_interface::add_grob (delim_, ly_symbol2scm ("elements"),  inf.grob_);
+
+      Pointer_group_interface::add_grob (delim_, ly_symbol2scm ("elements"), inf.grob_);
     }
   else if (System_start_delimiter::has_interface (inf.grob_))
     {
@@ -47,18 +44,18 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
 
       /*
        UGH UGH
-       */
-      if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str  ("brace"))
-         && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str  ("bracket")))
+      */
+      if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str ("brace"))
+         && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
        inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
-      else if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str  ("bracket"))
-              && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str  ("bracket")))
-       {
-         inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
-         inf.grob_->set_property ("arch-height",
-                                      scm_make_real (scm_to_double (inf.grob_->get_property
-                                       ("arch-height"))+0.5));
-       }
+      else if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str ("bracket"))
+              && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
+       {
+         inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
+         inf.grob_->set_property ("arch-height",
+                                  scm_make_real (scm_to_double (inf.grob_->get_property
+                                                                ("arch-height")) + 0.5));
+       }
     }
 }
 
@@ -74,10 +71,10 @@ System_start_delimiter_engraver::process_music ()
     {
       SCM delim_name = get_property ("systemStartDelimiter");
       delim_ = make_spanner_from_properties (this, delim_name, SCM_EOL,
-                                            ly_symbol2string (delim_name).to_str0());
+                                            ly_symbol2string (delim_name).to_str0 ());
 
       delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-      
+
     }
 }
 void
@@ -86,14 +83,14 @@ System_start_delimiter_engraver::finalize ()
   if (delim_)
     {
       delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
-      
+
     }
 }
 
 ADD_TRANSLATOR (System_start_delimiter_engraver,
-/* descr */       "Creates a system start delimiter (ie. SystemStart@{Bar, Brace, Bracket@} spanner",
-/* creats*/       "SystemStartBar SystemStartBrace SystemStartBracket",
-/* accepts */     "",
-/* acks  */      "system-start-delimiter-interface staff-symbol-interface",
-/* reads */       "systemStartDelimiter",
-/* write */       "");
+               /* descr */ "Creates a system start delimiter (ie. SystemStart@{Bar, Brace, Bracket@} spanner",
+               /* creats*/ "SystemStartBar SystemStartBrace SystemStartBracket",
+               /* accepts */ "",
+               /* acks  */ "system-start-delimiter-interface staff-symbol-interface",
+               /* reads */ "systemStartDelimiter",
+               /* write */ "");
index ded4977de0899d7d2d3ea2224c6c02d69c66070a..0a5b6fe532e60ae6375201b02ab12be6fa4cc26a 100644 (file)
@@ -1,11 +1,10 @@
-/* 
+/*
   system-start-delimiter.cc -- implement System_start_delimiter
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+*/
 
 #include "system-start-delimiter.hh"
 
 #include "lookup.hh"
 
 Stencil
-System_start_delimiter::staff_bracket (Grob*me, Real height)
+System_start_delimiter::staff_bracket (Grob *me, Real height)
 {
-  Real arc_height = scm_to_double (me->get_property ("arch-height")) ;
+  Real arc_height = scm_to_double (me->get_property ("arch-height"));
 
   SCM at = scm_list_n (ly_symbol2scm ("bracket"),
-                   me->get_property ("arch-angle"),
-                   me->get_property ("arch-width"),
-                   scm_make_real (arc_height),
-                   scm_make_real (height),
-                   me->get_property ("arch-thick"),
-                   me->get_property ("thickness"),
-                   SCM_UNDEFINED);
+                      me->get_property ("arch-angle"),
+                      me->get_property ("arch-width"),
+                      scm_make_real (arc_height),
+                      scm_make_real (height),
+                      me->get_property ("arch-thick"),
+                      me->get_property ("thickness"),
+                      SCM_UNDEFINED);
 
-/*
-TODO: sort this out.
-  
-Another thing:
-In system-start-delimiter.cc I see the line
+  /*
+    TODO: sort this out.
 
-  Real h = height + 2 * arc_height;
+    Another thing:
+    In system-start-delimiter.cc I see the line
+
+    Real h = height + 2 * arc_height;
 
-But I really think that you mean
+    But I really think that you mean
 
- Real h = height + 2 * arc_width;
   Real h = height + 2 * arc_width;
 
-(arc_height changes the x-axis-size of arc ; arc_width changes the
-y-axis-size)
-Will not fix it since I'm not sure.
+    (arc_height changes the x-axis-size of arc ; arc_width changes the
+    y-axis-size)
+    Will not fix it since I'm not sure.
 
-   */
+  */
 
   Real h = height + 2 * arc_height;
-  Box b (Interval (0, 1.5), Interval (-h/2, h/2));
+  Box b (Interval (0, 1.5), Interval (-h / 2, h / 2));
   Stencil mol (b, at);
   mol.align_to (X_AXIS, CENTER);
   return mol;
 }
 
-
-
 Stencil
-System_start_delimiter::simple_bar (Grob*me, Real h) 
+System_start_delimiter::simple_bar (Grob *me, Real h)
 {
-  Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")) ;
+  Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
   Real w = lt * robust_scm2double (me->get_property ("thickness"), 1);
-  return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h/2, h/2)),
+  return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h / 2, h / 2)),
                                   lt);
 }
 
@@ -74,14 +71,14 @@ MAKE_SCHEME_CALLBACK (System_start_delimiter, after_line_breaking, 1);
 SCM
 System_start_delimiter::after_line_breaking (SCM smob)
 {
-  Grob * me = unsmob_grob (smob);
-  SCM   gl = me->get_property ("glyph");
+  Grob *me = unsmob_grob (smob);
+  SCM gl = me->get_property ("glyph");
   if (ly_c_equal_p (gl, scm_makfrom0str ("bar-line")))
     {
       int count = 0;
 
       /*
-       Get all coordinates, to trigger Hara kiri. 
+       Get all coordinates, to trigger Hara kiri.
       */
       SCM elts = me->get_property ("elements");
       Grob *common = common_refpoint_of_list (elts, me, Y_AXIS);
@@ -90,11 +87,10 @@ System_start_delimiter::after_line_breaking (SCM smob)
          Interval v = unsmob_grob (scm_car (s))->extent (common, Y_AXIS);
 
          if (!v.is_empty ())
-           count ++;
+           count++;
        }
 
-
-      if (count <=  1)
+      if (count <= 1)
        {
          me->suicide ();
        }
@@ -102,7 +98,6 @@ System_start_delimiter::after_line_breaking (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
-
 MAKE_SCHEME_CALLBACK (System_start_delimiter, print, 1);
 SCM
 System_start_delimiter::print (SCM smob)
@@ -114,19 +109,19 @@ System_start_delimiter::print (SCM smob)
   SCM s = me->get_property ("glyph");
   if (!scm_is_string (s))
     return SCM_EOL;
-  SCM gsym = scm_string_to_symbol (s) ;
+  SCM gsym = scm_string_to_symbol (s);
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
 
   SCM elts = me->get_property ("elements");
-  Grob * common = common_refpoint_of_list (elts, me, Y_AXIS);
+  Grob *common = common_refpoint_of_list (elts, me, Y_AXIS);
 
   Interval ext;
   for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
     {
-      Spanner * sp = unsmob_spanner (scm_car (s));
-      if (sp &&
-         sp->get_bound (LEFT) == me->get_bound (LEFT))
+      Spanner *sp = unsmob_spanner (scm_car (s));
+      if (sp
+         && sp->get_bound (LEFT) == me->get_bound (LEFT))
        {
          Interval dims = sp->extent (common, Y_AXIS);
          if (!dims.is_empty ())
@@ -195,10 +190,8 @@ System_start_delimiter::staff_brace (Grob *me, Real y)
   return Stencil (b, stil.expr ());
 }
 
-
 ADD_INTERFACE (System_start_delimiter, "system-start-delimiter-interface",
               "The brace, bracket or bar in front of the system. "
-              "It is implemented as a spanner."
-              ,
+              "It is implemented as a spanner.",
               "collapse-height thickness "
               "arch-height arch-angle arch-thick arch-width bracket-thick glyph");
index 8f1e907f4e93a6a156dfaa92cf34adcefbafb81f..d1066602fe0ddfe34e52cbe9f1d9824408861629 100644 (file)
 #include "paper-system.hh"
 #include "tweak-registration.hh"
 
-
 System::System (System const &src, int count)
   : Spanner (src, count)
 {
   rank_ = 0;
 }
 
-System::System (SCM s, Object_key const*key)
+System::System (SCM s, Object_key const *key)
   : Spanner (s, key)
 {
   rank_ = 0;
 }
 
-
-Grob * 
+Grob *
 System::clone (int count) const
 {
   return new System (*this, count);
 }
 
-
 int
 System::element_count () const
 {
@@ -57,13 +54,13 @@ System::spanner_count () const
 {
   int k = 0;
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
-    if (dynamic_cast<Spanner*> (unsmob_grob (scm_car (s))))
+    if (dynamic_cast<Spanner *> (unsmob_grob (scm_car (s))))
       k++;
   return k;
 }
 
 void
-System::typeset_grob (Grob * elem)
+System::typeset_grob (Grob *elem)
 {
   if (elem->pscore_)
     programming_error ("Adding element twice.");
@@ -94,9 +91,9 @@ System::get_lines ()
       if (g->internal_has_interface (ly_symbol2scm ("only-prebreak-interface")))
        {
          /*
-           Kill no longer needed grobs. 
-          */
-         Item * it = dynamic_cast<Item*> (g);
+           Kill no longer needed grobs.
+         */
+         Item *it = dynamic_cast<Item *> (g);
          if (it && Item::is_breakable (it))
            {
              it->find_prebroken_piece (LEFT)->suicide ();
@@ -120,10 +117,10 @@ System::get_lines ()
        fixup_refpoint (scm_car (s));
       count += scm_ilength (all);
     }
-  
+
   /*
     needed for doing items.
-   */
+  */
   fixup_refpoints (get_property ("all-elements"));
 
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
@@ -131,7 +128,7 @@ System::get_lines ()
   handle_broken_dependencies ();
 
 #if 0  /* don't do this: strange side effects.  */
-  
+
   /* Because the this->get_property (all-elements) contains items in 3
      versions, handle_broken_dependencies () will leave duplicated
      items in all-elements.  Strictly speaking this is harmless, but
@@ -140,22 +137,22 @@ System::get_lines ()
   for (int i = 0; i < line_count; i++)
     {
       SCM all = broken_intos_[i]->get_property ("all-elements");
-      all = ly_list_qsort_uniq_x(all); 
+      all = ly_list_qsort_uniq_x (all);
     }
 #endif
-  
+
   if (be_verbose_global)
-    progress_indication (_f ("Element count %d.",  count + element_count ()));
+    progress_indication (_f ("Element count %d.", count + element_count ()));
 
   int line_count = broken_intos_.size ();
   SCM lines = scm_c_make_vector (line_count, SCM_EOL);
-  
+
   for (int i = 0; i < line_count; i++)
     {
       if (be_verbose_global)
        progress_indication ("[");
 
-      System *system = dynamic_cast<System*> (broken_intos_[i]);
+      System *system = dynamic_cast<System *> (broken_intos_[i]);
       system->post_processing ();
       scm_vector_set_x (lines, scm_int2num (i), system->get_line ());
 
@@ -166,22 +163,22 @@ System::get_lines ()
 }
 
 void
-System::break_into_pieces (Array<Column_x_positions> const &breaking) 
+System::break_into_pieces (Array<Column_x_positions> const &breaking)
 {
   for (int i = 0; i < breaking.size (); i++)
     {
-      System *system = dynamic_cast <System*> (clone (i));
+      System *system = dynamic_cast<System *> (clone (i));
       system->rank_ = i;
 
       Link_array<Grob> c (breaking[i].cols_);
       pscore_->typeset_line (system);
-      
+
       system->set_bound (LEFT, c[0]);
       system->set_bound (RIGHT, c.top ());
       for (int j = 0; j < c.size (); j++)
        {
          c[j]->translate_axis (breaking[i].config_[j], X_AXIS);
-         dynamic_cast<Paper_column*> (c[j])->system_ = system;
+         dynamic_cast<Paper_column *> (c[j])->system_ = system;
        }
       set_loose_columns (system, &breaking[i]);
       broken_intos_.push (system);
@@ -189,13 +186,13 @@ System::break_into_pieces (Array<Column_x_positions> const &breaking)
 }
 
 void
-System::add_column (Paper_column*p)
+System::add_column (Paper_column *p)
 {
   Grob *me = this;
   SCM cs = me->get_property ("columns");
-  Grob *prev =  scm_is_pair (cs) ? unsmob_grob (scm_car (cs)) : 0;
+  Grob *prev = scm_is_pair (cs) ? unsmob_grob (scm_car (cs)) : 0;
 
-  p->rank_ = prev ? Paper_column::get_rank (prev) + 1 : 0; 
+  p->rank_ = prev ? Paper_column::get_rank (prev) + 1 : 0;
 
   me->set_property ("columns", scm_cons (p->self_scm (), cs));
 
@@ -212,7 +209,7 @@ apply_tweaks (Grob *g, bool broken)
        {
          SCM proc = scm_caar (s);
          SCM rest = scm_cdar (s);
-         scm_apply_1 (proc, g->self_scm(), rest);
+         scm_apply_1 (proc, g->self_scm (), rest);
        }
     }
 }
@@ -225,13 +222,12 @@ System::pre_processing ()
 
   if (be_verbose_global)
     progress_indication (_f ("Grob count %d", element_count ()));
-  
+
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
     unsmob_grob (scm_car (s))->handle_prebroken_dependencies ();
-  
+
   fixup_refpoints (get_property ("all-elements"));
 
-  
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
     apply_tweaks (unsmob_grob (scm_car (s)), false);
 
@@ -240,7 +236,7 @@ System::pre_processing ()
       Grob *sc = unsmob_grob (scm_car (s));
       sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
     }
-  
+
   progress_indication ("\n");
   progress_indication (_ ("Calculating line breaks..."));
   progress_indication (" ");
@@ -259,11 +255,11 @@ System::post_processing ()
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
     {
       Grob *g = unsmob_grob (scm_car (s));
-      
+
       apply_tweaks (g, true);
 
       g->calculate_dependencies (POSTCALCED, POSTCALCING,
-          ly_symbol2scm ("after-line-breaking-callback"));
+                                ly_symbol2scm ("after-line-breaking-callback"));
     }
 
   Interval iv (extent (this, Y_AXIS));
@@ -271,7 +267,7 @@ System::post_processing ()
     programming_error ("System with zero extent.");
   else
     translate_axis (-iv[MAX], Y_AXIS);
-  
+
   /* Generate all stencils to trigger font loads.
      This might seem inefficient, but Stencils are cached per grob
      anyway. */
@@ -288,7 +284,7 @@ System::post_processing ()
 
 SCM
 System::get_line ()
-{  
+{
   static int const LAYER_COUNT = 3;
 
   SCM exprs = SCM_EOL;
@@ -296,7 +292,7 @@ System::get_line ()
 
   /* Output stencils in three layers: 0, 1, 2.  Default layer: 1. */
   SCM all = get_property ("all-elements");
-  
+
   for (int i = 0; i < LAYER_COUNT; i++)
     for (SCM s = all; scm_is_pair (s); s = scm_cdr (s))
       {
@@ -322,7 +318,7 @@ System::get_line ()
        st.translate (o + extra);
 
        *tail = scm_cons (st.expr (), SCM_EOL);
-       tail = SCM_CDRLOC(*tail);
+       tail = SCM_CDRLOC (*tail);
       }
 
   if (Stencil *me = get_stencil ())
@@ -335,25 +331,24 @@ System::get_line ()
                                 exprs));
 
   Interval staff_refpoints;
-  staff_refpoints.set_empty();
+  staff_refpoints.set_empty ();
   for (SCM s = get_property ("spaceable-staves");
        scm_is_pair (s); s = scm_cdr (s))
-      {
-       Grob *g = unsmob_grob (scm_car (s));
-       staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
-      }
-  
+    {
+      Grob *g = unsmob_grob (scm_car (s));
+      staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
+    }
+
   Paper_system *pl = new Paper_system (sys_stencil, false);
   pl->staff_refpoints_ = staff_refpoints;
-  Item * break_point = this->get_bound(LEFT);
-  pl->break_before_penalty_ =
-    robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
-  
+  Item *break_point = this->get_bound (LEFT);
+  pl->break_before_penalty_
+    robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
+
   return scm_gc_unprotect_object (pl->self_scm ());
 }
 
-Link_array<Item> 
+Link_array<Item>
 System::broken_col_range (Item const *left, Item const *right) const
 {
   Link_array<Item> ret;
@@ -370,7 +365,7 @@ System::broken_col_range (Item const *left, Item const *right) const
 
   while (scm_is_pair (s) && scm_car (s) != left->self_scm ())
     {
-      Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (scm_car (s)));
+      Paper_column *c = dynamic_cast<Paper_column *> (unsmob_grob (scm_car (s)));
       if (Item::is_breakable (c) && !c->system_)
        ret.push (c);
 
index b5bd9c2ceb119dad6441694a53d39477ab56df7e..aff6336ab74467217df52bd00b4005d8dcbdae59 100644 (file)
@@ -4,7 +4,6 @@
   based on note-heads-engraver.cc, by Jean-Baptiste Lamy <jiba@tuxfamily.org>,
 
   (c) 2002--2005
-
 */
 
 #include <cctype>
@@ -26,7 +25,7 @@
 class Tab_note_heads_engraver : public Engraver
 {
   Link_array<Item> notes_;
-  
+
   Link_array<Item> dots_;
   Link_array<Music> note_events_;
   Link_array<Music> tabstring_events_;
@@ -34,19 +33,18 @@ public:
   TRANSLATOR_DECLARATIONS (Tab_note_heads_engraver);
 
 protected:
-  virtual bool try_music (Music *event) ;
+  virtual bool try_music (Music *event);
   virtual void process_music ();
 
   virtual void stop_translation_timestep ();
 };
 
-
 Tab_note_heads_engraver::Tab_note_heads_engraver ()
 {
 }
 
 bool
-Tab_note_heads_engraver::try_music (Music *m) 
+Tab_note_heads_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("note-event"))
     {
@@ -62,41 +60,38 @@ Tab_note_heads_engraver::try_music (Music *m)
     {
       return note_events_.size ();
     }
-  
+
   return false;
 }
 
-
 void
 Tab_note_heads_engraver::process_music ()
 {
-  int j = 0; 
+  int j = 0;
   for (int i = 0; i < note_events_.size (); i++)
     {
       SCM stringTunings = get_property ("stringTunings");
       int number_of_strings = ((int) ly_length (stringTunings));
       bool high_string_one = to_boolean (get_property ("highStringOne"));
 
-      
-      Music * event = note_events_[i];
-      Item * note  = make_item ("TabNoteHead", event->self_scm ());
+      Music *event = note_events_[i];
+      Item *note = make_item ("TabNoteHead", event->self_scm ());
 
-      
-      Music * tabstring_event = 0;
+      Music *tabstring_event = 0;
 
       for (SCM s = event->get_property ("articulations");
           !tabstring_event && scm_is_pair (s); s = scm_cdr (s))
        {
-         Music * art = unsmob_music (scm_car (s));
+         Music *art = unsmob_music (scm_car (s));
 
          if (art->is_mus_type ("string-number-event"))
            tabstring_event = art;
        }
 
-      if (!tabstring_event  && j < tabstring_events_.size ())
+      if (!tabstring_event && j < tabstring_events_.size ())
        {
          tabstring_event = tabstring_events_[j];
-         if (j +1 <  tabstring_events_.size ())
+         if (j +1 < tabstring_events_.size ())
            j++;
        }
 
@@ -112,36 +107,35 @@ Tab_note_heads_engraver::process_music ()
          tab_string = high_string_one ? 1 : number_of_strings;
          string_found = false;
        }
-      
+
       Duration dur = *unsmob_duration (event->get_property ("duration"));
       note->set_property ("duration-log",
-                              scm_int2num (dur.duration_log ()));
+                         scm_int2num (dur.duration_log ()));
 
       if (dur.dot_count ())
        {
-         Item * d = make_item ("Dots", event->self_scm ());
+         Item *d = make_item ("Dots", event->self_scm ());
          Rhythmic_head::set_dots (note, d);
-         
+
          if (dur.dot_count ()
              != scm_to_int (d->get_property ("dot-count")))
            d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
 
          d->set_parent (note, Y_AXIS);
-         
+
          dots_.push (d);
        }
-      
-      
+
       SCM scm_pitch = event->get_property ("pitch");
-      SCM proc      = get_property ("tablatureFormat");
+      SCM proc = get_property ("tablatureFormat");
       SCM min_fret_scm = get_property ("minimumFret");
       int min_fret = scm_is_number (min_fret_scm) ? scm_to_int (min_fret_scm) : 0;
 
       while (!string_found)
        {
          int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
-           - scm_to_int (scm_list_ref (stringTunings, scm_int2num (tab_string-1)));
-         if (fret<min_fret)
+           - scm_to_int (scm_list_ref (stringTunings, scm_int2num (tab_string - 1)));
+         if (fret < min_fret)
            tab_string += high_string_one ? 1 : -1;
          else
            string_found = true;
@@ -152,9 +146,9 @@ Tab_note_heads_engraver::process_music ()
       int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!!
       if (to_boolean (get_property ("stringOneTopmost")))
        pos = -pos;
-      
-      note->set_property ("text", text);      
-      
+
+      note->set_property ("text", text);
+
       note->set_property ("staff-position", scm_int2num (pos));
       notes_.push (note);
     }
@@ -169,12 +163,11 @@ Tab_note_heads_engraver::stop_translation_timestep ()
   tabstring_events_.clear ();
 }
 
-
 ADD_TRANSLATOR (Tab_note_heads_engraver,
-/* descr */       "Generate one or more tablature noteheads from Music of type NoteEvent.",
-/* creats*/       "TabNoteHead Dots",
-/* accepts */     "note-event string-number-event busy-playing-event",
-/* acks  */      "",
-/* reads */       "middleCPosition stringTunings minimumFret tablatureFormat highStringOne stringOneTopmost",
-/* write */       "");
+               /* descr */ "Generate one or more tablature noteheads from Music of type NoteEvent.",
+               /* creats*/ "TabNoteHead Dots",
+               /* accepts */ "note-event string-number-event busy-playing-event",
+               /* acks  */ "",
+               /* reads */ "middleCPosition stringTunings minimumFret tablatureFormat highStringOne stringOneTopmost",
+               /* write */ "");
 
index d7ed5211f40b093bd9c7b03608db26860f0c353b..3b638996ec2adf92a33eeb158b2f2fc7fb85f6ae 100644 (file)
@@ -26,6 +26,4 @@ Interval_t<Rational>::T_to_string (Rational a)
   return a.to_string ();
 }
 
-
-
 template INTERVAL__INSTANTIATE (Rational);
index 074fbcc70969a2084c6b62939418b05d1ca0f5ee..0cbbbf450cab229cbeafe062c1a1eab6dd1055a9 100644 (file)
@@ -6,7 +6,6 @@
   (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-
 #include "audio-item.hh"
 #include "performer.hh"
 
@@ -18,13 +17,13 @@ public:
 
 protected:
 
-  virtual bool try_music (Musicreq);
+  virtual bool try_music (Music *req);
   virtual void stop_translation_timestep ();
   virtual void create_audio_elements ();
 
 private:
-  Musictempo_req_;
-  Audio_tempoaudio_;
+  Music *tempo_req_;
+  Audio_tempo *audio_;
 };
 
 Tempo_performer::Tempo_performer ()
@@ -37,7 +36,6 @@ Tempo_performer::~Tempo_performer ()
 {
 }
 
-
 void
 Tempo_performer::create_audio_elements ()
 {
@@ -46,9 +44,9 @@ Tempo_performer::create_audio_elements ()
 
       SCM met = tempo_req_->get_property ("metronome-count");
       Duration *d = unsmob_duration (tempo_req_->get_property ("tempo-unit"));
-      
-      Rational r =  (d->get_length () / Moment (Rational (1, 4)) * Moment (scm_to_int (met))).main_part_;
-      
+
+      Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (scm_to_int (met))).main_part_;
+
       audio_ = new Audio_tempo (int (r));
 
       Audio_element_info info (audio_, tempo_req_);
@@ -68,7 +66,7 @@ Tempo_performer::stop_translation_timestep ()
 }
 
 bool
-Tempo_performer::try_music (Musicreq)
+Tempo_performer::try_music (Music *req)
 {
   if (tempo_req_)
     return false;
@@ -78,8 +76,6 @@ Tempo_performer::try_music (Music* req)
 }
 
 
-
-
 ADD_TRANSLATOR (Tempo_performer, "", "",
-                  "metronome-change-event",
-                  "", "", "" );
+               "metronome-change-event",
+               "", "", "");
index 21d0b8f52541bd8d96678b7801527439605ec4f0..9569f3d24ba09b71354ac9d5b58d1d9271889102 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   text-engraver.cc -- implement Text_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "directional-element-interface.hh"
 #include "engraver.hh"
@@ -16,7 +15,7 @@
 
 /**
    typeset directions that are  plain text.
- */
+*/
 class Text_engraver : public Engraver
 {
   Link_array<Music> evs_;
@@ -24,7 +23,7 @@ class Text_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (Text_engraver);
 protected:
-  virtual bool try_music (Musicm);
+  virtual bool try_music (Music *m);
   virtual void stop_translation_timestep ();
   virtual void process_acknowledged_grobs ();
   virtual void acknowledge_grob (Grob_info);
@@ -48,21 +47,21 @@ Text_engraver::acknowledge_grob (Grob_info inf)
     {
       for (int i = 0; i < texts_.size (); i++)
        {
-         Grob*t = texts_[i];
+         Grob *t = texts_[i];
          Side_position_interface::add_support (t, inf.grob_);
 
          /*
            ugh.
-          */
+         */
          if (Side_position_interface::get_axis (t) == X_AXIS
              && !t->get_parent (Y_AXIS))
            t->set_parent (inf.grob_, Y_AXIS);
          else if (Side_position_interface::get_axis (t) == Y_AXIS
-             && !t->get_parent (X_AXIS))
+                  && !t->get_parent (X_AXIS))
            t->set_parent (inf.grob_, X_AXIS);
        }
     }
-  
+
   if (Stem::has_interface (inf.grob_))
     {
       for (int i = 0; i < texts_.size (); i++)
@@ -79,12 +78,11 @@ Text_engraver::process_acknowledged_grobs ()
     return;
   for (int i = 0; i < evs_.size (); i++)
     {
-      Music * r = evs_[i];
-      
+      Music *r = evs_[i];
+
       // URG: Text vs TextScript
       Item *text = make_item ("TextScript", r->self_scm ());
 
-      
       Axis ax = Y_AXIS;
       Side_position_interface::set_axis (text, ax);
 
@@ -93,17 +91,16 @@ Text_engraver::process_acknowledged_grobs ()
       SCM s = text->get_property ("script-priority");
       if (scm_is_number (s))
        priority = scm_to_int (s);
-      
+
       /* see script-engraver.cc */
       priority += i;
-      
+
       text->set_property ("script-priority", scm_int2num (priority));
 
       Direction dir = to_dir (r->get_property ("direction"));
       if (dir)
        set_grob_direction (text, dir);
 
-
       SCM mark = r->get_property ("text");
 
       text->set_property ("text", mark);
@@ -118,15 +115,14 @@ Text_engraver::stop_translation_timestep ()
   evs_.clear ();
 }
 
-
 Text_engraver::Text_engraver ()
 {
 }
 
 ADD_TRANSLATOR (Text_engraver,
-/* descr */       "Create text-scripts",
-/* creats*/       "TextScript",
-/* accepts */     "text-script-event",
-/* acks  */      "rhythmic-head-interface stem-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create text-scripts",
+               /* creats*/ "TextScript",
+               /* accepts */ "text-script-event",
+               /* acks  */ "rhythmic-head-interface stem-interface",
+               /* reads */ "",
+               /* write */ "");
index d5dd43c3445cd87811af0557e7d8662cd9449055..2cbaedefc2667e1bf468162bc4190637b58fb3ec 100644 (file)
@@ -1,17 +1,17 @@
-/*   
+/*
   text-item.cc -- implement Text_interface
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-                 Jan Nieuwenhuizen <janneke@gnu.org>
+  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "text-item.hh"
 
 #include <math.h>
 
-#include "main.hh" 
+#include "main.hh"
 #include "config.hh"
 #include "pango-font.hh"
 #include "warn.hh"
 #include "output-def.hh"
 #include "modified-font-metric.hh"
 
-
 MAKE_SCHEME_CALLBACK (Text_interface, interpret_string, 3)
-SCM
+  SCM
 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,
@@ -40,9 +39,8 @@ Text_interface::interpret_string (SCM layout_smob,
   return fm->text_stencil (str).smobbed_copy ();
 }
 
-
 MAKE_SCHEME_CALLBACK (Text_interface, interpret_markup, 3)
-SCM
+  SCM
 Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
 {
   if (scm_is_string (markup))
@@ -53,20 +51,20 @@ Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
       SCM args = scm_cdr (markup);
       if (!markup_p (markup))
        programming_error ("Markup head has no markup signature.");
-      
+
       return scm_apply_2 (func, layout_smob, props, args);
     }
   else
     {
       programming_error ("Is not a markup: ");
-      scm_display (markup, scm_current_error_port());
+      scm_display (markup, scm_current_error_port ());
       assert (false);
       Box b;
-      b[X_AXIS].set_empty();
-      b[Y_AXIS].set_empty();
-      
-      Stencil s(b, SCM_EOL);
-      return s.smobbed_copy();
+      b[X_AXIS].set_empty ();
+      b[Y_AXIS].set_empty ();
+
+      Stencil s (b, SCM_EOL);
+      return s.smobbed_copy ();
     }
 }
 
@@ -75,7 +73,7 @@ SCM
 Text_interface::print (SCM grob)
 {
   Grob *me = unsmob_grob (grob);
-  
+
   SCM t = me->get_property ("text");
   SCM chain = Font_interface::text_font_alist_chain (me);
   return interpret_markup (me->get_layout ()->self_scm (), chain, t);
@@ -97,5 +95,3 @@ ADD_INTERFACE (Text_interface, "text-interface",
               "text baseline-skip word-space");
 
 
-
-
index 3092afa01be7595dd374daf1cd406f35b7f50bc5..927a9d39e950fb9a331421bfc32a2ff36450ef64 100644 (file)
@@ -19,10 +19,10 @@ lookup_tex_text_dimension (Font_metric *font, SCM text)
   Box b;
 
   SCM limit = ly_lily_module_constant ("TEX_STRING_HASHLIMIT");
-  String key_str = ly_scm2string (font->font_file_name());
+  String key_str = ly_scm2string (font->font_file_name ());
   int hash_code = scm_to_int (scm_hash (text, limit));
-  key_str = to_string (hash_code)  + key_str;
-  
+  key_str = to_string (hash_code) + key_str;
+
   SCM val = SCM_BOOL_F;
   if (text_dimension_hash_tab)
     {
@@ -37,21 +37,21 @@ lookup_tex_text_dimension (Font_metric *font, SCM text)
       val = scm_cdr (val);
       b[Y_AXIS][UP] = scm_to_double (scm_car (val)) * point_constant;
       val = scm_cdr (val);
-      b[Y_AXIS][DOWN] = scm_to_double (scm_car (val)) * point_constant; 
+      b[Y_AXIS][DOWN] = scm_to_double (scm_car (val)) * point_constant;
     }
-  
-  return b; 
+
+  return b;
 }
 
-LY_DEFINE(ly_load_text_dimensions, "ly:load-text-dimensions",
-         1, 0, 0,
-         (SCM dimension_alist),
-         "Load dimensions from TeX in a (KEY . (W H D)) format alist")
+LY_DEFINE (ly_load_text_dimensions, "ly:load-text-dimensions",
+          1, 0, 0,
+          (SCM dimension_alist),
+          "Load dimensions from TeX in a (KEY . (W H D)) format alist")
 {
   if (!text_dimension_hash_tab)
     {
-      text_dimension_hash_tab =
-       scm_gc_protect_object (scm_c_make_hash_table (113));
+      text_dimension_hash_tab
+       scm_gc_protect_object (scm_c_make_hash_table (113));
     }
 
   for (SCM s = dimension_alist;
@@ -60,7 +60,7 @@ LY_DEFINE(ly_load_text_dimensions, "ly:load-text-dimensions",
     {
       SCM key = scm_caar (s);
       SCM val = scm_cdar (s);
-      
+
       if (scm_hash_ref (text_dimension_hash_tab, key, SCM_BOOL_F)
          == SCM_BOOL_F)
        {
@@ -74,11 +74,11 @@ LY_DEFINE(ly_load_text_dimensions, "ly:load-text-dimensions",
 void
 try_load_text_metrics (String basename)
 {
-  String path =  global_path.find (basename +  ".textmetrics");
+  String path = global_path.find (basename + ".textmetrics");
   if (path != "")
     {
       String contents (gulp_file_to_string (path, true));
-      contents = "(quote (" +  contents + "))";
+      contents = "(quote (" + contents + "))";
 
       SCM lst = scm_c_eval_string (contents.to_str0 ());
       ly_load_text_dimensions (lst);
index 44a6ee8dda872ed00babc6aa36da596d59c506a5..0001365823ff5f0d6183d6908da9ff6dd03dbe47 100644 (file)
@@ -13,7 +13,7 @@
 class Text_spanner_engraver : public Engraver
 {
 public:
-  TRANSLATOR_DECLARATIONS (Text_spanner_engraver);  
+  TRANSLATOR_DECLARATIONS (Text_spanner_engraver);
 protected:
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
@@ -25,11 +25,10 @@ private:
   Spanner *span_;
   Spanner *finished_;
   Music *current_req_;
-  Drul_array<Music*> req_drul_;
+  Drul_array<Music *> req_drul_;
   void typeset_all ();
 };
 
-
 Text_spanner_engraver::Text_spanner_engraver ()
 {
   finished_ = 0;
@@ -78,9 +77,8 @@ Text_spanner_engraver::process_music ()
       else
        {
          current_req_ = req_drul_[START];
-         span_  = make_spanner ("TextSpanner", req_drul_[START]->self_scm ());
+         span_ = make_spanner ("TextSpanner", req_drul_[START]->self_scm ());
 
-         
          Side_position_interface::set_axis (span_, Y_AXIS);
          req_drul_[START] = 0;
        }
@@ -90,25 +88,25 @@ Text_spanner_engraver::process_music ()
 void
 Text_spanner_engraver::acknowledge_grob (Grob_info info)
 {
-  Spanner * spans[2] ={span_, finished_};
-  for (int i = 0;  i < 2 ; i++)
+  Spanner *spans[2] ={span_, finished_};
+  for (int i = 0; i < 2; i++)
     {
       if (spans[i] && Note_column::has_interface (info.grob_))
        {
          Side_position_interface::add_support (spans[i], info.grob_);
-         add_bound_item (spans[i], dynamic_cast<Item*> (info.grob_));
+         add_bound_item (spans[i], dynamic_cast<Item *> (info.grob_));
        }
     }
 }
 
 void
 Text_spanner_engraver::typeset_all ()
-{  
+{
   if (finished_)
     {
       if (!finished_->get_bound (RIGHT))
        {
-         Grobe = unsmob_grob (get_property ("currentMusicalColumn"));
+         Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
          finished_->set_bound (RIGHT, e);
        }
       finished_ = 0;
@@ -120,7 +118,7 @@ Text_spanner_engraver::stop_translation_timestep ()
 {
   if (span_ && !span_->get_bound (LEFT))
     {
-      Grobe = unsmob_grob (get_property ("currentMusicalColumn"));
+      Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
       span_->set_bound (LEFT, e);
     }
 
@@ -142,9 +140,9 @@ Text_spanner_engraver::finalize ()
 }
 
 ADD_TRANSLATOR (Text_spanner_engraver,
-/* descr */       "Create text spanner from a Music.",
-/* creats*/       "TextSpanner",
-/* accepts */     "text-span-event",
-/* acks  */      "note-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create text spanner from a Music.",
+               /* creats*/ "TextSpanner",
+               /* accepts */ "text-span-event",
+               /* acks  */ "note-column-interface",
+               /* reads */ "",
+               /* write */ "");
index 2919f01a25d95cda90a95b5029372b1594707939..f21432c9e72e8fd4dd3f0a54f61319a0c3043fbb 100644 (file)
@@ -5,7 +5,7 @@
 
   (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 
-  Revised over good by Han-Wen. 
+  Revised over good by Han-Wen.
 */
 
 #include "text-spanner.hh"
@@ -34,15 +34,15 @@ MAKE_SCHEME_CALLBACK (Text_spanner, print, 1);
   TODO: this function is too long
 */
 SCM
-Text_spanner::print (SCM smob) 
+Text_spanner::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner *spanner = dynamic_cast<Spanner*> (me);
-  
+  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->get_layout ();
+  Output_def *layout = me->get_layout ();
 
   SCM flare = me->get_property ("bracket-flare");
   SCM shorten = me->get_property ("shorten-pair");
@@ -63,23 +63,22 @@ Text_spanner::print (SCM smob)
            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));
-         }
-      
+       {
+         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;
@@ -90,40 +89,40 @@ Text_spanner::print (SCM smob)
        {
          if (broken[d])
            continue;
-         
+
          SCM text = index_get_cell (edge_text, d);
 
-         if (Text_interface::markup_p (text)) 
+         if (Text_interface::markup_p (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);
-    }
-  
+  {
+    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
     {
@@ -132,7 +131,7 @@ Text_spanner::print (SCM smob)
        {
          edge[d].translate_axis (span_points[d], X_AXIS);
          m.add_stencil (edge[d]);
-         span_points[d] += -d *  ext[-d];
+         span_points[d] += -d * ext[-d];
        }
     }
   while (flip (&d) != LEFT);
@@ -149,7 +148,7 @@ Text_spanner::print (SCM smob)
   if (!span_points.is_empty ())
     {
       Stencil l = Line_spanner::line_stencil (me, Offset (span_points[LEFT], 0),
-                                              Offset (span_points[RIGHT], 0));
+                                             Offset (span_points[RIGHT], 0));
       m.add_stencil (l);
     }
   m.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS);
index fa91480267d8209a6359945d9f9b7063d3af036f..1b6862ec02fe8ed3da6caa4651eb37e89143a344 100644 (file)
@@ -1,13 +1,13 @@
-/*   
+/*
   tfm-reader.cc -- implement Tex_font_metric_reader
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-  
+
 
   some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
- */
+*/
 
 #include "tfm-reader.hh"
 
 #include "warn.hh"
 
 #define format_string String_convert::form_string
-#define FIX_UNITY \
- (1 << 20)
+#define FIX_UNITY                              \
 (1 << 20)
 static const Real fix_to_real (Fix f);
 
-
 Tex_font_metric_reader::Tex_font_metric_reader (String name)
   : input_ (name)
 {
-  
+
   for (int i = 0; i < TFM_SIZE; i++)
     ascii_to_metric_idx_.push (-1);
 
@@ -71,7 +70,7 @@ void
 Tex_font_metric_reader::read_header ()
 {
   U16 file_length = input_.get_U16 ();
- (void) file_length;
 (void) file_length;
   U16 header_length = input_.get_U16 ();
 
   info_.first_charcode = input_.get_U16 ();
@@ -82,21 +81,21 @@ Tex_font_metric_reader::read_header ()
   U16 italic_correction_word_count = input_.get_U16 ();
   U16 lig_kern_word_count = input_.get_U16 ();
   U16 kern_word_count = input_.get_U16 ();
- (void)kern_word_count;
 (void)kern_word_count;
   U16 extensible_word_count = input_.get_U16 ();
- (void)extensible_word_count;
-  
 (void)extensible_word_count;
+
   header_.param_word_count = input_.get_U16 ();
   info_.parameter_count = header_.param_word_count;
 
   header_.char_info_pos = (6 + header_length) * 4;
   header_.width_pos = header_.char_info_pos
-                         + (info_.last_charcode
-                            - info_.first_charcode + 1) * 4;
+    + (info_.last_charcode
+       - info_.first_charcode + 1) * 4;
   header_.height_pos = header_.width_pos + width_word_count * 4;
   header_.depth_pos = header_.height_pos + height_word_count * 4;
   header_.italic_correction_pos = header_.depth_pos
-                                     + depth_word_count * 4;
+    + depth_word_count * 4;
   header_.lig_kern_pos = header_.italic_correction_pos
     + italic_correction_word_count * 4;
   header_.kern_pos = header_.lig_kern_pos + lig_kern_word_count * 4;
@@ -183,7 +182,7 @@ Tex_font_metric_reader::read_char_metric (Char_code code)
      try to read it. */
   if (code < info_.first_charcode || code > info_.last_charcode)
     return tfm_char;
-  
+
   //brr
   /* Move to the appropriate place in the `char_info' array.  */
   input_.seek_str0 (header_.char_info_pos + (code - info_.first_charcode) * 4);
@@ -197,7 +196,6 @@ Tex_font_metric_reader::read_char_metric (Char_code code)
   return tfm_char;
 }
 
-
 /* We assume we are positioned at the beginning of a `char_info' word.
    We read that word to get the indexes into the dimension tables; then
    we go read the tables to get the values (if the character exists).  */
@@ -221,14 +219,14 @@ Tex_font_metric_reader::read_char ()
 
   Tex_font_char_metric tfm_char;
 
-#define GET_CHAR_DIMEN(d) \
-   if (d##_index != 0) \
-     { \
-       input_.seek_str0 (header_. d##_pos + d##_index*4); \
-       tfm_char.d##_fix_ = input_.get_U32 (); \
-       tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
-                      * info_.design_size; \
-     }
+#define GET_CHAR_DIMEN(d)                                      \
+  if (d##_index != 0)                                          \
+    {                                                          \
+      input_.seek_str0 (header_. d##_pos + d##_index*4);       \
+      tfm_char.d##_fix_ = input_.get_U32 ();                   \
+      tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_)          \
+       * info_.design_size;                                    \
+    }
 
   GET_CHAR_DIMEN (width);
   GET_CHAR_DIMEN (height);
@@ -259,7 +257,7 @@ Tex_font_metric_reader::read_char ()
 #define KERN_FLAG 128
 
 void
-Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligatures, Array <Tfm_kern>* kerns)
+Tex_font_metric_reader::read_lig_kern_program (Array<Tfm_ligature>* ligatures, Array<Tfm_kern>* kerns)
 {
   bool end_b;
 
@@ -271,13 +269,12 @@ Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligatures,
       bool kern_step_b = input_.get_U8 () >= KERN_FLAG;
       U8 remainder = input_.get_U8 ();
 
-
       if (kern_step_b)
        {
          Tfm_kern kern_element;
          kern_element.character = next_char;
 
-         char constold_pos = input_.pos_str0 ();
+         char const *old_pos = input_.pos_str0 ();
          input_.seek_str0 (header_.kern_pos + remainder * 4);
          kern_element.kern = get_U32_fix_scaled ();
          input_.set_pos (old_pos);
@@ -293,6 +290,8 @@ Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligatures,
          ligatures->push (ligature_element);
 
        }
-  } while (!end_b);
+    }
+  while (!end_b);
+
 }
 
index 1e8dc4fb001c0b4cd7ec81803915aad605a5b62c..8d86135022a3c0378659ea13f44380412512f0f8 100644 (file)
@@ -1,12 +1,12 @@
-/*   
+/*
   tfm.cc -- implement Tex_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 
   some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
- */
+*/
 
 #include "file-name.hh"
 #include "tfm.hh"
@@ -40,11 +40,11 @@ Tex_font_char_metric::dimensions () const
       b.set_empty ();
       return b;
     }
-  
+
   Real d = -depth_;
   Real point_constant = 1 PT;
-  
-  return Box (Interval (0, width_* point_constant ),
+
+  return Box (Interval (0, width_* point_constant),
              Interval ((d <? height_) * point_constant,
                        (d >? height_) * point_constant));
 }
@@ -65,10 +65,10 @@ Tex_font_metric::find_ascii (int ascii, bool warn) const
 {
   if (ascii >= 0 && ascii < ascii_to_metric_idx_.size ()
       && ascii_to_metric_idx_[ascii] >= 0)
-    return & char_metrics_[ascii_to_metric_idx_ [ascii]];
+    return &char_metrics_[ascii_to_metric_idx_ [ascii]];
   else if (warn)
     warning (_f ("can't find ascii character: %d", ascii));
-  return &dummy_static_char_metric;  
+  return &dummy_static_char_metric;
 }
 
 /* UGH: glyphs need not be consecutive in TFM. */
index a6f053376e2dfbf1dbcd33cde29e43a22e22d01e..9f8bf74fb949502925090cb01df5279142768080 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   tie-column.cc -- implement Tie_column
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "tie-column.hh"
 #include "paper-column.hh"
 */
 /*
   TODO: this doesn't follow standard pattern. Regularize.
- */
+*/
 void
-Tie_column::add_tie (Grob*me, Grob *tie)
+Tie_column::add_tie (Grob *me, Grob *tie)
 {
   if (tie->get_parent (Y_AXIS)
       && Tie_column::has_interface (tie->get_parent (Y_AXIS)))
-    return ;
+    return;
 
-   
   if (!Pointer_group_interface::count (me, ly_symbol2scm ("ties")))
     {
-      dynamic_cast<Spanner*> (me)->set_bound (LEFT, Tie::head (tie, LEFT));
-      dynamic_cast<Spanner*> (me)->set_bound (RIGHT, Tie::head (tie, RIGHT));
+      dynamic_cast<Spanner *> (me)->set_bound (LEFT, Tie::head (tie, LEFT));
+      dynamic_cast<Spanner *> (me)->set_bound (RIGHT, Tie::head (tie, RIGHT));
     }
-  
-   
+
   tie->set_parent (me, Y_AXIS);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("ties"), tie);
   tie->add_dependency (me);
 }
 
 void
-Tie_column::set_directions (Grob*me)
+Tie_column::set_directions (Grob *me)
 {
   werner_directions (me);
 }
 
 int
-tie_compare (Grob* const & s1,
-            Grob* const & s2)
+tie_compare (Grob *const &s1,
+            Grob *const &s2)
 {
   return sign (Tie::get_position (s1) - Tie::get_position (s2));
 }
 
 /*
-Werner:
+  Werner:
 
- . The algorithm to choose the direction of the ties doesn't work
-   properly.  I suggest the following for applying ties sequentially
-   from top to bottom:
 . The algorithm to choose the direction of the ties doesn't work
+  properly.  I suggest the following for applying ties sequentially
+  from top to bottom:
 
-     + The topmost tie is always `up'.
+  + The topmost tie is always `up'.
 
-     + If there is a vertical gap to the last note above larger than
-       or equal to a fifth (or sixth?), the tie is `up', otherwise it
-       is `down'.
-
-     + The bottommost tie is always `down'.
+  + If there is a vertical gap to the last note above larger than
+  or equal to a fifth (or sixth?), the tie is `up', otherwise it
+  is `down'.
 
+  + The bottommost tie is always `down'.
 */
 void
 Tie_column::werner_directions (Grob *me)
 {
-  Link_array<Grob> ties =
-    extract_grob_array (me, ly_symbol2scm ("ties"));
+  Link_array<Grob> ties
+    extract_grob_array (me, ly_symbol2scm ("ties"));
 
   if (!ties.size ())
-    return ;
-  
+    return;
+
   ties.sort (tie_compare);
 
   Direction d = get_grob_direction (me);
@@ -86,20 +82,20 @@ Tie_column::werner_directions (Grob *me)
     {
       for (int i = ties.size (); i--;)
        {
-         Grob *  t = ties[i];
+         Grob *t = ties[i];
          if (!get_grob_direction (t))
            set_grob_direction (t, d);
        }
-      return ;
+      return;
     }
-  
+
   if (ties.size () == 1)
     {
-      Grob *  t = ties[0];
+      Grob *t = ties[0];
       if (t->is_live ()
          && !get_grob_direction (t))
        set_grob_direction (t, Tie::get_default_dir (t));
-      return ;
+      return;
     }
 
   Real last_down_pos = 10000;
@@ -108,19 +104,19 @@ Tie_column::werner_directions (Grob *me)
 
   /*
     Go downward.
-   */
+  */
   Grob *last_tie = 0;
   for (int i = ties.size (); i--;)
     {
       Grob *t = ties[i];
-      
+
       Direction d = get_grob_direction (t);
-      Real p  = Tie::get_position (t);
+      Real p = Tie::get_position (t);
       if (!d)
        {
          if (last_tie
              && Tie::get_column_rank (t, LEFT)
-                < Tie::get_column_rank (last_tie, LEFT))
+             < Tie::get_column_rank (last_tie, LEFT))
            {
              d = DOWN;
            }
@@ -142,10 +138,9 @@ Tie_column::werner_directions (Grob *me)
       last_tie = t;
     }
 
-  return ;
+  return;
 }
 
-
 MAKE_SCHEME_CALLBACK (Tie_column, after_line_breaking, 1);
 SCM
 Tie_column::after_line_breaking (SCM smob)
@@ -156,19 +151,19 @@ Tie_column::after_line_breaking (SCM smob)
 
 /*
   Extend the spanner over its Tie constituents.
- */
+*/
 MAKE_SCHEME_CALLBACK (Tie_column, before_line_breaking, 1);
 SCM
 Tie_column::before_line_breaking (SCM smob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (unsmob_grob (smob));
+  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
   for (SCM s = me->get_property ("ties"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Spanner *tie = dynamic_cast<Spanner*> (unsmob_grob (scm_car (s)));
+      Spanner *tie = dynamic_cast<Spanner *> (unsmob_grob (scm_car (s)));
       Direction dir = LEFT;
       do
        {
-         if (dir * Paper_column::get_rank (tie->get_bound (dir)->get_column ()) 
+         if (dir * Paper_column::get_rank (tie->get_bound (dir)->get_column ())
              > dir * Paper_column::get_rank (me->get_bound (dir)->get_column ()))
            {
              me->set_bound (dir, Tie::head (tie, dir));
@@ -180,6 +175,6 @@ Tie_column::before_line_breaking (SCM smob)
 }
 
 ADD_INTERFACE (Tie_column, "tie-column-interface",
-  "Object that sets directions of multiple ties in a tied chord",
-  "direction");
+              "Object that sets directions of multiple ties in a tied chord",
+              "direction");
 
index 43d6917587cb67131baff665359a04c63e555f45..efd6098c5ad5c612e4ea7a838c90bd970f770d5f 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   tie-engraver.cc -- implement Tie_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "tie.hh"
 #include "context.hh"
@@ -33,10 +32,10 @@ struct Head_event_tuple
   Grob *head_;
   SCM tie_definition_;
   Music *event_;
-  Head_event_tuple()
+  Head_event_tuple ()
   {
   }
-  Head_event_tuple(Grob *h, Music *m, SCM def)
+  Head_event_tuple (Grob *h, Music *m, SCM def)
   {
     head_ = h;
     event_ = m;
@@ -50,27 +49,26 @@ class Tie_engraver : public Engraver
   Link_array<Grob> now_heads_;
   Array<Head_event_tuple> heads_to_tie_;
   Link_array<Grob> ties_;
-  
-  Spanner * tie_column_;
-  
+
+  Spanner *tie_column_;
+
 protected:
   virtual void stop_translation_timestep ();
   virtual void derived_mark () const;
   virtual void start_translation_timestep ();
   virtual void acknowledge_grob (Grob_info);
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void process_music ();
-  void typeset_tie (Grob*);
+  void typeset_tie (Grob *);
 public:
   TRANSLATOR_DECLARATIONS (Tie_engraver);
 };
 
-
 void
 Tie_engraver::derived_mark () const
 {
   Engraver::derived_mark ();
-  for (int i = 0;  i < heads_to_tie_.size();  i++)
+  for (int i = 0; i < heads_to_tie_.size (); i++)
     scm_gc_mark (heads_to_tie_[i].tie_definition_);
 }
 
@@ -80,7 +78,6 @@ Tie_engraver::Tie_engraver ()
   tie_column_ = 0;
 }
 
-
 bool
 Tie_engraver::try_music (Music *mus)
 {
@@ -88,7 +85,7 @@ Tie_engraver::try_music (Music *mus)
     {
       event_ = mus;
     }
-  
+
   return true;
 }
 
@@ -106,29 +103,29 @@ Tie_engraver::acknowledge_grob (Grob_info i)
 {
   if (Note_head::has_interface (i.grob_))
     {
-      Grob * h  = i.grob_;
+      Grob *h = i.grob_;
       now_heads_.push (h);
-      for  (int i = heads_to_tie_.size (); i--;)
+      for (int i = heads_to_tie_.size (); i--;)
        {
-         Grob *th =  heads_to_tie_[i].head_;
-         Music * right_mus = unsmob_music (h->get_property ("cause"));
-         Music * left_mus = unsmob_music (th->get_property ("cause"));
+         Grob *th = heads_to_tie_[i].head_;
+         Music *right_mus = unsmob_music (h->get_property ("cause"));
+         Music *left_mus = unsmob_music (th->get_property ("cause"));
 
          /*
            maybe should check positions too.
-          */
+         */
          if (right_mus && left_mus
              && ly_c_equal_p (right_mus->get_property ("pitch"),
-                            left_mus->get_property ("pitch")))
+                              left_mus->get_property ("pitch")))
            {
-             Grob * p = new Spanner  (heads_to_tie_[i].tie_definition_,
-                                      context()->get_grob_key ("Tie"));
+             Grob *p = new Spanner (heads_to_tie_[i].tie_definition_,
+                                    context ()->get_grob_key ("Tie"));
              announce_grob (p, heads_to_tie_[i].event_->self_scm ());
              Tie::set_interface (p); // cannot remove yet!
-         
+
              Tie::set_head (p, LEFT, th);
              Tie::set_head (p, RIGHT, h);
-         
+
              ties_.push (p);
              heads_to_tie_.del (i);
            }
@@ -150,7 +147,7 @@ Tie_engraver::start_translation_timestep ()
 {
   context ()->set_property ("tieMelismaBusy",
                            ly_bool2scm (heads_to_tie_.size ()));
-      
+
 }
 
 void
@@ -162,8 +159,8 @@ Tie_engraver::stop_translation_timestep ()
        {
          heads_to_tie_.clear ();
        }
-      
-      for (int i = 0; i<  ties_.size (); i++)
+
+      for (int i = 0; i< ties_.size (); i++)
        {
          typeset_tie (ties_[i]);
        }
@@ -171,23 +168,22 @@ Tie_engraver::stop_translation_timestep ()
       ties_.clear ();
       tie_column_ = 0;
     }
-  
+
   if (event_)
     {
       SCM start_definition
        = updated_grob_properties (context (), ly_symbol2scm ("Tie"));
 
       if (!to_boolean (get_property ("tieWaitForNote")))
-       heads_to_tie_.clear();
+       heads_to_tie_.clear ();
 
-      for  (int i = 0; i < now_heads_.size(); i++)
+      for (int i = 0; i < now_heads_.size (); i++)
        {
          heads_to_tie_.push (Head_event_tuple (now_heads_[i], event_,
-                                               start_definition
-                                               ));
-       }      
+                                               start_definition));
+       }
     }
-  
+
   event_ = 0;
   now_heads_.clear ();
 }
@@ -201,22 +197,23 @@ Tie_engraver::typeset_tie (Grob *her)
   Direction d = LEFT;
   Drul_array<Grob *> new_head_drul;
   new_head_drul[LEFT] = Tie::head (her, LEFT);
-  new_head_drul[RIGHT] = Tie::head (her, RIGHT);  
-  do {
-    if (!Tie::head (her, d))
-      new_head_drul[d] = Tie::head (her, (Direction)-d);
-  } while (flip (&d) != LEFT);
+  new_head_drul[RIGHT] = Tie::head (her, RIGHT);
+  do
+    {
+      if (!Tie::head (her, d))
+       new_head_drul[d] = Tie::head (her, (Direction) - d);
+    }
+  while (flip (&d) != LEFT);
 
   index_set_cell (her->get_property ("head-pair"), LEFT, new_head_drul[LEFT]->self_scm ());
   index_set_cell (her->get_property ("head-pair"), RIGHT, new_head_drul[RIGHT]->self_scm ());
 
 }
 
-
 ADD_TRANSLATOR (Tie_engraver,
-/* descr */       "Generate ties between noteheads of equal pitch.",
-/* creats*/       "Tie TieColumn",
-/* accepts */     "tie-event",
-/* acks  */      "rhythmic-head-interface",
-/* reads */       "tieMelismaBusy",
-/* write */       "");
+               /* descr */ "Generate ties between noteheads of equal pitch.",
+               /* creats*/ "Tie TieColumn",
+               /* accepts */ "tie-event",
+               /* acks  */ "rhythmic-head-interface",
+               /* reads */ "tieMelismaBusy",
+               /* write */ "");
index 560d89bde29191b941c3b6f0ebb9ca8aa228ec0a..2c0b3c4b32adbc355f6d0caab74408b06aff55eb 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   tie-performer.cc -- implement Tie_performer
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "context.hh"
 #include "audio-item.hh"
@@ -20,12 +19,12 @@ class Tie_performer : public Performer
   Array<Audio_element_info> heads_to_tie_;
 
   bool ties_created_;
-  
+
 protected:
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
   virtual void acknowledge_audio_element (Audio_element_info);
-  virtual bool try_music (Music*);
+  virtual bool try_music (Music *);
   virtual void process_music ();
 public:
   TRANSLATOR_DECLARATIONS (Tie_performer);
@@ -34,7 +33,7 @@ public:
 Tie_performer::Tie_performer ()
 {
   event_ = 0;
-  last_event_  = 0;
+  last_event_ = 0;
   ties_created_ = false;
 }
 
@@ -45,7 +44,7 @@ Tie_performer::try_music (Music *mus)
     {
       event_ = mus;
     }
-  
+
   return true;
 }
 
@@ -59,22 +58,22 @@ Tie_performer::process_music ()
 void
 Tie_performer::acknowledge_audio_element (Audio_element_info inf)
 {
-  if (Audio_note * an = dynamic_cast<Audio_note *> (inf.elem_))
+  if (Audio_note *an = dynamic_cast<Audio_note *> (inf.elem_))
     {
       now_heads_.push (inf);
-      for  (int i = heads_to_tie_.size (); i--;)
+      for (int i = heads_to_tie_.size (); i--;)
        {
-         Music * right_mus = inf.event_;
-         
-         Audio_note *th =  dynamic_cast<Audio_note*> (heads_to_tie_[i].elem_);
-         Music * left_mus = heads_to_tie_[i].event_;
+         Music *right_mus = inf.event_;
+
+         Audio_note *th = dynamic_cast<Audio_note *> (heads_to_tie_[i].elem_);
+         Music *left_mus = heads_to_tie_[i].event_;
 
          if (right_mus && left_mus
              && ly_c_equal_p (right_mus->get_property ("pitch"),
                               left_mus->get_property ("pitch")))
            {
              an->tie_to (th);
-             ties_created_ = true;  
+             ties_created_ = true;
            }
        }
     }
@@ -85,7 +84,7 @@ Tie_performer::start_translation_timestep ()
 {
   context ()->set_property ("tieMelismaBusy",
                            ly_bool2scm (heads_to_tie_.size ()));
-      
+
 }
 
 void
@@ -97,7 +96,7 @@ Tie_performer::stop_translation_timestep ()
       last_event_ = 0;
       ties_created_ = false;
     }
-  
+
   if (event_)
     {
       heads_to_tie_ = now_heads_;
@@ -108,9 +107,9 @@ Tie_performer::stop_translation_timestep ()
 }
 
 ADD_TRANSLATOR (Tie_performer,
-/* descr */       "Generate ties between noteheads of equal pitch.",
-/* creats*/       "",
-/* accepts */     "tie-event",
-/* acks  */       "",
-/* reads */       "tieMelismaBusy",
-/* write */       "");
+               /* descr */ "Generate ties between noteheads of equal pitch.",
+               /* creats*/ "",
+               /* accepts */ "tie-event",
+               /* acks  */ "",
+               /* reads */ "tieMelismaBusy",
+               /* write */ "");
index 569aa220ad9cc9ec0cc35afe8b150a5000337e2b..59755a8ad712e92cdcbe9de10ae8ead2cc0842aa 100644 (file)
   c4 \staffchange c4
 
   do we have non-horizontal ties then?
-  */
-
+*/
 
 void
-Tie::set_head (Grob*me, Direction d, Grob * h)
+Tie::set_head (Grob *me, Direction d, Grob *h)
 {
   assert (!head (me, d));
   index_set_cell (me->get_property ("head-pair"), d, h->self_scm ());
-  
-  dynamic_cast<Spanner*> (me)->set_bound (d, h);
+
+  dynamic_cast<Spanner *> (me)->set_bound (d, h);
   me->add_dependency (h);
 }
 
 void
-Tie::set_interface (Grob*me)
+Tie::set_interface (Grob *me)
 {
   me->set_property ("head-pair", scm_cons (SCM_EOL, SCM_EOL));
 }
 
-
-Grob*
-Tie::head (Grob*me, Direction d) 
+Grob *
+Tie::head (Grob *me, Direction d)
 {
   SCM c = me->get_property ("head-pair");
 
@@ -68,39 +66,37 @@ Tie::head (Grob*me, Direction d)
 int
 Tie::get_column_rank (Grob *me, Direction d)
 {
-  Spanner *span = dynamic_cast<Spanner*> (me); 
-  Grob * h = head (me, d);
+  Spanner *span = dynamic_cast<Spanner *> (me);
+  Grob *h = head (me, d);
   if (!h)
     h = span->get_bound (d);
 
-  Grob *col = dynamic_cast<Item*> (h)->get_column ();
+  Grob *col = dynamic_cast<Item *> (h)->get_column ();
   return Paper_column::get_rank (col);
 }
 
 Real
-Tie::get_position (Grob*me) 
+Tie::get_position (Grob *me)
 {
   Direction d = head (me, LEFT) ? LEFT:RIGHT;
   return Staff_symbol_referencer::get_position (head (me, d));
 }
 
-
 /*
   Default:  Put the tie oppositie of the stem [Wanske p231]
 
   In case of chords: Tie_column takes over
-  
+
   The direction of the Tie is more complicated (See [Ross] p136 and
   further).
 
-  (what about linebreaks? )  
-  
+  (what about linebreaks? )
 */
 Direction
-Tie::get_default_dir (Grob*me) 
+Tie::get_default_dir (Grob *me)
 {
-  Item * sl =  head (me, LEFT) ? Rhythmic_head::get_stem (head (me, LEFT)) :0;
-  Item * sr =  head (me, RIGHT) ? Rhythmic_head::get_stem (head (me, RIGHT)) :0;  
+  Item *sl = head (me, LEFT) ? Rhythmic_head::get_stem (head (me, LEFT)) :0;
+  Item *sr = head (me, RIGHT) ? Rhythmic_head::get_stem (head (me, RIGHT)) :0;
   if (sl && sr)
     {
       if (get_grob_direction (sl) == UP
@@ -110,16 +106,14 @@ Tie::get_default_dir (Grob*me)
   else if (sl || sr)
     {
       Item *s = sl ? sl : sr;
-      return - get_grob_direction (s);
+      return -get_grob_direction (s);
     }
 
-  
   return UP;
 }
 
-
 void
-Tie::set_direction (Grob*me)
+Tie::set_direction (Grob *me)
 {
   if (!get_grob_direction (me))
     {
@@ -133,13 +127,12 @@ Tie::set_direction (Grob*me)
 /*
   TODO: we should also use thickness for computing the clearance
   between head and tie. Very thick ties will now touch the note head.
-  
-  */
+*/
 SCM
 Tie::get_control_points (SCM smob)
-{  
-  Spanner*me = unsmob_spanner (smob);
-  Direction headdir = CENTER; 
+{
+  Spanner *me = unsmob_spanner (smob);
+  Direction headdir = CENTER;
   if (head (me, LEFT))
     headdir = LEFT;
   else if (head (me, RIGHT))
@@ -154,33 +147,33 @@ Tie::get_control_points (SCM smob)
   set_direction (me);
 
   Direction dir = get_grob_direction (me);
-  
+
   Real staff_space = Staff_symbol_referencer::staff_space (me);
 
   Real x_gap_f = robust_scm2double (me->get_property ("x-gap"), 0);
 
-  Grobl = me->get_bound (LEFT);
-  Grob* r = me->get_bound (RIGHT);  
+  Grob *l = me->get_bound (LEFT);
+  Grob *r = me->get_bound (RIGHT);
 
-  Grobcommonx = me->common_refpoint (l, X_AXIS);
+  Grob *commonx = me->common_refpoint (l, X_AXIS);
   commonx = me->common_refpoint (r, X_AXIS);
-  
+
   Real left_x;
 
   /*
-     the tie has to be long enough to be visible, but should not go
+    the tie has to be long enough to be visible, but should not go
     through key sigs. In the 1.5 series the pref.matter - note
     distance is fixed , so this won't be a problem anymore.
-   */
-  Real lambda = 0.9;           
-  
+  */
+  Real lambda = 0.9;
+
   if (Note_head::has_interface (l))
     {
       Real where = RIGHT;
 
       /*
        This correction is due te the shape of the black note head.
-       */
+      */
       if (Rhythmic_head::duration_log (l) == 2)
        where += dir* 0.2;
       left_x = l->extent (l, X_AXIS).linear_combination (where)
@@ -188,13 +181,12 @@ Tie::get_control_points (SCM smob)
     }
   else
     left_x = l->extent (l, X_AXIS).linear_combination (lambda);
-  
 
   Real width;
   if (Note_head::has_interface (l) && Note_head::has_interface (r))
     {
-      width = 
-       + r->extent (commonx, X_AXIS)[LEFT]
+      width
+       + r->extent (commonx, X_AXIS)[LEFT]
        - l->extent (commonx, X_AXIS)[RIGHT]
        -2 * x_gap_f;
     }
@@ -205,24 +197,22 @@ Tie::get_control_points (SCM smob)
          - l->extent (commonx, X_AXIS)[RIGHT]
          - 2 * x_gap_f;
       else
-       width =
-         - l->extent (commonx, X_AXIS).linear_combination (lambda)  
+       width
+         = -l->extent (commonx, X_AXIS).linear_combination (lambda)
          + r->extent (commonx, X_AXIS)[LEFT]
          - 2 * x_gap_f;
     }
-  
-
 
   SCM details = me->get_property ("details");
 
   SCM lim // groetjes aan de chirurgendochter.
     = scm_assq (ly_symbol2scm ("height-limit"), details);
-  
-  Real h_inf = scm_to_double (scm_cdr (lim)) *  staff_space;
+
+  Real h_inf = scm_to_double (scm_cdr (lim)) * staff_space;
   Real r_0 = scm_to_double (scm_cdr (scm_assq (ly_symbol2scm ("ratio"), details)));
 
-  Bezier b  = slur_shape (width, h_inf, r_0);
-  
+  Bezier b = slur_shape (width, h_inf, r_0);
+
   /*
     I think this better, particularly for small ties. It always allows the user to move ties if
     they seem in the wrong place
@@ -231,59 +221,57 @@ Tie::get_control_points (SCM smob)
 
   */
 
-  Real ypos = Tie::get_position (me) * staff_space/2
+  Real ypos = Tie::get_position (me) * staff_space / 2
     + dir * scm_to_double (me->get_property ("y-offset"));;
 
   /*
     Make sure we don't start on a dots
-   */
+  */
   if (Note_head::has_interface (l) && Rhythmic_head::get_dots (l))
     {
-      Grobdots = Rhythmic_head::get_dots (l);
+      Grob *dots = Rhythmic_head::get_dots (l);
       if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) /2
-              - ypos) < 0.5)
+               - ypos) < 0.5)
        {
-         ypos += 0.5 * dir ;
+         ypos += 0.5 * dir;
        }
     }
 
-  
   /*
     todo: prevent ending / staffline collision.
 
     todo: tie / stem collision
-   */
+  */
 
   b = slur_shape (width, h_inf, r_0);
   b.scale (1, dir);
   b.translate (Offset (left_x, ypos));
-  
 
   /*
     Avoid colliding of the horizontal part with stafflines.
 
-    
+
     TODO: redo this, heuristic is half-baken, and ties often look ugly
     as a result.
 
     TODO: doesn't work when on staff with even number of lines.
-   */
+  */
   Array<Real> horizontal (b.solve_derivative (Offset (1, 0)));
   if (horizontal.size ())
     {
       /*
        ugh. Doesnt work for non-horizontal curves.
-       */
+      */
       Real y = b.curve_point (horizontal[0])[Y_AXIS];
 
-      Real ry = rint (y/staff_space) * staff_space;
+      Real ry = rint (y / staff_space) * staff_space;
       Real diff = ry - y;
       Real newy = y;
 
       Real clear = staff_space * scm_to_double (me->get_property ("staffline-clearance"));
 
-      if (fabs (y) <=
-         Staff_symbol_referencer::staff_radius (me) * staff_space + clear
+      if (fabs (y)
+         <= Staff_symbol_referencer::staff_radius (me) * staff_space + clear
          && fabs (diff) < clear)
        {
          Real y1 = ry + clear;
@@ -295,47 +283,44 @@ Tie::get_control_points (SCM smob)
            Any way. This test is to make sure that staffline
            collision avoidance does not result in completely flat
            ties.
-          */
+         */
          if (fabs (y1 - ypos) < 0.5)
            y1 = y2;
          else if (fabs (y2 - ypos) < 0.5)
            y2 = y1;
-         
+
          newy = (fabs (y1 - y) < fabs (y2 - y)) ? y1 : y2;
-         
+
          // newy = ry - 0.5 * staff_space * sign (diff) ;
 
          /*
            we don't want horizontal ties
-          */
+         */
          if (fabs (newy - b.control_[0][Y_AXIS]) < 1e-2)
            {
-             newy = newy + dir * staff_space; 
+             newy = newy + dir * staff_space;
            }
        }
 
       Real y0 = b.control_ [0][Y_AXIS];
-      b.control_[2][Y_AXIS] = 
-      b.control_[1][Y_AXIS] =
- (b.control_[1][Y_AXIS] - y0)  * ((newy - y0) / (y - y0)) + y0; 
+      b.control_[2][Y_AXIS]
+       = b.control_[1][Y_AXIS]
+       = (b.control_[1][Y_AXIS] - y0) * ((newy - y0) / (y - y0)) + y0;
     }
   else
     programming_error ("Tie is nowhere horizontal");
 
-
-
   SCM controls = SCM_EOL;
   for (int i = 4; i--;)
     controls = scm_cons (ly_offset2scm (b.control_[i]), controls);
   return controls;
 }
 
-
 MAKE_SCHEME_CALLBACK (Tie, print, 1);
 SCM
-Tie::print (SCM smob) 
+Tie::print (SCM smob)
 {
-  Grob*me = unsmob_grob (smob);
+  Grob *me = unsmob_grob (smob);
 
   SCM cp = me->get_property ("control-points");
   if (!scm_is_pair (cp))               // list is more accurate
@@ -346,10 +331,10 @@ Tie::print (SCM smob)
 
   if (!scm_is_pair (cp))
     return Stencil ().smobbed_copy ();
-  
+
   Real thick
     = Staff_symbol_referencer::line_thickness (me)
-    *  robust_scm2double (me->get_property ("thickness"), 1);
+    * robust_scm2double (me->get_property ("thickness"), 1);
 
   Bezier b;
   int i = 0;
@@ -358,15 +343,12 @@ Tie::print (SCM smob)
       b.control_[i] = ly_scm2offset (scm_car (s));
       i++;
     }
-  
-   Stencil a = Lookup::slur (b, get_grob_direction (me) * thick, thick);
-   
-   return a.smobbed_copy ();
-}
 
+  Stencil a = Lookup::slur (b, get_grob_direction (me) * thick, thick);
 
+  return a.smobbed_copy ();
+}
 
 ADD_INTERFACE (Tie, "tie-interface",
-              "A tie connecting two noteheads.\n"
-              ,
-  "y-offset staffline-clearance control-points head-pair details thickness x-gap direction minimum-length");
+              "A tie connecting two noteheads.\n",
+              "y-offset staffline-clearance control-points head-pair details thickness x-gap direction minimum-length");
index 77581af8e979de94403d862d3db42baec418a7bc..06a4f7ab1bec75d73209cdfe017847e12a5ca0c5 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   time-scaled-music-iterator.cc -- implement Time_scaled_music_iterator
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "time-scaled-music-iterator.hh"
 #include "context.hh"
@@ -25,5 +24,5 @@ Time_scaled_music_iterator::process (Moment m)
 
   Music_wrapper_iterator::process (m);
 }
+
 IMPLEMENT_CTOR_CALLBACK (Time_scaled_music_iterator);
index e217fd900378309cab19e337cba3c17a3533eab4..5dc4913a80de7d10b1b1e176369d3a96aa5f8490 100644 (file)
@@ -12,8 +12,8 @@
 #include "misc.hh"
 
 /**
-  generate time_signatures. 
-  */
+   generate time_signatures.
+*/
 class Time_signature_engraver : public Engraver
 {
   Item *time_signature_;
@@ -26,9 +26,8 @@ public:
   TRANSLATOR_DECLARATIONS (Time_signature_engraver);
 };
 
-
 Time_signature_engraver::Time_signature_engraver ()
-{ 
+{
   time_signature_ = 0;
   last_time_fraction_ = SCM_BOOL_F;
 }
@@ -51,15 +50,13 @@ Time_signature_engraver::process_music ()
            Todo: should make typecheck?
 
            OTOH, Tristan Keuris writes 8/20 in his Intermezzi.
-          */
+         */
          warning (_f ("Found strange time signature %d/%d.",
-                     den,
-                     scm_to_int (scm_car (fr))
-                     ));
+                      den,
+                      scm_to_int (scm_car (fr))));
        }
-  
-      
-      last_time_fraction_ = fr; 
+
+      last_time_fraction_ = fr;
       time_signature_ = make_item ("TimeSignature", SCM_EOL);
       time_signature_->set_property ("fraction", fr);
     }
@@ -70,12 +67,11 @@ Time_signature_engraver::stop_translation_timestep ()
 {
   time_signature_ = 0;
 }
 
 ADD_TRANSLATOR (Time_signature_engraver,
-/* descr */       "Create a TimeSignature whenever @code{timeSignatureFraction} changes",
-/* creats*/       "TimeSignature",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create a TimeSignature whenever @code{timeSignatureFraction} changes",
+               /* creats*/ "TimeSignature",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");
index 3b499d5ddd87c875b74bf6da684507ae7149a15c..4b9aad5e483540773674d713b9579fe0b55f74f8 100644 (file)
@@ -23,10 +23,9 @@ protected:
   SCM prev_fraction_;
 private:
 
-  Audio_time_signatureaudio_;
+  Audio_time_signature *audio_;
 };
 
-
 Time_signature_performer::Time_signature_performer ()
 {
   prev_fraction_ = SCM_BOOL_F;
@@ -37,7 +36,6 @@ Time_signature_performer::~Time_signature_performer ()
 {
 }
 
-
 void
 Time_signature_performer::create_audio_elements ()
 {
@@ -47,7 +45,7 @@ Time_signature_performer::create_audio_elements ()
       prev_fraction_ = fr;
       int b = scm_to_int (scm_car (fr));
       int o = scm_to_int (scm_cdr (fr));
-      
+
       audio_ = new Audio_time_signature (b, o);
       Audio_element_info info (audio_, 0);
       announce_element (info);
index 93717f10e2229c115f444278000a0723311bcff9..d560b8d226ccd426fde05f2b1ad9889d9c6a94ee 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   time-signature.cc -- implement Time_signature
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "time-signature.hh"
 
 
   this file should go ; The formatting can completely be done with
   markups.
-  
- */
+*/
 
 MAKE_SCHEME_CALLBACK (Time_signature, print, 1);
 SCM
-Time_signature::print (SCM smob) 
+Time_signature::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   SCM st = me->get_property ("style");
@@ -47,7 +45,7 @@ Time_signature::print (SCM smob)
     m = numbered_time_signature (me, n, d);
 
   if (Staff_symbol_referencer::line_count (me) % 2 == 0)
-    m.translate_axis (Staff_symbol_referencer::staff_space (me) / 2 , Y_AXIS);
+    m.translate_axis (Staff_symbol_referencer::staff_space (me) / 2, Y_AXIS);
 
   return m.smobbed_copy ();
 }
@@ -66,8 +64,8 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
   if (style == "C")
     {
       if /* neither C2/2 nor C4/4 */
-       (((n != 2) || (d != 2)) && 
-        ((n != 4) || (d != 4)))
+       (((n != 2) || (d != 2))
+        && ((n != 4) || (d != 4)))
        {
          return numbered_time_signature (me, n, d);
        }
@@ -81,28 +79,28 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
     return out;
 
   /* If there is no such symbol, we default to the numbered style.
-    (Here really with a warning!) */
+     (Here really with a warning!) */
   me->warning (_f ("time signature symbol `%s' not found; "
                   "reverting to numbered style", char_name));
   return numbered_time_signature (me, n, d);
 }
 
 Stencil
-Time_signature::numbered_time_signature (Grob*me, int num, int den)
+Time_signature::numbered_time_signature (Grob *me, int num, int den)
 {
   SCM chain = me->get_property_alist_chain (Font_interface::text_font_alist_chain (me));
   chain = scm_cons (scm_list_1 (scm_cons (ly_symbol2scm ("font-encoding"),
-                                        ly_symbol2scm ("fetaNumber"))),
+                                         ly_symbol2scm ("fetaNumber"))),
                    chain);
-                               
+
   SCM sn = Text_interface::interpret_markup (me->get_layout ()->self_scm (), chain,
-                                       scm_makfrom0str (to_string (num).to_str0 ()));
+                                            scm_makfrom0str (to_string (num).to_str0 ()));
   SCM sd = Text_interface::interpret_markup (me->get_layout ()->self_scm (), chain,
-                                       scm_makfrom0str (to_string (den).to_str0 ()));
+                                            scm_makfrom0str (to_string (den).to_str0 ()));
 
   Stencil n = *unsmob_stencil (sn);
   Stencil d = *unsmob_stencil (sd);
-                             
+
   n.align_to (X_AXIS, CENTER);
   d.align_to (X_AXIS, CENTER);
   Stencil m;
@@ -118,33 +116,33 @@ Time_signature::numbered_time_signature (Grob*me, int num, int den)
     }
 
   m.align_to (X_AXIS, LEFT);
-  
+
   return m;
 }
 
 ADD_INTERFACE (Time_signature, "time-signature-interface",
-  "A time signature, in different styles.\n"
-"  The following values for 'style are are recognized:\n"
-"\n"
-"    @table @samp\n"
-"      @item @code{C}\n"
-"        4/4 and 2/2 are typeset as C and struck C, respectively.  All\n"
-"        other time signatures are written with two digits.\n"
-"\n"
-"      @item @code{neomensural}\n"
-"        2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are\n"
-"        typeset with neo-mensural style mensuration marks.  All other time\n"
-"        signatures are written with two digits.\n"
-"\n"
-"      @item @code{mensural}\n"
-"        2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are\n"
-"        typeset with mensural style mensuration marks.  All other time\n"
-"        signatures are written with two digits.\n"
-"\n"
-"      @item @code{single-digit}\n"
-"        All time signatures are typeset with a single\n"
-"        digit, e.g. 3/2 is written as 3.\n"
-"    @end table\n"
-"\n"
-"See also the test-file @file{input/test/time.ly}.\n",
-  "fraction style");
+              "A time signature, in different styles.\n"
+              "  The following values for 'style are are recognized:\n"
+              "\n"
+              "    @table @samp\n"
+              "      @item @code{C}\n"
+              "        4/4 and 2/2 are typeset as C and struck C, respectively.  All\n"
+              "        other time signatures are written with two digits.\n"
+              "\n"
+              "      @item @code{neomensural}\n"
+              "        2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are\n"
+              "        typeset with neo-mensural style mensuration marks.  All other time\n"
+              "        signatures are written with two digits.\n"
+              "\n"
+              "      @item @code{mensural}\n"
+              "        2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are\n"
+              "        typeset with mensural style mensuration marks.  All other time\n"
+              "        signatures are written with two digits.\n"
+              "\n"
+              "      @item @code{single-digit}\n"
+              "        All time signatures are typeset with a single\n"
+              "        digit, e.g. 3/2 is written as 3.\n"
+              "    @end table\n"
+              "\n"
+              "See also the test-file @file{input/test/time.ly}.\n",
+              "fraction style");
index 0e2fb868dc3c70a61454b485d3298a96b45b75db..7660ba9a3e5166775b1456a1193ee6ee6b46d8ce 100644 (file)
 #include "grob.hh"
 
 /**
-  Do time bookkeeping
- */
+   Do time bookkeeping
+*/
 class Timing_engraver : public Timing_translator, public Engraver
 {
 protected:
   /* Needed to know whether we're advancing in grace notes, or not. */
   Moment last_moment_;
-  
+
   virtual void start_translation_timestep ();
   virtual void initialize ();
-  virtual void process_music();
+  virtual void process_music ();
   virtual void stop_translation_timestep ();
 
 public:
   TRANSLATOR_DECLARATIONS (Timing_engraver);
 };
 
-
 Timing_engraver::Timing_engraver ()
 {
   last_moment_.main_part_ = Rational (-1);
 }
 
-
 void
 Timing_engraver::initialize ()
 {
   Timing_translator::initialize ();
-  
+
   SCM which = get_property ("whichBar");
   Moment now = now_mom ();
-  
+
   /* Set the first bar of the score? */
   if (!scm_is_string (which))
     which = (now.main_part_ || now.main_part_ == last_moment_.main_part_)
@@ -54,25 +52,24 @@ Timing_engraver::initialize ()
 }
 
 void
-Timing_engraver::process_music()
+Timing_engraver::process_music ()
 {
   Timing_translator::process_music ();
 
-  bool start_of_measure = (last_moment_.main_part_ != now_mom().main_part_
+  bool start_of_measure = (last_moment_.main_part_ != now_mom ().main_part_
                           && !measure_position ().main_part_);
 
   /*
     We can't do this in start_translation_timestep(), since time sig
     changes won't have happened by then.
-   */
+  */
   if (start_of_measure)
     {
       Moment mlen = Moment (measure_length ());
       unsmob_grob (get_property ("currentCommandColumn"))
-       ->set_property ("measure-length", mlen.smobbed_copy ()); 
+       ->set_property ("measure-length", mlen.smobbed_copy ());
     }
 }
-  
 
 void
 Timing_engraver::start_translation_timestep ()
@@ -95,7 +92,7 @@ Timing_engraver::start_translation_timestep ()
     {
       SCM always = get_property ("barAlways");
 
-      if ( start_of_measure || (to_boolean (always)))
+      if (start_of_measure || (to_boolean (always)))
        {
          /* should this work, or be junked?  See input/bugs/no-bars.ly */
          which = get_property ("defaultBarType");
@@ -113,17 +110,14 @@ Timing_engraver::stop_translation_timestep ()
   last_moment_ = now_mom ();
 }
 
-
 ADD_TRANSLATOR (Timing_engraver,
-/* descr */       " Responsible for synchronizing timing information from staves.  "
-"Normally in @code{Score}.  In order to create polyrhythmic music, "
-"this engraver should be removed from @code{Score} and placed in "
-"@code{Staff}. "
-"\n\nThis engraver adds the alias @code{Timing} to its containing context."
-
-                  ,
-/* creats*/       "",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "automaticBars whichBar barAlways defaultBarType skipBars timing measureLength measurePosition currentBarNumber",
-/* write */       "");
+               /* descr */ " Responsible for synchronizing timing information from staves.  "
+               "Normally in @code{Score}.  In order to create polyrhythmic music, "
+               "this engraver should be removed from @code{Score} and placed in "
+               "@code{Staff}. "
+               "\n\nThis engraver adds the alias @code{Timing} to its containing context.",
+               /* creats*/ "",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "automaticBars whichBar barAlways defaultBarType skipBars timing measureLength measurePosition currentBarNumber",
+               /* write */ "");
index 16c7b6d2bb56f10f697398bc6b70cea18a889873..7edc7ec4fd918993c20e11912e2a10fb74c84aec 100644 (file)
@@ -35,7 +35,7 @@ Timing_translator::stop_translation_timestep ()
          /*
            Hmm. We insert the bar moment every time we process a
            moment.  A waste of cpu?
-          */
+         */
          && !now.grace_part_)
        global->add_moment_to_process (now + barleft);
     }
@@ -46,18 +46,18 @@ Timing_translator::initialize ()
 {
 
   /*
-    move this to engraver-init.ly? 
-   */
+    move this to engraver-init.ly?
+  */
   context ()->add_alias (ly_symbol2scm ("Timing"));
-  context ()->set_property ("timing" , SCM_BOOL_T);  
-  context ()->set_property ("currentBarNumber" , scm_int2num (1));
+  context ()->set_property ("timing", SCM_BOOL_T);
+  context ()->set_property ("currentBarNumber", scm_int2num (1));
 
   context ()->set_property ("timeSignatureFraction",
-                               scm_cons (scm_int2num (4), scm_int2num (4)));
+                           scm_cons (scm_int2num (4), scm_int2num (4)));
   /*
     Do not init measurePosition; this should be done from global
     context.
-   */
+  */
   context ()->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
   context ()->set_property ("beatLength", Moment (Rational (1, 4)).smobbed_copy ());
 }
@@ -81,15 +81,15 @@ Moment
 Timing_translator::measure_position () const
 {
   SCM sm = get_property ("measurePosition");
-  
-  Moment m   = 0;
+
+  Moment m = 0;
   if (unsmob_moment (sm))
     {
       m = *unsmob_moment (sm);
       while (m.main_part_ < Rational (0))
        m.main_part_ += measure_length ();
     }
-  
+
   return m;
 }
 
@@ -99,7 +99,7 @@ Timing_translator::start_translation_timestep ()
   Global_context *global = get_global_context ();
 
   Moment now = global->now_mom ();
-  Moment dt = now  - global->previous_moment ();
+  Moment dt = now - global->previous_moment ();
   if (dt < Moment (0))
     {
       programming_error ("Moving backwards in time");
@@ -110,7 +110,7 @@ Timing_translator::start_translation_timestep ()
       programming_error ("Moving infinitely to future");
       dt = 0;
     }
-  
+
   if (!dt.to_bool ())
     return;
 
@@ -127,9 +127,9 @@ Timing_translator::start_translation_timestep ()
       context ()->set_property ("measurePosition",
                                measposp.smobbed_copy ());
     }
-  
+
   measposp += dt;
-  
+
   SCM barn = get_property ("currentBarNumber");
   int b = 0;
   if (scm_is_number (barn))
@@ -144,7 +144,7 @@ Timing_translator::start_translation_timestep ()
   while (c && measposp.main_part_ >= len)
     {
       measposp.main_part_ -= len;
-      b ++;
+      b++;
     }
 
   context ()->set_property ("currentBarNumber", scm_int2num (b));
@@ -152,8 +152,7 @@ Timing_translator::start_translation_timestep ()
 }
 
 ADD_TRANSLATOR (Timing_translator,
-                  "This engraver adds the alias "
-                  "@code{Timing} to its containing context."
-                  ,
+               "This engraver adds the alias "
+               "@code{Timing} to its containing context.",
 
-                  "", "", "", "", "");
+               "", "", "", "", "");
index c580060457bff77e07b6d4251fa3fb31089e352f..7f9f41bce7b0b3472dd2eaf1cbd39100df313b12 100644 (file)
 
 Scheme_hash_table *global_translator_dict = 0;
 
-LY_DEFINE (get_all_translators, "ly:get-all-translators", 0, 0, 0,  (),
-         "Return a list of all translator objects that may be instantiated. "
-          )
+LY_DEFINE (get_all_translators, "ly:get-all-translators", 0, 0, 0, (),
+          "Return a list of all translator objects that may be instantiated. ")
 {
-  SCM l = global_translator_dict ?  global_translator_dict->to_alist () : SCM_EOL;
+  SCM l = global_translator_dict ? global_translator_dict->to_alist () : SCM_EOL;
 
   for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
@@ -36,13 +35,13 @@ add_translator (Translator *t)
   if (!global_translator_dict)
     global_translator_dict = new Scheme_hash_table;
 
-  SCM k = ly_symbol2scm  (classname (t));
+  SCM k = ly_symbol2scm (classname (t));
   global_translator_dict->set (k, t->self_scm ());
 
   scm_gc_unprotect_object (t->self_scm ());
 }
 
-Translator*
+Translator *
 get_translator (SCM sym)
 {
   SCM v = SCM_BOOL_F;
index f5183e460652b0422129a89b7d40aab7efb0e490..081cd8611359d2f894f31b1beee27a18b37b834d 100644 (file)
 #include "main.hh"
 #include "music.hh"
 
-Translator_group*
+Translator_group *
 Translator_group::get_daddy_translator () const
 {
   return context ()->get_parent_context ()->implementation ();
 }
 
-
 void
 translator_each (SCM list, Translator_method method)
 {
@@ -30,7 +29,6 @@ translator_each (SCM list, Translator_method method)
     (unsmob_translator (scm_car (p))->*method) ();
 }
 
-
 void
 Translator_group::initialize ()
 {
@@ -38,9 +36,8 @@ Translator_group::initialize ()
   context ()->set_property ("acceptHashTable", tab);
 }
 
-
 bool
-translator_accepts_any_of (Translator*tr, SCM ifaces)
+translator_accepts_any_of (Translator *tr, SCM ifaces)
 {
   SCM ack_ifs = scm_assoc (ly_symbol2scm ("events-accepted"),
                           tr->translator_description ());
@@ -55,11 +52,11 @@ SCM
 find_accept_translators (SCM gravlist, SCM ifaces)
 {
   SCM l = SCM_EOL;
-  for (SCM s = gravlist; scm_is_pair (s);  s = scm_cdr (s))
+  for (SCM s = gravlist; scm_is_pair (s); s = scm_cdr (s))
     {
-      Translatortr = unsmob_translator (scm_car (s));
+      Translator *tr = unsmob_translator (scm_car (s));
       if (translator_accepts_any_of (tr, ifaces))
-       l = scm_cons (tr->self_scm (), l); 
+       l = scm_cons (tr->self_scm (), l);
     }
   l = scm_reverse_x (l, SCM_EOL);
 
@@ -67,7 +64,7 @@ find_accept_translators (SCM gravlist, SCM ifaces)
 }
 
 bool
-Translator_group::try_music (Musicm)
+Translator_group::try_music (Music *m)
 {
   SCM tab = get_property ("acceptHashTable");
   SCM name = scm_sloppy_assq (ly_symbol2scm ("name"),
@@ -87,30 +84,28 @@ Translator_group::try_music (Music* m)
 
   for (SCM p = accept_list; scm_is_pair (p); p = scm_cdr (p))
     {
-      Translator * t = unsmob_translator (scm_car (p));
+      Translator *t = unsmob_translator (scm_car (p));
       if (t && t->try_music (m))
        return true;
     }
   return false;
 }
 
-
 SCM
 Translator_group::get_simple_trans_list ()
 {
   return simple_trans_list_;
 }
 
-
 void
-recurse_over_translators (Context * c, Translator_method ptr, Direction dir)
+recurse_over_translators (Context *c, Translator_method ptr, Direction dir)
 {
-  Translator_group * tg
-    = dynamic_cast<Translator_group*> (c->implementation ());
+  Translator_group *tg
+    = dynamic_cast<Translator_group *> (c->implementation ());
 
   /*
-    Top down: 
-   */
+    Top down:
+  */
   if (dir == DOWN)
     {
       translator_each (tg->get_simple_trans_list (),
@@ -134,7 +129,7 @@ recurse_over_translators (Context * c, Translator_method ptr, Direction dir)
     }
 }
 
-Translator_group::Translator_group()
+Translator_group::Translator_group ()
 {
   simple_trans_list_ = SCM_EOL;
 }
@@ -142,5 +137,5 @@ Translator_group::Translator_group()
 void
 Translator_group::derived_mark () const
 {
-  scm_gc_mark (simple_trans_list_); 
+  scm_gc_mark (simple_trans_list_);
 }
index 27da857289d9619338cc4a04144461148f9c3543..cec56a0a76b992c4b54826c7ea0e8c6296e9cd42 100644 (file)
@@ -4,15 +4,14 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+*/
 
 #include "context-def.hh"
 #include "translator-group.hh"
 
 LY_DEFINE (ly_translator_name, "ly:translator-name",
           1, 0, 0, (SCM trans),
-         "Return the type name of the translator object @var{trans}. "
+          "Return the type name of the translator object @var{trans}. "
           "The name is a symbol.")
 {
   Translator *tr = unsmob_translator (trans);
@@ -22,8 +21,8 @@ LY_DEFINE (ly_translator_name, "ly:translator-name",
 }
 
 LY_DEFINE (ly_translator_description, "ly:translator-description",
-         1, 0, 0, (SCM me),
-         "Return an alist of properties of  translator @var{me}.")
+          1, 0, 0, (SCM me),
+          "Return an alist of properties of  translator @var{me}.")
 {
   Translator *tr = unsmob_translator (me);
   SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
@@ -33,7 +32,7 @@ LY_DEFINE (ly_translator_description, "ly:translator-description",
 int
 Translator::print_smob (SCM s, SCM port, scm_print_state *)
 {
-  Translator *me = (Translator*) SCM_CELL_WORD_1 (s);
+  Translator *me = (Translator *) SCM_CELL_WORD_1 (s);
   scm_puts ("#<Translator ", port);
   scm_puts (classname (me), port);
   scm_puts (" >", port);
index af72ca083a723697ec0d3820b2e51533862f10ea..9f192103b95167c1f00b0a7337cd301fbf644292 100644 (file)
@@ -36,7 +36,7 @@ Translator::do_announces ()
 void
 Translator::process_music ()
 {
-  
+
 }
 
 Translator::Translator ()
@@ -55,7 +55,6 @@ Translator::try_music (Music *)
 {
   return false;
 }
-                           
 
 Moment
 Translator::now_mom () const
@@ -69,14 +68,12 @@ Translator::get_output_def () const
   return daddy_context_->get_output_def ();
 }
 
-
-Translator_group*
+Translator_group *
 Translator::get_daddy_translator () const
 {
   return daddy_context_->implementation ();
 }
 
-
 SCM
 Translator::internal_get_property (SCM sym) const
 {
@@ -95,8 +92,7 @@ Translator::stop_translation_timestep ()
 
   - It is called before any user information enters the translators.
   (i.e. any \property or event is not processed yet.)
-
-  */
+*/
 void
 Translator::start_translation_timestep ()
 {
@@ -112,16 +108,13 @@ Translator::finalize ()
 {
 }
 
-
 /*
-
   SMOBS
-
 */
 SCM
 Translator::mark_smob (SCM sm)
 {
-  Translator * me = (Translator*) SCM_CELL_WORD_1 (sm);
+  Translator *me = (Translator *) SCM_CELL_WORD_1 (sm);
   me->derived_mark ();
   return SCM_EOL;
 }
@@ -132,20 +125,17 @@ Translator::translator_description () const
   return SCM_EOL;
 }
 
-
 Global_context *
 Translator::get_global_context () const
 {
   return daddy_context_ ->get_global_context ();
 }
 
-
 Score_context *
 Translator::get_score_context () const
 {
   return daddy_context_->get_score_context ();
-}  
-
+}
 
 SCM
 Translator::static_translator_description ()const
@@ -153,7 +143,6 @@ Translator::static_translator_description ()const
   return SCM_EOL;
 }
 
-
 IMPLEMENT_SMOBS (Translator);
 IMPLEMENT_DEFAULT_EQUAL_P (Translator);
 IMPLEMENT_TYPE_P (Translator, "ly:translator?");
@@ -167,5 +156,5 @@ Translator::must_be_last () const
 void
 Translator::derived_mark () const
 {
-  
+
 }
index c64d87c9e45e5ac35bc1f9836c925c46c3ff7fcb..fd93042b283c42f4c7a812877c1bc04ff1648623 100644 (file)
@@ -10,9 +10,8 @@
   C&P from text-spanner.cc
 
   - todo: ending should be detected automatically? a new note
-    automatically is the end of the trill?
-  
- */
+  automatically is the end of the trill?
+*/
 
 #include "note-column.hh"
 #include "side-position-interface.hh"
@@ -21,7 +20,7 @@
 class Trill_spanner_engraver : public Engraver
 {
 public:
-  TRANSLATOR_DECLARATIONS (Trill_spanner_engraver);  
+  TRANSLATOR_DECLARATIONS (Trill_spanner_engraver);
 protected:
   virtual void finalize ();
   virtual void acknowledge_grob (Grob_info);
@@ -33,11 +32,10 @@ private:
   Spanner *span_;
   Spanner *finished_;
   Music *current_req_;
-  Drul_array<Music*> req_drul_;
+  Drul_array<Music *> req_drul_;
   void typeset_all ();
 };
 
-
 Trill_spanner_engraver::Trill_spanner_engraver ()
 {
   finished_ = 0;
@@ -86,7 +84,7 @@ Trill_spanner_engraver::process_music ()
       else
        {
          current_req_ = req_drul_[START];
-         span_  = make_spanner ("TrillSpanner", req_drul_[START]->self_scm ());
+         span_ = make_spanner ("TrillSpanner", req_drul_[START]->self_scm ());
          Side_position_interface::set_axis (span_, Y_AXIS);
          req_drul_[START] = 0;
        }
@@ -96,25 +94,25 @@ Trill_spanner_engraver::process_music ()
 void
 Trill_spanner_engraver::acknowledge_grob (Grob_info info)
 {
-  Spanner * spans[2] ={span_, finished_};
-  for (int i = 0;  i < 2 ; i++)
+  Spanner *spans[2] ={span_, finished_};
+  for (int i = 0; i < 2; i++)
     {
       if (spans[i] && Note_column::has_interface (info.grob_))
        {
          Side_position_interface::add_support (spans[i], info.grob_);
-         add_bound_item (spans[i], dynamic_cast<Item*> (info.grob_));
+         add_bound_item (spans[i], dynamic_cast<Item *> (info.grob_));
        }
     }
 }
 
 void
 Trill_spanner_engraver::typeset_all ()
-{  
+{
   if (finished_)
     {
       if (!finished_->get_bound (RIGHT))
        {
-         Grobe = unsmob_grob (get_property ("currentMusicalColumn"));
+         Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
          finished_->set_bound (RIGHT, e);
        }
       finished_ = 0;
@@ -126,7 +124,7 @@ Trill_spanner_engraver::stop_translation_timestep ()
 {
   if (span_ && !span_->get_bound (LEFT))
     {
-      Grobe = unsmob_grob (get_property ("currentMusicalColumn"));
+      Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
       span_->set_bound (LEFT, e);
     }
 
@@ -148,9 +146,9 @@ Trill_spanner_engraver::finalize ()
 }
 
 ADD_TRANSLATOR (Trill_spanner_engraver,
-/* descr */       "Create trill spanner from a Music.",
-/* creats*/       "TrillSpanner",
-/* accepts */     "trill-span-event",
-/* acks  */      "note-column-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Create trill spanner from a Music.",
+               /* creats*/ "TrillSpanner",
+               /* accepts */ "trill-span-event",
+               /* acks  */ "note-column-interface",
+               /* reads */ "",
+               /* write */ "");
index 2db6fca93fd8db07203507fbb0cec142ea288a51..dc1f4a3c206bccd0a83b60943af994da06a6fd32 100644 (file)
   - There is no support for kneed brackets, or nested brackets.
 
   - number placement for parallel beams should be much more advanced:
-    for sloped beams some extra horizontal offset must be introduced.
+  for sloped beams some extra horizontal offset must be introduced.
 
   - number placement is usually done over the center note, not the
-    graphical center.
-  
- */
+  graphical center.
+*/
 
 /*
-
-    TODO: quantise, we don't want to collide with staff lines.
- (or should we be above staff?)
+  TODO: quantise, we don't want to collide with staff lines.
+  (or should we be above staff?)
 
   todo: handle breaking elegantly.
 */
@@ -48,7 +46,7 @@
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
 
-static Grob*
+static Grob *
 get_x_bound_grob (Grob *g, Direction my_dir)
 {
   if (Note_column::get_stem (g)
@@ -59,25 +57,23 @@ get_x_bound_grob (Grob *g, Direction my_dir)
   return g;
 }
 
-
-
-Grob*
+Grob *
 Tuplet_bracket::parallel_beam (Grob *me, Link_array<Grob> const &cols, bool *equally_long)
 {
   /*
-    ugh: code dup. 
+    ugh: code dup.
   */
-  Grob *s1 = Note_column::get_stem (cols[0]); 
-  Grob *s2 = Note_column::get_stem (cols.top ());    
+  Grob *s1 = Note_column::get_stem (cols[0]);
+  Grob *s2 = Note_column::get_stem (cols.top ());
+
+  Grob *b1 = s1 ? Stem::get_beam (s1) : 0;
+  Grob *b2 = s2 ? Stem::get_beam (s2) : 0;
 
-  Grob*b1 = s1 ? Stem::get_beam (s1) : 0;
-  Grob*b2 = s2 ? Stem::get_beam (s2) : 0;
-  
-  Spanner*sp = dynamic_cast<Spanner*> (me);  
+  Spanner *sp = dynamic_cast<Spanner *> (me);
 
   *equally_long = false;
   if (! (b1 && (b1 == b2) && !sp->is_broken ()))
-      return 0;
+    return 0;
 
   Link_array<Grob> beam_stems = extract_grob_array (b1, ly_symbol2scm ("stems"));
   if (beam_stems.size () == 0)
@@ -86,53 +82,51 @@ Tuplet_bracket::parallel_beam (Grob *me, Link_array<Grob> const &cols, bool *equ
       *equally_long = 0;
       return 0;
     }
-  
+
   *equally_long = (beam_stems[0] == s1 && beam_stems.top () == s2);
   return b1;
 }
 
-
 /*
   TODO:
 
   in the case that there is no bracket, but there is a (single) beam,
   follow beam precisely for determining tuplet number location.
-  
- */
+*/
 MAKE_SCHEME_CALLBACK (Tuplet_bracket, print, 1);
 SCM
-Tuplet_bracket::print (SCM smob) 
+Tuplet_bracket::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Stencil  mol;
-  Link_array<Grob> columns =
-    extract_grob_array (me, ly_symbol2scm ("note-columns"));
+  Stencil mol;
+  Link_array<Grob> columns
+    extract_grob_array (me, ly_symbol2scm ("note-columns"));
 
   if (!columns.size ())
     return mol.smobbed_copy ();
 
   {
     SCM lp = me->get_property ("left-position");
-    SCM rp = me->get_property ("right-position");  
+    SCM rp = me->get_property ("right-position");
 
     if (!scm_is_number (rp) || !scm_is_number (lp))
       after_line_breaking (smob);
   }
-  
+
   Real ly = robust_scm2double (me->get_property ("left-position"), 0);
-  Real ry = robust_scm2double (me->get_property ("right-position"), 0);  
-  
+  Real ry = robust_scm2double (me->get_property ("right-position"), 0);
+
   bool equally_long = false;
-  Grob * par_beam = parallel_beam (me, columns, &equally_long);
+  Grob *par_beam = parallel_beam (me, columns, &equally_long);
 
-  Spanner*sp = dynamic_cast<Spanner*> (me);  
+  Spanner *sp = dynamic_cast<Spanner *> (me);
 
   bool bracket_visibility = !(par_beam && equally_long);
   bool number_visibility = true;
 
   /*
     Fixme: the type of this prop is sucky.
-   */
+  */
   SCM bracket = me->get_property ("bracket-visibility");
   if (scm_is_bool (bracket))
     {
@@ -141,101 +135,101 @@ Tuplet_bracket::print (SCM smob)
   else if (bracket == ly_symbol2scm ("if-no-beam"))
     bracket_visibility = !par_beam;
 
-  SCM numb = me->get_property ("number-visibility");  
+  SCM numb = me->get_property ("number-visibility");
   if (scm_is_bool (numb))
     {
       number_visibility = ly_scm2bool (numb);
     }
   else if (numb == ly_symbol2scm ("if-no-beam"))
     number_visibility = !par_beam;
-       
-  Grob * commonx = columns[0]->common_refpoint (columns.top (), X_AXIS);
+
+  Grob *commonx = columns[0]->common_refpoint (columns.top (), X_AXIS);
 
   /*
     Tuplet brackets are normally not broken, but we shouldn't crash if
     they are.
-   */
+  */
   commonx = commonx->common_refpoint (sp->get_bound (LEFT), X_AXIS);
-  commonx = commonx->common_refpoint (sp->get_bound (RIGHT), X_AXIS);  
-  
+  commonx = commonx->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
+
   Direction dir = get_grob_direction (me);
 
-  Grob * lgr = get_x_bound_grob (columns[0], dir);
-  Grob * rgr = get_x_bound_grob (columns.top (), dir);
-  
+  Grob *lgr = get_x_bound_grob (columns[0], dir);
+  Grob *rgr = get_x_bound_grob (columns.top (), dir);
+
   Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT];
   Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
   Real w = x1 -x0;
-  
+
   SCM number = me->get_property ("text");
 
   Output_def *pap = me->get_layout ();
   Stencil num;
- if (scm_is_string (number) && number_visibility)
 if (scm_is_string (number) && number_visibility)
     {
       SCM properties = Font_interface::text_font_alist_chain (me);
       SCM snum = Text_interface::interpret_markup (pap->self_scm (), properties, number);
       num = *unsmob_stencil (snum);
       num.align_to (X_AXIS, CENTER);
-      num.translate_axis (w/2, X_AXIS);
+      num.translate_axis (w / 2, X_AXIS);
       num.align_to (Y_AXIS, CENTER);
-       
-      num.translate_axis ((ry-ly)/2, Y_AXIS);
+
+      num.translate_axis ((ry - ly) / 2, Y_AXIS);
 
       mol.add_stencil (num);
     }
 
-
   /*
     No bracket when it would be smaller than the number.
 
     TODO: should use GAP in calculation too.
-   */
+  */
   if (bracket_visibility && number_visibility
       && mol.extent (X_AXIS).length () > w)
     {
       bracket_visibility = false;
     }
-  
-  if (bracket_visibility)      
+
+  if (bracket_visibility)
     {
-      Real ss =   Staff_symbol_referencer::staff_space (me);
+      Real ss = Staff_symbol_referencer::staff_space (me);
       Real gap = 0.;
 
       if (!num.extent (X_AXIS).is_empty ())
        gap = num.extent (X_AXIS).length () + 1.0;
-      
+
       SCM fl = me->get_property ("bracket-flare");
       SCM eh = me->get_property ("edge-height");
       SCM sp = me->get_property ("shorten-pair");
-      
+
       Direction d = LEFT;
       Drul_array<Real> height, flare, shorten;
-      do {
-       flare[d] =  height[d] = shorten[d] = 0.0;
-       if (is_number_pair (fl))
-         flare[d] +=  ss * scm_to_double (index_get_cell (fl, d));
-       if (is_number_pair (eh))
-         height[d] +=  - dir * ss *scm_to_double (index_get_cell (eh, d));
-       if (is_number_pair (sp))
-         shorten[d] +=  ss *scm_to_double (index_get_cell (sp, d));
-      }
+      do
+       {
+         flare[d] = height[d] = shorten[d] = 0.0;
+         if (is_number_pair (fl))
+           flare[d] += ss * scm_to_double (index_get_cell (fl, d));
+         if (is_number_pair (eh))
+           height[d] += -dir * ss *scm_to_double (index_get_cell (eh, d));
+         if (is_number_pair (sp))
+           shorten[d] += ss *scm_to_double (index_get_cell (sp, d));
+       }
       while (flip (&d) != LEFT);
-      
+
       Stencil brack = make_bracket (me, Y_AXIS,
-                                    Offset (w, ry - ly), 
-                                    height,
+                                   Offset (w, ry - ly),
+                                   height,
                                    /*
                                      0.1 = more space at right due to italics
                                      TODO: use italic correction of font.
-                                    */
+                                   */
                                    Interval (-0.5, 0.5) * gap + 0.1,
-                                    flare, shorten);
+                                   flare, shorten);
       mol.add_stencil (brack);
     }
-  
+
   mol.translate_axis (ly, Y_AXIS);
-  mol.translate_axis (x0  - sp->get_bound (LEFT)->relative_coordinate (commonx, X_AXIS), X_AXIS);
+  mol.translate_axis (x0 - sp->get_bound (LEFT)->relative_coordinate (commonx, X_AXIS), X_AXIS);
   return mol.smobbed_copy ();
 }
 
@@ -244,9 +238,9 @@ Tuplet_bracket::print (SCM smob)
 
   TODO: this will fail for very short (shorter than the flare)
   brackets.
- */
+*/
 Stencil
-Tuplet_bracket::make_bracket (Grob *me,        // for line properties.
+Tuplet_bracket::make_bracket (Grob *me, // for line properties.
                              Axis protusion_axis,
                              Offset dz,
                              Drul_array<Real> height,
@@ -255,88 +249,93 @@ Tuplet_bracket::make_bracket (Grob *me,   // for line properties.
                              Drul_array<Real> shorten)
 {
   Drul_array<Offset> corners (Offset (0, 0), dz);
-  
+
   Real length = dz.length ();
   Drul_array<Offset> gap_corners;
 
-  
   Axis bracket_axis = other_axis (protusion_axis);
 
   Drul_array<Offset> straight_corners = corners;
 
   Direction d = LEFT;
-  do {
-    straight_corners[d] += - d * shorten[d] /length * dz;
-  } while (flip (&d) != LEFT);
-
+  do
+    {
+      straight_corners[d] += -d * shorten[d] /length * dz;
+    }
+  while (flip (&d) != LEFT);
 
-  if (gap.is_empty())
+  if (gap.is_empty ())
     gap = Interval (0, 0);
-  do {
-    gap_corners[d] = (dz * 0.5) + gap[d] / length * dz;
-  } while (flip (&d) != LEFT);
+  do
+    {
+      gap_corners[d] = (dz * 0.5) + gap[d] / length * dz;
+    }
+  while (flip (&d) != LEFT);
 
   Drul_array<Offset> flare_corners = straight_corners;
-  do {
-    flare_corners[d][bracket_axis] = straight_corners[d][bracket_axis];
-    flare_corners[d][protusion_axis] += height[d];
-    straight_corners[d][bracket_axis] += - d * flare[d];
-  } while (flip (&d) != LEFT);
+  do
+    {
+      flare_corners[d][bracket_axis] = straight_corners[d][bracket_axis];
+      flare_corners[d][protusion_axis] += height[d];
+      straight_corners[d][bracket_axis] += -d * flare[d];
+    }
+  while (flip (&d) != LEFT);
 
   Stencil m;
-  do {
-    m.add_stencil (Line_interface::line (me, straight_corners[d],
-                                        gap_corners[d]));
-    
-    m.add_stencil (Line_interface::line (me,  straight_corners[d],
-                                        flare_corners[d]));
-  } while (flip (&d) != LEFT);
-
-  return m;  
-}
+  do
+    {
+      m.add_stencil (Line_interface::line (me, straight_corners[d],
+                                          gap_corners[d]));
 
+      m.add_stencil (Line_interface::line (me, straight_corners[d],
+                                          flare_corners[d]));
+    }
+  while (flip (&d) != LEFT);
+
+  return m;
+}
 
 /*
   use first -> last note for slope, and then correct for disturbing
   notes in between.  */
 void
-Tuplet_bracket::calc_position_and_height (Grob*me, Real *offset, Real * dy) 
+Tuplet_bracket::calc_position_and_height (Grob *me, Real *offset, Real *dy)
 {
-  Link_array<Grob> columns =
-    extract_grob_array (me, ly_symbol2scm ("note-columns"));
+  Link_array<Grob> columns
+    extract_grob_array (me, ly_symbol2scm ("note-columns"));
 
   SCM cols = me->get_property ("note-columns");
-  Grob * commony = common_refpoint_of_list (cols, me, Y_AXIS);
-  Grob * commonx = common_refpoint_of_list (cols, me, X_AXIS);  
+  Grob *commony = common_refpoint_of_list (cols, me, Y_AXIS);
+  Grob *commonx = common_refpoint_of_list (cols, me, X_AXIS);
 
   Interval staff;
-  if (Grob * st = Staff_symbol_referencer::get_staff_symbol (me))
+  if (Grob *st = Staff_symbol_referencer::get_staff_symbol (me))
     staff = st->extent (commony, Y_AXIS);
-  
+
   Direction dir = get_grob_direction (me);
 
   /*
     Use outer non-rest columns to determine slope
-   */
+  */
   int l = 0;
   while (l <columns.size () && Note_column::has_rests (columns[l]))
-    l ++;
+    l++;
 
   int r = columns.size ()- 1;
   while (r >= l && Note_column::has_rests (columns[r]))
     r--;
-  
+
   if (l < r)
     {
       Interval rv = columns[r]->extent (commony, Y_AXIS);
       Interval lv = columns[l]->extent (commony, Y_AXIS);
       rv.unite (staff);
       lv.unite (staff);
-      Real graphical_dy =  rv[dir] - lv[dir];
+      Real graphical_dy = rv[dir] - lv[dir];
 
       Slice ls = Note_column::head_positions_interval (columns[l]);
       Slice rs = Note_column::head_positions_interval (columns[r]);
-      
+
       Interval musical_dy;
       musical_dy[UP] = rs[UP] - ls[UP];
       musical_dy[DOWN] = rs[DOWN] - ls[DOWN];
@@ -350,16 +349,13 @@ Tuplet_bracket::calc_position_and_height (Grob*me, Real *offset, Real * dy)
   else
     * dy = 0;
 
-
-  *offset = - dir * infinity_f;
+  *offset = -dir * infinity_f;
 
   if (!columns.size ())
     return;
 
-
-  
-  Grob * lgr = get_x_bound_grob (columns[0], dir);
-  Grob * rgr = get_x_bound_grob (columns.top (), dir);  
+  Grob *lgr = get_x_bound_grob (columns[0], dir);
+  Grob *rgr = get_x_bound_grob (columns.top (), dir);
   Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT];
   Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
 
@@ -367,61 +363,57 @@ Tuplet_bracket::calc_position_and_height (Grob*me, Real *offset, Real * dy)
     Slope.
   */
   Real factor = columns.size () > 1 ? 1/ (x1 - x0) : 1.0;
-  
-  for (int i = 0; i < columns.size ();  i++)
+
+  for (int i = 0; i < columns.size (); i++)
     {
       Interval note_ext = columns[i]->extent (commony, Y_AXIS);
       note_ext.unite (staff);
       Real notey = note_ext[dir] - me->relative_coordinate (commony, Y_AXIS);
-      
+
       Real x = columns[i]->relative_coordinate (commonx, X_AXIS) - x0;
-      Real tuplety =  *dy * x * factor;
+      Real tuplety = *dy * x * factor;
 
       if (notey * dir > (*offset + tuplety) * dir)
-       *offset = notey - tuplety; 
+       *offset = notey - tuplety;
     }
 
   // padding
-  *offset +=  scm_to_double (me->get_property ("padding")) *dir;
+  *offset += scm_to_double (me->get_property ("padding")) *dir;
 
-  
   /*
     horizontal brackets should not collide with staff lines.
-    
-   */
+
+  */
   Real ss = Staff_symbol_referencer::staff_space (me);
-  if (*dy == 0 && fabs (*offset) <  ss * Staff_symbol_referencer::staff_radius (me))
+  if (*dy == 0 && fabs (*offset) < ss * Staff_symbol_referencer::staff_radius (me))
     {
       // quantize, then do collision check.
       *offset *= 2 / ss;
-      
+
       *offset = rint (*offset);
       if (Staff_symbol_referencer::on_staffline (me, (int) rint (*offset)))
        *offset += dir;
 
       *offset *= 0.5 * ss;
     }
-  
-}
-
 
+}
 
 /*
   We depend on the beams if there are any.
- */
+*/
 MAKE_SCHEME_CALLBACK (Tuplet_bracket, before_line_breaking, 1);
 SCM
 Tuplet_bracket::before_line_breaking (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Link_array<Grob> columns =
-    extract_grob_array (me, ly_symbol2scm ("note-columns"));
-
+  Link_array<Grob> columns
+    = extract_grob_array (me, ly_symbol2scm ("note-columns"));
 
   for (int i = columns.size (); i--;)
     {
-      Grob * s = Note_column::get_stem (columns[i]);
-      Grob * b = s ? Stem::get_beam (s): 0;
+      Grob *s = Note_column::get_stem (columns[i]);
+      Grob *b = s ? Stem::get_beam (s): 0;
       if (b)
        me->add_dependency (b);
     }
@@ -433,35 +425,35 @@ MAKE_SCHEME_CALLBACK (Tuplet_bracket, after_line_breaking, 1);
 SCM
 Tuplet_bracket::after_line_breaking (SCM smob)
 {
-  Grob * me = unsmob_grob (smob);
-  Link_array<Grob> columns =
-    extract_grob_array (me, ly_symbol2scm ("note-columns"));
+  Grob *me = unsmob_grob (smob);
+  Link_array<Grob> columns
+    extract_grob_array (me, ly_symbol2scm ("note-columns"));
 
   if (!columns.size ())
     {
       me->suicide ();
       return SCM_UNSPECIFIED;
     }
-  if (dynamic_cast<Spanner*> (me)->is_broken ())
+  if (dynamic_cast<Spanner *> (me)->is_broken ())
     {
-      me->warning (_("Killing tuplet bracket across linebreak."));
+      me->warning (_ ("Killing tuplet bracket across linebreak."));
       me->suicide ();
       return SCM_UNSPECIFIED;
     }
-  
+
   Direction dir = get_grob_direction (me);
   if (!dir)
     {
       dir = Tuplet_bracket::get_default_dir (me);
       set_grob_direction (me, dir);
     }
-  
+
   bool equally_long = false;
-  Grob * par_beam = parallel_beam (me, columns, &equally_long);
+  Grob *par_beam = parallel_beam (me, columns, &equally_long);
 
   /*
     We follow the beam only if there is one, and we are next to it.
-   */
+  */
   Real dy, offset;
   if (!par_beam
       || get_grob_direction (par_beam) != dir)
@@ -470,22 +462,21 @@ Tuplet_bracket::after_line_breaking (SCM smob)
     }
   else
     {
-      SCM ps =  par_beam->get_property ("positions"); 
+      SCM ps = par_beam->get_property ("positions");
 
       Real lp = scm_to_double (scm_car (ps));
       Real rp = scm_to_double (scm_cdr (ps));
 
       /*
        duh. magic.
-       */
+      */
       offset = lp + dir * (0.5 + scm_to_double (me->get_property ("padding")));
       dy = rp- lp;
     }
-  
-  
-  SCM lp =  me->get_property ("left-position");
-  SCM rp = me->get_property ("right-position");  
-  
+
+  SCM lp = me->get_property ("left-position");
+  SCM rp = me->get_property ("right-position");
+
   if (scm_is_number (lp) && !scm_is_number (rp))
     {
       rp = scm_make_real (scm_to_double (lp) + dy);
@@ -506,17 +497,16 @@ Tuplet_bracket::after_line_breaking (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
-
 /*
-  similar to beam ? 
- */
+  similar to beam ?
+*/
 Direction
-Tuplet_bracket::get_default_dir (Grob*me)
+Tuplet_bracket::get_default_dir (Grob *me)
 {
-  Drul_array<int> dirs (0, 0);  
+  Drul_array<int> dirs (0, 0);
   for (SCM s = me->get_property ("note-columns"); scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * nc = unsmob_grob (scm_car (s));
+      Grob *nc = unsmob_grob (scm_car (s));
       Direction d = Note_column::dir (nc);
       if (d)
        dirs[d]++;
@@ -526,23 +516,20 @@ Tuplet_bracket::get_default_dir (Grob*me)
 }
 
 void
-Tuplet_bracket::add_column (Grob*me, Item*n)
+Tuplet_bracket::add_column (Grob *me, Item *n)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n);
   me->add_dependency (n);
 
-  add_bound_item (dynamic_cast<Spanner*> (me), n);
+  add_bound_item (dynamic_cast<Spanner *> (me), n);
 }
 
 
 
-
-
-
 ADD_INTERFACE (Tuplet_bracket,
               "tuplet-bracket-interface",
               "A bracket with a number in the middle, used for tuplets.",
-              
+
               "note-columns bracket-flare edge-height shorten-pair "
               "padding left-position right-position bracket-visibility "
               "number-visibility thickness direction");
index e881e0de78605bdee578bd0511d69ec5074847cb..9acf07106b601525e6a388cfc0fa85bbbb9390b2 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   tuplet-engraver.cc -- implement Tuplet_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "tuplet-bracket.hh"
 #include "note-column.hh"
@@ -19,7 +18,7 @@ struct Tuplet_description
   Rational stop_;
   Rational span_stop_;
   Spanner *spanner_;
-  Tuplet_description()
+  Tuplet_description ()
   {
     music_ = 0;
     spanner_ = 0;
@@ -35,7 +34,7 @@ protected:
   Array<Tuplet_description> tuplets_;
 
   virtual void acknowledge_grob (Grob_info);
-  virtual bool try_music (Music*r);
+  virtual bool try_music (Music *r);
   virtual void start_translation_timestep ();
   virtual void process_music ();
 };
@@ -50,13 +49,13 @@ Tuplet_engraver::try_music (Music *music)
        {
          Tuplet_description d;
          d.music_ = music;
-         d.stop_  = now_mom ().main_part_ + music->get_length ().main_part_;
+         d.stop_ = now_mom ().main_part_ + music->get_length ().main_part_;
          d.span_stop_ = d.stop_;
-         
+
          SCM s = get_property ("tupletSpannerDuration");
          if (unsmob_moment (s))
            d.span_stop_ = d.span_stop_ <? (now_mom () + *unsmob_moment (s)).main_part_;
-         
+
          tuplets_.push (d);
        }
       return true;
@@ -72,7 +71,7 @@ Tuplet_engraver::process_music ()
       if (tuplets_[i].spanner_)
        continue;
 
-      Spannerspanner = make_spanner ("TupletBracket",
+      Spanner *spanner = make_spanner ("TupletBracket",
                                       tuplets_[i].music_->self_scm ());
       tuplets_[i].spanner_ = spanner;
 
@@ -91,9 +90,9 @@ Tuplet_engraver::acknowledge_grob (Grob_info i)
   if (Note_column::has_interface (i.grob_))
     {
       for (int j = 0; j < tuplets_.size (); j++)
-       if (tuplets_[j].spanner_) 
+       if (tuplets_[j].spanner_)
          Tuplet_bracket::add_column (tuplets_[j].spanner_,
-                                     dynamic_cast<Item*> (i.grob_));
+                                     dynamic_cast<Item *> (i.grob_));
     }
 }
 
@@ -115,10 +114,10 @@ Tuplet_engraver::start_translation_timestep ()
            {
              if (!sp->get_bound (RIGHT))
                sp->set_bound (RIGHT, sp->get_bound (LEFT));
-             
+
              tuplets_[i].spanner_ = 0;
            }
-         
+
          if (tsd.to_bool ())
            tuplets_[i].span_stop_ += tsd.main_part_;
        }
@@ -135,9 +134,9 @@ Tuplet_engraver::Tuplet_engraver ()
 }
 
 ADD_TRANSLATOR (Tuplet_engraver,
-/* descr */       "Catch Time_scaled_music and generate appropriate bracket  ",
-/* creats*/       "TupletBracket",
-/* accepts */     "time-scaled-music",
-/* acks  */      "note-column-interface",
-/* reads */       "tupletNumberFormatFunction tupletSpannerDuration",
-/* write */       "");
+               /* descr */ "Catch Time_scaled_music and generate appropriate bracket  ",
+               /* creats*/ "TupletBracket",
+               /* accepts */ "time-scaled-music",
+               /* acks  */ "note-column-interface",
+               /* reads */ "tupletNumberFormatFunction tupletSpannerDuration",
+               /* write */ "");
index 29de348eb9bf9b32a5a9ff3bef7ba082677e0cc5..0e13e326d5ea2ffb2e424cdfc1dafb0cf6d69be5 100644 (file)
@@ -4,18 +4,15 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
-
 #include "tweak-registration.hh"
 #include "grob.hh"
 #include "object-key-undumper.hh"
 
 LY_DEFINE (ly_clear_tweak_registry, "ly:tweak-clear-registry",
           0, 0, 0, (),
-          "Clear global tweak registry"
-          )
+          "Clear global tweak registry")
 {
   global_registry_->clear ();
   return SCM_UNSPECIFIED;
@@ -24,15 +21,14 @@ LY_DEFINE (ly_clear_tweak_registry, "ly:tweak-clear-registry",
 LY_DEFINE (ly_grob_insert_tweak, "ly:grob-insert-tweak",
           2, 0, 0,
           (SCM grob, SCM tweak),
-          "add new tweak for grob."
-          )
+          "add new tweak for grob.")
 {
   Grob *gr = unsmob_grob (grob);
   SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "Grob");
   SCM_ASSERT_TYPE (scm_list_p (tweak) == SCM_BOOL_T
                   && ly_c_procedure_p (scm_car (tweak)),
                   tweak, SCM_ARG2, __FUNCTION__, "Tweak");
-  
+
   global_registry_->insert_grob_tweak (gr, tweak);
   return SCM_UNSPECIFIED;
 }
@@ -40,43 +36,36 @@ LY_DEFINE (ly_grob_insert_tweak, "ly:grob-insert-tweak",
 LY_DEFINE (ly_grob_replace_tweak, "ly:grob-replace-tweak",
           2, 0, 0,
           (SCM grob, SCM tweak),
-          "Replace tweak for grob."
-          )
+          "Replace tweak for grob.")
 {
   Grob *gr = unsmob_grob (grob);
   SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "Grob");
   SCM_ASSERT_TYPE (scm_list_p (tweak) == SCM_BOOL_T
                   && ly_c_procedure_p (scm_car (tweak)),
                   tweak, SCM_ARG2, __FUNCTION__, "Tweak");
-  
+
   global_registry_->replace_grob_tweak (gr, tweak);
   return SCM_UNSPECIFIED;
 }
 
-
 LY_DEFINE (ly_tweak_read_keys, "ly:tweak-define-keys",
           1, 0, 0, (SCM keys),
-          "Read keys"
-          )
+          "Read keys")
 {
-  global_registry_->undumper ()->parse_contents (keys); 
+  global_registry_->undumper ()->parse_contents (keys);
   return SCM_UNSPECIFIED;
 }
 
-
 LY_DEFINE (ly_all_tweaks, "ly:all-tweaks",
           0, 0, 0, (),
-          "all tweaks"
-          )
+          "all tweaks")
 {
   return global_registry_->list_tweaks ();
 }
 
-
 LY_DEFINE (ly_tweak_read_tweaks, "ly:tweak-define-tweaks",
           1, 0, 0, (SCM tweaks),
-          "Read  tweaks"
-          )
+          "Read  tweaks")
 {
   for (SCM s = tweaks; scm_is_pair (s); s = scm_cdr (s))
     global_registry_->insert_tweak_from_file (scm_car (s));
index bde84f7cb7cb0700a22bcc184192000fd321e2f9..fe815e19c85e86fa927cd1db328b7a1ff5a1f5b2 100644 (file)
@@ -4,7 +4,6 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "tweak-registration.hh"
@@ -39,8 +38,8 @@ Tweak_registry::insert_tweak_from_file (SCM tweak)
 {
   SCM skey = scm_car (tweak);
 
-  assert (scm_is_pair (skey) &&
-        scm_car (skey) == ly_symbol2scm ("key"));
+  assert (scm_is_pair (skey)
+         && scm_car (skey) == ly_symbol2scm ("key"));
 
   Object_key const *key = undumper_->get_key (scm_to_int (scm_cadr (skey)));
   if (tweaks_.find (key) == tweaks_.end ())
@@ -67,7 +66,7 @@ Tweak_registry::replace_grob_tweak (Grob *g, SCM tweak)
 }
 
 SCM
-Tweak_registry::get_tweaks (Grob *g) 
+Tweak_registry::get_tweaks (Grob *g)
 {
   Object_key const *key = g->get_key ();
   if (tweaks_.find (key) == tweaks_.end ())
@@ -94,7 +93,7 @@ Tweak_registry::list_tweaks ()
 SCM
 Tweak_registry::mark_smob (SCM smob)
 {
-  Tweak_registry *me = (Tweak_registry*) SCM_CELL_WORD_1 (smob);
+  Tweak_registry *me = (Tweak_registry *) SCM_CELL_WORD_1 (smob);
 
   for (Tweak_map::const_iterator i (me->tweaks_.begin ());
        i != me->tweaks_.end ();
@@ -106,7 +105,7 @@ Tweak_registry::mark_smob (SCM smob)
 
   if (me->undumper_)
     scm_gc_mark (me->undumper_->self_scm ());
-                     
+
   return SCM_EOL;
 }
 
@@ -114,11 +113,11 @@ int
 Tweak_registry::print_smob (SCM smob, SCM port, scm_print_state*)
 {
   (void) smob;                 // smother warning.
-  scm_puts ("#<Tweak_registry>", port); 
+  scm_puts ("#<Tweak_registry>", port);
   return 1;
 }
 
-Object_key_undumper*
+Object_key_undumper *
 Tweak_registry::undumper () const
 {
   return undumper_;
@@ -127,7 +126,6 @@ Tweak_registry::undumper () const
 IMPLEMENT_DEFAULT_EQUAL_P (Tweak_registry);
 IMPLEMENT_SMOBS (Tweak_registry);
 
-
 Tweak_registry *global_registry_;
 
 void
index 72982a1132467f90a9f660d6969e9403d095e694..616099fbed5343415cd0246087ae89bdb662d974 100644 (file)
 class Skip_event_swallow_translator : public virtual Translator
 {
 protected:
-  virtual bool try_music (Music*) { return true; }
+  virtual bool try_music (Music *) { return true; }
 
-public:  
+public:
   TRANSLATOR_DECLARATIONS (Skip_event_swallow_translator);
 };
 
-
 class Rest_swallow_translator : public virtual Translator
 {
 protected:
-  virtual bool try_music (Music*) { return true; }
+  virtual bool try_music (Music *) { return true; }
 
-public:  
+public:
   TRANSLATOR_DECLARATIONS (Rest_swallow_translator);
 };
 
-
 Skip_event_swallow_translator::Skip_event_swallow_translator (){}
 
 ADD_TRANSLATOR (Skip_event_swallow_translator,
-                 "Swallow \\skip.",
-                 "",
-                 "skip-event",
-                 "",
-                 "",
-                 "");
-
+               "Swallow \\skip.",
+               "",
+               "skip-event",
+               "",
+               "",
+               "");
 
 Rest_swallow_translator::Rest_swallow_translator (){}
 
 ADD_TRANSLATOR (Rest_swallow_translator,
-                 "Swallow rest",
-                 "",
-                 "rest-event",
-                 "",
-                 "",
-       
+               "Swallow rest",
+               "",
+               "rest-event",
+               "",
+               "",
 
-         "");
+               "");
 
 class Note_swallow_translator : public virtual Translator
 {
 protected:
-  virtual bool try_music (Music*) { return true; }
+  virtual bool try_music (Music *) { return true; }
 
-public:  
+public:
   TRANSLATOR_DECLARATIONS (Note_swallow_translator);
 };
 
 Note_swallow_translator::Note_swallow_translator (){}
 
 ADD_TRANSLATOR (Note_swallow_translator,
-                 "Swallow notes",
-                 "",
-                 "note-event",
-                 "",
-                 "",
-                 "");
-                 
+               "Swallow notes",
+               "",
+               "note-event",
+               "",
+               "",
+               "");
+
index c871c373950578f2a8a532a36a34dfba849de39e..c7a5db97f794f6926c1fa5f80017cd58e2f72de7 100644 (file)
@@ -1,10 +1,10 @@
-/*   
-unfolded-repeat-iterator.cc -- implement Unfolded_repeat_iterator, Volta_repeat_iterator
+/*
+  unfolded-repeat-iterator.cc -- implement Unfolded_repeat_iterator, Volta_repeat_iterator
 
-source file of the GNU LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
 
-(c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "music.hh"
@@ -19,13 +19,12 @@ protected:
   virtual SCM get_music_list () const;
 };
 
-
 SCM
 Unfolded_repeat_iterator::get_music_list () const
 {
   SCM l = SCM_EOL;
   SCM *tail = &l;
-  
+
   SCM body = get_music ()->get_property ("element");
   SCM alts = get_music ()->get_property ("elements");
   int alt_count = scm_ilength (alts);
@@ -34,7 +33,7 @@ Unfolded_repeat_iterator::get_music_list () const
   for (int i = 0; i < rep_count; i++)
     {
       if (unsmob_music (body))
-       *tail = scm_cons (body, SCM_EOL) ;
+       *tail = scm_cons (body, SCM_EOL);
 
       tail = SCM_CDRLOC (*tail);
 
@@ -43,12 +42,12 @@ Unfolded_repeat_iterator::get_music_list () const
          *tail = scm_cons (scm_car (alts), SCM_EOL);
          tail = SCM_CDRLOC (*tail);
          if (i >= rep_count - alt_count)
-           
+
            alts = scm_cdr (alts);
-       }      
+       }
     }
 
-  return l; 
+  return l;
 }
 
 class Volta_repeat_iterator : public Sequential_iterator
@@ -70,7 +69,6 @@ protected:
   int done_count_;
 };
 
-
 Volta_repeat_iterator::Volta_repeat_iterator ()
 {
   done_count_ = alt_count_ = rep_count_ = 0;
@@ -81,14 +79,14 @@ SCM
 Volta_repeat_iterator::get_music_list ()const
 {
   return scm_cons (get_music ()->get_property ("element"),
-                 get_music ()->get_property ("elements"));
+                  get_music ()->get_property ("elements"));
 }
 
 void
 Volta_repeat_iterator::construct_children ()
 {
   Sequential_iterator::construct_children ();
-  
+
   SCM alts = get_music ()->get_property ("elements");
 
   alt_count_ = scm_ilength (alts);
@@ -96,17 +94,16 @@ Volta_repeat_iterator::construct_children ()
   done_count_ = 0;
 }
 
-
 /*
   TODO: add source information for debugging
- */
+*/
 void
 Volta_repeat_iterator::add_repeat_command (SCM what)
 {
   SCM reps = ly_symbol2scm ("repeatCommands");
   SCM current_reps = get_outlet ()->internal_get_property (reps);
 
-  Context * where = get_outlet ()->where_defined (reps);
+  Context *where = get_outlet ()->where_defined (reps);
   if (where
       && current_reps == SCM_EOL || scm_is_pair (current_reps))
     {
@@ -115,16 +112,15 @@ Volta_repeat_iterator::add_repeat_command (SCM what)
     }
 }
 
-
 void
 Volta_repeat_iterator::next_element (bool side_effect)
 {
-  done_count_ ++;
+  done_count_++;
 
   Sequential_iterator::next_element (side_effect);
 
   if (side_effect)
-    {    
+    {
       if (alt_count_)
        {
          String repstr = to_string (rep_count_ - alt_count_ + done_count_) + ".";
@@ -136,8 +132,6 @@ Volta_repeat_iterator::next_element (bool side_effect)
                add_repeat_command (ly_symbol2scm ("end-repeat"));
            }
 
-         
-      
          if (done_count_ == 1 && alt_count_ < rep_count_)
            {
              repstr = "1.--" + to_string (rep_count_ - alt_count_ + done_count_) + ".";
@@ -154,7 +148,6 @@ Volta_repeat_iterator::next_element (bool side_effect)
     }
 }
 
-
 void
 Volta_repeat_iterator::process (Moment m)
 {
@@ -166,6 +159,5 @@ Volta_repeat_iterator::process (Moment m)
   Sequential_iterator::process (m);
 }
 
-
 IMPLEMENT_CTOR_CALLBACK (Volta_repeat_iterator);
 IMPLEMENT_CTOR_CALLBACK (Unfolded_repeat_iterator);
index a0af4f2c174ebb486cfb9b7a4467f5a2e61ce27c..da0169237fd500e4faef5d07f6507fc526c37687 100644 (file)
@@ -1,10 +1,10 @@
 /*
   vaticana-ligature-engraver.cc -- implement Vaticana_ligature_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
- */
+*/
 
 #include "gregorian-ligature-engraver.hh"
 #include "gregorian-ligature.hh"
@@ -54,41 +54,41 @@ bool
 Vaticana_ligature_engraver::is_stacked_head (int prefix_set,
                                             int context_info)
 {
-      bool is_stacked_b;
+  bool is_stacked_b;
 
-      // upper head of pes is stacked upon lower head of pes ...
-      is_stacked_b = context_info & PES_UPPER;
+  // upper head of pes is stacked upon lower head of pes ...
+  is_stacked_b = context_info & PES_UPPER;
 
-      // ... unless this note starts a flexa
-      if (context_info & FLEXA_LEFT)
-       is_stacked_b = false;
+  // ... unless this note starts a flexa
+  if (context_info & FLEXA_LEFT)
+    is_stacked_b = false;
 
-      // ... or another pes
-      if (context_info & PES_LOWER)
-       is_stacked_b = false;
+  // ... or another pes
+  if (context_info & PES_LOWER)
+    is_stacked_b = false;
 
-      // ... or the previous note is a semivocalis or inclinatum
-      if (context_info & AFTER_DEMINUTUM)
-       is_stacked_b = false;
+  // ... or the previous note is a semivocalis or inclinatum
+  if (context_info & AFTER_DEMINUTUM)
+    is_stacked_b = false;
 
-      // auctum head is never stacked upon preceding note
-      if (prefix_set & AUCTUM)
-       is_stacked_b = false;
+  // auctum head is never stacked upon preceding note
+  if (prefix_set & AUCTUM)
+    is_stacked_b = false;
 
-      // virga is never stacked upon preceding note
-      if (prefix_set & VIRGA)
-       is_stacked_b = false;
+  // virga is never stacked upon preceding note
+  if (prefix_set & VIRGA)
+    is_stacked_b = false;
 
-      // oriscus is never stacked upon preceding note
-      if (prefix_set & ORISCUS)
-       is_stacked_b = false;
+  // oriscus is never stacked upon preceding note
+  if (prefix_set & ORISCUS)
+    is_stacked_b = false;
 
-      if ((prefix_set & DEMINUTUM) &&
-         !(prefix_set & INCLINATUM) &&
-         (context_info & FLEXA_RIGHT))
-       is_stacked_b = true; // semivocalis head of deminutus form
+  if ((prefix_set & DEMINUTUM)
+      && ! (prefix_set & INCLINATUM)
+      && (context_info & FLEXA_RIGHT))
+    is_stacked_b = true; // semivocalis head of deminutus form
 
-      return is_stacked_b;
+  return is_stacked_b;
 }
 
 /*
@@ -109,14 +109,14 @@ need_extra_space (int prev_prefix_set, int prefix_set,
      */
     return true;
 
-  if ((prefix_set & INCLINATUM) &&
-          !(prev_prefix_set & INCLINATUM))
+  if ((prefix_set & INCLINATUM)
+      && ! (prev_prefix_set & INCLINATUM))
     /*
      * Always start a series of inclinatum heads with an extra space.
      */
     return true;
 
-  if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER))
+  if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER))
     /*
      * Before a flexa (but not within a torculus), make a an
      * additional small space such that the appendix on the left side
@@ -150,11 +150,11 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
   /*
    * The paper column where we put the whole ligature into.
    */
-  Paper_column *column =
-    dynamic_cast<Item*> (primitives[0].grob_)->get_column ();
+  Paper_column *column
+    = dynamic_cast<Item *> (primitives[0].grob_)->get_column ();
 
-  Real join_thickness =
-    thickness * column->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+  Real join_thickness
+    thickness * column->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
 
   /*
    * Amount of extra space two put between some particular
@@ -173,11 +173,11 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
   int prev_prefix_set = 0;
   for (int i = 0; i < primitives.size (); i++)
     {
-      Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
-      int prefix_set =
-       scm_to_int (primitive->get_property ("prefix-set"));
-      int context_info =
-       scm_to_int (primitive->get_property ("context-info"));
+      Item *primitive = dynamic_cast<Item *> (primitives[i].grob_);
+      int prefix_set
+       scm_to_int (primitive->get_property ("prefix-set"));
+      int context_info
+       scm_to_int (primitive->get_property ("context-info"));
 
       /*
        * Get glyph_name, delta_pitch and context_info for this head.
@@ -227,12 +227,12 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
           * of this and the other head are horizontally aligned.
           */
          head_width = 0.0;
-         x_offset = join_thickness -
-           Font_interface::get_default_font (primitive)->
+         x_offset = join_thickness
+           Font_interface::get_default_font (primitive)->
            find_by_name ("noteheads." + glyph_name).extent (X_AXIS).length ();
        }
-      else if (!String::compare (glyph_name, "flexa") ||
-              !String::compare (glyph_name, ""))
+      else if (!String::compare (glyph_name, "flexa")
+              || !String::compare (glyph_name, ""))
        {
          /*
           * This head represents either half of a flexa shape.
@@ -247,8 +247,8 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
           * This is a regular head, placed right to the previous one.
           * Retrieve its width from corresponding font.
           */
-         head_width =
-           Font_interface::get_default_font (primitive)->
+         head_width
+           Font_interface::get_default_font (primitive)->
            find_by_name ("noteheads." + glyph_name).extent (X_AXIS).length ();
          x_offset = 0.0;
        }
@@ -257,16 +257,16 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
        * Save the head's final x-offset.
        */
       primitive->set_property ("x-offset",
-                                   scm_make_real (x_offset));
+                              scm_make_real (x_offset));
 
       /*
        * If the head is the 2nd head of a pes or flexa (but not a
        * flexa shape), mark this head to be joined with the left-side
        * neighbour head (i.e. the previous head) by a vertical beam.
        */
-      if ((context_info & PES_UPPER) ||
-         ((context_info & FLEXA_RIGHT) &&
-          !(context_info & PES_LOWER)))
+      if ((context_info & PES_UPPER)
+         || ((context_info & FLEXA_RIGHT)
+             && ! (context_info & PES_LOWER)))
        {
          if (!prev_primitive)
            {
@@ -276,7 +276,7 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
          else
            {
              prev_primitive->set_property ("add-join",
-                                                ly_bool2scm (true));
+                                           ly_bool2scm (true));
 
              /*
               * Create a small overlap of adjacent heads so that the join
@@ -333,8 +333,8 @@ Vaticana_ligature_engraver::align_heads (Array<Grob_info> primitives,
 void
 check_for_prefix_loss (Item *primitive)
 {
-  int prefix_set =
-    scm_to_int (primitive->get_property ("prefix-set"));
+  int prefix_set
+    scm_to_int (primitive->get_property ("prefix-set"));
   if (prefix_set & ~PES_OR_FLEXA)
     {
       String prefs = Gregorian_ligature::prefixes_to_str (primitive);
@@ -348,211 +348,212 @@ void
 Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
                                             Array<Grob_info> primitives)
 {
-  Real flexa_width = robust_scm2double ( ligature->get_property ("flexa-width"), 2);
+  Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2);
 
-  Real thickness = robust_scm2double ( ligature->get_property ("thickness"), 1);
+  Real thickness = robust_scm2double (ligature->get_property ("thickness"), 1);
 
   Item *prev_primitive = 0;
   int prev_prefix_set = 0;
   int prev_context_info = 0;
   int prev_delta_pitch = 0;
   String prev_glyph_name = "";
-  for (int i = 0; i < primitives.size (); i++) {
-    Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
-
-    int delta_pitch;
-    SCM delta_pitch_scm = primitive->get_property ("delta-pitch");
-    if (delta_pitch_scm != SCM_EOL)
-      {
-       delta_pitch = scm_to_int (delta_pitch_scm);
-      }
-    else
-      {
-       primitive->programming_error ("Vaticana_ligature:"
-                                     "delta-pitch undefined -> "
-                                     "ignoring grob");
-       continue;
-      }
-
-    /* retrieve & complete prefix_set and context_info */
-    int prefix_set =
-      scm_to_int (primitive->get_property ("prefix-set"));
-    int context_info =
-      scm_to_int (primitive->get_property ("context-info"));
-    if (is_stacked_head (prefix_set, context_info))
-      {
-       context_info |= STACKED_HEAD;
-       primitive->set_property ("context-info",
-                                     scm_int2num (context_info));
-      }
+  for (int i = 0; i < primitives.size (); i++)
+    {
+      Item *primitive = dynamic_cast<Item *> (primitives[i].grob_);
 
-    /*
-     * Now determine which head to typeset (this is context sensitive
-     * information, since it depends on neighbouring heads; therefore,
-     * this decision must be made here in the engraver rather than in
-     * the backend).
-     */
-    String glyph_name;
-    if (prefix_set & VIRGA)
-      {
-       glyph_name = "svaticana.punctum";
-       primitive->set_property ("add-stem", ly_bool2scm (true));
-      }
-    else if (prefix_set & QUILISMA)
-      glyph_name = "svaticana.quilisma";
-    else if (prefix_set & ORISCUS)
-      glyph_name = "ssolesmes.oriscus";
-    else if (prefix_set & STROPHA)
-      if (prefix_set & AUCTUM)
-       glyph_name = "ssolesmes.stropha.aucta";
-      else glyph_name = "ssolesmes.stropha";
-    else if (prefix_set & INCLINATUM)
-      if (prefix_set & AUCTUM)
-       glyph_name = "ssolesmes.incl.auctum";
-      else if (prefix_set & DEMINUTUM)
-       glyph_name = "ssolesmes.incl.parvum";
-      else
-       glyph_name = "svaticana.inclinatum";
-    else if (prefix_set & DEMINUTUM)
-      if (i == 0)
+      int delta_pitch;
+      SCM delta_pitch_scm = primitive->get_property ("delta-pitch");
+      if (delta_pitch_scm != SCM_EOL)
        {
-         // initio debilis
-         glyph_name = "svaticana.reverse.plica";
+         delta_pitch = scm_to_int (delta_pitch_scm);
        }
-      else if (prev_delta_pitch > 0)
+      else
        {
-         // epiphonus
-         if (!(prev_context_info & FLEXA_RIGHT))
-           /* correct head of previous primitive */
-           if (prev_delta_pitch > 1)
-             prev_glyph_name = "svaticana.epiphonus";
-           else
-             prev_glyph_name = "svaticana.vepiphonus";
-         glyph_name = "svaticana.plica";
+         primitive->programming_error ("Vaticana_ligature:"
+                                       "delta-pitch undefined -> "
+                                       "ignoring grob");
+         continue;
        }
-      else // (prev_delta_pitch <= 0)
-       {
-         // cephalicus
-         if (!(prev_context_info & FLEXA_RIGHT))
-           /* correct head of previous primitive */
-           {
-             if (i > 1)
-               {
-                 /* cephalicus head with fixed size cauda */
-                 prev_glyph_name = "svaticana.inner.cephalicus";
-               }
-             else
-               {
-                 /* cephalicus head without cauda */
-                 prev_glyph_name = "svaticana.cephalicus";
-               }
 
-             /*
-              * Flexa has no variable size cauda if its left head is
-              * stacked on the right head.  This is true for
-              * cephalicus.  Hence, remove the cauda.
-              *
-              * Urgh: for the current implementation, this rule only
-              * applies for cephalicus; but it is a fundamental rule.
-              * Therefore, the following line of code should be
-              * placed somewhere else.
-              */
-             prev_primitive->set_property ("add-cauda",
-                                                ly_bool2scm (false));
-           }
-         glyph_name = "svaticana.reverse.plica";
+      /* retrieve & complete prefix_set and context_info */
+      int prefix_set
+       = scm_to_int (primitive->get_property ("prefix-set"));
+      int context_info
+       = scm_to_int (primitive->get_property ("context-info"));
+      if (is_stacked_head (prefix_set, context_info))
+       {
+         context_info |= STACKED_HEAD;
+         primitive->set_property ("context-info",
+                                  scm_int2num (context_info));
        }
-    else if (prefix_set & (CAVUM | LINEA))
-      if ((prefix_set & CAVUM) && (prefix_set & LINEA))
-       glyph_name = "svaticana.linea.punctum.cavum";
-      else if (prefix_set & CAVUM)
-       glyph_name = "svaticana.punctum.cavum";
-      else
-       glyph_name = "svaticana.linea.punctum";
-    else if (prefix_set & AUCTUM)
-      if (prefix_set & ASCENDENS)
-       glyph_name = "ssolesmes.auct.asc";
-      else
-       glyph_name = "ssolesmes.auct.desc";
-    else if ((context_info & STACKED_HEAD) &&
-            (context_info & PES_UPPER))
-      if (prev_delta_pitch > 1)
-       glyph_name = "svaticana.upes";
-      else
-       glyph_name = "svaticana.vupes";
-    else
-      glyph_name = "svaticana.punctum";
 
-    /*
-     * This head needs a cauda, if it starts a flexa, is not the upper
-     * head of a pes, and if it is a punctum.
-     */
-    if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER))
-      if (!String::compare (glyph_name, "svaticana.punctum"))
-       primitive->set_property ("add-cauda", ly_bool2scm (true));
-
-    /*
-     * Execptional rule for porrectus:
-     *
-     * If the current head is preceded by a \flexa and succeded by a
-     * \pes (e.g. "a \flexa g \pes a"), then join the current head and
-     * the previous head into a single curved flexa shape.
-     */
-    if ((context_info & FLEXA_RIGHT) && (context_info & PES_LOWER))
-      {
-       check_for_prefix_loss (prev_primitive);
-       prev_glyph_name = "flexa";
-       prev_primitive->set_property ("flexa-height",
-                                          scm_int2num (prev_delta_pitch));
-       prev_primitive->set_property ("flexa-width",
-                                          scm_make_real (flexa_width));
-       bool add_cauda = !(prev_prefix_set && PES_OR_FLEXA);
-       prev_primitive->set_property ("add-cauda",
-                                          ly_bool2scm (add_cauda));
-       check_for_prefix_loss (primitive);
-       glyph_name = "";
-       primitive->set_property ("flexa-width",
-                                     scm_make_real (flexa_width));
-      }
-
-    /*
-     * Exceptional rule for pes:
-     *
-     * If this head is stacked on the previous one due to a \pes, then
-     * set the glyph of the previous head to that for this special
-     * case, thereby avoiding potential vertical collision with the
-     * current head.
-     */
-    if (prefix_set & PES_OR_FLEXA)
-      {
-       if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD))
+      /*
+       * Now determine which head to typeset (this is context sensitive
+       * information, since it depends on neighbouring heads; therefore,
+       * this decision must be made here in the engraver rather than in
+       * the backend).
+       */
+      String glyph_name;
+      if (prefix_set & VIRGA)
+       {
+         glyph_name = "svaticana.punctum";
+         primitive->set_property ("add-stem", ly_bool2scm (true));
+       }
+      else if (prefix_set & QUILISMA)
+       glyph_name = "svaticana.quilisma";
+      else if (prefix_set & ORISCUS)
+       glyph_name = "ssolesmes.oriscus";
+      else if (prefix_set & STROPHA)
+       if (prefix_set & AUCTUM)
+         glyph_name = "ssolesmes.stropha.aucta";
+       else glyph_name = "ssolesmes.stropha";
+      else if (prefix_set & INCLINATUM)
+       if (prefix_set & AUCTUM)
+         glyph_name = "ssolesmes.incl.auctum";
+       else if (prefix_set & DEMINUTUM)
+         glyph_name = "ssolesmes.incl.parvum";
+       else
+         glyph_name = "svaticana.inclinatum";
+      else if (prefix_set & DEMINUTUM)
+       if (i == 0)
          {
-           if (!String::compare (prev_glyph_name, "svaticana.punctum"))
+           // initio debilis
+           glyph_name = "svaticana.reverse.plica";
+         }
+       else if (prev_delta_pitch > 0)
+         {
+           // epiphonus
+           if (! (prev_context_info & FLEXA_RIGHT))
+             /* correct head of previous primitive */
              if (prev_delta_pitch > 1)
-               prev_glyph_name = "svaticana.lpes";
+               prev_glyph_name = "svaticana.epiphonus";
              else
-               prev_glyph_name = "svaticana.vlpes";
+               prev_glyph_name = "svaticana.vepiphonus";
+           glyph_name = "svaticana.plica";
+         }
+       else // (prev_delta_pitch <= 0)
+         {
+           // cephalicus
+           if (! (prev_context_info & FLEXA_RIGHT))
+             /* correct head of previous primitive */
+             {
+               if (i > 1)
+                 {
+                   /* cephalicus head with fixed size cauda */
+                   prev_glyph_name = "svaticana.inner.cephalicus";
+                 }
+               else
+                 {
+                   /* cephalicus head without cauda */
+                   prev_glyph_name = "svaticana.cephalicus";
+                 }
+
+               /*
+                * Flexa has no variable size cauda if its left head is
+                * stacked on the right head.  This is true for
+                * cephalicus.  Hence, remove the cauda.
+                *
+                * Urgh: for the current implementation, this rule only
+                * applies for cephalicus; but it is a fundamental rule.
+                * Therefore, the following line of code should be
+                * placed somewhere else.
+                */
+               prev_primitive->set_property ("add-cauda",
+                                             ly_bool2scm (false));
+             }
+           glyph_name = "svaticana.reverse.plica";
          }
-      }
+      else if (prefix_set & (CAVUM | LINEA))
+       if ((prefix_set & CAVUM) && (prefix_set & LINEA))
+         glyph_name = "svaticana.linea.punctum.cavum";
+       else if (prefix_set & CAVUM)
+         glyph_name = "svaticana.punctum.cavum";
+       else
+         glyph_name = "svaticana.linea.punctum";
+      else if (prefix_set & AUCTUM)
+       if (prefix_set & ASCENDENS)
+         glyph_name = "ssolesmes.auct.asc";
+       else
+         glyph_name = "ssolesmes.auct.desc";
+      else if ((context_info & STACKED_HEAD)
+              && (context_info & PES_UPPER))
+       if (prev_delta_pitch > 1)
+         glyph_name = "svaticana.upes";
+       else
+         glyph_name = "svaticana.vupes";
+      else
+       glyph_name = "svaticana.punctum";
 
-    if (prev_primitive)
-      prev_primitive->set_property ("glyph-name",
-                                   scm_makfrom0str (prev_glyph_name.to_str0 ()));
+      /*
+       * This head needs a cauda, if it starts a flexa, is not the upper
+       * head of a pes, and if it is a punctum.
+       */
+      if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER))
+       if (!String::compare (glyph_name, "svaticana.punctum"))
+         primitive->set_property ("add-cauda", ly_bool2scm (true));
 
-    /*
-     * In the backend, flexa shapes and joins need to know about line
-     * thickness.  Hence, for simplicity, let's distribute the
-     * ligature grob's value for thickness to each ligature head (even
-     * if not all of them need to know).
-     */
-    primitive->set_property ("thickness", scm_make_real (thickness));
+      /*
+       * Execptional rule for porrectus:
+       *
+       * If the current head is preceded by a \flexa and succeded by a
+       * \pes (e.g. "a \flexa g \pes a"), then join the current head and
+       * the previous head into a single curved flexa shape.
+       */
+      if ((context_info & FLEXA_RIGHT) && (context_info & PES_LOWER))
+       {
+         check_for_prefix_loss (prev_primitive);
+         prev_glyph_name = "flexa";
+         prev_primitive->set_property ("flexa-height",
+                                       scm_int2num (prev_delta_pitch));
+         prev_primitive->set_property ("flexa-width",
+                                       scm_make_real (flexa_width));
+         bool add_cauda = !(prev_prefix_set && PES_OR_FLEXA);
+         prev_primitive->set_property ("add-cauda",
+                                       ly_bool2scm (add_cauda));
+         check_for_prefix_loss (primitive);
+         glyph_name = "";
+         primitive->set_property ("flexa-width",
+                                  scm_make_real (flexa_width));
+       }
+
+      /*
+       * Exceptional rule for pes:
+       *
+       * If this head is stacked on the previous one due to a \pes, then
+       * set the glyph of the previous head to that for this special
+       * case, thereby avoiding potential vertical collision with the
+       * current head.
+       */
+      if (prefix_set & PES_OR_FLEXA)
+       {
+         if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD))
+           {
+             if (!String::compare (prev_glyph_name, "svaticana.punctum"))
+               if (prev_delta_pitch > 1)
+                 prev_glyph_name = "svaticana.lpes";
+               else
+                 prev_glyph_name = "svaticana.vlpes";
+           }
+       }
 
-    prev_primitive = primitive;
-    prev_prefix_set = prefix_set;
-    prev_context_info = context_info;
-    prev_delta_pitch = delta_pitch;
-    prev_glyph_name = glyph_name;
-  }
+      if (prev_primitive)
+       prev_primitive->set_property ("glyph-name",
+                                     scm_makfrom0str (prev_glyph_name.to_str0 ()));
+
+      /*
+       * In the backend, flexa shapes and joins need to know about line
+       * thickness.  Hence, for simplicity, let's distribute the
+       * ligature grob's value for thickness to each ligature head (even
+       * if not all of them need to know).
+       */
+      primitive->set_property ("thickness", scm_make_real (thickness));
+
+      prev_primitive = primitive;
+      prev_prefix_set = prefix_set;
+      prev_context_info = context_info;
+      prev_delta_pitch = delta_pitch;
+      prev_glyph_name = glyph_name;
+    }
 
   prev_primitive->set_property ("glyph-name",
                                scm_makfrom0str (prev_glyph_name.to_str0 ()));
@@ -562,7 +563,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
 #if 0 // experimental code to collapse spacing after ligature
   /* TODO: set to max (old/new spacing-increment), since other
      voices/staves also may want to set this property. */
-  Item *first_primitive = dynamic_cast<Item*> (primitives[0].grob_);
+  Item *first_primitive = dynamic_cast<Item *> (primitives[0].grob_);
   Paper_column *paper_column = first_primitive->get_column ();
   paper_column->warning (_f ("Vaticana_ligature_engraver: "
                             "setting `spacing-increment = %f': ptr =%ul",
@@ -572,11 +573,10 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
 #endif
 }
 
-
 ADD_TRANSLATOR (Vaticana_ligature_engraver,
-/* descr */       "Handles ligatures by glueing special ligature heads together.",
-/* creats*/       "VaticanaLigature",
-/* accepts */     "ligature-event",
-/* acks  */      "note-head-interface rest-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Handles ligatures by glueing special ligature heads together.",
+               /* creats*/ "VaticanaLigature",
+               /* accepts */ "ligature-event",
+               /* acks  */ "note-head-interface rest-interface",
+               /* reads */ "",
+               /* write */ "");
index f9d6462942a91a2a22359da13c1e061a7690d6f2..d8e8b03e2d13b9ccf6e9af81fab1996d08b7543a 100644 (file)
@@ -1,8 +1,8 @@
 /*
   vaticana-ligature.cc -- implement Vaticana_ligature
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
 */
 
@@ -27,7 +27,7 @@ vaticana_brew_cauda (Grob *me,
                     Real blotdiameter)
 {
   bool on_staffline = Staff_symbol_referencer::on_staffline (me, pos);
-  int interspaces = Staff_symbol_referencer::line_count (me)-1;
+  int interspaces = Staff_symbol_referencer::line_count (me) - 1;
   bool above_staff = pos > interspaces;
 
   if (delta_pitch > -1)
@@ -99,9 +99,9 @@ vaticana_brew_flexa (Grob *me,
    * Compensate curve thickness that appears to be smaller in steep
    * section of bend.
    */
-  Real left_height =
-    right_height +
-    min (0.12 * abs (interval), 0.3) * staff_space;
+  Real left_height
+    = right_height
+    min (0.12 * abs (interval), 0.3) * staff_space;
 
   /*
    * Compensate optical illusion regarding vertical position of left
@@ -130,22 +130,22 @@ vaticana_brew_flexa (Grob *me,
 
   if (solid)
     {
-      Stencil solid_head =
-       Lookup::bezier_sandwich (top_curve, bottom_curve);
+      Stencil solid_head
+       Lookup::bezier_sandwich (top_curve, bottom_curve);
       stencil.add_stencil (solid_head);
     }
   else // outline
     {
       Bezier inner_top_curve = top_curve;
       inner_top_curve.translate (Offset (0.0, -line_thickness));
-      Stencil top_edge =
-       Lookup::bezier_sandwich (top_curve, inner_top_curve);
+      Stencil top_edge
+       Lookup::bezier_sandwich (top_curve, inner_top_curve);
       stencil.add_stencil (top_edge);
 
       Bezier inner_bottom_curve = bottom_curve;
       inner_bottom_curve.translate (Offset (0.0, +line_thickness));
-      Stencil bottom_edge =
-       Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
+      Stencil bottom_edge
+       Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve);
       stencil.add_stencil (bottom_edge);
 
       /*
@@ -205,13 +205,13 @@ vaticana_brew_primitive (Grob *me)
   String glyph_name = ly_scm2string (glyph_name_scm);
 
   Stencil out;
-  Real thickness = robust_scm2double ( me->get_property ("thickness"), 1);
+  Real thickness = robust_scm2double (me->get_property ("thickness"), 1);
 
-  Real line_thickness =
-    thickness * me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+  Real line_thickness
+    thickness * me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
 
-  Real blotdiameter =
-    (me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")));
+  Real blotdiameter
+    (me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")));
 
   int pos = Staff_symbol_referencer::get_rounded_position (me);
 
@@ -222,7 +222,7 @@ vaticana_brew_primitive (Grob *me)
   else
     delta_pitch = 0;
 
-  Real x_offset = robust_scm2double ( me->get_property ("x-offset"), 0);
+  Real x_offset = robust_scm2double (me->get_property ("x-offset"), 0);
 
   bool add_stem = to_boolean (me->get_property ("add-stem"));
   bool add_cauda = to_boolean (me->get_property ("add-cauda"));
@@ -238,9 +238,9 @@ vaticana_brew_primitive (Grob *me)
        * flexa_width.)
        */
       Real staff_space = Staff_symbol_referencer::staff_space (me);
-      Real flexa_width  = robust_scm2double ( me->get_property ("flexa-width"), 2)  *staff_space;
-      out =
-       Lookup::blank (Box (Interval (0, 0.5*flexa_width), Interval (0, 0)));
+      Real flexa_width = robust_scm2double (me->get_property ("flexa-width"), 2) *staff_space;
+      out
+       Lookup::blank (Box (Interval (0, 0.5*flexa_width), Interval (0, 0)));
     }
   else if (!String::compare (glyph_name, "flexa"))
     {
@@ -248,8 +248,8 @@ vaticana_brew_primitive (Grob *me)
     }
   else
     {
-      out =
-       Font_interface::get_default_font (me)->
+      out
+       Font_interface::get_default_font (me)->
        find_by_name ("noteheads." + glyph_name);
     }
   out.translate_axis (x_offset, X_AXIS);
@@ -257,25 +257,25 @@ vaticana_brew_primitive (Grob *me)
 
   if (add_cauda)
     {
-      Stencil cauda =
-       vaticana_brew_cauda (me, pos, delta_pitch,
-                            line_thickness, blotdiameter);
+      Stencil cauda
+       vaticana_brew_cauda (me, pos, delta_pitch,
+                              line_thickness, blotdiameter);
       out.add_stencil (cauda);
     }
 
   if (add_stem)
     {
-      Stencil stem =
-       vaticana_brew_cauda (me, pos, -1,
-                            line_thickness, blotdiameter);
+      Stencil stem
+       vaticana_brew_cauda (me, pos, -1,
+                              line_thickness, blotdiameter);
       stem.translate_axis (head_width - line_thickness, X_AXIS);
       out.add_stencil (stem);
     }
 
   if (add_join)
     {
-      Stencil join =
-       vaticana_brew_join (me, delta_pitch, line_thickness, blotdiameter);
+      Stencil join
+       vaticana_brew_join (me, delta_pitch, line_thickness, blotdiameter);
       join.translate_axis (head_width - line_thickness, X_AXIS);
       out.add_stencil (join);
     }
index f45d48a261602eb7ce68505492f59cf1852e41e3..33c0f1a98a16f25bc7d27bab4f4dbf3fa18c9c81 100644 (file)
@@ -15,8 +15,8 @@
 
 class Vertical_align_engraver : public Engraver
 {
-  Spanner * valign_;
-  bool qualifies (Grob_info) const;  
+  Spanner *valign_;
+  bool qualifies (Grob_info) const;
 public:
   TRANSLATOR_DECLARATIONS (Vertical_align_engraver);
 protected:
@@ -53,7 +53,7 @@ Vertical_align_engraver::finalize ()
 bool
 Vertical_align_engraver::qualifies (Grob_info i) const
 {
-  int sz = i.origin_contexts ((Translator*)this).size ()  ;
+  int sz = i.origin_contexts ((Translator *)this).size ();
 
   return sz > 0 && Axis_group_interface::has_interface (i.grob_)
     && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::has_axis (i.grob_, Y_AXIS);
@@ -68,11 +68,10 @@ Vertical_align_engraver::acknowledge_grob (Grob_info i)
     }
 }
 
-
 ADD_TRANSLATOR (Vertical_align_engraver,
-/* descr */       "Catch Vertical axis groups and stack them.",
-/* creats*/       "VerticalAlignment",
-/* accepts */     "",
-/* acks  */      "axis-group-interface",
-/* reads */       "",
-/* write */       "");
+               /* descr */ "Catch Vertical axis groups and stack them.",
+               /* creats*/ "VerticalAlignment",
+               /* accepts */ "",
+               /* acks  */ "axis-group-interface",
+               /* reads */ "",
+               /* write */ "");
index 3ef1ae950850de3c4753008582e52dac06bab45d..1127f2776aed3f41ef2274272482199c0db16d77 100644 (file)
   --
 
   * Should look for system_start_delim to find left edge of staff.
-  
-*/
+  */
 
 MAKE_SCHEME_CALLBACK (Volta_bracket_interface, print, 1);
 SCM
-Volta_bracket_interface::print (SCM smob) 
+Volta_bracket_interface::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Spanner *orig_span =  dynamic_cast<Spanner*> (me->original_);
+  Spanner *orig_span = dynamic_cast<Spanner *> (me->original_);
 
-  bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner*)me);
+  bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner *)me);
 
-  bool broken_last_bracket = orig_span && (orig_span->broken_intos_.top () == (Spanner*)me);
+  bool broken_last_bracket = orig_span && (orig_span->broken_intos_.top () == (Spanner *)me);
 
   bool no_vertical_start = orig_span && !broken_first_bracket;
   bool no_vertical_end = orig_span && !broken_last_bracket;
   SCM s = me->get_property ("bars");
-  Grob * endbar = scm_is_pair (s) ?  unsmob_grob (scm_car (s)) : 0;
+  Grob *endbar = scm_is_pair (s) ? unsmob_grob (scm_car (s)) : 0;
   SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL;
-  
+
   String str;
   if (scm_is_string (glyph))
     str = ly_scm2string (glyph);
   else
     str = "|";
-  
-  const char* cs = str.to_str0 ();
-  no_vertical_end |=
-    (strcmp (cs, ":|")!= 0 && strcmp (cs, "|:")!= 0 && strcmp (cs, "|.")!= 0
-     && strcmp (cs, ":|:")!= 0 && strcmp (cs, ".|")!= 0);
 
-  Output_def * layout = me->get_layout ();
+  const char *cs = str.to_str0 ();
+  no_vertical_end
+    |= (strcmp (cs, ":|")!= 0 && strcmp (cs, "|:")!= 0 && strcmp (cs, "|.")!= 0
+       && strcmp (cs, ":|:")!= 0 && strcmp (cs, ".|")!= 0);
+
+  Output_def *layout = me->get_layout ();
   Real half_space = 0.5;
 
-  Item * bound = dynamic_cast<Spanner*> (me)->get_bound (LEFT);
+  Item *bound = dynamic_cast<Spanner *> (me)->get_bound (LEFT);
 
   /*
     not a start, but really broken in two
   */
-  Real left = 0.;  
+  Real left = 0.;
   if (bound->break_status_dir () == RIGHT)
     {
       Paper_column *pc = bound->get_column ();
-      left = pc->extent (pc, X_AXIS)[RIGHT]   - bound->relative_coordinate (pc, X_AXIS);
+      left = pc->extent (pc, X_AXIS)[RIGHT] - bound->relative_coordinate (pc, X_AXIS);
     }
   else
     {
@@ -80,13 +79,13 @@ Volta_bracket_interface::print (SCM smob)
       */
     }
 
-  Real w = dynamic_cast<Spanner*> (me)->spanner_length () - left - half_space;
-  Real h =  robust_scm2double (me->get_property ("height"), 1);
+  Real w = dynamic_cast<Spanner *> (me)->spanner_length () - left - half_space;
+  Real h = robust_scm2double (me->get_property ("height"), 1);
 
-  Stencil start, end ;
+  Stencil start, end;
   if (!no_vertical_start)
-    start = Line_interface::line (me, Offset (0, 0), Offset (0, h)); 
-  
+    start = Line_interface::line (me, Offset (0, 0), Offset (0, h));
+
   if (!no_vertical_end)
     end = Line_interface::line (me, Offset (w, 0), Offset (w, h));
 
@@ -98,7 +97,7 @@ Volta_bracket_interface::print (SCM smob)
     {
       SCM text = me->get_property ("text");
       SCM properties = me->get_property_alist_chain (SCM_EOL);
-      SCM snum  = Text_interface::interpret_markup (layout->self_scm (), properties, text);
+      SCM snum = Text_interface::interpret_markup (layout->self_scm (), properties, text);
       Stencil num = *unsmob_stencil (snum);
 
       mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
@@ -108,17 +107,16 @@ Volta_bracket_interface::print (SCM smob)
   return mol.smobbed_copy ();
 }
 
-
 void
-Volta_bracket_interface::add_bar (Grob *me, Itemb)
+Volta_bracket_interface::add_bar (Grob *me, Item *b)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("bars"), b);
   Side_position_interface::add_support (me, b);
-  add_bound_item (dynamic_cast<Spanner*> (me), b); 
+  add_bound_item (dynamic_cast<Spanner *> (me), b);
 }
 
 void
-Volta_bracket_interface::add_column (Grob*me, Grob* c)
+Volta_bracket_interface::add_column (Grob *me, Grob *c)
 {
   Side_position_interface::add_support (me, c);
 }
index cedc195012d7aba69a25a2d0b175485ea9fe2a98..531c6fa02a9bbd6da648f849b66985c829a2ac98 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   volta-engraver.cc -- implement Volta_engraver
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "engraver.hh"
 #include "context.hh"
@@ -19,7 +18,7 @@
 /*
   Create Volta spanners, by reading repeatCommands  property, usually
   set by Unfolded_repeat_iterator.
- */
+*/
 class Volta_engraver : public Engraver
 {
 public:
@@ -30,7 +29,7 @@ protected:
   virtual void finalize ();
   virtual void stop_translation_timestep ();
   virtual void process_music ();
-  
+
   Moment started_mom_;
   Spanner *volta_span_;
   Spanner *end_volta_span_;
@@ -38,7 +37,7 @@ protected:
   SCM start_string_;
 
   bool staff_eligible ();
+
 };
 
 Volta_engraver::Volta_engraver ()
@@ -48,14 +47,13 @@ Volta_engraver::Volta_engraver ()
   end_volta_span_ = 0;
 }
 
-
 /*
   TODO: this logic should be rewritten, it is buggy.
 
   One of the problems is that we can't determine wether or not to
   print the volta bracket during the first step, since that requires
   acknowledging the staff.
- */
+*/
 bool
 Volta_engraver::staff_eligible ()
 {
@@ -65,7 +63,6 @@ Volta_engraver::staff_eligible ()
       return to_boolean (doit);
     }
 
-
   if (!unsmob_grob (staff_))
     return false;
 
@@ -77,10 +74,10 @@ Volta_engraver::staff_eligible ()
 
   /*
     only put a volta on the top staff.
-       
+
     May be this is a bit convoluted, and we should have a single
     volta engraver in score context or somesuch.
-       
+
   */
   if (!scm_is_pair (staffs))
     {
@@ -94,17 +91,15 @@ Volta_engraver::staff_eligible ()
   return true;
 }
 
-
 void
 Volta_engraver::process_music ()
 {
   SCM cs = get_property ("repeatCommands");
 
   if (!staff_eligible ())
-    return ; 
+    return;
 
-    
-  bool  end = false;
+  bool end = false;
   start_string_ = SCM_EOL;
   while (scm_is_pair (cs))
     {
@@ -114,12 +109,12 @@ Volta_engraver::process_music ()
          && scm_car (c) == ly_symbol2scm ("volta")
          && scm_is_pair (scm_cdr (c)))
        {
-         if (scm_cadr (c) ==  SCM_BOOL_F)
+         if (scm_cadr (c) == SCM_BOOL_F)
            end = true;
          else
            start_string_ = scm_cadr (c);
        }
-      
+
       cs = scm_cdr (cs);
     }
 
@@ -127,14 +122,13 @@ Volta_engraver::process_music ()
     {
       SCM l (get_property ("voltaSpannerDuration"));
       Moment now = now_mom ();
-  
+
       bool early_stop = unsmob_moment (l)
        && *unsmob_moment (l) <= now - started_mom_;
-      
+
       end = end || early_stop;
     }
 
-  
   if (end && !volta_span_)
     {
       warning (_ ("No volta spanner to end")); // fixme: be more verbose.
@@ -145,38 +139,36 @@ Volta_engraver::process_music ()
       volta_span_ = 0;
     }
 
-  if (volta_span_ && 
-      (scm_is_string (start_string_) || scm_is_pair (start_string_)))
+  if (volta_span_
+      && (scm_is_string (start_string_) || scm_is_pair (start_string_)))
     {
       warning (_ ("Already have a volta spanner.  Stopping that one prematurely."));
-      
+
       if (end_volta_span_)
        {
          warning (_ ("Also have a stopped spanner.  Giving up."));
-         return ;
+         return;
        }
 
       end_volta_span_ = volta_span_;
       volta_span_ = 0;
     }
 
-  if (!volta_span_ && 
-      (scm_is_string (start_string_) || scm_is_pair (start_string_)))
+  if (!volta_span_
+      && (scm_is_string (start_string_) || scm_is_pair (start_string_)))
     {
-      started_mom_ = now_mom () ;
+      started_mom_ = now_mom ();
 
       volta_span_ = make_spanner ("VoltaBracket", SCM_EOL);
 
-      
       volta_span_->set_property ("text", start_string_);
     }
 }
 
-
 void
 Volta_engraver::acknowledge_grob (Grob_info i)
 {
-  if (Item* item = dynamic_cast<Item*> (i.grob_))
+  if (Item *item = dynamic_cast<Item *> (i.grob_))
     {
       if (Note_column::has_interface (item))
        {
@@ -188,7 +180,7 @@ Volta_engraver::acknowledge_grob (Grob_info i)
          if (volta_span_)
            Volta_bracket_interface::add_bar (volta_span_, item);
          if (end_volta_span_)
-           Volta_bracket_interface::add_bar (end_volta_span_ , item);
+           Volta_bracket_interface::add_bar (end_volta_span_, item);
        }
     }
   else if (Staff_symbol::has_interface (i.grob_))
@@ -209,9 +201,7 @@ Volta_engraver::finalize ()
 {
 }
 
-
-
-void 
+void
 Volta_engraver::stop_translation_timestep ()
 {
   if (volta_span_ && !staff_eligible ())
@@ -222,15 +212,15 @@ Volta_engraver::stop_translation_timestep ()
        we need to do this here, because STAFF_ is not initialized yet
        in the 1st call of process_music ()
       */
-      
-      volta_span_->suicide ( );
+
+      volta_span_->suicide ();
       volta_span_ = 0;
     }
-  
+
   if (end_volta_span_ && !end_volta_span_->get_bound (RIGHT))
     {
-      Grob * cc = unsmob_grob (get_property ("currentCommandColumn"));
-      Item * ci = dynamic_cast<Item*> (cc);
+      Grob *cc = unsmob_grob (get_property ("currentCommandColumn"));
+      Item *ci = dynamic_cast<Item *> (cc);
       end_volta_span_->set_bound (RIGHT, ci);
     }
 
@@ -238,21 +228,21 @@ Volta_engraver::stop_translation_timestep ()
 
   if (volta_span_ && !volta_span_->get_bound (LEFT))
     {
-      Grob * cc = unsmob_grob (get_property ("currentCommandColumn"));
-      Item * ci = dynamic_cast<Item*> (cc);
+      Grob *cc = unsmob_grob (get_property ("currentCommandColumn"));
+      Item *ci = dynamic_cast<Item *> (cc);
       volta_span_->set_bound (LEFT, ci);
     }
-  
+
 }
 
 /*
   TODO: should attach volta to paper-column if no bar is found.
- */
+*/
 
 ADD_TRANSLATOR (Volta_engraver,
-/* descr */       "Make volta brackets.",
-/* creats*/       "VoltaBracket",
-/* accepts */     "",
-/* acks  */       "bar-line-interface staff-symbol-interface note-column-interface",
-/* reads */       "repeatCommands voltaSpannerDuration stavesFound",
-/* write */       "");
+               /* descr */ "Make volta brackets.",
+               /* creats*/ "VoltaBracket",
+               /* accepts */ "",
+               /* acks  */ "bar-line-interface staff-symbol-interface note-column-interface",
+               /* reads */ "repeatCommands voltaSpannerDuration stavesFound",
+               /* write */ "");