diff --git a/cef/cef-proc-def.go b/cef/cef-proc-def.go index 8e12535728b67070dcf7d318a63464c29ecf2c47..7629cf84e0d215158b194301d0c6f9135a0376af 100644 --- a/cef/cef-proc-def.go +++ b/cef/cef-proc-def.go @@ -718,6 +718,43 @@ func init() { dllimports.NewEnergyImport("CefValue_SetBinary", 0), dllimports.NewEnergyImport("CefValue_SetDictionary", 0), dllimports.NewEnergyImport("CefValue_SetList", 0), + //ICefBinaryValue + dllimports.NewEnergyImport("CefBinaryValueRef_New", 0), + dllimports.NewEnergyImport("CefBinaryValueRef_Create", 0), + dllimports.NewEnergyImport("CefBinaryValue_IsValid", 0), + dllimports.NewEnergyImport("CefBinaryValue_IsOwned", 0), + dllimports.NewEnergyImport("CefBinaryValue_Copy", 0), + dllimports.NewEnergyImport("CefBinaryValue_GetSize", 0), + dllimports.NewEnergyImport("CefBinaryValue_GetData", 0), + //ICefDictionaryValue + dllimports.NewEnergyImport("CefDictionaryValueRef_New", 0), + dllimports.NewEnergyImport("CefDictionaryValue_IsValid", 0), + dllimports.NewEnergyImport("CefDictionaryValue_isOwned", 0), + dllimports.NewEnergyImport("CefDictionaryValue_IsReadOnly", 0), + dllimports.NewEnergyImport("CefDictionaryValue_Copy", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetSize", 0), + dllimports.NewEnergyImport("CefDictionaryValue_Clear", 0), + dllimports.NewEnergyImport("CefDictionaryValue_HasKey", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetKeys", 0), + dllimports.NewEnergyImport("CefDictionaryValue_Remove", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetType", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetValue", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetBool", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetInt", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetDouble", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetString", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetBinary", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetDictionary", 0), + dllimports.NewEnergyImport("CefDictionaryValue_GetList", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetValue", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetNull", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetBool", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetInt", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetDouble", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetString", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetBinary", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetDictionary", 0), + dllimports.NewEnergyImport("CefDictionaryValue_SetList", 0), } imports.SetEnergyImportDefs(energyImportDefs) } @@ -1424,4 +1461,41 @@ const ( internale_CefValue_SetBinary internale_CefValue_SetDictionary internale_CefValue_SetList + //ICefBinaryValue + internale_CefBinaryValueRef_New + internale_CefBinaryValueRef_Create + internale_CefBinaryValue_IsValid + internale_CefBinaryValue_IsOwned + internale_CefBinaryValue_Copy + internale_CefBinaryValue_GetSize + internale_CefBinaryValue_GetData + //ICefDictionaryValue + internale_CefDictionaryValueRef_New + internale_CefDictionaryValue_IsValid + internale_CefDictionaryValue_isOwned + internale_CefDictionaryValue_IsReadOnly + internale_CefDictionaryValue_Copy + internale_CefDictionaryValue_GetSize + internale_CefDictionaryValue_Clear + internale_CefDictionaryValue_HasKey + internale_CefDictionaryValue_GetKeys + internale_CefDictionaryValue_Remove + internale_CefDictionaryValue_GetType + internale_CefDictionaryValue_GetValue + internale_CefDictionaryValue_GetBool + internale_CefDictionaryValue_GetInt + internale_CefDictionaryValue_GetDouble + internale_CefDictionaryValue_GetString + internale_CefDictionaryValue_GetBinary + internale_CefDictionaryValue_GetDictionary + internale_CefDictionaryValue_GetList + internale_CefDictionaryValue_SetValue + internale_CefDictionaryValue_SetNull + internale_CefDictionaryValue_SetBool + internale_CefDictionaryValue_SetInt + internale_CefDictionaryValue_SetDouble + internale_CefDictionaryValue_SetString + internale_CefDictionaryValue_SetBinary + internale_CefDictionaryValue_SetDictionary + internale_CefDictionaryValue_SetList ) diff --git a/cef/cef-types-binary-value.go b/cef/cef-types-binary-value.go index 52a42860fc4ce2ef47b7d4b4a2be4bb083c758cb..9ded7d5f1ff50f220fca55b01c9b76ebcb69c37e 100644 --- a/cef/cef-types-binary-value.go +++ b/cef/cef-types-binary-value.go @@ -1,5 +1,34 @@ package cef +import ( + "github.com/energye/energy/common/imports" + "github.com/energye/energy/types" + "github.com/energye/golcl/lcl/api" + "unsafe" +) + +// BinaryValueRef -> ICefBinaryValue +var BinaryValueRef cefBinaryValue + +//cefBinaryValue +type cefBinaryValue uintptr + +func (*cefBinaryValue) New(data []byte) *ICefBinaryValue { + var result uintptr + imports.Proc(internale_CefBinaryValueRef_New).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result))) + return &ICefBinaryValue{ + instance: unsafe.Pointer(result), + } +} + +func (*cefBinaryValue) Create() *ICefBinaryValue { + var result uintptr + imports.Proc(internale_CefBinaryValueRef_Create).Call(uintptr(unsafe.Pointer(&result))) + return &ICefBinaryValue{ + instance: unsafe.Pointer(result), + } +} + // Instance 实例 func (m *ICefBinaryValue) Instance() uintptr { if m == nil { @@ -7,3 +36,31 @@ func (m *ICefBinaryValue) Instance() uintptr { } return uintptr(m.instance) } + +func (m *ICefBinaryValue) IsValid() bool { + r1, _, _ := imports.Proc(internale_CefBinaryValue_IsValid).Call(m.Instance()) + return api.GoBool(r1) +} + +func (m *ICefBinaryValue) IsOwned() bool { + r1, _, _ := imports.Proc(internale_CefBinaryValue_IsOwned).Call(m.Instance()) + return api.GoBool(r1) +} + +func (m *ICefBinaryValue) Copy() *ICefBinaryValue { + var result uintptr + imports.Proc(internale_CefBinaryValue_Copy).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) + return &ICefBinaryValue{ + instance: unsafe.Pointer(result), + } +} + +func (m *ICefBinaryValue) GetSize() uint32 { + r1, _, _ := imports.Proc(internale_CefBinaryValue_GetSize).Call(m.Instance()) + return uint32(r1) +} + +func (m *ICefBinaryValue) GetData(buffer []byte, dataOffset types.NativeUInt) uint32 { + r1, _, _ := imports.Proc(internale_CefBinaryValue_GetData).Call(m.Instance(), uintptr(unsafe.Pointer(&buffer[0])), uintptr(uint32(len(buffer))), dataOffset.ToPtr()) + return uint32(r1) +} diff --git a/cef/cef-types-dictionary-value.go b/cef/cef-types-dictionary-value.go index d24c5e5781184e0bd83311c183faafbf7624316e..1c8da9f873a1414347d169c1b6cc1f5247d797bc 100644 --- a/cef/cef-types-dictionary-value.go +++ b/cef/cef-types-dictionary-value.go @@ -1,5 +1,23 @@ package cef +import ( + "unsafe" +) + +// DictionaryValueRef -> ICefDictionaryValue +var DictionaryValueRef cefDictionaryValue + +//cefDictionaryValue +type cefDictionaryValue uintptr + +func (*cefDictionaryValue) New() *ICefDictionaryValue { + var result uintptr + //imports.Proc(internale_CefBinaryValueRef_New).Call(uintptr(unsafe.Pointer(&data[0])), uintptr(uint32(len(data))), uintptr(unsafe.Pointer(&result))) + return &ICefDictionaryValue{ + instance: unsafe.Pointer(result), + } +} + // Instance 实例 func (m *ICefDictionaryValue) Instance() uintptr { if m == nil { diff --git a/cef/cef-types-v8-value.go b/cef/cef-types-v8-value.go index d1a48c9bf6d6ac730b5e5cff8d7e086fdef87588..367a61d27fd149eb483e13bccd4e0757f62b8401 100644 --- a/cef/cef-types-v8-value.go +++ b/cef/cef-types-v8-value.go @@ -25,170 +25,107 @@ func (m *ICefV8Value) IsValid() bool { } func (m *ICefV8Value) IsUndefined() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsUndefined).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsNull() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsNull).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsBool() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsBool).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsInt() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsInt).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsUInt() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsUInt).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsDouble() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsDouble).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsDate() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsDate).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsString() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsString).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsObject() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsObject).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsArray() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsArray).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsArrayBuffer() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsArrayBuffer).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsFunction() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsFunction).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsPromise() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsPromise).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) IsSame() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsSame).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) GetBoolValue() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_GetBoolValue).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) GetIntValue() int32 { - if !m.IsValid() { - return 0 - } r1, _, _ := imports.Proc(internale_CefV8Value_GetIntValue).Call(m.Instance()) return int32(r1) } func (m *ICefV8Value) GetUIntValue() uint32 { - if !m.IsValid() { - return 0 - } r1, _, _ := imports.Proc(internale_CefV8Value_GetIntValue).Call(m.Instance()) return uint32(r1) } func (m *ICefV8Value) GetDoubleValue() (result float64) { - if !m.IsValid() { - return 0 - } imports.Proc(internale_CefV8Value_GetDoubleValue).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) return result } func (m *ICefV8Value) GetDateValue() time.Time { - if !m.IsValid() { - return time.Time{} - } var result float64 imports.Proc(internale_CefV8Value_GetDateValue).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) return common.DDateTimeToGoDateTime(result) } func (m *ICefV8Value) GetStringValue() string { - if !m.IsValid() { - return "" - } r1, _, _ := imports.Proc(internale_CefV8Value_GetStringValue).Call(m.Instance()) return api.GoStr(r1) } func (m *ICefV8Value) IsUserCreated() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_IsUserCreated).Call(m.Instance()) return api.GoBool(r1) } @@ -203,65 +140,41 @@ func (m *ICefV8Value) IsUserCreated() bool { //} func (m *ICefV8Value) ClearException() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_ClearException).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) WillRethrowExceptions() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_WillRethrowExceptions).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) SetRethrowExceptions(reThrow bool) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_SetRethrowExceptions).Call(m.Instance(), api.PascalBool(reThrow)) return api.GoBool(r1) } func (m *ICefV8Value) HasValueByKey(key string) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_HasValueByKey).Call(m.Instance(), api.PascalStr(key)) return api.GoBool(r1) } func (m *ICefV8Value) HasValueByIndex(index int32) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_HasValueByIndex).Call(m.Instance(), uintptr(index)) return api.GoBool(r1) } func (m *ICefV8Value) DeleteValueByKey(key string) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_DeleteValueByKey).Call(m.Instance(), api.PascalStr(key)) return api.GoBool(r1) } func (m *ICefV8Value) DeleteValueByIndex(index int32) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_DeleteValueByIndex).Call(m.Instance(), uintptr(index)) return api.GoBool(r1) } func (m *ICefV8Value) GetValueByKey(key string) *ICefV8Value { - if !m.IsValid() { - return nil - } var result uintptr imports.Proc(internale_CefV8Value_GetValueByKey).Call(m.Instance(), api.PascalStr(key), uintptr(unsafe.Pointer(&result))) return &ICefV8Value{ @@ -270,9 +183,6 @@ func (m *ICefV8Value) GetValueByKey(key string) *ICefV8Value { } func (m *ICefV8Value) GetValueByIndex(index int32) *ICefV8Value { - if !m.IsValid() { - return nil - } var result uintptr imports.Proc(internale_CefV8Value_GetValueByIndex).Call(m.Instance(), uintptr(index), uintptr(unsafe.Pointer(&result))) return &ICefV8Value{ @@ -281,25 +191,16 @@ func (m *ICefV8Value) GetValueByIndex(index int32) *ICefV8Value { } func (m *ICefV8Value) SetValueByKey(key string, value *ICefV8Value, attribute consts.TCefV8PropertyAttributes) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_SetValueByKey).Call(m.Instance(), api.PascalStr(key), value.Instance(), attribute.ToPtr()) return api.GoBool(r1) } func (m *ICefV8Value) SetValueByIndex(index int32, value *ICefV8Value) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_SetValueByIndex).Call(m.Instance(), uintptr(index), value.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) SetValueByAccessor(key string, settings consts.TCefV8AccessControls, attribute consts.TCefV8PropertyAttributes) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_SetValueByAccessor).Call(m.Instance(), api.PascalStr(key), settings.ToPtr(), attribute.ToPtr()) return api.GoBool(r1) } @@ -310,17 +211,11 @@ func (m *ICefV8Value) SetValueByAccessor(key string, settings consts.TCefV8Acces //} func (m *ICefV8Value) SetUserData(data *ICefV8Value) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_SetUserData).Call(m.Instance(), data.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) GetUserData() *ICefV8Value { - if !m.IsValid() { - return nil - } var result uintptr imports.Proc(internale_CefV8Value_GetUserData).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) return &ICefV8Value{ @@ -329,25 +224,16 @@ func (m *ICefV8Value) GetUserData() *ICefV8Value { } func (m *ICefV8Value) GetExternallyAllocatedMemory() int32 { - if !m.IsValid() { - return 0 - } r1, _, _ := imports.Proc(internale_CefV8Value_GetExternallyAllocatedMemory).Call(m.Instance()) return int32(r1) } func (m *ICefV8Value) AdjustExternallyAllocatedMemory(changeInBytes int32) int32 { - if !m.IsValid() { - return 0 - } r1, _, _ := imports.Proc(internale_CefV8Value_AdjustExternallyAllocatedMemory).Call(m.Instance(), uintptr(changeInBytes)) return int32(r1) } func (m *ICefV8Value) GetArrayLength() int32 { - if !m.IsValid() { - return 0 - } r1, _, _ := imports.Proc(internale_CefV8Value_GetArrayLength).Call(m.Instance()) return int32(r1) } @@ -357,25 +243,16 @@ func (m *ICefV8Value) GetArrayLength() int32 { //} func (m *ICefV8Value) NeuterArrayBuffer() bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_NeuterArrayBuffer).Call(m.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) GetFunctionName() string { - if !m.IsValid() { - return "" - } r1, _, _ := imports.Proc(internale_CefV8Value_GetFunctionName).Call(m.Instance()) return api.GoStr(r1) } func (m *ICefV8Value) GetFunctionHandler() *ICefV8Handler { - if !m.IsValid() { - return nil - } var result uintptr imports.Proc(internale_CefV8Value_GetFunctionHandler).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) return &ICefV8Handler{ @@ -384,9 +261,6 @@ func (m *ICefV8Value) GetFunctionHandler() *ICefV8Handler { } func (m *ICefV8Value) ExecuteFunction(obj *ICefV8Value, arguments []*ICefV8Value) *ICefV8Value { - if !m.IsValid() { - return nil - } var result uintptr imports.Proc(internale_CefV8Value_ExecuteFunction).Call(m.Instance(), obj.Instance(), uintptr(unsafe.Pointer(&result)), uintptr(unsafe.Pointer(arguments[0])), uintptr(int32(len(arguments)))) return &ICefV8Value{ @@ -395,9 +269,6 @@ func (m *ICefV8Value) ExecuteFunction(obj *ICefV8Value, arguments []*ICefV8Value } func (m *ICefV8Value) ExecuteFunctionWithContext(v8Context *ICefV8Context, obj *ICefV8Value, arguments []*ICefV8Value) *ICefV8Value { - if !m.IsValid() { - return nil - } var result uintptr imports.Proc(internale_CefV8Value_ExecuteFunctionWithContext).Call(m.Instance(), v8Context.Instance(), obj.Instance(), uintptr(unsafe.Pointer(&result)), uintptr(unsafe.Pointer(arguments[0])), uintptr(int32(len(arguments)))) return &ICefV8Value{ @@ -406,17 +277,11 @@ func (m *ICefV8Value) ExecuteFunctionWithContext(v8Context *ICefV8Context, obj * } func (m *ICefV8Value) ResolvePromise(arg *ICefV8Value) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_ResolvePromise).Call(m.Instance(), arg.Instance()) return api.GoBool(r1) } func (m *ICefV8Value) RejectPromise(errorMsg string) bool { - if !m.IsValid() { - return false - } r1, _, _ := imports.Proc(internale_CefV8Value_RejectPromise).Call(m.Instance(), api.PascalStr(errorMsg)) return api.GoBool(r1) } diff --git a/cef/cef-types-value.go b/cef/cef-types-value.go index 3ac47d2efa9a1d6c3d762c894c74a28fdee2719e..bc9ff361f5ae6dd271cf569236e8bebcd639e9e6 100644 --- a/cef/cef-types-value.go +++ b/cef/cef-types-value.go @@ -2,6 +2,8 @@ package cef import ( "github.com/energye/energy/common/imports" + "github.com/energye/energy/consts" + "github.com/energye/golcl/lcl/api" "unsafe" ) @@ -27,82 +29,114 @@ func (m *ICefValue) Instance() uintptr { return uintptr(m.instance) } -func (m *ICefValue) IsValid() { - +func (m *ICefValue) IsValid() bool { + r1, _, _ := imports.Proc(internale_CefValue_IsValid).Call(m.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) IsOwned() { - +func (m *ICefValue) IsOwned() bool { + r1, _, _ := imports.Proc(internale_CefValue_IsOwned).Call(m.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) IsReadOnly() { - +func (m *ICefValue) IsReadOnly() bool { + r1, _, _ := imports.Proc(internale_CefValue_IsReadOnly).Call(m.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) Copy() { - +func (m *ICefValue) Copy() *ICefValue { + var result uintptr + imports.Proc(internale_CefValue_Copy).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) + return &ICefValue{ + instance: unsafe.Pointer(result), + } } -func (m *ICefValue) GetType() { - +func (m *ICefValue) GetType() consts.TCefValueType { + r1, _, _ := imports.Proc(internale_CefValue_GetType).Call(m.Instance()) + return consts.TCefValueType(r1) } -func (m *ICefValue) GetBool() { - +func (m *ICefValue) GetBool() bool { + r1, _, _ := imports.Proc(internale_CefValue_GetBool).Call(m.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) GetInt() { - +func (m *ICefValue) GetInt() int32 { + r1, _, _ := imports.Proc(internale_CefValue_GetInt).Call(m.Instance()) + return int32(r1) } -func (m *ICefValue) GetDouble() { - +func (m *ICefValue) GetDouble() (result float64) { + imports.Proc(internale_CefValue_GetDouble).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) + return result } -func (m *ICefValue) GetString() { - +func (m *ICefValue) GetString() string { + r1, _, _ := imports.Proc(internale_CefValue_GetString).Call(m.Instance()) + return api.GoStr(r1) } -func (m *ICefValue) GetBinary() { - +func (m *ICefValue) GetBinary() *ICefBinaryValue { + var result uintptr + imports.Proc(internale_CefValue_GetBinary).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) + return &ICefBinaryValue{ + instance: unsafe.Pointer(result), + } } -func (m *ICefValue) GetDictionary() { - +func (m *ICefValue) GetDictionary() *ICefDictionaryValue { + var result uintptr + imports.Proc(internale_CefValue_GetDictionary).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) + return &ICefDictionaryValue{ + instance: unsafe.Pointer(result), + } } -func (m *ICefValue) GetList() { - +func (m *ICefValue) GetList() *ICefListValue { + var result uintptr + imports.Proc(internale_CefValue_GetList).Call(m.Instance(), uintptr(unsafe.Pointer(&result))) + return &ICefListValue{ + instance: unsafe.Pointer(result), + } } -func (m *ICefValue) SetNull() { - +func (m *ICefValue) SetNull() bool { + r1, _, _ := imports.Proc(internale_CefValue_SetNull).Call(m.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) SetBool() { - +func (m *ICefValue) SetBool(value bool) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetBool).Call(m.Instance(), api.PascalBool(value)) + return api.GoBool(r1) } -func (m *ICefValue) SetInt() { - +func (m *ICefValue) SetInt(value int32) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetInt).Call(m.Instance(), uintptr(value)) + return api.GoBool(r1) } -func (m *ICefValue) SetDouble() { - +func (m *ICefValue) SetDouble(value float64) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetDouble).Call(m.Instance(), uintptr(unsafe.Pointer(&value))) + return api.GoBool(r1) } -func (m *ICefValue) SetString() { - +func (m *ICefValue) SetString(value string) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetString).Call(m.Instance(), api.PascalStr(value)) + return api.GoBool(r1) } -func (m *ICefValue) SetBinary() { - +func (m *ICefValue) SetBinary(value *ICefBinaryValue) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetBinary).Call(m.Instance(), value.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) SetDictionary() { - +func (m *ICefValue) SetDictionary(value *ICefDictionaryValue) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetDictionary).Call(m.Instance(), value.Instance()) + return api.GoBool(r1) } -func (m *ICefValue) SetList() { - +func (m *ICefValue) SetList(value *ICefListValue) bool { + r1, _, _ := imports.Proc(internale_CefValue_SetList).Call(m.Instance(), value.Instance()) + return api.GoBool(r1) } diff --git a/example/browser-frameless/frameless.go b/example/browser-frameless/frameless.go index 7fd0e0a500988e80ee4728816ccb8741fa6ad479..19c09cb0d9e1d04f8f8133ce4c891ae0f4bc7458 100644 --- a/example/browser-frameless/frameless.go +++ b/example/browser-frameless/frameless.go @@ -33,7 +33,7 @@ func main() { cefApp := cef.NewApplication(config) //指定一个URL地址,或本地html文件目录 cef.BrowserWindow.Config.Url = "http://localhost:22022/index.html" - cef.BrowserWindow.Config.IconFS = "resources/icon.png" + cef.BrowserWindow.Config.IconFS = "resources/icon.ico" cef.BrowserWindow.Config.EnableHideCaption = true cef.BrowserWindow.Config.Title = "Energy Vue + ElementUI 示例" cef.BrowserWindow.Config.Width = 1200 diff --git a/example/dev-test/process-message/process-message.go b/example/dev-test/process-message/process-message.go index 6a51ea752cd7b6ce4fee4e3e73428971eb23d8ca..70511b37218423a6dc9c5b5e120313b3174e821a 100644 --- a/example/dev-test/process-message/process-message.go +++ b/example/dev-test/process-message/process-message.go @@ -42,7 +42,22 @@ func main() { message := cef.ProcessMessage.New("testname") fmt.Println("ProcessMessageRef IsValid", message.IsValid(), message.Name()) list := message.ArgumentList() - fmt.Println("ArgumentList IsValid", list.IsValid()) + list.SetString(0, "值?") + fmt.Println("list IsValid", list.IsValid(), list.GetSize(), list.GetString(0)) + listCopy := list.Copy() + fmt.Println("listCopy GetString", listCopy.IsValid(), list.GetSize(), list.GetString(0), list.GetValue(0).GetType()) + listCopy.SetDouble(1, 112211.22) + fmt.Println("listCopy GetDouble", listCopy.GetDouble(1), listCopy.GetType(1)) + data := make([]byte, 1024, 1024) + for i := 0; i < len(data); i++ { + data[i] = byte(i % 255) + } + value := cef.BinaryValueRef.New(data) + fmt.Println("BinaryValueNew IsValid", value.IsValid()) + fmt.Println("BinaryValueNew size", value.GetSize()) + buf := make([]byte, 300) + fmt.Println("BinaryValueNew GetData", value.GetData(buf, 0)) + fmt.Println("BinaryValueNew GetData buf", buf) return true }) //