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