2023-02-25 19:13:07 +08:00
|
|
|
//----------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Licensed under Apache License Version 2.0, January 2004
|
|
|
|
//
|
|
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
//----------------------------------------
|
|
|
|
|
2023-02-26 21:17:28 +08:00
|
|
|
// CEF 进程消息 ProcessMessageRef.New()
|
2023-02-24 19:28:56 +08:00
|
|
|
package cef
|
|
|
|
|
2023-02-24 21:44:32 +08:00
|
|
|
import (
|
|
|
|
"github.com/energye/energy/common/imports"
|
|
|
|
"github.com/energye/golcl/lcl/api"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2023-02-26 21:17:28 +08:00
|
|
|
// ProcessMessageRef -> ICefProcessMessage
|
|
|
|
var ProcessMessageRef processMessage
|
2023-02-24 19:28:56 +08:00
|
|
|
|
2023-02-26 21:17:28 +08:00
|
|
|
// processMessage
|
|
|
|
type processMessage uintptr
|
2023-02-24 19:28:56 +08:00
|
|
|
|
2023-02-25 19:13:07 +08:00
|
|
|
// New 创建一个进程消息类型
|
|
|
|
//
|
|
|
|
// 参数: name 消息名
|
2023-02-26 21:17:28 +08:00
|
|
|
func (*processMessage) New(name string) *ICefProcessMessage {
|
2023-02-24 21:44:32 +08:00
|
|
|
var result uintptr
|
|
|
|
imports.Proc(internale_CefProcessMessageRef_New).Call(api.PascalStr(name), uintptr(unsafe.Pointer(&result)))
|
|
|
|
return &ICefProcessMessage{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *ICefProcessMessage) Instance() uintptr {
|
|
|
|
return uintptr(m.instance)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefProcessMessage) ArgumentList() *ICefListValue {
|
|
|
|
var result uintptr
|
|
|
|
imports.Proc(internale_CefProcessMessage_ArgumentList).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
|
|
|
|
return &ICefListValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefProcessMessage) IsValid() bool {
|
2023-02-24 22:00:28 +08:00
|
|
|
if m == nil || m.instance == nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
r1, _, _ := imports.Proc(internale_CefProcessMessage_IsValid).Call(m.Instance())
|
2023-02-24 21:44:32 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefProcessMessage) Copy() *ICefProcessMessage {
|
|
|
|
var result uintptr
|
|
|
|
imports.Proc(internale_CefProcessMessage_Copy).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
|
|
|
|
return &ICefProcessMessage{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefProcessMessage) Name() string {
|
|
|
|
r1, _, _ := imports.Proc(internale_CefProcessMessage_Name).Call(m.Instance())
|
|
|
|
return api.GoStr(r1)
|
|
|
|
}
|
2023-02-24 19:28:56 +08:00
|
|
|
|
2023-02-24 21:44:32 +08:00
|
|
|
func (m *ICefProcessMessage) Free() {
|
2023-02-25 19:13:07 +08:00
|
|
|
m.ArgumentList().Free()
|
2023-02-24 21:44:32 +08:00
|
|
|
m.instance = nil
|
2023-02-24 19:28:56 +08:00
|
|
|
}
|