X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fpage-spacing.hh;h=206bcbf426bb4193ab7c0bdf03c3665c01711229;hb=75d9336b83e91fa3bbab43b31099f3d5d00f8b47;hp=b670387ad691a1375c7002633d2832ace33dded2;hpb=e18531db1f79fb685fbd16d6a2a67bf4b6c09915;p=lilypond.git diff --git a/lily/include/page-spacing.hh b/lily/include/page-spacing.hh index b670387ad6..206bcbf426 100644 --- a/lily/include/page-spacing.hh +++ b/lily/include/page-spacing.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2010 Joe Neeman + Copyright (C) 2006--2011 Joe Neeman LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,6 +53,7 @@ class Page_spacer public: Page_spacer (vector const &lines, vsize first_page_num, Page_breaking const*); Page_spacing_result solve (vsize page_count); + Page_spacing_result solve (); private: struct Page_spacing_node @@ -64,19 +65,27 @@ private: penalty_ = infinity_f; prev_ = VPOS; system_count_status_ = SYSTEM_COUNT_OK; + page_ = 0; } Real demerits_; Real force_; Real penalty_; vsize prev_; + vsize page_; int system_count_status_; }; Page_breaking const *breaker_; vsize first_page_num_; vector lines_; + + // If a page-count is requested, we use state_, which + // is indexed by page*system, for our dynamic programming + // intermediate storage. Otherwise, we use simple_state_, + // which is indexed only by system. Matrix state_; + vector simple_state_; vsize max_page_count_; bool ragged_; @@ -93,6 +102,7 @@ struct Page_spacing Real rod_height_; Real spring_len_; Real inverse_spring_k_; + bool has_footnotes_; Line_details last_line_; Line_details first_line_; @@ -102,11 +112,13 @@ struct Page_spacing { page_height_ = page_height; breaker_ = breaker; + has_footnotes_ = false; clear (); } void calc_force (); void resize (Real new_height); + Real account_for_footnotes (Line_details const &line); void append_system (const Line_details &line); void prepend_system (const Line_details &line); void clear ();