Mercurial > projects > dstep
annotate dstep/foundation/NSConnection.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.NSConnection; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSData; | |
11 import dstep.foundation.NSDate; | |
12 import dstep.foundation.NSDictionary; | |
13 import dstep.foundation.NSDistantObject; | |
14 import dstep.foundation.NSException; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
15 import dstep.foundation.NSInvocation; |
14 | 16 import dstep.foundation.NSObject; |
17 import dstep.foundation.NSPort; | |
18 import dstep.foundation.NSPortNameServer; | |
19 import dstep.foundation.NSRunLoop; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
20 import dstep.foundation.NSString; |
14 | 21 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
22 import dstep.objc.objc; |
14 | 23 |
24 import bindings = dstep.foundation.NSConnection_bindings; | |
25 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
26 private |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
27 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
28 NSString NSConnectionReplyMode_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
29 NSString NSConnectionDidDieNotification_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 NSString NSFailedAuthenticationException_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 NSString NSConnectionDidInitializeNotification_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
32 } |
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 NSString NSConnectionReplyMode () |
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 if (NSConnectionReplyMode_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
37 return NSConnectionReplyMode_; |
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 NSConnectionReplyMode_ = new NSString(bindings.NSConnectionReplyMode); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
40 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
41 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
42 NSString NSConnectionDidDieNotification () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
43 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
44 if (NSConnectionDidDieNotification_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
45 return NSConnectionDidDieNotification_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
46 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
47 return NSConnectionDidDieNotification_ = new NSString(bindings.NSConnectionDidDieNotification); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
48 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
49 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
50 NSString NSFailedAuthenticationException () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
51 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
52 if (NSFailedAuthenticationException_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
53 return NSFailedAuthenticationException_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
54 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
55 return NSFailedAuthenticationException_ = new NSString(bindings.NSFailedAuthenticationException); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
56 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
57 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
58 NSString NSConnectionDidInitializeNotification () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
59 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
60 if (NSConnectionDidInitializeNotification_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
61 return NSConnectionDidInitializeNotification_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
62 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
63 return NSConnectionDidInitializeNotification_ = new NSString(bindings.NSConnectionDidInitializeNotification); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
64 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
65 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
66 const TNSDistantObjectRequestMethods = ` |
14 | 67 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
68 bool connection (NSConnection connection, NSDistantObjectRequest doreq) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
69 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
70 return invokeObjcSelf!(bool, "connection:handleRequest:", NSConnection, NSDistantObjectRequest)(connection, doreq); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
71 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
72 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
73 //mixin ObjcBindMethod!(connection, "connection:handleRequest:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
74 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
75 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
76 const TNSConnectionDelegateMethods = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
77 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
78 bool makeNewConnection (NSConnection conn, NSConnection ancestor) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
79 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
80 return invokeObjcSelf!(bool, "makeNewConnection:sender:")(conn, ancestor); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
81 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
82 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
83 bool connection (NSConnection ancestor, NSConnection conn) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
84 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
85 return invokeObjcSelf!(bool, "connection:shouldMakeNewConnection:", NSConnection, NSConnection)(ancestor, conn); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
86 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
87 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
88 NSData authenticationDataForComponents (NSArray components) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
89 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
90 return invokeObjcSelf!(NSData, "authenticationDataForComponents:", NSArray)(components); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
91 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
92 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
93 bool authenticateComponents (NSArray components, NSData signature) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
94 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
95 return invokeObjcSelf!(bool, "authenticateComponents:withData:")(components, signature); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
96 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
97 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
98 Object createConversationForConnection (NSConnection conn) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
99 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
100 return invokeObjcSelf!(Object, "createConversationForConnection:")(conn); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
101 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
102 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
103 //mixin ObjcBindMethod!(makeNewConnection, "makeNewConnection:sender:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
104 //mixin ObjcBindMethod!(connection, "connection:shouldMakeNewConnection:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
105 //mixin ObjcBindMethod!(authenticationDataForComponents, "authenticationDataForComponents:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
106 //mixin ObjcBindMethod!(authenticateComponents, "authenticateComponents:withData:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
107 //mixin ObjcBindMethod!(createConversationForConnection, "createConversationForConnection:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
108 `; |
14 | 109 |
110 class NSDistantObjectRequest : NSObject | |
111 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
112 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
113 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
114 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
115 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
116 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
117 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
118 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
119 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
120 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
121 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
122 } |
14 | 123 |
124 NSInvocation invocation () | |
125 { | |
126 return invokeObjcSelf!(NSInvocation, "invocation"); | |
127 } | |
128 | |
129 NSConnection connection () | |
130 { | |
131 return invokeObjcSelf!(NSConnection, "connection"); | |
132 } | |
133 | |
134 Object conversation () | |
135 { | |
136 return invokeObjcSelf!(Object, "conversation"); | |
137 } | |
138 | |
139 void replyWithException (NSException exception) | |
140 { | |
141 return invokeObjcSelf!(void, "replyWithException:", NSException)(exception); | |
142 } | |
143 } | |
144 | |
145 class NSConnection : NSObject | |
146 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
147 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
148 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
149 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
150 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
151 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
152 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
153 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
154 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
155 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
156 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
157 } |
14 | 158 |
159 NSDictionary statistics () | |
160 { | |
161 return invokeObjcSelf!(NSDictionary, "statistics"); | |
162 } | |
163 | |
164 static NSArray allConnections () | |
165 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
166 return invokeObjcSuperClass!(NSArray, "allConnections"); |
14 | 167 } |
168 | |
169 static NSConnection defaultConnection () | |
170 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
171 return invokeObjcSuperClass!(NSConnection, "defaultConnection"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
172 } |
14 | 173 |
174 static Object connectionWithRegisteredName (NSString name, NSString hostName) | |
175 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
176 return invokeObjcSuperClass!(Object, "connectionWithRegisteredName:host:", NSString, NSString)(name, hostName); |
14 | 177 } |
178 | |
179 static Object connectionWithRegisteredName (NSString name, NSString hostName, NSPortNameServer server) | |
180 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
181 return invokeObjcSuperClass!(Object, "connectionWithRegisteredName:host:usingNameServer:", NSString, NSString, NSPortNameServer)(name, hostName, server); |
14 | 182 } |
183 | |
184 static NSDistantObject rootProxyForConnectionWithRegisteredName (NSString name, NSString hostName) | |
185 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
186 return invokeObjcSuperClass!(NSDistantObject, "rootProxyForConnectionWithRegisteredName:host:", NSString, NSString)(name, hostName); |
14 | 187 } |
188 | |
189 static NSDistantObject rootProxyForConnectionWithRegisteredName (NSString name, NSString hostName, NSPortNameServer server) | |
190 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
191 return invokeObjcSuperClass!(NSDistantObject, "rootProxyForConnectionWithRegisteredName:host:usingNameServer:", NSString, NSString, NSPortNameServer)(name, hostName, server); |
14 | 192 } |
193 | |
194 static Object serviceConnectionWithName (NSString name, Object root, NSPortNameServer server) | |
195 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
196 return invokeObjcSuperClass!(Object, "serviceConnectionWithName:rootObject:usingNameServer:", NSString, Object, NSPortNameServer)(name, root, server); |
14 | 197 } |
198 | |
199 static Object serviceConnectionWithName (NSString name, Object root) | |
200 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
201 return invokeObjcSuperClass!(Object, "serviceConnectionWithName:rootObject:", NSString, Object)(name, root); |
14 | 202 } |
203 | |
204 void setRequestTimeout (double ti) | |
205 { | |
206 return invokeObjcSelf!(void, "setRequestTimeout:", double)(ti); | |
207 } | |
208 | |
209 double requestTimeout () | |
210 { | |
211 return invokeObjcSelf!(double, "requestTimeout"); | |
212 } | |
213 | |
214 void setReplyTimeout (double ti) | |
215 { | |
216 return invokeObjcSelf!(void, "setReplyTimeout:", double)(ti); | |
217 } | |
218 | |
219 double replyTimeout () | |
220 { | |
221 return invokeObjcSelf!(double, "replyTimeout"); | |
222 } | |
223 | |
224 void setRootObject (Object anObject) | |
225 { | |
226 return invokeObjcSelf!(void, "setRootObject:", Object)(anObject); | |
227 } | |
228 | |
229 Object rootObject () | |
230 { | |
231 return invokeObjcSelf!(Object, "rootObject"); | |
232 } | |
233 | |
234 NSDistantObject rootProxy () | |
235 { | |
236 return invokeObjcSelf!(NSDistantObject, "rootProxy"); | |
237 } | |
238 | |
239 void setDelegate (Object anObject) | |
240 { | |
241 return invokeObjcSelf!(void, "setDelegate:", Object)(anObject); | |
242 } | |
243 | |
244 Object delegate_ () | |
245 { | |
246 return invokeObjcSelf!(Object, "delegate"); | |
247 } | |
248 | |
249 void setIndependentConversationQueueing (bool yorn) | |
250 { | |
251 return invokeObjcSelf!(void, "setIndependentConversationQueueing:", bool)(yorn); | |
252 } | |
253 | |
254 bool independentConversationQueueing () | |
255 { | |
256 return invokeObjcSelf!(bool, "independentConversationQueueing"); | |
257 } | |
258 | |
259 bool isValid () | |
260 { | |
261 return invokeObjcSelf!(bool, "isValid"); | |
262 } | |
263 | |
264 void invalidate () | |
265 { | |
266 return invokeObjcSelf!(void, "invalidate"); | |
267 } | |
268 | |
269 void addRequestMode (NSString rmode) | |
270 { | |
271 return invokeObjcSelf!(void, "addRequestMode:", NSString)(rmode); | |
272 } | |
273 | |
274 void removeRequestMode (NSString rmode) | |
275 { | |
276 return invokeObjcSelf!(void, "removeRequestMode:", NSString)(rmode); | |
277 } | |
278 | |
279 NSArray requestModes () | |
280 { | |
281 return invokeObjcSelf!(NSArray, "requestModes"); | |
282 } | |
283 | |
284 bool registerName (NSString name) | |
285 { | |
286 return invokeObjcSelf!(bool, "registerName:", NSString)(name); | |
287 } | |
288 | |
289 bool registerName (NSString name, NSPortNameServer server) | |
290 { | |
291 return invokeObjcSelf!(bool, "registerName:withNameServer:", NSString, NSPortNameServer)(name, server); | |
292 } | |
293 | |
294 static Object connectionWithReceivePort (NSPort receivePort, NSPort sendPort) | |
295 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
296 return invokeObjcSuperClass!(Object, "connectionWithReceivePort:sendPort:", NSPort, NSPort)(receivePort, sendPort); |
14 | 297 } |
298 | |
299 static Object currentConversation () | |
300 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
301 return invokeObjcSuperClass!(Object, "currentConversation"); |
14 | 302 } |
303 | |
304 Object initWithReceivePort (NSPort receivePort, NSPort sendPort) | |
305 { | |
306 return invokeObjcSelf!(Object, "initWithReceivePort:sendPort:", NSPort, NSPort)(receivePort, sendPort); | |
307 } | |
308 | |
309 this (NSPort receivePort, NSPort sendPort) | |
310 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
311 typeof(this).alloc.initWithReceivePort(receivePort, sendPort); |
14 | 312 } |
313 | |
314 NSPort sendPort () | |
315 { | |
316 return invokeObjcSelf!(NSPort, "sendPort"); | |
317 } | |
318 | |
319 NSPort receivePort () | |
320 { | |
321 return invokeObjcSelf!(NSPort, "receivePort"); | |
322 } | |
323 | |
324 void enableMultipleThreads () | |
325 { | |
326 return invokeObjcSelf!(void, "enableMultipleThreads"); | |
327 } | |
328 | |
329 bool multipleThreadsEnabled () | |
330 { | |
331 return invokeObjcSelf!(bool, "multipleThreadsEnabled"); | |
332 } | |
333 | |
334 void addRunLoop (NSRunLoop runloop) | |
335 { | |
336 return invokeObjcSelf!(void, "addRunLoop:", NSRunLoop)(runloop); | |
337 } | |
338 | |
339 void removeRunLoop (NSRunLoop runloop) | |
340 { | |
341 return invokeObjcSelf!(void, "removeRunLoop:", NSRunLoop)(runloop); | |
342 } | |
343 | |
344 void runInNewThread () | |
345 { | |
346 return invokeObjcSelf!(void, "runInNewThread"); | |
347 } | |
348 | |
349 NSArray remoteObjects () | |
350 { | |
351 return invokeObjcSelf!(NSArray, "remoteObjects"); | |
352 } | |
353 | |
354 NSArray localObjects () | |
355 { | |
356 return invokeObjcSelf!(NSArray, "localObjects"); | |
357 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
358 } |