]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/break-algorithm.hh
623fc81a4a29fe6ba94b0a178a6410c12f65337b
[lilypond.git] / lily / include / break-algorithm.hh
1 /*
2   break-algorithm.hh -- declare  Break_algorithm
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef BREAK_HH
11 #define BREAK_HH
12
13 #include "array.hh"
14 #include "interval.hh"
15 #include "lily-proto.hh"
16 #include "column-x-positions.hh"
17
18
19 /** Class representation of an algorithm which decides where to put
20   the column, and where to break lines.
21
22   JUNKME.
23   
24   */
25 class Break_algorithm {
26 protected:
27   Paper_score *pscore_;
28   Real linewidth_;
29
30   /// search all pcols which are breakable.
31   Link_array<Grob> find_breaks () const;
32
33   Array<int> find_break_indices () const;
34     
35
36   /// helper: solve for the columns in #curline#.
37   void solve_line (Column_x_positions*) const;
38
39   /// does curline fit on the paper?    
40   bool feasible (Link_array<Grob> const &) const;
41     
42
43   Simple_spacer* generate_spacing_problem (Link_array<Grob> const &, Interval) const;
44
45   virtual Array<Column_x_positions> do_solve () const=0;
46
47 public:
48   Simple_spacer* (*get_line_spacer) ();
49   Break_algorithm ();
50   void set_pscore (Paper_score*);
51
52   Array<Column_x_positions> solve () const;
53 };
54
55 #endif // BREAK_HH
56