upgrade-dev v2.2.9

This commit is contained in:
杨红岩 2023-03-13 18:12:55 +08:00
parent a345b03afb
commit 3e91eed784
6 changed files with 61 additions and 39 deletions

View File

@ -1,34 +0,0 @@
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
// energy Id生成器
package cef
var (
_bind_id = 10000
_event_id = 10000
)
// __bind_id 绑定变量ID
func __bind_id() int {
_bind_id++
return _bind_id
}
// __idReset 重置ID
func __idReset() {
_bind_id = 10000
}
// __event_id 事件ID
func __event_id() int {
_event_id++
return _event_id
}

View File

@ -1067,6 +1067,7 @@ func init() {
dllimports.NewEnergyImport("CefDownloadItemCallback_Pause", 0),
dllimports.NewEnergyImport("CefDownloadItemCallback_Cancel", 0),
dllimports.NewEnergyImport("CefDownloadItemCallback_Resume", 0),
dllimports.NewEnergyImport("CefDownloadItemCallbackRef_Pause", 0),
//ICefBrowserView
dllimports.NewEnergyImport("CefBrowserView_Browser", 0),
dllimports.NewEnergyImport("CefBrowserView_ChromeToolbar", 0),
@ -2129,6 +2130,7 @@ const (
internale_CefDownloadItemCallback_Pause
internale_CefDownloadItemCallback_Cancel
internale_CefDownloadItemCallback_Resume
internale_CefDownloadItemCallbackRef_Pause
//ICefBrowserView
internale_CefBrowserView_Browser
internale_CefBrowserView_ChromeToolbar

View File

@ -17,27 +17,38 @@ import (
)
func (m *ICefDisplay) ID() (result int64) {
imports.Proc(internale_CEFDisplay_ID).Call(uintptr(m.instance), uintptr(unsafe.Pointer(&result)))
imports.Proc(internale_CEFDisplay_ID).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
return
}
func (m *ICefDisplay) DeviceScaleFactor() float32 {
var result uintptr
imports.Proc(internale_CEFDisplay_DeviceScaleFactor).Call(uintptr(m.instance), uintptr(unsafe.Pointer(&result)))
imports.Proc(internale_CEFDisplay_DeviceScaleFactor).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
return *(*float32)(unsafe.Pointer(result))
}
func (m *ICefDisplay) Rotation() int32 {
r1, _, _ := imports.Proc(internale_CEFDisplay_Rotation).Call(uintptr(m.instance))
r1, _, _ := imports.Proc(internale_CEFDisplay_Rotation).Call(m.Instance())
return int32(r1)
}
func (m *ICefDisplay) Bounds() (result TCefRect) {
imports.Proc(internale_CEFDisplay_Bounds).Call(uintptr(m.instance), uintptr(unsafe.Pointer(&result)))
imports.Proc(internale_CEFDisplay_Bounds).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
return
}
func (m *ICefDisplay) WorkArea() (result TCefRect) {
imports.Proc(internale_CEFDisplay_WorkArea).Call(uintptr(m.instance), uintptr(unsafe.Pointer(&result)))
imports.Proc(internale_CEFDisplay_WorkArea).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
return
}
func (m *ICefDisplay) Instance() uintptr {
return uintptr(m.instance)
}
func (m *ICefDisplay) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}

View File

@ -139,6 +139,23 @@ func (m *ICefDownloadItem) State() int32 {
}
}
func (m *ICefDownloadItem) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}
var DownloadItemCallbackRef downloadItemCallback
type downloadItemCallback uintptr
func (*downloadItemCallback) UnWrap(data *ICefDownloadItemCallback) *ICefDownloadItemCallback {
var result uintptr
imports.Proc(internale_CefDownloadItemCallbackRef_Pause).Call(data.Instance(), uintptr(unsafe.Pointer(&result)))
return &ICefDownloadItemCallback{instance: unsafe.Pointer(result)}
}
func (m *ICefDownloadItemCallback) Instance() uintptr {
return uintptr(m.instance)
}
@ -164,6 +181,13 @@ func (m *ICefDownloadItemCallback) Resume() {
imports.Proc(internale_CefDownloadItemCallback_Resume).Call(m.Instance())
}
func (m *ICefDownloadItemCallback) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}
func (m *ICefBeforeDownloadCallback) Instance() uintptr {
return uintptr(m.instance)
}
@ -177,3 +201,10 @@ func (m *ICefBeforeDownloadCallback) Instance() uintptr {
func (m *ICefBeforeDownloadCallback) Cont(downloadPath string, showDialog bool) {
imports.Proc(internale_CefBeforeDownloadCallback_Cont).Call(m.Instance(), api.PascalStr(downloadPath), api.PascalBool(showDialog))
}
func (m *ICefBeforeDownloadCallback) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}

View File

@ -43,6 +43,13 @@ func (m *ICefPdfPrintCallback) OnPdfPrintFinished(fn OnPdfPrintFinished) {
imports.Proc(internale_CefPdfPrintCallback_OnPdfPrintFinished).Call(m.Instance(), api.MakeEventDataPtr(fn))
}
func (m *ICefPdfPrintCallback) Free() {
if m.instance != nil {
m.base.Free(m.Instance())
m.instance = nil
}
}
func init() {
lcl.RegisterExtEventCallback(func(fn interface{}, getVal func(idx int) uintptr) bool {
switch fn.(type) {

View File

@ -264,6 +264,7 @@ type ICefDictionaryValue struct {
// ICefDisplay
type ICefDisplay struct {
base TCefBaseRefCounted
instance unsafe.Pointer
}
@ -414,6 +415,7 @@ type ICefV8ArrayBufferReleaseCallback struct {
// ICefDownloadItem 下载项
type ICefDownloadItem struct {
base TCefBaseRefCounted
instance unsafe.Pointer
}
@ -421,6 +423,7 @@ type ICefDownloadItem struct {
//
// 下载中回调
type ICefDownloadItemCallback struct {
base TCefBaseRefCounted
instance unsafe.Pointer
}
@ -428,11 +431,13 @@ type ICefDownloadItemCallback struct {
//
// 下载之前回调
type ICefBeforeDownloadCallback struct {
base TCefBaseRefCounted
instance unsafe.Pointer
}
// ICefPdfPrintCallback
type ICefPdfPrintCallback struct {
base TCefBaseRefCounted
instance unsafe.Pointer
}