]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 1954: Implement event type filtering for pointAndClick events.
authorDavid Kastrup <dak@gnu.org>
Tue, 1 Nov 2011 19:55:04 +0000 (20:55 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 7 Nov 2011 04:35:04 +0000 (05:35 +0100)
input/regression/point-and-click-types.ly [new file with mode: 0644]
lily/include/main.hh
lily/main.cc
lily/program-option-scheme.cc
ly/property-init.ly
scm/output-ps.scm

diff --git a/input/regression/point-and-click-types.ly b/input/regression/point-and-click-types.ly
new file mode 100644 (file)
index 0000000..f9a2058
--- /dev/null
@@ -0,0 +1,7 @@
+\version "2.15.17"
+
+\pointAndClickTypes #'note-event
+
+\relative c' {
+  c2\f( f)
+}
\ No newline at end of file
index 7c21437b809581b791ecde72541ed4f34d7b15d4..a9b827ef75d140098a0b036782bb8ee88dac48c8 100644 (file)
@@ -43,7 +43,6 @@ extern string output_backend_global;
 extern string output_name_global;
 extern bool be_safe_global;
 extern bool do_internal_type_checking_global;
-extern bool point_and_click_global;
 extern string lilypond_datadir;
 extern bool use_object_keys;
 extern bool strict_infinity_checking;
index 5b5ea18d08e2c127db537aa041c0600e9914750e..3bb602ac230dcfd7c3fd005509c05470a3d2749f 100644 (file)
@@ -74,9 +74,6 @@ string output_name_global;
 /* Run in safe mode? */
 bool be_safe_global = false;
 
-/* Provide URI links to the original file */
-bool point_and_click_global = true;
-
 /* Scheme code to execute before parsing, after .scm init.
    This is where -e arguments are appended to.  */
 string init_scheme_code_global;
index 0a6c3a80dc66ba006772271da0ebb3060e5bad18..2c3d60dc8792ebf0f34d9ca01a55f0c7b17e0c82 100644 (file)
@@ -65,11 +65,6 @@ internal_set_option (SCM var,
       profile_property_accesses = valbool;
       val = val_scm_bool;
     }
-  else if (varstr == "point-and-click")
-    {
-      point_and_click_global = valbool;
-      val = val_scm_bool;
-    }
   else if (varstr == "protected-scheme-parsing")
     {
       parse_protect_global = valbool;
index 2de518fb461e706e684b950baabf79e1eec60a7c..60232edce0cd2e7462085b95c2f6e5755297b2dd 100644 (file)
@@ -343,6 +343,10 @@ back to the lilypond source statement.")
    (ly:set-option 'point-and-click #f)
    (make-music 'SequentialMusic 'void #t))
 
+pointAndClickTypes =
+#(define-void-function (parser location types) (list-or-symbol?)
+  (_i "Set a type or list of types (such as @code{#'note-event}) for which point-and-click info is generated.")
+  (ly:set-option 'point-and-click types))
 
 %% predefined fretboards
 
index c83b613cbd1ceca68b2157886cb05fb0b5bfa393..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)