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     bool AdjustFingerFlag(std::shared_ptr<PointerEvent> pointerEvent);
60 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
61     bool HandleWindowInputType(const WindowInfo &window, std::shared_ptr<PointerEvent> pointerEvent);
62     void UpdateCaptureMode(const DisplayGroupInfo &displayGroupInfo);
63     void UpdateDisplayInfo(DisplayGroupInfo &displayGroupInfo);
64     void UpdateDisplayInfoExtIfNeed(DisplayGroupInfo &displayGroupInfo, bool needUpdateDisplayExt);
65     void UpdateWindowInfo(const WindowGroupInfo &windowGroupInfo);
66 #if defined(OHOS_BUILD_ENABLE_POINTER) && defined(OHOS_BUILD_ENABLE_POINTER_DRAWING)
67     void SetWindowPointerStyle(WindowArea area, int32_t pid, int32_t windowId);
68     void UpdateWindowPointerVisible(int32_t pid);
69 #endif // OHOS_BUILD_ENABLE_POINTER && OHOS_BUILD_ENABLE_POINTER_DRAWING
70     int32_t ClearWindowPointerStyle(int32_t pid, int32_t windowId);
71     void Dump(int32_t fd, const std::vector<std::string> &args);
72     int32_t GetWindowPid(int32_t windowId, const std::vector<WindowInfo> &windowsInfo) const;
73     int32_t GetWindowPid(int32_t windowId) const;
74     int32_t SetMouseCaptureMode(int32_t windowId, bool isCaptureMode);
75     bool GetMouseIsCaptureMode() const;
76     void DeviceStatusChanged(int32_t deviceId, const std::string &sysUid, const std::string devStatus);
77     int32_t GetDisplayBindInfo(DisplayBindInfos &infos);
78     int32_t SetDisplayBind(int32_t deviceId, int32_t displayId, std::string &msg);
79     int32_t AppendExtraData(const ExtraData& extraData);
80     bool IsWindowVisible(int32_t pid);
81     void ClearExtraData();
82     ExtraData GetExtraData() const;
83     const std::vector<WindowInfo>& GetWindowGroupInfoByDisplayId(int32_t displayId) const;
84     std::pair<double, double> TransformWindowXY(const WindowInfo &window, double logicX, double logicY) const;
85     bool CheckPidInSession(int32_t pid);
86     std::pair<double, double> TransformDisplayXY(const DisplayInfo &info, double logicX, double logicY) const;
87     int32_t GetCurrentUserId();
88     bool GetCancelEventFlag(std::shared_ptr<PointerEvent> pointerEvent);
89     void SetFoldState ();
90 #ifdef OHOS_BUILD_ENABLE_KEYBOARD
91     std::vector<std::pair<int32_t, TargetInfo>> GetPidAndUpdateTarget(std::shared_ptr<KeyEvent> keyEvent);
92     std::vector<std::pair<int32_t, TargetInfo>> UpdateTarget(std::shared_ptr<KeyEvent> keyEvent);
93     bool IsKeyPressed(int32_t pressedKey, std::vector<KeyEvent::KeyItem> &keyItems);
94     bool IsOnTheWhitelist(std::shared_ptr<KeyEvent> keyEvent);
95     void HandleKeyEventWindowId(std::shared_ptr<KeyEvent> keyEvent);
96 #endif // OHOS_BUILD_ENABLE_KEYBOARD
97     int32_t CheckWindowIdPermissionByPid(int32_t windowId, int32_t pid);
98 
99 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
100     MouseLocation GetMouseInfo();
101     CursorPosition GetCursorPos();
102     CursorPosition ResetCursorPos();
103     void SetGlobalDefaultPointerStyle();
104     void UpdateAndAdjustMouseLocation(int32_t& displayId, double& x, double& y, bool isRealData = true);
105 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
106 #ifdef OHOS_BUILD_ENABLE_POINTER
107     const DisplayGroupInfo& GetDisplayGroupInfo();
108     int32_t SetHoverScrollState(bool state);
109     bool GetHoverScrollState() const;
110 #endif // OHOS_BUILD_ENABLE_POINTER
111 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
112     int32_t SetPointerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle, bool isUiExtension = false);
113     int32_t GetPointerStyle(int32_t pid, int32_t windowId, PointerStyle &pointerStyle,
114         bool isUiExtension = false) const;
115     void SetUiExtensionInfo(bool isUiExtension, int32_t uiExtensionPid, int32_t uiExtensionWindoId);
116     void DispatchPointer(int32_t pointerAction, int32_t windowId = -1);
117     void SendPointerEvent(int32_t pointerAction);
118     bool IsMouseSimulate() const;
119     bool HasMouseHideFlag() const;
120 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
121 #ifdef OHOS_BUILD_ENABLE_POINTER
122     PointerStyle GetLastPointerStyle() const;
123 #ifdef OHOS_BUILD_ENABLE_POINTER_DRAWING
124     bool IsNeedRefreshLayer(int32_t windowId);
125 #endif // OHOS_BUILD_ENABLE_POINTER_DRAWING
126 #endif //OHOS_BUILD_ENABLE_POINTER
127 
128 #ifdef OHOS_BUILD_ENABLE_TOUCH
129     void AdjustDisplayCoordinate(const DisplayInfo& displayInfo, double& physicalX, double& physicalY) const;
130     bool TouchPointToDisplayPoint(int32_t deviceId, struct libinput_event_touch* touch,
131         EventTouch& touchInfo, int32_t& targetDisplayId);
132 #endif // OHOS_BUILD_ENABLE_TOUCH
133 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
134     void ReverseRotateScreen(const DisplayInfo& info, const double x, const double y, Coordinate2D& cursorPos) const;
135     void RotateScreen(const DisplayInfo& info, PhysicalCoordinate& coord) const;
136 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
137 #ifdef OHOS_BUILD_ENABLE_TOUCH
138     bool TransformTipPoint(struct libinput_event_tablet_tool* tip, PhysicalCoordinate& coord, int32_t& displayId) const;
139     bool CalculateTipPoint(struct libinput_event_tablet_tool* tip,
140         int32_t& targetDisplayId, PhysicalCoordinate& coord) const;
141     const DisplayInfo *GetDefaultDisplayInfo() const;
142     void ReverseXY(int32_t &x, int32_t &y);
143 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
144     void FoldScreenRotation(std::shared_ptr<PointerEvent> pointerEvent);
145 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
146     void SendCancelEventWhenLock();
147 #endif // OHOS_BUILD_ENABLE_TOUCH
148 
149 #ifdef OHOS_BUILD_ENABLE_ANCO
150     void UpdateWindowInfoExt(const WindowGroupInfo &windowGroupInfo, const DisplayGroupInfo &displayGroupInfo);
151     void UpdateShellWindow(const WindowInfo &window);
152     void UpdateDisplayInfoExt(const DisplayGroupInfo &displayGroupInfo);
153     bool IsInAncoWindow(const WindowInfo &window, int32_t x, int32_t y) const;
154     bool IsAncoWindow(const WindowInfo &window) const;
155     bool IsAncoWindowFocus(const WindowInfo &window) const;
156     void SimulatePointerExt(std::shared_ptr<PointerEvent> pointerEvent);
157     void SimulateKeyExt(std::shared_ptr<KeyEvent> keyEvent);
158     void DumpAncoWindows(std::string& out) const;
159     void CleanShellWindowIds();
160     bool IsKnuckleOnAncoWindow(std::shared_ptr<PointerEvent> pointerEvent);
161 #endif // OHOS_BUILD_ENABLE_ANCO
162 
163 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
164     bool UpdateDisplayId(int32_t& displayId);
165     void DrawTouchGraphic(std::shared_ptr<PointerEvent> pointerEvent);
166     int32_t UpdateTargetPointer(std::shared_ptr<PointerEvent> pointerEvent);
167 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
168     const DisplayInfo* GetPhysicalDisplay(int32_t id) const;
169 
170 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
171     void UpdatePointerChangeAreas();
172 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
173     std::optional<WindowInfo> GetWindowAndDisplayInfo(int32_t windowId, int32_t displayId);
174     void GetTargetWindowIds(int32_t pointerItemId, int32_t sourceType, std::vector<int32_t> &windowIds);
175     void AddTargetWindowIds(int32_t pointerItemId, int32_t sourceType, int32_t windowId);
176     void ClearTargetWindowId(int32_t pointerId);
177     bool IsTransparentWin(std::unique_ptr<Media::PixelMap> &pixelMap, int32_t logicalX, int32_t logicalY);
178     int32_t SetCurrentUser(int32_t userId);
179     DisplayMode GetDisplayMode() const;
180     void SetWindowStateNotifyPid(int32_t pid);
181     int32_t GetWindowStateNotifyPid();
182     int32_t GetPidByWindowId(int32_t pid);
183 #ifdef OHOS_BUILD_ENABLE_ANCO
184     int32_t AncoAddChannel(sptr<IAncoChannel> channel);
185     int32_t AncoRemoveChannel(sptr<IAncoChannel> channel);
186 #endif // OHOS_BUILD_ENABLE_ANCO
187 
188     int32_t SetPixelMapData(int32_t infoId, void *pixelMap);
189     void CleanInvalidPiexMap();
190     void HandleWindowPositionChange();
191     void SendCancelEventWhenWindowChange(int32_t pointerId);
192 
193 private:
194     bool IgnoreTouchEvent(std::shared_ptr<PointerEvent> pointerEvent);
195     void ReissueCancelTouchEvent(std::shared_ptr<PointerEvent> pointerEvent);
196     int32_t GetDisplayId(std::shared_ptr<InputEvent> inputEvent) const;
197     void PrintWindowInfo(const std::vector<WindowInfo> &windowsInfo);
198     void PrintDisplayInfo();
199     void PrintWindowGroupInfo(const WindowGroupInfo &windowGroupInfo);
200     void CheckFocusWindowChange(const DisplayGroupInfo &displayGroupInfo);
201     void CheckZorderWindowChange(const std::vector<WindowInfo> &oldWindowsInfo,
202         const std::vector<WindowInfo> &newWindowsInfo);
203     void UpdateDisplayIdAndName();
204     void UpdatePointerAction(std::shared_ptr<PointerEvent> pointerEvent);
205     bool IsNeedDrawPointer(PointerEvent::PointerItem &pointerItem) const;
206     void UpdateDisplayInfoByIncrementalInfo(const WindowInfo &window, DisplayGroupInfo &displayGroupInfo);
207     void UpdateWindowsInfoPerDisplay(const DisplayGroupInfo &displayGroupInfo);
208     std::pair<int32_t, int32_t> TransformSampleWindowXY(int32_t logicX, int32_t logicY) const;
209     bool IsValidZorderWindow(const WindowInfo &window, const std::shared_ptr<PointerEvent>& pointerEvent);
210 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
211     void UpdateTopBottomArea(const Rect &windowArea, std::vector<int32_t> &pointerChangeAreas,
212         std::vector<Rect> &windowHotAreas);
213     void UpdateLeftRightArea(const Rect &windowArea, std::vector<int32_t> &pointerChangeAreas,
214         std::vector<Rect> &windowHotAreas);
215     void UpdateInnerAngleArea(const Rect &windowArea, std::vector<int32_t> &pointerChangeAreas,
216         std::vector<Rect> &windowHotAreas);
217     void CoordinateCorrection(int32_t width, int32_t height, int32_t &integerX, int32_t &integerY);
218     void GetWidthAndHeight(const DisplayInfo* displayInfo, int32_t &width, int32_t &height, bool isRealData = true);
219 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
220     void SetPrivacyModeFlag(SecureFlag privacyMode, std::shared_ptr<InputEvent> event);
221     void PrintChangedWindowByEvent(int32_t eventType, const WindowInfo &newWindowInfo);
222     void PrintChangedWindowBySync(const DisplayGroupInfo &newDisplayInfo);
223     bool IsMouseDrawing(int32_t currentAction);
224     bool ParseConfig();
225     bool ParseJson(const std::string &configFile);
226 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
227     void SendUIExtentionPointerEvent(int32_t logicalX, int32_t logicalY,
228         const WindowInfo& windowInfo, std::shared_ptr<PointerEvent> pointerEvent);
229     void DispatchUIExtentionPointerEvent(int32_t logicalX, int32_t logicalY,
230         std::shared_ptr<PointerEvent> pointerEvent);
231 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
232 #ifdef OHOS_BUILD_ENABLE_POINTER
233     void GetPointerStyleByArea(WindowArea area, int32_t pid, int32_t winId, PointerStyle& pointerStyle);
234     int32_t UpdateMouseTarget(std::shared_ptr<PointerEvent> pointerEvent);
235     void UpdatePointerEvent(int32_t logicalX, int32_t logicalY,
236         const std::shared_ptr<PointerEvent>& pointerEvent, const WindowInfo& touchWindow);
237     void NotifyPointerToWindow();
238     void OnSessionLost(SessionPtr session);
239     void InitPointerStyle();
240 #endif // OHOS_BUILD_ENABLE_POINTER
241 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
242     int32_t UpdatePoinerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle);
243     int32_t UpdateSceneBoardPointerStyle(int32_t pid, int32_t windowId, PointerStyle pointerStyle,
244         bool isUiExtension = false);
245 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
246 #ifdef OHOS_BUILD_ENABLE_POINTER
247     int32_t UpdateTouchPadTarget(std::shared_ptr<PointerEvent> pointerEvent);
248 #endif // OHOS_BUILD_ENABLE_POINTER
249 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
250     std::optional<WindowInfo> SelectWindowInfo(int32_t logicalX, int32_t logicalY,
251         const std::shared_ptr<PointerEvent>& pointerEvent);
252     void CheckUIExtentionWindowPointerHotArea(int32_t logicalX, int32_t logicalY,
253         const std::vector<WindowInfo>& windowInfos, int32_t& windowId);
254     std::optional<WindowInfo> GetWindowInfo(int32_t logicalX, int32_t logicalY);
255     bool IsInsideDisplay(const DisplayInfo& displayInfo, int32_t physicalX, int32_t physicalY);
256     void FindPhysicalDisplay(const DisplayInfo& displayInfo, int32_t& physicalX,
257         int32_t& physicalY, int32_t& displayId);
258 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
259 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
260     void InitMouseDownInfo();
261     bool SelectPointerChangeArea(const WindowInfo &windowInfo, PointerStyle &pointerStyle,
262         int32_t logicalX, int32_t logicalY);
263     void UpdatePointerChangeAreas(const DisplayGroupInfo &displayGroupInfo);
264 #ifdef OHOS_BUILD_ENABLE_POINTER_DRAWING
265     void AdjustDisplayRotation();
266     void SetPointerEvent(int32_t pointerAction, std::shared_ptr<PointerEvent> pointerEvent);
267     void DispatchPointerCancel(int32_t displayId);
268 #endif // OHOS_BUILD_ENABLE_POINTER_DRAWING
269 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
270 
271 #if defined(OHOS_BUILD_ENABLE_POINTER) && defined(OHOS_BUILD_ENABLE_POINTER_DRAWING)
272 void PointerDrawingManagerOnDisplayInfo(const DisplayGroupInfo &displayGroupInfo);
273 bool NeedUpdatePointDrawFlag(const std::vector<WindowInfo> &windows);
274 #endif // OHOS_BUILD_ENABLE_POINTER && OHOS_BUILD_ENABLE_POINTER_DRAWING
275 
276 #ifdef OHOS_BUILD_ENABLE_TOUCH
277     bool SkipAnnotationWindow(uint32_t flag, int32_t toolType);
278     bool SkipNavigationWindow(WindowInputType windowType, int32_t toolType);
279     int32_t UpdateTouchScreenTarget(std::shared_ptr<PointerEvent> pointerEvent);
280     bool IsValidNavigationWindow(const WindowInfo& touchWindow, double physicalX, double physicalY);
281     bool IsNavigationWindowInjectEvent(std::shared_ptr<PointerEvent> pointerEvent);
282     void UpdateTransformDisplayXY(std::shared_ptr<PointerEvent> pointerEvent, std::vector<WindowInfo>& windowsInfo,
283         const DisplayInfo& displayInfo);
284     void PullEnterLeaveEvent(int32_t logicalX, int32_t logicalY,
285         const std::shared_ptr<PointerEvent> pointerEvent, const WindowInfo* touchWindow);
286     void DispatchTouch(int32_t pointerAction);
287     const DisplayInfo* FindPhysicalDisplayInfo(const std::string& uniq) const;
288     void GetPhysicalDisplayCoord(struct libinput_event_touch* touch,
289         const DisplayInfo& info, EventTouch& touchInfo);
290     void SetAntiMisTake(bool state);
291     void SetAntiMisTakeStatus(bool state);
292     void CheckUIExtentionWindowDefaultHotArea(std::pair<int32_t, int32_t> logicalXY, bool isHotArea,
293         const std::shared_ptr<PointerEvent> pointerEvent, const std::vector<WindowInfo>& windowInfos,
294         const WindowInfo** touchWindow);
295     void GetUIExtentionWindowInfo(std::vector<WindowInfo> &uiExtentionWindowInfo, int32_t windowId,
296         WindowInfo **touchWindow, bool &isUiExtentionWindow);
297 #endif // OHOS_BUILD_ENABLE_TOUCH
298 
299 #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH)
300     bool IsInHotArea(int32_t x, int32_t y, const std::vector<Rect> &rects, const WindowInfo &window) const;
301     bool InWhichHotArea(int32_t x, int32_t y, const std::vector<Rect> &rects, PointerStyle &pointerStyle) const;
302 #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH
303     template <class T>
304     void CreateAntiMisTakeObserver(T& item);
305 
306 #ifdef OHOS_BUILD_ENABLE_JOYSTICK
307     int32_t UpdateJoystickTarget(std::shared_ptr<PointerEvent> pointerEvent);
308 #endif // OHOS_BUILD_ENABLE_JOYSTICK
309 
310 #if defined(OHOS_BUILD_ENABLE_POINTER) && defined(OHOS_BUILD_ENABLE_CROWN)
311     int32_t UpdateCrownTarget(std::shared_ptr<PointerEvent> pointerEvent);
312 #endif // OHOS_BUILD_ENABLE_POINTER && OHOS_BUILD_ENABLE_CROWN
313 
314     void UpdateDisplayMode();
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