]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/page-breaking.hh
Fix regression with page-spacing-tall-headfoot.ly.
[lilypond.git] / lily / include / page-breaking.hh
index b643a11c9cc9bc5b4fea3857f5e5f9c5dbd2a4c6..45ec467dc23f6daed3aca01416012f1137217708 100644 (file)
@@ -99,6 +99,7 @@ class Page_breaking
 {
 public:
   typedef bool (*Break_predicate) (Grob *);
+  typedef bool (*Prob_break_predicate) (Prob *);
   typedef vector<vsize> Line_division;
   
   /*
@@ -109,7 +110,7 @@ public:
    */
   virtual SCM solve () = 0;
 
-  Page_breaking (Paper_book *pb, Break_predicate);
+  Page_breaking (Paper_book *pb, Break_predicate, Prob_break_predicate);
   virtual ~Page_breaking ();
 
   bool ragged () const;
@@ -120,6 +121,7 @@ public:
   int max_systems_per_page () const;
   int min_systems_per_page () const;
   Real page_height (int page_number, bool last) const;
+  Real paper_height () const;
   vsize system_count () const;
   Real line_count_penalty (int line_count) const;
   int line_count_status (int line_count) const;
@@ -189,11 +191,16 @@ private:
   vsize current_end_breakpoint_;
 
   void cache_line_details (vsize configuration_index);
+  void compute_line_heights ();
   void clear_line_details_cache ();
   vsize cached_configuration_index_;
   vector<Line_details> cached_line_details_;
   vector<Line_details> uncompressed_line_details_;
 
+  Real paper_height_;
+  mutable vector<Real> page_height_cache_;
+  mutable vector<Real> last_page_height_cache_;
+
   vector<Break_position> chunk_list (vsize start, vsize end);
   Line_division system_count_bounds (vector<Break_position> const &chunks, bool min);
   void line_breaker_args (vsize i,
@@ -212,7 +219,7 @@ private:
   Page_spacing_result space_systems_on_2_pages (vsize configuration_index, vsize first_page_num);
   Page_spacing_result finalize_spacing_result (vsize configuration_index, Page_spacing_result);
   void create_system_list ();
-  void find_chunks_and_breaks (Break_predicate);
+  void find_chunks_and_breaks (Break_predicate, Prob_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);