Mercurial > projects > dstep
annotate dstep/foundation/NSInvocation.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.NSInvocation; | |
8 | |
9 import dstep.foundation.NSMethodSignature; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
10 import dstep.foundation.NSObjCRuntime; |
14 | 11 import dstep.foundation.NSObject; |
12 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
13 import dstep.objc.objc; |
14 | 14 |
15 class NSInvocation : NSObject | |
16 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
17 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
18 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
19 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
20 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
21 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
22 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
23 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
24 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
25 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
26 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
27 } |
14 | 28 |
29 static NSInvocation invocationWithMethodSignature (NSMethodSignature sig) | |
30 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 return invokeObjcSuperClass!(NSInvocation, "invocationWithMethodSignature:", NSMethodSignature)(sig); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 } |
14 | 33 |
34 NSMethodSignature methodSignature () | |
35 { | |
36 return invokeObjcSelf!(NSMethodSignature, "methodSignature"); | |
37 } | |
38 | |
39 void retainArguments () | |
40 { | |
41 return invokeObjcSelf!(void, "retainArguments"); | |
42 } | |
43 | |
44 bool argumentsRetained () | |
45 { | |
46 return invokeObjcSelf!(bool, "argumentsRetained"); | |
47 } | |
48 | |
49 Object target () | |
50 { | |
51 return invokeObjcSelf!(Object, "target"); | |
52 } | |
53 | |
54 void setTarget (Object target) | |
55 { | |
56 return invokeObjcSelf!(void, "setTarget:", Object)(target); | |
57 } | |
58 | |
59 SEL selector () | |
60 { | |
61 return invokeObjcSelf!(SEL, "selector"); | |
62 } | |
63 | |
64 void setSelector (SEL selector) | |
65 { | |
66 return invokeObjcSelf!(void, "setSelector:", SEL)(selector); | |
67 } | |
68 | |
69 void getReturnValue (void* retLoc) | |
70 { | |
71 return invokeObjcSelf!(void, "getReturnValue:", void*)(retLoc); | |
72 } | |
73 | |
74 void setReturnValue (void* retLoc) | |
75 { | |
76 return invokeObjcSelf!(void, "setReturnValue:", void*)(retLoc); | |
77 } | |
78 | |
79 void getArgument (void* argumentLocation, NSInteger idx) | |
80 { | |
81 return invokeObjcSelf!(void, "getArgument:atIndex:", void*, NSInteger)(argumentLocation, idx); | |
82 } | |
83 | |
84 void setArgument (void* argumentLocation, NSInteger idx) | |
85 { | |
86 return invokeObjcSelf!(void, "setArgument:atIndex:", void*, NSInteger)(argumentLocation, idx); | |
87 } | |
88 | |
89 void invoke () | |
90 { | |
91 return invokeObjcSelf!(void, "invoke"); | |
92 } | |
93 | |
94 void invokeWithTarget (Object target) | |
95 { | |
96 return invokeObjcSelf!(void, "invokeWithTarget:", Object)(target); | |
97 } | |
98 } | |
99 |