lilypond-0.0.40
[lilypond.git] / src / text-reg.cc
blob5232549a140043ac208bc95473f18361a1c54a3f
1 /*
2 text-reg.cc -- implement Text_register
4 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
5 */
7 #include "musicalrequest.hh"
8 #include "text-reg.hh"
9 #include "textitem.hh"
11 Text_register::Text_register()
13 text_p_ = 0;
14 set_feature(Features::dir(0));
15 post_move_processing();
18 bool
19 Text_register::try_request(Request*req_l)
21 if (!req_l->text())
22 return false;
23 if (text_req_l_ &&
24 Text_req::compare(*req_l->text(), *text_req_l_))
26 return false;
28 text_req_l_ = req_l->text();
29 return true;
32 void
33 Text_register::process_requests()
36 if (text_req_l_) {
37 text_p_ = new Text_item(text_req_l_, 10); // UGH
38 announce_element(Staff_elem_info(text_p_, text_req_l_));
41 void
42 Text_register::pre_move_processing()
44 if (text_p_) {
45 text_p_->dir_i_ = dir_i_;
46 typeset_element(text_p_);
47 text_p_ = 0;
50 void
51 Text_register::set_feature(Features i)
53 dir_i_ = i.direction_i_;
55 void
56 Text_register::post_move_processing()
58 text_req_l_ = 0;