Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
924f4e0c
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,发现更多精彩内容 >>
提交
924f4e0c
编写于
7月 17, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
U: remove const.IsMessageLoop, add application.IsMessageLoop()
上级
afc2073e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
23 addition
and
20 deletion
+23
-20
cef/application-callback.go
cef/application-callback.go
+1
-1
cef/application-config.go
cef/application-config.go
+9
-0
cef/application-run.go
cef/application-run.go
+8
-12
cef/chromium-callback.go
cef/chromium-callback.go
+1
-1
cef/tray-sys-commponent.go
cef/tray-sys-commponent.go
+1
-2
consts/consts.go
consts/consts.go
+3
-4
未找到文件。
cef/application-callback.go
浏览文件 @
924f4e0c
...
...
@@ -45,7 +45,7 @@ func appWebKitInitialized() {
return
energyExtensionHandler
:=
V8HandlerRef
.
New
()
energyExtensionHandler
.
Execute
(
func
(
name
string
,
object
*
ICefV8Value
,
arguments
*
TCefV8ValueArray
,
retVal
*
ResultV8Value
,
exception
*
ResultString
)
bool
{
fmt
.
Println
(
"Execute"
,
name
,
consts
.
IsMessageLoop
,
application
.
SingleProcess
())
fmt
.
Println
(
"Execute"
,
name
,
application
.
IsMessageLoop
()
,
application
.
SingleProcess
())
if
name
==
"mouseMove"
{
message
:=
&
ipcArgument
.
List
{
Id
:
-
1
,
...
...
cef/application-config.go
浏览文件 @
924f4e0c
...
...
@@ -160,6 +160,15 @@ func (m *TCEFApplication) MultiThreadedMessageLoop() bool {
return
api
.
GoBool
(
r1
)
}
// IsMessageLoop
// 消息轮询方式使用不同的窗口组件
// return true: 使用VF(views framework)窗口组件, false: 使用LCL窗口组件
func
(
m
*
TCEFApplication
)
IsMessageLoop
()
bool
{
emp
:=
m
.
ExternalMessagePump
()
mtml
:=
m
.
MultiThreadedMessageLoop
()
return
!
emp
&&
!
mtml
}
func
(
m
*
TCEFApplication
)
SetMultiThreadedMessageLoop
(
value
bool
)
{
imports
.
Proc
(
def
.
CEFAppConfig_SetMultiThreadedMessageLoop
)
.
Call
(
api
.
PascalBool
(
value
))
}
...
...
cef/application-run.go
浏览文件 @
924f4e0c
...
...
@@ -16,7 +16,6 @@ import (
"github.com/energye/energy/v2/cef/lclwidget"
"github.com/energye/energy/v2/cef/process"
"github.com/energye/energy/v2/common"
"github.com/energye/energy/v2/consts"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/api"
)
...
...
@@ -61,35 +60,32 @@ func Run(app *TCEFApplication) {
app
.
Free
()
}
else
{
//externalMessagePump 和 multiThreadedMessageLoop 为 false 时, 启用 VF (ViewsFrameworkBrowserWindow) 窗口组件
emp
:=
app
.
ExternalMessagePump
()
mtml
:=
app
.
MultiThreadedMessageLoop
()
consts
.
IsMessageLoop
=
!
emp
&&
!
mtml
if
consts
.
IsMessageLoop
{
if
app
.
IsMessageLoop
()
{
// 启用VF窗口组件
BrowserWindow
.
appContextInitialized
(
app
)
}
// 启动主进程
success
:=
app
.
StartMainProcess
()
if
success
{
if
!
consts
.
IsMessageLoop
{
//LCL -> Linux 必须在主进程启动之后初始化组件
lclwidget
.
CustomWidgetSetInitialization
()
}
//
if !consts.IsMessageLoop {
//LCL -> Linux 必须在主进程启动之后初始化组件
lclwidget
.
CustomWidgetSetInitialization
()
//
}
// 主进程启动成功之后回调
if
browserProcessStartAfterCallback
!=
nil
{
browserProcessStartAfterCallback
(
success
)
}
appMainRunCallback
()
if
consts
.
IsMessageLoop
{
if
app
.
IsMessageLoop
()
{
lcl
.
Application
.
Initialize
()
// VF窗口
消息轮询
// VF窗口
app
.
RunMessageLoop
()
}
else
{
// 创建LCL窗口组件
if
BrowserWindow
.
mainBrowserWindow
==
nil
{
BrowserWindow
.
mainBrowserWindow
=
new
(
lclBrowserWindow
)
}
//
运行主
窗口
//
LCL
窗口
lcl
.
RunApp
(
&
BrowserWindow
.
mainBrowserWindow
)
lclwidget
.
CustomWidgetSetFinalization
()
}
...
...
cef/chromium-callback.go
浏览文件 @
924f4e0c
...
...
@@ -62,7 +62,7 @@ func chromiumOnBeforeBrowser(browser *ICefBrowser, frame *ICefFrame) {
}
BrowserWindow
.
putWindowInfo
(
browser
.
BrowserId
(),
bw
)
}
if
!
consts
.
IsMessageLoop
{
if
!
application
.
IsMessageLoop
()
{
QueueAsyncCall
(
func
(
id
int
)
{
// lcl
BrowserWindow
.
createNextLCLPopupWindow
()
...
...
cef/tray-sys-commponent.go
浏览文件 @
924f4e0c
...
...
@@ -14,7 +14,6 @@ package cef
import
(
"github.com/energye/energy/v2/common"
"github.com/energye/energy/v2/consts"
"github.com/energye/energy/v2/pkgs/notice"
"github.com/energye/energy/v2/pkgs/systray"
"github.com/energye/golcl/energy/emfs"
...
...
@@ -109,7 +108,7 @@ func (m *SysTray) Show() {
}
if
common
.
IsDarwin
()
{
// view framework
if
consts
.
IsMessageLoop
{
if
application
.
IsMessageLoop
()
{
runLoop
()
}
else
{
//LCL
...
...
consts/consts.go
浏览文件 @
924f4e0c
...
...
@@ -21,10 +21,9 @@ import (
)
var
(
ExePath
string
//执行文件目录
HomeDir
,
_
=
homedir
.
Dir
()
//系统用户目录
Separator
=
string
(
filepath
.
Separator
)
//系统目录分隔符
IsMessageLoop
=
false
//CEF应用的窗口, true: 使用VF(views framework)窗口组件, false: 使用LCL窗口组件, 其实是窗口消息轮询使用方式.
ExePath
string
//执行文件目录
HomeDir
,
_
=
homedir
.
Dir
()
//系统用户目录
Separator
=
string
(
filepath
.
Separator
)
//系统目录分隔符
)
const
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录