{
AddToCallStacks("OnKeyInputFocusLost");
}
- virtual Actor GetChildByAlias(const std::string& actorAlias)
+ virtual Vector3 GetNaturalSize()
{
- AddToCallStacks("GetChildByAlias");
+ return Vector3( 0.0f, 0.0f, 0.0f );
+ }
- if ("found" == actorAlias)
- {
- return Actor::New();
- }
- else
- {
- return Actor();
- }
+ virtual float GetHeightForWidth( float width )
+ {
+ return 0.0f;
}
- virtual Vector3 GetNaturalSize()
+ virtual float GetWidthForHeight( float height )
{
- return Vector3( 0.0f, 0.0f, 0.0f );
+ return 0.0f;
+ }
+
+ virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
+ {
+ }
+
+ virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
+ {
+ }
+
+ virtual void OnCalculateRelayoutSize( Dimension::Type dimension )
+ {
+ }
+
+ virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
+ {
+ return 0.0f;
+ }
+
+ virtual void OnLayoutNegotiated( float size, Dimension::Type dimension )
+ {
+ }
+
+ virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS )
+ {
+ return false;
}
void SetDaliProperty(std::string s)
{
}
- virtual Actor GetChildByAlias(const std::string& actorAlias)
+ virtual Vector3 GetNaturalSize()
{
- return Actor();
+ return Vector3( 0.0f, 0.0f, 0.0f );
}
- virtual Vector3 GetNaturalSize()
+ virtual float GetHeightForWidth( float width )
+ {
+ return 0.0f;
+ }
+
+ virtual float GetWidthForHeight( float height )
+ {
+ return 0.0f;
+ }
+
+ virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
+ {
+ }
+
+ virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
{
- return Vector3( 0.0f, 0.0f, 0.0f );
+ }
+
+ virtual void OnCalculateRelayoutSize( Dimension::Type dimension )
+ {
+ }
+
+ virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
+ {
+ return 0.0f;
+ }
+
+ virtual void OnLayoutNegotiated( float size, Dimension::Type dimension )
+ {
+ }
+
+ virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS )
+ {
+ return false;
}
};
return Vector3( 0.0f, 0.0f, 0.0f );
}
+ virtual float GetHeightForWidth( float width )
+ {
+ return 0.0f;
+ }
+
+ virtual float GetWidthForHeight( float height )
+ {
+ return 0.0f;
+ }
+
+ virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
+ {
+ }
+
+ virtual void OnLayoutNegotiated( float size, Dimension::Type dimension )
+ {
+ }
+
+ virtual void OnCalculateRelayoutSize( Dimension::Type dimension )
+ {
+ }
+
private:
TestCustomActor( Impl::TestCustomActor& impl ) : CustomActor( impl )
};
+
+using namespace Dali;
+
BaseHandle CreateActor()
{
return TestCustomActor::New();
}
+Dali::TypeRegistration mType( typeid(TestCustomActor), typeid(Dali::CustomActor), CreateActor );
+
} // anon namespace
DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
Animation anim = Animation::New( 1.0f );
- anim.Resize( custom, Vector3( 8.0f, 9.0f, 10.0f ) );
+ anim.AnimateTo( Property( custom, Actor::Property::SIZE ), Vector3( 8.0f, 9.0f, 10.0f ) );
DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
DALI_TEST_EQUALS( 8.0f, custom.GetTargetSize().width, TEST_LOCATION );
DALI_TEST_EQUALS( 9.0f, custom.GetTargetSize().height, TEST_LOCATION );
DALI_TEST_EQUALS( 10.0f, custom.GetTargetSize().depth, TEST_LOCATION );
-
- anim.Resize( custom, 1.0f, 2.0f );
- DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
- DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
- DALI_TEST_EQUALS( 1.0f, custom.GetTargetSize().width, TEST_LOCATION );
- DALI_TEST_EQUALS( 2.0f, custom.GetTargetSize().height, TEST_LOCATION );
END_TEST;
}
END_TEST;
}
-int UtcDaliCustomActorFindChildByAlias(void)
-{
- TestApplication application;
- tet_infoline("Testing Dali::CustomActor::GetChildByAlias()");
-
- TestCustomActor custom = TestCustomActor::New();
- DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
-
- custom.Add(Actor::New());
-
- DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
-
- DALI_TEST_CHECK( !custom.FindChildByAlias("not-found") );
-
- DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
- DALI_TEST_EQUALS( "GetChildByAlias", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
-
- DALI_TEST_CHECK( custom.FindChildByAlias("found") );
- END_TEST;
-}
-
int UtcDaliCustomActorImplOnPropertySet(void)
{
TestApplication application;
DALI_TEST_CHECK( true );
END_TEST;
}
+
+int UtcDaliCustomActorDoAction(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::CustomActor::DoAction()");
+
+ TestCustomActor custom = TestCustomActor::New();
+
+ BaseHandle customActorObject = custom;
+
+ DALI_TEST_CHECK(customActorObject);
+
+ std::vector<Property::Value> attributes;
+
+ // Check that an invalid command is not performed
+ DALI_TEST_CHECK(customActorObject.DoAction("invalidCommand", attributes) == false);
+
+ // Check that the custom actor is visible
+ custom.SetVisible(true);
+ DALI_TEST_CHECK(custom.IsVisible() == true);
+
+ // Check the custom actor performed an action to hide itself
+ DALI_TEST_CHECK(customActorObject.DoAction("hide", attributes) == true);
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+
+ // Check that the custom actor is now invisible
+ DALI_TEST_CHECK(custom.IsVisible() == false);
+
+ // Check the custom actor performed an action to show itself
+ DALI_TEST_CHECK(customActorObject.DoAction("show", attributes) == true);
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+
+ // Check that the custom actor is now visible
+ DALI_TEST_CHECK(custom.IsVisible() == true);
+ END_TEST;
+}