Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
964b0bbb
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
964b0bbb
编写于
7月 26, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
U: CEFWindowParent, Add SetFocus, CanFocus Proc Api
上级
0f451654
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
46 addition
and
21 deletion
+46
-21
cef/aux-devtools_windows.go
cef/aux-devtools_windows.go
+1
-1
cef/base-win-control.go
cef/base-win-control.go
+1
-1
cef/browser-window-lcl.go
cef/browser-window-lcl.go
+5
-0
cef/chromium-browser.go
cef/chromium-browser.go
+1
-1
cef/internal/def/proc-def-index.go
cef/internal/def/proc-def-index.go
+4
-0
cef/internal/def/proc-def.go
cef/internal/def/proc-def.go
+4
-0
cef/tray-cef-commponent_windows.go
cef/tray-cef-commponent_windows.go
+1
-1
cef/types-window-parent.go
cef/types-window-parent.go
+4
-14
cef/types-window-parent_other.go
cef/types-window-parent_other.go
+13
-2
cef/types-window-parent_windows.go
cef/types-window-parent_windows.go
+12
-1
未找到文件。
cef/aux-devtools_windows.go
浏览文件 @
964b0bbb
...
...
@@ -31,7 +31,7 @@ func createDevtoolsWindow(owner *LCLBrowserWindow) *devToolsWindow {
window
.
TForm
=
lcl
.
NewForm
(
owner
)
window
.
SetCaption
(
devToolsName
)
window
.
SetIcon
(
owner
.
Icon
())
window
.
SetWindowParent
(
NewCEFWindow
(
window
))
window
.
SetWindowParent
(
NewCEFWindow
Parent
(
window
))
window
.
WindowParent
()
.
SetParent
(
window
)
window
.
WindowParent
()
.
SetAlign
(
types
.
AlClient
)
window
.
SetWidth
(
1024
)
...
...
cef/base-win-control.go
浏览文件 @
964b0bbb
...
...
@@ -25,7 +25,7 @@ type BaseWinControl struct {
// IsValid 是否有效
func
(
m
*
BaseWinControl
)
IsValid
()
bool
{
return
m
.
instance
!=
nil
return
m
!=
nil
&&
m
.
instance
!=
nil
}
// Instance 当前实例
...
...
cef/browser-window-lcl.go
浏览文件 @
964b0bbb
...
...
@@ -504,6 +504,11 @@ func (m *LCLBrowserWindow) ChromiumCreate(config *TCefChromiumConfig, defaultUrl
}
m
.
Chromium
()
.
SendCaptureLostEvent
()
})
m
.
Chromium
()
.
SetOnGotFocus
(
func
(
sender
lcl
.
IObject
,
browser
*
ICefBrowser
)
{
if
m
.
IsValid
()
{
m
.
WindowParent
()
.
SetFocus
()
}
})
// 主窗口、子窗口chromium检测
if
m
.
WindowProperty
()
.
WindowType
!=
consts
.
WT_DEV_TOOLS
{
window
.
CurrentBrowseWindowCache
=
m
...
...
cef/chromium-browser.go
浏览文件 @
964b0bbb
...
...
@@ -41,7 +41,7 @@ type TCEFChromiumBrowser struct {
func
NewChromiumBrowser
(
owner
lcl
.
IWinControl
,
config
*
TCefChromiumConfig
)
ICEFChromiumBrowser
{
var
m
=
new
(
TCEFChromiumBrowser
)
m
.
chromium
=
NewChromium
(
owner
,
config
)
m
.
windowParent
=
NewCEFWindow
(
owner
)
m
.
windowParent
=
NewCEFWindow
Parent
(
owner
)
m
.
windowParent
.
SetParent
(
owner
)
m
.
windowParent
.
SetChromium
(
m
.
chromium
,
0
)
m
.
createTimer
=
lcl
.
NewTimer
(
owner
)
...
...
cef/internal/def/proc-def-index.go
浏览文件 @
964b0bbb
...
...
@@ -557,6 +557,8 @@ const (
CEFWindow_OnExit
CEFWindow_SetTag
CEFWindow_GetTag
CEFWindow_SetFocus
CEFWindow_CanFocus
// TCEFLinkedWindowParent
CEFLinkedWindow_Create
CEFLinkedWindow_GetHandle
...
...
@@ -591,6 +593,8 @@ const (
CEFLinkedWindow_SetChromium
CEFLinkedWindow_SetTag
CEFLinkedWindow_GetTag
CEFLinkedWindow_SetFocus
CEFLinkedWindow_CanFocus
// ICefBrowser
CEFBrowser_ShowDevTools
CEFBrowser_CloseDevTools
...
...
cef/internal/def/proc-def.go
浏览文件 @
964b0bbb
...
...
@@ -557,6 +557,8 @@ func init() {
dllimports
.
NewEnergyImport
(
"CEFWindow_OnExit"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFWindow_SetTag"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFWindow_GetTag"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFWindow_SetFocus"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFWindow_CanFocus"
,
0
),
//CEFLinkedParentWindow
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_Create"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_GetHandle"
,
0
),
...
...
@@ -591,6 +593,8 @@ func init() {
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_SetChromium"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_SetTag"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_GetTag"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_SetFocus"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFLinkedWindow_CanFocus"
,
0
),
//ICefBrowser
dllimports
.
NewEnergyImport
(
"CEFBrowser_ShowDevTools"
,
0
),
dllimports
.
NewEnergyImport
(
"CEFBrowser_CloseDevTools"
,
0
),
...
...
cef/tray-cef-commponent_windows.go
浏览文件 @
964b0bbb
...
...
@@ -231,7 +231,7 @@ func (m *CEFTray) createTrayWindow() {
})
}
})
m
.
windowParent
=
NewCEFWindow
(
m
.
TForm
)
m
.
windowParent
=
NewCEFWindow
Parent
(
m
.
TForm
)
m
.
windowParent
.
SetParent
(
m
.
TForm
)
m
.
windowParent
.
SetAlign
(
types
.
AlClient
)
m
.
windowParent
.
SetAnchors
(
types
.
NewSet
(
types
.
AkTop
,
types
.
AkLeft
,
types
.
AkRight
,
types
.
AkBottom
))
...
...
cef/
i
-window-parent.go
→
cef/
types
-window-parent.go
浏览文件 @
964b0bbb
...
...
@@ -13,13 +13,14 @@
package
cef
import
(
"github.com/energye/energy/v2/common"
"github.com/energye/energy/v2/consts"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/types"
)
// ICEFWindowParent 接口定义
// Windows return TCEFWindowParent
// MacOSX, Linux return TCEFLinkedWindowParent
type
ICEFWindowParent
interface
{
lcl
.
IWinControl
Instance
()
uintptr
...
...
@@ -58,17 +59,6 @@ type ICEFWindowParent interface {
SetBoundsRect
(
value
types
.
TRect
)
// 设置矩形边界
point
()
(
x
,
y
int32
)
// 坐标点
size
()
(
w
,
h
int32
)
// 大小
}
// NewCEFWindow 创建CEFWindowParent
//
// # Windows return TCEFWindowParent
//
// MacOSX, Linux return TCEFLinkedWindowParent
func
NewCEFWindow
(
owner
lcl
.
IComponent
)
ICEFWindowParent
{
if
common
.
IsWindows
()
{
return
NewCEFWindowParent
(
owner
)
}
else
{
return
NewCEFLinkedWindowParent
(
owner
)
}
SetFocus
()
//
CanFocus
()
bool
//
}
cef/
linked-window-parent
.go
→
cef/
types-window-parent_other
.go
浏览文件 @
964b0bbb
...
...
@@ -8,6 +8,8 @@
//
//----------------------------------------
//go:build !windows
// CEFWindowParent组件
// MacOSX, Linux
...
...
@@ -29,8 +31,8 @@ type TCEFLinkedWindowParent struct {
x
,
y
,
w
,
h
int32
}
// NewCEF
LinkedWindowParent 创建一个新的WindowParent
组件
func
NewCEF
Linked
WindowParent
(
owner
lcl
.
IComponent
)
*
TCEFLinkedWindowParent
{
// NewCEF
WindowParent 创建一个新的 TCEFLinkedWindowParent
组件
func
NewCEFWindowParent
(
owner
lcl
.
IComponent
)
*
TCEFLinkedWindowParent
{
m
:=
new
(
TCEFLinkedWindowParent
)
r1
,
_
,
_
:=
imports
.
Proc
(
def
.
CEFLinkedWindow_Create
)
.
Call
(
lcl
.
CheckPtr
(
owner
))
m
.
instance
=
unsafe
.
Pointer
(
r1
)
...
...
@@ -248,3 +250,12 @@ func (m *TCEFLinkedWindowParent) point() (x, y int32) {
func
(
m
*
TCEFLinkedWindowParent
)
size
()
(
w
,
h
int32
)
{
return
m
.
w
,
m
.
h
}
func
(
m
*
TCEFLinkedWindowParent
)
SetFocus
()
{
imports
.
Proc
(
def
.
CEFWindow_SetFocus
)
.
Call
(
m
.
Instance
())
}
func
(
m
*
TCEFLinkedWindowParent
)
CanFocus
()
bool
{
r1
,
_
,
_
:=
imports
.
Proc
(
def
.
CEFWindow_CanFocus
)
.
Call
(
m
.
Instance
())
return
api
.
GoBool
(
r1
)
}
cef/
window-parent
.go
→
cef/
types-window-parent_windows
.go
浏览文件 @
964b0bbb
...
...
@@ -8,6 +8,8 @@
//
//----------------------------------------
//go:build windows
package
cef
import
(
...
...
@@ -26,7 +28,7 @@ type TCEFWindowParent struct {
x
,
y
,
w
,
h
int32
}
// NewCEFWindowParent 创建一个新的
WindowParent
组件
// NewCEFWindowParent 创建一个新的
TCEFWindowParent
组件
func
NewCEFWindowParent
(
owner
lcl
.
IComponent
)
*
TCEFWindowParent
{
m
:=
new
(
TCEFWindowParent
)
r1
,
_
,
_
:=
imports
.
Proc
(
def
.
CEFWindow_Create
)
.
Call
(
lcl
.
CheckPtr
(
owner
))
...
...
@@ -244,3 +246,12 @@ func (m *TCEFWindowParent) point() (x, y int32) {
func
(
m
*
TCEFWindowParent
)
size
()
(
w
,
h
int32
)
{
return
m
.
w
,
m
.
h
}
func
(
m
*
TCEFWindowParent
)
SetFocus
()
{
imports
.
Proc
(
def
.
CEFLinkedWindow_SetFocus
)
.
Call
(
m
.
Instance
())
}
func
(
m
*
TCEFWindowParent
)
CanFocus
()
bool
{
r1
,
_
,
_
:=
imports
.
Proc
(
def
.
CEFLinkedWindow_CanFocus
)
.
Call
(
m
.
Instance
())
return
api
.
GoBool
(
r1
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录