/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
END_TEST;
}
+int UtcDaliScrollViewMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ScrollView scrollView = ScrollView::New();
+ DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+ DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+
+ ScrollView moved = std::move( scrollView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+ DALI_TEST_CHECK( !scrollView );
+
+ END_TEST;
+}
+
int UtcDaliToolkitScrollViewAssignmentOperatorP(void)
{
ToolkitTestApplication application;
ScrollView scrollView = ScrollView::New();
scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
- ScrollView copy = scrollView;
+ ScrollView copy;
+ copy = scrollView;
DALI_TEST_CHECK( copy );
DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
END_TEST;
}
+int UtcDaliScrollViewMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ScrollView scrollView = ScrollView::New();
+ DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+ DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+
+ ScrollView moved;
+ moved = std::move( scrollView );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+ DALI_TEST_CHECK( !scrollView );
+
+ END_TEST;
+}
+
int UtcDaliScrollViewDestructorP(void)
{
ToolkitTestApplication application;
DALI_TEST_CHECK( scrollView2 == scrollView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the ScrollView actor
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
const Vector2 target = Vector2(100.0f, 200.0f);
const Vector2 target2 = Vector2(300.0f, 100.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
// Create the ScrollView actor
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
const Vector2 target = Vector2(100.0f, 200.0f);
const Vector2 target2 = Vector2(300.0f, 100.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
tet_infoline(" UtcDaliToolkitScrollViewScrollToPageP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 50.0f, 0.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 0.0f, 50.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 0.0f, 50.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
Vector2 START_POSITION = Vector2(10.0f, 10.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
tet_infoline(" UtcDaliToolkitScrollViewScrollToActorP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
Actor actorA = Actor::New();
const Vector3 positionA = Vector3(100.0f, 400.0f, 0.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToSnapPointP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
tet_infoline(" UtcDaliToolkitScrollViewSetWrapModeP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
Actor actor = Actor::New();
scrollView.Add( actor );
tet_infoline(" UtcDaliToolkitScrollViewActorAutoSnap");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
DALI_TEST_CHECK(scrollUpdated);
DALI_TEST_CHECK(scrollCompleted);
- Stage::GetCurrent().Remove( scrollView );
+ application.GetScene().Remove( scrollView );
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
scrollView.SetOvershootEnabled(true);
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollView.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, overshootSize );
DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, TEST_LOCATION );
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
tet_infoline(" UtcDaliToolkitScrollViewGetCurrentPageP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
tet_infoline(" UtcDaliToolkitScrollViewSetRulerXP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
tet_infoline(" UtcDaliToolkitScrollViewSetRulerYP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerY = new FixedRuler( 200.0f );
rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 50.0f, 0.0f );