]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4540: Rename Grob::pure_height() to pure_y_extent() to avoid
authorDan Eble <nine.fierce.ballads@gmail.com>
Mon, 3 Aug 2015 13:27:21 +0000 (09:27 -0400)
committerDan Eble <nine.fierce.ballads@gmail.com>
Fri, 14 Aug 2015 21:21:18 +0000 (17:21 -0400)
ambiguity with pure_height() callbacks in many grob-interface classes.

This is preparatory to deriving the interface classes from Grob.

15 files changed:
lily/accidental-placement.cc
lily/align-interface.cc
lily/axis-group-interface.cc
lily/flag.cc
lily/grob-scheme.cc
lily/grob.cc
lily/include/grob.hh
lily/include/item.hh
lily/item.cc
lily/note-spacing.cc
lily/separation-item.cc
lily/slur.cc
lily/staff-spacing.cc
lily/stem-tremolo.cc
lily/system.cc

index 3555435bea769a125e38f79d8c420458f40a58bb..32eb54fac7e94c9b915858bb7f33331e334b7d95 100644 (file)
@@ -371,7 +371,7 @@ build_heads_skyline (vector<Grob *> const &heads_and_stems,
   vector<Box> head_extents;
   for (vsize i = heads_and_stems.size (); i--;)
     head_extents.push_back (Box (heads_and_stems[i]->extent (common[X_AXIS], X_AXIS),
-                                 heads_and_stems[i]->pure_height (common[Y_AXIS], 0, INT_MAX)));
+                                 heads_and_stems[i]->pure_y_extent (common[Y_AXIS], 0, INT_MAX)));
 
   return Skyline (head_extents, Y_AXIS, LEFT);
 }
