]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-ps.scm
* ps/music-drawing-routines.ps: new routine: insert PDF mark
[lilypond.git] / scm / output-ps.scm
index f682173e3aa3c513af79b34abed448e41ad62d7e..7694e0a3862acd566e9b03aa02106651cf0ab047 100644 (file)
        x-y-named-glyphs))
   ))
 
-(define (grob-cause grob)
-  "")
+(define (grob-cause offset grob)
+  (let* ((cause (ly:grob-property grob 'cause))
+        (music-origin (if (ly:music? cause)
+                          (ly:music-property cause 'origin)))
+        (location (if (ly:input-location? music-origin)
+                      (ly:input-file-line-column music-origin)
+                      #f
+                      ))
+        (x-ext (ly:grob-extent grob grob X)) 
+        (y-ext (ly:grob-extent grob grob Y)) 
+        )
+
+    (if location
+       (format "~a ~a ~a ~a (lily-edit.sh ~a ~a ~a) mark_file_line\n"
+               (+ (car offset) (car x-ext))
+               (+ (cdr offset) (car y-ext))
+               (+ (car offset) (cdr x-ext))
+               (+ (cdr offset) (cdr y-ext))
+               (car location)
+               (cadr location)
+               (caddr location))
+       "")))
 
 ;; WTF is this in every backend?
 (define (horizontal-line x1 x2 th)