/
loading.go
1627 lines (1458 loc) · 43.5 KB
/
loading.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
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by webidl-bind. DO NOT EDIT.
// +build !js
package loading
import js "github.com/gowebapi/webapi/core/js"
import (
"github.com/gowebapi/webapi/core"
"github.com/gowebapi/webapi/dom/domcore"
"github.com/gowebapi/webapi/javascript"
)
// using following types:
// domcore.Event
// domcore.EventHandler
// domcore.EventTarget
// javascript.FrozenArray
// javascript.Promise
// javascript.PromiseFinally
// source idl files:
// css-font-loading.idl
// promises.idl
// transform files:
// css-font-loading.go.md
// promises.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: FontFaceLoadStatus
type FontFaceLoadStatus int
const (
UnloadedFontFaceLoadStatus FontFaceLoadStatus = iota
LoadingFontFaceLoadStatus
LoadedFontFaceLoadStatus
ErrorFontFaceLoadStatus
)
var fontFaceLoadStatusToWasmTable = []string{
"unloaded", "loading", "loaded", "error",
}
var fontFaceLoadStatusFromWasmTable = map[string]FontFaceLoadStatus{
"unloaded": UnloadedFontFaceLoadStatus, "loading": LoadingFontFaceLoadStatus, "loaded": LoadedFontFaceLoadStatus, "error": ErrorFontFaceLoadStatus,
}
// JSValue is converting this enum into a javascript object
func (this *FontFaceLoadStatus) JSValue() js.Value {
return js.ValueOf(this.Value())
}
// Value is converting this into javascript defined
// string value
func (this FontFaceLoadStatus) Value() string {
idx := int(this)
if idx >= 0 && idx < len(fontFaceLoadStatusToWasmTable) {
return fontFaceLoadStatusToWasmTable[idx]
}
panic("unknown input value")
}
// FontFaceLoadStatusFromJS is converting a javascript value into
// a FontFaceLoadStatus enum value.
func FontFaceLoadStatusFromJS(value js.Value) FontFaceLoadStatus {
key := value.String()
conv, ok := fontFaceLoadStatusFromWasmTable[key]
if !ok {
panic("unable to convert '" + key + "'")
}
return conv
}
// enum: FontFaceSetLoadStatus
type FontFaceSetLoadStatus int
const (
LoadingFontFaceSetLoadStatus FontFaceSetLoadStatus = iota
LoadedFontFaceSetLoadStatus
)
var fontFaceSetLoadStatusToWasmTable = []string{
"loading", "loaded",
}
var fontFaceSetLoadStatusFromWasmTable = map[string]FontFaceSetLoadStatus{
"loading": LoadingFontFaceSetLoadStatus, "loaded": LoadedFontFaceSetLoadStatus,
}
// JSValue is converting this enum into a javascript object
func (this *FontFaceSetLoadStatus) JSValue() js.Value {
return js.ValueOf(this.Value())
}
// Value is converting this into javascript defined
// string value
func (this FontFaceSetLoadStatus) Value() string {
idx := int(this)
if idx >= 0 && idx < len(fontFaceSetLoadStatusToWasmTable) {
return fontFaceSetLoadStatusToWasmTable[idx]
}
panic("unknown input value")
}
// FontFaceSetLoadStatusFromJS is converting a javascript value into
// a FontFaceSetLoadStatus enum value.
func FontFaceSetLoadStatusFromJS(value js.Value) FontFaceSetLoadStatus {
key := value.String()
conv, ok := fontFaceSetLoadStatusFromWasmTable[key]
if !ok {
panic("unable to convert '" + key + "'")
}
return conv
}
// callback: FontFaceSetForEach
type FontFaceSetForEachFunc func(currentValue *FontFace, currentValueAgain *FontFace, listObj *FontFaceSet)
// FontFaceSetForEach is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type FontFaceSetForEach js.Func
func FontFaceSetForEachToJS(callback FontFaceSetForEachFunc) *FontFaceSetForEach {
if callback == nil {
return nil
}
ret := FontFaceSetForEach(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 *FontFace // javascript: FontFace currentValue
_p1 *FontFace // javascript: FontFace currentValueAgain
_p2 *FontFaceSet // javascript: FontFaceSet listObj
)
_p0 = FontFaceFromJS(args[0])
_p1 = FontFaceFromJS(args[1])
_p2 = FontFaceSetFromJS(args[2])
callback(_p0, _p1, _p2)
// returning no return value
return nil
}))
return &ret
}
func FontFaceSetForEachFromJS(_value js.Value) FontFaceSetForEachFunc {
return func(currentValue *FontFace, currentValueAgain *FontFace, listObj *FontFaceSet) {
var (
_args [3]interface{}
_end int
)
_p0 := currentValue.JSValue()
_args[0] = _p0
_end++
_p1 := currentValueAgain.JSValue()
_args[1] = _p1
_end++
_p2 := listObj.JSValue()
_args[2] = _p2
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnFulfilled
type PromiseFontFaceOnFulfilledFunc func(value *FontFace)
// PromiseFontFaceOnFulfilled is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseFontFaceOnFulfilled js.Func
func PromiseFontFaceOnFulfilledToJS(callback PromiseFontFaceOnFulfilledFunc) *PromiseFontFaceOnFulfilled {
if callback == nil {
return nil
}
ret := PromiseFontFaceOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 *FontFace // javascript: FontFace value
)
_p0 = FontFaceFromJS(args[0])
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseFontFaceOnFulfilledFromJS(_value js.Value) PromiseFontFaceOnFulfilledFunc {
return func(value *FontFace) {
var (
_args [1]interface{}
_end int
)
_p0 := value.JSValue()
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnRejected
type PromiseFontFaceOnRejectedFunc func(reason js.Value)
// PromiseFontFaceOnRejected is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseFontFaceOnRejected js.Func
func PromiseFontFaceOnRejectedToJS(callback PromiseFontFaceOnRejectedFunc) *PromiseFontFaceOnRejected {
if callback == nil {
return nil
}
ret := PromiseFontFaceOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 js.Value // javascript: any reason
)
_p0 = args[0]
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseFontFaceOnRejectedFromJS(_value js.Value) PromiseFontFaceOnRejectedFunc {
return func(reason js.Value) {
var (
_args [1]interface{}
_end int
)
_p0 := reason
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnFulfilled
type PromiseSequenceFontFaceOnFulfilledFunc func(value []*FontFace)
// PromiseSequenceFontFaceOnFulfilled is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseSequenceFontFaceOnFulfilled js.Func
func PromiseSequenceFontFaceOnFulfilledToJS(callback PromiseSequenceFontFaceOnFulfilledFunc) *PromiseSequenceFontFaceOnFulfilled {
if callback == nil {
return nil
}
ret := PromiseSequenceFontFaceOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 []*FontFace // javascript: sequence<FontFace> value
)
__length0 := args[0].Length()
__array0 := make([]*FontFace, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *FontFace
__seq_in0 := args[0].Index(__idx0)
__seq_out0 = FontFaceFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_p0 = __array0
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseSequenceFontFaceOnFulfilledFromJS(_value js.Value) PromiseSequenceFontFaceOnFulfilledFunc {
return func(value []*FontFace) {
var (
_args [1]interface{}
_end int
)
_p0 := js.Global().Get("Array").New(len(value))
for __idx0, __seq_in0 := range value {
__seq_out0 := __seq_in0.JSValue()
_p0.SetIndex(__idx0, __seq_out0)
}
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnRejected
type PromiseSequenceFontFaceOnRejectedFunc func(reason js.Value)
// PromiseSequenceFontFaceOnRejected is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseSequenceFontFaceOnRejected js.Func
func PromiseSequenceFontFaceOnRejectedToJS(callback PromiseSequenceFontFaceOnRejectedFunc) *PromiseSequenceFontFaceOnRejected {
if callback == nil {
return nil
}
ret := PromiseSequenceFontFaceOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 js.Value // javascript: any reason
)
_p0 = args[0]
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseSequenceFontFaceOnRejectedFromJS(_value js.Value) PromiseSequenceFontFaceOnRejectedFunc {
return func(reason js.Value) {
var (
_args [1]interface{}
_end int
)
_p0 := reason
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// dictionary: FontFaceDescriptors
type FontFaceDescriptors struct {
Style string
Weight string
Stretch string
UnicodeRange string
Variant string
FeatureSettings string
VariationSettings string
Display string
}
// JSValue is allocating a new javascript object and copy
// all values
func (_this *FontFaceDescriptors) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Style
out.Set("style", value0)
value1 := _this.Weight
out.Set("weight", value1)
value2 := _this.Stretch
out.Set("stretch", value2)
value3 := _this.UnicodeRange
out.Set("unicodeRange", value3)
value4 := _this.Variant
out.Set("variant", value4)
value5 := _this.FeatureSettings
out.Set("featureSettings", value5)
value6 := _this.VariationSettings
out.Set("variationSettings", value6)
value7 := _this.Display
out.Set("display", value7)
return out
}
// FontFaceDescriptorsFromJS is allocating a new
// FontFaceDescriptors object and copy all values in the value javascript object.
func FontFaceDescriptorsFromJS(value js.Value) *FontFaceDescriptors {
var out FontFaceDescriptors
var (
value0 string // javascript: DOMString {style Style style}
value1 string // javascript: DOMString {weight Weight weight}
value2 string // javascript: DOMString {stretch Stretch stretch}
value3 string // javascript: DOMString {unicodeRange UnicodeRange unicodeRange}
value4 string // javascript: DOMString {variant Variant variant}
value5 string // javascript: DOMString {featureSettings FeatureSettings featureSettings}
value6 string // javascript: DOMString {variationSettings VariationSettings variationSettings}
value7 string // javascript: DOMString {display Display display}
)
value0 = (value.Get("style")).String()
out.Style = value0
value1 = (value.Get("weight")).String()
out.Weight = value1
value2 = (value.Get("stretch")).String()
out.Stretch = value2
value3 = (value.Get("unicodeRange")).String()
out.UnicodeRange = value3
value4 = (value.Get("variant")).String()
out.Variant = value4
value5 = (value.Get("featureSettings")).String()
out.FeatureSettings = value5
value6 = (value.Get("variationSettings")).String()
out.VariationSettings = value6
value7 = (value.Get("display")).String()
out.Display = value7
return &out
}
// dictionary: FontFaceSetEntryIteratorValue
type FontFaceSetEntryIteratorValue struct {
Value []*FontFace
Done bool
}
// JSValue is allocating a new javascript object and copy
// all values
func (_this *FontFaceSetEntryIteratorValue) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := js.Global().Get("Array").New(len(_this.Value))
for __idx0, __seq_in0 := range _this.Value {
__seq_out0 := __seq_in0.JSValue()
value0.SetIndex(__idx0, __seq_out0)
}
out.Set("value", value0)
value1 := _this.Done
out.Set("done", value1)
return out
}
// FontFaceSetEntryIteratorValueFromJS is allocating a new
// FontFaceSetEntryIteratorValue object and copy all values in the value javascript object.
func FontFaceSetEntryIteratorValueFromJS(value js.Value) *FontFaceSetEntryIteratorValue {
var out FontFaceSetEntryIteratorValue
var (
value0 []*FontFace // javascript: sequence<FontFace> {value Value value}
value1 bool // javascript: boolean {done Done done}
)
__length0 := value.Get("value").Length()
__array0 := make([]*FontFace, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *FontFace
__seq_in0 := value.Get("value").Index(__idx0)
__seq_out0 = FontFaceFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
value0 = __array0
out.Value = value0
value1 = (value.Get("done")).Bool()
out.Done = value1
return &out
}
// dictionary: FontFaceSetKeyIteratorValue
type FontFaceSetKeyIteratorValue struct {
Value *FontFace
Done bool
}
// JSValue is allocating a new javascript object and copy
// all values
func (_this *FontFaceSetKeyIteratorValue) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Value.JSValue()
out.Set("value", value0)
value1 := _this.Done
out.Set("done", value1)
return out
}
// FontFaceSetKeyIteratorValueFromJS is allocating a new
// FontFaceSetKeyIteratorValue object and copy all values in the value javascript object.
func FontFaceSetKeyIteratorValueFromJS(value js.Value) *FontFaceSetKeyIteratorValue {
var out FontFaceSetKeyIteratorValue
var (
value0 *FontFace // javascript: FontFace {value Value value}
value1 bool // javascript: boolean {done Done done}
)
value0 = FontFaceFromJS(value.Get("value"))
out.Value = value0
value1 = (value.Get("done")).Bool()
out.Done = value1
return &out
}
// dictionary: FontFaceSetLoadEventInit
type FontFaceSetLoadEventInit struct {
Bubbles bool
Cancelable bool
Composed bool
Fontfaces []*FontFace
}
// JSValue is allocating a new javascript object and copy
// all values
func (_this *FontFaceSetLoadEventInit) 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 := js.Global().Get("Array").New(len(_this.Fontfaces))
for __idx3, __seq_in3 := range _this.Fontfaces {
__seq_out3 := __seq_in3.JSValue()
value3.SetIndex(__idx3, __seq_out3)
}
out.Set("fontfaces", value3)
return out
}
// FontFaceSetLoadEventInitFromJS is allocating a new
// FontFaceSetLoadEventInit object and copy all values in the value javascript object.
func FontFaceSetLoadEventInitFromJS(value js.Value) *FontFaceSetLoadEventInit {
var out FontFaceSetLoadEventInit
var (
value0 bool // javascript: boolean {bubbles Bubbles bubbles}
value1 bool // javascript: boolean {cancelable Cancelable cancelable}
value2 bool // javascript: boolean {composed Composed composed}
value3 []*FontFace // javascript: sequence<FontFace> {fontfaces Fontfaces fontfaces}
)
value0 = (value.Get("bubbles")).Bool()
out.Bubbles = value0
value1 = (value.Get("cancelable")).Bool()
out.Cancelable = value1
value2 = (value.Get("composed")).Bool()
out.Composed = value2
__length3 := value.Get("fontfaces").Length()
__array3 := make([]*FontFace, __length3, __length3)
for __idx3 := 0; __idx3 < __length3; __idx3++ {
var __seq_out3 *FontFace
__seq_in3 := value.Get("fontfaces").Index(__idx3)
__seq_out3 = FontFaceFromJS(__seq_in3)
__array3[__idx3] = __seq_out3
}
value3 = __array3
out.Fontfaces = value3
return &out
}
// dictionary: FontFaceSetValueIteratorValue
type FontFaceSetValueIteratorValue struct {
Value *FontFace
Done bool
}
// JSValue is allocating a new javascript object and copy
// all values
func (_this *FontFaceSetValueIteratorValue) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Value.JSValue()
out.Set("value", value0)
value1 := _this.Done
out.Set("done", value1)
return out
}
// FontFaceSetValueIteratorValueFromJS is allocating a new
// FontFaceSetValueIteratorValue object and copy all values in the value javascript object.
func FontFaceSetValueIteratorValueFromJS(value js.Value) *FontFaceSetValueIteratorValue {
var out FontFaceSetValueIteratorValue
var (
value0 *FontFace // javascript: FontFace {value Value value}
value1 bool // javascript: boolean {done Done done}
)
value0 = FontFaceFromJS(value.Get("value"))
out.Value = value0
value1 = (value.Get("done")).Bool()
out.Done = value1
return &out
}
// class: FontFace
type FontFace struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
// JSValue returns the js.Value or js.Null() if _this is nil
func (_this *FontFace) JSValue() js.Value {
if _this == nil {
return js.Null()
}
return _this.Value_JS
}
// FontFaceFromJS is casting a js.Value into FontFace.
func FontFaceFromJS(value js.Value) *FontFace {
if typ := value.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &FontFace{}
ret.Value_JS = value
return ret
}
// FontFaceFromJS is casting from something that holds a js.Value into FontFace.
func FontFaceFromWrapper(input core.Wrapper) *FontFace {
return FontFaceFromJS(input.JSValue())
}
func NewFontFace(family string, source *Union, descriptors *FontFaceDescriptors) (_result *FontFace) {
_klass := js.Global().Get("FontFace")
var (
_args [3]interface{}
_end int
)
_p0 := family
_args[0] = _p0
_end++
_p1 := source.JSValue()
_args[1] = _p1
_end++
if descriptors != nil {
_p2 := descriptors.JSValue()
_args[2] = _p2
_end++
}
_returned := _klass.New(_args[0:_end]...)
var (
_converted *FontFace // javascript: FontFace _what_return_name
)
_converted = FontFaceFromJS(_returned)
_result = _converted
return
}
// Family returning attribute 'family' with
// type string (idl: DOMString).
func (_this *FontFace) Family() string {
var ret string
value := _this.Value_JS.Get("family")
ret = (value).String()
return ret
}
// SetFamily setting attribute 'family' with
// type string (idl: DOMString).
func (_this *FontFace) SetFamily(value string) {
input := value
_this.Value_JS.Set("family", input)
}
// Style returning attribute 'style' with
// type string (idl: DOMString).
func (_this *FontFace) Style() string {
var ret string
value := _this.Value_JS.Get("style")
ret = (value).String()
return ret
}
// SetStyle setting attribute 'style' with
// type string (idl: DOMString).
func (_this *FontFace) SetStyle(value string) {
input := value
_this.Value_JS.Set("style", input)
}
// Weight returning attribute 'weight' with
// type string (idl: DOMString).
func (_this *FontFace) Weight() string {
var ret string
value := _this.Value_JS.Get("weight")
ret = (value).String()
return ret
}
// SetWeight setting attribute 'weight' with
// type string (idl: DOMString).
func (_this *FontFace) SetWeight(value string) {
input := value
_this.Value_JS.Set("weight", input)
}
// Stretch returning attribute 'stretch' with
// type string (idl: DOMString).
func (_this *FontFace) Stretch() string {
var ret string
value := _this.Value_JS.Get("stretch")
ret = (value).String()
return ret
}
// SetStretch setting attribute 'stretch' with
// type string (idl: DOMString).
func (_this *FontFace) SetStretch(value string) {
input := value
_this.Value_JS.Set("stretch", input)
}
// UnicodeRange returning attribute 'unicodeRange' with
// type string (idl: DOMString).
func (_this *FontFace) UnicodeRange() string {
var ret string
value := _this.Value_JS.Get("unicodeRange")
ret = (value).String()
return ret
}
// SetUnicodeRange setting attribute 'unicodeRange' with
// type string (idl: DOMString).
func (_this *FontFace) SetUnicodeRange(value string) {
input := value
_this.Value_JS.Set("unicodeRange", input)
}
// Variant returning attribute 'variant' with
// type string (idl: DOMString).
func (_this *FontFace) Variant() string {
var ret string
value := _this.Value_JS.Get("variant")
ret = (value).String()
return ret
}
// SetVariant setting attribute 'variant' with
// type string (idl: DOMString).
func (_this *FontFace) SetVariant(value string) {
input := value
_this.Value_JS.Set("variant", input)
}
// FeatureSettings returning attribute 'featureSettings' with
// type string (idl: DOMString).
func (_this *FontFace) FeatureSettings() string {
var ret string
value := _this.Value_JS.Get("featureSettings")
ret = (value).String()
return ret
}
// SetFeatureSettings setting attribute 'featureSettings' with
// type string (idl: DOMString).
func (_this *FontFace) SetFeatureSettings(value string) {
input := value
_this.Value_JS.Set("featureSettings", input)
}
// VariationSettings returning attribute 'variationSettings' with
// type string (idl: DOMString).
func (_this *FontFace) VariationSettings() string {
var ret string
value := _this.Value_JS.Get("variationSettings")
ret = (value).String()
return ret
}
// SetVariationSettings setting attribute 'variationSettings' with
// type string (idl: DOMString).
func (_this *FontFace) SetVariationSettings(value string) {
input := value
_this.Value_JS.Set("variationSettings", input)
}
// Display returning attribute 'display' with
// type string (idl: DOMString).
func (_this *FontFace) Display() string {
var ret string
value := _this.Value_JS.Get("display")
ret = (value).String()
return ret
}
// SetDisplay setting attribute 'display' with
// type string (idl: DOMString).
func (_this *FontFace) SetDisplay(value string) {
input := value
_this.Value_JS.Set("display", input)
}
// Status returning attribute 'status' with
// type FontFaceLoadStatus (idl: FontFaceLoadStatus).
func (_this *FontFace) Status() FontFaceLoadStatus {
var ret FontFaceLoadStatus
value := _this.Value_JS.Get("status")
ret = FontFaceLoadStatusFromJS(value)
return ret
}
// Loaded returning attribute 'loaded' with
// type javascript.Promise (idl: Promise).
func (_this *FontFace) Loaded() *javascript.Promise {
var ret *javascript.Promise
value := _this.Value_JS.Get("loaded")
ret = javascript.PromiseFromJS(value)
return ret
}
func (_this *FontFace) Load() (_result *PromiseFontFace) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("load", _args[0:_end]...)
var (
_converted *PromiseFontFace // javascript: Promise _what_return_name
)
_converted = PromiseFontFaceFromJS(_returned)
_result = _converted
return
}
// class: FontFaceSet
type FontFaceSet struct {
domcore.EventTarget
}
// FontFaceSetFromJS is casting a js.Value into FontFaceSet.
func FontFaceSetFromJS(value js.Value) *FontFaceSet {
if typ := value.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &FontFaceSet{}
ret.Value_JS = value
return ret
}
// FontFaceSetFromJS is casting from something that holds a js.Value into FontFaceSet.
func FontFaceSetFromWrapper(input core.Wrapper) *FontFaceSet {
return FontFaceSetFromJS(input.JSValue())
}
func NewFontFaceSet(initialFaces []*FontFace) (_result *FontFaceSet) {
_klass := js.Global().Get("FontFaceSet")
var (
_args [1]interface{}
_end int
)
_p0 := js.Global().Get("Array").New(len(initialFaces))
for __idx0, __seq_in0 := range initialFaces {
__seq_out0 := __seq_in0.JSValue()
_p0.SetIndex(__idx0, __seq_out0)
}
_args[0] = _p0
_end++
_returned := _klass.New(_args[0:_end]...)
var (
_converted *FontFaceSet // javascript: FontFaceSet _what_return_name
)
_converted = FontFaceSetFromJS(_returned)
_result = _converted
return
}
// OnLoading returning attribute 'onloading' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *FontFaceSet) OnLoading() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onloading")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// OnLoadingDone returning attribute 'onloadingdone' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *FontFaceSet) OnLoadingDone() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onloadingdone")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// OnLoadingError returning attribute 'onloadingerror' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *FontFaceSet) OnLoadingError() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onloadingerror")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// Ready returning attribute 'ready' with
// type javascript.Promise (idl: Promise).
func (_this *FontFaceSet) Ready() *javascript.Promise {
var ret *javascript.Promise
value := _this.Value_JS.Get("ready")
ret = javascript.PromiseFromJS(value)
return ret
}
// Status returning attribute 'status' with
// type FontFaceSetLoadStatus (idl: FontFaceSetLoadStatus).
func (_this *FontFaceSet) Status() FontFaceSetLoadStatus {
var ret FontFaceSetLoadStatus
value := _this.Value_JS.Get("status")
ret = FontFaceSetLoadStatusFromJS(value)
return ret
}
// Size returning attribute 'size' with
// type int (idl: long).
func (_this *FontFaceSet) Size() int {
var ret int
value := _this.Value_JS.Get("size")
ret = (value).Int()
return ret
}
// event attribute: FontFaceSetLoadEvent
func eventFuncFontFaceSet_FontFaceSetLoadEvent(listener func(event *FontFaceSetLoadEvent, target *FontFaceSet)) js.Func {
fn := func(this js.Value, args []js.Value) interface{} {
var ret *FontFaceSetLoadEvent
value := args[0]
incoming := value.Get("target")
ret = FontFaceSetLoadEventFromJS(value)
src := FontFaceSetFromJS(incoming)
listener(ret, src)
return js.Undefined()
}
return js.FuncOf(fn)
}
// AddLoading is adding doing AddEventListener for 'Loading' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *FontFaceSet) AddEventLoading(listener func(event *FontFaceSetLoadEvent, currentTarget *FontFaceSet)) js.Func {
cb := eventFuncFontFaceSet_FontFaceSetLoadEvent(listener)
_this.Value_JS.Call("addEventListener", "loading", cb)
return cb
}
// SetOnLoading is assigning a function to 'onloading'. This
// This method is returning allocated javascript function that need to be released.
func (_this *FontFaceSet) SetOnLoading(listener func(event *FontFaceSetLoadEvent, currentTarget *FontFaceSet)) js.Func {
cb := eventFuncFontFaceSet_FontFaceSetLoadEvent(listener)
_this.Value_JS.Set("onloading", cb)
return cb
}
// AddLoadingDone is adding doing AddEventListener for 'LoadingDone' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *FontFaceSet) AddEventLoadingDone(listener func(event *FontFaceSetLoadEvent, currentTarget *FontFaceSet)) js.Func {
cb := eventFuncFontFaceSet_FontFaceSetLoadEvent(listener)
_this.Value_JS.Call("addEventListener", "loadingdone", cb)
return cb
}
// SetOnLoadingDone is assigning a function to 'onloadingdone'. This
// This method is returning allocated javascript function that need to be released.
func (_this *FontFaceSet) SetOnLoadingDone(listener func(event *FontFaceSetLoadEvent, currentTarget *FontFaceSet)) js.Func {
cb := eventFuncFontFaceSet_FontFaceSetLoadEvent(listener)
_this.Value_JS.Set("onloadingdone", cb)
return cb
}
// AddLoadingError is adding doing AddEventListener for 'LoadingError' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *FontFaceSet) AddEventLoadingError(listener func(event *FontFaceSetLoadEvent, currentTarget *FontFaceSet)) js.Func {
cb := eventFuncFontFaceSet_FontFaceSetLoadEvent(listener)
_this.Value_JS.Call("addEventListener", "loadingerror", cb)
return cb
}
// SetOnLoadingError is assigning a function to 'onloadingerror'. This
// This method is returning allocated javascript function that need to be released.
func (_this *FontFaceSet) SetOnLoadingError(listener func(event *FontFaceSetLoadEvent, currentTarget *FontFaceSet)) js.Func {
cb := eventFuncFontFaceSet_FontFaceSetLoadEvent(listener)
_this.Value_JS.Set("onloadingerror", cb)
return cb
}
func (_this *FontFaceSet) Add(font *FontFace) (_result *FontFaceSet) {
var (
_args [1]interface{}
_end int
)
_p0 := font.JSValue()
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("add", _args[0:_end]...)
var (
_converted *FontFaceSet // javascript: FontFaceSet _what_return_name
)
_converted = FontFaceSetFromJS(_returned)
_result = _converted
return
}
func (_this *FontFaceSet) Delete(font *FontFace) (_result bool) {