more cocoa 64-bit type fixes

db4
Joe Groff 2008-09-10 20:19:57 -07:00
parent 727f0689d4
commit 32dfcd36ac
3 changed files with 43 additions and 27 deletions

View File

@ -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

View File

@ -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" } ;

View File

@ -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