ppc cocoa

This commit is contained in:
Matthew Flatt 2010-10-23 20:11:12 -06:00
parent 391cbe1315
commit 2cebc60eca
3 changed files with 23 additions and 6 deletions

View File

@ -112,9 +112,14 @@
(set-cpointer-tag! p objc_class-tag) (set-cpointer-tag! p objc_class-tag)
p))] p))]
[empty-cache (lambda () [empty-cache (lambda ()
;; If you try things the hard way with Obj-C 2.0,
;; you need to set up the cache. For ealier
;; versions, you need to set the cache to #f.
#;
(let ([p (malloc 'raw 1 _objc_cache)]) (let ([p (malloc 'raw 1 _objc_cache)])
(memset p 0 1 _objc_cache) (memset p 0 1 _objc_cache)
p))] p)
#f)]
[meta-super (cast (objc_class-isa super) _pointer _objc_class-pointer)] [meta-super (cast (objc_class-isa super) _pointer _objc_class-pointer)]
[new-meta (malloc+memcpy [new-meta (malloc+memcpy
(make-objc_class (objc_class-isa root) (make-objc_class (objc_class-isa root)

View File

@ -564,10 +564,17 @@
[(scroller val) [(scroller val)
(when scroller (when scroller
(set-scroller-page! scroller val) (set-scroller-page! scroller val)
(tellv (scroller-cocoa scroller) setKnobProportion: (let ([proportion
#:type _CGFloat (max (min 1.0 (/ val (max (min 1.0 (/ val
(+ val (exact->inexact (scroller-range scroller))))) (+ val (exact->inexact (scroller-range scroller)))))
0.0)))] 0.0)])
(if old-cocoa?
(tellv (scroller-cocoa scroller)
setFloatValue: #:type _float (tell #:type _float (scroller-cocoa scroller)
floatValue)
knobProportion: #:type _CGFloat proportion)
(tellv (scroller-cocoa scroller) setKnobProportion:
#:type _CGFloat proportion))))]
[(scroller) [(scroller)
(if scroller (if scroller
(scroller-page scroller) (scroller-page scroller)

View File

@ -18,7 +18,8 @@
with-autorelease with-autorelease
clean-menu-label clean-menu-label
->wxb ->wxb
->wx) ->wx
old-cocoa?)
(define cocoa-lib (ffi-lib (format "/System/Library/Frameworks/Cocoa.framework/Cocoa"))) (define cocoa-lib (ffi-lib (format "/System/Library/Frameworks/Cocoa.framework/Cocoa")))
(define cf-lib (ffi-lib (format "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"))) (define cf-lib (ffi-lib (format "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")))
@ -69,3 +70,7 @@
(define (->wx wxb) (define (->wx wxb)
(and wxb (and wxb
(weak-box-value wxb))) (weak-box-value wxb)))
;; FIXME: need a better test:
(define old-cocoa? (equal? (path->string (system-library-subpath #f))
"ppc-macosx"))