mirror of
https://github.com/bluszcz/cutego.git
synced 2024-09-28 13:15:17 +03:00
33ee7b247d
* Go 1.13 related fixes for js/wasm * fix windows docker deployment issue * new 3rdparty/UGlobalHotkey example * fix webengine module on arch linux * support for the prebuilt Qt wasm builds * make use of -trimpath if available * bump Go version in docker images to 1.12.9
28 lines
670 B
Go
28 lines
670 B
Go
// +build js,!wasm
|
|
|
|
package qt
|
|
|
|
import "github.com/gopherjs/gopherjs/js"
|
|
|
|
var Global = js.Global
|
|
var Module = Global.Call("eval", "Module")
|
|
|
|
func MakeWrapper(i interface{}) *js.Object {
|
|
o := js.InternalObject(i)
|
|
methods := o.Get("constructor").Get("methods")
|
|
for i := 0; i < methods.Length(); i++ {
|
|
m := methods.Index(i)
|
|
if m.Get("pkg").String() != "" { // not exported
|
|
continue
|
|
}
|
|
if o.Get(m.Get("name").String()) == js.Undefined {
|
|
o.Set(m.Get("name").String(), func(args ...*js.Object) *js.Object {
|
|
return js.Global.Call("$externalizeFunction", o.Get(m.Get("prop").String()), m.Get("typ"), true).Call("apply", o, args)
|
|
})
|
|
}
|
|
}
|
|
return o
|
|
}
|
|
|
|
//
|