X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fpage-spacing.hh;h=846fe1be3e12043f86db917733283eb0eacd345b;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=7dba158c84929bfd8fa182dd39afa5415d29ddbd;hpb=f1c03fdebfcb3ab05816eacb688fd7a7568f3ef1;p=lilypond.git diff --git a/lily/include/page-spacing.hh b/lily/include/page-spacing.hh index 7dba158c84..846fe1be3e 100644 --- a/lily/include/page-spacing.hh +++ b/lily/include/page-spacing.hh @@ -4,39 +4,25 @@ source file of the GNU LilyPond music typesetter - (c) 2006--2007 Joe Neeman + (c) 2006--2008 Joe Neeman */ #ifndef PAGE_SPACING_HH #define PAGE_SPACING_HH #include "constrained-breaking.hh" +#include "page-spacing-result.hh" -struct Spacing_result { - vector systems_per_page_; - vector force_; - Real penalty_; - Real demerits_; - - Spacing_result () - { - penalty_ = 0; - demerits_ = infinity_f; - } -}; /* for page_count > 2, we use a dynamic algorithm similar to constrained-breaking -- we have a class that stores the intermediate calculations so they can be reused for querying different page counts. */ - -class Page_breaking; - class Page_spacer { public: Page_spacer (vector const &lines, vsize first_page_num, Page_breaking const*); - Spacing_result solve (vsize page_count); + Page_spacing_result solve (vsize page_count); private: struct Page_spacing_node @@ -75,21 +61,23 @@ struct Page_spacing Real rod_height_; Real spring_len_; Real inverse_spring_k_; + Real page_top_space_; Line_details last_line_; + Line_details first_line_; - Page_spacing (Real page_height) + Page_spacing (Real page_height, Real page_top_space) { page_height_ = page_height; + page_top_space_ = page_top_space; clear (); } void calc_force (); - + void resize (Real new_height); void append_system (const Line_details &line); void prepend_system (const Line_details &line); void clear (); }; -Real line_space (Line_details const &line); #endif /* PAGE_SPACING_HH */