Added lock-icon

Changed most *-icon and *-logo function arguments to keyword arguments

text-icon no longer uses font size

Small doc changes
This commit is contained in:
Neil Toronto 2012-06-26 14:58:15 -06:00
parent 0c78194267
commit db57b78e18
25 changed files with 749 additions and 555 deletions

View File

@ -188,11 +188,13 @@ profile todo:
(super-make-object bitmap))])
note%)))
(define file-note% (make-note% "stop-22x22.png" (compiled-bitmap (stop-sign-icon halt-icon-color))))
(define bug-note% (make-note% "stop-multi.png" (compiled-bitmap (stop-signs-icon halt-icon-color))))
(define file-note%
(make-note% "stop-22x22.png" (compiled-bitmap (stop-sign-icon #:color halt-icon-color))))
(define bug-note%
(make-note% "stop-multi.png" (compiled-bitmap (stop-signs-icon #:color halt-icon-color))))
(define mf-note% (make-note% "mf.gif" (include-bitmap (lib "icons/mf.gif") 'gif)))
(define small-planet-bitmap (compiled-bitmap (planet-logo (default-icon-height))))
(define small-planet-bitmap (compiled-bitmap (planet-logo #:height (default-icon-height))))
(define planet-note% (make-note% "small-planet.png" small-planet-bitmap))
;; display-stats : (syntax -> syntax)

View File

@ -76,15 +76,15 @@ module browser threading seems wrong.
images/icons/stickman images/logos))))
(define execute-bitmap
(icons:compiled-bitmap (icons:play-icon icons:run-icon-color (icons:toolbar-icon-height))))
(icons:compiled-bitmap (icons:play-icon #:color icons:run-icon-color
#:height (icons:toolbar-icon-height))))
(define break-bitmap
(icons:compiled-bitmap (icons:stop-icon icons:halt-icon-color (icons:toolbar-icon-height))))
(icons:compiled-bitmap (icons:stop-icon #:color icons:halt-icon-color
#:height (icons:toolbar-icon-height))))
(define small-save-bitmap
(icons:compiled-bitmap (icons:small-save-icon icons:syntax-icon-color "gold"
(icons:toolbar-icon-height))))
(icons:compiled-bitmap (icons:small-save-icon #:height (icons:toolbar-icon-height))))
(define save-bitmap
(icons:compiled-bitmap (icons:save-icon icons:syntax-icon-color "gold"
(icons:toolbar-icon-height))))
(icons:compiled-bitmap (icons:save-icon #:height (icons:toolbar-icon-height))))
(begin-for-syntax
(define stickman-height 18)
@ -93,17 +93,15 @@ module browser threading seems wrong.
(define running-frame-list
(icons:compiled-bitmap-list
(for/list ([t (in-range 0 1 (/ 1 num-running-frames))])
(icons:running-stickman-icon t icons:run-icon-color "white" icons:run-icon-color
stickman-height))))
(icons:running-stickman-icon t #:height stickman-height))))
(define running-frames (list->vector running-frame-list))
(define standing-frame
(icons:compiled-bitmap
(icons:standing-stickman-icon icons:run-icon-color "white" icons:run-icon-color
stickman-height)))
(icons:standing-stickman-icon #:height stickman-height)))
(define very-small-planet-bitmap
(icons:compiled-bitmap (icons:planet-logo (icons:toolbar-icon-height))))
(icons:compiled-bitmap (icons:planet-logo #:height (icons:toolbar-icon-height))))
;; ===================================================================================================

View File

@ -12,9 +12,9 @@
(define-local-member-name syncheck:button-callback)
(define syncheck-bitmap
(compiled-bitmap (check-syntax-icon (toolbar-icon-height))))
(compiled-bitmap (check-syntax-icon #:height (toolbar-icon-height))))
(define syncheck-small-bitmap
(compiled-bitmap (small-check-syntax-icon (toolbar-icon-height))))
(compiled-bitmap (small-check-syntax-icon #:height (toolbar-icon-height))))
(define syncheck-drracket-button
(list

View File

@ -1111,21 +1111,19 @@
(define over-bitmap
(compiled-bitmap
(pict->bitmap
(cc-superimpose (bitmap (text-icon "()"
(make-object font%)
syntax-icon-color))
(bitmap (right-over-arrow-icon run-icon-color))))))
(cc-superimpose (bitmap (text-icon "()" #:color syntax-icon-color))
(bitmap (right-over-arrow-icon #:color run-icon-color))))))
(define out-bitmap
(compiled-bitmap
(pict->bitmap
(hc-append
-8
(bitmap (text-icon "()" (make-object font%) syntax-icon-color))
(bitmap (right-arrow-icon run-icon-color 19))))))
(bitmap (text-icon "()" #:color syntax-icon-color))
(bitmap (right-arrow-icon #:color run-icon-color #:height 19))))))
(define pause-bitmap (compiled-bitmap (pause-icon run-icon-color)))
(define resume-bitmap (compiled-bitmap (play-icon run-icon-color)))
(define step-bitmap (compiled-bitmap (step-icon run-icon-color)))
(define pause-bitmap (compiled-bitmap (pause-icon #:color run-icon-color)))
(define resume-bitmap (compiled-bitmap (play-icon #:color run-icon-color)))
(define step-bitmap (compiled-bitmap (step-icon #:color run-icon-color)))
(define make-pause-label (bitmap-label-maker "Pause" pause-bitmap))
(define make-resume-label (bitmap-label-maker "Go" resume-bitmap))

View File

@ -45,6 +45,10 @@
(values alpha-bs rgb-bs))
(define (make-3d-bitmap ctxt bm quality)
(unless (is-a? bm bitmap%)
(raise-type-error 'make-3d-bitmap "bitmap%" 0 bm quality))
(unless (and (exact-integer? quality) (<= 0 quality 100))
(raise-type-error 'make-3d-bitmap "(integer-in 0 100)" 1 bm quality))
(cond [(= quality 100)
(with-syntax ([bs (datum->syntax ctxt (save-png bm))])
(syntax/loc ctxt (load-png bs)))]

View File

@ -48,70 +48,77 @@
0 0))
32 32 (/ height 32)))
(defproc (right-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (right-arrow-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(flomap-render-thin-icon (flat-right-arrow-flomap color height) material)))
(defproc (up-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (up-arrow-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(flomap-render-icon (flomap-cw-rotate (flat-right-arrow-flomap color height)) material)))
(defproc (down-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (down-arrow-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(flomap-render-icon (flomap-ccw-rotate (flat-right-arrow-flomap color height)) material)))
(defproc (right-over-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (right-over-arrow-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(flomap-render-thin-icon (flat-right-over-arrow-flomap color height) material)))
(defproc (right-under-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (right-under-arrow-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(flomap-render-thin-icon
(flomap-flip-vertical (flat-right-over-arrow-flomap color height)) material)))
(defproc (left-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (left-arrow-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (right-arrow-flomap color height material)))
(flomap-flip-horizontal
(right-arrow-flomap #:color color #:height height #:material material)))
(defproc (left-over-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (left-over-arrow-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (right-over-arrow-flomap color height material)))
(flomap-flip-horizontal
(right-over-arrow-flomap #:color color #:height height #:material material)))
(defproc (left-under-arrow-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (left-under-arrow-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (right-under-arrow-flomap color height material)))
(flomap-flip-horizontal
(right-under-arrow-flomap #:color color #:height height #:material material)))
(define-icon-wrappers
([color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[left-arrow-icon left-arrow-flomap]
[right-arrow-icon right-arrow-flomap]
[up-arrow-icon up-arrow-flomap]

View File

@ -34,18 +34,19 @@
(cons 4 31) (cons 0 31))))
24 32 (/ height 32)))
(defproc (play-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (play-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(define fm (flat-play-flomap color height))
(flomap-render-icon fm material)))
(defproc (fast-forward-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (fast-forward-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
@ -60,9 +61,9 @@
20 32 (/ height 32) material))
(flomap-hc-append fm fm)))
(defproc (stop-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (stop-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
@ -73,9 +74,9 @@
(send dc draw-polygon (list '(0 . 0) '(31 . 0) '(31 . 31) '(0 . 31))))
32 32 (/ height 32) material)))
(defproc (record-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (record-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
@ -86,9 +87,9 @@
(send dc draw-ellipse 0 0 31 31))
32 32 (/ height 32) material)))
(defproc (bar-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (bar-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
@ -99,85 +100,87 @@
(send dc draw-polygon (list '(0 . 0) '(7 . 0) '(7 . 31) '(0 . 31))))
8 32 (/ height 32) material)))
(defproc (back-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (back-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (play-flomap color height material)))
(flomap-flip-horizontal (play-flomap #:color color #:height height #:material material)))
(defproc (rewind-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (rewind-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (fast-forward-flomap color height material)))
(flomap-flip-horizontal (fast-forward-flomap #:color color #:height height #:material material)))
(defproc (pause-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (pause-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(define bar (bar-flomap #:color color #:height height #:material material))
(flomap-hc-append bar (make-flomap 4 (max 1 (inexact->exact (round (* 1/8 height)))) 0) bar))
(defproc (step-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(bar-flomap color height material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/8 height)))) 0)
(bar-flomap color height material)))
(defproc (step-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(play-flomap color height material)
(play-flomap #:color color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(bar-flomap color height material)))
(bar-flomap #:color color #:height height #:material material)))
(defproc (step-back-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (step-back-flomap [#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(bar-flomap color height material)
(bar-flomap #:color color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(back-flomap color height material)))
(back-flomap #:color color #:height height #:material material)))
(defproc (continue-forward-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (continue-forward-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(bar-flomap color height material)
(bar-flomap #:color color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(play-flomap color height material)))
(play-flomap #:color color #:height height #:material material)))
(defproc (continue-backward-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (continue-backward-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(back-flomap color height material)
(back-flomap #:color color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(bar-flomap color height material)))
(bar-flomap #:color color #:height height #:material material)))
(defproc (search-forward-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (search-forward-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(fast-forward-flomap color height material)
(fast-forward-flomap #:color color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(bar-flomap color height material)))
(bar-flomap #:color color #:height height #:material material)))
(defproc (search-backward-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (search-backward-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append
(bar-flomap color height material)
(bar-flomap #:color color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(rewind-flomap color height material)))
(rewind-flomap #:color color #:height height #:material material)))
(define-icon-wrappers
([color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[play-icon play-flomap]
[back-icon back-flomap]
[fast-forward-icon fast-forward-flomap]

View File

@ -16,9 +16,10 @@
small-load-icon small-load-flomap)
(only-doc-out (all-defined-out)))
(defproc (floppy-disk-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (floppy-disk-flomap
[#:color color (or/c string? (is-a?/c color%)) "slategray"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
@ -107,53 +108,57 @@
[fm (flomap-ct-superimpose fm label-fm)])
fm)))
(defproc (save-flomap [arrow-color (or/c string? (is-a?/c color%))]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (save-flomap [#:disk-color disk-color (or/c string? (is-a?/c color%)) "gold"]
[#:arrow-color arrow-color (or/c string? (is-a?/c color%)) syntax-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append (right-arrow-flomap arrow-color (* 3/4 height) material)
(flomap-hc-append
(right-arrow-flomap #:color arrow-color #:height (* 3/4 height) #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(floppy-disk-flomap color height material)))
(floppy-disk-flomap #:color disk-color #:height height #:material material)))
(defproc (load-flomap [arrow-color (or/c string? (is-a?/c color%))]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (load-flomap [#:disk-color disk-color (or/c string? (is-a?/c color%)) "gold"]
[#:arrow-color arrow-color (or/c string? (is-a?/c color%)) syntax-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-hc-append (floppy-disk-flomap color height material)
(flomap-hc-append
(floppy-disk-flomap #:color disk-color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(right-arrow-flomap arrow-color (* 3/4 height) material)))
(right-arrow-flomap #:color arrow-color #:height (* 3/4 height) #:material material)))
(defproc (small-save-flomap [arrow-color (or/c string? (is-a?/c color%))]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (small-save-flomap
[#:disk-color disk-color (or/c string? (is-a?/c color%)) "gold"]
[#:arrow-color arrow-color (or/c string? (is-a?/c color%)) syntax-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-pin* 0 0 11/16 0
(floppy-disk-flomap color height material)
(right-arrow-flomap arrow-color (* 3/4 height) material)))
(floppy-disk-flomap #:color disk-color #:height height #:material material)
(right-arrow-flomap #:color arrow-color #:height (* 3/4 height) #:material material)))
(defproc (small-load-flomap [arrow-color (or/c string? (is-a?/c color%))]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (small-load-flomap
[#:disk-color disk-color (or/c string? (is-a?/c color%)) "gold"]
[#:arrow-color arrow-color (or/c string? (is-a?/c color%)) syntax-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-pin* 1 1 5/16 1
(floppy-disk-flomap color height material)
(right-arrow-flomap arrow-color (* 3/4 height) material)))
(floppy-disk-flomap #:color disk-color #:height height #:material material)
(right-arrow-flomap #:color arrow-color #:height (* 3/4 height) #:material material)))
(define-icon-wrappers
([color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:color color (or/c string? (is-a?/c color%)) "slategray"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[floppy-disk-icon floppy-disk-flomap])
(define-icon-wrappers
([arrow-color (or/c string? (is-a?/c color%))]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:disk-color disk-color (or/c string? (is-a?/c color%)) "gold"]
[#:arrow-color arrow-color (or/c string? (is-a?/c color%)) syntax-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[save-icon save-flomap]
[load-icon load-flomap]
[small-save-icon small-save-flomap]

View File

@ -10,7 +10,6 @@
(provide (activate-contract-out
regular-polygon-icon regular-polygon-flomap
octagon-icon octagon-flomap
stop-sign-icon stop-sign-flomap
stop-signs-icon stop-signs-flomap
foot-icon foot-flomap
@ -21,7 +20,8 @@
clock-icon clock-flomap
stopwatch-icon stopwatch-flomap
stethoscope-icon stethoscope-flomap
short-stethoscope-icon short-stethoscope-flomap)
short-stethoscope-icon short-stethoscope-flomap
lock-icon lock-flomap)
(only-doc-out (all-defined-out)))
(define (flat-regular-polygon-flomap sides start color size)
@ -39,25 +39,22 @@
(+ 15.5 (/ (* 15.5 (sin θ)) max-frac))))))
32 32 (/ size 32))))
(defproc (regular-polygon-flomap [sides exact-positive-integer?]
[start real?]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (regular-polygon-flomap
[sides exact-positive-integer?]
[start real? (- (/ pi sides) (* 1/2 pi))]
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height sides start color material]
(flomap-render-icon (flat-regular-polygon-flomap sides start color height) material)))
(defproc (octagon-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
#:document-body
(regular-polygon-flomap 8 (/ (* 2 pi) 16) color height material))
(defproc (stop-sign-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (stop-sign-flomap
[#:color color (or/c string? (is-a?/c color%)) halt-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(define scale (/ height 32))
@ -68,18 +65,23 @@
[dfm (deep-flomap-icon-style dfm)]
[dfm (deep-flomap-cc-superimpose 'add dfm indent-dfm)]
[fm (deep-flomap-render-icon dfm material)])
(flomap-cc-superimpose fm (x-flomap light-metal-icon-color (* 22 scale) metal-icon-material)))))
(flomap-cc-superimpose fm (x-flomap #:color light-metal-icon-color
#:height (* 22 scale)
#:material metal-icon-material)))))
(defproc (stop-signs-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(define fm (stop-sign-flomap color (* height 2/3) material))
(flomap-pin* 3/16 1/4 0 0
fm (flomap-pin* 3/16 1/4 0 0 fm fm)))
(defproc (stop-signs-flomap
[#:color color (or/c string? (is-a?/c color%)) halt-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(define fm (stop-sign-flomap #:color color #:height (* height 2/3) #:material material))
(flomap-pin* 3/16 1/4 0 0 fm fm fm))
(defproc (foot-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (foot-flomap
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(draw-rendered-icon-flomap
@ -104,10 +106,11 @@
0.25 0.25 0.0
0.0))
(defproc (magnifying-glass-flomap [frame-color (or/c string? (is-a?/c color%))]
[handle-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (magnifying-glass-flomap
[#:frame-color frame-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:handle-color handle-color (or/c string? (is-a?/c color%)) "brown"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height frame-color handle-color material]
@ -168,20 +171,24 @@
handle-fm
(flomap-pin* 1/2 1/2 1/2 1/2 circle-fm glass-fm))))
(defproc (left-magnifying-glass-flomap [frame-color (or/c string? (is-a?/c color%))]
[handle-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (left-magnifying-glass-flomap
[#:frame-color frame-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:handle-color handle-color (or/c string? (is-a?/c color%)) "brown"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (magnifying-glass-flomap frame-color handle-color height material)))
(flomap-flip-horizontal
(magnifying-glass-flomap #:frame-color frame-color #:handle-color handle-color
#:height height #:material material)))
;; ---------------------------------------------------------------------------------------------------
;; Bomb
(defproc (left-bomb-flomap [cap-color (or/c string? (is-a?/c color%))]
[bomb-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (left-bomb-flomap
[#:cap-color cap-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:bomb-color bomb-color (or/c string? (is-a?/c color%)) dark-metal-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height cap-color bomb-color material]
@ -247,12 +254,15 @@
(deep-flomap-render-icon sphere-dfm material)))
(flomap-lt-superimpose sphere-fm cap-fm fuse-fm)))
(defproc (bomb-flomap [cap-color (or/c string? (is-a?/c color%))]
[bomb-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (bomb-flomap
[#:cap-color cap-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:bomb-color bomb-color (or/c string? (is-a?/c color%)) dark-metal-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-flip-horizontal (left-bomb-flomap cap-color bomb-color height material)))
(flomap-flip-horizontal
(left-bomb-flomap #:cap-color cap-color #:bomb-color bomb-color
#:height height #:material material)))
;; ---------------------------------------------------------------------------------------------------
;; Clock
@ -264,11 +274,13 @@
0.1 0.1 0.6
0.0))
(defproc (clock-flomap [height (and/c rational? (>=/c 0)) (default-icon-height)]
[face-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[hand-color (or/c string? (is-a?/c color%)) "firebrick"]
(defproc (clock-flomap
[hours (integer-in 0 11) 1]
[minutes (real-in 0 60) 47]) flomap?
[minutes (real-in 0 60) 47]
[#:face-color face-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:hand-color hand-color (or/c string? (is-a?/c color%)) "firebrick"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
) flomap?
(make-cached-flomap
[height face-color hand-color hours minutes]
(define R 12.5)
@ -301,7 +313,8 @@
(+ 15.5 (* R (sin θ))))))
32 32 scale)
;; lambda logo
(fm* 0.33 (lambda-flomap face-color (* 1/2 height) glass-icon-material))
(fm* 0.33 (lambda-flomap #:color face-color #:height (* 1/2 height)
#:material glass-icon-material))
;; minute hand
(draw-rendered-icon-flomap
(λ (dc)
@ -349,14 +362,19 @@
face-fm
(deep-flomap-render-icon dfm clock-shell-material face-fm)))))
(defproc (stopwatch-flomap [height (and/c rational? (>=/c 0)) (default-icon-height)]
[face-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[hand-color (or/c string? (is-a?/c color%)) "firebrick"]
(defproc (stopwatch-flomap
[hours (integer-in 0 11) 0]
[minutes (real-in 0 60) 47]) flomap?
[minutes (real-in 0 60) 47]
[#:face-color face-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:hand-color hand-color (or/c string? (is-a?/c color%)) "firebrick"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
) flomap?
(make-cached-flomap
[height face-color hand-color hours minutes]
(define clock-fm (clock-flomap (* 30/32 height) face-color hand-color hours minutes))
(define clock-fm (clock-flomap hours minutes
#:face-color face-color
#:hand-color hand-color
#:height (* 30/32 height)))
(define buttons-fm
(draw-rendered-icon-flomap
(λ (dc)
@ -394,15 +412,9 @@
'((m 25 1.5)
(c 4 2 0 5.5 0 11.5)))
(define rubber-material
(deep-flomap-material-value
'cubic-zirconia 2.0 0.0 1.0
1.5 0.25 1.0
0.25 0.5 0.0
0.03))
(defproc (stethoscope-flomap [color (or/c string? (is-a?/c color%)) "black"]
[height (and/c rational? (>=/c 0)) (default-icon-height)]) flomap?
(defproc (stethoscope-flomap
[#:color color (or/c string? (is-a?/c color%)) "black"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]) flomap?
(define scale (/ height 32))
(flomap-ct-superimpose
(draw-rendered-icon-flomap
@ -414,7 +426,7 @@
(send dc set-pen (make-object pen% "black" 3 'solid 'round 'round))
(send dc draw-line 23.5 1 25 1.5)
(send dc draw-line 7.5 1 6 1.5))
32 32 scale rubber-material)
32 32 scale rubber-icon-material)
(draw-rendered-icon-flomap
(λ (dc)
(send dc set-pen (make-object pen% dark-metal-icon-color 2.5 'solid 'round 'round))
@ -443,8 +455,9 @@
-7 0 -6.5 4.5 6 4
12.5 -0.5 14.5 -5 14.5 -5)))
(defproc (short-stethoscope-flomap [color (or/c string? (is-a?/c color%)) "black"]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
(defproc (short-stethoscope-flomap
[#:color color (or/c string? (is-a?/c color%)) "black"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
) flomap?
(define scale (/ height 32))
(flomap-ct-superimpose
@ -458,7 +471,7 @@
(send dc set-pen (make-object pen% "black" 3 'solid 'round 'round))
(send dc draw-line 4.5 1 3 1.5)
(send dc draw-line 26.5 1 28 1.5))
32 32 scale rubber-material)
32 32 scale rubber-icon-material)
(draw-rendered-icon-flomap
(λ (dc)
(send dc translate 0 6)
@ -477,53 +490,142 @@
(send dc draw-ellipse 22.25 16.25 8 8))
32 32 scale metal-icon-material)))
;; ---------------------------------------------------------------------------------------------------
;; Lock
(define shackle-commands
'((m 10.5 0)
(c -6 0 -10 4 -10 10)
(l 0 5)
(l 4 0)
(l 0 -5)
(c 0 -4 2 -6 6 -6)
(c 4 0 6 2 6 6)
(l 0 5)
(l 4 0)
(l 0 -5)
(c 0 -6 -4 -10 -10 -10)))
(defproc (lock-flomap
[open? boolean? #f]
[#:body-color body-color (or/c string? (is-a?/c color%)) "orange"]
[#:shackle-color shackle-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height open? body-color shackle-color material]
(define scale (/ height 32))
(define body-fm
(draw-icon-flomap
(λ (dc)
(set-icon-pen dc (icon-color->outline-color body-color) 1 'solid)
(send dc set-brush body-color 'solid)
(send dc draw-rounded-rectangle 2 0 27 19 2))
32 20 scale))
(define face-fm
(draw-icon-flomap
(λ (dc)
(send dc set-pen "black" 1 'transparent)
(send dc set-brush "black" 'solid)
(send dc draw-ellipse 13 4.5 5 5)
(send dc draw-polygon '((14.5 . 8)
(16.5 . 8)
(17.5 . 15.5)
(13.5 . 15.5)))
(send dc set-alpha 1/8)
(for ([i (in-range 4)])
(send dc draw-rectangle 3.5 (+ 3 (* 4 i)) 24 1)))
32 20 scale))
(define face-alpha-fm (flomap-ref-component face-fm 0))
(define body-rfm
(let* ([dfm (flomap->deep-flomap body-fm)]
[dfm (deep-flomap-bulge-horizontal dfm (* scale 6))]
[dfm (deep-flomap-emboss dfm (* scale 3) (* scale 2))]
[dfm (deep-flomap-raise dfm (* scale 20))]
[dfm (deep-flomap-raise dfm (fm* (* scale -1/2) (flomap-blur face-alpha-fm
(* 1/2 scale))))])
(flomap-cc-superimpose (deep-flomap-render-icon dfm material)
face-fm)))
(define shackle-fm
(draw-icon-flomap
(λ (dc)
(set-icon-pen dc (icon-color->outline-color shackle-color) 1 'solid)
(send dc set-brush shackle-color 'solid)
(draw-path-commands dc shackle-commands 0 0))
22 16 scale))
(define shackle-rfm
(let* ([dfm (flomap->deep-flomap shackle-fm)]
[dfm (deep-flomap-emboss dfm (* scale 3) (* scale 10))])
(deep-flomap-render-icon dfm metal-icon-material)))
(flomap-pin* 1/2 3/4 (if open? 1 1/2) 0 shackle-rfm body-rfm)))
;; ===================================================================================================
;; Bitmaps (icons)
(defproc (regular-polygon-icon [sides exact-positive-integer?]
[start real?]
[color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
) (is-a?/c bitmap%)
(flomap->bitmap (regular-polygon-flomap sides start color height material)))
(define-icon-wrappers
([sides exact-positive-integer?]
[start real? (- (/ pi sides) (* 1/2 pi))]
[#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[regular-polygon-icon regular-polygon-flomap])
(define-icon-wrappers
([height (and/c rational? (>=/c 0)) (default-icon-height)]
[face-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[hand-color (or/c string? (is-a?/c color%)) "firebrick"]
[hours (integer-in 0 11) 0]
[minutes (real-in 0 60) 47])
([hours (integer-in 0 11) 0]
[minutes (real-in 0 60) 47]
[#:face-color face-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:hand-color hand-color (or/c string? (is-a?/c color%)) "firebrick"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)])
[clock-icon clock-flomap]
[stopwatch-icon stopwatch-flomap])
(define-icon-wrappers
([color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
[octagon-icon octagon-flomap]
([#:color color (or/c string? (is-a?/c color%)) halt-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[stop-sign-icon stop-sign-flomap]
[stop-signs-icon stop-signs-flomap]
[stop-signs-icon stop-signs-flomap])
(define-icon-wrappers
([#:color color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[foot-icon foot-flomap])
(define-icon-wrappers
([frame-color (or/c string? (is-a?/c color%))]
[handle-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:frame-color frame-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:handle-color handle-color (or/c string? (is-a?/c color%)) "brown"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[magnifying-glass-icon magnifying-glass-flomap]
[left-magnifying-glass-icon left-magnifying-glass-flomap])
(define-icon-wrappers
([cap-color (or/c string? (is-a?/c color%))]
[bomb-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:cap-color cap-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:bomb-color bomb-color (or/c string? (is-a?/c color%)) dark-metal-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[bomb-icon bomb-flomap]
[left-bomb-icon left-bomb-flomap])
(define-icon-wrappers
([color (or/c string? (is-a?/c color%)) "black"]
[height (and/c rational? (>=/c 0)) (default-icon-height)])
([open? boolean? #f]
[#:body-color body-color (or/c string? (is-a?/c color%)) "orange"]
[#:shackle-color shackle-color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[lock-icon lock-flomap])
(define-icon-wrappers
([#:color color (or/c string? (is-a?/c color%)) "black"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)])
[stethoscope-icon stethoscope-flomap]
[short-stethoscope-icon short-stethoscope-flomap])

View File

@ -110,14 +110,15 @@
(+ standing-right-elbow-angle standing-torso-angle standing-right-hand-angle)
lower-arm-length)))
(defproc (standing-stickman-flomap [color (or/c string? (is-a?/c color%))]
[arm-color (or/c string? (is-a?/c color%))]
[head-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (standing-stickman-flomap
[#:body-color body-color (or/c string? (is-a?/c color%)) run-icon-color]
[#:arm-color arm-color (or/c string? (is-a?/c color%)) "white"]
[#:head-color head-color (or/c string? (is-a?/c color%)) run-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color arm-color head-color material]
[height body-color arm-color head-color material]
(flomap-lt-superimpose
(draw-short-rendered-icon-flomap
(λ (dc)
@ -133,11 +134,11 @@
26 32 (/ height 32) material)
(draw-short-rendered-icon-flomap
(λ (dc)
(send dc set-pen (icon-color->outline-color color)
(send dc set-pen (icon-color->outline-color body-color)
(+ body-width (* 2 line-width)) 'solid)
(send dc draw-lines (list standing-neck-point standing-hip-point))
(send dc set-pen (icon-color->outline-color color)
(send dc set-pen (icon-color->outline-color body-color)
(+ leg-width (* 2 line-width)) 'solid)
(send dc draw-lines (list standing-hip-point
standing-left-knee-point
@ -146,10 +147,10 @@
standing-right-knee-point
standing-right-foot-point))
(send dc set-pen color body-width 'solid)
(send dc set-pen body-color body-width 'solid)
(send dc draw-lines (list standing-neck-point standing-hip-point))
(send dc set-pen color leg-width 'solid)
(send dc set-pen body-color leg-width 'solid)
(send dc draw-lines (list standing-hip-point
standing-left-knee-point
standing-left-foot-point))
@ -294,37 +295,40 @@
(draw-running-arm dc t color arm-width))
26 32 (/ height 32) material)))
(defproc (running-stickman-flomap [t rational?]
[color (or/c string? (is-a?/c color%))]
[arm-color (or/c string? (is-a?/c color%))]
[head-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (running-stickman-flomap
[t rational?]
[#:body-color body-color (or/c string? (is-a?/c color%))]
[#:arm-color arm-color (or/c string? (is-a?/c color%))]
[#:head-color head-color (or/c string? (is-a?/c color%))]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height t color arm-color head-color material]
[height t body-color arm-color head-color material]
(flomap-lt-superimpose (running-arm-flomap (+ t 0.5) arm-color height material)
(running-leg-flomap (+ t 0.5) #f color height material)
(running-leg-flomap t #t color height material)
(running-leg-flomap (+ t 0.5) #f body-color height material)
(running-leg-flomap t #t body-color height material)
(running-head-flomap t head-color height material)
(running-arm-flomap t arm-color height material))))
(defproc (standing-stickman-icon [color (or/c string? (is-a?/c color%))]
[arm-color (or/c string? (is-a?/c color%))]
[head-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
) (is-a?/c bitmap%)
(flomap->bitmap (standing-stickman-flomap color arm-color head-color height material)))
;; ---------------------------------------------------------------------------------------------------
(defproc (running-stickman-icon [t rational?]
[color (or/c string? (is-a?/c color%))]
[arm-color (or/c string? (is-a?/c color%))]
[head-color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
) (is-a?/c bitmap%)
(flomap->bitmap (running-stickman-flomap t color arm-color head-color height material)))
(define-icon-wrappers
([#:body-color body-color (or/c string? (is-a?/c color%)) run-icon-color]
[#:arm-color arm-color (or/c string? (is-a?/c color%)) "white"]
[#:head-color head-color (or/c string? (is-a?/c color%)) run-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[standing-stickman-icon standing-stickman-flomap])
(define-icon-wrappers
([t rational?]
[#:body-color body-color (or/c string? (is-a?/c color%)) run-icon-color]
[#:arm-color arm-color (or/c string? (is-a?/c color%)) "white"]
[#:head-color head-color (or/c string? (is-a?/c color%)) run-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[running-stickman-icon running-stickman-flomap])
#;; FOR TESTING ONLY: Do not let this find its way into the repo uncommented!
(begin

View File

@ -3,7 +3,8 @@
(require racket/draw unstable/parameter-group
racket/contract unstable/latent-contract unstable/latent-contract/defthing
"../private/flomap.rkt"
"../private/deep-flomap.rkt")
"../private/deep-flomap.rkt"
(for-syntax syntax/parse))
(provide light-metal-icon-color
metal-icon-color
@ -12,6 +13,7 @@
halt-icon-color
run-icon-color
plastic-icon-material
rubber-icon-material
glass-icon-material
metal-icon-material
bitmap-render-icon
@ -50,6 +52,13 @@
0.8 0.2 0.0
0.0))
(defthing rubber-icon-material deep-flomap-material-value?
(deep-flomap-material-value
'cubic-zirconia 2.0 0.0 1.0
1.5 0.25 1.0
0.25 0.5 0.0
0.03))
(defthing glass-icon-material deep-flomap-material-value?
(deep-flomap-material-value
'cubic-zirconia 1.0 0.75 0.2
@ -76,7 +85,9 @@
(flomap->bitmap (deep-flomap-render-icon dfm material))))
(defproc (icon-color->outline-color [color (or/c string? (is-a?/c color%))]) (is-a?/c color%)
(cond [(string? color) (icon-color->outline-color (send the-color-database find-color color))]
(cond [(string? color) (define c (send the-color-database find-color color))
(cond [c (icon-color->outline-color c)]
[else (icon-color->outline-color "black")])]
[else
(define r (send color red))
(define g (send color green))
@ -155,12 +166,19 @@
;; ===================================================================================================
;; Syntax for writing icon functions
(define-for-syntax (arg-actual arg-stx)
(syntax-parse arg-stx
[[arg-kw:keyword arg-name:id arg-props:expr ...]
(list #'arg-kw #'arg-name)]
[[arg-name:id arg-props:expr ...]
(list #'arg-name)]))
(define-syntax (define-icon-wrappers stx)
(syntax-case stx ()
[(_ ([arg-name arg-props ...] ...)
[icon-fun flomap-fun] ...)
[(_ (arg ...) [icon-fun flomap-fun] ...)
(with-syntax ([(actual-args ...) (apply append (map arg-actual (syntax->list #'(arg ...))))])
(syntax/loc stx
(begin
(defproc (icon-fun [arg-name arg-props ...] ...) (is-a?/c bitmap%)
(flomap->bitmap (flomap-fun arg-name ...)))
...))]))
(defproc (icon-fun arg ...) (is-a?/c bitmap%)
(flomap->bitmap (flomap-fun actual-args ...)))
...)))]))

View File

@ -7,7 +7,7 @@
"../private/utils.rkt"
"style.rkt")
(provide flat-x-flomap
(provide flat-x-flomap flat-check-flomap
(activate-contract-out
text-icon text-flomap
recycle-icon recycle-flomap
@ -44,13 +44,14 @@
0 0))
32 32 (/ height 32)))
(defproc (text-flomap [str string?] [font (is-a?/c font%)]
[color (or/c string? (is-a?/c color%))]
[trim? boolean? #t]
[outline (or/c 'auto (and/c rational? (>=/c 0))) 'auto]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(define size (max 32 (send font get-point-size)))
(defproc (text-flomap [str string?]
[font (is-a?/c font%) (make-font)]
[#:trim? trim? boolean? #t]
[#:color color (or/c string? (is-a?/c color%)) "white"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
[#:outline outline (and/c rational? (>=/c 0)) (/ height 32)]
) flomap?
(define family (send font get-family))
(define style (send font get-style))
(define weight (send font get-weight))
@ -58,26 +59,26 @@
(define smoothing (send font get-smoothing))
(make-cached-flomap
[height str family style weight underline? smoothing color trim? outline material]
(let ([font (make-object font% size family style weight underline? smoothing #t)]
[outline (if (equal? outline 'auto) (/ height 32) outline)])
[height str family style weight underline? smoothing trim? outline color material]
(let ([font (make-object font% (min height 1024) family style weight underline? smoothing #t)])
(define outline-color (icon-color->outline-color color))
(define r (/ (send outline-color red) 255.0))
(define g (/ (send outline-color green) 255.0))
(define b (/ (send outline-color blue) 255.0))
(define r (real->double-flonum (/ (send outline-color red) 255)))
(define g (real->double-flonum (/ (send outline-color green) 255)))
(define b (real->double-flonum (/ (send outline-color blue) 255)))
(define-values (w h) (get-text-size str font))
(define ceiling-amt (inexact->exact (ceiling outline)))
(define ceiling-amt (inexact->exact (min (/ height 2) (ceiling outline))))
(let* ([fm (draw-flomap
(λ (dc)
(send dc scale 2 2)
(send dc set-font font)
(send dc set-text-foreground color)
(send dc draw-text str 0 0 #t))
w h)]
(* w 2) (* h 2))]
[fm (if trim? (flomap-trim fm) fm)]
[fm (flomap-resize fm #f (- height (* 2 ceiling-amt)))]
[fm (flomap-inset fm ceiling-amt)]
[fm (cond [(outline . > . 0)
(flomap-cc-superimpose (flomap-outline fm outline (flvector 1.0 r g b)) fm)]
(flomap-cc-superimpose (flomap-outline fm outline (vector 1.0 r g b)) fm)]
[else fm])])
(flomap-render-icon fm material)))))
@ -132,9 +133,10 @@
(l -11.71875 0.0)
(c -0.6322314 0.0 -0.8622934 -0.175155 -1.0625 -0.34375)))
(defproc (recycle-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (recycle-flomap [#:color color (or/c string? (is-a?/c color%)) "forestgreen"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(draw-short-rendered-icon-flomap
@ -144,9 +146,10 @@
(draw-path-commands dc recycle-path-commands 0 0))
32 32 (/ height 32) material)))
(defproc (x-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (x-flomap [#:color color (or/c string? (is-a?/c color%)) halt-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(define scale (/ height 32))
@ -156,9 +159,10 @@
[dfm (deep-flomap-raise dfm (* -8 scale))])
(deep-flomap-render-icon dfm material))))
(defproc (check-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (check-flomap [#:color color (or/c string? (is-a?/c color%)) run-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(define scale (/ height 32))
@ -225,9 +229,10 @@
-0.9645608778761062 -0.1662308436578171
-1.451858010619469 -0.16614886324483774)))
(defproc (lambda-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (lambda-flomap [#:color color (or/c string? (is-a?/c color%)) "white"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(make-cached-flomap
[height color material]
(draw-rendered-icon-flomap
@ -240,9 +245,10 @@
(draw-path-commands dc lambda-path-commands 4 0))
32 32 (/ height 32) material)))
(defproc (hash-quote-flomap [color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]) flomap?
(defproc (hash-quote-flomap
[#:color color (or/c string? (is-a?/c color%)) "mediumseagreen"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]) flomap?
(make-cached-flomap
[height color material]
(define (draw-hash-quote dc)
@ -271,21 +277,42 @@
;; ===================================================================================================
;; Bitmaps (icons)
(defproc (text-icon [str string?] [font (is-a?/c font%)]
[color (or/c string? (is-a?/c color%))]
[trim? boolean? #t]
[outline (or/c 'auto (and/c rational? (>=/c 0))) 'auto]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
) (is-a?/c bitmap%)
(flomap->bitmap (text-flomap str font color trim? outline height material)))
(define-icon-wrappers
([str string?]
[font (is-a?/c font%) (make-font)]
[#:trim? trim? boolean? #t]
[#:color color (or/c string? (is-a?/c color%)) "white"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
[#:outline outline (and/c rational? (>=/c 0)) (/ height 32)])
[text-icon text-flomap])
(define-icon-wrappers
([color (or/c string? (is-a?/c color%))]
[height (and/c rational? (>=/c 0)) (default-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
[recycle-icon recycle-flomap]
[x-icon x-flomap]
[check-icon check-flomap]
[lambda-icon lambda-flomap]
([#:color color (or/c string? (is-a?/c color%)) "forestgreen"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[recycle-icon recycle-flomap])
(define-icon-wrappers
([#:color color (or/c string? (is-a?/c color%)) halt-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[x-icon x-flomap])
(define-icon-wrappers
([#:color color (or/c string? (is-a?/c color%)) run-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[check-icon check-flomap])
(define-icon-wrappers
([#:color color (or/c string? (is-a?/c color%)) light-metal-icon-color]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[lambda-icon lambda-flomap])
(define-icon-wrappers
([#:color color (or/c string? (is-a?/c color%)) "mediumseagreen"]
[#:height height (and/c rational? (>=/c 0)) (default-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[hash-quote-icon hash-quote-flomap])

View File

@ -31,57 +31,68 @@
(defthing small-macro-stepper-hash-color (or/c string? (is-a?/c color%)) #:document-value
(make-object color% 128 255 128))
(defproc (check-syntax-flomap [height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (check-syntax-flomap
[#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-ht-append
(left-magnifying-glass-flomap metal-icon-color "chocolate" height material)
(left-magnifying-glass-flomap #:frame-color metal-icon-color #:handle-color "chocolate"
#:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/32 height)))) 0)
(check-flomap syntax-icon-color height material)))
(check-flomap #:color syntax-icon-color #:height height #:material material)))
(defproc (small-check-syntax-flomap [height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (small-check-syntax-flomap
[#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-pin*
1 1 5/16 1
(check-flomap syntax-icon-color height material)
(magnifying-glass-flomap metal-icon-color "chocolate" (* 3/4 height) material)))
(check-flomap #:color syntax-icon-color #:height height #:material material)
(magnifying-glass-flomap #:frame-color metal-icon-color #:handle-color "chocolate"
#:height (* 3/4 height) #:material material)))
(defproc (macro-stepper-flomap [height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (macro-stepper-flomap
[#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-ht-append
(hash-quote-flomap macro-stepper-hash-color height material)
(hash-quote-flomap #:color macro-stepper-hash-color #:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/32 height)))) 0)
(step-flomap syntax-icon-color height material)))
(step-flomap #:color syntax-icon-color #:height height #:material material)))
(defproc (small-macro-stepper-flomap [height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (small-macro-stepper-flomap
[#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-pin*
0 0 7/16 0
(step-flomap syntax-icon-color height material)
(hash-quote-flomap small-macro-stepper-hash-color (* 3/4 height) material)))
(step-flomap #:color syntax-icon-color #:height height #:material material)
(hash-quote-flomap #:color small-macro-stepper-hash-color
#:height (* 3/4 height) #:material material)))
(defproc (debugger-flomap [height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (debugger-flomap
[#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-ht-append
(left-bomb-flomap metal-icon-color debugger-bomb-color height material)
(left-bomb-flomap #:cap-color metal-icon-color #:bomb-color debugger-bomb-color
#:height height #:material material)
(make-flomap 4 (max 1 (inexact->exact (round (* 1/16 height)))) 0)
(step-flomap run-icon-color height material)))
(step-flomap #:color run-icon-color #:height height #:material material)))
(defproc (small-debugger-flomap [height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)]
(defproc (small-debugger-flomap
[#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)]
) flomap?
(flomap-pin*
0 0 9/16 0
(step-flomap run-icon-color height material)
(left-bomb-flomap metal-icon-color debugger-bomb-color (* 3/4 height) material)))
(step-flomap #:color run-icon-color #:height height #:material material)
(left-bomb-flomap #:cap-color metal-icon-color #:bomb-color debugger-bomb-color
#:height (* 3/4 height) #:material material)))
(define-icon-wrappers
([height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[material deep-flomap-material-value? (default-icon-material)])
([#:height height (and/c rational? (>=/c 0)) (toolbar-icon-height)]
[#:material material deep-flomap-material-value? (default-icon-material)])
[check-syntax-icon check-syntax-flomap]
[small-check-syntax-icon small-check-syntax-flomap]
[macro-stepper-icon macro-stepper-flomap]

View File

@ -110,7 +110,7 @@
(match-define (flomap _ c w h) fm)
(fm+ fm (fm* z-amt (make-random-flomap c w h))))
(defproc (plt-flomap [height (and/c rational? (>=/c 0)) 256]) flomap?
(defproc (plt-flomap [#:height height (and/c rational? (>=/c 0)) 256]) flomap?
(make-cached-flomap
[height]
(define scale (/ height 256))
@ -258,7 +258,7 @@
(draw-path-commands dc continents-path-commands 0 -17))
32 32 scale))
(defproc (planet-flomap [height (and/c rational? (>=/c 0)) 256]) flomap?
(defproc (planet-flomap [#:height height (and/c rational? (>=/c 0)) 256]) flomap?
(make-cached-flomap
[height]
(define scale (/ height 32))
@ -302,20 +302,23 @@
;; ===================================================================================================
;; Algebraic stepper logo
(defproc (stepper-flomap [height (and/c rational? (>=/c 0)) 96]) flomap?
(defproc (stepper-flomap [#:height height (and/c rational? (>=/c 0)) 96]) flomap?
(flomap-pin*
1/2 20/32 1/2 1/2
(foot-flomap "forestgreen" height glass-icon-material)
(lambda-flomap light-metal-icon-color (* 5/8 height) metal-icon-material)))
(foot-flomap #:color "forestgreen" #:height height #:material glass-icon-material)
(lambda-flomap #:color light-metal-icon-color
#:height (* 5/8 height) #:material metal-icon-material)))
;; ===================================================================================================
;; Macro stepper logo
(defproc (macro-stepper-logo-flomap [height (and/c rational? (>=/c 0)) 96]) flomap?
(defproc (macro-stepper-logo-flomap [#:height height (and/c rational? (>=/c 0)) 96]) flomap?
(flomap-pin*
1/2 20/32 15/36 1/2
(foot-flomap (make-object color% 34 42 160) height glass-icon-material)
(hash-quote-flomap light-metal-icon-color (* 1/2 height) metal-icon-material)))
(foot-flomap #:color (make-object color% 34 42 160) #:height height #:material glass-icon-material)
(hash-quote-flomap #:color light-metal-icon-color
#:height (* 1/2 height)
#:material metal-icon-material)))
;; ===================================================================================================
;; Racket logo
@ -351,7 +354,7 @@
0.5 0.25 0.0
0.01))
(defproc (racket-flomap [height (and/c rational? (>=/c 0)) 256]) flomap?
(defproc (racket-flomap [#:height height (and/c rational? (>=/c 0)) 256]) flomap?
(make-cached-flomap
[height]
(define scale (/ height 32))
@ -404,30 +407,12 @@
;; Bitmaps
(define-icon-wrappers
([height (and/c rational? (>=/c 0)) 256])
([#:height height (and/c rational? (>=/c 0)) 256])
[plt-logo plt-flomap]
[racket-logo racket-flomap])
(define-icon-wrappers
([height (and/c rational? (>=/c 0)) 96])
([#:height height (and/c rational? (>=/c 0)) 96])
[planet-logo planet-flomap]
[stepper-logo stepper-flomap]
[macro-stepper-logo macro-stepper-logo-flomap])
#|
(define steth-flomap
(short-stethoscope-flomap (make-object color% 16 32 48) 256))
(define drracket-logo1
(flomap->bitmap
(flomap-cc-superimpose (plt-flomap 256) steth-flomap)))
drracket-logo1
(define drracket-logo2
(flomap->bitmap
(flomap-ct-superimpose (racket-flomap 212) steth-flomap)))
drracket-logo2
|#

View File

@ -29,7 +29,9 @@ The literal bitmap values are encoded in @link["http://en.wikipedia.org/wiki/Por
To get the most from compiled bitmaps during development, it is best to put them in files that are changed infrequently.
For example, for games, we suggest having a separate module called something like @tt{images.rkt} or @tt{resources.rkt} that @racket[provide]s all the game's images.
@defform[(compiled-bitmap expr [quality])]{
@defform[(compiled-bitmap expr [quality])
#:contracts ([expr (is-a?/c bitmap%)]
[quality (integer-in 0 100)])]{
Evaluates @racket[expr] at expansion time, which must return a @racket[bitmap%], and returns to the bitmap at run time.
Keep in mind that @racket[expr] has access only to expansion-time values, not run-time values.
@ -45,7 +47,7 @@ For example, suppose we are computing a large PLT logo at run time:
@racketblock+eval[#:eval ctime-eval
(require images/logos)
(define the-logo (plt-logo 384))
(define the-logo (plt-logo #:height 384))
]
Running this takes several seconds. It produces
@interaction[#:eval ctime-eval the-logo]
@ -57,14 +59,16 @@ To move the cost to expansion time, we change the program to
(require images/compile-time
(for-syntax images/logos))
(define the-logo (compiled-bitmap (plt-logo 384)))
(define the-logo (compiled-bitmap (plt-logo #:height 384)))
}|
The logo is unchanged, but now @italic{expanding} (and thus compiling) the program takes several seconds, and running it takes a few milliseconds.
Note that @racketmodname[images/logos] is now required @racket[for-syntax], so that the expansion-phase expression @racket[(plt-logo 384)]
Note that @racketmodname[images/logos] is now required @racket[for-syntax], so that the expansion-phase expression @racket[(plt-logo #:height 384)]
has access to the identifier @racket[plt-logo].
}
@defform[(compiled-bitmap-list expr [quality])]{
@defform[(compiled-bitmap-list expr [quality])
#:contracts ([expr (listof (is-a?/c bitmap%))]
[quality (integer-in 0 100)])]{
Like @racket[compiled-bitmap], but it expects @racket[expr] to return a @racket[list] of @racket[bitmap%]s, and it returns the list at run time.
The @racket[quality] argument works as in @racket[compiled-bitmap], but is applied to all the images in the list.
@ -80,7 +84,10 @@ Use this for animations. For example,
(define running-stickman-frames
(compiled-bitmap-list
(for/list ([t (in-range 0 1 (/ 1 num-stickman-frames))])
(running-stickman-icon t "red" "white" "red" 32))
(running-stickman-icon t #:height 32
#:body-color "red"
#:arm-color "white"
#:head-color "red"))
50))
]
This computes

View File

@ -116,7 +116,7 @@ This conceptual model allows us to treat flomaps as if they were multi-valued fu
For example, we might plot the red component of an ARGB icon:
@interaction[#:eval flomap-eval
(require images/icons/misc plot)
(define icon-fm (bomb-flomap "azure" "orange" 48))
(define icon-fm (bomb-flomap #:bomb-color "orange" #:height 48))
(flomap->bitmap icon-fm)
(define-values (icon-width icon-height) (flomap-size icon-fm))
(plot3d-bitmap (contour-intervals3d

View File

@ -45,21 +45,22 @@ Its shape and color are a visual metaphor for an action or a message.
Icons should be @bold{easily recognizable}, @bold{distinguishable}, @bold{visually consistent}, and @bold{metaphorically appropriate} for the actions and messages they are used with.
It can be difficult to meet all four requirements at once (``distinguishable'' and ``visually consistent' are often at odds), but good examples, good abstractions, and an existing icon library help considerably.
@(define (hash-quote) (hash-quote-icon macro-stepper-hash-color 16))
@(define (step) (step-icon syntax-icon-color 16))
@(define (play) (play-icon syntax-icon-color 16))
@(define (bar) (bar-icon syntax-icon-color 16))
@(define (macro-stepper) (macro-stepper-icon 16))
@(define (hash-quote) (hash-quote-icon #:color macro-stepper-hash-color #:height 16))
@(define (step) (step-icon #:color syntax-icon-color #:height 16))
@(define (play) (play-icon #:color syntax-icon-color #:height 16))
@(define (bar) (bar-icon #:color syntax-icon-color #:height 16))
@(define (macro-stepper) (macro-stepper-icon #:height 16))
Example: The Macro Stepper icon is composed by appending a text icon @(hash-quote) and a step icon @(step) to get @(macro-stepper).
The syntax quote icon @(hash-quote) is the color that DrRacket colors syntax quotes by default.
The step icon @(step) is colored like DrRacket colors identifier syntax by default, and is shaped using metaphors used in debugger toolbars, TV remotes, and music players around the world.
It is composed of @(play) to connote starting and @(bar) to connote immediately stopping.
It would not do to have just @(step) as the Macro Stepper icon: it would be too easily confused with the Debugger icon @(step-icon run-icon-color 16),
It would not do to have just @(step) as the Macro Stepper icon: it would be too easily confused with the Debugger icon @(step-icon #:color run-icon-color #:height 16),
especially for new users and people with certain forms of color-blindness, and thus fail to be distinguishable enough.
As another example, the Check Syntax icon @(check-syntax-icon 16) connotes inspecting and passing. Note that the check mark is also the color of syntax.
As another example, the Check Syntax icon @(check-syntax-icon #:height 16) connotes inspecting and passing.
Notice that the check mark is also the color of syntax.
@;====================================================================================================
@ -72,12 +73,14 @@ For example, a media player application might create a large ``step'' button by
(require slideshow/pict images/icons/control images/icons/style)
(pict->bitmap
(cc-superimpose
(bitmap (record-icon "forestgreen" 96 glass-icon-material))
(bitmap (step-icon light-metal-icon-color 48 metal-icon-material))))]
(bitmap (record-icon #:color "forestgreen" #:height 96
#:material glass-icon-material))
(bitmap (step-icon #:color light-metal-icon-color #:height 48
#:material metal-icon-material))))]
All the icons in this collection are first drawn using standard @racket[dc<%>] drawing commands.
Then, to get lighting effects, they are turned into 3D objects and @link["http://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29"]{ray traced}.
Many are afterward composed to create new icons; for example, the @racket[stop-signs-icon] @(stop-signs-icon halt-icon-color 16) superimposes three @racket[stop-sign-icon]s, and the @racket[magnifying-glass-icon] @(magnifying-glass-icon metal-icon-color "orange" 16) is composed of three others (frame, glass and handle).
Many are afterward composed to create new icons; for example, the @racket[stop-signs-icon] @(stop-signs-icon #:height 16) superimposes three @racket[stop-sign-icon]s, and the @racket[magnifying-glass-icon] @(magnifying-glass-icon #:height 16) is composed of three others (frame, glass and handle).
The ray tracer helps keep icons visually consistent with each other and with physical objects in day-to-day life.
As an example of the latter, the @racket[record-icon], when rendered in clear glass, looks like the clear, round button on a @link["http://en.wikipedia.org/wiki/Wiimote"]{Wii Remote}.
@ -110,16 +113,19 @@ Good colors to use with @racket[metal-icon-material]. See @racket[bomb-icon] and
Standard toolbar icon colors.
Use @racket[syntax-icon-color] in icons that connote macro expansion or syntax. Example:
@interaction[#:eval icons-eval (step-icon syntax-icon-color 32)]
@interaction[#:eval icons-eval (step-icon #:color syntax-icon-color #:height 32)]
Use @racket[halt-icon-color] in icons that connote stopping or errors. Example:
@interaction[#:eval icons-eval (stop-icon halt-icon-color 32)]
@interaction[#:eval icons-eval (stop-icon #:color halt-icon-color #:height 32)]
Use @racket[run-icon-color] in icons that connote executing programs or evaluation. Examples:
@interaction[#:eval icons-eval
(play-icon run-icon-color 32)
(play-icon #:color run-icon-color #:height 32)
(require images/icons/stickman)
(running-stickman-icon 0.9 run-icon-color "white" run-icon-color 32)]
(running-stickman-icon 0.9 #:height 32
#:body-color run-icon-color
#:arm-color "white"
#:head-color run-icon-color)]
For new users and for accessibility reasons, do not try to differentiate icons for similar functions only by color.
}
@ -138,27 +144,30 @@ If you cannot, as with the Macro Stepper, send a thinner icon as the @racket[alt
}
@doc-apply[plastic-icon-material]
@doc-apply[rubber-icon-material]
@doc-apply[glass-icon-material]
@doc-apply[metal-icon-material]{
Materials for icons.
Plastic is opaque and reflects a little more than glass.
Rubber is also opaque, reflects more light than plastic, but diffuses less.
Glass is transparent but frosted, so it scatters refracted light.
It has the high refractive index of @link["http://en.wikipedia.org/wiki/Cubic_zirconia"]{cubic zirconia}, or fake diamond.
The ``glassy look'' cannot actually be achieved using glass.
Metal reflects the most, its @link["http://en.wikipedia.org/wiki/Specular_highlight"]{specular highlight} is nearly the same color as the material (in the others, the highlight is white),
and it diffuses much more ambient light than directional.
This is because, while plastic and glass mostly reflect light directly, metal mostly absorbs light and re-emits it.
This is because while plastic and glass mostly reflect light directly, metal mostly absorbs light and re-emits it.
@examples[#:eval icons-eval
(require images/icons/misc)
(for/list ([material (list plastic-icon-material
rubber-icon-material
glass-icon-material
metal-icon-material)])
(bomb-icon light-metal-icon-color dark-metal-icon-color 32
material))]
(bomb-icon #:height 32 #:material material))]
}
@doc-apply[default-icon-material]{
@ -195,7 +204,8 @@ As an example, here is how to duplicate the @racket[record-icon] using @racketmo
(pict->bitmap (inset (cc-superimpose brush-pict pen-pict) 1))
5/8 glass-icon-material)
(record-icon "forestgreen" 64 glass-icon-material)]
(record-icon #:color "forestgreen" #:height 64
#:material glass-icon-material)]
The outline width is usually @racket[(/ height 32)] (in this case, @racket[2]), but not always.
(For example, @racket[recycle-icon] is an exception, as are parts of @racket[floppy-disk-icon].)
@ -214,10 +224,12 @@ The outline width is usually @racket[(/ height 32)] (in this case, @racket[2]),
@doc-apply[down-arrow-icon]{
Standard directional arrows.
@examples[#:eval icons-eval
(list (right-arrow-icon syntax-icon-color (toolbar-icon-height))
(left-arrow-icon run-icon-color)
(up-arrow-icon halt-icon-color 37)
(down-arrow-icon "lightblue" 44 glass-icon-material))]
(list (right-arrow-icon #:color syntax-icon-color
#:height (toolbar-icon-height))
(left-arrow-icon #:color run-icon-color)
(up-arrow-icon #:color halt-icon-color #:height 37)
(down-arrow-icon #:color "lightblue" #:height 44
#:material glass-icon-material))]
}
@doc-apply[right-over-arrow-icon]
@ -226,10 +238,12 @@ Standard directional arrows.
@doc-apply[left-under-arrow-icon]{
Standard bent arrows.
@examples[#:eval icons-eval
(list (right-over-arrow-icon metal-icon-color (toolbar-icon-height))
(left-over-arrow-icon dark-metal-icon-color)
(right-under-arrow-icon run-icon-color 37)
(left-under-arrow-icon "lightgreen" 44 glass-icon-material))]
(list (right-over-arrow-icon #:color metal-icon-color
#:height (toolbar-icon-height))
(left-over-arrow-icon #:color dark-metal-icon-color)
(right-under-arrow-icon #:color run-icon-color #:height 37)
(left-under-arrow-icon #:color "lightgreen" #:height 44
#:material glass-icon-material))]
}
@;====================================================================================================
@ -240,22 +254,22 @@ Standard bent arrows.
@interaction-eval[#:eval icons-eval (require images/icons/control)]
@doc-apply[bar-icon]{
@examples[#:eval icons-eval (bar-icon run-icon-color 32)]
@examples[#:eval icons-eval (bar-icon #:color run-icon-color #:height 32)]
This is not a ``control'' icon @italic{per se}, but is used to make many others.
}
@doc-apply[play-icon]{ @examples[#:eval icons-eval (play-icon run-icon-color 32)] }
@doc-apply[back-icon]{ @examples[#:eval icons-eval (back-icon run-icon-color 32)] }
@doc-apply[fast-forward-icon]{ @examples[#:eval icons-eval (fast-forward-icon syntax-icon-color 32)] }
@doc-apply[rewind-icon]{ @examples[#:eval icons-eval (rewind-icon syntax-icon-color 32)] }
@doc-apply[stop-icon]{ @examples[#:eval icons-eval (stop-icon halt-icon-color 32)] }
@doc-apply[record-icon]{ @examples[#:eval icons-eval (record-icon "red" 32)] }
@doc-apply[pause-icon]{ @examples[#:eval icons-eval (pause-icon halt-icon-color 32)] }
@doc-apply[step-icon]{ @examples[#:eval icons-eval (step-icon run-icon-color 32)] }
@doc-apply[step-back-icon]{ @examples[#:eval icons-eval (step-back-icon run-icon-color 32)] }
@doc-apply[continue-forward-icon]{ @examples[#:eval icons-eval (continue-forward-icon run-icon-color 32)] }
@doc-apply[continue-backward-icon]{ @examples[#:eval icons-eval (continue-backward-icon run-icon-color 32)] }
@doc-apply[search-forward-icon]{ @examples[#:eval icons-eval (search-forward-icon syntax-icon-color 32)] }
@doc-apply[search-backward-icon]{ @examples[#:eval icons-eval (search-backward-icon syntax-icon-color 32)] }
@doc-apply[play-icon]{ @examples[#:eval icons-eval (play-icon #:color run-icon-color #:height 32)] }
@doc-apply[back-icon]{ @examples[#:eval icons-eval (back-icon #:color run-icon-color #:height 32)] }
@doc-apply[fast-forward-icon]{ @examples[#:eval icons-eval (fast-forward-icon #:color syntax-icon-color #:height 32)] }
@doc-apply[rewind-icon]{ @examples[#:eval icons-eval (rewind-icon #:color syntax-icon-color #:height 32)] }
@doc-apply[stop-icon]{ @examples[#:eval icons-eval (stop-icon #:color halt-icon-color #:height 32)] }
@doc-apply[record-icon]{ @examples[#:eval icons-eval (record-icon #:color "red" #:height 32)] }
@doc-apply[pause-icon]{ @examples[#:eval icons-eval (pause-icon #:color halt-icon-color #:height 32)] }
@doc-apply[step-icon]{ @examples[#:eval icons-eval (step-icon #:color run-icon-color #:height 32)] }
@doc-apply[step-back-icon]{ @examples[#:eval icons-eval (step-back-icon #:color run-icon-color #:height 32)] }
@doc-apply[continue-forward-icon]{ @examples[#:eval icons-eval (continue-forward-icon #:color run-icon-color #:height 32)] }
@doc-apply[continue-backward-icon]{ @examples[#:eval icons-eval (continue-backward-icon #:color run-icon-color #:height 32)] }
@doc-apply[search-forward-icon]{ @examples[#:eval icons-eval (search-forward-icon #:color syntax-icon-color #:height 32)] }
@doc-apply[search-backward-icon]{ @examples[#:eval icons-eval (search-backward-icon #:color syntax-icon-color #:height 32)] }
@;====================================================================================================
@ -264,11 +278,11 @@ This is not a ``control'' icon @italic{per se}, but is used to make many others.
@defmodule[images/icons/file]
@interaction-eval[#:eval icons-eval (require images/icons/file)]
@doc-apply[floppy-disk-icon]{ @examples[#:eval icons-eval (floppy-disk-icon "crimson" 32 glass-icon-material)] }
@doc-apply[save-icon]{ @examples[#:eval icons-eval (save-icon syntax-icon-color run-icon-color 32)] }
@doc-apply[load-icon]{ @examples[#:eval icons-eval (load-icon syntax-icon-color metal-icon-color 32)] }
@doc-apply[small-save-icon]{ @examples[#:eval icons-eval (small-save-icon syntax-icon-color halt-icon-color 32)] }
@doc-apply[small-load-icon]{ @examples[#:eval icons-eval (small-load-icon syntax-icon-color dark-metal-icon-color 32)] }
@doc-apply[floppy-disk-icon]{ @examples[#:eval icons-eval (floppy-disk-icon #:height 32 #:material glass-icon-material)] }
@doc-apply[save-icon]{ @examples[#:eval icons-eval (save-icon #:height 32)] }
@doc-apply[load-icon]{ @examples[#:eval icons-eval (load-icon #:height 32)] }
@doc-apply[small-save-icon]{ @examples[#:eval icons-eval (small-save-icon #:height 32)] }
@doc-apply[small-load-icon]{ @examples[#:eval icons-eval (small-load-icon #:height 32)] }
@;====================================================================================================
@ -281,57 +295,44 @@ This is not a ``control'' icon @italic{per se}, but is used to make many others.
Renders a text string as an icon. For example,
@interaction[#:eval icons-eval
(text-icon "An Important Point!"
(make-object font% 48 'decorative 'normal 'bold #t)
"lightskyblue" #t 'auto 48)]
(make-font #:weight 'bold #:underlined? #t)
#:color "lightskyblue" #:height 44)]
Before rendering, the drawn text is scaled so that it is exactly @racket[height] pixels tall.
Make sure the font is large enough that scaling does not create blurry and jagged edge artifacts, as in the following example:
@interaction[#:eval icons-eval
(text-icon "Q" (make-object font% 32 'default 'normal 'bold)
"green" #t 0 96)]
When @racket[str] contains tall letters or @racket[trim?] is @racket[#f], using @racket[height] as the font size should be sufficient.
To make it easy to create a large enough font, @racket[text-icon] always interpets font sizes as being in pixels, never points.
See @racket[font%] for details on font sizes.
If @racket[trim?] is @racket[#f], the drawn text is not cropped before rendering.
The size of @racket[font] is ignored. If @racket[trim?] is @racket[#f], the drawn text is not cropped before rendering.
Otherwise, it is cropped to the smallest rectangle containing all the non-zero-alpha pixels.
Rendering very small glyphs shows the difference dramatically:
@interaction[#:eval icons-eval
(define font (make-object font% 32 'default))
(list (text-icon "." font "white")
(text-icon "." font "white" #f))]
Note that both icons are @racket[(default-icon-height)] pixels tall.
(list (text-icon "." #:trim? #t)
(text-icon "." #:trim? #f))]
Notice that both icons are @racket[(default-icon-height)] pixels tall.
When @racket[outline] is @racket['auto], the outline drawn around the text is @racket[(/ height 32)] pixels wide.
Because different platforms have different fonts, @racket[text-icon] cannot guarantee the icons it returns have a consistent look or width across all platforms, or that the unicode characters will exist.
Because different platforms have different fonts, @racket[text-icon] cannot guarantee the icons it returns have a consistent look or width across all platforms, or that any unicode characters in @racket[str] will exist.
}
@doc-apply[recycle-icon]{
Returns the universal recycling symbol, rendered as an icon.
@examples[#:eval icons-eval (recycle-icon (make-object color% 0 153 0) 48)]
@examples[#:eval icons-eval (recycle-icon #:height 48)]
}
@doc-apply[x-icon]{
Returns an ``x'' icon that is guaranteed to look the same on all platforms.
(Anything similar that would be constructed by @racket[text-icon] would differ at least slightly across platforms.)
@examples[#:eval icons-eval (x-icon "red" 32)]
@examples[#:eval icons-eval (x-icon #:height 32)]
}
@doc-apply[check-icon]{
@examples[#:eval icons-eval (check-icon "darkgreen" 32)]
@examples[#:eval icons-eval (check-icon #:height 32)]
}
@doc-apply[lambda-icon]{
@examples[#:eval icons-eval
(lambda-icon light-metal-icon-color 32 metal-icon-material)]
(lambda-icon #:height 32 #:material metal-icon-material)]
}
@doc-apply[hash-quote-icon]{
@examples[#:eval icons-eval
(require (only-in images/icons/tool macro-stepper-hash-color))
(hash-quote-icon macro-stepper-hash-color 32)]
(hash-quote-icon #:color macro-stepper-hash-color #:height 32)]
}
@;====================================================================================================
@ -343,62 +344,77 @@ Returns an ``x'' icon that is guaranteed to look the same on all platforms.
@doc-apply[regular-polygon-icon]{
Renders the largest regular polygon with @racket[sides] sides, with the first vertex at angle @racket[start], that can be centered in a @racket[height] × @racket[height] box.
The default @racket[start] angle is chosen so that the polygon has a horizontal bottom edge.
@examples[#:eval icons-eval (for/list ([sides (in-range 1 9)]
[material (in-cycle (list plastic-icon-material
glass-icon-material))])
(regular-polygon-icon sides (* 1/4 pi) "cornflowerblue" 32
material))]
}
@doc-apply[octagon-icon]{
Equivalent to @racket[(regular-polygon-icon 8 (/ (* 2 pi) 16) color height material)].
@examples[#:eval icons-eval (octagon-icon halt-icon-color 32)]
(regular-polygon-icon sides #:color "cornflowerblue" #:height 32
#:material material))]
}
@doc-apply[stop-sign-icon]{
@examples[#:eval icons-eval
(stop-sign-icon halt-icon-color 32 glass-icon-material)]
(stop-sign-icon #:height 32 #:material glass-icon-material)]
}
@doc-apply[stop-signs-icon]{
@examples[#:eval icons-eval
(stop-signs-icon halt-icon-color 32 plastic-icon-material)]
(stop-signs-icon #:height 32 #:material plastic-icon-material)]
}
@doc-apply[foot-icon]{
@examples[#:eval icons-eval
(foot-icon "chocolate" 32 glass-icon-material)]
(foot-icon #:color "chocolate" #:height 32
#:material glass-icon-material)]
}
@doc-apply[magnifying-glass-icon]{
@examples[#:eval icons-eval
(magnifying-glass-icon light-metal-icon-color "lightblue" 32
glass-icon-material)]
(magnifying-glass-icon #:height 32)]
}
@doc-apply[left-magnifying-glass-icon]{
@examples[#:eval icons-eval
(left-magnifying-glass-icon metal-icon-color "red" 32)]
(left-magnifying-glass-icon #:height 32)]
}
@doc-apply[bomb-icon]{
@examples[#:eval icons-eval
(bomb-icon light-metal-icon-color "black" 32 glass-icon-material)]
(bomb-icon #:height 48 #:material glass-icon-material)]
}
@doc-apply[left-bomb-icon]{
@examples[#:eval icons-eval
(left-bomb-icon metal-icon-color dark-metal-icon-color 32)]
(left-bomb-icon #:height 48)]
}
@doc-apply[clock-icon]{
@examples[#:eval icons-eval
(clock-icon 96)
(clock-icon 48 "lightblue" "darkblue" 3 21)]
(clock-icon #:height 96)
(clock-icon 3 21 #:height 48
#:face-color "lightblue"
#:hand-color "darkblue")]
}
@doc-apply[stopwatch-icon]{
@examples[#:eval icons-eval (stopwatch-icon 96)]
@examples[#:eval icons-eval (stopwatch-icon #:height 96)]
}
@doc-apply[stethoscope-icon]{
@examples[#:eval icons-eval (stethoscope-icon #:height 96)]
}
@doc-apply[short-stethoscope-icon]{
@examples[#:eval icons-eval (short-stethoscope-icon #:color "purple" #:height 96)]
}
@doc-apply[lock-icon]{
@examples[#:eval icons-eval
(lock-icon #:height 32)
(lock-icon #t #:height 48
#:body-color "navajowhite"
#:shackle-color "lemonchiffon"
#:material glass-icon-material)]
}
@;====================================================================================================
@ -410,7 +426,7 @@ Equivalent to @racket[(regular-polygon-icon 8 (/ (* 2 pi) 16) color height mater
@doc-apply[standing-stickman-icon]{
Returns the icon displayed in DrRacket's lower-right corner when no program is running.
@examples[#:eval icons-eval (standing-stickman-icon run-icon-color "white" run-icon-color 64)]
@examples[#:eval icons-eval (standing-stickman-icon #:height 64)]
}
@doc-apply[running-stickman-icon]{
@ -420,7 +436,7 @@ The frame returned is for time @racket[t] of a run cycle with a one-second perio
The following example samples the run cycle at 12 Hz, or every @racket[1/12] second:
@interaction[#:eval icons-eval
(for/list ([t (in-range 0 1 1/12)])
(running-stickman-icon t run-icon-color "white" run-icon-color 32))]
(running-stickman-icon t #:height 32))]
The stickman's joint angles are defined by continuous periodic functions, so the run cycle can be sampled at any resolution, or at any real-valued time @racket[t].
The cycle is modeled after the run cycle of the player's avatar in the Commodore 64 game @link["http://en.wikipedia.org/wiki/Impossible_Mission"]{Impossible Mission}.
@ -436,19 +452,22 @@ The cycle is modeled after the run cycle of the player's avatar in the Commodore
@doc-apply[check-syntax-icon]
@doc-apply[small-check-syntax-icon]{
Icons for Check Syntax. The @racket[small-check-syntax-icon] is used when the toolbar is on the side.
@examples[#:eval icons-eval (list (check-syntax-icon 32) (small-check-syntax-icon 32))]
@examples[#:eval icons-eval (list (check-syntax-icon #:height 32)
(small-check-syntax-icon #:height 32))]
}
@doc-apply[macro-stepper-icon]
@doc-apply[small-macro-stepper-icon]{
Icons for the Macro Stepper. The @racket[small-macro-stepper-icon] is used when the toolbar is on the side.
@examples[#:eval icons-eval (list (macro-stepper-icon 32) (small-macro-stepper-icon 32))]
@examples[#:eval icons-eval (list (macro-stepper-icon #:height 32)
(small-macro-stepper-icon #:height 32))]
}
@doc-apply[debugger-icon]
@doc-apply[small-debugger-icon]{
Icons for the Debugger. The @racket[small-debugger-icon] is used when the toolbar is on the side.
@examples[#:eval icons-eval (list (debugger-icon 32) (small-debugger-icon 32))]
@examples[#:eval icons-eval (list (debugger-icon #:height 32)
(small-debugger-icon #:height 32))]
}
@doc-apply[debugger-bomb-color]

View File

@ -3,7 +3,7 @@
@(require scribble/eval
unstable/latent-contract/defthing
(for-label images/logos
racket)
racket racket/draw)
images/logos)
@(define (author-email) "neil.toronto@gmail.com")
@ -26,7 +26,7 @@ The default height is the size used for DrRacket splash screen.
Returns an unofficial PLaneT logo. This is used as the PLaneT icon when DrRacket downloads PLaneT packages.
@examples[#:eval logos-eval
(planet-logo)
(planet-logo (default-icon-height))]
(planet-logo #:height (default-icon-height))]
}
@doc-apply[stepper-logo]{

View File

@ -19,11 +19,11 @@
(flomap-cc-superimpose (flomap-shadow fm σ color) fm))
(define plt-fm
(flomap-shadowed (flomap-inset (plt-flomap (- size (* 4 blur))) (* 2 blur))
(flomap-shadowed (flomap-inset (plt-flomap #:height (- size (* 4 blur))) (* 2 blur))
blur #(1/2 0 0 1/8)))
(define racket-fm
(flomap-shadowed (flomap-inset (racket-flomap (- size (* 4 blur))) (* 2 blur))
(flomap-shadowed (flomap-inset (racket-flomap #:height (- size (* 4 blur))) (* 2 blur))
blur #(1/2 1/8 0 0)))
(define logo-flomap* (flomap-whirl-morph plt-fm racket-fm))

View File

@ -32,7 +32,7 @@
(compiled-bitmap-list
(for/list ([t (in-range 0 1 (/ 1 num-running-frames))])
(running-stickman-icon t run-icon-color "white" run-icon-color stickman-height)))
(running-stickman-icon t #:height stickman-height)))
;; ===================================================================================================
;; Other icons, various colors
@ -44,17 +44,19 @@
(list right-arrow-icon left-arrow-icon up-arrow-icon down-arrow-icon
right-over-arrow-icon left-over-arrow-icon right-under-arrow-icon left-under-arrow-icon)
(list floppy-disk-icon
(λ (color) (save-icon syntax-icon-color color))
(λ (color) (load-icon syntax-icon-color color))
(λ (color) (small-save-icon syntax-icon-color color))
(λ (color) (small-load-icon syntax-icon-color color)))
(λ (#:color color) (save-icon #:arrow-color syntax-icon-color #:disk-color color))
(λ (#:color color) (load-icon #:arrow-color syntax-icon-color #:disk-color color))
(λ (#:color color) (small-save-icon #:arrow-color syntax-icon-color #:disk-color color))
(λ (#:color color) (small-load-icon #:arrow-color syntax-icon-color #:disk-color color)))
(list x-icon check-icon recycle-icon lambda-icon hash-quote-icon)
(list octagon-icon stop-sign-icon stop-signs-icon foot-icon
(λ (color) (magnifying-glass-icon metal-icon-color color))
(λ (color) (left-magnifying-glass-icon metal-icon-color color))
(λ (color) (bomb-icon metal-icon-color color))
(λ (color) (left-bomb-icon metal-icon-color color))
(λ (color) (stopwatch-icon (default-icon-height) color)))))
(list stop-sign-icon stop-signs-icon foot-icon
(λ (#:color color) (magnifying-glass-icon #:frame-color metal-icon-color
#:handle-color color))
(λ (#:color color) (left-magnifying-glass-icon #:frame-color metal-icon-color
#:handle-color color))
(λ (#:color color) (bomb-icon #:bomb-color color))
(λ (#:color color) (left-bomb-icon #:bomb-color color))
(λ (#:color color) (stopwatch-icon #:height (default-icon-height) #:face-color color)))))
(define tool-icon-procs
(list check-syntax-icon small-check-syntax-icon
@ -64,7 +66,7 @@
(define (icons color)
(for/list ([fs icon-procss])
(for/list ([f fs])
(f color))))
(f #:color color))))
(define (colored-icons-test)
(printf "~v~n" (for/list ([f tool-icon-procs])

View File

@ -27,19 +27,19 @@
;; Compiled-in assets (button icons)
(define navigate-up-icon
(compiled-bitmap (up-arrow-icon syntax-icon-color (toolbar-icon-height))))
(compiled-bitmap (up-arrow-icon #:color syntax-icon-color #:height (toolbar-icon-height))))
(define navigate-to-start-icon
(compiled-bitmap (search-backward-icon syntax-icon-color (toolbar-icon-height))))
(compiled-bitmap (search-backward-icon #:color syntax-icon-color #:height (toolbar-icon-height))))
(define navigate-previous-icon
(compiled-bitmap (step-back-icon syntax-icon-color (toolbar-icon-height))))
(compiled-bitmap (step-back-icon #:color syntax-icon-color #:height (toolbar-icon-height))))
(define navigate-next-icon
(compiled-bitmap (step-icon syntax-icon-color (toolbar-icon-height))))
(compiled-bitmap (step-icon #:color syntax-icon-color #:height (toolbar-icon-height))))
(define navigate-to-end-icon
(compiled-bitmap (search-forward-icon syntax-icon-color (toolbar-icon-height))))
(compiled-bitmap (search-forward-icon #:color syntax-icon-color #:height (toolbar-icon-height))))
(define navigate-down-icon
(compiled-bitmap (down-arrow-icon syntax-icon-color (toolbar-icon-height))))
(compiled-bitmap (down-arrow-icon #:color syntax-icon-color #:height (toolbar-icon-height))))
(define small-logo (compiled-bitmap (macro-stepper-logo 32)))
(define small-logo (compiled-bitmap (macro-stepper-logo #:height 32)))
(define large-logo (compiled-bitmap (macro-stepper-logo)))
(define (show-about-dialog parent)

View File

@ -516,7 +516,7 @@
(strip-regular stx))
;; the bitmap to use in a horizontal or vertical toolbar:
(define step-img (compiled-bitmap (step-icon run-icon-color (toolbar-icon-height))))
(define step-img (compiled-bitmap (step-icon #:color run-icon-color #:height (toolbar-icon-height))))
;; testing code

View File

@ -284,19 +284,21 @@
(define logo-canvas
(new (class bitmap-canvas%
(super-new [parent top-panel] [bitmap (compiled-bitmap (stepper-logo 32))])
(super-new [parent top-panel] [bitmap (compiled-bitmap (stepper-logo #:height 32))])
(define/override (on-event evt)
(when (eq? (send evt get-event-type) 'left-up)
(show-about-dialog s-frame))))))
(define prev-img (compiled-bitmap (step-back-icon run-icon-color (toolbar-icon-height))))
(define prev-img (compiled-bitmap (step-back-icon #:color run-icon-color
#:height (toolbar-icon-height))))
(define previous-button (new button%
[label (list prev-img (string-constant stepper-previous) 'left)]
[parent button-panel]
[callback (λ (_1 _2) (previous))]
[enabled #f]))
(define next-img (compiled-bitmap (step-icon run-icon-color (toolbar-icon-height))))
(define next-img (compiled-bitmap (step-icon #:color run-icon-color
#:height (toolbar-icon-height))))
(define next-button (new button%
[label (list next-img (string-constant stepper-next) 'right)]
[parent button-panel]

View File

@ -70,8 +70,8 @@
(define message-text (new text:basic% [auto-wrap #t]))
(send message-text insert
(make-object image-snip% (if (missed-opt-report-entry? s)
(x-icon "red" 20)
(check-icon "green" 20))))
(x-icon #:height 20)
(check-icon #:height 20))))
(send message-text insert-port
(open-input-string (string-append " " msg)))
;; adjust display

View File

@ -13,7 +13,7 @@
;; DrRacket tool for reporting missed optimizations in the editor.
(define performance-report-bitmap
(compiled-bitmap (stopwatch-icon (toolbar-icon-height))))
(compiled-bitmap (stopwatch-icon #:height (toolbar-icon-height))))
;; performance-report-callback : drracket:unit:frame<%> -> void
(define (performance-report-callback drr-frame)