move the standard viewer to a seperate module
This commit is contained in:
parent
6e72d5abd4
commit
7b9b6c3e66
|
@ -913,34 +913,3 @@
|
||||||
(lp (cdr chars) (string-append token (string (car chars)))
|
(lp (cdr chars) (string-append token (string (car chars)))
|
||||||
tokens (+ i 1)))))))
|
tokens (+ i 1)))))))
|
||||||
|
|
||||||
(define (make-standard-viewer)
|
|
||||||
(let ((x 1)
|
|
||||||
(y 1)
|
|
||||||
(text "")
|
|
||||||
(value #f))
|
|
||||||
|
|
||||||
(lambda (message)
|
|
||||||
(cond
|
|
||||||
|
|
||||||
((eq? message 'init)
|
|
||||||
(lambda (self new-value buffer)
|
|
||||||
(set! value new-value)
|
|
||||||
(set! text
|
|
||||||
(layout-result-standard
|
|
||||||
(exp->string value)
|
|
||||||
(result-buffer-num-cols buffer)))
|
|
||||||
self))
|
|
||||||
|
|
||||||
((eq? message 'paint)
|
|
||||||
(lambda (self win buffer have-focus?)
|
|
||||||
;; #### get rid of this cruft
|
|
||||||
((make-simple-result-buffer-printer y x text '() '())
|
|
||||||
win buffer have-focus?)))
|
|
||||||
|
|
||||||
((eq? message 'key-press)
|
|
||||||
(lambda (self . ignore)
|
|
||||||
self))))))
|
|
||||||
|
|
||||||
(define standard-view-plugin
|
|
||||||
(make-view-plugin make-standard-viewer
|
|
||||||
(lambda (val) #t)))
|
|
||||||
|
|
|
@ -120,6 +120,14 @@
|
||||||
plugin)
|
plugin)
|
||||||
(files std-command))
|
(files std-command))
|
||||||
|
|
||||||
|
(define-structure standard-viewer
|
||||||
|
(export make-standard-viewer)
|
||||||
|
(open scheme
|
||||||
|
|
||||||
|
objects
|
||||||
|
layout)
|
||||||
|
(files std-viewer))
|
||||||
|
|
||||||
;;; fs-objects
|
;;; fs-objects
|
||||||
|
|
||||||
(define-interface fs-object-interface
|
(define-interface fs-object-interface
|
||||||
|
@ -305,6 +313,7 @@
|
||||||
inspect-exception
|
inspect-exception
|
||||||
rt-modules
|
rt-modules
|
||||||
tty-debug
|
tty-debug
|
||||||
|
|
||||||
fs-object
|
fs-object
|
||||||
objects
|
objects
|
||||||
plugin
|
plugin
|
||||||
|
@ -319,6 +328,7 @@
|
||||||
dirlist-view-plugin
|
dirlist-view-plugin
|
||||||
process-viewer
|
process-viewer
|
||||||
standard-command-plugin
|
standard-command-plugin
|
||||||
|
standard-viewer
|
||||||
nuit-inspector-plugin)
|
nuit-inspector-plugin)
|
||||||
(files nuit-engine))
|
(files nuit-engine))
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
(define (make-standard-viewer)
|
||||||
|
(let ((x 1)
|
||||||
|
(y 1)
|
||||||
|
(text "")
|
||||||
|
(value #f))
|
||||||
|
|
||||||
|
(lambda (message)
|
||||||
|
(cond
|
||||||
|
|
||||||
|
((eq? message 'init)
|
||||||
|
(lambda (self new-value buffer)
|
||||||
|
(set! value new-value)
|
||||||
|
(set! text
|
||||||
|
(layout-result-standard
|
||||||
|
(exp->string value)
|
||||||
|
(result-buffer-num-cols buffer)))
|
||||||
|
self))
|
||||||
|
|
||||||
|
((eq? message 'paint)
|
||||||
|
(lambda (self win buffer have-focus?)
|
||||||
|
;; #### get rid of this cruft
|
||||||
|
((make-simple-result-buffer-printer y x text '() '())
|
||||||
|
win buffer have-focus?)))
|
||||||
|
|
||||||
|
((eq? message 'key-press)
|
||||||
|
(lambda (self . ignore)
|
||||||
|
self))))))
|
||||||
|
|
Loading…
Reference in New Issue