]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/define-context-properties.scm
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 16 Oct 2005 01:06:19 +0000 (01:06 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 16 Oct 2005 01:06:19 +0000 (01:06 +0000)
(all-user-translation-properties): remove verticalAlignmentChildCallback

* lily/tuplet-bracket.cc: use positions property iso. left,right-position.
(calc_direction): use callback
(calc_positions): use callback.

* lily/tie.cc (calc_direction): use callback. Only call parent
positioning for more than one tie.

* lily/tie-column.cc (calc_positioning_done): use callback

* lily/slur-scoring.cc (calc_control_points): use callback

* lily/slur.cc (calc_direction): use callback.

* lily/note-collision.cc (force_shift_callback): remove.

* lily/dot-column.cc (force_shift_callback): remove. Use
other_axis_parent_positioning.

* lily/grob.cc (other_axis_parent_positioning): new function.
(same_axis_parent_positioning): new function

* lily/align-interface.cc (alignment_callback): remove function.

* lily/note-collision.cc (calc_positioning_done): use callback.

* lily/laissez-vibrer-tie.cc (calc_control_points): use callback.
(calc_direction): idem.
remove print function.

* lily/laissez-vibrer-tie-column.cc (calc_positioning_done): use callback.

* lily/dot-column.cc (calc_positioning_done): use callback.

* lily/break-align-interface.cc (calc_positioning_done): use callback.

* lily/beam.cc (calc_direction): use pseudo-property for beam
direction callback.
(calc_positions): use callback

* lily/align-interface.cc (calc_positioning_done): use
callback. Fold fixed  distance and normal alignment in one function.

* lily/stem.cc (calc_stem_end_position): use callback.
(calc_positioning_done): idem.
(calc_direction): idem.
(calc_stem_end_position): idem
(calc_stem_info): idem.

* lily/grob-property.cc (get_property_data): new function:
(try_callback): new function.

* scm/define-grob-properties.scm (all-user-grob-properties): doc
callbacks property.

* lily/break-align-interface.cc: remove Break_align_interface::alignment_callback.

57 files changed:
ChangeLog
lily/accidental-placement.cc
lily/align-interface.cc
lily/bar-line.cc
lily/beam.cc
lily/break-align-interface.cc
lily/directional-element-interface.cc
lily/dot-column.cc
lily/dots.cc
lily/drum-note-engraver.cc
lily/grob-property.cc
lily/grob-smob.cc
lily/grob.cc
lily/hara-kiri-group-spanner.cc
lily/include/accidental-placement.hh
lily/include/align-interface.hh
lily/include/beam.hh
lily/include/break-align-interface.hh
lily/include/dot-column.hh
lily/include/grob.hh
lily/include/laissez-vibrer-tie-column.hh
lily/include/laissez-vibrer-tie.hh
lily/include/note-collision.hh
lily/include/note-head.hh
lily/include/rest-collision.hh
lily/include/slur.hh
lily/include/stem.hh
lily/include/tie-column.hh
lily/include/tie.hh
lily/include/tuplet-bracket.hh
lily/laissez-vibrer-tie-column.cc
lily/laissez-vibrer-tie.cc
lily/new-figured-bass-engraver.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-head.cc
lily/rest-collision.cc
lily/script-column.cc
lily/script-engraver.cc
lily/script-interface.cc
lily/separating-group-spanner.cc
lily/slur-scoring.cc
lily/slur.cc
lily/span-bar.cc
lily/stem.cc
lily/tie-column.cc
lily/tie.cc
lily/tuplet-bracket.cc
lily/vertical-align-engraver.cc
lily/volta-bracket.cc
ly/engraver-init.ly
scm/define-context-properties.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/lily.scm
scm/music-functions.scm
scm/safe-lily.scm

index 8ae11067514ac0462c6e5668a28d1a346fc4f82f..f4eb09e2fb914e0673546c1906964a2080d13fa7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,71 @@
+2005-10-16  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/define-context-properties.scm
+       (all-user-translation-properties): remove verticalAlignmentChildCallback
+
+       * lily/tuplet-bracket.cc: use positions property iso. left,right-position.
+       (calc_direction): use callback
+       (calc_positions): use callback.
+
+       * lily/tie.cc (calc_direction): use callback. Only call parent
+       positioning for more than one tie.
+
+       * lily/tie-column.cc (calc_positioning_done): use callback
+
+       * lily/slur-scoring.cc (calc_control_points): use callback
+
+       * lily/slur.cc (calc_direction): use callback.
+
+       * lily/note-collision.cc (force_shift_callback): remove.
+
+       * lily/dot-column.cc (force_shift_callback): remove. Use
+       other_axis_parent_positioning.
+
+       * lily/grob.cc (other_axis_parent_positioning): new function.
+       (same_axis_parent_positioning): new function
+
+       * lily/align-interface.cc (alignment_callback): remove function.
+
+       * lily/note-collision.cc (calc_positioning_done): use callback.
+
+       * lily/laissez-vibrer-tie.cc (calc_control_points): use callback.
+       (calc_direction): idem.
+       remove print function.
+
+       * lily/laissez-vibrer-tie-column.cc (calc_positioning_done): use callback.
+
+       * lily/dot-column.cc (calc_positioning_done): use callback.
+
+       * lily/break-align-interface.cc (calc_positioning_done): use callback.
+
+       * lily/beam.cc (calc_direction): use pseudo-property for beam
+       direction callback.
+       (calc_positions): use callback 
+
+       * lily/align-interface.cc (calc_positioning_done): use
+       callback. Fold fixed  distance and normal alignment in one function.
+
+       * lily/stem.cc (calc_stem_end_position): use callback.
+       (calc_positioning_done): idem.
+       (calc_direction): idem.
+       (calc_stem_end_position): idem
+       (calc_stem_info): idem.
+
+       * lily/grob-property.cc (get_property_data): new function: 
+       (try_callback): new function.
+
+       * scm/define-grob-properties.scm (all-user-grob-properties): doc
+       callbacks property.
+
+       * lily/break-align-interface.cc: remove Break_align_interface::alignment_callback.
+
 2005-10-15  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * lily/include/*.hh (Module): lots of compile fixes.
+       * lily/tie.cc (get_position): robustness fix. Don't crash if a
+       tie
+       has no heads.
+       
+       * lily/include/*.hh (Module): compile fixes.
 
 2005-10-14  Heikki Junes <hjunes@cc.hut.fi>
 
@@ -34,7 +99,7 @@
 2005-10-11  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * ly/titling-init.ly (evenHeaderMarkup): use space in header on
-       even header too.6
+       even header too.
        
        * scm/define-markup-commands.scm (wordwrap-string): bugfix for
        MacOS 9 users.
index 3f63cb1c5baaf628b61b5ed35bb7fcb8f6b0cb5d..4457289235ef1e139403dc5f030334fe38596d4f 100644 (file)
 #include "note-collision.hh"
 #include "accidental-interface.hh"
 
-MAKE_SCHEME_CALLBACK (Accidental_placement, alignment_callback, 2);
-SCM
-Accidental_placement::alignment_callback (SCM s, SCM)
-{
-  Grob *me = unsmob_grob (s);
-
-  Grob *par = me->get_parent (X_AXIS);
-  if (!to_boolean (par->get_property ("positioning-done")))
-    {
-      par->set_property ("positioning-done", SCM_BOOL_T);
-      position_accidentals (par);
-    }
-
-  return scm_from_int (0);
-}
 
 void
 Accidental_placement::add_accidental (Grob *me, Grob *a)
 {
   a->set_parent (me, X_AXIS);
-  a->add_offset_callback (alignment_callback_proc, X_AXIS);
+  a->add_offset_callback (Grob::same_axis_parent_positioning_proc, X_AXIS);
   SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
 
   Music *mcause = unsmob_music (cause);
@@ -221,20 +206,26 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
 
   Natural + downstem
 
-  |_
-  | |    X
-  |_|   |
-  |   |
+  *
+  *  |_
+  *  | |    X
+  *  |_|   |
+  *    |   |
+  *
+
 */
+
+MAKE_SCHEME_CALLBACK(Accidental_placement, calc_positioning_done, 1);
 SCM
-Accidental_placement::position_accidentals (Grob *me)
+Accidental_placement::calc_positioning_done (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);
   if (!me->is_live ())
-    return SCM_UNSPECIFIED;
+    return SCM_BOOL_T;
 
   SCM accs = me->get_object ("accidental-grobs");
   if (!scm_is_pair (accs))
-    return SCM_UNSPECIFIED;
+    return SCM_BOOL_T;
 
   /*
     TODO: there is a bug in this code. If two accs are on the same
@@ -403,10 +394,16 @@ Accidental_placement::position_accidentals (Grob *me)
   for (int i = apes.size (); i--;)
     delete apes[i];
 
-  return SCM_UNSPECIFIED;
+  return SCM_BOOL_T;
 }
 
 ADD_INTERFACE (Accidental_placement,
               "accidental-placement-interface",
               "Resolve accidental collisions.",
-              "left-padding padding right-padding accidental-grobs positioning-done")
+
+              /* properties */
+              "accidental-grobs "
+              "left-padding "
+              "padding "
+              "positioning-done "
+              "right-padding ")
index bedae50c809cd878484159ff43ead5d915335636..ada7e4e3a210771930aab59f01daa71cf7cf3ff6 100644 (file)
   distance.
  */
 
-MAKE_SCHEME_CALLBACK (Align_interface, alignment_callback, 2);
+MAKE_SCHEME_CALLBACK (Align_interface, calc_positioning_done, 1);
 SCM
-Align_interface::alignment_callback (SCM element_smob, SCM axis)
+Align_interface::calc_positioning_done (SCM smob)
 {
-  Grob *me = unsmob_grob (element_smob);
+  Grob *me = unsmob_grob (smob);
+  SCM axis = scm_car (me->get_property ("axes"));
   Axis ax = (Axis)scm_to_int (axis);
-  Grob *par = me->get_parent (ax);
-  if (par && !to_boolean (par->get_property ("positioning-done")))
-    Align_interface::align_elements_to_extents (par, ax);
-  return scm_from_double (0.0);
-}
 
-MAKE_SCHEME_CALLBACK (Align_interface, fixed_distance_alignment_callback, 2);
-SCM
-Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
-{
-  Grob *me = unsmob_grob (element_smob);
-  Axis ax = (Axis)scm_to_int (axis);
-  Grob *par = me->get_parent (ax);
-  if (par && !to_boolean (par->get_property ("positioning-done")))
-    Align_interface::align_to_fixed_distance (par, ax);
-  return scm_from_double (0.0);
+  SCM force = me->get_property ("forced-distance");
+  if (scm_is_number (force))
+    Align_interface::align_to_fixed_distance (me, ax);
+  else
+    Align_interface::align_elements_to_extents (me, ax);
+
+  return SCM_BOOL_T;
 }
 
 /*
@@ -88,8 +81,6 @@ Align_interface::stretch_after_break (SCM grob)
 void
 Align_interface::align_to_fixed_distance (Grob *me, Axis a)
 {
-  me->set_property ("positioning-done", SCM_BOOL_T);
-
   Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
                                           DOWN);
 
@@ -151,6 +142,7 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a)
   The original function has been taken over by
   align_to_fixed_distance ().
 */
+
 void
 Align_interface::align_elements_to_extents (Grob *me, Axis a)
 {
@@ -177,8 +169,6 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
                                       extra_space);
     }
   
-  me->set_property ("positioning-done", SCM_BOOL_T);
-  
   Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
                                               DOWN);
 
@@ -271,9 +261,10 @@ Align_interface::axis (Grob *me)
 }
 
 void
-Align_interface::add_element (Grob *me, Grob *element, SCM call_back)
+Align_interface::add_element (Grob *me, Grob *element)
 {
-  element->add_offset_callback (call_back, Align_interface::axis (me));
+  element->add_offset_callback (Grob::same_axis_parent_positioning_proc,
+                               Align_interface::axis (me));
   Axis_group_interface::add_element (me, element);
 }
 
index 555a5c2566cb01e06ea8913dfdcc7037e39a02c8..ab18eb0fcbac2e4e5adec301dc68b65e42f18ef7 100644 (file)
@@ -16,7 +16,6 @@
 #include "staff-symbol-referencer.hh"
 
 MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
-
 SCM
 Bar_line::print (SCM smob)
 {
@@ -151,7 +150,6 @@ Bar_line::simple_barline (Grob *me,
 }
 
 MAKE_SCHEME_CALLBACK (Bar_line, before_line_breaking, 1);
-
 SCM
 Bar_line::before_line_breaking (SCM smob)
 {
@@ -174,7 +172,7 @@ Bar_line::before_line_breaking (SCM smob)
       // leave y_extent for spanbar? 
     }
 
-  if (! ly_is_equal (g, orig))
+  if (!ly_is_equal (g, orig))
     me->set_property ("glyph", g);
 
   return SCM_UNSPECIFIED;
@@ -203,7 +201,9 @@ Bar_line::get_staff_bar_size (SCM smob)
   return scm_from_int (0);
 }
 
