Mercurial > projects > dstep
annotate dstep/foundation/NSHost.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.NSHost; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSObject; | |
11 import dstep.foundation.NSString; | |
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 NSHost : 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 NSHost currentHost () | |
30 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 return invokeObjcSuperClass!(NSHost, "currentHost"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 } |
14 | 33 |
34 static NSHost hostWithName (NSString name) | |
35 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
36 return invokeObjcSuperClass!(NSHost, "hostWithName:", NSString)(name); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
37 } |
14 | 38 |
39 static NSHost hostWithAddress (NSString address) | |
40 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
41 return invokeObjcSuperClass!(NSHost, "hostWithAddress:", NSString)(address); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 } |
14 | 43 |
44 static void setHostCacheEnabled (bool flag) | |
45 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
46 return invokeObjcSuperClass!(void, "setHostCacheEnabled:", bool)(flag); |
14 | 47 } |
48 | |
49 static bool isHostCacheEnabled () | |
50 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
51 return invokeObjcSuperClass!(bool, "isHostCacheEnabled"); |
14 | 52 } |
53 | |
54 static void flushHostCache () | |
55 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
56 return invokeObjcSuperClass!(void, "flushHostCache"); |
14 | 57 } |
58 | |
59 bool isEqualToHost (NSHost aHost) | |
60 { | |
61 return invokeObjcSelf!(bool, "isEqualToHost:", NSHost)(aHost); | |
62 } | |
63 | |
64 NSString name () | |
65 { | |
66 return invokeObjcSelf!(NSString, "name"); | |
67 } | |
68 | |
69 NSArray names () | |
70 { | |
71 return invokeObjcSelf!(NSArray, "names"); | |
72 } | |
73 | |
74 NSString address () | |
75 { | |
76 return invokeObjcSelf!(NSString, "address"); | |
77 } | |
78 | |
79 NSArray addresses () | |
80 { | |
81 return invokeObjcSelf!(NSArray, "addresses"); | |
82 } | |
83 } | |
84 |