From: Han-Wen Nienhuys Date: Sun, 20 May 2007 19:51:01 +0000 (-0300) Subject: formatting nits X-Git-Tag: release/2.11.25-1~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e9488911dfa6085f346f9178fd650fcc6ec8bef5;p=lilypond.git formatting nits --- diff --git a/lily/include/constrained-breaking.hh b/lily/include/constrained-breaking.hh index 2478afcaca..2d93ff2a8d 100644 --- a/lily/include/constrained-breaking.hh +++ b/lily/include/constrained-breaking.hh @@ -17,7 +17,9 @@ struct Line_details { Real force_; Interval extent_; /* Y-extent of the system */ - Real padding_; /* compulsory space after this system (if we're not last on a page) */ + + Real padding_; /* compulsory space after this system (if we're not + last on a page) */ Real bottom_padding_; Real space_; /* spring length */ Real inverse_hooke_; diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh index aefa1add24..dc33a53070 100644 --- a/lily/include/page-breaking.hh +++ b/lily/include/page-breaking.hh @@ -75,6 +75,13 @@ class Page_breaking public: typedef bool (*Break_predicate) (Grob *); typedef vector Line_division; + + /* + TODO: naming. + + determine the page breaking, and break scores into lines + appropriately. + */ virtual SCM solve () = 0; Page_breaking (Paper_book *pb, Break_predicate); @@ -108,9 +115,12 @@ protected: vsize current_configuration_count () const; Line_division current_configuration (vsize configuration_index) const; - Spacing_result space_systems_on_n_pages (vsize configuration_index, vsize n, vsize first_page_num); - Spacing_result space_systems_on_n_or_one_more_pages (vsize configuration_index, vsize n, vsize first_page_num); - Spacing_result space_systems_on_best_pages (vsize configuration_index, vsize first_page_num); + Spacing_result space_systems_on_n_pages (vsize configuration_index, + vsize n, vsize first_page_num); + Spacing_result space_systems_on_n_or_one_more_pages (vsize configuration_index, vsize n, + vsize first_page_num); + Spacing_result space_systems_on_best_pages (vsize configuration_index, + 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; diff --git a/lily/optimal-page-breaking.cc b/lily/optimal-page-breaking.cc index d9aec18550..c3d3f03315 100644 --- a/lily/optimal-page-breaking.cc +++ b/lily/optimal-page-breaking.cc @@ -41,6 +41,7 @@ Optimal_page_breaking::solve () vsize ideal_sys_count = 0; vsize max_sys_count = max_system_count (0, end); vsize page_count = 0; + Line_division ideal_line_division; Line_division best_division; Line_division bound; diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 46a1eed02d..b6d1b93e8a 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -19,7 +19,8 @@ #include "system.hh" #include "warn.hh" -/* for each forbidden page break, merge the systems around it into one system. */ +/* for each forbidden page break, merge the systems around it into one + system. */ static vector compress_lines (const vector &orig) { @@ -141,7 +142,8 @@ Page_breaking::line_breaker_args (vsize sys, } void -Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_division const &div) +Page_breaking::break_into_pieces (vsize start_break, vsize end_break, + Line_division const &div) { vector chunks = chunk_list (start_break, end_break); bool ignore_div = false; @@ -176,8 +178,10 @@ Page_breaking::systems () { if (all_[sys].pscore_) { - all_[sys].pscore_->root_system ()->do_break_substitution_and_fixup_refpoints (); - SCM lines = all_[sys].pscore_->root_system ()->get_broken_system_grobs (); + all_[sys].pscore_->root_system () + ->do_break_substitution_and_fixup_refpoints (); + SCM lines = all_[sys].pscore_->root_system () + ->get_broken_system_grobs (); ret = scm_cons (lines, ret); } else @@ -233,18 +237,21 @@ Page_breaking::make_pages (vector lines_per_page, SCM systems) page_stencil = scm_variable_ref (page_stencil); SCM book = book_->self_scm (); - int first_page_number = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1); + int first_page_number + = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1); SCM ret = SCM_EOL; for (vsize i = 0; i < lines_per_page.size (); i++) { SCM page_num = scm_from_int (i + first_page_number); SCM last = scm_from_bool (i == lines_per_page.size () - 1); - SCM rag = scm_from_bool (ragged () || (to_boolean (last) && ragged_last ())); + SCM rag = scm_from_bool (ragged () || (to_boolean (last) + && ragged_last ())); SCM line_count = scm_from_int (lines_per_page[i]); SCM lines = scm_list_head (systems, line_count); SCM page = scm_apply_0 (make_page, - scm_list_n (book, lines, page_num, rag, last, SCM_UNDEFINED)); + scm_list_n (book, lines, page_num, + rag, last, SCM_UNDEFINED)); scm_apply_1 (page_stencil, page, SCM_EOL); ret = scm_cons (page, ret); @@ -381,7 +388,8 @@ Page_breaking::max_system_count (vsize start, vsize end) } Page_breaking::Line_division -Page_breaking::system_count_bounds (vector const &chunks, bool min) +Page_breaking::system_count_bounds (vector const &chunks, + bool min) { assert (chunks.size () >= 2);