2 page-layout-problem.hh -- space systems nicely on a page. If systems can
3 be stretched, do that too.
5 source file of the GNU LilyPond music typesetter
7 (c) 2009 Joe Neeman <joeneeman@gmail.com>
10 #ifndef PAGE_LAYOUT_HH
11 #define PAGE_LAYOUT_HH
13 #include "simple-spacer.hh"
16 class Page_layout_problem
19 Page_layout_problem (Paper_book*, SCM page, SCM systems);
21 SCM solution (bool ragged);
22 void set_header_height (Real);
23 void set_footer_height (Real);
24 static bool read_spacing_spec (SCM spec, Real* dest, SCM sym);
25 static bool is_spaceable (Grob *g);
26 static SCM get_details (Grob *g);
27 static SCM get_spacing_spec (Grob *before, Grob *after);
30 void append_system (System*, Spring const&, Real padding);
31 void append_prob (Prob*, Spring const&, Real padding);
33 void solve_rod_spring_problem (bool ragged);
34 SCM find_system_offsets ();
35 void distribute_loose_lines (vector<Grob*> const&, vector<Real> const&, Real, Real);
37 static Grob* find_vertical_alignment (System*);
38 static void build_system_skyline (vector<Grob*> const&, vector<Real> const&, Skyline* up, Skyline* down);
39 static vector<Grob*> filter_dead_elements (vector<Grob*> const&);
41 // This is a union (in spirit).
42 // Either staves must be empty or prob must be null.
43 typedef struct Element {
46 vector<Real> min_offsets;
48 Element (vector<Grob*> const& a, vector<Real> const& o)
61 static Interval first_staff_extent (Element const&);
62 static Interval last_staff_extent (Element const&);
63 static Interval prob_extent (Prob*);
64 static SCM get_details (Element const&);
65 static SCM details_get_property (SCM details, const char*);
66 static void alter_spring_from_spacing_spec (SCM spec, Spring* spring);
67 static void mark_as_spaceable (Grob*);
69 vector<Spring> springs_;
70 vector<Element> elements_;
71 vector<Real> solution_;
72 Skyline bottom_skyline_;
80 #endif /* PAGE_LAYOUT_HH */