]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context-def.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / context-def.cc
index b856486dba4900e3fd7bd158ea4fb32943b233e7..a5c13305d42f574c48e561cb6c81c601c4ec9867 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2000--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 /* TODO: should junk this class an replace by
@@ -27,14 +27,21 @@ Context_def::Context_def ()
   context_name_ = SCM_EOL;
   default_child_ = SCM_EOL;
   description_ = SCM_EOL;
+  input_location_ = SCM_EOL;
 
   smobify_self ();
 
+  input_location_ = make_input (Input ());
   context_name_ = ly_symbol2scm ("");
 }
 
+Input *
+Context_def::origin () const
+{
+  return unsmob_input (input_location_);
+}
+
 Context_def::Context_def (Context_def const &s)
-  : Input (s)
 {
   context_aliases_ = SCM_EOL;
   translator_group_type_ = SCM_EOL;
@@ -44,10 +51,11 @@ Context_def::Context_def (Context_def const &s)
   context_name_ = SCM_EOL;
   description_ = SCM_EOL;
   default_child_ = SCM_EOL;
-
+  input_location_ = SCM_EOL;
   smobify_self ();
-  description_ = s.description_;
 
+  description_ = s.description_;
+  input_location_ = make_input (*s.origin ()); 
   default_child_ = s.default_child_;
   accept_mods_ = s.accept_mods_;
   property_ops_ = s.property_ops_;
@@ -79,6 +87,8 @@ Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
 SCM
 Context_def::mark_smob (SCM smob)
 {
+  ASSERT_LIVE_IS_ALLOWED();
+  
   Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob);
 
   scm_gc_mark (me->description_);
@@ -88,6 +98,7 @@ Context_def::mark_smob (SCM smob)
   scm_gc_mark (me->property_ops_);
   scm_gc_mark (me->translator_group_type_);
   scm_gc_mark (me->default_child_);
+  scm_gc_mark (me->input_location_);
 
   return me->context_name_;
 }
@@ -250,9 +261,9 @@ Context_def::get_translator_names (SCM user_mod) const
 }
 
 Context *
-Context_def::instantiate (SCM ops, Object_key const *key)
+Context_def::instantiate (SCM ops)
 {
-  Context *context = new Context (key);
+  Context *context = new Context ();
 
   context->definition_ = self_scm ();
   context->definition_mods_ = ops;