-ADD_INTERFACE (Bar_line, "bar-line-interface",
+ADD_INTERFACE (Bar_line,
+              "bar-line-interface",
+
               "Bar line.\n"
               "\n"
               "Print a special bar symbol. It replaces the \n"
@@ -218,4 +218,14 @@ ADD_INTERFACE (Bar_line, "bar-line-interface",
               "repeat, a double bar, a start bar, an end bar, and a thick double bar.\n"
               "If @var{bartype} is set to @code{empty} then nothing is printed,\n"
               "but a line break is allowed at that spot.\n",
-              "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function");
+
+
+              /* properties */ 
+              "bar-size-procedure "
+              "kern "
+              "thin-kern "
+              "hair-thickness "
+              "thick-thickness "
+              "glyph "
+              "bar-size "
+              "break-glyph-function");
index 4c7d8b85efa441b4d2ff29cd05435f073bb72629..f4d29ed728d2d7af8c398e8f3def25ed5ea2bc84 100644 (file)
 void
 Beam::add_stem (Grob *me, Grob *s)
 {
-  Pointer_group_interface::add_grob (me, ly_symbol2scm ("stems"), s);
-
-  s->add_dependency (me);
+  if (Stem::get_beam (s))
+    {
+      programming_error ("Stem already has beam");
+      return ;
+    }
 
-  assert (!Stem::get_beam (s));
+  Pointer_group_interface::add_grob (me, ly_symbol2scm ("stems"), s);
   s->set_object ("beam", me->self_scm ());
-
   add_bound_item (dynamic_cast<Spanner *> (me), dynamic_cast<Item *> (s));
 }
 
@@ -120,9 +121,9 @@ Beam::space_function (SCM smob, SCM beam_count)
    Currenly, this means that beam has set all stem's directions.
    [Alternatively, stems could set its own directions, according to
    their beam, during 'final-pre-processing'.] */
-MAKE_SCHEME_CALLBACK (Beam, before_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Beam, calc_direction, 1);
 SCM
-Beam::before_line_breaking (SCM smob)
+Beam::calc_direction (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
@@ -153,10 +154,12 @@ Beam::before_line_breaking (SCM smob)
          return SCM_UNSPECIFIED;
        }
     }
+
+  Direction d = CENTER;
+  
   if (count >= 1)
     {
-      Direction d = get_default_dir (me);
-
+      d = get_default_dir (me);
       consider_auto_knees (me);
       set_stem_directions (me, d);
 
@@ -165,7 +168,7 @@ Beam::before_line_breaking (SCM smob)
       set_stem_shorten (me);
     }
 
-  return SCM_EOL;
+  return scm_from_int (d);
 }
 
 /* We want a maximal number of shared beams, but if there is choice, we
@@ -284,7 +287,6 @@ SCM
 Beam::print (SCM grob)
 {
   Spanner *me = unsmob_spanner (grob);
-  position_beam (me);
 
   extract_grob_set (me, "stems", stems);
   Grob *xcommon = common_refpoint_of_array (stems, me, X_AXIS);
@@ -522,26 +524,25 @@ Beam::get_default_dir (Grob *me)
   total[UP] = total[DOWN] = 0;
   Drul_array<int> count;
   count[UP] = count[DOWN] = 0;
-  Direction d = DOWN;
 
   extract_grob_set (me, "stems", stems);
 
   for (int i = 0; i < stems.size (); i++)
-    do
-      {
-       Grob *s = stems[i];
-       Direction sd = get_grob_direction (s);
-
-       int center_distance = max (int (- d * Stem::head_positions (s) [-d]), 0);
-       int current = sd ? (1 + d * sd) / 2 : center_distance;
-
-       if (current)
-         {
-           total[d] += current;
-           count[d]++;
-         }
-      }
-    while (flip (&d) != DOWN);
+    {
+      Grob *s = stems[i];
+      Direction stem_dir = CENTER;
+      SCM stem_dir_scm = s->get_property_data (ly_symbol2scm ("direction"));
+      if (is_direction (stem_dir_scm))
+       stem_dir = to_dir (stem_dir_scm);
+      else
+       stem_dir = Stem::get_default_dir (s);
+
+      if (stem_dir)
+       {
+         count[stem_dir] ++;
+         total[stem_dir] += max (int (- stem_dir * Stem::head_positions (s) [-stem_dir]), 0);
+       }
+    }
 
   SCM func = me->get_property ("dir-function");
   SCM s = scm_call_2 (func,
@@ -569,7 +570,7 @@ Beam::set_stem_directions (Grob *me, Direction d)
     {
       Grob *s = stems[i];
 
-      SCM forcedir = s->get_property ("direction");
+      SCM forcedir = s->get_property_data (ly_symbol2scm ("direction"));
       if (!to_dir (forcedir))
        set_grob_direction (s, d);
     }
@@ -624,7 +625,7 @@ Beam::consider_auto_knees (Grob *me)
          */
          head_extents += stem->relative_coordinate (common, Y_AXIS);
 
-         if (to_dir (stem->get_property ("direction")))
+         if (to_dir (stem->get_property_data (ly_symbol2scm ("direction"))))
            {
              Direction stemdir = to_dir (stem->get_property ("direction"));
              head_extents[-stemdir] = -stemdir * infinity_f;
@@ -724,44 +725,31 @@ Beam::set_stem_shorten (Grob *me)
     me->set_property ("shorten", scm_from_double (shorten_f));
 }
 
-/*  Call list of y-dy-callbacks, that handle setting of
-    grob-properties
-*/
-MAKE_SCHEME_CALLBACK (Beam, after_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Beam, calc_positions, 1);
 SCM
-Beam::after_line_breaking (SCM smob)
+Beam::calc_positions (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-
-  position_beam (me);
-  return SCM_UNSPECIFIED;
-}
-
-void
-Beam::position_beam (Grob *me)
-{
   if (!me->is_live ())
-    return;
-  if (to_boolean (me->get_property ("positioning-done")))
-    return;
-
-  me->set_property ("positioning-done", SCM_BOOL_T);
+    return SCM_EOL;
 
-  /* Copy to mutable list. */
-  SCM s = ly_deep_copy (me->get_property ("positions"));
-  me->set_property ("positions", s);
+  (void) me->get_property ("direction");
+  
+  SCM posns = scm_cons (SCM_BOOL_F, SCM_BOOL_F);
+  me->set_property ("positions", posns);
 
-  if (scm_car (s) == SCM_BOOL_F)
-    {
-      // one wonders if such genericity is necessary  --hwn.
-      SCM callbacks = me->get_property ("position-callbacks");
-      for (SCM i = callbacks; scm_is_pair (i); i = scm_cdr (i))
-       scm_call_1 (scm_car (i), me->self_scm ());
-    }
+  SCM callbacks = me->get_property ("position-callbacks");
+  for (SCM i = callbacks; scm_is_pair (i); i = scm_cdr (i))
+    scm_call_1 (scm_car (i), me->self_scm ());
 
+  /*
+    TODO: move this in separate calc function.
+   */
   set_stem_lengths (me);
+  return SCM_UNSPECIFIED;
 }
 
+
 void
 set_minimum_dy (Grob *me, Real *dy)
 {
@@ -1291,13 +1279,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   if (scm_is_pair (s) && scm_is_number (scm_car (s)))
     pos = ly_scm2interval (s);
   else
-    {
-      /*
-       UGH. TODO: fix dependency tracking.
-      */
-      position_beam (beam);
-      pos = ly_scm2interval (beam->get_property ("positions"));
-    }
+    programming_error ("positions property should always be pair of numbers.");
 
   Real staff_space = Staff_symbol_referencer::staff_space (rest);
 
@@ -1395,10 +1377,17 @@ Beam::get_direction_beam_count (Grob *me, Direction d)
   return bc;
 }
 
-ADD_INTERFACE (Beam, "beam-interface",
+ADD_INTERFACE (Beam,
+              "beam-interface",
+
               "A beam. \n\n"
               "The @code{thickness} property is the weight of beams, "
-              "measured in staffspace",
+              "measured in staffspace.  The @code{direction} property is not user-serviceable. Use "
+              "the @code{direction} property of @code{Stem} instead. "
+
+              ,
+              
+              /* properties */
               "auto-knee-gap "
               "beamed-stem-shorten "
               "break-overshoot "
@@ -1406,6 +1395,7 @@ ADD_INTERFACE (Beam, "beam-interface",
               "concaveness "
               "damping "
               "details "
+              "direction " 
               "dir-function "
               "flag-width-function "
               "gap "
@@ -1415,7 +1405,6 @@ ADD_INTERFACE (Beam, "beam-interface",
               "least-squares-dy "
               "neutral-direction "
               "position-callbacks "
-              "positioning-done "
               "positions "
               "quant-score "
               "shorten "
index 970be7cbe8f3a33820135e2ea909d1f2ad14ee63..1d82c0622a63b700ac26a1b4137fe6f4156d044e 100644 (file)
 #include "paper-column.hh"
 #include "align-interface.hh"
 
-MAKE_SCHEME_CALLBACK (Break_align_interface, alignment_callback, 2);
-SCM
-Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
-{
-  Grob *me = unsmob_grob (element_smob);
-  Axis a = (Axis) scm_to_int (axis);
-
-  assert (a == X_AXIS);
-  Grob *par = me->get_parent (a);
-  if (par && !to_boolean (par->get_property ("positioning-done")))
-    {
-      par->set_property ("positioning-done", SCM_BOOL_T);
-      Break_align_interface::do_alignment (par);
-    }
-
-  return scm_from_double (0);
-}
 
 MAKE_SCHEME_CALLBACK (Break_align_interface, self_align_callback, 2);
 SCM
@@ -103,12 +86,14 @@ Break_align_interface::ordered_elements (Grob *grob)
 void
 Break_align_interface::add_element (Grob *me, Grob *toadd)
 {
-  Axis_group_interface::add_element (me, toadd);
+  Align_interface::add_element (me, toadd);
 }
 
-void
-Break_align_interface::do_alignment (Grob *grob)
+MAKE_SCHEME_CALLBACK(Break_align_interface, calc_positioning_done, 1)
+SCM
+Break_align_interface::calc_positioning_done (SCM smob)
 {
+  Grob *grob = unsmob_grob (smob);  
   Item *me = dynamic_cast<Item *> (grob);
 
   Link_array<Grob> elems = ordered_elements (me);
@@ -251,7 +236,7 @@ Break_align_interface::do_alignment (Grob *grob)
     }
 
   if (total_extent.is_empty ())
-    return;
+    return SCM_BOOL_T;
 
   if (me->break_status_dir () == LEFT)
     alignment_off = -total_extent[RIGHT] - extra_right_space;
@@ -264,6 +249,8 @@ Break_align_interface::do_alignment (Grob *grob)
       here += offsets[i];
       elems[i]->translate_axis (here, X_AXIS);
     }
+
+  return SCM_BOOL_T;
 }
 
 ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
@@ -293,5 +280,8 @@ ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
 
 ADD_INTERFACE (Break_align_interface, "break-alignment-interface",
               "The object that performs break aligment. See @ref{break-aligned-interface}.",
-              "positioning-done break-align-orders");
+
+              /* properties */
+              "positioning-done "
+              "break-align-orders");
 
index 3d7514cad624b7940e73c85f6fdd3fc718169f69..872f3ad23fb059b3ae0a1f5083e8cb676e772c30 100644 (file)
@@ -7,11 +7,17 @@
 */
 
 #include "directional-element-interface.hh"
+#include "warn.hh"
 
 Direction
 get_grob_direction (Grob *me)
 {
   SCM d = me->get_property ("direction");
+  if (d == ly_symbol2scm ("calculation-in-progress"))
+    {
+      programming_error ("Grob direction requested while calculation in progress. ");
+      return UP;
+    }
   if (!is_direction (d))
     return CENTER;
 
index a8d3e735705ade449ad9f21c3392383a3a76f4c8..6a1cc7ef029ea4398baacf1460b981e0411d075d 100644 (file)
@@ -26,24 +26,6 @@ using namespace std;
   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)
-{
-  Grob *me = unsmob_grob (element_smob);
-  (void) axis;
-  assert (scm_to_int (axis) == Y_AXIS);
-  me = me->get_parent (X_AXIS);
-
-  if (!to_boolean (me->get_property ("positioning-done")))
-    {
-      me->set_property ("positioning-done", SCM_BOOL_T);
-
-      do_shifts (me);
-    }
-  return scm_from_double (0.0);
-}
-
 MAKE_SCHEME_CALLBACK (Dot_column, side_position, 2);
 SCM
 Dot_column::side_position (SCM element_smob, SCM axis)
@@ -63,8 +45,9 @@ Dot_column::side_position (SCM element_smob, SCM axis)
 
        This will add the stem to the support if a flag collision happens.
       */
-      Stem::stem_end_position (stem);
+      stem->get_property ("stem-end-position");
     }
