2 hyphen-engraver.cc -- implement Hyphen_engraver
4 (c) 1999 Glen Prideaux <glenprideaux@iname.com>
8 #include "musical-request.hh"
9 #include "hyphen-engraver.hh"
10 #include "hyphen-spanner.hh"
11 #include "paper-column.hh"
12 #include "text-item.hh"
13 #include "extender-engraver.hh"
15 ADD_THIS_TRANSLATOR (Hyphen_engraver
);
17 Hyphen_engraver::Hyphen_engraver ()
21 hyphen_spanner_p_
= 0;
26 Hyphen_engraver::acknowledge_element (Score_element_info i
)
28 if (Text_item
* t
= dynamic_cast<Text_item
*> (i
.elem_l_
))
32 && !hyphen_spanner_p_
->spanned_drul_
[RIGHT
]
35 hyphen_spanner_p_
->set_textitem (RIGHT
, t
);
42 Hyphen_engraver::do_try_music (Music
* r
)
44 if (Hyphen_req
* p
= dynamic_cast <Hyphen_req
*> (r
))
56 Hyphen_engraver::do_removal_processing ()
58 if (hyphen_spanner_p_
)
60 req_l_
->warning (_ ("unterminated hyphen"));
61 hyphen_spanner_p_
->set_bounds(RIGHT
, get_staff_info ().command_pcol_l ());
66 Hyphen_engraver::do_process_requests ()
72 req_l_
->warning (_ ("Nothing to connect hyphen to on the left. Ignoring hyphen request."));
76 hyphen_spanner_p_
= new Hyphen_spanner
;
77 hyphen_spanner_p_
->set_textitem (LEFT
, last_lyric_l_
);
78 announce_element (Score_element_info (hyphen_spanner_p_
, req_l_
));
84 Hyphen_engraver::do_pre_move_processing ()
86 if (hyphen_spanner_p_
)
88 typeset_element (hyphen_spanner_p_
);
89 hyphen_spanner_p_
= 0;
94 last_lyric_l_
= current_lyric_l_
;
100 Hyphen_engraver::do_post_move_processing ()