• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 OLD_DISPLAY_INFO_H
16 #define OLD_DISPLAY_INFO_H
17 #include "window_info.h"
18 namespace OHOS {
19 namespace MMI {
20 namespace OLD {
21 struct DisplayInfo {
22     /**
23      * Unique ID of the physical display
24      *
25      * @since 9
26      */
27     int32_t id;
28 
29     /**
30      * X coordinate of the upper left corner on the logical screen
31      *
32      * @since 9
33      */
34     int32_t x;
35 
36     /**
37      * Y coordinate of the upper left corner on the logical screen
38      *
39      * @since 9
40      */
41     int32_t y;
42 
43     /**
44      * Display width, which is the logical width of the original screen when the rotation angle is 0.
45      * The value remains unchanged even if the display screen is rotated.
46      *
47      * @since 9
48      */
49     int32_t width;
50 
51     /**
52      * Display height, which is the logical height of the original screen when the rotation angle is 0.
53      * The value remains unchanged even if the display screen is rotated.
54      *
55      * @since 9
56      */
57     int32_t height;
58 
59     /**
60      * Pixel density, which indicates the number of pixels in an inch
61      *
62      * @since 10
63      */
64     int32_t dpi;
65 
66     /**
67      * Name of the physical display, which is used for debugging
68      *
69      * @since 9
70      */
71     std::string name;
72 
73     /**
74      * Unique screen ID, which is used to associate the corresponding touchscreen. The default value is default0.
75      *
76      * @since 9
77      */
78     std::string uniq;
79 
80     /**
81      * Orientation of the physical display
82      *
83      * @since 9
84      */
85     OHOS::MMI::Direction direction;
86 
87     OHOS::MMI::Direction displayDirection;
88 
89     /**
90      * DisplayMode of the display
91      *
92      * @since 9
93      */
94     OHOS::MMI::DisplayMode displayMode { OHOS::MMI::DisplayMode::UNKNOWN };
95 
96     /**
97      * Number of transform in the screen which is used to calculate the display x and display y by logic x and logic y.
98      * The value must be POINTER_CHANGEAREA_COUNT.
99      *
100      * @since 12
101      */
102     std::vector<float> transform;
103 
104     /**
105      * Orientation of the physical display
106      *
107      * @since 12
108      */
109     int32_t offsetX = 0;
110     int32_t offsetY = 0;
111     float ppi;
112 
113     /**
114      * Scale percent of oneHand rect to display rect.
115      * If 'scalePercent < 100', it means one hand mode.
116      * If 'scalePercent == 100', it means not in one hand mode.
117      */
118     int32_t scalePercent = 100;
119     /**
120      * Expand height from bottom.
121      */
122     int32_t expandHeight = 0;
123     /**
124      * Use for off screen policy
125      *
126      * @since 12
127      */
128     bool isCurrentOffScreenRendering = false;
129     int32_t screenRealWidth = 0;
130     int32_t screenRealHeight = 0;
131     int32_t screenRealDPI = 0;
132     /**
133      * logical screen mode
134      *
135      * @since 12 20
136      */
137     OHOS::MMI::DisplaySourceMode displaySourceMode = OHOS::MMI::DisplaySourceMode::SCREEN_MAIN;
138     /**
139      * Coordinate of the upper left corner of the virtual screen in one-hand mode.
140      * If oneHandX is 0, the virtual screen is in the lower left corner.
141      * If oneHandX is greater than 0, the virtual screen is in the lower right corner.
142      */
143     int32_t oneHandX = 0;
144     int32_t oneHandY = 0;
145 
146     /**
147      * Width of the effective area of the screen. When the screen is rotated, the value changes accordingly.
148      *
149      * @since 12
150      */
151     int32_t validWidth = 0;
152 
153     /**
154      * Height of the effective area of the screen. When the screen is rotated, the value changes accordingly.
155      *
156      * @since 12
157      */
158     int32_t validHeight = 0;
159 
160     /**
161      * Rotation angle of the TP patch offset correction.
162      *
163      * @since 12
164      */
165     OHOS::MMI::Direction fixedDirection;
166 
167     /**
168      * The physical width of the screen, in millimeters.
169      *
170      * @since 12
171      */
172     int32_t physicalWidth { 0 };
173 
174     /**
175      * The physical height of the screen, in millimeters.
176      *
177      * @since 12
178      */
179     int32_t physicalHeight { 0 };
180 
181     /**
182      * The Pointer Active Width
183      *
184      * @since 18
185      */
186     int32_t pointerActiveWidth { 0 };
187 
188     /**
189      * The Pointer Active Height
190      *
191      * @since 18
192      */
193     int32_t pointerActiveHeight { 0 };
194 
195     /** Unique ID of the physical display
196      *
197      * @since 18
198      */
199     uint64_t rsId { 0 };
200 };
201 
202 struct DisplayGroupInfo {
203     /**
204      * index of group. default=-1
205      *
206      * @since 19
207      */
208     int32_t groupId { DEFAULT_GROUP_ID };
209     /**
210      * Logical screen group type
211      *
212      * @since 20
213      */
214     OHOS::MMI::GroupType type;
215     /**
216      * The main logical screen ID. The logical screen with this ID must be in the displaysInfo.
217      *
218      * @since 20
219      */
220     int32_t mainDisplayId;
221 
222     /**
223      * ID of the focus window
224      *
225      * @since 9
226      */
227     int32_t focusWindowId;
228 
229     int32_t currentUserId { -1 };
230 
231     /**
232      * List of window information of the logical display arranged in Z order, with the top window at the top
233      *
234      * @since 9
235      */
236     std::vector<OHOS::MMI::WindowInfo> windowsInfo;
237 
238     /**
239      * Physical screen information list
240      *
241      * @since 9
242      */
243     std::vector<DisplayInfo> displaysInfo;
244 };
245 } // namespace OLD
246 } // namespace MMI
247 } // namespace OHOS
248 #endif // DISPLAY_INFO_H