]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-score.cc
patch::: 1.3.33.jcn3
[lilypond.git] / lily / paper-score.cc
index 4a78ff3fb358ac223fdba3768a61cfd7c32af234..41a4fcd8e0e18c8f79d423bdedb4e982b5d25fcc 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996,  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "main.hh"
@@ -49,8 +49,8 @@ Paper_score::typeset_element (Score_element * elem_p)
 {
   elem_p->pscore_l_ = this;
 
-  SCM_CDR(element_smob_list_) = gh_cons (elem_p->self_scm_,
-                                        SCM_CDR (element_smob_list_));
+  gh_set_cdr_x(element_smob_list_,
+              gh_cons (elem_p->self_scm_, gh_cdr (element_smob_list_)));
   elem_p->set_elt_property ("full-name",
                            gh_str02scm((char*)elem_p->name()));
   
@@ -75,10 +75,10 @@ Paper_score::print () const
   DEBUG_OUT << "Paper_score { ";
   DEBUG_OUT << "\n elements: ";
 
-  for (SCM p = SCM_CDR (element_smob_list_);
+  for (SCM p = gh_cdr (element_smob_list_);
        p != SCM_EOL;
-       p = SCM_CDR(p))
-    gh_display (SCM_CAR(p));
+       p = gh_cdr(p))
+    gh_display (gh_car (p));
   DEBUG_OUT << "}\n";
 #endif
 }
@@ -110,19 +110,29 @@ Paper_score::calc_breaking ()
 void
 Paper_score::process ()
 {
-
   print ();
-  *mlog << _ ("Preprocessing elements...") << " " << flush;
+  progress_indication (_ ("Preprocessing elements...") + " ");
   line_l_->breakable_col_processing ();
   fixup_refpoints ();
   line_l_->pre_processing ();
   
-  *mlog << '\n' << _ ("Calculating column positions...") << " " << flush;
+  progress_indication ("\n" + _ ("Calculating column positions...") + " " );
   line_l_->space_processing ();
 
   Array<Column_x_positions> breaking = calc_breaking ();
   line_l_->break_into_pieces (breaking);
 
+  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element *sc = unsmob_element (gh_car (s));
+      sc->do_break_processing ();
+    }
+  for (SCM s = element_smob_list_; gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element *sc = unsmob_element (gh_car (s));
+      sc->handle_broken_dependencies ();
+    }
+  
   outputter_l_ = new Paper_outputter ;
   outputter_l_->output_header ();
 
@@ -213,8 +223,13 @@ Paper_score::fixup_refpoints ()
       SCM e = gh_car (s);
       if (SMOB_IS_TYPE_B(Score_element, e))
        {
-         Score_element * se = SMOB_TO_TYPE (Score_element,e );
+         Score_element * se = unsmob_element (e);
          se->fixup_refpoint ();
+
+         if (!dynamic_cast<Line_of_score*> (se) && !se->parent_l (Y_AXIS))
+           {
+             programming_error ("No parent!");
+           }
        }
     }
 }