diff --git a/collects/ffi/objc.scrbl b/collects/ffi/objc.scrbl index 00f4985c85..e4564f6161 100644 --- a/collects/ffi/objc.scrbl +++ b/collects/ffi/objc.scrbl @@ -3,7 +3,7 @@ scribble/eval (for-label scheme/base scheme/foreign - ffi/objc)) + "private/objc-doc-unsafe.ss")) @(define objc-eval (make-base-eval)) @(interaction-eval #:eval objc-eval (define-struct cpointer:id ())) @@ -13,7 +13,9 @@ @title{@bold{Objective-C} FFI} -@defmodule[ffi/objc]{The @schememodname[ffi/objc] library builds on +@declare-exporting[ffi/private/objc-doc-unsafe #:use-sources (ffi/objc)] + +@defmodule*/no-declare[(ffi/objc)]{The @schememodname[ffi/objc] library builds on @schememodname[scheme/foreign] to support interaction with @link["http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/"]{Objective-C}.} @@ -26,8 +28,23 @@ relatively low-level compared to normal Scheme libraries, because argument and result types must be declared in terms of FFI C types (@seeCtype). +@bold{Important:} Most of the bindings documented here are available +only after an @scheme[(objc-unsafe!)] declaration in the importing +module. + @table-of-contents[] +@; ---------------------------------------------------------------------- + +@section{Using Unsafe Bindings} + +@defform[(objc-unsafe!)]{ + +Analogous to @scheme[(unsafe!)], makes unsafe bindings of +@schememodname[ffi/objc] available in the importing module.} + +@; ---------------------------------------------------------------------- + @section{FFI Types and Constants} @defthing[_id ctype?]{ diff --git a/collects/ffi/objc.ss b/collects/ffi/objc.ss index 8c9be4ccb9..0b89fb3eb9 100644 --- a/collects/ffi/objc.ss +++ b/collects/ffi/objc.ss @@ -15,7 +15,7 @@ (define-syntax-rule (define-objc id type) (begin - (provide id) + (provide* (unsafe id)) (define-objc/private id id type))) ;; ---------------------------------------- @@ -86,16 +86,16 @@ (define msgSends (make-hash)) (define (objc_msgSend/typed types) (lookup-send types msgSends objc_msgSend objc_msgSend_fpret _id)) -(provide objc_msgSend/typed) +(provide* (unsafe objc_msgSend/typed)) (define msgSendSupers (make-hash)) (define (objc_msgSendSuper/typed types) (lookup-send types msgSendSupers objc_msgSendSuper objc_msgSendSuper_fpret _pointer)) -(provide objc_msgSendSuper/typed) +(provide* (unsafe objc_msgSendSuper/typed)) ;; ---------------------------------------- -(provide import-class) +(provide* (unsafe import-class)) (define-syntax (import-class stx) (syntax-case stx () [(_ id) @@ -107,7 +107,7 @@ ;; ---------------------------------------- ;; iget-value and set-ivar! work only with fields that contain Scheme values -(provide get-ivar set-ivar!) +(provide* (unsafe get-ivar) (unsafe set-ivar!)) (define-for-syntax (check-ivar ivar stx) (unless (identifier? ivar) @@ -161,7 +161,7 @@ (hash-set! method-sels sym id) id))) -(provide selector) +(provide* (unsafe selector)) (define-syntax (selector stx) (syntax-case stx () [(_ id) @@ -256,7 +256,7 @@ arg))) (loop (cdr rest)))))))) -(provide tell tellv) +(provide* (unsafe tell) (unsafe tellv)) (define-for-syntax (build-send stx result-type send/typed send-args l-stx) (let ([l (syntax->list l-stx)]) (with-syntax ([((tag type arg) ...) (parse-arg-list l stx #f)] @@ -329,7 +329,7 @@ ;; ---------------------------------------- -(provide define-objc-class self super-tell) +(provide* (unsafe define-objc-class) self super-tell) (define-syntax (define-objc-class stx) (syntax-case stx () @@ -549,3 +549,8 @@ #'objc_msgSendSuper/typed #'((make-objc_super self super-class)) #'(method/arg ...))])) + +;; -------------------------------------------------- + +(define-unsafer objc-unsafe!) + diff --git a/collects/ffi/private/objc-doc-unsafe.ss b/collects/ffi/private/objc-doc-unsafe.ss new file mode 100644 index 0000000000..20ecc1eb89 --- /dev/null +++ b/collects/ffi/private/objc-doc-unsafe.ss @@ -0,0 +1,10 @@ +#lang scheme/base + +(require ffi/objc) + +(error 'objc-unsafe! "only `for-label' use in the documentation") + +(objc-unsafe!) + +(provide (protect-out (all-defined-out)) + (all-from-out ffi/objc)) diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss index 5c88ec23e5..23b6c0e67e 100644 --- a/collects/scribble/latex-render.ss +++ b/collects/scribble/latex-render.ss @@ -4,6 +4,7 @@ mzlib/class scheme/runtime-path scheme/port + scheme/path scheme/string setup/main-collects) (provide render-mixin) @@ -18,6 +19,11 @@ (define-runtime-path scribble-tex "scribble.tex") +(define (gif-to-png p) + (if (equal? (filename-extension p) #"gif") + (path-replace-suffix p #".png") + p)) + (define (render-mixin %) (class % (init-field [style-file #f] @@ -194,7 +200,7 @@ (void) (let ([fn (install-file (main-collects-relative->path - (image-file-path style)))]) + (gif-to-png (image-file-path style))))]) (printf "\\includegraphics[scale=~a]{~a}" (image-file-scale style) fn)))] [else (super render-element e part ri)]))) diff --git a/collects/teachpack/balls.png b/collects/teachpack/balls.png new file mode 100644 index 0000000000..03ea3eb596 Binary files /dev/null and b/collects/teachpack/balls.png differ diff --git a/src/mac/cw/MrEd.r b/src/mac/cw/MrEd.r index 903e907a66..3105b679b8 100644 --- a/src/mac/cw/MrEd.r +++ b/src/mac/cw/MrEd.r @@ -10,7 +10,7 @@ data 'DITL' (129) { $"0081 0000 0000 0018 008F 0048 0170 8844" /* .........H.pˆD */ $"4372 6561 7465 6420 7769 7468 2050 4C54" /* Created with PLT */ $"2053 6368 656D 650D A920 3230 3034 2D32" /* Scheme.© 2004-2 */ - $"3030 3720 504C 5420 5363 6865 6D65 2049" /* 007 PLT Scheme I */ + $"3030 3920 504C 5420 5363 6865 6D65 2049" /* 009 PLT Scheme I */ $"6E63 2E20 0DA9 2031 3939 352D 3230 3033" /* nc. .© 1995-2003 */ $"2050 4C54 0000 0000 004D 008F 0089 018F" /* PLT.....M..‰. */ $"884E 466F 7220 7570 2D74 6F2D 6461 7465" /* ˆNFor up-to-date */