]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context-property.cc
fix typos.
[lilypond.git] / lily / context-property.cc
index 4796980d9fb4edb72d3031171d8ccf9c4b24b190..bd5ccbf7b8f326d39a00feb51bd8f3b0d51403b0 100644 (file)
@@ -1,18 +1,18 @@
-/*   
-   translator-property.cc -- implement manipulation of immutable Grob
+/*
+   context-property.cc -- implement manipulation of immutable Grob
    property lists.
 
    source file of the GNU LilyPond music typesetter
 
    (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
- */
+*/
 
-#include "main.hh"
 #include "context.hh"
-#include "warn.hh"
+#include "engraver.hh"
 #include "item.hh"
+#include "main.hh"
 #include "spanner.hh"
-#include "engraver.hh"
+#include "warn.hh"
 
 /*
   Grob descriptions (ie. alists with layout properties) are
@@ -178,7 +178,7 @@ updated_grob_properties (Context * tg, SCM sym)
   else
     {
       SCM copy = daddy_props;
-      SCM * tail = &copy;
+      SCM *tail = &copy;
       SCM p = scm_car (props);
       while  (p != based_on)
        {
@@ -194,28 +194,31 @@ updated_grob_properties (Context * tg, SCM sym)
     }
 }
 
-Item*
-make_item_from_properties (Translator *tr, SCM x, SCM cause)
+Item *
+make_item_from_properties (Engraver *tr, SCM x, SCM cause, const char * name)
 {
-  Context *tg = tr->context ();
+  Context *context = tr->context ();
   
-  SCM props = updated_grob_properties (tg, x);
-  Item *it= new Item (props);
+  SCM props = updated_grob_properties (context, x);
+
+  Object_key const*key = context->get_grob_key (name);
+  Item *it = new Item (props, key);
+  scm_gc_unprotect_object (key->self_scm ());
 
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
-  
+
   return it;
 }
 
 Spanner*
-make_spanner_from_properties (Translator *tr, SCM x, SCM cause)
+make_spanner_from_properties (Engraver *tr, SCM x, SCM cause, const char *name)
 {
-  Context *tg = tr->context ();
-  
-  SCM props = updated_grob_properties (tg, x);
-  Spanner *it= new Spanner (props);
+  Context *context = tr->context ();
+
+  SCM props = updated_grob_properties (context, x);
+  Spanner *it = new Spanner (props, context->get_grob_key (name));
 
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
-  
+
   return it;
 }