OLD | NEW |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2000--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 2000--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org> | 4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
11 ;;;; LilyPond is distributed in the hope that it will be useful, | 11 ;;;; LilyPond is distributed in the hope that it will be useful, |
12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 ;;;; GNU General Public License for more details. | 14 ;;;; GNU General Public License for more details. |
15 ;;;; | 15 ;;;; |
16 ;;;; You should have received a copy of the GNU General Public License | 16 ;;;; You should have received a copy of the GNU General Public License |
17 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>. | 17 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
19 (define (sort-grob-properties props) | 19 (define (sort-grob-properties props) |
20 ;; force 'meta to the end of each prop-list | 20 ;; force 'meta to the end of each prop-list |
21 (let ((meta (assoc 'meta props))) | 21 (let ((meta (assoc 'meta props))) |
22 (append (sort (assoc-remove! props 'meta) ly:alist-ci<?) | 22 (append (sort (assoc-remove! props 'meta) ly:alist-ci<?) |
23 (list meta)))) | 23 (list meta)))) |
24 | 24 |
25 ;; properly sort all properties and interfaces | 25 ;; properly sort all properties and interfaces |
26 ;; within the all-grob-descriptions alist | 26 ;; within the all-grob-descriptions alist |
27 (set! all-grob-descriptions | 27 (set! all-grob-descriptions |
28 (map! | 28 (map! |
29 (lambda (grob-description) | 29 (lambda (grob-description) |
30 (let* ((grob-key (car grob-description)) | 30 (let* ((grob-key (car grob-description)) |
31 (props (assoc-ref all-grob-descriptions grob-key)) | 31 (props (assoc-ref all-grob-descriptions grob-key)) |
32 (meta (assoc-ref props 'meta)) | 32 (meta (assoc-ref props 'meta)) |
33 (interfaces (assoc-ref meta 'interfaces)) | 33 (interfaces (assoc-ref meta 'interfaces)) |
34 (sorted-ifaces (sort interfaces ly:symbol-ci<?)) | 34 (sorted-ifaces (sort interfaces ly:symbol-ci<?)) |
35 (new-meta (assoc-set! meta 'interfaces sorted-ifaces)) | 35 (new-meta (assoc-set! meta 'interfaces sorted-ifaces)) |
36 (new-props (assoc-set! props 'meta new-meta)) | 36 (new-props (assoc-set! props 'meta new-meta)) |
37 (sorted-props (sort-grob-properties new-props))) | 37 (sorted-props (sort-grob-properties new-props))) |
38 (cons grob-key sorted-props))) | 38 (cons grob-key sorted-props))) |
39 all-grob-descriptions)) | 39 all-grob-descriptions)) |
40 | 40 |
41 ;; sort all grobs in the all-grob-descriptions alist | 41 ;; sort all grobs in the all-grob-descriptions alist |
42 (set! all-grob-descriptions (sort all-grob-descriptions ly:alist-ci<?)) | 42 (set! all-grob-descriptions (sort all-grob-descriptions ly:alist-ci<?)) |
43 | 43 |
44 (define (interface-doc-string interface grob-description) | 44 (define (interface-doc-string interface grob-description) |
45 (let* ((name (car interface)) | 45 (let* ((name (car interface)) |
46 (desc (cadr interface)) | 46 (desc (cadr interface)) |
47 (props (caddr interface)) | 47 (props (caddr interface)) |
48 (docfunc (lambda (pr) | 48 (docfunc (lambda (pr) |
49 (property->texi | 49 (property->texi |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 (map (lambda (x) (grob-doc (cdr x))) all-grob-descriptions))) | 171 (map (lambda (x) (grob-doc (cdr x))) all-grob-descriptions))) |
172 | 172 |
173 (define interface-description-alist | 173 (define interface-description-alist |
174 (hash-fold | 174 (hash-fold |
175 (lambda (key val prior) | 175 (lambda (key val prior) |
176 (cons (cons key val) prior)) | 176 (cons (cons key val) prior)) |
177 '() (ly:all-grob-interfaces))) | 177 '() (ly:all-grob-interfaces))) |
178 | 178 |
179 ;; sort user-settable and internal props within each grob-interface | 179 ;; sort user-settable and internal props within each grob-interface |
180 (set! interface-description-alist | 180 (set! interface-description-alist |
181 (map! (lambda (iface-desc) | 181 (map! (lambda (iface-desc) |
182 (let* ((key-name-docstr (list-head iface-desc 3)) | 182 (let* ((key-name-docstr (list-head iface-desc 3)) |
183 (props (list-tail iface-desc 3)) | 183 (props (list-tail iface-desc 3)) |
184 (sorted-props (list (sort (car props) ly:symbol-ci<?)))) | 184 (sorted-props (list (sort (car props) ly:symbol-ci<?)))) |
185 (append key-name-docstr sorted-props))) | 185 (append key-name-docstr sorted-props))) |
186 interface-description-alist)) | 186 interface-description-alist)) |
187 | 187 |
188 ;; sort list of grob interfaces | 188 ;; sort list of grob interfaces |
189 (set! interface-description-alist | 189 (set! interface-description-alist |
190 (sort interface-description-alist ly:alist-ci<?)) | 190 (sort interface-description-alist ly:alist-ci<?)) |
191 | 191 |
192 ;;;;;;;;;; check for dangling backend properties. | 192 ;;;;;;;;;; check for dangling backend properties. |
193 (define (mark-interface-properties entry) | 193 (define (mark-interface-properties entry) |
194 (for-each (lambda (x) (set-object-property! x 'iface-marked #t)) | 194 (for-each (lambda (x) (set-object-property! x 'iface-marked #t)) |
195 (caddr (cdr entry)))) | 195 (caddr (cdr entry)))) |
196 | 196 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 (all-grobs-doc) | 235 (all-grobs-doc) |
236 (all-interfaces-doc) | 236 (all-interfaces-doc) |
237 (make <texi-node> | 237 (make <texi-node> |
238 #:name "User backend properties" | 238 #:name "User backend properties" |
239 #:desc "All tunable properties in a big list." | 239 #:desc "All tunable properties in a big list." |
240 #:text (backend-properties-doc-string all-user-grob-properties)) | 240 #:text (backend-properties-doc-string all-user-grob-properties)) |
241 (make <texi-node> | 241 (make <texi-node> |
242 #:name "Internal backend properties" | 242 #:name "Internal backend properties" |
243 #:desc "All internal layout properties in a big list." | 243 #:desc "All internal layout properties in a big list." |
244 #:text (backend-properties-doc-string all-internal-grob-properties))))) | 244 #:text (backend-properties-doc-string all-internal-grob-properties))))) |
OLD | NEW |