mirror of
https://gitee.com/energye/energy.git
synced 2024-11-30 10:47:57 +08:00
update: NewChromium return, TCEFChromium > IChromium
This commit is contained in:
parent
c128d6aef8
commit
87a1d5b6b0
@ -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 //
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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{}) {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user