• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef ARKUI_NATIVE_NODE_RENDER_H
16 #define ARKUI_NATIVE_NODE_RENDER_H
17 
18 #include "native_render.h"
19 
20 #include <vector>
21 #include "core/interfaces/arkoala/arkoala_api.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 struct ArkUI_RenderNode {
28     ArkUIRenderNodeHandle renderNodeHandle = nullptr;
29 };
30 
31 struct ArkUI_RenderContentModifier {
32     ArkUIRenderModifierHandle RenderModifierHandle = nullptr;
33 };
34 
35 struct ArkUI_FloatProperty {
36     ArkUIPropertyHandle rsPropertyHandle = nullptr;
37 };
38 
39 struct ArkUI_Vector2Property {
40     ArkUIPropertyHandle rsPropertyHandle = nullptr;
41 };
42 
43 struct ArkUI_ColorProperty {
44     ArkUIPropertyHandle rsPropertyHandle = nullptr;
45 };
46 
47 struct ArkUI_FloatAnimatableProperty {
48     ArkUIPropertyHandle rsPropertyHandle = nullptr;
49 };
50 
51 struct ArkUI_Vector2AnimatableProperty {
52     ArkUIPropertyHandle rsPropertyHandle = nullptr;
53 };
54 
55 struct ArkUI_ColorAnimatableProperty {
56     ArkUIPropertyHandle rsPropertyHandle = nullptr;
57 };
58 
59 /**
60  * @brief Defines the rect shape.
61  *
62  * @since 20
63  */
64 struct ArkUI_RectShape {
65     float left;
66     float right;
67     float top;
68     float bottom;
69 };
70 
71 /**
72  * @brief Defines the node border style.
73  *
74  * @since 20
75  */
76 struct ArkUI_NodeBorderStyle {
77     ArkUI_BorderStyle leftStyle;
78     ArkUI_BorderStyle rightStyle;
79     ArkUI_BorderStyle topStyle;
80     ArkUI_BorderStyle bottomStyle;
81 };
82 
83 /**
84  * @brief Defines the node border width.
85  *
86  * @since 20
87  */
88 struct ArkUI_NodeBorderWidth {
89     float leftWidth;
90     float rightWidth;
91     float topWidth;
92     float bottomWidth;
93 };
94 
95 /**
96  * @brief Defines the node border color.
97  *
98  * @since 20
99  */
100 struct ArkUI_NodeBorderColor {
101     uint32_t leftColor;
102     uint32_t rightColor;
103     uint32_t topColor;
104     uint32_t bottomColor;
105 };
106 
107 /**
108  * @brief Defines the node border radius.
109  *
110  * @since 20
111  */
112 struct ArkUI_NodeBorderRadius {
113     float topLeftRadius;
114     float topRightRadius;
115     float bottomLeftRadius;
116     float bottomRightRadius;
117 };
118 
119 /**
120  * @brief Defines the circle shape.
121  *
122  * @since 20
123  */
124 struct ArkUI_CircleShape {
125     float centerX;
126     float centerY;
127     float radius;
128 };
129 
130 /**
131  * @brief Defines the round rect shape.
132  *
133  * @since 20
134  */
135 struct ArkUI_RoundRectShape {
136     float left;
137     float right;
138     float top;
139     float bottom;
140     float topLeftX;
141     float topLeftY;
142     float topRightX;
143     float topRightY;
144     float bottomLeftX;
145     float bottomLeftY;
146     float bottomRightX;
147     float bottomRightY;
148 };
149 
150 /**
151  * @brief Defines the command path.
152  *
153  * @since 20
154  */
155 struct ArkUI_CommandPath {
156     const char* commands;
157 };
158 
159 struct ArkUI_RenderNodeMaskOption {
160     uint32_t fillColor;
161     uint32_t strokeColor;
162     float strokeWidth;
163     ArkUIRectShape rect;
164     ArkUICircleShape circle;
165     ArkUIRoundRectShape roundRect;
166     ArkUIRectShape oval;
167     const char* commands;
168     int32_t type;
169 };
170 
171 struct ArkUI_RenderNodeClipOption {
172     ArkUIRectShape rect;
173     ArkUICircleShape circle;
174     ArkUIRoundRectShape roundRect;
175     ArkUIRectShape oval;
176     const char* commands;
177     int32_t type;
178 };
179 
180 #ifdef __cplusplus
181 };
182 #endif
183 #endif // ARKUI_NATIVE_NODE_RENDER_H