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