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) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 1998--2011 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 ;;;; |
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 laissez-vibrer::print | 2659 laissez-vibrer::print |
2660 ly:flag::calc-y-offset | 2660 ly:flag::calc-y-offset |
2661 ly:rest::y-offset-callback | 2661 ly:rest::y-offset-callback |
2662 ly:staff-symbol-referencer::callback | 2662 ly:staff-symbol-referencer::callback |
2663 ly:staff-symbol::height)) | 2663 ly:staff-symbol::height)) |
2664 | 2664 |
2665 (define-public (pure-relevant? grob) | 2665 (define-public (pure-relevant? grob) |
2666 (let ((extent-callback (ly:grob-property-data grob 'Y-extent))) | 2666 (let ((extent-callback (ly:grob-property-data grob 'Y-extent))) |
2667 (not (eq? #f | 2667 (not (eq? #f |
2668 (or | 2668 (or |
| 2669 (ly:unpure-pure-container? extent-callback) |
2669 (pair? extent-callback) | 2670 (pair? extent-callback) |
2670 (memq extent-callback pure-functions) | 2671 (memq extent-callback pure-functions) |
2671 (and | 2672 (and |
2672 (pair? (assq extent-callback pure-conversions-alist)) | 2673 (pair? (assq extent-callback pure-conversions-alist)) |
2673 (let ((stencil (ly:grob-property-data grob 'stencil))) | 2674 (let ((stencil (ly:grob-property-data grob 'stencil))) |
2674 (or | 2675 (or |
2675 (not (eq? extent-callback ly:grob::stencil-height)) | 2676 (not (eq? extent-callback ly:grob::stencil-height)) |
2676 (memq stencil pure-print-callbacks) | 2677 (memq stencil pure-print-callbacks) |
2677 (assq stencil pure-print-to-height-conversions) | 2678 (assq stencil pure-print-to-height-conversions) |
2678 (ly:stencil? stencil))))))))) | 2679 (ly:stencil? stencil))))))))) |
2679 | 2680 |
| 2681 ;; hideous code dup below - to be cleaned up when call pure functino |
| 2682 ;; is eliminated and lilypond works entirely from unpure-pure-containers |
| 2683 |
2680 (define-public (call-pure-function unpure args start end) | 2684 (define-public (call-pure-function unpure args start end) |
2681 (if (ly:simple-closure? unpure) | 2685 (if (ly:unpure-pure-container? unpure) |
2682 (ly:eval-simple-closure (car args) unpure start end) | 2686 (let ((unpure (ly:unpure-pure-container-pure-part unpure))) |
2683 (if (not (procedure? unpure)) | 2687 (if (ly:simple-closure? unpure) |
2684 » unpure | 2688 (ly:eval-simple-closure (car args) unpure start end) |
2685 » (if (memq unpure pure-functions) | 2689 (if (not (procedure? unpure)) |
2686 » (apply unpure args) | 2690 unpure |
2687 » (let ((pure (assq unpure pure-conversions-alist))) | 2691 (apply (cdr pure) |
2688 » » (if pure | 2692 (append |
2689 » » (apply (cdr pure) | 2693 (list (car args) start end) |
2690 » » » (append | 2694 (cdr args)))))) |
2691 » » » (list (car args) start end) | 2695 (if (ly:simple-closure? unpure) |
2692 » » » (cdr args))))))))) | 2696 (ly:eval-simple-closure (car args) unpure start end) |
| 2697 (if (not (procedure? unpure)) |
| 2698 unpure |
| 2699 (if (memq unpure pure-functions) |
| 2700 (apply unpure args) |
| 2701 (let ((pure (assq unpure pure-conversions-alist))) |
| 2702 (if pure |
| 2703 (apply (cdr pure) |
| 2704 (append |
| 2705 (list (car args) start end) |
| 2706 (cdr args)))))))))) |
OLD | NEW |