]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
Makes all side-positioning based on skylines instead of boxes.
[lilypond.git] / scm / output-lib.scm
index c6ed83e6e026929d22ab8374794e17ff134f7ce7..c83fd27ed61ec2fdd603b11c3f2a6224b0cbea63 100644 (file)
      ((ly:grob? cause) (event-cause cause))
      (else #f))))
 
+(define-public (non-event-cause grob)
+  (let ((cause (ly:grob-property  grob 'cause)))
+
+    (cond
+     ((ly:stream-event? cause) (non-event-cause cause))
+     ((ly:grob? cause) cause)
+     (else #f))))
+
 (define-public (grob-interpret-markup grob text)
   (let* ((layout (ly:grob-layout grob))
         (defs (ly:output-def-lookup layout 'text-font-defaults))
    (ly:side-position-interface::calc-cross-staff g)))
 
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; side-position stuff
+
+(define-public (only-if-beamed g)
+  (reduce lily-or
+          #f
+          (map (lambda (x)
+                 (ly:grob? (ly:grob-object x 'beam)))
+               (ly:grob-array->list (ly:grob-object g
+                                                    'side-support-elements)))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; note heads
 
@@ -926,6 +945,9 @@ between the two text elements."
 (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))
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; fret boards