Mercurial > projects > dstep
annotate dstep/foundation/NSURL.d @ 27:57371c29ef73 default tip
ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 09 Apr 2010 23:00:22 +0200 |
parents | b9de51448c6b |
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.NSURL; | |
8 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
9 import dstep.foundation.NSCoder; |
14 | 10 import dstep.foundation.NSData; |
11 import dstep.foundation.NSDictionary; | |
12 import dstep.foundation.NSObject; | |
13 import dstep.foundation.NSString; | |
14 import dstep.foundation.NSURLHandle; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
15 import dstep.foundation.NSValue; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
16 import dstep.foundation.NSZone; |
14 | 17 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
18 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
19 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
20 |
14 | 21 |
22 import bindings = dstep.foundation.NSURL_bindings; | |
23 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
24 private NSString NSURLFileScheme_; |
14 | 25 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
26 NSString NSURLFileScheme () |
14 | 27 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
28 if (NSURLFileScheme_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
29 return NSURLFileScheme_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 return NSURLFileScheme_ = new NSString(bindings.NSURLFileScheme); |
14 | 32 } |
33 | |
34 class NSURL : NSObject, INSCoding, INSCopying, INSURLHandleClient | |
35 { | |
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
|
36 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
|
37 |
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
|
38 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
|
39 { |
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
|
40 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
|
41 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
42 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
43 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
44 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
45 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
46 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
47 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
48 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
49 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
50 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
51 } |
14 | 52 |
53 Object initWithScheme (NSString scheme, NSString host, NSString path) | |
54 { | |
55 return invokeObjcSelf!(Object, "initWithScheme:host:path:", NSString, NSString, NSString)(scheme, host, path); | |
56 } | |
57 | |
58 this (NSString scheme, NSString host, NSString path) | |
59 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
60 typeof(this).alloc.initWithScheme(scheme, host, path); |
14 | 61 } |
62 | |
63 Object initFileURLWithPath (NSString path, bool isDir) | |
64 { | |
65 return invokeObjcSelf!(Object, "initFileURLWithPath:isDirectory:", NSString, bool)(path, isDir); | |
66 } | |
67 | |
68 this (NSString path, bool isDir) | |
69 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
70 typeof(this).alloc.initFileURLWithPath(path, isDir); |
14 | 71 } |
72 | |
73 Object initFileURLWithPath (NSString path) | |
74 { | |
75 return invokeObjcSelf!(Object, "initFileURLWithPath:", NSString)(path); | |
76 } | |
77 | |
78 static Object fileURLWithPath (NSString path, bool isDir) | |
79 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
80 return invokeObjcSuperClass!(Object, "fileURLWithPath:isDirectory:", NSString, bool)(path, isDir); |
14 | 81 } |
82 | |
83 static Object fileURLWithPath (NSString path) | |
84 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
85 return invokeObjcSuperClass!(Object, "fileURLWithPath:", NSString)(path); |
14 | 86 } |
87 | |
88 Object initWithString (NSString URLString) | |
89 { | |
90 return invokeObjcSelf!(Object, "initWithString:", NSString)(URLString); | |
91 } | |
92 | |
93 this (NSString URLString) | |
94 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
95 typeof(this).alloc.initWithString(URLString); |
14 | 96 } |
97 | |
98 Object initWithString (NSString URLString, NSURL baseURL) | |
99 { | |
100 return invokeObjcSelf!(Object, "initWithString:relativeToURL:", NSString, NSURL)(URLString, baseURL); | |
101 } | |
102 | |
103 this (NSString URLString, NSURL baseURL) | |
104 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
105 typeof(this).alloc.initWithString(URLString, baseURL); |
14 | 106 } |
107 | |
108 static Object URLWithString (NSString URLString) | |
109 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
110 return invokeObjcSuperClass!(Object, "URLWithString:", NSString)(URLString); |
14 | 111 } |
112 | |
113 static Object URLWithString (NSString URLString, NSURL baseURL) | |
114 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
115 return invokeObjcSuperClass!(Object, "URLWithString:relativeToURL:", NSString, NSURL)(URLString, baseURL); |
14 | 116 } |
117 | |
118 NSString absoluteString () | |
119 { | |
120 return invokeObjcSelf!(NSString, "absoluteString"); | |
121 } | |
122 | |
123 NSString relativeString () | |
124 { | |
125 return invokeObjcSelf!(NSString, "relativeString"); | |
126 } | |
127 | |
128 NSURL baseURL () | |
129 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
130 id result = invokeObjcSelf!(id, "baseURL"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
131 return result is this.objcObject ? this : (result !is null ? new NSURL(result) : null); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
132 } |
14 | 133 |
134 NSURL absoluteURL () | |
135 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
136 id result = invokeObjcSelf!(id, "absoluteURL"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
137 return result is this.objcObject ? this : (result !is null ? new NSURL(result) : null); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
138 } |
14 | 139 |
140 NSString scheme () | |
141 { | |
142 return invokeObjcSelf!(NSString, "scheme"); | |
143 } | |
144 | |
145 NSString resourceSpecifier () | |
146 { | |
147 return invokeObjcSelf!(NSString, "resourceSpecifier"); | |
148 } | |
149 | |
150 NSString host () | |
151 { | |
152 return invokeObjcSelf!(NSString, "host"); | |
153 } | |
154 | |
155 NSNumber port () | |
156 { | |
157 return invokeObjcSelf!(NSNumber, "port"); | |
158 } | |
159 | |
160 NSString user () | |
161 { | |
162 return invokeObjcSelf!(NSString, "user"); | |
163 } | |
164 | |
165 NSString password () | |
166 { | |
167 return invokeObjcSelf!(NSString, "password"); | |
168 } | |
169 | |
170 NSString path () | |
171 { | |
172 return invokeObjcSelf!(NSString, "path"); | |
173 } | |
174 | |
175 NSString fragment () | |
176 { | |
177 return invokeObjcSelf!(NSString, "fragment"); | |
178 } | |
179 | |
180 NSString parameterString () | |
181 { | |
182 return invokeObjcSelf!(NSString, "parameterString"); | |
183 } | |
184 | |
185 NSString query () | |
186 { | |
187 return invokeObjcSelf!(NSString, "query"); | |
188 } | |
189 | |
190 NSString relativePath () | |
191 { | |
192 return invokeObjcSelf!(NSString, "relativePath"); | |
193 } | |
194 | |
195 bool isFileURL () | |
196 { | |
197 return invokeObjcSelf!(bool, "isFileURL"); | |
198 } | |
199 | |
200 NSURL standardizedURL () | |
201 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
202 id result = invokeObjcSelf!(id, "standardizedURL"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
203 return result is this.objcObject ? this : (result !is null ? new NSURL(result) : null); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
204 } |
14 | 205 |
206 void encodeWithCoder (NSCoder aCoder) | |
207 { | |
208 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
209 } | |
210 | |
211 Object initWithCoder (NSCoder aDecoder) | |
212 { | |
213 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
214 } | |
215 | |
216 this (NSCoder aDecoder) | |
217 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
218 typeof(this).alloc.initWithCoder(aDecoder); |
14 | 219 } |
220 | |
221 Object copyWithZone (NSZone* zone) | |
222 { | |
223 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone); | |
224 } | |
225 | |
226 void URLHandle (NSURLHandle sender, NSData newBytes) | |
227 { | |
228 return invokeObjcSelf!(void, "URLHandle:resourceDataDidBecomeAvailable:", NSURLHandle, NSData)(sender, newBytes); | |
229 } | |
230 | |
231 void URLHandleResourceDidBeginLoading (NSURLHandle sender) | |
232 { | |
233 return invokeObjcSelf!(void, "URLHandleResourceDidBeginLoading:", NSURLHandle)(sender); | |
234 } | |
235 | |
236 void URLHandleResourceDidFinishLoading (NSURLHandle sender) | |
237 { | |
238 return invokeObjcSelf!(void, "URLHandleResourceDidFinishLoading:", NSURLHandle)(sender); | |
239 } | |
240 | |
241 void URLHandleResourceDidCancelLoading (NSURLHandle sender) | |
242 { | |
243 return invokeObjcSelf!(void, "URLHandleResourceDidCancelLoading:", NSURLHandle)(sender); | |
244 } | |
245 | |
246 void URLHandle (NSURLHandle sender, NSString reason) | |
247 { | |
248 return invokeObjcSelf!(void, "URLHandle:resourceDidFailLoadingWithReason:", NSURLHandle, NSString)(sender, reason); | |
249 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
250 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
251 // TNSURLLoading |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
252 NSData resourceDataUsingCache (bool shouldUseCache) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
253 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
254 return invokeObjcSelf!(NSData, "resourceDataUsingCache:", bool)(shouldUseCache); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
255 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
256 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
257 void loadResourceDataNotifyingClient (Object client, bool shouldUseCache) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
258 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
259 return invokeObjcSelf!(void, "loadResourceDataNotifyingClient:usingCache:", Object, bool)(client, shouldUseCache); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
260 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
261 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
262 Object propertyForKey (NSString propertyKey) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
263 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
264 return invokeObjcSelf!(Object, "propertyForKey:", NSString)(propertyKey); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
265 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
266 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
267 bool setResourceData (NSData data) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
268 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
269 return invokeObjcSelf!(bool, "setResourceData:", NSData)(data); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
270 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
271 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
272 bool setProperty (Object property, NSString propertyKey) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
273 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
274 return invokeObjcSelf!(bool, "setProperty:forKey:", Object, NSString)(property, propertyKey); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
275 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
276 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
277 NSURLHandle URLHandleUsingCache (bool shouldUseCache) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
278 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
279 return invokeObjcSelf!(NSURLHandle, "URLHandleUsingCache:", bool)(shouldUseCache); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
280 } |
14 | 281 } |
282 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
283 const TNSURLLoading = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
284 |
14 | 285 NSData resourceDataUsingCache (bool shouldUseCache) |
286 { | |
287 return invokeObjcSelf!(NSData, "resourceDataUsingCache:", bool)(shouldUseCache); | |
288 } | |
289 | |
290 void loadResourceDataNotifyingClient (Object client, bool shouldUseCache) | |
291 { | |
292 return invokeObjcSelf!(void, "loadResourceDataNotifyingClient:usingCache:", Object, bool)(client, shouldUseCache); | |
293 } | |
294 | |
295 Object propertyForKey (NSString propertyKey) | |
296 { | |
297 return invokeObjcSelf!(Object, "propertyForKey:", NSString)(propertyKey); | |
298 } | |
299 | |
300 bool setResourceData (NSData data) | |
301 { | |
302 return invokeObjcSelf!(bool, "setResourceData:", NSData)(data); | |
303 } | |
304 | |
305 bool setProperty (Object property, NSString propertyKey) | |
306 { | |
307 return invokeObjcSelf!(bool, "setProperty:forKey:", Object, NSString)(property, propertyKey); | |
308 } | |
309 | |
310 NSURLHandle URLHandleUsingCache (bool shouldUseCache) | |
311 { | |
312 return invokeObjcSelf!(NSURLHandle, "URLHandleUsingCache:", bool)(shouldUseCache); | |
313 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
314 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
315 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
316 const TNSURLClient = ` |
14 | 317 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
318 void URL (NSURL sender, NSData newBytes) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
319 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
320 return invokeObjcSelf!(void, "URL:resourceDataDidBecomeAvailable:", NSURL, NSData)(sender, newBytes); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
321 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
322 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
323 void URLResourceDidFinishLoading (NSURL sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
324 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
325 return invokeObjcSelf!(void, "URLResourceDidFinishLoading:", NSURL)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
326 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
327 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
328 void URLResourceDidCancelLoading (NSURL sender) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
329 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
330 return invokeObjcSelf!(void, "URLResourceDidCancelLoading:", NSURL)(sender); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
331 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
332 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
333 void URL (NSURL sender, NSString reason) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
334 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
335 return invokeObjcSelf!(void, "URL:resourceDidFailLoadingWithReason:", NSURL, NSString)(sender, reason); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
336 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
337 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
338 //mixin ObjcBindMethod!(URL, "URL:resourceDataDidBecomeAvailable:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
339 //mixin ObjcBindMethod!(URLResourceDidFinishLoading, "URLResourceDidFinishLoading:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
340 //mixin ObjcBindMethod!(URLResourceDidCancelLoading, "URLResourceDidCancelLoading:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
341 //mixin ObjcBindMethod!(URL, "URL:resourceDidFailLoadingWithReason:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
342 `; |
14 | 343 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
344 const TNSURLUtilities = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
345 |
14 | 346 NSString stringByAddingPercentEscapesUsingEncoding (uint enc) |
347 { | |
348 return invokeObjcSelf!(NSString, "stringByAddingPercentEscapesUsingEncoding:", uint)(enc); | |
349 } | |
350 | |
351 NSString stringByReplacingPercentEscapesUsingEncoding (uint enc) | |
352 { | |
353 return invokeObjcSelf!(NSString, "stringByReplacingPercentEscapesUsingEncoding:", uint)(enc); | |
354 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
355 `; |