Docs: LM 4.4.3: Clarify overriding vertical positioning of spanners
[lilypond/mpolesky.git] / lily / vertically-spaced-context-engraver.cc
blobbc64f1bc5ce3f66ff064dcbba76ba6c47eeefcf5
1 /*
2 vertically-spaced-contexts-engraver.cc -- implement Vertically_spaced_contexts_engraver
3 TODO: junk this, since we now determine spaceability using Page_layout_problem::is_spaceable.
5 source file of the GNU LilyPond music typesetter
7 (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
8 */
10 #include "engraver.hh"
11 #include "grob.hh"
12 #include "axis-group-interface.hh"
13 #include "context.hh"
14 #include "pointer-group-interface.hh"
16 class Vertically_spaced_contexts_engraver : public Engraver
18 TRANSLATOR_DECLARATIONS (Vertically_spaced_contexts_engraver);
19 protected:
20 virtual void initialize ();
21 DECLARE_ACKNOWLEDGER (vertically_spaceable);
23 private:
24 Grob *system_;
27 Vertically_spaced_contexts_engraver::Vertically_spaced_contexts_engraver ()
29 system_ = 0;
32 void
33 Vertically_spaced_contexts_engraver::initialize ()
35 system_ = unsmob_grob (get_property ("rootSystem"));
38 void
39 Vertically_spaced_contexts_engraver::acknowledge_vertically_spaceable (Grob_info gi)
41 if (Axis_group_interface::has_interface (gi.grob ()))
43 SCM spaceable = get_property ("verticallySpacedContexts");
44 Context *orig = gi.origin_contexts (this)[0];
46 if (scm_memq (ly_symbol2scm (orig->context_name ().c_str ()),
47 spaceable) != SCM_BOOL_F)
49 Pointer_group_interface::add_unordered_grob (system_,
50 ly_symbol2scm ("spaceable-staves"),
51 gi.grob ());
56 #include "translator.icc"
58 ADD_ACKNOWLEDGER (Vertically_spaced_contexts_engraver, vertically_spaceable);
59 ADD_TRANSLATOR (Vertically_spaced_contexts_engraver,
60 /* doc */
61 "",
63 /* create */
64 "",
66 /* read */
67 "verticallySpacedContexts ",
69 /* write */
70 "verticallySpacedContexts "