mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
unify all test suites
Signed-off-by: liyujie <liyujie43@huawei.com> Change-Id: I68c5230bba5712470780a561270de48cc063c3e2
This commit is contained in:
parent
0e46d807e3
commit
ea54649eb2
@ -41,12 +41,12 @@ frameworks/bridge/declarative_frontend/state_mgmt/ @guido_grassel @s10021109
|
||||
frameworks/bridge/engine/stateMgmt.js @guido_grassel @s10021109
|
||||
|
||||
[JS Frontend Core]
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view.h @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view.cpp @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view_functions.h @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view_functions.cpp @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/view_stack_processor.cpp @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/view_stack_processor.h @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view.h @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view.cpp @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view_functions.h @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/jsview/js_view_functions.cpp @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/view_stack_processor.cpp @yan-shuifeng @guido_grassel
|
||||
frameworks/bridge/declarative_frontend/view_stack_processor.h @yan-shuifeng @guido_grassel
|
||||
|
||||
[UI Components]
|
||||
frameworks/core/components_ng/pattern/ability_component/ @lushi1202
|
||||
@ -323,105 +323,5 @@ frameworks/core/components_ng/components_plugin.gni @sunfei2021
|
||||
frameworks/core/components_ng/components.gni @sunfei2021
|
||||
|
||||
[Test source]
|
||||
frameworks/bridge/test/ @liyujie43
|
||||
test/mock/ @liyujie43
|
||||
test/unittest/ @liyujie43
|
||||
frameworks/core/components_ng/test/pattern/ability_component/ @lushi1202
|
||||
frameworks/core/components_ng/test/pattern/action_sheet/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/animator/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/app_bar/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/badge/ @Hu_ZeQi
|
||||
frameworks/core/components_ng/test/pattern/blank/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/bubble/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/button/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/calendar/ @techbuilding
|
||||
frameworks/core/components_ng/test/pattern/canvas_context/ @keerecles
|
||||
frameworks/core/components_ng/test/pattern/canvas_renderer/ @keerecles
|
||||
frameworks/core/components_ng/test/pattern/checkbox/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/checkboxgroup/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/common_view/ @yangfan229
|
||||
frameworks/core/components_ng/test/pattern/container_modal/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/counter/ @aryawang
|
||||
frameworks/core/components_ng/test/pattern/custom/ @yan-shuifeng
|
||||
frameworks/core/components_ng/test/pattern/custom_paint/ @keerecles
|
||||
frameworks/core/components_ng/test/pattern/data_panel/ @Hu_ZeQi
|
||||
frameworks/core/components_ng/test/pattern/dialog/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/divider/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/effect_component/ @liuchao92
|
||||
frameworks/core/components_ng/test/pattern/flex/ @yangfan229
|
||||
frameworks/core/components_ng/test/pattern/form/ @wangchensu1
|
||||
frameworks/core/components_ng/test/pattern/gauge/ @Hu_ZeQi
|
||||
frameworks/core/components_ng/test/pattern/gesture/ @zheng-qiyi
|
||||
frameworks/core/components_ng/test/pattern/grid/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/grid_col/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/grid_container/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/grid_row/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/hyperlink/ @jinweiliu
|
||||
frameworks/core/components_ng/test/pattern/image/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/image_animator/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/indexer/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/linear_layout/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/linear_split/ @xiexiyun
|
||||
frameworks/core/components_ng/test/pattern/list/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/loading_progress/ @Zhang-Dong-hui
|
||||
frameworks/core/components_ng/test/pattern/marquee/ @aryawang
|
||||
frameworks/core/components_ng/test/pattern/menu/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/model/ @
|
||||
frameworks/core/components_ng/test/pattern/navigation/ @tsj_2020
|
||||
frameworks/core/components_ng/test/pattern/navigator/ @tsj_2020
|
||||
frameworks/core/components_ng/test/pattern/navrouter/ @tsj_2020
|
||||
frameworks/core/components_ng/test/pattern/option/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/overlay/ @yangfan229
|
||||
frameworks/core/components_ng/test/pattern/panel/ @zhou-chaobo
|
||||
frameworks/core/components_ng/test/pattern/patternlock/ @Zhang-Dong-hui
|
||||
frameworks/core/components_ng/test/pattern/picker/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/plugin/ @wangchensu1
|
||||
frameworks/core/components_ng/test/pattern/preview_mock/ @laigerendaqiu
|
||||
frameworks/core/components_ng/test/pattern/progress/ @Zhang-Dong-hui
|
||||
frameworks/core/components_ng/test/pattern/qrcode/ @Zhang-Dong-hui
|
||||
frameworks/core/components_ng/test/pattern/radio/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/rating/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/recycle_view/ @guozejun
|
||||
frameworks/core/components_ng/test/pattern/refresh/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/relative_container/ @nickyjd
|
||||
frameworks/core/components_ng/test/pattern/remote_window/ @liuchao92
|
||||
frameworks/core/components_ng/test/pattern/rendering_context/ @keerecles
|
||||
frameworks/core/components_ng/test/pattern/rich_editor/ @wu-yinxiao
|
||||
frameworks/core/components_ng/test/pattern/root/ @yan-shuifeng
|
||||
frameworks/core/components_ng/test/pattern/scroll/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/scroll_bar/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/scrollable/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/search/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/security_component/ @
|
||||
frameworks/core/components_ng/test/pattern/select/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/select_overlay/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/shape/ @sunbees
|
||||
frameworks/core/components_ng/test/pattern/side_bar/ @tsj_2020
|
||||
frameworks/core/components_ng/test/pattern/slider/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/stack/ @nickyjd
|
||||
frameworks/core/components_ng/test/pattern/stage/ @yan-shuifeng
|
||||
frameworks/core/components_ng/test/pattern/stepper/ @tsj_2020
|
||||
frameworks/core/components_ng/test/pattern/swiper/ @xuzhidan
|
||||
frameworks/core/components_ng/test/pattern/swiper_indicator/ @xuzhidan
|
||||
frameworks/core/components_ng/test/pattern/tabs/ @xuzhidan
|
||||
frameworks/core/components_ng/test/pattern/text/ @lijuan124
|
||||
frameworks/core/components_ng/test/pattern/text_clock/ @aryawang
|
||||
frameworks/core/components_ng/test/pattern/text_drag/ @zhaojian2021
|
||||
frameworks/core/components_ng/test/pattern/text_field/ @jyj_0306 @lijuan124
|
||||
frameworks/core/components_ng/test/pattern/text_picker/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/texttimer/ @aryawang
|
||||
frameworks/core/components_ng/test/pattern/time_picker/ @cheng-feiwang
|
||||
frameworks/core/components_ng/test/pattern/toast/ @
|
||||
frameworks/core/components_ng/test/pattern/toggle/ @luoying_ace_admin
|
||||
frameworks/core/components_ng/test/pattern/ui_extension/ @lushi1202
|
||||
frameworks/core/components_ng/test/pattern/video/ @jinweiliu
|
||||
frameworks/core/components_ng/test/pattern/view_context/ @hehongyang9
|
||||
frameworks/core/components_ng/test/pattern/waterflow/ @suiwuyue
|
||||
frameworks/core/components_ng/test/pattern/web/ @LongLie
|
||||
frameworks/core/components_ng/test/pattern/window_scene/ @liuchao92
|
||||
frameworks/core/components_ng/test/pattern/xcomponent/ @sunbees
|
||||
frameworks/core/components_ng/test/event/ @zhaojian2021 @catpoison
|
||||
frameworks/core/components_ng/test/syntax/ @yan-shuifeng @lightningHo
|
||||
frameworks/core/components_ng/test/svg/ @xiexiyun
|
||||
frameworks/core/components_ng/test/image_provider/ @xiexiyun
|
||||
frameworks/core/components_ng/test/animation/ @suiwuyue
|
||||
test/unittest/ @liyujie43
|
@ -212,8 +212,8 @@ bool SystemProperties::svgTraceEnable_ = IsSvgTraceEnabled();
|
||||
bool SystemProperties::accessibilityEnabled_ = IsAccessibilityEnabled();
|
||||
bool SystemProperties::isRound_ = false;
|
||||
bool SystemProperties::isDeviceAccess_ = false;
|
||||
int32_t SystemProperties::deviceWidth_ = 0;
|
||||
int32_t SystemProperties::deviceHeight_ = 0;
|
||||
ACE_WEAK_SYM int32_t SystemProperties::deviceWidth_ = 0;
|
||||
ACE_WEAK_SYM int32_t SystemProperties::deviceHeight_ = 0;
|
||||
int32_t SystemProperties::devicePhysicalWidth_ = 0;
|
||||
int32_t SystemProperties::devicePhysicalHeight_ = 0;
|
||||
ACE_WEAK_SYM double SystemProperties::resolution_ = 1.0;
|
||||
@ -237,7 +237,7 @@ ACE_WEAK_SYM bool SystemProperties::isHookModeEnabled_ = IsHookModeEnabled();
|
||||
bool SystemProperties::debugBoundaryEnabled_ = IsDebugBoundaryEnabled();
|
||||
bool SystemProperties::downloadByNetworkEnabled_ = IsDownloadByNetworkDisabled();
|
||||
ACE_WEAK_SYM bool SystemProperties::windowAnimationEnabled_ = IsWindowAnimationEnabled();
|
||||
bool SystemProperties::debugEnabled_ = IsDebugEnabled();
|
||||
ACE_WEAK_SYM bool SystemProperties::debugEnabled_ = IsDebugEnabled();
|
||||
bool SystemProperties::gpuUploadEnabled_ = IsGpuUploadEnabled();
|
||||
bool SystemProperties::astcEnabled_ = GetAstcEnabled();
|
||||
int32_t SystemProperties::astcMax_ = GetAstcMaxErrorProp();
|
||||
@ -374,7 +374,7 @@ void SystemProperties::InitDeviceInfo(
|
||||
InitDeviceTypeBySystemProperty();
|
||||
}
|
||||
|
||||
void SystemProperties::SetDeviceOrientation(int32_t orientation)
|
||||
ACE_WEAK_SYM void SystemProperties::SetDeviceOrientation(int32_t orientation)
|
||||
{
|
||||
if (orientation == ORIENTATION_PORTRAIT && orientation_ != DeviceOrientation::PORTRAIT) {
|
||||
Swap(deviceWidth_, deviceHeight_);
|
||||
|
@ -91,19 +91,19 @@ foreach(item, ace_platforms) {
|
||||
part_name = ace_engine_part
|
||||
testonly = true
|
||||
sources = [
|
||||
"$ace_root/frameworks/base/test/mock/mock_download_manager.cpp",
|
||||
"$ace_root/frameworks/base/test/mock/mock_drag_window_old.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/subwindow_mock.cpp",
|
||||
"$ace_root/test/mock/adapter/mock_ace_container.cpp",
|
||||
"$ace_root/test/mock/base/mock_download_manager.cpp",
|
||||
"$ace_root/test/mock/base/mock_drag_window.cpp",
|
||||
"$ace_root/test/mock/base/mock_subwindow.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp",
|
||||
]
|
||||
|
||||
if (is_ohos_standard_system) {
|
||||
sources -= [
|
||||
"$ace_root/frameworks/base/test/mock/mock_download_manager.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/test/mock/base/mock_download_manager.cpp",
|
||||
]
|
||||
}
|
||||
|
||||
@ -119,6 +119,7 @@ foreach(item, ace_platforms) {
|
||||
"$ace_root/frameworks/bridge:framework_bridge_ohos",
|
||||
"$ace_root/frameworks/core:ace_core_ohos",
|
||||
"$ace_root/frameworks/core/components/theme:build_theme_code",
|
||||
"//third_party/googletest:gmock_main",
|
||||
"//third_party/googletest:gtest_main",
|
||||
]
|
||||
|
||||
|
@ -177,7 +177,6 @@
|
||||
],
|
||||
"test": [
|
||||
"//foundation/arkui/ace_engine/test/unittest:unittest",
|
||||
"//foundation/arkui/ace_engine/frameworks/core/components_ng/test:unittest",
|
||||
"//foundation/arkui/ace_engine/test/fuzztest:fuzztest"
|
||||
]
|
||||
}
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "base/utils/macros.h"
|
||||
|
||||
namespace OHOS {
|
||||
class MockAceContainer {
|
||||
public:
|
||||
MockAceContainer() = default;
|
||||
virtual ~MockAceContainer() = default;
|
||||
};
|
||||
|
||||
namespace AbilityRuntime {
|
||||
class Context {
|
||||
public:
|
||||
Context() = default;
|
||||
~Context() = default;
|
||||
};
|
||||
} // namespace AbilityRuntime
|
||||
|
||||
namespace Ace::Platform {
|
||||
class ACE_FORCE_EXPORT AceContainer : public MockAceContainer {
|
||||
public:
|
||||
AceContainer() = default;
|
||||
~AceContainer() = default;
|
||||
std::shared_ptr<AbilityRuntime::Context> GetAbilityContextByModule(
|
||||
const std::string& bundle, const std::string& module);
|
||||
};
|
||||
|
||||
std::shared_ptr<AbilityRuntime::Context> AceContainer::GetAbilityContextByModule(
|
||||
const std::string& bundle, const std::string& module)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace Ace::Platform
|
||||
} // namespace OHOS
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "base/geometry/animatable_dimension.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
AnimatableDimension& AnimatableDimension::operator=(const Dimension& newDimension)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
AnimatableDimension& AnimatableDimension::operator=(const CalcDimension& newDimension)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
AnimatableDimension& AnimatableDimension::operator=(const AnimatableDimension& newDimension)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
void AnimatableDimension::AnimateTo(double endValue) {}
|
||||
|
||||
void AnimatableDimension::ResetController() {}
|
||||
|
||||
void AnimatableDimension::OnAnimationCallback(double value) {}
|
||||
|
||||
void AnimatableDimension::MoveTo(double target) {}
|
||||
|
||||
void AnimatableDimension::ResetAnimatableDimension() {}
|
||||
} // namespace OHOS::Ace
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_ASSET_MANAGER_H
|
||||
#define FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_ASSET_MANAGER_H
|
||||
|
||||
#include "base/resource/asset_manager.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
class MockAsset final : public Asset {
|
||||
public:
|
||||
~MockAsset() override = default;
|
||||
|
||||
size_t GetSize() const override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const uint8_t* GetData() const override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class MockAssetManager final : public AssetManager {
|
||||
public:
|
||||
~MockAssetManager() override = default;
|
||||
|
||||
void PushFront(RefPtr<AssetProvider> provider) override {}
|
||||
|
||||
void PushBack(RefPtr<AssetProvider> provider) override {}
|
||||
|
||||
RefPtr<Asset> GetAsset(const std::string& assetName) override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string GetAssetPath(const std::string& /* assetName */, bool /* isAddHapPath */) override
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void SetLibPath(const std::string& appLibPathKey, const std::vector<std::string>& packagePath) override {}
|
||||
|
||||
std::string GetAppLibPathKey() const override
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<std::string> GetLibPath() const override
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void GetAssetList(const std::string& path, std::vector<std::string>& assetList) const override {}
|
||||
|
||||
bool GetFileInfo(const std::string& /* fileName */, MediaFileInfo& /* fileInfo */) const override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
} // namespace OHOS::Ace
|
||||
#endif // FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_ASSET_MANAGER_H
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "base/window/drag_window.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
RefPtr<DragWindow> DragWindow::CreateDragWindow(const std::string& windowName, int32_t x, int32_t y, uint32_t width,
|
||||
uint32_t height)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DragWindow> DragWindow::CreateTextDragWindow(
|
||||
const std::string& windowName, int32_t x, int32_t y, uint32_t width, uint32_t height)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DragWindow::MoveTo(int32_t x, int32_t y) const {}
|
||||
|
||||
void DragWindow::Destroy() const {}
|
||||
|
||||
void DragWindow::DrawPixelMap(const RefPtr<PixelMap>& pixelmap) {}
|
||||
} // namespace OHOS::Ace
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_PIXEL_MAP_H
|
||||
#define FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_PIXEL_MAP_H
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
#include "base/image/pixel_map.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
class MockPixelMap : public PixelMap {
|
||||
DECLARE_ACE_TYPE(MockPixelMap, PixelMap);
|
||||
|
||||
public:
|
||||
MockPixelMap() = default;
|
||||
~MockPixelMap() override = default;
|
||||
|
||||
int32_t GetWidth() const override;
|
||||
int32_t GetHeight() const override;
|
||||
MOCK_CONST_METHOD0(GetPixels, const uint8_t*());
|
||||
MOCK_CONST_METHOD0(GetPixelFormat, PixelFormat());
|
||||
MOCK_CONST_METHOD0(GetAlphaType, AlphaType());
|
||||
MOCK_CONST_METHOD0(GetRowBytes, int32_t());
|
||||
MOCK_CONST_METHOD0(GetByteCount, int32_t());
|
||||
MOCK_CONST_METHOD0(GetPixelManager, void*());
|
||||
MOCK_CONST_METHOD0(GetRawPixelMapPtr, void*());
|
||||
MOCK_CONST_METHOD0(GetWritablePixels, void*());
|
||||
MOCK_METHOD0(GetId, std::string());
|
||||
MOCK_METHOD0(GetModifyId, std::string());
|
||||
MOCK_METHOD0(GetPixelMapSharedPtr, std::shared_ptr<Media::PixelMap>());
|
||||
};
|
||||
} // namespace OHOS::Ace
|
||||
#endif // FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_PIXEL_MAP_H
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_TASK_EXECUTOR_H
|
||||
#define FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_TASK_EXECUTOR_H
|
||||
|
||||
#include "base/thread/background_task_executor.h"
|
||||
#include "base/thread/task_executor.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
class MockTaskExecutor final : public TaskExecutor {
|
||||
public:
|
||||
bool WillRunOnCurrentThread(TaskType type) const final
|
||||
{
|
||||
switch (type) {
|
||||
case TaskType::PLATFORM:
|
||||
case TaskType::UI:
|
||||
case TaskType::IO:
|
||||
case TaskType::GPU:
|
||||
case TaskType::JS:
|
||||
return false;
|
||||
case TaskType::BACKGROUND:
|
||||
// Always return false for background tasks.
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void AddTaskObserver(Task&& callback) {}
|
||||
void RemoveTaskObserver() {}
|
||||
Task WrapTaskWithTraceId(Task&& task, int32_t id) const final
|
||||
{
|
||||
return std::move(task);
|
||||
}
|
||||
|
||||
private:
|
||||
bool OnPostTask(Task&& task, TaskType type, uint32_t delayTime, const std::string& callerInfo) const final
|
||||
{
|
||||
switch (type) {
|
||||
case TaskType::PLATFORM:
|
||||
case TaskType::UI:
|
||||
case TaskType::IO:
|
||||
case TaskType::GPU:
|
||||
case TaskType::JS:
|
||||
return false;
|
||||
case TaskType::BACKGROUND:
|
||||
// Ignore delay time
|
||||
return BackgroundTaskExecutor::GetInstance().PostTask(std::move(task));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace OHOS::Ace
|
||||
#endif // FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_TASK_EXECUTOR_H
|
@ -22,7 +22,7 @@
|
||||
#include "bridge/card_frontend/card_frontend_declarative.h"
|
||||
#undef private
|
||||
#undef protected
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "bridge/common/utils/utils.h"
|
||||
|
||||
using namespace testing;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "bridge/card_frontend/js_card_parser.h"
|
||||
#undef private
|
||||
#undef protected
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "bridge/common/utils/utils.h"
|
||||
|
||||
using namespace testing;
|
||||
|
@ -20,9 +20,9 @@
|
||||
#include "bridge/common/manifest/manifest_parser.h"
|
||||
#include "core/common/ace_engine.h"
|
||||
#include "core/components/test/mock/mock_resource_adapter.h"
|
||||
#include "core/components_ng/test/mock/theme/mock_theme_manager.h"
|
||||
#include "core/pipeline_ng/test/mock/mock_interface.h"
|
||||
#include "core/pipeline_ng/test/mock/mock_pipeline_base.h"
|
||||
#include "test/mock/core/common/mock_theme_manager.h"
|
||||
#include "test/mock/core/pipeline/mock_interface.h"
|
||||
#include "test/mock/core/pipeline/mock_pipeline_base.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
|
@ -20,7 +20,7 @@ ohos_unittest("AnimationTest") {
|
||||
module_out_path = module_output_path
|
||||
|
||||
sources = [
|
||||
"$ace_root/frameworks/core/animation/test/mock/mock_animation.cpp",
|
||||
"$ace_root/test/mock/core/animation/mock_animation.cpp",
|
||||
"animation_framework_test.cpp",
|
||||
|
||||
# accessibility
|
||||
@ -54,7 +54,6 @@ ohos_unittest("AnimationTest") {
|
||||
"$ace_root/frameworks/core/common/font_loader.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
@ -66,6 +65,7 @@ ohos_unittest("AnimationTest") {
|
||||
"$ace_root/frameworks/core/gestures/raw_recognizer.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/composed_component.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/root/root_component.cpp",
|
||||
@ -143,7 +143,6 @@ ohos_unittest("AnimationTest") {
|
||||
"$ace_root/frameworks/core/components/focus_animation/render_focus_animation.cpp",
|
||||
|
||||
# rendering
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/bubble/render_bubble.cpp",
|
||||
"$ace_root/frameworks/core/components/clip/render_clip.cpp",
|
||||
"$ace_root/frameworks/core/components/dialog_modal/render_dialog_modal.cpp",
|
||||
@ -170,6 +169,7 @@ ohos_unittest("AnimationTest") {
|
||||
"$ace_root/frameworks/core/components/transform/click_spring_effect.cpp",
|
||||
"$ace_root/frameworks/core/components/transform/render_transform.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
|
||||
# mock
|
||||
@ -182,12 +182,12 @@ ohos_unittest("AnimationTest") {
|
||||
"$ace_root/frameworks/base/json/json_util.cpp",
|
||||
"$ace_root/frameworks/base/log/dump_log.cpp",
|
||||
"$ace_root/frameworks/base/memory/memory_monitor.cpp",
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/base/thread/background_task_executor.cpp",
|
||||
"$ace_root/frameworks/base/utils/base_id.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/friction_motion.h"
|
||||
#include "core/animation/scroll_motion.h"
|
||||
|
@ -20,7 +20,7 @@ ohos_unittest("SpringChainTest") {
|
||||
module_out_path = module_output_path
|
||||
|
||||
sources = [
|
||||
"$ace_root/frameworks/core/animation/test/mock/mock_animation.cpp",
|
||||
"$ace_root/test/mock/core/animation/mock_animation.cpp",
|
||||
"spring_chain_test.cpp",
|
||||
|
||||
# accessibility
|
||||
@ -57,7 +57,6 @@ ohos_unittest("SpringChainTest") {
|
||||
"$ace_root/frameworks/core/common/font_loader.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
@ -70,6 +69,7 @@ ohos_unittest("SpringChainTest") {
|
||||
"$ace_root/frameworks/core/pipeline/base/component_group_element.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/composed_component.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/root/root_component.cpp",
|
||||
@ -146,7 +146,6 @@ ohos_unittest("SpringChainTest") {
|
||||
"$ace_root/frameworks/core/components/focus_animation/render_focus_animation.cpp",
|
||||
|
||||
# rendering
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/bubble/render_bubble.cpp",
|
||||
"$ace_root/frameworks/core/components/clip/render_clip.cpp",
|
||||
"$ace_root/frameworks/core/components/dialog_modal/render_dialog_modal.cpp",
|
||||
@ -173,6 +172,7 @@ ohos_unittest("SpringChainTest") {
|
||||
"$ace_root/frameworks/core/components/transform/click_spring_effect.cpp",
|
||||
"$ace_root/frameworks/core/components/transform/render_transform.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
|
||||
#mock
|
||||
@ -185,12 +185,12 @@ ohos_unittest("SpringChainTest") {
|
||||
"$ace_root/frameworks/base/json/json_util.cpp",
|
||||
"$ace_root/frameworks/base/log/dump_log.cpp",
|
||||
"$ace_root/frameworks/base/memory/memory_monitor.cpp",
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/base/thread/background_task_executor.cpp",
|
||||
"$ace_root/frameworks/base/utils/base_id.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "core/animation/test/mock/mock_spring_chain.h"
|
||||
#include "core/components/test/json/json_frontend.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/pipeline/pipeline_context.h"
|
||||
|
||||
|
@ -20,7 +20,7 @@ ohos_unittest("SvgAnimateTest") {
|
||||
module_out_path = module_output_path
|
||||
|
||||
sources = [
|
||||
"$ace_root/frameworks/core/animation/test/mock/mock_animation.cpp",
|
||||
"$ace_root/test/mock/core/animation/mock_animation.cpp",
|
||||
"svg_animate_test.cpp",
|
||||
|
||||
# accessibility
|
||||
@ -56,7 +56,6 @@ ohos_unittest("SvgAnimateTest") {
|
||||
"$ace_root/frameworks/core/common/font_loader.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
@ -68,6 +67,7 @@ ohos_unittest("SvgAnimateTest") {
|
||||
"$ace_root/frameworks/core/gestures/raw_recognizer.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/composed_component.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/root/root_component.cpp",
|
||||
@ -145,7 +145,6 @@ ohos_unittest("SvgAnimateTest") {
|
||||
"$ace_root/frameworks/core/components/focus_animation/render_focus_animation.cpp",
|
||||
|
||||
# rendering
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/bubble/render_bubble.cpp",
|
||||
"$ace_root/frameworks/core/components/clip/render_clip.cpp",
|
||||
"$ace_root/frameworks/core/components/dialog_modal/render_dialog_modal.cpp",
|
||||
@ -173,6 +172,7 @@ ohos_unittest("SvgAnimateTest") {
|
||||
"$ace_root/frameworks/core/components/transform/click_spring_effect.cpp",
|
||||
"$ace_root/frameworks/core/components/transform/render_transform.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
|
||||
# mock
|
||||
@ -185,12 +185,12 @@ ohos_unittest("SvgAnimateTest") {
|
||||
"$ace_root/frameworks/base/json/json_util.cpp",
|
||||
"$ace_root/frameworks/base/log/dump_log.cpp",
|
||||
"$ace_root/frameworks/base/memory/memory_monitor.cpp",
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/base/thread/background_task_executor.cpp",
|
||||
"$ace_root/frameworks/base/utils/base_id.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "base/json/json_util.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/flush_event.h"
|
||||
#include "core/animation/svg_animate.h"
|
||||
|
@ -221,12 +221,12 @@ ohos_unittest("CheckableComponentTest") {
|
||||
"render_checkable_test.cpp",
|
||||
|
||||
# mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/frameworks/core/image/test/mock/mock_image_loader.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/checkable/checkable_component.h"
|
||||
#include "core/components/checkable/radio_group_component.h"
|
||||
|
@ -164,8 +164,8 @@ ohos_unittest("ClockComponentTest") {
|
||||
"render_clock_test.cpp",
|
||||
|
||||
#mock
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -18,7 +18,7 @@
|
||||
#define protected public
|
||||
#include "base/i18n/localization.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "base/utils/system_properties.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "frameworks/core/components/clock/clock_component.h"
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "core/components/test/unittest/display/display_test_utils.h"
|
||||
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/box/box_component.h"
|
||||
#include "core/components/flex/flex_component.h"
|
||||
|
@ -74,13 +74,13 @@ ohos_unittest("RenderImageTest") {
|
||||
"$ace_root/frameworks/core/common/focus_animation_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
"$ace_root/frameworks/core/components/display/display_component.cpp",
|
||||
"$ace_root/frameworks/core/components/test/json/json_frontend.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/composed_component.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/image/image_component.cpp",
|
||||
@ -118,7 +118,6 @@ ohos_unittest("RenderImageTest") {
|
||||
"$ace_root/frameworks/core/image/image_source_info.cpp",
|
||||
|
||||
# rendering
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/components/box/render_box.cpp",
|
||||
"$ace_root/frameworks/core/components/refresh/render_refresh.cpp",
|
||||
@ -132,6 +131,7 @@ ohos_unittest("RenderImageTest") {
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/mock_flutter_font_manager.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/mock_render_node_factory.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"image_test_utils.cpp",
|
||||
"render_image_test.cpp",
|
||||
"render_imagefit_none_test.cpp",
|
||||
@ -167,11 +167,11 @@ ohos_unittest("RenderImageTest") {
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
|
||||
#mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/frameworks/core/image/test/mock/mock_image_loader.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "adapter/aosp/entrance/java/jni/ace_application_info.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/animator.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/shared_transition_controller.h"
|
||||
|
@ -57,7 +57,6 @@ ohos_unittest("ImageAnimatorElementTest") {
|
||||
"$ace_root/frameworks/core/common/focus_animation_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
@ -75,6 +74,7 @@ ohos_unittest("ImageAnimatorElementTest") {
|
||||
"$ace_root/frameworks/core/pipeline/base/composed_component.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/constants.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# base
|
||||
"$ace_root/adapter/ohos/osal/log_wrapper.cpp",
|
||||
@ -188,19 +188,19 @@ ohos_unittest("ImageAnimatorElementTest") {
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
|
||||
# theme
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/app_theme.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_attributes.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_constants.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_manager_impl.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_utils.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
|
||||
#mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/box/box_component.h"
|
||||
|
@ -91,11 +91,11 @@ ohos_unittest("RenderMarqueeTest") {
|
||||
"$ace_root/frameworks/core/common/font_loader.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
"$ace_root/frameworks/core/components/test/json/json_frontend.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/box/box_component.cpp",
|
||||
@ -196,21 +196,21 @@ ohos_unittest("RenderMarqueeTest") {
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
|
||||
# theme
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/app_theme.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_attributes.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_constants.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_manager_impl.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_utils.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
"render_marquee_test.cpp",
|
||||
|
||||
# mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/frameworks/core/image/test/mock/mock_image_loader.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "core/components/test/unittest/mock/mock_render_common.h"
|
||||
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/stage/stage_element.h"
|
||||
#include "core/components/test/json/json_frontend.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
|
||||
#endif
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/animator.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/shared_transition_controller.h"
|
||||
|
@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components/scroll/scrollable.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
// Static Functions.
|
||||
double Scrollable::sFriction_ = 0.0;
|
||||
double Scrollable::sVelocityScale_ = 0.0;
|
||||
|
||||
void Scrollable::SetVelocityScale(double sVelocityScale)
|
||||
{
|
||||
sVelocityScale_ = sVelocityScale;
|
||||
}
|
||||
|
||||
void Scrollable::SetFriction(double sFriction)
|
||||
{
|
||||
sFriction_ = sFriction;
|
||||
}
|
||||
|
||||
Scrollable::~Scrollable() = default;
|
||||
|
||||
void Scrollable::Initialize(const WeakPtr<PipelineBase>& context)
|
||||
{
|
||||
context_ = context;
|
||||
controller_ = nullptr;
|
||||
springController_ = nullptr;
|
||||
|
||||
spring_ = nullptr;
|
||||
available_ = true;
|
||||
scrollPause_ = false;
|
||||
touchUp_ = false;
|
||||
isDragUpdateStop_ = false;
|
||||
slipFactor_ = 0.0;
|
||||
startIncreaseTime_ = 0;
|
||||
}
|
||||
|
||||
void Scrollable::HandleTouchDown()
|
||||
{
|
||||
isTouching_ = true;
|
||||
currentPos_ = 0.0;
|
||||
}
|
||||
|
||||
void Scrollable::HandleTouchUp()
|
||||
{
|
||||
}
|
||||
|
||||
bool Scrollable::IsAnimationNotRunning() const
|
||||
{
|
||||
return !isTouching_ && !controller_->IsRunning() && !springController_->IsRunning();
|
||||
}
|
||||
|
||||
bool Scrollable::Idle() const
|
||||
{
|
||||
return !isTouching_ && controller_->IsStopped() && springController_->IsStopped();
|
||||
}
|
||||
|
||||
bool Scrollable::IsStopped() const
|
||||
{
|
||||
return (!springController_ || (springController_->IsStopped())) && (!controller_ || (controller_->IsStopped()));
|
||||
}
|
||||
|
||||
void Scrollable::StopScrollable()
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::HandleDragStart(const OHOS::Ace::GestureEvent& info)
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::HandleDragUpdate(const GestureEvent& info)
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::HandleDragEnd(const GestureEvent& info)
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::ExecuteScrollBegin(double& mainDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::FixScrollMotion(double position)
|
||||
{
|
||||
};
|
||||
|
||||
void Scrollable::StartSpringMotion(
|
||||
double mainPosition, double mainVelocity, const ExtentPair& extent, const ExtentPair& initExtent)
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::ProcessScrollMotionStop()
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::ProcessSpringMotion(double position)
|
||||
{
|
||||
currentPos_ = position;
|
||||
}
|
||||
|
||||
void Scrollable::ProcessScrollMotion(double position)
|
||||
{
|
||||
currentPos_ = position;
|
||||
}
|
||||
|
||||
bool Scrollable::UpdateScrollPosition(const double offset, int32_t source) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Scrollable::ProcessScrollOverCallback(double velocity)
|
||||
{
|
||||
}
|
||||
|
||||
void Scrollable::SetSlipFactor(double SlipFactor)
|
||||
{
|
||||
}
|
||||
|
||||
const RefPtr<SpringProperty>& Scrollable::GetDefaultOverSpringProperty()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace OHOS::Ace
|
@ -17,7 +17,7 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/frontend.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/plugin/plugin_window.h"
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "base/utils/system_properties.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/rating/rating_component.h"
|
||||
|
@ -63,10 +63,10 @@ ohos_unittest("RenderSemiModalTest") {
|
||||
"$ace_root/frameworks/core/common/font_loader.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/box/box_component.cpp",
|
||||
@ -176,7 +176,6 @@ ohos_unittest("RenderSemiModalTest") {
|
||||
"$ace_root/frameworks/core/components/scroll/render_multi_child_scroll.cpp",
|
||||
|
||||
# rendering
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/components/bubble/render_bubble.cpp",
|
||||
"$ace_root/frameworks/core/components/positioned/render_positioned.cpp",
|
||||
@ -198,14 +197,15 @@ ohos_unittest("RenderSemiModalTest") {
|
||||
"$ace_root/frameworks/core/components/theme/theme_manager_impl.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_utils.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
"render_semi_modal_test.cpp",
|
||||
|
||||
# mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
if (!is_wearable_product) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "base/utils/utils.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "base/geometry/dimension.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/memory/ace_type.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/panel/render_sliding_panel.h"
|
||||
#include "core/components/panel/sliding_panel_component_v2.h"
|
||||
|
@ -81,11 +81,11 @@ ohos_unittest("SwiperComponentTest") {
|
||||
"$ace_root/frameworks/core/common/font_loader.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
"$ace_root/frameworks/core/components/test/json/json_frontend.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/box/box_component.cpp",
|
||||
@ -199,10 +199,8 @@ ohos_unittest("SwiperComponentTest") {
|
||||
"$ace_root/frameworks/base/json/json_util.cpp",
|
||||
"$ace_root/frameworks/base/log/dump_log.cpp",
|
||||
"$ace_root/frameworks/base/memory/memory_monitor.cpp",
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/base/thread/background_task_executor.cpp",
|
||||
"$ace_root/frameworks/base/utils/base_id.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
@ -212,6 +210,8 @@ ohos_unittest("SwiperComponentTest") {
|
||||
"$ace_root/frameworks/core/components/theme/theme_manager_impl.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_utils.cpp",
|
||||
"$ace_root/frameworks/core/image/test/mock/mock_image_loader.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
"render_swiper_test.cpp",
|
||||
]
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
#include "core/components/test/json/json_frontend.h"
|
||||
#include "core/components/test/unittest/mock/mock_render_depend.h"
|
||||
|
@ -29,14 +29,14 @@ ohos_unittest("ThemeManagerTest") {
|
||||
"$ace_root/frameworks/base/log/ace_trace.cpp",
|
||||
"$ace_root/frameworks/base/resource/ace_res_config.cpp",
|
||||
"$ace_root/frameworks/base/resource/ace_res_key_parser.cpp",
|
||||
"$ace_root/frameworks/base/test/mock/mock_ace_container.cpp",
|
||||
"$ace_root/test/mock/base/mock_ace_container.cpp",
|
||||
|
||||
# properties
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/border.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/border_edge.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/color.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/text_style.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
|
||||
# theme
|
||||
"$ace_root/frameworks/core/components/theme/app_theme.cpp",
|
||||
@ -65,8 +65,8 @@ ohos_unittest("ThemeManagerTest") {
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
|
||||
# event
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/event/back_end_event_manager.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
"theme_manager_test.cpp",
|
||||
"theme_mock.cpp",
|
||||
]
|
||||
@ -140,12 +140,12 @@ ohos_unittest("ThemeConstantsTest") {
|
||||
"$ace_root/frameworks/base/utils/base_id.cpp",
|
||||
|
||||
# properties
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/border.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/border_edge.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/color.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/text_style.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/icon_theme.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
|
||||
# theme
|
||||
"$ace_root/frameworks/core/components/theme/app_theme.cpp",
|
||||
@ -175,13 +175,13 @@ ohos_unittest("ThemeConstantsTest") {
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
|
||||
# event
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/event/back_end_event_manager.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
"theme_constants_test.cpp",
|
||||
"theme_mock.cpp",
|
||||
|
||||
# mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -28,7 +28,7 @@ common_mock_files = [
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/overlay_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/semi_modal_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
"transition_test_utils.cpp",
|
||||
]
|
||||
|
||||
@ -195,7 +195,7 @@ common_module_files = [
|
||||
"$ace_root/frameworks/core/components/common/properties/scroll_bar.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/shadow.cpp",
|
||||
"$ace_root/frameworks/core/components/common/properties/text_style.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
|
||||
# add secure c API
|
||||
"//third_party/bounds_checking_function/src/strcpy_s.c",
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "base/utils/system_properties.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/curve_animation.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/keyframe_animation.h"
|
||||
#include "core/common/test/mock/mock_resource_register.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "base/utils/system_properties.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
#include "core/animation/curve_animation.h"
|
||||
|
@ -70,7 +70,6 @@ ohos_unittest("TweenElementTest") {
|
||||
"$ace_root/frameworks/core/common/focus_animation_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/font_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/frontend.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/common/thread_checker.cpp",
|
||||
"$ace_root/frameworks/core/common/vibrator/vibrator_proxy.cpp",
|
||||
"$ace_root/frameworks/core/common/window.cpp",
|
||||
@ -81,6 +80,7 @@ ohos_unittest("TweenElementTest") {
|
||||
"$ace_root/frameworks/core/components/test/json/json_frontend.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/base/composed_component.cpp",
|
||||
"$ace_root/frameworks/core/pipeline/pipeline_context.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_watch_dog.cpp",
|
||||
|
||||
# components
|
||||
"$ace_root/frameworks/core/components/root/root_component.cpp",
|
||||
@ -178,19 +178,19 @@ ohos_unittest("TweenElementTest") {
|
||||
"$ace_root/frameworks/core/pipeline/base/render_node.cpp",
|
||||
|
||||
# theme
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/app_theme.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_attributes.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_constants.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_manager_impl.cpp",
|
||||
"$ace_root/frameworks/core/components/theme/theme_utils.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
|
||||
|
||||
# mock
|
||||
"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp",
|
||||
"$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
|
||||
"$ace_root/test/mock/base/mock_system_properties.cpp",
|
||||
]
|
||||
|
||||
# add sources only needed by wearable like watch.
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
|
||||
#include "base/log/log.h"
|
||||
#include "base/test/mock/mock_asset_manager.h"
|
||||
#include "base/test/mock/mock_task_executor.h"
|
||||
#include "test/mock/base/mock_task_executor.h"
|
||||
#include "core/animation/animatable.h"
|
||||
#include "core/animation/animatable_data.h"
|
||||
#include "core/animation/card_transition_controller.h"
|
||||
|
@ -46,9 +46,9 @@ ohos_unittest("RenderTextureTest") {
|
||||
module_out_path = module_output_path
|
||||
|
||||
sources = [
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp",
|
||||
"$ace_root/frameworks/core/components/test/json/json_frontend.cpp",
|
||||
"$ace_root/frameworks/core/components/test/unittest/mock/mock_render_common.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
|
||||
"render_texture_test.cpp",
|
||||
"texture_test_utils.cpp",
|
||||
]
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "grid_container_layout_property.h"
|
||||
|
||||
#include "base/log/log_wrapper.h"
|
||||
#include "base/log/log.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
|
||||
|
@ -16,31 +16,31 @@
|
||||
#ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_RENDER_DRAWING_MOCK_H
|
||||
#define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_RENDER_DRAWING_MOCK_H
|
||||
|
||||
#include "core/components_ng/test/mock/rosen/testing_bitmap.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_brush.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_camera.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_canvas.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_color.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_color_filter.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_color_matrix.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_filter.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_font_collection.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_image.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_image_filter.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_mask_filter.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_path.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_path_effect.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_pen.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_point.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_point3.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_sampling_options.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_scalar.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_shader_effect.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_shadowflags.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_text_style.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_typography.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_typography_create.h"
|
||||
#include "core/components_ng/test/mock/rosen/testing_typography_style.h"
|
||||
#include "test/mock/core/rosen/testing_bitmap.h"
|
||||
#include "test/mock/core/rosen/testing_brush.h"
|
||||
#include "test/mock/core/rosen/testing_camera.h"
|
||||
#include "test/mock/core/rosen/testing_canvas.h"
|
||||
#include "test/mock/core/rosen/testing_color.h"
|
||||
#include "test/mock/core/rosen/testing_color_filter.h"
|
||||
#include "test/mock/core/rosen/testing_color_matrix.h"
|
||||
#include "test/mock/core/rosen/testing_filter.h"
|
||||
#include "test/mock/core/rosen/testing_font_collection.h"
|
||||
#include "test/mock/core/rosen/testing_image.h"
|
||||
#include "test/mock/core/rosen/testing_image_filter.h"
|
||||
#include "test/mock/core/rosen/testing_mask_filter.h"
|
||||
#include "test/mock/core/rosen/testing_path.h"
|
||||
#include "test/mock/core/rosen/testing_path_effect.h"
|
||||
#include "test/mock/core/rosen/testing_pen.h"
|
||||
#include "test/mock/core/rosen/testing_point.h"
|
||||
#include "test/mock/core/rosen/testing_point3.h"
|
||||
#include "test/mock/core/rosen/testing_sampling_options.h"
|
||||
#include "test/mock/core/rosen/testing_scalar.h"
|
||||
#include "test/mock/core/rosen/testing_shader_effect.h"
|
||||
#include "test/mock/core/rosen/testing_shadowflags.h"
|
||||
#include "test/mock/core/rosen/testing_text_style.h"
|
||||
#include "test/mock/core/rosen/testing_typography.h"
|
||||
#include "test/mock/core/rosen/testing_typography_create.h"
|
||||
#include "test/mock/core/rosen/testing_typography_style.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
namespace RSDrawing = Testing;
|
||||
|
@ -1,32 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
|
||||
group("unittest") {
|
||||
testonly = true
|
||||
deps = []
|
||||
if (!is_asan) {
|
||||
deps = [
|
||||
"animation:animation_unittest",
|
||||
"event:event_unittest",
|
||||
"image_provider:image_provider_test_ng",
|
||||
"layout:layout_unittest",
|
||||
"manager:manager_unittest",
|
||||
"pattern:pattern_unittest",
|
||||
"property:property_unittest",
|
||||
"svg:svg_unittest",
|
||||
"syntax:syntax_unittest",
|
||||
]
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
group("animation_unittest") {
|
||||
testonly = true
|
||||
deps = [ "geometry_transition:geometry_transition_test_ng" ]
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
group("event_unittest") {
|
||||
testonly = true
|
||||
deps = [
|
||||
"click_event:click_event_test_ng",
|
||||
"drag_event:drag_event_test_ng",
|
||||
"event_hub:event_hub_test_ng",
|
||||
"event_manager:event_manager_test_ng",
|
||||
"focus_hub:focus_hub_test_ng",
|
||||
"gesture_event_hub:gesture_event_hub_test_ng",
|
||||
"input_event_hub:input_event_hub_test_ng",
|
||||
"long_press_event:long_press_event_test_ng",
|
||||
"pan_event:pan_event_test_ng",
|
||||
"scrollable_event:scrollable_event_test_ng",
|
||||
"state_style:state_style_test_ng",
|
||||
"touch_event:touch_event_test_ng",
|
||||
]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("click_event_test_ng") {
|
||||
module_output = "events"
|
||||
type = "new"
|
||||
sources = [ "click_event_test_ng.cpp" ]
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
# Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("event_manager_test_ng") {
|
||||
type = "new"
|
||||
flutter_skia = true
|
||||
render = true
|
||||
sources = [
|
||||
"$ace_root/frameworks/core/common/event_manager.cpp",
|
||||
"$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp",
|
||||
"$ace_root/frameworks/core/event/key_event.cpp",
|
||||
"$ace_root/frameworks/core/event/mouse_event.cpp",
|
||||
"$ace_root/frameworks/core/gestures/gesture_referee.cpp",
|
||||
"$ace_root/test/mock/core/common/mock_window.cpp",
|
||||
"event_manager_test_ng.cpp",
|
||||
]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("focus_hub_test_ng") {
|
||||
type = "new"
|
||||
module_output = "events"
|
||||
sources = [ "focus_hub_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("gesture_event_hub_test_ng") {
|
||||
type = "new"
|
||||
module_output = "events"
|
||||
sources = [ "gesture_event_hub_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("long_press_event_test_ng") {
|
||||
module_output = "events"
|
||||
type = "new"
|
||||
sources = [ "long_press_event_test_ng.cpp" ]
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/click_event.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
ClickEventActuator::ClickEventActuator(const WeakPtr<GestureEventHub>& gestureEventHub)
|
||||
: gestureEventHub_(gestureEventHub)
|
||||
{}
|
||||
|
||||
void ClickEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, const TouchRestrict& touchRestrict,
|
||||
const GetEventTargetImpl& getEventTargetImpl, TouchTestResult& result)
|
||||
{}
|
||||
|
||||
GestureEventFunc ClickEventActuator::GetClickEvent()
|
||||
{
|
||||
auto callback = [weak = WeakClaim(this)](GestureEvent& info) {
|
||||
auto actuator = weak.Upgrade();
|
||||
CHECK_NULL_VOID(actuator);
|
||||
for (const auto& callback : actuator->clickEvents_) {
|
||||
if (callback) {
|
||||
(*callback)(info);
|
||||
}
|
||||
}
|
||||
if (actuator->userCallback_) {
|
||||
(*actuator->userCallback_)(info);
|
||||
}
|
||||
if (actuator->onAccessibilityEventFunc_) {
|
||||
actuator->onAccessibilityEventFunc_(AccessibilityEventType::CLICK);
|
||||
}
|
||||
};
|
||||
return callback;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "base/memory/ace_type.h"
|
||||
#include "core/components_ng/event/drag_event.h"
|
||||
#include "core/components_ng/event/touch_event.h"
|
||||
#include "core/components_ng/gestures/recognizers/long_press_recognizer.h"
|
||||
#include "core/components_ng/gestures/recognizers/pan_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
DragEventActuator::DragEventActuator(
|
||||
const WeakPtr<GestureEventHub>& gestureEventHub, PanDirection direction, int32_t fingers, float distance)
|
||||
: gestureEventHub_(gestureEventHub), direction_(direction), fingers_(fingers), distance_(distance)
|
||||
{
|
||||
if (fingers_ < 1) {
|
||||
fingers_ = 1;
|
||||
}
|
||||
|
||||
if (LessOrEqual(distance_, 5.0f)) {
|
||||
distance_ = 5.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, const TouchRestrict& touchRestrict,
|
||||
const GetEventTargetImpl& getEventTargetImpl, TouchTestResult& result)
|
||||
{
|
||||
// emplace not a NGGestureRecognizer, just for going to a branch
|
||||
auto touchEventActuator = AceType::MakeRefPtr<TouchEventActuator>();
|
||||
result.emplace_back(touchEventActuator);
|
||||
}
|
||||
|
||||
void DragEventActuator::StartDragTaskForWeb(const GestureEvent& info) {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/long_press_event.h"
|
||||
#include "core/components_ng/gestures/recognizers/long_press_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
LongPressEventActuator::LongPressEventActuator(const WeakPtr<GestureEventHub>& gestureEventHub)
|
||||
: gestureEventHub_(gestureEventHub)
|
||||
{}
|
||||
|
||||
void LongPressEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, const TouchRestrict& touchRestrict,
|
||||
const GetEventTargetImpl& getEventTargetImpl, TouchTestResult& result)
|
||||
{
|
||||
if (!longPressRecognizer_) {
|
||||
longPressRecognizer_ = MakeRefPtr<LongPressRecognizer>(isForDrag_, isDisableMouseLeft_);
|
||||
}
|
||||
result.emplace_back(longPressRecognizer_);
|
||||
}
|
||||
|
||||
GestureEventFunc LongPressEventActuator::GetGestureEventFunc()
|
||||
{
|
||||
auto callback = [weak = WeakClaim(this)](GestureEvent& info) {
|
||||
auto actuator = weak.Upgrade();
|
||||
CHECK_NULL_VOID(actuator);
|
||||
if (actuator->longPressEvent_) {
|
||||
(*actuator->longPressEvent_)(info);
|
||||
}
|
||||
if (actuator->onAccessibilityEventFunc_) {
|
||||
actuator->onAccessibilityEventFunc_(AccessibilityEventType::LONG_PRESS);
|
||||
}
|
||||
};
|
||||
return callback;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/pan_event.h"
|
||||
#include "core/components_ng/gestures/recognizers/pan_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
PanEventActuator::PanEventActuator(
|
||||
const WeakPtr<GestureEventHub>& gestureEventHub, PanDirection direction, int32_t fingers, float distance)
|
||||
: gestureEventHub_(gestureEventHub), direction_(direction), fingers_(fingers), distance_(distance)
|
||||
{
|
||||
if (fingers_ < DEFAULT_PAN_FINGER) {
|
||||
fingers_ = DEFAULT_PAN_FINGER;
|
||||
}
|
||||
if (LessOrEqual(distance_, DEFAULT_PAN_DISTANCE.ConvertToPx())) {
|
||||
distance_ = DEFAULT_PAN_DISTANCE.ConvertToPx();
|
||||
}
|
||||
}
|
||||
|
||||
void PanEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, const TouchRestrict& touchRestrict,
|
||||
const GetEventTargetImpl& getEventTargetImpl, TouchTestResult& result)
|
||||
{}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/scrollable_event.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
ScrollableActuator::ScrollableActuator(const WeakPtr<GestureEventHub>& gestureEventHub)
|
||||
: gestureEventHub_(gestureEventHub)
|
||||
{}
|
||||
|
||||
void ScrollableActuator::AddScrollEdgeEffect(const Axis& axis, RefPtr<ScrollEdgeEffect>& effect)
|
||||
{}
|
||||
|
||||
bool ScrollableActuator::RemoveScrollEdgeEffect(const RefPtr<ScrollEdgeEffect>& effect)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScrollableActuator::InitializeScrollable(RefPtr<ScrollableEvent> event)
|
||||
{}
|
||||
|
||||
void ScrollableActuator::CollectTouchTarget(const OffsetF& coordinateOffset, const TouchRestrict& touchRestrict,
|
||||
const GetEventTargetImpl& getEventTargetImpl, TouchTestResult& result, const PointF& localPoint)
|
||||
{}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/touch_event.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
bool TouchEventActuator::DispatchEvent(const TouchEvent& point)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TouchEventActuator::HandleEvent(const TouchEvent& point)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("pan_event_test_ng") {
|
||||
type = "new"
|
||||
module_output = "events"
|
||||
sources = [ "pan_event_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("scrollable_event_test_ng") {
|
||||
type = "new"
|
||||
module_output = "events"
|
||||
sources = [ "scrollable_event_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("touch_event_test_ng") {
|
||||
type = "new"
|
||||
module_output = "events"
|
||||
sources = [ "touch_event_test_ng.cpp" ]
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
group("layout_unittest") {
|
||||
testonly = true
|
||||
deps = [
|
||||
"box_layout_algorithm:box_layout_algorithm_test_ng",
|
||||
"layout_property:layout_property_test_ng",
|
||||
"layout_wrapper:layout_wrapper_test_ng",
|
||||
"layout_wrapper_builder:layout_wrapper_build_test_ng",
|
||||
"layout_wrapper_node:layout_wrapper_node_test_ng",
|
||||
]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("box_layout_algorithm_test_ng") {
|
||||
type = "new"
|
||||
module_output = "layout"
|
||||
sources = [ "box_layout_algorithm_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("layout_property_test_ng") {
|
||||
type = "new"
|
||||
module_output = "layout"
|
||||
sources = [ "layout_property_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("layout_wrapper_test_ng") {
|
||||
type = "new"
|
||||
module_output = "layout"
|
||||
sources = [ "layout_wrapper_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("layout_wrapper_build_test_ng") {
|
||||
type = "new"
|
||||
module_output = "layout"
|
||||
sources = [ "layout_wrapper_build_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("layout_wrapper_node_test_ng") {
|
||||
type = "new"
|
||||
module_output = "layout"
|
||||
sources = [ "layout_wrapper_node_test_ng.cpp" ]
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
group("manager_unittest") {
|
||||
testonly = true
|
||||
deps = [
|
||||
"drag_drop/drag_drop_manager:drag_drop_manager_test_ng",
|
||||
"drag_drop/drag_drop_proxy:drag_drop_proxy_test_ng",
|
||||
"full_screen:full_screen_manager_test_ng",
|
||||
"select_overlay/select_overlay_manager:select_overlay_manager_test_ng",
|
||||
"select_overlay/select_overlay_proxy:select_overlay_proxy_test_ng",
|
||||
"shared_overlay:shared_overlay_manager_test_ng",
|
||||
]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("drag_drop_proxy_test_ng") {
|
||||
type = "new"
|
||||
module_output = "manager"
|
||||
sources = [ "drag_drop_proxy_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("full_screen_manager_test_ng") {
|
||||
type = "new"
|
||||
module_output = "manager"
|
||||
sources = [ "full_screen_manager_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("select_overlay_manager_test_ng") {
|
||||
type = "new"
|
||||
module_output = "manager"
|
||||
sources = [ "select_overlay_manager_test_ng.cpp" ]
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//foundation/arkui/ace_engine/test/unittest/ace_unittest.gni")
|
||||
|
||||
ace_unittest("select_overlay_proxy_test_ng") {
|
||||
type = "new"
|
||||
module_output = "manager"
|
||||
sources = [ "select_overlay_proxy_test_ng.cpp" ]
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/animation/geometry_transition.h"
|
||||
#include "core/components_ng/base/frame_node.h"
|
||||
#include "core/components_ng/layout/layout_property.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
GeometryTransition::GeometryTransition(const std::string& id, bool followWithoutTransition) : id_(id),
|
||||
followWithoutTransition_(followWithoutTransition) {}
|
||||
|
||||
void GeometryTransition::Build(const WeakPtr<FrameNode>& frameNode, bool isNodeIn) {}
|
||||
void GeometryTransition::WillLayout(const RefPtr<LayoutWrapper>& layoutWrapper) {}
|
||||
void GeometryTransition::DidLayout(const RefPtr<LayoutWrapper>& layoutWrapper) {}
|
||||
void GeometryTransition::OnReSync(const WeakPtr<FrameNode>& trigger, const AnimationOption& option) {}
|
||||
|
||||
bool GeometryTransition::OnAdditionalLayout(const WeakPtr<FrameNode>& frameNode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeometryTransition::OnFollowWithoutTransition(std::optional<bool> direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeometryTransition::Update(const WeakPtr<FrameNode>& which, const WeakPtr<FrameNode>& value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeometryTransition::IsNodeInAndActive(const WeakPtr<FrameNode>& frameNode) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeometryTransition::IsNodeOutAndActive(const WeakPtr<FrameNode>& frameNode) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeometryTransition::IsRunning(const WeakPtr<FrameNode>& frameNode) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeometryTransition::IsInAndOutEmpty() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GeometryTransition::IsInAndOutValid() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string GeometryTransition::ToString() const
|
||||
{
|
||||
return std::string("");
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,344 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "base/memory/ace_type.h"
|
||||
#include "core/components_ng/base/frame_node.h"
|
||||
#include "core/components_ng/pattern/pattern.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
thread_local int32_t UINode::currentAccessibilityId_ = 0;
|
||||
|
||||
class FramePorxy {
|
||||
public:
|
||||
explicit FramePorxy(FrameNode* frameNode) {}
|
||||
~FramePorxy() {}
|
||||
};
|
||||
|
||||
FrameNode::~FrameNode() {}
|
||||
void FrameNode::OnWindowShow() {}
|
||||
void FrameNode::OnWindowHide() {}
|
||||
void FrameNode::OnWindowFocused() {}
|
||||
void FrameNode::OnWindowUnfocused() {}
|
||||
void FrameNode::OnWindowSizeChanged(int32_t width, int32_t height, WindowSizeChangeReason type) {}
|
||||
void FrameNode::OnNotifyMemoryLevel(int32_t level) {}
|
||||
void FrameNode::OnAccessibilityEvent(
|
||||
AccessibilityEventType eventType, WindowsContentChangeTypes windowsContentChangeType) const
|
||||
{}
|
||||
void FrameNode::OnAccessibilityEvent(
|
||||
AccessibilityEventType eventType, std::string beforeText, std::string latestContent) const
|
||||
{}
|
||||
void FrameNode::DumpInfo() {}
|
||||
void FrameNode::DumpAdvanceInfo() {}
|
||||
void FrameNode::DumpViewDataPageNode(RefPtr<ViewDataWrap> viewDataWrap) {}
|
||||
bool FrameNode::CheckAutoSave()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void FrameNode::FocusToJsonValue(std::unique_ptr<JsonValue>& json) const {}
|
||||
void FrameNode::MouseToJsonValue(std::unique_ptr<JsonValue>& json) const {}
|
||||
void FrameNode::TouchToJsonValue(std::unique_ptr<JsonValue>& json) const {}
|
||||
void FrameNode::ToJsonValue(std::unique_ptr<JsonValue>& json) const {}
|
||||
void FrameNode::FromJson(const std::unique_ptr<JsonValue>& json) {}
|
||||
void FrameNode::OnAttachToMainTree(bool) {}
|
||||
void FrameNode::OnDetachFromMainTree(bool) {}
|
||||
bool FrameNode::OnRemoveFromParent(bool)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool FrameNode::RemoveImmediately() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void FrameNode::SwapDirtyLayoutWrapperOnMainThread(const RefPtr<LayoutWrapper>& dirty) {}
|
||||
void FrameNode::SetActive(bool active)
|
||||
{
|
||||
isActive_ = active;
|
||||
}
|
||||
void FrameNode::OnVisibleChange(bool isVisible) {}
|
||||
void FrameNode::PostTask(std::function<void()>&& task, TaskExecutor::TaskType taskType) {}
|
||||
void FrameNode::RebuildRenderContextTree() {}
|
||||
void FrameNode::MarkModifyDone()
|
||||
{
|
||||
pattern_->OnModifyDone();
|
||||
}
|
||||
void FrameNode::OnInspectorIdUpdate(const std::string& /*unused*/) {}
|
||||
void FrameNode::OnMountToParentDone() {}
|
||||
void FrameNode::FlushUpdateAndMarkDirty() {}
|
||||
void FrameNode::MarkDirtyNode(PropertyChangeFlag extraFlag) {}
|
||||
void FrameNode::MarkNeedRenderOnly() {}
|
||||
void FrameNode::MarkNeedRender(bool isRenderBoundary) {}
|
||||
void FrameNode::MarkDirtyNode(bool isMeasureBoundary, bool isRenderBoundary, PropertyChangeFlag extraFlag) {}
|
||||
void FrameNode::OnGenerateOneDepthVisibleFrame(std::list<RefPtr<FrameNode>>& visibleList) {}
|
||||
void FrameNode::OnGenerateOneDepthAllFrame(std::list<RefPtr<FrameNode>>& allList) {}
|
||||
void FrameNode::OnGenerateOneDepthVisibleFrameWithTransition(std::list<RefPtr<FrameNode>>& visibleList) {}
|
||||
void FrameNode::UpdateChildrenLayoutWrapper(const RefPtr<LayoutWrapperNode>& self, bool forceMeasure, bool forceLayout)
|
||||
{}
|
||||
void FrameNode::AdjustLayoutWrapperTree(const RefPtr<LayoutWrapperNode>& parent, bool forceMeasure, bool forceLayout) {}
|
||||
void FrameNode::UpdateLayoutPropertyFlag() {}
|
||||
void FrameNode::ForceUpdateLayoutPropertyFlag(PropertyChangeFlag propertyChangeFlag) {}
|
||||
void FrameNode::AdjustParentLayoutFlag(PropertyChangeFlag& flag) {}
|
||||
void FrameNode::MarkResponseRegion(bool isResponseRegion) {}
|
||||
void FrameNode::MarkNeedSyncRenderTree(bool) {}
|
||||
RefPtr<LayoutWrapperNode> FrameNode::UpdateLayoutWrapper(
|
||||
RefPtr<LayoutWrapperNode> layoutWrapper, bool forceMeasure, bool forceLayout)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<UINode> FrameNode::GetFrameChildByIndex(uint32_t index, bool needBuild)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
const RefPtr<LayoutAlgorithmWrapper>& FrameNode::GetLayoutAlgorithm(bool needReset)
|
||||
{
|
||||
return layoutAlgorithm_;
|
||||
}
|
||||
|
||||
void FrameNode::Measure(const std::optional<LayoutConstraintF>& parentConstraint) {}
|
||||
|
||||
void FrameNode::Layout() {}
|
||||
|
||||
RefPtr<LayoutWrapper> FrameNode::GetOrCreateChildByIndex(uint32_t index, bool addToRenderTree)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<LayoutWrapper> FrameNode::GetChildByIndex(uint32_t index)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const std::list<RefPtr<LayoutWrapper>>& FrameNode::GetAllChildrenWithBuild(bool addToRenderTree)
|
||||
{
|
||||
static std::list<RefPtr<LayoutWrapper>> list;
|
||||
return list;
|
||||
}
|
||||
|
||||
void FrameNode::RemoveChildInRenderTree(uint32_t index) {}
|
||||
|
||||
bool FrameNode::SkipMeasureContent() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
float FrameNode::GetBaselineDistance() const
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
bool FrameNode::CheckNeedForceMeasureAndLayout()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void FrameNode::SetCacheCount(int32_t cacheCount, const std::optional<LayoutConstraintF>& itemConstraint) {}
|
||||
|
||||
void FrameNode::RemoveAllChildInRenderTree() {}
|
||||
|
||||
FrameNode::FrameNode(const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern, bool isRoot)
|
||||
: UINode(tag, nodeId, isRoot), LayoutWrapper(WeakClaim(this)), pattern_(pattern)
|
||||
{
|
||||
paintProperty_ = pattern->CreatePaintProperty();
|
||||
layoutProperty_ = pattern->CreateLayoutProperty();
|
||||
eventHub_ = pattern->CreateEventHub();
|
||||
accessibilityProperty_ = pattern->CreateAccessibilityProperty();
|
||||
layoutProperty_->SetHost(WeakClaim(this));
|
||||
}
|
||||
|
||||
void FrameNode::SetGeometryNode(const RefPtr<GeometryNode>& node)
|
||||
{
|
||||
geometryNode_ = node;
|
||||
}
|
||||
|
||||
void FrameNode::UpdateLayoutConstraint(const MeasureProperty& calcLayoutConstraint)
|
||||
{
|
||||
layoutProperty_->UpdateCalcLayoutProperty(calcLayoutConstraint);
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> FrameNode::CreateFrameNodeWithTree(
|
||||
const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern)
|
||||
{
|
||||
auto frameNode = AceType::MakeRefPtr<FrameNode>(tag, nodeId, pattern);
|
||||
return frameNode;
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> FrameNode::GetOrCreateFrameNode(
|
||||
const std::string& tag, int32_t nodeId, const std::function<RefPtr<Pattern>(void)>& patternCreator)
|
||||
{
|
||||
auto pattern = patternCreator ? patternCreator() : MakeRefPtr<Pattern>();
|
||||
return CreateFrameNode(tag, nodeId, pattern);
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> FrameNode::GetFrameNode(const std::string& tag, int32_t nodeId)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> FrameNode::CreateFrameNode(
|
||||
const std::string& tag, int32_t nodeId, const RefPtr<Pattern>& pattern, bool isRoot)
|
||||
{
|
||||
auto frameNode = MakeRefPtr<FrameNode>(tag, nodeId, pattern, isRoot);
|
||||
frameNode->InitializePatternAndContext();
|
||||
return frameNode;
|
||||
}
|
||||
|
||||
void FrameNode::InitializePatternAndContext()
|
||||
{
|
||||
pattern_->AttachToFrameNode(WeakClaim(this));
|
||||
}
|
||||
|
||||
void FrameNode::CreateLayoutTask(bool forceUseMainThread)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::optional<UITask> FrameNode::CreateRenderTask(bool forceUseMainThread)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
LayoutConstraintF FrameNode::GetLayoutConstraint() const
|
||||
{
|
||||
return LayoutConstraintF();
|
||||
}
|
||||
|
||||
OffsetF FrameNode::GetParentGlobalOffset() const
|
||||
{
|
||||
return { 1.0f, 1.0f };
|
||||
}
|
||||
|
||||
OffsetF FrameNode::GetPaintRectOffsetToPage() const
|
||||
{
|
||||
return { 1.0f, 1.0f };
|
||||
}
|
||||
|
||||
RefPtr<LayoutWrapperNode> FrameNode::CreateLayoutWrapper(bool forceMeasure, bool forceLayout)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<PaintWrapper> FrameNode::CreatePaintWrapper()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> FrameNode::GetAncestorNodeOfFrame() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool FrameNode::IsOutOfTouchTestRegion(const PointF& parentLocalPoint, int32_t sourceType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FrameNode::IsMeasureBoundary()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FrameNode::IsRenderBoundary()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const RefPtr<Pattern>& FrameNode::GetPattern() const
|
||||
{
|
||||
return pattern_;
|
||||
}
|
||||
|
||||
bool FrameNode::IsAtomicNode() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
HitTestMode FrameNode::GetHitTestMode() const
|
||||
{
|
||||
return HitTestMode::HTMDEFAULT;
|
||||
}
|
||||
|
||||
bool FrameNode::GetTouchable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FrameNode::IsResponseRegion() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
HitTestResult FrameNode::TouchTest(const PointF& globalPoint, const PointF& parentLocalPoint,
|
||||
const PointF& parentRevertPoint, const TouchRestrict& touchRestrict, TouchTestResult& result, int32_t touchId)
|
||||
{
|
||||
return HitTestResult::BUBBLING;
|
||||
}
|
||||
|
||||
std::vector<RectF> FrameNode::GetResponseRegionList(const RectF& rect, int32_t sourceType)
|
||||
{
|
||||
return std::vector<RectF>();
|
||||
}
|
||||
|
||||
bool FrameNode::InResponseRegionList(const PointF& parentLocalPoint, const std::vector<RectF>& responseRegionList) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
HitTestResult FrameNode::MouseTest(const PointF& globalPoint, const PointF& parentLocalPoint,
|
||||
MouseTestResult& onMouseResult, MouseTestResult& onHoverResult, RefPtr<FrameNode>& hoverNode)
|
||||
{
|
||||
return HitTestResult::BUBBLING;
|
||||
}
|
||||
|
||||
HitTestResult FrameNode::AxisTest(
|
||||
const PointF& globalPoint, const PointF& parentLocalPoint, AxisTestResult& onAxisResult)
|
||||
{
|
||||
return HitTestResult::BUBBLING;
|
||||
}
|
||||
|
||||
RefPtr<FocusHub> FrameNode::GetOrCreateFocusHub() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OffsetF FrameNode::GetOffsetRelativeToWindow() const
|
||||
{
|
||||
return { 1.0f, 1.0f };
|
||||
}
|
||||
|
||||
RectF FrameNode::GetTransformRectRelativeToWindow() const
|
||||
{
|
||||
return RectF(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
OffsetF FrameNode::GetTransformRelativeOffset() const
|
||||
{
|
||||
return { 1.0f, 1.0f };
|
||||
}
|
||||
|
||||
bool FrameNode::MarkRemoving()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> FrameNode::FindChildByPosition(float x, float y)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void FrameNode::OnConfigurationUpdate(const OnConfigurationChange& configurationChange) {}
|
||||
|
||||
void FrameNode::DoRemoveChildInRenderTree(uint32_t index, bool isAll)
|
||||
{
|
||||
isActive_ = false;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/base/frame_node.h"
|
||||
#include "core/components_ng/pattern/stage/stage_manager.h"
|
||||
#include "core/components_ng/pattern/stage/stage_pattern.h"
|
||||
#include "core/components_v2/inspector/inspector_constants.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
StageManager::StageManager(const RefPtr<FrameNode>& stage) : stageNode_(stage)
|
||||
{
|
||||
stagePattern_ = DynamicCast<StagePattern>(stageNode_->GetPattern());
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> StageManager::GetLastPage()
|
||||
{
|
||||
return stageNode_;
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> StageManager::GetPageById(int32_t pageId)
|
||||
{
|
||||
const auto& children = stageNode_->GetChildren();
|
||||
for (const auto& child : children) {
|
||||
if (child->GetPageId() == pageId) {
|
||||
return DynamicCast<FrameNode>(child);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,170 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/base/ui_node.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
UINode::~UINode() {}
|
||||
void UINode::ReplaceChild(const RefPtr<UINode>& oldNode, const RefPtr<UINode>& newNode) {}
|
||||
void UINode::Clean(bool cleanDirectly, bool allowTransition) {}
|
||||
void UINode::GetFocusChildren(std::list<RefPtr<FrameNode>>& children) const {}
|
||||
void UINode::AttachToMainTree(bool) {}
|
||||
void UINode::DetachFromMainTree(bool) {}
|
||||
void UINode::MovePosition(int32_t slot) {}
|
||||
void UINode::UpdateLayoutPropertyFlag() {}
|
||||
void UINode::AdjustParentLayoutFlag(PropertyChangeFlag& flag) {}
|
||||
void UINode::MarkDirtyNode(PropertyChangeFlag extraFlag) {}
|
||||
void UINode::MarkNeedFrameFlushDirty(PropertyChangeFlag extraFlag) {}
|
||||
void UINode::MarkNeedSyncRenderTree(bool needRebuild) {}
|
||||
void UINode::RebuildRenderContextTree() {}
|
||||
void UINode::OnDetachFromMainTree(bool) {}
|
||||
void UINode::OnAttachToMainTree(bool) {}
|
||||
void UINode::OnGenerateOneDepthVisibleFrameWithTransition(std::list<RefPtr<FrameNode>>& visibleList) {}
|
||||
bool UINode::OnRemoveFromParent(bool)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool UINode::RemoveImmediately() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void UINode::DumpTree(int32_t depth) {}
|
||||
void UINode::AdjustLayoutWrapperTree(const RefPtr<LayoutWrapperNode>& parent, bool forceMeasure, bool forceLayout) {}
|
||||
void UINode::GenerateOneDepthVisibleFrame(std::list<RefPtr<FrameNode>>& visibleList) {}
|
||||
void UINode::GenerateOneDepthAllFrame(std::list<RefPtr<FrameNode>>& allList) {}
|
||||
void UINode::Build() {}
|
||||
void UINode::SetActive(bool active) {}
|
||||
void UINode::SetJSViewActive(bool active) {}
|
||||
void UINode::OnVisibleChange(bool isVisible) {}
|
||||
|
||||
void UINode::AddChild(const RefPtr<UINode>& child, int32_t /* slot */, bool /*silently*/)
|
||||
{
|
||||
CHECK_NULL_VOID(child);
|
||||
auto it = std::find(children_.begin(), children_.end(), child);
|
||||
if (it != children_.end()) {
|
||||
return;
|
||||
}
|
||||
it = children_.begin();
|
||||
std::advance(it, -1);
|
||||
children_.insert(it, child);
|
||||
child->SetParent(Claim(this));
|
||||
}
|
||||
|
||||
void UINode::MountToParent(const RefPtr<UINode>& parent, int32_t slot, bool silently)
|
||||
{
|
||||
CHECK_NULL_VOID(parent);
|
||||
parent->AddChild(AceType::Claim(this), slot, silently);
|
||||
}
|
||||
|
||||
std::list<RefPtr<UINode>>::iterator UINode::RemoveChild(const RefPtr<UINode>& child, bool allowTransition)
|
||||
{
|
||||
CHECK_NULL_RETURN(child, children_.end());
|
||||
auto iter = std::find(children_.begin(), children_.end(), child);
|
||||
if (iter == children_.end()) {
|
||||
return children_.end();
|
||||
}
|
||||
auto result = children_.erase(iter);
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t UINode::RemoveChildAndReturnIndex(const RefPtr<UINode>& child)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
UINode::UINode(const std::string& tag, int32_t nodeId, bool isRoot) : tag_(tag), nodeId_(nodeId), isRoot_(isRoot) {}
|
||||
|
||||
void UINode::RemoveChildAtIndex(int32_t index) {}
|
||||
|
||||
RefPtr<UINode> UINode::GetChildAtIndex(int32_t index) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> UINode::GetFocusParent() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<PipelineContext> UINode::GetContext()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
HitTestResult UINode::TouchTest(const PointF& globalPoint, const PointF& parentLocalPoint,
|
||||
const PointF& parentRevertPoint, const TouchRestrict& touchRestrict, TouchTestResult& result, int32_t touchId)
|
||||
{
|
||||
return HitTestResult::OUT_OF_REGION;
|
||||
}
|
||||
|
||||
HitTestResult UINode::MouseTest(const PointF& globalPoint, const PointF& parentLocalPoint,
|
||||
MouseTestResult& onMouseResult, MouseTestResult& onHoverResult, RefPtr<FrameNode>& hoverNode)
|
||||
{
|
||||
return HitTestResult::OUT_OF_REGION;
|
||||
}
|
||||
|
||||
HitTestResult UINode::AxisTest(const PointF& globalPoint, const PointF& parentLocalPoint, AxisTestResult& onAxisResult)
|
||||
{
|
||||
return HitTestResult::OUT_OF_REGION;
|
||||
}
|
||||
|
||||
int32_t UINode::FrameCount() const
|
||||
{
|
||||
return TotalChildCount();
|
||||
}
|
||||
|
||||
int32_t UINode::TotalChildCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t UINode::GetChildIndexById(int32_t id)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
RefPtr<LayoutWrapperNode> UINode::CreateLayoutWrapper(bool forceMeasure, bool forceLayout)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool UINode::MarkRemoving()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UINode::RemoveDisappearingChild(const RefPtr<UINode>& child)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void UINode::UpdateConfigurationUpdate(const OnConfigurationChange& configurationChange) {}
|
||||
|
||||
void UINode::AddDisappearingChild(const RefPtr<UINode>& child, uint32_t) {}
|
||||
|
||||
RefPtr<UINode> UINode::GetDisappearingChildById(const std::string& id) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<UINode> UINode::GetFrameChildByIndex(uint32_t index, bool needBuild)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void UINode::DoRemoveChildInRenderTree(uint32_t index, bool isAll) {}
|
||||
|
||||
void UINode::OnSetCacheCount(int32_t cacheCount, const std::optional<LayoutConstraintF>& itemConstraint) {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/base/view_abstract.h"
|
||||
#include "core/components_ng/base/view_stack_processor.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void ViewAbstract::SetHeight(const CalcLength& height)
|
||||
{
|
||||
if (!ViewStackProcessor::GetInstance()->IsCurrentVisualStateProcess()) {
|
||||
return;
|
||||
}
|
||||
auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode();
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
auto layoutProperty = frameNode->GetLayoutProperty();
|
||||
CHECK_NULL_VOID(layoutProperty);
|
||||
layoutProperty->UpdateUserDefinedIdealSize(CalcSize(std::nullopt, height));
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/base/group_node.h"
|
||||
#include "core/components_ng/base/view_stack_processor.h"
|
||||
#include "core/components_ng/syntax/for_each_node.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
thread_local std::unique_ptr<ViewStackProcessor> ViewStackProcessor::instance = nullptr;
|
||||
|
||||
ViewStackProcessor* ViewStackProcessor::GetInstance()
|
||||
{
|
||||
if (!instance) {
|
||||
instance.reset(new ViewStackProcessor);
|
||||
}
|
||||
return instance.get();
|
||||
}
|
||||
|
||||
ViewStackProcessor::ViewStackProcessor() = default;
|
||||
|
||||
std::string ViewStackProcessor::ProcessViewId(const std::string& viewId)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
RefPtr<FrameNode> ViewStackProcessor::GetMainFrameNode() const
|
||||
{
|
||||
return AceType::DynamicCast<FrameNode>(GetMainElementNode());
|
||||
}
|
||||
|
||||
RefPtr<UINode> ViewStackProcessor::GetMainElementNode() const
|
||||
{
|
||||
if (elementsStack_.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return elementsStack_.top();
|
||||
}
|
||||
|
||||
void ViewStackProcessor::Pop()
|
||||
{
|
||||
if (elementsStack_.empty() || elementsStack_.size() == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto currentNode = Finish();
|
||||
auto parent = GetMainElementNode();
|
||||
if (AceType::InstanceOf<GroupNode>(parent)) {
|
||||
auto groupNode = AceType::DynamicCast<GroupNode>(parent);
|
||||
groupNode->AddChildToGroup(currentNode);
|
||||
return;
|
||||
}
|
||||
currentNode->MountToParent(parent, DEFAULT_NODE_SLOT, AceType::InstanceOf<ForEachNode>(parent));
|
||||
auto currentFrameNode = AceType::DynamicCast<FrameNode>(currentNode);
|
||||
if (currentFrameNode) {
|
||||
currentFrameNode->OnMountToParentDone();
|
||||
}
|
||||
LOGD("ViewStackProcessor Pop size %{public}d", static_cast<int32_t>(elementsStack_.size()));
|
||||
}
|
||||
|
||||
void ViewStackProcessor::PopContainer()
|
||||
{
|
||||
auto top = GetMainElementNode();
|
||||
// for container node.
|
||||
if (top && !top->IsAtomicNode()) {
|
||||
Pop();
|
||||
return;
|
||||
}
|
||||
|
||||
while (top && (top->IsAtomicNode())) {
|
||||
if (elementsStack_.size() == 1) {
|
||||
return;
|
||||
}
|
||||
Pop();
|
||||
top = GetMainElementNode();
|
||||
}
|
||||
Pop();
|
||||
}
|
||||
|
||||
void ViewStackProcessor::Push(const RefPtr<UINode>& element, bool /*isCustomView*/)
|
||||
{
|
||||
elementsStack_.push(element);
|
||||
}
|
||||
|
||||
RefPtr<UINode> ViewStackProcessor::Finish()
|
||||
{
|
||||
auto element = elementsStack_.top();
|
||||
elementsStack_.pop();
|
||||
return element;
|
||||
}
|
||||
|
||||
bool ViewStackProcessor::IsCurrentVisualStateProcess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ScopedViewStackProcessor::ScopedViewStackProcessor()
|
||||
{
|
||||
std::swap(instance_, ViewStackProcessor::instance);
|
||||
}
|
||||
|
||||
ScopedViewStackProcessor::~ScopedViewStackProcessor()
|
||||
{
|
||||
std::swap(instance_, ViewStackProcessor::instance);
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/focus_hub.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void FocusHub::RemoveSelf(BlurReason reason) {}
|
||||
|
||||
bool FocusHub::IsEnabled() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FocusHub::IsFocusable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void FocusHub::SetFocusable(bool focusable) {}
|
||||
|
||||
bool FocusHub::RequestFocusImmediately()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FocusHub::OnClick(const KeyEvent& event)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FocusHub::PaintFocusState(bool isNeedStateStyles)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void FocusHub::ClearFocusState(bool isNeedStateStyles) {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/gesture_event_hub.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
GestureEventHub::GestureEventHub(const WeakPtr<EventHub>& eventHub) : eventHub_(eventHub) {}
|
||||
|
||||
bool GestureEventHub::ProcessTouchTestHit(const OffsetF& coordinateOffset, const TouchRestrict& touchRestrict,
|
||||
TouchTestResult& innerTargets, TouchTestResult& finalResult, int32_t touchId, const PointF& localPoint)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void GestureEventHub::CombineIntoExclusiveRecognizer(
|
||||
const PointF& globalPoint, const PointF& localPoint, TouchTestResult& result, int32_t touchId)
|
||||
{}
|
||||
|
||||
void GestureEventHub::OnModifyDone() {}
|
||||
void GestureEventHub::AddClickEvent(const RefPtr<ClickEvent>& clickEvent) {}
|
||||
void GestureEventHub::SetUserOnClick(GestureEventFunc&& clickEvent) {}
|
||||
void GestureEventHub::BindMenu(GestureEventFunc&& showMenu) {}
|
||||
|
||||
std::string GestureEventHub::GetHitTestModeStr() const
|
||||
{
|
||||
return "HitTestMode.Default";
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/event/event_hub.h"
|
||||
#include "core/components_ng/event/input_event_hub.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
InputEventHub::InputEventHub(const WeakPtr<EventHub>& eventHub) : eventHub_(eventHub) {}
|
||||
|
||||
bool InputEventHub::ProcessMouseTestHit(const OffsetF& coordinateOffset, TouchTestResult& result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InputEventHub::ProcessAxisTestHit(const OffsetF& coordinateOffset, AxisTestResult& onAxisResult)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string InputEventHub::GetHoverEffectStr() const
|
||||
{
|
||||
return "HoverEffect.Auto";
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/click_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
ClickRecognizer::ClickRecognizer(int32_t fingers, int32_t count) {}
|
||||
|
||||
void ClickRecognizer::OnAccepted() {}
|
||||
|
||||
void ClickRecognizer::OnRejected() {}
|
||||
|
||||
void ClickRecognizer::HandleTouchDownEvent(const TouchEvent& event) {}
|
||||
|
||||
void ClickRecognizer::HandleTouchUpEvent(const TouchEvent& event) {}
|
||||
|
||||
void ClickRecognizer::HandleTouchMoveEvent(const TouchEvent& event) {}
|
||||
|
||||
void ClickRecognizer::HandleTouchCancelEvent(const TouchEvent& event) {}
|
||||
|
||||
void ClickRecognizer::HandleOverdueDeadline() {}
|
||||
|
||||
bool ClickRecognizer::ReconcileFrom(const RefPtr<NGGestureRecognizer>& /* recognizer */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
RefPtr<GestureSnapshot> ClickRecognizer::Dump() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/exclusive_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void ExclusiveRecognizer::OnAccepted() {}
|
||||
|
||||
void ExclusiveRecognizer::OnRejected() {}
|
||||
|
||||
void ExclusiveRecognizer::OnPending() {}
|
||||
|
||||
void ExclusiveRecognizer::OnBlocked() {}
|
||||
|
||||
bool ExclusiveRecognizer::HandleEvent(const TouchEvent& /* point */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ExclusiveRecognizer::HandleEvent(const AxisEvent& /* event */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExclusiveRecognizer::BatchAdjudicate(const RefPtr<NGGestureRecognizer>& recognizer, GestureDisposal disposal) {}
|
||||
|
||||
bool ExclusiveRecognizer::ReconcileFrom(const RefPtr<NGGestureRecognizer>& /* recognizer */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void ExclusiveRecognizer::OnResetStatus() {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/gesture_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
bool NGGestureRecognizer::HandleEvent(const TouchEvent& /* point */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NGGestureRecognizer::HandleEvent(const AxisEvent& /* event */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unordered_map<int, TransformConfig>& NGGestureRecognizer::GetGlobalTransCfg()
|
||||
{
|
||||
std::unordered_map<int, TransformConfig> transCfg {};
|
||||
return transCfg;
|
||||
}
|
||||
|
||||
std::unordered_map<int, AncestorNodeInfo>& NGGestureRecognizer::GetGlobalTransIds()
|
||||
{
|
||||
std::unordered_map<int, AncestorNodeInfo> transVid {};
|
||||
return transVid;
|
||||
}
|
||||
|
||||
void NGGestureRecognizer::ResetGlobalTransCfg() {}
|
||||
|
||||
void NGGestureRecognizer::BatchAdjudicate(const RefPtr<NGGestureRecognizer>& recognizer, GestureDisposal disposal) {}
|
||||
|
||||
void NGGestureRecognizer::Transform(PointF& windowPointF, PointF& originPointF) {}
|
||||
|
||||
void NGGestureRecognizer::SetTransInfo(int id) {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/long_press_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
LongPressRecognizer::LongPressRecognizer(
|
||||
int32_t duration, int32_t fingers, bool repeat, bool isForDrag, bool isDisableMouseLeft) {}
|
||||
|
||||
void LongPressRecognizer::OnAccepted() {}
|
||||
|
||||
void LongPressRecognizer::OnRejected() {}
|
||||
|
||||
void LongPressRecognizer::HandleTouchDownEvent(const TouchEvent& event) {}
|
||||
|
||||
void LongPressRecognizer::HandleTouchUpEvent(const TouchEvent& /* event */) {}
|
||||
|
||||
void LongPressRecognizer::HandleTouchMoveEvent(const TouchEvent& event) {}
|
||||
|
||||
void LongPressRecognizer::HandleTouchCancelEvent(const TouchEvent& event) {}
|
||||
|
||||
bool LongPressRecognizer::ReconcileFrom(const RefPtr<NGGestureRecognizer>& /* recognizer */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void LongPressRecognizer::OnResetStatus() {}
|
||||
|
||||
GestureEventFunc LongPressRecognizer::GetLongPressActionFunc()
|
||||
{
|
||||
return [](GestureEvent& info) {};
|
||||
}
|
||||
|
||||
RefPtr<GestureSnapshot> LongPressRecognizer::Dump() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/pan_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
PanRecognizer::PanRecognizer(int32_t fingers, const PanDirection& direction, double distance) {}
|
||||
|
||||
void PanRecognizer::OnAccepted() {}
|
||||
|
||||
void PanRecognizer::OnRejected() {}
|
||||
|
||||
void PanRecognizer::HandleTouchDownEvent(const TouchEvent& event) {}
|
||||
|
||||
void PanRecognizer::HandleTouchDownEvent(const AxisEvent& event) {}
|
||||
|
||||
void PanRecognizer::HandleTouchUpEvent(const TouchEvent& event) {}
|
||||
|
||||
void PanRecognizer::HandleTouchUpEvent(const AxisEvent& event) {}
|
||||
|
||||
void PanRecognizer::HandleTouchMoveEvent(const TouchEvent& event) {}
|
||||
|
||||
void PanRecognizer::OnFlushTouchEventsBegin() {}
|
||||
|
||||
void PanRecognizer::OnFlushTouchEventsEnd() {}
|
||||
|
||||
void PanRecognizer::HandleTouchMoveEvent(const AxisEvent& event) {}
|
||||
|
||||
void PanRecognizer::HandleTouchCancelEvent(const TouchEvent& /* event */) {}
|
||||
|
||||
void PanRecognizer::HandleTouchCancelEvent(const AxisEvent& /* event */) {}
|
||||
|
||||
void PanRecognizer::OnResetStatus() {}
|
||||
|
||||
void PanRecognizer::OnSucceedCancel() {}
|
||||
|
||||
void PanRecognizer::SetDirection(OHOS::Ace::PanDirection const& direction) {}
|
||||
|
||||
bool PanRecognizer::ReconcileFrom(const RefPtr<NGGestureRecognizer>& /* recognizer */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
RefPtr<GestureSnapshot> PanRecognizer::Dump() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/parallel_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void ParallelRecognizer::OnAccepted() {}
|
||||
|
||||
void ParallelRecognizer::OnRejected() {}
|
||||
|
||||
void ParallelRecognizer::OnPending() {}
|
||||
|
||||
void ParallelRecognizer::OnBlocked() {}
|
||||
|
||||
bool ParallelRecognizer::HandleEvent(const TouchEvent& /* point */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ParallelRecognizer::HandleEvent(const AxisEvent& /* event */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ParallelRecognizer::BatchAdjudicate(const RefPtr<NGGestureRecognizer>& recognizer, GestureDisposal disposal) {}
|
||||
|
||||
bool ParallelRecognizer::ReconcileFrom(const RefPtr<NGGestureRecognizer>& /* recognizer */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/recognizer_group.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void RecognizerGroup::AddChildren(const std::list<RefPtr<NGGestureRecognizer>>& recognizers) {}
|
||||
|
||||
void RecognizerGroup::OnFlushTouchEventsBegin() {}
|
||||
|
||||
void RecognizerGroup::OnFlushTouchEventsEnd() {}
|
||||
|
||||
void RecognizerGroup::OnBeginGestureReferee(int32_t touchId, bool needUpdateChild) {}
|
||||
|
||||
void RecognizerGroup::OnFinishGestureReferee(int32_t touchId, bool isBlocked) {}
|
||||
|
||||
void RecognizerGroup::OnResetStatus() {}
|
||||
|
||||
const std::list<RefPtr<NGGestureRecognizer>>& RecognizerGroup::GetGroupRecognizer()
|
||||
{
|
||||
std::list<RefPtr<NGGestureRecognizer>> groupRecognizer;
|
||||
return groupRecognizer;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/gestures/recognizers/sequenced_recognizer.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void SequencedRecognizer::OnAccepted() {}
|
||||
|
||||
void SequencedRecognizer::OnRejected() {}
|
||||
|
||||
void SequencedRecognizer::OnPending() {}
|
||||
|
||||
void SequencedRecognizer::OnBlocked() {}
|
||||
|
||||
bool SequencedRecognizer::HandleEvent(const TouchEvent& /* point */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void SequencedRecognizer::BatchAdjudicate(const RefPtr<NGGestureRecognizer>& recognizer, GestureDisposal disposal) {}
|
||||
|
||||
void SequencedRecognizer::OnResetStatus() {}
|
||||
|
||||
bool SequencedRecognizer::ReconcileFrom(const RefPtr<NGGestureRecognizer>& /* recognizer */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "base/geometry/ng/size_t.h"
|
||||
#include "core/components_ng/layout/box_layout_algorithm.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void BoxLayoutAlgorithm::Measure(LayoutWrapper* layoutWrapper) {}
|
||||
void BoxLayoutAlgorithm::Layout(LayoutWrapper* layoutWrapper) {}
|
||||
|
||||
std::optional<SizeF> BoxLayoutAlgorithm::MeasureContent(
|
||||
const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper)
|
||||
{
|
||||
return std::optional<SizeF>();
|
||||
}
|
||||
|
||||
void BoxLayoutAlgorithm::PerformMeasureSelf(LayoutWrapper* layoutWrapper) {}
|
||||
void BoxLayoutAlgorithm::PerformLayout(LayoutWrapper* layoutWrapper) {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,200 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/layout/layout_property.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
void LayoutProperty::Reset() {}
|
||||
void LayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json) const {}
|
||||
void LayoutProperty::FromJson(const std::unique_ptr<JsonValue>& json) {}
|
||||
|
||||
RefPtr<LayoutProperty> LayoutProperty::Clone() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LayoutProperty::SetHost(const WeakPtr<FrameNode>& host)
|
||||
{
|
||||
host_ = host;
|
||||
}
|
||||
|
||||
void LayoutProperty::Clone(RefPtr<LayoutProperty> layoutProperty) const {}
|
||||
|
||||
void LayoutProperty::UpdateCalcLayoutProperty(const MeasureProperty& constraint)
|
||||
{
|
||||
if (!calcLayoutConstraint_) {
|
||||
calcLayoutConstraint_ = std::make_unique<MeasureProperty>(constraint);
|
||||
propertyChangeFlag_ = propertyChangeFlag_ | PROPERTY_UPDATE_MEASURE;
|
||||
return;
|
||||
}
|
||||
if (*calcLayoutConstraint_ == constraint) {
|
||||
return;
|
||||
}
|
||||
calcLayoutConstraint_->selfIdealSize = constraint.selfIdealSize;
|
||||
calcLayoutConstraint_->maxSize = constraint.maxSize;
|
||||
calcLayoutConstraint_->minSize = constraint.minSize;
|
||||
propertyChangeFlag_ = propertyChangeFlag_ | PROPERTY_UPDATE_MEASURE;
|
||||
}
|
||||
|
||||
void LayoutProperty::UpdateLayoutProperty(const LayoutProperty* layoutProperty) {}
|
||||
|
||||
void LayoutProperty::UpdateLayoutConstraint(const LayoutConstraintF& parentConstraint)
|
||||
{
|
||||
layoutConstraint_ = parentConstraint;
|
||||
}
|
||||
|
||||
void LayoutProperty::OnVisibilityUpdate(VisibleType visible, bool allowTransition) {}
|
||||
|
||||
RefPtr<FrameNode> LayoutProperty::GetHost() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LayoutConstraintF LayoutProperty::CreateChildConstraint() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void BuildGridProperty(const RefPtr<FrameNode>& host) {}
|
||||
|
||||
void UpdateContentConstraint() {}
|
||||
|
||||
MarginPropertyF CreateMargin()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
PaddingPropertyF CreatePaddingAndBorder()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
bool LayoutProperty::HasFixedWidth() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LayoutProperty::HasFixedHeight() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LayoutProperty::HasAspectRatio() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float LayoutProperty::GetAspectRatio() const
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void LayoutProperty::UpdateAspectRatio(float ratio) {}
|
||||
|
||||
void LayoutProperty::UpdateGeometryTransition(const std::string& id, bool followWithoutTransition) {}
|
||||
|
||||
void LayoutProperty::UpdateLayoutDirection(TextDirection value) {}
|
||||
|
||||
void LayoutProperty::UpdateLayoutWeight(float value) {}
|
||||
|
||||
void LayoutProperty::UpdateBorderWidth(const BorderWidthProperty& value) {}
|
||||
|
||||
void LayoutProperty::UpdateAlignment(Alignment value) {}
|
||||
|
||||
void LayoutProperty::UpdateMargin(const MarginProperty& value) {}
|
||||
|
||||
void LayoutProperty::UpdatePadding(const PaddingProperty& value) {}
|
||||
|
||||
void LayoutProperty::UpdateUserDefinedIdealSize(const CalcSize& value) {}
|
||||
|
||||
void LayoutProperty::ClearUserDefinedIdealSize(bool clearWidth, bool clearHeight) {}
|
||||
|
||||
void LayoutProperty::UpdateCalcMinSize(const CalcSize& value) {}
|
||||
|
||||
void LayoutProperty::UpdateCalcMaxSize(const CalcSize& value) {}
|
||||
|
||||
void LayoutProperty::UpdateMarginSelfIdealSize(const SizeF& value) {}
|
||||
|
||||
void LayoutProperty::ResetCalcMinSize() {}
|
||||
|
||||
void LayoutProperty::UpdateFlexGrow(float flexGrow) {}
|
||||
|
||||
void LayoutProperty::ResetFlexGrow() {}
|
||||
|
||||
void LayoutProperty::UpdateFlexShrink(float flexShrink) {}
|
||||
|
||||
void LayoutProperty::ResetFlexShrink() {}
|
||||
|
||||
void LayoutProperty::UpdateFlexBasis(const Dimension& flexBasis) {}
|
||||
|
||||
void LayoutProperty::UpdateAlignSelf(const FlexAlign& flexAlign) {}
|
||||
|
||||
void LayoutProperty::ResetAlignSelf() {}
|
||||
|
||||
void LayoutProperty::UpdateAlignRules(const std::map<AlignDirection, AlignRule>& alignRules) {}
|
||||
|
||||
void LayoutProperty::UpdateDisplayIndex(int32_t displayIndex) {}
|
||||
|
||||
LayoutConstraintF LayoutProperty::CreateContentConstraint() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void LayoutProperty::UpdateLayoutConstraint(const RefPtr<LayoutProperty>& layoutProperty) {}
|
||||
|
||||
void LayoutProperty::UpdateVisibility(const VisibleType& value, bool allowTransition) {}
|
||||
|
||||
void LayoutProperty::SetOverlayOffset(
|
||||
const std::optional<Dimension>& overlayOffsetX, const std::optional<Dimension>& overlayOffsetY)
|
||||
{}
|
||||
|
||||
void LayoutProperty::GetOverlayOffset(Dimension& overlayOffsetX, Dimension& overlayOffsetY) {}
|
||||
|
||||
void LayoutProperty::UpdateAllGeometryTransition(const RefPtr<UINode>& parent) {}
|
||||
|
||||
bool LayoutProperty::UpdateGridOffset(const RefPtr<FrameNode>& host)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void LayoutProperty::BuildGridProperty(const RefPtr<FrameNode>& host) {}
|
||||
|
||||
void LayoutProperty::UpdateContentConstraint() {}
|
||||
|
||||
MarginPropertyF LayoutProperty::CreateMargin()
|
||||
{
|
||||
return MarginPropertyF();
|
||||
}
|
||||
|
||||
PaddingPropertyF LayoutProperty::CreatePaddingAndBorder()
|
||||
{
|
||||
return PaddingPropertyF();
|
||||
}
|
||||
|
||||
std::pair<bool, bool> LayoutProperty::GetPercentSensitive()
|
||||
{
|
||||
return { false, false };
|
||||
}
|
||||
|
||||
std::pair<bool, bool> LayoutProperty::UpdatePercentSensitive(bool width, bool height)
|
||||
{
|
||||
return { widthPercentSensitive_, heightPercentSensitive_ };
|
||||
}
|
||||
|
||||
bool LayoutProperty::ConstraintEqual(const std::optional<LayoutConstraintF>& preLayoutConstraint,
|
||||
const std::optional<LayoutConstraintF>& preContentConstraint)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,97 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/layout/layout_wrapper.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
|
||||
const RefPtr<LayoutAlgorithmWrapper>& GetLayoutAlgorithm(bool needReset = false)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Measure(const std::optional<LayoutConstraintF>& parentConstraint) {}
|
||||
|
||||
void Layout() {}
|
||||
|
||||
int32_t GetTotalChildCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const RefPtr<GeometryNode>& GetGeometryNode()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const RefPtr<LayoutProperty>& GetLayoutProperty()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<LayoutWrapper> GetOrCreateChildByIndex(uint32_t index, bool addToRenderTree = true)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const std::list<RefPtr<LayoutWrapper>>& GetAllChildrenWithBuild(bool addToRenderTree = true)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void RemoveChildInRenderTree(uint32_t index) {}
|
||||
|
||||
void RemoveAllChildInRenderTree() {}
|
||||
|
||||
RefPtr<FrameNode> GetHostNode()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const std::string& GetHostTag()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
bool IsActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetActive(bool active = true) {}
|
||||
|
||||
bool SkipMeasureContent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetCacheCount(int32_t cacheCount = 0, const std::optional<LayoutConstraintF>& itemConstraint = std::nullopt) {}
|
||||
|
||||
float GetBaselineDistance()
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
bool CheckNeedForceMeasureAndLayout()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void AddNodeFlexLayouts() {}
|
||||
|
||||
void AddNodeLayoutTime(int64_t time) {}
|
||||
|
||||
void RestoreGeoState() {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "core/components_ng/manager/drag_drop/drag_drop_manager.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
namespace {
|
||||
std::string ITEM_DRAG_START("OnItemDragStart");
|
||||
std::string ON_DRAG_START("OnDragStart");
|
||||
constexpr int32_t CURRENT_ID = 1;
|
||||
int64_t g_proxyId = 0;
|
||||
} // namespace
|
||||
|
||||
RefPtr<DragDropProxy> DragDropManager::CreateAndShowDragWindow(
|
||||
const RefPtr<PixelMap>& pixelMap, const GestureEvent& info)
|
||||
{
|
||||
currentId_ = ++g_proxyId;
|
||||
return MakeRefPtr<DragDropProxy>(currentId_);
|
||||
}
|
||||
|
||||
RefPtr<DragDropProxy> DragDropManager::CreateAndShowDragWindow(
|
||||
const RefPtr<UINode>& customNode, const GestureEvent& info)
|
||||
{
|
||||
currentId_ = ++g_proxyId;
|
||||
return MakeRefPtr<DragDropProxy>(currentId_);
|
||||
}
|
||||
|
||||
RefPtr<DragDropProxy> DragDropManager::CreateTextDragDropProxy()
|
||||
{
|
||||
currentId_ = ++g_proxyId;
|
||||
return MakeRefPtr<DragDropProxy>(currentId_);
|
||||
}
|
||||
|
||||
bool DragDropManager::CheckDragDropProxy(int64_t id) const
|
||||
{
|
||||
return CURRENT_ID == id;
|
||||
}
|
||||
|
||||
void DragDropManager::UpdateDragWindowPosition(int32_t globalX, int32_t globalY) {}
|
||||
|
||||
void DragDropManager::OnDragStart(const Point& point, const RefPtr<FrameNode>& frameNode)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnDragStart has called";
|
||||
frameNode->SetNodeName(ON_DRAG_START);
|
||||
}
|
||||
|
||||
void DragDropManager::OnDragMove(const Point& point, const std::string& /* extraInfo */)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnDragMove has called";
|
||||
}
|
||||
|
||||
void DragDropManager::OnDragEnd(const Point& point, const std::string& /* extraInfo */)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnDragEnd has called";
|
||||
}
|
||||
|
||||
void DragDropManager::OnTextDragEnd(float globalX, float globalY, const std::string& extraInfo)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnTextDragEnd has called";
|
||||
}
|
||||
|
||||
void DragDropManager::onDragCancel()
|
||||
{
|
||||
GTEST_LOG_(INFO) << "onDragCancel has called";
|
||||
}
|
||||
|
||||
void DragDropManager::OnItemDragStart(float /* globalX */, float /* globalY */, const RefPtr<FrameNode>& frameNode)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnItemDragStart has called";
|
||||
frameNode->SetNodeName(ITEM_DRAG_START);
|
||||
}
|
||||
|
||||
void DragDropManager::OnItemDragMove(
|
||||
float /* globalX */, float /* globalY */, int32_t /* draggedIndex */, DragType /* dragType */)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnItemDragMove has called";
|
||||
}
|
||||
void DragDropManager::OnItemDragEnd(
|
||||
float /* globalX */, float /* globalY */, int32_t /* draggedIndex */, DragType /* dragType */)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "OnItemDragEnd has called";
|
||||
}
|
||||
|
||||
void DragDropManager::onItemDragCancel()
|
||||
{
|
||||
GTEST_LOG_(INFO) << "onItemDragCancel has called";
|
||||
}
|
||||
|
||||
void DragDropManager::AddDataToClipboard(const std::string& extraInfo)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "AddDataToClipboard has called, extraInfo is " << extraInfo;
|
||||
}
|
||||
|
||||
void DragDropManager::GetExtraInfoFromClipboard(std::string& /* extraInfo */)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "GetExtraInfoFromClipboard has called";
|
||||
}
|
||||
|
||||
void DragDropManager::RestoreClipboardData()
|
||||
{
|
||||
GTEST_LOG_(INFO) << "RestoreClipboardData has called";
|
||||
}
|
||||
|
||||
void DragDropManager::DestroyDragWindow() {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/manager/drag_drop/drag_drop_proxy.h"
|
||||
#include "core/pipeline_ng/pipeline_context.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
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();
|
||||
CHECK_NULL_VOID(pipeline);
|
||||
auto manager = pipeline->GetDragDropManager();
|
||||
CHECK_NULL_VOID(manager);
|
||||
CHECK_NULL_VOID(manager->CheckDragDropProxy(id_));
|
||||
}
|
||||
|
||||
void DragDropProxy::OnDragMove(const GestureEvent& info) {}
|
||||
|
||||
void DragDropProxy::OnDragEnd(const GestureEvent& info, bool isTextDragEnd) {}
|
||||
|
||||
void DragDropProxy::onDragCancel() {}
|
||||
|
||||
void DragDropProxy::OnItemDragStart(const GestureEvent& info, const RefPtr<FrameNode>& frameNode) {}
|
||||
|
||||
void DragDropProxy::OnItemDragMove(const GestureEvent& info, int32_t draggedIndex, DragType dragType) {}
|
||||
|
||||
void DragDropProxy::OnItemDragEnd(const GestureEvent& info, int32_t draggedIndex, DragType dragType) {}
|
||||
|
||||
void DragDropProxy::onItemDragCancel() {}
|
||||
|
||||
void DragDropProxy::DestroyDragWindow() {}
|
||||
} // namespace OHOS::Ace::NG
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core/components_ng/manager/select_overlay/select_overlay_manager.h"
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
namespace {
|
||||
// SELECT_OVERLAY_ID is seen as the default SELECT_OVERLAY_ID
|
||||
constexpr int32_t SELECT_OVERLAY_ID = 143;
|
||||
} // namespace
|
||||
|
||||
RefPtr<SelectOverlayProxy> SelectOverlayManager::CreateAndShowSelectOverlay(
|
||||
const SelectOverlayInfo& info, const WeakPtr<SelectionHost>& host, bool animation)
|
||||
{
|
||||
return MakeRefPtr<SelectOverlayProxy>(0);
|
||||
}
|
||||
|
||||
void SelectOverlayManager::DestroySelectOverlay(const RefPtr<SelectOverlayProxy>& proxy, bool animation) {}
|
||||
|
||||
void SelectOverlayManager::DestroySelectOverlay(int32_t overlayId, bool animation) {}
|
||||
|
||||
void SelectOverlayManager::DestroySelectOverlay(bool animation) {}
|
||||
|
||||
bool SelectOverlayManager::IsInSelectedOrSelectOverlayArea(const PointF& point)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SelectOverlayManager::HasSelectOverlay(int32_t overlayId)
|
||||
{
|
||||
return SELECT_OVERLAY_ID == overlayId;
|
||||
}
|
||||
|
||||
RefPtr<SelectOverlayNode> SelectOverlayManager::GetSelectOverlayNode(int32_t overlayId)
|
||||
{
|
||||
SelectOverlayInfo info;
|
||||
info.singleLineHeight = static_cast<float>(overlayId);
|
||||
auto infoPtr = std::make_shared<SelectOverlayInfo>(info);
|
||||
auto selectOverlayNode = DynamicCast<SelectOverlayNode>(SelectOverlayNode::CreateSelectOverlayNode(infoPtr));
|
||||
return selectOverlayNode;
|
||||
}
|
||||
|
||||
void SelectOverlayManager::HandleGlobalEvent(const TouchEvent& touchPoint, const NG::OffsetF& rootOffset) {}
|
||||
} // namespace OHOS::Ace::NG
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user