]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/script-column-engraver.cc
patch::: 1.3.86.jcn2
[lilypond.git] / lily / script-column-engraver.cc
index d38aed9b0f12f8d32081f5c3bb445f5f6cb03783..0a30bea2496d66a366dd9af421d90d2fbe37b8cc 100644 (file)
@@ -3,23 +3,23 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "engraver.hh"
 #include "script-column.hh"
-#include "staff-side.hh"
-#include "dimension-cache.hh"
+#include "item.hh"
+#include "side-position-interface.hh"
 
 /**
    Find potentially colliding scripts, and put them in a
    Script_column, that will fix the collisions.  */
 class Script_column_engraver : public Engraver
 {
-  Script_column *scol_p_;
+  Score_element *scol_p_;
   Link_array<Item> script_l_arr_;
-  Link_array<Staff_side_item> staff_side_l_arr_;  
+
 public:
   Script_column_engraver ();
   VIRTUAL_COPY_CONS(Translator);
@@ -50,25 +50,17 @@ void
 Script_column_engraver::do_post_move_processing ()
 {
   script_l_arr_.clear ();
-  staff_side_l_arr_.clear ();
+
 }
 
 void
-Script_column_engraver::acknowledge_element( Score_element_info inf) 
+Script_column_engraver::acknowledge_element(Score_element_info inf) 
 {
-  Item *thing =  dynamic_cast<Item*>(inf.elem_l_);
-  if (!thing)
-    return;
-  
-  Dimension_cache * parcache = thing->dim_cache_[Y_AXIS]->parent_l_;
-  if (!parcache || !thing)
-    return ;
-  
-  Graphical_element *parent = parcache->element_l ();
-
-  if (Staff_side_item * ss = dynamic_cast<Staff_side_item*>(parent))
+  Item *thing = dynamic_cast<Item*> (inf.elem_l_);
+  if (thing && Side_position::has_interface (inf.elem_l_)) // ugh FIXME
     {
-      if (!ss->breakable_b ())
+      if (!Item::breakable_b (thing)
+         && Side_position::get_axis (inf.elem_l_) == Y_AXIS)
        {
          script_l_arr_.push (thing);
        }
@@ -80,14 +72,16 @@ Script_column_engraver::process_acknowledged ()
 {
   if (!scol_p_ && script_l_arr_.size () > 1)
     {
-      scol_p_ = new Script_column;
-      announce_element (Score_element_info (scol_p_, 0));
+      scol_p_ = new Item (get_property ("basicScriptColumnProperties"));
+
+
+      announce_element (scol_p_, 0);
     }
 
   if (scol_p_)
     {
       for (int i=0; i < script_l_arr_.size (); i++)
-       scol_p_->add_staff_sided (script_l_arr_[i]);
+       Script_column::add_staff_sided (scol_p_, script_l_arr_[i]);
       script_l_arr_.clear ();
     }
 }