2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "axis-group-engraver.hh"
21 #include "hara-kiri-group-spanner.hh"
22 #include "rhythmic-head.hh"
25 #include "translator.icc"
28 TODO: fold together with axis_group_engraver?
31 class Hara_kiri_engraver : public Axis_group_engraver
34 virtual Spanner *get_spanner ();
35 DECLARE_ACKNOWLEDGER (grob);
36 virtual void add_element (Grob *e);
37 void process_music ();
38 virtual void derived_mark () const;
41 TRANSLATOR_DECLARATIONS (Hara_kiri_engraver);
44 Hara_kiri_engraver::Hara_kiri_engraver ()
46 interesting_ = SCM_EOL;
50 Hara_kiri_engraver::derived_mark () const
52 scm_gc_mark (interesting_);
56 Hara_kiri_engraver::process_music ()
58 Axis_group_engraver::process_music ();
59 interesting_ = get_property ("keepAliveInterfaces");
63 Hara_kiri_engraver::add_element (Grob *e)
65 Axis_group_engraver::add_element (e);
69 Hara_kiri_engraver::get_spanner ()
71 Spanner *sp = make_spanner ("VerticalAxisGroup", SCM_EOL);
76 Hara_kiri_engraver::acknowledge_grob (Grob_info i)
78 Axis_group_engraver::acknowledge_grob (i);
81 for (SCM s = interesting_; scm_is_pair (s); s = scm_cdr (s))
83 if (i.grob ()->internal_has_interface (scm_car (s)))
84 Hara_kiri_group_spanner::add_interesting_item (staffline_, i.grob ());
89 ADD_ACKNOWLEDGER (Hara_kiri_engraver, grob);
90 ADD_TRANSLATOR (Hara_kiri_engraver,
92 "Like @code{Axis_group_engraver}, but make a hara-kiri"
93 " spanner, and add interesting items (i.e., note heads, lyric"
94 " syllables, and normal rests).",
100 "keepAliveInterfaces ",