Docs: Add new procedure for barNumberVisibility
[lilypond/mpolesky.git] / lily / vertically-spaced-context-engraver.cc
blob750f2e3721c77e26e623513c2324a916dd99a4dd
1 /*
2 vertically-spaced-contexts-engraver.cc -- implement Vertically_spaced_contexts_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #include "engraver.hh"
10 #include "grob.hh"
11 #include "axis-group-interface.hh"
12 #include "context.hh"
13 #include "pointer-group-interface.hh"
15 class Vertically_spaced_contexts_engraver : public Engraver
17 TRANSLATOR_DECLARATIONS (Vertically_spaced_contexts_engraver);
18 protected:
19 virtual void initialize ();
20 DECLARE_ACKNOWLEDGER (vertically_spaceable);
22 private:
23 Grob *system_;
26 Vertically_spaced_contexts_engraver::Vertically_spaced_contexts_engraver ()
28 system_ = 0;
31 void
32 Vertically_spaced_contexts_engraver::initialize ()
34 system_ = unsmob_grob (get_property ("rootSystem"));
37 void
38 Vertically_spaced_contexts_engraver::acknowledge_vertically_spaceable (Grob_info gi)
40 if (Axis_group_interface::has_interface (gi.grob ()))
42 SCM spaceable = get_property ("verticallySpacedContexts");
43 Context *orig = gi.origin_contexts (this)[0];
45 if (scm_memq (ly_symbol2scm (orig->context_name ().c_str ()),
46 spaceable) != SCM_BOOL_F)
48 Pointer_group_interface::add_unordered_grob (system_,
49 ly_symbol2scm ("spaceable-staves"),
50 gi.grob ());
55 #include "translator.icc"
57 ADD_ACKNOWLEDGER (Vertically_spaced_contexts_engraver, vertically_spaceable);
58 ADD_TRANSLATOR (Vertically_spaced_contexts_engraver,
59 /* doc */
60 "",
62 /* create */
63 "",
65 /* read */
66 "verticallySpacedContexts ",
68 /* write */
69 "verticallySpacedContexts "