]> git.donarmstrong.com Git - lilypond.git/blob - lily/rest-collision-reg.cc
release: 0.0.56
[lilypond.git] / lily / rest-collision-reg.cc
1 /*
2   rest-collision-reg.cc -- implement Rest_collision_register
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "rest-collision.hh"
10 #include "rest-collision-reg.hh"
11 #include "collision.hh"
12 #include "rest-column.hh"
13 #include "note-column.hh"
14
15 void
16 Rest_collision_register::acknowledge_element(Staff_elem_info i)
17 {
18     char const * nC = i.elem_l_->name();
19     if (nC == Collision::static_name()) {
20         collision_l_arr_.push((Collision*)i.elem_l_);
21     } 
22     else if (nC == Rest_column ::static_name()) {
23         if (!rest_collision_p_)
24             rest_collision_p_ = new Rest_collision;
25         rest_collision_p_->add((Rest_column*)i.elem_l_);
26     }
27 }
28
29 void
30 Rest_collision_register::pre_move_processing()
31 {
32     if (rest_collision_p_) {
33         typeset_element(rest_collision_p_);
34         rest_collision_p_ = 0;
35     }
36 }
37
38 Rest_collision_register::Rest_collision_register()
39 {
40     rest_collision_p_ =0;
41 }
42
43 IMPLEMENT_STATIC_NAME(Rest_collision_register);
44 ADD_THIS_REGISTER(Rest_collision_register);