]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/system.cc
* stepmake/aclocal.m4 (STEPMAKE_KPATHSEA): Do not include
[lilypond.git] / lily / system.cc
index d16b5a3b4e85c1134e6e6c422c3d4a20f9c443db..d667bdd2a0a22d32a5f58879e04c61b5075ad131 100644 (file)
@@ -3,23 +3,21 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "system.hh"
+
 #include <math.h>
 
 #include "align-interface.hh"
 #include "axis-group-interface.hh"
 #include "warn.hh"
-#include "system.hh"
 #include "main.hh"
 #include "paper-column.hh"
 #include "output-def.hh"
-#include "paper-outputter.hh"
 #include "paper-score.hh"
-#include "string.hh"
 #include "warn.hh"
-#include "stencil.hh"
 #include "all-font-metrics.hh"
 #include "spacing-interface.hh"
 #include "staff-symbol-referencer.hh"
@@ -114,7 +112,7 @@ System::get_lines ()
     fixups must be done in broken line_of_scores, because new elements
     are put over there.  */
   int count = 0;
-  for (int i=0; i < broken_intos_.size (); i++)
+  for (int i = 0; i < broken_intos_.size (); i++)
     {
       Grob *se = broken_intos_[i];
       SCM all = se->get_property ("all-elements");
@@ -146,7 +144,7 @@ System::get_lines ()
     }
 #endif
   
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (_f ("Element count %d.",  count + element_count ()));
 
   int line_count = broken_intos_.size ();
@@ -154,14 +152,14 @@ System::get_lines ()
   
   for (int i = 0; i < line_count; i++)
     {
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[");
 
       System *system = dynamic_cast<System*> (broken_intos_[i]);
       system->post_processing ();
       scm_vector_set_x (lines, scm_int2num (i), system->get_line ());
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication (to_string (i) + "]");
     }
   return lines;
@@ -217,7 +215,7 @@ set_loose_columns (System* which, Column_x_positions const *posns)
       Real rx =        right->extent (common, X_AXIS)[LEFT];
       Real lx = left->extent (common, X_AXIS)[RIGHT];
       Real total_dx = rx - lx;
-      Interval cval =col->extent (col, X_AXIS);
+      Interval cval = col->extent (col, X_AXIS);
 
       /* Put it in the middle.  This is not an ideal solution -- the
         break alignment code inserts a fixed space before the clef
@@ -252,8 +250,8 @@ System::break_into_pieces (Array<Column_x_positions> const &breaking)
       Link_array<Grob> c (breaking[i].cols_);
       pscore_->typeset_line (system);
       
-      system->set_bound (LEFT,c[0]);
-      system->set_bound (RIGHT,c.top ());
+      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);
@@ -299,7 +297,7 @@ System::pre_processing ()
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
     unsmob_grob (scm_car (s))->discretionary_processing ();
 
-  if (verbose_global_b)
+  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))
@@ -370,12 +368,10 @@ System::get_line ()
   SCM exprs = SCM_EOL;
   SCM *tail = &exprs;
 
-  /* Output stencils in three layers: 0, 1, 2.  Default layer: 1.
-
-     Start with layer 3, since scm_cons prepends to list.  */
+  /* Output stencils in three layers: 0, 1, 2.  Default layer: 1. */
   SCM all = get_property ("all-elements");
   
-  for (int i = LAYER_COUNT; i--;)
+  for (int i = 0; i < LAYER_COUNT; i++)
     for (SCM s = all; scm_is_pair (s); s = scm_cdr (s))
       {
        Grob *g = unsmob_grob (scm_car (s));
@@ -398,6 +394,7 @@ System::get_line ()
 
        Stencil st = *stil;
        st.translate (o + extra);
+
        *tail = scm_cons (st.expr (), SCM_EOL);
        tail = SCM_CDRLOC(*tail);
       }
@@ -407,7 +404,7 @@ System::get_line ()
 
   Interval x (extent (this, X_AXIS));
   Interval y (extent (this, Y_AXIS));
-  Stencil sys_stencil (Box (x,y),
+  Stencil sys_stencil (Box (x, y),
                       scm_cons (ly_symbol2scm ("combine-stencil"),
                                 exprs));
 
@@ -423,8 +420,8 @@ System::get_line ()
  
   Paper_system *pl = new Paper_system (sys_stencil, false);
   pl->staff_refpoints_ = staff_refpoints;
-  Item * break_point =this->get_bound(LEFT);
-  pl->penalty_ =
+  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 ());
@@ -482,7 +479,7 @@ System::columns () const
   return acs;
 }
 
-ADD_INTERFACE (System,"system-interface",
+ADD_INTERFACE (System, "system-interface",
               "This is the toplevel object: each object in a score "
               "ultimately has a System object as its X and Y parent. ",
               "all-elements spaceable-staves columns")