X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fclip-region.scm;h=3585a12bc3805b4c1cfd9e8a1d4cbd96cc2c7658;hb=82e1937780c911be71b439a7d1f2006f058f0490;hp=ce1bd4d66baa37a6790598d0139acb3171ded580;hpb=2a8c79664174b846da1fe107f429f23536f8724d;p=lilypond.git diff --git a/scm/clip-region.scm b/scm/clip-region.scm index ce1bd4d66b..3585a12bc3 100644 --- a/scm/clip-region.scm +++ b/scm/clip-region.scm @@ -1,71 +1,57 @@ -;; -;; clip-region.scm -- implement rhythmic-location and EPS musical clipping -;; -;; source file of the GNU LilyPond music typesetter -;; -;; (c) 2006 Han-Wen Nienhuys -;; +;;;; This file is part of LilyPond, the GNU music typesetter. +;;;; +;;;; Copyright (C) 2006--2012 Han-Wen Nienhuys +;;;; +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . (define-module (scm clip-region)) (use-modules (lily)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; The procedures shown in this list have been moved to +;; scm/output-lib.scm +;; +;; +;; (define-public (make-rhythmic-location bar-num num den) +;: (define-public (rhythmic-location? a) +;; (define-public (make-graceless-rhythmic-location loc) +;; (define-public rhythmic-location-measure-position cdr) +;; (define-public rhythmic-location-bar-number car) +;; (define-public (rhythmic-location=? a b) +;; (define-public (rhythmic-location>? a b) +;: (define-public (rhythmic-location=? a b) +;; (define-public (rhythmic-location->file-string a) +;; (define-public (rhythmic-location->string a) -(define-public (make-rhythmic-location bar-num num den) - (cons - bar-num (ly:make-moment num den))) - -(define-public (rhythmic-location? a) - (and (pair? a) - (integer? (car a)) - (ly:moment? (cdr a)))) - -(define-public (make-graceless-rhythmic-location loc) - (make-rhythmic-location - (car loc) - (ly:moment-main-numerator (rhythmic-location-measure-position loc)) - (ly:moment-main-denominator (rhythmic-location-measure-position loc)))) - - -(define-public rhythmic-location-measure-position cdr) -(define-public rhythmic-location-bar-number car) - -(define-public (rhythmic-location (car a) (car b)) #f) - (else - (ly:moment=? a b) - (rhythmic-location? a b) - (rhythmic-locationfile-string a) - (format "~a.~a.~a" - (car a) - (ly:moment-main-numerator (cdr a)) - (ly:moment-main-denominator (cdr a)))) - -(define-public (rhythmic-location->string a) - (format "bar ~a ~a" - (car a) - (ly:moment->string (cdr a)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Actual clipping logic. +;; +;; the total of this will be +;; O(#systems * #regions) +;; +;; we can actually do better by sorting the regions as well, +;; but let's leave that for future extensions. +;; (define-public (system-clipped-x-extent system-grob clip-region) - "Return the X-extent of the SYSTEM-GROB when clipped with -CLIP-REGION. Return #f if not appropriate." + "Return the X-extent of @var{system-grob} when clipped with +@var{clip-region}. Return @code{#f} if not appropriate." (let* ((region-start (car clip-region))