source file of the GNU LilyPond music typesetter
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
-
-#ifndef P_COL_HH
-#define P_COL_HH
+#ifndef PAPER_COLUMN_HH
+#define PAPER_COLUMN_HH
#include "item.hh"
#include "rod.hh"
-#include "spring.hh"
-
-/**
- stuff grouped vertically.
- This is a class to address items vertically. It contains the data for:
- \begin{itemize}
- \item
- unbroken score
- \item
- broken score
- \item
- the linespacing problem
- \end{itemize}
- */
class Paper_column : public Item
-{
-public:
- VIRTUAL_COPY_CONS(Score_element);
-
- /*
- ugh.
-
- TODO:
-
- * junk these after spacing is done.
-
- * Put these in Scheme.
- */
-
- Array<Column_rod> minimal_dists_;
- Array<Column_spring > springs_;
-
- /// 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;
- virtual Line_of_score *line_l () const;
-
+{
+ int rank_;
/// if lines are broken then this column is in #line#
- Line_of_score *line_l_;
+ System *system_;
- /// which one (left =0)
- int rank_i() const;
+ // ugh: friend declarations.
+ friend void set_loose_columns (System *which, Column_x_positions const *posns);
+ friend class System;
+public:
+ Paper_column (SCM);
+ Paper_column (Paper_column const &);
- Paper_column (Moment when);
- Moment when_mom ()const;
+ virtual Grob *clone () const;
+ virtual void do_break_processing ();
+ virtual Paper_column *get_column () const;
+ virtual System *get_system () const;
+ void set_system (System *);
- bool musical_b () const;
+ static int compare (Grob * const &a,
+ Grob * const &b);
+ static bool less_than (Grob *const &a,
+ Grob *const &b);
+ int get_rank () const { return rank_; }
void set_rank (int);
-private:
-
- /**
- The ranking: left is smaller than right
- -1 is uninitialised.
- */
- int rank_i_;
+ DECLARE_SCHEME_CALLBACK (print, (SCM));
+ DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+
+ DECLARE_GROB_INTERFACE();
+ static int get_rank (Grob const *);
+ static bool is_musical (Grob *);
+ static Moment when_mom (Grob *);
+ static bool is_used (Grob *);
+ static bool is_breakable (Grob *);
+ static bool is_extraneous_column_from_ligature (Grob *);
+ static Real minimum_distance (Grob *l, Grob *r);
+ static Interval break_align_width (Grob *me);
};
-
-#endif // P_COL_HH
+
+#endif // PAPER_COLUMN_HH