18bf80f4bSopenharmony_ci/* 28bf80f4bSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 38bf80f4bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48bf80f4bSopenharmony_ci * you may not use this file except in compliance with the License. 58bf80f4bSopenharmony_ci * You may obtain a copy of the License at 68bf80f4bSopenharmony_ci * 78bf80f4bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88bf80f4bSopenharmony_ci * 98bf80f4bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108bf80f4bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118bf80f4bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128bf80f4bSopenharmony_ci * See the License for the specific language governing permissions and 138bf80f4bSopenharmony_ci * limitations under the License. 148bf80f4bSopenharmony_ci */ 158bf80f4bSopenharmony_ci#include <meta/base/namespace.h> 168bf80f4bSopenharmony_ci#include <meta/interface/animation/builtin_animations.h> 178bf80f4bSopenharmony_ci#include <meta/interface/intf_object.h> 188bf80f4bSopenharmony_ci#include <meta/interface/intf_object_registry.h> 198bf80f4bSopenharmony_ci 208bf80f4bSopenharmony_ci#include "animation/animation_controller.h" 218bf80f4bSopenharmony_ci#include "animation/interpolator.h" 228bf80f4bSopenharmony_ci#include "animation/keyframe_animation.h" 238bf80f4bSopenharmony_ci#include "animation/modifiers/loop.h" 248bf80f4bSopenharmony_ci#include "animation/modifiers/reverse.h" 258bf80f4bSopenharmony_ci#include "animation/modifiers/speed.h" 268bf80f4bSopenharmony_ci#include "animation/parallel_animation.h" 278bf80f4bSopenharmony_ci#include "animation/property_animation.h" 288bf80f4bSopenharmony_ci#include "animation/sequential_animation.h" 298bf80f4bSopenharmony_ci#include "animation/track_animation.h" 308bf80f4bSopenharmony_ci#include "curves/bezier_curve.h" 318bf80f4bSopenharmony_ci#include "curves/easing_curve.h" 328bf80f4bSopenharmony_ci 338bf80f4bSopenharmony_ciMETA_BEGIN_NAMESPACE() 348bf80f4bSopenharmony_ci 358bf80f4bSopenharmony_cinamespace Internal { 368bf80f4bSopenharmony_ci 378bf80f4bSopenharmony_ci#define DECL_NO(A, B) { ObjectTypeInfo::UID }, ClassId::A, (B) 388bf80f4bSopenharmony_ci#define DECL_AN(A, B) { ObjectTypeInfo::UID }, ClassId::A, (B) 398bf80f4bSopenharmony_ci 408bf80f4bSopenharmony_cistatic constexpr ObjectTypeInfo OBJECTS[] = { 418bf80f4bSopenharmony_ci AnimationController::OBJECT_INFO, 428bf80f4bSopenharmony_ci KeyframeAnimation::OBJECT_INFO, 438bf80f4bSopenharmony_ci PropertyAnimation::OBJECT_INFO, 448bf80f4bSopenharmony_ci TrackAnimation::OBJECT_INFO, 458bf80f4bSopenharmony_ci ParallelAnimation::OBJECT_INFO, 468bf80f4bSopenharmony_ci SequentialAnimation::OBJECT_INFO, 478bf80f4bSopenharmony_ci AnimationModifiers::Loop::OBJECT_INFO, 488bf80f4bSopenharmony_ci AnimationModifiers::Reverse::OBJECT_INFO, 498bf80f4bSopenharmony_ci AnimationModifiers::SpeedImpl::OBJECT_INFO, 508bf80f4bSopenharmony_ci 518bf80f4bSopenharmony_ci Curves::Easing::LinearEasingCurve::OBJECT_INFO, 528bf80f4bSopenharmony_ci Curves::Easing::InQuadEasingCurve::OBJECT_INFO, 538bf80f4bSopenharmony_ci Curves::Easing::OutQuadEasingCurve::OBJECT_INFO, 548bf80f4bSopenharmony_ci Curves::Easing::InOutQuadEasingCurve::OBJECT_INFO, 558bf80f4bSopenharmony_ci Curves::Easing::InCubicEasingCurve::OBJECT_INFO, 568bf80f4bSopenharmony_ci Curves::Easing::OutCubicEasingCurve::OBJECT_INFO, 578bf80f4bSopenharmony_ci Curves::Easing::InOutCubicEasingCurve::OBJECT_INFO, 588bf80f4bSopenharmony_ci Curves::Easing::InSineEasingCurve::OBJECT_INFO, 598bf80f4bSopenharmony_ci Curves::Easing::OutSineEasingCurve::OBJECT_INFO, 608bf80f4bSopenharmony_ci Curves::Easing::InOutSineEasingCurve::OBJECT_INFO, 618bf80f4bSopenharmony_ci Curves::Easing::InQuartEasingCurve::OBJECT_INFO, 628bf80f4bSopenharmony_ci Curves::Easing::OutQuartEasingCurve::OBJECT_INFO, 638bf80f4bSopenharmony_ci Curves::Easing::InOutQuartEasingCurve::OBJECT_INFO, 648bf80f4bSopenharmony_ci Curves::Easing::InQuintEasingCurve::OBJECT_INFO, 658bf80f4bSopenharmony_ci Curves::Easing::OutQuintEasingCurve::OBJECT_INFO, 668bf80f4bSopenharmony_ci Curves::Easing::InOutQuintEasingCurve::OBJECT_INFO, 678bf80f4bSopenharmony_ci Curves::Easing::InExpoEasingCurve::OBJECT_INFO, 688bf80f4bSopenharmony_ci Curves::Easing::OutExpoEasingCurve::OBJECT_INFO, 698bf80f4bSopenharmony_ci Curves::Easing::InOutExpoEasingCurve::OBJECT_INFO, 708bf80f4bSopenharmony_ci Curves::Easing::InCircEasingCurve::OBJECT_INFO, 718bf80f4bSopenharmony_ci Curves::Easing::OutCircEasingCurve::OBJECT_INFO, 728bf80f4bSopenharmony_ci Curves::Easing::InOutCircEasingCurve::OBJECT_INFO, 738bf80f4bSopenharmony_ci Curves::Easing::InBackEasingCurve::OBJECT_INFO, 748bf80f4bSopenharmony_ci Curves::Easing::OutBackEasingCurve::OBJECT_INFO, 758bf80f4bSopenharmony_ci Curves::Easing::InOutBackEasingCurve::OBJECT_INFO, 768bf80f4bSopenharmony_ci Curves::Easing::InElasticEasingCurve::OBJECT_INFO, 778bf80f4bSopenharmony_ci Curves::Easing::OutElasticEasingCurve::OBJECT_INFO, 788bf80f4bSopenharmony_ci Curves::Easing::InOutElasticEasingCurve::OBJECT_INFO, 798bf80f4bSopenharmony_ci Curves::Easing::InBounceEasingCurve::OBJECT_INFO, 808bf80f4bSopenharmony_ci Curves::Easing::OutBounceEasingCurve::OBJECT_INFO, 818bf80f4bSopenharmony_ci Curves::Easing::InOutBounceEasingCurve::OBJECT_INFO, 828bf80f4bSopenharmony_ci Curves::Easing::StepStartEasingCurve::OBJECT_INFO, 838bf80f4bSopenharmony_ci Curves::Easing::StepEndEasingCurve::OBJECT_INFO, 848bf80f4bSopenharmony_ci Curves::Easing::CubicBezierEasingCurve::OBJECT_INFO, 858bf80f4bSopenharmony_ci}; 868bf80f4bSopenharmony_ci 878bf80f4bSopenharmony_civoid RegisterBuiltInAnimations(IObjectRegistry& registry) 888bf80f4bSopenharmony_ci{ 898bf80f4bSopenharmony_ci for (auto& t : OBJECTS) { 908bf80f4bSopenharmony_ci registry.RegisterObjectType(t.GetFactory()); 918bf80f4bSopenharmony_ci } 928bf80f4bSopenharmony_ci 938bf80f4bSopenharmony_ci RegisterDefaultInterpolators(registry); 948bf80f4bSopenharmony_ci} 958bf80f4bSopenharmony_civoid UnRegisterBuiltInAnimations(IObjectRegistry& registry) 968bf80f4bSopenharmony_ci{ 978bf80f4bSopenharmony_ci for (auto& t : OBJECTS) { 988bf80f4bSopenharmony_ci registry.UnregisterObjectType(t.GetFactory()); 998bf80f4bSopenharmony_ci } 1008bf80f4bSopenharmony_ci 1018bf80f4bSopenharmony_ci UnRegisterDefaultInterpolators(registry); 1028bf80f4bSopenharmony_ci} 1038bf80f4bSopenharmony_ci} // namespace Internal 1048bf80f4bSopenharmony_ciMETA_END_NAMESPACE() 105