+  
   return Side_position_interface::aligned_side (element_smob, axis);
 }
 
@@ -219,9 +202,11 @@ remove_collision (Dot_configuration &cfg, int p)
     }
 }
 
+MAKE_SCHEME_CALLBACK(Dot_column, calc_positioning_done, 1);
 SCM
-Dot_column::do_shifts (Grob *me)
+Dot_column::calc_positioning_done (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);  
   Link_array<Grob> dots
     = extract_grob_array (me, "dots");
 
@@ -280,7 +265,7 @@ Dot_column::do_shifts (Grob *me)
        i != cfg.end (); i++)
     Staff_symbol_referencer::set_position (i->second.dot_, i->first);
 
-  return SCM_UNSPECIFIED;
+  return SCM_BOOL_T;
 }
 
 void
@@ -292,13 +277,19 @@ Dot_column::add_head (Grob *me, Grob *rh)
       Side_position_interface::add_support (me, rh);
 
       Pointer_group_interface::add_grob (me, ly_symbol2scm ("dots"), d);
-      d->add_offset_callback (Dot_column::force_shift_callback_proc, Y_AXIS);
+      d->add_offset_callback (Grob::other_axis_parent_positioning_proc, Y_AXIS);
       Axis_group_interface::add_element (me, d);
     }
 }
 
-ADD_INTERFACE (Dot_column, "dot-column-interface",
+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 ",
-              "positioning-done direction stem");
+
+              /* properties */
+              "positioning-done "
+              "direction "
+              "stem");
 
index a6f2e64a5c750126bd504711f62b17c33ff3f3e5..c823783d82865f1ef663288740e497bc7977e613 100644 (file)
@@ -52,5 +52,8 @@ ADD_INTERFACE (Dots, "dots-interface",
               "The dots to go with a notehead or rest."
               "@code{direction} sets the preferred direction to move in case of staff "
               "line collisions.",
-              "direction dot-count");
+
+              /* properties */
+              "direction "
+              "dot-count");
 
index 13204180a60bb8a5458f6869c5f91b650d72fde4..059c72190da397682ffc98bc0a9fd3b3564cefa0 100644 (file)
@@ -131,10 +131,6 @@ Drum_notes_engraver::acknowledge_stem (Grob_info inf)
       if (to_dir (e->get_property ("side-relative-direction")))
        e->set_object ("direction-source", inf.grob ()->self_scm ());
 
-      /*
-       add dep ?
-      */
-      e->add_dependency (inf.grob ());
       Side_position_interface::add_support (e, inf.grob ());
     }
 }
index e6b6ec961eb5acba38257226e4ee51524e6f5917..34f1652c90fc2d9ebc9984aa0b1a9d057498f369 100644 (file)
@@ -92,31 +92,121 @@ Grob::internal_set_property (SCM sym, SCM v)
 
 //#define PROFILE_PROPERTY_ACCESSES
 
+/*
+  Ugh C&P Coding.
 
+  Retrieve property without triggering callback.
+ */
 SCM
-Grob::internal_get_property (SCM sym) const
+Grob::get_property_data (SCM sym) const
 {
 #ifndef NDEBUG
   if (profile_property_accesses)
     note_property_access (&grob_property_lookup_table, sym);
 #endif
+  
+  SCM handle = scm_sloppy_assq (sym, mutable_property_alist_);
+  if (handle != SCM_BOOL_F)
+    return scm_cdr (handle);
 
-  SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
-  if (s != SCM_BOOL_F)
-    return scm_cdr (s);
+  handle = scm_sloppy_assq (sym, immutable_property_alist_);
+
+  if (do_internal_type_checking_global && scm_is_pair (handle))
+    {
+      if (!type_check_assignment (sym, scm_cdr (handle),
+                                 ly_symbol2scm ("backend-type?")))
+       abort ();
 
-  s = scm_sloppy_assq (sym, immutable_property_alist_);
+      check_interfaces_for_property (this, sym);
+    }
+  
+  return (handle == SCM_BOOL_F) ? SCM_EOL : scm_cdr (handle);
+}
+
+SCM
+Grob::internal_get_property (SCM sym) const
+{
+#ifndef NDEBUG
+  if (profile_property_accesses)
+    note_property_access (&grob_property_lookup_table, sym);
+#endif
+  
+  SCM handle = scm_sloppy_assq (sym, mutable_property_alist_);
+  if (handle != SCM_BOOL_F)
+    return scm_cdr (handle);
 
-  if (do_internal_type_checking_global && scm_is_pair (s))
+  handle = scm_sloppy_assq (sym, immutable_property_alist_);
+
+  if (do_internal_type_checking_global && scm_is_pair (handle))
     {
-      if (!type_check_assignment (sym, scm_cdr (s),
+      if (!type_check_assignment (sym, scm_cdr (handle),
                                  ly_symbol2scm ("backend-type?")))
        abort ();
 
       check_interfaces_for_property (this, sym);
     }
 
-  return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
+  
+  if (handle == SCM_BOOL_F)
+    {
+      SCM value = ((Grob*)  this)->try_callback (sym);
+      if (value != SCM_UNSPECIFIED)
+       return value;
+    }
+  
+  return (handle == SCM_BOOL_F) ? SCM_EOL : scm_cdr (handle);
+}
+
+#ifndef NDEBUG
+#include "protected-scm.hh"
+Protected_scm grob_property_callback_stack = SCM_EOL;
+bool debug_property_callbacks;
+#endif
+
+SCM
+Grob::try_callback (SCM sym)
+{      
+  SCM handle = scm_sloppy_assq (sym, property_callbacks_);
+  if (scm_is_pair (handle))
+    {
+      SCM proc = scm_cdr (handle);
+      if (ly_is_procedure (proc))
+       {
+         SCM marker = ly_symbol2scm ("calculation-in-progress");
+         /*
+           need to put a value in SYM to ensure that we don't get a
+           cyclic call chain.
+         */
+         mutable_property_alist_
+           = scm_assq_set_x (mutable_property_alist_, sym, marker);
+
+#ifndef NDEBUG
+         if (debug_property_callbacks)
+           grob_property_callback_stack = scm_acons (sym, proc, grob_property_callback_stack);
+#endif
+         SCM value = scm_call_1 (proc, self_scm ());
+#ifndef NDEBUG
+         if (debug_property_callbacks)
+           grob_property_callback_stack = scm_cdr (grob_property_callback_stack);
+#endif
+         
+         /*
+           If the function returns SCM_UNSPECIFIED, we assume the
+           property has been set with an explicit set_property()
+           call.
+          */
+         if (value == SCM_UNSPECIFIED)
+           value = internal_get_property (sym);
+         else
+           internal_set_property (sym, value);
+         
+         return value;
+       }
+      else
+       programming_error ("Callback should be procedure type");
+    }
+
+  return SCM_UNSPECIFIED;
 }
 
 void
index e2e673e1943df8d7666852a7998c92436cd8e2b7..06e757d1c204c94c995a6c82b912797c76e8b558 100644 (file)
@@ -21,6 +21,7 @@ Grob::mark_smob (SCM ses)
 {
   Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
   scm_gc_mark (s->immutable_property_alist_);
+  scm_gc_mark (s->property_callbacks_);
 
   if (s->key_)
     scm_gc_mark (s->key_->self_scm ());
index cf3b52d9353fb83c7698ecc58806f54e5ee6ee53..4933934c0c8934ebf44681837bedabced6614de7 100644 (file)
 #include "ly-smobs.icc"
 #include "output-def.hh"
 
+MAKE_SCHEME_CALLBACK(Grob, same_axis_parent_positioning, 2);
+SCM
+Grob::same_axis_parent_positioning (SCM element_smob, SCM axis)
+{
+  Grob *me = unsmob_grob (element_smob);
+  Axis ax = other_axis ((Axis)scm_to_int (axis));
+  
+  Grob *par = me->get_parent (ax);
+  if (par)
+    par->get_property ("positioning-done");
+
+  return scm_from_double (0.0);
+}
+
+MAKE_SCHEME_CALLBACK(Grob,other_axis_parent_positioning, 2);
+SCM
+Grob::other_axis_parent_positioning (SCM element_smob, SCM axis)
+{
+  Grob *me = unsmob_grob (element_smob);
+  Axis ax = other_axis ((Axis) scm_to_int (axis));
+  
+  Grob *par = me->get_parent (ax);
+  if (par)
+    par->get_property ("positioning-done");
+
+  return scm_from_double (0.0);
+}
+
+
+
 Grob *
 Grob::clone (int count) const
 {
@@ -55,7 +85,8 @@ Grob::Grob (SCM basicprops,
   immutable_property_alist_ = basicprops;
   mutable_property_alist_ = SCM_EOL;
   object_alist_ = SCM_EOL;
-
+  property_callbacks_ = SCM_EOL;
+  
   /* We do smobify_self () as the first step.  Since the object lives
      on the heap, none of its SCM variables are protected from
      GC. After smobify_self (), they are.  */
@@ -78,6 +109,8 @@ Grob::Grob (SCM basicprops,
   creation. Convenient eg. when using \override with
   StaffSymbol.  */
 
+  property_callbacks_ = get_property ("callbacks");
+
   SCM off_callbacks[] = {
     get_property ("X-offset-callbacks"),
     get_property ("Y-offset-callbacks")
@@ -116,6 +149,7 @@ Grob::Grob (SCM basicprops,
               && ly_is_procedure (get_property ("print-function")))
        dim_cache_[a].dimension_callback_ = stencil_extent_proc;
     }
+
 }
 
 Grob::Grob (Grob const &s, int copy_index)
@@ -128,6 +162,7 @@ Grob::Grob (Grob const &s, int copy_index)
   immutable_property_alist_ = s.immutable_property_alist_;
   mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_);
   interfaces_ = s.interfaces_;
+  property_callbacks_ = s.property_callbacks_;
   object_alist_ = SCM_EOL;
 
   /* No properties are copied.  That is the job of
@@ -276,14 +311,6 @@ Grob::get_system () const
   return 0;
 }
 
-void
-Grob::add_dependency (Grob *e)
-{
-  if (e)
-    Pointer_group_interface::add_grob (this, ly_symbol2scm ("dependencies"), e);
-  else
-    programming_error ("null dependency added");
-}
 
 void
 Grob::handle_broken_dependencies ()
@@ -331,6 +358,7 @@ Grob::suicide ()
 
   mutable_property_alist_ = SCM_EOL;
   object_alist_ = SCM_EOL;
+  property_callbacks_ = SCM_EOL;
   immutable_property_alist_ = SCM_EOL;
   interfaces_ = SCM_EOL;
 
@@ -718,13 +746,35 @@ ADD_INTERFACE (Grob, "grob-interface",
               "lists of other objects, or results from computations are stored in"
               "mutable properties: every call to set-grob-property (or its C++ equivalent) "
               "sets a mutable property. ",
-              "X-offset-callbacks Y-offset-callbacks X-extent-callback stencil cause "
-              "Y-extent-callback print-function extra-offset spacing-procedure "
-              "context staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
-              "meta layer before-line-breaking-callback "
-              "color "
+
+              /* properties */
+              "X-extent "
+              "X-extent-callback "
+              "X-offset-callbacks "
+              "Y-extent "
+              "Y-extent-callback "
+              "Y-offset-callbacks "
+              "after-line-breaking-callback "
               "axis-group-parent-X "
               "axis-group-parent-Y "
-              "after-line-breaking-callback extra-Y-extent minimum-X-extent "
-              "minimum-Y-extent transparent");
+              "before-line-breaking-callback "
+              "callbacks "
+              "cause "
+              "color "
+              "context "
+              "extra-X-extent "
+              "extra-Y-extent "
+              "extra-offset "
+              "interfaces "
+              "layer "
+              "meta "
+              "minimum-X-extent "
+              "minimum-Y-extent "
+              "print-function "
+              "spacing-procedure "
+              "staff-symbol "
+              "stencil "
+              "transparent"
+              );
+
 
index f824a2a8cba77b33071686a7b5ce82eeb45a3226..01bfa853dfa1b8f74eab28cd6c251571ce75dac8 100644 (file)
@@ -92,7 +92,6 @@ Hara_kiri_group_spanner::add_element (Grob *me, Grob *e)
 void
 Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n)
 {
-  me->add_dependency (n);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("items-worth-living"), n);
 }
 
