• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 
16 #ifndef INPUT_WINDOWS_MANAGER_H
17 #define INPUT_WINDOWS_MANAGER_H
18 
19 #include <vector>
20 
21 #include "nocopyable.h"
22 #include "pixel_map.h"
23 #include "window_manager_lite.h"
24 
25 #include "i_input_windows_manager.h"
26 #include "input_display_bind_helper.h"
27 #include "input_event_data_transformation.h"
28 #include "knuckle_drawing_manager.h"
29 #include "knuckle_dynamic_drawing_manager.h"
30 
31 namespace OHOS {
32 namespace MMI {
33 struct WindowInfoEX {
34     WindowInfo window;
35     bool flag { false };
36 };
37 
38 struct SwitchFocusKey {
39     int32_t keyCode { -1 };
40     int32_t pressedKey { -1 };
41 };
42 
43 class InputWindowsManager final : public IInputWindowsManager {
44 public:
45     InputWindowsManager();
46     ~InputWindowsManager();
47     DISALLOW_COPY_AND_MOVE(InputWindowsManager);
48 
49     void Init(UDSServer& udsServer);
50     void SetMouseFlag(bool state);
51     bool GetMouseFlag();
52     bool JudgeCaramaInFore();
53 #ifdef OHOS_BUILD_ENABLE_POINTER
54     void JudgMouseIsDownOrUp(bool dragState);
55 #endif // OHOS_BUILD_ENABLE_POINTER
56 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
57     int32_t GetClientFd(std::shared_ptr<PointerEvent> pointerEvent);
58     int32_t GetClientFd(std::shared_ptr<PointerEvent> pointerEvent, int32_t windowId);
59 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
60     bool HandleWindowInputType(const WindowInfo &window, std::shared_ptr<PointerEvent> pointerEvent);
61     void UpdateCaptureMode(const DisplayGroupInfo &displayGroupInfo);
62     void UpdateDisplayInfo(DisplayGroupInfo &displayGroupInfo);
63     void UpdateDisplayInfoExtIfNeed(DisplayGroupInfo &displayGroupInfo, bool needUpdateDisplayExt);
64     void UpdateWindowInfo(const WindowGroupInfo &windowGroupInfo);
65 #if defined(OHOS_BUILD_ENABLE_POINTER) && defined(OHOS_BUILD_ENABLE_POINTER_DRAWING)
66     void SetWindowPointerStyle(WindowArea area, int32_t pid, int32_t windowId);
67     void UpdateWindowPointerVisible(int32_t pid);
68 #endif // OHOS_BUILD_ENABLE_POINTER && OHOS_BUILD_ENABLE_POINTER_DRAWING
69     int32_t ClearWindowPointerStyle(int32_t pid, int32_t windowId);
70     void Dump(int32_t fd, const std::vector<std::string> &args);
71     int32_t GetWindowPid(int32_t windowId, const std::vector<WindowInfo> &windowsInfo) const;
72     int32_t GetWindowPid(int32_t windowId) const;
73     int32_t SetMouseCaptureMode(int32_t windowId, bool isCaptureMode);
74     bool GetMouseIsCaptureMode() const;
75     void DeviceStatusChanged(int32_t deviceId, const std::string &sysUid, const std::string devStatus);
76     int32_t GetDisplayBindInfo(DisplayBindInfos &infos);
77     int32_t SetDisplayBind(int32_t deviceId, int32_t displayId, std::string &msg);
78     int32_t AppendExtraData(const ExtraData& extraData);
79     bool IsWindowVisible(int32_t pid);
80     void ClearExtraData();
81     ExtraData GetExtraData() const;
82     const std::vector<WindowInfo>& GetWindowGroupInfoByDisplayId(int32_t displayId) const;
83     std::pair<double, double> TransformWindowXY(const WindowInfo &window, double logicX, double logicY) const;
84     bool CheckPidInSession(int32_t pid);
85     std::pair<double, double> TransformDisplayXY(const DisplayInfo &info, double logicX, double logicY) const;
86     int32_t GetCurrentUserId();
87     bool GetCancelEventFlag(std::shared_ptr<PointerEvent> pointerEvent);
88     void SetFoldState ();
89 #ifdef OHOS_BUILD_ENABLE_KEYBOARD
90     std::vector<std::pair<int32_t, TargetInfo>> GetPidAndUpdateTarget(std::shared_ptr<KeyEvent> keyEvent);
91     std::vector<std::pair<int32_t, TargetInfo>> UpdateTarget(std::shared_ptr<KeyEvent> keyEvent);
92     bool IsKeyPressed(int32_t pressedKey, std::vector<KeyEvent::KeyItem> &keyItems);
93     bool IsOnTheWhitelist(std::shared_ptr<KeyEvent> keyEvent);
94     void HandleKeyEventWindowId(std::shared_ptr<KeyEvent> keyEvent);
95 #endif // OHOS_BUILD_ENABLE_KEYBOARD
96     int32_t CheckWindowIdPermissionByPid(int32_t windowId, int32_t pid);
97 
98 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
99     MouseLocation GetMouseInfo();
100     CursorPosition GetCursorPos();
101     CursorPosition ResetCursorPos();
102     void SetGlobalDefaultPointerStyle();
103     void UpdateAndAdjustMouseLocation(int32_t& displayId, double& x, double& y, bool isRealData = true);
104 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
105 #ifdef OHOS_BUILD_ENABLE_POINTER
106     const DisplayGroupInfo& GetDisplayGroupInfo();
107     int32_t SetHoverScrollState(bool state);
108     bool GetHoverScrollState() const;
109 #endif // OHOS_BUILD_ENABLE_POINTER
110 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
111     int32_t SetPointerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle, bool isUiExtension = false);
112     int32_t GetPointerStyle(int32_t pid, int32_t windowId, PointerStyle &pointerStyle,
113         bool isUiExtension = false) const;
114     void SetUiExtensionInfo(bool isUiExtension, int32_t uiExtensionPid, int32_t uiExtensionWindoId);
115     void DispatchPointer(int32_t pointerAction, int32_t windowId = -1);
116     void SendPointerEvent(int32_t pointerAction);
117     bool IsMouseSimulate() const;
118 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
119 #ifdef OHOS_BUILD_ENABLE_POINTER
120     PointerStyle GetLastPointerStyle() const;
121 #ifdef OHOS_BUILD_ENABLE_POINTER_DRAWING
122     bool IsNeedRefreshLayer(int32_t windowId);
123 #endif // OHOS_BUILD_ENABLE_POINTER_DRAWING
124 #endif //OHOS_BUILD_ENABLE_POINTER
125 
126 #ifdef OHOS_BUILD_ENABLE_TOUCH
127     void AdjustDisplayCoordinate(const DisplayInfo& displayInfo, double& physicalX, double& physicalY) const;
128     bool TouchPointToDisplayPoint(int32_t deviceId, struct libinput_event_touch* touch,
129         EventTouch& touchInfo, int32_t& targetDisplayId);
130 #endif // OHOS_BUILD_ENABLE_TOUCH
131 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
132     void ReverseRotateScreen(const DisplayInfo& info, const double x, const double y, Coordinate2D& cursorPos) const;
133     void RotateScreen(const DisplayInfo& info, PhysicalCoordinate& coord) const;
134 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
135 #ifdef OHOS_BUILD_ENABLE_TOUCH
136     bool TransformTipPoint(struct libinput_event_tablet_tool* tip, PhysicalCoordinate& coord, int32_t& displayId) const;
137     bool CalculateTipPoint(struct libinput_event_tablet_tool* tip,
138         int32_t& targetDisplayId, PhysicalCoordinate& coord) const;
139     const DisplayInfo *GetDefaultDisplayInfo() const;
140     void ReverseXY(int32_t &x, int32_t &y);
141     void SendCancelEventWhenLock();
142 #endif // OHOS_BUILD_ENABLE_TOUCH
143 
144 #ifdef OHOS_BUILD_ENABLE_ANCO
145     void UpdateWindowInfoExt(const WindowGroupInfo &windowGroupInfo, const DisplayGroupInfo &displayGroupInfo);
146     void UpdateShellWindow(const WindowInfo &window);
147     void UpdateDisplayInfoExt(const DisplayGroupInfo &displayGroupInfo);
148     bool IsInAncoWindow(const WindowInfo &window, int32_t x, int32_t y) const;
149     bool IsAncoWindow(const WindowInfo &window) const;
150     bool IsAncoWindowFocus(const WindowInfo &window) const;
151     void SimulatePointerExt(std::shared_ptr<PointerEvent> pointerEvent);
152     void SimulateKeyExt(std::shared_ptr<KeyEvent> keyEvent);
153     void DumpAncoWindows(std::string& out) const;
154     void CleanShellWindowIds();
155     bool IsKnuckleOnAncoWindow(std::shared_ptr<PointerEvent> pointerEvent);
156 #endif // OHOS_BUILD_ENABLE_ANCO
157 
158 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
159     bool UpdateDisplayId(int32_t& displayId);
160     void DrawTouchGraphic(std::shared_ptr<PointerEvent> pointerEvent);
161     int32_t UpdateTargetPointer(std::shared_ptr<PointerEvent> pointerEvent);
162 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
163     const DisplayInfo* GetPhysicalDisplay(int32_t id) const;
164 
165 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
166     void UpdatePointerChangeAreas();
167 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
168     std::optional<WindowInfo> GetWindowAndDisplayInfo(int32_t windowId, int32_t displayId);
169     void GetTargetWindowIds(int32_t pointerItemId, int32_t sourceType, std::vector<int32_t> &windowIds);
170     void AddTargetWindowIds(int32_t pointerItemId, int32_t sourceType, int32_t windowId);
171     void ClearTargetWindowId(int32_t pointerId);
172     bool IsTransparentWin(std::unique_ptr<Media::PixelMap> &pixelMap, int32_t logicalX, int32_t logicalY);
173     int32_t SetCurrentUser(int32_t userId);
174     DisplayMode GetDisplayMode() const;
175     void SetWindowStateNotifyPid(int32_t pid);
176     int32_t GetWindowStateNotifyPid();
177     int32_t GetPidByWindowId(int32_t pid);
178 #ifdef OHOS_BUILD_ENABLE_ANCO
179     int32_t AncoAddChannel(sptr<IAncoChannel> channel);
180     int32_t AncoRemoveChannel(sptr<IAncoChannel> channel);
181 #endif // OHOS_BUILD_ENABLE_ANCO
182 
183     int32_t SetPixelMapData(int32_t infoId, void *pixelMap);
184     void CleanInvalidPiexMap();
185     void HandleWindowPositionChange();
186     void SendCancelEventWhenWindowChange(int32_t pointerId);
187 
188 private:
189     bool IgnoreTouchEvent(std::shared_ptr<PointerEvent> pointerEvent);
190     void ReissueCancelTouchEvent(std::shared_ptr<PointerEvent> pointerEvent);
191     int32_t GetDisplayId(std::shared_ptr<InputEvent> inputEvent) const;
192     void PrintWindowInfo(const std::vector<WindowInfo> &windowsInfo);
193     void PrintDisplayInfo();
194     void PrintWindowGroupInfo(const WindowGroupInfo &windowGroupInfo);
195     void CheckFocusWindowChange(const DisplayGroupInfo &displayGroupInfo);
196     void CheckZorderWindowChange(const std::vector<WindowInfo> &oldWindowsInfo,
197         const std::vector<WindowInfo> &newWindowsInfo);
198     void UpdateDisplayIdAndName();
199     void UpdatePointerAction(std::shared_ptr<PointerEvent> pointerEvent);
200     bool IsNeedDrawPointer(PointerEvent::PointerItem &pointerItem) const;
201     void UpdateDisplayInfoByIncrementalInfo(const WindowInfo &window, DisplayGroupInfo &displayGroupInfo);
202     void UpdateWindowsInfoPerDisplay(const DisplayGroupInfo &displayGroupInfo);
203     std::pair<int32_t, int32_t> TransformSampleWindowXY(int32_t logicX, int32_t logicY) const;
204     bool IsValidZorderWindow(const WindowInfo &window, const std::shared_ptr<PointerEvent>& pointerEvent);
205 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
206     void UpdateTopBottomArea(const Rect &windowArea, std::vector<int32_t> &pointerChangeAreas,
207         std::vector<Rect> &windowHotAreas);
208     void UpdateLeftRightArea(const Rect &windowArea, std::vector<int32_t> &pointerChangeAreas,
209         std::vector<Rect> &windowHotAreas);
210     void UpdateInnerAngleArea(const Rect &windowArea, std::vector<int32_t> &pointerChangeAreas,
211         std::vector<Rect> &windowHotAreas);
212     void CoordinateCorrection(int32_t width, int32_t height, int32_t &integerX, int32_t &integerY);
213     void GetWidthAndHeight(const DisplayInfo* displayInfo, int32_t &width, int32_t &height);
214 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
215     void SetPrivacyModeFlag(SecureFlag privacyMode, std::shared_ptr<InputEvent> event);
216 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
217     void FoldScreenRotation(std::shared_ptr<PointerEvent> pointerEvent);
218 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
219     void PrintChangedWindowByEvent(int32_t eventType, const WindowInfo &newWindowInfo);
220     void PrintChangedWindowBySync(const DisplayGroupInfo &newDisplayInfo);
221     bool IsMouseDrawing(int32_t currentAction);
222     bool ParseConfig();
223     bool ParseJson(const std::string &configFile);
224 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
225     void SendUIExtentionPointerEvent(int32_t logicalX, int32_t logicalY,
226         const WindowInfo& windowInfo, std::shared_ptr<PointerEvent> pointerEvent);
227     void DispatchUIExtentionPointerEvent(int32_t logicalX, int32_t logicalY,
228         std::shared_ptr<PointerEvent> pointerEvent);
229 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
230 #ifdef OHOS_BUILD_ENABLE_POINTER
231     void GetPointerStyleByArea(WindowArea area, int32_t pid, int32_t winId, PointerStyle& pointerStyle);
232     int32_t UpdateMouseTarget(std::shared_ptr<PointerEvent> pointerEvent);
233     void UpdatePointerEvent(int32_t logicalX, int32_t logicalY,
234         const std::shared_ptr<PointerEvent>& pointerEvent, const WindowInfo& touchWindow);
235     void NotifyPointerToWindow();
236     void OnSessionLost(SessionPtr session);
237     void InitPointerStyle();
238 #endif // OHOS_BUILD_ENABLE_POINTER
239 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
240     int32_t UpdatePoinerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle);
241     int32_t UpdateSceneBoardPointerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle,
242         bool isUiExtension = false);
243 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
244 #ifdef OHOS_BUILD_ENABLE_POINTER
245     int32_t UpdateTouchPadTarget(std::shared_ptr<PointerEvent> pointerEvent);
246 #endif // OHOS_BUILD_ENABLE_POINTER
247 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
248     std::optional<WindowInfo> SelectWindowInfo(int32_t logicalX, int32_t logicalY,
249         const std::shared_ptr<PointerEvent>& pointerEvent);
250     void CheckUIExtentionWindowPointerHotArea(int32_t logicalX, int32_t logicalY,
251         const std::vector<WindowInfo>& windowInfos, int32_t& windowId);
252     std::optional<WindowInfo> GetWindowInfo(int32_t logicalX, int32_t logicalY);
253     bool IsInsideDisplay(const DisplayInfo& displayInfo, int32_t physicalX, int32_t physicalY);
254     void FindPhysicalDisplay(const DisplayInfo& displayInfo, int32_t& physicalX,
255         int32_t& physicalY, int32_t& displayId);
256 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
257 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
258     void InitMouseDownInfo();
259     bool SelectPointerChangeArea(const WindowInfo &windowInfo, PointerStyle &pointerStyle,
260         int32_t logicalX, int32_t logicalY);
261     void UpdatePointerChangeAreas(const DisplayGroupInfo &displayGroupInfo);
262 #ifdef OHOS_BUILD_ENABLE_POINTER_DRAWING
263     void AdjustDisplayRotation();
264     void SetPointerEvent(int32_t pointerAction, std::shared_ptr<PointerEvent> pointerEvent);
265     void DispatchPointerCancel(int32_t displayId);
266 #endif // OHOS_BUILD_ENABLE_POINTER_DRAWING
267 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
268 
269 #if defined(OHOS_BUILD_ENABLE_POINTER) && defined(OHOS_BUILD_ENABLE_POINTER_DRAWING)
270 void PointerDrawingManagerOnDisplayInfo(const DisplayGroupInfo &displayGroupInfo);
271 bool NeedUpdatePointDrawFlag(const std::vector<WindowInfo> &windows);
272 #endif // OHOS_BUILD_ENABLE_POINTER && OHOS_BUILD_ENABLE_POINTER_DRAWING
273 
274 #ifdef OHOS_BUILD_ENABLE_TOUCH
275     bool SkipAnnotationWindow(uint32_t flag, int32_t toolType);
276     bool SkipNavigationWindow(WindowInputType windowType, int32_t toolType);
277     int32_t UpdateTouchScreenTarget(std::shared_ptr<PointerEvent> pointerEvent);
278     bool IsValidNavigationWindow(const WindowInfo& touchWindow, double physicalX, double physicalY);
279     bool IsNavigationWindowInjectEvent(std::shared_ptr<PointerEvent> pointerEvent);
280     void UpdateTransformDisplayXY(std::shared_ptr<PointerEvent> pointerEvent, std::vector<WindowInfo>& windowsInfo,
281         const DisplayInfo& displayInfo);
282     void PullEnterLeaveEvent(int32_t logicalX, int32_t logicalY,
283         const std::shared_ptr<PointerEvent> pointerEvent, const WindowInfo* touchWindow);
284     void DispatchTouch(int32_t pointerAction);
285     const DisplayInfo* FindPhysicalDisplayInfo(const std::string& uniq) const;
286     void GetPhysicalDisplayCoord(struct libinput_event_touch* touch,
287         const DisplayInfo& info, EventTouch& touchInfo);
288     void SetAntiMisTake(bool state);
289     void SetAntiMisTakeStatus(bool state);
290     void CheckUIExtentionWindowDefaultHotArea(std::pair<int32_t, int32_t> logicalXY, bool isHotArea,
291         const std::shared_ptr<PointerEvent> pointerEvent, const std::vector<WindowInfo>& windowInfos,
292         const WindowInfo** touchWindow);
293     void GetUIExtentionWindowInfo(std::vector<WindowInfo> &uiExtentionWindowInfo, int32_t windowId,
294         WindowInfo **touchWindow, bool &isUiExtentionWindow);
295 #endif // OHOS_BUILD_ENABLE_TOUCH
296 
297 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
298     bool IsInHotArea(int32_t x, int32_t y, const std::vector<Rect> &rects, const WindowInfo &window) const;
299     bool InWhichHotArea(int32_t x, int32_t y, const std::vector<Rect> &rects, PointerStyle &pointerStyle) const;
300 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
301     template <class T>
302     void CreateAntiMisTakeObserver(T& item);
303 
304 #ifdef OHOS_BUILD_ENABLE_JOYSTICK
305     int32_t UpdateJoystickTarget(std::shared_ptr<PointerEvent> pointerEvent);
306 #endif // OHOS_BUILD_ENABLE_JOYSTICK
307 
308 #if defined(OHOS_BUILD_ENABLE_POINTER) && defined(OHOS_BUILD_ENABLE_CROWN)
309     int32_t UpdateCrownTarget(std::shared_ptr<PointerEvent> pointerEvent);
310 #endif // OHOS_BUILD_ENABLE_POINTER && OHOS_BUILD_ENABLE_CROWN
311 
312 #ifdef OHOS_BUILD_ENABLE_FINGERSENSE_WRAPPER
313     void UpdateDisplayMode();
314 #endif // OHOS_BUILD_ENABLE_FINGERSENSE_WRAPPER
315 
316 private:
317     UDSServer* udsServer_ { nullptr };
318 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
319     bool isUiExtension_ { false };
320     int32_t uiExtensionPid_ { -1 };
321     int32_t uiExtensionWindowId_ { -1 };
322     int32_t firstBtnDownWindowId_ { -1 };
323     int32_t lastLogicX_ { -1 };
324     int32_t lastLogicY_ { -1 };
325     WindowInfo lastWindowInfo_;
326     std::shared_ptr<PointerEvent> lastPointerEvent_ { nullptr };
327     std::map<int32_t, std::map<int32_t, PointerStyle>> pointerStyle_;
328     std::map<int32_t, std::map<int32_t, PointerStyle>> uiExtensionPointerStyle_;
329     WindowInfo mouseDownInfo_;
330     PointerStyle globalStyle_;
331 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
332 #ifdef OHOS_BUILD_ENABLE_TOUCH
333     int32_t lastTouchLogicX_ { -1 };
334     int32_t lastTouchLogicY_ { -1 };
335     WindowInfo lastTouchWindowInfo_;
336     std::shared_ptr<PointerEvent> lastTouchEvent_ { nullptr };
337     std::shared_ptr<PointerEvent> lastTouchEventOnBackGesture_ { nullptr };
338 #endif // OHOS_BUILD_ENABLE_TOUCH
339     DisplayGroupInfo displayGroupInfoTmp_;
340     DisplayGroupInfo displayGroupInfo_;
341     std::map<int32_t, WindowGroupInfo> windowsPerDisplay_;
342     PointerStyle lastPointerStyle_ {.id = -1};
343     PointerStyle dragPointerStyle_ {.id = -1};
344     MouseLocation mouseLocation_ = { -1, -1 };
345     CursorPosition cursorPos_ {};
346     std::map<int32_t, WindowInfoEX> touchItemDownInfos_;
347     std::map<int32_t, WindowInfoEX> shellTouchItemDownInfos_;
348     std::map<int32_t, WindowInfoEX> accessTouchItemDownInfos_;
349     std::map<int32_t, std::vector<Rect>> windowsHotAreas_;
350     InputDisplayBindHelper bindInfo_;
351     struct CaptureModeInfo {
352         int32_t windowId { -1 };
353         bool isCaptureMode { false };
354     } captureModeInfo_;
355     ExtraData extraData_;
356     bool haveSetObserver_ { false };
357     bool dragFlag_ { false };
358     bool isDragBorder_ { false };
359     bool pointerDrawFlag_ { false };
360     DisplayMode displayMode_ { DisplayMode::UNKNOWN };
361     struct AntiMisTake {
362         std::string switchName;
363         bool isOpen { false };
364     } antiMistake_;
365     bool isOpenAntiMisTakeObserver_ { false };
366     std::shared_ptr<KnuckleDrawingManager> knuckleDrawMgr_ { nullptr };
367     bool mouseFlag_ {false};
368     std::map<int32_t, std::vector<int32_t>> targetTouchWinIds_;
369     std::map<int32_t, std::vector<int32_t>> targetMouseWinIds_;
370     int32_t pointerActionFlag_ { -1 };
371     int32_t currentUserId_ { -1 };
372     std::shared_ptr<KnuckleDynamicDrawingManager> knuckleDynamicDrawingManager_ { nullptr };
373     std::shared_ptr<PointerEvent> lastPointerEventforWindowChange_ { nullptr };
374     bool cancelTouchStatus_ { false };
375     Direction lastDirection_ = static_cast<Direction>(-1);
376     std::map<int32_t, WindowInfo> lastMatchedWindow_;
377     std::vector<SwitchFocusKey> vecWhiteList_;
378     bool isParseConfig_ { false };
379     int32_t windowStateNotifyPid_ { -1 };
380     std::map<int32_t, std::unique_ptr<Media::PixelMap>> transparentWins_;
381     bool IsFoldable_ { false };
382 };
383 } // namespace MMI
384 } // namespace OHOS
385 #endif // INPUT_WINDOWS_MANAGER_H
386