From 2a4d7df6e50f62cb03dc133fc9fb92b6806fa7c7 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 26 Feb 2005 23:09:44 +0000 Subject: [PATCH] * ps/music-drawing-routines.ps: new routine: insert PDF mark * scm/output-ps.scm (grob-cause): point & click support for PostScript --- ChangeLog | 15 +++++++++++++ Documentation/user/changing-defaults.itely | 4 ++-- lily/input-scheme.cc | 5 +---- lily/stencil.cc | 3 ++- ps/music-drawing-routines.ps | 26 ++++++++++++++++++++++ scm/output-ps.scm | 24 ++++++++++++++++++-- scm/output-tex.scm | 2 +- scm/safe-lily.scm | 2 +- 8 files changed, 70 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 114c57bebb..1a5711e0a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-02-27 Han-Wen Nienhuys + + * ps/music-drawing-routines.ps: new routine: insert PDF mark + + * scm/output-ps.scm (grob-cause): point & click support for + PostScript + +2005-02-26 Han-Wen Nienhuys + + * lily/input-scheme.cc (LY_DEFINE): rename to + ly:input-file-line-column + 2005-02-26 Graham Percival * Documentation/user/examples.itely: small fix from Steve Doonan. @@ -19,6 +31,9 @@ 2005-02-26 Han-Wen Nienhuys + * Documentation/user/lilypond-book.itely (Music fragment options): + doc fontload. + * Documentation/user/changing-defaults.itely (Text encoding): add fontload option to utf8 include diff --git a/Documentation/user/changing-defaults.itely b/Documentation/user/changing-defaults.itely index 2f54ed2ec0..10a9df0d3a 100644 --- a/Documentation/user/changing-defaults.itely +++ b/Documentation/user/changing-defaults.itely @@ -1567,7 +1567,7 @@ and Cyrillic lyrics, @cindex Hebrew @cindex ASCII, non -@lilypondfile{utf8.ly} +@lilypondfile[fontload]{utf8.ly} The @TeX{} backend does not handle encoding specially at all. Strings @@ -1593,7 +1593,7 @@ interpreting non-ASCII strings. @seealso -@inputfileref[fontload]{input/regression,utf8.ly} +@inputfileref{input/regression,utf8.ly} @node Nested scores diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index c9f257c5b6..7f2ccf1a02 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -33,10 +33,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg), return SCM_UNSPECIFIED; } -/* - TODO: rename this function. ly:input-location? vs ly:input-location - */ -LY_DEFINE (ly_input_location, "ly:input-location", 1, 0, 0, (SCM sip), +LY_DEFINE (ly_input_file_line_column, "ly:input-file-line-column", 1, 0, 0, (SCM sip), "Return input location in @var{sip} as (file-name line column).") { Input *ip = unsmob_input (sip); diff --git a/lily/stencil.cc b/lily/stencil.cc index 0301cc1f53..688efe2855 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -221,7 +221,8 @@ interpret_stencil_expression (SCM expr, { SCM grob = scm_cadr (expr); - (*func) (func_arg, scm_list_2 (head, grob)); + (*func) (func_arg, scm_list_3 (head, + ly_quote_scm (ly_offset2scm (o)), grob)); interpret_stencil_expression (scm_caddr (expr), func, func_arg, o); (*func) (func_arg, scm_list_1 (ly_symbol2scm ("no-origin"))); return; diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 4ac077c9bb..b54622b3bb 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -3,6 +3,32 @@ % Functions for direct and embedded PostScript +/pdfmark where +{pop} {userdict /pdfmark /cleartomark load put} ifelse + + +% llx lly urx ury command +/mark_file_line +{ + /editorcommand exch def + /ury exch def + /urx exch def + /lly exch def + /llx exch def + [ + /Rect [ llx lly urx ury ] + /Border [ 0 0 0 0 ] + /Action + << + /Subtype /Launch + /File editorcommand + >> + /Subtype /Link + /ANN + pdfmark +} +bind def + /set_tex_dimen { cvr def } bind def diff --git a/scm/output-ps.scm b/scm/output-ps.scm index f682173e3a..7694e0a386 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -207,8 +207,28 @@ 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) diff --git a/scm/output-tex.scm b/scm/output-tex.scm index c0aa31680b..a95e94965e 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -175,7 +175,7 @@ ;; no-origin not yet supported by Xdvi (define (no-origin) "") -(define (grob-cause grob) +(define (grob-cause offset grob) (if (procedure? point-and-click) (let* ((cause (ly:grob-property grob 'cause)) (music-origin (if (ly:music? cause) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index 32adc29083..65484d243c 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -59,7 +59,7 @@ ly:grob-system ly:grob-translate-axis! ly:grob? - ly:input-location + ly:input-file-line-column ly:input-location? ly:input-message ly:intlog2 -- 2.39.2