/usr/share/lilypond/2.14.2/scm/framework-socket.scm is in lilypond-data 2.14.2-4.
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 | ;;;; framework-socket.scm
(define-module (scm framework-socket)
#:export (output-framework)
)
(use-modules (ice-9 regex)
(ice-9 string-fun)
(scm paper-system)
(ice-9 format)
(guile)
(srfi srfi-1)
(ice-9 pretty-print)
(srfi srfi-13)
(lily))
(define (get-page-dimensions paper)
(let* ((landscape (ly:output-def-lookup paper 'landscape))
(output-scale (ly:output-def-lookup paper 'output-scale))
(paper-width (ly:output-def-lookup paper 'paper-width))
(paper-height (ly:output-def-lookup paper 'paper-height))
(indent (ly:output-def-lookup paper 'indent))
(line-width (ly:output-def-lookup paper 'line-width))
(plain-left-margin (ly:output-def-lookup paper 'left-margin))
(top-margin (ly:output-def-lookup paper 'top-margin))
(w (if landscape paper-height paper-width))
(h (if landscape paper-width paper-height))
(left-margin (if (null? plain-left-margin)
(/ (- w line-width) 2)
plain-left-margin))
;; (list w h left-margin top-margin indent line-width)))
;; (convert (lambda (x) (* x output-scale (/ (ly:bp 1))))))
(unit-length (ly:output-def-lookup paper 'output-scale))
(convert (lambda (x) (* x lily-unit->mm-factor unit-length))))
(map convert (list w h left-margin top-margin indent line-width))))
(define-public (output-framework channel book scopes fields)
(let* ((ctor-arg (if (string? channel)
(open-output-file (format "~a.socket" channel))
channel))
(outputter (ly:make-paper-outputter
ctor-arg
'socket))
(systems (ly:paper-book-systems book))
(paper (ly:paper-book-paper book))
(pages (ly:paper-book-pages book)))
(for-each (lambda (x)
(let* ((system-stencil (paper-system-stencil x))
(x-extent (ly:stencil-extent system-stencil X))
(y-extent (ly:stencil-extent system-stencil Y)))
(format ctor-arg (ly:format "system ~4l ~4l ~4l ~4l\n"
(car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)))
(ly:outputter-dump-stencil outputter system-stencil)))
systems)))
(define-public (output-classic-framework channel book scopes fields)
(let* ((ctor-arg (if (string? channel)
(open-output-file (format "~a.socket" channel))
channel))
(outputter (ly:make-paper-outputter
ctor-arg
'socket))
(systems (ly:paper-book-systems book))
(paper (ly:paper-book-paper book)))
(format ctor-arg (ly:format "paper ~4l\n" (get-page-dimensions paper)))
(for-each (lambda (x)
(let* ((system-stencil (paper-system-stencil x))
(x-extent (ly:stencil-extent system-stencil X))
(y-extent (ly:stencil-extent system-stencil Y)))
(format ctor-arg (ly:format "system ~4l ~4l ~4l ~4l\n"
(car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)))
(ly:outputter-dump-stencil outputter system-stencil)))
systems)))
(define-public (convert-to-ps . args) #t)
(define-public (convert-to-pdf . args) #t)
(define-public (convert-to-png . args) #t)
|