OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 class _AudioContextFactoryProvider { | |
6 | |
7 factory AudioContext() { return create(); } | |
8 | |
9 static AudioContext create() native; | |
10 } | |
11 | |
12 class _DOMParserFactoryProvider { | |
13 | |
14 factory DOMParser() { return create(); } | |
15 | |
16 static DOMParser create() native; | |
17 } | |
18 | |
19 class _FileReaderFactoryProvider { | |
20 | |
21 factory FileReader() { return create(); } | |
22 | |
23 static FileReader create() native; | |
24 } | |
25 | |
26 class _TypedArrayFactoryProvider { | |
27 | |
28 factory Float32Array(int length) => _F32(length); | |
29 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); | |
30 factory Float32Array.fromBuffer(ArrayBuffer buffer) => _F32(buffer); | |
31 | |
32 factory Float64Array(int length) => _F64(length); | |
33 factory Float64Array.fromList(List<num> list) => _F64(ensureNative(list)); | |
34 factory Float64Array.fromBuffer(ArrayBuffer buffer) => _F64(buffer); | |
35 | |
36 factory Int8Array(int length) => _I8(length); | |
37 factory Int8Array.fromList(List<num> list) => _I8(ensureNative(list)); | |
38 factory Int8Array.fromBuffer(ArrayBuffer buffer) => _I8(buffer); | |
39 | |
40 factory Int16Array(int length) => _I16(length); | |
41 factory Int16Array.fromList(List<num> list) => _I16(ensureNative(list)); | |
42 factory Int16Array.fromBuffer(ArrayBuffer buffer) => _I16(buffer); | |
43 | |
44 factory Int32Array(int length) => _I32(length); | |
45 factory Int32Array.fromList(List<num> list) => _I32(ensureNative(list)); | |
46 factory Int32Array.fromBuffer(ArrayBuffer buffer) => _I32(buffer); | |
47 | |
48 factory Uint8Array(int length) => _U8(length); | |
49 factory Uint8Array.fromList(List<num> list) => _U8(ensureNative(list)); | |
50 factory Uint8Array.fromBuffer(ArrayBuffer buffer) => _U8(buffer); | |
51 | |
52 factory Uint16Array(int length) => _U16(length); | |
53 factory Uint16Array.fromList(List<num> list) => _U16(ensureNative(list)); | |
54 factory Uint16Array.fromBuffer(ArrayBuffer buffer) => _U16(buffer); | |
55 | |
56 factory Uint32Array(int length) => _U32(length); | |
57 factory Uint32Array.fromList(List<num> list) => _U32(ensureNative(list)); | |
58 factory Uint32Array.fromBuffer(ArrayBuffer buffer) => _U32(buffer); | |
59 | |
60 factory Uint8ClampedArray(int length) => _U8C(length); | |
61 factory Uint8ClampedArray.fromList(List<num> list) => _U8C(ensureNative(list))
; | |
62 factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer) => _U8C(buffer); | |
63 | |
64 static Float32Array _F32(arg) native; | |
65 static Float64Array _F64(arg) native; | |
66 static Int8Array _I8(arg) native; | |
67 static Int16Array _I16(arg) native; | |
68 static Int32Array _I32(arg) native; | |
69 static Uint8Array _U8(arg) native; | |
70 static Uint16Array _U16(arg) native; | |
71 static Uint32Array _U32(arg) native; | |
72 static Uint8ClampedArray _U8C(arg) native; | |
73 | |
74 static ensureNative(List list) => list; // TODO: make sure. | |
75 } | |
76 | |
77 class _WebKitCSSMatrixFactoryProvider { | |
78 | |
79 factory WebKitCSSMatrix([String spec = '']) { return create(spec); } | |
80 | |
81 static WebKitCSSMatrix create(spec) native; | |
82 } | |
83 | |
84 class _WebKitPointFactoryProvider { | |
85 | |
86 factory WebKitPoint(num x, num y) { return create(x, y); } | |
87 | |
88 static WebKitPoint create(x, y) native; | |
89 } | |
90 | |
91 class _WebSocketFactoryProvider { | |
92 | |
93 factory WebSocket(String url) { return create(url); } | |
94 | |
95 static WebKitPoint create(url) native; | |
96 } | |
97 | |
98 class _XMLHttpRequestFactoryProvider { | |
99 | |
100 factory XMLHttpRequest() { return create(); } | |
101 | |
102 static XMLHttpRequest create() native; | |
103 } | |
OLD | NEW |