lilypond-1.5.2
[lilypond.git] / lily / paper-column.cc
blob14774ed651be5a0fa4d2f2fd844e18af457a2af5
1 /*
2 paper-column.cc -- implement Paper_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8 #include "moment.hh"
9 #include "paper-column.hh"
10 #include "paper-score.hh"
11 #include "debug.hh"
12 #include "axis-group-interface.hh"
13 #include "spaceable-grob.hh"
15 void
16 Paper_column::do_break_processing ()
18 Spaceable_grob::remove_interface (this);
19 Item::do_break_processing ();
22 int
23 Paper_column::rank_i (Grob*me)
25 return dynamic_cast<Paper_column*> (me)->rank_i_;
28 Line_of_score*
29 Paper_column::line_l () const
31 return line_l_;
34 Paper_column*
35 Paper_column::column_l () const
37 return (Paper_column*) (this);
40 Paper_column::Paper_column (SCM l)
41 : Item (l) // guh.?
43 Axis_group_interface::set_interface (this);
44 Axis_group_interface::set_axes (this, X_AXIS, X_AXIS);
45 Spaceable_grob::set_interface (this);
47 line_l_=0;
48 rank_i_ = -1;
51 Moment
52 Paper_column::when_mom (Grob*me)
54 SCM m = me->get_grob_property ("when");
55 Moment s (0);
56 if (unsmob_moment (m))
58 return *unsmob_moment (m);
60 return s;
63 bool
64 Paper_column::musical_b (Grob *me)
66 SCM m = me->get_grob_property ("shortest-starter-duration");
67 Moment s (0);
68 if (unsmob_moment (m))
70 s = *unsmob_moment (m);
72 return s != Moment (0);
76 bool
77 Paper_column::used_b (Grob*me)
79 return gh_pair_p (me->get_grob_property ("elements")) || Item::breakable_b (me)
80 || gh_pair_p (me->get_grob_property ("bounded-by-me"))