utc-Dali-ConfirmationPopup.cpp
utc-Dali-CubeTransitionEffect.cpp
utc-Dali-EffectsView.cpp
- utc-Dali-Fade.cpp
+ utc-Dali-FadeTransition.cpp
utc-Dali-FlexContainer.cpp
utc-Dali-FlexNode.cpp
utc-Dali-GaussianBlurView.cpp
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/transition/transition-set.h>
-#include <dali-toolkit/public-api/transition/transition-base.h>
-#include <dali-toolkit/public-api/transition/fade.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-// Functor to test whether a Finish signal is emitted
-struct TransitionFinishCheck
-{
- TransitionFinishCheck(bool& signalReceived)
- : mSignalReceived(signalReceived)
- {
- }
-
- void operator()(TransitionSet& transitionSet)
- {
- mSignalReceived = true;
- }
-
- void Reset()
- {
- mSignalReceived = false;
- }
-
- void CheckSignalReceived()
- {
- if(!mSignalReceived)
- {
- tet_printf("Expected Finish signal was not received\n");
- tet_result(TET_FAIL);
- }
- else
- {
- tet_result(TET_PASS);
- }
- }
-
- void CheckSignalNotReceived()
- {
- if(mSignalReceived)
- {
- tet_printf("Unexpected Finish signal was received\n");
- tet_result(TET_FAIL);
- }
- else
- {
- tet_result(TET_PASS);
- }
- }
-
- bool& mSignalReceived; // owned by individual tests
-};
-
-int UtcDaliFadeSetGetProperty(void)
-{
- ToolkitTestApplication application;
- tet_infoline("UtcDaliFadeSetGetProperty");
-
- Control control = Control::New();
-
- Fade fade = Fade::New(control, 0.5, TimePeriod(-0.5f, -0.5f));
-
- TimePeriod timePeriod = fade.GetTimePeriod();
- DALI_TEST_EQUALS(0.0f, timePeriod.delaySeconds, TEST_LOCATION);
- DALI_TEST_EQUALS(0.0f, timePeriod.durationSeconds, TEST_LOCATION);
-
- END_TEST;
-}
-
-int UtcDaliFadeWithOffScene(void)
-{
- ToolkitTestApplication application;
- tet_infoline("UtcDaliFadeWithOffScene");
-
- Control control = Control::New();
- control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
- control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
- control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
- control.SetProperty(Actor::Property::OPACITY, 1.0f);
- Property::Map controlProperty;
- controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
- controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
- control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
-
- application.SendNotification();
- application.Render(20);
-
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- Fade fade = Fade::New(control, 0.5, TimePeriod(0.5f));
- fade.SetAppearingTransition(false); // set fade out
- TransitionSet transitionSet = TransitionSet::New();
- transitionSet.AddTransition(fade);
- transitionSet.Play();
-
- bool signalReceived(false);
- TransitionFinishCheck finishCheck(signalReceived);
- transitionSet.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(400);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
-
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- application.SendNotification();
- application.Render(200);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
-
- application.SendNotification();
- application.Render(20);
-
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- END_TEST;
-}
-
-int UtcDaliFadeOut(void)
-{
- ToolkitTestApplication application;
- tet_infoline("UtcDaliFadeOut");
-
- Control control = Control::New();
- control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
- control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
- control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
- control.SetProperty(Actor::Property::OPACITY, 1.0f);
- Property::Map controlProperty;
- controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
- controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
- control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
-
- application.GetScene().Add(control);
-
- application.SendNotification();
- application.Render(20);
-
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- Fade fade = Fade::New(control, 0.5, TimePeriod(0.5f));
- fade.SetAppearingTransition(false); // set fade out
- TransitionSet transitionSet = TransitionSet::New();
- transitionSet.AddTransition(fade);
- transitionSet.Play();
-
- bool signalReceived(false);
- TransitionFinishCheck finishCheck(signalReceived);
- transitionSet.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(400);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
-
- float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
- DALI_TEST_CHECK(currentOpacity <= 0.7 && currentOpacity >= 0.5);
-
- application.SendNotification();
- application.Render(200);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
-
- application.SendNotification();
- application.Render(20);
-
- // Property is reset after animation.
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- END_TEST;
-}
-
-int UtcDaliFadeIn(void)
-{
- ToolkitTestApplication application;
- tet_infoline("UtcDaliFadeIn");
-
- Control control = Control::New();
- control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
- control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
- control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
- control.SetProperty(Actor::Property::OPACITY, 1.0f);
- Property::Map controlProperty;
- controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
- controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
- control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
-
- application.GetScene().Add(control);
-
- application.SendNotification();
- application.Render(20);
-
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- Fade fade = Fade::New(control, 0.5, TimePeriod(0.5f));
- fade.SetAppearingTransition(true); // set fade in
- TransitionSet transitionSet = TransitionSet::New();
- transitionSet.AddTransition(fade);
- transitionSet.Play();
-
- bool signalReceived(false);
- TransitionFinishCheck finishCheck(signalReceived);
- transitionSet.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(400);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
-
- float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
- DALI_TEST_CHECK(currentOpacity <= 1.0 && currentOpacity >= 0.8);
-
- application.SendNotification();
- application.Render(200);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
-
- application.SendNotification();
- application.Render(20);
-
- DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
- END_TEST;
-}
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+#include <stdlib.h>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/public-api/transition/transition-set.h>
+#include <dali-toolkit/public-api/transition/transition-base.h>
+#include <dali-toolkit/public-api/transition/fade-transition.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+// Functor to test whether a Finish signal is emitted
+struct TransitionFinishCheck
+{
+ TransitionFinishCheck(bool& signalReceived)
+ : mSignalReceived(signalReceived)
+ {
+ }
+
+ void operator()(TransitionSet& transitionSet)
+ {
+ mSignalReceived = true;
+ }
+
+ void Reset()
+ {
+ mSignalReceived = false;
+ }
+
+ void CheckSignalReceived()
+ {
+ if(!mSignalReceived)
+ {
+ tet_printf("Expected Finish signal was not received\n");
+ tet_result(TET_FAIL);
+ }
+ else
+ {
+ tet_result(TET_PASS);
+ }
+ }
+
+ void CheckSignalNotReceived()
+ {
+ if(mSignalReceived)
+ {
+ tet_printf("Unexpected Finish signal was received\n");
+ tet_result(TET_FAIL);
+ }
+ else
+ {
+ tet_result(TET_PASS);
+ }
+ }
+
+ bool& mSignalReceived; // owned by individual tests
+};
+
+int UtcDaliFadeTransitionSetGetProperty(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliFadeTransitionSetGetProperty");
+
+ Control control = Control::New();
+
+ FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(-0.5f, -0.5f));
+
+ TimePeriod timePeriod = fade.GetTimePeriod();
+ DALI_TEST_EQUALS(0.0f, timePeriod.delaySeconds, TEST_LOCATION);
+ DALI_TEST_EQUALS(0.0f, timePeriod.durationSeconds, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliFadeTransitionWithOffScene(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliFadeTransitionWithOffScene");
+
+ Control control = Control::New();
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
+ control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
+ control.SetProperty(Actor::Property::OPACITY, 1.0f);
+ Property::Map controlProperty;
+ controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+ control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(0.5f));
+ fade.SetAppearingTransition(false); // set fade out
+ TransitionSet transitionSet = TransitionSet::New();
+ transitionSet.AddTransition(fade);
+ transitionSet.Play();
+
+ bool signalReceived(false);
+ TransitionFinishCheck finishCheck(signalReceived);
+ transitionSet.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(400);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render(200);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliFadeTransitionDisappearing(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliFadeTransitionOut");
+
+ Control control = Control::New();
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
+ control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
+ control.SetProperty(Actor::Property::OPACITY, 1.0f);
+ Property::Map controlProperty;
+ controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+ control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
+
+ application.GetScene().Add(control);
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(0.5f));
+ fade.SetAppearingTransition(false); // set fade out
+ TransitionSet transitionSet = TransitionSet::New();
+ transitionSet.AddTransition(fade);
+ transitionSet.Play();
+
+ bool signalReceived(false);
+ TransitionFinishCheck finishCheck(signalReceived);
+ transitionSet.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(400);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
+ DALI_TEST_CHECK(currentOpacity <= 0.7 && currentOpacity >= 0.5);
+
+ application.SendNotification();
+ application.Render(200);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ application.SendNotification();
+ application.Render(20);
+
+ // Property is reset after animation.
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliFadeTransitionAppearing(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliFadeTransitionIn");
+
+ Control control = Control::New();
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
+ control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
+ control.SetProperty(Actor::Property::OPACITY, 1.0f);
+ Property::Map controlProperty;
+ controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+ control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
+
+ application.GetScene().Add(control);
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(0.5f));
+ fade.SetAppearingTransition(true); // set fade in
+ TransitionSet transitionSet = TransitionSet::New();
+ transitionSet.AddTransition(fade);
+ transitionSet.Play();
+
+ bool signalReceived(false);
+ TransitionFinishCheck finishCheck(signalReceived);
+ transitionSet.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(400);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
+ DALI_TEST_CHECK(currentOpacity <= 1.0 && currentOpacity >= 0.8);
+
+ application.SendNotification();
+ application.Render(200);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ END_TEST;
+}
+
+
+int UtcDaliFadeTransitionAppearingWithDelay(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliFadeTransitionIn");
+
+ Control control = Control::New();
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
+ control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
+ control.SetProperty(Actor::Property::OPACITY, 1.0f);
+ Property::Map controlProperty;
+ controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+ control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
+
+ application.GetScene().Add(control);
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(0.5f, 0.5f));
+ fade.SetAppearingTransition(true); // set fade in
+ TransitionSet transitionSet = TransitionSet::New();
+ transitionSet.AddTransition(fade);
+ transitionSet.Play();
+
+ bool signalReceived(false);
+ TransitionFinishCheck finishCheck(signalReceived);
+ transitionSet.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(400);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
+ DALI_TEST_CHECK(currentOpacity <= 0.01f);
+
+ application.SendNotification();
+ application.Render(500);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
+ DALI_TEST_CHECK(currentOpacity <= 1.0 && currentOpacity >= 0.8);
+
+ application.SendNotification();
+ application.Render(200);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
+
+ END_TEST;
+}
DALI_TEST_EQUALS(startWorldPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
-
application.SendNotification();
application.Render(400);
#include <dali-toolkit/public-api/text/text-enumerations.h>
-#include <dali-toolkit/public-api/transition/fade.h>
+#include <dali-toolkit/public-api/transition/fade-transition.h>
#include <dali-toolkit/public-api/transition/transition.h>
#include <dali-toolkit/public-api/transition/transition-set.h>
${toolkit_src_dir}/text/rendering/text-backend-impl.cpp
${toolkit_src_dir}/text/rendering/text-typesetter.cpp
${toolkit_src_dir}/text/rendering/view-model.cpp
- ${toolkit_src_dir}/transition/fade-impl.cpp
+ ${toolkit_src_dir}/transition/fade-transition-impl.cpp
${toolkit_src_dir}/transition/transition-base-impl.cpp
${toolkit_src_dir}/transition/transition-impl.cpp
${toolkit_src_dir}/transition/transition-lifecycle-controller.cpp
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/internal/transition/fade-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali/devel-api/actors/actor-devel.h>
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/object/type-registry.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal
-{
-namespace
-{
-const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION(Dali::AlphaFunction::DEFAULT);
-
-} // anonymous namespace
-
-FadePtr Fade::New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod)
-{
- float delaySeconds = timePeriod.delaySeconds;
- if(delaySeconds < 0.0f)
- {
- DALI_LOG_WARNING("delay should be greater than 0.0f.\n");
- delaySeconds = 0.0f;
- }
-
- float durationSeconds = timePeriod.durationSeconds;
- if(durationSeconds < 0.0f)
- {
- DALI_LOG_WARNING("duration should be greater than 0.0f.\n");
- durationSeconds = 0.0f;
- }
-
- FadePtr fade = new Fade(control, Dali::Clamp(opacity, 0.0f, 1.0f), TimePeriod(delaySeconds, durationSeconds));
-
- // Second-phase construction
- fade->Initialize();
-
- return fade;
-}
-
-Fade::Fade(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod)
-: TransitionBase(),
- mTargetControl(control),
- mOpacity(opacity)
-{
- SetTarget(control);
- SetTimePeriod(timePeriod);
-}
-
-Fade::~Fade()
-{
-}
-
-void Fade::OnPlay()
-{
- Dali::Toolkit::Control targetControl = mTargetControl.GetHandle();
- if(!targetControl || !targetControl[Dali::Actor::Property::CONNECTED_TO_SCENE])
- {
- DALI_LOG_ERROR("The Control is not added on the window\n");
- return;
- }
-
- Property::Map initialPropertyMap;
- Property::Map startPropertyMap;
- Property::Map finishPropertyMap;
-
- float targetOpacity = GetWorldColor(targetControl).a;
- targetControl[Dali::Actor::Property::COLOR_MODE] = Dali::ColorMode::USE_OWN_COLOR;
-
- if(IsAppearingTransition())
- {
- initialPropertyMap.Insert(Dali::Actor::Property::OPACITY, 0.0f);
- startPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity * targetOpacity);
- finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
- }
- else
- {
- initialPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
- startPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
- finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity * targetOpacity);
- }
-
- SetInitialPropertyMap(initialPropertyMap);
- SetStartPropertyMap(startPropertyMap);
- SetFinishPropertyMap(finishPropertyMap);
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_TOOLKIT_INTERNAL_FADE_H
-#define DALI_TOOLKIT_INTERNAL_FADE_H
-
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/transition/transition-base-impl.h>
-#include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/transition/fade.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/weak-handle.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal
-{
-using FadePtr = IntrusivePtr<Fade>;
-
-class Fade : public TransitionBase
-{
-public:
- /**
- * @brief Create a new Fade object.
- * @param[in] control A control of this transition.
- * @param[in] opacity opacity value the control Opacity property will be changed from/to.
- * @param[in] timePeriod The duration of the animation.
- * @return A smart-pointer to the newly allocated Fade.
- */
- static FadePtr New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod);
-
-protected:
- /**
- * @copydoc Dali::Toolkit::Fade::OnPlay()
- */
- void OnPlay() override;
-
-protected:
- /**
- * @brief Construct a new Fade.
- */
- Fade(Dali::Toolkit::Control control,
- float opacity,
- TimePeriod timePeriod);
-
- /**
- * @brief A reference counted object may only be deleted by calling Unreference()
- */
- ~Fade() override;
-
-private:
- // Undefined
- Fade(const Fade&);
-
- // Undefined
- Fade& operator=(const Fade& rhs);
-
-private:
- WeakHandle<Dali::Toolkit::Control> mTargetControl;
- float mOpacity;
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::Fade& GetImplementation(Dali::Toolkit::Fade& fade)
-{
- DALI_ASSERT_ALWAYS(fade && "Fade handle is empty");
-
- BaseObject& handle = fade.GetBaseObject();
-
- return static_cast<Internal::Fade&>(handle);
-}
-
-inline const Internal::Fade& GetImplementation(const Dali::Toolkit::Fade& fade)
-{
- DALI_ASSERT_ALWAYS(fade && "Fade handle is empty");
-
- const BaseObject& handle = fade.GetBaseObject();
-
- return static_cast<const Internal::Fade&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_INTERNAL_FADE_H
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/transition/fade-transition-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/object/type-registry.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+FadeTransitionPtr FadeTransition::New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod)
+{
+ float delaySeconds = timePeriod.delaySeconds;
+ if(delaySeconds < 0.0f)
+ {
+ DALI_LOG_WARNING("delay should be greater than 0.0f.\n");
+ delaySeconds = 0.0f;
+ }
+
+ float durationSeconds = timePeriod.durationSeconds;
+ if(durationSeconds < 0.0f)
+ {
+ DALI_LOG_WARNING("duration should be greater than 0.0f.\n");
+ durationSeconds = 0.0f;
+ }
+
+ FadeTransitionPtr fadeTransition = new FadeTransition(control, Dali::Clamp(opacity, 0.0f, 1.0f), TimePeriod(delaySeconds, durationSeconds));
+
+ // Second-phase construction
+ fadeTransition->Initialize();
+
+ return fadeTransition;
+}
+
+FadeTransition::FadeTransition(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod)
+: TransitionBase(),
+ mTargetControl(control),
+ mOpacity(opacity)
+{
+ SetTarget(control);
+ SetTimePeriod(timePeriod);
+}
+
+FadeTransition::~FadeTransition()
+{
+}
+
+void FadeTransition::OnPlay()
+{
+ Dali::Toolkit::Control targetControl = mTargetControl.GetHandle();
+ if(!targetControl || !targetControl[Dali::Actor::Property::CONNECTED_TO_SCENE])
+ {
+ DALI_LOG_ERROR("The Control is not added on the window\n");
+ return;
+ }
+
+ Property::Map startPropertyMap;
+ Property::Map finishPropertyMap;
+
+ float targetOpacity = targetControl[Dali::Actor::Property::OPACITY];
+ if(IsAppearingTransition())
+ {
+ startPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity * targetOpacity);
+ finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
+ }
+ else
+ {
+ startPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
+ finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity * targetOpacity);
+ }
+
+ SetStartPropertyMap(startPropertyMap);
+ SetFinishPropertyMap(finishPropertyMap);
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_INTERNAL_FADE_TRANSITION_H
+#define DALI_TOOLKIT_INTERNAL_FADE_TRANSITION_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/transition/transition-base-impl.h>
+#include <dali-toolkit/public-api/controls/control.h>
+#include <dali-toolkit/public-api/transition/fade-transition.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/weak-handle.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+using FadeTransitionPtr = IntrusivePtr<FadeTransition>;
+
+class FadeTransition : public TransitionBase
+{
+public:
+ /**
+ * @brief Create a new FadeTransition object.
+ * @param[in] control A control of this transition.
+ * @param[in] opacity opacity value the control Opacity property will be changed from/to.
+ * @param[in] timePeriod The duration of the animation.
+ * @return A smart-pointer to the newly allocated FadeTransition.
+ */
+ static FadeTransitionPtr New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod);
+
+protected:
+ /**
+ * @copydoc Dali::Toolkit::FadeTransition::OnPlay()
+ */
+ void OnPlay() override;
+
+protected:
+ /**
+ * @brief Construct a new FadeTransition.
+ */
+ FadeTransition(Dali::Toolkit::Control control,
+ float opacity,
+ TimePeriod timePeriod);
+
+ /**
+ * @brief A reference counted object may only be deleted by calling Unreference()
+ */
+ ~FadeTransition() override;
+
+private:
+ // Undefined
+ FadeTransition(const FadeTransition&);
+
+ // Undefined
+ FadeTransition& operator=(const FadeTransition& rhs);
+
+private:
+ WeakHandle<Dali::Toolkit::Control> mTargetControl;
+ float mOpacity;
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::FadeTransition& GetImplementation(Dali::Toolkit::FadeTransition& fade)
+{
+ DALI_ASSERT_ALWAYS(fade && "FadeTransition handle is empty");
+
+ BaseObject& handle = fade.GetBaseObject();
+
+ return static_cast<Internal::FadeTransition&>(handle);
+}
+
+inline const Internal::FadeTransition& GetImplementation(const Dali::Toolkit::FadeTransition& fade)
+{
+ DALI_ASSERT_ALWAYS(fade && "FadeTransition handle is empty");
+
+ const BaseObject& handle = fade.GetBaseObject();
+
+ return static_cast<const Internal::FadeTransition&>(handle);
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_INTERNAL_FADE_TRANSITION_H
{
namespace
{
+static constexpr float OPACITY_TRANSPARENT = 0.0f;
+
const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION(Dali::AlphaFunction::DEFAULT);
+const Property::Map PROPERTY_MAP_INDEPENDENT_CONTROL{
+ {Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER},
+ {Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER},
+ {Dali::Actor::Property::POSITION_USES_ANCHOR_POINT, true},
+ {Dali::Actor::Property::INHERIT_POSITION, false},
+ {Dali::Actor::Property::INHERIT_ORIENTATION, false},
+ {Dali::Actor::Property::INHERIT_SCALE, false},
+ {Dali::Actor::Property::COLOR_MODE, Dali::ColorMode::USE_OWN_COLOR},
+};
+
Property::Map GetOriginalProperties(Dali::Toolkit::Control control)
{
Property::Map propertyMap;
mTimePeriod(TimePeriod(0.0f)),
mTransitionWithChild(false),
mMoveTargetChildren(false),
- mIsAppearingTransition(true)
+ mIsAppearingTransition(true),
+ mIsPairTransition(false)
{
}
return;
}
+ // Set world transform and color to the target control to make it independent of the parent control and its transition.
+ // The properties will be returned at the TransitionFinished() method.
+ Matrix targetWorldTransform = GetWorldTransform(mTarget);
+ Vector3 targetPosition, targetScale;
+ Quaternion targetOrientation;
+ targetWorldTransform.GetTransformComponents(targetPosition, targetOrientation, targetScale);
+ Vector4 targetColor = GetWorldColor(mTarget);
+
+ mTarget.SetProperties(PROPERTY_MAP_INDEPENDENT_CONTROL);
+ mTarget[Dali::Actor::Property::POSITION] = targetPosition;
+ mTarget[Dali::Actor::Property::SCALE] = targetScale;
+ mTarget[Dali::Actor::Property::ORIENTATION] = targetOrientation;
+ mTarget[Dali::Actor::Property::COLOR] = targetColor;
+
OnPlay();
SetAnimation();
return;
}
+ // If this transition is not a transition from a Control to another Control
+ // and a transition effect to appear with delay,
+ // the mTarget should not be shown until delay seconds.
+ if(!IsPairTransition() && mIsAppearingTransition && mAnimation && mTimePeriod.delaySeconds > Dali::Math::MACHINE_EPSILON_10)
+ {
+ Dali::KeyFrames initialKeyframes = Dali::KeyFrames::New();
+ initialKeyframes.Add(0.0f, OPACITY_TRANSPARENT);
+ initialKeyframes.Add(1.0f, OPACITY_TRANSPARENT);
+ mAnimation.AnimateBetween(Property(mTarget, Dali::Actor::Property::OPACITY), initialKeyframes, TimePeriod(mTimePeriod.delaySeconds));
+ }
+
for(uint32_t i = 0; i < mStartPropertyMap.Count(); ++i)
{
- Property::Value* initialValuePointer = mInitialPropertyMap.Find(mStartPropertyMap.GetKeyAt(i).indexKey);
Property::Value* finishValue = mFinishPropertyMap.Find(mStartPropertyMap.GetKeyAt(i).indexKey);
if(finishValue)
{
- Property::Value initialValue = mStartPropertyMap.GetValue(i);
- if(initialValuePointer)
- {
- initialValue = *initialValuePointer;
- }
- AnimateBetween(mTarget, mStartPropertyMap.GetKeyAt(i).indexKey, initialValue, mStartPropertyMap.GetValue(i), *finishValue);
+ AnimateBetween(mTarget, mStartPropertyMap.GetKeyAt(i).indexKey, mStartPropertyMap.GetValue(i), *finishValue);
}
}
}
-void TransitionBase::AnimateBetween(Dali::Toolkit::Control target, Property::Index index, Property::Value initialValue, Property::Value sourceValue, Property::Value destinationValue)
+void TransitionBase::AnimateBetween(Dali::Toolkit::Control target, Property::Index index, Property::Value sourceValue, Property::Value destinationValue)
{
if(mAnimation)
{
- if(mTimePeriod.delaySeconds>0.0f)
+ // To make each property keep start value during delay time.
+ // When this transition is not Pair transition, it is not required.
+ // (For appearing transition, the mTarget control will not be shown during delay time,
+ // For disapplearing transition, the property of mTarget control keeps current value during delay time)
+ if(IsPairTransition() && mTimePeriod.delaySeconds > Dali::Math::MACHINE_EPSILON_10)
{
Dali::KeyFrames initialKeyframes = Dali::KeyFrames::New();
- initialKeyframes.Add(0.0f, initialValue);
- initialKeyframes.Add(1.0f, initialValue);
+ initialKeyframes.Add(0.0f, sourceValue);
+ initialKeyframes.Add(1.0f, sourceValue);
mAnimation.AnimateBetween(Property(target, index), initialKeyframes, TimePeriod(mTimePeriod.delaySeconds));
}
Dali::KeyFrames keyframes = Dali::KeyFrames::New();
}
protected:
- /**
- * @brief Set property map which will be used as a initial properties.
- * @param[in] propertyMap propertyMap that will be used as a start value of transition.
- */
- void SetInitialPropertyMap(const Property::Map& propertyMap)
- {
- mInitialPropertyMap = propertyMap;
- }
+
/**
* @brief Set property map which will be used as a animation start properties.
* @param[in] propertyMap propertyMap that will be used as a start value of transition.
return mIsAppearingTransition;
}
+ /**
+ * @brief Set whether this transition is a transition from a Control to another Control or effect to appearing or disappearing.
+ * @param[in] pairTransition True if this transition is appearing transition.
+ */
+ void SetPairTransition(bool pairTransition)
+ {
+ mIsPairTransition = pairTransition;
+ }
+
+ /**
+ * @brief Returns whether this transition is a transition from a Control to another Control or effect to appearing or disappearing.
+ */
+ bool IsPairTransition() const
+ {
+ return mIsPairTransition;
+ }
+
protected:
/**
* Construct a new TransitionBase.
* @brief Adds a property on an animation between sourceValue and destimationValue.
* @param[in] target target control to be animated.
* @param[in] index property index for animation.
- * @param[in] initialValue initial value of animation.
* @param[in] sourceValue source value of animation.
* @param[in] destinationValue destination value of animation.
*/
- void AnimateBetween(Dali::Toolkit::Control target, Property::Index index, Property::Value initialValue, Property::Value sourceValue, Property::Value destinationValue);
+ void AnimateBetween(Dali::Toolkit::Control target, Property::Index index, Property::Value sourceValue, Property::Value destinationValue);
/**
* @brief Copy target to make clone for the child Actors
Dali::Actor mCopiedActor; ///< Copied View that will replace mTarget during transition
Dali::Animation mAnimation; ///< Property animations for the transition of mTarget
AlphaFunction mAlphaFunction; ///< Alpha function that will applied for the property animation
- Property::Map mInitialPropertyMap; ///< Initial properties to be animated. (world transform)
Property::Map mStartPropertyMap; ///< Start properties to be animated. (world transform)
Property::Map mFinishPropertyMap; ///< Finish properties to be animated. (world transform)
Property::Map mOriginalPropertyMap; ///< Original properties of mTarget to be used to restore after the transition is finished.
///< If this is false, the child Actors are moved to the child of mCopiedActor that will have original properties of target Actor during Transition.
bool mMoveTargetChildren; ///< Flag, if mTransitionWithChild is false and mTarget has children than True.
bool mIsAppearingTransition; ///< True, if this transition is appearing transition.
+ bool mIsPairTransition; ///< True, if this transition is started from a Control to another Control.
};
} // namespace Internal
{
SetTarget(destination);
SetTimePeriod(timePeriod);
+ SetPairTransition(true);
}
Transition::~Transition()
Quaternion sourceOrientation;
sourceWorldTransform.GetTransformComponents(sourcePosition, sourceOrientation, sourceScale);
- Matrix destinationWorldTransform = GetWorldTransform(destinationControl);
- Vector3 destinationPosition, destinationScale;
- Quaternion destinationOrientation;
- destinationWorldTransform.GetTransformComponents(destinationPosition, destinationOrientation, destinationScale);
+ Vector3 destinationPosition = destinationControl[Dali::Actor::Property::POSITION];
+ Vector3 destinationScale = destinationControl[Dali::Actor::Property::SCALE];
+ Quaternion destinationOrientation = destinationControl[Dali::Actor::Property::ORIENTATION];
+ Vector4 targetColor = destinationControl[Dali::Actor::Property::COLOR];
+ Vector3 targetSize = destinationControl[Dali::Actor::Property::SIZE];
- Vector3 targetSize = destinationControl[Dali::Actor::Property::SIZE];
- Vector4 targetColor = GetWorldColor(destinationControl);
Property::Map startPropertyMap;
Property::Map finishPropertyMap;
- // Use world transform if this transition requires animation of transform.
- destinationControl[Dali::Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
- destinationControl[Dali::Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
- destinationControl[Dali::Actor::Property::POSITION_USES_ANCHOR_POINT] = true;
- destinationControl[Dali::Actor::Property::INHERIT_POSITION] = false;
- destinationControl[Dali::Actor::Property::INHERIT_ORIENTATION] = false;
- destinationControl[Dali::Actor::Property::INHERIT_SCALE] = false;
- destinationControl[Dali::Actor::Property::COLOR_MODE] = Dali::ColorMode::USE_OWN_COLOR;
-
// Set animation of Transform
startPropertyMap.Insert(Dali::Actor::Property::POSITION, sourcePosition);
finishPropertyMap.Insert(Dali::Actor::Property::POSITION, destinationPosition);
void TransitionSet::TransitionFinished(Dali::Animation& source)
{
- for(auto&& transition : mTransitions)
+ // Call TransitionFinished() in reverse order.
+ // This let the first copied original properties will be return again at the final.
+ std::vector<TransitionBasePtr>::reverse_iterator riter;
+ for(riter = mTransitions.rbegin(); riter != mTransitions.rend(); riter++)
{
- transition->TransitionFinished();
+ (*riter)->TransitionFinished();
}
EmitFinishedSignal();
${public_api_src_dir}/image-loader/async-image-loader.cpp
${public_api_src_dir}/image-loader/sync-image-loader.cpp
${public_api_src_dir}/styling/style-manager.cpp
- ${public_api_src_dir}/transition/fade.cpp
+ ${public_api_src_dir}/transition/fade-transition.cpp
${public_api_src_dir}/transition/transition-base.cpp
${public_api_src_dir}/transition/transition-set.cpp
${public_api_src_dir}/transition/transition.cpp
)
SET( public_api_transition_header_files
- ${public_api_src_dir}/transition/fade.h
+ ${public_api_src_dir}/transition/fade-transition.h
${public_api_src_dir}/transition/transition-base.h
${public_api_src_dir}/transition/transition-set.h
${public_api_src_dir}/transition/transition.h
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/public-api/transition/fade-transition.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/transition/fade-transition-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+FadeTransition::FadeTransition() = default;
+
+FadeTransition::FadeTransition(Internal::FadeTransition* fadeTransition)
+: TransitionBase(fadeTransition)
+{
+}
+
+FadeTransition FadeTransition::New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod)
+{
+ Internal::FadeTransitionPtr internal = Dali::Toolkit::Internal::FadeTransition::New(control, opacity, timePeriod);
+
+ return FadeTransition(internal.Get());
+}
+
+FadeTransition FadeTransition::DownCast(BaseHandle handle)
+{
+ return FadeTransition(dynamic_cast<Dali::Toolkit::Internal::FadeTransition*>(handle.GetObjectPtr()));
+}
+
+FadeTransition::~FadeTransition() = default;
+
+FadeTransition::FadeTransition(const FadeTransition& handle) = default;
+
+FadeTransition& FadeTransition::operator=(const FadeTransition& rhs) = default;
+
+FadeTransition::FadeTransition(FadeTransition&& rhs) = default;
+
+FadeTransition& FadeTransition::operator=(FadeTransition&& rhs) = default;
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_FADE_TRANSITION_H
+#define DALI_TOOLKIT_FADE_TRANSITION_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control.h>
+#include <dali-toolkit/public-api/transition/transition-base.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal DALI_INTERNAL
+{
+class FadeTransition;
+}
+
+/**
+ * @brief Fade provides smoothly appearing/disappearing effects for target Control.
+ */
+class DALI_TOOLKIT_API FadeTransition : public TransitionBase
+{
+public:
+ /**
+ * @brief Creates an uninitialized FadeTransition; this can be initialized with FadeTransition::New().
+ *
+ * Calling member functions with an uninitialized FadeTransition handle is not allowed.
+ */
+ FadeTransition();
+
+ /**
+ * @brief Creates an initialized FadeTransition.
+ *
+ * @param[in] control A control of this transition.
+ * @param[in] opacity opacity value the control Opacity property will be changed from/to. Opacity must be between [0, 1].
+ * @param[in] timePeriod The duration of the animation.
+ * @return A handle to a newly allocated Dali resource
+ */
+ static FadeTransition New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod);
+
+ /**
+ * @brief Downcasts a handle to FadeTransition handle.
+ *
+ * If handle points to an FadeTransition object, the downcast produces valid handle.
+ * If not, the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object
+ * @return Handle to an FadeTransition object or an uninitialized handle
+ */
+ static FadeTransition DownCast(BaseHandle handle);
+
+ /**
+ * @brief Destructor.
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ */
+ ~FadeTransition();
+
+ /**
+ * @brief This copy constructor is required for (smart) pointer semantics.
+ *
+ * @param[in] handle A reference to the copied handle
+ */
+ FadeTransition(const FadeTransition& handle);
+
+ /**
+ * @brief This assignment operator is required for (smart) pointer semantics.
+ *
+ * @param[in] rhs A reference to the copied handle
+ * @return A reference to this
+ */
+ FadeTransition& operator=(const FadeTransition& rhs);
+
+ /**
+ * @brief Move constructor.
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ FadeTransition(FadeTransition&& rhs);
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ FadeTransition& operator=(FadeTransition&& rhs);
+
+public: // Not intended for use by Application developers
+ /// @cond internal
+ /**
+ * @brief This constructor is used by FadeTransition::New() methods.
+ * @param[in] fadeTransition A pointer to a newly allocated Dali resource
+ */
+ explicit DALI_INTERNAL FadeTransition(Internal::FadeTransition* fadeTransition);
+ /// @endcond
+};
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_FADE_TRANSITION_H
+++ /dev/null
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/public-api/transition/fade.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/transition/fade-impl.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-Fade::Fade() = default;
-
-Fade::Fade(Internal::Fade* fade)
-: TransitionBase(fade)
-{
-}
-
-Fade Fade::New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod)
-{
- Internal::FadePtr internal = Dali::Toolkit::Internal::Fade::New(control, opacity, timePeriod);
-
- return Fade(internal.Get());
-}
-
-Fade Fade::DownCast(BaseHandle handle)
-{
- return Fade(dynamic_cast<Dali::Toolkit::Internal::Fade*>(handle.GetObjectPtr()));
-}
-
-Fade::~Fade() = default;
-
-Fade::Fade(const Fade& handle) = default;
-
-Fade& Fade::operator=(const Fade& rhs) = default;
-
-Fade::Fade(Fade&& rhs) = default;
-
-Fade& Fade::operator=(Fade&& rhs) = default;
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_TOOLKIT_FADE_H
-#define DALI_TOOLKIT_FADE_H
-
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/transition/transition-base.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal DALI_INTERNAL
-{
-class Fade;
-}
-
-/**
- * @brief Fade provides smoothly appearing/disappearing effects for target Control.
- */
-class DALI_TOOLKIT_API Fade : public TransitionBase
-{
-public:
- /**
- * @brief Creates an uninitialized Fade; this can be initialized with Fade::New().
- *
- * Calling member functions with an uninitialized Fade handle is not allowed.
- */
- Fade();
-
- /**
- * @brief Creates an initialized Fade.
- *
- * @param[in] control A control of this transition.
- * @param[in] opacity opacity value the control Opacity property will be changed from/to. Opacity must be between [0, 1].
- * @param[in] timePeriod The duration of the animation.
- * @return A handle to a newly allocated Dali resource
- */
- static Fade New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod);
-
- /**
- * @brief Downcasts a handle to Fade handle.
- *
- * If handle points to an Fade object, the downcast produces valid handle.
- * If not, the returned handle is left uninitialized.
- *
- * @param[in] handle Handle to an object
- * @return Handle to an Fade object or an uninitialized handle
- */
- static Fade DownCast(BaseHandle handle);
-
- /**
- * @brief Destructor.
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- */
- ~Fade();
-
- /**
- * @brief This copy constructor is required for (smart) pointer semantics.
- *
- * @param[in] handle A reference to the copied handle
- */
- Fade(const Fade& handle);
-
- /**
- * @brief This assignment operator is required for (smart) pointer semantics.
- *
- * @param[in] rhs A reference to the copied handle
- * @return A reference to this
- */
- Fade& operator=(const Fade& rhs);
-
- /**
- * @brief Move constructor.
- *
- * @param[in] rhs A reference to the moved handle
- */
- Fade(Fade&& rhs);
-
- /**
- * @brief Move assignment operator.
- *
- * @param[in] rhs A reference to the moved handle
- * @return A reference to this handle
- */
- Fade& operator=(Fade&& rhs);
-
-public: // Not intended for use by Application developers
- /// @cond internal
- /**
- * @brief This constructor is used by Fade::New() methods.
- * @param[in] fade A pointer to a newly allocated Dali resource
- */
- explicit DALI_INTERNAL Fade(Internal::Fade* fade);
- /// @endcond
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_FADE_H
/**
* @brief
- *
* TransitionSet is used to control lifetime of multiple Transitions.
* Transition could be played with multiple other transitions for a scene change.
* For the case, it is more useful to manage a group of transitions with same lifetime and a finished signal.
* TransitionSet provides a single Play call and Finished callback for the multiple traisitions those added on it.
+ *
+ * @note
+ * Do not add transitions for a View by dividing them into multiple TransitionSets.
*/
class DALI_TOOLKIT_API TransitionSet : public BaseHandle
{