Mercurial > projects > dstep
annotate dstep/foundation/NSProxy.d @ 27:57371c29ef73 default tip
ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 09 Apr 2010 23:00:22 +0200 |
parents | b9de51448c6b |
children |
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 { |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
22 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
23 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
24 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
25 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
26 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
27 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
28 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
29 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
30 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 } |
14 | 33 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
34 typeof(this) init () |
14 | 35 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
36 return invokeObjcSelf!(typeof(this), "init"); |
14 | 37 } |
38 | |
39 static Object allocWithZone (NSZone* zone) | |
40 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 return invokeObjcSuperClass!(Object, "allocWithZone:", NSZone*)(zone); |
14 | 42 } |
43 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
44 static Class class_static () |
14 | 45 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
46 return invokeObjcSuperClass!(Class, "class"); |
14 | 47 } |
48 | |
49 void forwardInvocation (NSInvocation invocation) | |
50 { | |
51 return invokeObjcSelf!(void, "forwardInvocation:", NSInvocation)(invocation); | |
52 } | |
53 | |
54 NSMethodSignature methodSignatureForSelector (SEL sel) | |
55 { | |
56 return invokeObjcSelf!(NSMethodSignature, "methodSignatureForSelector:", SEL)(sel); | |
57 } | |
58 | |
59 void dealloc () | |
60 { | |
61 return invokeObjcSelf!(void, "dealloc"); | |
62 } | |
63 | |
64 void finalize () | |
65 { | |
66 return invokeObjcSelf!(void, "finalize"); | |
67 } | |
68 | |
69 NSString description () | |
70 { | |
71 return invokeObjcSelf!(NSString, "description"); | |
72 } | |
73 | |
74 static bool respondsToSelector (SEL aSelector) | |
75 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
76 return invokeObjcSuperClass!(bool, "respondsToSelector:", SEL)(aSelector); |
14 | 77 } |
78 | |
79 bool isEqual (Object object) | |
80 { | |
81 return invokeObjcSelf!(bool, "isEqual:", Object)(object); | |
82 } | |
83 | |
84 NSUInteger hash () | |
85 { | |
86 return invokeObjcSelf!(NSUInteger, "hash"); | |
87 } | |
88 | |
89 Class superclass () | |
90 { | |
91 return invokeObjcSelf!(Class, "superclass"); | |
92 } | |
93 | |
94 Class class_ () | |
95 { | |
96 return invokeObjcSelf!(Class, "class"); | |
97 } | |
98 | |
99 Object self () | |
100 { | |
101 return invokeObjcSelf!(Object, "self"); | |
102 } | |
103 | |
104 NSZone* zone () | |
105 { | |
106 return invokeObjcSelf!(NSZone*, "zone"); | |
107 } | |
108 | |
109 Object performSelector (SEL aSelector) | |
110 { | |
111 return invokeObjcSelf!(Object, "performSelector:", SEL)(aSelector); | |
112 } | |
113 | |
114 Object performSelector (SEL aSelector, Object object) | |
115 { | |
116 return invokeObjcSelf!(Object, "performSelector:withObject:", SEL, Object)(aSelector, object); | |
117 } | |
118 | |
119 Object performSelector (SEL aSelector, Object object1, Object object2) | |
120 { | |
121 return invokeObjcSelf!(Object, "performSelector:withObject:withObject:", SEL, Object, Object)(aSelector, object1, object2); | |
122 } | |
123 | |
124 bool isProxy () | |
125 { | |
126 return invokeObjcSelf!(bool, "isProxy"); | |
127 } | |
128 | |
129 bool isKindOfClass (Class aClass) | |
130 { | |
131 return invokeObjcSelf!(bool, "isKindOfClass:", Class)(aClass); | |
132 } | |
133 | |
134 bool isMemberOfClass (Class aClass) | |
135 { | |
136 return invokeObjcSelf!(bool, "isMemberOfClass:", Class)(aClass); | |
137 } | |
138 | |
139 bool conformsToProtocol (Protocol aProtocol) | |
140 { | |
141 return invokeObjcSelf!(bool, "conformsToProtocol:", Protocol)(aProtocol); | |
142 } | |
143 | |
144 bool respondsToSelector (SEL aSelector) | |
145 { | |
146 return invokeObjcSelf!(bool, "respondsToSelector:", SEL)(aSelector); | |
147 } | |
148 | |
149 Object retain () | |
150 { | |
151 return invokeObjcSelf!(Object, "retain"); | |
152 } | |
153 | |
154 void release () | |
155 { | |
156 return invokeObjcSelf!(void, "release"); | |
157 } | |
158 | |
159 Object autorelease () | |
160 { | |
161 return invokeObjcSelf!(Object, "autorelease"); | |
162 } | |
163 | |
164 NSUInteger retainCount () | |
165 { | |
166 return invokeObjcSelf!(NSUInteger, "retainCount"); | |
167 } | |
168 } | |
169 |