This repository has been archived by the owner on May 18, 2023. It is now read-only.
forked from gowebapi/webapi
/
regions.go
300 lines (269 loc) · 6.81 KB
/
regions.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
// Code generated by webidl-bind. DO NOT EDIT.
// +build !js
package regions
import js "github.com/gowebapi/webapi/core/js"
import (
"github.com/gowebapi/webapi/dom"
"github.com/gowebapi/webapi/dom/domcore"
)
// using following types:
// dom.Node
// dom.Range
// domcore.EventTarget
// source idl files:
// css-regions.idl
// transform files:
// css-regions.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}
}
// class: NamedFlow
type NamedFlow struct {
domcore.EventTarget
}
// NamedFlowFromJS is casting a js.Wrapper into NamedFlow.
func NamedFlowFromJS(value js.Wrapper) *NamedFlow {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &NamedFlow{}
ret.Value_JS = input
return ret
}
// Name returning attribute 'name' with
// type string (idl: DOMString).
func (_this *NamedFlow) Name() string {
var ret string
value := _this.Value_JS.Get("name")
ret = (value).String()
return ret
}
// Overset returning attribute 'overset' with
// type bool (idl: boolean).
func (_this *NamedFlow) Overset() bool {
var ret bool
value := _this.Value_JS.Get("overset")
ret = (value).Bool()
return ret
}
// FirstEmptyRegionIndex returning attribute 'firstEmptyRegionIndex' with
// type int (idl: short).
func (_this *NamedFlow) FirstEmptyRegionIndex() int {
var ret int
value := _this.Value_JS.Get("firstEmptyRegionIndex")
ret = (value).Int()
return ret
}
func (_this *NamedFlow) GetRegions() (_result []*Region) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getRegions", _args[0:_end]...)
var (
_converted []*Region // javascript: sequence<Region> _what_return_name
)
__length0 := _returned.Length()
__array0 := make([]*Region, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *Region
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = RegionFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
_result = _converted
return
}
func (_this *NamedFlow) GetContent() (_result []*dom.Node) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getContent", _args[0:_end]...)
var (
_converted []*dom.Node // javascript: sequence<Node> _what_return_name
)
__length0 := _returned.Length()
__array0 := make([]*dom.Node, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *dom.Node
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = dom.NodeFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
_result = _converted
return
}
func (_this *NamedFlow) GetRegionsByContent(node *dom.Node) (_result []*Region) {
var (
_args [1]interface{}
_end int
)
_p0 := node.JSValue()
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("getRegionsByContent", _args[0:_end]...)
var (
_converted []*Region // javascript: sequence<Region> _what_return_name
)
__length0 := _returned.Length()
__array0 := make([]*Region, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *Region
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = RegionFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
_result = _converted
return
}
// class: NamedFlowMap
type NamedFlowMap struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *NamedFlowMap) JSValue() js.Value {
return _this.Value_JS
}
// NamedFlowMapFromJS is casting a js.Wrapper into NamedFlowMap.
func NamedFlowMapFromJS(value js.Wrapper) *NamedFlowMap {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &NamedFlowMap{}
ret.Value_JS = input
return ret
}
func (_this *NamedFlowMap) Get(flowName string) (_result *NamedFlow) {
var (
_args [1]interface{}
_end int
)
_p0 := flowName
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("get", _args[0:_end]...)
var (
_converted *NamedFlow // javascript: NamedFlow _what_return_name
)
if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
_converted = NamedFlowFromJS(_returned)
}
_result = _converted
return
}
func (_this *NamedFlowMap) Has(flowName string) (_result bool) {
var (
_args [1]interface{}
_end int
)
_p0 := flowName
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("has", _args[0:_end]...)
var (
_converted bool // javascript: boolean _what_return_name
)
_converted = (_returned).Bool()
_result = _converted
return
}
func (_this *NamedFlowMap) Set(flowName string, flowValue *NamedFlow) (_result *NamedFlowMap) {
var (
_args [2]interface{}
_end int
)
_p0 := flowName
_args[0] = _p0
_end++
_p1 := flowValue.JSValue()
_args[1] = _p1
_end++
_returned := _this.Value_JS.Call("set", _args[0:_end]...)
var (
_converted *NamedFlowMap // javascript: NamedFlowMap _what_return_name
)
_converted = NamedFlowMapFromJS(_returned)
_result = _converted
return
}
func (_this *NamedFlowMap) Delete(flowName string) (_result bool) {
var (
_args [1]interface{}
_end int
)
_p0 := flowName
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("delete", _args[0:_end]...)
var (
_converted bool // javascript: boolean _what_return_name
)
_converted = (_returned).Bool()
_result = _converted
return
}
// class: Region
type Region struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *Region) JSValue() js.Value {
return _this.Value_JS
}
// RegionFromJS is casting a js.Wrapper into Region.
func RegionFromJS(value js.Wrapper) *Region {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &Region{}
ret.Value_JS = input
return ret
}
// RegionOverset returning attribute 'regionOverset' with
// type string (idl: DOMString).
func (_this *Region) RegionOverset() string {
var ret string
value := _this.Value_JS.Get("regionOverset")
ret = (value).String()
return ret
}
func (_this *Region) GetRegionFlowRanges() (_result []*dom.Range) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getRegionFlowRanges", _args[0:_end]...)
var (
_converted []*dom.Range // javascript: sequence<Range> _what_return_name
)
if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
__length0 := _returned.Length()
__array0 := make([]*dom.Range, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *dom.Range
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = dom.RangeFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
}
_result = _converted
return
}