• Home
Name Date Size #Lines LOC

..--

automock/07-Sep-2024-14,2216,570

cli/07-Sep-2024-2,6212,227

cmake/07-Sep-2024-4240

figures/07-Sep-2024-

gn/07-Sep-2024-3937

jsapp/07-Sep-2024-2,8942,381

mock/07-Sep-2024-3,8512,583

test/07-Sep-2024-6,5465,102

util/07-Sep-2024-5,3373,854

.gitattributesD07-Sep-202411 11

.gitignoreD07-Sep-2024198 1716

BUILD.gnD07-Sep-20244.8 KiB169154

JenkinsfileD07-Sep-20241.4 KiB4945

LICENSED07-Sep-202410.1 KiB177150

OAT.xmlD07-Sep-20244 KiB6613

README.mdD07-Sep-20242.5 KiB4426

README_zh.mdD07-Sep-20241.9 KiB4226

RichPreviewer.cppD07-Sep-20247 KiB216169

ThinPreviewer.cppD07-Sep-20247.5 KiB202153

app.rcD07-Sep-202438 21

app_define.jsonD07-Sep-2024139 11

build.shD07-Sep-20241.6 KiB5939

bundle.jsonD07-Sep-20242.2 KiB8281

config.cfgD07-Sep-2024114 52

README.md

1# Previewer
2
3## Introduction
4
5The Previewer is a component that empowers the DevEco Studio Previewer to leverage the ArkUI rendering engine for real-time rendering and preview. To be specific, with the Previewer component, the DevEco Studio Previewer can send commands through the named pipe to instruct the ArkUI rendering engine to implement real-time rendering and receive the resultant images for preview presentation. The Previewer component supports ArkTS and JS applications on Windows or macOS.
6
7**Figure 1** Previewer component architecture<a name="fig2606133765017"></a>
8
9![](figures/Previewer-Component-Architecture.PNG "Previewer Component Architecture")
10
11To start with, the DevEco Studio Previewer launches the Previewer component through the command line and passes to it startup parameters such as the ArkTS build product path and preview specifications. When starting up, the Previewer component launches the ArkUI rendering engine, which then renders pages based on the startup parameters and delivers preview images for the DevEco Studio Previewer. When page information changes, the DevEco Studio Previewer sends page refresh commands through the named pipe to the Previewer component. Based on the received commands, the Previewer component calls the ArkUI processing APIs to refresh and render the pages and deliver the images.
12## Directory Structure
13
14The source code of the Previewer component is stored in **/ide_previewer**. The following shows the directory structure.
15
16```
17/ide_previewer
18├── cli                       # Command processing
19├── gn                        # Build dependencies and toolchain configuration
20├── jsapp                     # Rendering engine invoking
21├── mock                      # Code of the interaction layer
22├── util                      # Utility
23```
24
25## Application Scenarios
26
27The Previewer component is built and released with the OpenHarmony SDK. You can use it to enable the DevEco Studio Previewer to leverage the ArkUI rendering engine for page rendering.
28
29## Building and Compilation
30
31For details, see the README in the [build](https://gitee.com/openharmony/build) repository.
32
33## Repositories Involved
34
35**ide_previewer**
36
37[arkui\_ace\_engine\_lite](https://gitee.com/openharmony/arkui_ace_engine_lite)
38
39[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine)
40
41## How to Contribute
42
43For details about how to contribute, see [Contribution Guide](https://gitee.com/openharmony/docs/blob/master/en/contribute/Readme-EN.md).
44

README_zh.md

1# 预览器组件<a name="ZH-CN_TOPIC_0000001076213355"></a>
2
3## 简介
4
5预览器组件为DevEco Studio预览器提供了启动ArkUI渲染引擎的能力,使预览器能够通过命名管道的通信方式发送命令给预览器组件,操控ArkUI渲染引擎做到实时渲染,并将处理好的图片发送到DevEco Studio预览器中展示。预览器组件支持在Windows、MacOS上运行ArkTS及JS应用。
6
7**图 1**  预览器组件架构<a name="fig2606133765017"></a>
8![](figures/预览器组件架构图.PNG "预览器组件架构")
9
10DevEco Studio预览器通过命令行启动预览器组件,传递ArkTS编译产物路径及预览规格等参数数据,预览器组件启动时拉起ArkUI渲染引擎,根据启动参数渲染页面并输出图片给DevEco Studio预览器前端。DevEco Studio预览器通过命名管道发送命令给预览器组件处理页面动态变更信息,预览器组件根据不同命令调用ArkUI处理接口刷新渲染页面输出图片。
11## 目录
12
13预览器组件源代码在/ide_previewer下,目录结构如下图所示:
14
15```
16/ide_previewer
17├── cli                       # 命令处理
18├── gn                        # 编译依赖及工具链配置
19├── jsapp                     # 渲染引擎调用
20├── mock                      # 交互层代码
21├── util                      # 工具类
22```
23
24## 使用场景
25
26预览器组件随OpenHarmony SDK一起编译和发布,为DevEco Studio预览器提供调用ArkUI渲染页面的能力。
27
28## 构建编译
29
30构建编译相关介绍请见[build](https://gitee.com/openharmony/build)仓的README文档。
31
32## 相关仓
33
34**ide_previewer**
35
36[arkui\_ace\_engine\_lite](https://gitee.com/openharmony/arkui_ace_engine_lite)
37
38[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine)
39
40## 贡献
41
42详情请参考[贡献指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/Readme-CN.md)