X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fpage-breaking.hh;h=9a38485c28d181c0b6781879079e03272444394e;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=d34534c1ca4eb462b6c1fb9ff4f1bd8ce270d10e;hpb=60d641c51caa5a53b185d40b6f6825417670887e;p=lilypond.git diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh index d34534c1ca..9a38485c28 100644 --- a/lily/include/page-breaking.hh +++ b/lily/include/page-breaking.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2010 Joe Neeman + Copyright (C) 2006--2015 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 @@ -52,23 +52,24 @@ struct System_spec struct Break_position { /* - index in system_spec_index_, if VPOS start of book. + index into system_specs_, if this is VPOS, the Break_position represents the + start of the book. */ vsize system_spec_index_; - /* if system_spec_index_ is a score, then we start at the score_brk_'th possible - page-break in the score */ - vsize score_break_; + /* if system_spec_index_ indexes a score, then we start at the score_brk_'th + possible page-break in the score */ + vsize score_break_; - /* if system_spec_index_ is a score, this points to the broken column */ - Grob *col_; + /* if system_spec_index_ indexes a score, this points to the broken column */ + 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) + Break_position (vsize s = VPOS, vsize brk = VPOS, Grob *g = NULL, bool end = false) { system_spec_index_ = s; score_break_ = brk; @@ -80,18 +81,18 @@ struct Break_position /* lexicographic in (system_spec_index_, score_break_) */ - bool operator< (const Break_position &other) + bool operator < (const Break_position &other) { return (system_spec_index_ == VPOS && other.system_spec_index_ != VPOS) - || (system_spec_index_ < other.system_spec_index_) - || (system_spec_index_ == other.system_spec_index_ && score_break_ < other.score_break_); + || (system_spec_index_ < other.system_spec_index_) + || (system_spec_index_ == other.system_spec_index_ && score_break_ < other.score_break_); } - bool operator<= (const Break_position &other) + bool operator <= (const Break_position &other) { return (system_spec_index_ == VPOS) - || (system_spec_index_ < other.system_spec_index_ && other.system_spec_index_ != VPOS) - || (system_spec_index_ == other.system_spec_index_ && score_break_ <= other.score_break_); + || (system_spec_index_ < other.system_spec_index_ && other.system_spec_index_ != VPOS) + || (system_spec_index_ == other.system_spec_index_ && score_break_ <= other.score_break_); } }; @@ -101,7 +102,7 @@ public: typedef bool (*Break_predicate) (Grob *); typedef bool (*Prob_break_predicate) (Prob *); typedef vector Line_division; - + /* TODO: naming. @@ -121,13 +122,19 @@ 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 footnote_separator_stencil_height () const; + Real footnote_padding () const; + Real in_note_padding () const; + Real footnote_number_raise () const; + Real footnote_footer_padding () 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; + Real min_whitespace_at_top_of_page (Line_details const &) const; + Real min_whitespace_at_bottom_of_page (Line_details const &) const; int orphan_penalty () const; protected: @@ -140,30 +147,30 @@ protected: vsize min_system_count (vsize start, vsize end); vsize max_system_count (vsize start, vsize end); - void break_into_pieces (vsize start, vsize end, Line_division const &div); SCM systems (); + SCM footnotes (); void set_current_breakpoints (vsize start, - vsize end, - vsize system_count, - Line_division lower_bound = Line_division (), - Line_division upper_bound = Line_division ()); + vsize end, + vsize system_count, + Line_division lower_bound = Line_division (), + Line_division upper_bound = Line_division ()); void set_to_ideal_line_configuration (vsize start, vsize end); 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, - Real penalty_for_fewer_pages); + vsize first_page_num, + Real penalty_for_fewer_pages); 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); + vsize first_page_num); Page_spacing_result pack_systems_on_least_pages (vsize configuration_index, - vsize first_page_num); + 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; @@ -171,10 +178,11 @@ protected: SCM breakpoint_property (vsize breakpoint, char const *str); vsize last_break_position () const; + + vector system_specs_; private: vector breaks_; vector chunks_; - vector system_specs_; vector line_breaking_; bool ragged_; bool ragged_last_; @@ -182,6 +190,11 @@ private: int max_systems_per_page_; int min_systems_per_page_; vsize system_count_; + Real footnote_separator_stencil_height_; + Real footnote_padding_; + Real in_note_padding_; + Real footnote_number_raise_; + Real footnote_footer_padding_; int orphan_penalty_; vector current_configurations_; @@ -196,21 +209,22 @@ private: vector cached_line_details_; vector uncompressed_line_details_; + Real paper_height_; mutable vector page_height_cache_; mutable vector last_page_height_cache_; vector chunk_list (vsize start, vsize end); Line_division system_count_bounds (vector const &chunks, bool min); void line_breaker_args (vsize i, - Break_position const &start, - Break_position const &end, - vsize *line_breaker_start, - vsize *line_breaker_end); + Break_position const &start, + Break_position const &end, + vsize *line_breaker_start, + vsize *line_breaker_end); void line_divisions_rec (vsize system_count, - Line_division const &min, - Line_division const &max, - Line_division *cur); + Line_division const &min, + Line_division const &max, + Line_division *cur); vector line_details (vsize start, vsize end, Line_division const &div); Page_spacing_result space_systems_on_1_page (vector const &lines, Real page_height, bool ragged);