#include <toolkit-event-thread-callback.h>
#include <dali-toolkit-test-suite-utils.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/object/handle-devel.h>
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummyControl.SetSize(200.f, 200.f);
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
Stage::GetCurrent().Add( dummyControl );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetSize(200.f, 200.f);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
application.SendNotification();
application.Render(0);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetSize(200.f, 200.f);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
application.SendNotification();
application.Render(0);
value = resultMap.Find( ImageVisual::Property::FITTING_MODE, Property::INTEGER );
DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == FittingMode::SHRINK_TO_FIT );
+ DALI_TEST_CHECK( value->Get<int>() == FittingMode::DEFAULT );
value = resultMap.Find( ImageVisual::Property::SAMPLING_MODE, Property::INTEGER );
DALI_TEST_CHECK( value );
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
- actor.SetSize(2000, 2000);
- actor.SetParentOrigin(ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
- actor.SetSize(2000, 2000);
- actor.SetParentOrigin(ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
- actor.SetSize(2000, 2000);
- actor.SetParentOrigin(ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetSize(2000, 2000);
- actor.SetParentOrigin(ParentOrigin::CENTER);
- actor.SetColor(Color::BLACK);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
application.Render(2001u); // go past end
application.SendNotification(); // Trigger signals
- DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4( 1.0f, 1.0f, 1.0f, TARGET_MIX_COLOR.a ) ), true, TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR) ), true, TEST_LOCATION );
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetSize(2000, 2000);
- actor.SetParentOrigin(ParentOrigin::CENTER);
- actor.SetColor(Color::BLACK);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
Stage::GetCurrent().Add(actor);
application.SendNotification();
DummyControl actor = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetSize( 2000, 2000 );
- actor.SetParentOrigin(ParentOrigin::CENTER);
- actor.SetColor(Color::BLACK);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
Stage::GetCurrent().Add(actor);
application.SendNotification();
DummyControl actor = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetSize( 2000, 2000 );
- actor.SetParentOrigin(ParentOrigin::CENTER);
- actor.SetColor(Color::BLACK);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
Stage::GetCurrent().Add(actor);
application.SendNotification();
//Put the visual on the stage
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
- actor.SetSize(2000, 2000);
- actor.SetParentOrigin(ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
Stage::GetCurrent().Add(actor);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transformMap );
- dummy.SetSize(2000, 2000);
- dummy.SetParentOrigin(ParentOrigin::CENTER);
+ dummy.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
+ dummy.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
Stage::GetCurrent().Add(dummy);
application.SendNotification();
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
- dummyControl.SetSize(200.f, 200.f);
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
tet_infoline( "Add control with visual to stage and check renderer count is 1" );
Stage::GetCurrent().Add( dummyControl );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
- dummyControl.SetSize(200.f, 200.f);
- dummyControl.SetParentOrigin( ParentOrigin::CENTER );
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummyControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummyControl );
application.SendNotification();
textVisual.SetDepthIndex( 1 );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
- dummyControl.SetSize( 720.f, 640.f );
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 720.f, 640.f ) );
application.SendNotification(); // force process events to ensure text visual
// adds renderer to the dummy control in OnRelayout
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
- dummyControl.SetSize(200.f, 200.f);
- dummyControl.SetParentOrigin( ParentOrigin::CENTER );
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummyControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummyControl );
application.SendNotification();
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, anotherTestVisual2Replacement );
DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000, TEST_LOCATION );
- dummyControl.SetSize(200.f, 200.f);
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
Stage::GetCurrent().Add( dummyControl );
END_TEST;
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2 );
DALI_TEST_CHECK( testVisual2.GetDepthIndex() > testVisual1.GetDepthIndex() );
- dummyControl.SetSize(200.f, 200.f);
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
Stage::GetCurrent().Add( dummyControl );
END_TEST;
DALI_TEST_EQUALS( testVisual3.GetDepthIndex(), 300, TEST_LOCATION );
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
- dummyControl.SetSize(200.f, 200.f);
+ dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
Stage::GetCurrent().Add( dummyControl );
END_TEST;
Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummy.SetSize( 200.f, 200.f );
- dummy.SetParentOrigin( ParentOrigin::CENTER );
+ dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummy );
application.SendNotification();
Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummy.SetSize( 200.f, 200.f );
- dummy.SetParentOrigin( ParentOrigin::CENTER );
+ dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummy );
application.SendNotification();
Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummy.SetSize( 200.f, 200.f );
- dummy.SetParentOrigin( ParentOrigin::CENTER );
+ dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummy );
application.SendNotification();
Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummy.SetSize( 200.f, 200.f );
- dummy.SetParentOrigin( ParentOrigin::CENTER );
+ dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummy );
application.SendNotification();
Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummy.SetSize( 200.f, 200.f );
- dummy.SetParentOrigin( ParentOrigin::CENTER );
+ dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Stage::GetCurrent().Add( dummy );
application.SendNotification();