mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-10-07 00:13:44 +00:00
aafwk->ability_runtime
Signed-off-by: zhoushicheng <zhoushicheng2@huawei.com> Change-Id: I04fff1a4b609cfc06fb0586460cbf8a596edef79
This commit is contained in:
commit
62893be371
@ -53,8 +53,7 @@ if (!defined(aosp_libs_dir)) {
|
||||
libs_root = "${aosp_libs_dir}/sdk"
|
||||
|
||||
ability_runtime_path = "//foundation/ability/ability_runtime"
|
||||
ability_runtime_inner_api_path =
|
||||
"${ability_runtime_path}/interfaces/inner_api"
|
||||
ability_runtime_inner_api_path = "${ability_runtime_path}/interfaces/inner_api"
|
||||
ability_runtime_inner_kits_path = "${ability_runtime_path}/interfaces/kits"
|
||||
ability_runtime_kits_path = "${ability_runtime_path}/frameworks/kits"
|
||||
ability_runtime_services_path = "${ability_runtime_path}/services"
|
||||
@ -92,7 +91,7 @@ if (is_standard_system) {
|
||||
|
||||
# Config part name
|
||||
if (is_standard_system) {
|
||||
ace_engine_part = "ace_engine_standard"
|
||||
ace_engine_part = "ace_engine"
|
||||
hilog_deps = [ "hiviewdfx_hilog_native:libhilog" ]
|
||||
ark_runtime_path = "//ark/runtime_core"
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ohos/ace_engine_standard",
|
||||
"name": "@ohos/ace_engine",
|
||||
"description": "ArkUI Cross-Platform Engine for UI layout measure and paint",
|
||||
"version": "3.1",
|
||||
"license": "Apache 2.0",
|
||||
@ -10,7 +10,7 @@
|
||||
"dirs": {},
|
||||
"scripts": {},
|
||||
"component": {
|
||||
"name": "ace_engine_standard",
|
||||
"name": "ace_engine",
|
||||
"subsystem": "arkui",
|
||||
"syscap": [],
|
||||
"features": [],
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"subsystem": "arkui",
|
||||
"parts": {
|
||||
"ace_engine_standard": {
|
||||
"ace_engine": {
|
||||
"version": "1.0.0",
|
||||
"interface-version": {},
|
||||
"variants": [
|
||||
|
@ -1107,7 +1107,7 @@ void AceContainer::AttachView(std::unique_ptr<Window> window, AceView* view, dou
|
||||
pipelineContext_->SetDataProviderManager(dataProviderManager);
|
||||
|
||||
#if defined(ENABLE_ROSEN_BACKEND) and !defined(UPLOAD_GPU_DISABLED)
|
||||
pipelineContext_->SetPostRSTaskCallBack([](std::function<void()>&& task) {
|
||||
pipelineContext_->SetPostRTTaskCallBack([](std::function<void()>&& task) {
|
||||
auto syncTask = std::make_shared<AceRosenSyncTask>(std::move(task));
|
||||
Rosen::RSTransactionProxy::GetInstance()->ExecuteSynchronousTask(syncTask);
|
||||
});
|
||||
|
@ -92,6 +92,7 @@ template("ace_osal_ohos_source_set") {
|
||||
"hisysevent_native:libhisysevent",
|
||||
"hitrace_native:libhitrace",
|
||||
]
|
||||
deps += [ "//foundation/graphic/graphic_2d/rosen/modules/frame_analyzer:libframe_analyzer" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <frame_collector.h>
|
||||
|
||||
#include "base/log/log_wrapper.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
@ -94,6 +96,11 @@ void FrameReport::Init()
|
||||
}
|
||||
|
||||
int FrameReport::GetEnable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int FrameReport::GetFrameReportEnable()
|
||||
{
|
||||
if (!frameSchedSoLoaded_) {
|
||||
return 0;
|
||||
@ -102,13 +109,17 @@ int FrameReport::GetEnable()
|
||||
if (frameGetEnableFunc_ != nullptr) {
|
||||
return frameGetEnableFunc_();
|
||||
} else {
|
||||
LOGE("frame-ace:[GetEnable]load GetSenseSchedEnable function failed!");
|
||||
LOGE("frame-ace:[GetFrameReportEnable]load GetSenseSchedEnable function failed!");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void FrameReport::BeginFlushAnimation()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::AnimateStart);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginFlushAnimationFunc_ = (BeginFlushAnimationFunc)LoadSymbol("BeginFlushAnimation");
|
||||
if (beginFlushAnimationFunc_ != nullptr) {
|
||||
beginFlushAnimationFunc_();
|
||||
@ -119,6 +130,10 @@ void FrameReport::BeginFlushAnimation()
|
||||
|
||||
void FrameReport::EndFlushAnimation()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::AnimateEnd);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
endFlushAnimationFunc_ = (EndFlushAnimationFunc)LoadSymbol("EndFlushAnimation");
|
||||
if (endFlushAnimationFunc_ != nullptr) {
|
||||
endFlushAnimationFunc_();
|
||||
@ -129,6 +144,10 @@ void FrameReport::EndFlushAnimation()
|
||||
|
||||
void FrameReport::BeginFlushBuild()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::BuildStart);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginFlushBuildFunc_ = (BeginFlushBuildFunc)LoadSymbol("BeginFlushBuild");
|
||||
if (beginFlushBuildFunc_ != nullptr) {
|
||||
beginFlushBuildFunc_();
|
||||
@ -139,6 +158,10 @@ void FrameReport::BeginFlushBuild()
|
||||
|
||||
void FrameReport::EndFlushBuild()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::BuildEnd);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
endFlushBuildFunc_ = (EndFlushBuildFunc)LoadSymbol("EndFlushBuild");
|
||||
if (endFlushBuildFunc_ != nullptr) {
|
||||
endFlushBuildFunc_();
|
||||
@ -149,6 +172,10 @@ void FrameReport::EndFlushBuild()
|
||||
|
||||
void FrameReport::BeginFlushLayout()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::LayoutStart);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginFlushLayoutFunc_ = (BeginFlushLayoutFunc)LoadSymbol("BeginFlushLayout");
|
||||
if (beginFlushLayoutFunc_ != nullptr) {
|
||||
beginFlushLayoutFunc_();
|
||||
@ -159,6 +186,10 @@ void FrameReport::BeginFlushLayout()
|
||||
|
||||
void FrameReport::EndFlushLayout()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::LayoutEnd);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
endFlushLayoutFunc_ = (EndFlushLayoutFunc)LoadSymbol("EndFlushLayout");
|
||||
if (endFlushLayoutFunc_ != nullptr) {
|
||||
endFlushLayoutFunc_();
|
||||
@ -169,6 +200,10 @@ void FrameReport::EndFlushLayout()
|
||||
|
||||
void FrameReport::BeginFlushRender()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::DrawStart);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginFlushRenderFunc_ = (BeginFlushRenderFunc)LoadSymbol("BeginFlushRender");
|
||||
if (beginFlushRenderFunc_ != nullptr) {
|
||||
beginFlushRenderFunc_();
|
||||
@ -179,6 +214,9 @@ void FrameReport::BeginFlushRender()
|
||||
|
||||
void FrameReport::EndFlushRender()
|
||||
{
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
endFlushRenderFunc_ = (EndFlushRenderFunc)LoadSymbol("EndFlushRender");
|
||||
if (endFlushRenderFunc_ != nullptr) {
|
||||
endFlushRenderFunc_();
|
||||
@ -189,6 +227,9 @@ void FrameReport::EndFlushRender()
|
||||
|
||||
void FrameReport::BeginFlushRenderFinish()
|
||||
{
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginFlushRenderFinishFunc_ = (BeginFlushRenderFinishFunc)LoadSymbol("BeginFlushRenderFinish");
|
||||
if (beginFlushRenderFinishFunc_ != nullptr) {
|
||||
beginFlushRenderFinishFunc_();
|
||||
@ -199,6 +240,10 @@ void FrameReport::BeginFlushRenderFinish()
|
||||
|
||||
void FrameReport::EndFlushRenderFinish()
|
||||
{
|
||||
Rosen::FrameCollector::GetInstance().MarkFrameEvent(Rosen::FrameEventType::DrawEnd);
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
endFlushRenderFinishFunc_ = (EndFlushRenderFinishFunc)LoadSymbol("EndFlushRenderFinish");
|
||||
if (endFlushRenderFinishFunc_ != nullptr) {
|
||||
endFlushRenderFinishFunc_();
|
||||
@ -209,6 +254,9 @@ void FrameReport::EndFlushRenderFinish()
|
||||
|
||||
void FrameReport::BeginProcessPostFlush()
|
||||
{
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginProcessPostFunc_ = (BeginProcessPostFlushFunc)LoadSymbol("BeginProcessPostFlush");
|
||||
if (beginProcessPostFunc_ != nullptr) {
|
||||
beginProcessPostFunc_();
|
||||
@ -219,6 +267,9 @@ void FrameReport::BeginProcessPostFlush()
|
||||
|
||||
void FrameReport::BeginListFling()
|
||||
{
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
beginListFlingFunc_ = (BeginListFlingFunc)LoadSymbol("BeginListFling");
|
||||
if (beginListFlingFunc_ != nullptr) {
|
||||
beginListFlingFunc_();
|
||||
@ -229,6 +280,9 @@ void FrameReport::BeginListFling()
|
||||
|
||||
void FrameReport::EndListFling()
|
||||
{
|
||||
if (GetFrameReportEnable() == 0) {
|
||||
return;
|
||||
}
|
||||
endListFlingFunc_ = (EndListFlingFunc)LoadSymbol("EndListFling");
|
||||
if (endListFlingFunc_ != nullptr) {
|
||||
endListFlingFunc_();
|
||||
|
@ -40,6 +40,6 @@ gen_sa_dialog_js("dialog_picker_js_files_etc") {
|
||||
"common/ic_xls.png",
|
||||
]
|
||||
dialog_name = "dialog_picker_service"
|
||||
part_name = "ace_engine_standard"
|
||||
part_name = ace_engine_part
|
||||
subsystem_name = "arkui"
|
||||
}
|
||||
|
@ -170,12 +170,12 @@ void AceAbility::InitEnv()
|
||||
appResourcesPath.append(DELIMITER);
|
||||
}
|
||||
if (runArgs_.projectModel == ProjectModel::STAGE) {
|
||||
paths.push_back(appResourcesPath);
|
||||
paths.push_back(appResourcesPath + ASSET_PATH_SHARE_STAGE);
|
||||
} else {
|
||||
paths.push_back(GetCustomAssetPath(runArgs_.assetPath) + ASSET_PATH_SHARE);
|
||||
}
|
||||
AceContainer::AddAssetPath(ACE_INSTANCE_ID, "", paths);
|
||||
|
||||
auto container = AceContainer::GetContainerInstance(ACE_INSTANCE_ID);
|
||||
if (!container) {
|
||||
LOGE("container is null, initialize the environment failed.");
|
||||
@ -199,10 +199,11 @@ void AceAbility::InitEnv()
|
||||
AceContainer::RunPage(ACE_INSTANCE_ID, UNUSED_PAGE_ID, runArgs_.url, "");
|
||||
AceContainer::SetView(view, runArgs_.deviceConfig.density, runArgs_.deviceWidth, runArgs_.deviceHeight);
|
||||
}
|
||||
|
||||
if (runArgs_.projectModel == ProjectModel::STAGE && !runArgs_.formsEnabled) {
|
||||
container->SetStageAppConfig();
|
||||
}
|
||||
AceContainer::AddRouterChangeCallback(ACE_INSTANCE_ID, runArgs_.onRouterChange);
|
||||
OHOS::Ace::Framework::InspectorClient::GetInstance().RegisterFastPreviewErrorCallback(runArgs_.onError);
|
||||
|
||||
// Should make it possible to update surface changes by using viewWidth and viewHeight.
|
||||
view->NotifySurfaceChanged(runArgs_.deviceWidth, runArgs_.deviceHeight);
|
||||
view->NotifyDensityChanged(runArgs_.deviceConfig.density);
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "adapter/preview/entrance/ace_application_info.h"
|
||||
#include "adapter/preview/entrance/dir_asset_provider.h"
|
||||
#include "adapter/preview/osal/stage_card_parser.h"
|
||||
#include "adapter/preview/osal/stage_module_parser.h"
|
||||
#include "base/log/ace_trace.h"
|
||||
#include "base/log/event_report.h"
|
||||
#include "base/log/log.h"
|
||||
@ -168,6 +169,23 @@ void AceContainer::RunNativeEngineLoop()
|
||||
taskExecutor_->PostTask([frontend = frontend_]() { frontend->RunNativeEngineLoop(); }, TaskExecutor::TaskType::JS);
|
||||
}
|
||||
|
||||
void AceContainer::SetStageAppConfig()
|
||||
{
|
||||
const char* configFilename = "module.json";
|
||||
std::string appConfig;
|
||||
if (!Framework::GetAssetContentImpl(assetManager_, configFilename, appConfig)) {
|
||||
LOGI("Can not load the application config of stage model.");
|
||||
return;
|
||||
}
|
||||
RefPtr<StageModuleParser> stageModuleParser = AceType::MakeRefPtr<StageModuleParser>();
|
||||
stageModuleParser->Parse(appConfig);
|
||||
auto appInfo = stageModuleParser->GetAppInfo();
|
||||
if (pipelineContext_ && appInfo) {
|
||||
LOGI("Set MinPlatformVersion to %{public}d", appInfo->GetMinAPIVersion());
|
||||
pipelineContext_->SetMinPlatformVersion(appInfo->GetMinAPIVersion());
|
||||
}
|
||||
}
|
||||
|
||||
void AceContainer::SetStageCardConfig(const std::string& pageProfile, const std::string& selectUrl)
|
||||
{
|
||||
std::string fullPageProfile = pageProfile + ".json";
|
||||
|
@ -180,6 +180,8 @@ public:
|
||||
|
||||
void SetStageCardConfig(const std::string& pageProfile, const std::string& selectUrl);
|
||||
|
||||
void SetStageAppConfig();
|
||||
|
||||
void SetPageProfile(const std::string& pageProfile)
|
||||
{
|
||||
pageProfile_ = pageProfile;
|
||||
|
@ -236,9 +236,9 @@ ohos_copy("copy_napi_modules_shared_library") {
|
||||
"root_out_dir")
|
||||
deps += [ "$ace_root/interfaces/napi/kits:${module}" ]
|
||||
if (use_mac) {
|
||||
sources += [ "${out_path}/arkui/ace_engine_standard/lib${module}.dylib" ]
|
||||
sources += [ "${out_path}/arkui/ace_engine/lib${module}.dylib" ]
|
||||
} else {
|
||||
sources += [ "${out_path}/arkui/ace_engine_standard/lib${module}.dll" ]
|
||||
sources += [ "${out_path}/arkui/ace_engine/lib${module}.dll" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,7 @@ template("ace_osal_preview_source_set") {
|
||||
"response_data.cpp",
|
||||
"ressched_report.cpp",
|
||||
"stage_card_parser.cpp",
|
||||
"stage_module_parser.cpp",
|
||||
"system_properties.cpp",
|
||||
"trace_id_impl.cpp",
|
||||
]
|
||||
|
@ -51,6 +51,11 @@ int FrameReport::GetEnable()
|
||||
return false;
|
||||
}
|
||||
|
||||
int FrameReport::GetFrameReportEnable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void FrameReport::BeginFlushAnimation()
|
||||
{
|
||||
beginFlushAnimationFunc_ = nullptr;
|
||||
|
@ -126,4 +126,4 @@ WindowConfig& StageCardParser::GetWindowConfig() const
|
||||
return manifestWindow_->GetWindowConfig();
|
||||
}
|
||||
|
||||
} // namespace OHOS::Ace::Framework
|
||||
} // namespace OHOS::Ace
|
||||
|
132
adapter/preview/osal/stage_module_parser.cpp
Normal file
132
adapter/preview/osal/stage_module_parser.cpp
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* 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 "adapter/preview/osal/stage_module_parser.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
|
||||
void StageAppInfo::AppInfoParse(const std::unique_ptr<JsonValue>& root)
|
||||
{
|
||||
if (!root) {
|
||||
LOGE("The information of stage model application is null.");
|
||||
return;
|
||||
}
|
||||
apiReleaseType_ = root->GetString("apiReleaseType");
|
||||
bundleName_ = root->GetString("bundleName");
|
||||
icon_ = root->GetString("icon");
|
||||
label_ = root->GetString("label");
|
||||
vendor_ = root->GetString("vendor");
|
||||
versionName_ = root->GetString("versionName");
|
||||
debug_ = root->GetBool("debug", false);
|
||||
distributedNotificationEnabled_ = root->GetBool("distributedNotificationEnabled", true);
|
||||
iconId_ = root->GetUInt("iconId", 0);
|
||||
labelId_ = root->GetUInt("labelId", 0);
|
||||
minAPIVersion_ = root->GetUInt("minAPIVersion", 0);
|
||||
targetAPIVersion_ = root->GetUInt("targetAPIVersion", 0);
|
||||
versionCode_ = root->GetUInt("versionCode", 0);
|
||||
}
|
||||
|
||||
const std::string& StageAppInfo::GetApiReleaseType() const
|
||||
{
|
||||
return apiReleaseType_;
|
||||
}
|
||||
|
||||
const std::string& StageAppInfo::GetBundleName() const
|
||||
{
|
||||
return bundleName_;
|
||||
}
|
||||
|
||||
const std::string& StageAppInfo::GetIcon() const
|
||||
{
|
||||
return icon_;
|
||||
}
|
||||
|
||||
const std::string& StageAppInfo::GetLabel() const
|
||||
{
|
||||
return label_;
|
||||
}
|
||||
|
||||
const std::string& StageAppInfo::GetVendor() const
|
||||
{
|
||||
return vendor_;
|
||||
}
|
||||
|
||||
const std::string& StageAppInfo::GetVersionName() const
|
||||
{
|
||||
return versionName_;
|
||||
}
|
||||
|
||||
bool StageAppInfo::GetDebug() const
|
||||
{
|
||||
return debug_;
|
||||
}
|
||||
|
||||
bool StageAppInfo::GetDistributedNotificationEnabled() const
|
||||
{
|
||||
return distributedNotificationEnabled_;
|
||||
}
|
||||
|
||||
uint32_t StageAppInfo::GetIconId() const
|
||||
{
|
||||
return iconId_;
|
||||
}
|
||||
|
||||
uint32_t StageAppInfo::GetLabelId() const
|
||||
{
|
||||
return labelId_;
|
||||
}
|
||||
|
||||
uint32_t StageAppInfo::GetMinAPIVersion() const
|
||||
{
|
||||
return minAPIVersion_;
|
||||
}
|
||||
|
||||
uint32_t StageAppInfo::GetTargetAPIVersion() const
|
||||
{
|
||||
return targetAPIVersion_;
|
||||
}
|
||||
|
||||
uint32_t StageAppInfo::GetVersionCode() const
|
||||
{
|
||||
return versionCode_;
|
||||
}
|
||||
|
||||
StageModuleParser::StageModuleParser()
|
||||
: stageAppInfo_(Referenced::MakeRefPtr<StageAppInfo>()),
|
||||
stageModuleInfo_(Referenced::MakeRefPtr<StageModuleInfo>())
|
||||
{}
|
||||
|
||||
void StageModuleParser::Parse(const std::string& contents)
|
||||
{
|
||||
auto rootJson = JsonUtil::ParseJsonString(contents);
|
||||
if (!rootJson || !rootJson->IsValid()) {
|
||||
LOGE("The module config of stage application is illegal.");
|
||||
return;
|
||||
}
|
||||
stageAppInfo_->AppInfoParse(rootJson->GetValue("app"));
|
||||
stageModuleInfo_->ModuleInfoParse(rootJson->GetValue("module"));
|
||||
}
|
||||
|
||||
const RefPtr<StageAppInfo>& StageModuleParser::GetAppInfo() const
|
||||
{
|
||||
return stageAppInfo_;
|
||||
}
|
||||
|
||||
const RefPtr<StageModuleInfo>& StageModuleParser::GetModuleInfo() const
|
||||
{
|
||||
return stageModuleInfo_;
|
||||
}
|
||||
|
||||
} // namespace OHOS::Ace
|
90
adapter/preview/osal/stage_module_parser.h
Normal file
90
adapter/preview/osal/stage_module_parser.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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_ADAPTER_PREVIEW_OSAL_STAGE_MODULE_PARSER_H
|
||||
#define FOUNDATION_ACE_ADAPTER_PREVIEW_OSAL_STAGE_MODULE_PARSER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/log/log.h"
|
||||
#include "base/memory/referenced.h"
|
||||
#include "base/utils/noncopyable.h"
|
||||
#include "frameworks/base/json/json_util.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
|
||||
class StageAppInfo : public Referenced {
|
||||
public:
|
||||
StageAppInfo() = default;
|
||||
~StageAppInfo() override = default;
|
||||
void AppInfoParse(const std::unique_ptr<JsonValue>& root);
|
||||
const std::string& GetApiReleaseType() const;
|
||||
const std::string& GetBundleName() const;
|
||||
const std::string& GetIcon() const;
|
||||
const std::string& GetLabel() const;
|
||||
const std::string& GetVendor() const;
|
||||
const std::string& GetVersionName() const;
|
||||
bool GetDebug() const;
|
||||
bool GetDistributedNotificationEnabled() const;
|
||||
uint32_t GetIconId() const;
|
||||
uint32_t GetLabelId() const;
|
||||
uint32_t GetMinAPIVersion() const;
|
||||
uint32_t GetTargetAPIVersion() const;
|
||||
uint32_t GetVersionCode() const;
|
||||
|
||||
private:
|
||||
std::string apiReleaseType_;
|
||||
std::string bundleName_;
|
||||
std::string icon_;
|
||||
std::string label_;
|
||||
std::string vendor_;
|
||||
std::string versionName_;
|
||||
bool debug_ = false;
|
||||
bool distributedNotificationEnabled_ = true;
|
||||
uint32_t iconId_;
|
||||
uint32_t labelId_ = 0;
|
||||
uint32_t minAPIVersion_ = 0;
|
||||
uint32_t targetAPIVersion_ = 0;
|
||||
uint32_t versionCode_ = 0;
|
||||
ACE_DISALLOW_COPY_AND_MOVE(StageAppInfo);
|
||||
};
|
||||
|
||||
class StageModuleInfo : public Referenced {
|
||||
public:
|
||||
StageModuleInfo() = default;
|
||||
~StageModuleInfo() override = default;
|
||||
void ModuleInfoParse(const std::unique_ptr<JsonValue>& root) {}
|
||||
|
||||
private:
|
||||
ACE_DISALLOW_COPY_AND_MOVE(StageModuleInfo);
|
||||
};
|
||||
|
||||
class StageModuleParser : public Referenced {
|
||||
public:
|
||||
StageModuleParser();
|
||||
~StageModuleParser() override = default;
|
||||
void Parse(const std::string& contents);
|
||||
const RefPtr<StageAppInfo>& GetAppInfo() const;
|
||||
const RefPtr<StageModuleInfo>& GetModuleInfo() const;
|
||||
|
||||
private:
|
||||
RefPtr<StageAppInfo> stageAppInfo_;
|
||||
RefPtr<StageModuleInfo> stageModuleInfo_;
|
||||
ACE_DISALLOW_COPY_AND_MOVE(StageModuleParser);
|
||||
};
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
||||
#endif // FOUNDATION_ACE_ADAPTER_PREVIEW_OSAL_STAGE_MODULE_PARSER_H
|
@ -196,10 +196,9 @@ if (is_standard_system) {
|
||||
"root_out_dir")
|
||||
deps += [ "$ace_root/interfaces/napi/kits:${module}" ]
|
||||
if (use_mac) {
|
||||
sources +=
|
||||
[ "${out_path}/arkui/ace_engine_standard/lib${module}.dylib" ]
|
||||
sources += [ "${out_path}/arkui/ace_engine/lib${module}.dylib" ]
|
||||
} else {
|
||||
sources += [ "${out_path}/arkui/ace_engine_standard/lib${module}.dll" ]
|
||||
sources += [ "${out_path}/arkui/ace_engine/lib${module}.dll" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,11 @@ public:
|
||||
~Size() = default;
|
||||
Size(double width, double height) : width_(width), height_(height) {}
|
||||
|
||||
inline static bool IsValueInfinite(double inputValue)
|
||||
{
|
||||
return NearEqual(inputValue, INFINITE_SIZE);
|
||||
}
|
||||
|
||||
double Width() const
|
||||
{
|
||||
return width_;
|
||||
|
@ -64,6 +64,7 @@ private:
|
||||
bool LoadLibrary();
|
||||
void CloseLibrary();
|
||||
void *LoadSymbol(const char *symName);
|
||||
int GetFrameReportEnable();
|
||||
void *frameSchedHandle_ = nullptr;
|
||||
bool frameSchedSoLoaded_ = false;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import("//build/test.gni")
|
||||
import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
|
||||
if (is_standard_system) {
|
||||
module_output_path = "ace_engine_standard/frameworkbasicability/jsonutil"
|
||||
module_output_path = "ace_engine/frameworkbasicability/jsonutil"
|
||||
} else {
|
||||
module_output_path = "ace_engine_full/frameworkbasicability/jsonutil"
|
||||
}
|
||||
@ -36,13 +36,7 @@ ohos_unittest("JsonUtilsTest") {
|
||||
"//utils/native/base:utils",
|
||||
]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_json_creator_test") {
|
||||
|
@ -15,7 +15,7 @@ import("//build/test.gni")
|
||||
import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
|
||||
if (is_standard_system) {
|
||||
module_output_path = "ace_engine_standard/frameworkbasicability/executor"
|
||||
module_output_path = "ace_engine/frameworkbasicability/executor"
|
||||
} else {
|
||||
module_output_path = "ace_engine_full/frameworkbasicability/executor"
|
||||
}
|
||||
@ -33,13 +33,7 @@ ohos_unittest("TaskExecutorsTest") {
|
||||
"$ace_root/build:ace_ohos_unittest_base",
|
||||
]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
group("unittest") {
|
||||
|
@ -139,6 +139,7 @@ template("declarative_js_engine") {
|
||||
"jsview/js_clipboard.cpp",
|
||||
"jsview/js_column.cpp",
|
||||
"jsview/js_column_split.cpp",
|
||||
"jsview/js_common_view.cpp",
|
||||
"jsview/js_container_base.cpp",
|
||||
"jsview/js_counter.cpp",
|
||||
"jsview/js_data_panel.cpp",
|
||||
|
@ -104,8 +104,8 @@ JSRef<JSObject> CreateEventTargetObject(const BaseEventInfo& info)
|
||||
offset->SetProperty<double>("y", localOffset.GetY().ConvertToVp());
|
||||
globalOffset->SetProperty<double>("x", (origin.GetX().ConvertToVp() + localOffset.GetX().ConvertToVp()));
|
||||
globalOffset->SetProperty<double>("y", (origin.GetY().ConvertToVp() + localOffset.GetY().ConvertToVp()));
|
||||
area->SetPropertyObject("pos", offset);
|
||||
area->SetPropertyObject("globalPos", globalOffset);
|
||||
area->SetPropertyObject("position", offset);
|
||||
area->SetPropertyObject("globalPosition", globalOffset);
|
||||
area->SetProperty<double>("width", info.GetTarget().area.GetWidth().ConvertToVp());
|
||||
area->SetProperty<double>("height", info.GetTarget().area.GetHeight().ConvertToVp());
|
||||
target->SetPropertyObject("area", area);
|
||||
|
@ -34,19 +34,19 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_button.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_calendar.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_calendar_controller.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_checkbox.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_checkboxgroup.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_clipboard.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_hyperlink.h"
|
||||
#ifndef WEARABLE_PRODUCT
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_camera.h"
|
||||
#endif
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas_gradient.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas_path.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_checkbox.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_checkboxgroup.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_clipboard.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_circle.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_column.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_column_split.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_common_view.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_container_base.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_counter.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_data_panel.h"
|
||||
@ -70,6 +70,7 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_grid.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_grid_container.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_grid_item.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_hyperlink.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_if_else.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_image.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_image_animator.h"
|
||||
@ -1014,12 +1015,14 @@ static const std::unordered_map<std::string, std::function<void(BindingTarget)>>
|
||||
{ "Refresh", JSRefresh::JSBind },
|
||||
{ "WaterFlow", JSWaterFlow::JSBind },
|
||||
{ "FlowItem", JSWaterFlowItem::JSBind },
|
||||
{ "RelativeContainer", JSRelativeContainer::JSBind }
|
||||
{ "RelativeContainer", JSRelativeContainer::JSBind },
|
||||
{ "__Common__", JSCommonView::JSBind },
|
||||
};
|
||||
|
||||
void RegisterAllModule(BindingTarget globalObj)
|
||||
{
|
||||
JSColumn::JSBind(globalObj);
|
||||
JSCommonView::JSBind(globalObj);
|
||||
JSSwiperController::JSBind(globalObj);
|
||||
JSTabsController::JSBind(globalObj);
|
||||
JSScroller::JSBind(globalObj);
|
||||
|
@ -34,6 +34,9 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_button.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_calendar.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_calendar_controller.h"
|
||||
#ifndef WEARABLE_PRODUCT
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_camera.h"
|
||||
#endif
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas_gradient.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas_path.h"
|
||||
@ -46,12 +49,10 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_render_image.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_rendering_context.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_rendering_context_settings.h"
|
||||
#ifndef WEARABLE_PRODUCT
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_camera.h"
|
||||
#endif
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_circle.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_column.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_column_split.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_common_view.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_container_base.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_counter.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_data_panel.h"
|
||||
@ -960,6 +961,7 @@ void JsRegisterViews(BindingTarget globalObj)
|
||||
JSWaterFlow::JSBind(globalObj);
|
||||
JSWaterFlowItem::JSBind(globalObj);
|
||||
JSRelativeContainer::JSBind(globalObj);
|
||||
JSCommonView::JSBind(globalObj);
|
||||
|
||||
JSObjectTemplate toggleType;
|
||||
toggleType.Constant("Checkbox", 0);
|
||||
|
@ -32,12 +32,16 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_button.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_calendar.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_calendar_controller.h"
|
||||
#ifndef WEARABLE_PRODUCT
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_camera.h"
|
||||
#endif
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas_gradient.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_canvas_path.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_checkbox.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_checkboxgroup.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_clipboard.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_common_view.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_distributed.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_hyperlink.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_offscreen_rendering_context.h"
|
||||
@ -45,9 +49,6 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_render_image.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_rendering_context.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_rendering_context_settings.h"
|
||||
#ifndef WEARABLE_PRODUCT
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_camera.h"
|
||||
#endif
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_circle.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_column.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_column_split.h"
|
||||
@ -707,6 +708,7 @@ static const std::unordered_map<std::string, std::function<void(BindingTarget)>>
|
||||
{"WaterFlow", JSWaterFLow::JSBind},
|
||||
{"FlowItem", JSFLowItem::JSBind},
|
||||
{"RelativeContainer", JSRelativeContainer::JSBind},
|
||||
{"__Common__", JSCommonView::JSBind},
|
||||
};
|
||||
|
||||
void RegisterAllModule(BindingTarget globalObj)
|
||||
|
@ -47,7 +47,15 @@ void JSButton::SetFontSize(const JSCallbackInfo& info)
|
||||
textStyle.SetAdaptTextSize(fontSize, fontSize);
|
||||
textComponent->SetTextStyle(std::move(textStyle));
|
||||
}
|
||||
ResetButtonHeight();
|
||||
|
||||
auto stack = ViewStackProcessor::GetInstance();
|
||||
auto buttonComponent = AceType::DynamicCast<ButtonComponent>(stack->GetMainComponent());
|
||||
if (!buttonComponent) {
|
||||
return;
|
||||
}
|
||||
if (buttonComponent->NeedResetHeight()) {
|
||||
ResetButtonHeight();
|
||||
}
|
||||
}
|
||||
|
||||
void JSButton::SetFontWeight(std::string value)
|
||||
@ -242,6 +250,9 @@ void JSButton::CreateWithChild(const JSCallbackInfo& info)
|
||||
JSInteractableView::SetFocusable(true);
|
||||
JSInteractableView::SetFocusNode(true);
|
||||
buttonComponent->SetMouseAnimationType(HoverAnimationType::SCALE);
|
||||
if (buttonComponent->NeedResetHeight()) {
|
||||
ResetButtonHeight();
|
||||
}
|
||||
}
|
||||
|
||||
void JSButton::SetDefaultAttributes(const RefPtr<ButtonComponent>& buttonComponent)
|
||||
@ -276,7 +287,7 @@ void JSButton::ResetButtonHeight()
|
||||
auto stack = ViewStackProcessor::GetInstance();
|
||||
auto buttonComponent = AceType::DynamicCast<ButtonComponent>(stack->GetMainComponent());
|
||||
if (buttonComponent) {
|
||||
if (buttonComponent->GetType() != ButtonType::NORMAL) {
|
||||
if (buttonComponent->GetType() == ButtonType::CIRCLE) {
|
||||
return;
|
||||
}
|
||||
const Dimension initialHeight = Dimension(-1.0, DimensionUnit::VP);
|
||||
@ -323,8 +334,10 @@ void JSButton::JsPadding(const JSCallbackInfo& info)
|
||||
if (paddingChild) {
|
||||
paddingChild->SetPadding(padding);
|
||||
}
|
||||
if (component->NeedResetHeight()) {
|
||||
ResetButtonHeight();
|
||||
}
|
||||
}
|
||||
ResetButtonHeight();
|
||||
}
|
||||
|
||||
void JSButton::JsOnClick(const JSCallbackInfo& info)
|
||||
@ -456,6 +469,7 @@ void JSButton::JsHeight(const JSCallbackInfo& info)
|
||||
if (!buttonComponent) {
|
||||
return;
|
||||
}
|
||||
buttonComponent->IsNeedResetHeight(false);
|
||||
if (!stack->IsVisualStateSet()) {
|
||||
buttonComponent->SetHeight(value, option);
|
||||
buttonComponent->SetDeclareHeight(true);
|
||||
@ -507,6 +521,7 @@ void JSButton::JsSize(const JSCallbackInfo& info)
|
||||
JSRef<JSVal> heightValue = sizeObj->GetProperty("height");
|
||||
Dimension height;
|
||||
if (ParseJsDimensionVp(heightValue, height)) {
|
||||
buttonComponent->IsNeedResetHeight(false);
|
||||
if (!stack->IsVisualStateSet()) {
|
||||
buttonComponent->SetHeight(height, stack->GetImplicitAnimationOption());
|
||||
buttonComponent->SetDeclareHeight(true);
|
||||
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 "frameworks/bridge/declarative_frontend/jsview/js_common_view.h"
|
||||
|
||||
#include "core/components/proxy/proxy_component.h"
|
||||
#include "frameworks/bridge/declarative_frontend/view_stack_processor.h"
|
||||
|
||||
namespace OHOS::Ace::Framework {
|
||||
void JSCommonView::Create(const JSCallbackInfo& info)
|
||||
{
|
||||
auto specializedBox = AceType::MakeRefPtr<OHOS::Ace::ProxyComponent>();
|
||||
ViewStackProcessor::GetInstance()->Push(specializedBox);
|
||||
}
|
||||
|
||||
void JSCommonView::JSBind(BindingTarget globalObj)
|
||||
{
|
||||
JSClass<JSCommonView>::Declare("__Common__");
|
||||
MethodOptions opt = MethodOptions::NONE;
|
||||
JSClass<JSCommonView>::StaticMethod("create", &JSCommonView::Create, opt);
|
||||
JSClass<JSCommonView>::StaticMethod("onAppear", &JSInteractableView::JsOnAppear);
|
||||
JSClass<JSCommonView>::StaticMethod("onDisAppear", &JSInteractableView::JsOnDisAppear);
|
||||
JSClass<JSCommonView>::StaticMethod("onTouch", &JSInteractableView::JsOnTouch);
|
||||
JSClass<JSCommonView>::StaticMethod("onHover", &JSInteractableView::JsOnHover);
|
||||
JSClass<JSCommonView>::StaticMethod("onKeyEvent", &JSInteractableView::JsOnKey);
|
||||
JSClass<JSCommonView>::StaticMethod("onDeleteEvent", &JSInteractableView::JsOnDelete);
|
||||
JSClass<JSCommonView>::StaticMethod("onClick", &JSInteractableView::JsOnClick);
|
||||
JSClass<JSCommonView>::StaticMethod("remoteMessage", &JSInteractableView::JsCommonRemoteMessage);
|
||||
|
||||
JSClass<JSCommonView>::Inherit<JSContainerBase>();
|
||||
JSClass<JSCommonView>::Bind<>(globalObj);
|
||||
}
|
||||
} // namespace OHOS::Ace::Framework
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_COMMON_VIEW_H
|
||||
#define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_COMMON_VIEW_H
|
||||
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_container_base.h"
|
||||
|
||||
namespace OHOS::Ace::Framework {
|
||||
|
||||
class JSCommonView : public JSContainerBase {
|
||||
public:
|
||||
static void JSBind(BindingTarget globalObj);
|
||||
static void Create(const JSCallbackInfo& info);
|
||||
};
|
||||
|
||||
} // namespace OHOS::Ace::Framework
|
||||
#endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_DIVIDER_H
|
@ -16,8 +16,6 @@
|
||||
#include "frameworks/bridge/declarative_frontend/engine/functions/js_mouse_function.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_grid_item.h"
|
||||
|
||||
#include "frameworks/bridge/declarative_frontend/view_stack_processor.h"
|
||||
|
||||
namespace OHOS::Ace::Framework {
|
||||
|
||||
void JSGridItem::Create()
|
||||
@ -91,6 +89,8 @@ void JSGridItem::JSBind(BindingTarget globalObj)
|
||||
JSClass<JSGridItem>::StaticMethod("forceRebuild", &JSGridItem::ForceRebuild, opt);
|
||||
JSClass<JSGridItem>::StaticMethod("selectable", &JSGridItem::SetSelectable, opt);
|
||||
JSClass<JSGridItem>::StaticMethod("onSelect", &JSGridItem::SelectCallback);
|
||||
JSClass<JSGridItem>::StaticMethod("width", &JSGridItem::SetGridItemWidth);
|
||||
JSClass<JSGridItem>::StaticMethod("height", &JSGridItem::SetGridItemHeight);
|
||||
JSClass<JSGridItem>::StaticMethod("onClick", &JSInteractableView::JsOnClick);
|
||||
JSClass<JSGridItem>::StaticMethod("onAppear", &JSInteractableView::JsOnAppear);
|
||||
JSClass<JSGridItem>::StaticMethod("onDisAppear", &JSInteractableView::JsOnDisAppear);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_container_base.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_interactable_view.h"
|
||||
#include "frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h"
|
||||
#include "frameworks/bridge/declarative_frontend/view_stack_processor.h"
|
||||
#include "frameworks/core/components/grid_layout/grid_layout_item_component.h"
|
||||
|
||||
namespace OHOS::Ace::Framework {
|
||||
@ -31,6 +32,31 @@ public:
|
||||
static void Create();
|
||||
|
||||
protected:
|
||||
#define ACE_DEFINE_SET_GRID_ITEM_SIZE(name) \
|
||||
static void SetGridItem##name(const JSCallbackInfo &info) \
|
||||
{ \
|
||||
if (info.Length() < 1) { \
|
||||
LOGE("The arg is wrong when set %{public}s of grid item", #name); \
|
||||
return; \
|
||||
} \
|
||||
if (!JSViewAbstract::Js##name(info[0])) { \
|
||||
LOGE("JSViewAbstract fail to parse %{public}s of grid item", #name); \
|
||||
return; \
|
||||
} \
|
||||
Dimension item##name; \
|
||||
if (!ParseJsDimensionVp(info[0], item##name)) { \
|
||||
LOGE("Fail to parse %{public}s of grid item in Dimension unit", #name); \
|
||||
return; \
|
||||
} \
|
||||
auto gridItem = \
|
||||
AceType::DynamicCast<GridLayoutItemComponent>(ViewStackProcessor::GetInstance()->GetMainComponent()); \
|
||||
if (gridItem) { \
|
||||
gridItem->SetGridItem##name(item##name); \
|
||||
} \
|
||||
} \
|
||||
|
||||
ACE_DEFINE_SET_GRID_ITEM_SIZE(Width);
|
||||
ACE_DEFINE_SET_GRID_ITEM_SIZE(Height);
|
||||
static void SetColumnStart(int32_t columnStart);
|
||||
static void SetColumnEnd(int32_t columnEnd);
|
||||
static void SetRowStart(int32_t rowStart);
|
||||
|
@ -211,9 +211,9 @@ RefPtr<Gesture> JSInteractableView::GetRemoteMessageTapGesture(const JSCallbackI
|
||||
return tapGesture;
|
||||
}
|
||||
|
||||
void JSInteractableView::SetFocusable(bool focusable, bool createIfNotExist)
|
||||
void JSInteractableView::SetFocusable(bool focusable)
|
||||
{
|
||||
auto focusableComponent = ViewStackProcessor::GetInstance()->GetFocusableComponent(createIfNotExist);
|
||||
auto focusableComponent = ViewStackProcessor::GetInstance()->GetFocusableComponent();
|
||||
if (focusableComponent) {
|
||||
focusableComponent->SetFocusable(focusable);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
static void JsOnHover(const JSCallbackInfo& args);
|
||||
static EventMarker GetClickEventMarker(const JSCallbackInfo& info);
|
||||
static void JsOnKey(const JSCallbackInfo& args);
|
||||
static void SetFocusable(bool focusable, bool createIfNotExist = true);
|
||||
static void SetFocusable(bool focusable);
|
||||
static void SetFocusNode(bool isFocusNode);
|
||||
|
||||
static void JsOnAppear(const JSCallbackInfo& info);
|
||||
|
@ -482,7 +482,7 @@ void JSText::Create(const JSCallbackInfo& info)
|
||||
|
||||
auto textComponent = AceType::MakeRefPtr<OHOS::Ace::TextComponentV2>(data);
|
||||
ViewStackProcessor::GetInstance()->Push(textComponent);
|
||||
JSInteractableView::SetFocusable(false, false);
|
||||
JSInteractableView::SetFocusable(false);
|
||||
JSInteractableView::SetFocusNode(false);
|
||||
|
||||
// Init text style, allowScale is not supported in declarative.
|
||||
|
@ -44,8 +44,9 @@ std::string JsiBaseUtils::GenerateSummaryBody(std::shared_ptr<JsValue> error, st
|
||||
|
||||
RefPtr<RevSourceMap> pageMap;
|
||||
RefPtr<RevSourceMap> appMap;
|
||||
std::string pageUrl;
|
||||
if (runningPage) {
|
||||
auto pageUrl = runningPage->GetUrl();
|
||||
pageUrl = runningPage->GetUrl();
|
||||
summaryBody.append("page: ").append(pageUrl).append("\n");
|
||||
|
||||
pageMap = runningPage->GetPageMap();
|
||||
@ -66,7 +67,7 @@ std::string JsiBaseUtils::GenerateSummaryBody(std::shared_ptr<JsValue> error, st
|
||||
stackStr.append(stack->ToString(runtime));
|
||||
|
||||
if (pageMap || appMap) {
|
||||
std::string tempStack = JsiDumpSourceFile(stackStr, pageMap, appMap, data);
|
||||
std::string tempStack = JsiDumpSourceFile(stackStr, pageUrl, pageMap, appMap, data);
|
||||
summaryBody.append(tempStack);
|
||||
} else {
|
||||
summaryBody.append("Cannot get SourceMap info, dump raw stack:\n");
|
||||
@ -86,15 +87,16 @@ std::string JsiBaseUtils::TransSourceStack(RefPtr<JsAcePage> runningPage, const
|
||||
std::string summaryBody;
|
||||
RefPtr<RevSourceMap> pageMap;
|
||||
RefPtr<RevSourceMap> appMap;
|
||||
std::string pageUrl;
|
||||
if (runningPage) {
|
||||
auto pageUrl = runningPage->GetUrl();
|
||||
pageUrl = runningPage->GetUrl();
|
||||
summaryBody.append(" Page: ").append(pageUrl).append("\n");
|
||||
pageMap = runningPage->GetPageMap();
|
||||
appMap = runningPage->GetAppMap();
|
||||
}
|
||||
|
||||
if (pageMap || appMap) {
|
||||
std::string tempStack = JsiBaseUtils::JsiDumpSourceFile(stacktrace, pageMap, appMap);
|
||||
std::string tempStack = JsiBaseUtils::JsiDumpSourceFile(stacktrace, pageUrl, pageMap, appMap);
|
||||
summaryBody.append(tempStack);
|
||||
} else {
|
||||
summaryBody.append("Cannot get SourceMap info, dump raw stack:\n");
|
||||
@ -104,16 +106,23 @@ std::string JsiBaseUtils::TransSourceStack(RefPtr<JsAcePage> runningPage, const
|
||||
return summaryBody;
|
||||
}
|
||||
|
||||
std::string JsiBaseUtils::JsiDumpSourceFile(const std::string& stackStr, const RefPtr<RevSourceMap>& pageMap,
|
||||
const RefPtr<RevSourceMap>& appMap, const AceType *data)
|
||||
std::string JsiBaseUtils::JsiDumpSourceFile(const std::string& stackStr, const std::string& pageUrl,
|
||||
const RefPtr<RevSourceMap>& pageMap, const RefPtr<RevSourceMap>& appMap, const AceType *data)
|
||||
{
|
||||
const std::string closeBrace = ")";
|
||||
const std::string openBrace = "(";
|
||||
std::string ans = "";
|
||||
std::string tempStack = stackStr;
|
||||
int32_t appFlag = static_cast<int32_t>(tempStack.find("app_.js"));
|
||||
std::string runningPageTag = "app_.js";
|
||||
int32_t appFlag = static_cast<int32_t>(tempStack.find(runningPageTag));
|
||||
bool isAppPage = appFlag > 0 && appMap;
|
||||
|
||||
if (!isAppPage) {
|
||||
std::string ans = std::as_const(pageUrl);
|
||||
char* ch = strrchr((char*)ans.c_str(), '.');
|
||||
int index = ch - ans.c_str();
|
||||
ans.insert(index, "_");
|
||||
runningPageTag = ans;
|
||||
}
|
||||
// find per line of stack
|
||||
std::vector<std::string> res;
|
||||
ExtractEachInfo(tempStack, res);
|
||||
@ -135,6 +144,9 @@ std::string JsiBaseUtils::JsiDumpSourceFile(const std::string& stackStr, const R
|
||||
}
|
||||
for (; i < res.size(); i++) {
|
||||
std::string temp = res[i];
|
||||
if (temp.find(runningPageTag) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
int32_t closeBracePos = static_cast<int32_t>(temp.find(closeBrace));
|
||||
int32_t openBracePos = static_cast<int32_t>(temp.find(openBrace));
|
||||
|
||||
|
@ -64,8 +64,8 @@ public:
|
||||
|
||||
private:
|
||||
static std::string GenerateSummaryBody(std::shared_ptr<JsValue> error, std::shared_ptr<JsRuntime> runtime);
|
||||
static std::string JsiDumpSourceFile(const std::string& stackStr, const RefPtr<RevSourceMap>& pageMap,
|
||||
const RefPtr<RevSourceMap>& appMap, const AceType *data = nullptr);
|
||||
static std::string JsiDumpSourceFile(const std::string& stackStr, const std::string& pageUrl,
|
||||
const RefPtr<RevSourceMap>& pageMap, const RefPtr<RevSourceMap>& appMap, const AceType *data = nullptr);
|
||||
static void ExtractEachInfo(const std::string& tempStack, std::vector<std::string>& res);
|
||||
static void GetPosInfo(const std::string& temp, int32_t start, std::string& line, std::string& column);
|
||||
static std::string GetSourceInfo(const std::string& line, const std::string& column,
|
||||
|
@ -113,6 +113,7 @@ void JsiXComponentBridge::HandleContext(const shared_ptr<JsRuntime>& runtime, No
|
||||
Local<ObjectRef> obj = arkObjectRef->ToObject(pandaRuntime->GetEcmaVm());
|
||||
if (obj.CheckException()) {
|
||||
LOGE("Get local object failed.");
|
||||
renderContext_.reset();
|
||||
return;
|
||||
}
|
||||
renderContext->SetValue(pandaRuntime, obj);
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomCardButtonTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -32,13 +32,7 @@ ohos_unittest("DomCardClockTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomCardDivTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomCardImageTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomCardProgressTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomCardStackTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomCardTextTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("CardFrontendTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -25,13 +25,8 @@ ohos_unittest("MediaQueryTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
subsystem_name = "arkui"
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_media_query_test") {
|
||||
|
@ -44,13 +44,7 @@ ohos_unittest("AnimatorApiTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -25,13 +25,7 @@ ohos_unittest("GroupMessageCodecTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomButtonTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomDivTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomDividerTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomImageTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomImageAnimatorTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomInputTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomLabelTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomListTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomNodeTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomPieceTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomPopupTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomRatingTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomRefreshTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSearchTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSpanTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSvgTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSvgTextTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomTabTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomTextTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomTextareaTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("CommonEventTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -30,13 +30,7 @@ ohos_unittest("ManifestWindowTest") {
|
||||
|
||||
external_deps = [ "ability_base:configuration" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_manifest_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomMarqueeTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomProgressTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSliderTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSwiperTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomSwitchTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -28,13 +28,7 @@ ohos_unittest("JsUtilsTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_js_utils_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("DomVideoTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -31,13 +31,7 @@ ohos_unittest("PluginFrontendDelegateTest") {
|
||||
"$ace_root/build:ace_ohos_unittest_base",
|
||||
]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
ohos_unittest("PluginFrontendTest") {
|
||||
@ -55,13 +49,7 @@ ohos_unittest("PluginFrontendTest") {
|
||||
"$ace_root/build:ace_ohos_unittest_base",
|
||||
]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_domnode_test") {
|
||||
|
@ -225,13 +225,7 @@ ohos_unittest("AnimationTest") {
|
||||
[ "//base/global/resource_management/frameworks/resmgr:global_resmgr" ]
|
||||
}
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_animation_test") {
|
||||
|
@ -230,13 +230,7 @@ ohos_unittest("SpringChainTest") {
|
||||
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
|
||||
}
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_animation_test") {
|
||||
|
@ -229,13 +229,7 @@ ohos_unittest("SvgAnimateTest") {
|
||||
[ "//base/global/resource_management/frameworks/resmgr:global_resmgr" ]
|
||||
}
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_animation_test") {
|
||||
|
@ -15,7 +15,7 @@ import("//build/test.gni")
|
||||
import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
|
||||
if (is_standard_system) {
|
||||
module_output_path = "ace_engine_standard/backenduicomponent/plugin"
|
||||
module_output_path = "ace_engine/backenduicomponent/plugin"
|
||||
} else {
|
||||
module_output_path = "ace_engine_full/backenduicomponent/plugin"
|
||||
}
|
||||
@ -46,13 +46,7 @@ ohos_unittest("PluginManagerTest") {
|
||||
"eventhandler:libeventhandler",
|
||||
]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("config_json_creator_test") {
|
||||
|
@ -1598,7 +1598,6 @@ void RenderBox::OnTouchTestHit(
|
||||
if (touchRecognizer_) {
|
||||
touchRecognizer_->SetCoordinateOffset(coordinateOffset);
|
||||
result.emplace_back(touchRecognizer_);
|
||||
MarkIsNotSiblingAddRecognizerToResult(false);
|
||||
}
|
||||
if (onClick_) {
|
||||
onClick_->SetCoordinateOffset(coordinateOffset);
|
||||
|
@ -181,6 +181,16 @@ public:
|
||||
return isDeclareHeight_;
|
||||
}
|
||||
|
||||
void IsNeedResetHeight(bool needResetHeight)
|
||||
{
|
||||
needResetHeight_ = needResetHeight;
|
||||
}
|
||||
|
||||
bool NeedResetHeight()
|
||||
{
|
||||
return needResetHeight_;
|
||||
}
|
||||
|
||||
void FitTextHeight(AnimatableDimension& height);
|
||||
|
||||
uint32_t Compare(const RefPtr<Component>& component) const override;
|
||||
@ -217,6 +227,7 @@ private:
|
||||
bool isInputButton_ = false;
|
||||
bool isCatchMode_ = true;
|
||||
bool isDeclareHeight_ = false;
|
||||
bool needResetHeight_ = true;
|
||||
uint32_t layoutFlag_ = 0;
|
||||
// for custom button type
|
||||
std::array<Radius, 4> radii_ = { Radius(0.0_vp), Radius(0.0_vp), Radius(0.0_vp), Radius(0.0_vp) };
|
||||
|
@ -495,6 +495,9 @@ void RenderButton::PerformLayout()
|
||||
SetLayoutSize(CalculateLayoutSize());
|
||||
SetChildrenAlignment();
|
||||
buttonSize_ = GetLayoutSize() - Size(widthDelta_, widthDelta_);
|
||||
if (type_ == ButtonType::CAPSULE) {
|
||||
rrectRadius_ = buttonSize_.Height() / 2;
|
||||
}
|
||||
}
|
||||
|
||||
void RenderButton::SetChildrenLayoutSize()
|
||||
@ -508,7 +511,7 @@ void RenderButton::SetChildrenLayoutSize()
|
||||
}
|
||||
double height = buttonSize_.Height();
|
||||
if (buttonComponent_->GetDeclarativeFlag()) {
|
||||
if (!heightDefined_ && type_ == ButtonType::NORMAL) {
|
||||
if (!heightDefined_ && type_ != ButtonType::CIRCLE) {
|
||||
height = GetLayoutParam().GetMaxSize().Height();
|
||||
}
|
||||
}
|
||||
@ -544,6 +547,9 @@ Size RenderButton::CalculateLayoutSize()
|
||||
|
||||
bool RenderButton::NeedAdaptiveChild()
|
||||
{
|
||||
if (buttonComponent_->GetDeclarativeFlag() && type_ != ButtonType::CIRCLE) {
|
||||
return true;
|
||||
}
|
||||
if ((type_ == ButtonType::TEXT) && isWatch_) {
|
||||
return true;
|
||||
}
|
||||
|
@ -1432,13 +1432,12 @@ void FlutterDecorationPainter::PaintSaturate(const flutter::RRect& outerRRect, S
|
||||
const Dimension& saturate, const Color& color)
|
||||
{
|
||||
double saturates = saturate.Value();
|
||||
if (GreatNotEqual(saturates, 0.0)) {
|
||||
if (!NearEqual(saturates, 1.0) && GreatOrEqual(saturates, 0.0)) {
|
||||
if (canvas) {
|
||||
SkAutoCanvasRestore acr(canvas, true);
|
||||
canvas->clipRRect(outerRRect.sk_rrect, true);
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
#ifdef USE_SYSTEM_SKIA
|
||||
float matrix[20] = { 0 };
|
||||
matrix[0] = 0.3086f * (1 - saturates) + saturates;
|
||||
matrix[1] = matrix[11] = 0.6094f * (1 - saturates);
|
||||
@ -1447,10 +1446,11 @@ void FlutterDecorationPainter::PaintSaturate(const flutter::RRect& outerRRect, S
|
||||
matrix[6] = 0.6094f * (1 - saturates) + saturates;
|
||||
matrix[12] = 0.0820f * (1 - saturates) + saturates;
|
||||
matrix[18] = 1.0f;
|
||||
#ifdef USE_SYSTEM_SKIA
|
||||
auto filter = SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
|
||||
paint.setColorFilter(filter);
|
||||
#else
|
||||
paint.setColorFilter(SkColorFilters::Blend(color.GetValue(), SkBlendMode::kDstOver));
|
||||
paint.setColorFilter(SkColorFilters::Matrix(matrix));
|
||||
#endif
|
||||
SkCanvas::SaveLayerRec slr(nullptr, &paint, SkCanvas::kInitWithPrevious_SaveLayerFlag);
|
||||
canvas->saveLayer(slr);
|
||||
|
@ -1388,7 +1388,7 @@ void RosenDecorationPainter::PaintSaturate(
|
||||
const SkRRect& outerRRect, SkCanvas* canvas, const Dimension& saturate, const Color& color)
|
||||
{
|
||||
double saturates = saturate.Value();
|
||||
if (GreatNotEqual(saturates, 0.0)) {
|
||||
if (!NearEqual(saturates, 1.0) && GreatOrEqual(saturates, 0.0)) {
|
||||
if (canvas) {
|
||||
SkAutoCanvasRestore acr(canvas, true);
|
||||
canvas->clipRRect(outerRRect, true);
|
||||
|
@ -1162,7 +1162,7 @@ private:
|
||||
// Contrast
|
||||
Dimension contrast_;
|
||||
// Saturate
|
||||
Dimension saturate_;
|
||||
Dimension saturate_ = 1.0_px;
|
||||
// Sepia
|
||||
Dimension sepia_;
|
||||
// invert
|
||||
|
@ -15,7 +15,7 @@ import("//build/test.gni")
|
||||
import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
|
||||
if (is_standard_system) {
|
||||
module_output_path = "ace_engine_standard/backenduicomponent/align"
|
||||
module_output_path = "ace_engine/backenduicomponent/align"
|
||||
} else {
|
||||
module_output_path = "ace_engine_full/backenduicomponent/align"
|
||||
}
|
||||
@ -32,13 +32,7 @@ ohos_unittest("AlignmentTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("alignment_test") {
|
||||
|
@ -15,7 +15,7 @@ import("//build/test.gni")
|
||||
import("//foundation/arkui/ace_engine/ace_config.gni")
|
||||
|
||||
if (is_standard_system) {
|
||||
module_output_path = "ace_engine_standard/backenduicomponent/color"
|
||||
module_output_path = "ace_engine/backenduicomponent/color"
|
||||
} else {
|
||||
module_output_path = "ace_engine_full/backenduicomponent/color"
|
||||
}
|
||||
@ -32,13 +32,7 @@ ohos_unittest("ColorPropertyTest") {
|
||||
|
||||
deps = [ "$ace_root/build:ace_ohos_unittest_base" ]
|
||||
|
||||
if (!is_standard_system) {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_full"
|
||||
} else {
|
||||
subsystem_name = "arkui"
|
||||
part_name = "ace_engine_standard"
|
||||
}
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
config("color_test") {
|
||||
|
@ -30,14 +30,17 @@ public:
|
||||
|
||||
void Update() override
|
||||
{
|
||||
const auto context = renderNode_->GetContext().Upgrade();
|
||||
std::list<TaskFunc> tasks;
|
||||
auto paint = AceType::DynamicCast<RenderCustomPaint>(renderNode_);
|
||||
if (paint && paint->HasTask()) {
|
||||
tasks = paint->GetTasks();
|
||||
if (context && !context->GetIsDeclarative()) {
|
||||
if (paint && paint->HasTask()) {
|
||||
tasks = paint->GetTasks();
|
||||
}
|
||||
}
|
||||
customComponent_ = component_;
|
||||
RenderElement::Update();
|
||||
if (paint) {
|
||||
if (context && !context->GetIsDeclarative() && paint) {
|
||||
paint->SetTasks(tasks);
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void RenderCustomPaint::Update(const RefPtr<Component>& component)
|
||||
if (taskPool) {
|
||||
taskPool->SetRenderNode(AceType::WeakClaim(this));
|
||||
pool_ = taskPool;
|
||||
tasks_ = std::list<TaskFunc>(taskPool->GetTasks().begin(), taskPool->GetTasks().end());
|
||||
std::copy(taskPool->GetTasks().begin(), taskPool->GetTasks().end(), std::back_inserter(tasks_));
|
||||
taskPool->ClearTasks();
|
||||
pool_->SetPushToRenderNodeFunc([weak = AceType::WeakClaim(this)](const TaskFunc& taskFunc) {
|
||||
auto client = weak.Upgrade();
|
||||
|
@ -157,7 +157,7 @@ RosenRenderCustomPaint::~RosenRenderCustomPaint()
|
||||
if (!pipeline) {
|
||||
return;
|
||||
}
|
||||
pipeline->PostTaskToRS([this]() { environment_ = nullptr; });
|
||||
pipeline->PostTaskToRT([this]() { environment_ = nullptr; });
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ void RosenRenderCustomPaint::InitializeEglContext()
|
||||
if (!pipeline) {
|
||||
return;
|
||||
}
|
||||
pipeline->PostTaskToRS([this]() { environment_ = EnvironmentGL::MakeSharedGLContext(); });
|
||||
pipeline->PostTaskToRT([this]() { environment_ = EnvironmentGL::MakeSharedGLContext(); });
|
||||
if (!environment_) {
|
||||
LOGE("Make shared GLContext failed.");
|
||||
return;
|
||||
|
@ -100,6 +100,26 @@ public:
|
||||
onSelectId_ = onSelectId;
|
||||
}
|
||||
|
||||
void SetGridItemWidth(const Dimension& width)
|
||||
{
|
||||
itemWidth_ = width;
|
||||
}
|
||||
|
||||
const Dimension& GetGridItemWidth() const
|
||||
{
|
||||
return itemWidth_;
|
||||
}
|
||||
|
||||
void SetGridItemHeight(const Dimension& height)
|
||||
{
|
||||
itemHeight_ = height;
|
||||
}
|
||||
|
||||
const Dimension& GetGridItemHeight() const
|
||||
{
|
||||
return itemHeight_;
|
||||
}
|
||||
|
||||
private:
|
||||
EventMarker clickEventId_;
|
||||
int32_t columnIndex_ = -1;
|
||||
@ -109,6 +129,8 @@ private:
|
||||
bool forceRebuild_ = false;
|
||||
OnSelectFunc onSelectId_;
|
||||
bool selectable_ = true;
|
||||
Dimension itemWidth_ {-1};
|
||||
Dimension itemHeight_ {-1};
|
||||
};
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
@ -216,7 +216,8 @@ int32_t RenderGridLayout::GetIndexByGrid(int32_t row, int32_t column) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
LayoutParam RenderGridLayout::MakeInnerLayoutParam(int32_t row, int32_t col, int32_t rowSpan, int32_t colSpan) const
|
||||
LayoutParam RenderGridLayout::MakeInnerLayoutParam(
|
||||
int32_t row, int32_t col, int32_t rowSpan, int32_t colSpan, bool itemIsPercentUnit) const
|
||||
{
|
||||
LOGD("%{public}d %{public}d %{public}d %{public}d", row, col, rowSpan, colSpan);
|
||||
LayoutParam innerLayout;
|
||||
|
@ -196,7 +196,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual LayoutParam MakeInnerLayoutParam(int32_t row, int32_t col, int32_t rowSpan, int32_t colSpan) const;
|
||||
virtual LayoutParam MakeInnerLayoutParam(
|
||||
int32_t row, int32_t col, int32_t rowSpan, int32_t colSpan, bool itemIsPercentUnit = false) const;
|
||||
|
||||
void SetItemIndex(const RefPtr<RenderNode>& child, int32_t index);
|
||||
|
||||
|
@ -40,6 +40,8 @@ void RenderGridLayoutItem::Update(const RefPtr<Component>& component)
|
||||
InitAnimationController(GetContext());
|
||||
onSelectId_ = gridItem->GetOnSelectId();
|
||||
selectable_ = gridItem->GetSelectable();
|
||||
itemWidth_ = gridItem->GetGridItemWidth();
|
||||
itemHeight_ = gridItem->GetGridItemHeight();
|
||||
MarkNeedLayout();
|
||||
}
|
||||
|
||||
|
@ -133,6 +133,26 @@ public:
|
||||
return isSelected_;
|
||||
}
|
||||
|
||||
void SetGridItemWidth(const Dimension& width)
|
||||
{
|
||||
itemWidth_ = width;
|
||||
}
|
||||
|
||||
const Dimension& GetGridItemWidth() const
|
||||
{
|
||||
return itemWidth_;
|
||||
}
|
||||
|
||||
void SetGridItemHeight(const Dimension& height)
|
||||
{
|
||||
itemHeight_ = height;
|
||||
}
|
||||
|
||||
const Dimension& GetGridItemHeight() const
|
||||
{
|
||||
return itemHeight_;
|
||||
}
|
||||
|
||||
private:
|
||||
int32_t index_ = -1;
|
||||
int32_t columnIndex_ = -1;
|
||||
@ -146,6 +166,8 @@ private:
|
||||
OnSelectFunc onSelectId_;
|
||||
bool selectable_ = true;
|
||||
bool isSelected_ = false;
|
||||
Dimension itemWidth_ {-1};
|
||||
Dimension itemHeight_ {-1};
|
||||
};
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
@ -17,6 +17,7 @@ import(
|
||||
build_component("proxy") {
|
||||
sources = [
|
||||
"flutter_render_item_proxy.cpp",
|
||||
"proxy_component.cpp",
|
||||
"render_item_proxy.cpp",
|
||||
"render_item_proxy_creator.cpp",
|
||||
"render_proxy.cpp",
|
||||
|
25
frameworks/core/components/proxy/proxy_component.cpp
Normal file
25
frameworks/core/components/proxy/proxy_component.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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/proxy/proxy_component.h"
|
||||
|
||||
#include "core/components/proxy/proxy_element.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
RefPtr<Element> ProxyComponent::CreateElement()
|
||||
{
|
||||
return AceType::MakeRefPtr<ProxyElement>();
|
||||
}
|
||||
} // namespace OHOS::Ace
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user