Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
abde5bf2
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,体验更适合开发者的 AI 搜索 >>
提交
abde5bf2
编写于
7月 26, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
A: add demo build-examples, build examples exe to dist
上级
cd35a0df
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
98 addition
and
33 deletion
+98
-33
.gitignore
.gitignore
+2
-0
example/app-icon-gen/windows/main.go
example/app-icon-gen/windows/main.go
+1
-1
example/build-examples/build-examples.go
example/build-examples/build-examples.go
+72
-0
example/build-examples/syso_other.go
example/build-examples/syso_other.go
+10
-0
example/build-examples/syso_windows.go
example/build-examples/syso_windows.go
+10
-0
example/cookie/cookie.go
example/cookie/cookie.go
+1
-1
example/proxy/proxy.go
example/proxy/proxy.go
+2
-1
example/window-state/README.md
example/window-state/README.md
+0
-6
example/window-state/lcl/lcl-window-state.go
example/window-state/lcl/lcl-window-state.go
+0
-19
example/window-state/vf/vf-window-state.go
example/window-state/vf/vf-window-state.go
+0
-5
未找到文件。
.gitignore
浏览文件 @
abde5bf2
...
...
@@ -123,3 +123,5 @@ rsrc
bytes.txt
*.icns
icons.iconset/
dist
example/app-icon-gen/windows/main.go
浏览文件 @
abde5bf2
...
...
@@ -46,7 +46,7 @@ func syso() error {
syso
:=
winRes
.
NewSYSO
()
// 设置命令行执行目录, 该目录是要生成图标的应用根目录
// 资源在 resources 目录中读取
syso
.
CMDDir
=
filepath
.
Join
(
wd
(),
"example"
,
"
lib-checkupdate
"
)
syso
.
CMDDir
=
filepath
.
Join
(
wd
(),
"example"
,
"
control
"
)
syso
.
IconName
=
"icon.ico"
return
syso
.
RC
()
}
example/build-examples/build-examples.go
0 → 100644
浏览文件 @
abde5bf2
package
main
import
(
"github.com/energye/golcl/tools/command"
"os"
"path/filepath"
"runtime"
)
func
main
()
{
const
(
isWindows
=
runtime
.
GOOS
==
"windows"
//support
isLinux
=
runtime
.
GOOS
==
"linux"
//support
isDarwin
=
runtime
.
GOOS
==
"darwin"
//support
)
wd
,
_
:=
os
.
Getwd
()
println
(
"current:"
,
wd
)
dist
:=
filepath
.
Join
(
wd
,
"example"
,
"dist"
)
if
!
isExist
(
dist
)
{
os
.
MkdirAll
(
dist
,
os
.
ModePerm
)
}
examples
:=
[]
string
{
"context-menu"
,
"control"
,
"cookie"
,
"cookie-manager"
,
"custom-drag-window"
,
"dev-tools"
,
"dom-visitor"
,
"download"
,
"drag-file"
,
"execute-dev-tools-method"
,
"execute-javascript"
,
"flash-for-cef-v87"
,
"frameless"
,
"i18n"
,
"internal-http-server"
,
"ipc-on-emit/go-composite-type"
,
"ipc-on-emit/go-to-js"
,
"ipc-on-emit/js-to-go"
,
"key-event"
,
"lib-checkupdate"
,
"load-html-url"
,
"msgbox"
,
"osr/linux"
,
"osr/windows"
,
"popup-sub-window"
,
"print-pdf"
,
"process-type"
,
"proxy"
,
"response-filter"
,
"scheme"
,
"screen"
,
"search-text"
,
"simple"
,
"sub-process/main-process"
,
"sub-process/sub-process"
,
"sys-dialog"
,
"sys-menu"
,
"tempdll"
,
"view-source"
,
"vue"
,
"webkit-register"
,
"zoom"
}
var
(
ext
string
ldflags
string
)
if
isWindows
{
examples
=
append
(
examples
,
"windows/custom-browser-create"
,
"windows/transparent"
)
examples
=
append
(
examples
,
"tray/lclceftray"
,
"tray/lcltray"
,
"tray/systray"
,
"tray/lclvftray"
)
ext
=
".exe"
ldflags
=
`-H windowsgui -s -w`
}
else
if
isLinux
||
isDarwin
{
examples
=
append
(
examples
,
"tray/lcltray"
,
"tray/systray"
)
ldflags
=
`-s -w`
}
cmd
:=
command
.
NewCMD
()
for
_
,
example
:=
range
examples
{
dir
:=
filepath
.
Join
(
wd
,
"example"
,
example
)
if
isExist
(
dir
)
{
cmd
.
Dir
=
dir
out
:=
filepath
.
Join
(
dist
,
example
+
ext
)
println
(
"build example"
,
example
,
"
\n\t
build-dir:"
,
dir
,
"
\n\t
out-dir:"
,
out
)
cmd
.
Command
(
"go"
,
"build"
,
"-ldflags"
,
ldflags
,
"-o"
,
out
,
`-tags=tempdll`
)
println
()
}
else
{
println
(
"not found:"
,
dir
)
}
}
cmd
.
Close
()
println
(
"build end."
)
}
func
isExist
(
path
string
)
bool
{
_
,
err
:=
os
.
Stat
(
path
)
if
err
!=
nil
{
if
os
.
IsExist
(
err
)
{
return
true
}
else
if
os
.
IsNotExist
(
err
)
{
return
false
}
return
false
}
return
true
}
example/build-examples/syso_other.go
0 → 100644
浏览文件 @
abde5bf2
//go:build !windows
package
main
const
(
syso
=
false
)
var
sysoBytesAMD64
[]
byte
var
sysoBytes386
[]
byte
example/build-examples/syso_windows.go
0 → 100644
浏览文件 @
abde5bf2
//go:build windows
package
main
const
(
syso
=
true
)
var
sysoBytesAMD64
[]
byte
var
sysoBytes386
[]
byte
example/cookie/cookie.go
浏览文件 @
abde5bf2
...
...
@@ -27,7 +27,7 @@ func main() {
//主窗口的配置
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/cookie.html"
if
common
.
IsLinux
()
&&
a
pp
.
IsUIGtk3
()
{
if
common
.
IsLinux
()
&&
cefA
pp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/proxy/proxy.go
浏览文件 @
abde5bf2
...
...
@@ -27,12 +27,13 @@ func main() {
loadEnergyUrl
consts
.
MenuId
loadBaiduUrl
consts
.
MenuId
)
event
.
SetOnBeforeContextMenu
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
frame
*
cef
.
ICefFrame
,
params
*
cef
.
ICefContextMenuParams
,
model
*
cef
.
ICefMenuModel
)
{
event
.
SetOnBeforeContextMenu
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
frame
*
cef
.
ICefFrame
,
params
*
cef
.
ICefContextMenuParams
,
model
*
cef
.
ICefMenuModel
)
bool
{
model
.
AddSeparator
()
loadEnergyUrl
=
model
.
CefMis
.
NextCommandId
()
model
.
AddCheckItem
(
loadEnergyUrl
,
"load-energy"
)
loadBaiduUrl
=
model
.
CefMis
.
NextCommandId
()
model
.
AddCheckItem
(
loadBaiduUrl
,
"load-baidu"
)
return
false
})
event
.
SetOnContextMenuCommand
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
frame
*
cef
.
ICefFrame
,
params
*
cef
.
ICefContextMenuParams
,
commandId
consts
.
MenuId
,
eventFlags
uint32
,
result
*
bool
)
{
if
commandId
==
loadEnergyUrl
{
...
...
example/window-state/README.md
已删除
100644 → 0
浏览文件 @
cd35a0df
### 窗口状态示例
### 窗口初始化时状态和动态控制窗口状态的示例
### 分别为 LCL 和 VF
example/window-state/lcl/lcl-window-state.go
已删除
100644 → 0
浏览文件 @
cd35a0df
package
main
import
(
"github.com/energye/energy/v2/cef"
"github.com/energye/golcl/lcl/types"
)
func
main
()
{
//全局初始化 每个应用都必须调用的
cef
.
GlobalInit
(
nil
,
nil
)
//创建应用
app
:=
cef
.
NewApplication
()
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"https://www.baidu.com"
cef
.
BrowserWindow
.
Config
.
WindowInitState
=
types
.
WsFullScreen
cef
.
BrowserWindow
.
Config
.
EnableHideCaption
=
true
//运行应用
cef
.
Run
(
app
)
}
example/window-state/vf/vf-window-state.go
已删除
100644 → 0
浏览文件 @
cd35a0df
package
main
func
main
()
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录