/usr/share/lilypond/2.18.2/scm/output-socket.scm is in lilypond-data 2.18.2-4.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | ;;;; output-socket.scm
;;;;
;;;; implement network-based output (socket) in Scheme
(define-module (scm output-socket)
#:re-export (quote))
(use-modules (guile)
(srfi srfi-1)
(srfi srfi-13)
(lily))
(define format ergonomic-simple-format)
(define (event-cause grob)
(let*
((cause (ly:grob-property grob 'cause)))
(if (ly:stream-event? cause)
cause
#f)))
(define (grob-bbox grob offset)
(let*
((x-ext (ly:grob-extent grob grob X))
(y-ext (ly:grob-extent grob grob Y))
(x (car offset))
(y (cdr offset)))
(if (interval-empty? x-ext)
(set! x-ext '(0 . 0)))
(if (interval-empty? y-ext)
(set! y-ext '(0 . 0)))
(list (+ x (car x-ext))
(+ y (car y-ext))
(+ x (cdr x-ext))
(+ y (cdr y-ext)))))
(define (escape-string str)
(string-regexp-substitute
" " "\\040"
(string-regexp-substitute "\"" "\\\"" str)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; stencil commands
;;;
(define (draw-line thick x1 y1 x2 y2)
(format #f "drawline ~a ~a ~a ~a ~a"
thick x1 y2 x2 y2))
(define (grob-cause offset grob)
(let*
((cause (event-cause grob))
(tag (if (and cause (integer? (ly:event-property cause 'input-tag)))
(ly:event-property cause 'input-tag)
-1))
(name (assoc-get 'name (ly:grob-property grob 'meta))))
(apply format #f
"cause ~a \"~a\" ~a ~a ~a ~a\n" tag name
(grob-bbox grob offset))))
(define (named-glyph font glyph)
(format #f "glyphshow ~a \"~a\" ~a \"~a\""
(ly:font-glyph-name-to-charcode font glyph)
(ly:font-name font)
(modified-font-metric-font-scaling font)
glyph))
(define (no-origin)
"nocause\n")
(define (placebox x y s)
(if (not (string-null? s))
(format #f "at ~a ~a ~a\n" x y s)
""))
(define (polygon xy-coords blot do-fill)
(format #f "polygon ~a ~a ~a"
blot
(if do-fill "True" "False")
(string-join (map number->string xy-coords))))
(define (round-filled-box breapth width depth height blot-diameter)
(format #f "draw_round_box ~a ~a ~a ~a ~a"
breapth width depth height blot-diameter))
(define (utf-8-string descr string)
(format #f "utf-8 \"~a\" \"~a\""
(escape-string descr)
;; don't want unescaped spaces.
(escape-string string)))
|