diff --git a/Factor.app/Contents/Frameworks/libfreetype.6.dylib b/Factor.app/Contents/Frameworks/libfreetype.6.dylib old mode 100644 new mode 100755 index 5147d44386..381e74bf18 Binary files a/Factor.app/Contents/Frameworks/libfreetype.6.dylib and b/Factor.app/Contents/Frameworks/libfreetype.6.dylib differ diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index ceb3a0021c..7be649416c 100755 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -130,12 +130,21 @@ SYMBOL: alien>objc-types objc>alien-types get [ swap ] assoc-map ! A hack... -H{ - { "NSPoint" "{_NSPoint=ff}" } - { "NSRect" "{_NSRect=ffff}" } - { "NSSize" "{_NSSize=ff}" } - { "NSRange" "{_NSRange=II}" } -} assoc-union alien>objc-types set-global +"ptrdiff_t" heap-size { + { 4 [ H{ + { "NSPoint" "{_NSPoint=ff}" } + { "NSRect" "{_NSRect=ffff}" } + { "NSSize" "{_NSSize=ff}" } + { "NSRange" "{_NSRange=II}" } + } ] } + { 8 [ H{ + { "NSPoint" "{_NSPoint=dd}" } + { "NSRect" "{_NSRect=dddd}" } + { "NSSize" "{_NSSize=dd}" } + { "NSRange" "{_NSRange=QQ}" } + } ] } +} case +assoc-union alien>objc-types set-global : objc-struct-type ( i string -- ctype ) 2dup CHAR: = -rot index-from swap subseq diff --git a/basis/cocoa/types/types.factor b/basis/cocoa/types/types.factor index dbaf311da2..6e65bc1a72 100644 --- a/basis/cocoa/types/types.factor +++ b/basis/cocoa/types/types.factor @@ -1,13 +1,20 @@ ! Copyright (C) 2006, 2007 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types alien.syntax kernel ; +USING: alien.c-types alien.syntax combinators kernel ; IN: cocoa.types +TYPEDEF: long NSInteger +TYPEDEF: ulong NSUInteger +<< "ptrdiff_t" heap-size { + { 4 [ "float" ] } + { 8 [ "double" ] } +} case "CGFloat" typedef >> + C-STRUCT: NSRect - { "float" "x" } - { "float" "y" } - { "float" "w" } - { "float" "h" } ; + { "CGFloat" "x" } + { "CGFloat" "y" } + { "CGFloat" "w" } + { "CGFloat" "h" } ; TYPEDEF: NSRect _NSRect TYPEDEF: NSRect CGRect @@ -23,8 +30,8 @@ TYPEDEF: NSRect CGRect [ NSRect-x ] keep NSRect-y ; C-STRUCT: NSPoint - { "float" "x" } - { "float" "y" } ; + { "CGFloat" "x" } + { "CGFloat" "y" } ; TYPEDEF: NSPoint _NSPoint TYPEDEF: NSPoint CGPoint @@ -35,8 +42,8 @@ TYPEDEF: NSPoint CGPoint [ set-NSPoint-x ] keep ; C-STRUCT: NSSize - { "float" "w" } - { "float" "h" } ; + { "CGFloat" "w" } + { "CGFloat" "h" } ; TYPEDEF: NSSize _NSSize TYPEDEF: NSPoint CGPoint @@ -47,8 +54,8 @@ TYPEDEF: NSPoint CGPoint [ set-NSSize-w ] keep ; C-STRUCT: NSRange - { "uint" "location" } - { "uint" "length" } ; + { "NSUInteger" "location" } + { "NSUInteger" "length" } ; TYPEDEF: NSRange _NSRange @@ -58,12 +65,12 @@ TYPEDEF: NSRange _NSRange [ set-NSRange-location ] keep ; C-STRUCT: CGAffineTransform - { "float" "a" } - { "float" "b" } - { "float" "c" } - { "float" "d" } - { "float" "tx" } - { "float" "ty" } ; + { "CGFloat" "a" } + { "CGFloat" "b" } + { "CGFloat" "c" } + { "CGFloat" "d" } + { "CGFloat" "tx" } + { "CGFloat" "ty" } ; C-STRUCT: NSFastEnumerationState { "ulong" "state" } diff --git a/basis/core-foundation/core-foundation.factor b/basis/core-foundation/core-foundation.factor index e51b19645a..00bf73e9dd 100644 --- a/basis/core-foundation/core-foundation.factor +++ b/basis/core-foundation/core-foundation.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.strings alien.syntax kernel -math sequences io.encodings.utf16 destructors accessors ; +math sequences io.encodings.utf16 destructors accessors combinators ; IN: core-foundation TYPEDEF: void* CFAllocatorRef @@ -17,10 +17,10 @@ TYPEDEF: void* CFURLRef TYPEDEF: void* CFUUIDRef TYPEDEF: void* CFTypeRef TYPEDEF: bool Boolean -TYPEDEF: int CFIndex +TYPEDEF: long CFIndex TYPEDEF: int SInt32 TYPEDEF: uint UInt32 -TYPEDEF: uint CFTypeID +TYPEDEF: ulong CFTypeID TYPEDEF: double CFTimeInterval TYPEDEF: double CFAbsoluteTime