• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 
16 #ifndef DRAG_DRAWING_H
17 #define DRAG_DRAWING_H
18 
19 #include <vector>
20 #include <shared_mutex>
21 
22 #include "display_manager.h"
23 #include "event_handler.h"
24 #include "event_runner.h"
25 #include "json_parser.h"
26 #include "libxml/tree.h"
27 #include "libxml/parser.h"
28 
29 #include "modifier_ng/custom/rs_content_style_modifier.h"
30 
31 #include "vsync_receiver.h"
32 
33 #include "drag_data.h"
34 #include "drag_smooth_processor.h"
35 #include "drag_vsync_station.h"
36 #ifndef OHOS_BUILD_ENABLE_ARKUI_X
37 #include "i_context.h"
38 #endif // OHOS_BUILD_ENABLE_ARKUI_X
39 #include "i_drag_animation.h"
40 #ifdef OHOS_BUILD_ENABLE_ARKUI_X
41 #include "pointer_style.h"
42 #include "virtual_rs_window.h"
43 #endif // OHOS_BUILD_ENABLE_ARKUI_X
44 
45 namespace OHOS {
46 namespace Msdp {
47 namespace DeviceStatus {
48 struct DrawingInfo;
49 class DragDrawing;
50 using DragStartExtFunc = void (*)(DragData &dragData);
51 using DragNotifyExtFunc = void (*)(DragEventInfo &dragEventInfo);
52 
53 using RSContentStyleModifier = Rosen::ModifierNG::RSContentStyleModifier;
54 using RSDrawingContext = Rosen::ModifierNG::RSDrawingContext;
55 using RSModifier = Rosen::ModifierNG::RSModifier;
56 
57 class DrawSVGModifier : public RSContentStyleModifier {
58 public:
DrawSVGModifier(std::shared_ptr<Media::PixelMap> stylePixelMap,bool isRTL)59     DrawSVGModifier(std::shared_ptr<Media::PixelMap> stylePixelMap, bool isRTL)
60         : stylePixelMap_(stylePixelMap), isRTL_(isRTL) {}
61     ~DrawSVGModifier() = default;
62     void Draw(RSDrawingContext& context) const override;
63 
64 private:
65     std::shared_ptr<Media::PixelMap> stylePixelMap_ { nullptr };
66     bool isRTL_ { false };
67 };
68 
69 class DrawPixelMapModifier : public RSContentStyleModifier {
70 public:
71     DrawPixelMapModifier() = default;
72     ~DrawPixelMapModifier() = default;
73     void SetDragShadow(std::shared_ptr<Rosen::RSCanvasNode> pixelMapNode) const;
74     void SetTextDragShadow(std::shared_ptr<Rosen::RSCanvasNode> pixelMapNode) const;
75     Rosen::SHADOW_COLOR_STRATEGY ConvertShadowColorStrategy(int32_t shadowColorStrategy) const;
76     void Draw(RSDrawingContext &context) const override;
77 };
78 
79 class DrawMouseIconModifier : public RSContentStyleModifier {
80 public:
DrawMouseIconModifier(MMI::PointerStyle pointerStyle)81     explicit DrawMouseIconModifier(MMI::PointerStyle pointerStyle) : pointerStyle_(pointerStyle) {}
82     ~DrawMouseIconModifier() = default;
83     void Draw(RSDrawingContext &context) const override;
84 
85 private:
86     void OnDraw(std::shared_ptr<Media::PixelMap> pixelMap) const;
87     std::shared_ptr<Media::PixelMap> DrawFromSVG() const;
88 
89 private:
90     MMI::PointerStyle pointerStyle_;
91 };
92 
93 class DrawDynamicEffectModifier : public RSContentStyleModifier {
94 public:
95     DrawDynamicEffectModifier() = default;
96     ~DrawDynamicEffectModifier() = default;
97     void Draw(RSDrawingContext &context) const override;
98     void SetAlpha(float alpha);
99     void SetScale(float scale);
100 
101 private:
102     std::shared_ptr<Rosen::RSAnimatableProperty<float>> alpha_ { nullptr };
103     std::shared_ptr<Rosen::RSAnimatableProperty<float>> scale_ { nullptr };
104 };
105 
106 class DrawDragStopModifier : public RSContentStyleModifier {
107 public:
108     DrawDragStopModifier() = default;
109     ~DrawDragStopModifier() = default;
110     void Draw(RSDrawingContext &context) const override;
111     void SetAlpha(float alpha);
112     void SetScale(float scale);
113     void SetStyleScale(float scale);
114     void SetStyleAlpha(float alpha);
115 
116 private:
117     std::shared_ptr<Rosen::RSAnimatableProperty<float>> alpha_ { nullptr };
118     std::shared_ptr<Rosen::RSAnimatableProperty<float>> scale_ { nullptr };
119     std::shared_ptr<Rosen::RSAnimatableProperty<float>> styleScale_ { nullptr };
120     std::shared_ptr<Rosen::RSAnimatableProperty<float>> styleAlpha_ { nullptr };
121 };
122 
123 class DrawStyleChangeModifier : public RSContentStyleModifier {
124 public:
125     DrawStyleChangeModifier() = default;
DrawStyleChangeModifier(std::shared_ptr<Media::PixelMap> stylePixelMap,bool isRTL)126     DrawStyleChangeModifier(std::shared_ptr<Media::PixelMap> stylePixelMap, bool isRTL)
127         : stylePixelMap_(stylePixelMap), isRTL_(isRTL) {}
128     ~DrawStyleChangeModifier() = default;
129     void Draw(RSDrawingContext &context) const override;
130     void SetScale(float scale);
131 
132 private:
133     std::shared_ptr<Media::PixelMap> stylePixelMap_ { nullptr };
134     std::shared_ptr<Rosen::RSAnimatableProperty<float>> scale_ { nullptr };
135     bool isRTL_ { false };
136 };
137 
138 class DrawStyleScaleModifier : public RSContentStyleModifier {
139 public:
140     DrawStyleScaleModifier() = default;
141     ~DrawStyleScaleModifier() = default;
142     void Draw(RSDrawingContext &context) const override;
143     void SetScale(float scale);
144 
145 private:
146     std::shared_ptr<Rosen::RSAnimatableProperty<float>> scale_ { nullptr };
147 };
148 
149 struct FilterInfo {
150     std::string dragType;
151     bool shadowEnable { false };
152     bool shadowIsFilled { false };
153     bool shadowMask { false };
154     int32_t shadowColorStrategy { 0 };
155     float shadowCorner { 0.0F };
156     float dipScale { 0.0f };
157     float scale { 1.0f };
158     float cornerRadius1 { 0.0f };
159     float cornerRadius2 { 0.0f };
160     float cornerRadius3 { 0.0f };
161     float cornerRadius4 { 0.0f };
162     float opacity { 0.95f };
163     float offsetX { 0.0f };
164     float offsetY { 0.0f };
165     uint32_t argb { 0 };
166     std::string path;
167     float elevation { 0.0f };
168     bool isHardwareAcceleration { false };
169     Rosen::Vector2f coef;
170     float blurRadius { -1.0f };
171     float blurStaturation { -1.0f };
172     float blurBrightness { -1.0f };
173     uint32_t blurColor { 0 };
174     int32_t blurStyle { -1 };
175     float dragNodeGrayscale { 0.0f };
176     int32_t eventId { -1 };
177 };
178 
179 struct ExtraInfo {
180     std::string componentType;
181     int32_t blurStyle { -1 };
182     float cornerRadius { 0.0f };
183     bool allowDistributed { true };
184     Rosen::Vector2f coef;
185 };
186 
187 enum class ScreenSizeType {
188     // Undefined screen width
189     UNDEFINED = 0,
190     // Screen width size is SM, limit is 600vp, circle’s Radius is 144vp
191     SM,
192     // Screen width size is MD, limit is 840vp, circle’s Radius is 260vp
193     MD,
194     // Screen width size is LG, limit is 1440vp, circle’s Radius is 396vp
195     LG,
196     // Screen width size is XL, no limit , circle’s Radius is 396vp
197     XL,
198 };
199 
200 struct DrawingInfo {
201     std::atomic_bool isRunning { false };
202     std::atomic_bool isPreviousDefaultStyle { false };
203     std::atomic_bool isCurrentDefaultStyle { false };
204     bool isInitUiDirector { true };
205     bool isExistScalingValue { false };
206     std::atomic_bool needDestroyDragWindow { false };
207     int32_t sourceType { -1 };
208     int32_t currentDragNum { -1 };
209     DragCursorStyle currentStyle { DragCursorStyle::DEFAULT };
210     int32_t displayId { -1 };
211     int32_t pixelMapX { -1 };
212     int32_t pixelMapY { -1 };
213     int32_t displayX { -1 };
214     int32_t displayY { -1 };
215     float x { -1.0f };
216     float y { -1.0f };
217     float currentPositionX { -1.0f };
218     float currentPositionY { -1.0f };
219     int32_t mouseWidth { 0 };
220     int32_t mouseHeight { 0 };
221     int32_t rootNodeWidth { -1 };
222     int32_t rootNodeHeight { -1 };
223     std::atomic<int64_t> startNum { -1 };
224     int32_t timerId { -1 };
225     float scalingValue { 0.0 };
226     std::vector<std::shared_ptr<Rosen::RSCanvasNode>> nodes;
227     std::vector<std::shared_ptr<Rosen::RSCanvasNode>> multiSelectedNodes;
228     std::vector<std::shared_ptr<Media::PixelMap>> multiSelectedPixelMaps;
229     std::shared_ptr<Rosen::RSNode> rootNode { nullptr };
230     std::shared_ptr<Rosen::RSNode> parentNode { nullptr };
231     std::shared_ptr<Rosen::RSSurfaceNode> surfaceNode { nullptr };
232     std::shared_ptr<Media::PixelMap> pixelMap { nullptr };
233     std::shared_ptr<Media::PixelMap> stylePixelMap { nullptr };
234 #ifdef OHOS_BUILD_INTERNAL_DROP_ANIMATION
235     std::shared_ptr<Rosen::RSNode> curvesMaskNode { nullptr };
236     std::shared_ptr<Rosen::RSNode> lightNode { nullptr };
237 #endif // OHOS_BUILD_INTERNAL_DROP_ANIMATION
238 #ifndef OHOS_BUILD_ENABLE_ARKUI_X
239     IContext* context { nullptr };
240 #endif // OHOS_BUILD_ENABLE_ARKUI_X
241     ExtraInfo extraInfo;
242     FilterInfo filterInfo;
243 };
244 
245 struct DragWindowRotationInfo {
246     float rotation { 0.0f };
247     float pivotX { 0.0f };
248     float pivotY { 0.0f };
249 };
250 
251 class DragDrawing : public IDragAnimation {
252 public:
253     DragDrawing() = default;
254     DISALLOW_COPY_AND_MOVE(DragDrawing);
255     ~DragDrawing();
256 
257 #ifndef OHOS_BUILD_ENABLE_ARKUI_X
258     int32_t Init(const DragData &dragData, IContext* context, bool isLongPressDrag = false);
259     void OnStartDragExt();
260     void NotifyDragInfo(const std::string &sourceName, const std::string &targetName);
261 #else
262     int32_t Init(const DragData &dragData, bool isLongPressDrag = false);
263 #endif // OHOS_BUILD_ENABLE_ARKUI_X
264     void Draw(int32_t displayId, int32_t displayX, int32_t displayY, bool isNeedAdjustDisplayXY = true,
265         bool isMultiSelectedAnimation = true);
266     int32_t UpdateDragStyle(DragCursorStyle style);
267     int32_t UpdateShadowPic(const ShadowInfo &shadowInfo);
268     int32_t UpdatePreviewStyle(const PreviewStyle &previewStyle);
269     int32_t UpdatePreviewStyleWithAnimation(const PreviewStyle &previewStyle, const PreviewAnimation &animation);
270     int32_t StartVsync();
271 #ifndef OHOS_BUILD_ENABLE_ARKUI_X
272     void OnDragSuccess(IContext* context);
273     void OnDragFail(IContext* context, bool isLongPressDrag);
274     void StopVSyncStation();
275     void SetDragStyleRTL(bool isRTL);
276 #else
277     void OnDragSuccess();
278     void OnDragFail();
279     void SetDragWindow(std::shared_ptr<OHOS::Rosen::Window> window);
280     void AddDragDestroy(std::function<void()> cb);
281     void SetSVGFilePath(const std::string &filePath);
282 #endif // OHOS_BUILD_ENABLE_ARKUI_X
283     void OnDragMove(int32_t displayId, int32_t displayX, int32_t displayY, int64_t actionTime);
284 #ifdef OHOS_ENABLE_PULLTHROW
285     void OnPullThrowDragMove(int32_t displayId, int32_t displayX, int32_t displayY, int64_t actionTime);
286 #endif // OHOS_ENABLE_PULLTHROW
287     void EraseMouseIcon();
288     void DestroyDragWindow();
289     void UpdateDrawingState();
290     void UpdateDragWindowState(bool visible, bool isZoomInAndAlphaChanged = false,
291         const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr);
292     void OnStartDrag(const DragAnimationData &dragAnimationData) override;
293     void OnDragStyle(std::shared_ptr<Rosen::RSCanvasNode> dragStyleNode,
294         std::shared_ptr<Media::PixelMap> stylePixelMap) override;
295     void OnStopDragSuccess(std::shared_ptr<Rosen::RSCanvasNode> shadowNode,
296         std::shared_ptr<Rosen::RSCanvasNode> dragStyleNode) override;
297     void OnStopDragFail(std::shared_ptr<Rosen::RSSurfaceNode> surfaceNode,
298         std::shared_ptr<Rosen::RSNode> rootNode) override;
299     void OnStopAnimation() override;
300     int32_t EnterTextEditorArea(bool enable);
301     bool GetAllowDragState();
302     void SetScreenId(uint64_t screenId);
303     int32_t RotateDragWindowAsync(Rosen::Rotation rotation);
304     int32_t RotateDragWindowSync(const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr);
305     void SetRotation(Rosen::DisplayId displayId, Rosen::Rotation rotation);
306     Rosen::Rotation GetRotation(Rosen::DisplayId displayId);
307     void RemoveDisplayIdFromMap(Rosen::DisplayId displayId);
308     float CalculateWidthScale();
309 #ifdef OHOS_ENABLE_PULLTHROW
310 #ifndef OHOS_BUILD_ENABLE_ARKUI_X
311     float CalculatePullThrowScale();
312 #endif // OHOS_BUILD_ENABLE_ARKUI_X
313 #endif // OHOS_ENABLE_PULLTHROW
314     float GetMaxWidthScale(int32_t width, int32_t height);
315     float CalculateScale(float width, float height, float widthLimit, float heightLimit);
316     int32_t AddSelectedPixelMap(std::shared_ptr<OHOS::Media::PixelMap> pixelMap);
317     void UpdateDragWindowDisplay(int32_t displayId);
318     void DetachToDisplay(int32_t displayId);
319     void ScreenRotate(Rosen::Rotation rotation, Rosen::Rotation lastRotation);
320     void UpdateDragState(DragState dragState);
321     static std::shared_ptr<Media::PixelMap> AccessGlobalPixelMapLocked();
322     static void UpdataGlobalPixelMapLocked(std::shared_ptr<Media::PixelMap> pixelmap);
323     void LongPressDragZoomOutAnimation();
324     void SetMultiSelectedAnimationFlag(bool needMultiSelectedAnimation);
325     void ResetAnimationParameter();
326     static int32_t GetSvgTouchPositionX(int32_t currentPixelMapWidth, int32_t stylePixelMapWidth, bool isRTL);
327 #ifdef OHOS_ENABLE_PULLTHROW
328     void PullThrowAnimation(double tx, double ty, float vx, float vy, std::shared_ptr<MMI::PointerEvent> pointerEvent);
329     void SetHovering(double tx, double ty, std::shared_ptr<MMI::PointerEvent> pointerEvent);
330     void SetScaleAnimation();
331     void PullThrowBreatheAnimation();
332     void PullThrowBreatheEndAnimation();
333     void PullThrowZoomOutAnimation();
334 #endif // OHOS_ENABLE_PULLTHROW
335 #ifdef OHOS_BUILD_INTERNAL_DROP_ANIMATION
336     void GetDragDrawingInfo(DragInternalInfo &dragInternalInfo);
337     void RemoveStyleNodeAnimations();
338 #endif // OHOS_BUILD_INTERNAL_DROP_ANIMATION
339 
340 private:
341     int32_t CheckDragData(const DragData &dragData);
342     int32_t InitLayer();
343     void InitCanvas(int32_t width, int32_t height);
344     void CreateWindow();
345     int32_t DrawShadow(std::shared_ptr<Rosen::RSCanvasNode> shadowNode);
346     int32_t DrawMouseIcon();
347     int32_t DrawStyle(std::shared_ptr<Rosen::RSCanvasNode> dragStyleNode,
348         std::shared_ptr<Media::PixelMap> stylePixelMap);
349     int32_t RunAnimation(std::function<int32_t()> cb);
350     int32_t InitVSync(float endAlpha, float endScale);
351     void OnVsync();
352     void InitDrawingInfo(const DragData &dragData, bool isLongPressDrag = false);
353     int32_t InitDragAnimationData(DragAnimationData &dragAnimationData);
354     void RemoveModifier();
355     int32_t UpdateSvgNodeInfo(xmlNodePtr curNode, int32_t extendSvgWidth);
356     xmlNodePtr GetRectNode(xmlNodePtr curNode);
357     xmlNodePtr UpdateRectNode(int32_t extendSvgWidth, xmlNodePtr curNode);
358     void UpdateTspanNode(xmlNodePtr curNode);
359     int32_t ParseAndAdjustSvgInfo(xmlNodePtr curNode);
360     std::shared_ptr<Media::PixelMap> DecodeSvgToPixelMap(const std::string &filePath);
361     void GetFilePath(std::string &filePath);
362     void GetLTRFilePath(std::string &filePath);
363     bool NeedAdjustSvgInfo();
364     void SetDecodeOptions(Media::DecodeOptions &decodeOpts);
365     bool ParserFilterInfo(const std::string &filterInfoStr, FilterInfo &filterInfo);
366     void ParserCornerRadiusInfo(const cJSON *cornerRadiusInfoStr, FilterInfo &filterInfo);
367     void ParserBlurInfo(const cJSON *BlurInfoInfoStr, FilterInfo &filterInfo);
368     void SetCustomDragBlur(const FilterInfo &filterInfo, std::shared_ptr<Rosen::RSCanvasNode> filterNode);
369     void SetComponentDragBlur(const FilterInfo &filterInfo, const ExtraInfo &extraInfo,
370         std::shared_ptr<Rosen::RSCanvasNode> filterNode);
371     void ParserDragShadowInfo(const cJSON* filterInfoParser, FilterInfo &filterInfo);
372     void ParserTextDragShadowInfo(const cJSON* filterInfoParser, FilterInfo &filterInfo);
373     void PrintDragShadowInfo();
374     void ProcessFilter();
375     bool ParserExtraInfo(const std::string &extraInfoStr, ExtraInfo &extraInfo);
376     static float RadiusVp2Sigma(float radiusVp, float dipScale);
377     void DoDrawMouse(int32_t mousePositionX, int32_t mousePositionY);
378     void UpdateMousePosition(float mousePositionX, float mousePositionY);
379     int32_t UpdateDefaultDragStyle(DragCursorStyle style);
380     int32_t UpdateValidDragStyle(DragCursorStyle style);
381     int32_t SetNodesLocation();
382     int32_t CreateEventRunner(int32_t positionX, int32_t positionY);
383     int32_t ModifyPreviewStyle(std::shared_ptr<Rosen::RSCanvasNode> node, const PreviewStyle &previewStyle);
384     int32_t ModifyMultiPreviewStyle(const std::vector<PreviewStyle> &previewStyles);
385     void MultiSelectedAnimation(int32_t positionX, int32_t positionY, int32_t adjustSize,
386         bool isMultiSelectedAnimation);
387     void DoMultiSelectedAnimation(float positionX, float positionY, float adjustSize,
388         bool isMultiSelectedAnimation = true);
389     void InitMultiSelectedNodes();
390     void ClearMultiSelectedData();
391     bool ParserRadius(float &radius);
392     void OnStopAnimationSuccess();
393     void OnStopAnimationFail();
394     void OnDragStyleAnimation();
395     void ChangeStyleAnimation();
396     void CheckStyleNodeModifier(std::shared_ptr<Rosen::RSCanvasNode> styleNode);
397     void RemoveStyleNodeModifier(std::shared_ptr<Rosen::RSCanvasNode> styleNode);
398     void StartStyleAnimation(float startScale, float endScale, int32_t duration);
399     void UpdateAnimationProtocol(Rosen::RSAnimationTimingProtocol protocol);
400     void RotateDisplayXY(int32_t &displayX, int32_t &displayY);
401     void RotatePixelMapXY();
402     void ResetAnimationFlag(bool isForce = false);
403     void DoEndAnimation();
404     void ResetParameter();
405     int32_t DoRotateDragWindow(float rotation,
406         const std::shared_ptr<Rosen::RSTransaction>& rsTransaction, bool isAnimated);
407     int32_t DoRotateDragWindowAnimation(float rotation, float pivotX, float pivotY,
408         const std::shared_ptr<Rosen::RSTransaction>& rsTransaction);
409     int32_t RotateDragWindow(Rosen::Rotation rotation,
410         const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, bool isAnimated = false);
411     void LongPressDragAnimation();
412     void LongPressDragZoomInAnimation();
413     void LongPressDragAlphaAnimation();
414 #ifndef OHOS_BUILD_ENABLE_ARKUI_X
415     std::shared_ptr<AppExecFwk::EventHandler> GetSuperHubHandler();
416     void GetRTLFilePath(std::string &filePath);
417 #endif // OHOS_BUILD_ENABLE_ARKUI_X
418     void RotateCanvasNode(float pivotX, float pivotY, float rotation);
419     void FlushDragPosition(uint64_t nanoTimestamp);
420     void RotatePosition(float &displayX, float &displayY);
421     void UpdateDragPosition(int32_t displayId, float displayX, float displayY);
422     float AdjustDoubleValue(double doubleValue);
423     int32_t UpdatePixelMapsAngleAndAlpha();
424     int32_t UpdatePixeMapDrawingOrder();
425     void LoadDragDropLib();
426     template <typename T>
427     void AdjustRotateDisplayXY(T &displayX, T &displayY);
428     void DrawRotateDisplayXY(float positionX, float positionY);
429     void ScreenRotateAdjustDisplayXY(
430         Rosen::Rotation rotation, Rosen::Rotation lastRotation, float &displayX, float &displayY);
431     void UpdateDragDataForSuperHub(const DragData &dragData);
432     std::shared_ptr<Rosen::VSyncReceiver> AccessReceiverLocked();
433     void UpdateReceiverLocked(std::shared_ptr<Rosen::VSyncReceiver> receiver);
434     void LongPressDragFail();
435     float CalculateSMScale(int32_t pixelMapWidth, int32_t pixelMapHeight, int32_t shortSide);
436     float CalculateMDScale(int32_t pixelMapWidth, int32_t pixelMapHeight, int32_t shortSide);
437     float CalculateDefaultScale(int32_t pixelMapWidth, int32_t pixelMapHeight, int32_t shortSide);
438 
439 private:
440     bool needMultiSelectedAnimation_ { true };
441     int32_t displayWidth_ { -1 };
442     int32_t displayHeight_ { -1 };
443     int64_t interruptNum_ { -1 };
444     std::shared_ptr<Rosen::RSCanvasNode> canvasNode_ { nullptr };
445     std::shared_ptr<DrawSVGModifier> drawSVGModifier_ { nullptr };
446     std::shared_ptr<DrawPixelMapModifier> drawPixelMapModifier_ { nullptr };
447     std::shared_ptr<DrawMouseIconModifier> drawMouseIconModifier_ { nullptr };
448     std::shared_ptr<DrawDynamicEffectModifier> drawDynamicEffectModifier_ { nullptr };
449     std::shared_ptr<DrawDragStopModifier> drawDragStopModifier_ { nullptr };
450     std::shared_ptr<DrawStyleChangeModifier> drawStyleChangeModifier_ { nullptr };
451     std::shared_ptr<DrawStyleScaleModifier> drawStyleScaleModifier_ { nullptr };
452     std::shared_ptr<Rosen::RSUIDirector> rsUiDirector_ { nullptr };
453     std::shared_ptr<Rosen::VSyncReceiver> receiver_ { nullptr };
454     std::shared_ptr<AppExecFwk::EventHandler> handler_ { nullptr };
455     std::shared_ptr<AppExecFwk::EventHandler> superHubHandler_ { nullptr };
456     std::atomic_bool hasRunningStopAnimation_ { false };
457     std::atomic_bool hasRunningScaleAnimation_ { false };
458     std::atomic_bool needBreakStyleScaleAnimation_ { false };
459     std::atomic_bool hasRunningAnimation_ { false };
460     std::atomic_bool screenRotateState_ { false };
461     void* dragExtHandler_ { nullptr };
462     bool needRotatePixelMapXY_ { false };
463     uint64_t screenId_ { 0 };
464 #ifdef OHOS_ENABLE_PULLTHROW
465     float pullThrowScale_ { 1.0 };
466 #endif // OHOS_ENABLE_PULLTHROW
467     std::map<Rosen::DisplayId, Rosen::Rotation> rotationMap_;
468     ScreenSizeType currentScreenSize_ = ScreenSizeType::UNDEFINED;
469     MMI::PointerStyle pointerStyle_;
470     DragVSyncStation vSyncStation_;
471     DragSmoothProcessor dragSmoothProcessor_;
472     std::shared_ptr<DragFrameCallback> frameCallback_ { nullptr };
473     std::atomic_bool isRunningRotateAnimation_ { false };
474     DragWindowRotationInfo DragWindowRotateInfo_;
475     Rosen::Rotation DragWindowRotationFlush_ { Rosen::Rotation::ROTATION_0 };
476     DragState dragState_ { DragState::STOP };
477     int32_t timerId_ { -1 };
478     std::shared_mutex receiverMutex_;
479     bool isRTL_ { false };
480 #ifdef OHOS_ENABLE_PULLTHROW
481     bool pullThrowAnimationXCompleted_  { false };
482     bool pullThrowAnimationYCompleted_ { false };
483     std::mutex animationMutex_;
484     std::condition_variable animationCV_;
485 #endif // OHOS_ENABLE_PULLTHROW
486 #ifdef OHOS_BUILD_ENABLE_ARKUI_X
487     std::shared_ptr<OHOS::Rosen::Window> window_ { nullptr };
488     std::function<void()> callback_ { nullptr };
489     std::string svgFilePath_;
490     int64_t actionTime_ { 0 };
491 #else
492     IContext* context_ { nullptr };
493 #endif // OHOS_BUILD_ENABLE_ARKUI_X
494 };
495 } // namespace DeviceStatus
496 } // namespace Msdp
497 } // namespace OHOS
498 #endif // DRAG_DRAWING_H