lilypond-1.3.130
[lilypond.git] / lily / lyric-register.cc
blob396fae38dc3db44c9ed5801cddfd1da5df0b4497
1 /*
2 lyric-register.cc -- implement Lyric_register
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "lyric-register.hh"
10 #include "musical-request.hh"
11 #include "text-item.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
15 Lyric_register::Lyric_register()
19 bool
20 Lyric_register::do_try_request(Request*r)
22 Musical_req * m =r->musical();
23 if (!m || ! m->lreq_l())
24 return false;
25 lreq_arr_.push(m->lreq_l());
27 return true;
30 void
31 Lyric_register::do_process_requests()
33 Text_item * last_item_l =0;
34 for (int i=0; i < lreq_arr_.size(); i++) {
35 Text_item *lp = new Text_item(lreq_arr_[i]->tdef_p_ );
36 lp->dir_i_ = -1;
37 lp->fat_b_ = true;
38 if (last_item_l)
39 lp->add_support(last_item_l);
40 last_item_l = lp;
41 typeset_element(lp);
45 void
46 Lyric_register::do_post_move_processing()
48 lreq_arr_.set_size(0);
52 IMPLEMENT_STATIC_NAME(Lyric_register);
53 IMPLEMENT_IS_TYPE_B1(Lyric_register,Request_register);
54 ADD_THIS_REGISTER(Lyric_register);