X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcontext.cc;h=3c982751fd6635e1822ad525a54471a2fb893a07;hb=c74523f061cba5fb50d307ff04e3507c8b36f5c8;hp=45a1562b1f98a6d255c7da7d2af73f065744d66b;hpb=8f5cd22af76fcb5c77853a5ede8b94ebef97caef;p=lilypond.git diff --git a/lily/context.cc b/lily/context.cc index 45a1562b1f..3c982751fd 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2004--2006 Han-Wen Nienhuys + (c) 2004--2007 Han-Wen Nienhuys */ #include "context.hh" @@ -47,8 +47,8 @@ Context::check_removal () } Context::Context (Context const &src) - : key_manager_ (src.key_manager_) { + (void) src; assert (false); } @@ -69,8 +69,7 @@ Context::add_context (Context *child) } -Context::Context (Object_key const *key) - : key_manager_ (key) +Context::Context () { daddy_context_ = 0; aliases_ = SCM_EOL; @@ -92,12 +91,6 @@ Context::Context (Object_key const *key) 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 (). */ @@ -267,7 +260,6 @@ Context::create_context_from_event (SCM sev) 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 path = unsmob_context_def (definition_)->path_to_acceptable_context (type_scm, get_output_def ()); @@ -278,7 +270,7 @@ Context::create_context_from_event (SCM sev) } Context_def *cdef = path[0]; - Context *new_context = cdef->instantiate (ops, key); + Context *new_context = cdef->instantiate (ops); new_context->id_string_ = id; @@ -337,7 +329,7 @@ Context::create_context (Context_def *cdef, 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")); @@ -468,19 +460,16 @@ Context::add_alias (SCM sym) aliases_ = scm_cons (sym, aliases_); } +/* we don't (yet) instrument context properties */ void -Context::internal_set_property (SCM sym, SCM val -#ifndef NDEBUG - , char const *file, int line, char const *fun -#endif - ) +Context::instrumented_set_property (SCM sym, SCM val, const char*, int, const char*) { -#ifndef NDEBUG - (void) file; - (void) line; - (void) fun; -#endif + internal_set_property (sym, val); +} +void +Context::internal_set_property (SCM sym, SCM val) +{ if (do_internal_type_checking_global) assert (type_check_assignment (sym, val, ly_symbol2scm ("translation-type?"))); @@ -629,23 +618,10 @@ Context::print_smob (SCM s, SCM port, scm_print_state *) 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_); @@ -689,17 +665,6 @@ 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? */ @@ -752,7 +717,7 @@ melisma_busy (Context *tr) SCM melisma_properties = tr->get_property ("melismaBusyProperties"); bool busy = false; - for (; scm_is_pair (melisma_properties); + for (; !busy && scm_is_pair (melisma_properties); melisma_properties = scm_cdr (melisma_properties)) busy = busy || to_boolean (tr->internal_get_property (scm_car (melisma_properties)));