]> git.donarmstrong.com Git - lilypond.git/blob - lily/tweak-engraver.cc
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[lilypond.git] / lily / tweak-engraver.cc
1 /*
2   tweak-engraver.cc -- implement Tweak_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #include "engraver.hh"
11
12 #include "grob.hh"
13 #include "stream-event.hh"
14 #include "translator.icc"
15
16 class Tweak_engraver : public Engraver
17 {
18   TRANSLATOR_DECLARATIONS (Tweak_engraver);
19
20 protected:
21   DECLARE_ACKNOWLEDGER (grob);
22 };
23
24 Tweak_engraver::Tweak_engraver ()
25 {
26 }
27
28 void
29 Tweak_engraver::acknowledge_grob (Grob_info info)
30 {
31   if (Stream_event *ev = info.event_cause ())
32     {
33       for (SCM s = ev->get_property ("tweaks");
34            scm_is_pair (s); s = scm_cdr (s))
35         {
36           info.grob ()->set_property (scm_caar (s), scm_cdar (s));
37         }
38     }
39 }
40
41 ADD_ACKNOWLEDGER (Tweak_engraver, grob);
42 ADD_TRANSLATOR (Tweak_engraver,
43                 /* doc */
44                 "Read the @code{tweaks} property from the originating event,"
45                 " and set properties.",
46                 
47                 /* create */
48                 "",
49
50                 /* read */
51                 "",
52
53                 /* write */
54                 ""
55                 );