update: NewChromium return, TCEFChromium > IChromium

This commit is contained in:
杨红岩 2022-12-01 15:24:22 +08:00
parent c128d6aef8
commit 87a1d5b6b0
7 changed files with 10 additions and 8 deletions

View File

@ -36,7 +36,7 @@ type IBaseWindow interface {
//BaseWindow 是一个基于chromium 和 lcl 的窗口组件
type BaseWindow struct {
*lcl.TForm //
chromium *TCEFChromium //
chromium IChromium //
windowParent ITCefWindow //
windowInfo *TCefWindowInfo //窗口信息
windowId int32 //

View File

@ -54,7 +54,7 @@ type TCEFChromium struct {
emitLock *sync.Mutex
}
func NewChromium(owner lcl.IComponent, config *tCefChromiumConfig) *TCEFChromium {
func NewChromium(owner lcl.IComponent, config *tCefChromiumConfig) IChromium {
m := new(TCEFChromium)
m.procName = "CEFChromium"
if config != nil {

View File

@ -26,7 +26,7 @@ type tCefTrayForm struct {
*lcl.TForm
owner lcl.IWinControl
trayIcon *lcl.TTrayIcon
chromium *TCEFChromium
chromium IChromium
windowParent ITCefWindow
x, y, w, h int32
mouseUp TMouseEvent

View File

@ -9,7 +9,7 @@ import (
type ITCefWindow interface {
lcl.IWinControl
Type() consts.TCefWindowHandleType
SetChromium(chromium *TCEFChromium, tag int32)
SetChromium(chromium IChromium, tag int32)
UpdateSize()
HandleAllocated() bool
CreateHandle()

View File

@ -32,7 +32,7 @@ func (m *TCEFLinkedWindowParent) Type() consts.TCefWindowHandleType {
return consts.Wht_LinkedWindowParent
}
func (m *TCEFLinkedWindowParent) SetChromium(chromium *TCEFChromium, tag int32) {
func (m *TCEFLinkedWindowParent) SetChromium(chromium IChromium, tag int32) {
_CEFLinkedWindow_SetChromium(m.instance, chromium, tag)
}

View File

@ -77,8 +77,8 @@ func _CEFLinkedWindow_UpdateSize(instance uintptr) {
Proc("CEFLinkedWindow_UpdateSize").Call(instance)
}
func _CEFLinkedWindow_SetChromium(instance uintptr, chromium *TCEFChromium, tag int32) {
Proc("CEFLinkedWindow_SetChromium").Call(instance, chromium.instance, uintptr(tag))
func _CEFLinkedWindow_SetChromium(instance uintptr, chromium IChromium, tag int32) {
Proc("CEFLinkedWindow_SetChromium").Call(instance, chromium.Instance(), uintptr(tag))
}
func _CEFLinkedWindow_OnEnter(instance uintptr, fn interface{}) {

View File

@ -9,6 +9,7 @@
package cef
import (
"fmt"
"github.com/energye/energy/consts"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/api"
@ -40,7 +41,8 @@ func (m *TCEFWindowParent) Type() consts.TCefWindowHandleType {
return consts.Wht_WindowParent
}
func (m *TCEFWindowParent) SetChromium(chromium *TCEFChromium, tag int32) {
func (m *TCEFWindowParent) SetChromium(chromium IChromium, tag int32) {
fmt.Println("chromium.Instance()", chromium.Instance())
}
func (m *TCEFWindowParent) HandleAllocated() bool {