]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/p-col.hh
release: 1.1.54
[lilypond.git] / lily / include / p-col.hh
index 48d6c62a1958e7c01287d9ff25336e0bc02d2890..bf2d032cf25183ca2a80bdfe2709f86e3d7cb1d9 100644 (file)
@@ -1,11 +1,18 @@
-#ifndef COLS_HH
-#define COLS_HH
+/*
+  p-col.hh -- declare  Paper_column
 
-#include "glob.hh"
-#include "boxes.hh"
-#include "plist.hh"
-#include "item.hh"
+  source file of the GNU LilyPond music typesetter
 
+  (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.
     \end{itemize}
   */
 
-struct PCol { 
-    PointerList<Item const *> its;
-    PointerList<Spanner const *> stoppers, starters;
-    
+class Paper_column : public Axis_group_item { 
+public:
+  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);
 
+  virtual Paper_column * column_l () const;
+  /// if lines are broken then this column is in #line#
+  Line_of_score *line_l_;
 
-    /** 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 Line_of_score *line_l () const;
 
-    /// 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 const *line_l_;
+  /// which  one (left =0)
+  int rank_i() const;
 
-    /// if lines are broken then this column x-coord #hpos#
-    Real hpos;
+  bool breakpoint_b() const;
+  void add_item (Item *i);
 
-    PScore * pscore_l_;
+  Paper_column();
 
-    /* *************** */
-    /// which  one (left =0)
-    int rank() const;
+  void set_rank (int);
 
-    /// does this column have items
-    bool used_b() const;
-    
-    void add(Item *i);
-
-    /// Can this be broken? true eg. for bars. 
-    bool breakable_b()const;
-    
-    Interval width() const;
-    ~PCol();
-    PCol(PCol * parent);
-
-    /**
-      which col comes first?.
-      signed compare on columns.
-
-      @return < 0 if c1 < c2.
-    */static int compare(const PCol &c1, const PCol &c2);
+  void OK() const;
+  virtual void do_print() const;
+private:
     
+  /**
+    The ranking: left is smaller than right 
+    -1 is uninitialised.
+    */
+  int rank_i_;
 
-    void OK() const;
-    void set_breakable();
-    void print()const;
-private:
-    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