comparison dstep/foundation/NSInvocation.d @ 14:89f3c3ef1fd2

Added the Foundation framework
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:23:15 +0200
parents
children 7ff919f595d5
comparison
equal deleted inserted replaced
13:4f583f7e242e 14:89f3c3ef1fd2
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.NSInvocation;
8
9 import dstep.foundation.NSMethodSignature;
10 import dstep.foundation.NSObject;
11 import dstep.objc.bridge.Bridge;
12 import dstep.objc.objc : id;
13 import dstep.stdbool;
14
15 class NSInvocation : NSObject
16 {
17 mixin ObjcWrap;
18
19 static NSInvocation invocationWithMethodSignature (NSMethodSignature sig)
20 {
21 return invokeObjcSelfClass!(NSInvocation, "invocationWithMethodSignature:", NSMethodSignature)(sigreturn result is this.objcObject ? this : (result !is null ? new NSInvocation(result) : null); }
22
23 NSMethodSignature methodSignature ()
24 {
25 return invokeObjcSelf!(NSMethodSignature, "methodSignature");
26 }
27
28 void retainArguments ()
29 {
30 return invokeObjcSelf!(void, "retainArguments");
31 }
32
33 bool argumentsRetained ()
34 {
35 return invokeObjcSelf!(bool, "argumentsRetained");
36 }
37
38 Object target ()
39 {
40 return invokeObjcSelf!(Object, "target");
41 }
42
43 void setTarget (Object target)
44 {
45 return invokeObjcSelf!(void, "setTarget:", Object)(target);
46 }
47
48 SEL selector ()
49 {
50 return invokeObjcSelf!(SEL, "selector");
51 }
52
53 void setSelector (SEL selector)
54 {
55 return invokeObjcSelf!(void, "setSelector:", SEL)(selector);
56 }
57
58 void getReturnValue (void* retLoc)
59 {
60 return invokeObjcSelf!(void, "getReturnValue:", void*)(retLoc);
61 }
62
63 void setReturnValue (void* retLoc)
64 {
65 return invokeObjcSelf!(void, "setReturnValue:", void*)(retLoc);
66 }
67
68 void getArgument (void* argumentLocation, NSInteger idx)
69 {
70 return invokeObjcSelf!(void, "getArgument:atIndex:", void*, NSInteger)(argumentLocation, idx);
71 }
72
73 void setArgument (void* argumentLocation, NSInteger idx)
74 {
75 return invokeObjcSelf!(void, "setArgument:atIndex:", void*, NSInteger)(argumentLocation, idx);
76 }
77
78 void invoke ()
79 {
80 return invokeObjcSelf!(void, "invoke");
81 }
82
83 void invokeWithTarget (Object target)
84 {
85 return invokeObjcSelf!(void, "invokeWithTarget:", Object)(target);
86 }
87 }
88