2 break.cc -- implement Break_algorithm
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2005 Han-Wen Nienhuys <hanwen@xs4all.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"
19 Break_algorithm::find_break_indices () const
21 Link_array<Grob> all = pscore_->root_system ()->columns ();
24 for (int i = 0; i < all.size (); i++)
25 if (Item::is_breakable (all[i]))
29 while (retval.size () > 2)
36 Break_algorithm::find_breaks () const
38 Link_array<Grob> all = pscore_->root_system ()->columns ();
39 Link_array<Grob> retval;
41 for (int i = 0; i < all.size (); i++)
42 if (Item::is_breakable (all[i]))
46 while (retval.size () > 2)
52 Simple_spacer_wrapper *
53 Break_algorithm::generate_spacing_problem (Link_array<Grob> const &curline,
56 Simple_spacer_wrapper *spw = new Simple_spacer_wrapper;
57 Simple_spacer *sp = spw->spacer_;
60 this is hardcoded, but this shouldn't happen anyway.
61 used to be get_dimension (ly_symbol2scm ("loose_column_distance"));
63 sp->default_space_ = 1.0;
64 sp->indent_ = line[LEFT];
67 sort out how interfacing this should work;
72 sp->line_len_ = line.length ();
74 spw->add_columns (curline);
78 Break_algorithm::Break_algorithm ()
85 Break_algorithm::set_pscore (Paper_score *s)
88 linewidth_ = s->layout ()->get_dimension (ly_symbol2scm ("linewidth"));
91 Array<Column_x_positions>
92 Break_algorithm::solve () const
94 Array<Column_x_positions> h= do_solve ();
99 Break_algorithm::~Break_algorithm ()