]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-engraver.cc
release: 1.3.47
[lilypond.git] / lily / text-engraver.cc
index c0fb5ab1509756de5e3b2617640a95c580ae65e5..0f222daab1bd2f1d6022c20729ed0fe437647a96 100644 (file)
@@ -3,13 +3,13 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
-#include "dimension-cache.hh"
 
+#include "dimension-cache.hh"
 #include "engraver.hh"
-#include "staff-side.hh"
+#include "side-position-interface.hh"
 #include "text-item.hh"
 #include "musical-request.hh"
 #include "note-head.hh"
@@ -30,7 +30,7 @@ protected:
   virtual bool do_try_music (Music* m);
   virtual void do_pre_move_processing ();
   virtual void do_post_move_processing ();
-  virtual void do_process_requests ();
+  virtual void do_process_music ();
   virtual void acknowledge_element (Score_element_info);
 };
 
@@ -54,7 +54,7 @@ Text_engraver::acknowledge_element (Score_element_info i)
     {
       for (int i=0; i < texts_.size (); i++)
        {
-         Staff_sidify st (texts_[i]);
+         Side_position_interface st (texts_[i]);
          st.add_support (n);
          if (st.get_axis( ) == X_AXIS
              && !texts_[i]->parent_l (Y_AXIS))
@@ -65,24 +65,24 @@ Text_engraver::acknowledge_element (Score_element_info i)
     {
       for (int i=0; i < texts_.size (); i++)
        {
-         Staff_sidify st(texts_[i]);
+         Side_position_interface st(texts_[i]);
          st.add_support (n);
        }
     }
 }
 
 void
-Text_engraver::do_process_requests ()
+Text_engraver::do_process_music ()
 {
   for (int i=0; i < reqs_.size (); i++)
     {
       Text_script_req * r = reqs_[i];
 
       Text_item *text = new Text_item;
-      Staff_sidify stafy (text);
+      Side_position_interface stafy (text);
 
-      SCM axisprop = get_property ("scriptHorizontal",0);
-      if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
+      SCM axisprop = get_property ("scriptHorizontal");
+      if (to_boolean (axisprop))
        {
          stafy.set_axis (X_AXIS);
          //      text->set_parent (ss, Y_AXIS);
@@ -96,16 +96,15 @@ Text_engraver::do_process_requests ()
       if (r->get_direction ())
        stafy.set_direction (r->get_direction ());
       
-      text->text_str_ = r->text_str_;
+      text->set_elt_property ("text",
+                             ly_str02scm ( r->text_str_.ch_C ()));
       
       if (r->style_str_.length_i ())
        text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
       
-      SCM empty = get_property ("textEmptyDimension", 0);
-      if (gh_boolean_p (empty) && gh_scm2bool (empty))
-       {
-         text->set_empty (true, X_AXIS);
-       }
+      SCM empty = get_property ("textNonEmpty");
+      if (!to_boolean (empty))
+       text->set_extent_callback (0, X_AXIS);
 
       announce_element (Score_element_info (text, r));
       texts_.push (text);
@@ -117,6 +116,7 @@ Text_engraver::do_pre_move_processing ()
 {
   for (int i=0; i < texts_.size (); i++)
     {
+      side_position (texts_[i]).add_staff_support ();
       typeset_element (texts_[i]);
     }
   texts_.clear ();