inspector filter过滤优化

Signed-off-by: Baisong Zhong <zhongbaisong@huawei.com>
Change-Id: Ibb195673c0ed33e8e98ba893ee04a1c821335aa4
This commit is contained in:
Baisong Zhong 2024-05-24 16:01:03 +08:00
parent 082531e21a
commit 8d106c1f75
131 changed files with 798 additions and 80 deletions

View File

@ -44,6 +44,7 @@ gen_obj("multimedia_movingphotoview_abc") {
ohos_shared_library("movingphotoview") {
defines = [ "USE_ARK_ENGINE" ]
sources = [
"$ace_root/frameworks/core/components_ng/base/inspector_filter.cpp",
"${component_ext_path}/ext_common/ext_napi_utils.cpp",
"${component_ext_path}/movingphoto/movingphoto_layout_algorithm.cpp",
"${component_ext_path}/movingphoto/movingphoto_model_ng.cpp",

View File

@ -137,6 +137,10 @@ struct BlurStyleOption {
}
void ToJsonValue(std::unique_ptr<JsonValue>& json, const NG::InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
static const char* STYLE[] = { "BlurStyle.NONE", "BlurStyle.Thin", "BlurStyle.Regular", "BlurStyle.Thick",
"BlurStyle.BACKGROUND_THIN", "BlurStyle.BACKGROUND_REGULAR", "BlurStyle.BACKGROUND_THICK",
"BlurStyle.BACKGROUND_ULTRA_THICK", "BlurStyle.COMPONENT_ULTRA_THIN", "BlurStyle.COMPONENT_THIN",
@ -178,8 +182,12 @@ struct BrightnessOption {
NearEqual(saturation, other.saturation) && posRGB == other.posRGB && negRGB == other.negRGB &&
NearEqual(fraction, other.fraction);
}
void ToJsonValue(std::unique_ptr<JsonValue>& json) const
void ToJsonValue(std::unique_ptr<JsonValue>& json, const NG::InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto jsonBrightnessOption = JsonUtil::Create(true);
jsonBrightnessOption->Put("rate", rate);
jsonBrightnessOption->Put("lightUpDegree", lightUpDegree);
@ -200,7 +208,7 @@ struct BrightnessOption {
}
jsonBrightnessOption->Put("negRGB", negRGBstr);
jsonBrightnessOption->Put("fraction", fraction);
json->Put("brightnessEffect", jsonBrightnessOption);
json->PutExtAttr("brightnessEffect", jsonBrightnessOption, filter);
}
};

View File

@ -793,6 +793,17 @@ void FrameNode::FocusToJsonValue(std::unique_ptr<JsonValue>& json, const Inspect
bool focusOnTouch = false;
int32_t tabIndex = 0;
auto focusHub = GetFocusHub();
if (filter.IsFastFilter()) {
if (filter.CheckFixedAttr(FIXED_ATTR_FOCUSABLE)) {
if (focusHub) {
focusable = focusHub->IsFocusable();
focused = focusHub->IsCurrentFocus();
}
json->Put("focusable", focusable);
json->Put("focused", focused);
}
return;
}
if (focusHub) {
enabled = focusHub->IsEnabled();
focusable = focusHub->IsFocusable();
@ -814,6 +825,10 @@ void FrameNode::FocusToJsonValue(std::unique_ptr<JsonValue>& json, const Inspect
void FrameNode::MouseToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
std::string hoverEffect = "HoverEffect.Auto";
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto inputEventHub = GetOrCreateInputEventHub();
if (inputEventHub) {
hoverEffect = inputEventHub->GetHoverEffectStr();
@ -826,6 +841,10 @@ void FrameNode::TouchToJsonValue(std::unique_ptr<JsonValue>& json, const Inspect
bool touchable = true;
bool monopolizeEvents = false;
std::string hitTestMode = "HitTestMode.Default";
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto gestureEventHub = GetOrCreateGestureEventHub();
std::vector<DimensionRect> responseRegion;
std::vector<DimensionRect> mouseResponseRegion;
@ -856,6 +875,10 @@ void FrameNode::GeometryNodeToJsonValue(std::unique_ptr<JsonValue>& json, const
{
bool hasIdealWidth = false;
bool hasIdealHeight = false;
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (layoutProperty_ && layoutProperty_->GetCalcLayoutConstraint()) {
auto selfIdealSize = layoutProperty_->GetCalcLayoutConstraint()->selfIdealSize;
hasIdealWidth = selfIdealSize.has_value() && selfIdealSize.value().Width().has_value();

View File

@ -54,6 +54,19 @@ bool InspectorFilter::CheckFilterAttr(const FixedAttrBit fixedAttrBit, const cha
return false;
}
bool InspectorFilter::IsFastFilter() const
{
/* no filter attr set */
if (FilterEmpty()) {
return false;
}
/* no extend attr set */
if (!filterExt.empty()) {
return false;
}
return true;
}
void InspectorFilter::AddFilterAttr(const std::string& attr)
{
const static std::map<std::string, FixedAttrBit> FIXED_ATTR_MAP = {

View File

@ -42,6 +42,7 @@ public:
bool CheckFixedAttr(const FixedAttrBit attrBit) const;
bool CheckExtAttr(const std::string& attr) const;
bool CheckFilterAttr(const FixedAttrBit fixedAttrBit, const char* extAttr) const;
bool IsFastFilter() const;
void AddFilterAttr(const std::string& attr);
void SetFilterID(const std::string& id);
std::string GetFilterID(void) const;

View File

@ -119,7 +119,10 @@ void LayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const Inspect
magicItemProperty_.ToJsonValue(json, filter);
ACE_PROPERTY_TO_JSON_VALUE(flexItemProperty_, FlexItemProperty);
ACE_PROPERTY_TO_JSON_VALUE(gridProperty_, GridProperty);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (padding_) {
json->PutExtAttr("padding", padding_->ToJsonString().c_str(), filter);
} else {

View File

@ -49,6 +49,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("want", propWant_->c_str(), filter);
}

View File

@ -36,12 +36,16 @@ const Dimension DEFAULT_CIRCLE_SIZE = 16.0_vp;
void BadgeLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto badgeTheme = pipeline->GetTheme<BadgeTheme>();
CHECK_NULL_VOID(badgeTheme);
LayoutProperty::ToJsonValue(json, filter);
json->PutExtAttr("position",
GetBadgePositionString(GetBadgePosition().value_or(badgeTheme->GetBadgePosition())).c_str(), filter);
json->PutExtAttr("count", std::to_string(GetBadgeCount().value_or(DEFAULT_COUNT)).c_str(), filter);

View File

@ -55,6 +55,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("min", GetMinSizeValue(Dimension()).ToString().c_str(), filter);
json->PutExtAttr("height", GetHeightValue(Dimension()).ToString().c_str(), filter);
}

View File

@ -64,6 +64,10 @@ std::string BlankPattern::GetColorString() const
void BlankPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("color", GetColorString().c_str(), filter);
}

View File

@ -128,6 +128,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto layoutProperty = host->GetLayoutProperty<ButtonLayoutProperty>();

View File

@ -49,6 +49,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("type", "ToggleType.Button", filter);
json->PutExtAttr("isOn", propIsOn_.value_or(false) ? "true" : "false", filter);
json->PutExtAttr("selectedColor", propSelectedColor_.value_or(Color()).ColorToString().c_str(), filter);

View File

@ -56,6 +56,10 @@ struct CurrentDayStyle {
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("dayColor", propDayColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("lunarColor", propLunarColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("markLunarColor", propMarkLunarColor.value_or(Color()).ColorToString().c_str(), filter);
@ -110,6 +114,10 @@ struct NonCurrentDayStyle {
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("nonCurrentMonthDayColor",
propNonCurrentMonthDayColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("nonCurrentMonthLunarColor",
@ -129,6 +137,10 @@ struct TodayStyle {
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("focusedDayColor", propFocusedDayColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("focusedLunarColor",
propFocusedLunarColor.value_or(Color()).ColorToString().c_str(), filter);
@ -150,6 +162,10 @@ struct WeekStyle {
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("weekColor", propWeekColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("weekendDayColor", propWeekendDayColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("weekendLunarColor",
@ -176,6 +192,10 @@ struct WorkStateStyle {
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("workDayMarkColor",
propWorkDayMarkColor.value_or(Color()).ColorToString().c_str(), filter);
json->PutExtAttr("offDayMarkColor", propOffDayMarkColor.value_or(Color()).ColorToString().c_str(), filter);
@ -244,6 +264,15 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
ACE_PROPERTY_TO_JSON_VALUE(propCurrentDayStyle_, CurrentDayStyle);
ACE_PROPERTY_TO_JSON_VALUE(propNonCurrentDayStyle_, NonCurrentDayStyle);
ACE_PROPERTY_TO_JSON_VALUE(propTodayStyle_, TodayStyle);
ACE_PROPERTY_TO_JSON_VALUE(propWeekStyle_, WeekStyle);
ACE_PROPERTY_TO_JSON_VALUE(propWorkStateStyle_, WorkStateStyle);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("showLunar", propShowLunar_.value_or(false) ? "true" : "false", filter);
json->PutExtAttr("showHoliday", propShowHoliday_.value_or(false) ? "true" : "false", filter);
static const char* WEEK[] = { "Week.Mon", "Week.Tue", "Week.Wed", "Week.Tur", "Week.Fri", "Week.Sat",
@ -251,11 +280,6 @@ public:
json->PutExtAttr("startOfWeek", WEEK[static_cast<int32_t>(GetStartOfWeek().value_or(Week::Mon))], filter);
const std::string DEFAULT_OFFDAYS = "5,6";
json->PutExtAttr("offDays", propOffDays_.value_or(DEFAULT_OFFDAYS).c_str(), filter);
ACE_PROPERTY_TO_JSON_VALUE(propCurrentDayStyle_, CurrentDayStyle);
ACE_PROPERTY_TO_JSON_VALUE(propNonCurrentDayStyle_, NonCurrentDayStyle);
ACE_PROPERTY_TO_JSON_VALUE(propTodayStyle_, TodayStyle);
ACE_PROPERTY_TO_JSON_VALUE(propWeekStyle_, WeekStyle);
ACE_PROPERTY_TO_JSON_VALUE(propWorkStateStyle_, WorkStateStyle);
}
ACE_DEFINE_PROPERTY_GROUP(CurrentDayStyle, CurrentDayStyle);

View File

@ -381,6 +381,10 @@ void CalendarPattern::UpdateTitleNode()
void CalendarPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto swiperNode = AceType::DynamicCast<FrameNode>(host->GetChildren().front());

View File

@ -46,6 +46,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
RefPtr<CalendarTheme> calendarTheme = pipeline->GetTheme<CalendarTheme>();

View File

@ -30,6 +30,10 @@ void CheckBoxPaintProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const
auto checkboxTheme = pipeline->GetTheme<CheckboxTheme>();
CHECK_NULL_VOID(checkboxTheme);
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("isOn", GetCheckBoxSelect().value_or(false) ? "true" : "false", filter);
json->PutExtAttr("selectedColor",
GetCheckBoxSelectedColor().value_or(DEFAULT_SELECTED_COLOR).ColorToString().c_str(), filter);

View File

@ -200,6 +200,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto checkBoxEventHub = host->GetEventHub<NG::CheckBoxEventHub>();

View File

@ -26,6 +26,11 @@ const Dimension DEFAULT_CHECKMARK_SIZE = Dimension(0, DimensionUnit::VP);
void CheckBoxGroupPaintProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
PaintProperty::ToJsonValue(json, filter);
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto checkboxTheme = pipeline->GetTheme<CheckboxTheme>();

View File

@ -148,6 +148,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto checkBoxEventHub = host->GetEventHub<NG::CheckBoxGroupEventHub>();

View File

@ -69,6 +69,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("viewKey", viewKey_.c_str(), filter);
}

View File

@ -76,6 +76,12 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
ToJsonValueColors(json, filter);
ToJsonTrackShadow(json, filter);
return;
}
auto jsonDashArray = JsonUtil::CreateArray(true);
for (size_t i = 0; i < propValues_.value().size(); ++i) {
auto index = std::to_string(i);
@ -104,6 +110,10 @@ public:
void ToJsonValueColors(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
std::vector<Gradient> valueColors;
if (propValueColors_.has_value()) {
valueColors = propValueColors_.value();
@ -137,6 +147,10 @@ public:
void ToJsonTrackShadow(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipelineContext = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipelineContext);
auto theme = pipelineContext->GetTheme<DataPanelTheme>();

View File

@ -78,6 +78,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("alignment", DialogAlignmentUtils::ConvertDialogAlignmentToString(
propDialogAlignment_.value_or(DialogAlignment::BOTTOM))
.c_str(), filter);

View File

@ -1064,6 +1064,10 @@ void DialogPattern::HandleFocusEvent()
// XTS inspector
void DialogPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
if (host->GetTag() == V2::ALERT_DIALOG_ETS_TAG || host->GetTag() == V2::ACTION_SHEET_DIALOG_ETS_TAG) {

View File

@ -49,6 +49,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("vertical", propVertical_.value_or(true) ? "true" : "false", filter);
json->PutExtAttr("strokeWidth",
propStrokeWidth_

View File

@ -49,6 +49,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipelineContext = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipelineContext);
auto theme = pipelineContext->GetTheme<DividerTheme>();

View File

@ -103,6 +103,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto property = GetLayoutProperty<FlexLayoutProperty>();
CHECK_NULL_VOID(property);
auto jsonConstructor = JsonUtil::Create(true);

View File

@ -49,6 +49,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto align = Alignment::CENTER;
if (GetPositionProperty()) {
align = GetPositionProperty()->GetAlignment().value_or(Alignment::CENTER);

View File

@ -96,6 +96,15 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
if (Container::GreatOrEqualAPIVersion(PlatformVersion::VERSION_ELEVEN)) {
ToJsonColor(json, filter);
ToJsonIndicator(json, filter);
ToJsonTrackShadow(json, filter);
}
return;
}
json->PutExtAttr("value", StringUtils::DoubleToString(propValue_.value_or(0)).c_str(), filter);
json->PutExtAttr("max", StringUtils::DoubleToString(propMax_.value_or(100)).c_str(), filter);
json->PutExtAttr("min", StringUtils::DoubleToString(propMin_.value_or(0)).c_str(), filter);
@ -129,6 +138,10 @@ public:
void ToJsonColor(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (!propGaugeType_.has_value()) {
auto jsonColor = JsonUtil::CreateArray(true);
for (size_t j = 0; j < GAUGE_DEFAULT_COLOR.size(); j++) {
@ -186,6 +199,10 @@ public:
void ToJsonIndicator(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (!propIsShowIndicator_.value_or(true)) {
json->PutExtAttr("indicator", "null", filter);
return;
@ -207,6 +224,10 @@ public:
void ToJsonTrackShadow(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
GaugeShadowOptions trackShadow;
if (propShadowOptions_.has_value()) {
trackShadow.radius = propShadowOptions_.value().radius;

View File

@ -45,6 +45,10 @@ void GridItemLayoutProperty::ResetGridLayoutInfoAndMeasure() const
void GridItemLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("rowStart", std::to_string(propRowStart_.value_or(0)).c_str(), filter);
json->PutExtAttr("rowEnd", std::to_string(propRowEnd_.value_or(0)).c_str(), filter);
json->PutExtAttr("columnStart", std::to_string(propColumnStart_.value_or(0)).c_str(), filter);

View File

@ -97,6 +97,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
Pattern::ToJsonValue(json, filter);
if (filter.IsFastFilter()) {
json->PutFixedAttr("selectable", selectable_ ? "true" : "false", filter, FIXED_ATTR_SELECTABLE);
return;
}
json->PutExtAttr("forceRebuild", forceRebuild_ ? "true" : "false", filter);
json->PutFixedAttr("selectable", selectable_ ? "true" : "false", filter, FIXED_ATTR_SELECTABLE);
}

View File

@ -50,6 +50,10 @@ void GridLayoutProperty::ResetPositionFlags() const
void GridLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("columnsTemplate", propColumnsTemplate_.value_or("").c_str(), filter);
json->PutExtAttr("rowsTemplate", propRowsTemplate_.value_or("").c_str(), filter);
json->PutExtAttr("columnsGap", propColumnsGap_.value_or(0.0_vp).ToString().c_str(), filter);

View File

@ -1210,6 +1210,10 @@ void GridPattern::ScrollBy(float offset)
void GridPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
ScrollablePattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("multiSelectable", multiSelectable_ ? "true" : "false", filter);
json->PutExtAttr("supportAnimation", supportAnimation_ ? "true" : "false", filter);
}

View File

@ -27,6 +27,10 @@ using OHOS::Ace::V2::GridContainerUtils;
void GridColLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto sizeType = GetSizeTypeValue(V2::GridSizeType::UNDEFINED);
auto span = GetSpan(sizeType);

View File

@ -52,7 +52,10 @@ void GridContainerLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json,
if (!HasContainerInfo()) {
return;
}
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto info = GetContainerInfoValue();
const std::string sizeTypeStrs[] { "SizeType.Auto", "SizeType.XS", "SizeType.SM", "SizeType.MD", "SizeType.LG",
"SizeType.XL" };

View File

@ -23,6 +23,10 @@ using OHOS::Ace::V2::GridContainerUtils;
void GridRowLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto sizeType = GetSizeTypeValue(V2::GridSizeType::UNDEFINED);
std::string str;

View File

@ -52,8 +52,12 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
json->PutExtAttr("color", propColor_.value_or(Color::BLUE).ColorToString().c_str(), filter);
json->PutFixedAttr("content", propContent_.value_or("").c_str(), filter, FIXED_ATTR_CONTENT);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("color", propColor_.value_or(Color::BLUE).ColorToString().c_str(), filter);
json->PutExtAttr("address", propAddress_.value_or("").c_str(), filter);
}

View File

@ -32,6 +32,10 @@ struct ImageSizeStyle {
ACE_DEFINE_PROPERTY_GROUP_ITEM(FitOriginalSize, bool);
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("sourceSize", propSourceSize.value_or(SizeF()).ToString().c_str(), filter);
json->PutExtAttr("fitOriginalSize", propFitOriginalSize.value_or(false) ? "true" : "false", filter);
json->PutExtAttr("autoResize", propAutoResize.value_or(true) ? "true" : "false", filter);
@ -71,15 +75,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
static const char* OBJECTFITVALUE[] = { "ImageFit.Fill", "ImageFit.Contain", "ImageFit.Cover",
"ImageFit.Auto", "ImageFit.FitHeight", "ImageFit.None", "ImageFit.ScaleDown" };
static const char* VERTICALALIGNVALUE[] = { "VerticalAlign.NONE", "VerticalAlign.TOP", "VerticalAlign.CENTER",
"VerticalAlign.BOTTOM", "VerticalAlign.BASELINE", "VerticalAlign.NONE" };
json->PutExtAttr("alt", propAlt_.value_or(ImageSourceInfo("")).GetSrc().c_str(), filter);
json->PutExtAttr("objectFit",
OBJECTFITVALUE[static_cast<int32_t>(propImageFit_.value_or(ImageFit::COVER))], filter);
json->PutExtAttr("verticalAlign",
VERTICALALIGNVALUE[static_cast<int32_t>(propVerticalAlign_.value_or(VerticalAlign::BOTTOM))], filter);
ACE_PROPERTY_TO_JSON_VALUE(propImageSizeStyle_, ImageSizeStyle);
if (GetHasPlaceHolderStyle().has_value()) {
TextBackgroundStyle::ToJsonValue(json, GetPlaceHolderStyle(), filter);
}
std::string src;
if (propImageSourceInfo_.has_value()) {
src = propImageSourceInfo_->GetSrc();
@ -91,14 +90,23 @@ public:
character = tolower(character);
}
}
if (filter.IsFastFilter()) {
json->PutFixedAttr("src", src.c_str(), filter, FIXED_ATTR_SRC);
return;
}
static const char* OBJECTFITVALUE[] = { "ImageFit.Fill", "ImageFit.Contain", "ImageFit.Cover",
"ImageFit.Auto", "ImageFit.FitHeight", "ImageFit.None", "ImageFit.ScaleDown" };
static const char* VERTICALALIGNVALUE[] = { "VerticalAlign.NONE", "VerticalAlign.TOP", "VerticalAlign.CENTER",
"VerticalAlign.BOTTOM", "VerticalAlign.BASELINE", "VerticalAlign.NONE" };
json->PutExtAttr("alt", propAlt_.value_or(ImageSourceInfo("")).GetSrc().c_str(), filter);
json->PutExtAttr("objectFit",
OBJECTFITVALUE[static_cast<int32_t>(propImageFit_.value_or(ImageFit::COVER))], filter);
json->PutExtAttr("verticalAlign",
VERTICALALIGNVALUE[static_cast<int32_t>(propVerticalAlign_.value_or(VerticalAlign::BOTTOM))], filter);
json->PutFixedAttr("src", src.c_str(), filter, FIXED_ATTR_SRC);
json->PutExtAttr("rawSrc", propImageSourceInfo_->GetSrc().c_str(), filter);
json->PutExtAttr("moduleName", propImageSourceInfo_->GetModuleName().c_str(), filter);
json->PutExtAttr("baselineOffset", GetBaselineOffsetValue(Dimension(0)).Value(), filter);
ACE_PROPERTY_TO_JSON_VALUE(propImageSizeStyle_, ImageSizeStyle);
if (GetHasPlaceHolderStyle().has_value()) {
TextBackgroundStyle::ToJsonValue(json, GetPlaceHolderStyle(), filter);
}
auto host = GetHost();
CHECK_NULL_VOID(host);
json->PutExtAttr("privacySensitive", host->IsPrivacySensitive(), filter);

View File

@ -1162,6 +1162,10 @@ void ImagePattern::HandleCopy()
void ImagePattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
static const char* COPY_OPTIONS[] = { "CopyOptions.None", "CopyOptions.InApp", "CopyOptions.Local",
"CopyOptions.Distributed" };
json->PutExtAttr("copyOption", COPY_OPTIONS[static_cast<int32_t>(copyOption_)], filter);

View File

@ -37,6 +37,10 @@ struct ImagePaintStyle {
ACE_DEFINE_PROPERTY_GROUP_ITEM(DynamicMode, DynamicRangeMode);
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
static const char* OBJECTREPEATVALUE[] = { "ImageRepeat.NoRepeat", "ImageRepeat.X", "ImageRepeat.Y",
"ImageRepeat.XY" };
static const char* INTERPOLATIONVALUE[] = { "ImageInterpolation.None", "ImageInterpolation.Low",

View File

@ -371,6 +371,10 @@ void ImageAnimatorPattern::UpdateEventCallback()
void ImageAnimatorPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
static const char* STATUS_MODE[] = { "AnimationStatus.Initial", "AnimationStatus.Running", "AnimationStatus.Paused",
"AnimationStatus.Stopped" };
json->PutExtAttr("state", STATUS_MODE[static_cast<int32_t>(status_)], filter);

View File

@ -30,6 +30,10 @@ const std::string DEFAULT_FAMILY = "HarmonyOS Sans";
void IndexerLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("selected", std::to_string(propSelected_.value_or(0)).c_str(), filter);
json->PutExtAttr("color", propColor_.value_or(Color::WHITE).ColorToString().c_str(), filter);
json->PutExtAttr("selectedColor", propSelectedColor_.value_or(Color::WHITE).ColorToString().c_str(), filter);
@ -57,12 +61,9 @@ void IndexerLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const
auto fontFamily = std::vector<std::string>();
fontFamily.emplace_back(DEFAULT_FAMILY);
defaultFont.SetFontFamilies(fontFamily);
auto fontJsonObject = ToJsonObjectValue(propFont_.value_or(defaultFont));
json->PutExtAttr("font", fontJsonObject, filter);
auto selectFontJsonObject = ToJsonObjectValue(propSelectedFont_.value_or(defaultFont));
json->PutExtAttr("selectFont", selectFontJsonObject, filter);
auto popupFontJsonObject = ToJsonObjectValue(propPopupFont_.value_or(defaultFont));
json->PutExtAttr("popupFont", popupFontJsonObject, filter);
json->PutExtAttr("font", ToJsonObjectValue(propFont_.value_or(defaultFont)), filter);
json->PutExtAttr("selectFont", ToJsonObjectValue(propSelectedFont_.value_or(defaultFont)), filter);
json->PutExtAttr("popupFont", ToJsonObjectValue(propPopupFont_.value_or(defaultFont)), filter);
auto pipeline = PipelineContext::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto indexerTheme = pipeline->GetTheme<IndexerTheme>();

View File

@ -72,6 +72,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("selectedBackgroundColor",
propSelectedBackgroundColor_.value_or(Color::WHITE).ColorToString().c_str(), filter);
json->PutExtAttr("popupBackground",

View File

@ -63,6 +63,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
std::string alignItems;
auto flexAlignItems = GetCrossAxisAlign().value_or(FlexAlign::CENTER);
if (isVertical_) {

View File

@ -48,6 +48,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("resizeable", propResizable_.value_or(false) ? "true" : "false", filter);
if (propDivider_.has_value()) {
auto divider = JsonUtil::Create(true);

View File

@ -52,6 +52,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("space", propSpace_.value_or(Dimension(0, DimensionUnit::VP)).ToString().c_str(), filter);
if (propDivider_.has_value()) {
auto divider = JsonUtil::Create(true);

View File

@ -23,6 +23,22 @@ namespace OHOS::Ace::NG {
void ListItemLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
auto editMode = propEditMode_.value_or(V2::EditMode::SHAM);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
if (editMode == V2::EditMode::NONE) {
json->PutFixedAttr("editable", "EditMode.None", filter, FIXED_ATTR_EDITABLE);
} else if (editMode == V2::EditMode::MOVABLE) {
json->PutFixedAttr("editable", "EditMode.Movable", filter, FIXED_ATTR_EDITABLE);
} else if (editMode == V2::EditMode::DELETABLE) {
json->PutFixedAttr("editable", "EditMode.Deletable", filter, FIXED_ATTR_EDITABLE);
} else if (editMode == (V2::EditMode::DELETABLE | V2::EditMode::MOVABLE)) {
json->PutFixedAttr("editable", true, filter, FIXED_ATTR_EDITABLE);
} else {
json->PutFixedAttr("editable", false, filter, FIXED_ATTR_EDITABLE);
}
return;
}
auto sticky = propStickyMode_.value_or(V2::StickyMode::NONE);
if (sticky == V2::StickyMode::NORMAL) {
json->PutExtAttr("sticky", "Sticky.Normal", filter);
@ -31,7 +47,6 @@ void ListItemLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const
} else {
json->PutExtAttr("sticky", "Sticky.None", filter);
}
auto editMode = propEditMode_.value_or(V2::EditMode::SHAM);
if (editMode == V2::EditMode::NONE) {
json->PutFixedAttr("editable", "EditMode.None", filter, FIXED_ATTR_EDITABLE);
} else if (editMode == V2::EditMode::MOVABLE) {

View File

@ -35,26 +35,27 @@ V2::ItemDivider ItemDividerFromJson(const std::unique_ptr<JsonValue>& json)
void ListLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
ScrollSnapPropToJsonValue(json, filter);
return;
}
json->PutExtAttr("space", propSpace_.value_or(Dimension(0, DimensionUnit::VP)).ToString().c_str(), filter);
json->PutExtAttr("contentStartOffset", std::to_string(propContentStartOffset_.value_or(0)).c_str(), filter);
json->PutExtAttr("contentEndOffset", std::to_string(propContentEndOffset_.value_or(0)).c_str(), filter);
json->PutExtAttr("initialIndex", std::to_string(propInitialIndex_.value_or(0)).c_str(), filter);
json->PutExtAttr("listDirection", propListDirection_.value_or(Axis::VERTICAL) == Axis::VERTICAL
? "Axis.Vertical"
: "Axis.Horizontal", filter);
? "Axis.Vertical" : "Axis.Horizontal", filter);
json->PutExtAttr("editMode", propEditMode_.value_or(false), filter);
json->PutExtAttr("chainAnimation", propChainAnimation_.value_or(false), filter);
auto divider = JsonUtil::Create(true);
if (propDivider_.has_value()) {
auto divider = JsonUtil::Create(true);
divider->Put("strokeWidth", propDivider_.value().strokeWidth.ToString().c_str());
divider->Put("startMargin", propDivider_.value().startMargin.ToString().c_str());
divider->Put("endMargin", propDivider_.value().endMargin.ToString().c_str());
divider->Put("color", propDivider_.value().color.ColorToString().c_str());
json->PutExtAttr("divider", divider, filter);
} else {
auto divider = JsonUtil::Create(true);
json->PutExtAttr("divider", divider, filter);
}
json->PutExtAttr("divider", divider, filter);
json->PutExtAttr("lanes", std::to_string(propLanes_.value_or(0)).c_str(), filter);
json->PutExtAttr("laneMinLength",
propLaneMinLength_.value_or(Dimension(0, DimensionUnit::VP)).ToString().c_str(), filter);
@ -87,6 +88,10 @@ void ListLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const Ins
void ListLayoutProperty::ScrollSnapPropToJsonValue(
std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto scrollSnapAlign = propScrollSnapAlign_.value_or(V2::ScrollSnapAlign::NONE);
if (scrollSnapAlign == V2::ScrollSnapAlign::START) {
json->PutExtAttr("scrollSnapAlign", "ScrollSnapAlign.START", filter);

View File

@ -2165,6 +2165,10 @@ int32_t ListPattern::GetItemIndexByPosition(float xOffset, float yOffset)
void ListPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
ScrollablePattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("multiSelectable", multiSelectable_, filter);
json->PutExtAttr("startIndex", startIndex_, filter);
if (!itemPosition_.empty()) {

View File

@ -60,7 +60,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto progressTheme = pipeline->GetTheme<ProgressTheme>();

View File

@ -78,6 +78,10 @@ public:
auto textLayoutProperty = textChild->GetLayoutProperty<TextLayoutProperty>();
CHECK_NULL_VOID(textLayoutProperty);
json->PutFixedAttr("src", textLayoutProperty->GetContent().value_or("").c_str(), filter, FIXED_ATTR_SRC);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("allowScale", propAllowScale_.value_or(false) ? "true" : "false", filter);
json->PutExtAttr("fontSize", propFontSize_.value_or(10.0_vp).ToString().c_str(), filter);
json->PutExtAttr("fontColor", propFontColor_.value_or(textLayoutProperty->GetTextColor().

View File

@ -55,6 +55,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("step", std::to_string(propScrollAmount_.value_or(
DEFAULT_MARQUEE_SCROLL_AMOUNT.ConvertToPx())).c_str(), filter);
json->PutExtAttr("loop", std::to_string(propLoop_.value_or(-1)).c_str(), filter);

View File

@ -147,6 +147,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
if (filter.IsFastFilter()) {
json->PutFixedAttr("content", GetContent().value_or("").c_str(), filter, FIXED_ATTR_CONTENT);
return;
}
if (GetStartIcon().has_value()) {
json->PutExtAttr("startIcon", GetStartIcon()->GetSrc().c_str(), filter);
}

View File

@ -71,6 +71,10 @@ void MenuLayoutProperty::DividerToJsonValue(std::unique_ptr<JsonValue>& json) co
void MenuLayoutProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("title", GetTitle().value_or("").c_str(), filter);
json->PutExtAttr("offset", GetPositionOffset().value_or(OffsetF()).ToString().c_str(), filter);
auto context = PipelineBase::GetCurrentContext();

View File

@ -94,6 +94,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("enableArrow", V2::ConvertBoolToString(GetEnableArrow().value_or(false)).c_str(), filter);
json->PutExtAttr("arrowOffset",
GetArrowOffset().value_or(Dimension(0.0, DimensionUnit::VP)).ToString().c_str(), filter);

View File

@ -70,6 +70,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("titleMode", GetTitleModeString().c_str(), filter);
json->PutExtAttr("hideBackButton", GetHideBackButtonValue(false), filter);
json->PutExtAttr("hideTitleBar", GetHideTitleBarValue(false), filter);

View File

@ -144,13 +144,17 @@ std::string NavBarNode::GetBarItemsString(bool isMenu) const
void NavBarNode::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
auto layoutProperty = GetLayoutProperty<NavBarLayoutProperty>();
CHECK_NULL_VOID(layoutProperty);
layoutProperty->ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("title", GetTitleString().c_str(), filter);
json->PutExtAttr("subtitle", GetSubtitleString().c_str(), filter);
json->PutExtAttr("menus", GetBarItemsString(true).c_str(), filter);
json->PutExtAttr("toolBar", GetBarItemsString(false).c_str(), filter);
auto layoutProperty = GetLayoutProperty<NavBarLayoutProperty>();
CHECK_NULL_VOID(layoutProperty);
layoutProperty->ToJsonValue(json, filter);
}
} // namespace OHOS::Ace::NG

View File

@ -74,6 +74,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
std::string navBarWidthRange = GetMinNavBarWidthValue(DEFAULT_MIN_NAV_BAR_WIDTH).ToString() + ", " +
GetMaxNavBarWidthValue(DEFAULT_MAX_NAV_BAR_WIDTH).ToString();
json->PutExtAttr("navBarWidth", GetNavBarWidthValue(DEFAULT_NAV_BAR_WIDTH).ToString().c_str(), filter);

View File

@ -92,6 +92,10 @@ std::string NavigatorEventHub::GetNavigatorType() const
void NavigatorEventHub::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("active", active_ ? "true" : "false", filter);
json->PutExtAttr("target", url_.c_str(), filter);
json->PutExtAttr("type", GetNavigatorType().c_str(), filter);

View File

@ -60,6 +60,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("hover", propHover_.value_or(false) ? "true" : "false", filter);
json->PutExtAttr("needDivider", propNeedDivider_.value_or(true) ? "true" : "false", filter);
json->PutExtAttr("hasIcon", propHasIcon_.value_or(false) ? "true" : "false", filter);

View File

@ -880,6 +880,10 @@ void SlidingPanelPattern::MarkDirtyNode(PropertyChangeFlag extraFlag)
void SlidingPanelPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto layoutProperty = GetLayoutProperty<SlidingPanelLayoutProperty>();
CHECK_NULL_VOID(layoutProperty);
static const char* PANEL_TYPE[] = { "PanelType.Minibar", "PanelType.Foldable", "PanelType.Temporary" };

View File

@ -50,6 +50,10 @@ public:
CHECK_NULL_VOID(pipeline);
auto patternLockTheme = pipeline->GetTheme<V2::PatternLockTheme>();
CHECK_NULL_VOID(patternLockTheme);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("sideLength",
GetSideLength().value_or(patternLockTheme->GetSideLength()).ToString().c_str(), filter);
}

View File

@ -69,6 +69,10 @@ public:
CHECK_NULL_VOID(pipeline);
auto patternLockTheme = pipeline->GetTheme<V2::PatternLockTheme>();
CHECK_NULL_VOID(patternLockTheme);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("circleRadius",
GetCircleRadius().value_or(patternLockTheme->GetCircleRadius()).ToString().c_str(), filter);
json->PutExtAttr("regularColor",

View File

@ -2153,6 +2153,10 @@ const std::string DatePickerPattern::GetFormatString(PickerDateF date)
void DatePickerPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto GetDateString = [](const PickerDate& pickerDate) {
std::string ret;
ret += std::to_string(pickerDate.GetYear());

View File

@ -66,6 +66,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("lunar", V2::ConvertBoolToString(GetLunar().value_or(false)).c_str(), filter);
auto disappearFont = JsonUtil::Create(true);

View File

@ -52,7 +52,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto progressTheme = pipeline->GetTheme<ProgressTheme>();

View File

@ -29,7 +29,11 @@ constexpr float PROGRSS_MAX_VALUE = 100.f;
void ProgressPaintProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
ToJsonValueForCapsule(json, filter);
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto progressTheme = pipeline->GetTheme<ProgressTheme>();
@ -73,6 +77,10 @@ std::string ProgressPaintProperty::ProgressOptions() const
void ProgressPaintProperty::ToJsonValueForCapsule(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto progressTheme = pipeline->GetTheme<ProgressTheme>();

View File

@ -103,6 +103,12 @@ void ProgressPattern::CalculateStrokeWidth(const SizeF& contentSize)
void ProgressPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
ToJsonValueForRingStyleOptions(json, filter);
ToJsonValueForLinearStyleOptions(json, filter);
return;
}
auto layoutProperty = GetLayoutProperty<ProgressLayoutProperty>();
CHECK_NULL_VOID(layoutProperty);
auto paintProperty = GetPaintProperty<ProgressPaintProperty>();
@ -282,6 +288,10 @@ void ProgressPattern::OnVisibleChange(bool isVisible)
void ProgressPattern::ToJsonValueForRingStyleOptions(std::unique_ptr<JsonValue>& json,
const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto layoutProperty = GetLayoutProperty<ProgressLayoutProperty>();
auto paintProperty = GetPaintProperty<ProgressPaintProperty>();
auto pipeline = PipelineBase::GetCurrentContext();
@ -299,6 +309,10 @@ void ProgressPattern::ToJsonValueForRingStyleOptions(std::unique_ptr<JsonValue>&
void ProgressPattern::ToJsonValueForLinearStyleOptions(
std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto layoutProperty = GetLayoutProperty<ProgressLayoutProperty>();
auto paintProperty = GetPaintProperty<ProgressPaintProperty>();
auto pipeline = PipelineBase::GetCurrentContext();

View File

@ -55,6 +55,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
RefPtr<QrcodeTheme> qrCodeTheme = pipeline->GetTheme<QrcodeTheme>();

View File

@ -54,10 +54,14 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto radioTheme = pipeline->GetTheme<RadioTheme>();
PaintProperty::ToJsonValue(json, filter);
json->PutExtAttr("checked", GetRadioCheck().value_or(false) ? "true" : "false", filter);
auto jsonValue = JsonUtil::Create(true);
jsonValue->Put("checkedBackgroundColor",

View File

@ -139,6 +139,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto radioEventHub = host->GetEventHub<NG::RadioEventHub>();

View File

@ -798,6 +798,10 @@ void RatingPattern::OnModifyDone()
// XTS inspector code
void RatingPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto ratingLayoutProperty = GetLayoutProperty<RatingLayoutProperty>();
if (isForegroundImageInfoFromTheme_) {
json->PutExtAttr("foregroundImageSourceInfo", ImageSourceInfo("").ToString().c_str(), filter);

View File

@ -34,6 +34,10 @@ struct RatingPropertyGroup {
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("indicator", GetIndicator().value_or(false) ? "true" : "false", filter);
json->PutExtAttr("stars", std::to_string(GetStars().value_or(DEFAULT_RATING_STAR_NUM)).c_str(), filter);
auto jsonStarStyle = JsonUtil::Create(true);

View File

@ -51,6 +51,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("rating", std::to_string(propRatingScore_.value_or(0.0)).c_str(), filter);
constexpr double DEFAULT_STEP_SIZE = 0.5;
json->PutExtAttr("stepSize", std::to_string(propStepSize_.value_or(DEFAULT_STEP_SIZE)).c_str(), filter);

View File

@ -74,7 +74,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr(
"offset", propIndicatorOffset_.value_or(Dimension(0, DimensionUnit::VP)).ToString().c_str(), filter);
json->PutExtAttr(

View File

@ -44,6 +44,10 @@ public:
{
LayoutProperty::ToJsonValue(json, filter);
auto align = Alignment::TOP_LEFT;
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (GetPositionProperty()) {
align = GetPositionProperty()->GetAlignment().value_or(Alignment::TOP_LEFT);
}

View File

@ -6940,6 +6940,10 @@ bool RichEditorPattern::NeedShowAIDetect()
void RichEditorPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("enableDataDetector", textDetectEnable_ ? "true" : "false", filter);
auto jsonValue = JsonUtil::Create(true);
jsonValue->Put("types", "");

View File

@ -61,6 +61,10 @@ public:
{ Axis::NONE, "ScrollDirection.None" } };
Axis axis = GetAxisValue(Axis::VERTICAL);
json->PutFixedAttr("scrollable", scrollableMap[axis].c_str(), filter, FIXED_ATTR_SCROLLABLE);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("enableScrollInteraction", propScrollEnabled_.value_or(true), filter);
std::unordered_map<ScrollSnapAlign, std::string> scrollSnapAlignMap {
{ ScrollSnapAlign::NONE, "ScrollSnapAlign.NONE" }, { ScrollSnapAlign::START, "ScrollSnapAlign.START" },

View File

@ -1182,6 +1182,10 @@ void ScrollPattern::DumpAdvanceInfo()
void ScrollPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
ScrollablePattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto initialOffset = JsonUtil::Create(true);
initialOffset->Put("xOffset", GetInitialOffset().GetX().ToString().c_str());
initialOffset->Put("yOffset", GetInitialOffset().GetY().ToString().c_str());

View File

@ -50,6 +50,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
std::unordered_map<Axis, std::string> directionMap = {
{ Axis::VERTICAL, "ScrollBarDirection.Vertical" },
{ Axis::HORIZONTAL, "ScrollBarDirection.Horizontal" }

View File

@ -23,6 +23,10 @@ namespace OHOS::Ace::NG {
void ScrollablePaintProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("scrollBar", GetBarStateString().c_str(), filter);
json->PutExtAttr("scrollBarColor", GetBarColor().ColorToString().c_str(), filter);
json->PutExtAttr("scrollBarWidth", GetBarWidth().ToString().c_str(), filter);

View File

@ -76,6 +76,10 @@ RefPtr<PaintProperty> ScrollablePattern::CreatePaintProperty()
void ScrollablePattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("friction", GetFriction(), filter);
if (edgeEffect_ == EdgeEffect::SPRING) {
json->PutExtAttr("edgeEffect", "EdgeEffect.Spring", filter);

View File

@ -60,6 +60,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("searchButton", GetSearchButton().value_or("")->c_str(), filter);
}

View File

@ -1175,6 +1175,10 @@ bool SearchPattern::HandleInputChildOnFocus() const
void SearchPattern::ToJsonValueForTextField(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto textFieldFrameNode = DynamicCast<FrameNode>(host->GetChildAtIndex(TEXTFIELD_INDEX));
@ -1250,6 +1254,10 @@ std::string SearchPattern::SearchTypeToString() const
void SearchPattern::ToJsonValueForSearchIcon(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto searchIconFrameNode = DynamicCast<FrameNode>(host->GetChildAtIndex(IMAGE_INDEX));
@ -1299,6 +1307,10 @@ void SearchPattern::ToJsonValueForSearchIcon(std::unique_ptr<JsonValue>& json, c
void SearchPattern::ToJsonValueForCancelButton(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto layoutProperty = host->GetLayoutProperty<SearchLayoutProperty>();
@ -1351,6 +1363,10 @@ void SearchPattern::ToJsonValueForCancelButton(std::unique_ptr<JsonValue>& json,
void SearchPattern::ToJsonValueForSearchButtonOption(
std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto searchButtonFrameNode = DynamicCast<FrameNode>(host->GetChildAtIndex(BUTTON_INDEX));
@ -1371,6 +1387,10 @@ void SearchPattern::ToJsonValueForSearchButtonOption(
void SearchPattern::ToJsonValueForCursor(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
auto textFieldFrameNode = DynamicCast<FrameNode>(host->GetChildAtIndex(TEXTFIELD_INDEX));

View File

@ -233,6 +233,11 @@ void SecurityComponentPattern::InitOnClick(RefPtr<FrameNode>& secCompNode, RefPt
void SecurityComponentPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
ToJsonValueRect(json, filter);
return;
}
auto node = GetHost();
CHECK_NULL_VOID(node);
@ -281,6 +286,10 @@ void SecurityComponentPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, con
void SecurityComponentPattern::ToJsonValueRect(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto node = GetHost();
CHECK_NULL_VOID(node);

View File

@ -933,6 +933,13 @@ void SelectPattern::InitSpinner(
// XTS inspector code
void SelectPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
ToJsonArrowAndText(json, filter);
ToJsonOptionAlign(json, filter);
ToJsonMenuBackgroundStyle(json, filter);
return;
}
json->PutExtAttr("options", InspectorGetOptions().c_str(), filter);
json->PutExtAttr("selected", std::to_string(selected_).c_str(), filter);
ToJsonArrowAndText(json, filter);
@ -971,6 +978,10 @@ void SelectPattern::ToJsonValue(std::unique_ptr<JsonValue>& json, const Inspecto
void SelectPattern::ToJsonArrowAndText(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto host = GetHost();
CHECK_NULL_VOID(host);
if (!host->GetChildren().empty()) {
@ -999,6 +1010,10 @@ void SelectPattern::ToJsonArrowAndText(std::unique_ptr<JsonValue>& json, const I
void SelectPattern::ToJsonMenuBackgroundStyle(
std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto menu = GetMenuNode();
CHECK_NULL_VOID(menu);
auto menuRenderContext = menu->GetRenderContext();
@ -1018,6 +1033,10 @@ void SelectPattern::ToJsonMenuBackgroundStyle(
void SelectPattern::ToJsonOptionAlign(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto optionAlignJson = JsonUtil::Create(true);
std::string alignTypeString = "MenuAlignType.Start";
if (menuAlign_.alignType == MenuAlignType::START) {

View File

@ -62,6 +62,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
ShapePaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (propStartPoint_.has_value()) {
auto startPointArray = JsonUtil::CreateArray(true);
startPointArray->Put("0", propStartPoint_.value().first.Value());

View File

@ -60,6 +60,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
ShapePaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (propCommands_.has_value()) {
json->PutExtAttr("commands", propCommands_.value().c_str(), filter);
}

View File

@ -62,6 +62,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
ShapePaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (propPoints_.has_value()) {
const auto size = static_cast<int32_t>(propPoints_.value().size());
std::vector<std::array<float, 2>> point(size);

View File

@ -74,6 +74,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
ShapePaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
if (!propTopLeftRadius_.has_value() || !propTopRightRadius_.has_value() || !propBottomLeftRadius_.has_value() ||
!propBottomRightRadius_.has_value()) {
return;

View File

@ -64,6 +64,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
ShapePaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto viewBoxJson = JsonUtil::Create(true);
if (propShapeViewBox_.has_value()) {
viewBoxJson->Put("x", propShapeViewBox_.value().Left().ToString().c_str());

View File

@ -80,6 +80,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("stroke", propStroke_.value_or(Color::BLACK).ColorToString().c_str(), filter);
json->PutExtAttr("strokeWidth", propStrokeWidth_.value_or(Dimension()).ConvertToPx(), filter);
json->PutExtAttr("strokeOpacity",

View File

@ -88,7 +88,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
constexpr Dimension DEFAULT_CONTROL_BUTTON_WIDTH = 32.0_vp;
constexpr Dimension DEFAULT_CONTROL_BUTTON_HEIGHT = 32.0_vp;
constexpr Dimension DEFAULT_CONTROL_BUTTON_LEFT = 16.0_vp;

View File

@ -45,11 +45,15 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto theme = pipeline->GetTheme<SliderTheme>();
CHECK_NULL_VOID(theme);
LayoutProperty::ToJsonValue(json, filter);
json->PutExtAttr("trackThickness",
GetThickness()
.value_or(GetSliderModeValue(SliderModel::SliderMode::OUTSET) == SliderModel::SliderMode::OUTSET

View File

@ -90,11 +90,18 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
if (GetCustomContent().has_value()) {
json->PutFixedAttr("content", GetCustomContent().value().c_str(), filter, FIXED_ATTR_CONTENT);
}
return;
}
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_VOID(pipeline);
auto theme = pipeline->GetTheme<SliderTheme>();
CHECK_NULL_VOID(theme);
PaintProperty::ToJsonValue(json, filter);
auto jsonConstructor = JsonUtil::Create(true);
jsonConstructor->Put("value", std::to_string(GetValue().value_or(0.0f)).c_str());
jsonConstructor->Put("min", std::to_string(GetMin().value_or(0.0f)).c_str());

View File

@ -43,6 +43,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
auto align = Alignment::CENTER;
if (GetPositionProperty()) {
align = GetPositionProperty()->GetAlignment().value_or(Alignment::CENTER);

View File

@ -50,7 +50,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("prevLabel",
GetLeftLabel().value_or(Localization::GetInstance()->GetEntryLetters("stepper.back")).c_str(), filter);
json->PutExtAttr("nextLabel",

View File

@ -46,6 +46,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("index", std::to_string(GetIndex().value_or(0)).c_str(), filter);
}

View File

@ -105,6 +105,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
LayoutProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("index", std::to_string(propIndex_.value_or(0)).c_str(), filter);
json->PutExtAttr("vertical",
propDirection_.value_or(Axis::HORIZONTAL) == Axis::VERTICAL ? "true" : "false", filter);

View File

@ -26,7 +26,10 @@ const int32_t SwiperAnimationStyle::DEFAULT_DURATION = 400;
void SwiperPaintProperty::ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const
{
PaintProperty::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("autoPlay", GetAutoPlay().value_or(false) ? "true" : "false", filter);
json->PutExtAttr("interval",
std::to_string(GetAutoPlayInterval().value_or(SwiperAnimationStyle::DEFAULT_INTERVAL)).c_str(), filter);

View File

@ -110,6 +110,10 @@ public:
void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
{
Pattern::ToJsonValue(json, filter);
/* no fixed attr below, just return */
if (filter.IsFastFilter()) {
return;
}
json->PutExtAttr("currentIndex", currentIndex_, filter);
json->PutExtAttr("currentOffset", currentOffset_, filter);
json->PutExtAttr("uiCastJumpIndex", uiCastJumpIndex_.value_or(-1), filter);

Some files were not shown because too many files have changed in this diff Show More