]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/p-col.hh
release: 1.0.1
[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
60   /// which  one (left =0)
61   int rank_i() const;
62
63   /// does this column have items
64   bool used_b() const;
65   bool breakpoint_b() const;
66     
67   void add_item (Item *i);
68
69   Paper_column();
70
71   /**
72     which col comes first?.
73     signed compare on columns.
74
75     @return < 0 if c1 < c2.
76     */
77   static int compare (const Paper_column &c1, const Paper_column &c2);
78   void set_rank (int);
79
80   void OK() const;
81   virtual void do_print() const;
82 private:
83     
84   /**
85     The ranking: left is smaller than right 
86     -1 is uninitialised.
87     */
88   int rank_i_;
89
90 };
91
92
93 #include "compare.hh"
94 INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
95      
96 #endif // P_COL_HH
97