]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/system.cc
* lily/paper-score.cc (process): Do not show progress newline.
[lilypond.git] / lily / system.cc
index 9b8499810f3d54a8a2fe81e0c472a6573d3defc3..0d2ce87b9ddbf9996721207b37373f307d7118dc 100644 (file)
@@ -23,7 +23,7 @@
 #include "spacing-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "paper-book.hh"
-#include "paper-line.hh"
+#include "paper-system.hh"
 
 System::System (SCM s)
   : Spanner (s)
@@ -269,7 +269,6 @@ System::pre_processing ()
 
   if (verbose_global_b)
     progress_indication (_f ("Grob count %d", element_count ()));
-
   
   for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
     unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
@@ -278,11 +277,13 @@ System::pre_processing ()
   
   for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
     {
-      Grobsc = unsmob_grob (ly_car (s));
+      Grob *sc = unsmob_grob (ly_car (s));
       sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
     }
   
-  progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
+  progress_indication ("\n");
+  progress_indication (_ ("Calculating line breaks..."));
+  progress_indication (" ");
   for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
     {
       Grob *e = unsmob_grob (ly_car (s));
@@ -339,7 +340,6 @@ System::get_line ()
   SCM exprs = SCM_EOL;
   SCM *tail = &exprs;
 
-  Real penalty = 0;
   for (int i = LAYER_COUNT; i--;)
     for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s))
       {
@@ -366,34 +366,22 @@ System::get_line ()
        *tail = scm_cons (st.expr (), SCM_EOL);
        tail = SCM_CDRLOC(*tail);
        
-       /*
-         UGH. back-end should extract this info from the System? 
-        */
-       if (g->original_)
-         {
-           /*
-             Huh ? penalties from all columns are added ??!! --hwn
-            */
-           if (Item *it = dynamic_cast <Item*> (g))
-             {
-               Grob *col = it->get_column ();
-               SCM s = col->get_property ("page-penalty");
-               
-               // FIXME; page breaking is not discrete at +-10000
-               if (ly_c_number_p (s)) // && fabs (ly_scm2double (s)) < 10000)
-                 penalty += ly_scm2double (s);
-             }
-         }
       }
 
+  
+
   Interval x (extent (this, X_AXIS));
   Interval y (extent (this, Y_AXIS));
   Stencil sys_stencil (Box (x,y),
                       scm_cons (ly_symbol2scm ("combine-stencil"),
                                 exprs));
   
-  Paper_line *pl = new Paper_line (sys_stencil, (int) penalty, false);
+  Paper_system *pl = new Paper_system (sys_stencil, false);
 
+  Item * break_point =this->get_bound(LEFT);
+  pl->penalty_ =
+    robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
+  
   return scm_gc_unprotect_object (pl->self_scm ());
 }