]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove last vestiges of SeparationItem.
authorNeil Puttock <n.puttock@gmail.com>
Thu, 8 Apr 2010 23:15:37 +0000 (00:15 +0100)
committerNeil Puttock <n.puttock@gmail.com>
Thu, 8 Apr 2010 23:39:53 +0000 (00:39 +0100)
lily/staff-symbol-engraver.cc
lily/tie.cc
ly/engraver-init.ly
scm/define-grob-properties.scm
scm/define-grobs.scm

index a103eda0b39fe963805833bf249a572c9fc19b69..11f14ea1c6040dbbd5c544a777b9c066a2d0414b 100644 (file)
@@ -58,8 +58,7 @@ Staff_symbol_engraver::Staff_symbol_engraver ()
   finished_span_ = 0;
   first_start_ = true;
   span_ = 0;
-  span_events_[LEFT] = 0;
-  span_events_[RIGHT] = 0;
+  span_events_.set (0, 0);
 }
 
 IMPLEMENT_TRANSLATOR_LISTENER (Staff_symbol_engraver, staff_span);
@@ -70,7 +69,7 @@ Staff_symbol_engraver::listen_staff_span (Stream_event *ev)
   if (d)
     ASSIGN_EVENT_ONCE (span_events_[d], ev);
   else
-    programming_error (_ ("staff-span event has no direction"));
+    programming_error ("staff-span event has no direction");
 }
 
 void
@@ -108,12 +107,12 @@ Staff_symbol_engraver::stop_spanner ()
 
   if (!finished_span_->get_bound (RIGHT))
     finished_span_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
-  
+
   announce_end_grob (finished_span_,
                     span_events_[STOP]
                     ? span_events_[STOP]->self_scm ()
                     : SCM_EOL);
-  
+
   finished_span_ = 0;
 }
 
@@ -122,12 +121,9 @@ Staff_symbol_engraver::stop_translation_timestep ()
 {
   if ((span_events_[START] || first_start_)
       && span_)
-    {
-      first_start_ = false;
-    }
+    first_start_ = false;
 
-  span_events_[START] = 0;
-  span_events_[STOP] = 0;
+  span_events_.set (0, 0);
   stop_spanner ();
 }
 
