2 break.cc -- implement Break_algorithm
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2006 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_breaks () const
21 vector<Grob*> all = pscore_->root_system ()->columns ();
24 for (vsize i = 0; i < all.size (); i++)
25 if (Item::is_breakable (all[i]))
26 retval.push_back (all[i]);
32 Simple_spacer_wrapper *
33 Break_algorithm::generate_spacing_problem (vector<Grob*> const &curline,
36 Simple_spacer_wrapper *spw = new Simple_spacer_wrapper;
37 Simple_spacer *sp = spw->spacer_;
40 this is hardcoded, but this shouldn't happen anyway.
41 used to be get_dimension (ly_symbol2scm ("loose_column_distance"));
43 sp->default_space_ = 1.0;
44 sp->indent_ = line[LEFT];
47 sort out how interfacing this should work;
52 sp->line_len_ = line.length ();
54 spw->add_columns (curline);
58 Break_algorithm::Break_algorithm ()
65 Break_algorithm::set_pscore (Paper_score *s)
68 linewidth_ = s->layout ()->get_dimension (ly_symbol2scm ("line-width"));
71 vector<Column_x_positions>
72 Break_algorithm::solve ()
74 vector<Column_x_positions> h;
78 Break_algorithm::~Break_algorithm ()