]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/page-breaking.hh
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / lily / include / page-breaking.hh
index 52a95812c41f9d707b4395d7cbd8c401b02f846e..e0b2abac33f48a6df6bf21762a04a874d5356365 100644 (file)
@@ -4,7 +4,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2006--2007 Joe Neeman <joeneeman@gmail.com>
+  (c) 2006--2009 Joe Neeman <joeneeman@gmail.com>
 */
 
 #ifndef PAGE_BREAKING_HH
@@ -54,12 +54,17 @@ struct Break_position
   Grob *col_;  
   bool score_ender_;
 
+  /* if non-zero, this is the (fixed, uncompressed) number of lines between
+     this Break_position and the previous. */
+  int forced_line_count_;
+
   Break_position (vsize s=VPOS, vsize brk=VPOS, Grob *g=NULL, bool end=false)
   {
     system_spec_index_ = s;
     score_break_ = brk;
     col_ = g;
     score_ender_ = end;
+    forced_line_count_ = 0;
   }
 
   /*
@@ -100,7 +105,18 @@ public:
   bool ragged () const;
   bool ragged_last () const;
   bool is_last () const;
+  bool ends_score () const;
+  int systems_per_page () const;
+  int max_systems_per_page () const;
+  int min_systems_per_page () const;
   Real page_height (int page_number, bool last) const;
+  vsize system_count () const;
+  Real line_count_penalty (int line_count) const;
+  int line_count_status (int line_count) const;
+  bool too_many_lines (int line_count) const;
+  bool too_few_lines (int line_count) const;
+  Real min_whitespace_at_top_of_page (Line_details const&) const;
+  Real min_whitespace_at_bottom_of_page (Line_details const&) const;
 
 protected:
   Paper_book *book_;
@@ -126,11 +142,13 @@ protected:
   vsize current_configuration_count () const;
   Line_division current_configuration (vsize configuration_index) const;
   Page_spacing_result space_systems_on_n_pages (vsize configuration_index,
-                                          vsize n, vsize first_page_num);
+                                               vsize n, vsize first_page_num);
   Page_spacing_result space_systems_on_n_or_one_more_pages (vsize configuration_index, vsize n,
-                                                      vsize first_page_num);
+                                                           vsize first_page_num);
   Page_spacing_result space_systems_on_best_pages (vsize configuration_index,
-                                             vsize first_page_num);
+                                                  vsize first_page_num);
+  Page_spacing_result space_systems_with_fixed_number_per_page (vsize configuration_index,
+                                                               vsize first_page_num);
   Page_spacing_result pack_systems_on_least_pages (vsize configuration_index,
                                                   vsize first_page_num);
   vsize min_page_count (vsize configuration_index, vsize first_page_num);
@@ -147,6 +165,10 @@ private:
   vector<Constrained_breaking> line_breaking_;
   bool ragged_;
   bool ragged_last_;
+  int systems_per_page_;
+  int max_systems_per_page_;
+  int min_systems_per_page_;
+  vsize system_count_;
 
   vector<Line_division> current_configurations_;
   vector<Break_position> current_chunks_;
@@ -178,5 +200,8 @@ private:
   Page_spacing_result finalize_spacing_result (vsize configuration_index, Page_spacing_result);
   void create_system_list ();
   void find_chunks_and_breaks (Break_predicate);
+  SCM make_page (int page_num, bool last) const;
+  SCM get_page_configuration (SCM systems, int page_num, bool ragged, bool last);
+  SCM draw_page (SCM systems, SCM config, int page_num, bool last);
 };
 #endif /* PAGE_BREAKING_HH */