diff --git a/cef/cef-base-browser-window.go b/cef/cef-base-browser-window.go index b9d1fc45..7b792756 100644 --- a/cef/cef-base-browser-window.go +++ b/cef/cef-base-browser-window.go @@ -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 // diff --git a/cef/cef-chromium.go b/cef/cef-chromium.go index de3b2bb6..4fc893d8 100644 --- a/cef/cef-chromium.go +++ b/cef/cef-chromium.go @@ -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 { diff --git a/cef/cef-commponent-tray_window.go b/cef/cef-commponent-tray_window.go index 574feafd..eb0d4e9c 100644 --- a/cef/cef-commponent-tray_window.go +++ b/cef/cef-commponent-tray_window.go @@ -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 diff --git a/cef/cef-i-window-parent.go b/cef/cef-i-window-parent.go index 718d604d..f303b48f 100644 --- a/cef/cef-i-window-parent.go +++ b/cef/cef-i-window-parent.go @@ -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() diff --git a/cef/cef-linked-window-parent.go b/cef/cef-linked-window-parent.go index 474ce280..17860d08 100644 --- a/cef/cef-linked-window-parent.go +++ b/cef/cef-linked-window-parent.go @@ -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) } diff --git a/cef/cef-proc.go b/cef/cef-proc.go index 5347d59c..f5452982 100644 --- a/cef/cef-proc.go +++ b/cef/cef-proc.go @@ -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{}) { diff --git a/cef/cef-window-parent.go b/cef/cef-window-parent.go index df4fc0d6..a7f75afa 100644 --- a/cef/cef-window-parent.go +++ b/cef/cef-window-parent.go @@ -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 {