]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator.cc
release: 1.3.0
[lilypond.git] / lily / translator.cc
index 58b4c589178f09a50610562213b83339187d61fa..218a8c142339f7c83eca4a5c637919c899888827 100644 (file)
@@ -3,14 +3,21 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
 #include "translator.hh"
 #include "debug.hh"
 #include "translator-group.hh"
-#include "dictionary-iter.hh"
+
+#include "moment.hh"
+
+char const*
+Translator::name() const
+{
+  return classname(this);
+}
 
 Translator::~Translator ()
 {
@@ -29,7 +36,6 @@ Translator::Translator (Translator const &s)
   status = ORPHAN;
   daddy_trans_l_ =0;
   output_def_l_ = s.output_def_l_;
-  properties_dict_ = s.properties_dict_;
   type_str_ = s.type_str_;
 }
 
@@ -40,16 +46,16 @@ Translator::is_alias_b (String s) const
 }
 
 bool
-Translator::do_try_request (Request *)
+Translator::do_try_music (Music *)
 {
   return false;
 }
                            
 
 Moment
-Translator::now_moment () const
+Translator::now_mom () const
 {
-  return daddy_trans_l_->now_moment ();
+  return daddy_trans_l_->now_mom ();
 }
 
 
@@ -72,15 +78,11 @@ void
 Translator::print () const
 {
 #ifndef NPRINT
-  DOUT << name () << " {";
-  if (name () != type_str_)
-    DOUT << "type = " << type_str_;
-  for (Dictionary_iter<Scalar> i (properties_dict_); i.ok (); i++)
-    {
-      DOUT << i.key () << "=" << i.val () <<"\n";
-    }
+  DEBUG_OUT << classname (this) << " {";
+  if (classname (this) != type_str_)
+    DEBUG_OUT << "type = " << type_str_;
   do_print ();
-  DOUT << "}\n";
+  DEBUG_OUT << "}\n";
 #endif
 }
 
@@ -89,7 +91,7 @@ Translator::do_print () const
 {
 }
 
-IMPLEMENT_IS_TYPE_B(Translator);
+
 
 
 void
@@ -103,75 +105,56 @@ Translator::creation_processing ()
 }
 
 void
-Translator::post_move_processing()
+Translator::post_move_processing ()
 {
   if (status >= MOVE_INITED)
     return;
 
-  creation_processing();
-  do_post_move_processing();
+  creation_processing ();
+  do_post_move_processing ();
   status = MOVE_INITED;
 }
 
 void
-Translator::removal_processing()
+Translator::removal_processing ()
 {
   if (status == ORPHAN)
     return;
-  creation_processing();
-  do_removal_processing();
+  creation_processing ();
+  do_removal_processing ();
   // elegancy ...
   // status = ORPHAN;
 }
 
 
 bool
-Translator::try_request (Request * r)
+Translator::try_music (Music * r)
 {
   if (status < MOVE_INITED)
-    post_move_processing();
+    post_move_processing ();
 
-  return do_try_request (r);
+  return do_try_music (r);
 }
 
 void
-Translator::process_requests()
+Translator::process_requests ()
 {
   if (status < PROCESSED_REQS)
-    post_move_processing();
+    post_move_processing ();
   else if (status >= PROCESSED_REQS)
     return; 
   
   status = PROCESSED_REQS;
-  do_process_requests();
+  do_process_requests ();
 }
 
 void
-Translator::pre_move_processing()
+Translator::pre_move_processing ()
 {
-  do_pre_move_processing();
+  do_pre_move_processing ();
   status = CREATION_INITED;
 }
 
-Scalar
-Translator::get_property (String id)
-{
-  if (properties_dict_.elt_b (id))
-    {
-      return properties_dict_[id];
-    }
-  
-  if (daddy_trans_l_)
-    return daddy_trans_l_->get_property (id);
-
-  return "";
-}
-
-void
-Translator::set_property (String id, Scalar val)
-{
-  properties_dict_[id] = val;
-}
 
 
 Music_output_def *
@@ -179,3 +162,22 @@ Translator::output_def_l () const
 {
   return output_def_l_;
 }
+
+SCM
+Translator::get_property (String id, Translator_group **where_l) const
+{
+  return daddy_trans_l_->get_property (id, where_l);
+}
+
+
+
+void
+Translator:: do_pre_move_processing(){}
+void
+Translator::do_post_move_processing(){}
+void
+Translator::do_process_requests () {}
+void
+Translator::do_creation_processing() {}
+void
+Translator::do_removal_processing(){}