]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-ps.scm
Issue 1954: Implement event type filtering for pointAndClick events.
[lilypond.git] / scm / output-ps.scm
index f20c42f1e1012cea4bd2d7b6142f93d5b3aecbf8..3e376bbe672186e6f3bf35b69d59a3607d3d0f42 100644 (file)
   (if (ly:get-option 'point-and-click)
       (let* ((cause (ly:grob-property grob 'cause))
             (music-origin (if (ly:stream-event? cause)
-                              (ly:event-property cause 'origin))))
-       (if (ly:input-location? music-origin)
+                              (ly:event-property cause 'origin)))
+            (point-and-click (ly:get-option 'point-and-click)))
+       (if (and
+            (ly:input-location? music-origin)
+            (cond ((boolean? point-and-click) point-and-click)
+                  ((symbol? point-and-click)
+                   (ly:in-event-class? cause point-and-click))
+                  (else (any (lambda (t)
+                               (ly:in-event-class? cause t))
+                             point-and-click))))
            (let* ((location (ly:input-file-line-char-column music-origin))
                   (raw-file (car location))
                   (file (if (is-absolute? raw-file)
             (cdr y)
             url))
 
+(define (page-link page-no x y)
+  (if (number? page-no)
+    (ly:format "~a ~a currentpoint vector_add  ~a ~a currentpoint vector_add ~a mark_page_link"
+              (car x)
+              (car y)
+              (cdr x)
+              (cdr y)
+              page-no)
+    ""))
+
 (define* (path thickness exps #:optional (cap 'round) (join 'round) (fill? #f))
   (define (convert-path-exps exps)
     (if (pair? exps)