(module (s9fes char-canvas shape vgroup) (;export ; real-shape-vgroup ; shape-vgroup) (import scheme utf8) (import (chicken base)) (import (chicken fixnum)) (import (chicken type)) (import record-variants) (import (s9fes char-canvas) (s9fes char-canvas rect) (s9fes char-canvas shape shape)) (include-relative "s9fes.char-canvas.types") (include-relative "s9fes.char-canvas.inlines") (: real-shape-vgroup ( -> real-shape-plotter)) (: shape-vgroup ( -> shape-plotter)) ;; Private (define (*canvas-draw-vgroup cv rgn ) ) ;; Public (define ((real-shape-vgroup )) #!optional cv (x0 (fx/ w 2)) (y0 (fx/ h 2))) (if cv (begin (*canvas-draw-vgroup cv (%rect x0 y0 w h) ) cv) (^real-info vgroup ) ) ) ;; (define ((shape-vgroup ) #!optional cv (x0 (floor (/ w 2))) (y0 (floor (/ h 2)))) (if cv (begin (*canvas-draw-vgroup cv (%rect-real cv (%rect x0 y0 w h)) ) cv) (^virtual-info vgroup ) ) ) ;; (define (vgroup-shape-size shp info) (let ((w (the integer (@info 0 info))) (h (the integer (@info 1 info)))) (values w h) ) ) (register-shape-method 'vgroup 'size vgroup-shape-size) ) ;module (s9fes char-canvas shape vgroup)