more cocoa 64-bit type fixes
parent
727f0689d4
commit
32dfcd36ac
|
@ -108,12 +108,12 @@ H{
|
|||
{ "c" "char" }
|
||||
{ "i" "int" }
|
||||
{ "s" "short" }
|
||||
{ "l" "long" }
|
||||
{ "l" "int" }
|
||||
{ "q" "longlong" }
|
||||
{ "C" "uchar" }
|
||||
{ "I" "uint" }
|
||||
{ "S" "ushort" }
|
||||
{ "L" "ulong" }
|
||||
{ "L" "uint" }
|
||||
{ "Q" "ulonglong" }
|
||||
{ "f" "float" }
|
||||
{ "d" "double" }
|
||||
|
@ -133,14 +133,14 @@ objc>alien-types get [ swap ] assoc-map
|
|||
"ptrdiff_t" heap-size {
|
||||
{ 4 [ H{
|
||||
{ "NSPoint" "{_NSPoint=ff}" }
|
||||
{ "NSRect" "{_NSRect=ffff}" }
|
||||
{ "NSRect" "{_NSRect={_NSPoint=ff}{_NSSize=ff}}" }
|
||||
{ "NSSize" "{_NSSize=ff}" }
|
||||
{ "NSRange" "{_NSRange=II}" }
|
||||
} ] }
|
||||
{ 8 [ H{
|
||||
{ "NSPoint" "{_NSPoint=dd}" }
|
||||
{ "NSRect" "{_NSRect=dddd}" }
|
||||
{ "NSSize" "{_NSSize=dd}" }
|
||||
{ "NSPoint" "{CGPoint=dd}" }
|
||||
{ "NSRect" "{CGRect={CGPoint=dd}{CGSize=dd}}" }
|
||||
{ "NSSize" "{CGSize=dd}" }
|
||||
{ "NSRange" "{_NSRange=QQ}" }
|
||||
} ] }
|
||||
} case
|
||||
|
|
|
@ -10,25 +10,6 @@ TYPEDEF: ulong NSUInteger
|
|||
{ 8 [ "double" ] }
|
||||
} case "CGFloat" typedef >>
|
||||
|
||||
C-STRUCT: NSRect
|
||||
{ "CGFloat" "x" }
|
||||
{ "CGFloat" "y" }
|
||||
{ "CGFloat" "w" }
|
||||
{ "CGFloat" "h" } ;
|
||||
|
||||
TYPEDEF: NSRect _NSRect
|
||||
TYPEDEF: NSRect CGRect
|
||||
|
||||
: <NSRect> ( x y w h -- rect )
|
||||
"NSRect" <c-object>
|
||||
[ set-NSRect-h ] keep
|
||||
[ set-NSRect-w ] keep
|
||||
[ set-NSRect-y ] keep
|
||||
[ set-NSRect-x ] keep ;
|
||||
|
||||
: NSRect-x-y ( alien -- origin-x origin-y )
|
||||
[ NSRect-x ] keep NSRect-y ;
|
||||
|
||||
C-STRUCT: NSPoint
|
||||
{ "CGFloat" "x" }
|
||||
{ "CGFloat" "y" } ;
|
||||
|
@ -53,6 +34,41 @@ TYPEDEF: NSPoint CGPoint
|
|||
[ set-NSSize-h ] keep
|
||||
[ set-NSSize-w ] keep ;
|
||||
|
||||
C-STRUCT: NSRect
|
||||
{ "NSPoint" "origin" }
|
||||
{ "NSSize" "size" } ;
|
||||
|
||||
TYPEDEF: NSRect _NSRect
|
||||
TYPEDEF: NSRect CGRect
|
||||
|
||||
: NSRect-x ( NSRect -- x )
|
||||
NSRect-origin NSPoint-x ; inline
|
||||
: NSRect-y ( NSRect -- y )
|
||||
NSRect-origin NSPoint-y ; inline
|
||||
: NSRect-w ( NSRect -- w )
|
||||
NSRect-size NSSize-w ; inline
|
||||
: NSRect-h ( NSRect -- h )
|
||||
NSRect-size NSSize-h ; inline
|
||||
|
||||
: set-NSRect-x ( x NSRect -- )
|
||||
NSRect-origin set-NSPoint-x ; inline
|
||||
: set-NSRect-y ( y NSRect -- )
|
||||
NSRect-origin set-NSPoint-y ; inline
|
||||
: set-NSRect-w ( w NSRect -- )
|
||||
NSRect-size set-NSSize-w ; inline
|
||||
: set-NSRect-h ( h NSRect -- )
|
||||
NSRect-size set-NSSize-h ; inline
|
||||
|
||||
: <NSRect> ( x y w h -- rect )
|
||||
"NSRect" <c-object>
|
||||
[ set-NSRect-h ] keep
|
||||
[ set-NSRect-w ] keep
|
||||
[ set-NSRect-y ] keep
|
||||
[ set-NSRect-x ] keep ;
|
||||
|
||||
: NSRect-x-y ( alien -- origin-x origin-y )
|
||||
[ NSRect-x ] keep NSRect-y ;
|
||||
|
||||
C-STRUCT: NSRange
|
||||
{ "NSUInteger" "location" }
|
||||
{ "NSUInteger" "length" } ;
|
||||
|
|
|
@ -128,8 +128,8 @@ CLASS: {
|
|||
}
|
||||
|
||||
! Rendering
|
||||
{ "drawRect:" "void" { "id" "SEL" "id" "NSRect" }
|
||||
[ 3drop window relayout-1 ]
|
||||
{ "drawRect:" "void" { "id" "SEL" "NSRect" }
|
||||
[ 2drop window relayout-1 ]
|
||||
}
|
||||
|
||||
! Events
|
||||
|
|
Loading…
Reference in New Issue