]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
Merge branch 'master' into translation
[lilypond.git] / scm / output-lib.scm
index 4533cf2a965a8c95eb22b3dcf84d21dc2e5ad8f7..6e2d06a66a81814a7fa711467f3a4e4864ce650d 100644 (file)
@@ -26,9 +26,6 @@
 (define-public (grob::is-live? grob)
   (pair? (ly:grob-basic-properties grob)))
 
-(define-public (grob::x-parent-width grob)
-  (ly:grob-property (ly:grob-parent grob X) 'X-extent))
-
 (define-public (make-stencil-boxer thickness padding callback)
   "Return function that adds a box around the grob passed as argument."
   (lambda (grob)
@@ -478,16 +475,6 @@ and duration-log @var{log}."
 (define-public center-visible          #(#f #t #f))
 (define-public end-of-line-visible     #(#t #f #f))
 (define-public all-invisible           #(#f #f #f))
-(define-public (inherit-x-parent-visibility grob)
-  (let ((parent (ly:grob-parent grob X)))
-    (ly:grob-property parent 'break-visibility all-invisible)))
-(define-public (inherit-y-parent-visibility grob)
-  (let ((parent (ly:grob-parent grob X)))
-    (ly:grob-property parent 'break-visibility)))
-
-
-(define-public spanbar-begin-of-line-invisible #(#t #f #f))
-
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; neighbor-interface routines
@@ -1096,9 +1083,19 @@ and draws the stencil based on its coordinates.
 (define-public ((grob::calc-property-by-copy prop) grob)
   (ly:event-property (event-cause grob) prop))
 
-(define-public ((grob::calc-property-by-non-event-cause prop) grob)
-  (ly:grob-property (non-event-cause grob) prop))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; general inheritance
 
+(define-public ((grob::inherit-parent-property axis property . default) grob)
+  "@var{grob} callback generator for inheriting a @var{property} from
+an @var{axis} parent, defaulting to @var{default} if there is no
+parent or the parent has no setting."
+  (let ((parent (ly:grob-parent grob axis)))
+    (cond
+     ((ly:grob? parent)
+      (apply ly:grob-property parent property default))
+     ((pair? default) (car default))
+     (else '()))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; fret boards
@@ -1283,6 +1280,12 @@ and draws the stencil based on its coordinates.
 (define-public (laissez-vibrer::print grob)
  (ly:tie::print grob))
 
+(define-public (semi-tie::calc-cross-staff grob)
+  (let* ((note-head (ly:grob-object grob 'note-head))
+         (stem (ly:grob-object note-head 'stem)))
+    (and (ly:grob? stem)
+         (ly:grob-property stem 'cross-staff #f))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; volta-bracket