@@ -100,5 +99,9 @@ ADD_INTERFACE (Hara_kiri_group_spanner, "hara-kiri-group-interface",
               "A group spanner that  keeps track of interesting items.  If it "
               "doesn't contain any after linebreaking, then it "
               "will remove itself and all its children.",
-              "items-worth-living remove-first");
+
+
+              /* properties */
+              "items-worth-living "
+              "remove-first");
 
index 3e75259af4914b72ef9ed3ddf81669472900201d..2343e01e12b7e95f1638e662af6103b50fc8e229 100644 (file)
@@ -24,7 +24,7 @@ public:
                                 Link_array<Grob> *break_reminder,
                                 Link_array<Grob> *real_acc);
 
-  static SCM position_accidentals (Grob *);
+  DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
   static bool has_interface (Grob *);
 };
 #endif /* ACCIDENTAL_PLACEMENT_HH */
index ec8099d2524260687b35d70b1a92c898ed8a43eb..73f036eb15f6dee2713d81103aebf067e2dceac7 100644 (file)
@@ -14,6 +14,7 @@
 
 struct Align_interface
 {
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
   DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (fixed_distance_alignment_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (stretch_after_break, (SCM element));
@@ -21,7 +22,7 @@ struct Align_interface
   static void align_elements_to_extents (Grob *, Axis a);
   static void set_axis (Grob *, Axis);
   static Axis axis (Grob *);
-  static void add_element (Grob *, Grob *, SCM callback);
+  static void add_element (Grob *, Grob *);
   static int get_count (Grob *, Grob *);
 
   static bool has_interface (Grob *);
index 3d9aa314bf45186ceb8d136792c03a95e37c814e..da210d56b94b94b544c4eef344787a337f216b8f 100644 (file)
@@ -51,7 +51,6 @@ public:
   static void set_beaming (Grob *, Beaming_info_list const *);
   static void set_stemlens (Grob *);
   static int get_beam_count (Grob *me);
-  static void position_beam (Grob *me);
   static Real get_beam_translation (Grob *me);
   static Real get_thickness (Grob *me);
   static void connect_beams (Grob *me);
@@ -59,8 +58,8 @@ public:
   DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
 
   /* position callbacks */
   DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
index 8ab57760f660ae414d10b1f88d967ea33770e937..cfa651bb9d4c9e552450ead5f6ffb0e1290724dd 100644 (file)
 class Break_align_interface
 {
 public:
-  static void do_alignment (Grob *);
   static Link_array<Grob> ordered_elements (Grob *me);
   static bool has_interface (Grob *);
   static void add_element (Grob *me, Grob *add);
-  DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
   DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis));
 };
 struct Break_aligned_interface
index ac9bbc488c65d8e27b708c776a3c418975c47d24..3a56cd9cc206204fa3bae0662d259b6aa038a0d7 100644 (file)
@@ -25,6 +25,6 @@ public:
   static bool has_interface (Grob *);
   DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (side_position, (SCM, SCM));
-  static SCM do_shifts (Grob *);
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
 };
 #endif // DOT_COLUMN_HH
index 40446590a2c30071ac967a50c1de7c1e1e24c123..c0dd655b478b211bfbd423c5c459aec858178ce8 100644 (file)
@@ -30,12 +30,16 @@ class Grob
 private:
   DECLARE_SMOBS (Grob, foo);
   void init ();
+
+
+
 protected:
   Object_key const *key_;
   SCM immutable_property_alist_;
   SCM mutable_property_alist_;
   SCM object_alist_;
-
+  SCM property_callbacks_;
+  
   /*
     If this is a property, it accounts for 25% of the property
     lookups.
@@ -52,6 +56,9 @@ protected:
 
   DECLARE_CLASSNAME(Grob);
 public:
+  DECLARE_SCHEME_CALLBACK(same_axis_parent_positioning, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK(other_axis_parent_positioning, (SCM, SCM));
+
   Object_key const *get_key () const;
 
   Grob *original_;
@@ -71,12 +78,14 @@ public:
   /*
     Properties
   */
-  SCM internal_get_property (SCM) const;
-  SCM internal_get_object (SCM) const;
+  SCM internal_get_property (SCM symbol) const;
+  SCM get_property_data (SCM symbol) const;
+  SCM internal_get_object (SCM symbol) const;
 
   void internal_set_property (SCM sym, SCM val);
   void internal_set_object (SCM sym, SCM val);
 
+  SCM try_callback (SCM);
   /*
     JUNKME.
   */
index ea7b63c5cdbfc6f6dde35db8870652fef78984bf..8b2d16357aef5e2b3f82285bc2d83fb21f6ff196 100644 (file)
 
 #include "grob-interface.hh"
 #include "lily-proto.hh"
+#include "lily-guile.hh"
 
 struct Laissez_vibrer_tie_column
 {
   static bool has_interface (Grob *);
-  static void set_directions (Grob *me);
+  
+  DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
 };
 
 
index d500f08f0cb9fc5a253a2cbd9e4e5f532df6a520..3dacf88e6f7851c4dd04ec35b52006a902f29585 100644 (file)
@@ -18,8 +18,8 @@ struct Laissez_vibrer_tie
 {
   static bool has_interface (Grob *);
   
-  DECLARE_SCHEME_CALLBACK (print, (SCM));
-  static void set_direction (Grob *);
+  DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
   static int compare (Grob *const &s1,
                      Grob *const &s2);
   static int get_position (Grob *);
index 8a0a5ec79e90c3f28a83122c2af3518bdb1e7230..ed65a0cac11a19625de9c8d7048685e617097534 100644 (file)
@@ -31,7 +31,7 @@ public:
 
   static Drul_array<Link_array<Grob> > get_clash_groups (Grob *me);
   DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
-  static void do_shifts (Grob *);
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob));
   static void add_column (Grob *me, Grob *ncol);
   static bool has_interface (Grob *);
 };
index 1c7e12dd843d8bf1f4442791eb6eed7c7d121796..6575b568eb2eb03a387765bba455ceadab44afe1 100644 (file)
@@ -22,6 +22,7 @@ public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM));
   DECLARE_SCHEME_CALLBACK (extent, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (stem_x_shift, (SCM, SCM));
   static bool has_interface (Grob *);
   static Real stem_attachment_coordinate (Grob *, Axis a);
   static int get_balltype (Grob *);
index f37fc1e97f88cbf6090fe201679053ba762b844d..a9a80eb20b6ff23996e736025d080d81ba170b0b 100644 (file)
@@ -19,6 +19,7 @@ public:
 
   static bool has_interface (Grob *);
   DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
   DECLARE_SCHEME_CALLBACK (force_shift_callback_rest, (SCM element, SCM axis));
   static SCM do_shift (Grob *);
 };
index 6fe85ccd0dcdd74bb29f1c9594a8ef00bd36e609..90841841202a24002e9ab04b068af6fed3e798f7 100644 (file)
@@ -18,7 +18,8 @@ public:
   static void add_column (Grob *me, Grob *col);
   static void add_extra_encompass (Grob *me, Grob *col);
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
   static bool has_interface (Grob *);
index fa9f65bccc07c37e6145b4356f22c2b88bbd6c0f..a42daf856d55cd2205ceb1458f683bd82681f0c9 100644 (file)
@@ -35,7 +35,6 @@ public:
   static bool is_invisible (Grob *);
   static Interval head_positions (Grob *);
   static Real get_default_stem_end_position (Grob *me);
-  static void position_noteheads (Grob *);
   static Real stem_end_position (Grob *);
   static Stencil flag (Grob *);
   static Stencil get_translated_flag (Grob*);
@@ -44,11 +43,11 @@ public:
 
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element, SCM axis));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_stem_end_position, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_stem_info, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
   DECLARE_SCHEME_CALLBACK (width_callback, (SCM smob, SCM axis));
   DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
-
-private:
-  static void calc_stem_info (Grob *);
 };
 #endif
index 37b5725c6486ab377aa3420869fbd6e35b5c4705..b5165695872b3fbcc0817dbb8c9982d1bd431f9e 100644 (file)
@@ -17,7 +17,7 @@ class Tie_column
 public:
   static bool has_interface (Grob *);
   static void add_tie (Grob *me, Grob *);
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
   static void set_directions (Grob *me);
   static void new_directions (Grob *me);
index 6ea8f653b20231c12aeb0f42b4855af7d0143151..6b4802ef58a3d1f974ae3d6eec2699e6f136ec39 100644 (file)
@@ -58,7 +58,6 @@ class Tie
 public:
   static void set_head (Grob *, Direction, Grob *head);
   static bool has_interface (Grob *);
-  static void set_direction (Grob *);
   static Grob *head (Grob *, Direction);
   static int get_column_rank (Grob *, Direction);
   static int get_position (Grob *);
@@ -73,6 +72,8 @@ public:
   static void set_default_control_points (Grob *);
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
   static int compare (Grob *const &s1,
                      Grob *const &s2);
 
index 073311500cb0bfc5716b7ca61aca538638692f0b..add0f47e6ff9cd8118e7eb2ceb054ebcb54e3239 100644 (file)
@@ -13,8 +13,8 @@
 class Tuplet_bracket
 {
 public:
-  DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
-  DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
 
   static bool has_interface (Grob *);
index d8b1b5e6e7800f4fad9b22f2c57d6fe5f29cd2fa..83b14cc3f4766e873b11e9c24b5fb38be2c7f028 100644 (file)
@@ -33,15 +33,12 @@ ADD_INTERFACE(Laissez_vibrer_tie_column,
 /*
   Cut & paste from tie-column.cc
  */   
-void
-Laissez_vibrer_tie_column::set_directions (Grob *me)
+MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie_column, calc_positioning_done, 1);
+SCM
+Laissez_vibrer_tie_column::calc_positioning_done (SCM smob)
 {
-  if (!to_boolean (me->get_property ("positioning-done")))
-    me->set_property ("positioning-done", SCM_BOOL_T); 
-  else
-    return;
-
-
+  Grob *me = unsmob_grob (smob);
+  
   extract_grob_set (me, "ties", lv_ro_ties);
   Link_array<Grob> lv_ties (lv_ro_ties);
 
@@ -52,7 +49,7 @@ Laissez_vibrer_tie_column::set_directions (Grob *me)
   for (int i = 0; i < lv_ties.size (); i++)
     {
       Tie_configuration conf;
-      conf.dir_ = get_grob_direction (lv_ties[i]);
+      conf.dir_ = CENTER;
       Item *head = unsmob_item (lv_ties[i]->get_object ("note-head"));
 
       heads.push (head);
@@ -122,6 +119,8 @@ Laissez_vibrer_tie_column::set_directions (Grob *me)
                               details );
       set_grob_direction (lv_ties[i], tie_configs[i].dir_);
     }
+
+  return SCM_BOOL_T;
 }
   
 
index 7dcce699865c72af2747197c7ca91691f4cfb176..1c361d443ae90ef97c93a7bb6df2588554edbb07 100644 (file)
@@ -28,40 +28,38 @@ ADD_INTERFACE(Laissez_vibrer_tie,
              "x-gap "
              );
 
-MAKE_SCHEME_CALLBACK (Laissez_vibrer_tie, print, 1);
+MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie, calc_control_points, 1)
 SCM
-Laissez_vibrer_tie::print (SCM smob)
+Laissez_vibrer_tie::calc_control_points (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  if (CENTER == get_grob_direction (me))
-    set_direction (me);
-
-  if (!get_grob_direction (me))
-    me->programming_error ("lv. tie direction not set."); 
-    
-  SCM cp = me->get_property ("control-points");
-  if (!scm_is_pair (cp))
-    if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
-      {
-       Laissez_vibrer_tie_column::set_directions (me->get_parent (Y_AXIS));
-      }
-
-  return Tie::print (smob);
+  if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
+    {
+      me->get_parent (Y_AXIS)->get_property ("positioning-done");
+    }
+  else
+    {
+      programming_error ("lv tie without Laissez_vibrer_tie_column. Killing lv tie."); 
+      me->suicide (); 
+    }
+  
+  return SCM_UNSPECIFIED;
 }
 
-void
-Laissez_vibrer_tie::set_direction (Grob *me)
+MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie, calc_direction, 1)
+SCM
+Laissez_vibrer_tie::calc_direction (SCM smob)
 {
-  if (!get_grob_direction (me))
+  Grob *me = unsmob_grob (smob);
+  if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
+    me->get_parent (Y_AXIS)->get_property("positioning-done");
+  else
     {
-      if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
-       Laissez_vibrer_tie_column::set_directions (me->get_parent (Y_AXIS));
-      else
-       {
-         programming_error ("lv tie without Laissez_vibrer_tie_column"); 
-         set_grob_direction (me, UP);
-       }
+      programming_error ("lv tie without Laissez_vibrer_tie_column"); 
+      set_grob_direction (me, UP);
     }
+
+  return SCM_UNSPECIFIED;
 }
 
 int
