2009-09-07 18:59:34 -04:00
|
|
|
! Copyright (C) 2009 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: accessors classes.struct cocoa cocoa.classes
|
2009-10-21 23:12:28 -04:00
|
|
|
cocoa.runtime cocoa.subclassing cocoa.types core-graphics.types
|
|
|
|
kernel math ;
|
|
|
|
FROM: alien.c-types => float ;
|
2009-09-07 18:59:34 -04:00
|
|
|
IN: tools.deploy.test.14
|
|
|
|
|
2010-07-06 19:02:52 -04:00
|
|
|
CLASS: Bar < NSObject
|
|
|
|
[
|
|
|
|
METHOD: float bar: NSRect rect [
|
|
|
|
rect origin>> [ x>> ] [ y>> ] bi +
|
|
|
|
rect size>> [ w>> ] [ h>> ] bi +
|
|
|
|
+
|
|
|
|
]
|
|
|
|
]
|
2009-09-07 18:59:34 -04:00
|
|
|
|
|
|
|
: main ( -- )
|
2009-09-07 23:48:57 -04:00
|
|
|
Bar -> alloc -> init
|
|
|
|
S{ CGRect f S{ CGPoint f 1.0 2.0 } S{ CGSize f 3.0 4.0 } } -> bar:
|
2009-09-07 18:59:34 -04:00
|
|
|
10.0 assert= ;
|
|
|
|
|
|
|
|
MAIN: main
|