docs: update README.md

This commit is contained in:
Liu
2021-05-31 22:51:17 +08:00
parent 7174868615
commit b93282a3ef
2 changed files with 58 additions and 213 deletions
+16 -52
View File
@@ -28,14 +28,10 @@
- [Related projects](#related-projects)
- [Design references](#design-references)
- [Quick start](#quick-start)
- [Windows](#windows)
- [Create new LCUI project](#create-new-lcui-project)
- [Install LCUI for existing project](#install-lcui-for-existing-project)
- [Manual compilation and installation](#manual-compilation-and-installation)
- [Ubuntu](#ubuntu)
- [Roadmap](#roadmap)
- [Primary Roadmap](#primary-roadmap)
- [Secondary Roadmap](#secondary-roadmap)
- [Use LCUI CLI](#use-lcui-cli)
- [Manual compilation and installation](#manual-compilation-and-installation)
- [Windows](#windows)
- [Ubuntu](#ubuntu)
- [Contribution](#contribution)
- [Documentation](#documentation)
- [FAQ](#faq)
@@ -111,11 +107,9 @@ Want to know what LCUI can do? You can view the following projects:
## Quick start
### Windows
### Use LCUI CLI
#### Create new LCUI project
Quickly create an LCUI project using [lcui-cli](https://github.com/lc-ui/lcui-cli):
LCUI CLI is a command line tool, you need to install [Node.js](https://nodejs.org/) before using it, and then run the following command to quickly experience it:
```bash
# Install lcui-cli and lcpkg
@@ -127,30 +121,19 @@ lcui create myapp
# Go into project directory
cd myapp
# Install dependencies
lcpkg install
# set up the development environment for this project
lcui setup
# Run it
lcpkg run start
# Build project
lcui build
# run project
lcui run
```
#### Install LCUI for existing project
### Manual compilation and installation
Use [lcpkg](https://github.com/lc-soft/lcpkg) to quick install LCUI in your project directory:
```bash
# Initialize the lcpkg configuration file to tell lcpkg about your project
lcpkg init
# Download and install the compiled LCUI library from GitHub
lcpkg install github.com/lc-soft/LCUI
```
After successful installation, follow the help documentation output by lcpkg to configure your project's build configuration.
#### Manual compilation and installation
If you want to manually compile LCUI from source code:
#### Windows
1. Open CMD window, and run following command in the LCUI source directory to install the dependency libraries:
```bash
@@ -164,7 +147,7 @@ If you want to manually compile LCUI from source code:
1. Rename `config.win32.h.in` in the include directory to `config.h`.
1. Open the `build/windows/LCUI.sln` file with [Visual Studio](https://visualstudio.microsoft.com/), and then build LCUI.
### Ubuntu
#### Ubuntu
```bash
# Install the dependencies
@@ -197,25 +180,6 @@ cd test
> **Note:** If you want to customize the compiler, compile flags, install location, and other configuration items, read the [INSTALL](INSTALL) file.
## Roadmap
The roadmap for this project is divided into primary and secondary roadmaps, with the primary roadmap developed by the project maintainer and the secondary roadmap developed by the open source community contributors and developers like you.
### Primary Roadmap
- Make project code more standardized, readable, and maintainable
- Improve relevant development tools and sample applications to improve the development efficiency and make it easier to use
### Secondary Roadmap
- Explore new GUI development methods to make LCUI unique
- [Accessbility](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/What_is_accessibility) support
- Research [SDL](https://github.com/SDL-mirror/SDL), [imgui](https://github.com/ocornut/imgui) and other similar open source projects, and try to fill in what LCUI is missing
- Refactor the existing graphics processing interface to make it easy to integrate with mainstream 2D graphics libraries and bring better graphics rendering performance to LCUI
- Add driver support for Mac OS, Android and iOS
- Add more mouse cursor styles
- Add clipboard support
## Contribution
Think LCUI is slow to update? there are many ways to [contribute](.github/CONTRIBUTING.md) to LCUI.
+42 -161
View File
@@ -28,11 +28,10 @@
- [相关项目](#%E7%9B%B8%E5%85%B3%E9%A1%B9%E7%9B%AE)
- [设计参考](#%E8%AE%BE%E8%AE%A1%E5%8F%82%E8%80%83)
- [快速上手](#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B)
- [Windows](#windows)
- [创建新的 LCUI 应用项目](#%E5%88%9B%E5%BB%BA%E6%96%B0%E7%9A%84-lcui-%E5%BA%94%E7%94%A8%E9%A1%B9%E7%9B%AE)
- [为已有的项目安装 LCUI](#%E4%B8%BA%E5%B7%B2%E6%9C%89%E7%9A%84%E9%A1%B9%E7%9B%AE%E5%AE%89%E8%A3%85-lcui)
- [手动编译安装](#%E6%89%8B%E5%8A%A8%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85)
- [Ubuntu](#ubuntu)
- [使用 LCUI CLI](#%E4%BD%BF%E7%94%A8-lcui-cli)
- [手动编译安装](#%E6%89%8B%E5%8A%A8%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85)
- [Windows](#windows)
- [Ubuntu](#ubuntu)
- [文档](#%E6%96%87%E6%A1%A3)
- [路线图](#%E8%B7%AF%E7%BA%BF%E5%9B%BE)
- [贡献](#%E8%B4%A1%E7%8C%AE)
@@ -108,11 +107,9 @@ LCUI 是一个用 C 语言编写的桌面端图形界面开发库。
## 快速上手
### Windows
### 使用 LCUI CLI
#### 创建新的 LCUI 应用项目
使用 [lcui-cli](https://github.com/lc-ui/lcui-cli) 快速创建一个 LCUI 应用项目:
LCUI CLI 是一个命令行工具,在使用它之前需要安装 [Node.js](https://nodejs.org/) ,之后再运行以下命令即可快速体验:
```bash
# 安装 lcui-cli 和 lcpkg
@@ -124,30 +121,22 @@ lcui create myapp
# 进入项目目录
cd myapp
# 安装依赖库
lcpkg install
# 设置开发环境
lcui setup
# 启动这个项目
lcpkg run start
# 构建项目
lcui build
# 运行项目
lcui run
```
#### 为已有的项目安装 LCUI
### 手动编译安装
在你的项目目录里使用 [lcpkg](https://github.com/lc-soft/lcpkg) 来快速安装 LCUI:
```bash
# 初始化 lcpkg 配置文件,告诉 lcpkg 你的项目相关信息
lcpkg init
# 从 GitHub 下载安装已编译好的 LCUI 库
lcpkg install github.com/lc-soft/LCUI
```
#### 手动编译安装
如果你想手动从源码编译 LCUI:
#### Windows
1. 打开命令行窗口,在 LCUI 的源码目录中使用以下命令安装依赖库:
```bash
lcpkg install
# 如果你需要编译 x64 版本的话
@@ -156,10 +145,11 @@ lcpkg install github.com/lc-soft/LCUI
lcpkg install --platform uwp
lcpkg install --arch x64 --platform uwp
```
1. 重命名 include 目录中的 `config.win32.h.in` 文件为 `config.h`。
1. 使用 [Visual Studio](https://visualstudio.microsoft.com/) 打开 `build/windows/LCUI.sln` 文件,然后编译生成 LCUI。
### Ubuntu
#### Ubuntu
```bash
# 安装依赖库
@@ -197,29 +187,14 @@ cd test
- 在线教程:[https://docs.lcui.lc-soft.io](https://docs.lcui.lc-soft.io)
- 更新日志:[CHANGELOG.zh-cn.md](CHANGELOG.zh-cn.md)
教程只有一部分,并且已经很久没有更新了,你可以参考头文件、源代码、示例程序以及上述的相关项目来了解基本用法。如果你希望我们能够为此项目提供完善的文档,可以考虑花时间帮助我们制定文档目录、章节和内容范围,相当于撰写一个文档模板,这样我们就不用花费时间在参考各种技术文档、思考初学者需要知道些什么、以及组织内容结构等工作上面,只需根据已定好的章节标题补全剩余内容即可。
## 路线图
此项目的开发计划分为主线和支线,主线中的开发任务主要由项目维护者负责推进,优先级较高,按照时间范围分为以下三类:
此项目的开发计划分为主线和支线,主线中的开发任务主要由项目维护者负责推进,优先级较高,主要包括:
- 近期计划
- 添加安卓端适配
- 开发示例移动端应用
- 撰写移动端应用开发教程
- 中期计划
- 开发移动端组件库
- 未来计划
- 为移动端组件库添加 React 实现,使之能应用在 Web 前端项目
- 重新设计 Trad 语言并重写其编译器,使之能应付基础的 UI 开发需求
- 重新设计图形抽象接口,支持引入主流的图形库来丰富图形元素的渲染方式
- 优化 CSS 样式库的内存占用
- 优化字体缓存库的内存占用
- 支持编译为 WebAssembly 运行在浏览器上
- 为 CSS 解析器添加支持 `@media` 查询
- 完善文档和教程
- LCUI 3.0 开发 ([#239](https://github.com/lc-soft/LCUI/issues/239))
- 完善文档
其它的任务则归为支线,交给开源社区贡献者以及像你这样的开发者来推进。如需了解更多细节可查看 [issues](https://github.com/lc-soft/LCUI/issues) 和[项目](https://github.com/lc-soft/LCUI/projects/2)页面。
其它的任务则归为支线,交给开源社区贡献者以及像你这样的开发者来推进。如需了解更多细节可查看 [issues](https://github.com/lc-soft/LCUI/issues) 和[项目](https://github.com/lc-soft/LCUI/projects)页面。
## 贡献
@@ -283,121 +258,27 @@ cd test
- 有良好的 CSS 编码风格
- 了解前端工程化和相关开发工具
1. **和写网页一样吗?需要注意什么?**
不一样,主要有以下差异需要注意:
- 界面描述文件格式是 XML,与 HTML 有一点区别。
- 本质上是在写 C 代码,开发效率比 JavaScript 低很多。
- 没有 `<script>` 标签,你不能像 HTML 那样内嵌 JavaScript 或 C 代码。
- 部件 (Widget) 是基本的界面布局元素,不是文字,不支持图文混排,不存在 `inline` 显示类型。
- 滚动条是一个独立的部件,使用 `overflow: scroll;` 样式不会出现滚动条,你需要主动创建它并指定容器和滚动层。
- 所有文本由 TextView 部件渲染,它的显示类型为 `block` 而不是 `inline`。
- 部件不会溢出父级部件的边界框,效果类似于已应用样式:`overflow: hidden;`。
- 绝对定位的部件始终相对于其父级部件,而不是父级第一个非静态定位的部件。
- 没有像 [Chrome Devtools](https://developers.google.com/web/tools/chrome-devtools) 这样的工具来调试图形界面,你需要凭借自己的想象力和开发经验来验证 BUG 是来自你的代码还是 LCUI 内部的。
1. **CSS 支持度如何?**
以下是支持的 CSS 特性列表,已勾选的是表示已支持(至少支持基本功能),未列出的属性则默认不支持。
<details>
<summary>CSS 特性覆盖范围</summary>
- at rules
- [x] `@font-face`
- [ ] `@keyframes`
- [ ] `@media`
- keywords
- [ ] `!important`
- selectors
- [x] `*`
- [x] `type`
- [x] `#id`
- [x] `.class`
- [x] `:hover`
- [x] `:focus`
- [x] `:active`
- [x] `:first-child`
- [x] `:last-child`
- [ ] `[attr="value"]`
- [ ] `:not()`
- [ ] `:nth-child()`
- [ ] `parent > child`
- [ ] `a ~ b`
- [ ] `::after`
- [ ] `::before`
- [ ] ...
- units
- [x] px
- [x] dp
- [x] sp
- [x] pt
- [x] %
- [ ] rem
- [ ] vh
- [ ] vw
- properties
- [x] top, right, bottom, left
- [x] width, height
- [x] visibility
- [x] display
- [x] none
- [x] inline-block
- [x] block
- [x] flex
- [ ] inline-flex
- [ ] inline
- [ ] grid
- [ ] table
- [ ] table-cell
- [ ] table-row
- [ ] table-column
- [ ] ...
- [x] position
- [x] static
- [x] relative
- [x] absolute
- [ ] fixed
- [x] box-sizing
- [x] border-box
- [x] content-box
- [x] border
- [x] border-radius
- [x] background-color
- [x] background-image
- [x] background-position
- [x] background-cover
- [ ] background
- [x] pointer-events
- [x] font-face
- [x] font-family
- [x] font-size
- [x] font-style
- [x] flex
- [x] flex-shrink
- [x] flex-grow
- [x] flex-basis
- [x] flex-wrap
- [x] flex-direction
- [x] justify-content
- [x] flex-start
- [x] center
- [x] flex-end
- [x] align-items
- [x] flex-start
- [x] center
- [x] flex-end
- [x] stretch
- [ ] float
- [ ] transition
- [ ] transform
- [ ] ...
</details>
1. **我想要 ???? 功能,就像 ???? 里的那样。**
请先[新建 issue](https://github.com/lc-soft/LCUI/issues/new/choose),按照已有的模板补全内容。
请先[新建 issue](https://github.com/lc-soft/LCUI/issues/new/choose),按照已有的模板补全内容,我们建议你尽量将你的需求描述清楚,如果能提供开发思路、相关参考文档等内容那是最好的,例如:
```markdown
# 建议添加 xxx
(简介)xxx 是......
(特性)它能够......
(理由)对于 LCUI 它能解决 ...... 等问题
(实现思路)大致的实现方法是先这样......然后......再......最后......
(参考资料)具体可参考这些 ......
```
不推荐的写法:
```markdown
# 建议添加 xxx
如题,我觉得很有必要,请添加,谢谢。
```
1. **求添加 JavaScript/Python/Go/Rust/PHP/C#/Java 语言绑定**
@@ -405,4 +286,4 @@ cd test
## 许可
LCUI 采用的开源许可证是 [MIT](http://opensource.org/licenses/MIT)。
LCUI 采用的开源许可证是 [MIT](http://opensource.org/licenses/MIT)。