]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dot-column.cc
* lily/include/tie.hh (struct Tie_details): add x_gap_
[lilypond.git] / lily / dot-column.cc
index ec981b63bc9c5957640297a4e1937d7c12a3a24a..0acae3b414c9acabdb4a777106b6c72e7b9b2faa 100644 (file)
@@ -19,6 +19,7 @@
 #include "side-position-interface.hh"
 #include "axis-group-interface.hh"
 #include "stem.hh"
+#include "pointer-group-interface.hh"
 
 /*
   TODO: let Dot_column communicate with stem via Note_column.
@@ -29,8 +30,8 @@ SCM
 Dot_column::force_shift_callback (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
-  Axis a = (Axis) scm_to_int (axis);
-  assert (a == Y_AXIS);
+  (void) axis;
+  assert (scm_to_int (axis) == Y_AXIS);
   me = me->get_parent (X_AXIS);
 
   if (!to_boolean (me->get_property ("positioning-done")))
@@ -39,7 +40,7 @@ Dot_column::force_shift_callback (SCM element_smob, SCM axis)
 
       do_shifts (me);
     }
-  return scm_make_real (0.0);
+  return scm_from_double (0.0);
 }
 
 MAKE_SCHEME_CALLBACK (Dot_column, side_position, 2);
@@ -47,10 +48,10 @@ SCM
 Dot_column::side_position (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
-  Axis a = (Axis) scm_to_int (axis);
-  assert (a == X_AXIS);
+  (void) axis;
+  assert (scm_to_int (axis) == X_AXIS);
 
-  Grob *stem = unsmob_grob (me->get_property ("stem"));
+  Grob *stem = unsmob_grob (me->get_object ("stem"));
   if (stem
       && !Stem::get_beam (stem)
       && Stem::duration_log (stem) > 2
@@ -81,7 +82,7 @@ struct Dot_position
   }
 };
 
-typedef std::map < int, Dot_position> Dot_configuration;
+typedef std::map<int, Dot_position> Dot_configuration;
 
 /*
   Value CFG according.
@@ -158,9 +159,7 @@ shift_one (Dot_configuration const &cfg,
          else
            {
              if (new_cfg.find (p) == new_cfg.end ())
-               {
-                 offset = 0;
-               }
+               offset = 0;
              new_cfg[p + offset] = i->second;
            }
        }
@@ -187,9 +186,7 @@ shift_one (Dot_configuration const &cfg,
          else
            {
              if (new_cfg.find (p) == new_cfg.end ())
-               {
-                 offset = 0;
-               }
+               offset = 0;
 
              new_cfg[p + offset] = i->second;
            }
@@ -225,7 +222,7 @@ SCM
 Dot_column::do_shifts (Grob *me)
 {
   Link_array<Grob> dots
-    = extract_grob_array (me, ly_symbol2scm ("dots"));
+    = extract_grob_array (me, "dots");
 
   { /*
       Trigger note collision resolution first, since that may kill off
@@ -261,7 +258,7 @@ Dot_column::do_shifts (Grob *me)
       Grob *note = dots[i]->get_parent (Y_AXIS);
       if (note)
        {
-         Grob *stem = unsmob_grob (note->get_property ("stem"));
+         Grob *stem = unsmob_grob (note->get_object ("stem"));
          if (stem)
            dp.extremal_head_ = Stem::first_head (stem) == note;
        }
@@ -280,9 +277,7 @@ Dot_column::do_shifts (Grob *me)
 
   for (Dot_configuration::const_iterator i (cfg.begin ());
        i != cfg.end (); i++)
-    {
-      Staff_symbol_referencer::set_position (i->second.dot_, i->first);
-    }
+    Staff_symbol_referencer::set_position (i->second.dot_, i->first);
 
   return SCM_UNSPECIFIED;
 }
@@ -290,7 +285,7 @@ Dot_column::do_shifts (Grob *me)
 void
 Dot_column::add_head (Grob *me, Grob *rh)
 {
-  Grob *d = unsmob_grob (rh->get_property ("dot"));
+  Grob *d = unsmob_grob (rh->get_object ("dot"));
   if (d)
     {
       Side_position_interface::add_support (me, rh);
@@ -301,7 +296,6 @@ Dot_column::add_head (Grob *me, Grob *rh)
     }
 }
 
-
 ADD_INTERFACE (Dot_column, "dot-column-interface",
               "Groups dot objects so they form a column, and position dots so they do not "
               "clash with staff lines ",