]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/p-col.hh
c297bb78430b8a0ddc5cd718144c69601611f60a
[lilypond.git] / lily / include / p-col.hh
1 /*
2   p-col.hh -- declare  Paper_column
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef P_COL_HH
11 #define P_COL_HH
12
13 #include "horizontal-group-item.hh"
14 #include "plist.hh"
15
16 /**
17    stuff grouped vertically.
18     This is a class to address items vertically. It contains the data for:
19     \begin{itemize}
20     \item
21     unbroken score
22     \item
23     broken score
24     \item
25     the linespacing problem
26     \end{itemize}
27   */
28
29 class Paper_column : public Horizontal_group_item { 
30 public:
31   DECLARE_MY_RUNTIME_TYPEINFO;
32   SCORE_ELEM_CLONE(Paper_column);
33   
34   /** prebreak is put before end of line.
35     if broken here, then (*this) column is discarded, and prebreak
36     is put at end of line, owned by Col
37     */
38   Paper_column *prebreak_l() const;
39
40   /// postbreak at beginning of the new line
41   Paper_column *postbreak_l() const;
42     
43   /// if lines are broken then this column is in #line#
44   Line_of_score *line_l_;
45
46   virtual Line_of_score *line_l () const;
47   bool error_mark_b_;
48   bool used_b_ ;                // manual override.. 
49     
50   /* *************** */
51
52   /// which  one (left =0)
53   int rank_i() const;
54
55   /// does this column have items
56   bool used_b() const;
57   bool breakpoint_b() const;
58     
59   void add (Item *i);
60
61   Paper_column();
62
63   /**
64     which col comes first?.
65     signed compare on columns.
66
67     @return < 0 if c1 < c2.
68     */
69   static int compare (const Paper_column &c1, const Paper_column &c2);
70   void set_rank (int);
71
72   void OK() const;
73   virtual void do_print() const;
74 private:
75     
76   /**
77     The ranking: left is smaller than right 
78     -1 is uninitialised.
79     */
80   int rank_i_;
81
82 };
83
84
85 #include "compare.hh"
86 INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
87      
88 #endif // P_COL_HH
89