energy/README.md

204 lines
9.1 KiB
Markdown
Raw Normal View History

2023-02-17 17:37:58 +08:00
<p align="center">
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/energy-icon.png">
2023-02-17 17:37:58 +08:00
</p>
2023-07-05 17:33:59 +08:00
<p align="center" style="font-size: 24px;">
<strong>
Energy is a framework for Go to build desktop applications based on CEF
2023-07-05 17:33:59 +08:00
</strong>
</p>
2023-02-14 20:33:57 +08:00
[中文](README.zh_CN.md) |
2022-12-03 15:05:07 +08:00
English
2022-10-04 16:21:00 +08:00
2022-10-06 16:39:52 +08:00
---
2023-09-28 11:06:26 +08:00
![go-version](https://img.shields.io/github/go-mod/go-version/energye/energy?logo=git&logoColor=green)
2023-02-14 20:33:57 +08:00
[![github](https://img.shields.io/github/last-commit/energye/energy/main.svg?logo=github&logoColor=green&label=commit)](https://github.com/energye/energy)
2023-05-31 19:37:08 +08:00
[![release](https://img.shields.io/github/v/release/energye/energy?logo=git&logoColor=green)](https://github.com/energye/energy/releases)
2023-09-28 11:06:26 +08:00
![Build Status](https://github.com/energye/energy/actions/workflows/go.yml/badge.svg)
2023-02-14 20:33:57 +08:00
![repo](https://img.shields.io/github/repo-size/energye/energy.svg?logo=github&logoColor=green&label=repo-size)
2023-10-05 19:47:12 +08:00
[![Go Report](https://goreportcard.com/badge/github.com/energye/energy)](https://goreportcard.com/report/github.com/energye/energy/v2)
[![Go Reference](https://pkg.go.dev/badge/github.com/energye/energy)](https://pkg.go.dev/github.com/energye/energy/v2)
[![codecov](https://codecov.io/gh/energye/energy/graph/badge.svg?token=H370UFUF12)](https://codecov.io/gh/energye/energy)
[![contributors](https://img.shields.io/github/contributors/energye/energy)](https://github.com/energye/energy/graphs/contributors)
[![license](https://img.shields.io/github/license/energye/energy.svg?logo=git&logoColor=red)](http://www.apache.org/licenses/LICENSE-2.0)
2023-02-14 20:33:57 +08:00
---
2023-08-14 11:34:02 +08:00
### [Project Introduction](https://energy.yanghy.cn/course/100/6350f94ca749ba0318943f25)
2023-07-05 17:33:59 +08:00
Energy is a framework by Golang based on CEF(Chromium Embedded Framework), embedded
[CEF](https://bitbucket.org/chromiumembedded/cef) binary
- [energy](https://github.com/energye/energy) is a framework developed by Golang based on CEF (Chromium Embedded Framework), embedded with [CEF](https://bitbucket.org/chromiumembedded/cef) binary
- Use Go and Web technology (HTML+CSS+JavaScript) to build cross-platform desktop applications that support Windows, Linux and MacOS
2023-02-17 14:34:25 +08:00
### Characteristic
- Rich CEF API and LCL system native widgets
- Development environment is simple and the compilation speed is fast. Only need Go and Energy.
- Cross-Platform: You can package your code as Windows, domestic UOS, Deepin, Kylin, MacOS and Linux
- Responsibilities
- Go: Go is responsible for creating Windows, configuring CEF and implementing functions, creating various UI components, calling the low level of the system and some functions that JS cannot handle, such as: file flow, security encryption, high-performance processing, etc.
- Web: HTML + CSS + JavaScript is responsible for the function of the client interface, you can make any interface you want.
- Front-end technology: Support mainstream frameworks, such as Vue, React, Angular or pure HTML+CSS+JS.
- Event driven: High performance event driven communication based on IPC allowing intercommunication between Go and Web.
- Resource loading: You can either read local resources or resources built into execution files either with or without HTTP services.
2023-02-14 20:33:57 +08:00
### Built-in dependency&integration
2022-10-06 16:39:52 +08:00
2023-06-20 19:33:53 +08:00
- [![LCL](https://img.shields.io/badge/LCL-green)](https://github.com/energye/golcl)
- [![CEF-CEF4Delphi](https://img.shields.io/badge/CEF(Chromium%20Embedded%20Framework)%20CEF4Delphi-green)](https://github.com/salvadordf/CEF4Delphi)
2023-02-14 20:33:57 +08:00
### [Development Environment](https://energy.yanghy.cn/course/100/63511b14a749ba0318943f3a)
2023-07-05 17:33:59 +08:00
2023-02-14 20:33:57 +08:00
#### Basic needs
2023-07-05 17:33:59 +08:00
- Golang >= 1.18
- Energy (CEF, liblcl)
#### Environmental installation
Automatic installation development environment using the energy [command-line tool](https://energy.yanghy.cn/course/100/1694511322285207)
2022-10-18 15:15:29 +08:00
### Guide to Start - [Link](https://energy.yanghy.cn)
2023-02-14 20:33:57 +08:00
2023-08-14 11:34:02 +08:00
* [Course](https://energy.yanghy.cn/course/100/0)
* [Example](https://energy.yanghy.cn/example/200/0)
* [Document](https://energy.yanghy.cn/document/300/0)
2022-10-06 16:39:52 +08:00
### Quick Start
2023-07-05 17:33:59 +08:00
- Using [energy](https://energy.yanghy.cn/course/100/1694511322285207) command line tools to install the complete development environment automatically.
### Run a simple application by three steps
1. Install development environment: `energy install .`
2. Initiate an Application: `energy init .`
3. Run the Application: `go run main.go`
### sample code
2023-02-14 20:33:57 +08:00
main.go
2022-10-06 16:39:52 +08:00
```go
package main
import (
2023-05-31 18:00:34 +08:00
"github.com/energye/energy/v2/cef"
2022-10-06 16:39:52 +08:00
)
func main() {
//Global initialization
2023-02-02 19:37:16 +08:00
cef.GlobalInit(nil, nil)
//Create an application
app := cef.NewApplication()
//Specify a URL address or local HTML file directory
cef.BrowserWindow.Config.Url = "https://energy.yanghy.cn"
//Run Application
cef.Run(app)
2022-10-06 16:39:52 +08:00
}
```
2023-07-05 17:33:59 +08:00
### Build
1. Build`energy build .`
2. Package`energy package .`
3. Package Type
- windows: Using `nsis` create exe installation package
- linux: Using `dpkg` create deb installation package
- macos: Generate `xxx.app`
2023-07-05 17:33:59 +08:00
2023-02-14 20:33:57 +08:00
### System support
![Windows](https://img.shields.io/badge/windows-supported-success.svg?logo=Windows&logoColor=blue)
2023-06-29 12:33:44 +08:00
![MacOS](https://img.shields.io/badge/MacOS-supported-success.svg?logo=MacOS)
2023-02-14 20:33:57 +08:00
![Linux](https://img.shields.io/badge/Linux-supported-success.svg?logo=Linux&logoColor=red)
2024-02-27 10:21:40 +08:00
| | 32 Bit | 64 Bit | Test System Version |
|-------------|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|-------------------------|
| Windows | ![Windows](https://img.shields.io/badge/supported-success.svg?logo=Windows&logoColor=blue) | ![Windows](https://img.shields.io/badge/supported-success.svg?logo=Windows&logoColor=blue) | Windows XP SP3、 7、10、11 |
2023-11-03 10:58:33 +08:00
| MacOSX | ![MacOSX](https://img.shields.io/badge/N/A-inactive.svg?logo=MacOS) | ![MacOSX](https://img.shields.io/badge/supported-success.svg?logo=MacOS) | MacOSX 10.15 |
2023-11-15 19:54:42 +08:00
| MacOS M1 M2 | ![MacOS](https://img.shields.io/badge/N/A-inactive.svg?logo=MacOS) | ![MacOS](https://img.shields.io/badge/supported-success.svg?logo=MacOS) | MacOS M2 |
2023-08-31 14:05:20 +08:00
| Linux | ![Linux](https://img.shields.io/badge/SelfCompila-supported-success.svg?logo=Linux) | ![Linux](https://img.shields.io/badge/supported-success.svg?logo=Linux&logoColor=red) | Deepin20.8、Ubuntu18.04、LinuxMint21 |
2023-11-03 10:58:33 +08:00
| Linux ARM | ![Linux ARM](https://img.shields.io/badge/SelfCompila-supported-success.svg?logo=Linux) | ![Linux ARM](https://img.shields.io/badge/supported-success.svg?logo=Linux) | Kylin-V10-SP1-2107 |
2023-02-14 20:33:57 +08:00
2023-09-25 14:43:59 +08:00
### Related Projects
* [CEF](https://github.com/chromiumembedded/cef)
* [CEF4Delphi](https://github.com/salvadordf/CEF4Delphi)
* [CefSharp](https://github.com/cefsharp/CefSharp)
* [Java-CEF](https://bitbucket.org/chromiumembedded/java-cef)
* [cefpython](https://github.com/cztomczak/cefpython)
* [Chromium](https://chromium.googlesource.com/chromium/src/)
2023-02-14 20:33:57 +08:00
---
2023-11-15 19:53:22 +08:00
### Welcome to join
join energy throwing in the process of construction, there are many things that cannot be completed alone, if there are interested students who want to participate in the realization or learning of energy, you can contact me through WeChat or QQ.
2023-06-14 10:37:26 +08:00
If this project is helpful to you, please give me a star
2023-06-14 10:37:26 +08:00
---
2023-11-15 19:53:22 +08:00
### ENERGY QQ Group & WeChat
2023-02-14 20:33:57 +08:00
2023-11-15 19:53:22 +08:00
<p align="center">
<img src="https://assets.yanghy.cn/qq-group.jpg" width="250" title="QQ Group: 541258627" alt="QQ Group: 541258627">
<img src="https://assets.yanghy.cn/we-chat.jpg" width="250" title="WeChat: sniawmdf" alt="WeChat: sniawmdf" style="margin-left: 30px;">
</p>
---
### Thanks Jetbrains
2023-02-14 20:33:57 +08:00
2023-06-14 10:37:26 +08:00
<p align="center">
2023-11-15 19:53:22 +08:00
<a href="https://www.jetbrains.com?from=energy">
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="JetBrains Logo (Main) logo.">
</a>
2023-06-14 10:37:26 +08:00
</p>
2023-07-09 19:21:20 +08:00
2023-02-14 20:33:57 +08:00
---
### Project screenshot
2023-07-05 17:33:59 +08:00
2023-02-14 20:33:57 +08:00
##### Windows-10
2023-06-14 10:37:26 +08:00
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/frameless-windows-10.png">
2023-02-14 20:33:57 +08:00
2023-02-17 12:59:36 +08:00
##### Windows-7 32 & 64
2023-07-05 17:33:59 +08:00
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/frameless-windows-7-64.png">
<img src="https://assets.yanghy.cn/frameless-windows-7-32.png">
2023-02-14 20:33:57 +08:00
2024-02-27 10:21:40 +08:00
##### Windows-XP-SP3
<img src="https://assets.yanghy.cn/windows-xp-sp3.png">
2023-02-17 12:59:36 +08:00
##### Linux - Deepin
2023-07-05 17:33:59 +08:00
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/frameless-deepin-20.8.png">
<img src="https://assets.yanghy.cn/frameless-deepin-hide-20.8.png">
2023-02-14 20:33:57 +08:00
2023-02-17 12:59:36 +08:00
##### Linux - Kylin ARM
2023-07-05 17:33:59 +08:00
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/frameless-kylin-arm-V10-SP1.png">
<img src="https://assets.yanghy.cn/frameless-kylin-arm-hide-V10-SP1.png">
2023-02-17 12:59:36 +08:00
##### Linux - Ubuntu
2023-07-05 17:33:59 +08:00
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/frameless-ubuntu-18.04.6.png">
<img src="https://assets.yanghy.cn/frameless-ubuntu-hide-18.04.6.png">
2023-02-14 20:33:57 +08:00
##### MacOSX
2023-07-05 17:33:59 +08:00
2023-10-19 18:26:08 +08:00
<img src="https://assets.yanghy.cn/frameless-macos.png">
2023-02-14 20:33:57 +08:00
2022-10-18 17:21:02 +08:00
2022-10-18 18:16:16 +08:00
----
2023-02-14 20:33:57 +08:00
### Public License
[![license](https://img.shields.io/github/license/energye/energy.svg?logo=git&logoColor=green)](http://www.apache.org/licenses/LICENSE-2.0)
2023-08-22 17:28:45 +08:00
### Contributors
<a href="https://github.com/energye/energy/graphs/contributors">
<img src="https://opencollective.com/energy/contributors.svg?width=890&button=false" />
</a>