]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dot-column.cc
patch::: 1.3.130.jcn1
[lilypond.git] / lily / dot-column.cc
index 738052d5a213d020da2409b1f5f086575881b939..014af080bf1f3f62e394fab62a6b8ff8a0eecf54 100644 (file)
 
 
 
-void
-Dot_column::add_head (Score_element * me, Score_element *rh)
-{
-  Score_element * d = unsmob_element (rh->get_elt_property ("dot"));
-  if (d)
-    {
-      Side_position::add_support (me,rh);
-
-      Pointer_group_interface gi (me, "dots");
-      gi.add_element (d);
-      
-      d->add_offset_callback (force_shift_callback , Y_AXIS);
-      Axis_group_interface::add_element (me, d);
-    }
-}
-
-
 
 
 void
-Dot_column::set_interface (Score_element* me)
+Dot_column::set_interface (Grob* me)
 {
 
   Directional_element_interface::set (me, RIGHT);
@@ -63,23 +46,26 @@ Dot_column::set_interface (Score_element* me)
  */
 
 
-Real
-Dot_column::force_shift_callback (Score_element * dot, Axis a)
+MAKE_SCHEME_CALLBACK(Dot_column,force_shift_callback,2);
+SCM
+Dot_column::force_shift_callback (SCM element_smob, SCM axis)
 {
+  Grob *me = unsmob_grob (element_smob);
+  Axis a = (Axis) gh_scm2int (axis);
   assert (a == Y_AXIS);
 Score_element * me = dot->parent_l (X_AXIS);
-  SCM dots = me->get_elt_property ("dots");
me = me->parent_l (X_AXIS);
+  SCM dots = me->get_grob_property ("dots");
   do_shifts (dots);
-  return 0.0;
+  return gh_double2scm (0.0);
 }
 
 SCM
 Dot_column::do_shifts (SCM l)
 {
-  Link_array<Score_element> dots;
+  Link_array<Grob> dots;
   while (gh_pair_p (l))
     {
-      dots.push (unsmob_element (gh_car (l)));
+      dots.push (unsmob_grob (gh_car (l)));
       l = gh_cdr (l);
     }
   
@@ -118,7 +104,7 @@ Dot_column::do_shifts (SCM l)
 
   for (int i=0; i < dots.size (); pos += 2, i++)
     {
-      Score_element * d = dots[i];
+      Grob * d = dots[i];
       Staff_symbol_referencer::set_position (d,pos);
     }
 
@@ -126,7 +112,23 @@ Dot_column::do_shifts (SCM l)
 }
 
 bool
-Dot_column::has_interface (Score_element*m)
+Dot_column::has_interface (Grob*m)
 {
   return m && m->has_interface (ly_symbol2scm ("dot-column-interface"));
 }
+
+
+void
+Dot_column::add_head (Grob * me, Grob *rh)
+{
+  Grob * d = unsmob_grob (rh->get_grob_property ("dot"));
+  if (d)
+    {
+      Side_position::add_support (me,rh);
+
+      Pointer_group_interface ::add_element (me, "dots",d);
+      d->add_offset_callback (Dot_column::force_shift_callback_proc , Y_AXIS);
+      Axis_group_interface::add_element (me, d);
+    }
+}
+