]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
Doc-es: various updates.
[lilypond.git] / lily / grob.cc
index 2f1bd8aa9f52c463c274fa28ab6fe2fc60227d03..924c80e500221b2d7bcfc2a8fab0102fea2a7c3c 100644 (file)
@@ -146,25 +146,15 @@ Grob::get_print_stencil () const
       /* whiteout background and larger file sizes with \pointAndClickOn. */
       /* A grob has to be visible, otherwise the whiteout property has no effect. */
       /* Calls the scheme procedure stencil-whiteout in scm/stencils.scm */
-      if (!transparent && (scm_is_number (get_property("whiteout"))
+      if (!transparent && (scm_is_number (get_property ("whiteout"))
                            || to_boolean (get_property ("whiteout"))))
         {
-          Real thickness = robust_scm2double (get_property("whiteout"), 3.0)
-               * layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
+          Real line_thickness = layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
           retval = *unsmob<Stencil>
             (Lily::stencil_whiteout (retval.smobbed_copy (),
-                                     scm_from_double (thickness)));
-        }
-
-      /* Calls the scheme procedure stencil-whiteout-box in scm/stencils.scm */
-      if (!transparent && (scm_is_number (get_property("whiteout-box"))
-                           || to_boolean (get_property ("whiteout-box"))))
-        {
-          Real thickness = robust_scm2double (get_property("whiteout-box"), 0.0)
-               * layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
-          retval = *unsmob<Stencil>
-            (Lily::stencil_whiteout_box (retval.smobbed_copy (),
-                                     scm_from_double (thickness)));
+                                     get_property ("whiteout-style"),
+                                     get_property ("whiteout"),
+                                     scm_from_double (line_thickness)));
         }
 
       if (transparent)
@@ -199,11 +189,11 @@ Grob::get_print_stencil () const
           retval = Stencil (retval.extent_box (), expr);
         }
 
-      SCM id = get_property ("id");
-      if (scm_is_string (id))
+      SCM attributes = get_property ("output-attributes");
+      if (scm_is_pair (attributes))
         {
-          SCM expr = scm_list_3 (ly_symbol2scm ("id"),
-                                 id,
+          SCM expr = scm_list_3 (ly_symbol2scm ("output-attributes"),
+                                 attributes,
                                  retval.expr ());
 
           retval = Stencil (retval.extent_box (), expr);
@@ -343,18 +333,21 @@ Real
 Grob::relative_coordinate (Grob const *refp, Axis a) const
 {
   /* eaa - hmmm, should we do a programming_error() here? */
-  if ((this == NULL) || (refp == this))
+  if (refp == this)
     return 0.0;
 
   /* We catch PARENT_L_ == nil case with this, but we crash if we did
      not ask for the absolute coordinate (ie. REFP == nil.)  */
-  Real off = get_offset (a);
-  if (refp == dim_cache_[a].parent_)
-    return off;
 
-  off += dim_cache_[a].parent_->relative_coordinate (refp, a);
+  return get_offset (a) + parent_relative (refp, a);
+}
 
-  return off;
+Real
+Grob::parent_relative (Grob const *refp, Axis a) const
+{
+  if (Grob *p = get_parent (a))
+    return p->relative_coordinate (refp, a);
+  return 0.0;
 }
 
 Real
@@ -823,16 +816,17 @@ ADD_INTERFACE (Grob,
                "cause "
                "color "
                "cross-staff "
-               "id "
                "extra-offset "
                "footnote-music "
                "forced-spacing "
                "horizontal-skylines "
+               "id "
                "interfaces "
                "layer "
                "meta "
                "minimum-X-extent "
                "minimum-Y-extent "
+               "output-attributes "
                "parenthesis-friends "
                "pure-Y-offset-in-progress "
                "rotation "
@@ -843,7 +837,7 @@ ADD_INTERFACE (Grob,
                "transparent "
                "vertical-skylines "
                "whiteout "
-               "whiteout-box "
+               "whiteout-style "
               );
 
 /****************************************************************