notes
This commit is contained in:
parent
0c09efe7fb
commit
3455194328
22
draw.rkt
22
draw.rkt
|
@ -157,14 +157,16 @@
|
||||||
(error 'matte "Original (~ax~a) must fit inside matte (~ax~a)"
|
(error 'matte "Original (~ax~a) must fit inside matte (~ax~a)"
|
||||||
xw xh w h))
|
xw xh w h))
|
||||||
(matte-at w h
|
(matte-at w h
|
||||||
(match ws
|
(max 1
|
||||||
['left 0]
|
(match ws
|
||||||
['center (floor (/ (- w xw) 2))]
|
['left 0]
|
||||||
['right (- w xw)])
|
['center (floor (/ (- w xw) 2))]
|
||||||
(match hs
|
['right (- w xw)]))
|
||||||
['top 0]
|
(max 1
|
||||||
['center (floor (/ (- h xh) 2))]
|
(match hs
|
||||||
['bottom (- h xh)])
|
['top 0]
|
||||||
|
['center (floor (/ (- h xh) 2))]
|
||||||
|
['bottom (- h xh)]))
|
||||||
x))
|
x))
|
||||||
|
|
||||||
(define (inset dw dh x)
|
(define (inset dw dh x)
|
||||||
|
@ -269,10 +271,6 @@
|
||||||
(for/list ([col (in-list row)])
|
(for/list ([col (in-list row)])
|
||||||
(if (raart? col) col (text (~a col))))))
|
(if (raart? col) col (text (~a col))))))
|
||||||
|
|
||||||
;; xxx render xexpr-like thing
|
|
||||||
;; xxx text... (fit text inside a width)
|
|
||||||
;; xxx paragraph (fit text inside a box)
|
|
||||||
|
|
||||||
(define style/c (apply or/c (hash-keys symbol->style)))
|
(define style/c (apply or/c (hash-keys symbol->style)))
|
||||||
(define color/c (apply or/c (hash-keys symbol->color)))
|
(define color/c (apply or/c (hash-keys symbol->color)))
|
||||||
(define valign/c (or/c 'top 'center 'bottom))
|
(define valign/c (or/c 'top 'center 'bottom))
|
||||||
|
|
15
size.rkt
15
size.rkt
|
@ -77,9 +77,22 @@
|
||||||
(bytes->number col-s))]
|
(bytes->number col-s))]
|
||||||
[x (error 'cursor-position "Something weird happened, got ~e" x)]))))
|
[x (error 'cursor-position "Something weird happened, got ~e" x)]))))
|
||||||
|
|
||||||
|
;; xxx xterm-set-window-title
|
||||||
|
|
||||||
|
;; xxx Do I make a 'lux chaos' for this?
|
||||||
|
;;
|
||||||
|
;; Or do I do the rune thing and make a separation between the
|
||||||
|
;; commands and the keys? Also, how should the mouse events fit
|
||||||
|
;; into that?
|
||||||
|
|
||||||
|
;; xxx render xexpr-like thing
|
||||||
|
;; xxx text... (fit text inside a width)
|
||||||
|
;; xxx paragraph (fit text inside a box)
|
||||||
|
|
||||||
|
;; xxx make a "Web" browser
|
||||||
|
|
||||||
(module+ main
|
(module+ main
|
||||||
(with-term
|
(with-term
|
||||||
(λ (t)
|
(λ (t)
|
||||||
(screen-size t)
|
(screen-size t)
|
||||||
(cursor-position t))))
|
(cursor-position t))))
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
(require raart)
|
(require raart)
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(draw (crop 70 80 10 20
|
(draw (crop 1 80 1 20
|
||||||
|
;;70 80 10 20
|
||||||
(matte 80 20
|
(matte 80 20
|
||||||
#:halign 'right
|
#:halign 'right
|
||||||
(fg 'blue
|
(fg 'blue
|
||||||
|
@ -14,6 +15,7 @@
|
||||||
(style 'bold (text "Right")))))))))
|
(style 'bold (text "Right")))))))))
|
||||||
(newline))
|
(newline))
|
||||||
|
|
||||||
|
#;
|
||||||
(module+ test
|
(module+ test
|
||||||
(draw (translate
|
(draw (translate
|
||||||
2 10
|
2 10
|
||||||
|
|
Loading…
Reference in New Issue