mirror of
https://gitee.com/energye/energy.git
synced 2024-11-30 02:37:46 +08:00
upgrade-dev v2.3.12
This commit is contained in:
parent
9f1a460914
commit
d3c2364bba
@ -15,9 +15,12 @@ package cef
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/energye/energy/common/imports"
|
||||
"github.com/energye/energy/consts"
|
||||
"github.com/energye/energy/pkgs/json"
|
||||
"github.com/energye/golcl/lcl/api"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// ipcValueConvert
|
||||
@ -509,3 +512,63 @@ func (m *v8ValueProcessMessageConvert) V8valueObjectToDictionaryValue(v8value *I
|
||||
keys.Free()
|
||||
return dictionaryValue, nil
|
||||
}
|
||||
|
||||
func (m *v8ValueProcessMessageConvert) BytesToProcessMessage(name string, array json.JSONArray) *ICefProcessMessage {
|
||||
if array == nil || !array.IsArray() {
|
||||
return nil
|
||||
}
|
||||
var data = array.Bytes()
|
||||
var result uintptr
|
||||
imports.Proc(internale_ValueConvert_BytesToProcessMessage).Call(api.PascalStr(name), uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result)))
|
||||
return &ICefProcessMessage{instance: unsafe.Pointer(result)}
|
||||
}
|
||||
|
||||
func (m *v8ValueProcessMessageConvert) BytesToListValue(array json.JSONArray) *ICefListValue {
|
||||
if array == nil || !array.IsArray() {
|
||||
return nil
|
||||
}
|
||||
var data = array.Bytes()
|
||||
var result uintptr
|
||||
imports.Proc(internale_ValueConvert_BytesToListValue).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result)))
|
||||
return &ICefListValue{instance: unsafe.Pointer(result)}
|
||||
}
|
||||
|
||||
func (m *v8ValueProcessMessageConvert) BytesToDictionaryValue(array json.JSONObject) *ICefDictionaryValue {
|
||||
if array == nil || !array.IsObject() {
|
||||
return nil
|
||||
}
|
||||
var data = array.Bytes()
|
||||
var result uintptr
|
||||
imports.Proc(internale_ValueConvert_BytesToDictionaryValue).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result)))
|
||||
return &ICefDictionaryValue{instance: unsafe.Pointer(result)}
|
||||
}
|
||||
|
||||
func (m *v8ValueProcessMessageConvert) BytesToV8ValueArray(array json.JSONArray) *TCefV8ValueArray {
|
||||
if array == nil || !array.IsArray() {
|
||||
return nil
|
||||
}
|
||||
var data = array.Bytes()
|
||||
var result uintptr
|
||||
imports.Proc(internale_ValueConvert_BytesToV8ValueArray).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result)))
|
||||
return &TCefV8ValueArray{instance: unsafe.Pointer(result)} //
|
||||
}
|
||||
|
||||
func (m *v8ValueProcessMessageConvert) BytesToV8Array(array json.JSONArray) *ICefV8Value {
|
||||
if array == nil || !array.IsArray() {
|
||||
return nil
|
||||
}
|
||||
var data = array.Bytes()
|
||||
var result uintptr
|
||||
imports.Proc(internale_ValueConvert_BytesToV8Array).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result)))
|
||||
return &ICefV8Value{instance: unsafe.Pointer(result)}
|
||||
}
|
||||
|
||||
func (m *v8ValueProcessMessageConvert) BytesToV8Object(array json.JSONObject) *ICefV8Value {
|
||||
if array == nil || !array.IsObject() {
|
||||
return nil
|
||||
}
|
||||
var data = array.Bytes()
|
||||
var result uintptr
|
||||
imports.Proc(internale_ValueConvert_BytesToV8Object).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result)))
|
||||
return &ICefV8Value{instance: unsafe.Pointer(result)}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user