Skip to content

Commit 6773399

Browse files
authored
Merge pull request #6 from IoTSharp/copilot/rewrite-readme-and-changelog
docs: rewrite README (zh/en) and add CHANGELOG
2 parents bb39c6c + 1302fd5 commit 6773399

File tree

3 files changed

+228
-19
lines changed

3 files changed

+228
-19
lines changed

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Changelog
2+
3+
本文件记录 LVGLSharp.Forms 的所有重要变更,遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 规范,版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)
4+
5+
All notable changes to this project will be documented in this file.
6+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7+
and this project adheres to [Semantic Versioning](https://semver.org/).
8+
9+
---
10+
11+
## [未发布 / Unreleased]
12+
13+
### 新增 / Added
14+
- WinForms API 兼容层核心框架,基于 LVGL 渲染引擎。
15+
- 支持控件:`Button``Label``TextBox``CheckBox``RadioButton``ComboBox``ListBox``ProgressBar``TrackBar``NumericUpDown``PictureBox``Panel``GroupBox``FlowLayoutPanel``TableLayoutPanel``RichTextBox`
16+
- `LVGLSharp.Darwing` 命名空间:跨平台绘图类型 `Size``Point``Color` 等,不依赖 `System.Drawing`
17+
- NativeAOT 支持(win-x64、linux-arm、linux-arm64、linux-x64)。
18+
- 基于 ClangSharpPInvokeGenerator 自动生成的 LVGL 全量 P/Invoke 绑定(`LVGLSharp.Interop`)。
19+
- 平台原生库分发包 `LVGLSharp.Native`,支持 win-x64、win-x86、win-arm64、linux-x64、linux-arm、linux-arm64。
20+
- LVGL GCHandle 事件桥接机制:通过 `[UnmanagedCallersOnly]` 静态回调将 LVGL 事件路由至托管控件事件。
21+
- `Application.Run(Form)` 生命周期支持。
22+
- WinFormsDemo 演示项目。
23+
24+
### 变更 / Changed
25+
- 无。
26+
27+
### 修复 / Fixed
28+
- 无。
29+
30+
---
31+
32+
## [9.3.0] - 初始版本 / Initial Release
33+
34+
### 新增 / Added
35+
- 项目初始化,基于 [imxcstar/LVGLSharp](https://github.com/imxcstar/LVGLSharp) 构建底层 LVGL .NET 封装。
36+
- 引入 LVGL 9.3 作为 git submodule。
37+
- 基础 `Control``Form` 类实现,支持 `Controls` 层级管理及 LVGL 对象创建。
38+
- 初步验证 NativeAOT 发布流程(win-x64、linux-arm)。
39+
40+
---
41+
42+
## 致谢 / Acknowledgements
43+
44+
- **[imxcstar / LVGLSharp](https://github.com/imxcstar/LVGLSharp)**:提供了最底层的 LVGL .NET 封装支撑。
45+
- **[LVGL](https://github.com/lvgl/lvgl)**:轻量级、高性能的嵌入式 GUI 库。
46+
- **[ClangSharpPInvokeGenerator](https://github.com/dotnet/ClangSharp)**:用于自动生成 LVGL P/Invoke 绑定。
47+
- **[SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp)**:跨平台图像处理库。
48+
- **[SixLabors.Fonts](https://github.com/SixLabors/Fonts)**:跨平台字体解析库。

README.md

Lines changed: 90 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,100 @@
1-
# LVGLSharp.Forms
1+
# LVGLSharp.Forms
22

33
中文 | [English](./README_en.md)
44

5-
# 我们的目标是所见即所得,即设计器设计的结果在Linux下尽可能的跟Windows下保持一致。目前尚处于试验阶段,不能正常使用
5+
**LVGLSharp.Forms** 是一个跨平台的 WinForms API 兼容层,以 [LVGL](https://github.com/lvgl/lvgl) 作为底层渲染引擎。目标是实现**所见即所得**——在 Visual Studio Windows Forms 设计器中设计的界面,可以在 Linux(arm / arm64 / x64)等嵌入式平台上以高度一致的效果运行
66

7-
## 得益于 imxcstar 的项目[LVGLSharp](https://github.com/imxcstar/LVGLSharp) 提供了最底层的支撑
7+
> ⚠️ 项目目前处于试验阶段,尚不可用于生产环境
88
9-
## 得益于ClangSharpPInvokeGenerator,现在已支持LVGL所有API互操作
9+
---
1010

11-
### 以下是经过AOT的win-x64, linux-arm应用程序预览(没有依赖)
11+
## ✨ 特性
1212

13-
![1.png](./preview/1.png)
13+
- 🖥️ **WinForms API 兼容**:使用与 `System.Windows.Forms` 高度相似的 API,轻松迁移现有代码。
14+
- 🔤 **LVGL 全 API 互操作**:基于 ClangSharpPInvokeGenerator 自动生成的 P/Invoke 绑定,覆盖 LVGL 全部 C API。
15+
- 🚀 **NativeAOT 支持**:支持发布为无依赖的原生可执行文件(已验证 win-x64 / linux-arm)。
16+
- 🌍 **跨平台**:支持 Windows(x64)、Linux(x64 / arm / arm64)。
17+
- 🧩 **内置常用控件**:Button、Label、TextBox、CheckBox、RadioButton、ComboBox、ListBox、ProgressBar、TrackBar、NumericUpDown、PictureBox、Panel、GroupBox、FlowLayoutPanel、TableLayoutPanel、RichTextBox 等。
18+
- 🎨 **自定义绘图类型**:提供 `LVGLSharp.Darwing` 命名空间下的 `Size``Point``Color` 等类型,无需依赖 `System.Drawing`,天然跨平台。
1419

15-
![2.png](./preview/2.png)
20+
---
1621

17-
## 引用
22+
## 📷 预览
1823

19-
1. https://github.com/lvgl/lvgl
20-
2. https://github.com/imxcstar/LVGLSharp
24+
以下为经过 NativeAOT 发布的 win-x64 / linux-arm 应用程序预览(无任何额外依赖):
25+
26+
![预览图 1](./preview/1.png)
27+
28+
![预览图 2](./preview/2.png)
29+
30+
---
31+
32+
## 📦 NuGet 包
33+
34+
| 包名 | 说明 |
35+
|------|------|
36+
| `LVGLSharp.Forms` | WinForms API 兼容层(核心包) |
37+
| `LVGLSharp.Interop` | LVGL P/Invoke 绑定(自动生成) |
38+
| `LVGLSharp.Native` | 各平台 LVGL 原生库(win-x64、linux-arm 等) |
39+
40+
---
41+
42+
## 🚀 快速开始
43+
44+
### 1. 创建项目
45+
46+
使用 Visual Studio 创建 Windows Forms 应用程序(.NET),然后将 `System.Windows.Forms` 的引用替换为 `LVGLSharp.Forms`
47+
48+
### 2. 入口程序
49+
50+
```csharp
51+
using LVGLSharp.Forms;
52+
53+
Application.SetHighDpiMode(HighDpiMode.SystemAware);
54+
Application.EnableVisualStyles();
55+
Application.SetCompatibleTextRenderingDefault(false);
56+
Application.Run(new frmMain());
57+
```
58+
59+
### 3. 在 Linux 上运行
60+
61+
使用 NativeAOT 发布:
62+
63+
```bash
64+
dotnet publish -r linux-arm64 -c Release
65+
```
66+
67+
---
68+
69+
## 🏗️ 项目结构
70+
71+
```
72+
src/
73+
├── LVGLSharp.WinForms/ # WinForms API 兼容层(核心)
74+
│ ├── Forms/ # 控件实现(Control、Form、Button 等)
75+
│ ├── Darwing/ # 跨平台绘图类型(Size、Point、Color 等)
76+
│ └── Runtime/ # 平台运行时(Windows / Linux)
77+
├── LVGLSharp.Interop/ # LVGL P/Invoke 自动生成绑定
78+
├── LVGLSharp.Native/ # 各平台原生库
79+
├── LVGLSharp.Core/ # 公共核心库
80+
└── Demos/
81+
└── WinFormsDemo/ # 演示项目
82+
libs/
83+
└── lvgl/ # LVGL 源码(submodule)
84+
```
85+
86+
---
87+
88+
## 🙏 致谢
89+
90+
- **[imxcstar / LVGLSharp](https://github.com/imxcstar/LVGLSharp)**:提供了最底层的 LVGL .NET 封装支撑,本项目基于此构建。
91+
- **[LVGL](https://github.com/lvgl/lvgl)**:轻量级、高性能的嵌入式 GUI 库。
92+
- **[ClangSharpPInvokeGenerator](https://github.com/dotnet/ClangSharp)**:用于自动生成 LVGL 全量 P/Invoke 绑定。
93+
- **[SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp)**:跨平台图像处理库。
94+
- **[SixLabors.Fonts](https://github.com/SixLabors/Fonts)**:跨平台字体解析库。
95+
96+
---
97+
98+
## 📄 许可证
99+
100+
本项目基于 [MIT License](./LICENSE.txt) 开源。

README_en.md

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,100 @@
1-
# LVGLSharp.Forms
1+
# LVGLSharp.Forms
22

33
[中文](./README.md) | English
44

5-
## Our goal is to achieve "what you see is what you get" (WYSIWYG), ensuring that the results designed in the editor appear as closely as possible on Linux as they do on Windows. It is currently still in the experimental phase and not yet functional for regular use.
5+
**LVGLSharp.Forms** is a cross-platform WinForms API compatibility layer that uses [LVGL](https://github.com/lvgl/lvgl) as the underlying rendering engine. The goal is to achieve **WYSIWYG (What You See Is What You Get)** — UI designed with the Visual Studio Windows Forms Designer on Windows will render with high fidelity on Linux (arm / arm64 / x64) and other embedded platforms.
66

7-
## Thanks to the project [LVGLSharp](https://github.com/imxcstar/LVGLSharp) by imxcstar for providing the underlying support.
7+
> ⚠️ This project is currently in the experimental phase and is not yet suitable for production use.
88
9-
## Thanks to ClangSharpPInvokeGenerator, all API interoperability of LVGL is now supported.
9+
---
1010

11-
### The following is a preview of an win-x64, linux-arm application that has undergone AOT (without dependencies)
11+
## ✨ Features
1212

13-
![1.png](./preview/1.png)
13+
- 🖥️ **WinForms API Compatibility**: An API surface closely mirroring `System.Windows.Forms`, making it easy to migrate existing code.
14+
- 🔤 **Full LVGL API Interop**: Auto-generated P/Invoke bindings via ClangSharpPInvokeGenerator covering the entire LVGL C API.
15+
- 🚀 **NativeAOT Support**: Publish as self-contained native executables with no managed runtime dependency (validated on win-x64 and linux-arm).
16+
- 🌍 **Cross-Platform**: Supports Windows (x64) and Linux (x64 / arm / arm64).
17+
- 🧩 **Built-in Common Controls**: Button, Label, TextBox, CheckBox, RadioButton, ComboBox, ListBox, ProgressBar, TrackBar, NumericUpDown, PictureBox, Panel, GroupBox, FlowLayoutPanel, TableLayoutPanel, RichTextBox, and more.
18+
- 🎨 **Custom Drawing Types**: The `LVGLSharp.Darwing` namespace provides `Size`, `Point`, `Color`, and other types without any dependency on `System.Drawing`, ensuring true cross-platform portability.
1419

15-
![2.png](./preview/2.png)
20+
---
1621

17-
## Reference
22+
## 📷 Preview
1823

19-
https://github.com/lvgl/lvgl
24+
The following screenshots show an application published with NativeAOT for win-x64 / linux-arm (no external dependencies required):
25+
26+
![Preview 1](./preview/1.png)
27+
28+
![Preview 2](./preview/2.png)
29+
30+
---
31+
32+
## 📦 NuGet Packages
33+
34+
| Package | Description |
35+
|---------|-------------|
36+
| `LVGLSharp.Forms` | WinForms API compatibility layer (core package) |
37+
| `LVGLSharp.Interop` | LVGL P/Invoke bindings (auto-generated) |
38+
| `LVGLSharp.Native` | Platform-native LVGL libraries (win-x64, linux-arm, etc.) |
39+
40+
---
41+
42+
## 🚀 Quick Start
43+
44+
### 1. Create a Project
45+
46+
Create a Windows Forms App (.NET) in Visual Studio, then replace the `System.Windows.Forms` reference with `LVGLSharp.Forms`.
47+
48+
### 2. Entry Point
49+
50+
```csharp
51+
using LVGLSharp.Forms;
52+
53+
Application.SetHighDpiMode(HighDpiMode.SystemAware);
54+
Application.EnableVisualStyles();
55+
Application.SetCompatibleTextRenderingDefault(false);
56+
Application.Run(new frmMain());
57+
```
58+
59+
### 3. Run on Linux
60+
61+
Publish using NativeAOT:
62+
63+
```bash
64+
dotnet publish -r linux-arm64 -c Release
65+
```
66+
67+
---
68+
69+
## 🏗️ Project Structure
70+
71+
```
72+
src/
73+
├── LVGLSharp.WinForms/ # WinForms API compatibility layer (core)
74+
│ ├── Forms/ # Control implementations (Control, Form, Button, etc.)
75+
│ ├── Darwing/ # Cross-platform drawing types (Size, Point, Color, etc.)
76+
│ └── Runtime/ # Platform runtime (Windows / Linux)
77+
├── LVGLSharp.Interop/ # LVGL P/Invoke auto-generated bindings
78+
├── LVGLSharp.Native/ # Platform-native libraries
79+
├── LVGLSharp.Core/ # Shared core library
80+
└── Demos/
81+
└── WinFormsDemo/ # Demo application
82+
libs/
83+
└── lvgl/ # LVGL source code (submodule)
84+
```
85+
86+
---
87+
88+
## 🙏 Acknowledgements
89+
90+
- **[imxcstar / LVGLSharp](https://github.com/imxcstar/LVGLSharp)**: Provides the foundational low-level LVGL .NET wrapper that this project is built upon.
91+
- **[LVGL](https://github.com/lvgl/lvgl)**: A lightweight, high-performance embedded GUI library.
92+
- **[ClangSharpPInvokeGenerator](https://github.com/dotnet/ClangSharp)**: Used to auto-generate the complete LVGL P/Invoke bindings.
93+
- **[SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp)**: Cross-platform image processing library.
94+
- **[SixLabors.Fonts](https://github.com/SixLabors/Fonts)**: Cross-platform font parsing library.
95+
96+
---
97+
98+
## 📄 License
99+
100+
This project is licensed under the [MIT License](./LICENSE.txt).

0 commit comments

Comments
 (0)