index a68a9c18a586a5482e81aa5d07846f72ec0bc95a..04dae1da50706dd0bb25f766a1ab57a4d7a645e1 100644 (file)
@@ -400,8 +400,7 @@ New_figured_bass_engraver::create_grobs ()
              group.group_ = make_spanner ("BassFigureLine", SCM_EOL);
              group.group_->set_bound (LEFT, muscol);
              Align_interface::add_element (alignment_,
-                                           group.group_,
-                                           Align_interface::alignment_callback_proc);
+                                           group.group_);
            }
 
          if (scm_memq (fig, get_property ("implicitBassFigures")) != SCM_BOOL_F)
index 8a96ab5efe4f2bde8e142e9a82809c2365939ac3..132dccdcae0e423dec0efb56e05a54372bdb7edf 100644 (file)
 #include "dot-column.hh"
 #include "pointer-group-interface.hh"
 
-MAKE_SCHEME_CALLBACK (Note_collision_interface, force_shift_callback, 2);
 
-SCM
-Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
-{
-  Grob *me = unsmob_grob (element_smob);
-  Axis a = (Axis) scm_to_int (axis);
-  assert (a == X_AXIS);
-
-  me = me->get_parent (a);
-
-  if (! to_boolean (me->get_property ("positioning-done")))
-    {
-      me->set_property ("positioning-done", SCM_BOOL_T);
-      do_shifts (me);
-    }
-
-  return scm_from_double (0.0);
-}
 
 void
 check_meshing_chords (Grob *me,
@@ -285,9 +267,12 @@ check_meshing_chords (Grob *me,
   while ((flip (&d)) != UP);
 }
 
-void
-Note_collision_interface::do_shifts (Grob *me)
+
+MAKE_SCHEME_CALLBACK(Note_collision_interface, calc_positioning_done, 1) 
+SCM
+Note_collision_interface::calc_positioning_done (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);  
   Drul_array<Link_array<Grob> > cg = get_clash_groups (me);
 
   SCM autos (automatic_shift (me, cg));
@@ -335,10 +320,12 @@ Note_collision_interface::do_shifts (Grob *me)
 
   for (int i = 0; i < amounts.size (); i++)
     done[i]->translate_axis (amounts[i] - left_most, X_AXIS);
+
+  return SCM_BOOL_T;
 }
 
-Drul_array < Link_array<Grob>
-Note_collision_interface::get_clash_groups (Grob *me)
+Drul_array < Link_array<Grob> >
+Note_collision_interface::get_clash_groups (Grob *me)
 {
   Drul_array<Link_array<Grob> > clash_groups;
 
@@ -482,9 +469,8 @@ Note_collision_interface::forced_shift (Grob *me)
 void
 Note_collision_interface::add_column (Grob *me, Grob *ncol)
 {
-  ncol->add_offset_callback (Note_collision_interface::force_shift_callback_proc, X_AXIS);
+  ncol->add_offset_callback (Grob::same_axis_parent_positioning_proc, X_AXIS);
   Axis_group_interface::add_element (me, ncol);
-  me->add_dependency (ncol);
 }
 
 ADD_INTERFACE (Note_collision_interface, "note-collision-interface",
@@ -493,4 +479,7 @@ ADD_INTERFACE (Note_collision_interface, "note-collision-interface",
               "are to be set in @ref{note-column-interface}: these are "
               "@code{force-hshift} and @code{horizontal-shift}.",
 
-              "merge-differently-dotted merge-differently-headed positioning-done");
+              /* properties */
+              "merge-differently-dotted "
+              "merge-differently-headed "
+              "positioning-done");
index 974f220b79de2803b1ab656379e7cfaf69ff2021..f49b65b986fe97ce49fa00377f770258a80590ff 100644 (file)
@@ -89,7 +89,6 @@ void
 Note_column::set_stem (Grob *me, Grob *stem)
 {
   me->set_object ("stem", stem->self_scm ());
-  me->add_dependency (stem);
   Axis_group_interface::add_element (me, stem);
 }
 
index 1a51dd69b97dbd5150862132da566c49cd7c31c2..2b31367ef07c369f70a7f9771de2457446dcacef 100644 (file)
@@ -72,6 +72,23 @@ internal_print (Grob *me, String *font_char)
   return out;
 }
 
+/*
+  TODO: make stem X-parent of notehead. 
+ */
+MAKE_SCHEME_CALLBACK (Note_head, stem_x_shift, 2);
+SCM
+Note_head::stem_x_shift (SCM smob, SCM axis)
+{
+  (void) axis;
+  
+  Grob *me = unsmob_grob (smob);
+  Grob *stem = unsmob_grob (me->get_object ("stem"));
+  if (stem)
+    (void) stem->get_property ("positioning-done");
+
+  return scm_from_int (0);
+}
+
 MAKE_SCHEME_CALLBACK (Note_head, print, 1);
 SCM
 Note_head::print (SCM smob)
index 21ec8c9166816d161dd0e4b01e06d375edfabf71..ecac2bc08f10b907e3a53571671ecce0e5770403 100644 (file)
@@ -32,12 +32,11 @@ Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
 
   if (Note_column::has_rests (them))
     {
-      Grob *rc = unsmob_grob (them->get_object ("rest-collision"));
+      Grob *collision = unsmob_grob (them->get_object ("rest-collision"));
 
-      if (rc && !to_boolean (rc->get_property ("positioning-done")))
+      if (collision)
        {
-         rc->set_property ("positioning-done", SCM_BOOL_T);
-         do_shift (rc);
+         (void) collision->get_property ("positioning-done");
        }
     }
   return scm_from_double (0.0);
@@ -60,7 +59,6 @@ Rest_collision::force_shift_callback_rest (SCM rest, SCM axis)
 void
 Rest_collision::add_column (Grob *me, Grob *p)
 {
-  me->add_dependency (p);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), p);
 
   /*
@@ -84,9 +82,11 @@ Rest_collision::add_column (Grob *me, Grob *p)
   TODO: look at horizontal-shift to determine ordering between rests
   for more than two voices.
 */
+MAKE_SCHEME_CALLBACK(Rest_collision, calc_positioning_done, 1);
 SCM
-Rest_collision::do_shift (Grob *me)
+Rest_collision::calc_positioning_done (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "elements", elts);
 
   Link_array<Grob> rests;
@@ -254,5 +254,9 @@ Rest_collision::do_shift (Grob *me)
 ADD_INTERFACE (Rest_collision, "rest-collision-interface",
               "Move around ordinary rests (not multi-measure-rests) to avoid "
               "conflicts.",
-              "minimum-distance positioning-done elements");
+
+              /* properties */
+              "minimum-distance "
+              "positioning-done "
+              "elements");
 
index e2e7411b536b5c4cd55021167068cc40caf35ece..2fc7f2f158bc2eb185a483c4874ffc612db03783 100644 (file)
 #include "pointer-group-interface.hh"
 
 void
-Script_column::add_staff_sided (Grob *me, Item *i)
+Script_column::add_staff_sided (Grob *me, Item *item)
 {
-  SCM p = i->get_property ("script-priority");
+  SCM p = item->get_property ("script-priority");
   if (!scm_is_number (p))
     return;
 
-  Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), i);
-
-  me->add_dependency (i);
+  Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), item);
 }
 
 LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less",
index ff0ebcc9147e39d417bcd2cce41ba8426f2bb369..09eef7460c8cd993779d48b3dd2d4aeb0f481ce8 100644 (file)
@@ -180,8 +180,6 @@ Script_engraver::acknowledge_stem (Grob_info info)
       if (to_dir (e->get_property ("side-relative-direction")))
        e->set_object ("direction-source", info.grob ()->self_scm ());
 
-      /* FIXME: add dependency */
-      e->add_dependency (info.grob ());
       Side_position_interface::add_support (e, info.grob ());
     }
 }
@@ -199,7 +197,6 @@ Script_engraver::acknowledge_rhythmic_head (Grob_info info)
              && !e->get_parent (Y_AXIS))
            {
              e->set_parent (info.grob (), Y_AXIS);
-             e->add_dependency (info.grob ());
            }
          Side_position_interface::add_support (e, info.grob ());
        }
index 38b801b1b499c2986204412e85e2eefbd913c54e..7c01a673e5d7452d5b124aff75aa687739e52509 100644 (file)
@@ -89,6 +89,8 @@ struct Text_script
 
 ADD_INTERFACE (Text_script, "text-script-interface",
               "An object that is put above or below a note",
+
+              /* properties */
               "add-stem-support "
               "avoid-slur "
               "script-priority "
index baf2ea14ae0bd053cc74408e39f14f3e5614c138..5939bb4fc7cda0910352bd826b9fcc78fcb83516 100644 (file)
@@ -108,10 +108,12 @@ void
 Separating_group_spanner::add_spacing_unit (Grob *me, Item *i)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), i);
-  me->add_dependency (i);
 }
 
 ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface",
               "A spanner that calculates spacing constraints (\"rods\") "
               "using the @code{separation-item-interface} grobs in @code{elements}.",
-              "elements padding");
+
+              /* properties */
+              "elements "
+              "padding");
index dc6ae852940944f378a241e3fe35d2d71d989d31..b2968cb38adb115c59f3dc3ebc0c76786b2131e9 100644 (file)
@@ -359,14 +359,18 @@ Slur_score_state::fill (Grob *me)
     musical_dy_ = 0.0;
 }
 
-void
-set_slur_control_points (Grob *me)
+
+MAKE_SCHEME_CALLBACK(Slur, calc_control_points, 1)
+SCM
+Slur::calc_control_points (SCM smob)
 {
+  Spanner *me = unsmob_spanner (smob);
+
   Slur_score_state state;
   state.fill (me);
 
   if (!state.valid_)
-    return;
+    return SCM_EOL;
 
   state.generate_curves ();
 
@@ -386,7 +390,8 @@ set_slur_control_points (Grob *me)
                  me->relative_coordinate (state.common_[Y_AXIS], Y_AXIS));
       controls = scm_cons (ly_offset2scm (o), controls);
     }
-  me->set_property ("control-points", controls);
+
+  return controls;
 }
 
 Bezier
index 6db1fabfb0fd3dbcb9f0639afd51d07e64db65ad..72dbe3dd0841cb139f04d9dc777e277f18948c75 100644 (file)
 #include "warn.hh"
 #include "slur-scoring.hh"
 
-static Direction
-get_default_dir (Grob *me)
+#include "script-interface.hh"
+
+
+
+MAKE_SCHEME_CALLBACK(Slur, calc_direction, 1)
+SCM
+Slur::calc_direction (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "note-columns", encompasses);
 
+  if (encompasses.is_empty ())
+    {
+      me->suicide ();
+      return SCM_BOOL_F;
+    }
+
   Direction d = DOWN;
   for (int i = 0; i < encompasses.size (); i++)
     {
@@ -41,7 +53,7 @@ get_default_dir (Grob *me)
          break;
        }
     }
-  return d;
+  return scm_from_int (d);
 }
 
 MAKE_SCHEME_CALLBACK (Slur, height, 2);
@@ -136,10 +148,9 @@ void
 Slur::add_extra_encompass (Grob *me, Grob *n)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("encompass-objects"), n);
-  me->add_dependency (n);
 }
 
-#include "script-interface.hh"
+
 MAKE_SCHEME_CALLBACK (Slur, outside_slur_callback, 2);
 SCM
 Slur::outside_slur_callback (SCM grob, SCM axis)
@@ -158,10 +169,6 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
   if (dir == CENTER)
     return scm_from_int (0);
 
-  /* FIXME: this dependency should be automatic.  */
-  if (scm_ilength (slur->get_property ("control-points")) < 4)
-    Slur::after_line_breaking (slur->self_scm ());
-
   Grob *cx = script->common_refpoint (slur, X_AXIS);
   Grob *cy = script->common_refpoint (slur, Y_AXIS);
 
@@ -219,28 +226,23 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
   return scm_from_double (offset);
 }
 
