forked from gowebapi/webapi
/
touchevents.go
737 lines (678 loc) · 21.7 KB
/
touchevents.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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
// Code generated by webidl-bind. DO NOT EDIT.
// +build !js
package touchevents
import js "github.com/gowebapi/webapi/core/js"
import (
"github.com/gowebapi/webapi/device/inputcapabilities"
"github.com/gowebapi/webapi/dom/domcore"
"github.com/gowebapi/webapi/html/htmlevent"
)
// using following types:
// domcore.EventTarget
// htmlevent.UIEvent
// inputcapabilities.InputDeviceCapabilities
// source idl files:
// touch-events.idl
// transform files:
// touch-events.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}
}
// enum: TouchType
type TouchType int
const (
DirectTouchType TouchType = iota
StylusTouchType
)
var touchTypeToWasmTable = []string{
"direct", "stylus",
}
var touchTypeFromWasmTable = map[string]TouchType{
"direct": DirectTouchType, "stylus": StylusTouchType,
}
// JSValue is converting this enum into a javascript object
func (this *TouchType) JSValue() js.Value {
return js.ValueOf(this.Value())
}
// Value is converting this into javascript defined
// string value
func (this TouchType) Value() string {
idx := int(this)
if idx >= 0 && idx < len(touchTypeToWasmTable) {
return touchTypeToWasmTable[idx]
}
panic("unknown input value")
}
// TouchTypeFromJS is converting a javascript value into
// a TouchType enum value.
func TouchTypeFromJS(value js.Value) TouchType {
key := value.String()
conv, ok := touchTypeFromWasmTable[key]
if !ok {
panic("unable to convert '" + key + "'")
}
return conv
}
// dictionary: TouchEventInit
type TouchEventInit struct {
Bubbles bool
Cancelable bool
Composed bool
View js.Value
Detail int
SourceCapabilities *inputcapabilities.InputDeviceCapabilities
CtrlKey bool
ShiftKey bool
AltKey bool
MetaKey bool
ModifierAltGraph bool
ModifierCapsLock bool
ModifierFn bool
ModifierFnLock bool
ModifierHyper bool
ModifierNumLock bool
ModifierScrollLock bool
ModifierSuper bool
ModifierSymbol bool
ModifierSymbolLock bool
Touches []*Touch
TargetTouches []*Touch
ChangedTouches []*Touch
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *TouchEventInit) 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.View
out.Set("view", value3)
value4 := _this.Detail
out.Set("detail", value4)
value5 := _this.SourceCapabilities.JSValue()
out.Set("sourceCapabilities", value5)
value6 := _this.CtrlKey
out.Set("ctrlKey", value6)
value7 := _this.ShiftKey
out.Set("shiftKey", value7)
value8 := _this.AltKey
out.Set("altKey", value8)
value9 := _this.MetaKey
out.Set("metaKey", value9)
value10 := _this.ModifierAltGraph
out.Set("modifierAltGraph", value10)
value11 := _this.ModifierCapsLock
out.Set("modifierCapsLock", value11)
value12 := _this.ModifierFn
out.Set("modifierFn", value12)
value13 := _this.ModifierFnLock
out.Set("modifierFnLock", value13)
value14 := _this.ModifierHyper
out.Set("modifierHyper", value14)
value15 := _this.ModifierNumLock
out.Set("modifierNumLock", value15)
value16 := _this.ModifierScrollLock
out.Set("modifierScrollLock", value16)
value17 := _this.ModifierSuper
out.Set("modifierSuper", value17)
value18 := _this.ModifierSymbol
out.Set("modifierSymbol", value18)
value19 := _this.ModifierSymbolLock
out.Set("modifierSymbolLock", value19)
value20 := js.Global().Get("Array").New(len(_this.Touches))
for __idx20, __seq_in20 := range _this.Touches {
__seq_out20 := __seq_in20.JSValue()
value20.SetIndex(__idx20, __seq_out20)
}
out.Set("touches", value20)
value21 := js.Global().Get("Array").New(len(_this.TargetTouches))
for __idx21, __seq_in21 := range _this.TargetTouches {
__seq_out21 := __seq_in21.JSValue()
value21.SetIndex(__idx21, __seq_out21)
}
out.Set("targetTouches", value21)
value22 := js.Global().Get("Array").New(len(_this.ChangedTouches))
for __idx22, __seq_in22 := range _this.ChangedTouches {
__seq_out22 := __seq_in22.JSValue()
value22.SetIndex(__idx22, __seq_out22)
}
out.Set("changedTouches", value22)
return out
}
// TouchEventInitFromJS is allocating a new
// TouchEventInit object and copy all values from
// input javascript object
func TouchEventInitFromJS(value js.Wrapper) *TouchEventInit {
input := value.JSValue()
var out TouchEventInit
var (
value0 bool // javascript: boolean {bubbles Bubbles bubbles}
value1 bool // javascript: boolean {cancelable Cancelable cancelable}
value2 bool // javascript: boolean {composed Composed composed}
value3 js.Value // javascript: Window {view View view}
value4 int // javascript: long {detail Detail detail}
value5 *inputcapabilities.InputDeviceCapabilities // javascript: InputDeviceCapabilities {sourceCapabilities SourceCapabilities sourceCapabilities}
value6 bool // javascript: boolean {ctrlKey CtrlKey ctrlKey}
value7 bool // javascript: boolean {shiftKey ShiftKey shiftKey}
value8 bool // javascript: boolean {altKey AltKey altKey}
value9 bool // javascript: boolean {metaKey MetaKey metaKey}
value10 bool // javascript: boolean {modifierAltGraph ModifierAltGraph modifierAltGraph}
value11 bool // javascript: boolean {modifierCapsLock ModifierCapsLock modifierCapsLock}
value12 bool // javascript: boolean {modifierFn ModifierFn modifierFn}
value13 bool // javascript: boolean {modifierFnLock ModifierFnLock modifierFnLock}
value14 bool // javascript: boolean {modifierHyper ModifierHyper modifierHyper}
value15 bool // javascript: boolean {modifierNumLock ModifierNumLock modifierNumLock}
value16 bool // javascript: boolean {modifierScrollLock ModifierScrollLock modifierScrollLock}
value17 bool // javascript: boolean {modifierSuper ModifierSuper modifierSuper}
value18 bool // javascript: boolean {modifierSymbol ModifierSymbol modifierSymbol}
value19 bool // javascript: boolean {modifierSymbolLock ModifierSymbolLock modifierSymbolLock}
value20 []*Touch // javascript: sequence<Touch> {touches Touches touches}
value21 []*Touch // javascript: sequence<Touch> {targetTouches TargetTouches targetTouches}
value22 []*Touch // javascript: sequence<Touch> {changedTouches ChangedTouches changedTouches}
)
value0 = (input.Get("bubbles")).Bool()
out.Bubbles = value0
value1 = (input.Get("cancelable")).Bool()
out.Cancelable = value1
value2 = (input.Get("composed")).Bool()
out.Composed = value2
value3 = input.Get("view")
out.View = value3
value4 = (input.Get("detail")).Int()
out.Detail = value4
if input.Get("sourceCapabilities").Type() != js.TypeNull && input.Get("sourceCapabilities").Type() != js.TypeUndefined {
value5 = inputcapabilities.InputDeviceCapabilitiesFromJS(input.Get("sourceCapabilities"))
}
out.SourceCapabilities = value5
value6 = (input.Get("ctrlKey")).Bool()
out.CtrlKey = value6
value7 = (input.Get("shiftKey")).Bool()
out.ShiftKey = value7
value8 = (input.Get("altKey")).Bool()
out.AltKey = value8
value9 = (input.Get("metaKey")).Bool()
out.MetaKey = value9
value10 = (input.Get("modifierAltGraph")).Bool()
out.ModifierAltGraph = value10
value11 = (input.Get("modifierCapsLock")).Bool()
out.ModifierCapsLock = value11
value12 = (input.Get("modifierFn")).Bool()
out.ModifierFn = value12
value13 = (input.Get("modifierFnLock")).Bool()
out.ModifierFnLock = value13
value14 = (input.Get("modifierHyper")).Bool()
out.ModifierHyper = value14
value15 = (input.Get("modifierNumLock")).Bool()
out.ModifierNumLock = value15
value16 = (input.Get("modifierScrollLock")).Bool()
out.ModifierScrollLock = value16
value17 = (input.Get("modifierSuper")).Bool()
out.ModifierSuper = value17
value18 = (input.Get("modifierSymbol")).Bool()
out.ModifierSymbol = value18
value19 = (input.Get("modifierSymbolLock")).Bool()
out.ModifierSymbolLock = value19
__length20 := input.Get("touches").Length()
__array20 := make([]*Touch, __length20, __length20)
for __idx20 := 0; __idx20 < __length20; __idx20++ {
var __seq_out20 *Touch
__seq_in20 := input.Get("touches").Index(__idx20)
__seq_out20 = TouchFromJS(__seq_in20)
__array20[__idx20] = __seq_out20
}
value20 = __array20
out.Touches = value20
__length21 := input.Get("targetTouches").Length()
__array21 := make([]*Touch, __length21, __length21)
for __idx21 := 0; __idx21 < __length21; __idx21++ {
var __seq_out21 *Touch
__seq_in21 := input.Get("targetTouches").Index(__idx21)
__seq_out21 = TouchFromJS(__seq_in21)
__array21[__idx21] = __seq_out21
}
value21 = __array21
out.TargetTouches = value21
__length22 := input.Get("changedTouches").Length()
__array22 := make([]*Touch, __length22, __length22)
for __idx22 := 0; __idx22 < __length22; __idx22++ {
var __seq_out22 *Touch
__seq_in22 := input.Get("changedTouches").Index(__idx22)
__seq_out22 = TouchFromJS(__seq_in22)
__array22[__idx22] = __seq_out22
}
value22 = __array22
out.ChangedTouches = value22
return &out
}
// dictionary: TouchInit
type TouchInit struct {
Identifier int
Target *domcore.EventTarget
ClientX float64
ClientY float64
ScreenX float64
ScreenY float64
PageX float64
PageY float64
RadiusX float32
RadiusY float32
RotationAngle float32
Force float32
AltitudeAngle float64
AzimuthAngle float64
TouchType TouchType
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *TouchInit) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Identifier
out.Set("identifier", value0)
value1 := _this.Target.JSValue()
out.Set("target", value1)
value2 := _this.ClientX
out.Set("clientX", value2)
value3 := _this.ClientY
out.Set("clientY", value3)
value4 := _this.ScreenX
out.Set("screenX", value4)
value5 := _this.ScreenY
out.Set("screenY", value5)
value6 := _this.PageX
out.Set("pageX", value6)
value7 := _this.PageY
out.Set("pageY", value7)
value8 := _this.RadiusX
out.Set("radiusX", value8)
value9 := _this.RadiusY
out.Set("radiusY", value9)
value10 := _this.RotationAngle
out.Set("rotationAngle", value10)
value11 := _this.Force
out.Set("force", value11)
value12 := _this.AltitudeAngle
out.Set("altitudeAngle", value12)
value13 := _this.AzimuthAngle
out.Set("azimuthAngle", value13)
value14 := _this.TouchType.JSValue()
out.Set("touchType", value14)
return out
}
// TouchInitFromJS is allocating a new
// TouchInit object and copy all values from
// input javascript object
func TouchInitFromJS(value js.Wrapper) *TouchInit {
input := value.JSValue()
var out TouchInit
var (
value0 int // javascript: long {identifier Identifier identifier}
value1 *domcore.EventTarget // javascript: EventTarget {target Target target}
value2 float64 // javascript: double {clientX ClientX clientX}
value3 float64 // javascript: double {clientY ClientY clientY}
value4 float64 // javascript: double {screenX ScreenX screenX}
value5 float64 // javascript: double {screenY ScreenY screenY}
value6 float64 // javascript: double {pageX PageX pageX}
value7 float64 // javascript: double {pageY PageY pageY}
value8 float32 // javascript: float {radiusX RadiusX radiusX}
value9 float32 // javascript: float {radiusY RadiusY radiusY}
value10 float32 // javascript: float {rotationAngle RotationAngle rotationAngle}
value11 float32 // javascript: float {force Force force}
value12 float64 // javascript: double {altitudeAngle AltitudeAngle altitudeAngle}
value13 float64 // javascript: double {azimuthAngle AzimuthAngle azimuthAngle}
value14 TouchType // javascript: TouchType {touchType TouchType touchType}
)
value0 = (input.Get("identifier")).Int()
out.Identifier = value0
value1 = domcore.EventTargetFromJS(input.Get("target"))
out.Target = value1
value2 = (input.Get("clientX")).Float()
out.ClientX = value2
value3 = (input.Get("clientY")).Float()
out.ClientY = value3
value4 = (input.Get("screenX")).Float()
out.ScreenX = value4
value5 = (input.Get("screenY")).Float()
out.ScreenY = value5
value6 = (input.Get("pageX")).Float()
out.PageX = value6
value7 = (input.Get("pageY")).Float()
out.PageY = value7
value8 = (float32)((input.Get("radiusX")).Float())
out.RadiusX = value8
value9 = (float32)((input.Get("radiusY")).Float())
out.RadiusY = value9
value10 = (float32)((input.Get("rotationAngle")).Float())
out.RotationAngle = value10
value11 = (float32)((input.Get("force")).Float())
out.Force = value11
value12 = (input.Get("altitudeAngle")).Float()
out.AltitudeAngle = value12
value13 = (input.Get("azimuthAngle")).Float()
out.AzimuthAngle = value13
value14 = TouchTypeFromJS(input.Get("touchType"))
out.TouchType = value14
return &out
}
// class: Touch
type Touch struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *Touch) JSValue() js.Value {
return _this.Value_JS
}
// TouchFromJS is casting a js.Wrapper into Touch.
func TouchFromJS(value js.Wrapper) *Touch {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &Touch{}
ret.Value_JS = input
return ret
}
func NewTouch(touchInitDict *TouchInit) (_result *Touch) {
_klass := js.Global().Get("Touch")
var (
_args [1]interface{}
_end int
)
_p0 := touchInitDict.JSValue()
_args[0] = _p0
_end++
_returned := _klass.New(_args[0:_end]...)
var (
_converted *Touch // javascript: Touch _what_return_name
)
_converted = TouchFromJS(_returned)
_result = _converted
return
}
// Identifier returning attribute 'identifier' with
// type int (idl: long).
func (_this *Touch) Identifier() int {
var ret int
value := _this.Value_JS.Get("identifier")
ret = (value).Int()
return ret
}
// Target returning attribute 'target' with
// type domcore.EventTarget (idl: EventTarget).
func (_this *Touch) Target() *domcore.EventTarget {
var ret *domcore.EventTarget
value := _this.Value_JS.Get("target")
ret = domcore.EventTargetFromJS(value)
return ret
}
// ScreenX returning attribute 'screenX' with
// type float64 (idl: double).
func (_this *Touch) ScreenX() float64 {
var ret float64
value := _this.Value_JS.Get("screenX")
ret = (value).Float()
return ret
}
// ScreenY returning attribute 'screenY' with
// type float64 (idl: double).
func (_this *Touch) ScreenY() float64 {
var ret float64
value := _this.Value_JS.Get("screenY")
ret = (value).Float()
return ret
}
// ClientX returning attribute 'clientX' with
// type float64 (idl: double).
func (_this *Touch) ClientX() float64 {
var ret float64
value := _this.Value_JS.Get("clientX")
ret = (value).Float()
return ret
}
// ClientY returning attribute 'clientY' with
// type float64 (idl: double).
func (_this *Touch) ClientY() float64 {
var ret float64
value := _this.Value_JS.Get("clientY")
ret = (value).Float()
return ret
}
// PageX returning attribute 'pageX' with
// type float64 (idl: double).
func (_this *Touch) PageX() float64 {
var ret float64
value := _this.Value_JS.Get("pageX")
ret = (value).Float()
return ret
}
// PageY returning attribute 'pageY' with
// type float64 (idl: double).
func (_this *Touch) PageY() float64 {
var ret float64
value := _this.Value_JS.Get("pageY")
ret = (value).Float()
return ret
}
// RadiusX returning attribute 'radiusX' with
// type float32 (idl: float).
func (_this *Touch) RadiusX() float32 {
var ret float32
value := _this.Value_JS.Get("radiusX")
ret = (float32)((value).Float())
return ret
}
// RadiusY returning attribute 'radiusY' with
// type float32 (idl: float).
func (_this *Touch) RadiusY() float32 {
var ret float32
value := _this.Value_JS.Get("radiusY")
ret = (float32)((value).Float())
return ret
}
// RotationAngle returning attribute 'rotationAngle' with
// type float32 (idl: float).
func (_this *Touch) RotationAngle() float32 {
var ret float32
value := _this.Value_JS.Get("rotationAngle")
ret = (float32)((value).Float())
return ret
}
// Force returning attribute 'force' with
// type float32 (idl: float).
func (_this *Touch) Force() float32 {
var ret float32
value := _this.Value_JS.Get("force")
ret = (float32)((value).Float())
return ret
}
// AltitudeAngle returning attribute 'altitudeAngle' with
// type float32 (idl: float).
func (_this *Touch) AltitudeAngle() float32 {
var ret float32
value := _this.Value_JS.Get("altitudeAngle")
ret = (float32)((value).Float())
return ret
}
// AzimuthAngle returning attribute 'azimuthAngle' with
// type float32 (idl: float).
func (_this *Touch) AzimuthAngle() float32 {
var ret float32
value := _this.Value_JS.Get("azimuthAngle")
ret = (float32)((value).Float())
return ret
}
// TouchType returning attribute 'touchType' with
// type TouchType (idl: TouchType).
func (_this *Touch) TouchType() TouchType {
var ret TouchType
value := _this.Value_JS.Get("touchType")
ret = TouchTypeFromJS(value)
return ret
}
// class: TouchEvent
type TouchEvent struct {
htmlevent.UIEvent
}
// TouchEventFromJS is casting a js.Wrapper into TouchEvent.
func TouchEventFromJS(value js.Wrapper) *TouchEvent {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &TouchEvent{}
ret.Value_JS = input
return ret
}
func NewTouchEvent(_type string, eventInitDict *TouchEventInit) (_result *TouchEvent) {
_klass := js.Global().Get("TouchEvent")
var (
_args [2]interface{}
_end int
)
_p0 := _type
_args[0] = _p0
_end++
if eventInitDict != nil {
_p1 := eventInitDict.JSValue()
_args[1] = _p1
_end++
}
_returned := _klass.New(_args[0:_end]...)
var (
_converted *TouchEvent // javascript: TouchEvent _what_return_name
)
_converted = TouchEventFromJS(_returned)
_result = _converted
return
}
// Touches returning attribute 'touches' with
// type TouchList (idl: TouchList).
func (_this *TouchEvent) Touches() *TouchList {
var ret *TouchList
value := _this.Value_JS.Get("touches")
ret = TouchListFromJS(value)
return ret
}
// TargetTouches returning attribute 'targetTouches' with
// type TouchList (idl: TouchList).
func (_this *TouchEvent) TargetTouches() *TouchList {
var ret *TouchList
value := _this.Value_JS.Get("targetTouches")
ret = TouchListFromJS(value)
return ret
}
// ChangedTouches returning attribute 'changedTouches' with
// type TouchList (idl: TouchList).
func (_this *TouchEvent) ChangedTouches() *TouchList {
var ret *TouchList
value := _this.Value_JS.Get("changedTouches")
ret = TouchListFromJS(value)
return ret
}
// AltKey returning attribute 'altKey' with
// type bool (idl: boolean).
func (_this *TouchEvent) AltKey() bool {
var ret bool
value := _this.Value_JS.Get("altKey")
ret = (value).Bool()
return ret
}
// MetaKey returning attribute 'metaKey' with
// type bool (idl: boolean).
func (_this *TouchEvent) MetaKey() bool {
var ret bool
value := _this.Value_JS.Get("metaKey")
ret = (value).Bool()
return ret
}
// CtrlKey returning attribute 'ctrlKey' with
// type bool (idl: boolean).
func (_this *TouchEvent) CtrlKey() bool {
var ret bool
value := _this.Value_JS.Get("ctrlKey")
ret = (value).Bool()
return ret
}
// ShiftKey returning attribute 'shiftKey' with
// type bool (idl: boolean).
func (_this *TouchEvent) ShiftKey() bool {
var ret bool
value := _this.Value_JS.Get("shiftKey")
ret = (value).Bool()
return ret
}
// class: TouchList
type TouchList struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *TouchList) JSValue() js.Value {
return _this.Value_JS
}
// TouchListFromJS is casting a js.Wrapper into TouchList.
func TouchListFromJS(value js.Wrapper) *TouchList {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &TouchList{}
ret.Value_JS = input
return ret
}
// Length returning attribute 'length' with
// type uint (idl: unsigned long).
func (_this *TouchList) Length() uint {
var ret uint
value := _this.Value_JS.Get("length")
ret = (uint)((value).Int())
return ret
}
func (_this *TouchList) Index(index uint) (_result *Touch) {
var (
_args [1]interface{}
_end int
)
_p0 := index
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("item", _args[0:_end]...)
var (
_converted *Touch // javascript: Touch _what_return_name
)
if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
_converted = TouchFromJS(_returned)
}
_result = _converted
return
}
func (_this *TouchList) Item(index uint) (_result *Touch) {
var (
_args [1]interface{}
_end int
)
_p0 := index
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("item", _args[0:_end]...)
var (
_converted *Touch // javascript: Touch _what_return_name
)
if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
_converted = TouchFromJS(_returned)
}
_result = _converted
return
}