]> git.donarmstrong.com Git - lilypond.git/commitdiff
formatting nits
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 20 May 2007 19:51:01 +0000 (16:51 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 20 May 2007 19:51:01 +0000 (16:51 -0300)
lily/include/constrained-breaking.hh
lily/include/page-breaking.hh
lily/optimal-page-breaking.cc
lily/page-breaking.cc

index 2478afcacaa0281638fc1deed859a4b0ef7e8155..2d93ff2a8d9a28f5d985d55dfe07ad947702b66f 100644 (file)
@@ -17,7 +17,9 @@
 struct Line_details {
   Real force_;
   Interval extent_;   /* Y-extent of the system */
-  Real padding_;  /* compulsory space after this system (if we're not last on a page) */
+
+  Real padding_;  /* compulsory space after this system (if we're not
+                    last on a page) */
   Real bottom_padding_;
   Real space_;    /* spring length */
   Real inverse_hooke_;
index aefa1add24e751c57ddf78ca7ca9facd3e648671..dc33a53070253b8ce44d45b2e402360cd4a50d3c 100644 (file)
@@ -75,6 +75,13 @@ class Page_breaking
 public:
   typedef bool (*Break_predicate) (Grob *);
   typedef vector<vsize> Line_division;
+  
+  /*
+    TODO: naming.
+
+    determine the page breaking, and break scores into lines
+    appropriately.
+   */
   virtual SCM solve () = 0;
 
   Page_breaking (Paper_book *pb, Break_predicate);
@@ -108,9 +115,12 @@ protected:
 
   vsize current_configuration_count () const;
   Line_division current_configuration (vsize configuration_index) const;
-  Spacing_result space_systems_on_n_pages (vsize configuration_index, vsize n, vsize first_page_num);
-  Spacing_result space_systems_on_n_or_one_more_pages (vsize configuration_index, vsize n, vsize first_page_num);
-  Spacing_result space_systems_on_best_pages (vsize configuration_index, vsize first_page_num);
+  Spacing_result space_systems_on_n_pages (vsize configuration_index,
+                                          vsize n, vsize first_page_num);
+  Spacing_result space_systems_on_n_or_one_more_pages (vsize configuration_index, vsize n,
+                                                      vsize first_page_num);
+  Spacing_result space_systems_on_best_pages (vsize configuration_index,
+                                             vsize first_page_num);
   vsize min_page_count (vsize configuration_index, vsize first_page_num);
   bool all_lines_stretched (vsize configuration_index);
   Real blank_page_penalty () const;
index d9aec185505b928192fbc35354a19fcb01bf1a21..c3d3f03315fdff4da77db5a39c2398517bd7f000 100644 (file)
@@ -41,6 +41,7 @@ Optimal_page_breaking::solve ()
   vsize ideal_sys_count = 0;
   vsize max_sys_count = max_system_count (0, end);
   vsize page_count = 0;
+  
   Line_division ideal_line_division;
   Line_division best_division;
   Line_division bound;
index 46a1eed02d04d81c0e65bd51fccea9582d275881..b6d1b93e8a1c0de6033e374ee3910f4f063ff304 100644 (file)
@@ -19,7 +19,8 @@
 #include "system.hh"
 #include "warn.hh"
 
-/* for each forbidden page break, merge the systems around it into one system. */
+/* for each forbidden page break, merge the systems around it into one
+   system. */
 static vector<Line_details>
 compress_lines (const vector<Line_details> &orig)
 {
@@ -141,7 +142,8 @@ Page_breaking::line_breaker_args (vsize sys,
 }
 
 void
-Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_division const &div)
+Page_breaking::break_into_pieces (vsize start_break, vsize end_break,
+                                 Line_division const &div)
 {
   vector<Break_position> chunks = chunk_list (start_break, end_break);
   bool ignore_div = false;
@@ -176,8 +178,10 @@ Page_breaking::systems ()
     {
       if (all_[sys].pscore_)
        {
-         all_[sys].pscore_->root_system ()->do_break_substitution_and_fixup_refpoints ();
-         SCM lines = all_[sys].pscore_->root_system ()->get_broken_system_grobs ();
+         all_[sys].pscore_->root_system ()
+           ->do_break_substitution_and_fixup_refpoints ();
+         SCM lines = all_[sys].pscore_->root_system ()
+           ->get_broken_system_grobs ();
          ret = scm_cons (lines, ret);
        }
       else
@@ -233,18 +237,21 @@ Page_breaking::make_pages (vector<vsize> lines_per_page, SCM systems)
   page_stencil = scm_variable_ref (page_stencil);
 
   SCM book = book_->self_scm ();
-  int first_page_number = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1);
+  int first_page_number
+    = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1);
   SCM ret = SCM_EOL;
 
   for (vsize i = 0; i < lines_per_page.size (); i++)
     {
       SCM page_num = scm_from_int (i + first_page_number);
       SCM last = scm_from_bool (i == lines_per_page.size () - 1);
-      SCM rag = scm_from_bool (ragged () || (to_boolean (last) && ragged_last ()));
+      SCM rag = scm_from_bool (ragged () || (to_boolean (last)
+                                            && ragged_last ()));
       SCM line_count = scm_from_int (lines_per_page[i]);
       SCM lines = scm_list_head (systems, line_count);
       SCM page = scm_apply_0 (make_page,
-                             scm_list_n (book, lines, page_num, rag, last, SCM_UNDEFINED));
+                             scm_list_n (book, lines, page_num,
+                                         rag, last, SCM_UNDEFINED));
 
       scm_apply_1 (page_stencil, page, SCM_EOL);
       ret = scm_cons (page, ret);
@@ -381,7 +388,8 @@ Page_breaking::max_system_count (vsize start, vsize end)
 }
 
 Page_breaking::Line_division
-Page_breaking::system_count_bounds (vector<Break_position> const &chunks, bool min)
+Page_breaking::system_count_bounds (vector<Break_position> const &chunks,
+                                   bool min)
 {
   assert (chunks.size () >= 2);