@@ -106,21 +106,21 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
106
106
}
107
107
}
108
108
109
- js .Global ().Call ("addEventListener" , "focus" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
109
+ js .Global ().Call ("addEventListener" , "focus" , js .FuncOf (func (this js.Value , args []js.Value ) any {
110
110
if w .focusCallback != nil {
111
111
w .focusCallback (w , true )
112
112
}
113
113
return nil
114
114
}))
115
115
116
- js .Global ().Call ("addEventListener" , "blur" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
116
+ js .Global ().Call ("addEventListener" , "blur" , js .FuncOf (func (this js.Value , args []js.Value ) any {
117
117
if w .focusCallback != nil {
118
118
w .focusCallback (w , false )
119
119
}
120
120
return nil
121
121
}))
122
122
123
- js .Global ().Call ("addEventListener" , "resize" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
123
+ js .Global ().Call ("addEventListener" , "resize" , js .FuncOf (func (this js.Value , args []js.Value ) any {
124
124
// HACK: Go fullscreen?
125
125
w .devicePixelRatio = js .Global ().Get ("devicePixelRatio" ).Float ()
126
126
widthScaled , heightScaled := w .GetSize ()
@@ -139,7 +139,7 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
139
139
return nil
140
140
}))
141
141
142
- document .Call ("addEventListener" , "keydown" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
142
+ document .Call ("addEventListener" , "keydown" , js .FuncOf (func (this js.Value , args []js.Value ) any {
143
143
ke := args [0 ]
144
144
w .goFullscreenIfRequested ()
145
145
@@ -172,7 +172,7 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
172
172
ke .Call ("preventDefault" )
173
173
return nil
174
174
}))
175
- document .Call ("addEventListener" , "keyup" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
175
+ document .Call ("addEventListener" , "keyup" , js .FuncOf (func (this js.Value , args []js.Value ) any {
176
176
ke := args [0 ]
177
177
w .goFullscreenIfRequested ()
178
178
@@ -194,7 +194,7 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
194
194
ke .Call ("preventDefault" )
195
195
return nil
196
196
}))
197
- document .Call ("addEventListener" , "mousedown" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
197
+ document .Call ("addEventListener" , "mousedown" , js .FuncOf (func (this js.Value , args []js.Value ) any {
198
198
me := args [0 ]
199
199
w .goFullscreenIfRequested ()
200
200
@@ -211,7 +211,7 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
211
211
me .Call ("preventDefault" )
212
212
return nil
213
213
}))
214
- document .Call ("addEventListener" , "mouseup" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
214
+ document .Call ("addEventListener" , "mouseup" , js .FuncOf (func (this js.Value , args []js.Value ) any {
215
215
me := args [0 ]
216
216
w .goFullscreenIfRequested ()
217
217
@@ -228,13 +228,13 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
228
228
me .Call ("preventDefault" )
229
229
return nil
230
230
}))
231
- document .Call ("addEventListener" , "contextmenu" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
231
+ document .Call ("addEventListener" , "contextmenu" , js .FuncOf (func (this js.Value , args []js.Value ) any {
232
232
me := args [0 ]
233
233
me .Call ("preventDefault" )
234
234
return nil
235
235
}))
236
236
237
- document .Call ("addEventListener" , "mousemove" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
237
+ document .Call ("addEventListener" , "mousemove" , js .FuncOf (func (this js.Value , args []js.Value ) any {
238
238
me := args [0 ]
239
239
var movementX , movementY float64
240
240
if ! w .missing .pointerLock {
@@ -257,7 +257,7 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
257
257
me .Call ("preventDefault" )
258
258
return nil
259
259
}))
260
- document .Call ("addEventListener" , "wheel" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
260
+ document .Call ("addEventListener" , "wheel" , js .FuncOf (func (this js.Value , args []js.Value ) any {
261
261
we := args [0 ]
262
262
263
263
deltaX := we .Get ("deltaX" ).Float ()
@@ -314,7 +314,7 @@ func CreateWindow(_, _ int, title string, monitor *Monitor, share *Window) (*Win
314
314
document.AddEventListener("touchmove", false, touchHandler)
315
315
document.AddEventListener("touchend", false, touchHandler)*/
316
316
317
- document .Call ("addEventListener" , "beforeUnload" , js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
317
+ document .Call ("addEventListener" , "beforeUnload" , js .FuncOf (func (this js.Value , args []js.Value ) any {
318
318
if w .closeCallback != nil {
319
319
w .closeCallback (w )
320
320
}
@@ -378,7 +378,7 @@ func (w *Window) SetSize(width, height int) {
378
378
fmt .Println ("not implemented: SetSize:" , width , height )
379
379
}
380
380
381
- func (w * Window ) SetIcon (images interface {} ) {
381
+ func (w * Window ) SetIcon (images any ) {
382
382
// images is actually of type []image.Image, but no need to import image until we actually do something with it
383
383
fmt .Println ("not implemented: SetIcon" )
384
384
}
@@ -534,7 +534,7 @@ func (w *Window) SwapBuffers() error {
534
534
535
535
var animationFrameChan = make (chan struct {}, 1 )
536
536
537
- var animationFrameCallback = js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
537
+ var animationFrameCallback = js .FuncOf (func (this js.Value , args []js.Value ) any {
538
538
animationFrameChan <- struct {}{}
539
539
540
540
return nil
@@ -592,8 +592,10 @@ func (w *Window) GetInputMode(mode InputMode) int {
592
592
}
593
593
}
594
594
595
- var ErrInvalidParameter = errors .New ("invalid parameter" )
596
- var ErrInvalidValue = errors .New ("invalid value" )
595
+ var (
596
+ ErrInvalidParameter = errors .New ("invalid parameter" )
597
+ ErrInvalidValue = errors .New ("invalid value" )
598
+ )
597
599
598
600
func (w * Window ) SetInputMode (mode InputMode , value int ) {
599
601
switch mode {
@@ -966,6 +968,7 @@ func DefaultWindowHints() {
966
968
func (w * Window ) SetClipboardString (str string ) {
967
969
SetClipboardString (str )
968
970
}
971
+
969
972
func (w * Window ) GetClipboardString () string {
970
973
return GetClipboardString ()
971
974
}
0 commit comments