]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator-def.cc
*** empty log message ***
[lilypond.git] / lily / translator-def.cc
index 7db483d56af11ed7c37022e2923f8a6e98c7b7a6..551c0b59d57f60b227a17a3bdd6a18a74c50e94e 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -31,6 +31,7 @@ Translator_def::mark_smob (SCM smob)
 {
   Translator_def* me = (Translator_def*) SCM_CELL_WORD_1 (smob);
 
+  scm_gc_mark (me->description_);
   scm_gc_mark (me->type_aliases_);
   scm_gc_mark (me->consists_name_list_);
   scm_gc_mark (me->accepts_name_list_);
@@ -50,7 +51,12 @@ Translator_def::Translator_def ()
   end_consists_name_list_ = SCM_EOL;
   property_ops_ = SCM_EOL;
   type_name_ = SCM_EOL;
+  description_ = SCM_EOL;
+
+  smobify_self();
+  
 }
+
 Translator_def::~Translator_def ()
 {
 }
@@ -58,11 +64,23 @@ Translator_def::~Translator_def ()
 Translator_def::Translator_def (Translator_def const & s)
   : Input (s)
 {
+  type_aliases_ = SCM_EOL;
+  translator_group_type_ = SCM_EOL;
+  accepts_name_list_ = SCM_EOL;   
+  consists_name_list_ = SCM_EOL;
+  end_consists_name_list_ = SCM_EOL;
+  property_ops_ = SCM_EOL;
+  type_name_ = SCM_EOL;
+  description_ = SCM_EOL;
+  
+  smobify_self();
+  description_ = s.description_;
+
   consists_name_list_ = scm_list_copy (s.consists_name_list_);
   end_consists_name_list_ = scm_list_copy (s.end_consists_name_list_);
   accepts_name_list_ = scm_list_copy (s.accepts_name_list_);
   property_ops_ = scm_list_copy (s.property_ops_);
-  type_aliases_ = s.type_aliases_;
+  type_aliases_ = scm_list_copy (s.type_aliases_);
   translator_group_type_ = s.translator_group_type_;
   type_name_ = s.type_name_;
 }
@@ -137,6 +155,8 @@ Translator_def::add_pop_property (SCM props, SCM syms)
                                 this->property_ops_);
 }
 
+
+
 /*
   Do it. SYM is single symbol. VAL is SCM_UNDEFINED in case of a pop
 */
@@ -275,14 +295,16 @@ SCM
 Translator_def::clone_scm () const
 {
   Translator_def * t = new Translator_def (*this);
-  return t->unprotected_smobify_self ();
+  scm_gc_unprotect_object (t->self_scm());
+  return t->self_scm();
 }
 
 SCM
 Translator_def::make_scm ()
 {
   Translator_def* t = new Translator_def;
-  return t->unprotected_smobify_self ();
+  scm_gc_unprotect_object (t->self_scm());
+  return t->self_scm();
 }
 
 void
@@ -309,10 +331,17 @@ Translator_def::to_alist () const
   SCM l = SCM_EOL;
   
   l = gh_cons (gh_cons (ly_symbol2scm ("consists"),  consists_name_list_), l);
-  l = gh_cons (gh_cons (ly_symbol2scm ("end-consists"),  end_consists_name_list_), l);
+  l = gh_cons (gh_cons (ly_symbol2scm ("description"),  description_), l);
+  l = gh_cons (gh_cons (ly_symbol2scm ("end-consists"),
+                       end_consists_name_list_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("accepts"),  accepts_name_list_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"),  property_ops_), l);
-  l = gh_cons (gh_cons (ly_symbol2scm ("type-name"),  type_name_), l); // junkme.
+
+  /*
+    junkme:
+   */
+  l = gh_cons (gh_cons (ly_symbol2scm ("type-name"),  type_name_), l);
+  
   l = gh_cons (gh_cons (ly_symbol2scm ("group-type"),  translator_group_type_), l);    
 
   return l;