]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-engraver.cc
* input/regression/markup-bidi-pango.ly: new file.
[lilypond.git] / lily / text-engraver.cc
index b9f95093042ee0c1ecbdb89bee66921e63bc9b6f..4787661847d5831eb62fcd24464616521be9a7ab 100644 (file)
@@ -24,9 +24,11 @@ public:
   TRANSLATOR_DECLARATIONS (Text_engraver);
 protected:
   virtual bool try_music (Music *m);
-  PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
-  PRECOMPUTED_VIRTUAL void process_acknowledged ();
-  virtual void acknowledge_grob (Grob_info);
+  void stop_translation_timestep ();
+  void process_acknowledged ();
+
+  DECLARE_ACKNOWLEDGER (stem);
+  DECLARE_ACKNOWLEDGER (rhythmic_head);
 };
 
 bool
@@ -41,34 +43,30 @@ Text_engraver::try_music (Music *m)
 }
 
 void
-Text_engraver::acknowledge_grob (Grob_info inf)
+Text_engraver::acknowledge_rhythmic_head (Grob_info inf)
 {
-  if (Rhythmic_head::has_interface (inf.grob ()))
+  for (int i = 0; i < texts_.size (); i++)
     {
-      for (int i = 0; i < texts_.size (); i++)
-       {
-         Grob *t = texts_[i];
-         Side_position_interface::add_support (t, inf.grob ());
-
-         /*
-           ugh.
-         */
-         if (Side_position_interface::get_axis (t) == X_AXIS
-             && !t->get_parent (Y_AXIS))
-           t->set_parent (inf.grob (), Y_AXIS);
-         else if (Side_position_interface::get_axis (t) == Y_AXIS
-                  && !t->get_parent (X_AXIS))
-           t->set_parent (inf.grob (), X_AXIS);
-       }
+      Grob *t = texts_[i];
+      Side_position_interface::add_support (t, inf.grob ());
+
+      /*
+       ugh.
+      */
+      if (Side_position_interface::get_axis (t) == X_AXIS
+         && !t->get_parent (Y_AXIS))
+       t->set_parent (inf.grob (), Y_AXIS);
+      else if (Side_position_interface::get_axis (t) == Y_AXIS
+              && !t->get_parent (X_AXIS))
+       t->set_parent (inf.grob (), X_AXIS);
     }
+}
 
-  if (Stem::has_interface (inf.grob ()))
-    {
-      for (int i = 0; i < texts_.size (); i++)
-       {
-         Side_position_interface::add_support (texts_[i], inf.grob ());
-       }
-    }
+void
+Text_engraver::acknowledge_stem (Grob_info inf)
+{
+  for (int i = 0; i < texts_.size (); i++)
+    Side_position_interface::add_support (texts_[i], inf.grob ());
 }
 
 void
@@ -95,7 +93,7 @@ Text_engraver::process_acknowledged ()
       /* see script-engraver.cc */
       priority += i;
 
-      text->set_property ("script-priority", scm_int2num (priority));
+      text->set_property ("script-priority", scm_from_int (priority));
 
       Direction dir = to_dir (r->get_property ("direction"));
       if (dir)
@@ -121,10 +119,11 @@ Text_engraver::Text_engraver ()
 
 #include "translator.icc"
 
+ADD_ACKNOWLEDGER (Text_engraver, stem);
+ADD_ACKNOWLEDGER (Text_engraver, rhythmic_head);
 ADD_TRANSLATOR (Text_engraver,
-               /* descr */ "Create text-scripts",
-               /* creats*/ "TextScript",
-               /* accepts */ "text-script-event",
-               /* acks  */ "rhythmic-head-interface stem-interface",
-               /* reads */ "",
+               /* doc */ "Create text-scripts",
+               /* create */ "TextScript",
+               /* accept */ "text-script-event",
+               /* read */ "",
                /* write */ "");