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"
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;
74 sp->line_len_ = line.length ();
76 spw->add_columns (curline);
80 Break_algorithm::Break_algorithm ()
87 Break_algorithm::set_pscore (Paper_score *s)
90 linewidth_ = s->layout ()->get_dimension (ly_symbol2scm ("linewidth"));
93 Array<Column_x_positions>
94 Break_algorithm::solve () const
96 Array<Column_x_positions> h= do_solve ();
101 Break_algorithm::~Break_algorithm ()