lilypond-0.0.35
[lilypond.git] / hdr / pcol.hh
blob4fac246e49a0e40aef7a9497d423071184cfcc9d
1 #ifndef COLS_HH
2 #define COLS_HH
4 #include "glob.hh"
5 #include "boxes.hh"
6 #include "plist.hh"
7 #include "item.hh"
10 /**
11 stuff grouped vertically.
12 This is a class to address items vertically. It contains the data for:
13 \begin{itemize}
14 \item
15 unbroken score
16 \item
17 broken score
18 \item
19 the linespacing problem
20 \end{itemize}
23 struct PCol {
24 PointerList<const Item*> its;
25 PointerList<const Spanner*> stoppers, starters;
29 /** prebreak is put before end of line.
30 if broken here, then (*this) column is discarded, and prebreak
31 is put at end of line, owned by Col
33 PCol *prebreak_p_;
35 /// postbreak at beginning of the new line
36 PCol *postbreak_p_;
38 /** if this column is pre or postbreak, then this field points to
39 the parent. */
40 PCol *daddy_l_;
42 /// if lines are broken then this column is in #line#
43 const Line_of_score *line_l_;
45 /// if lines are broken then this column x-coord #hpos#
46 Real hpos;
48 PScore * pscore_l_;
50 /* *************** */
51 /// which one (left =0)
52 int rank() const;
54 /// does this column have items
55 bool used_b() const;
57 void add(Item *i);
59 /// Can this be broken? true eg. for bars.
60 bool breakable_b()const;
62 Interval width() const;
63 ~PCol();
64 PCol(PCol * parent);
66 /**
67 which col comes first?.
68 signed compare on columns.
70 @return < 0 if c1 < c2.
71 */static int compare(const PCol &c1, const PCol &c2);
74 void OK() const;
75 void set_breakable();
76 void print()const;
77 private:
78 PCol(PCol const&){}
82 #include "compare.hh"
83 instantiate_compare(PCol &, PCol::compare);
86 #endif