From 23415f92c9ec1bf97f4e55952ed6897ebcf08d84 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Wed, 28 Aug 2024 15:49:49 -0700 Subject: [PATCH 1/2] Emit constants as Dart constants instead of external getters Closes https://github.com/dart-lang/web/issues/285 These constants have a predetermined value according to the IDL and therefore do not need to be external. This allows users to switch over constants instead of equality checks. Because they are now non-external, this triggers a 'constant_identifier_names' lint. To avoid ignoring this lint globally, analysis_options.yaml is forked into each package. Now unneeded ignores are pruned out of each one. --- web/CHANGELOG.md | 5 +- .../analysis_options.yaml | 8 +- web/lib/src/dom/angle_instanced_arrays.dart | 2 +- web/lib/src/dom/cssom.dart | 41 +- web/lib/src/dom/dom.dart | 104 +- web/lib/src/dom/ext_blend_minmax.dart | 5 +- .../src/dom/ext_color_buffer_half_float.dart | 11 +- web/lib/src/dom/ext_disjoint_timer_query.dart | 21 +- .../dom/ext_disjoint_timer_query_webgl2.dart | 12 +- web/lib/src/dom/ext_srgb.dart | 11 +- .../src/dom/ext_texture_compression_bptc.dart | 11 +- .../src/dom/ext_texture_compression_rgtc.dart | 11 +- .../dom/ext_texture_filter_anisotropic.dart | 5 +- web/lib/src/dom/ext_texture_norm16.dart | 23 +- web/lib/src/dom/fileapi.dart | 8 +- web/lib/src/dom/filter_effects.dart | 171 +- web/lib/src/dom/geolocation.dart | 8 +- web/lib/src/dom/html.dart | 57 +- .../src/dom/khr_parallel_shader_compile.dart | 2 +- web/lib/src/dom/navigation_timing.dart | 11 +- web/lib/src/dom/oes_standard_derivatives.dart | 2 +- web/lib/src/dom/oes_texture_half_float.dart | 2 +- web/lib/src/dom/oes_vertex_array_object.dart | 3 +- web/lib/src/dom/ovr_multiview2.dart | 13 +- web/lib/src/dom/svg.dart | 175 +- web/lib/src/dom/uievents.dart | 27 +- web/lib/src/dom/webgl1.dart | 890 ++++++--- web/lib/src/dom/webgl2.dart | 1677 +++++++++++------ web/lib/src/dom/webgl_color_buffer_float.dart | 8 +- .../dom/webgl_compressed_texture_astc.dart | 84 +- .../src/dom/webgl_compressed_texture_etc.dart | 29 +- .../dom/webgl_compressed_texture_etc1.dart | 2 +- .../dom/webgl_compressed_texture_pvrtc.dart | 11 +- .../dom/webgl_compressed_texture_s3tc.dart | 11 +- .../webgl_compressed_texture_s3tc_srgb.dart | 11 +- .../src/dom/webgl_debug_renderer_info.dart | 5 +- web/lib/src/dom/webgl_depth_texture.dart | 2 +- web/lib/src/dom/webgl_draw_buffers.dart | 102 +- web/lib/src/dom/webgpu.dart | 70 +- web/lib/src/dom/webidl.dart | 74 +- web/lib/src/dom/websockets.dart | 11 +- web/lib/src/dom/xhr.dart | 14 +- web/test/smoke_test.dart | 15 + web_generator/analysis_options.yaml | 26 + web_generator/lib/src/translator.dart | 110 +- web_generator/lib/src/webidl_api.dart | 2 +- 46 files changed, 2604 insertions(+), 1299 deletions(-) rename analysis_options.yaml => web/analysis_options.yaml (88%) create mode 100644 web_generator/analysis_options.yaml diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md index b854ecdf..bc5d5cdc 100644 --- a/web/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -4,9 +4,12 @@ the `HttpStatus` from the `dart:_internal` library that's exposed only through `dart:io` and `dart:html`. - Added `JSImmutableListWrapper` which helps create a dart list from a JS list. -- Deprecated `TouchListWrapper` and `TouchListConvert` in favor of `JSImmutableListWrapper`. +- Deprecated `TouchListWrapper` and `TouchListConvert` in favor of + `JSImmutableListWrapper`. - Added `[]` and `[]=` overloaded operators to types which define unnamed `getter`s and `setter`s, respectively. +- Exposed constants with primitive values as non-`external` so they can be + `switch`ed over. ## 1.0.0 diff --git a/analysis_options.yaml b/web/analysis_options.yaml similarity index 88% rename from analysis_options.yaml rename to web/analysis_options.yaml index b86d28fb..0c43be87 100644 --- a/analysis_options.yaml +++ b/web/analysis_options.yaml @@ -7,7 +7,7 @@ analyzer: strict-inference: true strict-raw-types: true exclude: - - web/test_fixes/** + - test_fixes/** errors: # 43 instances in generated code. @@ -18,8 +18,8 @@ analyzer: lines_longer_than_80_chars: ignore # 1,333 instances in generated code. non_constant_identifier_names: ignore - # Consider removing from dart_flutter_team_lints. - unreachable_from_main: ignore + # 1,260 instances in generated code. + constant_identifier_names: ignore linter: rules: @@ -37,4 +37,4 @@ linter: - prefer_const_declarations - prefer_final_locals - unnecessary_await_in_return - - use_string_buffers + - use_string_buffers \ No newline at end of file diff --git a/web/lib/src/dom/angle_instanced_arrays.dart b/web/lib/src/dom/angle_instanced_arrays.dart index 56e8d034..f99879ee 100644 --- a/web/lib/src/dom/angle_instanced_arrays.dart +++ b/web/lib/src/dom/angle_instanced_arrays.dart @@ -43,7 +43,7 @@ import 'webgl1.dart'; /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays). extension type ANGLE_instanced_arrays._(JSObject _) implements JSObject { - external static GLenum get VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE; + static const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 35070; /// The **`ANGLE_instanced_arrays.drawArraysInstancedANGLE()`** method of the /// [WebGL API](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API) diff --git a/web/lib/src/dom/cssom.dart b/web/lib/src/dom/cssom.dart index 9f4bef71..7d29f291 100644 --- a/web/lib/src/dom/cssom.dart +++ b/web/lib/src/dom/cssom.dart @@ -352,20 +352,33 @@ extension type CSSRuleList._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule). extension type CSSRule._(JSObject _) implements JSObject { - external static int get KEYFRAMES_RULE; - external static int get KEYFRAME_RULE; - external static int get SUPPORTS_RULE; - external static int get COUNTER_STYLE_RULE; - external static int get FONT_FEATURE_VALUES_RULE; - external static int get VIEW_TRANSITION_RULE; - external static int get STYLE_RULE; - external static int get CHARSET_RULE; - external static int get IMPORT_RULE; - external static int get MEDIA_RULE; - external static int get FONT_FACE_RULE; - external static int get PAGE_RULE; - external static int get MARGIN_RULE; - external static int get NAMESPACE_RULE; + static const int KEYFRAMES_RULE = 7; + + static const int KEYFRAME_RULE = 8; + + static const int SUPPORTS_RULE = 12; + + static const int COUNTER_STYLE_RULE = 11; + + static const int FONT_FEATURE_VALUES_RULE = 14; + + static const int VIEW_TRANSITION_RULE = 15; + + static const int STYLE_RULE = 1; + + static const int CHARSET_RULE = 2; + + static const int IMPORT_RULE = 3; + + static const int MEDIA_RULE = 4; + + static const int FONT_FACE_RULE = 5; + + static const int PAGE_RULE = 6; + + static const int MARGIN_RULE = 9; + + static const int NAMESPACE_RULE = 10; /// The **`cssText`** property of the [CSSRule] /// interface returns the actual text of a [CSSStyleSheet] style-rule. diff --git a/web/lib/src/dom/dom.dart b/web/lib/src/dom/dom.dart index b0d3ee8c..0bcb4f63 100644 --- a/web/lib/src/dom/dom.dart +++ b/web/lib/src/dom/dom.dart @@ -86,10 +86,13 @@ extension type Event._(JSObject _) implements JSObject { EventInit eventInitDict, ]); - external static int get NONE; - external static int get CAPTURING_PHASE; - external static int get AT_TARGET; - external static int get BUBBLING_PHASE; + static const int NONE = 0; + + static const int CAPTURING_PHASE = 1; + + static const int AT_TARGET = 2; + + static const int BUBBLING_PHASE = 3; /// The **`composedPath()`** method of the [Event] /// interface returns the event's path which is an array of the objects on @@ -906,24 +909,41 @@ extension type MutationRecord._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Node). extension type Node._(JSObject _) implements EventTarget, JSObject { - external static int get ELEMENT_NODE; - external static int get ATTRIBUTE_NODE; - external static int get TEXT_NODE; - external static int get CDATA_SECTION_NODE; - external static int get ENTITY_REFERENCE_NODE; - external static int get ENTITY_NODE; - external static int get PROCESSING_INSTRUCTION_NODE; - external static int get COMMENT_NODE; - external static int get DOCUMENT_NODE; - external static int get DOCUMENT_TYPE_NODE; - external static int get DOCUMENT_FRAGMENT_NODE; - external static int get NOTATION_NODE; - external static int get DOCUMENT_POSITION_DISCONNECTED; - external static int get DOCUMENT_POSITION_PRECEDING; - external static int get DOCUMENT_POSITION_FOLLOWING; - external static int get DOCUMENT_POSITION_CONTAINS; - external static int get DOCUMENT_POSITION_CONTAINED_BY; - external static int get DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; + static const int ELEMENT_NODE = 1; + + static const int ATTRIBUTE_NODE = 2; + + static const int TEXT_NODE = 3; + + static const int CDATA_SECTION_NODE = 4; + + static const int ENTITY_REFERENCE_NODE = 5; + + static const int ENTITY_NODE = 6; + + static const int PROCESSING_INSTRUCTION_NODE = 7; + + static const int COMMENT_NODE = 8; + + static const int DOCUMENT_NODE = 9; + + static const int DOCUMENT_TYPE_NODE = 10; + + static const int DOCUMENT_FRAGMENT_NODE = 11; + + static const int NOTATION_NODE = 12; + + static const int DOCUMENT_POSITION_DISCONNECTED = 1; + + static const int DOCUMENT_POSITION_PRECEDING = 2; + + static const int DOCUMENT_POSITION_FOLLOWING = 4; + + static const int DOCUMENT_POSITION_CONTAINS = 8; + + static const int DOCUMENT_POSITION_CONTAINED_BY = 16; + + static const int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; /// The **`getRootNode()`** method of the [Node] interface /// returns the context object's root, @@ -4833,10 +4853,13 @@ extension type StaticRange._(JSObject _) implements AbstractRange, JSObject { extension type Range._(JSObject _) implements AbstractRange, JSObject { external factory Range(); - external static int get START_TO_START; - external static int get START_TO_END; - external static int get END_TO_END; - external static int get END_TO_START; + static const int START_TO_START = 0; + + static const int START_TO_END = 1; + + static const int END_TO_END = 2; + + static const int END_TO_START = 3; /// The **`Range.getClientRects()`** method returns a list of [DOMRect] /// objects representing the area of the screen occupied by the @@ -5426,16 +5449,25 @@ extension type DOMTokenList._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XPathResult). extension type XPathResult._(JSObject _) implements JSObject { - external static int get ANY_TYPE; - external static int get NUMBER_TYPE; - external static int get STRING_TYPE; - external static int get BOOLEAN_TYPE; - external static int get UNORDERED_NODE_ITERATOR_TYPE; - external static int get ORDERED_NODE_ITERATOR_TYPE; - external static int get UNORDERED_NODE_SNAPSHOT_TYPE; - external static int get ORDERED_NODE_SNAPSHOT_TYPE; - external static int get ANY_UNORDERED_NODE_TYPE; - external static int get FIRST_ORDERED_NODE_TYPE; + static const int ANY_TYPE = 0; + + static const int NUMBER_TYPE = 1; + + static const int STRING_TYPE = 2; + + static const int BOOLEAN_TYPE = 3; + + static const int UNORDERED_NODE_ITERATOR_TYPE = 4; + + static const int ORDERED_NODE_ITERATOR_TYPE = 5; + + static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6; + + static const int ORDERED_NODE_SNAPSHOT_TYPE = 7; + + static const int ANY_UNORDERED_NODE_TYPE = 8; + + static const int FIRST_ORDERED_NODE_TYPE = 9; /// The **`iterateNext()`** method of the /// [XPathResult] interface iterates over a node set result and returns the diff --git a/web/lib/src/dom/ext_blend_minmax.dart b/web/lib/src/dom/ext_blend_minmax.dart index 1af86cd5..82cdf255 100644 --- a/web/lib/src/dom/ext_blend_minmax.dart +++ b/web/lib/src/dom/ext_blend_minmax.dart @@ -18,6 +18,7 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type EXT_blend_minmax._(JSObject _) implements JSObject { - external static GLenum get MIN_EXT; - external static GLenum get MAX_EXT; + static const GLenum MIN_EXT = 32775; + + static const GLenum MAX_EXT = 32776; } diff --git a/web/lib/src/dom/ext_color_buffer_half_float.dart b/web/lib/src/dom/ext_color_buffer_half_float.dart index 5c0ba4af..25b8e049 100644 --- a/web/lib/src/dom/ext_color_buffer_half_float.dart +++ b/web/lib/src/dom/ext_color_buffer_half_float.dart @@ -18,8 +18,11 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type EXT_color_buffer_half_float._(JSObject _) implements JSObject { - external static GLenum get RGBA16F_EXT; - external static GLenum get RGB16F_EXT; - external static GLenum get FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT; - external static GLenum get UNSIGNED_NORMALIZED_EXT; + static const GLenum RGBA16F_EXT = 34842; + + static const GLenum RGB16F_EXT = 34843; + + static const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 33297; + + static const GLenum UNSIGNED_NORMALIZED_EXT = 35863; } diff --git a/web/lib/src/dom/ext_disjoint_timer_query.dart b/web/lib/src/dom/ext_disjoint_timer_query.dart index c6a93648..4cd66b33 100644 --- a/web/lib/src/dom/ext_disjoint_timer_query.dart +++ b/web/lib/src/dom/ext_disjoint_timer_query.dart @@ -19,13 +19,20 @@ import 'webgl1.dart'; extension type WebGLTimerQueryEXT._(JSObject _) implements JSObject {} extension type EXT_disjoint_timer_query._(JSObject _) implements JSObject { - external static GLenum get QUERY_COUNTER_BITS_EXT; - external static GLenum get CURRENT_QUERY_EXT; - external static GLenum get QUERY_RESULT_EXT; - external static GLenum get QUERY_RESULT_AVAILABLE_EXT; - external static GLenum get TIME_ELAPSED_EXT; - external static GLenum get TIMESTAMP_EXT; - external static GLenum get GPU_DISJOINT_EXT; + static const GLenum QUERY_COUNTER_BITS_EXT = 34916; + + static const GLenum CURRENT_QUERY_EXT = 34917; + + static const GLenum QUERY_RESULT_EXT = 34918; + + static const GLenum QUERY_RESULT_AVAILABLE_EXT = 34919; + + static const GLenum TIME_ELAPSED_EXT = 35007; + + static const GLenum TIMESTAMP_EXT = 36392; + + static const GLenum GPU_DISJOINT_EXT = 36795; + external WebGLTimerQueryEXT? createQueryEXT(); external void deleteQueryEXT(WebGLTimerQueryEXT? query); external bool isQueryEXT(WebGLTimerQueryEXT? query); diff --git a/web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart b/web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart index a0332bab..040fc6c1 100644 --- a/web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart +++ b/web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart @@ -20,10 +20,14 @@ import 'webgl2.dart'; extension type EXT_disjoint_timer_query_webgl2._(JSObject _) implements JSObject { - external static GLenum get QUERY_COUNTER_BITS_EXT; - external static GLenum get TIME_ELAPSED_EXT; - external static GLenum get TIMESTAMP_EXT; - external static GLenum get GPU_DISJOINT_EXT; + static const GLenum QUERY_COUNTER_BITS_EXT = 34916; + + static const GLenum TIME_ELAPSED_EXT = 35007; + + static const GLenum TIMESTAMP_EXT = 36392; + + static const GLenum GPU_DISJOINT_EXT = 36795; + external void queryCounterEXT( WebGLQuery query, GLenum target, diff --git a/web/lib/src/dom/ext_srgb.dart b/web/lib/src/dom/ext_srgb.dart index 5f109f9d..4e9ac650 100644 --- a/web/lib/src/dom/ext_srgb.dart +++ b/web/lib/src/dom/ext_srgb.dart @@ -18,8 +18,11 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type EXT_sRGB._(JSObject _) implements JSObject { - external static GLenum get SRGB_EXT; - external static GLenum get SRGB_ALPHA_EXT; - external static GLenum get SRGB8_ALPHA8_EXT; - external static GLenum get FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT; + static const GLenum SRGB_EXT = 35904; + + static const GLenum SRGB_ALPHA_EXT = 35906; + + static const GLenum SRGB8_ALPHA8_EXT = 35907; + + static const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 33296; } diff --git a/web/lib/src/dom/ext_texture_compression_bptc.dart b/web/lib/src/dom/ext_texture_compression_bptc.dart index 0ad6d448..60d0e6b0 100644 --- a/web/lib/src/dom/ext_texture_compression_bptc.dart +++ b/web/lib/src/dom/ext_texture_compression_bptc.dart @@ -18,8 +18,11 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type EXT_texture_compression_bptc._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_RGBA_BPTC_UNORM_EXT; - external static GLenum get COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT; - external static GLenum get COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT; - external static GLenum get COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT; + static const GLenum COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492; + + static const GLenum COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493; + + static const GLenum COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494; + + static const GLenum COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495; } diff --git a/web/lib/src/dom/ext_texture_compression_rgtc.dart b/web/lib/src/dom/ext_texture_compression_rgtc.dart index 7a2fa100..b669f66f 100644 --- a/web/lib/src/dom/ext_texture_compression_rgtc.dart +++ b/web/lib/src/dom/ext_texture_compression_rgtc.dart @@ -18,8 +18,11 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type EXT_texture_compression_rgtc._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_RED_RGTC1_EXT; - external static GLenum get COMPRESSED_SIGNED_RED_RGTC1_EXT; - external static GLenum get COMPRESSED_RED_GREEN_RGTC2_EXT; - external static GLenum get COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT; + static const GLenum COMPRESSED_RED_RGTC1_EXT = 36283; + + static const GLenum COMPRESSED_SIGNED_RED_RGTC1_EXT = 36284; + + static const GLenum COMPRESSED_RED_GREEN_RGTC2_EXT = 36285; + + static const GLenum COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 36286; } diff --git a/web/lib/src/dom/ext_texture_filter_anisotropic.dart b/web/lib/src/dom/ext_texture_filter_anisotropic.dart index 9636e613..6526d879 100644 --- a/web/lib/src/dom/ext_texture_filter_anisotropic.dart +++ b/web/lib/src/dom/ext_texture_filter_anisotropic.dart @@ -19,6 +19,7 @@ import 'webgl1.dart'; extension type EXT_texture_filter_anisotropic._(JSObject _) implements JSObject { - external static GLenum get TEXTURE_MAX_ANISOTROPY_EXT; - external static GLenum get MAX_TEXTURE_MAX_ANISOTROPY_EXT; + static const GLenum TEXTURE_MAX_ANISOTROPY_EXT = 34046; + + static const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047; } diff --git a/web/lib/src/dom/ext_texture_norm16.dart b/web/lib/src/dom/ext_texture_norm16.dart index 0d0f8ee8..a378f337 100644 --- a/web/lib/src/dom/ext_texture_norm16.dart +++ b/web/lib/src/dom/ext_texture_norm16.dart @@ -18,12 +18,19 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type EXT_texture_norm16._(JSObject _) implements JSObject { - external static GLenum get R16_EXT; - external static GLenum get RG16_EXT; - external static GLenum get RGB16_EXT; - external static GLenum get RGBA16_EXT; - external static GLenum get R16_SNORM_EXT; - external static GLenum get RG16_SNORM_EXT; - external static GLenum get RGB16_SNORM_EXT; - external static GLenum get RGBA16_SNORM_EXT; + static const GLenum R16_EXT = 33322; + + static const GLenum RG16_EXT = 33324; + + static const GLenum RGB16_EXT = 32852; + + static const GLenum RGBA16_EXT = 32859; + + static const GLenum R16_SNORM_EXT = 36760; + + static const GLenum RG16_SNORM_EXT = 36761; + + static const GLenum RGB16_SNORM_EXT = 36762; + + static const GLenum RGBA16_SNORM_EXT = 36763; } diff --git a/web/lib/src/dom/fileapi.dart b/web/lib/src/dom/fileapi.dart index 670a75af..abfc1204 100644 --- a/web/lib/src/dom/fileapi.dart +++ b/web/lib/src/dom/fileapi.dart @@ -233,9 +233,11 @@ extension type FileList._(JSObject _) implements JSObject { extension type FileReader._(JSObject _) implements EventTarget, JSObject { external factory FileReader(); - external static int get EMPTY; - external static int get LOADING; - external static int get DONE; + static const int EMPTY = 0; + + static const int LOADING = 1; + + static const int DONE = 2; /// The **`readAsArrayBuffer()`** method of the [FileReader] interface is used /// to start reading the diff --git a/web/lib/src/dom/filter_effects.dart b/web/lib/src/dom/filter_effects.dart index d8ff8767..2b56793f 100644 --- a/web/lib/src/dom/filter_effects.dart +++ b/web/lib/src/dom/filter_effects.dart @@ -56,23 +56,40 @@ extension type SVGFEBlendElement._(JSObject _) implements SVGElement, JSObject { 'feBlend', ); - external static int get SVG_FEBLEND_MODE_UNKNOWN; - external static int get SVG_FEBLEND_MODE_NORMAL; - external static int get SVG_FEBLEND_MODE_MULTIPLY; - external static int get SVG_FEBLEND_MODE_SCREEN; - external static int get SVG_FEBLEND_MODE_DARKEN; - external static int get SVG_FEBLEND_MODE_LIGHTEN; - external static int get SVG_FEBLEND_MODE_OVERLAY; - external static int get SVG_FEBLEND_MODE_COLOR_DODGE; - external static int get SVG_FEBLEND_MODE_COLOR_BURN; - external static int get SVG_FEBLEND_MODE_HARD_LIGHT; - external static int get SVG_FEBLEND_MODE_SOFT_LIGHT; - external static int get SVG_FEBLEND_MODE_DIFFERENCE; - external static int get SVG_FEBLEND_MODE_EXCLUSION; - external static int get SVG_FEBLEND_MODE_HUE; - external static int get SVG_FEBLEND_MODE_SATURATION; - external static int get SVG_FEBLEND_MODE_COLOR; - external static int get SVG_FEBLEND_MODE_LUMINOSITY; + static const int SVG_FEBLEND_MODE_UNKNOWN = 0; + + static const int SVG_FEBLEND_MODE_NORMAL = 1; + + static const int SVG_FEBLEND_MODE_MULTIPLY = 2; + + static const int SVG_FEBLEND_MODE_SCREEN = 3; + + static const int SVG_FEBLEND_MODE_DARKEN = 4; + + static const int SVG_FEBLEND_MODE_LIGHTEN = 5; + + static const int SVG_FEBLEND_MODE_OVERLAY = 6; + + static const int SVG_FEBLEND_MODE_COLOR_DODGE = 7; + + static const int SVG_FEBLEND_MODE_COLOR_BURN = 8; + + static const int SVG_FEBLEND_MODE_HARD_LIGHT = 9; + + static const int SVG_FEBLEND_MODE_SOFT_LIGHT = 10; + + static const int SVG_FEBLEND_MODE_DIFFERENCE = 11; + + static const int SVG_FEBLEND_MODE_EXCLUSION = 12; + + static const int SVG_FEBLEND_MODE_HUE = 13; + + static const int SVG_FEBLEND_MODE_SATURATION = 14; + + static const int SVG_FEBLEND_MODE_COLOR = 15; + + static const int SVG_FEBLEND_MODE_LUMINOSITY = 16; + external SVGAnimatedString get in1; external SVGAnimatedString get in2; external SVGAnimatedEnumeration get mode; @@ -98,11 +115,16 @@ extension type SVGFEColorMatrixElement._(JSObject _) 'feColorMatrix', ); - external static int get SVG_FECOLORMATRIX_TYPE_UNKNOWN; - external static int get SVG_FECOLORMATRIX_TYPE_MATRIX; - external static int get SVG_FECOLORMATRIX_TYPE_SATURATE; - external static int get SVG_FECOLORMATRIX_TYPE_HUEROTATE; - external static int get SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA; + static const int SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0; + + static const int SVG_FECOLORMATRIX_TYPE_MATRIX = 1; + + static const int SVG_FECOLORMATRIX_TYPE_SATURATE = 2; + + static const int SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3; + + static const int SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4; + external SVGAnimatedString get in1; external SVGAnimatedEnumeration get type; external SVGAnimatedNumberList get values; @@ -147,12 +169,18 @@ extension type SVGFEComponentTransferElement._(JSObject _) /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGComponentTransferFunctionElement). extension type SVGComponentTransferFunctionElement._(JSObject _) implements SVGElement, JSObject { - external static int get SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN; - external static int get SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY; - external static int get SVG_FECOMPONENTTRANSFER_TYPE_TABLE; - external static int get SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE; - external static int get SVG_FECOMPONENTTRANSFER_TYPE_LINEAR; - external static int get SVG_FECOMPONENTTRANSFER_TYPE_GAMMA; + static const int SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0; + + static const int SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1; + + static const int SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2; + + static const int SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3; + + static const int SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4; + + static const int SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5; + external SVGAnimatedEnumeration get type; external SVGAnimatedNumberList get tableValues; external SVGAnimatedNumber get slope; @@ -241,13 +269,20 @@ extension type SVGFECompositeElement._(JSObject _) 'feComposite', ); - external static int get SVG_FECOMPOSITE_OPERATOR_UNKNOWN; - external static int get SVG_FECOMPOSITE_OPERATOR_OVER; - external static int get SVG_FECOMPOSITE_OPERATOR_IN; - external static int get SVG_FECOMPOSITE_OPERATOR_OUT; - external static int get SVG_FECOMPOSITE_OPERATOR_ATOP; - external static int get SVG_FECOMPOSITE_OPERATOR_XOR; - external static int get SVG_FECOMPOSITE_OPERATOR_ARITHMETIC; + static const int SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0; + + static const int SVG_FECOMPOSITE_OPERATOR_OVER = 1; + + static const int SVG_FECOMPOSITE_OPERATOR_IN = 2; + + static const int SVG_FECOMPOSITE_OPERATOR_OUT = 3; + + static const int SVG_FECOMPOSITE_OPERATOR_ATOP = 4; + + static const int SVG_FECOMPOSITE_OPERATOR_XOR = 5; + + static const int SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6; + external SVGAnimatedString get in1; external SVGAnimatedString get in2; external SVGAnimatedEnumeration get operator; @@ -277,10 +312,14 @@ extension type SVGFEConvolveMatrixElement._(JSObject _) 'feConvolveMatrix', ); - external static int get SVG_EDGEMODE_UNKNOWN; - external static int get SVG_EDGEMODE_DUPLICATE; - external static int get SVG_EDGEMODE_WRAP; - external static int get SVG_EDGEMODE_NONE; + static const int SVG_EDGEMODE_UNKNOWN = 0; + + static const int SVG_EDGEMODE_DUPLICATE = 1; + + static const int SVG_EDGEMODE_WRAP = 2; + + static const int SVG_EDGEMODE_NONE = 3; + external SVGAnimatedString get in1; external SVGAnimatedInteger get orderX; external SVGAnimatedInteger get orderY; @@ -408,11 +447,16 @@ extension type SVGFEDisplacementMapElement._(JSObject _) 'feDisplacementMap', ); - external static int get SVG_CHANNEL_UNKNOWN; - external static int get SVG_CHANNEL_R; - external static int get SVG_CHANNEL_G; - external static int get SVG_CHANNEL_B; - external static int get SVG_CHANNEL_A; + static const int SVG_CHANNEL_UNKNOWN = 0; + + static const int SVG_CHANNEL_R = 1; + + static const int SVG_CHANNEL_G = 2; + + static const int SVG_CHANNEL_B = 3; + + static const int SVG_CHANNEL_A = 4; + external SVGAnimatedString get in1; external SVGAnimatedString get in2; external SVGAnimatedNumber get scale; @@ -492,10 +536,14 @@ extension type SVGFEGaussianBlurElement._(JSObject _) 'feGaussianBlur', ); - external static int get SVG_EDGEMODE_UNKNOWN; - external static int get SVG_EDGEMODE_DUPLICATE; - external static int get SVG_EDGEMODE_WRAP; - external static int get SVG_EDGEMODE_NONE; + static const int SVG_EDGEMODE_UNKNOWN = 0; + + static const int SVG_EDGEMODE_DUPLICATE = 1; + + static const int SVG_EDGEMODE_WRAP = 2; + + static const int SVG_EDGEMODE_NONE = 3; + external void setStdDeviation( num stdDeviationX, num stdDeviationY, @@ -589,9 +637,12 @@ extension type SVGFEMorphologyElement._(JSObject _) 'feMorphology', ); - external static int get SVG_MORPHOLOGY_OPERATOR_UNKNOWN; - external static int get SVG_MORPHOLOGY_OPERATOR_ERODE; - external static int get SVG_MORPHOLOGY_OPERATOR_DILATE; + static const int SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0; + + static const int SVG_MORPHOLOGY_OPERATOR_ERODE = 1; + + static const int SVG_MORPHOLOGY_OPERATOR_DILATE = 2; + external SVGAnimatedString get in1; external SVGAnimatedEnumeration get operator; external SVGAnimatedNumber get radiusX; @@ -695,12 +746,18 @@ extension type SVGFETurbulenceElement._(JSObject _) 'feTurbulence', ); - external static int get SVG_TURBULENCE_TYPE_UNKNOWN; - external static int get SVG_TURBULENCE_TYPE_FRACTALNOISE; - external static int get SVG_TURBULENCE_TYPE_TURBULENCE; - external static int get SVG_STITCHTYPE_UNKNOWN; - external static int get SVG_STITCHTYPE_STITCH; - external static int get SVG_STITCHTYPE_NOSTITCH; + static const int SVG_TURBULENCE_TYPE_UNKNOWN = 0; + + static const int SVG_TURBULENCE_TYPE_FRACTALNOISE = 1; + + static const int SVG_TURBULENCE_TYPE_TURBULENCE = 2; + + static const int SVG_STITCHTYPE_UNKNOWN = 0; + + static const int SVG_STITCHTYPE_STITCH = 1; + + static const int SVG_STITCHTYPE_NOSTITCH = 2; + external SVGAnimatedNumber get baseFrequencyX; external SVGAnimatedNumber get baseFrequencyY; external SVGAnimatedInteger get numOctaves; diff --git a/web/lib/src/dom/geolocation.dart b/web/lib/src/dom/geolocation.dart index 59844ff7..05030c84 100644 --- a/web/lib/src/dom/geolocation.dart +++ b/web/lib/src/dom/geolocation.dart @@ -179,9 +179,11 @@ extension type GeolocationCoordinates._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPositionError). extension type GeolocationPositionError._(JSObject _) implements JSObject { - external static int get PERMISSION_DENIED; - external static int get POSITION_UNAVAILABLE; - external static int get TIMEOUT; + static const int PERMISSION_DENIED = 1; + + static const int POSITION_UNAVAILABLE = 2; + + static const int TIMEOUT = 3; /// The **`code`** read-only property of the [GeolocationPositionError] /// interface is an `unsigned short` representing the error code. diff --git a/web/lib/src/dom/html.dart b/web/lib/src/dom/html.dart index 7fd8de04..d4c6e548 100644 --- a/web/lib/src/dom/html.dart +++ b/web/lib/src/dom/html.dart @@ -3261,10 +3261,14 @@ extension type HTMLTrackElement._(JSObject _) implements HTMLElement, JSObject { /// Creates an [HTMLTrackElement] using the tag 'track'. HTMLTrackElement() : _ = document.createElement('track'); - external static int get NONE; - external static int get LOADING; - external static int get LOADED; - external static int get ERROR; + static const int NONE = 0; + + static const int LOADING = 1; + + static const int LOADED = 2; + + static const int ERROR = 3; + external String get kind; external set kind(String value); @@ -3299,15 +3303,23 @@ extension type HTMLTrackElement._(JSObject _) implements HTMLElement, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement). extension type HTMLMediaElement._(JSObject _) implements HTMLElement, JSObject { - external static int get NETWORK_EMPTY; - external static int get NETWORK_IDLE; - external static int get NETWORK_LOADING; - external static int get NETWORK_NO_SOURCE; - external static int get HAVE_NOTHING; - external static int get HAVE_METADATA; - external static int get HAVE_CURRENT_DATA; - external static int get HAVE_FUTURE_DATA; - external static int get HAVE_ENOUGH_DATA; + static const int NETWORK_EMPTY = 0; + + static const int NETWORK_IDLE = 1; + + static const int NETWORK_LOADING = 2; + + static const int NETWORK_NO_SOURCE = 3; + + static const int HAVE_NOTHING = 0; + + static const int HAVE_METADATA = 1; + + static const int HAVE_CURRENT_DATA = 2; + + static const int HAVE_FUTURE_DATA = 3; + + static const int HAVE_ENOUGH_DATA = 4; /// The **`HTMLMediaElement.setSinkId()`** method of the /// [Audio Output Devices API](https://developer.mozilla.org/en-US/docs/Web/API/Audio_Output_Devices_API) @@ -3707,10 +3719,13 @@ extension type HTMLMediaElement._(JSObject _) implements HTMLElement, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/MediaError). extension type MediaError._(JSObject _) implements JSObject { - external static int get MEDIA_ERR_ABORTED; - external static int get MEDIA_ERR_NETWORK; - external static int get MEDIA_ERR_DECODE; - external static int get MEDIA_ERR_SRC_NOT_SUPPORTED; + static const int MEDIA_ERR_ABORTED = 1; + + static const int MEDIA_ERR_NETWORK = 2; + + static const int MEDIA_ERR_DECODE = 3; + + static const int MEDIA_ERR_SRC_NOT_SUPPORTED = 4; /// The read-only property **`MediaError.code`** returns a numeric /// value which represents the kind of error that occurred on a media element. @@ -12582,9 +12597,11 @@ extension type EventSource._(JSObject _) implements EventTarget, JSObject { EventSourceInit eventSourceInitDict, ]); - external static int get CONNECTING; - external static int get OPEN; - external static int get CLOSED; + static const int CONNECTING = 0; + + static const int OPEN = 1; + + static const int CLOSED = 2; /// The **`close()`** method of the [EventSource] /// interface closes the connection, if one is made, and sets the diff --git a/web/lib/src/dom/khr_parallel_shader_compile.dart b/web/lib/src/dom/khr_parallel_shader_compile.dart index f2ad269d..0245d2cf 100644 --- a/web/lib/src/dom/khr_parallel_shader_compile.dart +++ b/web/lib/src/dom/khr_parallel_shader_compile.dart @@ -18,5 +18,5 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type KHR_parallel_shader_compile._(JSObject _) implements JSObject { - external static GLenum get COMPLETION_STATUS_KHR; + static const GLenum COMPLETION_STATUS_KHR = 37297; } diff --git a/web/lib/src/dom/navigation_timing.dart b/web/lib/src/dom/navigation_timing.dart index d57d0644..54a1398b 100644 --- a/web/lib/src/dom/navigation_timing.dart +++ b/web/lib/src/dom/navigation_timing.dart @@ -549,10 +549,13 @@ extension type PerformanceTiming._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigation). extension type PerformanceNavigation._(JSObject _) implements JSObject { - external static int get TYPE_NAVIGATE; - external static int get TYPE_RELOAD; - external static int get TYPE_BACK_FORWARD; - external static int get TYPE_RESERVED; + static const int TYPE_NAVIGATE = 0; + + static const int TYPE_RELOAD = 1; + + static const int TYPE_BACK_FORWARD = 2; + + static const int TYPE_RESERVED = 255; /// > **Warning:** This interface of this property is deprecated in the /// > [Navigation Timing Level 2 specification](https://w3c.github.io/navigation-timing/#obsolete). diff --git a/web/lib/src/dom/oes_standard_derivatives.dart b/web/lib/src/dom/oes_standard_derivatives.dart index aac2aa26..aa1d7cc2 100644 --- a/web/lib/src/dom/oes_standard_derivatives.dart +++ b/web/lib/src/dom/oes_standard_derivatives.dart @@ -18,5 +18,5 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type OES_standard_derivatives._(JSObject _) implements JSObject { - external static GLenum get FRAGMENT_SHADER_DERIVATIVE_HINT_OES; + static const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 35723; } diff --git a/web/lib/src/dom/oes_texture_half_float.dart b/web/lib/src/dom/oes_texture_half_float.dart index a90a3cfc..ea340ef9 100644 --- a/web/lib/src/dom/oes_texture_half_float.dart +++ b/web/lib/src/dom/oes_texture_half_float.dart @@ -18,5 +18,5 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type OES_texture_half_float._(JSObject _) implements JSObject { - external static GLenum get HALF_FLOAT_OES; + static const GLenum HALF_FLOAT_OES = 36193; } diff --git a/web/lib/src/dom/oes_vertex_array_object.dart b/web/lib/src/dom/oes_vertex_array_object.dart index 11dbccd1..3dfe863f 100644 --- a/web/lib/src/dom/oes_vertex_array_object.dart +++ b/web/lib/src/dom/oes_vertex_array_object.dart @@ -19,7 +19,8 @@ import 'webgl1.dart'; extension type WebGLVertexArrayObjectOES._(JSObject _) implements JSObject {} extension type OES_vertex_array_object._(JSObject _) implements JSObject { - external static GLenum get VERTEX_ARRAY_BINDING_OES; + static const GLenum VERTEX_ARRAY_BINDING_OES = 34229; + external WebGLVertexArrayObjectOES? createVertexArrayOES(); external void deleteVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); external GLboolean isVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); diff --git a/web/lib/src/dom/ovr_multiview2.dart b/web/lib/src/dom/ovr_multiview2.dart index bdb6474f..097b9e97 100644 --- a/web/lib/src/dom/ovr_multiview2.dart +++ b/web/lib/src/dom/ovr_multiview2.dart @@ -18,10 +18,15 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type OVR_multiview2._(JSObject _) implements JSObject { - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR; - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR; - external static GLenum get MAX_VIEWS_OVR; - external static GLenum get FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR; + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 38448; + + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = + 38450; + + static const GLenum MAX_VIEWS_OVR = 38449; + + static const GLenum FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 38451; + external void framebufferTextureMultiviewOVR( GLenum target, GLenum attachment, diff --git a/web/lib/src/dom/svg.dart b/web/lib/src/dom/svg.dart index c2be1228..c1154185 100644 --- a/web/lib/src/dom/svg.dart +++ b/web/lib/src/dom/svg.dart @@ -422,17 +422,28 @@ extension type SVGNumber._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength). extension type SVGLength._(JSObject _) implements JSObject { - external static int get SVG_LENGTHTYPE_UNKNOWN; - external static int get SVG_LENGTHTYPE_NUMBER; - external static int get SVG_LENGTHTYPE_PERCENTAGE; - external static int get SVG_LENGTHTYPE_EMS; - external static int get SVG_LENGTHTYPE_EXS; - external static int get SVG_LENGTHTYPE_PX; - external static int get SVG_LENGTHTYPE_CM; - external static int get SVG_LENGTHTYPE_MM; - external static int get SVG_LENGTHTYPE_IN; - external static int get SVG_LENGTHTYPE_PT; - external static int get SVG_LENGTHTYPE_PC; + static const int SVG_LENGTHTYPE_UNKNOWN = 0; + + static const int SVG_LENGTHTYPE_NUMBER = 1; + + static const int SVG_LENGTHTYPE_PERCENTAGE = 2; + + static const int SVG_LENGTHTYPE_EMS = 3; + + static const int SVG_LENGTHTYPE_EXS = 4; + + static const int SVG_LENGTHTYPE_PX = 5; + + static const int SVG_LENGTHTYPE_CM = 6; + + static const int SVG_LENGTHTYPE_MM = 7; + + static const int SVG_LENGTHTYPE_IN = 8; + + static const int SVG_LENGTHTYPE_PT = 9; + + static const int SVG_LENGTHTYPE_PC = 10; + external void newValueSpecifiedUnits( int unitType, num valueInSpecifiedUnits, @@ -471,11 +482,16 @@ extension type SVGLength._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGAngle). extension type SVGAngle._(JSObject _) implements JSObject { - external static int get SVG_ANGLETYPE_UNKNOWN; - external static int get SVG_ANGLETYPE_UNSPECIFIED; - external static int get SVG_ANGLETYPE_DEG; - external static int get SVG_ANGLETYPE_RAD; - external static int get SVG_ANGLETYPE_GRAD; + static const int SVG_ANGLETYPE_UNKNOWN = 0; + + static const int SVG_ANGLETYPE_UNSPECIFIED = 1; + + static const int SVG_ANGLETYPE_DEG = 2; + + static const int SVG_ANGLETYPE_RAD = 3; + + static const int SVG_ANGLETYPE_GRAD = 4; + external void newValueSpecifiedUnits( int unitType, num valueInSpecifiedUnits, @@ -762,9 +778,11 @@ extension type SVGAnimatedLengthList._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGUnitTypes). extension type SVGUnitTypes._(JSObject _) implements JSObject { - external static int get SVG_UNIT_TYPE_UNKNOWN; - external static int get SVG_UNIT_TYPE_USERSPACEONUSE; - external static int get SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; + static const int SVG_UNIT_TYPE_UNKNOWN = 0; + + static const int SVG_UNIT_TYPE_USERSPACEONUSE = 1; + + static const int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; } /// The **`SVGSVGElement`** interface provides access to the properties of @@ -1057,13 +1075,20 @@ extension type SVGStyleElement._(JSObject _) implements SVGElement, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGTransform). extension type SVGTransform._(JSObject _) implements JSObject { - external static int get SVG_TRANSFORM_UNKNOWN; - external static int get SVG_TRANSFORM_MATRIX; - external static int get SVG_TRANSFORM_TRANSLATE; - external static int get SVG_TRANSFORM_SCALE; - external static int get SVG_TRANSFORM_ROTATE; - external static int get SVG_TRANSFORM_SKEWX; - external static int get SVG_TRANSFORM_SKEWY; + static const int SVG_TRANSFORM_UNKNOWN = 0; + + static const int SVG_TRANSFORM_MATRIX = 1; + + static const int SVG_TRANSFORM_TRANSLATE = 2; + + static const int SVG_TRANSFORM_SCALE = 3; + + static const int SVG_TRANSFORM_ROTATE = 4; + + static const int SVG_TRANSFORM_SKEWX = 5; + + static const int SVG_TRANSFORM_SKEWY = 6; + external void setMatrix([DOMMatrix2DInit matrix]); external void setTranslate( num tx, @@ -1132,20 +1157,34 @@ extension type SVGAnimatedTransformList._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGPreserveAspectRatio). extension type SVGPreserveAspectRatio._(JSObject _) implements JSObject { - external static int get SVG_PRESERVEASPECTRATIO_UNKNOWN; - external static int get SVG_PRESERVEASPECTRATIO_NONE; - external static int get SVG_PRESERVEASPECTRATIO_XMINYMIN; - external static int get SVG_PRESERVEASPECTRATIO_XMIDYMIN; - external static int get SVG_PRESERVEASPECTRATIO_XMAXYMIN; - external static int get SVG_PRESERVEASPECTRATIO_XMINYMID; - external static int get SVG_PRESERVEASPECTRATIO_XMIDYMID; - external static int get SVG_PRESERVEASPECTRATIO_XMAXYMID; - external static int get SVG_PRESERVEASPECTRATIO_XMINYMAX; - external static int get SVG_PRESERVEASPECTRATIO_XMIDYMAX; - external static int get SVG_PRESERVEASPECTRATIO_XMAXYMAX; - external static int get SVG_MEETORSLICE_UNKNOWN; - external static int get SVG_MEETORSLICE_MEET; - external static int get SVG_MEETORSLICE_SLICE; + static const int SVG_PRESERVEASPECTRATIO_UNKNOWN = 0; + + static const int SVG_PRESERVEASPECTRATIO_NONE = 1; + + static const int SVG_PRESERVEASPECTRATIO_XMINYMIN = 2; + + static const int SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3; + + static const int SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4; + + static const int SVG_PRESERVEASPECTRATIO_XMINYMID = 5; + + static const int SVG_PRESERVEASPECTRATIO_XMIDYMID = 6; + + static const int SVG_PRESERVEASPECTRATIO_XMAXYMID = 7; + + static const int SVG_PRESERVEASPECTRATIO_XMINYMAX = 8; + + static const int SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9; + + static const int SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10; + + static const int SVG_MEETORSLICE_UNKNOWN = 0; + + static const int SVG_MEETORSLICE_MEET = 1; + + static const int SVG_MEETORSLICE_SLICE = 2; + external int get align; external set align(int value); external int get meetOrSlice; @@ -1398,9 +1437,12 @@ extension type SVGPolygonElement._(JSObject _) /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement). extension type SVGTextContentElement._(JSObject _) implements SVGGraphicsElement, JSObject { - external static int get LENGTHADJUST_UNKNOWN; - external static int get LENGTHADJUST_SPACING; - external static int get LENGTHADJUST_SPACINGANDGLYPHS; + static const int LENGTHADJUST_UNKNOWN = 0; + + static const int LENGTHADJUST_SPACING = 1; + + static const int LENGTHADJUST_SPACINGANDGLYPHS = 2; + external int getNumberOfChars(); external double getComputedTextLength(); external double getSubStringLength( @@ -1484,12 +1526,18 @@ extension type SVGTextPathElement._(JSObject _) 'textPath', ); - external static int get TEXTPATH_METHODTYPE_UNKNOWN; - external static int get TEXTPATH_METHODTYPE_ALIGN; - external static int get TEXTPATH_METHODTYPE_STRETCH; - external static int get TEXTPATH_SPACINGTYPE_UNKNOWN; - external static int get TEXTPATH_SPACINGTYPE_AUTO; - external static int get TEXTPATH_SPACINGTYPE_EXACT; + static const int TEXTPATH_METHODTYPE_UNKNOWN = 0; + + static const int TEXTPATH_METHODTYPE_ALIGN = 1; + + static const int TEXTPATH_METHODTYPE_STRETCH = 2; + + static const int TEXTPATH_SPACINGTYPE_UNKNOWN = 0; + + static const int TEXTPATH_SPACINGTYPE_AUTO = 1; + + static const int TEXTPATH_SPACINGTYPE_EXACT = 2; + external SVGAnimatedLength get startOffset; external SVGAnimatedEnumeration get method; external SVGAnimatedEnumeration get spacing; @@ -1587,12 +1635,17 @@ extension type SVGMarkerElement._(JSObject _) implements SVGElement, JSObject { 'marker', ); - external static int get SVG_MARKERUNITS_UNKNOWN; - external static int get SVG_MARKERUNITS_USERSPACEONUSE; - external static int get SVG_MARKERUNITS_STROKEWIDTH; - external static int get SVG_MARKER_ORIENT_UNKNOWN; - external static int get SVG_MARKER_ORIENT_AUTO; - external static int get SVG_MARKER_ORIENT_ANGLE; + static const int SVG_MARKERUNITS_UNKNOWN = 0; + + static const int SVG_MARKERUNITS_USERSPACEONUSE = 1; + + static const int SVG_MARKERUNITS_STROKEWIDTH = 2; + + static const int SVG_MARKER_ORIENT_UNKNOWN = 0; + + static const int SVG_MARKER_ORIENT_AUTO = 1; + + static const int SVG_MARKER_ORIENT_ANGLE = 2; /// The **`setOrientToAuto()`** method of the [SVGMarkerElement] interface /// sets the value of the `orient` attribute to `auto`. @@ -1666,10 +1719,14 @@ extension type SVGMarkerElement._(JSObject _) implements SVGElement, JSObject { /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SVGGradientElement). extension type SVGGradientElement._(JSObject _) implements SVGElement, JSObject { - external static int get SVG_SPREADMETHOD_UNKNOWN; - external static int get SVG_SPREADMETHOD_PAD; - external static int get SVG_SPREADMETHOD_REFLECT; - external static int get SVG_SPREADMETHOD_REPEAT; + static const int SVG_SPREADMETHOD_UNKNOWN = 0; + + static const int SVG_SPREADMETHOD_PAD = 1; + + static const int SVG_SPREADMETHOD_REFLECT = 2; + + static const int SVG_SPREADMETHOD_REPEAT = 3; + external SVGAnimatedEnumeration get gradientUnits; external SVGAnimatedTransformList get gradientTransform; external SVGAnimatedEnumeration get spreadMethod; diff --git a/web/lib/src/dom/uievents.dart b/web/lib/src/dom/uievents.dart index 0ed91993..4078941d 100644 --- a/web/lib/src/dom/uievents.dart +++ b/web/lib/src/dom/uievents.dart @@ -655,9 +655,11 @@ extension type WheelEvent._(JSObject _) implements MouseEvent, JSObject { WheelEventInit eventInitDict, ]); - external static int get DOM_DELTA_PIXEL; - external static int get DOM_DELTA_LINE; - external static int get DOM_DELTA_PAGE; + static const int DOM_DELTA_PIXEL = 0; + + static const int DOM_DELTA_LINE = 1; + + static const int DOM_DELTA_PAGE = 2; /// The **`WheelEvent.deltaX`** read-only property is a /// `double` representing the horizontal scroll amount in the @@ -874,10 +876,13 @@ extension type KeyboardEvent._(JSObject _) implements UIEvent, JSObject { KeyboardEventInit eventInitDict, ]); - external static int get DOM_KEY_LOCATION_STANDARD; - external static int get DOM_KEY_LOCATION_LEFT; - external static int get DOM_KEY_LOCATION_RIGHT; - external static int get DOM_KEY_LOCATION_NUMPAD; + static const int DOM_KEY_LOCATION_STANDARD = 0; + + static const int DOM_KEY_LOCATION_LEFT = 1; + + static const int DOM_KEY_LOCATION_RIGHT = 2; + + static const int DOM_KEY_LOCATION_NUMPAD = 3; /// The **`KeyboardEvent.getModifierState()`** method returns the /// current state of the specified modifier key: `true` if the modifier is @@ -1257,9 +1262,11 @@ extension type TextEvent._(JSObject _) implements UIEvent, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent). extension type MutationEvent._(JSObject _) implements Event, JSObject { - external static int get MODIFICATION; - external static int get ADDITION; - external static int get REMOVAL; + static const int MODIFICATION = 1; + + static const int ADDITION = 2; + + static const int REMOVAL = 3; /// The **`initMutationEvent()`** method of the [MutationEvent] interface /// initializes the diff --git a/web/lib/src/dom/webgl1.dart b/web/lib/src/dom/webgl1.dart index b7b07a34..c2afe0df 100644 --- a/web/lib/src/dom/webgl1.dart +++ b/web/lib/src/dom/webgl1.dart @@ -250,303 +250,599 @@ extension type WebGLShaderPrecisionFormat._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext). extension type WebGLRenderingContext._(JSObject _) implements JSObject { - external static GLenum get DEPTH_BUFFER_BIT; - external static GLenum get STENCIL_BUFFER_BIT; - external static GLenum get COLOR_BUFFER_BIT; - external static GLenum get POINTS; - external static GLenum get LINES; - external static GLenum get LINE_LOOP; - external static GLenum get LINE_STRIP; - external static GLenum get TRIANGLES; - external static GLenum get TRIANGLE_STRIP; - external static GLenum get TRIANGLE_FAN; - external static GLenum get ZERO; - external static GLenum get ONE; - external static GLenum get SRC_COLOR; - external static GLenum get ONE_MINUS_SRC_COLOR; - external static GLenum get SRC_ALPHA; - external static GLenum get ONE_MINUS_SRC_ALPHA; - external static GLenum get DST_ALPHA; - external static GLenum get ONE_MINUS_DST_ALPHA; - external static GLenum get DST_COLOR; - external static GLenum get ONE_MINUS_DST_COLOR; - external static GLenum get SRC_ALPHA_SATURATE; - external static GLenum get FUNC_ADD; - external static GLenum get BLEND_EQUATION; - external static GLenum get BLEND_EQUATION_RGB; - external static GLenum get BLEND_EQUATION_ALPHA; - external static GLenum get FUNC_SUBTRACT; - external static GLenum get FUNC_REVERSE_SUBTRACT; - external static GLenum get BLEND_DST_RGB; - external static GLenum get BLEND_SRC_RGB; - external static GLenum get BLEND_DST_ALPHA; - external static GLenum get BLEND_SRC_ALPHA; - external static GLenum get CONSTANT_COLOR; - external static GLenum get ONE_MINUS_CONSTANT_COLOR; - external static GLenum get CONSTANT_ALPHA; - external static GLenum get ONE_MINUS_CONSTANT_ALPHA; - external static GLenum get BLEND_COLOR; - external static GLenum get ARRAY_BUFFER; - external static GLenum get ELEMENT_ARRAY_BUFFER; - external static GLenum get ARRAY_BUFFER_BINDING; - external static GLenum get ELEMENT_ARRAY_BUFFER_BINDING; - external static GLenum get STREAM_DRAW; - external static GLenum get STATIC_DRAW; - external static GLenum get DYNAMIC_DRAW; - external static GLenum get BUFFER_SIZE; - external static GLenum get BUFFER_USAGE; - external static GLenum get CURRENT_VERTEX_ATTRIB; - external static GLenum get FRONT; - external static GLenum get BACK; - external static GLenum get FRONT_AND_BACK; - external static GLenum get CULL_FACE; - external static GLenum get BLEND; - external static GLenum get DITHER; - external static GLenum get STENCIL_TEST; - external static GLenum get DEPTH_TEST; - external static GLenum get SCISSOR_TEST; - external static GLenum get POLYGON_OFFSET_FILL; - external static GLenum get SAMPLE_ALPHA_TO_COVERAGE; - external static GLenum get SAMPLE_COVERAGE; - external static GLenum get NO_ERROR; - external static GLenum get INVALID_ENUM; - external static GLenum get INVALID_VALUE; - external static GLenum get INVALID_OPERATION; - external static GLenum get OUT_OF_MEMORY; - external static GLenum get CW; - external static GLenum get CCW; - external static GLenum get LINE_WIDTH; - external static GLenum get ALIASED_POINT_SIZE_RANGE; - external static GLenum get ALIASED_LINE_WIDTH_RANGE; - external static GLenum get CULL_FACE_MODE; - external static GLenum get FRONT_FACE; - external static GLenum get DEPTH_RANGE; - external static GLenum get DEPTH_WRITEMASK; - external static GLenum get DEPTH_CLEAR_VALUE; - external static GLenum get DEPTH_FUNC; - external static GLenum get STENCIL_CLEAR_VALUE; - external static GLenum get STENCIL_FUNC; - external static GLenum get STENCIL_FAIL; - external static GLenum get STENCIL_PASS_DEPTH_FAIL; - external static GLenum get STENCIL_PASS_DEPTH_PASS; - external static GLenum get STENCIL_REF; - external static GLenum get STENCIL_VALUE_MASK; - external static GLenum get STENCIL_WRITEMASK; - external static GLenum get STENCIL_BACK_FUNC; - external static GLenum get STENCIL_BACK_FAIL; - external static GLenum get STENCIL_BACK_PASS_DEPTH_FAIL; - external static GLenum get STENCIL_BACK_PASS_DEPTH_PASS; - external static GLenum get STENCIL_BACK_REF; - external static GLenum get STENCIL_BACK_VALUE_MASK; - external static GLenum get STENCIL_BACK_WRITEMASK; - external static GLenum get VIEWPORT; - external static GLenum get SCISSOR_BOX; - external static GLenum get COLOR_CLEAR_VALUE; - external static GLenum get COLOR_WRITEMASK; - external static GLenum get UNPACK_ALIGNMENT; - external static GLenum get PACK_ALIGNMENT; - external static GLenum get MAX_TEXTURE_SIZE; - external static GLenum get MAX_VIEWPORT_DIMS; - external static GLenum get SUBPIXEL_BITS; - external static GLenum get RED_BITS; - external static GLenum get GREEN_BITS; - external static GLenum get BLUE_BITS; - external static GLenum get ALPHA_BITS; - external static GLenum get DEPTH_BITS; - external static GLenum get STENCIL_BITS; - external static GLenum get POLYGON_OFFSET_UNITS; - external static GLenum get POLYGON_OFFSET_FACTOR; - external static GLenum get TEXTURE_BINDING_2D; - external static GLenum get SAMPLE_BUFFERS; - external static GLenum get SAMPLES; - external static GLenum get SAMPLE_COVERAGE_VALUE; - external static GLenum get SAMPLE_COVERAGE_INVERT; - external static GLenum get COMPRESSED_TEXTURE_FORMATS; - external static GLenum get DONT_CARE; - external static GLenum get FASTEST; - external static GLenum get NICEST; - external static GLenum get GENERATE_MIPMAP_HINT; - external static GLenum get BYTE; - external static GLenum get UNSIGNED_BYTE; - external static GLenum get SHORT; - external static GLenum get UNSIGNED_SHORT; - external static GLenum get INT; - external static GLenum get UNSIGNED_INT; - external static GLenum get FLOAT; - external static GLenum get DEPTH_COMPONENT; - external static GLenum get ALPHA; - external static GLenum get RGB; - external static GLenum get RGBA; - external static GLenum get LUMINANCE; - external static GLenum get LUMINANCE_ALPHA; - external static GLenum get UNSIGNED_SHORT_4_4_4_4; - external static GLenum get UNSIGNED_SHORT_5_5_5_1; - external static GLenum get UNSIGNED_SHORT_5_6_5; - external static GLenum get FRAGMENT_SHADER; - external static GLenum get VERTEX_SHADER; - external static GLenum get MAX_VERTEX_ATTRIBS; - external static GLenum get MAX_VERTEX_UNIFORM_VECTORS; - external static GLenum get MAX_VARYING_VECTORS; - external static GLenum get MAX_COMBINED_TEXTURE_IMAGE_UNITS; - external static GLenum get MAX_VERTEX_TEXTURE_IMAGE_UNITS; - external static GLenum get MAX_TEXTURE_IMAGE_UNITS; - external static GLenum get MAX_FRAGMENT_UNIFORM_VECTORS; - external static GLenum get SHADER_TYPE; - external static GLenum get DELETE_STATUS; - external static GLenum get LINK_STATUS; - external static GLenum get VALIDATE_STATUS; - external static GLenum get ATTACHED_SHADERS; - external static GLenum get ACTIVE_UNIFORMS; - external static GLenum get ACTIVE_ATTRIBUTES; - external static GLenum get SHADING_LANGUAGE_VERSION; - external static GLenum get CURRENT_PROGRAM; - external static GLenum get NEVER; - external static GLenum get LESS; - external static GLenum get EQUAL; - external static GLenum get LEQUAL; - external static GLenum get GREATER; - external static GLenum get NOTEQUAL; - external static GLenum get GEQUAL; - external static GLenum get ALWAYS; - external static GLenum get KEEP; - external static GLenum get REPLACE; - external static GLenum get INCR; - external static GLenum get DECR; - external static GLenum get INVERT; - external static GLenum get INCR_WRAP; - external static GLenum get DECR_WRAP; - external static GLenum get VENDOR; - external static GLenum get RENDERER; - external static GLenum get VERSION; - external static GLenum get NEAREST; - external static GLenum get LINEAR; - external static GLenum get NEAREST_MIPMAP_NEAREST; - external static GLenum get LINEAR_MIPMAP_NEAREST; - external static GLenum get NEAREST_MIPMAP_LINEAR; - external static GLenum get LINEAR_MIPMAP_LINEAR; - external static GLenum get TEXTURE_MAG_FILTER; - external static GLenum get TEXTURE_MIN_FILTER; - external static GLenum get TEXTURE_WRAP_S; - external static GLenum get TEXTURE_WRAP_T; - external static GLenum get TEXTURE_2D; - external static GLenum get TEXTURE; - external static GLenum get TEXTURE_CUBE_MAP; - external static GLenum get TEXTURE_BINDING_CUBE_MAP; - external static GLenum get TEXTURE_CUBE_MAP_POSITIVE_X; - external static GLenum get TEXTURE_CUBE_MAP_NEGATIVE_X; - external static GLenum get TEXTURE_CUBE_MAP_POSITIVE_Y; - external static GLenum get TEXTURE_CUBE_MAP_NEGATIVE_Y; - external static GLenum get TEXTURE_CUBE_MAP_POSITIVE_Z; - external static GLenum get TEXTURE_CUBE_MAP_NEGATIVE_Z; - external static GLenum get MAX_CUBE_MAP_TEXTURE_SIZE; - external static GLenum get TEXTURE0; - external static GLenum get TEXTURE1; - external static GLenum get TEXTURE2; - external static GLenum get TEXTURE3; - external static GLenum get TEXTURE4; - external static GLenum get TEXTURE5; - external static GLenum get TEXTURE6; - external static GLenum get TEXTURE7; - external static GLenum get TEXTURE8; - external static GLenum get TEXTURE9; - external static GLenum get TEXTURE10; - external static GLenum get TEXTURE11; - external static GLenum get TEXTURE12; - external static GLenum get TEXTURE13; - external static GLenum get TEXTURE14; - external static GLenum get TEXTURE15; - external static GLenum get TEXTURE16; - external static GLenum get TEXTURE17; - external static GLenum get TEXTURE18; - external static GLenum get TEXTURE19; - external static GLenum get TEXTURE20; - external static GLenum get TEXTURE21; - external static GLenum get TEXTURE22; - external static GLenum get TEXTURE23; - external static GLenum get TEXTURE24; - external static GLenum get TEXTURE25; - external static GLenum get TEXTURE26; - external static GLenum get TEXTURE27; - external static GLenum get TEXTURE28; - external static GLenum get TEXTURE29; - external static GLenum get TEXTURE30; - external static GLenum get TEXTURE31; - external static GLenum get ACTIVE_TEXTURE; - external static GLenum get REPEAT; - external static GLenum get CLAMP_TO_EDGE; - external static GLenum get MIRRORED_REPEAT; - external static GLenum get FLOAT_VEC2; - external static GLenum get FLOAT_VEC3; - external static GLenum get FLOAT_VEC4; - external static GLenum get INT_VEC2; - external static GLenum get INT_VEC3; - external static GLenum get INT_VEC4; - external static GLenum get BOOL; - external static GLenum get BOOL_VEC2; - external static GLenum get BOOL_VEC3; - external static GLenum get BOOL_VEC4; - external static GLenum get FLOAT_MAT2; - external static GLenum get FLOAT_MAT3; - external static GLenum get FLOAT_MAT4; - external static GLenum get SAMPLER_2D; - external static GLenum get SAMPLER_CUBE; - external static GLenum get VERTEX_ATTRIB_ARRAY_ENABLED; - external static GLenum get VERTEX_ATTRIB_ARRAY_SIZE; - external static GLenum get VERTEX_ATTRIB_ARRAY_STRIDE; - external static GLenum get VERTEX_ATTRIB_ARRAY_TYPE; - external static GLenum get VERTEX_ATTRIB_ARRAY_NORMALIZED; - external static GLenum get VERTEX_ATTRIB_ARRAY_POINTER; - external static GLenum get VERTEX_ATTRIB_ARRAY_BUFFER_BINDING; - external static GLenum get IMPLEMENTATION_COLOR_READ_TYPE; - external static GLenum get IMPLEMENTATION_COLOR_READ_FORMAT; - external static GLenum get COMPILE_STATUS; - external static GLenum get LOW_FLOAT; - external static GLenum get MEDIUM_FLOAT; - external static GLenum get HIGH_FLOAT; - external static GLenum get LOW_INT; - external static GLenum get MEDIUM_INT; - external static GLenum get HIGH_INT; - external static GLenum get FRAMEBUFFER; - external static GLenum get RENDERBUFFER; - external static GLenum get RGBA4; - external static GLenum get RGB5_A1; - external static GLenum get RGBA8; - external static GLenum get RGB565; - external static GLenum get DEPTH_COMPONENT16; - external static GLenum get STENCIL_INDEX8; - external static GLenum get DEPTH_STENCIL; - external static GLenum get RENDERBUFFER_WIDTH; - external static GLenum get RENDERBUFFER_HEIGHT; - external static GLenum get RENDERBUFFER_INTERNAL_FORMAT; - external static GLenum get RENDERBUFFER_RED_SIZE; - external static GLenum get RENDERBUFFER_GREEN_SIZE; - external static GLenum get RENDERBUFFER_BLUE_SIZE; - external static GLenum get RENDERBUFFER_ALPHA_SIZE; - external static GLenum get RENDERBUFFER_DEPTH_SIZE; - external static GLenum get RENDERBUFFER_STENCIL_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_OBJECT_NAME; - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL; - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE; - external static GLenum get COLOR_ATTACHMENT0; - external static GLenum get DEPTH_ATTACHMENT; - external static GLenum get STENCIL_ATTACHMENT; - external static GLenum get DEPTH_STENCIL_ATTACHMENT; - external static GLenum get NONE; - external static GLenum get FRAMEBUFFER_COMPLETE; - external static GLenum get FRAMEBUFFER_INCOMPLETE_ATTACHMENT; - external static GLenum get FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; - external static GLenum get FRAMEBUFFER_INCOMPLETE_DIMENSIONS; - external static GLenum get FRAMEBUFFER_UNSUPPORTED; - external static GLenum get FRAMEBUFFER_BINDING; - external static GLenum get RENDERBUFFER_BINDING; - external static GLenum get MAX_RENDERBUFFER_SIZE; - external static GLenum get INVALID_FRAMEBUFFER_OPERATION; - external static GLenum get UNPACK_FLIP_Y_WEBGL; - external static GLenum get UNPACK_PREMULTIPLY_ALPHA_WEBGL; - external static GLenum get CONTEXT_LOST_WEBGL; - external static GLenum get UNPACK_COLORSPACE_CONVERSION_WEBGL; - external static GLenum get BROWSER_DEFAULT_WEBGL; + static const GLenum DEPTH_BUFFER_BIT = 256; + + static const GLenum STENCIL_BUFFER_BIT = 1024; + + static const GLenum COLOR_BUFFER_BIT = 16384; + + static const GLenum POINTS = 0; + + static const GLenum LINES = 1; + + static const GLenum LINE_LOOP = 2; + + static const GLenum LINE_STRIP = 3; + + static const GLenum TRIANGLES = 4; + + static const GLenum TRIANGLE_STRIP = 5; + + static const GLenum TRIANGLE_FAN = 6; + + static const GLenum ZERO = 0; + + static const GLenum ONE = 1; + + static const GLenum SRC_COLOR = 768; + + static const GLenum ONE_MINUS_SRC_COLOR = 769; + + static const GLenum SRC_ALPHA = 770; + + static const GLenum ONE_MINUS_SRC_ALPHA = 771; + + static const GLenum DST_ALPHA = 772; + + static const GLenum ONE_MINUS_DST_ALPHA = 773; + + static const GLenum DST_COLOR = 774; + + static const GLenum ONE_MINUS_DST_COLOR = 775; + + static const GLenum SRC_ALPHA_SATURATE = 776; + + static const GLenum FUNC_ADD = 32774; + + static const GLenum BLEND_EQUATION = 32777; + + static const GLenum BLEND_EQUATION_RGB = 32777; + + static const GLenum BLEND_EQUATION_ALPHA = 34877; + + static const GLenum FUNC_SUBTRACT = 32778; + + static const GLenum FUNC_REVERSE_SUBTRACT = 32779; + + static const GLenum BLEND_DST_RGB = 32968; + + static const GLenum BLEND_SRC_RGB = 32969; + + static const GLenum BLEND_DST_ALPHA = 32970; + + static const GLenum BLEND_SRC_ALPHA = 32971; + + static const GLenum CONSTANT_COLOR = 32769; + + static const GLenum ONE_MINUS_CONSTANT_COLOR = 32770; + + static const GLenum CONSTANT_ALPHA = 32771; + + static const GLenum ONE_MINUS_CONSTANT_ALPHA = 32772; + + static const GLenum BLEND_COLOR = 32773; + + static const GLenum ARRAY_BUFFER = 34962; + + static const GLenum ELEMENT_ARRAY_BUFFER = 34963; + + static const GLenum ARRAY_BUFFER_BINDING = 34964; + + static const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 34965; + + static const GLenum STREAM_DRAW = 35040; + + static const GLenum STATIC_DRAW = 35044; + + static const GLenum DYNAMIC_DRAW = 35048; + + static const GLenum BUFFER_SIZE = 34660; + + static const GLenum BUFFER_USAGE = 34661; + + static const GLenum CURRENT_VERTEX_ATTRIB = 34342; + + static const GLenum FRONT = 1028; + + static const GLenum BACK = 1029; + + static const GLenum FRONT_AND_BACK = 1032; + + static const GLenum CULL_FACE = 2884; + + static const GLenum BLEND = 3042; + + static const GLenum DITHER = 3024; + + static const GLenum STENCIL_TEST = 2960; + + static const GLenum DEPTH_TEST = 2929; + + static const GLenum SCISSOR_TEST = 3089; + + static const GLenum POLYGON_OFFSET_FILL = 32823; + + static const GLenum SAMPLE_ALPHA_TO_COVERAGE = 32926; + + static const GLenum SAMPLE_COVERAGE = 32928; + + static const GLenum NO_ERROR = 0; + + static const GLenum INVALID_ENUM = 1280; + + static const GLenum INVALID_VALUE = 1281; + + static const GLenum INVALID_OPERATION = 1282; + + static const GLenum OUT_OF_MEMORY = 1285; + + static const GLenum CW = 2304; + + static const GLenum CCW = 2305; + + static const GLenum LINE_WIDTH = 2849; + + static const GLenum ALIASED_POINT_SIZE_RANGE = 33901; + + static const GLenum ALIASED_LINE_WIDTH_RANGE = 33902; + + static const GLenum CULL_FACE_MODE = 2885; + + static const GLenum FRONT_FACE = 2886; + + static const GLenum DEPTH_RANGE = 2928; + + static const GLenum DEPTH_WRITEMASK = 2930; + + static const GLenum DEPTH_CLEAR_VALUE = 2931; + + static const GLenum DEPTH_FUNC = 2932; + + static const GLenum STENCIL_CLEAR_VALUE = 2961; + + static const GLenum STENCIL_FUNC = 2962; + + static const GLenum STENCIL_FAIL = 2964; + + static const GLenum STENCIL_PASS_DEPTH_FAIL = 2965; + + static const GLenum STENCIL_PASS_DEPTH_PASS = 2966; + + static const GLenum STENCIL_REF = 2967; + + static const GLenum STENCIL_VALUE_MASK = 2963; + + static const GLenum STENCIL_WRITEMASK = 2968; + + static const GLenum STENCIL_BACK_FUNC = 34816; + + static const GLenum STENCIL_BACK_FAIL = 34817; + + static const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 34818; + + static const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 34819; + + static const GLenum STENCIL_BACK_REF = 36003; + + static const GLenum STENCIL_BACK_VALUE_MASK = 36004; + + static const GLenum STENCIL_BACK_WRITEMASK = 36005; + + static const GLenum VIEWPORT = 2978; + + static const GLenum SCISSOR_BOX = 3088; + + static const GLenum COLOR_CLEAR_VALUE = 3106; + + static const GLenum COLOR_WRITEMASK = 3107; + + static const GLenum UNPACK_ALIGNMENT = 3317; + + static const GLenum PACK_ALIGNMENT = 3333; + + static const GLenum MAX_TEXTURE_SIZE = 3379; + + static const GLenum MAX_VIEWPORT_DIMS = 3386; + + static const GLenum SUBPIXEL_BITS = 3408; + + static const GLenum RED_BITS = 3410; + + static const GLenum GREEN_BITS = 3411; + + static const GLenum BLUE_BITS = 3412; + + static const GLenum ALPHA_BITS = 3413; + + static const GLenum DEPTH_BITS = 3414; + + static const GLenum STENCIL_BITS = 3415; + + static const GLenum POLYGON_OFFSET_UNITS = 10752; + + static const GLenum POLYGON_OFFSET_FACTOR = 32824; + + static const GLenum TEXTURE_BINDING_2D = 32873; + + static const GLenum SAMPLE_BUFFERS = 32936; + + static const GLenum SAMPLES = 32937; + + static const GLenum SAMPLE_COVERAGE_VALUE = 32938; + + static const GLenum SAMPLE_COVERAGE_INVERT = 32939; + + static const GLenum COMPRESSED_TEXTURE_FORMATS = 34467; + + static const GLenum DONT_CARE = 4352; + + static const GLenum FASTEST = 4353; + + static const GLenum NICEST = 4354; + + static const GLenum GENERATE_MIPMAP_HINT = 33170; + + static const GLenum BYTE = 5120; + + static const GLenum UNSIGNED_BYTE = 5121; + + static const GLenum SHORT = 5122; + + static const GLenum UNSIGNED_SHORT = 5123; + + static const GLenum INT = 5124; + + static const GLenum UNSIGNED_INT = 5125; + + static const GLenum FLOAT = 5126; + + static const GLenum DEPTH_COMPONENT = 6402; + + static const GLenum ALPHA = 6406; + + static const GLenum RGB = 6407; + + static const GLenum RGBA = 6408; + + static const GLenum LUMINANCE = 6409; + + static const GLenum LUMINANCE_ALPHA = 6410; + + static const GLenum UNSIGNED_SHORT_4_4_4_4 = 32819; + + static const GLenum UNSIGNED_SHORT_5_5_5_1 = 32820; + + static const GLenum UNSIGNED_SHORT_5_6_5 = 33635; + + static const GLenum FRAGMENT_SHADER = 35632; + + static const GLenum VERTEX_SHADER = 35633; + + static const GLenum MAX_VERTEX_ATTRIBS = 34921; + + static const GLenum MAX_VERTEX_UNIFORM_VECTORS = 36347; + + static const GLenum MAX_VARYING_VECTORS = 36348; + + static const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661; + + static const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660; + + static const GLenum MAX_TEXTURE_IMAGE_UNITS = 34930; + + static const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 36349; + + static const GLenum SHADER_TYPE = 35663; + + static const GLenum DELETE_STATUS = 35712; + + static const GLenum LINK_STATUS = 35714; + + static const GLenum VALIDATE_STATUS = 35715; + + static const GLenum ATTACHED_SHADERS = 35717; + + static const GLenum ACTIVE_UNIFORMS = 35718; + + static const GLenum ACTIVE_ATTRIBUTES = 35721; + + static const GLenum SHADING_LANGUAGE_VERSION = 35724; + + static const GLenum CURRENT_PROGRAM = 35725; + + static const GLenum NEVER = 512; + + static const GLenum LESS = 513; + + static const GLenum EQUAL = 514; + + static const GLenum LEQUAL = 515; + + static const GLenum GREATER = 516; + + static const GLenum NOTEQUAL = 517; + + static const GLenum GEQUAL = 518; + + static const GLenum ALWAYS = 519; + + static const GLenum KEEP = 7680; + + static const GLenum REPLACE = 7681; + + static const GLenum INCR = 7682; + + static const GLenum DECR = 7683; + + static const GLenum INVERT = 5386; + + static const GLenum INCR_WRAP = 34055; + + static const GLenum DECR_WRAP = 34056; + + static const GLenum VENDOR = 7936; + + static const GLenum RENDERER = 7937; + + static const GLenum VERSION = 7938; + + static const GLenum NEAREST = 9728; + + static const GLenum LINEAR = 9729; + + static const GLenum NEAREST_MIPMAP_NEAREST = 9984; + + static const GLenum LINEAR_MIPMAP_NEAREST = 9985; + + static const GLenum NEAREST_MIPMAP_LINEAR = 9986; + + static const GLenum LINEAR_MIPMAP_LINEAR = 9987; + + static const GLenum TEXTURE_MAG_FILTER = 10240; + + static const GLenum TEXTURE_MIN_FILTER = 10241; + + static const GLenum TEXTURE_WRAP_S = 10242; + + static const GLenum TEXTURE_WRAP_T = 10243; + + static const GLenum TEXTURE_2D = 3553; + + static const GLenum TEXTURE = 5890; + + static const GLenum TEXTURE_CUBE_MAP = 34067; + + static const GLenum TEXTURE_BINDING_CUBE_MAP = 34068; + + static const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 34069; + + static const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 34070; + + static const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 34071; + + static const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072; + + static const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 34073; + + static const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074; + + static const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 34076; + + static const GLenum TEXTURE0 = 33984; + + static const GLenum TEXTURE1 = 33985; + + static const GLenum TEXTURE2 = 33986; + + static const GLenum TEXTURE3 = 33987; + + static const GLenum TEXTURE4 = 33988; + + static const GLenum TEXTURE5 = 33989; + + static const GLenum TEXTURE6 = 33990; + + static const GLenum TEXTURE7 = 33991; + + static const GLenum TEXTURE8 = 33992; + + static const GLenum TEXTURE9 = 33993; + + static const GLenum TEXTURE10 = 33994; + + static const GLenum TEXTURE11 = 33995; + + static const GLenum TEXTURE12 = 33996; + + static const GLenum TEXTURE13 = 33997; + + static const GLenum TEXTURE14 = 33998; + + static const GLenum TEXTURE15 = 33999; + + static const GLenum TEXTURE16 = 34000; + + static const GLenum TEXTURE17 = 34001; + + static const GLenum TEXTURE18 = 34002; + + static const GLenum TEXTURE19 = 34003; + + static const GLenum TEXTURE20 = 34004; + + static const GLenum TEXTURE21 = 34005; + + static const GLenum TEXTURE22 = 34006; + + static const GLenum TEXTURE23 = 34007; + + static const GLenum TEXTURE24 = 34008; + + static const GLenum TEXTURE25 = 34009; + + static const GLenum TEXTURE26 = 34010; + + static const GLenum TEXTURE27 = 34011; + + static const GLenum TEXTURE28 = 34012; + + static const GLenum TEXTURE29 = 34013; + + static const GLenum TEXTURE30 = 34014; + + static const GLenum TEXTURE31 = 34015; + + static const GLenum ACTIVE_TEXTURE = 34016; + + static const GLenum REPEAT = 10497; + + static const GLenum CLAMP_TO_EDGE = 33071; + + static const GLenum MIRRORED_REPEAT = 33648; + + static const GLenum FLOAT_VEC2 = 35664; + + static const GLenum FLOAT_VEC3 = 35665; + + static const GLenum FLOAT_VEC4 = 35666; + + static const GLenum INT_VEC2 = 35667; + + static const GLenum INT_VEC3 = 35668; + + static const GLenum INT_VEC4 = 35669; + + static const GLenum BOOL = 35670; + + static const GLenum BOOL_VEC2 = 35671; + + static const GLenum BOOL_VEC3 = 35672; + + static const GLenum BOOL_VEC4 = 35673; + + static const GLenum FLOAT_MAT2 = 35674; + + static const GLenum FLOAT_MAT3 = 35675; + + static const GLenum FLOAT_MAT4 = 35676; + + static const GLenum SAMPLER_2D = 35678; + + static const GLenum SAMPLER_CUBE = 35680; + + static const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 34338; + + static const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 34339; + + static const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 34340; + + static const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 34341; + + static const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922; + + static const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 34373; + + static const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975; + + static const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 35738; + + static const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 35739; + + static const GLenum COMPILE_STATUS = 35713; + + static const GLenum LOW_FLOAT = 36336; + + static const GLenum MEDIUM_FLOAT = 36337; + + static const GLenum HIGH_FLOAT = 36338; + + static const GLenum LOW_INT = 36339; + + static const GLenum MEDIUM_INT = 36340; + + static const GLenum HIGH_INT = 36341; + + static const GLenum FRAMEBUFFER = 36160; + + static const GLenum RENDERBUFFER = 36161; + + static const GLenum RGBA4 = 32854; + + static const GLenum RGB5_A1 = 32855; + + static const GLenum RGBA8 = 32856; + + static const GLenum RGB565 = 36194; + + static const GLenum DEPTH_COMPONENT16 = 33189; + + static const GLenum STENCIL_INDEX8 = 36168; + + static const GLenum DEPTH_STENCIL = 34041; + + static const GLenum RENDERBUFFER_WIDTH = 36162; + + static const GLenum RENDERBUFFER_HEIGHT = 36163; + + static const GLenum RENDERBUFFER_INTERNAL_FORMAT = 36164; + + static const GLenum RENDERBUFFER_RED_SIZE = 36176; + + static const GLenum RENDERBUFFER_GREEN_SIZE = 36177; + + static const GLenum RENDERBUFFER_BLUE_SIZE = 36178; + + static const GLenum RENDERBUFFER_ALPHA_SIZE = 36179; + + static const GLenum RENDERBUFFER_DEPTH_SIZE = 36180; + + static const GLenum RENDERBUFFER_STENCIL_SIZE = 36181; + + static const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048; + + static const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049; + + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050; + + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051; + + static const GLenum COLOR_ATTACHMENT0 = 36064; + + static const GLenum DEPTH_ATTACHMENT = 36096; + + static const GLenum STENCIL_ATTACHMENT = 36128; + + static const GLenum DEPTH_STENCIL_ATTACHMENT = 33306; + + static const GLenum NONE = 0; + + static const GLenum FRAMEBUFFER_COMPLETE = 36053; + + static const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054; + + static const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055; + + static const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057; + + static const GLenum FRAMEBUFFER_UNSUPPORTED = 36061; + + static const GLenum FRAMEBUFFER_BINDING = 36006; + + static const GLenum RENDERBUFFER_BINDING = 36007; + + static const GLenum MAX_RENDERBUFFER_SIZE = 34024; + + static const GLenum INVALID_FRAMEBUFFER_OPERATION = 1286; + + static const GLenum UNPACK_FLIP_Y_WEBGL = 37440; + + static const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441; + + static const GLenum CONTEXT_LOST_WEBGL = 37442; + + static const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443; + + static const GLenum BROWSER_DEFAULT_WEBGL = 37444; /// The **`WebGLRenderingContext.getContextAttributes()`** method /// returns a `WebGLContextAttributes` object that contains the actual context diff --git a/web/lib/src/dom/webgl2.dart b/web/lib/src/dom/webgl2.dart index d9d9a297..8ca9a843 100644 --- a/web/lib/src/dom/webgl2.dart +++ b/web/lib/src/dom/webgl2.dart @@ -163,565 +163,1124 @@ extension type WebGLVertexArrayObject._(JSObject _) implements JSObject {} /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext). extension type WebGL2RenderingContext._(JSObject _) implements JSObject { - external static GLenum get DEPTH_BUFFER_BIT; - external static GLenum get STENCIL_BUFFER_BIT; - external static GLenum get COLOR_BUFFER_BIT; - external static GLenum get POINTS; - external static GLenum get LINES; - external static GLenum get LINE_LOOP; - external static GLenum get LINE_STRIP; - external static GLenum get TRIANGLES; - external static GLenum get TRIANGLE_STRIP; - external static GLenum get TRIANGLE_FAN; - external static GLenum get ZERO; - external static GLenum get ONE; - external static GLenum get SRC_COLOR; - external static GLenum get ONE_MINUS_SRC_COLOR; - external static GLenum get SRC_ALPHA; - external static GLenum get ONE_MINUS_SRC_ALPHA; - external static GLenum get DST_ALPHA; - external static GLenum get ONE_MINUS_DST_ALPHA; - external static GLenum get DST_COLOR; - external static GLenum get ONE_MINUS_DST_COLOR; - external static GLenum get SRC_ALPHA_SATURATE; - external static GLenum get FUNC_ADD; - external static GLenum get BLEND_EQUATION; - external static GLenum get BLEND_EQUATION_RGB; - external static GLenum get BLEND_EQUATION_ALPHA; - external static GLenum get FUNC_SUBTRACT; - external static GLenum get FUNC_REVERSE_SUBTRACT; - external static GLenum get BLEND_DST_RGB; - external static GLenum get BLEND_SRC_RGB; - external static GLenum get BLEND_DST_ALPHA; - external static GLenum get BLEND_SRC_ALPHA; - external static GLenum get CONSTANT_COLOR; - external static GLenum get ONE_MINUS_CONSTANT_COLOR; - external static GLenum get CONSTANT_ALPHA; - external static GLenum get ONE_MINUS_CONSTANT_ALPHA; - external static GLenum get BLEND_COLOR; - external static GLenum get ARRAY_BUFFER; - external static GLenum get ELEMENT_ARRAY_BUFFER; - external static GLenum get ARRAY_BUFFER_BINDING; - external static GLenum get ELEMENT_ARRAY_BUFFER_BINDING; - external static GLenum get STREAM_DRAW; - external static GLenum get STATIC_DRAW; - external static GLenum get DYNAMIC_DRAW; - external static GLenum get BUFFER_SIZE; - external static GLenum get BUFFER_USAGE; - external static GLenum get CURRENT_VERTEX_ATTRIB; - external static GLenum get FRONT; - external static GLenum get BACK; - external static GLenum get FRONT_AND_BACK; - external static GLenum get CULL_FACE; - external static GLenum get BLEND; - external static GLenum get DITHER; - external static GLenum get STENCIL_TEST; - external static GLenum get DEPTH_TEST; - external static GLenum get SCISSOR_TEST; - external static GLenum get POLYGON_OFFSET_FILL; - external static GLenum get SAMPLE_ALPHA_TO_COVERAGE; - external static GLenum get SAMPLE_COVERAGE; - external static GLenum get NO_ERROR; - external static GLenum get INVALID_ENUM; - external static GLenum get INVALID_VALUE; - external static GLenum get INVALID_OPERATION; - external static GLenum get OUT_OF_MEMORY; - external static GLenum get CW; - external static GLenum get CCW; - external static GLenum get LINE_WIDTH; - external static GLenum get ALIASED_POINT_SIZE_RANGE; - external static GLenum get ALIASED_LINE_WIDTH_RANGE; - external static GLenum get CULL_FACE_MODE; - external static GLenum get FRONT_FACE; - external static GLenum get DEPTH_RANGE; - external static GLenum get DEPTH_WRITEMASK; - external static GLenum get DEPTH_CLEAR_VALUE; - external static GLenum get DEPTH_FUNC; - external static GLenum get STENCIL_CLEAR_VALUE; - external static GLenum get STENCIL_FUNC; - external static GLenum get STENCIL_FAIL; - external static GLenum get STENCIL_PASS_DEPTH_FAIL; - external static GLenum get STENCIL_PASS_DEPTH_PASS; - external static GLenum get STENCIL_REF; - external static GLenum get STENCIL_VALUE_MASK; - external static GLenum get STENCIL_WRITEMASK; - external static GLenum get STENCIL_BACK_FUNC; - external static GLenum get STENCIL_BACK_FAIL; - external static GLenum get STENCIL_BACK_PASS_DEPTH_FAIL; - external static GLenum get STENCIL_BACK_PASS_DEPTH_PASS; - external static GLenum get STENCIL_BACK_REF; - external static GLenum get STENCIL_BACK_VALUE_MASK; - external static GLenum get STENCIL_BACK_WRITEMASK; - external static GLenum get VIEWPORT; - external static GLenum get SCISSOR_BOX; - external static GLenum get COLOR_CLEAR_VALUE; - external static GLenum get COLOR_WRITEMASK; - external static GLenum get UNPACK_ALIGNMENT; - external static GLenum get PACK_ALIGNMENT; - external static GLenum get MAX_TEXTURE_SIZE; - external static GLenum get MAX_VIEWPORT_DIMS; - external static GLenum get SUBPIXEL_BITS; - external static GLenum get RED_BITS; - external static GLenum get GREEN_BITS; - external static GLenum get BLUE_BITS; - external static GLenum get ALPHA_BITS; - external static GLenum get DEPTH_BITS; - external static GLenum get STENCIL_BITS; - external static GLenum get POLYGON_OFFSET_UNITS; - external static GLenum get POLYGON_OFFSET_FACTOR; - external static GLenum get TEXTURE_BINDING_2D; - external static GLenum get SAMPLE_BUFFERS; - external static GLenum get SAMPLES; - external static GLenum get SAMPLE_COVERAGE_VALUE; - external static GLenum get SAMPLE_COVERAGE_INVERT; - external static GLenum get COMPRESSED_TEXTURE_FORMATS; - external static GLenum get DONT_CARE; - external static GLenum get FASTEST; - external static GLenum get NICEST; - external static GLenum get GENERATE_MIPMAP_HINT; - external static GLenum get BYTE; - external static GLenum get UNSIGNED_BYTE; - external static GLenum get SHORT; - external static GLenum get UNSIGNED_SHORT; - external static GLenum get INT; - external static GLenum get UNSIGNED_INT; - external static GLenum get FLOAT; - external static GLenum get DEPTH_COMPONENT; - external static GLenum get ALPHA; - external static GLenum get RGB; - external static GLenum get RGBA; - external static GLenum get LUMINANCE; - external static GLenum get LUMINANCE_ALPHA; - external static GLenum get UNSIGNED_SHORT_4_4_4_4; - external static GLenum get UNSIGNED_SHORT_5_5_5_1; - external static GLenum get UNSIGNED_SHORT_5_6_5; - external static GLenum get FRAGMENT_SHADER; - external static GLenum get VERTEX_SHADER; - external static GLenum get MAX_VERTEX_ATTRIBS; - external static GLenum get MAX_VERTEX_UNIFORM_VECTORS; - external static GLenum get MAX_VARYING_VECTORS; - external static GLenum get MAX_COMBINED_TEXTURE_IMAGE_UNITS; - external static GLenum get MAX_VERTEX_TEXTURE_IMAGE_UNITS; - external static GLenum get MAX_TEXTURE_IMAGE_UNITS; - external static GLenum get MAX_FRAGMENT_UNIFORM_VECTORS; - external static GLenum get SHADER_TYPE; - external static GLenum get DELETE_STATUS; - external static GLenum get LINK_STATUS; - external static GLenum get VALIDATE_STATUS; - external static GLenum get ATTACHED_SHADERS; - external static GLenum get ACTIVE_UNIFORMS; - external static GLenum get ACTIVE_ATTRIBUTES; - external static GLenum get SHADING_LANGUAGE_VERSION; - external static GLenum get CURRENT_PROGRAM; - external static GLenum get NEVER; - external static GLenum get LESS; - external static GLenum get EQUAL; - external static GLenum get LEQUAL; - external static GLenum get GREATER; - external static GLenum get NOTEQUAL; - external static GLenum get GEQUAL; - external static GLenum get ALWAYS; - external static GLenum get KEEP; - external static GLenum get REPLACE; - external static GLenum get INCR; - external static GLenum get DECR; - external static GLenum get INVERT; - external static GLenum get INCR_WRAP; - external static GLenum get DECR_WRAP; - external static GLenum get VENDOR; - external static GLenum get RENDERER; - external static GLenum get VERSION; - external static GLenum get NEAREST; - external static GLenum get LINEAR; - external static GLenum get NEAREST_MIPMAP_NEAREST; - external static GLenum get LINEAR_MIPMAP_NEAREST; - external static GLenum get NEAREST_MIPMAP_LINEAR; - external static GLenum get LINEAR_MIPMAP_LINEAR; - external static GLenum get TEXTURE_MAG_FILTER; - external static GLenum get TEXTURE_MIN_FILTER; - external static GLenum get TEXTURE_WRAP_S; - external static GLenum get TEXTURE_WRAP_T; - external static GLenum get TEXTURE_2D; - external static GLenum get TEXTURE; - external static GLenum get TEXTURE_CUBE_MAP; - external static GLenum get TEXTURE_BINDING_CUBE_MAP; - external static GLenum get TEXTURE_CUBE_MAP_POSITIVE_X; - external static GLenum get TEXTURE_CUBE_MAP_NEGATIVE_X; - external static GLenum get TEXTURE_CUBE_MAP_POSITIVE_Y; - external static GLenum get TEXTURE_CUBE_MAP_NEGATIVE_Y; - external static GLenum get TEXTURE_CUBE_MAP_POSITIVE_Z; - external static GLenum get TEXTURE_CUBE_MAP_NEGATIVE_Z; - external static GLenum get MAX_CUBE_MAP_TEXTURE_SIZE; - external static GLenum get TEXTURE0; - external static GLenum get TEXTURE1; - external static GLenum get TEXTURE2; - external static GLenum get TEXTURE3; - external static GLenum get TEXTURE4; - external static GLenum get TEXTURE5; - external static GLenum get TEXTURE6; - external static GLenum get TEXTURE7; - external static GLenum get TEXTURE8; - external static GLenum get TEXTURE9; - external static GLenum get TEXTURE10; - external static GLenum get TEXTURE11; - external static GLenum get TEXTURE12; - external static GLenum get TEXTURE13; - external static GLenum get TEXTURE14; - external static GLenum get TEXTURE15; - external static GLenum get TEXTURE16; - external static GLenum get TEXTURE17; - external static GLenum get TEXTURE18; - external static GLenum get TEXTURE19; - external static GLenum get TEXTURE20; - external static GLenum get TEXTURE21; - external static GLenum get TEXTURE22; - external static GLenum get TEXTURE23; - external static GLenum get TEXTURE24; - external static GLenum get TEXTURE25; - external static GLenum get TEXTURE26; - external static GLenum get TEXTURE27; - external static GLenum get TEXTURE28; - external static GLenum get TEXTURE29; - external static GLenum get TEXTURE30; - external static GLenum get TEXTURE31; - external static GLenum get ACTIVE_TEXTURE; - external static GLenum get REPEAT; - external static GLenum get CLAMP_TO_EDGE; - external static GLenum get MIRRORED_REPEAT; - external static GLenum get FLOAT_VEC2; - external static GLenum get FLOAT_VEC3; - external static GLenum get FLOAT_VEC4; - external static GLenum get INT_VEC2; - external static GLenum get INT_VEC3; - external static GLenum get INT_VEC4; - external static GLenum get BOOL; - external static GLenum get BOOL_VEC2; - external static GLenum get BOOL_VEC3; - external static GLenum get BOOL_VEC4; - external static GLenum get FLOAT_MAT2; - external static GLenum get FLOAT_MAT3; - external static GLenum get FLOAT_MAT4; - external static GLenum get SAMPLER_2D; - external static GLenum get SAMPLER_CUBE; - external static GLenum get VERTEX_ATTRIB_ARRAY_ENABLED; - external static GLenum get VERTEX_ATTRIB_ARRAY_SIZE; - external static GLenum get VERTEX_ATTRIB_ARRAY_STRIDE; - external static GLenum get VERTEX_ATTRIB_ARRAY_TYPE; - external static GLenum get VERTEX_ATTRIB_ARRAY_NORMALIZED; - external static GLenum get VERTEX_ATTRIB_ARRAY_POINTER; - external static GLenum get VERTEX_ATTRIB_ARRAY_BUFFER_BINDING; - external static GLenum get IMPLEMENTATION_COLOR_READ_TYPE; - external static GLenum get IMPLEMENTATION_COLOR_READ_FORMAT; - external static GLenum get COMPILE_STATUS; - external static GLenum get LOW_FLOAT; - external static GLenum get MEDIUM_FLOAT; - external static GLenum get HIGH_FLOAT; - external static GLenum get LOW_INT; - external static GLenum get MEDIUM_INT; - external static GLenum get HIGH_INT; - external static GLenum get FRAMEBUFFER; - external static GLenum get RENDERBUFFER; - external static GLenum get RGBA4; - external static GLenum get RGB5_A1; - external static GLenum get RGBA8; - external static GLenum get RGB565; - external static GLenum get DEPTH_COMPONENT16; - external static GLenum get STENCIL_INDEX8; - external static GLenum get DEPTH_STENCIL; - external static GLenum get RENDERBUFFER_WIDTH; - external static GLenum get RENDERBUFFER_HEIGHT; - external static GLenum get RENDERBUFFER_INTERNAL_FORMAT; - external static GLenum get RENDERBUFFER_RED_SIZE; - external static GLenum get RENDERBUFFER_GREEN_SIZE; - external static GLenum get RENDERBUFFER_BLUE_SIZE; - external static GLenum get RENDERBUFFER_ALPHA_SIZE; - external static GLenum get RENDERBUFFER_DEPTH_SIZE; - external static GLenum get RENDERBUFFER_STENCIL_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_OBJECT_NAME; - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL; - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE; - external static GLenum get COLOR_ATTACHMENT0; - external static GLenum get DEPTH_ATTACHMENT; - external static GLenum get STENCIL_ATTACHMENT; - external static GLenum get DEPTH_STENCIL_ATTACHMENT; - external static GLenum get NONE; - external static GLenum get FRAMEBUFFER_COMPLETE; - external static GLenum get FRAMEBUFFER_INCOMPLETE_ATTACHMENT; - external static GLenum get FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; - external static GLenum get FRAMEBUFFER_INCOMPLETE_DIMENSIONS; - external static GLenum get FRAMEBUFFER_UNSUPPORTED; - external static GLenum get FRAMEBUFFER_BINDING; - external static GLenum get RENDERBUFFER_BINDING; - external static GLenum get MAX_RENDERBUFFER_SIZE; - external static GLenum get INVALID_FRAMEBUFFER_OPERATION; - external static GLenum get UNPACK_FLIP_Y_WEBGL; - external static GLenum get UNPACK_PREMULTIPLY_ALPHA_WEBGL; - external static GLenum get CONTEXT_LOST_WEBGL; - external static GLenum get UNPACK_COLORSPACE_CONVERSION_WEBGL; - external static GLenum get BROWSER_DEFAULT_WEBGL; - external static GLenum get READ_BUFFER; - external static GLenum get UNPACK_ROW_LENGTH; - external static GLenum get UNPACK_SKIP_ROWS; - external static GLenum get UNPACK_SKIP_PIXELS; - external static GLenum get PACK_ROW_LENGTH; - external static GLenum get PACK_SKIP_ROWS; - external static GLenum get PACK_SKIP_PIXELS; - external static GLenum get COLOR; - external static GLenum get DEPTH; - external static GLenum get STENCIL; - external static GLenum get RED; - external static GLenum get RGB8; - external static GLenum get RGB10_A2; - external static GLenum get TEXTURE_BINDING_3D; - external static GLenum get UNPACK_SKIP_IMAGES; - external static GLenum get UNPACK_IMAGE_HEIGHT; - external static GLenum get TEXTURE_3D; - external static GLenum get TEXTURE_WRAP_R; - external static GLenum get MAX_3D_TEXTURE_SIZE; - external static GLenum get UNSIGNED_INT_2_10_10_10_REV; - external static GLenum get MAX_ELEMENTS_VERTICES; - external static GLenum get MAX_ELEMENTS_INDICES; - external static GLenum get TEXTURE_MIN_LOD; - external static GLenum get TEXTURE_MAX_LOD; - external static GLenum get TEXTURE_BASE_LEVEL; - external static GLenum get TEXTURE_MAX_LEVEL; - external static GLenum get MIN; - external static GLenum get MAX; - external static GLenum get DEPTH_COMPONENT24; - external static GLenum get MAX_TEXTURE_LOD_BIAS; - external static GLenum get TEXTURE_COMPARE_MODE; - external static GLenum get TEXTURE_COMPARE_FUNC; - external static GLenum get CURRENT_QUERY; - external static GLenum get QUERY_RESULT; - external static GLenum get QUERY_RESULT_AVAILABLE; - external static GLenum get STREAM_READ; - external static GLenum get STREAM_COPY; - external static GLenum get STATIC_READ; - external static GLenum get STATIC_COPY; - external static GLenum get DYNAMIC_READ; - external static GLenum get DYNAMIC_COPY; - external static GLenum get MAX_DRAW_BUFFERS; - external static GLenum get DRAW_BUFFER0; - external static GLenum get DRAW_BUFFER1; - external static GLenum get DRAW_BUFFER2; - external static GLenum get DRAW_BUFFER3; - external static GLenum get DRAW_BUFFER4; - external static GLenum get DRAW_BUFFER5; - external static GLenum get DRAW_BUFFER6; - external static GLenum get DRAW_BUFFER7; - external static GLenum get DRAW_BUFFER8; - external static GLenum get DRAW_BUFFER9; - external static GLenum get DRAW_BUFFER10; - external static GLenum get DRAW_BUFFER11; - external static GLenum get DRAW_BUFFER12; - external static GLenum get DRAW_BUFFER13; - external static GLenum get DRAW_BUFFER14; - external static GLenum get DRAW_BUFFER15; - external static GLenum get MAX_FRAGMENT_UNIFORM_COMPONENTS; - external static GLenum get MAX_VERTEX_UNIFORM_COMPONENTS; - external static GLenum get SAMPLER_3D; - external static GLenum get SAMPLER_2D_SHADOW; - external static GLenum get FRAGMENT_SHADER_DERIVATIVE_HINT; - external static GLenum get PIXEL_PACK_BUFFER; - external static GLenum get PIXEL_UNPACK_BUFFER; - external static GLenum get PIXEL_PACK_BUFFER_BINDING; - external static GLenum get PIXEL_UNPACK_BUFFER_BINDING; - external static GLenum get FLOAT_MAT2x3; - external static GLenum get FLOAT_MAT2x4; - external static GLenum get FLOAT_MAT3x2; - external static GLenum get FLOAT_MAT3x4; - external static GLenum get FLOAT_MAT4x2; - external static GLenum get FLOAT_MAT4x3; - external static GLenum get SRGB; - external static GLenum get SRGB8; - external static GLenum get SRGB8_ALPHA8; - external static GLenum get COMPARE_REF_TO_TEXTURE; - external static GLenum get RGBA32F; - external static GLenum get RGB32F; - external static GLenum get RGBA16F; - external static GLenum get RGB16F; - external static GLenum get VERTEX_ATTRIB_ARRAY_INTEGER; - external static GLenum get MAX_ARRAY_TEXTURE_LAYERS; - external static GLenum get MIN_PROGRAM_TEXEL_OFFSET; - external static GLenum get MAX_PROGRAM_TEXEL_OFFSET; - external static GLenum get MAX_VARYING_COMPONENTS; - external static GLenum get TEXTURE_2D_ARRAY; - external static GLenum get TEXTURE_BINDING_2D_ARRAY; - external static GLenum get R11F_G11F_B10F; - external static GLenum get UNSIGNED_INT_10F_11F_11F_REV; - external static GLenum get RGB9_E5; - external static GLenum get UNSIGNED_INT_5_9_9_9_REV; - external static GLenum get TRANSFORM_FEEDBACK_BUFFER_MODE; - external static GLenum get MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS; - external static GLenum get TRANSFORM_FEEDBACK_VARYINGS; - external static GLenum get TRANSFORM_FEEDBACK_BUFFER_START; - external static GLenum get TRANSFORM_FEEDBACK_BUFFER_SIZE; - external static GLenum get TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN; - external static GLenum get RASTERIZER_DISCARD; - external static GLenum get MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; - external static GLenum get MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS; - external static GLenum get INTERLEAVED_ATTRIBS; - external static GLenum get SEPARATE_ATTRIBS; - external static GLenum get TRANSFORM_FEEDBACK_BUFFER; - external static GLenum get TRANSFORM_FEEDBACK_BUFFER_BINDING; - external static GLenum get RGBA32UI; - external static GLenum get RGB32UI; - external static GLenum get RGBA16UI; - external static GLenum get RGB16UI; - external static GLenum get RGBA8UI; - external static GLenum get RGB8UI; - external static GLenum get RGBA32I; - external static GLenum get RGB32I; - external static GLenum get RGBA16I; - external static GLenum get RGB16I; - external static GLenum get RGBA8I; - external static GLenum get RGB8I; - external static GLenum get RED_INTEGER; - external static GLenum get RGB_INTEGER; - external static GLenum get RGBA_INTEGER; - external static GLenum get SAMPLER_2D_ARRAY; - external static GLenum get SAMPLER_2D_ARRAY_SHADOW; - external static GLenum get SAMPLER_CUBE_SHADOW; - external static GLenum get UNSIGNED_INT_VEC2; - external static GLenum get UNSIGNED_INT_VEC3; - external static GLenum get UNSIGNED_INT_VEC4; - external static GLenum get INT_SAMPLER_2D; - external static GLenum get INT_SAMPLER_3D; - external static GLenum get INT_SAMPLER_CUBE; - external static GLenum get INT_SAMPLER_2D_ARRAY; - external static GLenum get UNSIGNED_INT_SAMPLER_2D; - external static GLenum get UNSIGNED_INT_SAMPLER_3D; - external static GLenum get UNSIGNED_INT_SAMPLER_CUBE; - external static GLenum get UNSIGNED_INT_SAMPLER_2D_ARRAY; - external static GLenum get DEPTH_COMPONENT32F; - external static GLenum get DEPTH32F_STENCIL8; - external static GLenum get FLOAT_32_UNSIGNED_INT_24_8_REV; - external static GLenum get FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING; - external static GLenum get FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_RED_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_GREEN_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_BLUE_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE; - external static GLenum get FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE; - external static GLenum get FRAMEBUFFER_DEFAULT; - external static GLenum get UNSIGNED_INT_24_8; - external static GLenum get DEPTH24_STENCIL8; - external static GLenum get UNSIGNED_NORMALIZED; - external static GLenum get DRAW_FRAMEBUFFER_BINDING; - external static GLenum get READ_FRAMEBUFFER; - external static GLenum get DRAW_FRAMEBUFFER; - external static GLenum get READ_FRAMEBUFFER_BINDING; - external static GLenum get RENDERBUFFER_SAMPLES; - external static GLenum get FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER; - external static GLenum get MAX_COLOR_ATTACHMENTS; - external static GLenum get COLOR_ATTACHMENT1; - external static GLenum get COLOR_ATTACHMENT2; - external static GLenum get COLOR_ATTACHMENT3; - external static GLenum get COLOR_ATTACHMENT4; - external static GLenum get COLOR_ATTACHMENT5; - external static GLenum get COLOR_ATTACHMENT6; - external static GLenum get COLOR_ATTACHMENT7; - external static GLenum get COLOR_ATTACHMENT8; - external static GLenum get COLOR_ATTACHMENT9; - external static GLenum get COLOR_ATTACHMENT10; - external static GLenum get COLOR_ATTACHMENT11; - external static GLenum get COLOR_ATTACHMENT12; - external static GLenum get COLOR_ATTACHMENT13; - external static GLenum get COLOR_ATTACHMENT14; - external static GLenum get COLOR_ATTACHMENT15; - external static GLenum get FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; - external static GLenum get MAX_SAMPLES; - external static GLenum get HALF_FLOAT; - external static GLenum get RG; - external static GLenum get RG_INTEGER; - external static GLenum get R8; - external static GLenum get RG8; - external static GLenum get R16F; - external static GLenum get R32F; - external static GLenum get RG16F; - external static GLenum get RG32F; - external static GLenum get R8I; - external static GLenum get R8UI; - external static GLenum get R16I; - external static GLenum get R16UI; - external static GLenum get R32I; - external static GLenum get R32UI; - external static GLenum get RG8I; - external static GLenum get RG8UI; - external static GLenum get RG16I; - external static GLenum get RG16UI; - external static GLenum get RG32I; - external static GLenum get RG32UI; - external static GLenum get VERTEX_ARRAY_BINDING; - external static GLenum get R8_SNORM; - external static GLenum get RG8_SNORM; - external static GLenum get RGB8_SNORM; - external static GLenum get RGBA8_SNORM; - external static GLenum get SIGNED_NORMALIZED; - external static GLenum get COPY_READ_BUFFER; - external static GLenum get COPY_WRITE_BUFFER; - external static GLenum get COPY_READ_BUFFER_BINDING; - external static GLenum get COPY_WRITE_BUFFER_BINDING; - external static GLenum get UNIFORM_BUFFER; - external static GLenum get UNIFORM_BUFFER_BINDING; - external static GLenum get UNIFORM_BUFFER_START; - external static GLenum get UNIFORM_BUFFER_SIZE; - external static GLenum get MAX_VERTEX_UNIFORM_BLOCKS; - external static GLenum get MAX_FRAGMENT_UNIFORM_BLOCKS; - external static GLenum get MAX_COMBINED_UNIFORM_BLOCKS; - external static GLenum get MAX_UNIFORM_BUFFER_BINDINGS; - external static GLenum get MAX_UNIFORM_BLOCK_SIZE; - external static GLenum get MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS; - external static GLenum get MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS; - external static GLenum get UNIFORM_BUFFER_OFFSET_ALIGNMENT; - external static GLenum get ACTIVE_UNIFORM_BLOCKS; - external static GLenum get UNIFORM_TYPE; - external static GLenum get UNIFORM_SIZE; - external static GLenum get UNIFORM_BLOCK_INDEX; - external static GLenum get UNIFORM_OFFSET; - external static GLenum get UNIFORM_ARRAY_STRIDE; - external static GLenum get UNIFORM_MATRIX_STRIDE; - external static GLenum get UNIFORM_IS_ROW_MAJOR; - external static GLenum get UNIFORM_BLOCK_BINDING; - external static GLenum get UNIFORM_BLOCK_DATA_SIZE; - external static GLenum get UNIFORM_BLOCK_ACTIVE_UNIFORMS; - external static GLenum get UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES; - external static GLenum get UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER; - external static GLenum get UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER; - external static GLenum get INVALID_INDEX; - external static GLenum get MAX_VERTEX_OUTPUT_COMPONENTS; - external static GLenum get MAX_FRAGMENT_INPUT_COMPONENTS; - external static GLenum get MAX_SERVER_WAIT_TIMEOUT; - external static GLenum get OBJECT_TYPE; - external static GLenum get SYNC_CONDITION; - external static GLenum get SYNC_STATUS; - external static GLenum get SYNC_FLAGS; - external static GLenum get SYNC_FENCE; - external static GLenum get SYNC_GPU_COMMANDS_COMPLETE; - external static GLenum get UNSIGNALED; - external static GLenum get SIGNALED; - external static GLenum get ALREADY_SIGNALED; - external static GLenum get TIMEOUT_EXPIRED; - external static GLenum get CONDITION_SATISFIED; - external static GLenum get WAIT_FAILED; - external static GLenum get SYNC_FLUSH_COMMANDS_BIT; - external static GLenum get VERTEX_ATTRIB_ARRAY_DIVISOR; - external static GLenum get ANY_SAMPLES_PASSED; - external static GLenum get ANY_SAMPLES_PASSED_CONSERVATIVE; - external static GLenum get SAMPLER_BINDING; - external static GLenum get RGB10_A2UI; - external static GLenum get INT_2_10_10_10_REV; - external static GLenum get TRANSFORM_FEEDBACK; - external static GLenum get TRANSFORM_FEEDBACK_PAUSED; - external static GLenum get TRANSFORM_FEEDBACK_ACTIVE; - external static GLenum get TRANSFORM_FEEDBACK_BINDING; - external static GLenum get TEXTURE_IMMUTABLE_FORMAT; - external static GLenum get MAX_ELEMENT_INDEX; - external static GLenum get TEXTURE_IMMUTABLE_LEVELS; - external static GLint64 get TIMEOUT_IGNORED; - external static GLenum get MAX_CLIENT_WAIT_TIMEOUT_WEBGL; + static const GLenum DEPTH_BUFFER_BIT = 256; + + static const GLenum STENCIL_BUFFER_BIT = 1024; + + static const GLenum COLOR_BUFFER_BIT = 16384; + + static const GLenum POINTS = 0; + + static const GLenum LINES = 1; + + static const GLenum LINE_LOOP = 2; + + static const GLenum LINE_STRIP = 3; + + static const GLenum TRIANGLES = 4; + + static const GLenum TRIANGLE_STRIP = 5; + + static const GLenum TRIANGLE_FAN = 6; + + static const GLenum ZERO = 0; + + static const GLenum ONE = 1; + + static const GLenum SRC_COLOR = 768; + + static const GLenum ONE_MINUS_SRC_COLOR = 769; + + static const GLenum SRC_ALPHA = 770; + + static const GLenum ONE_MINUS_SRC_ALPHA = 771; + + static const GLenum DST_ALPHA = 772; + + static const GLenum ONE_MINUS_DST_ALPHA = 773; + + static const GLenum DST_COLOR = 774; + + static const GLenum ONE_MINUS_DST_COLOR = 775; + + static const GLenum SRC_ALPHA_SATURATE = 776; + + static const GLenum FUNC_ADD = 32774; + + static const GLenum BLEND_EQUATION = 32777; + + static const GLenum BLEND_EQUATION_RGB = 32777; + + static const GLenum BLEND_EQUATION_ALPHA = 34877; + + static const GLenum FUNC_SUBTRACT = 32778; + + static const GLenum FUNC_REVERSE_SUBTRACT = 32779; + + static const GLenum BLEND_DST_RGB = 32968; + + static const GLenum BLEND_SRC_RGB = 32969; + + static const GLenum BLEND_DST_ALPHA = 32970; + + static const GLenum BLEND_SRC_ALPHA = 32971; + + static const GLenum CONSTANT_COLOR = 32769; + + static const GLenum ONE_MINUS_CONSTANT_COLOR = 32770; + + static const GLenum CONSTANT_ALPHA = 32771; + + static const GLenum ONE_MINUS_CONSTANT_ALPHA = 32772; + + static const GLenum BLEND_COLOR = 32773; + + static const GLenum ARRAY_BUFFER = 34962; + + static const GLenum ELEMENT_ARRAY_BUFFER = 34963; + + static const GLenum ARRAY_BUFFER_BINDING = 34964; + + static const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 34965; + + static const GLenum STREAM_DRAW = 35040; + + static const GLenum STATIC_DRAW = 35044; + + static const GLenum DYNAMIC_DRAW = 35048; + + static const GLenum BUFFER_SIZE = 34660; + + static const GLenum BUFFER_USAGE = 34661; + + static const GLenum CURRENT_VERTEX_ATTRIB = 34342; + + static const GLenum FRONT = 1028; + + static const GLenum BACK = 1029; + + static const GLenum FRONT_AND_BACK = 1032; + + static const GLenum CULL_FACE = 2884; + + static const GLenum BLEND = 3042; + + static const GLenum DITHER = 3024; + + static const GLenum STENCIL_TEST = 2960; + + static const GLenum DEPTH_TEST = 2929; + + static const GLenum SCISSOR_TEST = 3089; + + static const GLenum POLYGON_OFFSET_FILL = 32823; + + static const GLenum SAMPLE_ALPHA_TO_COVERAGE = 32926; + + static const GLenum SAMPLE_COVERAGE = 32928; + + static const GLenum NO_ERROR = 0; + + static const GLenum INVALID_ENUM = 1280; + + static const GLenum INVALID_VALUE = 1281; + + static const GLenum INVALID_OPERATION = 1282; + + static const GLenum OUT_OF_MEMORY = 1285; + + static const GLenum CW = 2304; + + static const GLenum CCW = 2305; + + static const GLenum LINE_WIDTH = 2849; + + static const GLenum ALIASED_POINT_SIZE_RANGE = 33901; + + static const GLenum ALIASED_LINE_WIDTH_RANGE = 33902; + + static const GLenum CULL_FACE_MODE = 2885; + + static const GLenum FRONT_FACE = 2886; + + static const GLenum DEPTH_RANGE = 2928; + + static const GLenum DEPTH_WRITEMASK = 2930; + + static const GLenum DEPTH_CLEAR_VALUE = 2931; + + static const GLenum DEPTH_FUNC = 2932; + + static const GLenum STENCIL_CLEAR_VALUE = 2961; + + static const GLenum STENCIL_FUNC = 2962; + + static const GLenum STENCIL_FAIL = 2964; + + static const GLenum STENCIL_PASS_DEPTH_FAIL = 2965; + + static const GLenum STENCIL_PASS_DEPTH_PASS = 2966; + + static const GLenum STENCIL_REF = 2967; + + static const GLenum STENCIL_VALUE_MASK = 2963; + + static const GLenum STENCIL_WRITEMASK = 2968; + + static const GLenum STENCIL_BACK_FUNC = 34816; + + static const GLenum STENCIL_BACK_FAIL = 34817; + + static const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 34818; + + static const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 34819; + + static const GLenum STENCIL_BACK_REF = 36003; + + static const GLenum STENCIL_BACK_VALUE_MASK = 36004; + + static const GLenum STENCIL_BACK_WRITEMASK = 36005; + + static const GLenum VIEWPORT = 2978; + + static const GLenum SCISSOR_BOX = 3088; + + static const GLenum COLOR_CLEAR_VALUE = 3106; + + static const GLenum COLOR_WRITEMASK = 3107; + + static const GLenum UNPACK_ALIGNMENT = 3317; + + static const GLenum PACK_ALIGNMENT = 3333; + + static const GLenum MAX_TEXTURE_SIZE = 3379; + + static const GLenum MAX_VIEWPORT_DIMS = 3386; + + static const GLenum SUBPIXEL_BITS = 3408; + + static const GLenum RED_BITS = 3410; + + static const GLenum GREEN_BITS = 3411; + + static const GLenum BLUE_BITS = 3412; + + static const GLenum ALPHA_BITS = 3413; + + static const GLenum DEPTH_BITS = 3414; + + static const GLenum STENCIL_BITS = 3415; + + static const GLenum POLYGON_OFFSET_UNITS = 10752; + + static const GLenum POLYGON_OFFSET_FACTOR = 32824; + + static const GLenum TEXTURE_BINDING_2D = 32873; + + static const GLenum SAMPLE_BUFFERS = 32936; + + static const GLenum SAMPLES = 32937; + + static const GLenum SAMPLE_COVERAGE_VALUE = 32938; + + static const GLenum SAMPLE_COVERAGE_INVERT = 32939; + + static const GLenum COMPRESSED_TEXTURE_FORMATS = 34467; + + static const GLenum DONT_CARE = 4352; + + static const GLenum FASTEST = 4353; + + static const GLenum NICEST = 4354; + + static const GLenum GENERATE_MIPMAP_HINT = 33170; + + static const GLenum BYTE = 5120; + + static const GLenum UNSIGNED_BYTE = 5121; + + static const GLenum SHORT = 5122; + + static const GLenum UNSIGNED_SHORT = 5123; + + static const GLenum INT = 5124; + + static const GLenum UNSIGNED_INT = 5125; + + static const GLenum FLOAT = 5126; + + static const GLenum DEPTH_COMPONENT = 6402; + + static const GLenum ALPHA = 6406; + + static const GLenum RGB = 6407; + + static const GLenum RGBA = 6408; + + static const GLenum LUMINANCE = 6409; + + static const GLenum LUMINANCE_ALPHA = 6410; + + static const GLenum UNSIGNED_SHORT_4_4_4_4 = 32819; + + static const GLenum UNSIGNED_SHORT_5_5_5_1 = 32820; + + static const GLenum UNSIGNED_SHORT_5_6_5 = 33635; + + static const GLenum FRAGMENT_SHADER = 35632; + + static const GLenum VERTEX_SHADER = 35633; + + static const GLenum MAX_VERTEX_ATTRIBS = 34921; + + static const GLenum MAX_VERTEX_UNIFORM_VECTORS = 36347; + + static const GLenum MAX_VARYING_VECTORS = 36348; + + static const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661; + + static const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660; + + static const GLenum MAX_TEXTURE_IMAGE_UNITS = 34930; + + static const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 36349; + + static const GLenum SHADER_TYPE = 35663; + + static const GLenum DELETE_STATUS = 35712; + + static const GLenum LINK_STATUS = 35714; + + static const GLenum VALIDATE_STATUS = 35715; + + static const GLenum ATTACHED_SHADERS = 35717; + + static const GLenum ACTIVE_UNIFORMS = 35718; + + static const GLenum ACTIVE_ATTRIBUTES = 35721; + + static const GLenum SHADING_LANGUAGE_VERSION = 35724; + + static const GLenum CURRENT_PROGRAM = 35725; + + static const GLenum NEVER = 512; + + static const GLenum LESS = 513; + + static const GLenum EQUAL = 514; + + static const GLenum LEQUAL = 515; + + static const GLenum GREATER = 516; + + static const GLenum NOTEQUAL = 517; + + static const GLenum GEQUAL = 518; + + static const GLenum ALWAYS = 519; + + static const GLenum KEEP = 7680; + + static const GLenum REPLACE = 7681; + + static const GLenum INCR = 7682; + + static const GLenum DECR = 7683; + + static const GLenum INVERT = 5386; + + static const GLenum INCR_WRAP = 34055; + + static const GLenum DECR_WRAP = 34056; + + static const GLenum VENDOR = 7936; + + static const GLenum RENDERER = 7937; + + static const GLenum VERSION = 7938; + + static const GLenum NEAREST = 9728; + + static const GLenum LINEAR = 9729; + + static const GLenum NEAREST_MIPMAP_NEAREST = 9984; + + static const GLenum LINEAR_MIPMAP_NEAREST = 9985; + + static const GLenum NEAREST_MIPMAP_LINEAR = 9986; + + static const GLenum LINEAR_MIPMAP_LINEAR = 9987; + + static const GLenum TEXTURE_MAG_FILTER = 10240; + + static const GLenum TEXTURE_MIN_FILTER = 10241; + + static const GLenum TEXTURE_WRAP_S = 10242; + + static const GLenum TEXTURE_WRAP_T = 10243; + + static const GLenum TEXTURE_2D = 3553; + + static const GLenum TEXTURE = 5890; + + static const GLenum TEXTURE_CUBE_MAP = 34067; + + static const GLenum TEXTURE_BINDING_CUBE_MAP = 34068; + + static const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 34069; + + static const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 34070; + + static const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 34071; + + static const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072; + + static const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 34073; + + static const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074; + + static const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 34076; + + static const GLenum TEXTURE0 = 33984; + + static const GLenum TEXTURE1 = 33985; + + static const GLenum TEXTURE2 = 33986; + + static const GLenum TEXTURE3 = 33987; + + static const GLenum TEXTURE4 = 33988; + + static const GLenum TEXTURE5 = 33989; + + static const GLenum TEXTURE6 = 33990; + + static const GLenum TEXTURE7 = 33991; + + static const GLenum TEXTURE8 = 33992; + + static const GLenum TEXTURE9 = 33993; + + static const GLenum TEXTURE10 = 33994; + + static const GLenum TEXTURE11 = 33995; + + static const GLenum TEXTURE12 = 33996; + + static const GLenum TEXTURE13 = 33997; + + static const GLenum TEXTURE14 = 33998; + + static const GLenum TEXTURE15 = 33999; + + static const GLenum TEXTURE16 = 34000; + + static const GLenum TEXTURE17 = 34001; + + static const GLenum TEXTURE18 = 34002; + + static const GLenum TEXTURE19 = 34003; + + static const GLenum TEXTURE20 = 34004; + + static const GLenum TEXTURE21 = 34005; + + static const GLenum TEXTURE22 = 34006; + + static const GLenum TEXTURE23 = 34007; + + static const GLenum TEXTURE24 = 34008; + + static const GLenum TEXTURE25 = 34009; + + static const GLenum TEXTURE26 = 34010; + + static const GLenum TEXTURE27 = 34011; + + static const GLenum TEXTURE28 = 34012; + + static const GLenum TEXTURE29 = 34013; + + static const GLenum TEXTURE30 = 34014; + + static const GLenum TEXTURE31 = 34015; + + static const GLenum ACTIVE_TEXTURE = 34016; + + static const GLenum REPEAT = 10497; + + static const GLenum CLAMP_TO_EDGE = 33071; + + static const GLenum MIRRORED_REPEAT = 33648; + + static const GLenum FLOAT_VEC2 = 35664; + + static const GLenum FLOAT_VEC3 = 35665; + + static const GLenum FLOAT_VEC4 = 35666; + + static const GLenum INT_VEC2 = 35667; + + static const GLenum INT_VEC3 = 35668; + + static const GLenum INT_VEC4 = 35669; + + static const GLenum BOOL = 35670; + + static const GLenum BOOL_VEC2 = 35671; + + static const GLenum BOOL_VEC3 = 35672; + + static const GLenum BOOL_VEC4 = 35673; + + static const GLenum FLOAT_MAT2 = 35674; + + static const GLenum FLOAT_MAT3 = 35675; + + static const GLenum FLOAT_MAT4 = 35676; + + static const GLenum SAMPLER_2D = 35678; + + static const GLenum SAMPLER_CUBE = 35680; + + static const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 34338; + + static const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 34339; + + static const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 34340; + + static const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 34341; + + static const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922; + + static const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 34373; + + static const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975; + + static const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 35738; + + static const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 35739; + + static const GLenum COMPILE_STATUS = 35713; + + static const GLenum LOW_FLOAT = 36336; + + static const GLenum MEDIUM_FLOAT = 36337; + + static const GLenum HIGH_FLOAT = 36338; + + static const GLenum LOW_INT = 36339; + + static const GLenum MEDIUM_INT = 36340; + + static const GLenum HIGH_INT = 36341; + + static const GLenum FRAMEBUFFER = 36160; + + static const GLenum RENDERBUFFER = 36161; + + static const GLenum RGBA4 = 32854; + + static const GLenum RGB5_A1 = 32855; + + static const GLenum RGBA8 = 32856; + + static const GLenum RGB565 = 36194; + + static const GLenum DEPTH_COMPONENT16 = 33189; + + static const GLenum STENCIL_INDEX8 = 36168; + + static const GLenum DEPTH_STENCIL = 34041; + + static const GLenum RENDERBUFFER_WIDTH = 36162; + + static const GLenum RENDERBUFFER_HEIGHT = 36163; + + static const GLenum RENDERBUFFER_INTERNAL_FORMAT = 36164; + + static const GLenum RENDERBUFFER_RED_SIZE = 36176; + + static const GLenum RENDERBUFFER_GREEN_SIZE = 36177; + + static const GLenum RENDERBUFFER_BLUE_SIZE = 36178; + + static const GLenum RENDERBUFFER_ALPHA_SIZE = 36179; + + static const GLenum RENDERBUFFER_DEPTH_SIZE = 36180; + + static const GLenum RENDERBUFFER_STENCIL_SIZE = 36181; + + static const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048; + + static const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049; + + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050; + + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051; + + static const GLenum COLOR_ATTACHMENT0 = 36064; + + static const GLenum DEPTH_ATTACHMENT = 36096; + + static const GLenum STENCIL_ATTACHMENT = 36128; + + static const GLenum DEPTH_STENCIL_ATTACHMENT = 33306; + + static const GLenum NONE = 0; + + static const GLenum FRAMEBUFFER_COMPLETE = 36053; + + static const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054; + + static const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055; + + static const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057; + + static const GLenum FRAMEBUFFER_UNSUPPORTED = 36061; + + static const GLenum FRAMEBUFFER_BINDING = 36006; + + static const GLenum RENDERBUFFER_BINDING = 36007; + + static const GLenum MAX_RENDERBUFFER_SIZE = 34024; + + static const GLenum INVALID_FRAMEBUFFER_OPERATION = 1286; + + static const GLenum UNPACK_FLIP_Y_WEBGL = 37440; + + static const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441; + + static const GLenum CONTEXT_LOST_WEBGL = 37442; + + static const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443; + + static const GLenum BROWSER_DEFAULT_WEBGL = 37444; + + static const GLenum READ_BUFFER = 3074; + + static const GLenum UNPACK_ROW_LENGTH = 3314; + + static const GLenum UNPACK_SKIP_ROWS = 3315; + + static const GLenum UNPACK_SKIP_PIXELS = 3316; + + static const GLenum PACK_ROW_LENGTH = 3330; + + static const GLenum PACK_SKIP_ROWS = 3331; + + static const GLenum PACK_SKIP_PIXELS = 3332; + + static const GLenum COLOR = 6144; + + static const GLenum DEPTH = 6145; + + static const GLenum STENCIL = 6146; + + static const GLenum RED = 6403; + + static const GLenum RGB8 = 32849; + + static const GLenum RGB10_A2 = 32857; + + static const GLenum TEXTURE_BINDING_3D = 32874; + + static const GLenum UNPACK_SKIP_IMAGES = 32877; + + static const GLenum UNPACK_IMAGE_HEIGHT = 32878; + + static const GLenum TEXTURE_3D = 32879; + + static const GLenum TEXTURE_WRAP_R = 32882; + + static const GLenum MAX_3D_TEXTURE_SIZE = 32883; + + static const GLenum UNSIGNED_INT_2_10_10_10_REV = 33640; + + static const GLenum MAX_ELEMENTS_VERTICES = 33000; + + static const GLenum MAX_ELEMENTS_INDICES = 33001; + + static const GLenum TEXTURE_MIN_LOD = 33082; + + static const GLenum TEXTURE_MAX_LOD = 33083; + + static const GLenum TEXTURE_BASE_LEVEL = 33084; + + static const GLenum TEXTURE_MAX_LEVEL = 33085; + + static const GLenum MIN = 32775; + + static const GLenum MAX = 32776; + + static const GLenum DEPTH_COMPONENT24 = 33190; + + static const GLenum MAX_TEXTURE_LOD_BIAS = 34045; + + static const GLenum TEXTURE_COMPARE_MODE = 34892; + + static const GLenum TEXTURE_COMPARE_FUNC = 34893; + + static const GLenum CURRENT_QUERY = 34917; + + static const GLenum QUERY_RESULT = 34918; + + static const GLenum QUERY_RESULT_AVAILABLE = 34919; + + static const GLenum STREAM_READ = 35041; + + static const GLenum STREAM_COPY = 35042; + + static const GLenum STATIC_READ = 35045; + + static const GLenum STATIC_COPY = 35046; + + static const GLenum DYNAMIC_READ = 35049; + + static const GLenum DYNAMIC_COPY = 35050; + + static const GLenum MAX_DRAW_BUFFERS = 34852; + + static const GLenum DRAW_BUFFER0 = 34853; + + static const GLenum DRAW_BUFFER1 = 34854; + + static const GLenum DRAW_BUFFER2 = 34855; + + static const GLenum DRAW_BUFFER3 = 34856; + + static const GLenum DRAW_BUFFER4 = 34857; + + static const GLenum DRAW_BUFFER5 = 34858; + + static const GLenum DRAW_BUFFER6 = 34859; + + static const GLenum DRAW_BUFFER7 = 34860; + + static const GLenum DRAW_BUFFER8 = 34861; + + static const GLenum DRAW_BUFFER9 = 34862; + + static const GLenum DRAW_BUFFER10 = 34863; + + static const GLenum DRAW_BUFFER11 = 34864; + + static const GLenum DRAW_BUFFER12 = 34865; + + static const GLenum DRAW_BUFFER13 = 34866; + + static const GLenum DRAW_BUFFER14 = 34867; + + static const GLenum DRAW_BUFFER15 = 34868; + + static const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657; + + static const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 35658; + + static const GLenum SAMPLER_3D = 35679; + + static const GLenum SAMPLER_2D_SHADOW = 35682; + + static const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 35723; + + static const GLenum PIXEL_PACK_BUFFER = 35051; + + static const GLenum PIXEL_UNPACK_BUFFER = 35052; + + static const GLenum PIXEL_PACK_BUFFER_BINDING = 35053; + + static const GLenum PIXEL_UNPACK_BUFFER_BINDING = 35055; + + static const GLenum FLOAT_MAT2x3 = 35685; + + static const GLenum FLOAT_MAT2x4 = 35686; + + static const GLenum FLOAT_MAT3x2 = 35687; + + static const GLenum FLOAT_MAT3x4 = 35688; + + static const GLenum FLOAT_MAT4x2 = 35689; + + static const GLenum FLOAT_MAT4x3 = 35690; + + static const GLenum SRGB = 35904; + + static const GLenum SRGB8 = 35905; + + static const GLenum SRGB8_ALPHA8 = 35907; + + static const GLenum COMPARE_REF_TO_TEXTURE = 34894; + + static const GLenum RGBA32F = 34836; + + static const GLenum RGB32F = 34837; + + static const GLenum RGBA16F = 34842; + + static const GLenum RGB16F = 34843; + + static const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 35069; + + static const GLenum MAX_ARRAY_TEXTURE_LAYERS = 35071; + + static const GLenum MIN_PROGRAM_TEXEL_OFFSET = 35076; + + static const GLenum MAX_PROGRAM_TEXEL_OFFSET = 35077; + + static const GLenum MAX_VARYING_COMPONENTS = 35659; + + static const GLenum TEXTURE_2D_ARRAY = 35866; + + static const GLenum TEXTURE_BINDING_2D_ARRAY = 35869; + + static const GLenum R11F_G11F_B10F = 35898; + + static const GLenum UNSIGNED_INT_10F_11F_11F_REV = 35899; + + static const GLenum RGB9_E5 = 35901; + + static const GLenum UNSIGNED_INT_5_9_9_9_REV = 35902; + + static const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 35967; + + static const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968; + + static const GLenum TRANSFORM_FEEDBACK_VARYINGS = 35971; + + static const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 35972; + + static const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973; + + static const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976; + + static const GLenum RASTERIZER_DISCARD = 35977; + + static const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978; + + static const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979; + + static const GLenum INTERLEAVED_ATTRIBS = 35980; + + static const GLenum SEPARATE_ATTRIBS = 35981; + + static const GLenum TRANSFORM_FEEDBACK_BUFFER = 35982; + + static const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983; + + static const GLenum RGBA32UI = 36208; + + static const GLenum RGB32UI = 36209; + + static const GLenum RGBA16UI = 36214; + + static const GLenum RGB16UI = 36215; + + static const GLenum RGBA8UI = 36220; + + static const GLenum RGB8UI = 36221; + + static const GLenum RGBA32I = 36226; + + static const GLenum RGB32I = 36227; + + static const GLenum RGBA16I = 36232; + + static const GLenum RGB16I = 36233; + + static const GLenum RGBA8I = 36238; + + static const GLenum RGB8I = 36239; + + static const GLenum RED_INTEGER = 36244; + + static const GLenum RGB_INTEGER = 36248; + + static const GLenum RGBA_INTEGER = 36249; + + static const GLenum SAMPLER_2D_ARRAY = 36289; + + static const GLenum SAMPLER_2D_ARRAY_SHADOW = 36292; + + static const GLenum SAMPLER_CUBE_SHADOW = 36293; + + static const GLenum UNSIGNED_INT_VEC2 = 36294; + + static const GLenum UNSIGNED_INT_VEC3 = 36295; + + static const GLenum UNSIGNED_INT_VEC4 = 36296; + + static const GLenum INT_SAMPLER_2D = 36298; + + static const GLenum INT_SAMPLER_3D = 36299; + + static const GLenum INT_SAMPLER_CUBE = 36300; + + static const GLenum INT_SAMPLER_2D_ARRAY = 36303; + + static const GLenum UNSIGNED_INT_SAMPLER_2D = 36306; + + static const GLenum UNSIGNED_INT_SAMPLER_3D = 36307; + + static const GLenum UNSIGNED_INT_SAMPLER_CUBE = 36308; + + static const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311; + + static const GLenum DEPTH_COMPONENT32F = 36012; + + static const GLenum DEPTH32F_STENCIL8 = 36013; + + static const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 36269; + + static const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296; + + static const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297; + + static const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298; + + static const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299; + + static const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300; + + static const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301; + + static const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302; + + static const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303; + + static const GLenum FRAMEBUFFER_DEFAULT = 33304; + + static const GLenum UNSIGNED_INT_24_8 = 34042; + + static const GLenum DEPTH24_STENCIL8 = 35056; + + static const GLenum UNSIGNED_NORMALIZED = 35863; + + static const GLenum DRAW_FRAMEBUFFER_BINDING = 36006; + + static const GLenum READ_FRAMEBUFFER = 36008; + + static const GLenum DRAW_FRAMEBUFFER = 36009; + + static const GLenum READ_FRAMEBUFFER_BINDING = 36010; + + static const GLenum RENDERBUFFER_SAMPLES = 36011; + + static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052; + + static const GLenum MAX_COLOR_ATTACHMENTS = 36063; + + static const GLenum COLOR_ATTACHMENT1 = 36065; + + static const GLenum COLOR_ATTACHMENT2 = 36066; + + static const GLenum COLOR_ATTACHMENT3 = 36067; + + static const GLenum COLOR_ATTACHMENT4 = 36068; + + static const GLenum COLOR_ATTACHMENT5 = 36069; + + static const GLenum COLOR_ATTACHMENT6 = 36070; + + static const GLenum COLOR_ATTACHMENT7 = 36071; + + static const GLenum COLOR_ATTACHMENT8 = 36072; + + static const GLenum COLOR_ATTACHMENT9 = 36073; + + static const GLenum COLOR_ATTACHMENT10 = 36074; + + static const GLenum COLOR_ATTACHMENT11 = 36075; + + static const GLenum COLOR_ATTACHMENT12 = 36076; + + static const GLenum COLOR_ATTACHMENT13 = 36077; + + static const GLenum COLOR_ATTACHMENT14 = 36078; + + static const GLenum COLOR_ATTACHMENT15 = 36079; + + static const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182; + + static const GLenum MAX_SAMPLES = 36183; + + static const GLenum HALF_FLOAT = 5131; + + static const GLenum RG = 33319; + + static const GLenum RG_INTEGER = 33320; + + static const GLenum R8 = 33321; + + static const GLenum RG8 = 33323; + + static const GLenum R16F = 33325; + + static const GLenum R32F = 33326; + + static const GLenum RG16F = 33327; + + static const GLenum RG32F = 33328; + + static const GLenum R8I = 33329; + + static const GLenum R8UI = 33330; + + static const GLenum R16I = 33331; + + static const GLenum R16UI = 33332; + + static const GLenum R32I = 33333; + + static const GLenum R32UI = 33334; + + static const GLenum RG8I = 33335; + + static const GLenum RG8UI = 33336; + + static const GLenum RG16I = 33337; + + static const GLenum RG16UI = 33338; + + static const GLenum RG32I = 33339; + + static const GLenum RG32UI = 33340; + + static const GLenum VERTEX_ARRAY_BINDING = 34229; + + static const GLenum R8_SNORM = 36756; + + static const GLenum RG8_SNORM = 36757; + + static const GLenum RGB8_SNORM = 36758; + + static const GLenum RGBA8_SNORM = 36759; + + static const GLenum SIGNED_NORMALIZED = 36764; + + static const GLenum COPY_READ_BUFFER = 36662; + + static const GLenum COPY_WRITE_BUFFER = 36663; + + static const GLenum COPY_READ_BUFFER_BINDING = 36662; + + static const GLenum COPY_WRITE_BUFFER_BINDING = 36663; + + static const GLenum UNIFORM_BUFFER = 35345; + + static const GLenum UNIFORM_BUFFER_BINDING = 35368; + + static const GLenum UNIFORM_BUFFER_START = 35369; + + static const GLenum UNIFORM_BUFFER_SIZE = 35370; + + static const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 35371; + + static const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 35373; + + static const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 35374; + + static const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 35375; + + static const GLenum MAX_UNIFORM_BLOCK_SIZE = 35376; + + static const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377; + + static const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379; + + static const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380; + + static const GLenum ACTIVE_UNIFORM_BLOCKS = 35382; + + static const GLenum UNIFORM_TYPE = 35383; + + static const GLenum UNIFORM_SIZE = 35384; + + static const GLenum UNIFORM_BLOCK_INDEX = 35386; + + static const GLenum UNIFORM_OFFSET = 35387; + + static const GLenum UNIFORM_ARRAY_STRIDE = 35388; + + static const GLenum UNIFORM_MATRIX_STRIDE = 35389; + + static const GLenum UNIFORM_IS_ROW_MAJOR = 35390; + + static const GLenum UNIFORM_BLOCK_BINDING = 35391; + + static const GLenum UNIFORM_BLOCK_DATA_SIZE = 35392; + + static const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394; + + static const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395; + + static const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396; + + static const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398; + + static const GLenum INVALID_INDEX = 4294967295; + + static const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 37154; + + static const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 37157; + + static const GLenum MAX_SERVER_WAIT_TIMEOUT = 37137; + + static const GLenum OBJECT_TYPE = 37138; + + static const GLenum SYNC_CONDITION = 37139; + + static const GLenum SYNC_STATUS = 37140; + + static const GLenum SYNC_FLAGS = 37141; + + static const GLenum SYNC_FENCE = 37142; + + static const GLenum SYNC_GPU_COMMANDS_COMPLETE = 37143; + + static const GLenum UNSIGNALED = 37144; + + static const GLenum SIGNALED = 37145; + + static const GLenum ALREADY_SIGNALED = 37146; + + static const GLenum TIMEOUT_EXPIRED = 37147; + + static const GLenum CONDITION_SATISFIED = 37148; + + static const GLenum WAIT_FAILED = 37149; + + static const GLenum SYNC_FLUSH_COMMANDS_BIT = 1; + + static const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 35070; + + static const GLenum ANY_SAMPLES_PASSED = 35887; + + static const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 36202; + + static const GLenum SAMPLER_BINDING = 35097; + + static const GLenum RGB10_A2UI = 36975; + + static const GLenum INT_2_10_10_10_REV = 36255; + + static const GLenum TRANSFORM_FEEDBACK = 36386; + + static const GLenum TRANSFORM_FEEDBACK_PAUSED = 36387; + + static const GLenum TRANSFORM_FEEDBACK_ACTIVE = 36388; + + static const GLenum TRANSFORM_FEEDBACK_BINDING = 36389; + + static const GLenum TEXTURE_IMMUTABLE_FORMAT = 37167; + + static const GLenum MAX_ELEMENT_INDEX = 36203; + + static const GLenum TEXTURE_IMMUTABLE_LEVELS = 33503; + + static const GLint64 TIMEOUT_IGNORED = -1; + + static const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 37447; + external WebGLContextAttributes? getContextAttributes(); external bool isContextLost(); external JSArray? getSupportedExtensions(); diff --git a/web/lib/src/dom/webgl_color_buffer_float.dart b/web/lib/src/dom/webgl_color_buffer_float.dart index a93b72fd..18dd9b9a 100644 --- a/web/lib/src/dom/webgl_color_buffer_float.dart +++ b/web/lib/src/dom/webgl_color_buffer_float.dart @@ -18,7 +18,9 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_color_buffer_float._(JSObject _) implements JSObject { - external static GLenum get RGBA32F_EXT; - external static GLenum get FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT; - external static GLenum get UNSIGNED_NORMALIZED_EXT; + static const GLenum RGBA32F_EXT = 34836; + + static const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 33297; + + static const GLenum UNSIGNED_NORMALIZED_EXT = 35863; } diff --git a/web/lib/src/dom/webgl_compressed_texture_astc.dart b/web/lib/src/dom/webgl_compressed_texture_astc.dart index 8e1601d5..9405d120 100644 --- a/web/lib/src/dom/webgl_compressed_texture_astc.dart +++ b/web/lib/src/dom/webgl_compressed_texture_astc.dart @@ -18,33 +18,61 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_compressed_texture_astc._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_RGBA_ASTC_4x4_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_5x4_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_5x5_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_6x5_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_6x6_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_8x5_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_8x6_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_8x8_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_10x5_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_10x6_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_10x8_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_10x10_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_12x10_KHR; - external static GLenum get COMPRESSED_RGBA_ASTC_12x12_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR; + static const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 37808; + + static const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 37809; + + static const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 37810; + + static const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 37811; + + static const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 37812; + + static const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 37813; + + static const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 37814; + + static const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 37815; + + static const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 37816; + + static const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 37817; + + static const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 37818; + + static const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 37819; + + static const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 37820; + + static const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 37821; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 37841; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 37842; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 37843; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 37844; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 37845; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 37846; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 37847; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 37848; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 37849; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 37850; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 37851; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 37852; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 37853; + external JSArray getSupportedProfiles(); } diff --git a/web/lib/src/dom/webgl_compressed_texture_etc.dart b/web/lib/src/dom/webgl_compressed_texture_etc.dart index 36e91bc9..0382ef28 100644 --- a/web/lib/src/dom/webgl_compressed_texture_etc.dart +++ b/web/lib/src/dom/webgl_compressed_texture_etc.dart @@ -18,14 +18,23 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_compressed_texture_etc._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_R11_EAC; - external static GLenum get COMPRESSED_SIGNED_R11_EAC; - external static GLenum get COMPRESSED_RG11_EAC; - external static GLenum get COMPRESSED_SIGNED_RG11_EAC; - external static GLenum get COMPRESSED_RGB8_ETC2; - external static GLenum get COMPRESSED_SRGB8_ETC2; - external static GLenum get COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; - external static GLenum get COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2; - external static GLenum get COMPRESSED_RGBA8_ETC2_EAC; - external static GLenum get COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + static const GLenum COMPRESSED_R11_EAC = 37488; + + static const GLenum COMPRESSED_SIGNED_R11_EAC = 37489; + + static const GLenum COMPRESSED_RG11_EAC = 37490; + + static const GLenum COMPRESSED_SIGNED_RG11_EAC = 37491; + + static const GLenum COMPRESSED_RGB8_ETC2 = 37492; + + static const GLenum COMPRESSED_SRGB8_ETC2 = 37493; + + static const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; + + static const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; + + static const GLenum COMPRESSED_RGBA8_ETC2_EAC = 37496; + + static const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; } diff --git a/web/lib/src/dom/webgl_compressed_texture_etc1.dart b/web/lib/src/dom/webgl_compressed_texture_etc1.dart index 9f548614..69e2efda 100644 --- a/web/lib/src/dom/webgl_compressed_texture_etc1.dart +++ b/web/lib/src/dom/webgl_compressed_texture_etc1.dart @@ -18,5 +18,5 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_compressed_texture_etc1._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_RGB_ETC1_WEBGL; + static const GLenum COMPRESSED_RGB_ETC1_WEBGL = 36196; } diff --git a/web/lib/src/dom/webgl_compressed_texture_pvrtc.dart b/web/lib/src/dom/webgl_compressed_texture_pvrtc.dart index c36e6442..1d0501bb 100644 --- a/web/lib/src/dom/webgl_compressed_texture_pvrtc.dart +++ b/web/lib/src/dom/webgl_compressed_texture_pvrtc.dart @@ -19,8 +19,11 @@ import 'webgl1.dart'; extension type WEBGL_compressed_texture_pvrtc._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - external static GLenum get COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - external static GLenum get COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - external static GLenum get COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + static const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840; + + static const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841; + + static const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842; + + static const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843; } diff --git a/web/lib/src/dom/webgl_compressed_texture_s3tc.dart b/web/lib/src/dom/webgl_compressed_texture_s3tc.dart index 0c94d752..21d20fe4 100644 --- a/web/lib/src/dom/webgl_compressed_texture_s3tc.dart +++ b/web/lib/src/dom/webgl_compressed_texture_s3tc.dart @@ -18,8 +18,11 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_compressed_texture_s3tc._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_RGB_S3TC_DXT1_EXT; - external static GLenum get COMPRESSED_RGBA_S3TC_DXT1_EXT; - external static GLenum get COMPRESSED_RGBA_S3TC_DXT3_EXT; - external static GLenum get COMPRESSED_RGBA_S3TC_DXT5_EXT; + static const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT = 33776; + + static const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777; + + static const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778; + + static const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779; } diff --git a/web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart b/web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart index f3104719..e99927f9 100644 --- a/web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart +++ b/web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart @@ -19,8 +19,11 @@ import 'webgl1.dart'; extension type WEBGL_compressed_texture_s3tc_srgb._(JSObject _) implements JSObject { - external static GLenum get COMPRESSED_SRGB_S3TC_DXT1_EXT; - external static GLenum get COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - external static GLenum get COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - external static GLenum get COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + static const GLenum COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916; + + static const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917; + + static const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918; + + static const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919; } diff --git a/web/lib/src/dom/webgl_debug_renderer_info.dart b/web/lib/src/dom/webgl_debug_renderer_info.dart index 6d0ba232..c65cdced 100644 --- a/web/lib/src/dom/webgl_debug_renderer_info.dart +++ b/web/lib/src/dom/webgl_debug_renderer_info.dart @@ -18,6 +18,7 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_debug_renderer_info._(JSObject _) implements JSObject { - external static GLenum get UNMASKED_VENDOR_WEBGL; - external static GLenum get UNMASKED_RENDERER_WEBGL; + static const GLenum UNMASKED_VENDOR_WEBGL = 37445; + + static const GLenum UNMASKED_RENDERER_WEBGL = 37446; } diff --git a/web/lib/src/dom/webgl_depth_texture.dart b/web/lib/src/dom/webgl_depth_texture.dart index 68993a86..0865af33 100644 --- a/web/lib/src/dom/webgl_depth_texture.dart +++ b/web/lib/src/dom/webgl_depth_texture.dart @@ -18,5 +18,5 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_depth_texture._(JSObject _) implements JSObject { - external static GLenum get UNSIGNED_INT_24_8_WEBGL; + static const GLenum UNSIGNED_INT_24_8_WEBGL = 34042; } diff --git a/web/lib/src/dom/webgl_draw_buffers.dart b/web/lib/src/dom/webgl_draw_buffers.dart index 5913b7ec..05a8221b 100644 --- a/web/lib/src/dom/webgl_draw_buffers.dart +++ b/web/lib/src/dom/webgl_draw_buffers.dart @@ -18,39 +18,73 @@ import 'dart:js_interop'; import 'webgl1.dart'; extension type WEBGL_draw_buffers._(JSObject _) implements JSObject { - external static GLenum get COLOR_ATTACHMENT0_WEBGL; - external static GLenum get COLOR_ATTACHMENT1_WEBGL; - external static GLenum get COLOR_ATTACHMENT2_WEBGL; - external static GLenum get COLOR_ATTACHMENT3_WEBGL; - external static GLenum get COLOR_ATTACHMENT4_WEBGL; - external static GLenum get COLOR_ATTACHMENT5_WEBGL; - external static GLenum get COLOR_ATTACHMENT6_WEBGL; - external static GLenum get COLOR_ATTACHMENT7_WEBGL; - external static GLenum get COLOR_ATTACHMENT8_WEBGL; - external static GLenum get COLOR_ATTACHMENT9_WEBGL; - external static GLenum get COLOR_ATTACHMENT10_WEBGL; - external static GLenum get COLOR_ATTACHMENT11_WEBGL; - external static GLenum get COLOR_ATTACHMENT12_WEBGL; - external static GLenum get COLOR_ATTACHMENT13_WEBGL; - external static GLenum get COLOR_ATTACHMENT14_WEBGL; - external static GLenum get COLOR_ATTACHMENT15_WEBGL; - external static GLenum get DRAW_BUFFER0_WEBGL; - external static GLenum get DRAW_BUFFER1_WEBGL; - external static GLenum get DRAW_BUFFER2_WEBGL; - external static GLenum get DRAW_BUFFER3_WEBGL; - external static GLenum get DRAW_BUFFER4_WEBGL; - external static GLenum get DRAW_BUFFER5_WEBGL; - external static GLenum get DRAW_BUFFER6_WEBGL; - external static GLenum get DRAW_BUFFER7_WEBGL; - external static GLenum get DRAW_BUFFER8_WEBGL; - external static GLenum get DRAW_BUFFER9_WEBGL; - external static GLenum get DRAW_BUFFER10_WEBGL; - external static GLenum get DRAW_BUFFER11_WEBGL; - external static GLenum get DRAW_BUFFER12_WEBGL; - external static GLenum get DRAW_BUFFER13_WEBGL; - external static GLenum get DRAW_BUFFER14_WEBGL; - external static GLenum get DRAW_BUFFER15_WEBGL; - external static GLenum get MAX_COLOR_ATTACHMENTS_WEBGL; - external static GLenum get MAX_DRAW_BUFFERS_WEBGL; + static const GLenum COLOR_ATTACHMENT0_WEBGL = 36064; + + static const GLenum COLOR_ATTACHMENT1_WEBGL = 36065; + + static const GLenum COLOR_ATTACHMENT2_WEBGL = 36066; + + static const GLenum COLOR_ATTACHMENT3_WEBGL = 36067; + + static const GLenum COLOR_ATTACHMENT4_WEBGL = 36068; + + static const GLenum COLOR_ATTACHMENT5_WEBGL = 36069; + + static const GLenum COLOR_ATTACHMENT6_WEBGL = 36070; + + static const GLenum COLOR_ATTACHMENT7_WEBGL = 36071; + + static const GLenum COLOR_ATTACHMENT8_WEBGL = 36072; + + static const GLenum COLOR_ATTACHMENT9_WEBGL = 36073; + + static const GLenum COLOR_ATTACHMENT10_WEBGL = 36074; + + static const GLenum COLOR_ATTACHMENT11_WEBGL = 36075; + + static const GLenum COLOR_ATTACHMENT12_WEBGL = 36076; + + static const GLenum COLOR_ATTACHMENT13_WEBGL = 36077; + + static const GLenum COLOR_ATTACHMENT14_WEBGL = 36078; + + static const GLenum COLOR_ATTACHMENT15_WEBGL = 36079; + + static const GLenum DRAW_BUFFER0_WEBGL = 34853; + + static const GLenum DRAW_BUFFER1_WEBGL = 34854; + + static const GLenum DRAW_BUFFER2_WEBGL = 34855; + + static const GLenum DRAW_BUFFER3_WEBGL = 34856; + + static const GLenum DRAW_BUFFER4_WEBGL = 34857; + + static const GLenum DRAW_BUFFER5_WEBGL = 34858; + + static const GLenum DRAW_BUFFER6_WEBGL = 34859; + + static const GLenum DRAW_BUFFER7_WEBGL = 34860; + + static const GLenum DRAW_BUFFER8_WEBGL = 34861; + + static const GLenum DRAW_BUFFER9_WEBGL = 34862; + + static const GLenum DRAW_BUFFER10_WEBGL = 34863; + + static const GLenum DRAW_BUFFER11_WEBGL = 34864; + + static const GLenum DRAW_BUFFER12_WEBGL = 34865; + + static const GLenum DRAW_BUFFER13_WEBGL = 34866; + + static const GLenum DRAW_BUFFER14_WEBGL = 34867; + + static const GLenum DRAW_BUFFER15_WEBGL = 34868; + + static const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 36063; + + static const GLenum MAX_DRAW_BUFFERS_WEBGL = 34852; + external void drawBuffersWEBGL(JSArray buffers); } diff --git a/web/lib/src/dom/webgpu.dart b/web/lib/src/dom/webgpu.dart index 7d487678..b338c1e1 100644 --- a/web/lib/src/dom/webgpu.dart +++ b/web/lib/src/dom/webgpu.dart @@ -20,49 +20,69 @@ typedef GPUFlagsConstant = int; external $GPUBufferUsage get GPUBufferUsage; @JS('GPUBufferUsage') extension type $GPUBufferUsage._(JSObject _) implements JSObject { - external static GPUFlagsConstant get MAP_READ; - external static GPUFlagsConstant get MAP_WRITE; - external static GPUFlagsConstant get COPY_SRC; - external static GPUFlagsConstant get COPY_DST; - external static GPUFlagsConstant get INDEX; - external static GPUFlagsConstant get VERTEX; - external static GPUFlagsConstant get UNIFORM; - external static GPUFlagsConstant get STORAGE; - external static GPUFlagsConstant get INDIRECT; - external static GPUFlagsConstant get QUERY_RESOLVE; + static const GPUFlagsConstant MAP_READ = 1; + + static const GPUFlagsConstant MAP_WRITE = 2; + + static const GPUFlagsConstant COPY_SRC = 4; + + static const GPUFlagsConstant COPY_DST = 8; + + static const GPUFlagsConstant INDEX = 16; + + static const GPUFlagsConstant VERTEX = 32; + + static const GPUFlagsConstant UNIFORM = 64; + + static const GPUFlagsConstant STORAGE = 128; + + static const GPUFlagsConstant INDIRECT = 256; + + static const GPUFlagsConstant QUERY_RESOLVE = 512; } @JS() external $GPUMapMode get GPUMapMode; @JS('GPUMapMode') extension type $GPUMapMode._(JSObject _) implements JSObject { - external static GPUFlagsConstant get READ; - external static GPUFlagsConstant get WRITE; + static const GPUFlagsConstant READ = 1; + + static const GPUFlagsConstant WRITE = 2; } @JS() external $GPUTextureUsage get GPUTextureUsage; @JS('GPUTextureUsage') extension type $GPUTextureUsage._(JSObject _) implements JSObject { - external static GPUFlagsConstant get COPY_SRC; - external static GPUFlagsConstant get COPY_DST; - external static GPUFlagsConstant get TEXTURE_BINDING; - external static GPUFlagsConstant get STORAGE_BINDING; - external static GPUFlagsConstant get RENDER_ATTACHMENT; + static const GPUFlagsConstant COPY_SRC = 1; + + static const GPUFlagsConstant COPY_DST = 2; + + static const GPUFlagsConstant TEXTURE_BINDING = 4; + + static const GPUFlagsConstant STORAGE_BINDING = 8; + + static const GPUFlagsConstant RENDER_ATTACHMENT = 16; } @JS() external $GPUShaderStage get GPUShaderStage; @JS('GPUShaderStage') extension type $GPUShaderStage._(JSObject _) implements JSObject { - external static GPUFlagsConstant get VERTEX; - external static GPUFlagsConstant get FRAGMENT; - external static GPUFlagsConstant get COMPUTE; + static const GPUFlagsConstant VERTEX = 1; + + static const GPUFlagsConstant FRAGMENT = 2; + + static const GPUFlagsConstant COMPUTE = 4; } @JS() external $GPUColorWrite get GPUColorWrite; @JS('GPUColorWrite') extension type $GPUColorWrite._(JSObject _) implements JSObject { - external static GPUFlagsConstant get RED; - external static GPUFlagsConstant get GREEN; - external static GPUFlagsConstant get BLUE; - external static GPUFlagsConstant get ALPHA; - external static GPUFlagsConstant get ALL; + static const GPUFlagsConstant RED = 1; + + static const GPUFlagsConstant GREEN = 2; + + static const GPUFlagsConstant BLUE = 4; + + static const GPUFlagsConstant ALPHA = 8; + + static const GPUFlagsConstant ALL = 15; } diff --git a/web/lib/src/dom/webidl.dart b/web/lib/src/dom/webidl.dart index 71ede6c5..7f202225 100644 --- a/web/lib/src/dom/webidl.dart +++ b/web/lib/src/dom/webidl.dart @@ -42,31 +42,55 @@ extension type DOMException._(JSObject _) implements JSObject { String name, ]); - external static int get INDEX_SIZE_ERR; - external static int get DOMSTRING_SIZE_ERR; - external static int get HIERARCHY_REQUEST_ERR; - external static int get WRONG_DOCUMENT_ERR; - external static int get INVALID_CHARACTER_ERR; - external static int get NO_DATA_ALLOWED_ERR; - external static int get NO_MODIFICATION_ALLOWED_ERR; - external static int get NOT_FOUND_ERR; - external static int get NOT_SUPPORTED_ERR; - external static int get INUSE_ATTRIBUTE_ERR; - external static int get INVALID_STATE_ERR; - external static int get SYNTAX_ERR; - external static int get INVALID_MODIFICATION_ERR; - external static int get NAMESPACE_ERR; - external static int get INVALID_ACCESS_ERR; - external static int get VALIDATION_ERR; - external static int get TYPE_MISMATCH_ERR; - external static int get SECURITY_ERR; - external static int get NETWORK_ERR; - external static int get ABORT_ERR; - external static int get URL_MISMATCH_ERR; - external static int get QUOTA_EXCEEDED_ERR; - external static int get TIMEOUT_ERR; - external static int get INVALID_NODE_TYPE_ERR; - external static int get DATA_CLONE_ERR; + static const int INDEX_SIZE_ERR = 1; + + static const int DOMSTRING_SIZE_ERR = 2; + + static const int HIERARCHY_REQUEST_ERR = 3; + + static const int WRONG_DOCUMENT_ERR = 4; + + static const int INVALID_CHARACTER_ERR = 5; + + static const int NO_DATA_ALLOWED_ERR = 6; + + static const int NO_MODIFICATION_ALLOWED_ERR = 7; + + static const int NOT_FOUND_ERR = 8; + + static const int NOT_SUPPORTED_ERR = 9; + + static const int INUSE_ATTRIBUTE_ERR = 10; + + static const int INVALID_STATE_ERR = 11; + + static const int SYNTAX_ERR = 12; + + static const int INVALID_MODIFICATION_ERR = 13; + + static const int NAMESPACE_ERR = 14; + + static const int INVALID_ACCESS_ERR = 15; + + static const int VALIDATION_ERR = 16; + + static const int TYPE_MISMATCH_ERR = 17; + + static const int SECURITY_ERR = 18; + + static const int NETWORK_ERR = 19; + + static const int ABORT_ERR = 20; + + static const int URL_MISMATCH_ERR = 21; + + static const int QUOTA_EXCEEDED_ERR = 22; + + static const int TIMEOUT_ERR = 23; + + static const int INVALID_NODE_TYPE_ERR = 24; + + static const int DATA_CLONE_ERR = 25; /// The **`name`** read-only property of the /// [DOMException] interface returns a string that contains diff --git a/web/lib/src/dom/websockets.dart b/web/lib/src/dom/websockets.dart index 6b32acac..3d54f586 100644 --- a/web/lib/src/dom/websockets.dart +++ b/web/lib/src/dom/websockets.dart @@ -39,10 +39,13 @@ extension type WebSocket._(JSObject _) implements EventTarget, JSObject { JSAny protocols, ]); - external static int get CONNECTING; - external static int get OPEN; - external static int get CLOSING; - external static int get CLOSED; + static const int CONNECTING = 0; + + static const int OPEN = 1; + + static const int CLOSING = 2; + + static const int CLOSED = 3; /// The **`WebSocket.close()`** method closes the /// [WebSocket] connection or connection attempt, if any. If the connection is diff --git a/web/lib/src/dom/xhr.dart b/web/lib/src/dom/xhr.dart index e071390f..d026f878 100644 --- a/web/lib/src/dom/xhr.dart +++ b/web/lib/src/dom/xhr.dart @@ -91,11 +91,15 @@ extension type XMLHttpRequest._(JSObject _) implements XMLHttpRequestEventTarget, JSObject { external factory XMLHttpRequest(); - external static int get UNSENT; - external static int get OPENED; - external static int get HEADERS_RECEIVED; - external static int get LOADING; - external static int get DONE; + static const int UNSENT = 0; + + static const int OPENED = 1; + + static const int HEADERS_RECEIVED = 2; + + static const int LOADING = 3; + + static const int DONE = 4; /// @AvailableInWorkers("window_and_worker_except_service") /// diff --git a/web/test/smoke_test.dart b/web/test/smoke_test.dart index 41990fe6..159ef2d2 100644 --- a/web/test/smoke_test.dart +++ b/web/test/smoke_test.dart @@ -62,4 +62,19 @@ void main() { select[0] = option; expect(select.item(0), option); }); + + test('Constant values can be switched over.', () { + final request = XMLHttpRequest(); + switch (request.readyState) { + case XMLHttpRequest.UNSENT: + break; + case XMLHttpRequest.OPENED: + case XMLHttpRequest.HEADERS_RECEIVED: + case XMLHttpRequest.LOADING: + case XMLHttpRequest.DONE: + default: + throw Exception('Expected `readyState`: ${XMLHttpRequest.UNSENT}, but ' + 'got: ${request.readyState}.'); + } + }); } diff --git a/web_generator/analysis_options.yaml b/web_generator/analysis_options.yaml new file mode 100644 index 00000000..c4ebe406 --- /dev/null +++ b/web_generator/analysis_options.yaml @@ -0,0 +1,26 @@ +# https://dart.dev/guides/language/analysis-options +include: package:dart_flutter_team_lints/analysis_options.yaml + +analyzer: + language: + strict-casts: true + strict-inference: true + strict-raw-types: true + +linter: + rules: + - avoid_bool_literals_in_conditional_expressions + - avoid_private_typedef_functions + - avoid_redundant_argument_values + - avoid_returning_this + - avoid_unused_constructor_parameters + - cancel_subscriptions + - join_return_with_assignment + - literal_only_boolean_expressions + - no_adjacent_strings_in_list + - no_runtimeType_toString + - package_api_docs + - prefer_const_declarations + - prefer_final_locals + - unnecessary_await_in_return + - use_string_buffers diff --git a/web_generator/lib/src/translator.dart b/web_generator/lib/src/translator.dart index 63511712..b20e1f5b 100644 --- a/web_generator/lib/src/translator.dart +++ b/web_generator/lib/src/translator.dart @@ -334,7 +334,9 @@ class _Field extends _Property { } class _Constant extends _Property { - _Constant(super.name, super.idlType); + final String valueType; + final JSAny value; + _Constant(super.name, super.idlType, this.valueType, this.value); } abstract class _OverridableMember { @@ -467,8 +469,8 @@ class _PartialInterfacelike { final constant = member as idl.Constant; // Note that constants do not have browser compatibility data, so we // always emit. - properties - .add(_Constant(_MemberName(constant.name), constant.idlType)); + properties.add(_Constant(_MemberName(constant.name), constant.idlType, + constant.value.type, constant.value.value)); break; case 'attribute': final attribute = member as idl.Attribute; @@ -994,8 +996,8 @@ class Translator { ..optionalParameters.addAll(namedParameters) ..external = true // TODO(srujzs): Should we generate generative or factory constructors? - // With `@staticInterop`, factories were needed, but extension types have - // no such limitation. + // With `@staticInterop`, factories were needed, but extension types + // have no such limitation. ..factory = true); } } @@ -1090,18 +1092,54 @@ class Translator { ); } - List _constant(_Constant constant) { - return [ - code.Method( - (b) => b - ..annotations.addAll(_jsOverride(constant.name.jsOverride)) - ..external = true - ..static = true - ..returns = _typeReference(constant.type, returnType: true) - ..type = code.MethodType.getter - ..name = constant.name.name, - ) - ]; + (List, List) _constant(_Constant constant) { + code.Code? body; + // If it's a value type that we can emit directly in Dart as a constant, + // emit this as a field so users can `switch` over it. Value types taken + // from: https://github.com/w3c/webidl2.js/blob/main/README.md#default-and-const-values + if (constant.valueType == 'string') { + body = code.literalString((constant.value as JSString).toDart).code; + } else if (constant.valueType == 'boolean') { + body = code + .literalBool( + (constant.value as JSString).toDart.toLowerCase() == 'true') + .code; + } else if (constant.valueType == 'number') { + body = + code.literalNum(num.parse((constant.value as JSString).toDart)).code; + } else if (constant.valueType == 'null') { + body = code.literalNull.code; + } + if (body != null) { + return ( + [ + code.Field( + (b) => b + ..external = false + ..static = true + ..modifier = code.FieldModifier.constant + ..type = _typeReference(constant.type, returnType: true) + ..assignment = body + ..name = constant.name.name, + ) + ], + [] + ); + } + return ( + [], + [ + code.Method( + (b) => b + ..annotations.addAll(_jsOverride(constant.name.jsOverride)) + ..external = true + ..static = true + ..returns = _typeReference(constant.type, returnType: true) + ..type = code.MethodType.getter + ..name = constant.name.name, + ) + ] + ); } List _field(_Field field, MdnInterface? mdnInterface) { @@ -1115,19 +1153,20 @@ class Translator { ); } - List _property(_Property member, MdnInterface? mdnInterface) => + (List, List) _property( + _Property member, MdnInterface? mdnInterface) => switch (member) { - _Attribute() => _attribute(member, mdnInterface), - _Field() => _field(member, mdnInterface), + _Attribute() => ([], _attribute(member, mdnInterface)), + _Field() => ([], _field(member, mdnInterface)), _Constant() => _constant(member), }; - List _properties( - List<_Property> properties, MdnInterface? mdnInterface) { - return [ - for (final property in properties) ..._property(property, mdnInterface), - ]; - } + (List, List) _properties( + List<_Property> properties, MdnInterface? mdnInterface) => + properties.fold(([], []), (specs, property) { + final (fields, methods) = _property(property, mdnInterface); + return (specs.$1..addAll(fields), specs.$2..addAll(methods)); + }); List _operations(List<_OverridableOperation> operations) => [for (final operation in operations) _operation(operation)]; @@ -1197,11 +1236,13 @@ class Translator { required _RawType type, required List<_Property> extensionProperties, }) { + final properties = _properties(extensionProperties, null); return code.Extension( (b) => b ..name = '${type.type.snakeToPascal}Extension' ..on = _typeReference(type) - ..methods.addAll(_properties(extensionProperties, null)), + ..fields.addAll(properties.$1) + ..methods.addAll(properties.$2), ); } @@ -1221,10 +1262,12 @@ class Translator { final jsObject = _typeReference(_RawType('JSObject', false)); const representationFieldName = '_'; - final instanceProperties = []; - final staticProperties = []; - for (final property in _properties(properties, mdnInterface)) { - (property.static ? staticProperties : instanceProperties).add(property); + final instancePropertyMethods = []; + final staticPropertyMethods = []; + final propertySpecs = _properties(properties, mdnInterface); + for (final property in propertySpecs.$2) { + (property.static ? staticPropertyMethods : instancePropertyMethods) + .add(property); } return code.ExtensionType((b) => b ..docs.addAll(docs) @@ -1245,10 +1288,11 @@ class Translator { : []) .followedBy(_elementConstructors( jsName, dartClassName, representationFieldName))) + ..fields.addAll(propertySpecs.$1) ..methods.addAll(_operations(staticOperations) - .followedBy(staticProperties) + .followedBy(staticPropertyMethods) .followedBy(_operations(operations)) - .followedBy(instanceProperties) + .followedBy(instancePropertyMethods) .followedBy(dartClassName == 'CSSStyleDeclaration' ? _cssStyleDeclarationProperties() : []))); diff --git a/web_generator/lib/src/webidl_api.dart b/web_generator/lib/src/webidl_api.dart index c84b7205..676b3334 100644 --- a/web_generator/lib/src/webidl_api.dart +++ b/web_generator/lib/src/webidl_api.dart @@ -106,7 +106,7 @@ extension type Field._(JSObject _) implements Member { extension type Value._(JSObject _) implements JSObject { external String get type; - external JSAny? get value; + external JSAny get value; external bool? get negative; } From 98ababfe96f630afca15d616fbf61e5c02ae4dbe Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Tue, 3 Sep 2024 13:27:26 -0700 Subject: [PATCH 2/2] Use switch expression instead of if else --- web/analysis_options.yaml | 2 +- web_generator/lib/src/translator.dart | 25 ++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/web/analysis_options.yaml b/web/analysis_options.yaml index 0c43be87..c7a22845 100644 --- a/web/analysis_options.yaml +++ b/web/analysis_options.yaml @@ -37,4 +37,4 @@ linter: - prefer_const_declarations - prefer_final_locals - unnecessary_await_in_return - - use_string_buffers \ No newline at end of file + - use_string_buffers diff --git a/web_generator/lib/src/translator.dart b/web_generator/lib/src/translator.dart index b20e1f5b..554ea9b4 100644 --- a/web_generator/lib/src/translator.dart +++ b/web_generator/lib/src/translator.dart @@ -1093,23 +1093,18 @@ class Translator { } (List, List) _constant(_Constant constant) { - code.Code? body; // If it's a value type that we can emit directly in Dart as a constant, // emit this as a field so users can `switch` over it. Value types taken // from: https://github.com/w3c/webidl2.js/blob/main/README.md#default-and-const-values - if (constant.valueType == 'string') { - body = code.literalString((constant.value as JSString).toDart).code; - } else if (constant.valueType == 'boolean') { - body = code - .literalBool( - (constant.value as JSString).toDart.toLowerCase() == 'true') - .code; - } else if (constant.valueType == 'number') { - body = - code.literalNum(num.parse((constant.value as JSString).toDart)).code; - } else if (constant.valueType == 'null') { - body = code.literalNull.code; - } + final body = switch (constant.valueType) { + 'string' => code.literalString((constant.value as JSString).toDart), + 'boolean' => code.literalBool( + (constant.value as JSString).toDart.toLowerCase() == 'true'), + 'number' => + code.literalNum(num.parse((constant.value as JSString).toDart)), + 'null' => code.literalNull, + _ => null, + }; if (body != null) { return ( [ @@ -1119,7 +1114,7 @@ class Translator { ..static = true ..modifier = code.FieldModifier.constant ..type = _typeReference(constant.type, returnType: true) - ..assignment = body + ..assignment = body.code ..name = constant.name.name, ) ],