Mercurial > projects > dstep
annotate dstep/foundation/NSProxy.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 | 89f3c3ef1fd2 |
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.NSProxy; | |
8 | |
9 import dstep.foundation.NSInvocation; | |
10 import dstep.foundation.NSMethodSignature; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
11 import dstep.foundation.NSObjCRuntime; |
14 | 12 import dstep.foundation.NSObject; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.foundation.NSString; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
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:
14
diff
changeset
|
16 import dstep.objc.bridge.Wrapper; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
17 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
18 import dstep.objc.runtime; |
14 | 19 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
20 class NSProxy : ObjcWrapper, INSObject |
14 | 21 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
22 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
23 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
24 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
25 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
26 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
27 } |
14 | 28 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
29 typeof(this) init () |
14 | 30 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 return invokeObjcSelf!(typeof(this), "init"); |
14 | 32 } |
33 | |
34 static Object allocWithZone (NSZone* zone) | |
35 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
36 return invokeObjcSuperClass!(Object, "allocWithZone:", NSZone*)(zone); |
14 | 37 } |
38 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
39 static Class class_static () |
14 | 40 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 return invokeObjcSuperClass!(Class, "class"); |
14 | 42 } |
43 | |
44 void forwardInvocation (NSInvocation invocation) | |
45 { | |
46 return invokeObjcSelf!(void, "forwardInvocation:", NSInvocation)(invocation); | |
47 } | |
48 | |
49 NSMethodSignature methodSignatureForSelector (SEL sel) | |
50 { | |
51 return invokeObjcSelf!(NSMethodSignature, "methodSignatureForSelector:", SEL)(sel); | |
52 } | |
53 | |
54 void dealloc () | |
55 { | |
56 return invokeObjcSelf!(void, "dealloc"); | |
57 } | |
58 | |
59 void finalize () | |
60 { | |
61 return invokeObjcSelf!(void, "finalize"); | |
62 } | |
63 | |
64 NSString description () | |
65 { | |
66 return invokeObjcSelf!(NSString, "description"); | |
67 } | |
68 | |
69 static bool respondsToSelector (SEL aSelector) | |
70 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
71 return invokeObjcSuperClass!(bool, "respondsToSelector:", SEL)(aSelector); |
14 | 72 } |
73 | |
74 bool isEqual (Object object) | |
75 { | |
76 return invokeObjcSelf!(bool, "isEqual:", Object)(object); | |
77 } | |
78 | |
79 NSUInteger hash () | |
80 { | |
81 return invokeObjcSelf!(NSUInteger, "hash"); | |
82 } | |
83 | |
84 Class superclass () | |
85 { | |
86 return invokeObjcSelf!(Class, "superclass"); | |
87 } | |
88 | |
89 Class class_ () | |
90 { | |
91 return invokeObjcSelf!(Class, "class"); | |
92 } | |
93 | |
94 Object self () | |
95 { | |
96 return invokeObjcSelf!(Object, "self"); | |
97 } | |
98 | |
99 NSZone* zone () | |
100 { | |
101 return invokeObjcSelf!(NSZone*, "zone"); | |
102 } | |
103 | |
104 Object performSelector (SEL aSelector) | |
105 { | |
106 return invokeObjcSelf!(Object, "performSelector:", SEL)(aSelector); | |
107 } | |
108 | |
109 Object performSelector (SEL aSelector, Object object) | |
110 { | |
111 return invokeObjcSelf!(Object, "performSelector:withObject:", SEL, Object)(aSelector, object); | |
112 } | |
113 | |
114 Object performSelector (SEL aSelector, Object object1, Object object2) | |
115 { | |
116 return invokeObjcSelf!(Object, "performSelector:withObject:withObject:", SEL, Object, Object)(aSelector, object1, object2); | |
117 } | |
118 | |
119 bool isProxy () | |
120 { | |
121 return invokeObjcSelf!(bool, "isProxy"); | |
122 } | |
123 | |
124 bool isKindOfClass (Class aClass) | |
125 { | |
126 return invokeObjcSelf!(bool, "isKindOfClass:", Class)(aClass); | |
127 } | |
128 | |
129 bool isMemberOfClass (Class aClass) | |
130 { | |
131 return invokeObjcSelf!(bool, "isMemberOfClass:", Class)(aClass); | |
132 } | |
133 | |
134 bool conformsToProtocol (Protocol aProtocol) | |
135 { | |
136 return invokeObjcSelf!(bool, "conformsToProtocol:", Protocol)(aProtocol); | |
137 } | |
138 | |
139 bool respondsToSelector (SEL aSelector) | |
140 { | |
141 return invokeObjcSelf!(bool, "respondsToSelector:", SEL)(aSelector); | |
142 } | |
143 | |
144 Object retain () | |
145 { | |
146 return invokeObjcSelf!(Object, "retain"); | |
147 } | |
148 | |
149 void release () | |
150 { | |
151 return invokeObjcSelf!(void, "release"); | |
152 } | |
153 | |
154 Object autorelease () | |
155 { | |
156 return invokeObjcSelf!(Object, "autorelease"); | |
157 } | |
158 | |
159 NSUInteger retainCount () | |
160 { | |
161 return invokeObjcSelf!(NSUInteger, "retainCount"); | |
162 } | |
163 } | |
164 |