]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/p-col.hh
release: 1.0.15
[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--1998 Han-Wen Nienhuys <hanwen@cs.uu.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 #include "rod.hh"
16
17
18 /**
19    stuff grouped vertically.
20     This is a class to address items vertically. It contains the data for:
21     \begin{itemize}
22     \item
23     unbroken score
24     \item
25     broken score
26     \item
27     the linespacing problem
28     \end{itemize}
29   */
30
31 class Paper_column : public Horizontal_group_item { 
32 public:
33   DECLARE_MY_RUNTIME_TYPEINFO;
34   SCORE_ELEMENT_CLONE(Paper_column);
35   Drul_array< Array<Column_rod> > minimal_dists_arr_drul_;
36
37   void preprocess ();
38   /// set a minimum distance
39   void add_rod (Paper_column * to, Real distance);
40   
41   /** prebreak is put before end of line.
42     if broken here, then (*this) column is discarded, and prebreak
43     is put at end of line, owned by Col
44     */
45   Paper_column *prebreak_l() const;
46
47   /// postbreak at beginning of the new line
48   Paper_column *postbreak_l() const;
49
50   virtual Paper_column * column_l () const;
51   /// if lines are broken then this column is in #line#
52   Line_of_score *line_l_;
53
54   virtual Line_of_score *line_l () const;
55   bool error_mark_b_;
56   bool used_b_ ;                // manual override.. 
57     
58
59   /// which  one (left =0)
60   int rank_i() const;
61
62   /// does this column have items
63   bool used_b() const;
64   bool breakpoint_b() const;
65     
66   void add_item (Item *i);
67
68   Paper_column();
69
70   /**
71     which col comes first?.
72     signed compare on columns.
73
74     @return < 0 if c1 < c2.
75     */
76   static int compare (const Paper_column &c1, const Paper_column &c2);
77   void set_rank (int);
78
79   void OK() const;
80   virtual void do_print() const;
81 private:
82     
83   /**
84     The ranking: left is smaller than right 
85     -1 is uninitialised.
86     */
87   int rank_i_;
88
89 };
90
91
92 #include "compare.hh"
93 INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
94      
95 #endif // P_COL_HH
96