]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-column.cc
release: 1.3.109
[lilypond.git] / lily / paper-column.cc
1 /*
2   paper-column.cc -- implement Paper_column
3
4   source file of the GNU LilyPond music typesetter
5
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"
14
15 void
16 Paper_column::do_break_processing ()
17 {
18   Spaceable_element::remove_interface(this);
19   Item::do_break_processing ();
20 }
21
22 int
23 Paper_column::rank_i(Grob*me) 
24 {
25   return dynamic_cast<Paper_column*> (me)->rank_i_;
26 }
27
28 Line_of_score*
29 Paper_column::line_l() const
30 {
31   return line_l_;
32 }
33
34 Paper_column*
35 Paper_column::column_l () const
36 {
37   return (Paper_column*)(this);
38 }
39
40 Paper_column::Paper_column (SCM l)
41   : Item (l)            // guh.?
42 {
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
47   line_l_=0;
48   rank_i_ = -1;
49 }
50
51 Moment
52 Paper_column::when_mom (Grob*me)
53 {
54   SCM m = me->get_grob_property ("when");
55   Moment s (0);
56   if (unsmob_moment (m))
57     {
58       return *unsmob_moment (m);
59     }
60   return s;
61 }
62   
63 bool
64 Paper_column::musical_b () const
65 {
66   SCM m = get_grob_property ("shortest-starter-duration");
67   Moment s (0);
68   if (unsmob_moment (m))
69     {
70       s = *unsmob_moment (m);
71     }
72   return s != Moment(0);
73 }
74
75 bool
76 Paper_column::used_b (Grob*me )
77 {
78   return gh_pair_p (me->get_grob_property ("elements")) ||  Item::breakable_b (me)
79     || gh_pair_p (me->get_grob_property ("bounded-by-me"))
80     ;
81 }