index 32eb1edace843ffd3373afce761c67492d931244..0c140235dc97d044f96f48288d5a92c26547edfc 100644 (file)
@@ -93,7 +93,7 @@ get_skylines (Grob *g,
   else
     {
       assert (a == Y_AXIS);
-      Interval extent = g->pure_height (g, start, end);
+      Interval extent = g->pure_y_extent (g, start, end);
 
       // This is a hack to get better accuracy on the pure-height of VerticalAlignment.
       // It's quite common for a treble clef to be the highest element of one system
index 59d1d6ba24a1f54297b1fe2f9a4505d9ca634e36..4aad5860c7de2e5d9a1d4a0233c8819edfb1ceea 100644 (file)
@@ -284,7 +284,7 @@ Axis_group_interface::adjacent_pure_heights (SCM smob)
 
           if (g->pure_is_visible (start, visibility_end))
             {
-              Interval dims = g->pure_height (common, start, end);
+              Interval dims = g->pure_y_extent (common, start, end);
               if (!dims.is_empty ())
                 {
                   if (rank_span[LEFT] <= start)
@@ -346,7 +346,7 @@ Axis_group_interface::relative_pure_height (Grob *me, int start, int end)
           && !(to_boolean (g->get_property ("cross-staff"))
                && Stem::has_interface (g)))
         {
-          Interval dims = g->pure_height (common, start, end);
+          Interval dims = g->pure_y_extent (common, start, end);
           if (!dims.is_empty ())
             r.unite (dims);
         }
index 1e1ba55ffee9be9dbdfaa0f5710312dc61bc2103..7333bf299fd25c29eb4a28cfb15d39b9f556f56c 100644 (file)
@@ -187,7 +187,7 @@ Flag::internal_calc_y_offset (SCM smob, bool pure)
     = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
 
   Interval stem_extent = pure
-                         ? stem->pure_height (stem, 0, INT_MAX)
+                         ? stem->pure_y_extent (stem, 0, INT_MAX)
                          : stem->extent (stem, Y_AXIS);
 
   return scm_from_double (stem_extent.is_empty ()
index b6d07cb8c4dcbc8d939984d82cc550d30e330a2a..0924b0a58dab8699abde6cc5b2c87b104f86a6a5 100644 (file)
@@ -120,7 +120,7 @@ LY_DEFINE (ly_grob_pure_height, "ly:grob-pure-height",
   if (SCM_UNBNDP (val))
     val = SCM_EOL;
 
-  Interval retval = sc->pure_height (ref, scm_to_int (beg), scm_to_int (end));
+  Interval retval = sc->pure_y_extent (ref, scm_to_int (beg), scm_to_int (end));
 
   return ly_interval2scm (retval);
 }
index d5dcf6794dd90233209e94d924972f8fe5612815..83b78edac4c7db74e6f8ca5a0aaaebedfc600aa0 100644 (file)
@@ -496,7 +496,7 @@ Grob::extent (Grob *refp, Axis a) const
 }
 
 Interval
-Grob::pure_height (Grob *refp, int start, int end)
+Grob::pure_y_extent (Grob *refp, int start, int end)
 {
   SCM iv_scm = get_pure_property ("Y-extent", start, end);
   Interval iv = robust_scm2interval (iv_scm, Interval ());
@@ -518,7 +518,7 @@ Grob::pure_height (Grob *refp, int start, int end)
 Interval
 Grob::maybe_pure_extent (Grob *refp, Axis a, bool pure, int start, int end)
 {
-  return (pure && a == Y_AXIS) ? pure_height (refp, start, end) : extent (refp, a);
+  return (pure && a == Y_AXIS) ? pure_y_extent (refp, start, end) : extent (refp, a);
 }
 
 Interval_t<int>
index 819c86c287af033314adec15a6249e9093ad4868..8b2c4249ea8d91ce8781f44e46538b55308e5cb1 100644 (file)
@@ -148,7 +148,7 @@ public:
   /* extents */
   Interval extent (Grob *refpoint, Axis) const;
   void flush_extent_cache (Axis);
-  virtual Interval pure_height (Grob *refpoint, int start_col, int end_col);
+  virtual Interval pure_y_extent (Grob *refpoint, int start, int end);
   Interval maybe_pure_extent (Grob *refpoint, Axis, bool pure, int start, int end);
 
   /* refpoints */
index 3b13ed8477b804e6a108f5e93e88a345e8a3a5a5..e987d89bcabf81a01164b36e46857e08d310b3fa 100644 (file)
@@ -52,7 +52,7 @@ public:
   virtual Paper_column *get_column () const;
   virtual void handle_prebroken_dependencies ();
   virtual Interval_t<int> spanned_rank_interval () const;
-  virtual Interval pure_height (Grob *ref, int start, int end);
+  virtual Interval pure_y_extent (Grob *ref, int start, int end);
   virtual void cache_pure_height (Interval height);
   DECLARE_GROB_INTERFACE ();
 protected:
index 220176e55b8803fc64e4834309f2e49b354ead97..f90b29d30a78445c0789de622aadd1275d916ca3 100644 (file)
@@ -224,7 +224,7 @@ Item::derived_mark () const
 }
 
 Interval
-Item::pure_height (Grob *g, int start, int end)
+Item::pure_y_extent (Grob *g, int start, int end)
 {
   if (cached_pure_height_valid_)
     return cached_pure_height_ + pure_relative_y_coordinate (g, start, end);
@@ -232,7 +232,7 @@ Item::pure_height (Grob *g, int start, int end)
      assuming that Items' pure_heights do not depend on 'start' or 'end'.
   */
 
-  cache_pure_height (Grob::pure_height (this, start, end));
+  cache_pure_height (Grob::pure_y_extent (this, start, end));
   return cached_pure_height_ + pure_relative_y_coordinate (g, start, end);
 }
 
index fcd1523d2f1d2ba88f5b3ca3b2b04da561ac2847..91859fb6ec692daa1c9e3badce5dcdce3616238d 100644 (file)
@@ -265,7 +265,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
           if (!hp.is_empty ())
             {
               Real ss = Staff_symbol_referencer::staff_space (stem);
-              stem_posns[d] = stem->pure_height (stem, 0, INT_MAX) * (2 / ss);
+              stem_posns[d] = stem->pure_y_extent (stem, 0, INT_MAX) * (2 / ss);
               head_posns[d].unite (hp);
             }
         }
index d0cad83d8ec49bbbf8c7265414ea502edd8a9158..01490fa1a011852e5728ffa05d46d01a545a13a4 100644 (file)
@@ -157,7 +157,7 @@ Separation_item::boxes (Grob *me, Grob *left)
           && !Note_head::has_interface (il))
         continue;
 
-      Interval y (il->pure_height (ycommon, 0, very_large));
+      Interval y (il->pure_y_extent (ycommon, 0, very_large));
       Interval x (il->extent (pc, X_AXIS));
 
       Interval extra_width = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"),
index 93f5492b66f85c7a3d67ce31b7548b049f7e3d09..39059a59b64eef7d5715b368c398cef15e8bfb9e 100644 (file)
@@ -99,7 +99,7 @@ Slur::pure_height (SCM smob, SCM start_scm, SCM end_scm)
 
   for (vsize i = 0; i < encompasses.size (); i++)
     {
-      Interval d = encompasses[i]->pure_height (parent, start, end);
+      Interval d = encompasses[i]->pure_y_extent (parent, start, end);
       if (!d.is_empty ())
         {
           for (DOWN_and_UP (downup))
@@ -271,7 +271,7 @@ Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offs
 
   Real offset = robust_scm2double (offset_scm, 0.0);
   Direction dir = get_grob_direction (script);
-  return scm_from_double (offset + dir * slur->pure_height (slur, start, end).length () / 4);
+  return scm_from_double (offset + dir * slur->pure_y_extent (slur, start, end).length () / 4);
 }
 
 MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1, "");
index c414268f26b6f685c68a8365708123fd9c9a034f..11fb185a877b934364f7a8dcaf28a8f7f7d41fa1 100644 (file)
@@ -55,7 +55,7 @@ Staff_spacing::optical_correction (Grob *me, Grob *g, Interval bar_height)
       Direction d = get_grob_direction (stem);
       if (Stem::is_normal_stem (stem) && d == DOWN)
         {
-          Interval stem_posns = stem->pure_height (stem, 0, INT_MAX);
+          Interval stem_posns = stem->pure_y_extent (stem, 0, INT_MAX);
 
           stem_posns.intersect (bar_height);
 
index 8cb60db0787d8a3e75b9b9dc0840a0d67e4bc993..75d25f43cf4f1d5cc5a4e2f6b26c0b34b4111d89 100644 (file)
@@ -172,7 +172,7 @@ Stem_tremolo::pure_height (SCM smob, SCM, SCM)
   if (!beam)
     return ly_interval2scm (s1.extent (Y_AXIS));
 
-  Interval ph = stem->pure_height (stem, 0, INT_MAX);
+  Interval ph = stem->pure_y_extent (stem, 0, INT_MAX);
   Stem_info si = Stem::get_stem_info (stem);
   ph[-dir] = si.shortest_y_;
   int beam_count = Stem::beam_multiplicity (stem).length () + 1;
@@ -298,16 +298,16 @@ Stem_tremolo::y_offset (Grob *me, bool pure)
 
   if (pure && beam)
     {
-      Interval ph = stem->pure_height (stem, 0, INT_MAX);
+      Interval ph = stem->pure_y_extent (stem, 0, INT_MAX);
       Stem_info si = Stem::get_stem_info (stem);
       ph[-dir] = si.shortest_y_;
 
-      return (ph - dir * max (beam_count, 1) * beam_translation)[dir] - dir * 0.5 * me->pure_height (me, 0, INT_MAX).length ();
+      return (ph - dir * max (beam_count, 1) * beam_translation)[dir] - dir * 0.5 * me->pure_y_extent (me, 0, INT_MAX).length ();
     }
 
   Real end_y
     = (pure
-       ? stem->pure_height (stem, 0, INT_MAX)[dir]
+       ? stem->pure_y_extent (stem, 0, INT_MAX)[dir]
        : stem->extent (stem, Y_AXIS)[dir])
       - dir * max (beam_count, 1) * beam_translation
       - Stem::beam_end_corrective (stem);
index 91e3f0818163f4036eeba3c4f620ed059002d6d7..a511a32b678515d3ccc5dd468a768810d0b7d4b7 100644 (file)
@@ -450,7 +450,7 @@ System::break_into_pieces (vector<Column_x_positions> const &breaking)
 
       int st = Paper_column::get_rank (c[0]);
       int end = Paper_column::get_rank (c.back ());
-      Interval iv (pure_height (this, st, end));
+      Interval iv (pure_y_extent (this, st, end));
       system->set_property ("pure-Y-extent", ly_interval2scm (iv));
 
       system->set_bound (LEFT, c[0]);