]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/script.cc
release: 1.3.47
[lilypond.git] / lily / script.cc
index 97e60577ead396bef98858559560468cd8dd65c1..3e78d6acd8a4d2ecd2fff26dfd522d3c61d22db7 100644 (file)
@@ -1,21 +1,16 @@
 /*   
-     script.cc --  implement Script
+  script.cc --  implement Script
   
   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>
   
  */
 
-/*
-
-  TODO: Quantisation support (staccato dots between stafflines)
-
-*/
 #include "debug.hh"
 #include "script.hh"
 #include "lookup.hh"
-#include "staff-side.hh"
+#include "side-position-interface.hh"
 #include "paper-def.hh"
 #include "dimension-cache.hh"
 
@@ -24,9 +19,9 @@ Molecule
 Script::get_molecule(Direction d) const
 {
   SCM s = get_elt_property ("molecule");
-  assert (s != SCM_UNDEFINED);
+  assert (gh_pair_p (s));
 
-  SCM key = SCM_CAR (s);
+  SCM key = gh_car  (s);
   if (key == ly_symbol2scm ("feta"))
     {
       return lookup_l ()->afm_find ("scripts-" +
@@ -34,7 +29,7 @@ Script::get_molecule(Direction d) const
     }
   else if (key == ly_symbol2scm ("accordion"))
     {
-      return lookup_l ()->accordion (s, paper_l()->get_var("interline"));
+      return lookup_l ()->accordion (gh_cdr (s), paper_l()->get_var("interline"));
     }
 
   else assert (false);
@@ -44,40 +39,32 @@ Script::get_molecule(Direction d) const
 
 
 void
-Script::do_pre_processing ()
+Script::before_line_breaking ()
 {
   /*
     center my self on the note head.
    */
-  Graphical_element * e = parent_l(X_AXIS);
+  Score_element * e = parent_l(X_AXIS);
   translate_axis (e->extent (X_AXIS).center (), X_AXIS);
 }
 
 void
-Script::do_post_processing ()
+Script::after_line_breaking ()
 {
-  Direction d =  Staff_sidify (this).get_direction ();
-  Molecule m (get_molecule(d));
-
-  /*
-    UGH UGH UGH
-   */
-#if 0
-  if (staff_side_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED) 
-    translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
-#endif
+  Side_position_interface i (this);
+  Direction d =  i.get_direction ();
+  i.set_direction (d);
 }
 
-
-Molecule*
-Script::do_brew_molecule_p () const
+Molecule 
+Script::do_brew_molecule () const
 {
   Direction dir = DOWN;
   SCM d = get_elt_property ("direction");
   if (isdir_b (d))
     dir = to_dir (d);
   
-  return new Molecule (get_molecule (dir));
+  return get_molecule (dir);
 }