• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 
16 #ifndef DISPLAY_INFO_H
17 #define DISPLAY_INFO_H
18 
19 #include <vector>
20 #include <string>
21 
22 namespace OHOS {
23 namespace MMI {
24 enum Direction {
25     // The display rotated 0 degrees clockwise
26     Direction0,
27 
28     // The display rotated 90 degrees clockwise
29     Direction90,
30 
31     // The display rotated 180 degrees clockwise
32     Direction180,
33 
34     // The display rotated 270 degrees clockwise
35     Direction270
36 };
37 
38 struct WindowInfo {
39     // The Bit0 of the flags field represents Touchable or not state
40     static constexpr uint32_t FLAG_BIT_UNTOUCHABLE = 1;
41 
42     // The globally unique identifier of the window
43     int32_t id;
44 
45     // The id of the process where the window is located
46     int32_t pid;
47 
48     // The uid of the process where the window is located
49     int32_t uid;
50 
51     // The x coordinate of the upper left corner of the hot zone window in the logical display
52     int32_t hotZoneTopLeftX;
53 
54     // The y coordinate of the upper left corner of the hot zone window in the logical display
55     int32_t hotZoneTopLeftY;
56 
57     // Logical width of the hot zone window
58     int32_t hotZoneWidth;
59 
60     // Logical height of the hot zone window
61     int32_t hotZoneHeight;
62 
63     // The logical display id to which the window belongs
64     int32_t displayId;
65 
66     // The input events sent to this window will be sent to the agentwindowid window for processing
67     int32_t agentWindowId;
68 
69     // The x coordinate of the upper left corner of the window in the logical display
70     int32_t winTopLeftX;
71 
72     // The y coordinate of the upper left corner of the window in the logical display
73     int32_t winTopLeftY;
74 
75     // The current state of the window
76     uint32_t flags;
77 };
78 
79 struct PhysicalDisplayInfo {
80     // The globally unique id of the physical display
81     int32_t id;
82 
83     // Globally unique id of the physical display on the left
84     int32_t leftDisplayId;
85 
86     // The globally unique id of the upper physical display
87     int32_t upDisplayId;
88 
89     // The x coordinate of the upper left corner of the display
90     int32_t topLeftX;
91 
92     // The y coordinate of the upper left corner of the display
93     int32_t topLeftY;
94 
95     // Display width
96     int32_t width;
97 
98     // Display height
99     int32_t height;
100 
101     // Display name, for debugging
102     std::string name;
103 
104     // Display seatId, The display associated with the touch screen must be configured with a non-empty seatid
105     std::string seatId;
106 
107     std::string seatName;
108 
109     // Display logic width
110     int32_t logicWidth;
111 
112     // Display logic width
113     int32_t logicHeight;
114 
115     // Display orientation
116     Direction direction;
117 };
118 
119 struct LogicalDisplayInfo {
120     // The globally unique id of the logic display
121     int32_t id;
122 
123     // The x coordinate of the upper left corner of the logical display
124     int32_t topLeftX;
125 
126     // The y coordinate of the upper left corner of the logical display
127     int32_t topLeftY;
128 
129     // Logical display width
130     int32_t width;
131 
132     // Logical display height
133     int32_t height;
134 
135     // Logical display name, for debugging
136     std::string name;
137 
138     // Logical display seatId, Displays that are not touch screen-independent use this attribute to associate with input
139     // devices Keep it empty unless you are sure of what you are doing
140     std::string seatId;
141 
142     std::string seatName;
143 
144     int32_t focusWindowId;
145 
146     // List of window information arranged in Z order, with the top window at the top
147     std::vector<WindowInfo> windowsInfo_;
148 };
149 } // namespace MMI
150 } // namespace OHOS
151 
152 #endif // DISPLAY_INFO_H