fix cocoa `get-clipboard-string' to never return #f; fix docs

Merge to 5.2
This commit is contained in:
Matthew Flatt 2011-10-18 06:33:30 -06:00
parent 57a8ed5c79
commit 718229387c
2 changed files with 9 additions and 8 deletions

View File

@ -80,8 +80,9 @@
(define/public (get-text-data) (define/public (get-text-data)
(let ([bstr (get-data "TEXT")]) (let ([bstr (get-data "TEXT")])
(and bstr (or (and bstr
(bytes->string/utf-8 bstr #\?)))) (bytes->string/utf-8 bstr #\?))
"")))
(define/public (get-data type) (define/public (get-data type)
(atomically (atomically

View File

@ -29,7 +29,7 @@ Generic data is always retrieved from the clipboard as a byte
@defmethod[(get-clipboard-bitmap [time exact-integer?]) @defmethod[(get-clipboard-bitmap [time exact-integer?])
(or/c (is-a?/c bitmap%) false/c)]{ (or/c (is-a?/c bitmap%) #f)]{
Gets the current clipboard contents as a bitmap (Windows, Mac OS X), Gets the current clipboard contents as a bitmap (Windows, Mac OS X),
returning @racket[#f] if the clipboard does not contain a bitmap. returning @racket[#f] if the clipboard does not contain a bitmap.
@ -43,9 +43,9 @@ See @|timediscuss| for a discussion of the @racket[time] argument. If
} }
@defmethod[(get-clipboard-data [format string] @defmethod[(get-clipboard-data [format string?]
[time exact-integer?]) [time exact-integer?])
(or/c bytes? string? false/c)]{ (or/c bytes? string? #f)]{
Gets the current clipboard contents in a specific format, returning Gets the current clipboard contents in a specific format, returning
@racket[#f] if the clipboard does not contain data in the requested @racket[#f] if the clipboard does not contain data in the requested
@ -66,10 +66,10 @@ See @|timediscuss| for a discussion of the @racket[time] argument. If
} }
@defmethod[(get-clipboard-string [time exact-integer?]) @defmethod[(get-clipboard-string [time exact-integer?])
(or/c string false/c)]{ string?]{
Gets the current clipboard contents as simple text, returning Gets the current clipboard contents as simple text, returning
@racket[#f] if the clipboard does not contain any text. @racket[""] if the clipboard does not contain any text.
See @method[clipboard<%> get-clipboard-data] for information on See @method[clipboard<%> get-clipboard-data] for information on
eventspaces and the current clipboard client. eventspaces and the current clipboard client.
@ -117,7 +117,7 @@ See @|timediscuss| for a discussion of the @racket[time] argument. If
} }
@defmethod[(set-clipboard-string [new-text string] @defmethod[(set-clipboard-string [new-text string?]
[time exact-integer?]) [time exact-integer?])
void?]{ void?]{