OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 """This module provides shared functionality for systems to generate | 6 """This module provides shared functionality for systems to generate |
7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
8 | 8 |
9 import copy | 9 import copy |
10 import json | 10 import json |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 'RTCIceCandidateEvent': 'RTCIceCandidateEvent,RTCPeerConnectionIceEvent', | 314 'RTCIceCandidateEvent': 'RTCIceCandidateEvent,RTCPeerConnectionIceEvent', |
315 | 315 |
316 'RTCSessionDescription': 'RTCSessionDescription,mozRTCSessionDescription', | 316 'RTCSessionDescription': 'RTCSessionDescription,mozRTCSessionDescription', |
317 | 317 |
318 'RTCDataChannel': 'RTCDataChannel,DataChannel', | 318 'RTCDataChannel': 'RTCDataChannel,DataChannel', |
319 | 319 |
320 'ScriptProcessorNode': 'ScriptProcessorNode,JavaScriptAudioNode', | 320 'ScriptProcessorNode': 'ScriptProcessorNode,JavaScriptAudioNode', |
321 | 321 |
322 'TransitionEvent': 'TransitionEvent,WebKitTransitionEvent', | 322 'TransitionEvent': 'TransitionEvent,WebKitTransitionEvent', |
323 | 323 |
324 'WebGLLoseContext': 'WebGLLoseContext,WebGLExtensionLoseContext', | |
325 | |
326 'CSSKeyframeRule': | 324 'CSSKeyframeRule': |
327 'CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule', | 325 'CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule', |
328 | 326 |
329 'CSSKeyframesRule': | 327 'CSSKeyframesRule': |
330 'CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule', | 328 'CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule', |
331 | 329 |
| 330 # webgl extensions are sometimes named directly after the getExtension |
| 331 # parameter (e.g on Firefox). |
| 332 |
| 333 'ANGLEInstancedArrays': 'ANGLEInstancedArrays,ANGLE_instanced_arrays', |
| 334 'EXTsRGB': 'EXTsRGB,EXT_sRGB', |
| 335 'EXTBlendMinMax': 'EXTBlendMinMax,EXT_blend_min_max', |
| 336 'EXTFragDepth': 'EXTFragDepth,EXT_frag_depth', |
| 337 'EXTShaderTextureLOD': 'EXTShaderTextureLOD,EXT_shader_texture_lod', |
| 338 'EXTTextureFilterAnisotropic': |
| 339 'EXTTextureFilterAnisotropic,EXT_texture_filter_anisotropic', |
| 340 'OESElementIndexUint': 'OESElementIndexUint,OES_element_index_uint', |
| 341 'OESStandardDerivatives': 'OESStandardDerivatives,OES_standard_derivatives', |
| 342 'OESTextureFloat': 'OESTextureFloat,OES_texture_float', |
| 343 'OESTextureFloatLinear': 'OESTextureFloatLinear,OES_texture_float_linear', |
| 344 'OESTextureHalfFloat': 'OESTextureHalfFloat,OES_texture_half_float', |
| 345 'OESTextureHalfFloatLinear': |
| 346 'OESTextureHalfFloatLinear,OES_texture_half_float_linear', |
| 347 'OESVertexArrayObject': |
| 348 'OESVertexArrayObject,OES_vertex_array_object', |
| 349 'WebGLCompressedTextureATC': |
| 350 'WebGLCompressedTextureATC,WEBGL_compressed_texture_atc', |
| 351 'WebGLCompressedTextureETC1': |
| 352 'WebGLCompressedTextureETC1,WEBGL_compressed_texture_etc1', |
| 353 'WebGLCompressedTexturePVRTC': |
| 354 'WebGLCompressedTexturePVRTC,WEBGL_compressed_texture_pvrtc', |
| 355 'WebGLCompressedTextureS3TC': |
| 356 'WebGLCompressedTextureS3TC,WEBGL_compressed_texture_s3tc', |
| 357 'WebGLDebugRendererInfo': 'WebGLDebugRendererInfo,WEBGL_debug_renderer_info'
, |
| 358 'WebGLDebugShaders': 'WebGLDebugShaders,WEBGL_debug_shaders', |
| 359 'WebGLDepthTexture': 'WebGLDepthTexture,WEBGL_depth_texture', |
| 360 'WebGLDrawBuffers': 'WebGLDrawBuffers,WEBGL_draw_buffers', |
| 361 'WebGLLoseContext': |
| 362 'WebGLLoseContext,WebGLExtensionLoseContext,WEBGL_lose_context', |
| 363 |
| 364 |
332 }, dart2jsOnly=True) | 365 }, dart2jsOnly=True) |
333 | 366 |
334 def IsRegisteredType(type_name): | 367 def IsRegisteredType(type_name): |
335 return type_name in _idl_type_registry | 368 return type_name in _idl_type_registry |
336 | 369 |
337 def MakeNativeSpec(javascript_binding_name): | 370 def MakeNativeSpec(javascript_binding_name): |
338 if javascript_binding_name in _dart2js_dom_custom_native_specs: | 371 if javascript_binding_name in _dart2js_dom_custom_native_specs: |
339 return _dart2js_dom_custom_native_specs[javascript_binding_name] | 372 return _dart2js_dom_custom_native_specs[javascript_binding_name] |
340 else: | 373 else: |
341 # Make the class 'hidden' so it is dynamically patched at runtime. This | 374 # Make the class 'hidden' so it is dynamically patched at runtime. This |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 return_type == 'Rectangle') | 1697 return_type == 'Rectangle') |
1665 | 1698 |
1666 def wrap_return_type_blink(return_type, type_name, type_registry): | 1699 def wrap_return_type_blink(return_type, type_name, type_registry): |
1667 """Returns True if we should wrap the returned value. This checks | 1700 """Returns True if we should wrap the returned value. This checks |
1668 a number of different variations, calling the more basic functions | 1701 a number of different variations, calling the more basic functions |
1669 above.""" | 1702 above.""" |
1670 return (wrap_unwrap_type_blink(return_type, type_registry) or | 1703 return (wrap_unwrap_type_blink(return_type, type_registry) or |
1671 wrap_unwrap_type_blink(type_name, type_registry) or | 1704 wrap_unwrap_type_blink(type_name, type_registry) or |
1672 wrap_type_blink(return_type, type_registry) or | 1705 wrap_type_blink(return_type, type_registry) or |
1673 wrap_unwrap_list_blink(return_type, type_registry)) | 1706 wrap_unwrap_list_blink(return_type, type_registry)) |
OLD | NEW |