2 item.cc -- implement Item
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
13 #include "elem-group.hh"
22 IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
25 Item::do_print() const
36 return pcol_l_->hpos_f_ + offset().x;
44 return pcol_l_->line_l_;
48 Item::break_status_i() const
53 else if (!c->daddy_l_)
55 else if (c == c->daddy_l_->prebreak_p_)
62 Item::copy_breakable_items()
64 for (int i=0; i < 2; i++) {
65 Item * item_p = clone()->item();
66 item_p->copy_dependencies(*this);
67 /* add our pre and postbreaks blondly to our own y_group
68 Let Vertical_group_spanner figure out the mess.
71 y_group_l_->add_element( item_p );
72 pscore_l_->typeset_item(item_p, pcol_l_, -1+ 2*i);
73 item_p->handle_prebroken_dependencies();
74 broken_to_a_[i] = item_p;
79 Item::do_breakable_col_processing()
82 if (!c->breakable_b())
85 copy_breakable_items();
86 handle_prebroken_dependencies();
90 Item::find_prebroken_piece(Line_of_score*l) const
94 else if (broken_to_a_[0] && broken_to_a_[0]->line_l() == l)
95 return broken_to_a_[0];
96 else if (broken_to_a_[1] && broken_to_a_[1]->line_l() == l)
97 return broken_to_a_[1];
103 Item::find_prebroken_piece(PCol*c)const
106 return (Item *) this; // ugh
108 if (c == pcol_l_->prebreak_p_)
109 return (Item *) broken_to_a_[0];
110 else if (c==pcol_l_->postbreak_p_)
111 return (Item *)broken_to_a_[1];
117 Item::handle_prebroken_dependencies()
119 if ( pcol_l_->breakable_b() || pcol_l_->daddy_l_ )
120 Score_elem::handle_prebroken_dependencies();