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.NSProxy;
|
|
8
|
|
9 import dstep.foundation.NSInvocation;
|
|
10 import dstep.foundation.NSMethodSignature;
|
|
11 import dstep.foundation.NSObject;
|
|
12 import dstep.objc.bridge.Bridge;
|
|
13 import dstep.objc.objc : id;
|
|
14
|
|
15 class NSProxy : INSObject
|
|
16 {
|
|
17 mixin ObjcWrap;
|
|
18
|
|
19 static Object alloc ()
|
|
20 {
|
|
21 return invokeObjcSelfClass!(Object, "alloc");
|
|
22 }
|
|
23
|
|
24 static Object allocWithZone (NSZone* zone)
|
|
25 {
|
|
26 return invokeObjcSelfClass!(Object, "allocWithZone:", NSZone*)(zone);
|
|
27 }
|
|
28
|
|
29 static Class class_ ()
|
|
30 {
|
|
31 return invokeObjcSelfClass!(Class, "class");
|
|
32 }
|
|
33
|
|
34 void forwardInvocation (NSInvocation invocation)
|
|
35 {
|
|
36 return invokeObjcSelf!(void, "forwardInvocation:", NSInvocation)(invocation);
|
|
37 }
|
|
38
|
|
39 NSMethodSignature methodSignatureForSelector (SEL sel)
|
|
40 {
|
|
41 return invokeObjcSelf!(NSMethodSignature, "methodSignatureForSelector:", SEL)(sel);
|
|
42 }
|
|
43
|
|
44 void dealloc ()
|
|
45 {
|
|
46 return invokeObjcSelf!(void, "dealloc");
|
|
47 }
|
|
48
|
|
49 void finalize ()
|
|
50 {
|
|
51 return invokeObjcSelf!(void, "finalize");
|
|
52 }
|
|
53
|
|
54 NSString description ()
|
|
55 {
|
|
56 return invokeObjcSelf!(NSString, "description");
|
|
57 }
|
|
58
|
|
59 static bool respondsToSelector (SEL aSelector)
|
|
60 {
|
|
61 return invokeObjcSelfClass!(bool, "respondsToSelector:", SEL)(aSelector);
|
|
62 }
|
|
63
|
|
64 bool isEqual (Object object)
|
|
65 {
|
|
66 return invokeObjcSelf!(bool, "isEqual:", Object)(object);
|
|
67 }
|
|
68
|
|
69 NSUInteger hash ()
|
|
70 {
|
|
71 return invokeObjcSelf!(NSUInteger, "hash");
|
|
72 }
|
|
73
|
|
74 Class superclass ()
|
|
75 {
|
|
76 return invokeObjcSelf!(Class, "superclass");
|
|
77 }
|
|
78
|
|
79 Class class_ ()
|
|
80 {
|
|
81 return invokeObjcSelf!(Class, "class");
|
|
82 }
|
|
83
|
|
84 Object self ()
|
|
85 {
|
|
86 return invokeObjcSelf!(Object, "self");
|
|
87 }
|
|
88
|
|
89 NSZone* zone ()
|
|
90 {
|
|
91 return invokeObjcSelf!(NSZone*, "zone");
|
|
92 }
|
|
93
|
|
94 Object performSelector (SEL aSelector)
|
|
95 {
|
|
96 return invokeObjcSelf!(Object, "performSelector:", SEL)(aSelector);
|
|
97 }
|
|
98
|
|
99 Object performSelector (SEL aSelector, Object object)
|
|
100 {
|
|
101 return invokeObjcSelf!(Object, "performSelector:withObject:", SEL, Object)(aSelector, object);
|
|
102 }
|
|
103
|
|
104 Object performSelector (SEL aSelector, Object object1, Object object2)
|
|
105 {
|
|
106 return invokeObjcSelf!(Object, "performSelector:withObject:withObject:", SEL, Object, Object)(aSelector, object1, object2);
|
|
107 }
|
|
108
|
|
109 bool isProxy ()
|
|
110 {
|
|
111 return invokeObjcSelf!(bool, "isProxy");
|
|
112 }
|
|
113
|
|
114 bool isKindOfClass (Class aClass)
|
|
115 {
|
|
116 return invokeObjcSelf!(bool, "isKindOfClass:", Class)(aClass);
|
|
117 }
|
|
118
|
|
119 bool isMemberOfClass (Class aClass)
|
|
120 {
|
|
121 return invokeObjcSelf!(bool, "isMemberOfClass:", Class)(aClass);
|
|
122 }
|
|
123
|
|
124 bool conformsToProtocol (Protocol aProtocol)
|
|
125 {
|
|
126 return invokeObjcSelf!(bool, "conformsToProtocol:", Protocol)(aProtocol);
|
|
127 }
|
|
128
|
|
129 bool respondsToSelector (SEL aSelector)
|
|
130 {
|
|
131 return invokeObjcSelf!(bool, "respondsToSelector:", SEL)(aSelector);
|
|
132 }
|
|
133
|
|
134 Object retain ()
|
|
135 {
|
|
136 return invokeObjcSelf!(Object, "retain");
|
|
137 }
|
|
138
|
|
139 void release ()
|
|
140 {
|
|
141 return invokeObjcSelf!(void, "release");
|
|
142 }
|
|
143
|
|
144 Object autorelease ()
|
|
145 {
|
|
146 return invokeObjcSelf!(Object, "autorelease");
|
|
147 }
|
|
148
|
|
149 NSUInteger retainCount ()
|
|
150 {
|
|
151 return invokeObjcSelf!(NSUInteger, "retainCount");
|
|
152 }
|
|
153
|
|
154 NSString description ()
|
|
155 {
|
|
156 return invokeObjcSelf!(NSString, "description");
|
|
157 }
|
|
158 }
|
|
159
|