-/*
- 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
else
{
SCM copy = daddy_props;
- SCM * tail = ©
+ SCM *tail = ©
SCM p = scm_car (props);
while (p != based_on)
{
}
}
-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;
}