Mercurial > projects > dwt-mac
annotate dwt/internal/cocoa/NSAffineTransform.d @ 156:969e7de37c3d default tip
Fixes to get dwt to work with dmd and ldc
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 08 Jul 2009 21:56:44 +0200 |
parents | 62202ce0039f |
children |
rev | line source |
---|---|
45 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2008 IBM Corporation and others. | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
7 * |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
8 * Contributors: |
45 | 9 * IBM Corporation - initial API and implementation |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
10 * |
13
f565d3a95c0a
Ported dwt.internal
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
1
diff
changeset
|
11 * Port to the D programming language: |
45 | 12 * Jacob Carlborg <doob@me.com> |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
13 *******************************************************************************/ |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
14 module dwt.internal.cocoa.NSAffineTransform; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
15 |
45 | 16 import dwt.internal.c.Carbon; |
17 import cocoa = dwt.internal.cocoa.id; | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
18 import dwt.internal.cocoa.NSAffineTransformStruct; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
19 import dwt.internal.cocoa.NSObject; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
20 import dwt.internal.cocoa.NSPoint; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
21 import dwt.internal.cocoa.NSSize; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
22 import dwt.internal.cocoa.OS; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
23 import objc = dwt.internal.objc.runtime; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
24 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
25 public class NSAffineTransform : NSObject |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
26 { |
45 | 27 |
28 public this () | |
29 { | |
30 super(); | |
31 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
32 |
45 | 33 public this (objc.id id) |
34 { | |
35 super(id); | |
36 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
37 |
45 | 38 public this(cocoa.id id) { |
39 super(id); | |
40 } | |
41 | |
42 public void concat() { | |
43 OS.objc_msgSend(this.id, OS.sel_concat); | |
44 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
45 |
45 | 46 public NSAffineTransform initWithTransform (NSAffineTransform transform) |
47 { | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
48 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithTransform_, transform !is null ? transform.id : null); |
45 | 49 return result !is null ? this : null; |
50 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
51 |
45 | 52 public void invert () |
53 { | |
54 OS.objc_msgSend(this.id, OS.sel_invert); | |
55 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
56 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
57 |
45 | 58 public void prependTransform (NSAffineTransform transform) |
59 { | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
60 OS.objc_msgSend(this.id, OS.sel_prependTransform_, transform !is null ? transform.id : null); |
45 | 61 } |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
62 |
45 | 63 |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
64 public void rotateByDegrees(CGFloat angle) { |
45 | 65 OS.objc_msgSend(this.id, OS.sel_rotateByDegrees_, angle); |
66 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
67 |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
68 public void scaleXBy(CGFloat scaleX, CGFloat scaleY) { |
45 | 69 OS.objc_msgSend(this.id, OS.sel_scaleXBy_yBy_, scaleX, scaleY); |
70 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
71 |
45 | 72 public void set() { |
73 OS.objc_msgSend(this.id, OS.sel_set); | |
74 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
75 |
45 | 76 public void setTransformStruct (NSAffineTransformStruct transformStruct) |
77 { | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
78 OS.objc_msgSend(this.id, OS.sel_setTransformStruct_, transformStruct); |
45 | 79 } |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
80 |
45 | 81 public static NSAffineTransform transform () |
82 { | |
83 objc.id result = OS.objc_msgSend(OS.class_NSAffineTransform, OS.sel_transform); | |
84 return result !is null ? new NSAffineTransform(result) : null; | |
85 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
86 |
45 | 87 public NSPoint transformPoint (NSPoint aPoint) |
88 { | |
89 NSPoint result; | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
90 OS.objc_msgSend_stret(&result, this.id, OS.sel_transformPoint_, aPoint); |
45 | 91 return result; |
92 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
93 |
45 | 94 public NSSize transformSize (NSSize aSize) |
95 { | |
96 NSSize result; | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
97 OS.objc_msgSend_stret(&result, this.id, OS.sel_transformSize_, aSize); |
45 | 98 return result; |
99 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
100 |
45 | 101 public NSAffineTransformStruct transformStruct () |
102 { | |
103 NSAffineTransformStruct result; | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
104 OS.objc_msgSend_stret(&result, this.id, OS.sel_transformStruct); |
45 | 105 return result; |
106 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
107 |
45 | 108 public void translateXBy (CGFloat deltaX, CGFloat deltaY) |
109 { | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
110 OS.objc_msgSend(this.id, OS.sel_translateXBy_yBy_, deltaX, deltaY); |
45 | 111 } |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
112 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
113 } |