]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dot-column.cc
* Documentation/user/refman.itely: remove superfluous -'s
[lilypond.git] / lily / dot-column.cc
index ba07971a1a40c79e0fb332d4f31a483bc1adfbbc..736588a0e05282ba687abe2a9ba14682d8bce838 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "dots.hh"
 #include "axis-group-interface.hh"
 #include "stem.hh"
 
+/*
+  TODO: let Dot_column communicate with stem via Note_column.
+ */
+
 MAKE_SCHEME_CALLBACK (Dot_column,force_shift_callback,2);
 SCM
 Dot_column::force_shift_callback (SCM element_smob, SCM axis)
@@ -23,7 +27,7 @@ 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);
-  me = me->parent_l (X_AXIS);
+  me = me->get_parent (X_AXIS);
   SCM l = me->get_grob_property ("dots");
   do_shifts (l);
   return gh_double2scm (0.0);
@@ -39,8 +43,10 @@ Dot_column::side_position (SCM element_smob, SCM axis)
 
   Grob * stem = unsmob_grob (me->get_grob_property ("stem"));
   if (stem
-      && !Stem::beam_l (stem)
-      && Stem::flag_i (stem))
+      && !Stem::get_beam (stem)
+      && Stem::duration_log (stem) > 2
+      && !Stem::invisible_b (stem)
+      )
     {
       /*
        trigger stem end & direction calculation.
@@ -89,7 +95,7 @@ Dot_column::do_shifts (SCM l)
   int conflicts = 0;
   for (int i=0; i < dots.size (); i++)
     {
-      Real p = Staff_symbol_referencer::position_f (dots[i]);
+      Real p = Staff_symbol_referencer::get_position (dots[i]);
       for (int j=0; j < taken_posns.size (); j++)
        {
          if (taken_posns[j] == (int) p)
@@ -120,11 +126,6 @@ Dot_column::do_shifts (SCM l)
   return SCM_UNSPECIFIED;
 }
 
-bool
-Dot_column::has_interface (Grob*m)
-{
-  return m && m->has_interface (ly_symbol2scm ("dot-column-interface"));
-}
 
 
 void
@@ -135,9 +136,16 @@ Dot_column::add_head (Grob * me, Grob *rh)
     {
       Side_position_interface::add_support (me,rh);
 
-      Pointer_group_interface ::add_element (me, "dots",d);
+      Pointer_group_interface::add_grob (me, ly_symbol2scm ("dots"), d);
       d->add_offset_callback (Dot_column::force_shift_callback_proc , Y_AXIS);
       Axis_group_interface::add_element (me, d);
     }
 }
 
+
+
+
+ADD_INTERFACE (Dot_column, "dot-column-interface",
+  "Interface that groups dots so they form a column",
+  "direction stem");
+