From 9293e488c6575116a54cb849a4e6dcb993f2be4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=BA=A2=E5=B2=A9?= Date: Sun, 8 Jan 2023 18:39:35 +0800 Subject: [PATCH] v2.2.14 Fixed Chinese input and gtk3 issues for linux packagin --- common/assetserve/server.go | 3 ++ .../combination-sundry-browser.go} | 2 +- .../libs/liblcl.dll的存放目录.md | 0 .../resources/demo-misc.html | 10 +---- .../resources/icon.ico | Bin .../resources/min-browser-refresh.html | 0 .../resources/min-browser-tray.html | 0 .../src/browser-process.go} | 0 .../src/render-process.go} | 0 example/dev-test/lcl-browser/lcl-browser.go | 41 ++++++++++++++++++ ...放目录-可内置到执行程序中.md | 3 ++ .../dev-test/lcl-browser/resources/icon.ico | Bin 0 -> 67646 bytes .../dev-test/lcl-browser/resources/index.html | 20 +++++++++ ...放目录-可内置到执行程序中.md | 18 ++++++++ 14 files changed, 87 insertions(+), 10 deletions(-) rename example/{mini-browser/MiniBrowser.go => dev-test/combination-sundry-browser/combination-sundry-browser.go} (94%) rename example/{mini-browser => dev-test/combination-sundry-browser}/libs/liblcl.dll的存放目录.md (100%) rename example/{mini-browser => dev-test/combination-sundry-browser}/resources/demo-misc.html (98%) rename example/{mini-browser => dev-test/combination-sundry-browser}/resources/icon.ico (100%) rename example/{mini-browser => dev-test/combination-sundry-browser}/resources/min-browser-refresh.html (100%) rename example/{mini-browser => dev-test/combination-sundry-browser}/resources/min-browser-tray.html (100%) rename example/{mini-browser/src/min-browser.go => dev-test/combination-sundry-browser/src/browser-process.go} (100%) rename example/{mini-browser/src/min-render.go => dev-test/combination-sundry-browser/src/render-process.go} (100%) create mode 100644 example/dev-test/lcl-browser/lcl-browser.go create mode 100644 example/dev-test/lcl-browser/libs/liblcl.dll存放目录-可内置到执行程序中.md create mode 100644 example/dev-test/lcl-browser/resources/icon.ico create mode 100644 example/dev-test/lcl-browser/resources/index.html create mode 100644 example/dev-test/lcl-browser/resources/资源存放目录-可内置到执行程序中.md diff --git a/common/assetserve/server.go b/common/assetserve/server.go index 84d6fd3a..da452b2d 100644 --- a/common/assetserve/server.go +++ b/common/assetserve/server.go @@ -143,6 +143,9 @@ func (m *assetsHttpServer) graceShutdown(server *http.Server) { } } +//启动内置Http Server +// +//需要使用goroutine启动 [go x.StartHttpServer()] func (m *assetsHttpServer) StartHttpServer() { if m.LocalAssets != "" { m.LocalAssets = strings.ReplaceAll(m.LocalAssets, "\\", "/") diff --git a/example/mini-browser/MiniBrowser.go b/example/dev-test/combination-sundry-browser/combination-sundry-browser.go similarity index 94% rename from example/mini-browser/MiniBrowser.go rename to example/dev-test/combination-sundry-browser/combination-sundry-browser.go index d46597e8..3966195e 100644 --- a/example/mini-browser/MiniBrowser.go +++ b/example/dev-test/combination-sundry-browser/combination-sundry-browser.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/energye/energy/cef" "github.com/energye/energy/common/assetserve" - "github.com/energye/energy/example/mini-browser/src" + "github.com/energye/energy/example/dev-test/combination-sundry-browser/src" "github.com/energye/energy/logger" ) diff --git a/example/mini-browser/libs/liblcl.dll的存放目录.md b/example/dev-test/combination-sundry-browser/libs/liblcl.dll的存放目录.md similarity index 100% rename from example/mini-browser/libs/liblcl.dll的存放目录.md rename to example/dev-test/combination-sundry-browser/libs/liblcl.dll的存放目录.md diff --git a/example/mini-browser/resources/demo-misc.html b/example/dev-test/combination-sundry-browser/resources/demo-misc.html similarity index 98% rename from example/mini-browser/resources/demo-misc.html rename to example/dev-test/combination-sundry-browser/resources/demo-misc.html index 16706f24..c6a9db58 100644 --- a/example/mini-browser/resources/demo-misc.html +++ b/example/dev-test/combination-sundry-browser/resources/demo-misc.html @@ -46,15 +46,7 @@
-

