]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parenthesis-engraver.cc
Merge with master
[lilypond.git] / lily / parenthesis-engraver.cc
index 13aba090bd091fe2f645a8429b88f4606ca59b9a..8f190f969cca7b4aa43a540c3ab8fb063cac0ba7 100644 (file)
@@ -3,17 +3,17 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 */
 
 #include "engraver.hh"
 
-#include "warn.hh"
-#include "simple-closure.hh"
-#include "music.hh"
-#include "grob.hh"
 #include "item.hh"
+#include "pointer-group-interface.hh"
+#include "simple-closure.hh"
+#include "stream-event.hh"
+#include "warn.hh"
 
 #include "translator.icc"
 
@@ -29,25 +29,21 @@ Parenthesis_engraver::Parenthesis_engraver()
 {
 }
 
-
-
 void
 Parenthesis_engraver::acknowledge_grob (Grob_info info)
 {
-  if (Music *music = info.music_cause ())
+  if (Stream_event *ev = info.event_cause ())
     {
-      if (to_boolean (music->get_property ("parenthesize")))
+      if (to_boolean (ev->get_property ("parenthesize")))
        {
          if (Item *victim = dynamic_cast<Item*> (info.grob ()))
            {
              Engraver *eng = dynamic_cast<Engraver*> (info.origin_translator ());
-             Item *paren = make_item_from_properties (eng,
-                                                      ly_symbol2scm ("ParenthesesItem"),
-                                                      victim->self_scm (),
-                                                      "ParenthesesItem");
+             Item *paren = eng->make_item ("ParenthesesItem", victim->self_scm ());
+             Pointer_group_interface::add_grob (paren, ly_symbol2scm ("elements"), victim);
 
              paren->set_parent (victim, Y_AXIS);
-             paren->set_parent (victim, X_AXIS);
+             
              Real size = robust_scm2double (paren->get_property ("font-size"), 0.0)
                + robust_scm2double (victim->get_property ("font-size"), 0.0);
              paren->set_property ("font-size", scm_from_double (size));
@@ -71,7 +67,7 @@ ADD_TRANSLATOR (Parenthesis_engraver,
                /* doc */ "Parenthesize objects whose music cause has the @code{parenthesize} "
                "property.",
                
-               /* create */ "ParenthesesItem",
-               /* accept */ "",
+               /* create */
+               "ParenthesesItem ",
                /* read */ "",
                /* write */ "");