Mercurial > projects > dstep
annotate dstep/foundation/NSAffineTransform.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 7ff919f595d5 |
children | b9de51448c6b |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSAffineTransform; | |
8 | |
9 import dstep.applicationservices.coregraphics.CGAffineTransform; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
10 import dstep.applicationservices.coregraphics.CGBase; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
11 import dstep.foundation.NSCoder; |
14 | 12 import dstep.foundation.NSGeometry; |
13 import dstep.foundation.NSObject; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
14 import dstep.foundation.NSZone; |
14 | 15 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
16 import dstep.objc.objc; |
14 | 17 |
18 struct NSAffineTransformStruct | |
19 { | |
20 CGFloat m11; | |
21 CGFloat m12; | |
22 CGFloat m21; | |
23 CGFloat m22; | |
24 CGFloat tX; | |
25 CGFloat tY; | |
26 } | |
27 | |
28 class NSAffineTransform : NSObject, INSCopying, INSCoding | |
29 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
32 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
33 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
34 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
35 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
36 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
37 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
38 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
39 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
40 } |
14 | 41 |
42 static NSAffineTransform transform () | |
43 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
44 return invokeObjcSuperClass!(NSAffineTransform, "transform"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
45 } |
14 | 46 |
47 Object initWithTransform (NSAffineTransform transform) | |
48 { | |
49 return invokeObjcSelf!(Object, "initWithTransform:", NSAffineTransform)(transform); | |
50 } | |
51 | |
52 this (NSAffineTransform transform) | |
53 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
54 typeof(this).alloc.initWithTransform(transform); |
14 | 55 } |
56 | |
57 void translateXBy (CGFloat deltaX, CGFloat deltaY) | |
58 { | |
59 return invokeObjcSelf!(void, "translateXBy:yBy:", CGFloat, CGFloat)(deltaX, deltaY); | |
60 } | |
61 | |
62 void rotateByDegrees (CGFloat angle) | |
63 { | |
64 return invokeObjcSelf!(void, "rotateByDegrees:", CGFloat)(angle); | |
65 } | |
66 | |
67 void rotateByRadians (CGFloat angle) | |
68 { | |
69 return invokeObjcSelf!(void, "rotateByRadians:", CGFloat)(angle); | |
70 } | |
71 | |
72 void scaleBy (CGFloat scale) | |
73 { | |
74 return invokeObjcSelf!(void, "scaleBy:", CGFloat)(scale); | |
75 } | |
76 | |
77 void scaleXBy (CGFloat scaleX, CGFloat scaleY) | |
78 { | |
79 return invokeObjcSelf!(void, "scaleXBy:yBy:", CGFloat, CGFloat)(scaleX, scaleY); | |
80 } | |
81 | |
82 void invert () | |
83 { | |
84 return invokeObjcSelf!(void, "invert"); | |
85 } | |
86 | |
87 void appendTransform (NSAffineTransform transform) | |
88 { | |
89 return invokeObjcSelf!(void, "appendTransform:", NSAffineTransform)(transform); | |
90 } | |
91 | |
92 void prependTransform (NSAffineTransform transform) | |
93 { | |
94 return invokeObjcSelf!(void, "prependTransform:", NSAffineTransform)(transform); | |
95 } | |
96 | |
97 NSPoint transformPoint (NSPoint aPoint) | |
98 { | |
99 return invokeObjcSelf!(NSPoint, "transformPoint:", NSPoint)(aPoint); | |
100 } | |
101 | |
102 NSSize transformSize (NSSize aSize) | |
103 { | |
104 return invokeObjcSelf!(NSSize, "transformSize:", NSSize)(aSize); | |
105 } | |
106 | |
107 NSAffineTransformStruct transformStruct () | |
108 { | |
109 return invokeObjcSelf!(NSAffineTransformStruct, "transformStruct"); | |
110 } | |
111 | |
112 void setTransformStruct (NSAffineTransformStruct transformStruct) | |
113 { | |
114 return invokeObjcSelf!(void, "setTransformStruct:", NSAffineTransformStruct)(transformStruct); | |
115 } | |
116 | |
117 Object copyWithZone (NSZone* zone) | |
118 { | |
119 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone); | |
120 } | |
121 | |
122 void encodeWithCoder (NSCoder aCoder) | |
123 { | |
124 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
125 } | |
126 | |
127 Object initWithCoder (NSCoder aDecoder) | |
128 { | |
129 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
130 } | |
131 | |
132 this (NSCoder aDecoder) | |
133 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
134 typeof(this).alloc.initWithCoder(aDecoder); |
14 | 135 } |
136 } | |
137 |