+
+Context *
+Context::get_parent_context () const
+{
+ return daddy_context_;
+}
+
+void
+Context::clear_key_disambiguations ()
+{
+ if (!use_object_keys)
+ return;
+
+ key_manager_.clear ();
+ for (SCM s = context_list_; scm_is_pair (s); s = scm_cdr (s))
+ unsmob_context (scm_car (s))->clear_key_disambiguations ();
+}
+
+/*
+ Ugh. Where to put this?
+*/
+Rational
+measure_length (Context const *context)
+{
+ SCM l = context->get_property ("measureLength");
+ Rational length (1);
+ if (unsmob_moment (l))
+ length = unsmob_moment (l)->main_part_;
+ return length;
+}
+
+Moment
+measure_position (Context const *context)
+{
+ SCM sm = context->get_property ("measurePosition");
+
+ Moment m = 0;
+ if (unsmob_moment (sm))
+ {
+ m = *unsmob_moment (sm);
+
+ if (m.main_part_ < Rational (0))
+ {
+ Rational length (measure_length (context));
+ while (m.main_part_ < Rational (0))
+ m.main_part_ += length;
+ }
+ }
+
+ return m;
+}
+
+
+void
+set_context_property_on_children (Context *trans, SCM sym, SCM val)
+{
+ trans->internal_set_property (sym, ly_deep_copy (val));
+ for (SCM p = trans->children_contexts (); scm_is_pair (p); p = scm_cdr (p))
+ {
+ Context *trg = unsmob_context (scm_car (p));
+ set_context_property_on_children (trg, sym, ly_deep_copy (val));
+ }
+}