@@ -145,10 +141,6 @@ Staff_symbol_engraver::finalize ()
 void
 Staff_symbol_engraver::acknowledge_grob (Grob_info s)
 {
-  /*
-    Perhaps should try to take SeparationItem as bound of the staff
-    symbol?
-  */
   if (span_ || finished_span_)
     {
       Spanner *my = span_ ? span_ : finished_span_;
index bf9a4769d426a00b7f072e157aa0ddf143454d4c..563e2ca938873c06e4876586552f81112f2cd207 100644 (file)
@@ -40,7 +40,6 @@
 #include "warn.hh"
 #include "semi-tie-column.hh"
 
-
 bool
 Tie::less (Grob *const &s1, Grob *const &s2)
 {
@@ -57,15 +56,15 @@ Grob *
 Tie::head (Grob *me, Direction d)
 {
   if (is_direction (me->get_property ("head-direction")))
-     {
-       Direction hd = to_dir (me->get_property ("head-direction"));
-       return (hd == d)
-        ? unsmob_grob (me->get_object ("note-head"))
-        : 0;
-     }
-  
-  Item *it = dynamic_cast<Spanner*> (me)->get_bound (d);
+    {
+      Direction hd = to_dir (me->get_property ("head-direction"));
+
+      return (hd == d)
+       ? unsmob_grob (me->get_object ("note-head"))
+       : 0;
+    }
+
+  Item *it = dynamic_cast<Spanner *> (me)->get_bound (d);
   if (Note_head::has_interface (it))
     return it;
   else
@@ -97,10 +96,9 @@ Tie::get_position (Grob *me)
   while (flip (&d) != LEFT);
 
   /*
+    TODO: this is theoretically possible for ties across more than 2
+    systems.. We should look at the first broken copy.
 
-  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 ();
@@ -120,22 +118,22 @@ Tie::get_position (Grob *me)
 Direction
 Tie::get_default_dir (Grob *me)
 {
-  Drul_array<Grob*> stems;
+  Drul_array<Grob *> stems;
   Direction d = LEFT;
   do
     {
       Grob *one_head = head (me, d);
-      if (!one_head && dynamic_cast<Spanner*> (me)) 
-       one_head = Tie::head (dynamic_cast<Spanner*> (me)->broken_neighbor (d), d);
-      
+      if (!one_head && dynamic_cast<Spanner *> (me))
+       one_head = Tie::head (dynamic_cast<Spanner *> (me)->broken_neighbor (d), d);
+
       Grob *stem = one_head ? Rhythmic_head::get_stem (one_head) : 0;
       if (stem)
        stem = Stem::is_invisible (stem) ? 0 : stem;
 
       stems[d] = stem;
     }
-  while (flip (&d)!= LEFT);
-  
+  while (flip (&d) != LEFT);
+
   if (stems[LEFT] && stems[RIGHT])
     {
       if (get_grob_direction (stems[LEFT]) == UP
@@ -149,10 +147,9 @@ Tie::get_default_dir (Grob *me)
     }
   else if (int p = get_position (me))
     return Direction (sign (p));
-  
-  return to_dir (me->get_property("neutral-direction"));
-}
 
+  return to_dir (me->get_property ("neutral-direction"));
+}
 
 MAKE_SCHEME_CALLBACK (Tie, calc_direction, 1);
 SCM
@@ -161,7 +158,7 @@ Tie::calc_direction (SCM smob)
   Grob *me = unsmob_grob (smob);
   Grob *yparent = me->get_parent (Y_AXIS);
   if ((Tie_column::has_interface (yparent)
-       || Semi_tie_column::has_interface (yparent)) 
+       || Semi_tie_column::has_interface (yparent))
       && unsmob_grob_array (yparent->get_object ("ties"))
       //      && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1
       )
@@ -175,26 +172,24 @@ Tie::calc_direction (SCM smob)
     return scm_from_int (Tie::get_default_dir (me));
 }
 
-
 SCM
 Tie::get_default_control_points (Grob *me_grob)
 {
-  Spanner *me = dynamic_cast<Spanner*> (me_grob);
-  Grob *common  = me;
-  common = me->get_bound (LEFT)->common_refpoint (common, X_AXIS); 
-  common = me->get_bound (RIGHT)->common_refpoint (common, X_AXIS); 
-  
+  Spanner *me = dynamic_cast<Spanner *> (me_grob);
+  Grob *common = me;
+  common = me->get_bound (LEFT)->common_refpoint (common, X_AXIS);
+  common = me->get_bound (RIGHT)->common_refpoint (common, X_AXIS);
+
   Tie_formatting_problem problem;
   problem.from_tie (me);
-  
+
   Tie_specification spec = problem.get_tie_specification (0);
   if (!me->is_live ())
     return SCM_EOL;
 
-  
   Ties_configuration conf
     = problem.generate_optimal_configuration ();
-  
+
   return get_control_points (me, problem.common_x_refpoint (),
                             conf[0], problem.details_);
 }
@@ -203,8 +198,7 @@ SCM
 Tie::get_control_points (Grob *me,
                         Grob *common,
                         Tie_configuration const &conf,
-                        Tie_details const &details
-                        )
+                        Tie_details const &details)
 {
   Bezier b = conf.get_transformed_bezier (details);
   b.translate (Offset (- me->relative_coordinate (common, X_AXIS), 0));
@@ -227,39 +221,36 @@ Tie::calc_control_points (SCM smob)
 
   Grob *yparent = me->get_parent (Y_AXIS);
   if ((Tie_column::has_interface (yparent)
-       || Semi_tie_column::has_interface (yparent)) 
+       || Semi_tie_column::has_interface (yparent))
       && unsmob_grob_array (yparent->get_object ("ties")))
     {
       extract_grob_set (yparent, "ties", ties);
-      if (me->original() && ties.size() == 1
+      if (me->original () && ties.size () == 1
          && !to_dir (me->get_property_data ("direction")))
        {
          assert (ties[0] == me);
          set_grob_direction (me, Tie::get_default_dir (me));
-           
-       }      
+       }
       /* trigger positioning. */
       (void) yparent->get_property ("positioning-done");
     }
 
   SCM cp = me->get_property_data ("control-points");
   if (!scm_is_pair (cp))
-    {
-      cp = get_default_control_points (me);
-    }
+    cp = get_default_control_points (me);
 
   return cp;
 }
 
 /*
   TODO: merge with Slur::print.
- */
+*/
 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);
@@ -278,9 +269,9 @@ Tie::print (SCM smob)
 
   SCM dash_definition = me->get_property ("dash-definition");
   a = Lookup::slur (b,
-                   get_grob_direction (me) * base_thick,
+                   get_grob_direction (me) * base_thick,
                    line_thick,
-                    dash_definition);
+                   dash_definition);
 
 #if DEBUG_TIE_SCORING
   SCM annotation = me->get_property ("annotation");
