1# Graphics<a name="EN-US_TOPIC_0000001115588688"></a> 2 3The Graphics subsystem mainly consists of user interface \(UI\) components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for Internet of Things \(IoT\) devices with limited hardware resources or on the standard OS to develop OpenHarmony applications for standard- and large-system devices \(for example, tablet and lite smart devices\). 4 5## 1.1 Mini System<a name="section1346303311377"></a> 6 7### Introduction<a name="section1165992615384"></a> 8 9The Graphics subsystem mainly consists of user interface \(UI\) components, layout, animator, font, input event, window management, and rendering and drawing modules. It is an application framework that can be built on the LiteOS to develop OpenHarmony applications for Internet of Things \(IoT\) devices with limited hardware resources. 10 11**Figure 1** Graphics subsystem architecture<a name="fig16488143010409"></a> 12 13 14The related modules are described as follows: 15 16- View: provides application components, including UIView, UIViewGroup, UIButton, UILabel, UILabelButton, UIList, and UISlider. 17- Animator: defines functions for customizing animators. 18- Layout: lays out components, including Flexlayout, GridLayout, and ListLayout. 19- Transform: rotates, translates, or scales images. 20- Event: processes basic events, including click, press, drag, and long press events. 21- Rendering engine: performs rendering and drawing operations. 22- 2D graphics library: draws 2D graphical elements including lines, rectangles, circles, arcs, images, and texts. Functions of this module include software drawing and hardware acceleration capability interconnection. 23- Multi-language: processes the line feed and shaping of texts in different languages. 24- Image library: parses and operates images of different types and formats, such as PNG, JPEG, ARGB8888, and ARGB565. 25- WindowManager: manages windows, including creating, showing, hiding a window, and combining windows. 26- InputManager: processes input events. 27 28### Directory Structure<a name="section141331948134020"></a> 29 30``` 31/foundation/graphic 32├── surface # Shared memory 33├── ui # UI module, including UI components, animations, and fonts. 34├── utils # Basic graphics library and hardware adaptation layer 35└── wms # Window and input event management 36``` 37 38### Constraints<a name="section15729113104112"></a> 39 40- The Graphics subsystem does not support multi-thread concurrent operations. You are advised to perform related operations in UI threads. 41- The **utils/interfaces/innerkits/graphic\_config.h** file provides the configuration information about macro switches that can be used to enable or disable graphics features. You need to configure these switches before compilation. Note that some switches are configured depending on the platform. 42 43### Usage<a name="section812962919413"></a> 44 45For details, see the README and **test** directory of each repository. 46 47### Repositories Involved<a name="section12651205434115"></a> 48 49**Graphics subsystem** 50 51graphic\_surface 52 53graphic\_ui 54 55graphic\_wms 56 57graphic\_utils 58 59## 1.2 Standard System<a name="section1249610812538"></a> 60 61### Introduction<a name="section1374615251510"></a> 62 63The Graphics subsystem provides graphics APIs and window management capabilities, which can be invoked by using Java or JS APIs. It is applicable to all devices that run the standard system. 64 65The following figure shows the architecture of the Graphics subsystem. 66 67 68 69- Surface 70 71 Provides APIs for managing the graphics buffer and the efficient and convenient rotation buffer. 72 73- Vsync 74 75 Provides APIs for managing registration and response of all vertical sync signals. 76 77- WindowManager 78 79 Provides APIs for creating and managing windows. 80 81- WaylandProtocols 82 83 Provides the communication protocols between the window manager and synthesizer. 84 85- Compositor 86 87 Implements synthesis of layers. 88 89- Renderer 90 91 Functions as the back-end rendering module of the synthesizer. 92 93- Wayland protocols 94 95 Provides Wayland inter-process communication protocols. 96 97- Shell 98 99 Provides multi-window capabilities. 100 101- Input Manager 102 103 Functions as the multimodal input module that receives input events. 104 105 106### Directory Structure<a name="section16751364713"></a> 107 108``` 109foundation/graphic/standard/ 110├── frameworks # Framework code 111│ ├── bootanimation # BootAnimation code 112│ ├── surface # Surface code 113│ ├── vsync # Vsync code 114│ └── wm # WindowManager code 115├── interfaces # External APIs 116│ ├── innerkits # Native APIs 117│ └── kits # JS APIs and NAPIs 118└── utils # Utilities 119``` 120 121### Constraints<a name="section126494189715"></a> 122 123Language version: C++ 11 or later 124 125### Compilation and Building<a name="section883114292070"></a> 126 127The dependent APIs include the following: 128 129- graphic\_standard:libwms\_client 130- graphic\_standard:libsurface 131- graphic\_standard:libvsync\_client 132 133### Usage<a name="section1351214227564"></a> 134 135For details, see the README and **test** directory of each repository. 136 137### Repositories Involved<a name="section11578621131119"></a> 138 139**Graphics subsystem** 140 141graphic\_standard 142 143ace\_ace\_engine 144 145aafwk\_standard 146 147multimedia\_media\_standard 148 149multimedia\_camera\_standard 150 151