mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
commit
5e328c7729
@ -1332,6 +1332,9 @@ std::function<std::string(const std::string&)> ParseGetFunc(ArkUIRuntimeCallInfo
|
||||
CHECK_NULL_RETURN(vm, resultString);
|
||||
panda::LocalScope scope(vm);
|
||||
auto global = JSNApi::GetGlobalObject(vm);
|
||||
if (global.IsNull()) {
|
||||
return resultString;
|
||||
}
|
||||
auto getCustomProperty = global->Get(vm, panda::StringRef::NewFromUtf8(vm, "__getCustomPropertyString__"));
|
||||
if (getCustomProperty->IsUndefined() || !getCustomProperty->IsFunction(vm)) {
|
||||
return resultString;
|
||||
@ -1346,7 +1349,7 @@ std::function<std::string(const std::string&)> ParseGetFunc(ArkUIRuntimeCallInfo
|
||||
return resultString;
|
||||
}
|
||||
auto value = callValue->ToString(vm)->ToString(vm);
|
||||
return value.c_str();
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -10594,7 +10594,7 @@ std::function<std::string(const std::string&)> ParseJsGetFunc(const JSCallbackIn
|
||||
return resultString;
|
||||
}
|
||||
auto value = callValue->ToString(vm)->ToString(vm);
|
||||
return value.c_str();
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -5805,7 +5805,7 @@ void FrameNode::ResetPredictNodes()
|
||||
|
||||
void FrameNode::SetJSCustomProperty(std::function<bool()> func, std::function<std::string(const std::string&)> getFunc)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard<std::mutex> lock(customPropertyMapLock_);
|
||||
bool result = func();
|
||||
if (IsCNode()) {
|
||||
return;
|
||||
@ -5832,10 +5832,10 @@ bool FrameNode::GetCapiCustomProperty(const std::string& key, std::string& value
|
||||
if (!IsCNode()) {
|
||||
return false;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard<std::mutex> lock(customPropertyMapLock_);
|
||||
auto iter = customPropertyMap_.find(key);
|
||||
if (iter != customPropertyMap_.end()) {
|
||||
value = customPropertyMap_[key];
|
||||
value = iter->second;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -5843,13 +5843,13 @@ bool FrameNode::GetCapiCustomProperty(const std::string& key, std::string& value
|
||||
|
||||
void FrameNode::AddCustomProperty(const std::string& key, const std::string& value)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard<std::mutex> lock(customPropertyMapLock_);
|
||||
customPropertyMap_[key] = value;
|
||||
}
|
||||
|
||||
void FrameNode::RemoveCustomProperty(const std::string& key)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard<std::mutex> lock(customPropertyMapLock_);
|
||||
auto iter = customPropertyMap_.find(key);
|
||||
if (iter != customPropertyMap_.end()) {
|
||||
customPropertyMap_.erase(iter);
|
||||
|
@ -1367,7 +1367,7 @@ private:
|
||||
DragPreviewOption previewOption_ { true, false, false, false, false, false, { .isShowBadge = true } };
|
||||
|
||||
std::unordered_map<std::string, std::string> customPropertyMap_;
|
||||
std::mutex mutex_;
|
||||
std::mutex customPropertyMapLock_;
|
||||
|
||||
RefPtr<Recorder::ExposureProcessor> exposureProcessor_;
|
||||
|
||||
|
@ -492,7 +492,7 @@ void ResetSystemFontStyleChangeEvent(ArkUINodeHandle node)
|
||||
ViewAbstract::SetSystemFontChangeEvent(frameNode, nullptr);
|
||||
}
|
||||
|
||||
ArkUI_Uint32 getCustomPropertyCapiByKey(ArkUINodeHandle node, ArkUI_CharPtr key, char** value, ArkUI_Uint32* size)
|
||||
ArkUI_Uint32 GetCustomPropertyCapiByKey(ArkUINodeHandle node, ArkUI_CharPtr key, char** value, ArkUI_Uint32* size)
|
||||
{
|
||||
auto* frameNode = reinterpret_cast<FrameNode*>(node);
|
||||
CHECK_NULL_RETURN(frameNode, 0);
|
||||
@ -509,6 +509,7 @@ ArkUI_Uint32 getCustomPropertyCapiByKey(ArkUINodeHandle node, ArkUI_CharPtr key,
|
||||
|
||||
void FreeCustomPropertyCharPtr(char* value, ArkUI_Uint32 size)
|
||||
{
|
||||
CHECK_NULL_VOID(value);
|
||||
delete[] value;
|
||||
value = nullptr;
|
||||
}
|
||||
@ -551,7 +552,7 @@ const ArkUIFrameNodeModifier* GetFrameNodeModifier()
|
||||
GetInspectorId, GetNodeType, IsVisible, IsAttached, GetInspectorInfo, GetFrameNodeById, GetFrameNodeByUniqueId,
|
||||
GetFrameNodeByKey, GetAttachedFrameNodeById, PropertyUpdate, GetLast, GetFirstUINode, GetLayoutSize,
|
||||
GetLayoutPositionWithoutMargin, SetSystemColorModeChangeEvent, ResetSystemColorModeChangeEvent,
|
||||
SetSystemFontStyleChangeEvent, ResetSystemFontStyleChangeEvent, getCustomPropertyCapiByKey,
|
||||
SetSystemFontStyleChangeEvent, ResetSystemFontStyleChangeEvent, GetCustomPropertyCapiByKey,
|
||||
SetCustomPropertyModiferByKey, AddCustomProperty, RemoveCustomProperty, FreeCustomPropertyCharPtr };
|
||||
return &modifier;
|
||||
}
|
||||
|
@ -1420,11 +1420,11 @@
|
||||
"name": "OH_ArkUI_NodeUtils_GetPositionWithTranslateInScreen"
|
||||
},
|
||||
{
|
||||
"first_introduced": "14",
|
||||
"first_introduced": "13",
|
||||
"name": "OH_ArkUI_NodeUtils_AddCustomProperty"
|
||||
},
|
||||
{
|
||||
"first_introduced": "14",
|
||||
"first_introduced": "13",
|
||||
"name": "OH_ArkUI_NodeUtils_RemoveCustomProperty"
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user