lilypond-1.3.70
[lilypond.git] / lily / paper-column.cc
blobfcdc933f9aa39c0eb43d1a8d245719c0cf207a4e
1 /*
2 paper-column.cc -- implement Paper_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 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-element.hh"
15 void
16 Paper_column::do_break_processing ()
18 Spaceable_element::remove_interface(this);
19 Item::do_break_processing ();
22 int
23 Paper_column::rank_i(Score_element*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_element::set_interface (this);
46 set_elt_property ("bounded-by-me", SCM_EOL);
47 line_l_=0;
48 rank_i_ = -1;
51 Moment
52 Paper_column::when_mom (Score_element*me)
54 SCM m = me->get_elt_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 () const
66 SCM m = get_elt_property ("shortest-starter-duration");
67 Moment s (0);
68 if (unsmob_moment (m))
70 s = *unsmob_moment (m);
72 return s != Moment(0);
75 bool
76 Paper_column::used_b (Score_element*me )
78 return gh_pair_p (me->get_elt_property ("elements")) || Item::breakable_b (me)
79 || gh_pair_p (me->get_elt_property ("bounded-by-me"))