opencv/highgui.go
func goMouseCallback(name *C.char, event, x, y, flags C.int) {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	winName := C.GoString(name)
	win, ok := allWindows[winName]

	if !ok {
		return
	}
	if win.mouseHandle == nil {
		return
	}

	if fa, ok := win.mouseHandle.(func(event, x, y, flags int)); ok {
		fa(int(event), int(x), int(y), int(flags))
		return
	}

	if fb, ok := win.mouseHandle.(func(event, x, y, flags int, param ...interface{})); ok {
		if win.param != nil {
			fb(int(event), int(x), int(y), int(flags), win.param...)
		} else {
			fb(int(event), int(x), int(y), int(flags))
		}
		return
	}
}
func goMouseCallback(name *C.char, event, x, y, flags C.int) {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	winName := C.GoString(name)
	win, ok := allWindows[winName]

	if !ok {
		return
	}
	if win.mouseHandle == nil {
		return
	}

	if fa, ok := win.mouseHandle.(func(event, x, y, flags int)); ok {
		fa(int(event), int(x), int(y), int(flags))
		return
	}

	if fb, ok := win.mouseHandle.(func(event, x, y, flags int, param ...interface{})); ok {
		if win.param != nil {
			fb(int(event), int(x), int(y), int(flags), win.param...)
		} else {
			fb(int(event), int(x), int(y), int(flags))
		}
		return
	}
}
//export goMouseCallback