]> git.donarmstrong.com Git - lilypond.git/blob - lily/staff-collecting-engraver.cc
Correct dot placement on elongated fret-diagrams
[lilypond.git] / lily / staff-collecting-engraver.cc
1 /*
2   staff-collecting-engraver.cc -- implement Staff_collecting_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2001--2007  Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "staff-symbol.hh"
10 #include "engraver.hh"
11 #include "grob.hh"
12 #include "context.hh"
13
14 class Staff_collecting_engraver : public Engraver
15 {
16 public:
17   TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
18   DECLARE_ACKNOWLEDGER (staff_symbol);
19   DECLARE_END_ACKNOWLEDGER (staff_symbol);
20 };
21
22 Staff_collecting_engraver::Staff_collecting_engraver ()
23 {
24 }
25
26 void
27 Staff_collecting_engraver::acknowledge_staff_symbol (Grob_info gi)
28 {
29   SCM staffs = get_property ("stavesFound");
30   staffs = scm_cons (gi.grob ()->self_scm (), staffs);
31
32   context ()->set_property ("stavesFound", staffs);
33 }
34
35 void
36 Staff_collecting_engraver::acknowledge_end_staff_symbol (Grob_info gi)
37 {
38   SCM staffs = get_property ("stavesFound");
39   staffs = scm_delq (gi.grob ()->self_scm (), staffs);
40
41   context ()->set_property ("stavesFound", staffs);
42 }
43
44 #include "translator.icc"
45
46 ADD_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
47 ADD_END_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
48
49 ADD_TRANSLATOR (Staff_collecting_engraver,
50                 /* doc */
51                 "Maintain the @code{stavesFound} variable.",
52
53                 /* create */
54                 "",
55
56                 /* read */
57                 "stavesFound ",
58
59                 /* write */
60                 "stavesFound "
61                 );