lilypond-0.1.54
[lilypond.git] / lily / score-halign-reg.cc
blob748c018ffe3ad20d5327d3b75a6183069cfc42e0
1 /*
2 score-halign-reg.cc -- implement Score_horizontal_align_register
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "bar.hh"
10 #include "break-align-item.hh"
11 #include "score-halign-reg.hh"
12 #include "score-align-reg.hh"
14 Score_horizontal_align_register::Score_horizontal_align_register()
16 halign_p_ =0;
19 void
20 Score_horizontal_align_register::do_pre_move_processing()
22 if (halign_p_) {
23 typeset_breakable_item(halign_p_);
24 halign_p_ =0;
29 void
30 Score_horizontal_align_register::acknowledge_element(Score_elem_info i)
32 Request_register* reg = i.origin_reg_l_arr_[0];
33 if (reg->is_type_b(
34 Score_align_register::static_name()) )
36 Score_align_register * align_reg_l = (Score_align_register*) reg;
37 if (!halign_p_) {
38 halign_p_ = new Break_align_item;
39 announce_element(Score_elem_info(halign_p_,0));
41 Item * it = i.elem_l_->item();
42 if (align_reg_l->type_ch_C_ == Bar::static_name())
43 halign_p_->center_l_ = it;
45 halign_p_->add(it, align_reg_l->priority_i_);
48 IMPLEMENT_STATIC_NAME(Score_horizontal_align_register);
49 IMPLEMENT_IS_TYPE_B1(Score_horizontal_align_register,Request_register);
50 ADD_THIS_REGISTER(Score_horizontal_align_register);