X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Fdummy-control.cpp;h=b8ddd29d2dae638514e7adbac468c43885b9a289;hp=5e843c26cbb4a52420b652d5087f52f8c18df9b3;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=0ba4d17563f6d40d65b4d233b1a44a2d0a6fc709 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp index 5e843c2..b8ddd29 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp @@ -188,10 +188,21 @@ void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index in Property::Value DummyControlImpl::GetProperty( BaseObject* object, Dali::Property::Index propertyIndex ) { - Dali::Property::Value value; + Toolkit::DummyControl control = Toolkit::DummyControl::DownCast( Dali::BaseHandle( object ) ); + DummyControlImpl& dummyImpl = static_cast( control.GetImplementation() ); + + Visual::Base visual = dummyImpl.GetVisual( propertyIndex ); + Property::Map map; + if( visual ) + { + visual.CreatePropertyMap( map ); + } + Dali::Property::Value value = map; + return value; } + Toolkit::DummyControl Impl::DummyControl::New() { IntrusivePtr< Toolkit::Impl::DummyControl > impl = new Toolkit::Impl::DummyControl; @@ -200,6 +211,8 @@ Toolkit::DummyControl Impl::DummyControl::New() return control; } +int Impl::DummyControl::constructorCount; +int Impl::DummyControl::destructorCount; Impl::DummyControl::DummyControl() : DummyControlImpl(), @@ -226,10 +239,13 @@ Impl::DummyControl::DummyControl() keyInputFocusGained(false), keyInputFocusLost(false) { + ++constructorCount; } -Impl::DummyControl::~DummyControl() { } - +Impl::DummyControl::~DummyControl() +{ + ++destructorCount; +} void Impl::DummyControl::OnInitialize() { initializeCalled = true; } bool Impl::DummyControl::OnAccessibilityActivated() { activatedCalled = true; return true; } @@ -300,6 +316,23 @@ void Impl::DummyControl::SetRelayoutCallback( RelayoutCallbackFunc callback ) mRelayoutCallback = callback; } +Vector3 Impl::DummyControl::GetNaturalSize() +{ + Vector2 currentSize; + + for( auto elem : mRegisteredVisualIndices ) + { + Vector2 naturalSize; + Visual::Base visual = GetVisual(elem); + visual.GetNaturalSize( naturalSize ); + currentSize.width = std::max( naturalSize.width, currentSize.width ); + currentSize.height = std::max( naturalSize.height, currentSize.height ); + } + + return Vector3( currentSize ); +} + + DummyControl DummyControl::New( bool override ) {