;;;; source file of the GNU LilyPond music typesetter
;;;;
;;;; (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
;; (debug-enable 'backtrace)
-;; the public interface is tight.
+;; The public interface is tight.
;; It has to be, because user-code is evalled with this module.
+;; ***It should also be clean, well defined, documented and reviewed***
+
+;; To be reasonably safe, you probably do not want to use the TeX
+;; backend anyway, but rather the PostScript backend. You may want
+;; to run gs in a uml sandbox too.
+
+
(define-module (scm output-tex)
#:re-export (quote)
+
+ ;; JUNK this -- see lily.scm: ly:all-output-backend-commands
#:export (unknown
blank
dot
+ white-dot
beam
bracket
dashed-slur
filledbox
round-filled-box
text
+ white-text
tuplet
polygon
draw-line
- define-origin
no-origin
+ grob-cause
))
(use-modules (ice-9 regex)
(define (dot x y radius)
(embedded-ps (list 'dot x y radius)))
+
+(define (embedded-ps string)
+ (embedded-ps (list 'embedded-ps string)))
+
+(define (white-dot x y radius)
+ (embedded-ps (list 'white-dot x y radius)))
+
(define (beam width slope thick blot)
(embedded-ps (list 'beam width slope thick blot)))
s))
"}")))
-
+(define (white-text scale s)
+ (embedded-ps (list 'white-text scale s)))
+
(define (tuplet ht gapx dx dy thick dir)
(embedded-ps (list 'tuplet ht gapx dx dy thick dir)))
(define (draw-line thick fx fy tx ty)
(embedded-ps (list 'draw-line thick fx fy tx ty)))
-(define (define-origin file line col)
- (if (procedure? point-and-click)
- (string-append "\\special{src:" ;;; \\string ?
- (point-and-click line col file)
- "}" )
- ""))
-
;; no-origin not yet supported by Xdvi
(define (no-origin) "")
+(define (grob-cause grob)
+ (if (procedure? point-and-click)
+ (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-location music-origin))))
+ (if (pair? location)
+ ;;; \\string ?
+ (string-append "\\special{src:"
+ (apply point-and-click location) "}")
+ ""))
+ ""))