]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-spacing-engraver.cc
Web-ja: update introduction
[lilypond.git] / lily / note-spacing-engraver.cc
index 8cb1b3539dddf72002c383797be3ccbe3fe9f19e..653aa8db023f80ad804cae7c4d2ab235cbd38e51 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2012 Han-Wen Nienhuys <hanwen@lilypond.org>
+  Copyright (C) 2006--2015 Han-Wen Nienhuys <hanwen@lilypond.org>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -40,8 +40,8 @@ class Note_spacing_engraver : public Engraver
   TRANSLATOR_DECLARATIONS (Note_spacing_engraver);
 protected:
 
-  DECLARE_ACKNOWLEDGER (rhythmic_grob);
-  DECLARE_ACKNOWLEDGER (note_column);
+  void acknowledge_rhythmic_grob (Grob_info);
+  void acknowledge_note_column (Grob_info);
   void stop_translation_timestep ();
   virtual void finalize ();
   virtual void derived_mark () const;
@@ -55,7 +55,8 @@ Note_spacing_engraver::derived_mark () const
     scm_gc_mark (i->first->self_scm ());
 }
 
-Note_spacing_engraver::Note_spacing_engraver ()
+Note_spacing_engraver::Note_spacing_engraver (Context *c)
+  : Engraver (c)
 {
   spacing_ = 0;
   last_spacing_ = 0;
@@ -101,9 +102,9 @@ Note_spacing_engraver::finalize ()
   Grob *last_spacing = last_spacings_[parent];
 
   if (last_spacing
-      && !unsmob_grob_array (last_spacing->get_object ("right-items")))
+      && !unsmob<Grob_array> (last_spacing->get_object ("right-items")))
     {
-      Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
+      Grob *col = unsmob<Grob> (get_property ("currentCommandColumn"));
 
       Pointer_group_interface::add_grob (last_spacing,
                                          ly_symbol2scm ("right-items"),
@@ -120,7 +121,7 @@ Note_spacing_engraver::stop_translation_timestep ()
   if (last_spacing
       && to_boolean (get_property ("hasStaffSpacing")))
     {
-      Grob *col = unsmob_grob (get_property ("currentCommandColumn"));
+      Grob *col = unsmob<Grob> (get_property ("currentCommandColumn"));
       Pointer_group_interface::add_grob (last_spacing,
                                          ly_symbol2scm ("right-items"),
                                          col);
@@ -135,8 +136,13 @@ Note_spacing_engraver::stop_translation_timestep ()
 
 }
 
-ADD_ACKNOWLEDGER (Note_spacing_engraver, note_column);
-ADD_ACKNOWLEDGER (Note_spacing_engraver, rhythmic_grob);
+
+void
+Note_spacing_engraver::boot ()
+{
+  ADD_ACKNOWLEDGER (Note_spacing_engraver, note_column);
+  ADD_ACKNOWLEDGER (Note_spacing_engraver, rhythmic_grob);
+}
 
 ADD_TRANSLATOR (Note_spacing_engraver,
                 /* doc */