attempted to rewrite docs into scribble -- that didnt work, but this is the leftover cleanup

svn: r9463
This commit is contained in:
Robby Findler 2008-04-24 20:33:25 +00:00
parent e3a13be4a0
commit 06584c3941

View File

@ -1,9 +1,8 @@
#reader scribble/reader
#lang scheme/gui
(module test mzscheme (require scribble/srcdoc)
(require mred (require/doc scheme/base scribble/manual)
mzlib/class
mzlib/etc
mzlib/contract)
(define-syntax (provide/contract/docs stx) (define-syntax (provide/contract/docs stx)
(syntax-case stx () (syntax-case stx ()
@ -138,8 +137,8 @@
(let ([yield-semaphore (make-semaphore 0)] (let ([yield-semaphore (make-semaphore 0)]
[thread-semaphore (make-semaphore 0)]) [thread-semaphore (make-semaphore 0)])
(thread (thread
(rec loop
(λ () (λ ()
(let loop ()
(semaphore-wait thread-semaphore) (semaphore-wait thread-semaphore)
(sleep) (sleep)
(semaphore-post yield-semaphore) (semaphore-post yield-semaphore)
@ -169,37 +168,6 @@
(semaphore-wait sem) (semaphore-wait sem)
(reraise-error)))))) (reraise-error))))))
;; new, queue-callback based run-one
'(define run-one
(let ([yield-semaphore (make-semaphore 0)]
[thread-semaphore (make-semaphore 0)])
(thread
(rec loop
(λ ()
(semaphore-wait thread-semaphore)
(sleep)
(semaphore-post yield-semaphore)
(loop))))
(λ (thunk)
(let ([done (make-semaphore 0)])
(queue-callback
(λ ()
;; guarantee (probably) that some events are handled
(semaphore-post thread-semaphore)
(yield yield-semaphore)
(queue-callback (λ () (semaphore-post done)))
(unless (is-exn?)
(begin-action)
(parameterize ([current-exception-handler
(λ (exn)
(end-action-with-error exn)
((error-escape-handler)))])
(thunk))
(end-action))))
(semaphore-wait done)))))
(define current-get-eventspaces (define current-get-eventspaces
(make-parameter (λ () (list (current-eventspace))))) (make-parameter (λ () (list (current-eventspace)))))
@ -853,6 +821,13 @@
(define test:mouse-click mouse-click) (define test:mouse-click mouse-click)
(define test:new-window new-window) (define test:new-window new-window)
#;
(provide/doc
(proc-doc
test:number-pending-actions
(-> number?)
@{Returns the number of pending events (those that haven't completed yet)}))
(provide/contract/docs (provide/contract/docs
(test:number-pending-actions (test:number-pending-actions
(-> number?) (-> number?)
@ -989,8 +964,7 @@
"that string, otherwise it uses \\var{list-box} itself.") "that string, otherwise it uses \\var{list-box} itself.")
(test:keystroke (test:keystroke
(opt-> (->* ((or/c char? symbol?))
((or/c char? symbol?))
((listof (symbols 'alt 'control 'meta 'shift 'noalt 'nocontrol 'nometea 'noshift))) ((listof (symbols 'alt 'control 'meta 'shift 'noalt 'nocontrol 'nometea 'noshift)))
void?) void?)
((key) ((key)
@ -1028,7 +1002,7 @@
"use ``New'', not ``New Ctrl+m n''.") "use ``New'', not ``New Ctrl+m n''.")
(test:mouse-click (test:mouse-click
(opt-> (->*
((symbols 'left 'middle 'right) ((symbols 'left 'middle 'right)
(and/c exact? integer?) (and/c exact? integer?)
(and/c exact? integer?)) (and/c exact? integer?))
@ -1059,4 +1033,4 @@
"Moves the keyboard focus to a new window within the currently active" "Moves the keyboard focus to a new window within the currently active"
"frame. Unfortunately, neither this function nor any other function in" "frame. Unfortunately, neither this function nor any other function in"
"the test engine can cause the focus to move from the top-most (active)" "the test engine can cause the focus to move from the top-most (active)"
"frame. "))) "frame. "))