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-25 02:15:15 +08:00
|
|
|
package cef
|
|
|
|
|
2023-02-25 17:09:39 +08:00
|
|
|
import (
|
2023-06-11 00:10:55 +08:00
|
|
|
"github.com/energye/energy/v2/cef/internal/def"
|
2023-05-31 18:00:34 +08:00
|
|
|
"github.com/energye/energy/v2/cef/ipc/types"
|
|
|
|
"github.com/energye/energy/v2/common/imports"
|
|
|
|
"github.com/energye/energy/v2/consts"
|
2023-03-04 11:19:45 +08:00
|
|
|
"github.com/energye/golcl/lcl"
|
2023-02-25 19:13:07 +08:00
|
|
|
"github.com/energye/golcl/lcl/api"
|
2023-02-25 17:09:39 +08:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DictionaryValueRef -> ICefDictionaryValue
|
|
|
|
var DictionaryValueRef cefDictionaryValue
|
|
|
|
|
|
|
|
//cefDictionaryValue
|
|
|
|
type cefDictionaryValue uintptr
|
|
|
|
|
2023-02-25 19:13:07 +08:00
|
|
|
// New 创建一个字典类型
|
2023-02-25 17:09:39 +08:00
|
|
|
func (*cefDictionaryValue) New() *ICefDictionaryValue {
|
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValueRef_New).Call(uintptr(unsafe.Pointer(&result)))
|
2023-02-25 17:09:39 +08:00
|
|
|
return &ICefDictionaryValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-04 11:19:45 +08:00
|
|
|
// data
|
|
|
|
func (*cefDictionaryValue) UnWrap(data *ICefDictionaryValue) *ICefDictionaryValue {
|
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValueRef_UnWrap).Call(data.Instance(), uintptr(unsafe.Pointer(&result)))
|
2023-03-04 11:58:35 +08:00
|
|
|
data.instance = unsafe.Pointer(result)
|
|
|
|
return data
|
2023-03-04 11:19:45 +08:00
|
|
|
}
|
|
|
|
|
2023-02-25 02:15:15 +08:00
|
|
|
// Instance 实例
|
|
|
|
func (m *ICefDictionaryValue) Instance() uintptr {
|
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return uintptr(m.instance)
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) IsValid() bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if m == nil || m.instance == nil {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_IsValid).Call(m.Instance())
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) IsOwned() bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_IsOwned).Call(m.Instance())
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) IsReadOnly() bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_IsReadOnly).Call(m.Instance())
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) Copy(excludeEmptyChildren bool) *ICefDictionaryValue {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValue_Copy).Call(m.Instance(), api.PascalBool(excludeEmptyChildren), uintptr(unsafe.Pointer(&result)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return &ICefDictionaryValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-04 11:19:45 +08:00
|
|
|
func (m *ICefDictionaryValue) Size() uint32 {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return 0
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_GetSize).Call(m.Instance())
|
2023-02-25 19:13:07 +08:00
|
|
|
return uint32(r1)
|
|
|
|
}
|
|
|
|
|
2023-03-09 16:35:38 +08:00
|
|
|
func (m *ICefDictionaryValue) Clear() (result bool) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-03-09 16:35:38 +08:00
|
|
|
if m.values != nil {
|
|
|
|
for _, v := range m.values {
|
|
|
|
if v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.values = nil
|
|
|
|
}
|
|
|
|
if m.binaryValues != nil {
|
|
|
|
for _, v := range m.binaryValues {
|
|
|
|
if v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.binaryValues = nil
|
|
|
|
}
|
|
|
|
if m.dictionaryValues != nil {
|
|
|
|
for _, v := range m.dictionaryValues {
|
|
|
|
if v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.dictionaryValues = nil
|
|
|
|
}
|
|
|
|
if m.listValues != nil {
|
|
|
|
for _, v := range m.listValues {
|
|
|
|
if v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.listValues = nil
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_Clear).Call(m.Instance())
|
2023-03-09 16:35:38 +08:00
|
|
|
result = api.GoBool(r1)
|
|
|
|
return
|
2023-02-25 19:13:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) HasKey(key string) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_HasKey).Call(m.Instance(), api.PascalStr(key))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
2023-03-04 11:19:45 +08:00
|
|
|
func (m *ICefDictionaryValue) GetKeys() *ICefV8ValueKeys {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-03-04 11:19:45 +08:00
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_GetKeys).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
|
2023-03-04 11:19:45 +08:00
|
|
|
return &ICefV8ValueKeys{keys: lcl.AsStrings(result), count: int(int32(r1))}
|
|
|
|
}
|
|
|
|
|
2023-05-31 17:41:14 +08:00
|
|
|
func (m *ICefDictionaryValue) GetIKeys() types.IV8ValueKeys {
|
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-03-04 11:19:45 +08:00
|
|
|
return m.GetKeys()
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) Remove(key string) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_Remove).Call(m.Instance(), api.PascalStr(key))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) GetType(key string) consts.TCefValueType {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return 0
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_GetType).Call(m.Instance(), api.PascalStr(key))
|
2023-02-25 19:13:07 +08:00
|
|
|
return consts.TCefValueType(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) GetValue(key string) *ICefValue {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValue_GetValue).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&result)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return &ICefValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-31 17:41:14 +08:00
|
|
|
func (m *ICefDictionaryValue) GetIValue(key string) types.IValue {
|
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-03-03 21:53:18 +08:00
|
|
|
return m.GetValue(key)
|
|
|
|
}
|
|
|
|
|
2023-02-25 19:13:07 +08:00
|
|
|
func (m *ICefDictionaryValue) GetBool(key string) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_GetBool).Call(m.Instance(), api.PascalStr(key))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) GetInt(key string) int32 {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return 0
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_GetInt).Call(m.Instance(), api.PascalStr(key))
|
2023-02-25 19:13:07 +08:00
|
|
|
return int32(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) GetDouble(key string) (result float64) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return 0
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValue_GetDouble).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&result)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2023-07-24 19:44:25 +08:00
|
|
|
func (m *ICefDictionaryValue) GetString(key string) (value string) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return ""
|
|
|
|
}
|
2023-07-24 19:44:25 +08:00
|
|
|
val := NewTString()
|
|
|
|
imports.Proc(def.CefDictionaryValue_GetString).Call(m.Instance(), api.PascalStr(key), val.Instance())
|
|
|
|
value = val.Value()
|
|
|
|
val.Free()
|
|
|
|
return
|
2023-02-25 19:13:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) GetBinary(key string) *ICefBinaryValue {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValue_GetBinary).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&result)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return &ICefBinaryValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-31 17:41:14 +08:00
|
|
|
func (m *ICefDictionaryValue) GetIBinary(key string) types.IBinaryValue {
|
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-03-03 21:53:18 +08:00
|
|
|
return m.GetBinary(key)
|
|
|
|
}
|
|
|
|
|
2023-02-25 19:13:07 +08:00
|
|
|
func (m *ICefDictionaryValue) GetDictionary(key string) *ICefDictionaryValue {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValue_GetDictionary).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&result)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return &ICefDictionaryValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-31 17:41:14 +08:00
|
|
|
func (m *ICefDictionaryValue) GetIObject(key string) types.IObjectValue {
|
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-03-03 21:53:18 +08:00
|
|
|
return m.GetDictionary(key)
|
|
|
|
}
|
|
|
|
|
2023-02-25 19:13:07 +08:00
|
|
|
func (m *ICefDictionaryValue) GetList(key string) *ICefListValue {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
var result uintptr
|
2023-06-11 00:10:55 +08:00
|
|
|
imports.Proc(def.CefDictionaryValue_GetList).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&result)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return &ICefListValue{
|
|
|
|
instance: unsafe.Pointer(result),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-31 17:41:14 +08:00
|
|
|
func (m *ICefDictionaryValue) GetIArray(key string) types.IArrayValue {
|
|
|
|
if !m.IsValid() {
|
|
|
|
return nil
|
|
|
|
}
|
2023-03-03 21:53:18 +08:00
|
|
|
return m.GetList(key)
|
|
|
|
}
|
|
|
|
|
2023-02-25 19:13:07 +08:00
|
|
|
func (m *ICefDictionaryValue) SetNull(key string) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetNull).Call(m.Instance(), api.PascalStr(key))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) SetBool(key string, value bool) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetBool).Call(m.Instance(), api.PascalStr(key), api.PascalBool(value))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) SetInt(key string, value int32) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetInt).Call(m.Instance(), api.PascalStr(key), uintptr(value))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) SetDouble(key string, value float64) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetDouble).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&value)))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) SetString(key string, value string) bool {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetString).Call(m.Instance(), api.PascalStr(key), api.PascalStr(value))
|
2023-02-25 19:13:07 +08:00
|
|
|
return api.GoBool(r1)
|
|
|
|
}
|
|
|
|
|
2023-03-09 16:35:38 +08:00
|
|
|
func (m *ICefDictionaryValue) SetValue(key string, value *ICefValue) (result bool) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetValue).Call(m.Instance(), api.PascalStr(key), value.Instance())
|
2023-03-09 16:35:38 +08:00
|
|
|
result = api.GoBool(r1)
|
|
|
|
if result {
|
|
|
|
if m.values == nil {
|
|
|
|
m.values = make(map[string]*ICefValue)
|
|
|
|
}
|
|
|
|
if v, ok := m.values[key]; ok && v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
m.values[key] = value
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) SetBinary(key string, value *ICefBinaryValue) (result bool) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetBinary).Call(m.Instance(), api.PascalStr(key), value.Instance())
|
2023-03-09 16:35:38 +08:00
|
|
|
result = api.GoBool(r1)
|
|
|
|
if result {
|
|
|
|
if m.binaryValues == nil {
|
|
|
|
m.binaryValues = make(map[string]*ICefBinaryValue)
|
|
|
|
}
|
|
|
|
if v, ok := m.binaryValues[key]; ok && v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
m.binaryValues[key] = value
|
|
|
|
}
|
|
|
|
return
|
2023-02-25 19:13:07 +08:00
|
|
|
}
|
|
|
|
|
2023-03-09 16:35:38 +08:00
|
|
|
func (m *ICefDictionaryValue) SetDictionary(key string, value *ICefDictionaryValue) (result bool) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetDictionary).Call(m.Instance(), api.PascalStr(key), value.Instance())
|
2023-03-09 16:35:38 +08:00
|
|
|
result = api.GoBool(r1)
|
|
|
|
if result {
|
|
|
|
if m.dictionaryValues == nil {
|
|
|
|
m.dictionaryValues = make(map[string]*ICefDictionaryValue)
|
|
|
|
}
|
|
|
|
if v, ok := m.dictionaryValues[key]; ok && v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
m.dictionaryValues[key] = value
|
|
|
|
}
|
|
|
|
return
|
2023-02-25 19:13:07 +08:00
|
|
|
}
|
|
|
|
|
2023-03-09 16:35:38 +08:00
|
|
|
func (m *ICefDictionaryValue) SetList(key string, value *ICefListValue) (result bool) {
|
2023-05-31 17:41:14 +08:00
|
|
|
if !m.IsValid() {
|
|
|
|
return false
|
|
|
|
}
|
2023-06-11 00:10:55 +08:00
|
|
|
r1, _, _ := imports.Proc(def.CefDictionaryValue_SetList).Call(m.Instance(), api.PascalStr(key), value.Instance())
|
2023-03-09 16:35:38 +08:00
|
|
|
result = api.GoBool(r1)
|
|
|
|
if result {
|
|
|
|
if m.listValues == nil {
|
|
|
|
m.listValues = make(map[string]*ICefListValue)
|
|
|
|
}
|
|
|
|
if v, ok := m.listValues[key]; ok && v != nil && v.instance != nil {
|
|
|
|
v.Free()
|
|
|
|
}
|
|
|
|
m.listValues[key] = value
|
|
|
|
}
|
|
|
|
return
|
2023-02-25 19:13:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ICefDictionaryValue) Free() {
|
2023-03-16 09:13:31 +08:00
|
|
|
if m.instance != nil {
|
|
|
|
m.Clear()
|
|
|
|
m.base.Free(m.Instance())
|
|
|
|
m.instance = nil
|
|
|
|
}
|
2023-02-25 19:13:07 +08:00
|
|
|
}
|