]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/pcol.hh
release: 0.0.39-1
[lilypond.git] / lily / include / pcol.hh
1 #ifndef COLS_HH
2 #define COLS_HH
3
4 #include "glob.hh"
5 #include "boxes.hh"
6 #include "plist.hh"
7 #include "item.hh"
8
9
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}
21   */
22
23 struct PCol {
24     PointerList<const Item*> its;
25     PointerList<const Spanner*> stoppers, starters;
26     
27
28
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
32     */
33     PCol *prebreak_p_;
34
35     /// postbreak at beginning of the new line
36     PCol *postbreak_p_;
37     
38     /** if this column is pre or postbreak, then this field points to
39      the parent.  */
40     PCol *daddy_l_;
41     
42     /// if lines are broken then this column is in #line#
43     const Line_of_score *line_l_;
44
45     /// if lines are broken then this column x-coord #hpos#
46     Real hpos;
47
48     PScore * pscore_l_;
49
50     /* *************** */
51     /// which  one (left =0)
52     int rank() const;
53
54     /// does this column have items
55     bool used_b() const;
56     
57     void add(Item *i);
58
59     /// Can this be broken? true eg. for bars. 
60     bool breakable_b()const;
61     
62     Interval width() const;
63     ~PCol();
64     PCol(PCol * parent);
65
66     /**
67       which col comes first?.
68       signed compare on columns.
69
70       @return < 0 if c1 < c2.
71     */static int compare(const PCol &c1, const PCol &c2);
72     
73
74     void OK() const;
75     void set_breakable();
76     void print()const;
77 private:
78     PCol(PCol const&){}
79 };
80
81
82 #include "compare.hh"
83 instantiate_compare(PCol &, PCol::compare);
84      
85
86 #endif