/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2000--2014 Jan Nieuwenhuizen <janneke@gnu.org>
+ Copyright (C) 2000--2015 Jan Nieuwenhuizen <janneke@gnu.org>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
TRANSLATOR_DECLARATIONS (Text_spanner_engraver);
protected:
virtual void finalize ();
- DECLARE_TRANSLATOR_LISTENER (text_span);
- DECLARE_ACKNOWLEDGER (note_column);
+ void listen_text_span (Stream_event *);
+ void acknowledge_note_column (Grob_info);
void stop_translation_timestep ();
void process_music ();
void typeset_all ();
};
-Text_spanner_engraver::Text_spanner_engraver ()
+Text_spanner_engraver::Text_spanner_engraver (Context *c)
+ : Engraver (c)
{
finished_ = 0;
current_event_ = 0;
event_drul_.set (0, 0);
}
-IMPLEMENT_TRANSLATOR_LISTENER (Text_spanner_engraver, text_span);
void
Text_spanner_engraver::listen_text_span (Stream_event *ev)
{
{
current_event_ = event_drul_[START];
span_ = make_spanner ("TextSpanner", event_drul_[START]->self_scm ());
+ if (Direction d = to_dir (current_event_->get_property ("direction")))
+ span_->set_property ("direction", scm_from_int (d));
Side_position_interface::set_axis (span_, Y_AXIS);
event_drul_[START] = 0;
{
if (!finished_->get_bound (RIGHT))
{
- Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
+ Grob *e = unsmob<Grob> (get_property ("currentMusicalColumn"));
finished_->set_bound (RIGHT, e);
}
finished_ = 0;
{
if (span_ && !span_->get_bound (LEFT))
{
- Grob *e = Grob::unsmob (get_property ("currentMusicalColumn"));
+ Grob *e = unsmob<Grob> (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
}
}
}
-ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column);
+
+void
+Text_spanner_engraver::boot ()
+{
+ ADD_LISTENER (Text_spanner_engraver, text_span);
+ ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column);
+}
ADD_TRANSLATOR (Text_spanner_engraver,
/* doc */