source file of the GNU LilyPond music typesetter
- (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 2004--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "context.hh"
}
Context::Context (Context const &src)
- : key_manager_ (src.key_manager_)
{
+ (void) src;
assert (false);
}
}
-Context::Context (Object_key const *key)
- : key_manager_ (key)
+Context::Context ()
{
daddy_context_ = 0;
aliases_ = SCM_EOL;
event_source_->unprotect ();
events_below_ = new Dispatcher ();
events_below_->unprotect ();
-
- /*
- UGH UGH
- const correctness.
- */
- key_manager_.unprotect();
}
/* TODO: this shares code with find_create_context (). */
SCM ops = ev->get_property ("ops");
SCM type_scm = ev->get_property ("type");
string type = ly_symbol2string (type_scm);
- Object_key const *key = key_manager_.get_context_key (now_mom(), type, id);
vector<Context_def*> path
= unsmob_context_def (definition_)->path_to_acceptable_context (type_scm, get_output_def ());
}
Context_def *cdef = path[0];
- Context *new_context = cdef->instantiate (ops, key);
+ Context *new_context = cdef->instantiate (ops);
new_context->id_string_ = id;
send_stream_event (this, "CreateContext", 0,
ly_symbol2scm ("ops"), ops,
ly_symbol2scm ("type"), cdef->get_context_name (),
- ly_symbol2scm ("id"), scm_makfrom0str (id.c_str ()));
+ ly_symbol2scm ("id"), ly_string2scm (id));
event_source_->
remove_listener (GET_LISTENER (acknowledge_infant),
ly_symbol2scm ("AnnounceNewContext"));
return 1;
}
-Object_key const *
-Context::get_grob_key (string name)
-{
- return key_manager_.get_grob_key (now_mom (), name);
-}
-
-Object_key const *
-Context::get_context_key (string name, string id)
-{
- return key_manager_.get_context_key (now_mom (), name, id);
-}
-
SCM
Context::mark_smob (SCM sm)
{
Context *me = (Context *) SCM_CELL_WORD_1 (sm);
- me->key_manager_.gc_mark();
scm_gc_mark (me->context_list_);
scm_gc_mark (me->aliases_);
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?
*/