ceecbb6af4
General - 配置界面支持配置对象存储桶 - 快捷键进入截图 - 一键上传截图 & 复制截图链接 MacOS - 状态栏指示器和应用图标
37 lines
626 B
Go
37 lines
626 B
Go
//go:build darwin
|
|
|
|
package main
|
|
|
|
import "C"
|
|
|
|
//export nativeOverlayConfirm
|
|
func nativeOverlayConfirm(x, y, w, h C.int) {
|
|
nativeOverlayState.Lock()
|
|
app := nativeOverlayState.app
|
|
nativeOverlayState.app = nil
|
|
nativeOverlayState.Unlock()
|
|
if app == nil {
|
|
return
|
|
}
|
|
go func() {
|
|
_ = app.ConfirmNativeRegion(RegionRect{
|
|
X: int(x),
|
|
Y: int(y),
|
|
W: int(w),
|
|
H: int(h),
|
|
})
|
|
}()
|
|
}
|
|
|
|
//export nativeOverlayCancel
|
|
func nativeOverlayCancel() {
|
|
nativeOverlayState.Lock()
|
|
app := nativeOverlayState.app
|
|
nativeOverlayState.app = nil
|
|
nativeOverlayState.Unlock()
|
|
if app == nil {
|
|
return
|
|
}
|
|
go app.CancelNativeRegion()
|
|
}
|