2022-10-04 13:21:05 +08:00
|
|
|
//----------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
|
|
//
|
2022-10-04 16:38:43 +08:00
|
|
|
// Licensed under GNU General Public License v3.0
|
2022-10-04 13:21:05 +08:00
|
|
|
//
|
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
package cef
|
|
|
|
|
|
|
|
import (
|
2022-10-26 19:52:55 +08:00
|
|
|
"github.com/energye/energy/consts"
|
2022-10-04 13:21:05 +08:00
|
|
|
"github.com/energye/golcl/lcl"
|
|
|
|
"github.com/energye/golcl/lcl/api"
|
|
|
|
"github.com/energye/golcl/lcl/types"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type TCEFWindowParent struct {
|
|
|
|
BaseWinControl
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCEFWindowParent(owner lcl.IComponent) *TCEFWindowParent {
|
|
|
|
m := new(TCEFWindowParent)
|
|
|
|
m.procName = "CEFWindow"
|
2022-11-29 20:04:08 +08:00
|
|
|
m.instance = _Create(m.procName, lcl.CheckPtr(owner))
|
2022-10-04 13:21:05 +08:00
|
|
|
m.ptr = unsafe.Pointer(m.instance)
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) Handle() types.HWND {
|
2022-11-29 20:04:08 +08:00
|
|
|
return _GetHandle(m.procName, m.instance)
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) UpdateSize() {
|
|
|
|
_CEFWindow_UpdateSize(m.instance)
|
|
|
|
}
|
|
|
|
|
2022-10-26 19:52:55 +08:00
|
|
|
func (m *TCEFWindowParent) Type() consts.TCefWindowHandleType {
|
|
|
|
return consts.Wht_WindowParent
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) SetChromium(chromium *TCEFChromium, tag int32) {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) HandleAllocated() bool {
|
2022-11-29 20:04:08 +08:00
|
|
|
return api.DBoolToGoBool(_HandleAllocated(m.procName, m.instance))
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) CreateHandle() {
|
2022-11-29 20:04:08 +08:00
|
|
|
_CreateHandle(m.procName, m.instance)
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) DestroyChildWindow() bool {
|
2022-11-29 20:04:08 +08:00
|
|
|
return api.DBoolToGoBool(_DestroyChildWindow(m.procName, m.instance))
|
2022-10-04 13:21:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) SetOnEnter(fn lcl.TNotifyEvent) {
|
|
|
|
_CEFWindow_OnEnter(m.instance, fn)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *TCEFWindowParent) SetOnExit(fn lcl.TNotifyEvent) {
|
|
|
|
_CEFWindow_OnExit(m.instance, fn)
|
|
|
|
}
|
2022-10-30 00:35:04 +08:00
|
|
|
|
|
|
|
func (m *TCEFWindowParent) Free() {
|
2022-11-29 20:04:08 +08:00
|
|
|
_Free(m.procName, m.instance)
|
2022-10-30 00:35:04 +08:00
|
|
|
}
|