• Home
Name Date Size #Lines LOC

..--

ext/12-May-2024-187171

figures/12-May-2024-

frameworks/12-May-2024-39,47432,338

interfaces/12-May-2024-20,8156,991

test/12-May-2024-45,83534,909

tools/12-May-2024-5,4494,825

.clang-formatD12-May-20246.6 KiB161160

.gitignoreD12-May-202470 43

BUILD.gnD12-May-202410.8 KiB290277

LICENSED12-May-20249.9 KiB177150

OAT.xmlD12-May-20244.7 KiB7318

README.mdD12-May-20245.8 KiB12187

README_zh.mdD12-May-20245.2 KiB12187

bundle.jsonD12-May-20241.5 KiB6160

changelog.mdD12-May-20244.6 KiB9666

ui.gniD12-May-20247.4 KiB130126

README.md

1# UI<a name="EN-US_TOPIC_0000001123180295"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section161941989596)
5-   [Constraints](#section119744591305)
6-   [Compilation and Building](#section137768191623)
7-   [Description](#section1312121216216)
8    -   [Component Description](#section66002422015)
9    -   [Usage](#section129654513264)
10
11-   [Repositories Involved](#section1371113476307)
12
13## Introduction<a name="section11660541593"></a>
14
15The graphics UI module implements a system-level graphics engine.
16
17This module provides the UIKit APIs for application development. You can use the APIs to add animations, manage layouts, transform images, process events, and operates on rich UI components.
18
19The graphics UI directly calls the HAL API or uses the client provided by the Window Manager Service \(WMS\) to interact with the hardware to complete operations such as event response and image drawing.
20
21**Figure  1**  Graphics subsystem architecture<a name="fig1358754417214"></a>
22![](figures/graphics-subsystem-architecture.png "graphics-subsystem-architecture")
23
24## Directory Structure<a name="section161941989596"></a>
25
26```
27/foundation/arkui/ui_lite
28├── frameworks                  # Framework code
29│   ├── animator                # Animator module
30│   ├── common                  # Common module
31│   ├── components              # Components
32│   ├── core                    # UI main processes (such as rendering and task management)
33│   ├── default_resource
34│   ├── dfx                     # Maintenance and test
35│   ├── dock                    # Driver adaptation layer
36│   │   └── ohos                # OHOS platform adaptation
37│   ├── draw                    # Drawing logic
38│   ├── engines                 # Drawing engines
39│   ├── events                  # Events
40│   ├── font                    # Fonts
41│   ├── imgdecode               # Image management
42│   ├── layout                  # Page layout
43│   ├── themes                  # Theme management
44│   ├── window                  # Window management adaptation layer
45│   └── window_manager
46│       └── dfb
47├── interfaces                  # APIs
48│   ├── innerkits               # APIs between modules
49│   │   └── xxx                 # Sub-module APIs
50│   └── kits                    # External APIs
51│   │   └── xxx                 # Sub-module APIs
52├── test                        # Test code
53│   ├── framework
54│   │   ├── include             # Header files for the test framework
55│   │   └── src                 # Source code for the test framework
56│   ├── uitest                  # Display effect test (The executable program is in foundation/window/window_manager_lite/test:sample_ui.)
57│   │   └── test_xxx            # Specific UI effect test
58│   └── unittest                # Unit testing
59│       └── xxx                 # Unit testing for a specific UI component
60└── tools                       # Test and simulation tools (simulator projects and resource files)
61    └── qt                      # Qt project
62```
63
64## Constraints<a name="section119744591305"></a>
65
66Platform Constraints
67
68-   The Windows platform supports only Qt and OHOS IDE.
69-   For the support of other platforms, see the  **graphic**  tag in  **vendor/hisilicon/\[product\_name\]/config.json**. If the  **graphic**  tag does not exist, it indicates that the product does not have the graphics subsystem.
70
71## Compilation and Building<a name="section137768191623"></a>
72
73```
74# Generate the libui.so file in the out directory of the product folder through GN compilation.
75hb build -T //foundation/arkui/ui_lite:ui_lite -f  #build libui.so
76hb build -T //foundation/indow/window_manager_lite/test:sample_ui -f # build UI demo
77hb build -T //foundation/arkui/ui_lite/test/unittest:arkui_ui_lite_test -f # build TDD testcases
78
79# To compile the Qt library, see the Qt simulator project at arkui/ui_lite/tools/qt/simulator/simulator.pro.
80```
81
82## Description<a name="section1312121216216"></a>
83
84### Component Description<a name="section66002422015"></a>
85
86Components are classified into basic components and container components.
87
88-   Basic components: Implement only a single function, such as  **Text**,  **Button**,  **Image**, and  **List**.
89-   Container components: Hold and combine child components to implement complex functions.
90
91**Figure  2**  Graphics subsystem components<a name="fig1594213196218"></a>
92![](figures/graphics-subsystem-components.png "graphics-subsystem-components")
93
94### Usage<a name="section129654513264"></a>
95
96For details about how to use components and APIs of graphics, see the examples provided in  **foundation/arkui/ui_lite/test/uitest**.
97
98-   The Qt project can be debugged in the Windows environment. [User Guide](https://gitee.com/openharmony/arkui_ui_lite/wikis/%E5%BF%AB%E9%80%9F%E5%8A%A0%E5%85%A5/%E5%8A%A0%E5%85%A5%E6%8C%87%E5%BC%95)
99
100    Project file path:
101
102    ```
103    arkui/ui_lite/tools/qt/simulator/simulator.pro
104    ```
105
106-   For other debugging environments, you can run  **foundation/window/window_manager_lite/test:sample\_ui**.
107
108    After the building is successful, the executable program  **out/\[product\_name\]/dev\_tools/bin/sample\_ui**  is obtained. You can run the program in an environment to view the display effect of a specific component.
109
110
111## Repositories Involved<a name="section1371113476307"></a>
112
113[Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics.md)
114
115[graphic_wms](https://gitee.com/openharmony/graphic_wms/blob/master/README.md)
116
117[graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README.md)
118
119**graphic_ui**
120
121[graphic_utils](https://gitee.com/openharmony/graphic_utils/blob/master/README.md)

README_zh.md

1# 图形UI组件<a name="ZH-CN_TOPIC_0000001123180295"></a>
2
3-   [简介](#section11660541593)
4-   [目录](#section161941989596)
5-   [约束](#section119744591305)
6-   [编译构建](#section137768191623)
7-   [说明](#section1312121216216)
8    -   [组件说明](#section66002422015)
9    -   [使用说明](#section129654513264)
10
11-   [相关仓](#section1371113476307)
12
13## 简介<a name="section11660541593"></a>
14
15图形UI组件实现了一套系统级的图形引擎。
16
17该组件为应用开发提供UIKit接口,包括了动画、布局、图形转换、事件处理,以及丰富的UI组件。
18
19组件内部直接调用HAL接口,或者使用WMS\(Window Manager Service\)提供的客户端与硬件交互,以完成事件响应、图像绘制等操作。
20
21**图 1**  图形子系统架构图<a name="fig1358754417214"></a>
22![](figures/图形子系统架构图.png "图形子系统架构图")
23
24## 目录<a name="section161941989596"></a>
25
26```
27/foundation/arkui/ui_lite
28├── frameworks                  # 框架代码
29│   ├── animator                # 动画模块
30│   ├── common                  # 公共模块
31│   ├── components              # 组件
32│   ├── core                    # ui主流程(渲染、任务管理等)
33│   ├── default_resource
34│   ├── dfx                     # 维测功能
35│   ├── dock                    # 驱动适配层
36│   │   └── ohos                # ohos平台适配
37│   ├── draw                    # 绘制逻辑
38│   ├── engines                 # 绘制引擎
39│   ├── events                  # 事件
40│   ├── font                    # 字体
41│   ├── imgdecode               # 图片管理
42│   ├── layout                  # 页面布局
43│   ├── themes                  # 主题管理
44│   ├── window                  # 窗口管理适配层
45│   └── window_manager
46│       └── dfb
47├── interfaces                  # 接口
48│   ├── innerkits               # 模块间接口
49│   │   └── xxx                 # 子模块的接口
50│   └── kits                    # 对外接口
51│       └── xxx                 # 子模块的接口
52├── test                        # 测试代码
53│   ├── framework
54│   │   ├── include             # 测试框架头文件
55│   │   └── src                 # 测试框架源码
56│   ├── uitest                  # 显示效果测试(可执行程序在foundation/window/window_manager_lite/test:sample_ui)
57│   │   └── test_xxx            # 具体UI组件效果测试
58│   └── unittest                # 单元测试
59│       └── xxx                 # 具体UI组件单元测试
60└── tools                       # 测试和模拟器工具(模拟器工程、资源文件)
61    └── qt                      # QT工程
62```
63
64## 约束<a name="section119744591305"></a>
65
66平台约束
67
68-   Windows平台仅支持QT和OHOS IDE。
69-   其他平台支持情况参考vendor/hisilicon/\[product\_name\]/config.json中的graphic标签(不存在graphic标签即该产品不存在图形子系统)。
70
71## 编译构建<a name="section137768191623"></a>
72
73```
74# 通过gn编译,在out目录下对应产品的文件夹中生成图形库
75hb build -T //foundation/arkui/ui_lite:ui_lite -f  # 编译libui.so
76hb build -T //foundation/window/window_manager_lite/test:sample_ui -f # 编译UI用例
77hb build -T //foundation/arkui/ui_lite/test/unittest:arkui_ui_lite_test -f # 编译TDD用例
78
79# 编译qt库可直接参考qt模拟器工程:arkui/ui_lite/tools/qt/simulator/simulator.pro
80```
81
82## 说明<a name="section1312121216216"></a>
83
84### 组件说明<a name="section66002422015"></a>
85
86组件分为基础组件和容器组件
87
88-   基础组件:仅实现组件自身单一功能,比如按钮、文字、图片等;
89-   容器组件:可将其他组件作为自己的子组件,通过组合实现复杂功能。
90
91**图 2**  图形组件一览<a name="fig1594213196218"></a>
92![](figures/图形组件一览.png "图形组件一览")
93
94### 使用说明<a name="section129654513264"></a>
95
96foundation/arkui/ui_lite/test/uitest中提供了图形所有组件和功能接口的使用范例。
97
98-   Windows环境可运行QT工程调试,详见[加入指引](https://gitee.com/openharmony/arkui_ui_lite/wikis/%E5%BF%AB%E9%80%9F%E5%8A%A0%E5%85%A5/%E5%8A%A0%E5%85%A5%E6%8C%87%E5%BC%95)
99
100    工程文件路径:
101
102    ```
103    arkui/ui_lite/tools/qt/simulator/simulator.pro
104    ```
105
106-   其他调试环境可以编译运行foundation/window/window_manager_lite/test:sample\_ui
107
108    编译成功后得到可执行程序out/\[product\_name\]/dev\_tools/bin/sample\_ui,在实际环境上运行即可观察对应组件显示效果。
109
110
111## 相关仓<a name="section1371113476307"></a>
112
113[图形子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%9B%BE%E5%BD%A2%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
114
115[window_window_manager_lite](https://gitee.com/openharmony/window_window_manager_lite/blob/master/README.md)
116
117[graphic_surface_lite](https://gitee.com/openharmony/graphic_surface_lite/blob/master/README.md)
118
119**arkui_ui_lite**
120
121[graphic_graphic_utils_lite](https://gitee.com/openharmony/graphic_graphic_utils_lite/blob/master/README.md)