-MAKE_SCHEME_CALLBACK (Slur, after_line_breaking, 1);
-SCM
-Slur::after_line_breaking (SCM smob)
-{
-  Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
-  extract_grob_set (me, "note-columns", encompasses);
-  if (encompasses.is_empty ())
-    {
-      me->suicide ();
-      return SCM_UNSPECIFIED;
-    }
-
-  if (!get_grob_direction (me))
-    set_grob_direction (me, get_default_dir (me));
-
-  if (scm_ilength (me->get_property ("control-points")) < 4)
-    set_slur_control_points (me);
 
-  return SCM_UNSPECIFIED;
-}
 
 ADD_INTERFACE (Slur, "slur-interface",
+              
               "A slur",
-              "positions quant-score eccentricity encompass-objects control-points dash-period dash-fraction slur-details direction height-limit note-columns ratio thickness");
+              
+              "control-points "
+              "dash-fraction "
+              "dash-period "
+              "direction "
+              "eccentricity "
+              "encompass-objects "
+              "height-limit "
+              "note-columns "
+              "positions "
+              "quant-score "
+              "ratio "
+              "slur-details "
+              "thickness ");
 
index 9a3312daa0f490cfd5c1cce4b5bd5368b3285d5b..0b018dbce6cee5ccbe6b0dfb876c2aad72fd3b04 100644 (file)
@@ -22,8 +22,6 @@ void
 Span_bar::add_bar (Grob *me, Grob *b)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), b);
-
-  me->add_dependency (b);
 }
 
 MAKE_SCHEME_CALLBACK (Span_bar, print, 1);
index 06940e387f91426153e05f6837b6fc7d57183b21..25f8e051c38bc2114ef6fb819e0ef11bfcca28b4 100644 (file)
@@ -230,7 +230,6 @@ void
 Stem::add_head (Grob *me, Grob *n)
 {
   n->set_object ("stem", me->self_scm ());
-  n->add_dependency (me);
 
   if (Note_head::has_interface (n))
     Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), n);
@@ -266,6 +265,7 @@ Stem::get_default_dir (Grob *me)
   return to_dir (me->get_property ("neutral-direction"));
 }
 
+
 Real
 Stem::get_default_stem_end_position (Grob *me)
 {
@@ -289,11 +289,6 @@ Stem::get_default_stem_end_position (Grob *me)
   /* URGURGURG
      'set-default-stemlen' sets direction too.   */
   Direction dir = get_direction (me);
-  if (!dir)
-    {
-      dir = get_default_dir (me);
-      set_grob_direction (me, dir);
-    }
 
   /* Stems in unnatural (forced) direction should be shortened,
      according to [Roush & Gourlay] */
@@ -389,11 +384,13 @@ Stem::duration_log (Grob *me)
   return (scm_is_number (s)) ? scm_to_int (s) : 2;
 }
 
-void
-Stem::position_noteheads (Grob *me)
+MAKE_SCHEME_CALLBACK(Stem, calc_positioning_done, 1);
+SCM
+Stem::calc_positioning_done (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);  
   if (!head_count (me))
-    return;
+    return SCM_BOOL_T;
 
   extract_grob_set (me, "note-heads", ro_heads);
   Link_array<Grob> heads (ro_heads);
@@ -467,11 +464,33 @@ Stem::position_noteheads (Grob *me)
 
       lastpos = int (p);
     }
+
+  return SCM_BOOL_T;
+}
+
+
+
+MAKE_SCHEME_CALLBACK(Stem, calc_direction, 1);
+SCM
+Stem::calc_direction (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Direction dir = CENTER;
+  if (Grob *beam = unsmob_grob (me->get_object ("beam")))
+    {
+      SCM ignore_me = beam->get_property ("direction");
+      (void) ignore_me;
+      dir = get_grob_direction (me);
+    }
+  else
+    dir = get_default_dir (me);
+
+  return scm_from_int (dir);
 }
 
-MAKE_SCHEME_CALLBACK (Stem, before_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_stem_end_position, 1);
 SCM
-Stem::before_line_breaking (SCM smob)
+Stem::calc_stem_end_position (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
@@ -479,13 +498,13 @@ Stem::before_line_breaking (SCM smob)
     Do the calculations for visible stems, but also for invisible stems
     with note heads (i.e. half notes.)
   */
+  Real pos = 0.0;
   if (head_count (me))
     {
-      stem_end_position (me);  // ugh. Trigger direction calc.
-      position_noteheads (me);
+      pos = stem_end_position (me);    // ugh. Trigger direction calc.
     }
 
-  return SCM_UNSPECIFIED;
+  return scm_from_double (pos);
 }
 
 /*
@@ -501,26 +520,31 @@ Stem::height (SCM smob, SCM ax)
   Grob *me = unsmob_grob (smob);
   assert (a == Y_AXIS);
 
-  /*
-    ugh. - this dependency should be automatic.
+  Direction dir = get_grob_direction (me);
+  
+  /* Trigger callback.
+
+  UGH. Should be automatic
   */
   Grob *beam = get_beam (me);
   if (beam)
-    Beam::after_line_breaking (beam->self_scm ());
-
+    {
+      beam->get_property ("positions");
+    }
+  
   SCM mol = me->get_uncached_stencil ();
   Interval iv;
   if (mol != SCM_EOL)
     iv = unsmob_stencil (mol)->extent (a);
-  if (Grob *b = get_beam (me))
+  
+  if (beam)
     {
-      Direction d = get_direction (me);
-      if (d == CENTER)
+      if (dir == CENTER)
        {
          programming_error ("no stem direction");
-         d = UP;
+         dir = UP;
        }
-      iv[d] += d * Beam::get_thickness (b) * 0.5;
+      iv[dir] += dir * Beam::get_thickness (beam) * 0.5;
     }
 
   return ly_interval2scm (iv);
@@ -779,25 +803,21 @@ Stem::get_beam (Grob *me)
 Stem_info
 Stem::get_stem_info (Grob *me)
 {
-  /* Return cached info if available */
-  SCM scm_info = me->get_property ("stem-info");
-  if (!scm_is_pair (scm_info))
-    {
-      calc_stem_info (me);
-      scm_info = me->get_property ("stem-info");
-    }
-
   Stem_info si;
   si.dir_ = get_grob_direction (me);
+  
+  SCM scm_info = me->get_property ("stem-info");
   si.ideal_y_ = scm_to_double (scm_car (scm_info));
   si.shortest_y_ = scm_to_double (scm_cadr (scm_info));
   return si;
 }
 
 /* TODO: add extra space for tremolos!  */
-void
-Stem::calc_stem_info (Grob *me)
+MAKE_SCHEME_CALLBACK(Stem, calc_stem_info, 1);
+SCM
+Stem::calc_stem_info (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);
   Direction my_dir = get_grob_direction (me);
 
   if (!my_dir)
@@ -904,9 +924,8 @@ Stem::calc_stem_info (Grob *me)
   Real minimum_y = note_start + minimum_length;
   Real shortest_y = minimum_y * my_dir;
 
-  me->set_property ("stem-info",
-                   scm_list_2 (scm_from_double (ideal_y),
-                               scm_from_double (shortest_y)));
+  return scm_list_2 (scm_from_double (ideal_y),
+                    scm_from_double (shortest_y));
 }
 
 Slice
@@ -925,14 +944,34 @@ ADD_INTERFACE (Stem, "stem-interface",
               "In addition, it internally connects note heads, beams and"
               "tremolos. "
               "Rests and whole notes have invisible stems.",
-              "tremolo-flag french-beaming "
-              "avoid-note-head thickness "
-              "stemlet-length rests "
-              "stem-info beamed-lengths beamed-minimum-free-lengths "
-              "beamed-extreme-minimum-free-lengths lengths beam stem-shorten "
-              "duration-log beaming neutral-direction stem-end-position "
-              "note-heads direction length flag-style "
-              "no-stem-extend stroke-style");
+
+              /* properties */
+              
+              "avoid-note-head "
+              "beam "
+              "beamed-extreme-minimum-free-lengths "
+              "beamed-lengths "
+              "beamed-minimum-free-lengths "
+              "beaming "
+              "direction "
+              "duration-log "
+              "flag-style "
+              "french-beaming "
+              "length "
+              "lengths "
+              "neutral-direction "
+              "no-stem-extend "
+              "note-heads "
+              "positioning-done "
+              "rests "
+              "stem-end-position "
+              "stem-info "
+              "stem-shorten "
+              "stemlet-length "
+              "stroke-style "
+              "thickness "
+              "tremolo-flag "
+              );
 
 /****************************************************************/
 
index 76d45004cba8fc0ed34e35e765bf8c8c173a888c..54318451b3ccbe2755d0559ab72bb9850f1319fe 100644 (file)
@@ -36,27 +36,6 @@ Tie_column::add_tie (Grob *me, Grob *tie)
 
   tie->set_parent (me, Y_AXIS);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("ties"), tie);
-  tie->add_dependency (me);
-}
-
-void
-Tie_column::set_directions (Grob *me)
-{
-  if (!to_boolean (me->get_property ("positioning-done")))
-    {
-      me->set_property ("positioning-done", SCM_BOOL_T); 
-      new_directions (me);
-    }
-}
-
-
-
-MAKE_SCHEME_CALLBACK (Tie_column, after_line_breaking, 1);
-SCM
-Tie_column::after_line_breaking (SCM smob)
-{
-  set_directions (unsmob_grob (smob));
-  return SCM_UNSPECIFIED;
 }
 
 /*
@@ -79,22 +58,26 @@ Tie_column::before_line_breaking (SCM smob)
        }
       while (flip (&dir) != LEFT);
     }
+  
   return SCM_UNSPECIFIED;
 }
 
-
-void
-Tie_column::new_directions (Grob *me)
+MAKE_SCHEME_CALLBACK(Tie_column, calc_positioning_done, 1)
+SCM
+Tie_column::calc_positioning_done (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "ties", ro_ties);
   Link_array<Grob> ties (ro_ties);
   if (!ties.size ())
-    return;
+    return SCM_BOOL_T;
 
   if (ties.size() == 1)
     {
-      Tie::set_default_control_points (ties[0]);
-      return;
+      /*
+       Already handled by standard mechanisms.
+       */
+      return SCM_BOOL_T;
     }
   
   ties.sort (&Tie::compare);
@@ -176,6 +159,7 @@ Tie_column::new_directions (Grob *me)
                               );
       set_grob_direction (ties[i], tie_configs[i].dir_);
     }
+  return SCM_BOOL_T;
 }
 
 
index 78501ef7f755df03ee8191d71676b3ccc3b249e4..017dba751ea425aff1648aabd688063f9ee06a44 100644 (file)
@@ -7,8 +7,6 @@
 */
 
 #include "tie.hh"
-
-
 #include "spanner.hh"
 #include "lookup.hh"
 #include "output-def.hh"
@@ -22,6 +20,7 @@
 #include "stem.hh"
 #include "note-head.hh"
 #include "tie-column.hh"
+#include "grob-array.hh"
 
 int
 Tie::compare (Grob *const &s1,
@@ -34,7 +33,6 @@ void
 Tie::set_head (Grob *me, Direction d, Grob *h)
 {
   dynamic_cast<Spanner *> (me)->set_bound (d, h);
-  me->add_dependency (h);
 }
 
 Grob *
@@ -62,8 +60,24 @@ Tie::get_column_rank (Grob *me, Direction d)
 int
 Tie::get_position (Grob *me)
 {
-  Direction d = head (me, LEFT) ? LEFT : RIGHT;
-  return (int) Staff_symbol_referencer::get_position (head (me, d));
+  Direction d = LEFT;
+  do
+    {
+      Grob *h = head (me, d);
+      if (h)
+       return (int) Staff_symbol_referencer::get_position (h);
+    }
+  while (flip (&d) != LEFT);
+
+  /*
+
+  TODO: this is theoretically possible for ties across more than 2
+  systems.. We should look at the first broken copy.
+  
+  */
+  programming_error ("Tie without heads. Suicide");
+  me->suicide ();
+  return 0;
 }
 
 /*
@@ -96,16 +110,24 @@ Tie::get_default_dir (Grob *me)
   return UP;
 }
 
-void
-Tie::set_direction (Grob *me)
+
+MAKE_SCHEME_CALLBACK(Tie, calc_direction, 1);
+SCM
+Tie::calc_direction (SCM smob)
 {
-  if (!get_grob_direction (me))
+  Grob *me = unsmob_grob (smob);
+  Grob *yparent = me->get_parent (Y_AXIS);
+  if (Tie_column::has_interface (yparent)
+      && unsmob_grob_array (yparent->get_object ("ties"))
+      && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1)
     {
-      if (Tie_column::has_interface (me->get_parent (Y_AXIS)))
-       Tie_column::set_directions (me->get_parent (Y_AXIS));
-      else
-       set_grob_direction (me, Tie::get_default_dir (me));
+      /* trigger positioning. */
+      (void) yparent->get_property ("positioning-done");
     }
+  else
+    set_grob_direction (me, Tie::get_default_dir (me));
+
+  return SCM_UNSPECIFIED;
 }
 
 Interval
@@ -395,9 +417,6 @@ Tie::set_default_control_points (Grob *me_grob)
   common = me->get_bound (RIGHT)->common_refpoint (common, X_AXIS); 
   
   Tie_configuration conf;
