lilypond-1.3.7
[lilypond.git] / lily / register.cc
blobdd228e1be3c870a9480b7bec368ebfd6d15bc607
1 /*
2 register.cc -- implement Request_register
4 Sourcefile of GNU LilyPond musictypesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "music-list.hh"
10 #include "musical-request.hh"
11 #include "register.hh"
12 #include "register-group.hh"
13 #include "debug.hh"
15 void
16 Request_register::post_move_processing()
19 if (status < CREATION_INITED) {
20 do_creation_processing();
21 status = CREATION_INITED;
23 if (status >= MOVE_INITED)
24 return;
26 do_post_move_processing();
27 status = MOVE_INITED;
30 bool
31 Request_register::try_request(Request * r)
33 if (status < MOVE_INITED)
34 post_move_processing();
36 return do_try_request(r);
39 void
40 Request_register::process_requests()
42 if (status < PROCESSED_REQS)
43 post_move_processing();
44 else if (status >= PROCESSED_REQS)
45 return;
47 status = PROCESSED_REQS;
48 do_process_requests();
51 void
52 Request_register::pre_move_processing()
54 do_pre_move_processing();
55 status = CREATION_INITED;
58 void
59 Request_register::fill_staff_info(Staff_info&)
64 Scalar
65 Request_register::get_feature(String t)
67 return daddy_reg_l_->get_feature(t);
70 bool
71 Request_register::do_try_request(Request*)
73 return false;
76 Request_register::Request_register()
78 status = VIRGIN;
79 daddy_reg_l_ = 0;
82 void
83 Request_register::announce_element(Score_elem_info i)
85 i.origin_reg_l_arr_.push(this);
86 daddy_reg_l_->announce_element(i);
89 void
90 Request_register::typeset_element(Score_elem*p)
92 daddy_reg_l_->typeset_element(p);
95 Paper_def*
96 Request_register::paper()const
98 return daddy_reg_l_->paper();
101 void
102 Request_register::typeset_breakable_item(Item * nobreak_p)
104 daddy_reg_l_->typeset_breakable_item(nobreak_p);
107 bool
108 Request_register::contains_b(Request_register *reg_l)const
110 return this == reg_l;
113 Staff_info
114 Request_register::get_staff_info() const
116 return daddy_reg_l_->get_staff_info();
119 void
120 Request_register::print() const
122 #ifndef NPRINT
123 mtor << "\n" << name() << " {";
124 do_print();
125 mtor << "}";
126 #endif
129 IMPLEMENT_STATIC_NAME(Request_register);
130 IMPLEMENT_IS_TYPE_B(Request_register);
132 void
133 Request_register::do_print()const