]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/script.cc
release: 1.3.101
[lilypond.git] / lily / script.cc
index 5ad45f28ca7c23a1c345e19bec6b804696f069e2..9670115c55ebf922c7a903825fe73d6d310edd4d 100644 (file)
@@ -9,15 +9,12 @@
 
 #include "debug.hh"
 #include "script.hh"
-#include "lookup.hh"
+#include "font-interface.hh"
 #include "side-position-interface.hh"
 #include "paper-def.hh"
-#include "dimension-cache.hh"
-
-Script ::Script (SCM s)
-  : Item (s)
-{
-}
+#include "item.hh"
+#include "molecule.hh"
+#include "lookup.hh"
 
 Molecule
 Script::get_molecule(Score_element * me, Direction d)
@@ -28,12 +25,12 @@ Script::get_molecule(Score_element * me, Direction d)
   SCM key = gh_car  (s);
   if (key == ly_symbol2scm ("feta"))
     {
-      return me->lookup_l ()->afm_find ("scripts-" +
+      return Font_interface::get_default_font (me)->find_by_name ("scripts-" +
                                    ly_scm2string (index_cell (gh_cdr (s), d)));
     }
   else if (key == ly_symbol2scm ("accordion"))
     {
-      return me->lookup_l ()->accordion (gh_cdr (s), me->paper_l()->get_var("interline"));
+      return Lookup::accordion (gh_cdr (s), 1.0, Font_interface::get_default_font (me));
     }
   else
     assert (false);
@@ -41,34 +38,40 @@ Script::get_molecule(Score_element * me, Direction d)
   return Molecule ();
 }
 
-
-
-
-GLUE_SCORE_ELEMENT(Script,after_line_breaking);
+MAKE_SCHEME_CALLBACK(Script,after_line_breaking,1);
 SCM
-Script::member_after_line_breaking ()
+Script::after_line_breaking (SCM smob)
 {
-  Side_position_interface i (this);
-  Direction d =  i.get_direction ();
-  i.set_direction (d);
+  Score_element * me = unsmob_element (smob);
 
-  return SCM_UNDEFINED;
-}
+  Direction d = Side_position::get_direction (me);
+  Side_position::set_direction (me,d);
 
+  return SCM_UNSPECIFIED;
+}
 
-MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Script,brew_molecule);
+MAKE_SCHEME_CALLBACK(Script,brew_molecule,1);
 
 SCM
 Script::brew_molecule (SCM smob)
 {
   Score_element *me= unsmob_element (smob);
-  Direction dir = DOWN;
-  SCM d = me->get_elt_property ("direction");
-  if (isdir_b (d))
-    dir = to_dir (d);
-  
+//   Direction dir = DOWN;
+//   SCM d = me->get_elt_property ("direction");
+//   if (isdir_b (d))
+//     dir = to_dir (d);
+  Direction dir = Side_position::get_direction(me);
   return get_molecule (me, dir).create_scheme();
 }
 
+bool
+Script::has_interface (Score_element*me)
+{
+  return me->has_interface (ly_symbol2scm ("script-interface"));
+}
 
-
+void
+Script::set_interface (Score_element*me)
+{
+  return me->set_interface (ly_symbol2scm ("script-interface"));
+}