energy/cef/cef-misc-functions.go

38 lines
1.3 KiB
Go
Raw Normal View History

2022-10-04 16:38:43 +08:00
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// 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 (
"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
// WindowInfoAsChild BrowserWindow 设置到指定窗口做为子窗口
2022-10-04 13:21:05 +08:00
func WindowInfoAsChild(windowInfo, windowHandle uintptr, windowName string) {
imports.Proc(internale_CEFWindowInfoAsChild).Call(windowInfo, windowHandle, api.PascalStr(windowName))
2022-10-04 13:21:05 +08:00
}
// WindowInfoAsPopUp BrowserWindow 设置到做为弹出窗口
2022-10-04 13:21:05 +08:00
func WindowInfoAsPopUp(windowInfo, windowParent uintptr, windowName string) {
imports.Proc(internale_CEFWindowInfoAsPopUp).Call(windowInfo, windowParent, api.PascalStr(windowName))
2022-10-04 13:21:05 +08:00
}
// WindowInfoAsWindowless BrowserWindow 设置到做为无窗口
2022-10-04 13:21:05 +08:00
func WindowInfoAsWindowless(windowInfo, windowParent uintptr, windowName string) {
imports.Proc(internale_CEFWindowInfoAsWindowless).Call(windowInfo, windowParent, api.PascalStr(windowName))
2022-10-04 13:21:05 +08:00
}
2023-03-01 15:56:40 +08:00
// RegisterExtension 注册JS扩展
func RegisterExtension(name, code string, handler *ICefV8Handler) {
imports.Proc(internale_CEFJSRegisterExtension).Call(api.PascalStr(name), api.PascalStr(code), handler.Instance())
}