-
Notifications
You must be signed in to change notification settings - Fork 9
Add webgl2
IDL spec and generated code
#18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
03bd546
Add `mediacapture-streams` IDL spec and generated code
MaxDesiatov c6fb68d
Add `mediastream-recording` IDL and generated code
MaxDesiatov 49fa445
Add `webcodecs` IDL spec and generated code
MaxDesiatov a663185
Fix build issue with `BitrateMode`
MaxDesiatov 6f27a48
Resolve merge conflict
MaxDesiatov 60c6643
Fix merge conflict
MaxDesiatov ee0b3d0
Add `webgl1` IDL spec and generated code
MaxDesiatov 3dac17c
Fix merge conflict
MaxDesiatov f27be28
Add `console`, fix `DOMKitDemo` build
MaxDesiatov ed59751
Add `webcodecs` IDL spec and generated code
MaxDesiatov cb5b011
Add `webgl1` IDL spec and generated code
MaxDesiatov 4842b70
Add `webgl2` IDL spec and generated code
MaxDesiatov a646ea6
Add WebGL demo to `DOMKitDemo`
MaxDesiatov dfa88a7
Update copyrights
MaxDesiatov f6f0fed
Bump JSKit, fix BigInt support
MaxDesiatov 9cdaf37
Update main.swift
MaxDesiatov 3a6d5f4
Revert "Bump JSKit, fix BigInt support"
MaxDesiatov 168b245
Regenerate with older JSKit
MaxDesiatov 652cb26
Use revision requirement
MaxDesiatov 3aead91
Merge branch 'main' of github.com:swiftwasm/WebAPIKit into maxd/webgl2
MaxDesiatov 1b0bf31
Regenerate Swift code
MaxDesiatov a1eea27
Uncomment compatible code
MaxDesiatov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add WebGL demo to
DOMKitDemo
- Loading branch information
commit a646ea6e2a7274de0a54c60d7d16753668d9a1ae
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public enum BitrateMode: JSString, JSValueCompatible { | ||
case constant = "constant" | ||
case variable = "variable" | ||
|
||
@inlinable public static func construct(from jsValue: JSValue) -> Self? { | ||
if let string = jsValue.jsString { | ||
return Self(rawValue: string) | ||
} | ||
return nil | ||
} | ||
|
||
@inlinable public init?(string: String) { | ||
self.init(rawValue: JSString(string)) | ||
} | ||
|
||
@inlinable public var jsValue: JSValue { rawValue.jsValue } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public class BlobEvent: Event { | ||
@inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BlobEvent].function! } | ||
|
||
public required init(unsafelyWrapping jsObject: JSObject) { | ||
_data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) | ||
_timecode = ReadonlyAttribute(jsObject: jsObject, name: Strings.timecode) | ||
super.init(unsafelyWrapping: jsObject) | ||
} | ||
|
||
@inlinable public convenience init(type: String, eventInitDict: BlobEventInit) { | ||
self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) | ||
} | ||
|
||
@ReadonlyAttribute | ||
public var data: Blob | ||
|
||
@ReadonlyAttribute | ||
public var timecode: DOMHighResTimeStamp | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public class BlobEventInit: BridgedDictionary { | ||
public convenience init(data: Blob, timecode: DOMHighResTimeStamp) { | ||
let object = JSObject.global[Strings.Object].function!.new() | ||
object[Strings.data] = data.jsValue | ||
object[Strings.timecode] = timecode.jsValue | ||
self.init(unsafelyWrapping: object) | ||
} | ||
|
||
public required init(unsafelyWrapping object: JSObject) { | ||
_data = ReadWriteAttribute(jsObject: object, name: Strings.data) | ||
_timecode = ReadWriteAttribute(jsObject: object, name: Strings.timecode) | ||
super.init(unsafelyWrapping: object) | ||
} | ||
|
||
@ReadWriteAttribute | ||
public var data: Blob | ||
|
||
@ReadWriteAttribute | ||
public var timecode: DOMHighResTimeStamp | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public protocol Any_Bool_or_MediaTrackConstraints: ConvertibleToJSValue {} | ||
extension Bool: Any_Bool_or_MediaTrackConstraints {} | ||
extension MediaTrackConstraints: Any_Bool_or_MediaTrackConstraints {} | ||
|
||
public enum Bool_or_MediaTrackConstraints: JSValueCompatible, Any_Bool_or_MediaTrackConstraints { | ||
case bool(Bool) | ||
case mediaTrackConstraints(MediaTrackConstraints) | ||
|
||
var bool: Bool? { | ||
switch self { | ||
case let .bool(bool): return bool | ||
default: return nil | ||
} | ||
} | ||
|
||
var mediaTrackConstraints: MediaTrackConstraints? { | ||
switch self { | ||
case let .mediaTrackConstraints(mediaTrackConstraints): return mediaTrackConstraints | ||
default: return nil | ||
} | ||
} | ||
|
||
public static func construct(from value: JSValue) -> Self? { | ||
if let bool: Bool = value.fromJSValue() { | ||
return .bool(bool) | ||
} | ||
if let mediaTrackConstraints: MediaTrackConstraints = value.fromJSValue() { | ||
return .mediaTrackConstraints(mediaTrackConstraints) | ||
} | ||
return nil | ||
} | ||
|
||
public var jsValue: JSValue { | ||
switch self { | ||
case let .bool(bool): | ||
return bool.jsValue | ||
case let .mediaTrackConstraints(mediaTrackConstraints): | ||
return mediaTrackConstraints.jsValue | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public protocol Any_Bool_or_ScrollIntoViewOptions: ConvertibleToJSValue {} | ||
extension Bool: Any_Bool_or_ScrollIntoViewOptions {} | ||
extension ScrollIntoViewOptions: Any_Bool_or_ScrollIntoViewOptions {} | ||
|
||
public enum Bool_or_ScrollIntoViewOptions: JSValueCompatible, Any_Bool_or_ScrollIntoViewOptions { | ||
case bool(Bool) | ||
case scrollIntoViewOptions(ScrollIntoViewOptions) | ||
|
||
var bool: Bool? { | ||
switch self { | ||
case let .bool(bool): return bool | ||
default: return nil | ||
} | ||
} | ||
|
||
var scrollIntoViewOptions: ScrollIntoViewOptions? { | ||
switch self { | ||
case let .scrollIntoViewOptions(scrollIntoViewOptions): return scrollIntoViewOptions | ||
default: return nil | ||
} | ||
} | ||
|
||
public static func construct(from value: JSValue) -> Self? { | ||
if let bool: Bool = value.fromJSValue() { | ||
return .bool(bool) | ||
} | ||
if let scrollIntoViewOptions: ScrollIntoViewOptions = value.fromJSValue() { | ||
return .scrollIntoViewOptions(scrollIntoViewOptions) | ||
} | ||
return nil | ||
} | ||
|
||
public var jsValue: JSValue { | ||
switch self { | ||
case let .bool(bool): | ||
return bool.jsValue | ||
case let .scrollIntoViewOptions(scrollIntoViewOptions): | ||
return scrollIntoViewOptions.jsValue | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public class BoxQuadOptions: BridgedDictionary { | ||
public convenience init(box: CSSBoxType, relativeTo: GeometryNode) { | ||
let object = JSObject.global[Strings.Object].function!.new() | ||
object[Strings.box] = box.jsValue | ||
object[Strings.relativeTo] = relativeTo.jsValue | ||
self.init(unsafelyWrapping: object) | ||
} | ||
|
||
public required init(unsafelyWrapping object: JSObject) { | ||
_box = ReadWriteAttribute(jsObject: object, name: Strings.box) | ||
_relativeTo = ReadWriteAttribute(jsObject: object, name: Strings.relativeTo) | ||
super.init(unsafelyWrapping: object) | ||
} | ||
|
||
@ReadWriteAttribute | ||
public var box: CSSBoxType | ||
|
||
@ReadWriteAttribute | ||
public var relativeTo: GeometryNode | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public enum CSSBoxType: JSString, JSValueCompatible { | ||
case margin = "margin" | ||
case border = "border" | ||
case padding = "padding" | ||
case content = "content" | ||
|
||
@inlinable public static func construct(from jsValue: JSValue) -> Self? { | ||
if let string = jsValue.jsString { | ||
return Self(rawValue: string) | ||
} | ||
return nil | ||
} | ||
|
||
@inlinable public init?(string: String) { | ||
self.init(rawValue: JSString(string)) | ||
} | ||
|
||
@inlinable public var jsValue: JSValue { rawValue.jsValue } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public class CSSPseudoElement: EventTarget, GeometryUtils { | ||
@inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CSSPseudoElement].function! } | ||
|
||
public required init(unsafelyWrapping jsObject: JSObject) { | ||
_type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) | ||
_element = ReadonlyAttribute(jsObject: jsObject, name: Strings.element) | ||
_parent = ReadonlyAttribute(jsObject: jsObject, name: Strings.parent) | ||
super.init(unsafelyWrapping: jsObject) | ||
} | ||
|
||
@ReadonlyAttribute | ||
public var type: String | ||
|
||
@ReadonlyAttribute | ||
public var element: Element | ||
|
||
@ReadonlyAttribute | ||
public var parent: CSSPseudoElement_or_Element | ||
|
||
@inlinable public func pseudo(type: String) -> CSSPseudoElement? { | ||
let this = jsObject | ||
return this[Strings.pseudo].function!(this: this, arguments: [type.jsValue]).fromJSValue()! | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! | ||
|
||
import JavaScriptEventLoop | ||
import JavaScriptKit | ||
|
||
public protocol Any_CSSPseudoElement_or_Element: ConvertibleToJSValue {} | ||
extension CSSPseudoElement: Any_CSSPseudoElement_or_Element {} | ||
extension Element: Any_CSSPseudoElement_or_Element {} | ||
|
||
public enum CSSPseudoElement_or_Element: JSValueCompatible, Any_CSSPseudoElement_or_Element { | ||
case cssPseudoElement(CSSPseudoElement) | ||
case element(Element) | ||
|
||
var cssPseudoElement: CSSPseudoElement? { | ||
switch self { | ||
case let .cssPseudoElement(cssPseudoElement): return cssPseudoElement | ||
default: return nil | ||
} | ||
} | ||
|
||
var element: Element? { | ||
switch self { | ||
case let .element(element): return element | ||
default: return nil | ||
} | ||
} | ||
|
||
public static func construct(from value: JSValue) -> Self? { | ||
if let cssPseudoElement: CSSPseudoElement = value.fromJSValue() { | ||
return .cssPseudoElement(cssPseudoElement) | ||
} | ||
if let element: Element = value.fromJSValue() { | ||
return .element(element) | ||
} | ||
return nil | ||
} | ||
|
||
public var jsValue: JSValue { | ||
switch self { | ||
case let .cssPseudoElement(cssPseudoElement): | ||
return cssPseudoElement.jsValue | ||
case let .element(element): | ||
return element.jsValue | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be uncommented, right?