X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscript-column-engraver.cc;h=e94e233882ab45d4b87aeb20575604db8755611b;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=6a0211530de10dacd425f2776c61fb82f02bb69f;hpb=474c8729dc274a30558102a015a01fa5882673db;p=lilypond.git diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 6a0211530d..e94e233882 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -1,9 +1,20 @@ /* - script-column-engraver.cc -- implement Script_column_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 1999--2015 Han-Wen Nienhuys - (c) 1999--2007 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" @@ -19,17 +30,18 @@ class Script_column_engraver : public Engraver { Grob *script_column_; - vector scripts_; + vector scripts_; public: TRANSLATOR_DECLARATIONS (Script_column_engraver); protected: - DECLARE_ACKNOWLEDGER (side_position); + void acknowledge_side_position (Grob_info); void process_acknowledged (); void stop_translation_timestep (); }; -Script_column_engraver::Script_column_engraver () +Script_column_engraver::Script_column_engraver (Context *c) + : Engraver (c) { script_column_ = 0; } @@ -40,8 +52,8 @@ Script_column_engraver::stop_translation_timestep () if (script_column_) { for (vsize i = 0; i < scripts_.size (); i++) - if (Side_position_interface::get_axis (scripts_[i]) == Y_AXIS) - Script_column::add_side_positioned (script_column_, scripts_[i]); + if (Side_position_interface::get_axis (scripts_[i]) == Y_AXIS) + Script_column::add_side_positioned (script_column_, scripts_[i]); } script_column_ = 0; @@ -55,7 +67,7 @@ Script_column_engraver::acknowledge_side_position (Grob_info inf) if (thing) { if (!Item::is_non_musical (thing)) - scripts_.push_back (thing); + scripts_.push_back (thing); } } @@ -66,9 +78,23 @@ Script_column_engraver::process_acknowledged () script_column_ = make_item ("ScriptColumn", SCM_EOL); } -ADD_ACKNOWLEDGER (Script_column_engraver, side_position); +void +Script_column_engraver::boot () +{ + ADD_ACKNOWLEDGER (Script_column_engraver, side_position); +} + ADD_TRANSLATOR (Script_column_engraver, - /* doc */ "", - /* create */ "ScriptColumn", - /* read */ "", - /* write */ ""); + /* doc */ + "Find potentially colliding scripts and put them into a" + " @code{ScriptColumn} object; that will fix the collisions.", + + /* create */ + "ScriptColumn ", + + /* read */ + "", + + /* write */ + "" + );