@@ -305,7 +296,7 @@ Tie::print (SCM smob)
       /*
        It would be nice if we could put this in a different layer,
        but alas, this must be done with a Tie override.
-       */
+      */
       a.add_stencil (tm);
     }
 #endif
@@ -315,24 +306,18 @@ Tie::print (SCM smob)
 
 ADD_INTERFACE (Tie,
               "A horizontal curve connecting two noteheads.",
-              
+
               /* properties */
               "annotation "
               "avoid-slur "    //  UGH.
               "control-points "
-               "dash-definition "
+              "dash-definition "
               "details "
               "direction "
               "head-direction "
               "line-thickness "
               "neutral-direction "
               "quant-score "
-              "separation-item "
               "staff-position "
               "thickness "
               );
-
-
-
-
-
index ee723dc0e1e67947316f5e725543263897b8f1b1..81b6c8861aa6cebab34d1d906ea1438722288843 100644 (file)
@@ -407,7 +407,6 @@ printing of a single line of lyrics."
   \override VerticalAxisGroup #'inter-staff-spacing = #'((space . 5.5) (stretchability . 1) (padding . 0.5))
   \override VerticalAxisGroup #'inter-loose-line-spacing = #'((space . 0) (stretchability . 0) (padding . 0.2))
   \override VerticalAxisGroup #'non-affinity-spacing #'padding = #1.0
-  \override SeparationItem #'padding = #0.2
   \override InstrumentName #'self-alignment-Y = ##f
 
   %% sync with define-grobs.scm ;
index 72f6894703d6a1ee6e80e5b01e793b67f75a0188..cfa8726c48079a75b4064fe2af06c720e6c18b40 100644 (file)
@@ -963,8 +963,6 @@ relevant for finding the @code{pure-Y-extent}.")
      (right-items ,ly:grob-array? "DOCME")
      (right-neighbor ,ly:grob? "See @code{left-neighbor}.")
 
-     (separation-item ,ly:grob? "A pointer to a @code{SeparationItem}
-object.")
      (side-support-elements ,ly:grob-array? "The side support, an array of
 grobs.")
      (slur ,ly:grob? "A pointer to a @code{Slur} object.")
index 8251fec8192086a91a9bd347105376c4de17856f..176debd52320ba8bfb08e981da3ce84d5a34792b 100644 (file)
        (meta . ((class . Item)
                 (interfaces . (script-column-interface))))))
 
-    (SeparationItem
-     . (
-       (avoid-slur . inside)
-       (horizontal-skylines . ,ly:separation-item::calc-skylines)
-       (stencil . ,ly:separation-item::print)
-       (X-extent . ,ly:axis-group-interface::width)
-       (Y-extent . ,ly:axis-group-interface::height)
-       (meta . ((class . Item)
-                (interfaces . (separation-item-interface))))))
-
     (Slur
      . (
        (avoid-slur . inside)