X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fpage-layout-problem.hh;h=6c952e3eedc0526847673566afce7959345d0fcf;hb=a04d1cb5153717523cdafe23faeb2166571603da;hp=e67e508b4396e09f2d773da4910b50ab8456a9a5;hpb=b8d901590e169580b19bc7c42e84c0e234412adf;p=lilypond.git diff --git a/lily/include/page-layout-problem.hh b/lily/include/page-layout-problem.hh index e67e508b43..6c952e3eed 100644 --- a/lily/include/page-layout-problem.hh +++ b/lily/include/page-layout-problem.hh @@ -1,10 +1,20 @@ /* - page-layout-problem.hh -- space systems nicely on a page. If systems can - be stretched, do that too. + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2009--2011 Joe Neeman - (c) 2009 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef PAGE_LAYOUT_HH @@ -16,55 +26,65 @@ class Page_layout_problem { public: - Page_layout_problem (Paper_book*, SCM page, SCM systems); + Page_layout_problem (Paper_book *, SCM page, SCM systems, int footnote_count); SCM solution (bool ragged); void set_header_height (Real); void set_footer_height (Real); - static bool read_spacing_spec (SCM spec, Real* dest, SCM sym); + static bool read_spacing_spec (SCM spec, Real *dest, SCM sym); static bool is_spaceable (Grob *g); static SCM get_details (Grob *g); - static SCM get_spacing_spec (Grob *before, Grob *after); + static vsize get_footnote_count (SCM lines); + static SCM get_footnotes_from_lines (SCM lines, int counter, Paper_book *pb); + static Stencil *get_footnote_separator_stencil (Output_def *paper); + static SCM get_spacing_spec (Grob *before, Grob *after, bool pure, int start, int end); + static Real get_fixed_spacing (Grob *before, Grob *after, int spaceable_index, bool pure, int start, int end); + static void add_footnotes_to_footer (SCM footnotes, Stencil *foot, Paper_book *pb); protected: - void append_system (System*, Spring const&, Real padding); - void append_prob (Prob*, Spring const&, Real padding); + void append_system (System *, Spring const &, Real indent, Real padding); + void append_prob (Prob *, Spring const &, Real padding); void solve_rod_spring_problem (bool ragged); SCM find_system_offsets (); - void distribute_loose_lines (vector const&, vector const&, Real, Real); + void distribute_loose_lines (vector const &, vector const &, Real, Real); - static Grob* find_vertical_alignment (System*); - static void build_system_skyline (vector const&, vector const&, Skyline* up, Skyline* down); - static vector filter_dead_elements (vector const&); + static void build_system_skyline (vector const &, vector const &, Skyline *up, Skyline *down); + static vector filter_dead_elements (vector const &); // This is a union (in spirit). // Either staves must be empty or prob must be null. - typedef struct Element { + typedef struct Element + { Prob *prob; - vector staves; + vector staves; vector min_offsets; + // Store the appropriate '*-*-spacing 'padding, + // for spacing any adjacent loose line + Real padding; - Element (vector const& a, vector const& o) + Element (vector const &a, vector const &o, Real p) { staves = a; min_offsets = o; + padding = p; prob = 0; } - Element (Prob *p) + Element (Prob *p, Real pad) { prob = p; + padding = pad; } } Element; - static Interval first_staff_extent (Element const&); - static Interval last_staff_extent (Element const&); - static Interval prob_extent (Prob*); - static SCM get_details (Element const&); - static SCM details_get_property (SCM details, const char*); - static void alter_spring_from_spacing_spec (SCM spec, Spring* spring); - static void mark_as_spaceable (Grob*); + static Interval first_staff_extent (Element const &); + static Interval last_staff_extent (Element const &); + static Interval prob_extent (Prob *); + static SCM get_details (Element const &); + static SCM details_get_property (SCM details, const char *); + static void alter_spring_from_spacing_spec (SCM spec, Spring *spring); + static void mark_as_spaceable (Grob *); vector springs_; vector elements_; @@ -73,6 +93,8 @@ protected: Real page_height_; Real header_height_; Real footer_height_; + Real header_padding_; + Real footer_padding_; }; #endif /* PAGE_LAYOUT_HH */