comparison dstep/objc/bridge/Bridge.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
comparison
equal deleted inserted replaced
26:6825fcc47e39 27:57371c29ef73
316 /** 316 /**
317 * Binds a selector to an instance method. 317 * Binds a selector to an instance method.
318 * 318 *
319 * This will create a receiver method which will forward the call to $(D_PARAM method), 319 * This will create a receiver method which will forward the call to $(D_PARAM method),
320 * decapsulating arguments and encapsulating the return value as appropriate. 320 * decapsulating arguments and encapsulating the return value as appropriate.
321 *
322 * Mixes in: ObjcWrap
321 * 323 *
322 * Examples: 324 * Examples:
323 * --- 325 * ---
324 * class AppController : NSObject 326 * class AppController : NSObject
325 * { 327 * {
390 return dstep.objc.bridge.Capsule.encapsule!(R)(dg()(args)); 392 return dstep.objc.bridge.Capsule.encapsule!(R)(dg()(args));
391 } 393 }
392 394
393 /// The Objective-C method declaration for the binded method 395 /// The Objective-C method declaration for the binded method
394 ObjcMethodDeclaration!(__forwardVirtualCall, R, selector, ARGS) __objcMethodDeclaration; 396 ObjcMethodDeclaration!(__forwardVirtualCall, R, selector, ARGS) __objcMethodDeclaration;
397
398 static if (!is(typeof(this.__objcClass)))
399 mixin ObjcWrap;
395 } 400 }
396 } 401 }
397 402
398 /** 403 /**
399 * Binds a selector to a class (static) method. 404 * Binds a selector to a class (static) method.
514 return dstep.objc.bridge.Capsule.encapsule!(R)(funcPtr()(args)); 519 return dstep.objc.bridge.Capsule.encapsule!(R)(funcPtr()(args));
515 } 520 }
516 521
517 /// The Objective-C method declaration for the binded method 522 /// The Objective-C method declaration for the binded method
518 ObjcMethodDeclaration!(__forwardStaticCall, R, selector, ARGS) __objcClassMethodDeclaration; 523 ObjcMethodDeclaration!(__forwardStaticCall, R, selector, ARGS) __objcClassMethodDeclaration;
524
525 static if (is(typeof(this.__objcClass)))
526 mixin ObjcWrap;
519 } 527 }
520 } 528 }
521 529
522 /** 530 /**
523 * This $(D_KEYWORD struct) represents an Objective-C method declaration. 531 * This $(D_KEYWORD struct) represents an Objective-C method declaration.