-  if (!get_grob_direction (me))
-    set_grob_direction (me, get_default_dir (me));
-
   int tie_position = (int) Tie::get_position (me);
   conf.position_ = tie_position;
   
@@ -432,42 +451,31 @@ Tie::set_control_points (Grob *me,
   me->set_property ("control-points", controls);
 }
 
-
-
-MAKE_SCHEME_CALLBACK (Tie, print, 1);
+MAKE_SCHEME_CALLBACK(Tie, calc_control_points, 1);
 SCM
-Tie::print (SCM smob)
+Tie::calc_control_points (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  if (CENTER == get_grob_direction (me))
-    set_direction (me);
+  // trigger Tie-column
+  (void)  get_grob_direction (me);
 
-  if (!get_grob_direction (me))
-    me->programming_error ("Tie direction not set."); 
-    
-  SCM cp = me->get_property ("control-points");
-  if (!scm_is_pair (cp))
-    {
-      /*
-       UGH.  dependency tracking!
-       */
-      if (Tie_column::has_interface (me->get_parent (Y_AXIS)))
-       {
-         Tie_column::set_directions (me->get_parent (Y_AXIS));
-       }
-
-      cp = me->get_property ("control-points");
-    }
-  
-  if (!scm_is_pair (cp))
+  if (!scm_is_pair (me->get_property ("control-points")))
     {
       set_default_control_points (me);
-      cp = me->get_property ("control-points");
     }
 
-  if (!scm_is_pair (cp))
-    return Stencil ().smobbed_copy ();
+  return SCM_UNSPECIFIED;
+}
+
+
+MAKE_SCHEME_CALLBACK (Tie, print, 1);
+SCM
+Tie::print (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  
+  SCM cp = me->get_property ("control-points");
 
   Real staff_thick = Staff_symbol_referencer::line_thickness (me);
   Real base_thick = robust_scm2double (me->get_property ("thickness"), 1);
index 209545797f3ea71de30c95f63a1d482adc0f63cd..48d042753566d0b22f232ae6d92bb6b9061cafed 100644 (file)
@@ -110,26 +110,8 @@ Tuplet_bracket::print (SCM smob)
   Stencil mol;
   extract_grob_set (me, "note-columns", columns);
 
-  {
-    SCM lp = me->get_property ("left-position");
-    SCM rp = me->get_property ("right-position");
-
-    if (!scm_is_number (rp) || !scm_is_number (lp))
-      {
-       /*
-         UGH. dependency tracking!
-       */
-       extract_grob_set (me, "tuplets", tuplets);
-       for (int i = 0; i < tuplets.size (); i++)
-         Tuplet_bracket::print (tuplets[i]->self_scm ());
-
-       after_line_breaking (smob);
-      }
-  }
-
-  Real ly = robust_scm2double (me->get_property ("left-position"), 0);
-  Real ry = robust_scm2double (me->get_property ("right-position"), 0);
-
+  Drul_array<Real> positions = ly_scm2realdrul (me->get_property ("positions"));
+  Real dy = positions[RIGHT] - positions[LEFT];
   bool equally_long = false;
   Grob *par_beam = parallel_beam (me, columns, &equally_long);
   Spanner *sp = dynamic_cast<Spanner *> (me);
@@ -173,17 +155,14 @@ Tuplet_bracket::print (SCM smob)
 
       int neighbor_idx = me->get_break_index () - break_dir;
 
-      /*
-       UGH. dependency handling.
-       */
       if (break_dir
          && d == RIGHT
          && neighbor_idx < orig_spanner->broken_intos_.size ())
        {
          Grob *neighbor = orig_spanner->broken_intos_[neighbor_idx];
 
-         // ugh, should inspect callback?  
-         Tuplet_bracket::after_line_breaking (neighbor->self_scm ());
+         /* trigger possible suicide*/
+         (void) neighbor->get_property ("positions");
        }
 
       connect_to_other[d]
@@ -237,7 +216,7 @@ Tuplet_bracket::print (SCM smob)
       num.translate_axis (w / 2, X_AXIS);
       num.align_to (Y_AXIS, CENTER);
 
-      num.translate_axis ((ry - ly) / 2, Y_AXIS);
+      num.translate_axis (dy / 2, Y_AXIS);
 
       mol.add_stencil (num);
     }
@@ -299,7 +278,7 @@ Tuplet_bracket::print (SCM smob)
       while (flip (&d) != LEFT);
 
       Stencil brack = make_bracket (me, Y_AXIS,
-                                   Offset (w, ry - ly),
+                                   Offset (w, positions[RIGHT]),
                                    height,
                                    /*
                                      0.1 = more space at right due to italics
@@ -318,7 +297,7 @@ Tuplet_bracket::print (SCM smob)
       mol.add_stencil (brack);
     }
 
-  mol.translate_axis (ly, Y_AXIS);
+  mol.translate_axis (positions[LEFT], Y_AXIS);
   mol.translate_axis (x_span[LEFT]
                      - sp->get_bound (LEFT)->relative_coordinate (commonx, X_AXIS), X_AXIS);
   return mol.smobbed_copy ();
@@ -499,9 +478,10 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
       Interval tuplet_y (tuplets[i]->extent (commony, Y_AXIS));
 
       Direction d = LEFT;
-      Real lp = scm_to_double (tuplets[i]->get_property ("left-position"));
-      Real rp = scm_to_double (tuplets[i]->get_property ("right-position"));
-      Real other_dy = rp - lp;
+      Drul_array<Real> positions = ly_scm2realdrul (tuplets[i]->get_property ("positions"));
+
+      
+      Real other_dy = positions[RIGHT] - positions[LEFT];
 
       do
        {
@@ -560,29 +540,19 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
     }
 }
 
-/*
-  We depend on the beams if there are any.
-*/
-MAKE_SCHEME_CALLBACK (Tuplet_bracket, before_line_breaking, 1);
+
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_direction, 1);
 SCM
-Tuplet_bracket::before_line_breaking (SCM smob)
+Tuplet_bracket::calc_direction (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  extract_grob_set (me, "note-columns", columns);
-
-  for (int i = columns.size (); i--;)
-    {
-      Grob *s = Note_column::get_stem (columns[i]);
-      Grob *b = s ? Stem::get_beam (s) : 0;
-      if (b)
-       me->add_dependency (b);
-    }
-  return SCM_UNSPECIFIED;
+  Direction dir = Tuplet_bracket::get_default_dir (me);
+  return scm_from_int (dir);
 }
 
-MAKE_SCHEME_CALLBACK (Tuplet_bracket, after_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_positions, 1);
 SCM
-Tuplet_bracket::after_line_breaking (SCM smob)
+Tuplet_bracket::calc_positions (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "note-columns", columns);
@@ -590,16 +560,11 @@ Tuplet_bracket::after_line_breaking (SCM smob)
   if (columns.is_empty())
     {
       me->suicide ();
-      return SCM_UNSPECIFIED;
+      return scm_cons (scm_from_double (0),
+                      scm_from_double (0));
     }
   
   Direction dir = get_grob_direction (me);
-  if (!dir)
-    {
-      dir = Tuplet_bracket::get_default_dir (me);
-      set_grob_direction (me, dir);
-    }
-
   bool equally_long = false;
   Grob *par_beam = parallel_beam (me, columns, &equally_long);
 
@@ -625,23 +590,11 @@ Tuplet_bracket::after_line_breaking (SCM smob)
       dy = rp - lp;
     }
 
-  SCM lp = me->get_property ("left-position");
-  SCM rp = me->get_property ("right-position");
-
-  if (scm_is_number (lp) && !scm_is_number (rp))
-    rp = scm_from_double (scm_to_double (lp) + dy);
-  else if (scm_is_number (rp) && !scm_is_number (lp))
-    lp = scm_from_double (scm_to_double (rp) - dy);
-  else if (!scm_is_number (rp) && !scm_is_number (lp))
-    {
-      lp = scm_from_double (offset);
-      rp = scm_from_double (offset + dy);
-    }
-
-  me->set_property ("left-position", lp);
-  me->set_property ("right-position", rp);
-
-  return SCM_UNSPECIFIED;
+  
+  SCM x = scm_cons (scm_from_double (offset),
+                   scm_from_double (offset + dy));
+  
+  return x;
 }
 
 /*
@@ -667,8 +620,6 @@ void
 Tuplet_bracket::add_column (Grob *me, Item *n)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n);
-  me->add_dependency (n);
-
   add_bound_item (dynamic_cast<Spanner *> (me), n);
 }
 
@@ -676,7 +627,6 @@ void
 Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket)
 {
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("tuplets"), bracket);
-  me->add_dependency (bracket);
 }
 
 ADD_INTERFACE (Tuplet_bracket,
@@ -688,18 +638,18 @@ ADD_INTERFACE (Tuplet_bracket,
               "At a line break, the markups in the @code{edge-text} are printed "
               "at the edges. ",
 
-              
+
+              /* properties */
               "bracket-flare "
               "bracket-visibility "
               "break-overshoot "
               "direction "
               "edge-height "
               "edge-text "
-              "left-position "
+              "positions "
               "note-columns "
               "number-visibility "
               "padding "
-              "right-position "
               "shorten-pair "
               "staff-padding "
               "thickness "
index d711396a6f7a6db8ea321b06dc328ec3d60b1096..7e05369f8bf4b03e9a2f605f980b9defdb4a48c7 100644 (file)
@@ -111,8 +111,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
       Grob *before_grob = unsmob_grob (before);
       Grob *after_grob = unsmob_grob (after);
 
-      Align_interface::add_element (valign_, i.grob (),
-                                   get_property ("verticalAlignmentChildCallback"));
+      Align_interface::add_element (valign_, i.grob ());
 
       if (before_grob || after_grob)
        {
index c8e590b0f34d64983bf3421c097b0b2416c5dfee..7d7100e468086b9472c495b52b5c131088e97452 100644 (file)
@@ -50,8 +50,6 @@ Volta_bracket_interface::print (SCM smob)
   Spanner *orig_span = dynamic_cast<Spanner *> (me->original_);
   bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0]
                                            == (Spanner *)me);
-
-
   
   Output_def *layout = me->get_layout ();
   Real half_space = 0.5;
index 5282fc5104af9c14eae6ae1a7da7eccff59b3173..f6a04fa110a8f7d785a72720ec6d99a6ea8a34f0 100644 (file)
@@ -278,7 +278,6 @@ contained staves are not connected vertically."
   "Just like @code{GrandStaff} but with a forced distance between
     the staves, so cross staff beaming and slurring can be used."
   
-  verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback
   \override VerticalAlignment #'forced-distance = #12
   \override VerticalAlignment #'self-alignment-Y = #0
   \override VerticalAlignment #'after-line-breaking-callback
