comparison dstep/foundation/NSObject.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 6255d355d752
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
4 * Version: Initial created: Aug 3, 2009 4 * Version: Initial created: Aug 3, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) 5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */ 6 */
7 module dstep.foundation.NSObject; 7 module dstep.foundation.NSObject;
8 8
9 import dstep.foundation.NSArchiver;
10 import dstep.foundation.NSArray;
11 import dstep.foundation.NSClassDescription;
9 import dstep.foundation.NSCoder; 12 import dstep.foundation.NSCoder;
13 import dstep.foundation.NSConnection;
14 import dstep.foundation.NSData;
15 import dstep.foundation.NSDictionary;
10 import dstep.foundation.NSEnumerator; 16 import dstep.foundation.NSEnumerator;
17 import dstep.foundation.NSError;
18 import dstep.foundation.NSFileManager;
19 import dstep.foundation.NSIndexSet;
11 import dstep.foundation.NSInvocation; 20 import dstep.foundation.NSInvocation;
21 import dstep.foundation.NSKeyedArchiver;
22 import dstep.foundation.NSKeyValueCoding;
23 import dstep.foundation.NSKeyValueObserving;
24 import dstep.foundation.NSMetadata;
12 import dstep.foundation.NSMethodSignature; 25 import dstep.foundation.NSMethodSignature;
26 import dstep.foundation.NSNetServices;
13 import dstep.foundation.NSObjCRuntime; 27 import dstep.foundation.NSObjCRuntime;
28 import dstep.foundation.NSObjectScripting;
29 import dstep.foundation.NSPort;
30 import dstep.foundation.NSPortCoder;
31 import dstep.foundation.NSPortMessage;
32 import dstep.foundation.NSRange;
33 import dstep.foundation.NSRunLoop;
34 import dstep.foundation.NSScriptClassDescription;
35 import dstep.foundation.NSScriptKeyValueCoding;
36 import dstep.foundation.NSScriptObjectSpecifiers;
37 import dstep.foundation.NSScriptWhoseTests;
38 import dstep.foundation.NSSet;
39 import dstep.foundation.NSSpellServer;
40 import dstep.foundation.NSStream;
14 import dstep.foundation.NSString; 41 import dstep.foundation.NSString;
42 import dstep.foundation.NSThread;
43 import dstep.foundation.NSURL;
44 import dstep.foundation.NSURLAuthenticationChallenge;
45 import dstep.foundation.NSURLCache;
46 import dstep.foundation.NSURLConnection;
47 import dstep.foundation.NSURLDownload;
48 import dstep.foundation.NSURLRequest;
49 import dstep.foundation.NSURLResponse;
50 import dstep.foundation.NSXMLParser;
15 import dstep.foundation.NSZone; 51 import dstep.foundation.NSZone;
16 import dstep.foundation.Protocol; 52 import dstep.internal.Version;
17 import dstep.objc.bridge.Bridge; 53 import dstep.objc.bridge.Bridge;
18 import dstep.objc.objc : id; 54 import dstep.objc.bridge.Wrapper;
19 55 import dstep.objc.message;
20 class NSObject : INSObject 56 import dstep.objc.objc;
21 { 57
22 mixin ObjcWrap; 58
23 mixin TNSURLConnectionDelegate; 59 import bindings = dstep.foundation.NSObject_bindings;
24 mixin TNSFileManagerFileOperationAdditions; 60
25 mixin TNSDeprecatedKeyValueCoding; 61 import dstep.objc.runtime;
26 mixin TNSDistributedObjects;
27 mixin TNSArchiverCallback;
28 mixin TNSKeyValueObserverNotification;
29 mixin TNSMetadataQueryDelegate;
30 mixin TNSKeyValueObservingCustomization;
31 mixin TNSKeyedArchiverObjectSubstitution;
32 mixin TNSScriptClassDescription;
33 mixin TNSDelayedPerforming;
34 mixin TNSStreamDelegateEventExtensions;
35 mixin TNSCopyLinkMoveHandler;
36 mixin TNSMachPortDelegateMethods;
37 mixin TNSComparisonMethods;
38 mixin TNSSpellServerDelegate;
39 mixin TNSScriptKeyValueCoding;
40 mixin TNSDistantObjectRequestMethods;
41 mixin TNSClassDescriptionPrimitives;
42 mixin TNSKeyedUnarchiverObjectSubstitution;
43 mixin TNSScriptObjectSpecifiers;
44 mixin TNSNetServiceDelegateMethods;
45 mixin TNSConnectionDelegateMethods;
46 mixin TNSXMLParserDelegateEventAdditions;
47 mixin TNSErrorRecoveryAttempting;
48 mixin TNSDeprecatedMethods;
49 mixin TNSPortDelegateMethods;
50 mixin TNSURLClient;
51 mixin TNSScriptingComparisonMethods;
52 mixin TNSNetServiceBrowserDelegateMethods;
53 mixin TNSCoderMethods;
54 mixin TNSDeprecatedKeyValueObservingCustomization;
55 mixin TNSKeyedUnarchiverDelegate;
56 mixin TNSScripting;
57 mixin TNSURLDownloadDelegate;
58 mixin TNSKeyValueCoding;
59 mixin TNSKeyedArchiverDelegate;
60 mixin TNSThreadPerformAdditions;
61 mixin TNSKeyValueObserving;
62
63 static void load ()
64 {
65 return invokeObjcSelfClass!(void, "load");
66 }
67
68 static void initialize ()
69 {
70 return invokeObjcSelfClass!(void, "initialize");
71 }
72
73 Object init ()
74 {
75 return invokeObjcSelf!(Object, "init");
76 }
77
78 this ()
79 {
80 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass);
81 id result = Bridge.invokeObjcMethod!(id, "init")(objcObject);
82
83 if (result)
84 objcObject = ret;
85
86 dObject = this;
87 }
88
89 static Object new_ ()
90 {
91 return invokeObjcSelfClass!(Object, "new");
92 }
93
94 static Object allocWithZone (NSZone* zone)
95 {
96 return invokeObjcSelfClass!(Object, "allocWithZone:", NSZone*)(zone);
97 }
98
99 static Object alloc ()
100 {
101 return invokeObjcSelfClass!(Object, "alloc");
102 }
103
104 void dealloc ()
105 {
106 return invokeObjcSelf!(void, "dealloc");
107 }
108
109 void finalize ()
110 {
111 return invokeObjcSelf!(void, "finalize");
112 }
113
114 Object copy ()
115 {
116 return invokeObjcSelf!(Object, "copy");
117 }
118
119 Object mutableCopy ()
120 {
121 return invokeObjcSelf!(Object, "mutableCopy");
122 }
123
124 static Object copyWithZone (NSZone* zone)
125 {
126 return invokeObjcSelfClass!(Object, "copyWithZone:", NSZone*)(zone);
127 }
128
129 static Object mutableCopyWithZone (NSZone* zone)
130 {
131 return invokeObjcSelfClass!(Object, "mutableCopyWithZone:", NSZone*)(zone);
132 }
133
134 static Class superclass ()
135 {
136 return invokeObjcSelfClass!(Class, "superclass");
137 }
138
139 static Class class_ ()
140 {
141 return invokeObjcSelfClass!(Class, "class");
142 }
143
144 static bool instancesRespondToSelector (SEL aSelector)
145 {
146 return invokeObjcSelfClass!(bool, "instancesRespondToSelector:", SEL)(aSelector);
147 }
148
149 static bool conformsToProtocol (Protocol protocol)
150 {
151 return invokeObjcSelfClass!(bool, "conformsToProtocol:", Protocol)(protocol);
152 }
153
154 IMP methodForSelector (SEL aSelector)
155 {
156 return invokeObjcSelf!(IMP, "methodForSelector:", SEL)(aSelector);
157 }
158
159 static IMP instanceMethodForSelector (SEL aSelector)
160 {
161 return invokeObjcSelfClass!(IMP, "instanceMethodForSelector:", SEL)(aSelector);
162 }
163
164 void doesNotRecognizeSelector (SEL aSelector)
165 {
166 return invokeObjcSelf!(void, "doesNotRecognizeSelector:", SEL)(aSelector);
167 }
168
169 void forwardInvocation (NSInvocation anInvocation)
170 {
171 return invokeObjcSelf!(void, "forwardInvocation:", NSInvocation)(anInvocation);
172 }
173
174 NSMethodSignature methodSignatureForSelector (SEL aSelector)
175 {
176 return invokeObjcSelf!(NSMethodSignature, "methodSignatureForSelector:", SEL)(aSelector);
177 }
178
179 static NSMethodSignature instanceMethodSignatureForSelector (SEL aSelector)
180 {
181 return invokeObjcSelfClass!(NSMethodSignature, "instanceMethodSignatureForSelector:", SEL)(aSelector);
182 }
183
184 static NSString description ()
185 {
186 return invokeObjcSelfClass!(NSString, "description");
187 }
188
189 static bool isSubclassOfClass (Class aClass)
190 {
191 return invokeObjcSelfClass!(bool, "isSubclassOfClass:", Class)(aClass);
192 }
193
194 static bool resolveClassMethod (SEL sel)
195 {
196 return invokeObjcSelfClass!(bool, "resolveClassMethod:", SEL)(sel);
197 }
198
199 static bool resolveInstanceMethod (SEL sel)
200 {
201 return invokeObjcSelfClass!(bool, "resolveInstanceMethod:", SEL)(sel);
202 }
203
204 bool isEqual (Object object)
205 {
206 return invokeObjcSelf!(bool, "isEqual:", Object)(object);
207 }
208
209 NSUInteger hash ()
210 {
211 return invokeObjcSelf!(NSUInteger, "hash");
212 }
213
214 Class superclass ()
215 {
216 return invokeObjcSelf!(Class, "superclass");
217 }
218
219 Class class_ ()
220 {
221 return invokeObjcSelf!(Class, "class");
222 }
223
224 Object self ()
225 {
226 return invokeObjcSelf!(Object, "self");
227 }
228
229 NSZone* zone ()
230 {
231 return invokeObjcSelf!(NSZone*, "zone");
232 }
233
234 Object performSelector (SEL aSelector)
235 {
236 return invokeObjcSelf!(Object, "performSelector:", SEL)(aSelector);
237 }
238
239 Object performSelector (SEL aSelector, Object object)
240 {
241 return invokeObjcSelf!(Object, "performSelector:withObject:", SEL, Object)(aSelector, object);
242 }
243
244 Object performSelector (SEL aSelector, Object object1, Object object2)
245 {
246 return invokeObjcSelf!(Object, "performSelector:withObject:withObject:", SEL, Object, Object)(aSelector, object1, object2);
247 }
248
249 bool isProxy ()
250 {
251 return invokeObjcSelf!(bool, "isProxy");
252 }
253
254 bool isKindOfClass (Class aClass)
255 {
256 return invokeObjcSelf!(bool, "isKindOfClass:", Class)(aClass);
257 }
258
259 bool isMemberOfClass (Class aClass)
260 {
261 return invokeObjcSelf!(bool, "isMemberOfClass:", Class)(aClass);
262 }
263
264 bool conformsToProtocol (Protocol aProtocol)
265 {
266 return invokeObjcSelf!(bool, "conformsToProtocol:", Protocol)(aProtocol);
267 }
268
269 bool respondsToSelector (SEL aSelector)
270 {
271 return invokeObjcSelf!(bool, "respondsToSelector:", SEL)(aSelector);
272 }
273
274 Object retain ()
275 {
276 return invokeObjcSelf!(Object, "retain");
277 }
278
279 void release ()
280 {
281 return invokeObjcSelf!(void, "release");
282 }
283
284 Object autorelease ()
285 {
286 return invokeObjcSelf!(Object, "autorelease");
287 }
288
289 NSUInteger retainCount ()
290 {
291 return invokeObjcSelf!(NSUInteger, "retainCount");
292 }
293
294 NSString description ()
295 {
296 return invokeObjcSelf!(NSString, "description");
297 }
298 }
299 62
300 interface INSCopying 63 interface INSCopying
301 { 64 {
302 Object copyWithZone (NSZone* zone); 65 Object copyWithZone (NSZone* zone);
303 } 66 }
334 { 97 {
335 void encodeWithCoder (NSCoder aCoder); 98 void encodeWithCoder (NSCoder aCoder);
336 Object initWithCoder (NSCoder aDecoder); 99 Object initWithCoder (NSCoder aDecoder);
337 } 100 }
338 101
339 template TNSDeprecatedMethods () 102 const TNSDeprecatedMethods = `
103
104 static void poseAsClass (Class aClass)
105 {
106 return invokeObjcSelfClass!(void, "poseAsClass:", Class)(aClass);
107 }
108
109 //mixin ObjcBindClassMethod!(poseAsClass, "poseAsClass:");
110 `;
111
112 const TNSCoderMethods = `
113
114 static NSInteger version_ ()
115 {
116 return invokeObjcSelfClass!(NSInteger, "version");
117 }
118
119 static void setVersion (NSInteger aVersion)
120 {
121 return invokeObjcSelfClass!(NSInteger, "setVersion");
122 }
123
124 Class classForCoder ()
125 {
126 return invokeObjcSelf!(Class, "classForCoder");
127 }
128
129 Object replacementObjectForCoder (NSCoder aCoder)
130 {
131 return invokeObjcSelf!(Object, "replacementObjectForCoder:", NSCoder)(aCoder);
132 }
133
134 Object awakeAfterUsingCoder (NSCoder aDecoder)
135 {
136 return invokeObjcSelf!(Object, "awakeAfterUsingCoder:", NSCoder)(aDecoder);
137 }
138
139 //mixin ObjcBindClassMethod!(version_, "version");
140 //mixin ObjcBindClassMethod!(setVersion, "setVersion");
141 //mixin ObjcBindMethod!(classForCoder, "classForCoder");
142 //mixin ObjcBindMethod!(replacementObjectForCoder, "replacementObjectForCoder:");
143 //mixin ObjcBindMethod!(awakeAfterUsingCoder, "awakeAfterUsingCoder:");
144 `;
145
146 class NSObject : ObjcWrapper, INSObject
340 { 147 {
341 static void poseAsClass (Class aClass); 148 mixin (ObjcWrap);
342 } 149
343 150 this ()
344 template TNSCoderMethods () 151 {
345 { 152 super(NSObject.alloc.init.objcObject);
346 static NSInteger version_ (); 153 }
347 static void setVersion (NSInteger aVersion); 154
348 Class classForCoder (); 155 NSObject init ()
349 Object replacementObjectForCoder (NSCoder aCoder); 156 {
350 Object awakeAfterUsingCoder (NSCoder aDecoder); 157 return invokeObjcSelf!(NSObject, "init");
158 }
159
160 static void load ()
161 {
162 return invokeObjcSuperClass!(void, "load");
163 }
164
165 static void initialize ()
166 {
167 return invokeObjcSuperClass!(void, "initialize");
168 }
169
170 static Object new_ ()
171 {
172 return invokeObjcSuperClass!(Object, "new");
173 }
174
175 static Object allocWithZone (NSZone* zone)
176 {
177 return invokeObjcSuperClass!(Object, "allocWithZone:", NSZone*)(zone);
178 }
179
180 void dealloc ()
181 {
182 return invokeObjcSelf!(void, "dealloc");
183 }
184
185 void finalize ()
186 {
187 return invokeObjcSelf!(void, "finalize");
188 }
189
190 Object copy ()
191 {
192 return invokeObjcSelf!(Object, "copy");
193 }
194
195 Object mutableCopy ()
196 {
197 return invokeObjcSelf!(Object, "mutableCopy");
198 }
199
200 static Object copyWithZone (NSZone* zone)
201 {
202 return invokeObjcSuperClass!(Object, "copyWithZone:", NSZone*)(zone);
203 }
204
205 static Object mutableCopyWithZone (NSZone* zone)
206 {
207 return invokeObjcSuperClass!(Object, "mutableCopyWithZone:", NSZone*)(zone);
208 }
209
210 static Class superclass_static ()
211 {
212 return invokeObjcSuperClass!(Class, "superclass");
213 }
214
215 static Class class_static ()
216 {
217 return invokeObjcSuperClass!(Class, "class");
218 }
219
220 static bool instancesRespondToSelector (SEL aSelector)
221 {
222 return invokeObjcSuperClass!(bool, "instancesRespondToSelector:", SEL)(aSelector);
223 }
224
225 static bool conformsToProtocol (Protocol protocol)
226 {
227 return invokeObjcSuperClass!(bool, "conformsToProtocol:", Protocol)(protocol);
228 }
229
230 IMP methodForSelector (SEL aSelector)
231 {
232 return invokeObjcSelf!(IMP, "methodForSelector:", SEL)(aSelector);
233 }
234
235 static IMP instanceMethodForSelector (SEL aSelector)
236 {
237 return invokeObjcSuperClass!(IMP, "instanceMethodForSelector:", SEL)(aSelector);
238 }
239
240 void doesNotRecognizeSelector (SEL aSelector)
241 {
242 return invokeObjcSelf!(void, "doesNotRecognizeSelector:", SEL)(aSelector);
243 }
244
245 void forwardInvocation (NSInvocation anInvocation)
246 {
247 return invokeObjcSelf!(void, "forwardInvocation:", NSInvocation)(anInvocation);
248 }
249
250 NSMethodSignature methodSignatureForSelector (SEL aSelector)
251 {
252 return invokeObjcSelf!(NSMethodSignature, "methodSignatureForSelector:", SEL)(aSelector);
253 }
254
255 static NSMethodSignature instanceMethodSignatureForSelector (SEL aSelector)
256 {
257 return invokeObjcSuperClass!(NSMethodSignature, "instanceMethodSignatureForSelector:", SEL)(aSelector);
258 }
259
260 static NSString description_static ()
261 {
262 return invokeObjcSuperClass!(NSString, "description");
263 }
264
265 static bool isSubclassOfClass (Class aClass)
266 {
267 return invokeObjcSuperClass!(bool, "isSubclassOfClass:", Class)(aClass);
268 }
269
270 static bool resolveClassMethod (SEL sel)
271 {
272 return invokeObjcSuperClass!(bool, "resolveClassMethod:", SEL)(sel);
273 }
274
275 static bool resolveInstanceMethod (SEL sel)
276 {
277 return invokeObjcSuperClass!(bool, "resolveInstanceMethod:", SEL)(sel);
278 }
279
280 bool isEqual (Object object)
281 {
282 return invokeObjcSelf!(bool, "isEqual:", Object)(object);
283 }
284
285 NSUInteger hash ()
286 {
287 return invokeObjcSelf!(NSUInteger, "hash");
288 }
289
290 Class superclass ()
291 {
292 return invokeObjcSelf!(Class, "superclass");
293 }
294
295 Class class_ ()
296 {
297 return invokeObjcSelf!(Class, "class");
298 }
299
300 Object self ()
301 {
302 return invokeObjcSelf!(Object, "self");
303 }
304
305 NSZone* zone ()
306 {
307 return invokeObjcSelf!(NSZone*, "zone");
308 }
309
310 Object performSelector (SEL aSelector)
311 {
312 return invokeObjcSelf!(Object, "performSelector:", SEL)(aSelector);
313 }
314
315 Object performSelector (SEL aSelector, Object object)
316 {
317 return invokeObjcSelf!(Object, "performSelector:withObject:", SEL, Object)(aSelector, object);
318 }
319
320 Object performSelector (SEL aSelector, Object object1, Object object2)
321 {
322 return invokeObjcSelf!(Object, "performSelector:withObject:withObject:", SEL, Object, Object)(aSelector, object1, object2);
323 }
324
325 bool isProxy ()
326 {
327 return invokeObjcSelf!(bool, "isProxy");
328 }
329
330 bool isKindOfClass (Class aClass)
331 {
332 return invokeObjcSelf!(bool, "isKindOfClass:", Class)(aClass);
333 }
334
335 bool isMemberOfClass (Class aClass)
336 {
337 return invokeObjcSelf!(bool, "isMemberOfClass:", Class)(aClass);
338 }
339
340 bool conformsToProtocol (Protocol aProtocol)
341 {
342 return invokeObjcSelf!(bool, "conformsToProtocol:", Protocol)(aProtocol);
343 }
344
345 bool respondsToSelector (SEL aSelector)
346 {
347 return invokeObjcSelf!(bool, "respondsToSelector:", SEL)(aSelector);
348 }
349
350 Object retain ()
351 {
352 return invokeObjcSelf!(Object, "retain");
353 }
354
355 void release ()
356 {
357 return invokeObjcSelf!(void, "release");
358 }
359
360 Object autorelease ()
361 {
362 return invokeObjcSelf!(Object, "autorelease");
363 }
364
365 NSUInteger retainCount ()
366 {
367 return invokeObjcSelf!(NSUInteger, "retainCount");
368 }
369
370 NSString description ()
371 {
372 return invokeObjcSelf!(NSString, "description");
373 }
374
375 // NSArchiverCallback
376 Class classForArchiver ()
377 {
378 return invokeObjcSelf!(Class, "classForArchiver");
379 }
380
381 Object replacementObjectForArchiver (NSArchiver archiver)
382 {
383 return invokeObjcSelf!(Object, "replacementObjectForArchiver:", NSArchiver)(archiver);
384 }
385
386 // NSClassDescriptionPrimitives
387 NSClassDescription classDescription ()
388 {
389 return invokeObjcSelf!(NSClassDescription, "classDescription");
390 }
391
392 NSArray attributeKeys ()
393 {
394 return invokeObjcSelf!(NSArray, "attributeKeys");
395 }
396
397 NSArray toOneRelationshipKeys ()
398 {
399 return invokeObjcSelf!(NSArray, "toOneRelationshipKeys");
400 }
401
402 NSArray toManyRelationshipKeys ()
403 {
404 return invokeObjcSelf!(NSArray, "toManyRelationshipKeys");
405 }
406
407 NSString inverseForRelationshipKey (NSString relationshipKey)
408 {
409 return invokeObjcSelf!(NSString, "inverseForRelationshipKey:", NSString)(relationshipKey);
410 }
411
412 // NSCoderMethods
413 static NSInteger version_ ()
414 {
415 return invokeObjcSelfClass!(NSInteger, "version");
416 }
417
418 static void setVersion (NSInteger aVersion)
419 {
420 return invokeObjcSelfClass!(NSInteger, "setVersion");
421 }
422
423 Class classForCoder ()
424 {
425 return invokeObjcSelf!(Class, "classForCoder");
426 }
427
428 Object replacementObjectForCoder (NSCoder aCoder)
429 {
430 return invokeObjcSelf!(Object, "replacementObjectForCoder:", NSCoder)(aCoder);
431 }
432
433 Object awakeAfterUsingCoder (NSCoder aDecoder)
434 {
435 return invokeObjcSelf!(Object, "awakeAfterUsingCoder:", NSCoder)(aDecoder);
436 }
437
438 // NSComparisonMethods
439 bool isEqualTo (Object object)
440 {
441 return invokeObjcSelf!(bool, "isEqualTo:", Object)(object);
442 }
443
444 bool isLessThanOrEqualTo (Object object)
445 {
446 return invokeObjcSelf!(bool, "isLessThanOrEqualTo:", Object)(object);
447 }
448
449 bool isLessThan (Object object)
450 {
451 return invokeObjcSelf!(bool, "isLessThan:", Object)(object);
452 }
453
454 bool isGreaterThanOrEqualTo (Object object)
455 {
456 return invokeObjcSelf!(bool, "isGreaterThanOrEqualTo:", Object)(object);
457 }
458
459 bool isGreaterThan (Object object)
460 {
461 return invokeObjcSelf!(bool, "isGreaterThan:", Object)(object);
462 }
463
464 bool isNotEqualTo (Object object)
465 {
466 return invokeObjcSelf!(bool, "isNotEqualTo:", Object)(object);
467 }
468
469 bool doesContain (Object object)
470 {
471 return invokeObjcSelf!(bool, "doesContain:", Object)(object);
472 }
473
474 bool isLike (NSString object)
475 {
476 return invokeObjcSelf!(bool, "isLike:", NSString)(object);
477 }
478
479 bool isCaseInsensitiveLike (NSString object)
480 {
481 return invokeObjcSelf!(bool, "isCaseInsensitiveLike:", NSString)(object);
482 }
483
484 // NSConnectionDelegateMethods
485 bool makeNewConnection (NSConnection conn, NSConnection ancestor)
486 {
487 return invokeObjcSelf!(bool, "makeNewConnection:sender:")(conn, ancestor);
488 }
489
490 bool connection (NSConnection ancestor, NSConnection conn)
491 {
492 return invokeObjcSelf!(bool, "connection:shouldMakeNewConnection:", NSConnection, NSConnection)(ancestor, conn);
493 }
494
495 NSData authenticationDataForComponents (NSArray components)
496 {
497 return invokeObjcSelf!(NSData, "authenticationDataForComponents:", NSArray)(components);
498 }
499
500 bool authenticateComponents (NSArray components, NSData signature)
501 {
502 return invokeObjcSelf!(bool, "authenticateComponents:withData:")(components, signature);
503 }
504
505 Object createConversationForConnection (NSConnection conn)
506 {
507 return invokeObjcSelf!(Object, "createConversationForConnection:")(conn);
508 }
509
510 // NSCopyLinkMoveHandler
511 bool fileManager (NSFileManager fm, NSDictionary errorInfo)
512 {
513 return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:", NSFileManager, NSDictionary)(fm, errorInfo);
514 }
515
516 void fileManager (NSFileManager fm, NSString path)
517 {
518 return invokeObjcSelf!(void, "fileManager:willProcessPath:", NSFileManager, NSString)(fm, path);
519 }
520
521 // NSDelayedPerforming
522 void performSelector (SEL aSelector, Object anArgument, double delay, NSArray modes)
523 {
524 return invokeObjcSelf!(void, "performSelector:withObject:afterDelay:inModes:", SEL, Object, double, NSArray)(aSelector, anArgument, delay, modes);
525 }
526
527 void performSelector (SEL aSelector, Object anArgument, double delay)
528 {
529 return invokeObjcSelf!(void, "performSelector:withObject:afterDelay:", SEL, Object, double)(aSelector, anArgument, delay);
530 }
531
532 static void cancelPreviousPerformRequestsWithTarget (Object aTarget, SEL aSelector, Object anArgument)
533 {
534 return invokeObjcSelfClass!(void, "cancelPreviousPerformRequestsWithTarget:selector:object:", Object, SEL, Object)(aTarget, aSelector, anArgument);
535 }
536
537 static void cancelPreviousPerformRequestsWithTarget (Object aTarget)
538 {
539 return invokeObjcSelfClass!(void, "cancelPreviousPerformRequestsWithTarget:", Object)(aTarget);
540 }
541
542 // NSDeprecatedKeyValueCoding
543 static bool useStoredAccessor ()
544 {
545 return invokeObjcSelfClass!(bool, "useStoredAccessor");
546 }
547
548 Object storedValueForKey (NSString key)
549 {
550 return invokeObjcSelf!(Object, "storedValueForKey:", NSString)(key);
551 }
552
553 void takeStoredValue (Object value, NSString key)
554 {
555 return invokeObjcSelf!(void, "takeStoredValue:forKey:", Object, NSString)(value, key);
556 }
557
558 void takeValue (Object value, NSString key)
559 {
560 return invokeObjcSelf!(void, "takeValue:forKey:", Object, NSString)(value, key);
561 }
562
563 void takeValue_forKeyPath (Object value, NSString keyPath)
564 {
565 return invokeObjcSelf!(void, "takeValue:forKeyPath:", Object, NSString)(value, keyPath);
566 }
567
568 Object handleQueryWithUnboundKey (NSString key)
569 {
570 return invokeObjcSelf!(Object, "handleQueryWithUnboundKey:", NSString)(key);
571 }
572
573 void handleTakeValue (Object value, NSString key)
574 {
575 return invokeObjcSelf!(void, "handleTakeValue:forUnboundKey:", Object, NSString)(value, key);
576 }
577
578 void unableToSetNilForKey (NSString key)
579 {
580 return invokeObjcSelf!(void, "unableToSetNilForKey:", NSString)(key);
581 }
582
583 NSDictionary valuesForKeys (NSArray keys)
584 {
585 return invokeObjcSelf!(NSDictionary, "valuesForKeys:", NSArray)(keys);
586 }
587
588 void takeValuesFromDictionary (NSDictionary properties)
589 {
590 return invokeObjcSelf!(void, "takeValuesFromDictionary:", NSDictionary)(properties);
591 }
592
593 // NSDeprecatedKeyValueObservingCustomization
594 static void setKeys (NSArray keys, NSString dependentKey)
595 {
596 return invokeObjcSelfClass!(void, "setKeys:triggerChangeNotificationsForDependentKey:", NSArray, NSString)(keys, dependentKey);
597 }
598
599 // NSDeprecatedMethods
600 static void poseAsClass (Class aClass)
601 {
602 return invokeObjcSelfClass!(void, "poseAsClass:", Class)(aClass);
603 }
604
605 // NSDistantObjectRequestMethods
606 bool connection (NSConnection connection, NSDistantObjectRequest doreq)
607 {
608 return invokeObjcSelf!(bool, "connection:handleRequest:", NSConnection, NSDistantObjectRequest)(connection, doreq);
609 }
610
611 // NSDistributedObjects
612 Class classForPortCoder ()
613 {
614 return invokeObjcSelf!(Class, "classForPortCoder");
615 }
616
617 Object replacementObjectForPortCoder (NSPortCoder coder)
618 {
619 return invokeObjcSelf!(Object, "replacementObjectForPortCoder:", NSPortCoder)(coder);
620 }
621
622 // NSErrorRecoveryAttempting
623 /*void attemptRecoveryFromError (NSError error, NSUInteger recoveryOptionIndex, Object delegate_, SEL didRecoverSelector, void* contextInfo)
624 {
625 return invokeObjcSelf!(void, "attemptRecoveryFromError:optionIndexdelegate:didRecoverSelector:contextInfo:", NSError, NSUInteger, Object, SEL, void*)(error, recoveryOptionIndex, delegate_, didRecoverSelector, contextInfo);
626 }
627
628 bool attemptRecoveryFromError (NSError error, NSUInteger recoveryOptionIndex)
629 {
630 return invokeObjcSelf!(bool, "attemptRecoveryFromError:optionIndex:", NSError, NSUInteger)(error, recoveryOptionIndex);
631 }
632
633 // NSFileManagerFileOperationAdditions
634 bool fileManager_shouldCopyItemAtPath_toPath_dstPath (NSFileManager fileManager, NSString srcPath, NSString dstPath)
635 {
636 return invokeObjcSelf!(bool, "fileManager:shouldCopyItemAtPath:toPath:dstPath:", NSFileManager, NSString, NSString);
637 }*/
638
639 bool fileManager (NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath)
640 {
641 return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:", NSFileManager, NSError, NSString, NSString)(fileManager, error, srcPath, dstPath);
642 }
643
644 bool fileManager (NSFileManager fileManager, NSString srcPath, NSString dstPath)
645 {
646 return invokeObjcSelf!(bool, "fileManager:shouldMoveItemAtPath:toPath:", NSFileManager, NSString, NSString)(fileManager, srcPath, dstPath);
647 }
648
649 bool fileManager_shouldProceedAfterError_movingItemAtPath_toPath (NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath)
650 {
651 return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:movingItemAtPath:toPath:", NSFileManager, NSError, NSString, NSString)(fileManager, error, srcPath, dstPath);
652 }
653
654 bool fileManager (NSFileManager fileManager, NSString srcPath, NSString dstPath)
655 {
656 return invokeObjcSelf!(bool, "fileManager:shouldLinkItemAtPath:toPath:", NSFileManager, NSString, NSString)(fileManager, srcPath, dstPath);
657 }
658
659 bool fileManager_shouldProceedAfterError_linkingItemAtPath_toPath (NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath)
660 {
661 return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:", NSFileManager, NSError, NSString, NSString)(fileManager, error, srcPath, dstPath);
662 }
663
664 bool fileManager_shouldRemoveItemAtPath (NSFileManager fileManager, NSString path)
665 {
666 return invokeObjcSelf!(bool, "fileManager:shouldRemoveItemAtPath:", NSFileManager, NSString)(fileManager, path);
667 }
668
669 bool fileManager (NSFileManager fileManager, NSError error, NSString path)
670 {
671 return invokeObjcSelf!(bool, "fileManager:shouldProceedAfterError:removingItemAtPath:", NSFileManager, NSError, NSString)(fileManager, error, path);
672 }
673
674 // NSKeyedArchiverDelegate
675 Object archiver (NSKeyedArchiver archiver, Object object)
676 {
677 return invokeObjcSelf!(Object, "archiver:willEncodeObject:", NSKeyedArchiver, Object)(archiver, object);
678 }
679
680 void archiver_didEncodeObject (NSKeyedArchiver archiver, Object object)
681 {
682 return invokeObjcSelf!(void, "archiver:didEncodeObject:", NSKeyedArchiver, Object)(archiver, object);
683 }
684
685 void archiver (NSKeyedArchiver archiver, Object object, Object newObject)
686 {
687 return invokeObjcSelf!(void, "archiver:willReplaceObject:withObject:", NSKeyedArchiver, Object, Object)(archiver, object, newObject);
688 }
689
690 void archiverWillFinish (NSKeyedArchiver archiver)
691 {
692 return invokeObjcSelf!(void, "archiverWillFinish:", NSKeyedArchiver)(archiver);
693 }
694
695 void archiverDidFinish (NSKeyedArchiver archiver)
696 {
697 return invokeObjcSelf!(void, "archiverDidFinish:", NSKeyedArchiver)(archiver);
698 }
699
700 // NSKeyedArchiverObjectSubstitution
701 Class classForKeyedArchiver ()
702 {
703 return invokeObjcSelf!(Class, "classForKeyedArchiver");
704 }
705
706 Object replacementObjectForKeyedArchiver (NSKeyedArchiver archiver)
707 {
708 return invokeObjcSelf!(Object, "replacementObjectForKeyedArchiver:", NSKeyedArchiver)(archiver);
709 }
710
711 static NSArray classFallbacksForKeyedArchiver ()
712 {
713 return invokeObjcSelfClass!(NSArray, "classFallbacksForKeyedArchiver");
714 }
715
716 // NSKeyedUnarchiverDelegate
717 Class unarchiver (NSKeyedUnarchiver unarchiver, NSString name, NSArray classNames)
718 {
719 return invokeObjcSelf!(Class, "unarchiver:cannotDecodeObjectOfClassName:originalClasses:", NSKeyedUnarchiver, NSString, NSArray)(unarchiver, name, classNames);
720 }
721
722 Object unarchiver (NSKeyedUnarchiver unarchiver, Object object)
723 {
724 return invokeObjcSelf!(Object, "unarchiver:didDecodeObject:", NSKeyedUnarchiver, Object)(unarchiver, object);
725 }
726
727 void unarchiver (NSKeyedUnarchiver unarchiver, Object object, Object newObject)
728 {
729 return invokeObjcSelf!(void, "unarchiver:willReplaceObject:withObject:", NSKeyedUnarchiver, Object, Object)(unarchiver, object, newObject);
730 }
731
732 void unarchiverWillFinish (NSKeyedUnarchiver unarchiver)
733 {
734 return invokeObjcSelf!(void, "unarchiverWillFinish:", NSKeyedUnarchiver)(unarchiver);
735 }
736
737 void unarchiverDidFinish (NSKeyedUnarchiver unarchiver)
738 {
739 return invokeObjcSelf!(void, "unarchiverDidFinish:", NSKeyedUnarchiver)(unarchiver);
740 }
741
742 // NSKeyedUnarchiverObjectSubstitution
743 static Class classForKeyedUnarchiver ()
744 {
745 return invokeObjcSelfClass!(Class, "classForKeyedUnarchiver");
746 }
747
748 // NSKeyValueCoding
749 static bool accessInstanceVariablesDirectly ()
750 {
751 return invokeObjcSelfClass!(bool, "accessInstanceVariablesDirectly");
752 }
753
754 Object valueForKey (NSString key)
755 {
756 return invokeObjcSelf!(Object, "valueForKey:", NSString)(key);
757 }
758
759 void setValue (Object value, NSString key)
760 {
761 return invokeObjcSelf!(void, "setValue:forKey:", Object, NSString)(value, key);
762 }
763
764 bool validateValue (id* ioValue, NSString inKey, ref NSError outError)
765 {
766 id error;
767
768 if (outError)
769 error = new objc_object;
770
771 bool result = invokeObjcSelf!(bool, "validateValue:forKey:error:", id*, NSString, id*)(ioValue, inKey, &error);
772
773 if (error)
774 outError = new NSError(error);
775
776 return result;
777 }
778
779 NSMutableArray mutableArrayValueForKey (NSString key)
780 {
781 return invokeObjcSelf!(NSMutableArray, "mutableArrayValueForKey:", NSString)(key);
782 }
783
784 NSMutableSet mutableSetValueForKey (NSString key)
785 {
786 return invokeObjcSelf!(NSMutableSet, "mutableSetValueForKey:", NSString)(key);
787 }
788
789 Object valueForKeyPath (NSString keyPath)
790 {
791 return invokeObjcSelf!(Object, "valueForKeyPath:", NSString)(keyPath);
792 }
793
794 void setValue_forKeyPath (Object value, NSString keyPath)
795 {
796 return invokeObjcSelf!(void, "setValue:forKeyPath:", Object, NSString)(value, keyPath);
797 }
798
799 bool validateValue_forKeyPath_error (id* ioValue, NSString inKeyPath, ref NSError outError)
800 {
801 id error;
802
803 if (outError)
804 error = new objc_object;
805
806 bool result = invokeObjcSelf!(bool, "validateValue:forKeyPath:error:", id*, NSString, id*)(ioValue, inKeyPath, &error);
807
808 if (error)
809 outError = new NSError(error);
810
811 return result;
812 }
813
814 NSMutableArray mutableArrayValueForKeyPath (NSString keyPath)
815 {
816 return invokeObjcSelf!(NSMutableArray, "mutableArrayValueForKeyPath:", NSString)(keyPath);
817 }
818
819 NSMutableSet mutableSetValueForKeyPath (NSString keyPath)
820 {
821 return invokeObjcSelf!(NSMutableSet, "mutableSetValueForKeyPath:", NSString)(keyPath);
822 }
823
824 Object valueForUndefinedKey (NSString key)
825 {
826 return invokeObjcSelf!(Object, "valueForUndefinedKey:", NSString)(key);
827 }
828
829 void setValue_forUndefinedKey (Object value, NSString key)
830 {
831 return invokeObjcSelf!(void, "setValue:forUndefinedKey:", Object, NSString)(value, key);
832 }
833
834 void setNilValueForKey (NSString key)
835 {
836 return invokeObjcSelf!(void, "setNilValueForKey:", NSString)(key);
837 }
838
839 NSDictionary dictionaryWithValuesForKeys (NSArray keys)
840 {
841 return invokeObjcSelf!(NSDictionary, "dictionaryWithValuesForKeys:", NSArray)(keys);
842 }
843
844 void setValuesForKeysWithDictionary (NSDictionary keyedValues)
845 {
846 return invokeObjcSelf!(void, "setValuesForKeysWithDictionary:", NSDictionary)(keyedValues);
847 }
848
849 // NSKeyValueObserverNotification
850 void willChangeValueForKey (NSString key)
851 {
852 return invokeObjcSelf!(void, "willChangeValueForKey:", NSString)(key);
853 }
854
855 void didChangeValueForKey (NSString key)
856 {
857 return invokeObjcSelf!(void, "didChangeValueForKey:", NSString)(key);
858 }
859
860 void willChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString key)
861 {
862 return invokeObjcSelf!(void, "willChange:valuesAtIndexes:forKey:", NSKeyValueChange, NSIndexSet, NSString)(changeKind, indexes, key);
863 }
864
865 void didChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString key)
866 {
867 return invokeObjcSelf!(void, "didChange:valuesAtIndexes:forKey:", NSKeyValueChange, NSIndexSet, NSString)(changeKind, indexes, key);
868 }
869
870 void willChangeValueForKey (NSString key, NSKeyValueSetMutationKind mutationKind, NSSet objects)
871 {
872 return invokeObjcSelf!(void, "willChangeValueForKey:withSetMutation:usingObjects:", NSString, NSKeyValueSetMutationKind, NSSet)(key, mutationKind, objects);
873 }
874
875 void didChangeValueForKey (NSString key, NSKeyValueSetMutationKind mutationKind, NSSet objects)
876 {
877 return invokeObjcSelf!(void, "didChangeValueForKey:withSetMutation:usingObjects:", NSString, NSKeyValueSetMutationKind, NSSet)(key, mutationKind, objects);
878 }
879
880 // NSKeyValueObserving
881 void observeValueForKeyPath (NSString keyPath, Object object, NSDictionary change, void* context)
882 {
883 return invokeObjcSelf!(void, "observeValueForKeyPath:ofObject:change:context:", NSString, Object, NSDictionary, void*)(keyPath, object, change, context);
884 }
885
886 // NSKeyValueObservingCustomization
887 static NSSet keyPathsForValuesAffectingValueForKey (NSString key)
888 {
889 return invokeObjcSelfClass!(NSSet, "keyPathsForValuesAffectingValueForKey:", NSString)(key);
890 }
891
892 static bool automaticallyNotifiesObserversForKey (NSString key)
893 {
894 return invokeObjcSelfClass!(bool, "automaticallyNotifiesObserversForKey:", NSString)(key);
895 }
896
897 void setObservationInfo (void* observationInfo)
898 {
899 return invokeObjcSelf!(void, "setObservationInfo:", void*)(observationInfo);
900 }
901
902 void* observationInfo ()
903 {
904 return invokeObjcSelf!(void*, "observationInfo");
905 }
906
907 // NSMachPortDelegateMethods
908 void handleMachMessage (void* msg)
909 {
910 return invokeObjcSelf!(void, "handleMachMessage:", void*)(msg);
911 }
912
913 // NSMetadataQueryDelegate
914 Object metadataQuery (NSMetadataQuery query, NSMetadataItem result)
915 {
916 return invokeObjcSelf!(Object, "metadataQuery:replacementObjectForResultObject:", NSMetadataQuery, NSMetadataItem)(query, result);
917 }
918
919 Object metadataQuery (NSMetadataQuery query, NSString attrName, Object attrValue)
920 {
921 return invokeObjcSelf!(Object, "metadataQuery:replacementValueForAttribute:value:", NSMetadataQuery, NSString, Object)(query, attrName, attrValue);
922 }
923
924 // NSNetServiceBrowserDelegateMethods
925 void netServiceBrowserWillSearch (NSNetServiceBrowser aNetServiceBrowser)
926 {
927 return invokeObjcSelf!(void, "netServiceBrowserWillSearch:", NSNetServiceBrowser)(aNetServiceBrowser);
928 }
929
930 void netServiceBrowserDidStopSearch (NSNetServiceBrowser aNetServiceBrowser)
931 {
932 return invokeObjcSelf!(void, "netServiceBrowserDidStopSearch:", NSNetServiceBrowser)(aNetServiceBrowser);
933 }
934
935 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSDictionary errorDict)
936 {
937 return invokeObjcSelf!(void, "netServiceBrowser:didNotSearch:", NSNetServiceBrowser, NSDictionary)(aNetServiceBrowser, errorDict);
938 }
939
940 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSString domainString, bool moreComing)
941 {
942 return invokeObjcSelf!(void, "netServiceBrowser:didFindDomain:moreComing:", NSNetServiceBrowser, NSString, bool)(aNetServiceBrowser, domainString, moreComing);
943 }
944
945 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, bool moreComing)
946 {
947 return invokeObjcSelf!(void, "netServiceBrowser:didFindService:moreComing:", NSNetServiceBrowser, NSNetService, bool)(aNetServiceBrowser, aNetService, moreComing);
948 }
949
950 void netServiceBrowser_didRemoveDomain_moreComing (NSNetServiceBrowser aNetServiceBrowser, NSString domainString, bool moreComing)
951 {
952 return invokeObjcSelf!(void, "netServiceBrowser:didRemoveDomain:moreComing:", NSNetServiceBrowser, NSString, bool)(aNetServiceBrowser, domainString, moreComing);
953 }
954
955 void netServiceBrowser_didRemoveService_moreComing (NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, bool moreComing)
956 {
957 return invokeObjcSelf!(void, "netServiceBrowser:didRemoveService:moreComing:", NSNetServiceBrowser, NSNetService, bool)(aNetServiceBrowser, aNetService, moreComing);
958 }
959
960 // NSNetServiceDelegateMethods
961 void netServiceWillPublish (NSNetService sender)
962 {
963 return invokeObjcSelf!(void, "netServiceWillPublish:", NSNetService)(sender);
964 }
965
966 void netServiceDidPublish (NSNetService sender)
967 {
968 return invokeObjcSelf!(void, "netServiceDidPublish:", NSNetService)(sender);
969 }
970
971 void netService (NSNetService sender, NSDictionary errorDict)
972 {
973 return invokeObjcSelf!(void, "netService:didNotPublish:", NSNetService, NSDictionary)(sender, errorDict);
974 }
975
976 void netServiceWillResolve (NSNetService sender)
977 {
978 return invokeObjcSelf!(void, "netServiceWillResolve:", NSNetService)(sender);
979 }
980
981 void netServiceDidResolveAddress (NSNetService sender)
982 {
983 return invokeObjcSelf!(void, "netServiceDidResolveAddress:", NSNetService)(sender);
984 }
985
986 void netService_didNotPublish (NSNetService sender, NSDictionary errorDict)
987 {
988 return invokeObjcSelf!(void, "netService:didNotPublish:", NSNetService, NSDictionary)(sender, errorDict);
989 }
990
991 void netServiceDidStop (NSNetService sender)
992 {
993 return invokeObjcSelf!(void, "netServiceDidStop:", NSNetService)(sender);
994 }
995
996 void netService (NSNetService sender, NSData data)
997 {
998 return invokeObjcSelf!(void, "netService:didUpdateTXTRecordData:", NSNetService, NSData)(sender, data);
999 }
1000
1001 // NSPortDelegateMethods
1002 void handlePortMessage (NSPortMessage message)
1003 {
1004 return invokeObjcSelf!(void, "handlePortMessage:", NSPortMessage)(message);
1005 }
1006
1007 // NSScriptingComparisonMethods
1008 uint classCode ()
1009 {
1010 return invokeObjcSelf!(uint, "classCode");
1011 }
1012
1013 NSString className ()
1014 {
1015 return invokeObjcSelf!(NSString, "className");
1016 }
1017
1018 // NSScriptKeyValueCoding
1019 Object scriptingValueForSpecifier (NSScriptObjectSpecifier objectSpecifier)
1020 {
1021 return invokeObjcSelf!(Object, "scriptingValueForSpecifier:", NSScriptObjectSpecifier)(objectSpecifier);
1022 }
1023
1024 NSDictionary scriptingProperties ()
1025 {
1026 return invokeObjcSelf!(NSDictionary, "scriptingProperties");
1027 }
1028
1029 void setScriptingProperties (NSDictionary properties)
1030 {
1031 return invokeObjcSelf!(void, "setScriptingProperties:", NSDictionary)(properties);
1032 }
1033
1034 Object copyScriptingValue (Object value, NSString key, NSDictionary properties)
1035 {
1036 return invokeObjcSelf!(Object, "copyScriptingValue:forKey:withProperties:", Object, NSString, NSDictionary)(value, key, properties);
1037 }
1038
1039 Object newScriptingObjectOfClass (Class objectClass, NSString key, Object contentsValue, NSDictionary properties)
1040 {
1041 return invokeObjcSelf!(Object, "newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:", Class, NSString, Object, NSDictionary)(objectClass, key, contentsValue, properties);
1042 }
1043
1044 Object scriptingValueForSpecifier (NSScriptObjectSpecifier objectSpecifier)
1045 {
1046 return invokeObjcSelf!(Object, "scriptingValueForSpecifier:", NSScriptObjectSpecifier)(objectSpecifier);
1047 }
1048
1049 bool scriptingIsEqualTo (Object object)
1050 {
1051 return invokeObjcSelf!(bool, "scriptingIsEqualTo:", Object)(object);
1052 }
1053
1054 bool scriptingIsLessThanOrEqualTo (Object object)
1055 {
1056 return invokeObjcSelf!(bool, "scriptingIsLessThanOrEqualTo:", Object)(object);
1057 }
1058
1059 bool scriptingIsLessThan (Object object)
1060 {
1061 return invokeObjcSelf!(bool, "scriptingIsLessThan:", Object)(object);
1062 }
1063
1064 bool scriptingIsGreaterThanOrEqualTo (Object object)
1065 {
1066 return invokeObjcSelf!(bool, "scriptingIsGreaterThanOrEqualTo:", Object)(object);
1067 }
1068
1069 bool scriptingIsGreaterThan (Object object)
1070 {
1071 return invokeObjcSelf!(bool, "scriptingIsGreaterThan:", Object)(object);
1072 }
1073
1074 bool scriptingBeginsWith (Object object)
1075 {
1076 return invokeObjcSelf!(bool, "scriptingBeginsWith:", Object)(object);
1077 }
1078
1079 bool scriptingEndsWith (Object object)
1080 {
1081 return invokeObjcSelf!(bool, "scriptingEndsWith:", Object)(object);
1082 }
1083
1084 bool scriptingContains (Object object)
1085 {
1086 return invokeObjcSelf!(bool, "scriptingContains:", Object)(object);
1087 }
1088
1089 Object valueAtIndex (NSUInteger index, NSString key)
1090 {
1091 return invokeObjcSelf!(Object, "valueAtIndex:inPropertyWithKey:", NSUInteger, NSString)(index, key);
1092 }
1093
1094 Object valueWithName (NSString name, NSString key)
1095 {
1096 return invokeObjcSelf!(Object, "valueWithName:inPropertyWithKey:", NSString, NSString)(name, key);
1097 }
1098
1099 Object valueWithUniqueID (Object uniqueID, NSString key)
1100 {
1101 return invokeObjcSelf!(Object, "valueWithUniqueID:inPropertyWithKey:", Object, NSString)(uniqueID, key);
1102 }
1103
1104 void insertValue (Object value, NSUInteger index, NSString key)
1105 {
1106 return invokeObjcSelf!(void, "insertValue:atIndex:inPropertyWithKey:", Object, NSUInteger, NSString)(value, index, key);
1107 }
1108
1109 void removeValueAtIndex (NSUInteger index, NSString key)
1110 {
1111 return invokeObjcSelf!(void, "removeValueAtIndex:fromPropertyWithKey:", NSUInteger, NSString)(index, key);
1112 }
1113
1114 void replaceValueAtIndex (NSUInteger index, NSString key, Object value)
1115 {
1116 return invokeObjcSelf!(void, "replaceValueAtIndex:inPropertyWithKey:withValue:", NSUInteger, NSString, Object)(index, key, value);
1117 }
1118
1119 void insertValue (Object value, NSString key)
1120 {
1121 return invokeObjcSelf!(void, "insertValue:inPropertyWithKey:", Object, NSString)(value, key);
1122 }
1123
1124 Object coerceValue (Object value, NSString key)
1125 {
1126 return invokeObjcSelf!(Object, "coerceValue:forKey:", Object, NSString)(value, key);
1127 }
1128
1129 NSScriptObjectSpecifier objectSpecifier ()
1130 {
1131 return invokeObjcSelf!(NSScriptObjectSpecifier, "objectSpecifier");
1132 }
1133
1134 NSArray indicesOfObjectsByEvaluatingObjectSpecifier (NSScriptObjectSpecifier specifier)
1135 {
1136 return invokeObjcSelf!(NSArray, "indicesOfObjectsByEvaluatingObjectSpecifier:", NSScriptObjectSpecifier)(specifier);
1137 }
1138
1139 NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, NSInteger* wordCount, bool countOnly)
1140 {
1141 return invokeObjcSelf!(NSRange, "spellServer:findMisspelledWordInString:language:wordCount:countOnly:", NSSpellServer, NSString, NSString, NSInteger*, bool)(sender, stringToCheck, language, wordCount, countOnly);
1142 }
1143
1144 NSArray spellServer (NSSpellServer sender, NSString word, NSString language)
1145 {
1146 return invokeObjcSelf!(NSArray, "spellServer:suggestGuessesForWord:inLanguage:", NSSpellServer, NSString, NSString)(sender, word, language);
1147 }
1148
1149 void spellServer_didLearnWord_inLanguage (NSSpellServer sender, NSString word, NSString language)
1150 {
1151 return invokeObjcSelf!(void, "spellServer:didLearnWord:inLanguage:", NSSpellServer, NSString, NSString)(sender, word, language);
1152 }
1153
1154 void spellServer (NSSpellServer sender, NSString word, NSString language)
1155 {
1156 return invokeObjcSelf!(void, "spellServer:didForgetWord:inLanguage:", NSSpellServer, NSString, NSString)(sender, word, language);
1157 }
1158
1159 NSArray spellServer (NSSpellServer sender, NSRange range, NSString string, NSString language)
1160 {
1161 return invokeObjcSelf!(NSArray, "spellServer:suggestCompletionsForPartialWordRange:inString:language:", NSSpellServer, NSRange, NSString, NSString)(sender, range, string, language);
1162 }
1163
1164 NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, out NSArray details)
1165 {
1166 id det = new objc_object;
1167
1168 NSRange result = invokeObjcSelf!(NSRange, "spellServer:checkGrammarInString:language:details:", NSSpellServer, NSString, NSString, id*)(sender, stringToCheck, language, &det);
1169
1170 if (det)
1171 details = new NSArray(det);
1172
1173 return result;
1174 }
1175
1176 void stream (NSStream aStream, NSStreamEvent eventCode)
1177 {
1178 return invokeObjcSelf!(void, "stream:handleEvent:", NSStream, NSStreamEvent)(aStream, eventCode);
1179 }
1180
1181 void performSelectorOnMainThread (SEL aSelector, Object arg, bool wait, NSArray array)
1182 {
1183 return invokeObjcSelf!(void, "performSelectorOnMainThread:withObject:waitUntilDone:modes:", SEL, Object, bool, NSArray)(aSelector, arg, wait, array);
1184 }
1185
1186 void performSelectorOnMainThread (SEL aSelector, Object arg, bool wait)
1187 {
1188 return invokeObjcSelf!(void, "performSelectorOnMainThread:withObject:waitUntilDone:", SEL, Object, bool)(aSelector, arg, wait);
1189 }
1190
1191 void performSelector (SEL aSelector, NSThread thr, Object arg, bool wait, NSArray array)
1192 {
1193 return invokeObjcSelf!(void, "performSelector:onThread:withObject:waitUntilDone:modes:", SEL, NSThread, Object, bool, NSArray)(aSelector, thr, arg, wait, array);
1194 }
1195
1196 void performSelector (SEL aSelector, NSThread thr, Object arg, bool wait)
1197 {
1198 return invokeObjcSelf!(void, "performSelector:onThread:withObject:waitUntilDone:", SEL, NSThread, Object, bool)(aSelector, thr, arg, wait);
1199 }
1200
1201 void performSelectorInBackground (SEL aSelector, Object arg)
1202 {
1203 return invokeObjcSelf!(void, "performSelectorInBackground:withObject:", SEL, Object)(aSelector, arg);
1204 }
1205
1206 void URL (NSURL sender, NSData newBytes)
1207 {
1208 return invokeObjcSelf!(void, "URL:resourceDataDidBecomeAvailable:", NSURL, NSData)(sender, newBytes);
1209 }
1210
1211 void URLResourceDidFinishLoading (NSURL sender)
1212 {
1213 return invokeObjcSelf!(void, "URLResourceDidFinishLoading:", NSURL)(sender);
1214 }
1215
1216 void URLResourceDidCancelLoading (NSURL sender)
1217 {
1218 return invokeObjcSelf!(void, "URLResourceDidCancelLoading:", NSURL)(sender);
1219 }
1220
1221 void URL (NSURL sender, NSString reason)
1222 {
1223 return invokeObjcSelf!(void, "URL:resourceDidFailLoadingWithReason:", NSURL, NSString)(sender, reason);
1224 }
1225
1226 NSURLRequest connection (NSURLConnection connection, NSURLRequest request, NSURLResponse response)
1227 {
1228 return invokeObjcSelf!(NSURLRequest, "connection:willSendRequest:redirectResponse:", NSURLConnection, NSURLRequest, NSURLResponse)(connection, request, response);
1229 }
1230
1231 void connection (NSURLConnection connection, NSURLAuthenticationChallenge challenge)
1232 {
1233 return invokeObjcSelf!(void, "connection:didReceiveAuthenticationChallenge:", NSURLConnection, NSURLAuthenticationChallenge)(connection, challenge);
1234 }
1235
1236 void connection_didCancelAuthenticationChallenge (NSURLConnection connection, NSURLAuthenticationChallenge challenge)
1237 {
1238 return invokeObjcSelf!(void, "connection:didCancelAuthenticationChallenge:", NSURLConnection, NSURLAuthenticationChallenge)(connection, challenge);
1239 }
1240
1241 void connection (NSURLConnection connection, NSURLResponse response)
1242 {
1243 return invokeObjcSelf!(void, "connection:didReceiveResponse:", NSURLConnection, NSURLResponse)(connection, response);
1244 }
1245
1246 void connection (NSURLConnection connection, NSData data)
1247 {
1248 return invokeObjcSelf!(void, "connection:didReceiveData:", NSURLConnection, NSData)(connection, data);
1249 }
1250
1251 void connectionDidFinishLoading (NSURLConnection connection)
1252 {
1253 return invokeObjcSelf!(void, "connectionDidFinishLoading:", NSURLConnection)(connection);
1254 }
1255
1256 void connection (NSURLConnection connection, NSError error)
1257 {
1258 return invokeObjcSelf!(void, "connection:didFailWithError:", NSURLConnection, NSError)(connection, error);
1259 }
1260
1261 NSCachedURLResponse connection (NSURLConnection connection, NSCachedURLResponse cachedResponse)
1262 {
1263 return invokeObjcSelf!(NSCachedURLResponse, "connection:willCacheResponse:", NSURLConnection, NSCachedURLResponse)(connection, cachedResponse);
1264 }
1265
1266 void downloadDidBegin (NSURLDownload download)
1267 {
1268 return invokeObjcSelf!(void, "downloadDidBegin:", NSURLDownload)(download);
1269 }
1270
1271 NSURLRequest download (NSURLDownload download, NSURLRequest request, NSURLResponse redirectResponse)
1272 {
1273 return invokeObjcSelf!(NSURLRequest, "download:willSendRequest:redirectResponse:", NSURLDownload, NSURLRequest, NSURLResponse)(download, request, redirectResponse);
1274 }
1275
1276 void download (NSURLDownload download, NSURLAuthenticationChallenge challenge)
1277 {
1278 return invokeObjcSelf!(void, "download:didReceiveAuthenticationChallenge:", NSURLDownload, NSURLAuthenticationChallenge)(download, challenge);
1279 }
1280
1281 void download_didCancelAuthenticationChallenge (NSURLDownload download, NSURLAuthenticationChallenge challenge)
1282 {
1283 return invokeObjcSelf!(void, "download:didCancelAuthenticationChallenge:", NSURLDownload, NSURLAuthenticationChallenge)(download, challenge);
1284 }
1285
1286 void download (NSURLDownload download, NSURLResponse response)
1287 {
1288 return invokeObjcSelf!(void, "download:didReceiveResponse:", NSURLDownload, NSURLResponse)(download, response);
1289 }
1290
1291 void download (NSURLDownload download, NSURLResponse response, long startingByte)
1292 {
1293 return invokeObjcSelf!(void, "download:willResumeWithResponse:fromByte:", NSURLDownload, NSURLResponse, long)(download, response, startingByte);
1294 }
1295
1296 void download (NSURLDownload download, NSUInteger length)
1297 {
1298 return invokeObjcSelf!(void, "download:didReceiveDataOfLength:", NSURLDownload, NSUInteger)(download, length);
1299 }
1300
1301 bool download (NSURLDownload download, NSString encodingType)
1302 {
1303 return invokeObjcSelf!(bool, "download:shouldDecodeSourceDataOfMIMEType:", NSURLDownload, NSString)(download, encodingType);
1304 }
1305
1306 void download_decideDestinationWithSuggestedFilename (NSURLDownload download, NSString filename)
1307 {
1308 return invokeObjcSelf!(void, "download:decideDestinationWithSuggestedFilename:", NSURLDownload, NSString)(download, filename);
1309 }
1310
1311 void download_didCreateDestination (NSURLDownload download, NSString path)
1312 {
1313 return invokeObjcSelf!(void, "download:didCreateDestination:", NSURLDownload, NSString)(download, path);
1314 }
1315
1316 void downloadDidFinish (NSURLDownload download)
1317 {
1318 return invokeObjcSelf!(void, "downloadDidFinish:", NSURLDownload)(download);
1319 }
1320
1321 void download (NSURLDownload download, NSError error)
1322 {
1323 return invokeObjcSelf!(void, "download:didFailWithError:", NSURLDownload, NSError)(download, error);
1324 }
1325
1326 void parserDidStartDocument (NSXMLParser parser)
1327 {
1328 return invokeObjcSelf!(void, "parserDidStartDocument:", NSXMLParser)(parser);
1329 }
1330
1331 void parserDidEndDocument (NSXMLParser parser)
1332 {
1333 return invokeObjcSelf!(void, "parserDidEndDocument:", NSXMLParser)(parser);
1334 }
1335
1336 void parser (NSXMLParser parser, NSString name, NSString publicID, NSString systemID)
1337 {
1338 return invokeObjcSelf!(void, "parser:foundNotationDeclarationWithName:publicID:systemID:", NSXMLParser, NSString, NSString, NSString)(parser, name, publicID, systemID);
1339 }
1340
1341 void parser (NSXMLParser parser, NSString name, NSString publicID, NSString systemID, NSString notationName)
1342 {
1343 return invokeObjcSelf!(void, "parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:", NSXMLParser, NSString, NSString, NSString, NSString)(parser, name, publicID, systemID, notationName);
1344 }
1345
1346 void parser_foundAttributeDeclarationWithName_forElement_type_defaultValue (NSXMLParser parser, NSString attributeName, NSString elementName, NSString type, NSString defaultValue)
1347 {
1348 return invokeObjcSelf!(void, "parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:", NSXMLParser, NSString, NSString, NSString, NSString)(parser, attributeName, elementName, type, defaultValue);
1349 }
1350
1351 void parser (NSXMLParser parser, NSString elementName, NSString model)
1352 {
1353 return invokeObjcSelf!(void, "parser:foundElementDeclarationWithName:model:", NSXMLParser, NSString, NSString)(parser, elementName, model);
1354 }
1355
1356 void parser_foundInternalEntityDeclarationWithName_value (NSXMLParser parser, NSString name, NSString value)
1357 {
1358 return invokeObjcSelf!(void, "parser:foundInternalEntityDeclarationWithName:value:", NSXMLParser, NSString, NSString)(parser, name, value);
1359 }
1360
1361 void parser_foundExternalEntityDeclarationWithName_publicID_systemID (NSXMLParser parser, NSString name, NSString publicID, NSString systemID)
1362 {
1363 return invokeObjcSelf!(void, "parser:foundExternalEntityDeclarationWithName:publicID:systemID:", NSXMLParser, NSString, NSString, NSString)(parser, name, publicID, systemID);
1364 }
1365
1366 void parser (NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName, NSDictionary attributeDict)
1367 {
1368 return invokeObjcSelf!(void, "parser:didStartElement:namespaceURI:qualifiedName:attributes:", NSXMLParser, NSString, NSString, NSString, NSDictionary)(parser, elementName, namespaceURI, qName, attributeDict);
1369 }
1370
1371 void parser_didEndElement_namespaceURI_qualifiedName (NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName)
1372 {
1373 return invokeObjcSelf!(void, "parser:didEndElement:namespaceURI:qualifiedName:", NSXMLParser, NSString, NSString, NSString)(parser, elementName, namespaceURI, qName);
1374 }
1375
1376 void parser_didStartMappingPrefix_toURI (NSXMLParser parser, NSString prefix, NSString namespaceURI)
1377 {
1378 return invokeObjcSelf!(void, "parser:didStartMappingPrefix:toURI:", NSXMLParser, NSString, NSString)(parser, prefix, namespaceURI);
1379 }
1380
1381 void parser (NSXMLParser parser, NSString prefix)
1382 {
1383 return invokeObjcSelf!(void, "parser:didEndMappingPrefix:", NSXMLParser, NSString)(parser, prefix);
1384 }
1385
1386 void parser_foundCharacter (NSXMLParser parser, NSString string)
1387 {
1388 return invokeObjcSelf!(void, "parser:foundCharacters:", NSXMLParser, NSString)(parser, string);
1389 }
1390
1391 void parser_foundIgnorableWhitespace (NSXMLParser parser, NSString whitespaceString)
1392 {
1393 return invokeObjcSelf!(void, "parser:foundIgnorableWhitespace:", NSXMLParser, NSString)(parser, whitespaceString);
1394 }
1395
1396 void parser_foundProcessingInstructionWithTarget_data (NSXMLParser parser, NSString target, NSString data)
1397 {
1398 return invokeObjcSelf!(void, "parser:foundProcessingInstructionWithTarget:data:", NSXMLParser, NSString, NSString)(parser, target, data);
1399 }
1400
1401 void parser_foundComment (NSXMLParser parser, NSString comment)
1402 {
1403 return invokeObjcSelf!(void, "parser:foundComment:", NSXMLParser, NSString)(parser, comment);
1404 }
1405
1406 void parser (NSXMLParser parser, NSData CDATABlock)
1407 {
1408 return invokeObjcSelf!(void, "parser:foundCDATA:", NSXMLParser, NSData)(parser, CDATABlock);
1409 }
1410
1411 NSData parser_resolveExternalEntityName_systemID (NSXMLParser parser, NSString name, NSString systemID)
1412 {
1413 return invokeObjcSelf!(NSData, "parser:resolveExternalEntityName:systemID:", NSXMLParser, NSString, NSString)(parser, name, systemID);
1414 }
1415
1416 void parser (NSXMLParser parser, NSError parseError)
1417 {
1418 return invokeObjcSelf!(void, "parser:parseErrorOccurred:", NSXMLParser, NSError)(parser, parseError);
1419 }
1420
1421 void parser_validationErrorOccurred (NSXMLParser parser, NSError validationError)
1422 {
1423 return invokeObjcSelf!(void, "parser:validationErrorOccurred:", NSXMLParser, NSError)(parser, validationError);
1424 }
1425
1426 // D extensions
1427 equals_t opEqual (Object object)
1428 {
1429 if (auto str = cast(NSObject) object)
1430 return isEqual(str);
1431
1432 return false;
1433 }
351 } 1434 }
352 1435
353 Object NSAllocateObject (Class aClass, NSUInteger extraBytes, NSZone* zone) 1436 Object NSAllocateObject (Class aClass, NSUInteger extraBytes, NSZone* zone)
354 { 1437 {
355 return Bridge.invokeObjcFunction!(Object, bindings.NSAllocateObject, Class, NSUInteger, NSZone*)(aClass, extraBytes, zone); 1438 return Bridge.invokeObjcFunction!(Object, bindings.NSAllocateObject, Class, NSUInteger, NSZone*)(aClass, extraBytes, zone);