]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/p-col.hh
release: 1.1.54
[lilypond.git] / lily / include / p-col.hh
index 797fde9584ee671e33b0b019b3ebb7d11e4e44a6..bf2d032cf25183ca2a80bdfe2709f86e3d7cb1d9 100644 (file)
@@ -1,12 +1,19 @@
-#ifndef COLS_HH
-#define COLS_HH
+/*
+  p-col.hh -- declare  Paper_column
 
+  source file of the GNU LilyPond music typesetter
 
-#include "boxes.hh"
-#include "plist.hh"
-#include "item.hh"
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 
+#ifndef P_COL_HH
+#define P_COL_HH
+
+#include "axis-group-item.hh"
+#include "rod.hh"
+#include "spring.hh"
+
 /**
    stuff grouped vertically.
     This is a class to address items vertically. It contains the data for:
     \end{itemize}
   */
 
-class PCol { 
+class Paper_column : public Axis_group_item { 
 public:
-    Link_list<Item *> its;
-    Link_list<Spanner *> starters;
-    
-    /** prebreak is put before end of line.
-    if broken here, then (*this) column is discarded, and prebreak
-    is put at end of line, owned by Col
-    */
-    PCol *prebreak_p_;
+  VIRTUAL_COPY_CONS(Score_element);
+  Drul_array<Array<Column_rod> > minimal_dists_arr_drul_;
+  Drul_array<Array<Column_spring> > spring_arr_drul_;
+  void preprocess ();
+  /// set a minimum distance
+  void add_rod (Paper_column * to, Real distance);
+  void add_spring (Paper_column * to, Real dist, Real strength);
 
-    /// postbreak at beginning of the new line
-    PCol *postbreak_p_;
-    
-    /** if this column is pre or postbreak, then this field points to
-     the parent.  */
-    PCol *daddy_l_;
-    
-    /// if lines are broken then this column is in #line#
-    Line_of_score *line_l_;
+  virtual Paper_column * column_l () const;
+  /// if lines are broken then this column is in #line#
+  Line_of_score *line_l_;
 
-    /** if lines are broken then this column x-coord #hpos# if not
-      known, then hpos == -1.(ugh?)  */
+  virtual Line_of_score *line_l () const;
 
-    Real hpos_f_;                      // should use ptr?
+  /// which  one (left =0)
+  int rank_i() const;
 
-    bool error_mark_b_;
-    bool used_b_ ;             // manual override.. 
-    
-    Paper_score * pscore_l_;
+  bool breakpoint_b() const;
+  void add_item (Item *i);
 
-    /* *************** */
-    /// which  one (left =0)
-    int rank_i() const;
+  Paper_column();
 
-    /// does this column have items
-    bool used_b() const;
-    bool breakpoint_b() const;
-    void clean_breakable_items();
-    
-    void add (Item *i);
+  void set_rank (int);
 
-    /// Can this be broken? true eg. for bars. 
-    bool breakable_b()const;
+  void OK() const;
+  virtual void do_print() const;
+private:
     
-    Interval width() const;
-    virtual ~PCol();
-    PCol();
-
-    /**
-      which col comes first?.
-      signed compare on columns.
-
-      @return < 0 if c1 < c2.
+  /**
+    The ranking: left is smaller than right 
+    -1 is uninitialised.
     */
-    static int compare (const PCol &c1, const PCol &c2);
-    void set_rank (int);
+  int rank_i_;
 
-    void OK() const;
-    void set_breakable();
-    virtual void do_set_breakable();
-    void print()const;
-private:
-    
-    /**
-      The ranking: left is smaller than right 
-      -1 is uninitialised.
-     */
-    int rank_i_;
-    PCol (PCol const&){}
 };
 
 
-#include "compare.hh"
-INSTANTIATE_COMPARE(PCol &, PCol::compare);
+// #include "compare.hh"
+// INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
      
+#endif // P_COL_HH
 
-#endif