Mercurial > projects > dstep
annotate dstep/foundation/NSNetServices.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 | 89f3c3ef1fd2 |
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.NSNetServices; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSData; | |
11 import dstep.foundation.NSDate; | |
12 import dstep.foundation.NSDictionary; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.foundation.NSObjCRuntime; |
14 | 14 import dstep.foundation.NSObject; |
15 import dstep.foundation.NSRunLoop; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
16 import dstep.foundation.NSStream; |
14 | 17 import dstep.foundation.NSString; |
18 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
19 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
20 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
21 |
14 | 22 |
23 import bindings = dstep.foundation.NSNetServices_bindings; | |
24 | |
25 alias NSInteger NSNetServicesError; | |
26 alias NSUInteger NSNetServiceOptions; | |
27 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
28 private |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
29 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
30 NSString NSNetServicesErrorCode_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 NSString NSNetServicesErrorDomain_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
33 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
34 NSString NSNetServicesErrorCode () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
35 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
36 if (NSNetServicesErrorCode_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
37 return NSNetServicesErrorCode_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
38 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
39 return NSNetServicesErrorCode_ = new NSString(bindings.NSNetServicesErrorCode); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
40 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 NSString NSNetServicesErrorDomain () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
43 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
44 if (NSNetServicesErrorDomain_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
45 return NSNetServicesErrorDomain_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
46 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
47 return NSNetServicesErrorDomain_ = new NSString(bindings.NSNetServicesErrorDomain); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
48 } |
14 | 49 |
50 enum | |
51 { | |
52 NSNetServicesUnknownError = -72000, | |
53 NSNetServicesCollisionError = -72001, | |
54 NSNetServicesNotFoundError = -72002, | |
55 NSNetServicesActivityInProgress = -72003, | |
56 NSNetServicesBadArgumentError = -72004, | |
57 NSNetServicesCancelledError = -72005, | |
58 NSNetServicesInvalidError = -72006, | |
59 NSNetServicesTimeoutError = -72007 | |
60 } | |
61 | |
62 enum | |
63 { | |
64 NSNetServiceNoAutoRename = 1 << 0 | |
65 } | |
66 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
67 const TNSDeprecated = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
68 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
69 void searchForAllDomains () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
70 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
71 return invokeObjcSelf!(void, "searchForAllDomains"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
72 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
73 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
74 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
75 const TNSNetServiceDelegateMethods = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
76 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
77 void netServiceWillPublish (NSNetService sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
78 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
79 return invokeObjcSelf!(void, "netServiceWillPublish:", NSNetService)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
80 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
81 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
82 void netServiceDidPublish (NSNetService sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
83 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
84 return invokeObjcSelf!(void, "netServiceDidPublish:", NSNetService)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
85 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
86 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
87 void netService (NSNetService sender, NSDictionary errorDict) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
88 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
89 return invokeObjcSelf!(void, "netService:didNotPublish:", NSNetService, NSDictionary)(sender, errorDict); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
90 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
91 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
92 void netServiceWillResolve (NSNetService sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
93 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
94 return invokeObjcSelf!(void, "netServiceWillResolve:", NSNetService)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
95 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
96 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
97 void netServiceDidResolveAddress (NSNetService sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
98 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
99 return invokeObjcSelf!(void, "netServiceDidResolveAddress:", NSNetService)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
100 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
101 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
102 void netService_didNotPublish (NSNetService sender, NSDictionary errorDict) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
103 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
104 return invokeObjcSelf!(void, "netService:didNotPublish:", NSNetService, NSDictionary)(sender, errorDict); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
105 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
106 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
107 void netServiceDidStop (NSNetService sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
108 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
109 return invokeObjcSelf!(void, "netServiceDidStop:", NSNetService)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
110 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
111 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
112 void netService (NSNetService sender, NSData data) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
113 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
114 return invokeObjcSelf!(void, "netService:didUpdateTXTRecordData:", NSNetService, NSData)(sender, data); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
115 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
116 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
117 //mixin ObjcBindMethod!(netServiceWillPublish, "netServiceWillPublish:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
118 //mixin ObjcBindMethod!(netServiceDidPublish, "netServiceDidPublish:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
119 //mixin ObjcBindMethod!(netService, "netService:didNotPublish:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
120 //mixin ObjcBindMethod!(netServiceWillResolve, "netServiceWillResolve:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
121 //mixin ObjcBindMethod!(netServiceDidResolveAddress, "netServiceDidResolveAddress:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
122 //mixin ObjcBindMethod!(netService_didNotPublish, "netService:didNotPublish:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
123 //mixin ObjcBindMethod!(netServiceDidStop, "netServiceDidStop:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
124 //mixin ObjcBindMethod!(netService, "netService:didUpdateTXTRecordData:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
125 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
126 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
127 const TNSNetServiceBrowserDelegateMethods = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
128 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
129 void netServiceBrowserWillSearch (NSNetServiceBrowser aNetServiceBrowser) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
130 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
131 return invokeObjcSelf!(void, "netServiceBrowserWillSearch:", NSNetServiceBrowser)(aNetServiceBrowser); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
132 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
133 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
134 void netServiceBrowserDidStopSearch (NSNetServiceBrowser aNetServiceBrowser) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
135 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
136 return invokeObjcSelf!(void, "netServiceBrowserDidStopSearch:", NSNetServiceBrowser)(aNetServiceBrowser); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
137 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
138 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
139 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSDictionary errorDict) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
140 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
141 return invokeObjcSelf!(void, "netServiceBrowser:didNotSearch:", NSNetServiceBrowser, NSDictionary)(aNetServiceBrowser, errorDict); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
142 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
143 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
144 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSString domainString, bool moreComing) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
145 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
146 return invokeObjcSelf!(void, "netServiceBrowser:didFindDomain:moreComing:", NSNetServiceBrowser, NSString, bool)(aNetServiceBrowser, domainString, moreComing); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
147 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
148 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
149 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, bool moreComing) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
150 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
151 return invokeObjcSelf!(void, "netServiceBrowser:didFindService:moreComing:", NSNetServiceBrowser, NSNetService, bool)(aNetServiceBrowser, aNetService, moreComing); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
152 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
153 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
154 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSString domainString, bool moreComing) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
155 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
156 return invokeObjcSelf!(void, "netServiceBrowser:didRemoveDomain:moreComing:", NSNetServiceBrowser, NSString, bool)(aNetServiceBrowser, domainString, moreComing); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
157 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
158 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
159 void netServiceBrowser (NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, bool moreComing) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
160 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
161 return invokeObjcSelf!(void, "netServiceBrowser:didRemoveService:moreComing:", NSNetServiceBrowser, NSNetService, bool)(aNetServiceBrowser, aNetService, moreComing); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
162 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
163 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
164 //mixin ObjcBindMethod!(netServiceBrowserWillSearch, "netServiceBrowserWillSearch:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
165 //mixin ObjcBindMethod!(netServiceBrowserDidStopSearch, "netServiceBrowserDidStopSearch:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
166 //mixin ObjcBindMethod!(netServiceBrowser, "netServiceBrowser:didNotSearch:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
167 //mixin ObjcBindMethod!(netServiceBrowser, "netServiceBrowser:didFindDomain:moreComing:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
168 //mixin ObjcBindMethod!(netServiceBrowser, "netServiceBrowser:didFindService:moreComing:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
169 //mixin ObjcBindMethod!(netServiceBrowser, "netServiceBrowser:didRemoveDomain:moreComing:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
170 //mixin ObjcBindMethod!(netServiceBrowser, "netServiceBrowser:didRemoveService:moreComing:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
171 `; |
14 | 172 |
173 class NSNetService : NSObject | |
174 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
175 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
176 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
177 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
178 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
179 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
180 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
181 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
182 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
183 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
184 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
185 } |
14 | 186 |
187 Object initWithDomain (NSString domain, NSString type, NSString name, int port) | |
188 { | |
189 return invokeObjcSelf!(Object, "initWithDomain:type:name:port:", NSString, NSString, NSString, int)(domain, type, name, port); | |
190 } | |
191 | |
192 this (NSString domain, NSString type, NSString name, int port) | |
193 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
194 typeof(this).alloc.initWithDomain(domain, type, name, port); |
14 | 195 } |
196 | |
197 Object initWithDomain (NSString domain, NSString type, NSString name) | |
198 { | |
199 return invokeObjcSelf!(Object, "initWithDomain:type:name:", NSString, NSString, NSString)(domain, type, name); | |
200 } | |
201 | |
202 this (NSString domain, NSString type, NSString name) | |
203 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
204 typeof(this).alloc.initWithDomain(domain, type, name); |
14 | 205 } |
206 | |
207 Object delegate_ () | |
208 { | |
209 return invokeObjcSelf!(Object, "delegate"); | |
210 } | |
211 | |
212 void setDelegate (Object delegate_) | |
213 { | |
214 return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); | |
215 } | |
216 | |
217 void scheduleInRunLoop (NSRunLoop aRunLoop, NSString mode) | |
218 { | |
219 return invokeObjcSelf!(void, "scheduleInRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
220 } | |
221 | |
222 void removeFromRunLoop (NSRunLoop aRunLoop, NSString mode) | |
223 { | |
224 return invokeObjcSelf!(void, "removeFromRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
225 } | |
226 | |
227 NSString domain () | |
228 { | |
229 return invokeObjcSelf!(NSString, "domain"); | |
230 } | |
231 | |
232 NSString type () | |
233 { | |
234 return invokeObjcSelf!(NSString, "type"); | |
235 } | |
236 | |
237 NSString name () | |
238 { | |
239 return invokeObjcSelf!(NSString, "name"); | |
240 } | |
241 | |
242 NSArray addresses () | |
243 { | |
244 return invokeObjcSelf!(NSArray, "addresses"); | |
245 } | |
246 | |
247 NSInteger port () | |
248 { | |
249 return invokeObjcSelf!(NSInteger, "port"); | |
250 } | |
251 | |
252 void publish () | |
253 { | |
254 return invokeObjcSelf!(void, "publish"); | |
255 } | |
256 | |
257 void publishWithOptions (uint options) | |
258 { | |
259 return invokeObjcSelf!(void, "publishWithOptions:", uint)(options); | |
260 } | |
261 | |
262 void resolve () | |
263 { | |
264 return invokeObjcSelf!(void, "resolve"); | |
265 } | |
266 | |
267 void stop () | |
268 { | |
269 return invokeObjcSelf!(void, "stop"); | |
270 } | |
271 | |
272 static NSDictionary dictionaryFromTXTRecordData (NSData txtData) | |
273 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
274 return invokeObjcSuperClass!(NSDictionary, "dictionaryFromTXTRecordData:", NSData)(txtData); |
14 | 275 } |
276 | |
277 static NSData dataFromTXTRecordDictionary (NSDictionary txtDictionary) | |
278 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
279 return invokeObjcSuperClass!(NSData, "dataFromTXTRecordDictionary:", NSDictionary)(txtDictionary); |
14 | 280 } |
281 | |
282 NSString hostName () | |
283 { | |
284 return invokeObjcSelf!(NSString, "hostName"); | |
285 } | |
286 | |
287 void resolveWithTimeout (double timeout) | |
288 { | |
289 return invokeObjcSelf!(void, "resolveWithTimeout:", double)(timeout); | |
290 } | |
291 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
292 bool getInputStream (out NSInputStream inputStream, out NSOutputStream outputStream) |
14 | 293 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
294 id input; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
295 id output; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
296 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
297 bool result = invokeObjcSelf!(bool, "getInputStream:outputStream:", id*, id*)(&input, &output); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
298 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
299 if (input) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
300 inputStream = new NSInputStream(input); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
301 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
302 if (output) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
303 outputStream = new NSOutputStream(output); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
304 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
305 return result; |
14 | 306 } |
307 | |
308 bool setTXTRecordData (NSData recordData) | |
309 { | |
310 return invokeObjcSelf!(bool, "setTXTRecordData:", NSData)(recordData); | |
311 } | |
312 | |
313 NSData TXTRecordData () | |
314 { | |
315 return invokeObjcSelf!(NSData, "TXTRecordData"); | |
316 } | |
317 | |
318 void startMonitoring () | |
319 { | |
320 return invokeObjcSelf!(void, "startMonitoring"); | |
321 } | |
322 | |
323 void stopMonitoring () | |
324 { | |
325 return invokeObjcSelf!(void, "stopMonitoring"); | |
326 } | |
327 } | |
328 | |
329 class NSNetServiceBrowser : NSObject | |
330 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
331 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
332 |
14 | 333 this () |
334 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
335 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
336 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
337 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
338 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
339 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
340 return invokeObjcSelf!(typeof(this), "init"); |
14 | 341 } |
342 | |
343 Object delegate_ () | |
344 { | |
345 return invokeObjcSelf!(Object, "delegate"); | |
346 } | |
347 | |
348 void setDelegate (Object delegate_) | |
349 { | |
350 return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); | |
351 } | |
352 | |
353 void scheduleInRunLoop (NSRunLoop aRunLoop, NSString mode) | |
354 { | |
355 return invokeObjcSelf!(void, "scheduleInRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
356 } | |
357 | |
358 void removeFromRunLoop (NSRunLoop aRunLoop, NSString mode) | |
359 { | |
360 return invokeObjcSelf!(void, "removeFromRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
361 } | |
362 | |
363 void searchForBrowsableDomains () | |
364 { | |
365 return invokeObjcSelf!(void, "searchForBrowsableDomains"); | |
366 } | |
367 | |
368 void searchForRegistrationDomains () | |
369 { | |
370 return invokeObjcSelf!(void, "searchForRegistrationDomains"); | |
371 } | |
372 | |
373 void searchForServicesOfType (NSString type, NSString domainString) | |
374 { | |
375 return invokeObjcSelf!(void, "searchForServicesOfType:inDomain:", NSString, NSString)(type, domainString); | |
376 } | |
377 | |
378 void stop () | |
379 { | |
380 return invokeObjcSelf!(void, "stop"); | |
381 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
382 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
383 // TNSDeprecated |
14 | 384 void searchForAllDomains () |
385 { | |
386 return invokeObjcSelf!(void, "searchForAllDomains"); | |
387 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
388 } |