! Copyright (C) 2006, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
- USING: accessors alien alien.c-types alien.strings
- arrays assocs combinators compiler kernel
- math namespaces parser prettyprint prettyprint.sections
- quotations sequences strings words cocoa.runtime io macros
- memoize debugger io.encodings.ascii effects compiler.generator
- libc libc.private ;
+ USING: accessors alien alien.c-types alien.strings arrays assocs
+ combinators compiler kernel math namespaces make parser
+ prettyprint prettyprint.sections quotations sequences strings
+ words cocoa.runtime io macros memoize debugger
+ io.encodings.ascii effects compiler.generator libc libc.private ;
IN: cocoa.messages
: make-sender ( method function -- quot )
{ "c" "char" }
{ "i" "int" }
{ "s" "short" }
- { "l" "long" }
- { "q" "longlong" }
{ "C" "uchar" }
{ "I" "uint" }
{ "S" "ushort" }
- { "L" "ulong" }
- { "Q" "ulonglong" }
{ "f" "float" }
{ "d" "double" }
{ "B" "bool" }
{ "v" "void" }
{ "*" "char*" }
+ { "?" "unknown_type" }
{ "@" "id" }
{ "#" "id" }
{ ":" "SEL" }
-} objc>alien-types set-global
+}
+"ptrdiff_t" heap-size {
+ { 4 [ H{
+ { "l" "long" }
+ { "q" "longlong" }
+ { "L" "ulong" }
+ { "Q" "ulonglong" }
+ } ] }
+ { 8 [ H{
+ { "l" "long32" }
+ { "q" "long" }
+ { "L" "ulong32" }
+ { "Q" "ulong" }
+ } ] }
+} case
+assoc-union objc>alien-types set-global
! The transpose of the above map
SYMBOL: alien>objc-types
! A hack...
"ptrdiff_t" heap-size {
{ 4 [ H{
- { "NSPoint" "{_NSPoint=ff}" }
- { "NSRect" "{_NSRect=ffff}" }
- { "NSSize" "{_NSSize=ff}" }
- { "NSRange" "{_NSRange=II}" }
+ { "NSPoint" "{_NSPoint=ff}" }
+ { "NSRect" "{_NSRect={_NSPoint=ff}{_NSSize=ff}}" }
+ { "NSSize" "{_NSSize=ff}" }
+ { "NSRange" "{_NSRange=II}" }
+ { "NSInteger" "i" }
+ { "NSUInteger" "I" }
+ { "CGFloat" "f" }
} ] }
{ 8 [ H{
- { "NSPoint" "{_NSPoint=dd}" }
- { "NSRect" "{_NSRect=dddd}" }
- { "NSSize" "{_NSSize=dd}" }
- { "NSRange" "{_NSRange=QQ}" }
+ { "NSPoint" "{CGPoint=dd}" }
+ { "NSRect" "{CGRect={CGPoint=dd}{CGSize=dd}}" }
+ { "NSSize" "{CGSize=dd}" }
+ { "NSRange" "{_NSRange=QQ}" }
+ { "NSInteger" "q" }
+ { "NSUInteger" "Q" }
+ { "CGFloat" "d" }
} ] }
} case
assoc-union alien>objc-types set-global