@@ -489,8 +488,6 @@ AncientRemoveEmptyStaffContext = \context {
   autoBeamCheck = #default-auto-beam-check
   scriptDefinitions = #default-script-alist
 
-  verticalAlignmentChildCallback = #Align_interface::alignment_callback
-
   pedalSustainStrings = #'("Ped." "*Ped." "*")
   pedalSustainStyle = #'text
   pedalUnaCordaStrings = #'("una corda" "" "tre corde")
index 73c6b0d63043396673fd0db8e5d5c0297eece12e..95255d7895dc59e5abfc813abdac327655487d35 100644 (file)
@@ -422,9 +422,6 @@ context Voice \\times 2/3 @{
      (useBassFigureExtenders ,boolean? "Whether to use extender lines
 for repeated bass figures")
 
-     (verticalAlignmentChildCallback ,procedure? "What callback to add
-to children of a vertical alignment.  It determines what
-procedure is used on the alignment itself.")
      (verticalExtent ,number-pair? "Hard coded vertical extent.  The format
 is a pair of dimensions, for example, this sets the sizes of a staff
 to 10 (5+5) staffspaces high.
index fe7c4f39ceb98cd76b210a14e873a07feadc56fb..9a0ade0fd89bf999ff11788cf5dba9c80e149821 100644 (file)
@@ -131,6 +131,10 @@ middle C.")
      (cautionary-style ,symbol? "How to print cautionary
 accidentals. Choices are @code{smaller} or
 @code{parentheses}.")
+     (callbacks ,list? "An alist of (@var{symbol} . @var{procedure})
+pairs.  When the grob property @var{symbol} is requested,
+@var{procedure} is invoked. The return value, if it is unequal to
+@code{#<unspecified>} is recorded as the value of the property.") 
      (cautionary ,boolean? "Is this a cautionary accidental?")
      (concaveness ,number? "A beam is concave when its inner stems are
 closer to the beam than the two outside stems. This number is a
@@ -298,7 +302,6 @@ objects in higher layers.")
                            "The thickness of ledger lines: it is the
 sum of 2 numbers.  The first is the factor for line thickness, and the
 second for staff space. Both contributions are added.")
-     (left-position ,number? "Vertical position of left part of spanner.")
      (left-padding ,ly:dimension? "The amount of space that is put
 left to a group of accidentals.")
      (length ,ly:dimension? "User override for the stem length of
@@ -382,7 +385,6 @@ quicker the slur attains it @code{height-limit}.")
      (remove-first ,boolean? "Remove the first staff of a orchestral score?")
      (right-padding ,ly:dimension? "Space to insert between note and
 accidentals.")
-     (right-position ,number? "Vertical position of right part of spanner.")
      (script-priority ,number? "A sorting key that determines in what
 order a script is within a stack of scripts.")
 
@@ -552,8 +554,6 @@ bounds are spaced.")
      (columns ,ly:grob-array? "list of grobs, typically containing
 paper-columns or note-column objects.")
      (conditional-elements ,ly:grob-array? "Internal use only")
-     (dependencies ,ly:grob-array? "list of score-grob pointers that indicate
-who to compute first for certain global passes.")
      (encompass-objects ,ly:grob-array? "Objects that a slur should avoid
 in addition to notes and stems.")
      (elements ,ly:grob-array? "list of grobs, type depending on the Grob
index 6f2a5337ebc1292e43892b4bff5bf90f12584186..2ed04b566888ee36c08848d99570aaba848fe450 100644 (file)
@@ -49,7 +49,8 @@
     (AccidentalPlacement
      . ((X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (left-padding . 0.2)
-
+       (callbacks . ((positioning-done . ,Accidental_placement::calc_positioning_done)
+                     ))
        ;; this is quite small, but it is very ugly to have
        ;; accs closer to the previous note than to the next one.
        (right-padding . 0.15)
      . (
        (axes . (,Y))
        (threshold . (2 . 1000))
+       (callbacks . ((positioning-done . ,Align_interface::calc_positioning_done)
+                     ))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
        (stacking-dir . -1)
        (meta . ((class . Spanner)
        ;; rather long.
        (print-function . ,Beam::print)
        (gap . 0.8)
-       (positions . (#f . #f))
        (position-callbacks . (,Beam::least_squares
                               ,Beam::check_concave
                               ,Beam::slope_damping
                               ,Beam::shift_region_to_valid
                               ,Beam::quanting))
+       (callbacks . ((positions . ,Beam::calc_positions)
+                     (direction . ,Beam::calc_direction)
+                     ))
 
        ;; TODO: should be in SLT.
        (thickness . 0.48) ; in staff-space
-       (before-line-breaking-callback . ,Beam::before_line_breaking)
-       (after-line-breaking-callback . ,Beam::after_line_breaking)
+;      (before-line-breaking-callback . ,Beam::before_line_breaking)
+;      (after-line-breaking-callback . ,Beam::after_line_breaking)
        (neutral-direction . -1)
        (dir-function . ,beam-dir-majority-median)
 
      . (
        (breakable . #t)
        (stacking-dir . 1)
+       (callbacks . ((positioning-done . ,Break_align_interface::calc_positioning_done)
+                     ))
        (break-align-orders . ;; end of line
                            #((instrument-name
                               left-edge
     (BreakAlignGroup
      . (
        (axes . (0))
-       (X-offset-callbacks . (,Break_align_interface::alignment_callback))
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
      . (
        (axes . (0))
        (direction . ,RIGHT)
+       (callbacks . ((positioning-done . ,Dot_column::calc_positioning_done) 
+                      ))
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (X-offset-callbacks . (,Dot_column::side_position))
        (meta . ((class . Item)
                                break-aligned-interface))))))
     (LaissezVibrerTie
      . (
-       (print-function  . ,Laissez_vibrer_tie::print)
+       (print-function  . ,Tie::print)
+       (callbacks . ((control-points . ,Laissez_vibrer_tie::calc_control_points)
+                     (direction . ,Laissez_vibrer_tie::calc_direction)
+                     ))
        (details . ((ratio . 0.333)
                    (height-limit . 1.0)))
        (thickness . 1.0)
      . (
        (X-extent-callback . #f)
        (Y-extent-callback . #f)
+       (callbacks . ((positioning-done . ,Laissez_vibrer_tie_column::calc_positioning_done)
+                     ))
        (meta . ((class . Item)
                 (interfaces . (laissez-vibrer-tie-column-interface))
                 ))
     (LigatureBracket
      . (
        (ligature-primitive-callback . ,Note_head::print)
+       
+       ;; ugh.  A ligature bracket is totally different from
+       ;; a tuplet bracket.
+       (callbacks . ((direction  . ,Tuplet_bracket::calc_direction)
+                     (positions . ,Tuplet_bracket::calc_positions)
+                     ))
        (direction . 1)
        (gap . 0.0)
        (padding . 2.0)
        (thickness . 1.6)
        (edge-height . (0.7 . 0.7))
        (shorten-pair . (-0.2 . -0.2))
-       (before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking)
-       (after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking)
        (print-function . ,Tuplet_bracket::print)
        (meta . ((class . Spanner)
                 (interfaces . (tuplet-bracket-interface
        (axes . (0 1))
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+       (callbacks . ((positioning-done . ,Note_collision_interface::calc_positioning_done)
+                     ))
        (meta . ((class . Item)
                 (interfaces . (note-collision-interface
                                axis-group-interface))))))
        (ligature-primitive-callback . ,Note_head::print)
        (glyph-name-procedure . ,find-notehead-symbol)
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+       (X-offset-callbacks . (,Note_head::stem_x_shift))
        (stem-attachment-function . ,note-head-style->attachment-coordinates)
        (meta . ((class . Item)
                 (interfaces . (rhythmic-grob-interface
 
     (PhrasingSlur
      . ((slur-details . ,default-slur-details)
+       (callbacks . ((control-points . ,Slur::calc_control_points)
+                     (direction . ,Slur::calc_direction)
+                      ))
        (print-function . ,Slur::print)
        (thickness . 1.1)
        (spacing-procedure . ,Spanner::set_spacing_rods)
        (minimum-length . 1.5)
-       (after-line-breaking-callback . ,Slur::after_line_breaking)
        (Y-extent-callback . ,Slur::height)
        (height-limit . 2.0)
        (ratio . 0.333)
     (RestCollision
      . (
        (minimum-distance . 0.75)
+       (callbacks .  ((positioning-done . ,Rest_collision::calc_positioning_done)
+                      ))
        (meta . ((class . Item)
                 (interfaces . (rest-collision-interface))))))
 
 
     (Slur
      . ((slur-details . ,default-slur-details)
+       (callbacks . ((control-points . ,Slur::calc_control_points)
+                     (direction . ,Slur::calc_direction)
+                      ))
        (print-function . ,Slur::print)
        (thickness . 1.0)
        (spacing-procedure . ,Spanner::set_spacing_rods)
        (minimum-length . 1.5)
-       (after-line-breaking-callback . ,Slur::after_line_breaking)
        (Y-extent-callback . ,Slur::height)
                                        ; Slur::height)
        (height-limit . 2.0)
     (Stem
      . (
        ;; this list is rather long. Trim --hwn
-       (before-line-breaking-callback . ,Stem::before_line_breaking)
+       (callbacks . ((direction . ,Stem::calc_direction)
+                     (stem-end-position . ,Stem::calc_stem_end_position)
+                     (stem-info . ,Stem::calc_stem_info)
+                     (positioning-done . ,Stem::calc_positioning_done)
+                     ))
        (print-function . ,Stem::print)
        (thickness . 1.3)
 
 
     (Tie
      . ((print-function . ,Tie::print)
+       (callbacks . ((control-points . ,Tie::calc_control_points)
+                     (direction . ,Tie::calc_direction)
+                     ))
        (details . ((ratio . 0.333)
                    (height-limit . 1.0)
                    (between-length-limit . 1.0)))
 
     (TieColumn
      . (
-       (after-line-breaking-callback . ,Tie_column::after_line_breaking)
+       (callbacks . ((positioning-done . ,Tie_column::calc_positioning_done)
+                     ))
        (before-line-breaking-callback . ,Tie_column::before_line_breaking)
        (X-extent-callback . #f)
        (Y-extent-callback . #f)
+       
        (meta . ((class . Spanner)
                 (interfaces . (tie-column-interface))))))
 
        (thickness . 1.6)
        (edge-height . (0.7 . 0.7))
        (shorten-pair . (-0.2 . -0.2))
-       (before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking)
-       (after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking)
+       (callbacks . ((direction  . ,Tuplet_bracket::calc_direction)
+                     (positions . ,Tuplet_bracket::calc_positions)
+                     ))
        (print-function . ,Tuplet_bracket::print)
        (font-shape . italic)
 
     (VerticalAlignment
      . (
        (axes . (1))
+       (callbacks . ((positioning-done . ,Align_interface::calc_positioning_done)
+                     ))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (stacking-dir . -1)
index cf1e1082cf20a1a058c44088f13a99e992f22d02..9b93992e24ea720a6327139c620957e1339fe2f9 100644 (file)
@@ -71,7 +71,6 @@ similar to chord syntax")
       (debug-enable 'backtrace)
       (read-enable 'positions)))
 
-
 (define-public tex-backend?
   (member (ly:output-backend) '("texstr" "tex")))
 
index d30c668bf3b591344c893a07be2ee0400382c6fb..ea58c353fb423db5aec88de6bad64c855faa8ae0 100644 (file)
@@ -280,7 +280,7 @@ i.e.  this is not an override"
 
 (define-public (make-grob-property-revert grob gprop)
   "Revert the grob property GPROP for GROB."
-  (make-music 'OverrideProperty
+  (make-music 'RevertProperty
              'symbol grob
              'grob-property gprop))
 
index fc483d2f57301e854487d3991a970998ee067b2e..3ab99b4988e64feff8b9e369f892fac95ae89632 100644 (file)
    ;;$defaultmidi
    ;;$defaultlayout
 
-   Accidental_interface::after_line_breaking
    Accidental_interface::print
    Ambitus::print
    Arpeggio::print
    Arpeggio::brew_chord_bracket
    Arpeggio::width_callback
    Axis_group_interface::group_extent_callback
-   Bar_line::before_line_breaking
    Bar_line::get_staff_bar_size
    Bar_line::print
-   Beam::after_line_breaking
-   Beam::before_line_breaking
-   Beam::check_concave
-   Beam::least_squares
-   Beam::print
-   Beam::quanting
-   Beam::shift_region_to_valid
-   Beam::slope_damping
-   Beam::space_function
-   Break_align_interface::alignment_callback
    Breathing_sign::offset_callback
-   Chord_name::after_line_breaking
-   Clef::before_line_breaking
    Clef::print
    Cluster::print
    Cluster_beacon::height
    Hyphen_spanner::print
    Hyphen_spanner::set_spacing_rods
    Key_signature_interface::print
-   Line_spanner::after_line_breaking
    Line_spanner::print
    Lyric_extender::print
    Measure_grouping::print
    Note_head::print
    Note_head::brew_ez_stencil
    Ottava_bracket::print
-   Paper_column::before_line_breaking
    Paper_column::print
    Percent_repeat_item_interface::beat_slash
    Percent_repeat_item_interface::double_percent
    Piano_pedal_bracket::print
-   Rest::after_line_breaking
    Rest::extent_callback
    Rest::polyphonic_offset_callback
    Rest::print
-   Script_column::before_line_breaking
-   Script_interface::before_line_breaking
    Script_interface::print
    Self_alignment_interface::aligned_on_parent
    Self_alignment_interface::aligned_on_self
    Separating_group_spanner::set_spacing_rods
    Side_position_interface::aligned_on_support_refpoints
    Side_position_interface::aligned_side
-   Slur::after_line_breaking
    Slur::height
    Slur::print
    Spacing_spanner::set_springs
-   Span_bar::before_line_breaking
    Span_bar::get_bar_size
    Span_bar::print
    Span_bar::width_callback
    Spanner::set_spacing_rods
    Staff_symbol::print
    Staff_symbol_referencer::callback
-   Stem::before_line_breaking
    Stem::width_callback
    Stem::height
    Stem::offset_callback
    Stem_tremolo::height
    Stem_tremolo::print
    Sustain_pedal::print
-   System_start_delimiter::after_line_breaking
    System_start_delimiter::print
    Text_interface::print
    Text_spanner::print
    Tie::print
-   Tie_column::after_line_breaking
    Time_signature::print
-   Tuplet_bracket::after_line_breaking
-   Tuplet_bracket::before_line_breaking
    Tuplet_bracket::print
    Vaticana_ligature::brew_ligature_primitive
    Vaticana_ligature::print