Mercurial > projects > dstep
annotate dstep/foundation/NSDistantObject.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.NSDistantObject; | |
8 | |
9 import dstep.foundation.NSCoder; | |
10 import dstep.foundation.NSConnection; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
11 import dstep.foundation.NSObject; |
14 | 12 import dstep.foundation.NSProxy; |
13 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
14 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
15 import dstep.objc.runtime; |
14 | 16 |
17 class NSDistantObject : NSProxy, INSCoding | |
18 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
19 mixin (ObjcWrap); |
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 this () |
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 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
24 } |
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 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
27 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
28 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
29 } |
14 | 30 |
31 static NSDistantObject proxyWithTarget (Object target, NSConnection connection) | |
32 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
33 return invokeObjcSuperClass!(NSDistantObject, "proxyWithTarget:connection:", Object, NSConnection)(target, connection); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
34 } |
14 | 35 |
36 Object initWithTarget (Object target, NSConnection connection) | |
37 { | |
38 return invokeObjcSelf!(Object, "initWithTarget:connection:", Object, NSConnection)(target, connection); | |
39 } | |
40 | |
41 this (Object target, NSConnection connection) | |
42 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
43 typeof(this).alloc.initWithTarget(target, connection); |
14 | 44 } |
45 | |
46 static NSDistantObject proxyWithLocal (Object target, NSConnection connection) | |
47 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
48 return invokeObjcSuperClass!(NSDistantObject, "proxyWithLocal:connection:", Object, NSConnection)(target, connection); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
49 } |
14 | 50 |
51 Object initWithLocal (Object target, NSConnection connection) | |
52 { | |
53 return invokeObjcSelf!(Object, "initWithLocal:connection:", Object, NSConnection)(target, connection); | |
54 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
55 |
14 | 56 void setProtocolForProxy (Protocol proto) |
57 { | |
58 return invokeObjcSelf!(void, "setProtocolForProxy:", Protocol)(proto); | |
59 } | |
60 | |
61 NSConnection connectionForProxy () | |
62 { | |
63 return invokeObjcSelf!(NSConnection, "connectionForProxy"); | |
64 } | |
65 | |
66 void encodeWithCoder (NSCoder aCoder) | |
67 { | |
68 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
69 } | |
70 | |
71 Object initWithCoder (NSCoder aDecoder) | |
72 { | |
73 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
74 } | |
75 | |
76 this (NSCoder aDecoder) | |
77 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
78 typeof(this).alloc.initWithCoder(aDecoder); |
14 | 79 } |
80 } | |
81 |