这是一个各种使用方式的集合示例

-

- 在Go和Web端技术中,基于IPC通信,你可以很方便的在Go和Web端交互数据和事件 -
不再需要繁琐的web service接口 -
在Go中还可以定义JS变量,提供给Web端JS使用 -
在Go中调用JavaScript函数 -
在JavaScript中调用Go函数 -
就像调用语言本身函数一样简单 -

+

开发时测试的各种使用方式的集合示例

Golang 绑定映射 Javascript 通用类型属性、函数,结构对象属性

通用类型: diff --git a/example/mini-browser/resources/icon.ico b/example/dev-test/combination-sundry-browser/resources/icon.ico similarity index 100% rename from example/mini-browser/resources/icon.ico rename to example/dev-test/combination-sundry-browser/resources/icon.ico diff --git a/example/mini-browser/resources/min-browser-refresh.html b/example/dev-test/combination-sundry-browser/resources/min-browser-refresh.html similarity index 100% rename from example/mini-browser/resources/min-browser-refresh.html rename to example/dev-test/combination-sundry-browser/resources/min-browser-refresh.html diff --git a/example/mini-browser/resources/min-browser-tray.html b/example/dev-test/combination-sundry-browser/resources/min-browser-tray.html similarity index 100% rename from example/mini-browser/resources/min-browser-tray.html rename to example/dev-test/combination-sundry-browser/resources/min-browser-tray.html diff --git a/example/mini-browser/src/min-browser.go b/example/dev-test/combination-sundry-browser/src/browser-process.go similarity index 100% rename from example/mini-browser/src/min-browser.go rename to example/dev-test/combination-sundry-browser/src/browser-process.go diff --git a/example/mini-browser/src/min-render.go b/example/dev-test/combination-sundry-browser/src/render-process.go similarity index 100% rename from example/mini-browser/src/min-render.go rename to example/dev-test/combination-sundry-browser/src/render-process.go diff --git a/example/dev-test/lcl-browser/lcl-browser.go b/example/dev-test/lcl-browser/lcl-browser.go new file mode 100644 index 00000000..49970c36 --- /dev/null +++ b/example/dev-test/lcl-browser/lcl-browser.go @@ -0,0 +1,41 @@ +package main + +import ( + "embed" + "fmt" + "github.com/energye/energy/cef" + "github.com/energye/energy/common/assetserve" + "github.com/energye/golcl/lcl" + "github.com/energye/golcl/lcl/types" +) + +//go:embed resources +var resources embed.FS + +func main() { + //全局初始化 每个应用都必须调用的 + cef.GlobalCEFInit(nil, &resources) + //创建应用 + cefApp := cef.NewApplication(nil) + //指定一个URL地址,或本地html文件目录 + cef.BrowserWindow.Config.Url = "http://localhost:22022/index.html" + cef.BrowserWindow.SetBrowserInit(func(event *cef.BrowserEvent, window cef.IBrowserWindow) { + event.SetOnWidgetCompMsg(func(sender lcl.IObject, message types.TMessage, aHandled bool) { + fmt.Println("SetOnWidgetCompMsg:", message) + }) + event.SetOnDraggableRegionsChanged(func(sender lcl.IObject, browser *cef.ICefBrowser, frame *cef.ICefFrame, regions *cef.TCefDraggableRegions) { + fmt.Println("RegionsCount:", regions.RegionsCount()) + }) + }) + cef.SetBrowserProcessStartAfterCallback(func(b bool) { + fmt.Println("主进程启动 创建一个内置http服务") + //通过内置http服务加载资源 + server := assetserve.NewAssetsHttpServer() + server.PORT = 22022 + server.AssetsFSName = "resources" //必须设置目录名 + server.Assets = &resources + go server.StartHttpServer() + }) + //运行应用 + cef.Run(cefApp) +} diff --git a/example/dev-test/lcl-browser/libs/liblcl.dll存放目录-可内置到执行程序中.md b/example/dev-test/lcl-browser/libs/liblcl.dll存放目录-可内置到执行程序中.md new file mode 100644 index 00000000..25ddfd7e --- /dev/null +++ b/example/dev-test/lcl-browser/libs/liblcl.dll存放目录-可内置到执行程序中.md @@ -0,0 +1,3 @@ +提取Energy压缩包动态链接库liblcl.dll到该目录下 + +libs目录下的文件会被编译到执行文件中 \ No newline at end of file diff --git a/example/dev-test/lcl-browser/resources/icon.ico b/example/dev-test/lcl-browser/resources/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..15488cda83df2add53a05fbd651249c8deb3ab29 GIT binary patch literal 67646 zcmeHQ2V7Oh(g#$mv5PG#R!~tuq;~;DdX*|&L@{=KmKeooj3OFK#IC4`8hh`(YcQ6m zNo+Bi3usm~-Sucqlx_t&k|Zsrp|9fhq`8L7)l(RS>9xKotaDH3WKc1)Mn6dDRuE zD!+UoP`!q6j$hKKg1GV7)XCERF_)gi(WrcDQEsKxmQB2_L0FD71T{w2* zh$U2Yj=BsEZOwWInvx2p0sR!Us{{% zM;n$02yxv~e_FZFmlnM5Mej~_q0z%^X<$_Mf_`4@f9=t&>754kYwj{KGMvTvMsw`M zu{3nyWaZ}j^YV+&WbO2dN~do29=~#anD;7OXxOa9q1E|6QQ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0qg`Hj7v2(R6IzQ1B0>2p`Cc zF^8uQN)qI;Po6v>tm%MjMCf8b=C*3pDvF5;DZ>iVM&LmM-kQFUkwoLL` z1LdDOb&3M|+wqyPlKR5f2k`F;e}U?05pAA0+5voDiahZ2F^#mwljSr6*awfV@BvZ=jLo3)oNEARCH{vZL52SB@?eAKjbx z+-wCOa9BSm{!W`T`e!c7ra}Up1lu6+6Rm8&3F`ys9}bKkz;Zl0rSyh#UEH5(?`HMq zNKoeFv5r)|x)Jn%D)PEt6S+di)q~>%ZtDW(fwK8NgQGb|`F8uVPUK_A=e5C|F2BWC z1)qPA<3kTHdVnA6dPTClAekK@lg6) zHjlAazX*ev&nLBQQ~!!T`+11xHih_i{=G}5MzHzvF2{;2>nUpDOS|;sJ%cT*L+~8B zRm%F16ui9bZy?Lg&FM>Kof~8A7N7*qe0(EejxfXJ1S|*!F61zwMj# z&(x|_9ef=0^MW{9xfPO)sH2a*Ie$$}%2Y*#7Og}1m{Ffp9&%nT)P8OyAG@xk) z2GvN^!1=TA1jJN>sf8c>RS5C=3Taj%D+(e;#5CuIU?`@)7Lr^-Q7B5+R7lIJeX{U- z+52gQY1!`!lYi%5losn#R9{*B{uJL&Ei6!F+P&~S1E(-(O1CTg{wMK!ZPP^!mi@l0 z=^}uAE!IazX<7Y>^3(J5pAI7Yj0FOak%NJOfM9LYGIA^Wy^K832N9-;on#iT)D|Nfgk3kTf4(}e?iS<_IxEDS{xgqRcu^l9RQq5=P;m=?z$QMg}} y{_CBh586>tC`|uU)LtSX2if#NBtWpJ_4tX + + + + cookie + + + + +

开发时测试的一个针对【-webkit-app-region: drag/no-drag】示例

+ + + \ No newline at end of file diff --git a/example/dev-test/lcl-browser/resources/资源存放目录-可内置到执行程序中.md b/example/dev-test/lcl-browser/resources/资源存放目录-可内置到执行程序中.md new file mode 100644 index 00000000..633572cc --- /dev/null +++ b/example/dev-test/lcl-browser/resources/资源存放目录-可内置到执行程序中.md @@ -0,0 +1,18 @@ +可将html css javascript image等静态资源放入该目录,编译后将内置到执行程序中 + +通过内置http server 读取该目录文件,展示到页面中 +```go +//内置http服务链接安全配置 +assetserve.AssetsServerHeaderKeyName = "energy" +assetserve.AssetsServerHeaderKeyValue = "energy" +//内置http服务链接安全配置 +cef.SetBrowserProcessStartAfterCallback(func(b bool) { + fmt.Println("主进程启动 创建一个内置http服务") + //通过内置http服务加载资源 + server := assetserve.NewAssetsHttpServer() + server.PORT = 22022 + server.AssetsFSName = "resources" //必须设置目录名 + server.Assets = &resources + go server.StartHttpServer() +}) +``` \ No newline at end of file