2022-10-04 16:38:43 +08:00
|
|
|
//----------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
|
|
//
|
2023-02-19 23:21:47 +08:00
|
|
|
// Licensed under Apache License Version 2.0, January 2004
|
|
|
|
//
|
|
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
2022-10-04 16:38:43 +08:00
|
|
|
//
|
|
|
|
//----------------------------------------
|
|
|
|
|
2023-02-20 14:42:17 +08:00
|
|
|
// CEF的复杂函数导出
|
2022-10-04 13:21:05 +08:00
|
|
|
package cef
|
|
|
|
|
2022-10-04 22:34:57 +08:00
|
|
|
import (
|
2023-02-13 21:25:35 +08:00
|
|
|
"github.com/energye/energy/common/imports"
|
2022-10-04 22:34:57 +08:00
|
|
|
"github.com/energye/golcl/lcl/api"
|
|
|
|
)
|
2022-10-04 13:21:05 +08:00
|
|
|
|
2023-02-24 19:28:56 +08:00
|
|
|
// WindowInfoAsChild BrowserWindow 设置到指定窗口做为子窗口
|
2022-10-04 13:21:05 +08:00
|
|
|
func WindowInfoAsChild(windowInfo, windowHandle uintptr, windowName string) {
|
2023-02-13 21:25:35 +08:00
|
|
|
imports.Proc(internale_CEFWindowInfoAsChild).Call(windowInfo, windowHandle, api.PascalStr(windowName))
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
2023-02-24 19:28:56 +08:00
|
|
|
// WindowInfoAsPopUp BrowserWindow 设置到做为弹出窗口
|
2022-10-04 13:21:05 +08:00
|
|
|
func WindowInfoAsPopUp(windowInfo, windowParent uintptr, windowName string) {
|
2023-02-13 21:25:35 +08:00
|
|
|
imports.Proc(internale_CEFWindowInfoAsPopUp).Call(windowInfo, windowParent, api.PascalStr(windowName))
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
2023-02-24 19:28:56 +08:00
|
|
|
// WindowInfoAsWindowless BrowserWindow 设置到做为无窗口
|
2022-10-04 13:21:05 +08:00
|
|
|
func WindowInfoAsWindowless(windowInfo, windowParent uintptr, windowName string) {
|
2023-02-13 21:25:35 +08:00
|
|
|
imports.Proc(internale_CEFWindowInfoAsWindowless).Call(windowInfo, windowParent, api.PascalStr(windowName))
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
2023-02-24 19:28:56 +08:00
|
|
|
|
2023-03-01 15:56:40 +08:00
|
|
|
// RegisterExtension 注册JS扩展
|
|
|
|
func RegisterExtension(name, code string, handler *ICefV8Handler) {
|
2023-02-24 19:28:56 +08:00
|
|
|
imports.Proc(internale_CEFJSRegisterExtension).Call(api.PascalStr(name), api.PascalStr(code), handler.Instance())
|
|
|
|
}
|