]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/kievan-ligature-engraver.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / lily / kievan-ligature-engraver.cc
index 85d6d8dc0fb66dcf0eb85d9cb4603908c24e0eef..162674df2efd378bc138224661fde167330b7517 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2013--2014 Aleksandr Andreev <aleksandr.andreev@gmail.com>
+  Copyright (C) 2013--2015 Aleksandr Andreev <aleksandr.andreev@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -36,23 +36,17 @@ protected:
   virtual Spanner *create_ligature_spanner ();
   virtual void build_ligature (Spanner *ligature,
                                vector<Grob_info> const &primitives);
-  DECLARE_TRANSLATOR_LISTENER (ligature);
 
 public:
   TRANSLATOR_DECLARATIONS (Kievan_ligature_engraver);
+  TRANSLATOR_INHERIT (Coherent_ligature_engraver);
 
 private:
   void fold_up_primitives (vector<Grob_info> const &primitives, Real padding, Real &min_length);
 };
 
-IMPLEMENT_TRANSLATOR_LISTENER (Kievan_ligature_engraver, ligature);
-void
-Kievan_ligature_engraver::listen_ligature (Stream_event *ev)
-{
-  Ligature_engraver::listen_ligature (ev);
-}
-
-Kievan_ligature_engraver::Kievan_ligature_engraver ()
+Kievan_ligature_engraver::Kievan_ligature_engraver (Context *c)
+  : Coherent_ligature_engraver (c)
 {
 
 }
@@ -81,7 +75,7 @@ Kievan_ligature_engraver::fold_up_primitives (vector<Grob_info> const &primitive
          first = current;
 
       // must keep track of accidentals in spacing problem
-      Grob *acc_gr = unsmob_grob (current->get_object ("accidental-grob"));
+      Grob *acc_gr = unsmob<Grob> (current->get_object ("accidental-grob"));
       if (acc_gr && i > 0)
         {
            Interval acc_ext = acc_gr->extent (acc_gr, X_AXIS);
@@ -107,7 +101,7 @@ Kievan_ligature_engraver::fold_up_primitives (vector<Grob_info> const &primitive
       if (i < primitives.size () - 1)
         {
            Item *next = dynamic_cast<Item *> (primitives[i + 1].grob ());
-           Grob *acc_gr = unsmob_grob (next->get_object ("accidental-grob"));
+           Grob *acc_gr = unsmob<Grob> (next->get_object ("accidental-grob"));
            if (acc_gr)
              {
                 Interval acc_ext = acc_gr->extent (acc_gr, X_AXIS);
@@ -135,8 +129,14 @@ Kievan_ligature_engraver::build_ligature (Spanner *ligature,
 
 }
 
-ADD_ACKNOWLEDGER (Kievan_ligature_engraver, rest);
-ADD_ACKNOWLEDGER (Kievan_ligature_engraver, ligature_head);
+
+void
+Kievan_ligature_engraver::boot ()
+{
+  ADD_LISTENER (Kievan_ligature_engraver, ligature);
+  ADD_ACKNOWLEDGER (Kievan_ligature_engraver, rest);
+  ADD_ACKNOWLEDGER (Kievan_ligature_engraver, ligature_head);
+}
 
 ADD_TRANSLATOR (Kievan_ligature_engraver,
                 /* doc */