]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/engraver.cc
release: 1.5.10
[lilypond.git] / lily / engraver.cc
index 52eba772e03b7caf8a9c961a4d97997b0f9448a5..9059624ce660f249c0ea9b2e6a1c860f65821161 100644 (file)
 /*
   engraver.cc -- implement Engraver
 
-  Sourcefile of GNU LilyPond musictypesetter
+  Sourcefile of GNU LilyPond music type setter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "music-list.hh"
-#include "musical-request.hh"
+#include "music.hh"
 #include "engraver.hh"
-#include "engraver-group.hh"
-#include "debug.hh"
+#include "engraver-group-engraver.hh"
+#include "grob.hh"
+#include "main.hh"
 
-void
-Engraver::post_move_processing()
-{
-  if (status < CREATION_INITED) 
-    {
-       do_creation_processing();
-       status = CREATION_INITED;
-    }
-  if (status >= MOVE_INITED)
-       return;
-
-  do_post_move_processing();
-  status = MOVE_INITED;
-}
 
 void
-Engraver::removal_processing()
+Engraver::announce_grob (Grob_info inf)
 {
-  if ( status < CREATION_INITED)
-       do_creation_processing();
-  
-  do_removal_processing();
-}
-
-bool
-Engraver::try_request (Request * r)
-{
-  if (status < MOVE_INITED)
-       post_move_processing();
-
-  return do_try_request (r);
+  daddy_grav_l ()->announce_grob (inf);
 }
 
 void
-Engraver::process_requests()
+Engraver::announce_grob (Grob* e, Music *m)
 {
-  if (status < PROCESSED_REQS)
-       post_move_processing();
-  else if (status >= PROCESSED_REQS)
-       return; 
+  if (m && store_locations_global_b 
+      && m->origin ()->location_str ().length_i ())
+    {
+      e->set_grob_property ("origin", m->get_mus_property ("origin"));
+    }
   
-  status = PROCESSED_REQS;
-  do_process_requests();
+  Grob_info i (e, m);
+  if (!i.origin_trans_l_)
+    i.origin_trans_l_ = this;
+  daddy_grav_l ()->announce_grob (i);
 }
 
-void
-Engraver::pre_move_processing()
-{
-  do_pre_move_processing();
-  status = CREATION_INITED;
-}
 
 void
-Engraver::fill_staff_info (Staff_info&)
-{
-  
-}
-
-Scalar
-Engraver::get_feature (String t)
+Engraver::typeset_grob (Grob*p)
 {
-  return daddy_grav_l_->get_feature (t);
+  daddy_grav_l ()->typeset_grob (p);
 }
 
-bool
-Engraver::do_try_request (Request*)
-{
-  return false;
-}
 
-Engraver::Engraver()
+Engraver_group_engraver*
+Engraver::daddy_grav_l () const
 {
-  status = VIRGIN;
-  daddy_grav_l_ = 0;
+  return (daddy_trans_l_)
+       ? dynamic_cast<Engraver_group_engraver *> (daddy_trans_l_)
+       : 0;
 }
 
 void
-Engraver::announce_element (Score_elem_info i)
-{
-  i.origin_grav_l_arr_.push (this);
-  daddy_grav_l_->announce_element (i);
-}
-
-void
-Engraver::typeset_element (Score_elem*p)
-{
-  daddy_grav_l_->typeset_element (p);
-}
-
-Paper_def*
-Engraver::paper()const
-{
-  return daddy_grav_l_->paper();
-}
-
-bool
-Engraver::contains_b (Engraver *grav_l)const
-{
-  return this == grav_l;
-}
-
-Staff_info
-Engraver::get_staff_info() const
-{
-  return daddy_grav_l_->get_staff_info();
-}
-
-void
-Engraver::print() const
-{
-#ifndef NPRINT
-  DOUT << "\n" << name() << " {";
-  do_print();
-  DOUT << "}";
-#endif
-}
-
-
-IMPLEMENT_IS_TYPE_B(Engraver);
-
-void
-Engraver::do_print() const
+Engraver::process_music ()
 {
+  
 }
-