|
36 | 36 | exact-nonnegative-integer?)) |
37 | 37 | string? |
38 | 38 | exact-nonnegative-integer?) |
39 | | - (#:allow-funny? |
| 39 | + (#:increment-splash |
| 40 | + (or/c #f (-> (-> void?) any)) |
| 41 | + #:allow-funny? |
40 | 42 | boolean? |
41 | 43 | #:frame-icon |
42 | 44 | (or/c #f |
|
185 | 187 | (set! icons (cons (make-icon bm x y) icons)) |
186 | 188 | (refresh-splash))) |
187 | 189 |
|
188 | | -(define (start-splash splash-draw-spec _splash-title width-default |
| 190 | +(define (start-splash splash-draw-spec _splash-title width-default |
| 191 | + #:increment-splash [increment-splash #f] |
189 | 192 | #:allow-funny? [allow-funny? #f] |
190 | 193 | #:frame-icon [frame-icon #f]) |
191 | 194 | (unless allow-funny? (set! funny? #f)) |
192 | 195 | (set! splash-title _splash-title) |
193 | 196 | (set! splash-max-width (max 1 (splash-get-preference (get-splash-width-preference-name) width-default))) |
194 | 197 |
|
| 198 | + (cond |
| 199 | + [increment-splash (increment-splash inc-splash)] |
| 200 | + [else (install-splash-load-handler)]) |
| 201 | + |
195 | 202 | (on-splash-eventspace/ret |
196 | 203 | (let/ec k |
197 | 204 | (define (no-splash) |
|
288 | 295 | ;; example) |
289 | 296 | (define splash-range-ready? #f) |
290 | 297 |
|
291 | | -(define (splash-load-handler old-load f expected) |
| 298 | +(define (inc-splash) |
292 | 299 | (set! splash-current-width (+ splash-current-width 1)) |
293 | 300 | (when (<= splash-current-width splash-max-width) |
294 | 301 | (let ([splash-save-width splash-current-width]) |
|
298 | 305 | (when (or (not (member (get-gauge) (send gauge-panel get-children))) |
299 | 306 | ;; when the gauge is not visible, we'll redraw the canvas regardless |
300 | 307 | (refresh-splash-on-gauge-change? splash-save-width splash-max-width)) |
301 | | - (refresh-splash))))) |
| 308 | + (refresh-splash)))))) |
| 309 | + |
| 310 | +(define (splash-load-handler old-load f expected) |
| 311 | + (inc-splash) |
302 | 312 | (old-load f expected)) |
303 | 313 |
|
304 | | -(let ([make-compilation-manager-load/use-compiled-handler |
305 | | - (if (or (getenv "PLTDRCM") |
306 | | - (getenv "PLTDRDEBUG")) |
307 | | - (parameterize ([current-namespace (make-base-namespace)]) |
308 | | - (dynamic-require 'compiler/cm |
309 | | - 'make-compilation-manager-load/use-compiled-handler)) |
310 | | - #f)]) |
| 314 | +(define (install-splash-load-handler) |
| 315 | + (set! install-splash-load-handler void) |
| 316 | + (define make-compilation-manager-load/use-compiled-handler |
| 317 | + (if (or (getenv "PLTDRCM") |
| 318 | + (getenv "PLTDRDEBUG")) |
| 319 | + (parameterize ([current-namespace (make-base-namespace)]) |
| 320 | + (dynamic-require 'compiler/cm |
| 321 | + 'make-compilation-manager-load/use-compiled-handler)) |
| 322 | + #f)) |
311 | 323 |
|
312 | 324 | (current-load |
313 | 325 | (let ([old-load (current-load)]) |
314 | 326 | (λ (f expected) |
315 | 327 | (splash-load-handler old-load f expected)))) |
316 | | - |
| 328 | + |
317 | 329 | (when make-compilation-manager-load/use-compiled-handler |
318 | 330 | (printf "PLTDRCM/PLTDRDEBUG: reinstalling CM load handler after setting splash load handler\n") |
319 | 331 | (current-load/use-compiled (make-compilation-manager-load/use-compiled-handler)))) |
|
0 commit comments