2 break.cc -- implement Break_algorithm
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "break-algorithm.hh"
10 #include "paper-column.hh"
11 #include "output-def.hh"
13 #include "paper-score.hh"
14 #include "paper-column.hh"
15 #include "cpu-timer.hh"
16 #include "simple-spacer.hh"
17 #include "group-interface.hh"
20 Break_algorithm::find_break_indices () const
22 Link_array<Grob> all = pscore_->system_->columns ();
25 for (int i= 0; i < all.size (); i++)
26 if (Item::is_breakable (all[i]))
30 while (retval.size () > 2)
37 Break_algorithm::find_breaks () const
39 Link_array<Grob> all = pscore_->system_->columns ();
40 Link_array<Grob> retval;
42 for (int i= 0; i < all.size (); i++)
43 if (Item::is_breakable (all[i]))
47 while (retval.size () >2)
53 Simple_spacer_wrapper*
54 Break_algorithm::generate_spacing_problem (Link_array<Grob> const &curline,
57 Simple_spacer_wrapper * spw = new Simple_spacer_wrapper;
58 Simple_spacer * sp = spw->spacer_;
61 this is hardcoded, but this shouldn't happen anyway.
62 used to be get_dimension (ly_symbol2scm ("loose_column_distance"));
64 sp->default_space_ = 1.0;
65 sp->indent_ = line[LEFT];
68 sort out how interfacing this should work;
75 sp->line_len_ = line.length ();
77 spw->add_columns (curline);
81 Break_algorithm::Break_algorithm ()
88 Break_algorithm::set_pscore (Paper_score*s)
91 linewidth_ = s->layout_->get_dimension (ly_symbol2scm ("linewidth"));
94 Array<Column_x_positions>
95 Break_algorithm::solve () const
97 Array<Column_x_positions> h= do_solve ();