2 hara-kiri-engraver.cc -- implement Hara_kiri_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "axis-group-engraver.hh"
10 #include "hara-kiri-group-spanner.hh"
11 #include "rhythmic-head.hh"
14 #include "translator.icc"
17 TODO: fold together with axis_group_engraver?
20 class Hara_kiri_engraver
: public Axis_group_engraver
23 virtual Spanner
*get_spanner ();
24 DECLARE_ACKNOWLEDGER (grob
);
25 virtual void add_element (Grob
*e
);
26 void process_music ();
27 virtual void derived_mark () const;
30 TRANSLATOR_DECLARATIONS (Hara_kiri_engraver
);
34 Hara_kiri_engraver::Hara_kiri_engraver ()
36 interesting_
= SCM_EOL
;
40 Hara_kiri_engraver::derived_mark () const
42 scm_gc_mark (interesting_
);
46 Hara_kiri_engraver::process_music ()
48 Axis_group_engraver::process_music ();
49 interesting_
= get_property ("keepAliveInterfaces");
53 Hara_kiri_engraver::add_element (Grob
*e
)
55 Axis_group_engraver::add_element (e
);
59 Hara_kiri_engraver::get_spanner ()
61 Spanner
*sp
= make_spanner ("VerticalAxisGroup", SCM_EOL
);
66 Hara_kiri_engraver::acknowledge_grob (Grob_info i
)
68 Axis_group_engraver::acknowledge_grob (i
);
71 for (SCM s
= interesting_
; scm_is_pair (s
); s
= scm_cdr (s
))
73 if (i
.grob ()->internal_has_interface (scm_car (s
)))
74 Hara_kiri_group_spanner::add_interesting_item (staffline_
, i
.grob ());
80 ADD_ACKNOWLEDGER (Hara_kiri_engraver
, grob
);
81 ADD_TRANSLATOR (Hara_kiri_engraver
,
83 "Like @code{Axis_group_engraver}, but make a hara-kiri"
84 " spanner, and add interesting items (i.e., note heads, lyric"
85 " syllables, and normal rests).",
91 "keepAliveInterfaces ",