-
Notifications
You must be signed in to change notification settings - Fork 12
/
animations.go
301 lines (265 loc) · 7.7 KB
/
animations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
// Code generated by webidl-bind. DO NOT EDIT.
// +build !js
package animations
import js "github.com/gowebapi/webapi/core/js"
import (
"github.com/gowebapi/webapi/core"
"github.com/gowebapi/webapi/css/cssom"
"github.com/gowebapi/webapi/dom/domcore"
)
// using following types:
// cssom.CSSRule
// cssom.CSSRuleList
// cssom.CSSStyleDeclaration
// domcore.Event
// source idl files:
// css-animations.idl
// transform files:
// css-animations.go.md
// workaround for compiler error
func unused(value interface{}) {
// TODO remove this method
}
type Union struct {
Value js.Value
}
func (u *Union) JSValue() js.Value {
return u.Value
}
func UnionFromJS(value js.Value) *Union {
return &Union{Value: value}
}
// dictionary: AnimationEventInit
type AnimationEventInit struct {
Bubbles bool
Cancelable bool
Composed bool
AnimationName string
ElapsedTime float64
PseudoElement string
}
// JSValue is allocating a new javascript object and copy
// all values
func (_this *AnimationEventInit) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Bubbles
out.Set("bubbles", value0)
value1 := _this.Cancelable
out.Set("cancelable", value1)
value2 := _this.Composed
out.Set("composed", value2)
value3 := _this.AnimationName
out.Set("animationName", value3)
value4 := _this.ElapsedTime
out.Set("elapsedTime", value4)
value5 := _this.PseudoElement
out.Set("pseudoElement", value5)
return out
}
// AnimationEventInitFromJS is allocating a new
// AnimationEventInit object and copy all values in the value javascript object.
func AnimationEventInitFromJS(value js.Value) *AnimationEventInit {
var out AnimationEventInit
var (
value0 bool // javascript: boolean {bubbles Bubbles bubbles}
value1 bool // javascript: boolean {cancelable Cancelable cancelable}
value2 bool // javascript: boolean {composed Composed composed}
value3 string // javascript: DOMString {animationName AnimationName animationName}
value4 float64 // javascript: double {elapsedTime ElapsedTime elapsedTime}
value5 string // javascript: DOMString {pseudoElement PseudoElement pseudoElement}
)
value0 = (value.Get("bubbles")).Bool()
out.Bubbles = value0
value1 = (value.Get("cancelable")).Bool()
out.Cancelable = value1
value2 = (value.Get("composed")).Bool()
out.Composed = value2
value3 = (value.Get("animationName")).String()
out.AnimationName = value3
value4 = (value.Get("elapsedTime")).Float()
out.ElapsedTime = value4
value5 = (value.Get("pseudoElement")).String()
out.PseudoElement = value5
return &out
}
// class: AnimationEvent
type AnimationEvent struct {
domcore.Event
}
// AnimationEventFromJS is casting a js.Value into AnimationEvent.
func AnimationEventFromJS(value js.Value) *AnimationEvent {
if typ := value.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &AnimationEvent{}
ret.Value_JS = value
return ret
}
// AnimationEventFromJS is casting from something that holds a js.Value into AnimationEvent.
func AnimationEventFromWrapper(input core.Wrapper) *AnimationEvent {
return AnimationEventFromJS(input.JSValue())
}
func NewAnimationEvent(_type string, animationEventInitDict *AnimationEventInit) (_result *AnimationEvent) {
_klass := js.Global().Get("AnimationEvent")
var (
_args [2]interface{}
_end int
)
_p0 := _type
_args[0] = _p0
_end++
if animationEventInitDict != nil {
_p1 := animationEventInitDict.JSValue()
_args[1] = _p1
_end++
}
_returned := _klass.New(_args[0:_end]...)
var (
_converted *AnimationEvent // javascript: AnimationEvent _what_return_name
)
_converted = AnimationEventFromJS(_returned)
_result = _converted
return
}
// AnimationName returning attribute 'animationName' with
// type string (idl: DOMString).
func (_this *AnimationEvent) AnimationName() string {
var ret string
value := _this.Value_JS.Get("animationName")
ret = (value).String()
return ret
}
// ElapsedTime returning attribute 'elapsedTime' with
// type float64 (idl: double).
func (_this *AnimationEvent) ElapsedTime() float64 {
var ret float64
value := _this.Value_JS.Get("elapsedTime")
ret = (value).Float()
return ret
}
// PseudoElement returning attribute 'pseudoElement' with
// type string (idl: DOMString).
func (_this *AnimationEvent) PseudoElement() string {
var ret string
value := _this.Value_JS.Get("pseudoElement")
ret = (value).String()
return ret
}
// class: CSSKeyframeRule
type CSSKeyframeRule struct {
cssom.CSSRule
}
// CSSKeyframeRuleFromJS is casting a js.Value into CSSKeyframeRule.
func CSSKeyframeRuleFromJS(value js.Value) *CSSKeyframeRule {
if typ := value.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &CSSKeyframeRule{}
ret.Value_JS = value
return ret
}
// CSSKeyframeRuleFromJS is casting from something that holds a js.Value into CSSKeyframeRule.
func CSSKeyframeRuleFromWrapper(input core.Wrapper) *CSSKeyframeRule {
return CSSKeyframeRuleFromJS(input.JSValue())
}
// KeyText returning attribute 'keyText' with
// type string (idl: DOMString).
func (_this *CSSKeyframeRule) KeyText() string {
var ret string
value := _this.Value_JS.Get("keyText")
ret = (value).String()
return ret
}
// SetKeyText setting attribute 'keyText' with
// type string (idl: DOMString).
func (_this *CSSKeyframeRule) SetKeyText(value string) {
input := value
_this.Value_JS.Set("keyText", input)
}
// Style returning attribute 'style' with
// type cssom.CSSStyleDeclaration (idl: CSSStyleDeclaration).
func (_this *CSSKeyframeRule) Style() *cssom.CSSStyleDeclaration {
var ret *cssom.CSSStyleDeclaration
value := _this.Value_JS.Get("style")
ret = cssom.CSSStyleDeclarationFromJS(value)
return ret
}
// class: CSSKeyframesRule
type CSSKeyframesRule struct {
cssom.CSSRule
}
// CSSKeyframesRuleFromJS is casting a js.Value into CSSKeyframesRule.
func CSSKeyframesRuleFromJS(value js.Value) *CSSKeyframesRule {
if typ := value.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &CSSKeyframesRule{}
ret.Value_JS = value
return ret
}
// CSSKeyframesRuleFromJS is casting from something that holds a js.Value into CSSKeyframesRule.
func CSSKeyframesRuleFromWrapper(input core.Wrapper) *CSSKeyframesRule {
return CSSKeyframesRuleFromJS(input.JSValue())
}
// Name returning attribute 'name' with
// type string (idl: DOMString).
func (_this *CSSKeyframesRule) Name() string {
var ret string
value := _this.Value_JS.Get("name")
ret = (value).String()
return ret
}
// SetName setting attribute 'name' with
// type string (idl: DOMString).
func (_this *CSSKeyframesRule) SetName(value string) {
input := value
_this.Value_JS.Set("name", input)
}
// CssRules returning attribute 'cssRules' with
// type cssom.CSSRuleList (idl: CSSRuleList).
func (_this *CSSKeyframesRule) CssRules() *cssom.CSSRuleList {
var ret *cssom.CSSRuleList
value := _this.Value_JS.Get("cssRules")
ret = cssom.CSSRuleListFromJS(value)
return ret
}
func (_this *CSSKeyframesRule) AppendRule(rule string) {
var (
_args [1]interface{}
_end int
)
_p0 := rule
_args[0] = _p0
_end++
_this.Value_JS.Call("appendRule", _args[0:_end]...)
return
}
func (_this *CSSKeyframesRule) DeleteRule(_select string) {
var (
_args [1]interface{}
_end int
)
_p0 := _select
_args[0] = _p0
_end++
_this.Value_JS.Call("deleteRule", _args[0:_end]...)
return
}
func (_this *CSSKeyframesRule) FindRule(_select string) (_result *CSSKeyframeRule) {
var (
_args [1]interface{}
_end int
)
_p0 := _select
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("findRule", _args[0:_end]...)
var (
_converted *CSSKeyframeRule // javascript: CSSKeyframeRule _what_return_name
)
if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
_converted = CSSKeyframeRuleFromJS(_returned)
}
_result = _converted
return
}