]> git.donarmstrong.com Git - lilypond.git/blob - lily/tweak-engraver.cc
Basic-notation reorg and misc small fixes.
[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--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #include "engraver.hh"
11
12 #include "music.hh"
13 #include "grob.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 (Music *music = info.music_cause ())
32     {
33       for (SCM s = music->get_property ("tweaks");
34            scm_is_pair (s); s = scm_cdr (s))
35         {
36           info.grob ()->internal_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 */ "Read the @code{tweaks} property from the originating Music event, and set properties." ,
44                 
45                 /* create */ "",
46                 /* accept */ "",
47                 /* read */ "",
48                 /* write */ "");