X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscript-row-engraver.cc;h=30ded2b8345c72db47ff227d8240d38bee021d55;hb=b872748c6aa8bb721ced458691b38ac2fac5dfc8;hp=21a227228cd76ee0dd1d7a8aa515310a85e96f86;hpb=38d7d319eabc906e82fb42002678c6d42a23b6f7;p=lilypond.git diff --git a/lily/script-row-engraver.cc b/lily/script-row-engraver.cc index 21a227228c..30ded2b834 100644 --- a/lily/script-row-engraver.cc +++ b/lily/script-row-engraver.cc @@ -1,10 +1,21 @@ -/* - script-row-engraver.cc -- implement Script_row_engraver - - source file of the GNU LilyPond music typesetter - - (c) 2006--2009 Han-Wen Nienhuys - +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 2006--2015 Han-Wen Nienhuys + + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "engraver.hh" @@ -16,7 +27,6 @@ #include "translator.icc" - /** Find potentially colliding scripts, and put them in a Script_row @@ -24,18 +34,19 @@ class Script_row_engraver : public Engraver { Grob *script_row_; - vector scripts_; - + vector scripts_; + public: TRANSLATOR_DECLARATIONS (Script_row_engraver); protected: - DECLARE_ACKNOWLEDGER (accidental_placement); - DECLARE_ACKNOWLEDGER (side_position); + void acknowledge_accidental_placement (Grob_info); + void acknowledge_side_position (Grob_info); void process_acknowledged (); void stop_translation_timestep (); }; -Script_row_engraver::Script_row_engraver () +Script_row_engraver::Script_row_engraver (Context *c) + : Engraver (c) { script_row_ = 0; } @@ -46,9 +57,9 @@ Script_row_engraver::stop_translation_timestep () if (script_row_) { for (vsize i = 0; i < scripts_.size (); i++) - if (Accidental_placement::has_interface (scripts_[i]) - || Side_position_interface::get_axis (scripts_[i]) == X_AXIS) - Script_column::add_side_positioned (script_row_, scripts_[i]); + if (has_interface (scripts_[i]) + || Side_position_interface::get_axis (scripts_[i]) == X_AXIS) + Script_column::add_side_positioned (script_row_, scripts_[i]); } scripts_.clear (); @@ -62,18 +73,16 @@ Script_row_engraver::acknowledge_side_position (Grob_info inf) if (thing) { if (!Item::is_non_musical (thing)) - scripts_.push_back (thing); + scripts_.push_back (thing); } } - void Script_row_engraver::acknowledge_accidental_placement (Grob_info inf) { scripts_.push_back (inf.grob ()); } - void Script_row_engraver::process_acknowledged () { @@ -81,19 +90,23 @@ Script_row_engraver::process_acknowledged () script_row_ = make_item ("ScriptRow", SCM_EOL); } +void +Script_row_engraver::boot () +{ + ADD_ACKNOWLEDGER (Script_row_engraver, accidental_placement); + ADD_ACKNOWLEDGER (Script_row_engraver, side_position); +} -ADD_ACKNOWLEDGER (Script_row_engraver, accidental_placement); -ADD_ACKNOWLEDGER (Script_row_engraver, side_position); ADD_TRANSLATOR (Script_row_engraver, - /* doc */ - "Determine order in horizontal side position elements.", + /* doc */ + "Determine order in horizontal side position elements.", - /* create */ - "ScriptRow ", + /* create */ + "ScriptRow ", - /* read */ - "", + /* read */ + "", - /* write */ - "" - ); + /* write */ + "" + );