mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!33095 Rectify code specification problems
Merge pull request !33095 from yangziyong/xxx_change
This commit is contained in:
commit
44ade15407
@ -22,8 +22,8 @@ extern const char _binary_toolbar_abc_start[];
|
||||
extern const char _binary_toolbar_abc_end[];
|
||||
|
||||
// Napi get abc code function
|
||||
extern "C" __attribute__((visibility("default")))
|
||||
void NAPI_arkui_advanced_ToolBar_GetABCCode(const char **buf, int *buflen)
|
||||
extern "C" __attribute__((visibility("default"))) void NAPI_arkui_advanced_ToolBar_GetABCCode(
|
||||
const char **buf, int *buflen)
|
||||
{
|
||||
if (buf != nullptr) {
|
||||
*buf = _binary_toolbar_abc_start;
|
||||
|
@ -22,8 +22,8 @@ extern const char _binary_treeview_abc_start[];
|
||||
extern const char _binary_treeview_abc_end[];
|
||||
|
||||
// Napi get abc code function
|
||||
extern "C" __attribute__((visibility("default")))
|
||||
void NAPI_arkui_advanced_TreeView_GetABCCode(const char **buf, int *buflen)
|
||||
extern "C" __attribute__((visibility("default"))) void NAPI_arkui_advanced_TreeView_GetABCCode(
|
||||
const char **buf, int *buflen)
|
||||
{
|
||||
if (buf != nullptr) {
|
||||
*buf = _binary_treeview_abc_start;
|
||||
|
@ -297,8 +297,8 @@ napi_value ExportMovingPhoto(napi_env env, napi_value exports)
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
||||
extern "C" __attribute__((visibility("default")))
|
||||
void NAPI_multimedia_movingphotoview_GetJSCode(const char** buf, int* bufLen)
|
||||
extern "C" __attribute__((visibility("default"))) void NAPI_multimedia_movingphotoview_GetJSCode(
|
||||
const char** buf, int* bufLen)
|
||||
{
|
||||
if (buf != nullptr) {
|
||||
*buf = _binary_multimedia_movingphotoview_js_start;
|
||||
@ -310,8 +310,8 @@ void NAPI_multimedia_movingphotoview_GetJSCode(const char** buf, int* bufLen)
|
||||
}
|
||||
|
||||
// multimedia_movingphotoview JS register
|
||||
extern "C" __attribute__((visibility("default")))
|
||||
void NAPI_multimedia_movingphotoview_GetABCCode(const char** buf, int* buflen)
|
||||
extern "C" __attribute__((visibility("default"))) void NAPI_multimedia_movingphotoview_GetABCCode(
|
||||
const char** buf, int* buflen)
|
||||
{
|
||||
if (buf != nullptr) {
|
||||
*buf = _binary_multimedia_movingphotoview_abc_start;
|
||||
|
@ -29,7 +29,6 @@
|
||||
#endif
|
||||
|
||||
namespace OHOS::Ace::Framework {
|
||||
|
||||
void OffscreenCanvasRenderingContext2DModelImpl::SetPattern(RefPtr<AceType> pattern)
|
||||
{
|
||||
pattern_ = AceType::DynamicCast<OffscreenCanvas>(pattern);
|
||||
|
@ -189,7 +189,6 @@ protected:
|
||||
const auto firstOffset = colorStops_.front().offset;
|
||||
const auto lastOffset = colorStops_.back().offset;
|
||||
const float span = std::min(std::max(lastOffset - firstOffset, 0.0f), std::numeric_limits<float>::max());
|
||||
|
||||
if (NearZero(span)) {
|
||||
return;
|
||||
}
|
||||
|
@ -174,7 +174,6 @@ bool RenderGrid::UpdateOffset(const Offset& delta)
|
||||
if (NearZero(delta.GetX()) && NearZero(delta.GetY())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Offset oldOffset = offset_;
|
||||
offset_ += delta;
|
||||
offset_ = LimitOffset(offset_);
|
||||
@ -843,7 +842,6 @@ void RenderGrid::RequestChildIfNeeded()
|
||||
break;
|
||||
}
|
||||
double viewportEnd = viewportStart + viewportSize;
|
||||
|
||||
// Calculates the number of child nodes in the cache.
|
||||
auto beginCached = std::lower_bound(posOfChildren_.begin(), posOfChildren_.end(), viewportEnd);
|
||||
auto cachedNum = static_cast<int32_t>(std::distance(beginCached, posOfChildren_.end()));
|
||||
|
@ -869,7 +869,8 @@ void Scrollable::ProcessScrollSnapSpringMotion(float scrollSnapDelta, float scro
|
||||
}
|
||||
});
|
||||
} else {
|
||||
snapMotion_->Reset(currentPos_, scrollSnapDelta + currentPos_, scrollSnapVelocity, DEFAULT_OVER_SPRING_PROPERTY);
|
||||
snapMotion_->Reset(
|
||||
currentPos_, scrollSnapDelta + currentPos_, scrollSnapVelocity, DEFAULT_OVER_SPRING_PROPERTY);
|
||||
}
|
||||
if (scrollMotionFRCSceneCallback_) {
|
||||
scrollMotionFRCSceneCallback_(snapMotion_->GetCurrentVelocity(), NG::SceneStatus::START);
|
||||
|
@ -66,8 +66,7 @@ bool RenderSvgPolygon::PrepareSelfAnimation(const RefPtr<SvgAnimate>& component)
|
||||
|
||||
PrepareWeightAnimate(svgAnimate, pointsVector_, points_, isBy_);
|
||||
|
||||
std::function<void(double)> callback;
|
||||
callback = [weak = AceType::WeakClaim(this)](double value) {
|
||||
std::function<void(double)> callback = [weak = AceType::WeakClaim(this)](double value) {
|
||||
auto svgPath = weak.Upgrade();
|
||||
if (!svgPath) {
|
||||
LOGE("svgPolygon is null");
|
||||
|
@ -132,6 +132,12 @@ public:
|
||||
theme->hoverColor_ = swiperPattern->GetAttr<Color>("indicator_color_hover", Color::TRANSPARENT);
|
||||
theme->pressedColor_ = swiperPattern->GetAttr<Color>("indicator_color_pressed", Color::TRANSPARENT);
|
||||
theme->focusedColor_ = swiperPattern->GetAttr<Color>("indicator_color_focused", Color::TRANSPARENT);
|
||||
ParsePattern2(themeConstants, theme, swiperPattern);
|
||||
}
|
||||
|
||||
void ParsePattern2(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<SwiperIndicatorTheme>& theme,
|
||||
const RefPtr<ThemeStyle> swiperPattern) const
|
||||
{
|
||||
theme->focusedBorderWidth_ = SWIPER_FOCUSED_BORDER_WIDTH;
|
||||
theme->hoverArrowBackgroundColor_ =
|
||||
swiperPattern->GetAttr<Color>(ARROW_COLOR_BOARDCOLOR_HOVER, Color::TRANSPARENT);
|
||||
|
@ -1202,7 +1202,6 @@ void ListLayoutAlgorithm::FixPredictSnapOffsetAlignCenter()
|
||||
if (itemPosition_.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto predictEndPos = totalOffset_ - predictSnapOffset_.value();
|
||||
auto itemHeight = itemPosition_.begin()->second.endPos - itemPosition_.begin()->second.startPos + spaceWidth_;
|
||||
if (LessNotEqual(predictEndPos, itemHeight / 2.0f - contentMainSize_ / 2.0f - spaceWidth_ / 2.0f)) {
|
||||
|
@ -258,9 +258,8 @@ void OptionPattern::OnPress(const TouchEventInfo& info)
|
||||
host->MarkDirtyNode(PROPERTY_UPDATE_RENDER);
|
||||
// disable next option node's divider
|
||||
UpdateNextNodeDivider(false);
|
||||
}
|
||||
// leave press status
|
||||
else if (touchType == TouchType::UP || touchType == TouchType::CANCEL) {
|
||||
} else if (touchType == TouchType::UP || touchType == TouchType::CANCEL) {
|
||||
// leave press status
|
||||
if (IsHover()) {
|
||||
SetBgBlendColor(theme->GetHoverColor());
|
||||
} else {
|
||||
|
@ -305,7 +305,7 @@ void ScrollPattern::AdjustOffset(float& delta, int32_t source)
|
||||
// the distance below the bottom, if higher than bottom, it is zero
|
||||
float overScrollPastEnd = 0.0f;
|
||||
float overScrollPast = 0.0f;
|
||||
// TODO: not consider rowReverse or colReverse
|
||||
// not consider rowReverse or colReverse
|
||||
overScrollPastStart = std::max(currentOffset_, 0.0f);
|
||||
if (Positive(scrollableDistance_)) {
|
||||
overScrollPastEnd = std::max(-scrollableDistance_ - currentOffset_, 0.0f);
|
||||
|
@ -1310,7 +1310,6 @@ void TabBarPattern::PlayMaskAnimation(float selectedImageSize,
|
||||
MaskAnimationFinish(host, unselectedIndex, false);
|
||||
}
|
||||
});
|
||||
|
||||
AnimationUtils::AddKeyFrame(HALF_PROGRESS, [weak = AceType::WeakClaim(this), selectedIndex, unselectedIndex,
|
||||
selectedImageSize, originalSelectedMaskOffset, unselectedImageSize, originalUnselectedMaskOffset]() {
|
||||
auto tabBar = weak.Upgrade();
|
||||
@ -1321,7 +1320,6 @@ void TabBarPattern::PlayMaskAnimation(float selectedImageSize,
|
||||
INVALID_RATIO, false);
|
||||
}
|
||||
});
|
||||
|
||||
AnimationUtils::AddKeyFrame(FULL_PROGRESS, [weak = AceType::WeakClaim(this), selectedIndex, unselectedIndex,
|
||||
selectedImageSize, originalSelectedMaskOffset, unselectedImageSize, originalUnselectedMaskOffset]() {
|
||||
auto tabBar = weak.Upgrade();
|
||||
@ -1332,7 +1330,6 @@ void TabBarPattern::PlayMaskAnimation(float selectedImageSize,
|
||||
HALF_MASK_RADIUS_RATIO, false);
|
||||
}
|
||||
});
|
||||
|
||||
AnimationUtils::CloseImplicitAnimation();
|
||||
}
|
||||
|
||||
@ -2227,7 +2224,6 @@ void TabBarPattern::GetIndicatorStyle(IndicatorStyle& indicatorStyle, OffsetF& i
|
||||
return;
|
||||
}
|
||||
indicatorStyle = indicatorStyles_[indicator_];
|
||||
|
||||
auto host = GetHost();
|
||||
CHECK_NULL_VOID(host);
|
||||
auto layoutProperty = host->GetLayoutProperty<TabBarLayoutProperty>();
|
||||
@ -2236,11 +2232,9 @@ void TabBarPattern::GetIndicatorStyle(IndicatorStyle& indicatorStyle, OffsetF& i
|
||||
if (NonPositive(indicatorStyle.width.Value())) {
|
||||
indicatorStyle.width = Dimension(layoutProperty->GetIndicatorRect(indicator_).Width());
|
||||
}
|
||||
|
||||
if ((!isTouchingSwiper_ && !isAnimating_) || axis_ != Axis::HORIZONTAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (LessOrEqual(turnPageRate_, 0.0f)) {
|
||||
turnPageRate_ = 0.0f;
|
||||
}
|
||||
|
@ -4469,11 +4469,11 @@ void TextFieldPattern::HandleCounterBorder()
|
||||
}
|
||||
}
|
||||
|
||||
void TextFieldPattern::PerformAction(TextInputAction action, bool forceCloseKeyboard)
|
||||
bool TextFieldPattern::ProcessFocusIndexAction()
|
||||
{
|
||||
if (focusIndex_ == FocuseIndex::CANCEL) {
|
||||
CleanNodeResponseKeyEvent();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (focusIndex_ == FocuseIndex::UNIT) {
|
||||
if (IsShowPasswordIcon()) {
|
||||
@ -4482,6 +4482,14 @@ void TextFieldPattern::PerformAction(TextInputAction action, bool forceCloseKeyb
|
||||
if (IsShowUnit()) {
|
||||
UnitResponseKeyEvent();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TextFieldPattern::PerformAction(TextInputAction action, bool forceCloseKeyboard)
|
||||
{
|
||||
if (!ProcessFocusIndexAction()) {
|
||||
return;
|
||||
}
|
||||
TAG_LOGI(AceLogTag::ACE_TEXT_FIELD, "PerformAction %{public}d", static_cast<int32_t>(action));
|
||||
|
@ -329,7 +329,6 @@ public:
|
||||
focusPattern.SetIsFocusActiveWhenFocused(true);
|
||||
return focusPattern;
|
||||
}
|
||||
|
||||
void PerformAction(TextInputAction action, bool forceCloseKeyboard = false) override;
|
||||
void UpdateEditingValue(const std::shared_ptr<TextEditingValue>& value, bool needFireChangeEvent = true) override;
|
||||
void UpdateInputFilterErrorText(const std::string& errorText) override;
|
||||
@ -1349,6 +1348,7 @@ private:
|
||||
void InitLongPressEvent();
|
||||
void InitClickEvent();
|
||||
void InitDragDropEvent();
|
||||
bool ProcessFocusIndexAction();
|
||||
std::function<DragDropInfo(const RefPtr<OHOS::Ace::DragEvent>&, const std::string&)> OnDragStart();
|
||||
std::function<void(const RefPtr<OHOS::Ace::DragEvent>&, const std::string&)> OnDragDrop();
|
||||
void ShowSelectAfterDragEvent();
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
namespace OHOS::Ace::NG {
|
||||
namespace {
|
||||
// TODO timepicker style modification
|
||||
// timepicker style modification
|
||||
constexpr Dimension PADDING_WEIGHT = 10.0_vp;
|
||||
const Dimension FONT_SIZE = Dimension(2.0);
|
||||
const uint32_t OPTION_COUNT_PHONE_LANDSCAPE = 3;
|
||||
|
@ -326,10 +326,11 @@ bool DrawingImage::DrawWithRecordingCanvas(RSCanvas& canvas, const BorderRadiusA
|
||||
for (int i = 0; i < 4; i++) {
|
||||
pointRadius[i] = radius[i];
|
||||
}
|
||||
Rosen::Drawing::AdaptiveImageInfo rsImageInfo =
|
||||
{static_cast<int32_t>(config.imageFit_), static_cast<int32_t>(config.imageRepeat_),
|
||||
{pointRadius[0], pointRadius[1], pointRadius[2], pointRadius[3]}, 1.0, GetUniqueID(),
|
||||
GetCompressWidth(), GetCompressHeight()};
|
||||
Rosen::Drawing::AdaptiveImageInfo rsImageInfo = {
|
||||
static_cast<int32_t>(config.imageFit_), static_cast<int32_t>(config.imageRepeat_),
|
||||
{pointRadius[0], pointRadius[1], pointRadius[2], pointRadius[3]}, 1.0, GetUniqueID(),
|
||||
GetCompressWidth(), GetCompressHeight()
|
||||
};
|
||||
auto data = GetCompressData();
|
||||
recordingCanvas.AttachBrush(brush);
|
||||
recordingCanvas.DrawImageWithParm(GetImage(), std::move(data), rsImageInfo, options);
|
||||
|
@ -1624,12 +1624,10 @@ int32_t RenderGridScroll::GetIndexByPosition(double position) const
|
||||
if (!item || item->GetChildren().empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto gridItem = AceType::DynamicCast<RenderGridLayoutItem>(item);
|
||||
if (!gridItem) {
|
||||
break;
|
||||
}
|
||||
|
||||
startPosition = item->GetPosition().GetY();
|
||||
endPosition = item->GetPosition().GetY() + item->GetLayoutSize().Height();
|
||||
if ((position > startPosition && position < endPosition) || NearEqual(position, startPosition) ||
|
||||
|
@ -129,7 +129,7 @@ std::string GridRowComposedElement::GetGridRowBreakpoints() const
|
||||
return "[";
|
||||
}
|
||||
std::string result = "[";
|
||||
for (auto & breakpoint : breakpointPtr->breakpoints) {
|
||||
for (auto& breakpoint : breakpointPtr->breakpoints) {
|
||||
result.append(breakpoint);
|
||||
result.append(", ");
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ void APngImagePlayer::Resume()
|
||||
}
|
||||
}
|
||||
|
||||
void APngImagePlayer::RenderFrame(const int32_t &index)
|
||||
void APngImagePlayer::RenderFrame(const int32_t& index)
|
||||
{
|
||||
auto context = context_.Upgrade();
|
||||
if (!context) {
|
||||
@ -226,47 +226,44 @@ void APngImagePlayer::RenderFrame(const int32_t &index)
|
||||
}
|
||||
|
||||
auto taskExecutor = context->GetTaskExecutor();
|
||||
taskExecutor->PostTask([weak = AceType::WeakClaim(this),
|
||||
index,
|
||||
dstWidth = dstWidth_,
|
||||
dstHeight = dstHeight_,
|
||||
taskExecutor] {
|
||||
auto player = weak.Upgrade();
|
||||
if (!player) {
|
||||
return;
|
||||
}
|
||||
taskExecutor->PostTask(
|
||||
[weak = AceType::WeakClaim(this), index, dstWidth = dstWidth_, dstHeight = dstHeight_, taskExecutor] {
|
||||
auto player = weak.Upgrade();
|
||||
if (!player) {
|
||||
return;
|
||||
}
|
||||
|
||||
APngAnimatedFrameInfo *frameInfo = player->DecodeFrameImage(index);
|
||||
if (!frameInfo || !frameInfo->image) {
|
||||
return;
|
||||
}
|
||||
APngAnimatedFrameInfo* frameInfo = player->DecodeFrameImage(index);
|
||||
if (!frameInfo || !frameInfo->image) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef USE_ROSEN_DRAWING
|
||||
sk_sp<SkImage> skImage = frameInfo->image;
|
||||
if (dstWidth > 0 && dstHeight > 0) {
|
||||
skImage = ImageProvider::ApplySizeToSkImage(skImage, dstWidth, dstHeight);
|
||||
}
|
||||
if (!skImage) {
|
||||
LOGW("animated player cannot get the %{public}d skImage!", index);
|
||||
return;
|
||||
}
|
||||
auto canvasImage = NG::CanvasImage::Create(&skImage);
|
||||
sk_sp<SkImage> skImage = frameInfo->image;
|
||||
if (dstWidth > 0 && dstHeight > 0) {
|
||||
skImage = ImageProvider::ApplySizeToSkImage(skImage, dstWidth, dstHeight);
|
||||
}
|
||||
if (!skImage) {
|
||||
LOGW("animated player cannot get the %{public}d skImage!", index);
|
||||
return;
|
||||
}
|
||||
auto canvasImage = NG::CanvasImage::Create(&skImage);
|
||||
#else
|
||||
std::shared_ptr<RSImage> dImage = frameInfo->image;
|
||||
if (dstWidth > 0 && dstHeight > 0) {
|
||||
dImage = ImageProvider::ApplySizeToDrawingImage(dImage, dstWidth, dstHeight);
|
||||
}
|
||||
if (!dImage) {
|
||||
LOGW("animated player cannot get the %{public}d dImage!", index);
|
||||
return;
|
||||
}
|
||||
auto canvasImage = NG::CanvasImage::Create(&dImage);
|
||||
std::shared_ptr<RSImage> dImage = frameInfo->image;
|
||||
if (dstWidth > 0 && dstHeight > 0) {
|
||||
dImage = ImageProvider::ApplySizeToDrawingImage(dImage, dstWidth, dstHeight);
|
||||
}
|
||||
if (!dImage) {
|
||||
LOGW("animated player cannot get the %{public}d dImage!", index);
|
||||
return;
|
||||
}
|
||||
auto canvasImage = NG::CanvasImage::Create(&dImage);
|
||||
#endif
|
||||
|
||||
taskExecutor->PostTask([callback = player->successCallback_, canvasImage,
|
||||
source = player->imageSource_] { callback(source, canvasImage); },
|
||||
TaskExecutor::TaskType::UI, "ArkUIImageAPngRenderSuccess");
|
||||
},
|
||||
taskExecutor->PostTask([callback = player->successCallback_, canvasImage,
|
||||
source = player->imageSource_] { callback(source, canvasImage); },
|
||||
TaskExecutor::TaskType::UI, "ArkUIImageAPngRenderSuccess");
|
||||
},
|
||||
TaskExecutor::TaskType::IO, "ArkUIImageAPngRenderFrame");
|
||||
}
|
||||
|
||||
@ -313,7 +310,7 @@ sk_sp<SkImage> APngImagePlayer::GetImage(const int32_t& index, bool extendToCanv
|
||||
return rawImage;
|
||||
}
|
||||
#else
|
||||
// TODO Drawing : SkData::MakeWithProc
|
||||
// Drawing : SkData::MakeWithProc
|
||||
#endif
|
||||
void APngImagePlayer::ClearCanvasRect(const APngAnimatedFrameInfo *frameInfo)
|
||||
{
|
||||
@ -821,9 +818,7 @@ APngAnimatedFrameInfo *APngImagePlayer::DecodeFrameImage(const int32_t& index)
|
||||
#endif
|
||||
|
||||
blendFrameIndex_ = index;
|
||||
}
|
||||
// canvas is not ready
|
||||
else {
|
||||
} else { // canvas is not ready
|
||||
for (uint32_t i = (uint32_t) frameInfo->blendFromIndex; i <= (uint32_t) frameInfo->index; i++) {
|
||||
if (i == frameInfo->index) {
|
||||
if (!image) {
|
||||
|
@ -211,8 +211,8 @@ const double DEFAULT_GRID_WIDTH = -1.0;
|
||||
const double DEFAULT_GRID_HEIGHT = -1.0;
|
||||
|
||||
// scrollBar
|
||||
extern const char SCROLL_BAR_DISPLAY_MODE[] = "scrollbar";
|
||||
extern const char SCROLL_BAR_SHAPE_MODE[] = "shapemode";
|
||||
const char SCROLL_BAR_DISPLAY_MODE[] = "scrollbar";
|
||||
const char SCROLL_BAR_SHAPE_MODE[] = "shapemode";
|
||||
|
||||
// edge constants
|
||||
const char PADDING_NAME[] = "Padding";
|
||||
|
@ -611,17 +611,18 @@ napi_value ObserverProcess::ProcessDensityUnRegister(napi_env env, napi_callback
|
||||
|
||||
napi_value ObserverProcess::ProcessDrawCommandSendRegister(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_PARAMS(env, info, 3);
|
||||
GET_PARAMS(env, info, 3); // 3: Param Size Three
|
||||
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) {
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) { // 2: Param Size Two
|
||||
auto listener = std::make_shared<UIObserverListener>(env, argv[1]);
|
||||
int32_t instanceId = ContainerScope::CurrentId();
|
||||
UIObserver::RegisterDrawCallback(instanceId, listener);
|
||||
}
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && MatchValueType(env, argv[2], napi_function)) {
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && // 3: Param Size Three
|
||||
MatchValueType(env, argv[2], napi_function)) { // 2: Param Index Two
|
||||
auto context = argv[1];
|
||||
if (context) {
|
||||
auto listener = std::make_shared<UIObserverListener>(env, argv[2]);
|
||||
auto listener = std::make_shared<UIObserverListener>(env, argv[2]); // 2: Param Index Two
|
||||
auto uiContextInstanceId = GetUIContextInstanceId(env, context);
|
||||
UIObserver::RegisterDrawCallback(uiContextInstanceId, listener);
|
||||
}
|
||||
@ -632,14 +633,14 @@ napi_value ObserverProcess::ProcessDrawCommandSendRegister(napi_env env, napi_ca
|
||||
|
||||
napi_value ObserverProcess::ProcessDrawCommandSendUnRegister(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_PARAMS(env, info, 3);
|
||||
GET_PARAMS(env, info, 3); // 3: Param Size Three
|
||||
|
||||
if (argc == 1) {
|
||||
int32_t instanceId = ContainerScope::CurrentId();
|
||||
UIObserver::UnRegisterDrawCallback(instanceId, nullptr);
|
||||
}
|
||||
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_object)) {
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_object)) { // 2: Param Size Two
|
||||
napi_value context = argv[1];
|
||||
if (context) {
|
||||
auto uiContextInstanceId = GetUIContextInstanceId(env, context);
|
||||
@ -647,16 +648,17 @@ napi_value ObserverProcess::ProcessDrawCommandSendUnRegister(napi_env env, napi_
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) {
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) { // 2: Param Size Two
|
||||
int32_t instanceId = ContainerScope::CurrentId();
|
||||
UIObserver::UnRegisterDrawCallback(instanceId, argv[1]);
|
||||
}
|
||||
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && MatchValueType(env, argv[2], napi_function)) {
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && // 3: Param Size Three
|
||||
MatchValueType(env, argv[2], napi_function)) { // 2: Param Index Two
|
||||
napi_value context = argv[1];
|
||||
if (context) {
|
||||
auto uiContextInstanceId = GetUIContextInstanceId(env, context);
|
||||
UIObserver::UnRegisterDrawCallback(uiContextInstanceId, argv[2]);
|
||||
UIObserver::UnRegisterDrawCallback(uiContextInstanceId, argv[2]); // 2: Param Index Two
|
||||
}
|
||||
}
|
||||
|
||||
@ -666,17 +668,18 @@ napi_value ObserverProcess::ProcessDrawCommandSendUnRegister(napi_env env, napi_
|
||||
|
||||
napi_value ObserverProcess::ProcessLayoutDoneRegister(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_PARAMS(env, info, 3);
|
||||
GET_PARAMS(env, info, 3); // 3: Param Size Three
|
||||
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) {
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) { // 2: Param Size Two
|
||||
auto listener = std::make_shared<UIObserverListener>(env, argv[1]);
|
||||
int32_t instanceId = ContainerScope::CurrentId();
|
||||
UIObserver::RegisterLayoutCallback(instanceId, listener);
|
||||
}
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && MatchValueType(env, argv[2], napi_function)) {
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && // 3: Param Size Three
|
||||
MatchValueType(env, argv[2], napi_function)) { // 2: Param Index Two
|
||||
auto context = argv[1];
|
||||
if (context) {
|
||||
auto listener = std::make_shared<UIObserverListener>(env, argv[2]);
|
||||
auto listener = std::make_shared<UIObserverListener>(env, argv[2]); // 2: Param Index Two
|
||||
auto uiContextInstanceId = GetUIContextInstanceId(env, context);
|
||||
UIObserver::RegisterLayoutCallback(uiContextInstanceId, listener);
|
||||
}
|
||||
@ -687,14 +690,14 @@ napi_value ObserverProcess::ProcessLayoutDoneRegister(napi_env env, napi_callbac
|
||||
|
||||
napi_value ObserverProcess::ProcessLayoutDoneUnRegister(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_PARAMS(env, info, 3);
|
||||
GET_PARAMS(env, info, 3); // 3: Param Size Three
|
||||
|
||||
if (argc == 1) {
|
||||
int32_t instanceId = ContainerScope::CurrentId();
|
||||
UIObserver::UnRegisterLayoutCallback(instanceId, nullptr);
|
||||
}
|
||||
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_object)) {
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_object)) { // 2: Param Size Two
|
||||
napi_value context = argv[1];
|
||||
if (context) {
|
||||
auto uiContextInstanceId = GetUIContextInstanceId(env, context);
|
||||
@ -702,16 +705,17 @@ napi_value ObserverProcess::ProcessLayoutDoneUnRegister(napi_env env, napi_callb
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) {
|
||||
if (argc == 2 && MatchValueType(env, argv[1], napi_function)) { // 2: Param Size Two
|
||||
int32_t instanceId = ContainerScope::CurrentId();
|
||||
UIObserver::UnRegisterLayoutCallback(instanceId, argv[1]);
|
||||
}
|
||||
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && MatchValueType(env, argv[2], napi_function)) {
|
||||
if (argc == 3 && MatchValueType(env, argv[1], napi_object) && // 3: Param Size Three
|
||||
MatchValueType(env, argv[2], napi_function)) { // 2: Param Index Two
|
||||
napi_value context = argv[1];
|
||||
if (context) {
|
||||
auto uiContextInstanceId = GetUIContextInstanceId(env, context);
|
||||
UIObserver::UnRegisterLayoutCallback(uiContextInstanceId, argv[2]);
|
||||
UIObserver::UnRegisterLayoutCallback(uiContextInstanceId, argv[2]); // 2: Param Index Two
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user