X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscript-row-engraver.cc;h=430c2c9dc3f1b08073024ed9486d61c68f5c1247;hb=e90f0536f9be39ada0bef0aeb0d275dec3b2fb5b;hp=4a76c78c52fac00e8448e0ec0531a8418fbee4bb;hpb=bf7b9929425e6a60cc24f1de18e5f1cdc9055703;p=lilypond.git diff --git a/lily/script-row-engraver.cc b/lily/script-row-engraver.cc index 4a76c78c52..430c2c9dc3 100644 --- a/lily/script-row-engraver.cc +++ b/lily/script-row-engraver.cc @@ -1,14 +1,27 @@ -/* - script-row-engraver.cc -- implement Script_row_engraver - - source file of the GNU LilyPond music typesetter - - (c) 2006 Han-Wen Nienhuys +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 2006--2011 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" + +#include "accidental-placement.hh" +#include "item.hh" #include "script-column.hh" #include "side-position-interface.hh" @@ -27,6 +40,7 @@ class Script_row_engraver : public Engraver public: TRANSLATOR_DECLARATIONS (Script_row_engraver); protected: + DECLARE_ACKNOWLEDGER (accidental_placement); DECLARE_ACKNOWLEDGER (side_position); void process_acknowledged (); void stop_translation_timestep (); @@ -43,7 +57,8 @@ Script_row_engraver::stop_translation_timestep () if (script_row_) { for (vsize i = 0; i < scripts_.size (); i++) - if (Side_position_interface::get_axis (scripts_[i]) == X_AXIS) + 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]); } @@ -62,6 +77,14 @@ Script_row_engraver::acknowledge_side_position (Grob_info inf) } } + +void +Script_row_engraver::acknowledge_accidental_placement (Grob_info inf) +{ + scripts_.push_back (inf.grob ()); +} + + void Script_row_engraver::process_acknowledged () { @@ -70,10 +93,18 @@ Script_row_engraver::process_acknowledged () } +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. ", - /* create */ "ScriptRow ", - /* accept */ "", - /* read */ "", - /* write */ ""); + /* doc */ + "Determine order in horizontal side position elements.", + + /* create */ + "ScriptRow ", + + /* read */ + "", + + /* write */ + "" + );