X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fhara-kiri-engraver.cc;h=d35dbbf8291de975abade4b3c095d81c08a37a5a;hb=a97db4ced6286c02dd269c6e985c412fe2c86cb1;hp=e73c67ab4b494edd3e9723088d26fbab46b6a9a6;hpb=83ed05cef3bfcbd69f4148e8ee0669ca0664e214;p=lilypond.git diff --git a/lily/hara-kiri-engraver.cc b/lily/hara-kiri-engraver.cc index e73c67ab4b..d35dbbf829 100644 --- a/lily/hara-kiri-engraver.cc +++ b/lily/hara-kiri-engraver.cc @@ -1,10 +1,20 @@ /* - hara-kiri-engraver.cc -- implement Hara_kiri_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2010 Han-Wen Nienhuys - (c) 2005 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 "axis-group-engraver.hh" @@ -12,38 +22,54 @@ #include "rhythmic-head.hh" #include "spanner.hh" +#include "translator.icc" + +/* + TODO: fold together with axis_group_engraver? + */ + class Hara_kiri_engraver : public Axis_group_engraver { protected: virtual Spanner *get_spanner (); - DECLARE_ACKNOWLEDGER(grob); + DECLARE_ACKNOWLEDGER (grob); virtual void add_element (Grob *e); - PRECOMPUTED_VIRTUAL void start_translation_timestep (); - + void process_music (); + virtual void derived_mark () const; SCM interesting_; public: TRANSLATOR_DECLARATIONS (Hara_kiri_engraver); }; + +Hara_kiri_engraver::Hara_kiri_engraver () +{ + interesting_ = SCM_EOL; +} + void -Hara_kiri_engraver::start_translation_timestep () +Hara_kiri_engraver::derived_mark () const { - Axis_group_engraver::start_translation_timestep (); - interesting_ = get_property ("keepAliveInterfaces"); + scm_gc_mark (interesting_); } +void +Hara_kiri_engraver::process_music () +{ + Axis_group_engraver::process_music (); + interesting_ = get_property ("keepAliveInterfaces"); +} void Hara_kiri_engraver::add_element (Grob *e) { - Hara_kiri_group_spanner::add_element (staffline_, e); + Axis_group_engraver::add_element (e); } Spanner * Hara_kiri_engraver::get_spanner () { - Spanner *sp = make_spanner ("RemoveEmptyVerticalGroup", SCM_EOL); - + Spanner *sp = make_spanner ("VerticalAxisGroup", SCM_EOL); return sp; } @@ -61,19 +87,21 @@ Hara_kiri_engraver::acknowledge_grob (Grob_info i) } } -Hara_kiri_engraver::Hara_kiri_engraver () -{ - interesting_ = SCM_EOL; -} -#include "translator.icc" -ADD_ACKNOWLEDGER(Hara_kiri_engraver, grob); +ADD_ACKNOWLEDGER (Hara_kiri_engraver, grob); ADD_TRANSLATOR (Hara_kiri_engraver, - /* descr */ "Like Axis_group_engraver, but make a hara-kiri spanner, and add " - "interesting items (ie. note heads, lyric syllables and normal rests) ", - /* creats*/ "RemoveEmptyVerticalGroup", - /* accepts */ "", - /* acks */ "grob-interface", - /* reads */ "keepAliveInterfaces", - /* write */ ""); + /* doc */ + "Like @code{Axis_group_engraver}, but make a hara-kiri" + " spanner, and add interesting items (i.e., note heads, lyric" + " syllables, and normal rests).", + + /* create */ + "VerticalAxisGroup ", + + /* read */ + "keepAliveInterfaces ", + + /* write */ + "" + );