]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tweak-engraver.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / lily / tweak-engraver.cc
index 188780c59171e6b5388938b4c847f836567425fe..ed66637abeec3357fe7d6c9eaec4d2f13917bbea 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -29,10 +29,11 @@ class Tweak_engraver : public Engraver
   TRANSLATOR_DECLARATIONS (Tweak_engraver);
 
 protected:
-  DECLARE_ACKNOWLEDGER (grob);
+  void acknowledge_grob (Grob_info);
 };
 
-Tweak_engraver::Tweak_engraver ()
+Tweak_engraver::Tweak_engraver (Context *c)
+  : Engraver (c)
 {
 }
 
@@ -60,14 +61,16 @@ Tweak_engraver::acknowledge_grob (Grob_info info)
               if (scm_is_symbol (scm_caaar (s)))
                 {
                   if (SCM_UNBNDP (grobname))
-                    grobname = scm_from_locale_symbol
+                    grobname = scm_from_utf8_symbol
                       (info.grob ()->name ().c_str ());
                   if (scm_is_eq (scm_caaar (s), grobname))
-                    if (scm_is_symbol (scm_cdaar (s)))
-                      info.grob ()->set_property (scm_cdaar (s), scm_cdar (s));
-                    else
-                      set_nested_property (info.grob (), scm_cdaar (s),
-                                           scm_cdar (s));
+                    {
+                      if (scm_is_symbol (scm_cdaar (s)))
+                        info.grob ()->set_property (scm_cdaar (s), scm_cdar (s));
+                      else
+                        set_nested_property (info.grob (), scm_cdaar (s),
+                                             scm_cdar (s));
+                    }
                 }
               else if (direct)
                 set_nested_property (info.grob (), scm_cdaar (s),
@@ -79,7 +82,12 @@ Tweak_engraver::acknowledge_grob (Grob_info info)
     }
 }
 
-ADD_ACKNOWLEDGER (Tweak_engraver, grob);
+void
+Tweak_engraver::boot ()
+{
+  ADD_ACKNOWLEDGER (Tweak_engraver, grob);
+}
+
 ADD_TRANSLATOR (Tweak_engraver,
                 /* doc */
                 "Read the @code{tweaks} property from the originating event,"