mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 09:12:41 +00:00
!48452 getContext整改
Merge pull request !48452 from 贺晨韬/hct_add_codecheck_1
This commit is contained in:
commit
e41825fe34
@ -627,7 +627,7 @@ void CalculatePointerEvent(const NG::OffsetF& offsetF, const std::shared_ptr<MMI
|
||||
}
|
||||
auto windowX = xRelative;
|
||||
auto windowY = yRelative;
|
||||
auto pipelineContext = PipelineBase::GetCurrentContext();
|
||||
auto pipelineContext = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto displayWindowRect = pipelineContext->GetDisplayWindowRectInfo();
|
||||
auto windowWidth = displayWindowRect.Width();
|
||||
|
@ -149,7 +149,7 @@ void DragEventActuator::CancelDragForWeb()
|
||||
*/
|
||||
bool DragEventActuator::IsGlobalStatusSuitableForDragging()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, false);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_RETURN(dragDropManager, false);
|
||||
@ -277,7 +277,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
CHECK_NULL_VOID(gestureHub);
|
||||
auto frameNode = gestureHub->GetFrameNode();
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = frameNode->GetContextRefPtr();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -297,7 +297,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
DragEventActuator::ResetDragStatus();
|
||||
return;
|
||||
}
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -417,7 +417,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
|
||||
auto actionEnd = [weak = WeakClaim(this)](GestureEvent& info) {
|
||||
TAG_LOGI(AceLogTag::ACE_DRAG, "Trigger drag action end.");
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto dragDropManager = pipelineContext->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -457,7 +457,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
panRecognizer_->SetOnActionEnd(actionEnd);
|
||||
auto actionCancel = [weak = WeakClaim(this), touchSourceType = touchRestrict.sourceType]() {
|
||||
TAG_LOGD(AceLogTag::ACE_DRAG, "Drag event has been canceled.");
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto dragDropManager = pipelineContext->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -536,7 +536,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
auto gestureHub = actuator->gestureEventHub_.Upgrade();
|
||||
CHECK_NULL_VOID(gestureHub);
|
||||
actuator->ResetResponseRegion();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -837,7 +837,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
|
||||
void DragEventActuator::ResetDragStatus()
|
||||
{
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto overlayManager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(overlayManager);
|
||||
@ -850,7 +850,7 @@ void DragEventActuator::ResetDragStatus()
|
||||
|
||||
void DragEventActuator::SetDragDampStartPointInfo(const Point& point, int32_t pointerId)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -861,7 +861,7 @@ void DragEventActuator::SetDragDampStartPointInfo(const Point& point, int32_t po
|
||||
|
||||
void DragEventActuator::HandleDragDampingMove(const Point& point, int32_t pointerId, bool isRedragStart)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -920,7 +920,7 @@ void DragEventActuator::SetFilter(const RefPtr<DragEventActuator>& actuator)
|
||||
frameNode->GetTag().c_str(), frameNode->GetDepth());
|
||||
return;
|
||||
}
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -998,7 +998,7 @@ OffsetF DragEventActuator::GetFloatImageOffset(const RefPtr<FrameNode>& frameNod
|
||||
}
|
||||
#endif
|
||||
// Check web tag.
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipelineContext, OffsetF());
|
||||
if (pipelineContext->HasFloatTitle()) {
|
||||
offsetX -= static_cast<float>((CONTAINER_BORDER_WIDTH + CONTENT_PADDING).ConvertToPx());
|
||||
@ -1229,7 +1229,7 @@ RefPtr<PixelMap> DragEventActuator::GetScreenShotPixelMap(const RefPtr<FrameNode
|
||||
void DragEventActuator::SetPixelMap(const RefPtr<DragEventActuator>& actuator)
|
||||
{
|
||||
TAG_LOGD(AceLogTag::ACE_DRAG, "DragEvent start set pixelMap");
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -1383,7 +1383,7 @@ float DragEventActuator::RadiusToSigma(float radius)
|
||||
|
||||
std::optional<EffectOption> DragEventActuator::BrulStyleToEffection(const std::optional<BlurStyleOption>& blurStyleOp)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, std::nullopt);
|
||||
auto blurStyleTheme = pipeline->GetTheme<BlurStyleTheme>();
|
||||
if (!blurStyleTheme) {
|
||||
@ -1433,7 +1433,7 @@ void DragEventActuator::ApplyNewestOptionExecutedFromModifierToNode(
|
||||
void DragEventActuator::SetEventColumn(const RefPtr<DragEventActuator>& actuator)
|
||||
{
|
||||
TAG_LOGI(AceLogTag::ACE_DRAG, "DragEvent start set eventColumn.");
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -1478,7 +1478,7 @@ void DragEventActuator::HideFilter()
|
||||
if (frameNode->GetTag() != V2::WEB_ETS_TAG) {
|
||||
return;
|
||||
}
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -1509,7 +1509,7 @@ void DragEventActuator::HidePixelMap(bool startDrag, double x, double y, bool sh
|
||||
|
||||
void DragEventActuator::HideEventColumn()
|
||||
{
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -1650,7 +1650,7 @@ void DragEventActuator::SetTextPixelMap(const RefPtr<GestureEventHub>& gestureHu
|
||||
void DragEventActuator::SetTextAnimation(const RefPtr<GestureEventHub>& gestureHub, const Offset& globalLocation)
|
||||
{
|
||||
TAG_LOGD(AceLogTag::ACE_DRAG, "DragEvent start set textAnimation.");
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -1743,7 +1743,7 @@ void DragEventActuator::HideTextAnimation(bool startDrag, double globalX, double
|
||||
option.SetCurve(Curves::SHARP);
|
||||
option.SetOnFinishEvent(removeColumnNode);
|
||||
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetOverlayManager();
|
||||
auto dragNode = manager->GetPixelMapNode();
|
||||
@ -1867,7 +1867,7 @@ void DragEventActuator::CopyDragEvent(const RefPtr<DragEventActuator>& dragEvent
|
||||
|
||||
void DragEventActuator::FlushSyncGeometryNodeTasks()
|
||||
{
|
||||
auto pipeline = PipelineBase::GetCurrentContext();
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
pipeline->FlushSyncGeometryNodeTasks();
|
||||
}
|
||||
@ -1878,7 +1878,7 @@ void DragEventActuator::SetGatherNodeAboveFilter(const RefPtr<DragEventActuator>
|
||||
if (!actuator->IsNeedGather()) {
|
||||
return;
|
||||
}
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -1933,7 +1933,7 @@ RefPtr<FrameNode> DragEventActuator::CreateGatherNode(const RefPtr<DragEventActu
|
||||
auto frameNode = gestureHub->GetFrameNode();
|
||||
CHECK_NULL_RETURN(frameNode, nullptr);
|
||||
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipelineContext, nullptr);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_RETURN(manager, nullptr);
|
||||
@ -2089,8 +2089,6 @@ void DragEventActuator::GetFrameNodePreviewPixelMap(const RefPtr<FrameNode>& fra
|
||||
auto gestureHub = frameNode->GetOrCreateGestureEventHub();
|
||||
CHECK_NULL_VOID(gestureHub);
|
||||
auto dragPreviewInfo = frameNode->GetDragPreview();
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
if (dragPreviewInfo.inspectorId != "") {
|
||||
auto previewPixelMap = GetPreviewPixelMap(dragPreviewInfo.inspectorId, frameNode);
|
||||
gestureHub->SetDragPreviewPixelMap(previewPixelMap);
|
||||
@ -2108,7 +2106,7 @@ void DragEventActuator::GetFrameNodePreviewPixelMap(const RefPtr<FrameNode>& fra
|
||||
bool DragEventActuator::IsBelongToMultiItemNode(const RefPtr<FrameNode>& frameNode)
|
||||
{
|
||||
CHECK_NULL_RETURN(frameNode, false);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, false);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_RETURN(dragDropManager, false);
|
||||
@ -2259,7 +2257,7 @@ void DragEventActuator::HandleTouchMoveEvent()
|
||||
longPressRecognizer_->GetGestureDisposal() == GestureDisposal::REJECT) {
|
||||
SetGatherNode(nullptr);
|
||||
ClearGatherNodeChildrenInfo();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto manager = pipelineContext->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -2358,7 +2356,7 @@ void DragEventActuator::ParseShadowInfo(Shadow& shadow, std::unique_ptr<JsonValu
|
||||
|
||||
std::optional<Shadow> DragEventActuator::GetDefaultShadow()
|
||||
{
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipelineContext, std::nullopt);
|
||||
auto shadowTheme = pipelineContext->GetTheme<ShadowTheme>();
|
||||
CHECK_NULL_RETURN(shadowTheme, std::nullopt);
|
||||
@ -2529,7 +2527,7 @@ void DragEventActuator::ResetResponseRegion()
|
||||
void DragEventActuator::PrepareFinalPixelMapForDragThroughTouch(RefPtr<PixelMap> pixelMap, bool immediately)
|
||||
{
|
||||
ResetPreScaledPixelMapForDragThroughTouch();
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -2586,7 +2584,7 @@ void DragEventActuator::RecordMenuWrapperNodeForDrag(int32_t targetId)
|
||||
auto menuWrapperNode = overlayManager->GetMenuNode(targetId);
|
||||
CHECK_NULL_VOID(menuWrapperNode);
|
||||
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
|
@ -110,7 +110,7 @@ GetEventTargetImpl EventHub::CreateGetEventTargetImpl() const
|
||||
|
||||
void EventHub::PostEnabledTask()
|
||||
{
|
||||
auto pipeline = PipelineBase::GetCurrentContext();
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto taskExecutor = pipeline->GetTaskExecutor();
|
||||
CHECK_NULL_VOID(taskExecutor);
|
||||
@ -286,7 +286,7 @@ void EventHub::HandleInternalOnDrop(const RefPtr<OHOS::Ace::DragEvent>& info, co
|
||||
|
||||
void EventHub::AddInnerOnAreaChangedCallback(int32_t id, OnAreaChangedFunc&& callback)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto frameNode = GetFrameNode();
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
@ -418,7 +418,7 @@ void EventHub::ClearJSFrameNodeOnDisappear()
|
||||
void EventHub::FireOnAppear()
|
||||
{
|
||||
if (onAppear_ || onJSFrameNodeAppear_) {
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafely();
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto taskScheduler = pipeline->GetTaskExecutor();
|
||||
CHECK_NULL_VOID(taskScheduler);
|
||||
|
@ -362,7 +362,7 @@ bool FocusHub::RequestFocusImmediately(bool isJudgeRootTree)
|
||||
|
||||
bool FocusHub::RequestFocusImmediatelyInner(bool isJudgeRootTree)
|
||||
{
|
||||
auto context = NG::PipelineContext::GetCurrentContextSafely();
|
||||
auto context = NG::PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(context, false);
|
||||
auto focusManager = context->GetOrCreateFocusManager();
|
||||
CHECK_NULL_RETURN(focusManager, false);
|
||||
@ -787,7 +787,7 @@ bool FocusHub::OnKeyPreIme(KeyEventInfo& info, const KeyEvent& keyEvent)
|
||||
auto onKeyPreIme = GetOnKeyPreIme();
|
||||
if (onKeyPreIme) {
|
||||
bool retPreIme = onKeyPreIme(info);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
auto eventManager = pipeline->GetEventManager();
|
||||
if (eventManager) {
|
||||
eventManager->SetIsKeyConsumed(retPreIme);
|
||||
@ -1128,7 +1128,7 @@ void FocusHub::RequestFocus() const
|
||||
"Can't find Node %{public}s/%{public}d on tree, please check the timing of the function call.",
|
||||
frameNode->GetTag().c_str(), frameNode->GetId());
|
||||
}
|
||||
auto context = NG::PipelineContext::GetCurrentContextSafely();
|
||||
auto context = NG::PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
TAG_LOGI(AceLogTag::ACE_FOCUS, "Node: %{public}s/%{public}d RequestFocus.", GetFrameName().c_str(), GetFrameId());
|
||||
context->AddDirtyFocus(GetFrameNode());
|
||||
@ -1656,7 +1656,7 @@ void FocusHub::OnBlurScope()
|
||||
|
||||
bool FocusHub::PaintFocusState(bool isNeedStateStyles)
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContextSafely();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(context, false);
|
||||
auto frameNode = GetFrameNode();
|
||||
CHECK_NULL_RETURN(frameNode, false);
|
||||
@ -1835,7 +1835,7 @@ bool FocusHub::PaintAllFocusState()
|
||||
|
||||
bool FocusHub::PaintInnerFocusState(const RoundRect& paintRect, bool forceUpdate)
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContextSafely();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(context, false);
|
||||
auto frameNode = GetFrameNode();
|
||||
CHECK_NULL_RETURN(frameNode, false);
|
||||
@ -2316,7 +2316,7 @@ bool FocusHub::ScrollByOffsetToParent(const RefPtr<FrameNode>& parentFrameNode)
|
||||
TAG_LOGI(AceLogTag::ACE_FOCUS, "Scroll offset: %{public}f on %{public}s/%{public}d, axis: %{public}d",
|
||||
moveOffset, parentFrameNode->GetTag().c_str(), parentFrameNode->GetId(), scrollAxis);
|
||||
auto ret = scrollFunc(parentPattern->IsReverse() ? -moveOffset : moveOffset);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
if (pipeline) {
|
||||
pipeline->FlushUITasks();
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ float GestureEventHub::GetPixelMapScale(const int32_t height, const int32_t widt
|
||||
}
|
||||
auto frameNode = GetFrameNode();
|
||||
CHECK_NULL_RETURN(frameNode, scale);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = frameNode->GetContextRefPtr();
|
||||
CHECK_NULL_RETURN(pipeline, scale);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_RETURN(dragDropManager, scale);
|
||||
@ -427,7 +427,7 @@ void GestureEventHub::GenerateMousePixelMap(const GestureEvent& info)
|
||||
CHECK_NULL_VOID(pattern);
|
||||
auto dragNode = pattern->MoveDragNode();
|
||||
CHECK_NULL_VOID(dragNode);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
pipeline->FlushPipelineImmediately();
|
||||
context = dragNode->GetRenderContext();
|
||||
@ -475,7 +475,7 @@ void GestureEventHub::HandleOnDragStart(const GestureEvent& info)
|
||||
HandleNotallowDrag(info);
|
||||
return;
|
||||
}
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto eventManager = pipeline->GetEventManager();
|
||||
CHECK_NULL_VOID(eventManager);
|
||||
@ -932,7 +932,7 @@ void GestureEventHub::HandleOnDragUpdate(const GestureEvent& info)
|
||||
{
|
||||
gestureInfoForWeb_ = std::make_shared<GestureEvent>(info);
|
||||
CHECK_NULL_VOID(dragDropProxy_);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
if (dragDropManager->IsDragged()) {
|
||||
@ -942,7 +942,7 @@ void GestureEventHub::HandleOnDragUpdate(const GestureEvent& info)
|
||||
|
||||
void GestureEventHub::HandleOnDragEnd(const GestureEvent& info)
|
||||
{
|
||||
auto pipeline = NG::PipelineContext::GetCurrentContext();
|
||||
auto pipeline = NG::PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
const static int32_t PLATFORM_VERSION_TEN = 10;
|
||||
if (pipeline && (pipeline->GetMinPlatformVersion() < PLATFORM_VERSION_TEN)) {
|
||||
auto eventHub = eventHub_.Upgrade();
|
||||
@ -1118,7 +1118,7 @@ void GestureEventHub::SetMouseDragGatherPixelMaps()
|
||||
{
|
||||
auto frameNode = GetFrameNode();
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -1148,7 +1148,7 @@ void GestureEventHub::SetMouseDragGatherPixelMaps()
|
||||
|
||||
void GestureEventHub::SetNotMouseDragGatherPixelMaps()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragDropManager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
|
@ -192,7 +192,7 @@ void StateStyleManager::GetCustomNode(RefPtr<CustomNodeBase>& customNode,
|
||||
|
||||
void StateStyleManager::PostPressStyleTask(uint32_t delayTime)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto taskExecutor = pipeline->GetTaskExecutor();
|
||||
CHECK_NULL_VOID(taskExecutor);
|
||||
@ -216,7 +216,7 @@ void StateStyleManager::PostPressStyleTask(uint32_t delayTime)
|
||||
|
||||
void StateStyleManager::PostPressCancelStyleTask(uint32_t delayTime)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto taskExecutor = pipeline->GetTaskExecutor();
|
||||
CHECK_NULL_VOID(taskExecutor);
|
||||
|
@ -93,7 +93,7 @@ bool TouchEventActuator::TriggerTouchCallBack(const TouchEvent& point)
|
||||
|
||||
bool TouchEventActuator::ShouldResponse()
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(context, true);
|
||||
|
||||
auto eventManager = context->GetEventManager();
|
||||
|
@ -213,7 +213,7 @@ void ClickRecognizer::HandleTouchDownEvent(const TouchEvent& event)
|
||||
firstInputTime_ = event.time;
|
||||
}
|
||||
|
||||
auto pipeline = PipelineBase::GetCurrentContext();
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
if (pipeline && pipeline->IsFormRender()) {
|
||||
touchDownTime_ = event.time;
|
||||
}
|
||||
@ -305,7 +305,7 @@ void ClickRecognizer::HandleTouchUpEvent(const TouchEvent& event)
|
||||
{
|
||||
TAG_LOGI(AceLogTag::ACE_INPUTKEYFLOW, "Id:%{public}d, click %{public}d up, state: %{public}d", event.touchEventId,
|
||||
event.id, refereeState_);
|
||||
auto pipeline = PipelineBase::GetCurrentContext();
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
// In a card scenario, determine the interval between finger pressing and finger lifting. Delete this section of
|
||||
// logic when the formal scenario is complete.
|
||||
if (pipeline && pipeline->IsFormRender() && IsFormRenderClickRejected(event)) {
|
||||
@ -362,7 +362,7 @@ void ClickRecognizer::HandleTouchMoveEvent(const TouchEvent& event)
|
||||
InitGlobalValue(event.sourceType);
|
||||
// In form scenario, if move more than 20vp, reject click gesture.
|
||||
// Remove form scenario when formal solution is completed.
|
||||
auto pipeline = PipelineBase::GetCurrentContext();
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
if (pipeline && pipeline->IsFormRender()) {
|
||||
Offset offset = event.GetScreenOffset() - touchPoints_[event.id].GetScreenOffset();
|
||||
if (offset.GetDistance() > MAX_THRESHOLD) {
|
||||
@ -393,7 +393,7 @@ void ClickRecognizer::HandleOverdueDeadline()
|
||||
|
||||
void ClickRecognizer::DeadlineTimer(CancelableCallback<void()>& deadlineTimer, int32_t time)
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
|
||||
auto&& callback = [weakPtr = AceType::WeakClaim(this)]() {
|
||||
|
@ -21,7 +21,7 @@ namespace OHOS::Ace::NG {
|
||||
namespace {
|
||||
RefPtr<EventManager> GetCurrentEventManager()
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(context, nullptr);
|
||||
|
||||
return context->GetEventManager();
|
||||
@ -401,7 +401,7 @@ RefPtr<GestureSnapshot> NGGestureRecognizer::Dump() const
|
||||
|
||||
void NGGestureRecognizer::AddGestureProcedure(const std::string& procedure) const
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
auto eventMgr = context->GetEventManager();
|
||||
CHECK_NULL_VOID(eventMgr);
|
||||
@ -416,7 +416,7 @@ void NGGestureRecognizer::AddGestureProcedure(const TouchEvent& point,
|
||||
if (!recognizer) {
|
||||
return;
|
||||
}
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
auto eventMgr = context->GetEventManager();
|
||||
CHECK_NULL_VOID(eventMgr);
|
||||
|
@ -90,7 +90,7 @@ void LongPressRecognizer::OnRejected()
|
||||
|
||||
void LongPressRecognizer::ThumbnailTimer(int32_t time)
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
if (!callback_) {
|
||||
return;
|
||||
@ -172,7 +172,7 @@ void LongPressRecognizer::HandleTouchUpEvent(const TouchEvent& event)
|
||||
{
|
||||
TAG_LOGI(AceLogTag::ACE_INPUTKEYFLOW, "Id:%{public}d, LongPress %{public}d up, state: %{public}d",
|
||||
event.touchEventId, event.id, refereeState_);
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
context->RemoveGestureTask(task_);
|
||||
if (fingersId_.find(event.id) != fingersId_.end()) {
|
||||
@ -278,7 +278,7 @@ void LongPressRecognizer::HandleOverdueDeadline(bool isCatchMode)
|
||||
|
||||
void LongPressRecognizer::DeadlineTimer(int32_t time, bool isCatchMode)
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
|
||||
auto&& callback = [weakPtr = AceType::WeakClaim(this), isCatchMode]() {
|
||||
@ -313,7 +313,7 @@ void LongPressRecognizer::DoRepeat()
|
||||
|
||||
void LongPressRecognizer::StartRepeatTimer()
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
|
||||
auto&& callback = [weakPtr = AceType::WeakClaim(this)]() {
|
||||
@ -329,7 +329,7 @@ void LongPressRecognizer::StartRepeatTimer()
|
||||
|
||||
double LongPressRecognizer::ConvertPxToVp(double offset) const
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(context, offset);
|
||||
|
||||
double vpOffset = context->ConvertPxToVp(Dimension(offset, DimensionUnit::PX));
|
||||
@ -381,7 +381,7 @@ void LongPressRecognizer::OnResetStatus()
|
||||
MultiFingersRecognizer::OnResetStatus();
|
||||
timer_.Cancel();
|
||||
deadlineTimer_.Cancel();
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
context->RemoveGestureTask(task_);
|
||||
}
|
||||
|
@ -54,8 +54,6 @@ RefPtr<Gesture> PanRecognizer::CreateGestureFromRecognizer() const
|
||||
|
||||
PanRecognizer::PanRecognizer(const RefPtr<PanGestureOption>& panGestureOption) : panGestureOption_(panGestureOption)
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
CHECK_NULL_VOID(context);
|
||||
uint32_t directNum = panGestureOption->GetDirection().type;
|
||||
double distanceNumber = panGestureOption->GetDistance();
|
||||
int32_t fingersNumber = panGestureOption->GetFingers();
|
||||
@ -429,7 +427,7 @@ void PanRecognizer::HandleTouchMoveEvent(const AxisEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
bool isShiftKeyPressed = false;
|
||||
bool hasDifferentDirectionGesture = false;
|
||||
if (pipeline) {
|
||||
|
@ -72,7 +72,7 @@ void PinchRecognizer::OnRejected()
|
||||
|
||||
bool PinchRecognizer::IsCtrlBeingPressed()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, false);
|
||||
return pipeline->IsKeyInPressed(KeyCode::KEY_CTRL_LEFT) || pipeline->IsKeyInPressed(KeyCode::KEY_CTRL_RIGHT);
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ void SequencedRecognizer::OnResetStatus()
|
||||
|
||||
void SequencedRecognizer::DeadlineTimer()
|
||||
{
|
||||
auto context = PipelineContext::GetCurrentContext();
|
||||
auto context = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(context);
|
||||
|
||||
auto callback = [weakPtr = AceType::WeakClaim(this)]() {
|
||||
|
@ -275,7 +275,7 @@ void SwipeRecognizer::HandleTouchMoveEvent(const AxisEvent& event)
|
||||
time_ = event.time;
|
||||
lastAxisEvent_ = event;
|
||||
UpdateTouchPointWithAxisEvent(event);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
bool isShiftKeyPressed = false;
|
||||
bool hasDifferentDirectionGesture = false;
|
||||
if (pipeline) {
|
||||
|
@ -421,7 +421,7 @@ void DragDropFuncWrapper::ParseShadowInfo(Shadow& shadow, std::unique_ptr<JsonVa
|
||||
|
||||
std::optional<Shadow> DragDropFuncWrapper::GetDefaultShadow()
|
||||
{
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipelineContext, std::nullopt);
|
||||
auto shadowTheme = pipelineContext->GetTheme<ShadowTheme>();
|
||||
CHECK_NULL_RETURN(shadowTheme, std::nullopt);
|
||||
@ -446,7 +446,7 @@ float DragDropFuncWrapper::RadiusToSigma(float radius)
|
||||
std::optional<EffectOption> DragDropFuncWrapper::BrulStyleToEffection(
|
||||
const std::optional<BlurStyleOption>& blurStyleOp)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, std::nullopt);
|
||||
auto blurStyleTheme = pipeline->GetTheme<BlurStyleTheme>();
|
||||
if (!blurStyleTheme) {
|
||||
|
@ -182,7 +182,7 @@ int32_t DragDropManager::GetWindowId()
|
||||
|
||||
RefPtr<FrameNode> DragDropManager::CreateDragRootNode(const RefPtr<UINode>& customNode)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, nullptr);
|
||||
|
||||
auto rootNode = FrameNode::CreateFrameNodeWithTree(
|
||||
@ -245,7 +245,7 @@ void DragDropManager::UpdateItemDragPosition(int32_t globalX, int32_t globalY)
|
||||
|
||||
void DragDropManager::HideDragPreviewOverlay()
|
||||
{
|
||||
auto pipeline = NG::PipelineContext::GetCurrentContext();
|
||||
auto pipeline = NG::PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -367,7 +367,7 @@ RefPtr<FrameNode> DragDropManager::FindDragFrameNodeByPosition(float globalX, fl
|
||||
{
|
||||
auto rootNode = node;
|
||||
if (!rootNode) {
|
||||
auto pipeline = NG::PipelineContext::GetCurrentContext();
|
||||
auto pipeline = NG::PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, nullptr);
|
||||
rootNode = pipeline->GetRootElement();
|
||||
}
|
||||
@ -1063,7 +1063,7 @@ void DragDropManager::OnDragDrop(RefPtr<OHOS::Ace::DragEvent>& event, const RefP
|
||||
eventHub->HandleInternalOnDrop(event, extraParams);
|
||||
ClearVelocityInfo();
|
||||
SetIsDragged(false);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto dragResult = event->GetResult();
|
||||
if (dragResult == DragRet::DRAG_FAIL) {
|
||||
@ -1220,8 +1220,6 @@ void DragDropManager::FireOnDragEvent(
|
||||
}
|
||||
auto eventHub = frameNode->GetEventHub<EventHub>();
|
||||
CHECK_NULL_VOID(eventHub);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
if (!eventHub->HasOnDrop() && !eventHub->HasOnItemDrop() && !eventHub->HasCustomerOnDrop()) {
|
||||
return;
|
||||
}
|
||||
@ -1449,7 +1447,7 @@ int32_t DragDropManager::GetItemIndex(
|
||||
|
||||
void DragDropManager::AddDataToClipboard(const std::string& extraInfo)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
if (!extraInfo.empty()) {
|
||||
if (!newData_) {
|
||||
@ -1483,7 +1481,7 @@ void DragDropManager::AddDataToClipboard(const std::string& extraInfo)
|
||||
|
||||
void DragDropManager::GetExtraInfoFromClipboard(std::string& extraInfo)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
|
||||
if (!clipboard_) {
|
||||
@ -1510,7 +1508,7 @@ void DragDropManager::GetExtraInfoFromClipboard(std::string& extraInfo)
|
||||
|
||||
void DragDropManager::RestoreClipboardData()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
|
||||
if (!clipboard_) {
|
||||
@ -2181,7 +2179,7 @@ bool DragDropManager::IsUIExtensionShowPlaceholder(const RefPtr<NG::UINode>& nod
|
||||
{
|
||||
#ifdef WINDOW_SCENE_SUPPORTED
|
||||
CHECK_NULL_RETURN(node, true);
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, true);
|
||||
auto manager = pipeline->GetUIExtensionManager();
|
||||
CHECK_NULL_RETURN(manager, true);
|
||||
@ -2227,7 +2225,7 @@ void DragDropManager::HandleUIExtensionDragEvent(
|
||||
|
||||
RectF DragDropManager::GetMenuPreviewRect()
|
||||
{
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipelineContext, RectF());
|
||||
auto dragDropManager = pipelineContext->GetDragDropManager();
|
||||
CHECK_NULL_RETURN(dragDropManager, RectF());
|
||||
|
@ -21,7 +21,7 @@ namespace OHOS::Ace::NG {
|
||||
|
||||
void DragDropProxy::OnTextDragStart(const std::string& extraInfo)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -31,7 +31,7 @@ void DragDropProxy::OnTextDragStart(const std::string& extraInfo)
|
||||
void DragDropProxy::OnDragStart(
|
||||
const GestureEvent& info, const std::string& extraInfo, const RefPtr<FrameNode>& frameNode)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -48,7 +48,7 @@ void DragDropProxy::OnDragStart(
|
||||
|
||||
void DragDropProxy::OnDragMove(const GestureEvent& info)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -61,7 +61,7 @@ void DragDropProxy::OnDragMove(const GestureEvent& info)
|
||||
|
||||
void DragDropProxy::OnDragEnd(const GestureEvent& info, bool isTextDragEnd)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -78,7 +78,7 @@ void DragDropProxy::OnDragEnd(const GestureEvent& info, bool isTextDragEnd)
|
||||
|
||||
void DragDropProxy::onDragCancel()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -88,7 +88,7 @@ void DragDropProxy::onDragCancel()
|
||||
|
||||
void DragDropProxy::OnItemDragStart(const GestureEvent& info, const RefPtr<FrameNode>& frameNode)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -100,7 +100,7 @@ void DragDropProxy::OnItemDragStart(const GestureEvent& info, const RefPtr<Frame
|
||||
|
||||
void DragDropProxy::OnItemDragMove(const GestureEvent& info, int32_t draggedIndex, DragType dragType)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -112,7 +112,7 @@ void DragDropProxy::OnItemDragMove(const GestureEvent& info, int32_t draggedInde
|
||||
|
||||
void DragDropProxy::OnItemDragEnd(const GestureEvent& info, int32_t draggedIndex, DragType dragType)
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -124,7 +124,7 @@ void DragDropProxy::OnItemDragEnd(const GestureEvent& info, int32_t draggedIndex
|
||||
|
||||
void DragDropProxy::onItemDragCancel()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -135,7 +135,7 @@ void DragDropProxy::onItemDragCancel()
|
||||
|
||||
void DragDropProxy::DestroyDragWindow()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
|
@ -145,7 +145,7 @@ void DragAnimationHelper::PlayGatherAnimationBeforeLifting(const RefPtr<DragEven
|
||||
if (!actuator->IsNeedGather()) {
|
||||
return;
|
||||
}
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetOverlayManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
@ -262,7 +262,7 @@ void DragAnimationHelper::PlayGatherAnimation(const RefPtr<FrameNode>& frameNode
|
||||
|
||||
void DragAnimationHelper::ShowBadgeAnimation(const RefPtr<FrameNode>& textNode)
|
||||
{
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto dragDropManager = pipelineContext->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -316,7 +316,7 @@ void DragAnimationHelper::CalcBadgeTextPosition(const RefPtr<MenuPattern>& menuP
|
||||
CHECK_NULL_VOID(manager);
|
||||
CHECK_NULL_VOID(textNode);
|
||||
CHECK_NULL_VOID(menuPattern);
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto dragDropManager = pipelineContext->GetDragDropManager();
|
||||
CHECK_NULL_VOID(dragDropManager);
|
||||
@ -331,9 +331,7 @@ void DragAnimationHelper::CalcBadgeTextPosition(const RefPtr<MenuPattern>& menuP
|
||||
UpdateBadgeLayoutAndRenderContext(textNode, badgeLength, childSize);
|
||||
auto textRenderContext = textNode->GetRenderContext();
|
||||
CHECK_NULL_VOID(textRenderContext);
|
||||
auto pipeline = PipelineBase::GetCurrentContext();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto offset = CalcBadgeTextOffset(menuPattern, imageNode, pipeline, badgeLength);
|
||||
auto offset = CalcBadgeTextOffset(menuPattern, imageNode, pipelineContext, badgeLength);
|
||||
textRenderContext->UpdatePosition(OffsetT<Dimension>(Dimension(offset.GetX()), Dimension(offset.GetY())));
|
||||
textNode->MarkDirtyNode(NG::PROPERTY_UPDATE_MEASURE);
|
||||
textNode->MarkModifyDone();
|
||||
@ -343,7 +341,7 @@ void DragAnimationHelper::CalcBadgeTextPosition(const RefPtr<MenuPattern>& menuP
|
||||
if (context) {
|
||||
context->FlushUITaskWithSingleDirtyNode(textNode);
|
||||
}
|
||||
pipeline->FlushSyncGeometryNodeTasks();
|
||||
pipelineContext->FlushSyncGeometryNodeTasks();
|
||||
}
|
||||
|
||||
void DragAnimationHelper::UpdateBadgeLayoutAndRenderContext(
|
||||
|
@ -67,7 +67,7 @@ bool PostEventManager::PostDownEvent(const RefPtr<NG::UINode>& targetNode, const
|
||||
return false;
|
||||
}
|
||||
}
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipelineContext, false);
|
||||
auto eventManager = pipelineContext->GetEventManager();
|
||||
CHECK_NULL_RETURN(eventManager, false);
|
||||
@ -123,7 +123,7 @@ void PostEventManager::HandlePostEvent(const RefPtr<NG::UINode>& targetNode, con
|
||||
postEventAction.touchEvent = touchEvent;
|
||||
lastEventMap_[touchEvent.id] = postEventAction;
|
||||
postEventAction_.push_back(postEventAction);
|
||||
auto pipelineContext = PipelineContext::GetCurrentContext();
|
||||
auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto eventManager = pipelineContext->GetEventManager();
|
||||
if (touchEvent.type != TouchType::DOWN && touchEvent.type != TouchType::MOVE) {
|
||||
|
@ -31,7 +31,7 @@ namespace OHOS::Ace::NG {
|
||||
namespace {
|
||||
RefPtr<AppBarTheme> GetAppBarTheme()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_RETURN(pipeline, nullptr);
|
||||
return pipeline->GetTheme<AppBarTheme>();
|
||||
}
|
||||
@ -291,7 +291,7 @@ void AppBarView::CreateServicePanel(bool firstTry)
|
||||
return;
|
||||
}
|
||||
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto overlayManager = pipeline->GetOverlayManager();
|
||||
CHECK_NULL_VOID(overlayManager);
|
||||
@ -340,7 +340,7 @@ void AppBarView::InitUIExtensionNode(const RefPtr<FrameNode>& uiExtNode)
|
||||
|
||||
std::optional<RectF> AppBarView::GetAppBarRect()
|
||||
{
|
||||
auto pipeline = PipelineContext::GetCurrentContext();
|
||||
auto pipeline = PipelineContext::GetCurrentContextSafelyWithCheck();
|
||||
if (!pipeline || !pipeline->GetInstallationFree()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ double ConvertVirtualSize(const std::string& val, const DimensionUnit& unit, dou
|
||||
ret = ret / FULL_PERCENT * size;
|
||||
break;
|
||||
case DimensionUnit::VP: {
|
||||
auto pipelineContext = PipelineBase::GetCurrentContext();
|
||||
auto pipelineContext = PipelineBase::GetCurrentContextSafelyWithCheck();
|
||||
if (pipelineContext) {
|
||||
ret = pipelineContext->NormalizeToPx(Dimension(ret, DimensionUnit::VP));
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user