Mercurial > projects > dstep
annotate dstep/foundation/NSNetServices.d @ 25:b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 06 Apr 2010 11:37:27 +0200 |
parents | 19885b43130e |
children |
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 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
175 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
176 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
177 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
178 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
179 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
180 } |
16
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 this () |
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 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
185 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
186 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
187 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
188 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
189 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
190 } |
14 | 191 |
192 Object initWithDomain (NSString domain, NSString type, NSString name, int port) | |
193 { | |
194 return invokeObjcSelf!(Object, "initWithDomain:type:name:port:", NSString, NSString, NSString, int)(domain, type, name, port); | |
195 } | |
196 | |
197 this (NSString domain, NSString type, NSString name, int port) | |
198 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
199 typeof(this).alloc.initWithDomain(domain, type, name, port); |
14 | 200 } |
201 | |
202 Object initWithDomain (NSString domain, NSString type, NSString name) | |
203 { | |
204 return invokeObjcSelf!(Object, "initWithDomain:type:name:", NSString, NSString, NSString)(domain, type, name); | |
205 } | |
206 | |
207 this (NSString domain, NSString type, NSString name) | |
208 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
209 typeof(this).alloc.initWithDomain(domain, type, name); |
14 | 210 } |
211 | |
212 Object delegate_ () | |
213 { | |
214 return invokeObjcSelf!(Object, "delegate"); | |
215 } | |
216 | |
217 void setDelegate (Object delegate_) | |
218 { | |
219 return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); | |
220 } | |
221 | |
222 void scheduleInRunLoop (NSRunLoop aRunLoop, NSString mode) | |
223 { | |
224 return invokeObjcSelf!(void, "scheduleInRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
225 } | |
226 | |
227 void removeFromRunLoop (NSRunLoop aRunLoop, NSString mode) | |
228 { | |
229 return invokeObjcSelf!(void, "removeFromRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
230 } | |
231 | |
232 NSString domain () | |
233 { | |
234 return invokeObjcSelf!(NSString, "domain"); | |
235 } | |
236 | |
237 NSString type () | |
238 { | |
239 return invokeObjcSelf!(NSString, "type"); | |
240 } | |
241 | |
242 NSString name () | |
243 { | |
244 return invokeObjcSelf!(NSString, "name"); | |
245 } | |
246 | |
247 NSArray addresses () | |
248 { | |
249 return invokeObjcSelf!(NSArray, "addresses"); | |
250 } | |
251 | |
252 NSInteger port () | |
253 { | |
254 return invokeObjcSelf!(NSInteger, "port"); | |
255 } | |
256 | |
257 void publish () | |
258 { | |
259 return invokeObjcSelf!(void, "publish"); | |
260 } | |
261 | |
262 void publishWithOptions (uint options) | |
263 { | |
264 return invokeObjcSelf!(void, "publishWithOptions:", uint)(options); | |
265 } | |
266 | |
267 void resolve () | |
268 { | |
269 return invokeObjcSelf!(void, "resolve"); | |
270 } | |
271 | |
272 void stop () | |
273 { | |
274 return invokeObjcSelf!(void, "stop"); | |
275 } | |
276 | |
277 static NSDictionary dictionaryFromTXTRecordData (NSData txtData) | |
278 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
279 return invokeObjcSuperClass!(NSDictionary, "dictionaryFromTXTRecordData:", NSData)(txtData); |
14 | 280 } |
281 | |
282 static NSData dataFromTXTRecordDictionary (NSDictionary txtDictionary) | |
283 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
284 return invokeObjcSuperClass!(NSData, "dataFromTXTRecordDictionary:", NSDictionary)(txtDictionary); |
14 | 285 } |
286 | |
287 NSString hostName () | |
288 { | |
289 return invokeObjcSelf!(NSString, "hostName"); | |
290 } | |
291 | |
292 void resolveWithTimeout (double timeout) | |
293 { | |
294 return invokeObjcSelf!(void, "resolveWithTimeout:", double)(timeout); | |
295 } | |
296 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
297 bool getInputStream (out NSInputStream inputStream, out NSOutputStream outputStream) |
14 | 298 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
299 id input; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
300 id output; |
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 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
|
303 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
304 if (input) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
305 inputStream = new NSInputStream(input); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
306 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
307 if (output) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
308 outputStream = new NSOutputStream(output); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
309 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
310 return result; |
14 | 311 } |
312 | |
313 bool setTXTRecordData (NSData recordData) | |
314 { | |
315 return invokeObjcSelf!(bool, "setTXTRecordData:", NSData)(recordData); | |
316 } | |
317 | |
318 NSData TXTRecordData () | |
319 { | |
320 return invokeObjcSelf!(NSData, "TXTRecordData"); | |
321 } | |
322 | |
323 void startMonitoring () | |
324 { | |
325 return invokeObjcSelf!(void, "startMonitoring"); | |
326 } | |
327 | |
328 void stopMonitoring () | |
329 { | |
330 return invokeObjcSelf!(void, "stopMonitoring"); | |
331 } | |
332 } | |
333 | |
334 class NSNetServiceBrowser : NSObject | |
335 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
336 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
337 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
338 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
339 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
340 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
341 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
342 |
14 | 343 this () |
344 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
345 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
346 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
347 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
348 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
349 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
350 return invokeObjcSelf!(typeof(this), "init"); |
14 | 351 } |
352 | |
353 Object delegate_ () | |
354 { | |
355 return invokeObjcSelf!(Object, "delegate"); | |
356 } | |
357 | |
358 void setDelegate (Object delegate_) | |
359 { | |
360 return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); | |
361 } | |
362 | |
363 void scheduleInRunLoop (NSRunLoop aRunLoop, NSString mode) | |
364 { | |
365 return invokeObjcSelf!(void, "scheduleInRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
366 } | |
367 | |
368 void removeFromRunLoop (NSRunLoop aRunLoop, NSString mode) | |
369 { | |
370 return invokeObjcSelf!(void, "removeFromRunLoop:forMode:", NSRunLoop, NSString)(aRunLoop, mode); | |
371 } | |
372 | |
373 void searchForBrowsableDomains () | |
374 { | |
375 return invokeObjcSelf!(void, "searchForBrowsableDomains"); | |
376 } | |
377 | |
378 void searchForRegistrationDomains () | |
379 { | |
380 return invokeObjcSelf!(void, "searchForRegistrationDomains"); | |
381 } | |
382 | |
383 void searchForServicesOfType (NSString type, NSString domainString) | |
384 { | |
385 return invokeObjcSelf!(void, "searchForServicesOfType:inDomain:", NSString, NSString)(type, domainString); | |
386 } | |
387 | |
388 void stop () | |
389 { | |
390 return invokeObjcSelf!(void, "stop"); | |
391 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
392 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
393 // TNSDeprecated |
14 | 394 void searchForAllDomains () |
395 { | |
396 return invokeObjcSelf!(void, "searchForAllDomains"); | |
397 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
398 } |