Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
d3c2364b
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d3c2364b
编写于
3月 16, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upgrade-dev v2.3.12
上级
9f1a4609
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
63 addition
and
0 deletion
+63
-0
cef/cef-ipc-value-convert.go
cef/cef-ipc-value-convert.go
+63
-0
未找到文件。
cef/cef-ipc-value-convert.go
浏览文件 @
d3c2364b
...
...
@@ -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
)}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录