/*
- * Copyright (c) 2018 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.
Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( dummyVisualPtr.Get() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
tableView.AddChild( ImageView::New( TEST_RESOURCE_DIR "/gallery-small-1.jpg" ), TableView::CellPosition( 1, 1 ) );
tableView.AddChild( TextLabel::New("Stuff"), TableView::CellPosition( 1, 2 ) );
- Stage::GetCurrent().Add( tableView );
+ application.GetScene().Add( tableView );
Property::Value v(Matrix3::IDENTITY);
tableView.RegisterProperty( "SomeMatrix3", v);
std::ostringstream oss;
- Dali::Toolkit::Internal::DumpControlHierarchy( oss, Stage::GetCurrent().GetRootLayer() );
+ Dali::Toolkit::Internal::DumpControlHierarchy( oss, application.GetScene().GetRootLayer() );
DALI_TEST_CHECK( oss.str().length() != 0 );
tet_printf("Control hierarchy: \n%s\n", oss.str().c_str() );
const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-void TestDebugVisual( Visual::Base& visual, Visual::Type actualType, Vector2 expectedNaturalSize )
+void TestDebugVisual( Integration::Scene scene, Visual::Base& visual, Visual::Type actualType, Vector2 expectedNaturalSize )
{
{
auto& impl = GetImplementation( visual );
DummyControl actor = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
- Stage::GetCurrent().Add( actor );
+ scene.Add( actor );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1, TEST_LOCATION );
if( actor.GetRendererCount() > 0 )
propertyMap1.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
Visual::Base colorVisual = factory.CreateVisual(propertyMap1);
DALI_TEST_CHECK( colorVisual );
- TestDebugVisual( colorVisual, Visual::COLOR, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), colorVisual, Visual::COLOR, Vector2::ZERO );
// Test that border visual is replaced with debug visual
Property::Map propertyMap2;
propertyMap2.Insert(BorderVisual::Property::SIZE, 2.f);
Visual::Base borderVisual = factory.CreateVisual(propertyMap2);
DALI_TEST_CHECK( borderVisual );
- TestDebugVisual( borderVisual, Visual::BORDER, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), borderVisual, Visual::BORDER, Vector2::ZERO );
// Test that gradient visual is replaced with debug visual
Property::Map propertyMap3;
propertyMap3.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
Visual::Base gradientVisual = factory.CreateVisual(propertyMap3);
DALI_TEST_CHECK( gradientVisual );
- TestDebugVisual( gradientVisual, Visual::GRADIENT, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), gradientVisual, Visual::GRADIENT, Vector2::ZERO );
// Test that image visual is replaced with debug visual
Property::Map propertyMap4;
propertyMap4.Insert( ImageVisual::Property::DESIRED_HEIGHT, 100.f );
Visual::Base imageVisual = factory.CreateVisual( propertyMap4 );
DALI_TEST_CHECK( imageVisual );
- TestDebugVisual( imageVisual, Visual::IMAGE, Vector2( 50.f, 100.f ) );
+ TestDebugVisual( application.GetScene(), imageVisual, Visual::IMAGE, Vector2( 50.f, 100.f ) );
// Test that SVG visual is replaced with debug visual
// TEST_SVG_FILE:
propertyMap5.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
Visual::Base svgVisual = factory.CreateVisual( propertyMap5 );
DALI_TEST_CHECK( svgVisual );
- TestDebugVisual( svgVisual, Visual::SVG, Vector2(100.f, 100.f) );
+ TestDebugVisual( application.GetScene(), svgVisual, Visual::SVG, Vector2(100.f, 100.f) );
// Test that AnimatedImageVisual is replaced with debug visual
// TEST_GIF_FILE: anim.gif
propertyMap6.Insert( ImageVisual::Property::URL, TEST_GIF_FILE_NAME );
Visual::Base animatedImageVisual = factory.CreateVisual( propertyMap6 );
DALI_TEST_CHECK( animatedImageVisual );
- TestDebugVisual( animatedImageVisual, Visual::ANIMATED_IMAGE, Vector2(50.f, 50.f) );
+ TestDebugVisual( application.GetScene(), animatedImageVisual, Visual::ANIMATED_IMAGE, Vector2(50.f, 50.f) );
// Test that text visual is replaced with debug visual
propertyMap8.Insert( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME );
Visual::Base nPatchVisual = factory.CreateVisual( propertyMap8 );
DALI_TEST_CHECK( nPatchVisual );
- TestDebugVisual( nPatchVisual, Visual::N_PATCH, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), nPatchVisual, Visual::N_PATCH, Vector2::ZERO );
EnvironmentVariable::SetTestingEnvironmentVariable(false);
END_TEST;
Visual::Base colorVisual = factory.CreateVisual( map);
DALI_TEST_CHECK( colorVisual );
- TestDebugVisual( colorVisual, Visual::COLOR, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), colorVisual, Visual::COLOR, Vector2::ZERO );
// Test that border visual is replaced with debug visual
map.Clear();
map[ BorderVisual::Property::SIZE ] = 2.f;
Visual::Base borderVisual = factory.CreateVisual( map );
DALI_TEST_CHECK( borderVisual );
- TestDebugVisual( borderVisual, Visual::BORDER, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), borderVisual, Visual::BORDER, Vector2::ZERO );
// Test that image visual is replaced with debug visual
map.Clear();
map[ ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME;
Visual::Base imageVisual = factory.CreateVisual( map );
DALI_TEST_CHECK( imageVisual );
- TestDebugVisual( imageVisual, Visual::IMAGE, Vector2(64.0f, 64.0f /* Broken Image Size */ ));
+ TestDebugVisual( application.GetScene(), imageVisual, Visual::IMAGE, Vector2(64.0f, 64.0f /* Broken Image Size */ ));
// Test that n patch visual is replaced with debug visual
Visual::Base nPatchVisual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() );
DALI_TEST_CHECK( nPatchVisual );
- TestDebugVisual( nPatchVisual, Visual::N_PATCH, Vector2::ZERO );
+ TestDebugVisual( application.GetScene(), nPatchVisual, Visual::N_PATCH, Vector2::ZERO );
EnvironmentVariable::SetTestingEnvironmentVariable(false);
END_TEST;
try
{
Toolkit::TextLabel label = TextLabel::New( "Hello" );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
DALI_TEST_CHECK( true );
} catch( ... )
{
Dali::Toolkit::Internal::GridLayout* gridLayout = dynamic_cast<Dali::Toolkit::Internal::GridLayout*>(view.GetLayout(0).Get());
- Dali::Stage stage = Dali::Stage::GetCurrent();
- Vector3 stageSize(stage.GetSize());
+ Dali::Integration::Scene scene = application.GetScene();
+ Vector3 stageSize(scene.GetSize());
//Check if the number of columns is equals to 6 which is set before.
DALI_TEST_EQUALS(gridLayout->GetNumberOfColumns(), 6, TEST_LOCATION );
/*
- * 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.
tet_infoline(" UtcDaliTextCircularN");
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
- stage.SetBackgroundColor( Color::WHITE );
- stage.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) );
+ auto scene = application.GetScene();
+ scene.SetBackgroundColor( Color::WHITE );
+ scene.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) );
const std::string image1 = "<item 'width'=26 'height'=26 'url'='" + TEST_IMAGE_FILE_NAME1 + "'/>";
/*
- * 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.
TextSelectionPopup::CLIPBOARD );
textPopup.EnableButtons( buttonsToEnable );
- Stage::GetCurrent().Add( textPopup );
+ application.GetScene().Add( textPopup );
textPopup.ShowPopup();
// Render and notify
tet_infoline(" UtcDaliTextControllerSetGetLineSpacingProperty");
ToolkitTestApplication application;
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
// single line text
const std::string textSingle("A Quick Brown Fox Jumps Over The Lazy Dog");
mImpl.mOperationsPending = Controller::ALL_OPERATIONS;
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
DALI_TEST_EQUALS( Controller::COLOR, static_cast<Controller::OperationsMask>( mImpl.mOperationsPending & Controller::COLOR ), TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
tet_result(TET_PASS);
controller->SelectEvent( 0.f, 0.f, SelectionType::INTERACTIVE );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
// Get the implementation of the text controller
DALI_TEST_EQUALS( EventData::EDITING, mImpl.mEventData->mState, TEST_LOCATION );
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout( size );
tet_result(TET_PASS);
application.Render();
// Perform a relayout
- const Size size( Dali::Stage::GetCurrent().GetSize() );
+ const Size size( application.GetScene().GetSize() );
controller->Relayout(size);
// simulate a key event.
/*
- * 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.
textField.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
// Add the text field to the stage
- Stage::GetCurrent().Add( textField );
+ application.GetScene().Add( textField );
application.SendNotification();
application.Render();
/*
- * Copyright (c) 2018 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.
Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( dummyVisualPtr.Get() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( colorVisualPtr.Get() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
/*
- * 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.
// Add 2 buttons to test how many times the signal is sent
Test::TestButton testButton = Test::TestButton::New();
Test::TestButton testButton2 = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
- Stage::GetCurrent().Add( testButton2 );
+ application.GetScene().Add( testButton );
+ application.GetScene().Add( testButton2 );
StyleChangedSignalChecker styleChangedSignalHandler;
StyleChangedSignalChecker styleChangedSignalHandler2;
StyleManager styleManager = StyleManager::Get();
ToolkitTestApplication application;
Test::TestButton testButton = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
+ application.GetScene().Add( testButton );
StyleChangedSignalChecker styleChangedSignalHandler;
StyleManager styleManager = StyleManager::Get();
// Add 2 buttons
Test::TestButton testButton = Test::TestButton::New();
Test::TestButton testButton2 = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
- Stage::GetCurrent().Add( testButton2 );
+ application.GetScene().Add( testButton );
+ application.GetScene().Add( testButton2 );
StyleChangedSignalChecker styleChangedSignalHandler;
StyleManager styleManager = StyleManager::Get();
// Add 2 buttons
Test::TestButton testButton = Test::TestButton::New();
Test::TestButton testButton2 = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
- Stage::GetCurrent().Add( testButton2 );
+ application.GetScene().Add( testButton );
+ application.GetScene().Add( testButton2 );
StyleChangedSignalChecker styleChangedSignalHandler;
StyleManager styleManager = StyleManager::Get();
// Add 2 buttons
Test::TestButton testButton = Test::TestButton::New();
Test::TestButton testButton2 = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
- Stage::GetCurrent().Add( testButton2 );
+ application.GetScene().Add( testButton );
+ application.GetScene().Add( testButton2 );
StyleChangedSignalChecker styleChangedSignalHandler;
StyleManager styleManager = StyleManager::Get();
std::string labelStr("Label");
Toolkit::TextLabel label = Toolkit::TextLabel::New(labelStr);
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
Toolkit::TextField field = Toolkit::TextField::New();
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
Toolkit::TextEditor editor = Toolkit::TextEditor::New();
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
StyleChangedSignalChecker styleChangedSignalHandler;
Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
std::string labelStr("Label");
Toolkit::TextLabel label = Toolkit::TextLabel::New(labelStr);
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
Toolkit::TextLabel label2 = Toolkit::TextLabel::New(labelStr);
- Stage::GetCurrent().Add( label2 );
+ application.GetScene().Add( label2 );
StyleChangedSignalChecker styleChangedSignalHandler;
StyleMonitor styleMonitor = StyleMonitor::Get();
std::string fieldStr("Field");
Toolkit::TextField field = Toolkit::TextField::New();
field.SetProperty( Toolkit::TextField::Property::TEXT, fieldStr );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
Toolkit::TextField field2 = Toolkit::TextField::New();
- Stage::GetCurrent().Add( field2 );
+ application.GetScene().Add( field2 );
field2.SetProperty( Toolkit::TextField::Property::TEXT, fieldStr );
StyleChangedSignalChecker styleChangedSignalHandler;
std::string editorStr("Editor");
Toolkit::TextEditor editor = Toolkit::TextEditor::New();
editor.SetProperty( Toolkit::TextEditor::Property::TEXT, editorStr );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
Toolkit::TextEditor editor2 = Toolkit::TextEditor::New();
- Stage::GetCurrent().Add( editor2 );
+ application.GetScene().Add( editor2 );
editor2.SetProperty( Toolkit::TextEditor::Property::TEXT, editorStr );
StyleChangedSignalChecker styleChangedSignalHandler;
DummyControl actor = DummyControl::New(true);
actor.SetStyleName("BasicControl");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
DummyControl actor = DummyControl::New(true);
actor.SetStyleName("BasicControl");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
DummyControl actor = DummyControl::New(true);
actor.SetStyleName("NoStyles");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
Property::Map propertyMap;
DummyControl actor = DummyControl::New(true);
actor.SetStyleName("NoStateStyle");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
Property::Map propertyMap;
actor.SetProperty(DevelControl::Property::STATE, "NORMAL");
actor.SetProperty(DevelControl::Property::SUB_STATE, "SELECTED");
actor.SetStyleName("ComplexControl");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
tet_infoline( "Setting state to NORMAL/SELECTED before re-styling\n");
actor.SetStyleName("ComplexControl");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 );
// For coverage
Toolkit::TextEditor editor = Toolkit::TextEditor::New();
editor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( editor );
DALI_TEST_CHECK(manager.GetActorByFocusOrder(3) == Actor());
// Add the actors to the stage
- Stage::GetCurrent().Add(first);
- Stage::GetCurrent().Add(second);
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(first);
+ application.GetScene().Add(second);
+ application.GetScene().Add(third);
// Check that we get an empty handle because focus order 0 means undefined.
DALI_TEST_CHECK(manager.GetActorByFocusOrder(0) == Actor());
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
manager.SetFocusOrder(second, 2);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Create the third actor but don't add it to the stage
Actor third = Actor::New();
DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
// Add the third actor to the stage
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(third);
// make the third actor invisible
third.SetProperty( Actor::Property::VISIBLE,false);
Actor secondChild = Actor::New();
parent.Add(firstChild);
parent.Add(secondChild);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Create three actors and add them as the children of the first child actor
Actor firstGrandChild = Actor::New();
accAdaptor.HandleActionEnableEvent();
Actor first = Actor::New();
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
Actor third = Actor::New();
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(third);
// Set the focus order and description for the first actor
manager.SetFocusOrder(first, 1);
accAdaptor.HandleActionNextEvent(true);
Actor first = Actor::New();
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
Actor third = Actor::New();
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(third);
// Set the focus order and description for the first actor
manager.SetFocusOrder(first, 1);
accAdaptor.HandleActionEnableEvent();
Actor first = Actor::New();
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
Actor third = Actor::New();
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(third);
// Set the focus order and description for the first actor
manager.SetFocusOrder(first, 1);
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
manager.SetFocusOrder(second, 2);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Check that no actor is being focused yet.
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
manager.SetFocusOrder(second, 2);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Check that no actor is being focused yet.
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
Actor secondChild = Actor::New();
parent.Add(firstChild);
parent.Add(secondChild);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Create three actors and add them as the children of the first child actor
Actor firstGrandChild = Actor::New();
DALI_TEST_CHECK(defaultFocusIndicatorActor);
Actor focusedActor = Actor::New();
- Stage::GetCurrent().Add( focusedActor );
+ application.GetScene().Add( focusedActor );
application.SendNotification();
application.Render();
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
manager.SetFocusOrder(second, 2);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Check that no actor is being focused yet.
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
manager.SetFocusOrder(second, 2);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Check that the wrap mode is disabled
DALI_TEST_CHECK(manager.GetWrapMode() == false);
Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
button.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
- Stage::GetCurrent().Add(button);
+ application.GetScene().Add(button);
manager.SetFocusOrder( button, 1 );
manager.SetCurrentFocusActor( button );
DummyControl dummyControl = DummyControl::New(true);
dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
manager.SetFocusOrder( dummyControl, 1 );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
manager.SetCurrentFocusActor( dummyControl );
accessibilityAdaptor.HandleActionUpEvent();
Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
button.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
- Stage::GetCurrent().Add(button);
+ application.GetScene().Add(button);
manager.SetFocusOrder( button, 1 );
manager.SetCurrentFocusActor( button );
Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
button.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
- Stage::GetCurrent().Add(button);
+ application.GetScene().Add(button);
manager.SetFocusOrder( button, 1 );
manager.SetCurrentFocusActor( button );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
manager.SetFocusOrder( dummyControl, 1 );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
manager.SetCurrentFocusActor( dummyControl );
TouchPoint point( 0, TouchPoint::Started, 100.0f, 200.0f );
Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
DummyControl dummyControl = DummyControl::New(true);
dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
AccessibilityGestureEvent panGestureEvent(AccessibilityGestureEvent::Started);
panGestureEvent.previousPosition = Vector2(0.f, 0.f);
/*
- * Copyright (c) 2015 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.
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New();
DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalLeft);
DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalRight);
DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop);
DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop);
DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop);
DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom);
DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom);
DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom);
DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
application.Render();
application.SendNotification();
}
ToolkitTestApplication application;
Alignment alignment = Alignment::New();
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
END_TEST;
}
ToolkitTestApplication application;
Alignment alignment = Alignment::New();
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
DALI_TEST_EQUALS(size, alignment.GetTargetSize().GetVectorXY(), TEST_LOCATION);
- Stage::GetCurrent().Remove(alignment);
+ application.GetScene().Remove(alignment);
END_TEST;
}
Alignment alignment = Alignment::New();
alignment.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
alignment.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
alignment.TouchSignal().Connect(&TouchCallback);
ToolkitTestApplication application;
Alignment alignment = Alignment::New();
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
alignment.SetKeyInputFocus();
ToolkitTestApplication application;
Alignment alignment = Alignment::New();
- Stage::GetCurrent().Add(alignment);
+ application.GetScene().Add(alignment);
Animation animation = Animation::New(100.0f);
animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(20);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(20);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
Impl::DummyControl& dummyImpl1 = static_cast<Impl::DummyControl&>(dummyControl1.GetImplementation());
dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual1 );
dummyControl1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl1 );
+ application.GetScene().Add( dummyControl1 );
application.SendNotification();
application.Render(16);
Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(dummyControl2.GetImplementation());
dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual2 );
dummyControl2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl2 );
+ application.GetScene().Add( dummyControl2 );
application.SendNotification();
application.Render(16);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
textureTrace.Enable(true);
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
/*
- * Copyright (c) 2018 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.
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
tet_infoline( "Test Play action" );
DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render( 16 );
DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
tet_infoline( "On stage again" );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( dummy );
+ application.GetScene().Add( dummy );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
Vector2 naturalSize;
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Map attributes;
DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Map attributes;
DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Map attributes;
DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Map attributes;
DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Map attributes;
DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Map attributes;
DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
actor.SetProperty( Actor::Property::SIZE, controlSize );
actor.SetProperty( Actor::Property::SCALE, controlScale );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
actor1.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor1 );
+ application.GetScene().Add( actor1 );
propertyMap.Clear();
propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
actor2.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor2 );
+ application.GetScene().Add( actor2 );
DevelControl::DoAction( actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map() );
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Vector2 controlSize( 20.f, 30.f );
actor.SetProperty( Actor::Property::SIZE, controlSize );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
Toolkit::BloomView view = Toolkit::BloomView::New();
DALI_TEST_CHECK( view );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.Activate();
- RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
view.Deactivate();
- RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList3 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
END_TEST;
}
BloomView view = Toolkit::BloomView::New();
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
/*
- * Copyright (c) 2017 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.
Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
unsigned int taskCount = taskList.GetTaskCount();
Texture bgImage = CreateSolidColorTexture( application, Color::RED, 50, 50 );
BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f ));
DALI_TEST_CHECK(emitter);
Actor root = emitter.GetRootActor();
- Stage::GetCurrent().Add( root );
+ application.GetScene().Add( root );
root.SetProperty( Actor::Property::POSITION, Vector3::ZERO );
root.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
root.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
Actor root = emitter.GetRootActor();
Renderer bubbleRenderer = root.GetRendererAt( 0 );
- Stage::GetCurrent().Add( root );
+ application.GetScene().Add( root );
DALI_TEST_CHECK( bubbleRenderer );
Property::Index propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" );
Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
BubbleEmitter emitter = BubbleEmitter::New( movementArea,shapeImage, 90, Vector2( 5.f, 10.f ));
Actor root = emitter.GetRootActor();
- Stage::GetCurrent().Add( root );
+ application.GetScene().Add( root );
root.SetProperty( Actor::Property::POSITION, Vector3::ZERO );
root.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
root.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
/*
- * Copyright (c) 2018 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.
);
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
// Connect to builder's quit signal
bool functorCalled( false );
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors( application.GetScene().GetRootLayer() );
Animation anim = builder.CreateAnimation("animate");
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors( application.GetScene().GetRootLayer() );
Animation anim = builder.CreateAnimation("animate");
DALI_TEST_CHECK(anim);
// alternative actor to use for FindChildByName
- anim = builder.CreateAnimation("animate2", Dali::Stage::GetCurrent().GetRootLayer());
+ anim = builder.CreateAnimation("animate2", application.GetScene().GetRootLayer());
DALI_TEST_CHECK(anim);
// alternative actor to use for FindChildByName
- anim = builder.CreateAnimation("animate2", map, Dali::Stage::GetCurrent().GetRootLayer());
+ anim = builder.CreateAnimation("animate2", map, application.GetScene().GetRootLayer());
DALI_TEST_CHECK(anim);
DALI_TEST_CHECK( value.GetType() != Property::NONE );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
DALI_TEST_CHECK( builder );
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("image");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("image");
DALI_TEST_CHECK( actor );
END_TEST;
Builder builder = Builder::New();
builder.LoadFromString( json );
- unsigned int count = Stage::GetCurrent().GetRenderTaskList().GetTaskCount();
+ unsigned int count = application.GetScene().GetRenderTaskList().GetTaskCount();
// coverage
builder.CreateRenderTask( "task0" );
DALI_TEST_CHECK( count <
- Stage::GetCurrent().GetRenderTaskList().GetTaskCount() );
+ application.GetScene().GetRenderTaskList().GetTaskCount() );
END_TEST;
}
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
// Render and notify
application.SendNotification();
application.SendNotification();
application.Render();
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
DALI_TEST_CHECK( actor );
DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
// Render and notify
application.SendNotification();
application.SendNotification();
application.Render();
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
DALI_TEST_CHECK( actor );
DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
// Render and notify
application.SendNotification();
application.SendNotification();
application.Render();
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("actor");
DALI_TEST_CHECK( actor );
DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
// Render and notify
application.SendNotification();
application.SendNotification();
application.Render();
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("actor");
DALI_TEST_CHECK( actor );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
{
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( application.GetScene().GetRootLayer() );
DALI_TEST_CHECK( false );
}
catch(...)
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( "stage", Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( "stage", application.GetScene().GetRootLayer() );
// Render and notify
application.SendNotification();
application.Render();
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("Image1");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("Image1");
// coverage
DALI_TEST_CHECK( actor );
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors ( "arbitarysection", Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors ( "arbitarysection", application.GetScene().GetRootLayer() );
// Render and notify
application.SendNotification();
application.Render();
- Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
+ Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
DALI_TEST_CHECK( actor );
DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
// For coverage
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
builder.AddActors( actor );
// Render and notify
builder.LoadFromString( json );
Test::TestButton testButton = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
+ application.GetScene().Add( testButton );
// Render and notify
application.SendNotification();
builder.LoadFromString( json );
Test::TestButton testButton = Test::TestButton::New();
- Stage::GetCurrent().Add( testButton );
+ application.GetScene().Add( testButton );
// Render and notify
application.SendNotification();
);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
Builder builder = Builder::New();
builder.LoadFromString( json );
);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
Builder builder = Builder::New();
builder.LoadFromString( json );
);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
Builder builder = Builder::New();
builder.LoadFromString( json );
Builder builder = Builder::New();
builder.LoadFromString( json );
- builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+ builder.AddActors( application.GetScene().GetRootLayer() );
DALI_TEST_CHECK( true ); // For Coverage
/*
- * 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.
button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
application.SendNotification();
application.Render();
button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
application.SendNotification();
application.Render();
button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
application.SendNotification();
application.Render();
button.SetProperty( Button::Property::TOGGLABLE, true);
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
application.SendNotification();
application.Render();
parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- Stage::GetCurrent().Add( parentButton );
+ application.GetScene().Add( parentButton );
Button childButton = PushButton::New();
childButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- Stage::GetCurrent().Add( parentButton );
+ application.GetScene().Add( parentButton );
parentButton.ReleasedSignal().Connect( &ButtonCallback );
// Reset signal flags
button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
button.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
button.ReleasedSignal().Connect( &ButtonCallback );
// Reset signal flags
/*
- * 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.
ToolkitTestApplication application;
CheckBoxButton checkBox = CheckBoxButton::New();
- Stage::GetCurrent().Add( checkBox );
+ application.GetScene().Add( checkBox );
checkBox.SetProperty( Actor::Property::SIZE, Vector2( 20.0f, 20.0f ) );
checkBox.SetProperty(checkBox.GetPropertyIndex("disabledUnselectedBackgroundVisual"), "Image.jpg" );
ToolkitTestApplication application;
CheckBoxButton checkBox = CheckBoxButton::New();
- Stage::GetCurrent().Add( checkBox );
+ application.GetScene().Add( checkBox );
checkBox.SetProperty( Actor::Property::SIZE, Vector2( 20.0f, 20.0f ) );
checkBox.SetProperty(Button::Property::DISABLED_UNSELECTED_VISUAL, "Image.jpg" );
/*
- * Copyright (c) 2015 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.
DALI_TEST_CHECK( !gSignalReceivedCancel );
// Provoke the signal.
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
// Check the signal has occurred.
DALI_TEST_CHECK( gSignalReceivedOK );
DALI_TEST_CHECK( !gSignalReceivedCancel );
// Provoke the signal.
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
// Check the cancel signal has occurred.
DALI_TEST_CHECK( gSignalReceivedOK );
DALI_TEST_CHECK( !gSignalReceivedOK );
// Provoke the signal.
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
// Check the signal has still not occurred, as our button was incorrectly named.
DALI_TEST_CHECK( !gSignalReceivedOK );
Toolkit::Popup popup = Toolkit::Popup::DownCast( baseHandle );
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetDisplayState( Toolkit::Popup::SHOWN );
application.SendNotification();
/*
- * 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.
ToolkitTestApplication application;
Control control = Control::New();
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
int UtcDaliControlKeyInputFocus(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
DummyControl control;
DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
dummyImpl->mCustomSlot1Called = false;
actor.OnStageSignal().Disconnect( dummyImpl, &DummyControlImpl::CustomSlot1 );
DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Remove( actor );
+ application.GetScene().Add( actor );
DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
}
END_TEST;
DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
}
// dummyControl automatically disconnects
test.SetProperty( Actor::Property::SIZE, Vector3( 0.7f, 0.7f, 0.7f ) );
- Stage::GetCurrent().Add( test );
+ application.GetScene().Add( test );
application.SendNotification();
application.Render();
ToolkitTestApplication application;
Control control = Control::New();
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
tet_infoline( "Set transparent, no renderers should be created" );
control.SetBackgroundColor( Color::TRANSPARENT );
ToolkitTestApplication application;
Control control = Control::New();
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
ToolkitTestApplication application;
Control control = Control::New();
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
gKeyInputFocusCallBackCalled = false;
control.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback);
ToolkitTestApplication application;
Control control = Control::New();
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
gKeyInputFocusCallBackCalled = false;
control.KeyInputFocusLostSignal().Connect(&TestKeyInputFocusCallback);
control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
tet_infoline( "Test to ensure that the control background transform does not get overwritten when adding to the stage" );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
propertyMap.Insert( ImageVisual::Property::URL, "invalid.jpg" );
control.SetProperty( Control::Property::BACKGROUND, propertyMap );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
control.SetProperty( Control::Property::MARGIN, Extents( 20, 10, 0, 0 ) );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
control.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
tet_infoline( "Adding control to stage will in turn add the visual to the stage" );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
tet_infoline( "No change in textures could occurs as already loaded and cached texture will be used" );
/*
- * 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.
dummy.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify a couple of times
application.SendNotification();
DALI_TEST_CHECK( dummyImpl.longPressCalled == true );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
{
DummyControl dummy = DummyControl::New( true );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.Render();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, false, TEST_LOCATION );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, true, TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl.stageDisconnectionCalled, false, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
application.Render();
application.SendNotification();
DALI_TEST_EQUALS( dummyImpl.stageDisconnectionCalled, true, TEST_LOCATION );
// Ensure full code coverage
{
- unsigned int stageChildren = Stage::GetCurrent().GetLayer(0).GetChildCount();
+ unsigned int stageChildren = application.GetScene().GetLayer(0).GetChildCount();
DummyControl dummy = DummyControl::New();
- DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
- Stage::GetCurrent().Add(dummy);
+ DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
}
END_TEST;
}
DummyControl dummy = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
DALI_TEST_EQUALS( size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
{
DummyControl dummy = DummyControl::New();
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
Vector2 size(100.0f, 200.0f);
DALI_TEST_CHECK( size != dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY() );
DALI_TEST_EQUALS(size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION);
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
DummyControl dummy = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION );
Animation animation = Animation::New(1.0f);
DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
Animation animation = Animation::New(1.0f);
animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
application.Render();
application.SendNotification();
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
application.ProcessEvent(touchEvent);
DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
touchEvent.AddPoint(point);
application.ProcessEvent(touchEvent);
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
application.ProcessEvent( event );
DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
event.AddPoint(point);
application.ProcessEvent( event );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
DummyControl dummy = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.SetKeyInputFocus();
application.Render();
application.ProcessEvent(keyEvent);
DALI_TEST_EQUALS( dummyImpl.keyEventCalled, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.SetKeyInputFocus();
application.Render();
Integration::KeyEvent keyEvent;
application.ProcessEvent(keyEvent);
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
DummyControl dummy = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, false, TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.SetKeyInputFocus();
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
DummyControl dummy = DummyControl::New( true );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, false, TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.SetKeyInputFocus();
dummy.ClearKeyInputFocus();
dummyImpl.IsKeyboardNavigationSupported();
dummyImpl.IsKeyboardFocusGroup();
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.WheelEventSignal().Connect(&WheelEventCallback);
application.ProcessEvent( event );
DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, true, TEST_LOCATION );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
// Ensure full code coverage
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.WheelEventSignal().Connect(&WheelEventCallback);
Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
application.ProcessEvent( event );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
dummy.SetStyleName("TestStyle");
DALI_TEST_CHECK( dummy.GetStyleName() == "TestStyle" );
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
}
END_TEST;
}
dummyImpl.RegisterVisual( index, visual );
tet_infoline( "Add control with visual to stage and check renderer count is 1" );
- Stage::GetCurrent().Add( dummy );
+ application.GetScene().Add( dummy );
application.SendNotification();
application.Render();
dummyImpl.UnregisterVisual( index );
tet_infoline( "Remove control with visual from stage and check renderer count is 0" );
- Stage::GetCurrent().Remove( dummy );
+ application.GetScene().Remove( dummy );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( dummyImpl.GetVisual( TEST_PROPERTY ) == visual );
DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
// Register index with a color visual
dummyImpl.RegisterVisual( TEST_PROPERTY, visual );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
// Register index with a color visual
dummyImpl.RegisterVisual( TEST_PROPERTY, visual, false );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
DALI_TEST_CHECK( dummy.GetRendererCount() == 1u );
// Remove control from stage, visual should be removed from stage too
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
// Render and notify
application.SendNotification();
application.Render();
DALI_TEST_CHECK( dummy.GetRendererCount() == 0u );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
// Register second index with a color visual
dummyImpl.RegisterVisual( TEST_PROPERTY2, visual2 );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
DALI_TEST_CHECK( dummy.GetRendererCount() == 1u );
// Remove control from stage, visual should be removed from stage too
- Stage::GetCurrent().Remove(dummy);
+ application.GetScene().Remove(dummy);
// Render and notify
application.SendNotification();
application.Render();
DALI_TEST_CHECK( dummy.GetRendererCount() == 0u );
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
application.SendNotification();
application.Render();
/*
- * 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.
Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
- Stage::GetCurrent().Add( controlWrapper );
+ application.GetScene().Add( controlWrapper );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
- Stage::GetCurrent().Add( controlWrapper );
+ application.GetScene().Add( controlWrapper );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
DALI_TEST_EQUALS( visual.GetDepthIndex(), 10, TEST_LOCATION );
- Stage::GetCurrent().Add( controlWrapper );
+ application.GetScene().Add( controlWrapper );
// Render and notify
application.SendNotification();
controlWrapper.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
controlWrapper.SetProperty( Dali::Actor::Property::NAME,"Actor1");
controlWrapper.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(controlWrapper);
+ application.GetScene().Add(controlWrapper);
Animation anim = controlWrapperImpl->CreateTransition( transition );
DALI_TEST_CHECK( ! anim );
Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
- Stage::GetCurrent().Add( controlWrapper );
+ application.GetScene().Add( controlWrapper );
// "background" property
Property::Map rendererMap;
// Register to self
controlWrapperImpl->TestRegisterVisual( index, visual );
- Stage::GetCurrent().Add( controlWrapper );
+ application.GetScene().Add( controlWrapper );
controlWrapper.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
application.SendNotification();
application.Render(0); // Trigger animation start
DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
- Stage::GetCurrent().Remove( controlWrapper );
+ application.GetScene().Remove( controlWrapper );
}
DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
waveEffect.SetCurrentTexture( texture );
waveEffect.SetTargetTexture( texture );
CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
waveEffect.SetTransitionDuration( TRANSITION_DURATION );
waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- Stage::GetCurrent().Add( crossEffect );
+ application.GetScene().Add( crossEffect );
crossEffect.SetTransitionDuration( TRANSITION_DURATION );
crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- Stage::GetCurrent().Add( foldEffect );
+ application.GetScene().Add( foldEffect );
foldEffect.SetTransitionDuration( TRANSITION_DURATION );
DALI_TEST_CHECK( !foldEffect.IsTransitioning() );
waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
waveEffect.SetCurrentTexture( texture );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
application.SendNotification();
application.Render();
Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
waveEffect.SetCurrentTexture( texture );
waveEffect.SetTargetTexture( texture );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
application.SendNotification();
application.Render();
waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
waveEffect.SetCurrentTexture( texture );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
application.SendNotification();
application.Render();
crossEffect.SetCurrentTexture( texture );
crossEffect.SetTargetTexture( texture );
- Stage::GetCurrent().Add( crossEffect );
+ application.GetScene().Add( crossEffect );
application.SendNotification();
application.Render();
foldEffect.SetCurrentTexture( texture );
foldEffect.SetTargetTexture( texture );
- Stage::GetCurrent().Add( foldEffect );
+ application.GetScene().Add( foldEffect );
application.SendNotification();
application.Render();
waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
waveEffect.SetTransitionDuration( TRANSITION_DURATION );
waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
crossEffect.SetTransitionDuration( TRANSITION_DURATION );
crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- Stage::GetCurrent().Add( crossEffect );
+ application.GetScene().Add( crossEffect );
CubeTransitionEffect foldEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- Stage::GetCurrent().Add( foldEffect );
+ application.GetScene().Add( foldEffect );
bool signalVerified = false;
CubeTransitionEffect currentEffect;
waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
waveEffect.SetTransitionDuration( TRANSITION_DURATION );
waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
crossEffect.SetTransitionDuration( TRANSITION_DURATION );
crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- Stage::GetCurrent().Add( crossEffect );
+ application.GetScene().Add( crossEffect );
CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- Stage::GetCurrent().Add( foldEffect );
+ application.GetScene().Add( foldEffect );
bool signalVerified = false;
CubeTransitionEffect currentEffect;
waveEffect.SetCurrentTexture( firstTexture );
waveEffect.SetTargetTexture( secondTexture );
- Stage::GetCurrent().Add( waveEffect );
+ application.GetScene().Add( waveEffect );
application.SendNotification();
application.Render();
crossEffect.SetCurrentTexture( firstTexture );
crossEffect.SetTargetTexture( secondTexture );
- Stage::GetCurrent().Add( crossEffect );
+ application.GetScene().Add( crossEffect );
application.SendNotification();
application.Render();
foldEffect.SetCurrentTexture( firstTexture );
foldEffect.SetTargetTexture( secondTexture );
- Stage::GetCurrent().Add( foldEffect );
+ application.GetScene().Add( foldEffect );
application.SendNotification();
application.Render();
/*
- * 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.
Control control = Control::New();
control.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
control.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(control);
+ application.GetScene().Add(control);
detector.Attach(control);
application.SendNotification();
control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
- Stage::GetCurrent().Add(control1);
- Stage::GetCurrent().Add(control2);
+ application.GetScene().Add(control1);
+ application.GetScene().Add(control2);
detector.Attach(control1);
detector.Attach(control2);
control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
- Stage::GetCurrent().Add(control1);
- Stage::GetCurrent().Add(control2);
+ application.GetScene().Add(control1);
+ application.GetScene().Add(control2);
detector.Attach(control1);
detector.Attach(control2);
control1.SetProperty( Actor::Property::LEAVE_REQUIRED,true);
control2.SetProperty( Actor::Property::LEAVE_REQUIRED,true);
- Stage::GetCurrent().Add(control1);
- Stage::GetCurrent().Add(control2);
+ application.GetScene().Add(control1);
+ application.GetScene().Add(control2);
detector.Attach(control1);
detector.Attach(control2);
control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
- Stage::GetCurrent().Add(control1);
- Stage::GetCurrent().Add(control2);
+ application.GetScene().Add(control1);
+ application.GetScene().Add(control2);
detector.Attach(control1);
detector.Attach(control2);
control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
- Stage::GetCurrent().Add(control1);
- Stage::GetCurrent().Add(control2);
+ application.GetScene().Add(control1);
+ application.GetScene().Add(control2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
- Stage::GetCurrent().Add(control1);
- Stage::GetCurrent().Add(control2);
+ application.GetScene().Add(control1);
+ application.GetScene().Add(control2);
detector.Attach(control1);
detector.Attach(control2);
/*
- * Copyright (c) 2017 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.
view = EffectsView::New( EffectsView::DROP_SHADOW );
DALI_TEST_CHECK( view );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.Reset();
view = EffectsView::New( EffectsView::EMBOSS );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
DALI_TEST_CHECK( actor.GetParent() );
tet_infoline("Checking number of render tasks = 1");
application.SendNotification();
application.Render();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION );
tet_infoline("Create effects view");
EffectsView view = EffectsView::New(EffectsView::EMBOSS);
view.SetProperty( Actor::Property::SIZE, Vector2(100.f, 100.f) );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() == 1 );
stage.Add( view );
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
view.SetProperty( Actor::Property::SIZE, Vector2(100.f, 100.f) );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() == 1 );
stage.Add( view );
ToolkitTestApplication application;
EffectsView view = EffectsView::New( EffectsView::EMBOSS );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
Property::Value value = view.GetProperty( EffectsView::Property::EFFECT_OFFSET );
Vector3 offsetValue;
ToolkitTestApplication application;
EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
Property::Value value = view.GetProperty( EffectsView::Property::EFFECT_COLOR );
Vector4 colorValue;
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
view.SetProperty( Actor::Property::SIZE, Vector2(100.f, 100.f) );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( view );
application.SendNotification();
application.Render();
int UtcDaliEffectsViewSizeSet(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
{
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
/*
- * Copyright (c) 2016 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.
DALI_TEST_CHECK( flexContainer );
// Add flex container to the stage
- Stage::GetCurrent().Add( flexContainer );
+ application.GetScene().Add( flexContainer );
// Create two actors and add them to the container
Actor actor1 = Actor::New();
DALI_TEST_CHECK( flexContainer );
// Add flex container to the stage
- Stage::GetCurrent().Add( flexContainer );
+ application.GetScene().Add( flexContainer );
// Create two actors and add them to the container
Actor actor1 = Actor::New();
DALI_TEST_CHECK( flexContainer );
// Add flex container to the stage
- Stage::GetCurrent().Add( flexContainer );
+ application.GetScene().Add( flexContainer );
// Create an actor and add it to the container
Actor actor = Actor::New();
DALI_TEST_CHECK( flexContainer );
// Add flex container to the stage
- Stage::GetCurrent().Add( flexContainer );
+ application.GetScene().Add( flexContainer );
RelayoutSignalHandler relayoutSignal(flexContainer);
flexContainer.OnRelayoutSignal().Connect(&relayoutSignal, &RelayoutSignalHandler::RelayoutCallback );
flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
// Add flex container to the stage
- Stage::GetCurrent().Add( flexContainer );
- Size stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( flexContainer );
+ Size stageSize = application.GetScene().GetSize();
RelayoutSignalHandler relayoutSignal(flexContainer);
flexContainer.OnRelayoutSignal().Connect(&relayoutSignal, &RelayoutSignalHandler::RelayoutCallback );
Actor actor0 = Actor::New();
- Stage::GetCurrent().Add( actor0 );
+ application.GetScene().Add( actor0 );
actor0.Add( flexContainer );
// Create two actors and add them to the container
/*
- * 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.
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
DALI_TEST_CHECK( view );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.Activate();
- RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
DALI_TEST_CHECK( 2u == view.GetChildCount() );
view.Deactivate();
- RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList3 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
DALI_TEST_CHECK( 1u == view.GetChildCount() );
DALI_TEST_CHECK( view );
view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.Activate();
application.SendNotification();
DALI_TEST_CHECK( view );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.Activate();
PixelData pixels = Toolkit::SyncImageLoader::Load( TEST_IMAGE_FILE_NAME );
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
DALI_TEST_CHECK( view );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.ActivateOnce();
- RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
application.Render();
DALI_TEST_CHECK( view );
view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.ActivateOnce();
application.SendNotification();
DALI_TEST_CHECK( view );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.Activate();
TestCallback callback( view );
/*
- * 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.
imageView2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
application.GetPlatform().SetClosestImageSize( Vector2(34, 34) );
- Stage::GetCurrent().Add( imageView1 );
+ application.GetScene().Add( imageView1 );
application.GetPlatform().SetClosestImageSize( Vector2(50, 50) );
- Stage::GetCurrent().Add( imageView2 );
+ application.GetScene().Add( imageView2 );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
// remove the imageView2 from stage, the second image will also be removed from atlas
// then the space on the atlas will be used by the third image added.
- Stage::GetCurrent().Remove( imageView2 );
+ application.GetScene().Remove( imageView2 );
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
imageView3.SetProperty( ImageView::Property::IMAGE, imageMap3 );
application.GetPlatform().SetClosestImageSize( Vector2(100, 100) );
- Stage::GetCurrent().Add( imageView3 );
+ application.GetScene().Add( imageView3 );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
ImageView imageView1 = ImageView::New();
imageView1.SetProperty( ImageView::Property::IMAGE, imageMap );
- Stage::GetCurrent().Add( imageView1 );
+ application.GetScene().Add( imageView1 );
Property::Value value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
bool enable;
ImageView imageView2 = ImageView::New();
imageView2.SetProperty( ImageView::Property::IMAGE, imageMap );
- Stage::GetCurrent().Add( imageView2 );
+ application.GetScene().Add( imageView2 );
application.SendNotification();
application.Render();
ImageView imageView1 = ImageView::New();
imageView1.SetProperty( ImageView::Property::IMAGE, imageMap );
- Stage::GetCurrent().Add( imageView1 );
+ application.GetScene().Add( imageView1 );
Property::Value value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
bool enable;
// Disable pre-multiplied alpha blending
imageView2.SetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA, false );
- Stage::GetCurrent().Add( imageView2 );
+ application.GetScene().Add( imageView2 );
application.SendNotification();
application.Render();
.Add( ImageVisual::Property::PIXEL_AREA, pixelAreaVisual ) );
// Add to stage
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( gifView );
// loading started
ImageView imageView = ImageView::New( gImage_600_RGB );
// By default, Aysnc loading is used
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
imageView.SetProperty( Actor::Property::SIZE, Vector2(100, 100) );
imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// By default, Aysnc loading is used
// loading is not started if the actor is offStage
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render(16);
application.Render(16);
ImageView imageView = ImageView::New();
imageView.SetProperty( ImageView::Property::IMAGE, asyncLoadingMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render(16);
application.Render(16);
syncLoadingMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render(16);
syncLoadingMap[ "atlasing" ] = true;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render(16);
propertyMap[ImageVisual::Property::URL] = url;
imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
}
);
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio, 600x600 pixels
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
}
);
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// loading started, this waits for the loader thread
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
ImageView imageView = ImageView::New();
Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
std::string url;
Property::Map map;
imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render(16);
dummyControl.Add( imageView );
dummyImpl.SetRelayoutCallback( &OnRelayoutOverride );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
tet_infoline("Connect to ResourceReady signal for second ImageView, it should still fire as resource is ready");
imageViewWithExistingImage.ResourceReadySignal().Connect( &ResourceReadySignal);
- Stage::GetCurrent().Add( imageViewWithExistingImage );
+ application.GetScene().Add( imageViewWithExistingImage );
DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageMap[ Toolkit::ImageVisual::Property::URL ] = gImage_34_RGBA;
imageMap[ Toolkit::ImageVisual::Property::ATLASING ] = true;
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(600,500) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(700,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(700,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(700,600) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(700,600) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap2 );
imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap3 );
imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap2 );
imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap3 );
imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
imageView.SetProperty( Actor::Property::SIZE, Vector2(600,600) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
// Trigger a potential relayout
application.SendNotification();
ImageView imageView = ImageView::New();
imageView.SetProperty( ImageView::Property::IMAGE, properties );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
ImageView imageView = ImageView::New( TEST_IMAGE_FILE_NAME );
imageView.SetProperty( ImageView::Property::IMAGE, properties );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( ImageView::Property::IMAGE, properties );
imageView.SetProperty( ImageView::Property::IMAGE, TEST_IMAGE_FILE_NAME );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( ImageView::Property::IMAGE, properties1 );
imageView.SetProperty( ImageView::Property::IMAGE, properties );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( ImageView::Property::IMAGE, properties );
imageView.SetProperty( ImageView::Property::IMAGE, properties1 );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
application.Render();
imageView.SetProperty( Actor::Property::SIZE, Vector2(300, 300) );
imageView.SetProperty( Actor::Property::POSITION, Vector3( 150.0f , 150.0f , 0.0f ) );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_CHECK( imageView );
syncLoadingMap.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, true);
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_CHECK( imageView );
application.SendNotification();
syncLoadingMap.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, false);
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_CHECK( imageView );
application.SendNotification();
syncLoadingMap.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, std::to_string(5) );
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_CHECK( imageView );
application.SendNotification();
DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
application.SendNotification();
ImageView imageView = ImageView::New( gImage_34_RGBA );
imageView.ResourceReadySignal().Connect( &OnResourceReadySignal );
- Stage::GetCurrent().Add( imageView );
+ application.GetScene().Add( imageView );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification(); // Send messages to update
application.Render(); // process update and render
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( preMultipliedAlpha2, true, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
newActor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( newActor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( newActor );
+ application.GetScene().Add( newActor );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
drawTrace.Enable(true);
Actor actor = CreateActorWithImageVisual( propertyMap );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
// Wait for image to load
drawTrace.Reset();
Actor actor2 = CreateActorWithImageVisual( propertyMap );
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
application.SendNotification(); // Send messages to update
application.Render(); // process update and render
tet_infoline("Test that removing 1 actor doesn't delete the texture\n");
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
application.SendNotification();
application.Render();
tet_infoline("Test that removing last actor does delete the texture\n");
- Stage::GetCurrent().Remove( actor2 ); // Detaches remaining ImageVisual
+ application.GetScene().Remove( actor2 ); // Detaches remaining ImageVisual
application.SendNotification();
application.Render();
drawTrace.Enable(true);
Actor actor = CreateActorWithImageVisual( propertyMap );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
// Wait for image to load
propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, 100 );
propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, 100 );
Actor actor2 = CreateActorWithImageVisual( propertyMap );
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
application.SendNotification();
tet_infoline("Test that removing 1 actor deletes it's texture\n");
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
application.SendNotification();
application.Render();
tet_infoline("Test that removing last actor deletes it's texture\n");
- Stage::GetCurrent().Remove( actor2 );
+ application.GetScene().Remove( actor2 );
application.SendNotification();
application.Render();
dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// loading started
application.SendNotification();
dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// loading started
application.SendNotification();
actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
Dali::Toolkit::TransitionData transition = TransitionData::New( array );
Animation animation = dummyImpl.CreateTransition( transition );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0); // Ensure animation starts
actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
drawTrace.Enable(true);
Actor actor = CreateActorWithImageVisual( propertyMap );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
application.SendNotification();
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
dummyImpl.RegisterVisual( Control::Property::BACKGROUND, visual );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Cancel loading
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Create another visual with the same image
visual = factory.CreateVisual( propertyMap );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Do not wait for any EventThreadTrigger in synchronous alpha mask.
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
textureTrace.Reset();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Wait for image to load
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
// 2.Remove actor from stage. In this case, renderer also is deleted.
tet_infoline( "Remove actor from stage" );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
application.SendNotification();
application.Render();
// 3.Add actor in stage. In this case, renderer is created.
tet_infoline( "Add actor in stage" );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
application.SendNotification();
application.Render();
imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
tet_infoline( "Ensure nothing triggers another load as texure already loaded" );
const unsigned int TIME_OUT_3_SECONDS = 3;
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, TIME_OUT_3_SECONDS ), false, TEST_LOCATION );
imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
tet_infoline( "Allow image time to load" );
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
actor.ResourceReadySignal().Connect( &ResourceReadySignal);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
tet_infoline( "Create visual with ATTACHED load policy" );
Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::ATTACHED );
tet_infoline( "Create control for visual, need to loaded it" );
DummyControl actor = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
// Wait for image to load
dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( dummy );
+ application.GetScene().Add( dummy );
application.SendNotification();
application.Render();
dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual1 );
dummy1.SetProperty( Actor::Property::SIZE, Vector2( 200, 200 ) );
dummy1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( dummy1 );
+ application.GetScene().Add( dummy1 );
TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
glAbstraction.EnableEnableDisableCallTrace( true );
actor.ResourceReadySignal().Connect( &ResourceReadySignal);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
tet_infoline( "Create visual with IMMEDIATE load policy" );
Visual::Base imageVisual1 = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 );
actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
tet_infoline( "Wait for loading thread to finish");
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
layout->SetItemSize(itemSize);
Vector3 itemSize1;
- layout->GetItemSize(0u, Vector3(Stage::GetCurrent().GetSize()), itemSize1);
+ layout->GetItemSize(0u, Vector3(application.GetScene().GetSize()), itemSize1);
DALI_TEST_CHECK(itemSize == itemSize1);
- float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(Stage::GetCurrent().GetSize()));
+ float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(application.GetScene().GetSize()));
DALI_TEST_EQUALS(position, 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(swipSpeed, 30.0f, TEST_LOCATION );
}
}
- Dali::Stage stage = Dali::Stage::GetCurrent();
- Vector3 stageSize(stage.GetSize());
- view.ActivateLayout(0, stageSize, 0.5f);
- view.ActivateLayout(1, stageSize, 0.5f);
- view.ActivateLayout(2, stageSize, 0.5f);
+ Dali::Integration::Scene scene = application.GetScene();
+ Vector3 sceneSize(scene.GetSize());
+ view.ActivateLayout(0, sceneSize, 0.5f);
+ view.ActivateLayout(1, sceneSize, 0.5f);
+ view.ActivateLayout(2, sceneSize, 0.5f);
END_TEST;
}
DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
// Activate the depth layout
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(1, stageSize, 0.5f);
// Check the current active layout is the depth layout
DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
// Activate the grid layout
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
// Check the current active layout is the grid layout
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
// Get the item given the item ID
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
// Get the item given the item ID 2 and 3
view.AddLayout(*depthLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.0f);
// Check the current layout position for the 10th items is 9.0f
view.AddLayout(*layout);
view.SetProperty( Actor::Property::SIZE, vec );
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
layout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
tet_result(TET_FAIL);
}
- Stage::GetCurrent().Remove(view);
+ application.GetScene().Remove(view);
END_TEST;
}
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.0f);
// Get the specified item where new item to be inserted before that
view.AddLayout(*depthLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
unsigned int itemCount = view.GetChildCount();
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
Actor newActor = Actor::New();
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
ItemContainer replaceList;
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
ItemRange itemRange(0, 0);
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
// Connect the layout activated signal
view.LayoutActivatedSignal().Connect( &OnLayoutActivated );
application.Render();
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.1f);
// Wait for 0.1 second
int UtcDaliItemViewOvershootVertical(void)
{
ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
int UtcDaliItemViewOvershootHorizontal(void)
{
ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
int UtcDaliItemEnableDisableRefresh(void)
{
ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
/*
- * Copyright (c) 2017 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.
int UtcDaliKeyInputFocusManagerSetFocus01(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Check that there is no focused control. Set focus to control. Check it is now the focused actor and receives KeyInputFocusGained signal");
int UtcDaliKeyInputFocusManagerSetFocus02(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Set focus to control. Check it is now the focused actor and receives KeyInputFocusGained signal. Set focuse to another control - check that the first control receives KeyInputFocusLost");
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline("Test KeyEvent propagation. If focused control doesn't consume KeyEvent, KeyEvent will be recursively delivered to the control and its parents, until the event is consumed or the stage is reached. In this case, KeyEvent is delivered to KeyboardFocusManager via Stage's KeyEventSignal");
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline("Test KeyEvent propagation. If focused control doesn't consume KeyEvent, KeyEvent will be recursively delivered to the control and its parents, until the event is consumed or the stage is reached. In this case, KeyEvent is delivered from dummy3 to dummy2");
int UtcDaliKeyInputFocusManagerGetCurrentFocusControl(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Add 2 controls, check they each get focused. Re-focus the first control - ensure it's now got focus (check signals)");
int UtcDaliKeyInputFocusManagerRemoveFocus(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Add focus controls. Test that removing focus from control which has focus. ");
{
ToolkitTestApplication application;
KeyInputFocusManager manager = KeyInputFocusManager::Get();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged");
/*
- * Copyright (c) 2017 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.
// Create the first actor and add it to the stage
Actor first = Actor::New();
first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Create the third actor but don't add it to the stage
Actor third = Actor::New();
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
// Add the third actor to the stage
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(third);
// Check that it will fail to set focus on the third actor as it's not focusable
DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
// Create the first actor and add it to the stage
Actor first = Actor::New();
first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Move the focus to the right
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
// Create a 2x2 table view and try to move focus inside it
TableView tableView = TableView::New( 2, 2 );
- Stage::GetCurrent().Add(tableView);
+ application.GetScene().Add(tableView);
// Create the third actor
Actor third = Actor::New();
// Create the first actor and add it to the stage
Actor first = Actor::New();
first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Move the focus to the right
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
PushButton button2 = PushButton::New();
button1.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
button2.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(button1);
- Stage::GetCurrent().Add(button2);
+ application.GetScene().Add(button1);
+ application.GetScene().Add(button2);
// Set the focus to the button1
DALI_TEST_CHECK(manager.SetCurrentFocusActor(button1) == true);
// Create a 1x1 table view and try to move focus inside it
TableView tableView = TableView::New( 1, 1 );
- Stage::GetCurrent().Add(tableView);
+ application.GetScene().Add(tableView);
PushButton button = PushButton::New();
button.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
// Create the first actor and add it to the stage
Actor first = Actor::New();
first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Check that the focus is set on the first actor
DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
Actor parent = Actor::New();
Actor child = Actor::New();
parent.Add(child);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Create three actors and add them as the children of the first child actor
Actor grandChild = Actor::New();
// Create the first button and add it to the stage
PushButton firstPushButton = PushButton::New();
firstPushButton.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(firstPushButton);
+ application.GetScene().Add(firstPushButton);
// Create the second button and add it to the stage
PushButton secondPushButton = PushButton::New();
secondPushButton.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(secondPushButton);
+ application.GetScene().Add(secondPushButton);
// Check that the focus is set on the first button
DALI_TEST_CHECK(manager.SetCurrentFocusActor(firstPushButton) == true);
// Create the first actor and add it to the stage
Actor first = Actor::New();
first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Create the third actor and add it to the stage
Actor third = Actor::New();
third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(third);
+ application.GetScene().Add(third);
// Create the fourth actor and add it to the stage
Actor fourth = Actor::New();
fourth.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(fourth);
+ application.GetScene().Add(fourth);
// Check that the focus is set on the second actor
DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
{
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
manager.SetCurrentFocusActor(actor);
}
// Create a 2x2 table view and try to move focus inside it
TableView tableView = TableView::New( 2, 2 );
- Stage::GetCurrent().Add(tableView);
+ application.GetScene().Add(tableView);
// Create the first actor
Actor first = Actor::New();
// Create the first actor and add it to the stage
Control first = Control::New();
first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
// Create the second actor and add it to the stage
Control second = Control::New();
second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Move the focus to the right
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
// Create a 2x2 table view and try to move focus inside it
TableView tableView = TableView::New( 2, 2 );
- Stage::GetCurrent().Add(tableView);
+ application.GetScene().Add(tableView);
// Create the third actor
Control third = Control::New();
DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
tet_infoline( "Add actor to stage and attempt to set, our actor should be returned from KeyboardFocusManager" );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
manager.SetCurrentFocusActor( actor );
DALI_TEST_CHECK( manager.GetCurrentFocusActor() == actor );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
manager.SetCurrentFocusActor( actor );
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
magnifier = Magnifier::New();
DALI_TEST_CHECK( magnifier );
- Stage::GetCurrent().Add( magnifier );
+ application.GetScene().Add( magnifier );
application.SendNotification();
application.Render();
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
stage.Add( view );
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
stage.Add( view );
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
stage.Add( view );
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
stage.Add( view );
Magnifier view = Magnifier::New();
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
/*
- * Copyright (c) 2015 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.
DALI_TEST_CHECK( val.Get( obj_file_name ) );
DALI_TEST_EQUALS( obj_file_name, TEST_RESOURCE_LOCATION, TEST_LOCATION );
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
END_TEST;
}
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
Model3dView view = Toolkit::Model3dView::New();
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
navigationView = NavigationView::New();
DALI_TEST_CHECK( navigationView );
- Stage::GetCurrent().Add( navigationView );
+ application.GetScene().Add( navigationView );
application.SendNotification();
application.Render();
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
// 1 Create and Add Navigation View to stage, actor count should be zero
NavigationView naviView = NavigationView::New();
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
// 1 Create Navigation View
NavigationView naviView = NavigationView::New();
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
// 1 Create Navigation View
NavigationView naviView = NavigationView::New();
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
// 1 Create Navigation View
NavigationView naviView = NavigationView::New();
/*
- * 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.
PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
DALI_TEST_CHECK( landscapeView );
- Stage::GetCurrent().Add( landscapeView );
+ application.GetScene().Add( landscapeView );
// Test "viewPageSize" property
DALI_TEST_CHECK( landscapeView.GetPropertyIndex("viewPageSize") == PageTurnView::Property::VIEW_PAGE_SIZE );
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
TestPageFactory factory;
- Vector2 size = Stage::GetCurrent().GetSize();
+ Vector2 size = application.GetScene().GetSize();
PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
portraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( portraitView );
+ application.GetScene().Add( portraitView );
// Render and notify
application.SendNotification();
*/
TestPageFactory factory;
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
PageTurnView landscapeView = PageTurnLandscapeView::New( factory, Vector2(stageSize.x*0.5f, stageSize.x*0.8f) );
landscapeView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( landscapeView );
+ application.GetScene().Add( landscapeView );
// Render and notify
application.SendNotification();
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
TestPageFactory factory( false /* returns empty handles */ );
- Vector2 size = Stage::GetCurrent().GetSize();
+ Vector2 size = application.GetScene().GetSize();
try
{
PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
portraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( portraitView );
+ application.GetScene().Add( portraitView );
tet_result(TET_FAIL);
}
// Create the Popup actor
Popup popup = Popup::New();
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
// Put in show state so it's layer is connected to popup (for ancestor check).
// Create the Popup actor
Popup popup = Popup::New();
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
// Put in show state so it's layer is connected to popup (for ancestor check).
popup.SetDisplayState( Popup::SHOWN );
// Create the Popup actor
Popup popup = Popup::New();
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
// Put in show state so it's layer is connected to popup (for ancestor check).
popup.SetDisplayState( Popup::SHOWN );
// Create the Popup actor
Popup popup = Popup::New();
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetProperty( Popup::Property::TAIL_VISIBILITY, false );
popup.SetDisplayState( Popup::SHOWN );
popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
popup.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.OutsideTouchedSignal().Connect( &OnPopupTouchedOutside );
popup.SetDisplayState( Popup::SHOWN );
DALI_TEST_CHECK( popup.GetProperty( Popup::Property::AUTO_HIDE_DELAY ).Get( getAutoHideDelay ) );
DALI_TEST_EQUALS( getAutoHideDelay, 200, TEST_LOCATION );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
Popup popup = Popup::New();
ConnectStateSignals( popup );
popup.SetTitle( TextLabel::New( "Title" ) );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
std::string animationModes[] = { "NONE", "ZOOM", "FADE", "CUSTOM" };
placement.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
placement.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
placement.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( placement );
+ application.GetScene().Add( placement );
placement.Add( popup );
// Create the Popup actor
Popup popup = Popup::New();
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
Actor backing = popup.FindChildByName( "popupBacking" );
DALI_TEST_CHECK( backing );
// Create the Popup actor
Popup popup = Popup::New();
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
// Check setting an image
popup.SetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE, "invalid-image.png" );
DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::EXIT_ANIMATION ).Get( resultMap ) );
DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetDisplayState( Popup::SHOWN );
for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
button.ClickedSignal().Connect( &PushButtonClicked );
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
button.Add( popup );
DALI_TEST_CHECK( popup.GetProperty( Popup::Property::TAIL_POSITION ).Get( vectorResult ) );
DALI_TEST_EQUALS( vectorResult, tailPosition, TEST_LOCATION );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetDisplayState( Popup::SHOWN );
application.SendNotification();
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 1.0f );
popup.SetTitle( Toolkit::TextLabel::New( "This is a Toast Popup.\nIt will auto-hide itself" ) );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetDisplayState( Toolkit::Popup::SHOWN );
for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
ConnectStateSignals( popup );
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetDisplayState( Toolkit::Popup::SHOWN );
application.SendNotification();
// Create the Popup actor
Popup popup = Popup::New();
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- Stage::GetCurrent().Add( popup );
+ application.GetScene().Add( popup );
popup.SetDisplayState( Popup::SHOWN );
application.SendNotification();
/*
- * Copyright (c) 2017 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.
// Create the ProgressBar actor
ProgressBar progressBar = ProgressBar::New();
- Stage::GetCurrent().Add( progressBar );
+ application.GetScene().Add( progressBar );
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
ProgressBar progressBar = ProgressBar::New();
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
- Stage::GetCurrent().Add(progressBar);
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
ProgressBar progressBar = ProgressBar::New();
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
- Stage::GetCurrent().Add(progressBar);
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.3f);
progressBar.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
- Stage::GetCurrent().Add(progressBar);
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
ProgressBar progressBar = ProgressBar::New();
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, Stage::GetCurrent().GetSize().y ) );
- Stage::GetCurrent().Add( progressBar );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, application.GetScene().GetSize().y ) );
+ application.GetScene().Add( progressBar );
application.SendNotification();
application.Render();
pushButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
pushButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
application.SendNotification();
application.Render();
pushButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
pushButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
application.SendNotification();
application.Render();
pushButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
pushButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
application.SendNotification();
application.Render();
pushButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
application.SendNotification();
application.Render();
pushButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
pushButton.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BEGIN" );
pushButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
// Add a label and get size of control
pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
PushButton pushButton = PushButton::New();
pushButton.SetProperty( Actor::Property::SIZE, Vector2( BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS ) );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
Property::Map propertyMap;
propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
tet_printf("Remove button from stage\n" );
- Stage::GetCurrent().Remove( pushButton );
+ application.GetScene().Remove( pushButton );
rendererCount = pushButton.GetRendererCount();
tet_printf("After removing pushbutton from stage the renderer count is(%d)\n ", rendererCount );
tet_printf("Added UNSELECTED_VISUAL and add button back to Stage\n");
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
tet_printf("With UNSELECTED_BACKGROUND_VISUAL and UNSELECTED_VISUAL the renderer count is(%d)\n", pushButton.GetRendererCount() );
pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
application.SendNotification();
application.Render(0);
tet_printf("RendererCount prior to adding visual(%d)\n",preRendererCount);
DALI_TEST_EQUALS( preRendererCount, 0, TEST_LOCATION );
- Stage::GetCurrent().Remove( pushButton );
+ application.GetScene().Remove( pushButton );
application.SendNotification();
application.Render(0);
colorMap.Insert(BorderVisual::Property::SIZE, 5.f);
pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, colorMap );
- Stage::GetCurrent().Add( pushButton );
+ application.GetScene().Add( pushButton );
application.SendNotification();
application.Render(0);
SetupButtonForTestTouchEvents( application, button, true );
- Stage::GetCurrent().Add( button );
+ application.GetScene().Add( button );
application.SendNotification();
application.Render();
/*
- * Copyright (c) 2017 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.
// Create the RadioButton actor
RadioButton radioButton = RadioButton::New();
- Stage::GetCurrent().Add( radioButton );
+ application.GetScene().Add( radioButton );
radioButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
radioButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
radioButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
radioButton3.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 40.0f ));
Actor radioGroup = Actor::New();
- Stage::GetCurrent().Add( radioGroup );
+ application.GetScene().Add( radioGroup );
radioGroup.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
radioGroup.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
radioGroup.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
float scrollBarHeight = 100.0f;
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
// Create another source actor
Actor newSourceActor = Actor::New();
- Stage::GetCurrent().Add( newSourceActor );
+ application.GetScene().Add( newSourceActor );
// Register the scroll properties
Property::Index newPropertyScrollPosition = newSourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect to the ScrollPositionIntervalReached signal
scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
float scrollBarHeight = 100.0f;
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
float scrollBarHeight = 100.0f;
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
scrollBar.SetIndicatorFixedHeight(50.0f);
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect the pan finished signal
ConnectionTracker connectionTracker;
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
scrollBar.SetIndicatorFixedHeight(50.0f);
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect the pan finished signal
ConnectionTracker connectionTracker;
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
ConnectionTracker connectionTracker;
// Connect to the ScrollPositionIntervalReached signal
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect to the ScrollPositionIntervalReached signal
scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
/*
- * 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.
// 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 );
/*
- * 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.
gOnScrollCompleteCalled = true;
}
-ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
+ScrollView SetupTestScrollView(Integration::Scene scene, int rows, int columns, Vector2 size)
{
Constraint constraint;
scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
- Stage::GetCurrent().Add( scrollView );
+ scene.Add( scrollView );
RulerPtr rulerX = CreateRuler(size.width);
RulerPtr rulerY = CreateRuler(size.height);
if(columns > 1)
scrollView.SetRulerX( rulerX );
scrollView.SetRulerY( rulerY );
- Stage::GetCurrent().Add( scrollView );
+ scene.Add( scrollView );
Actor container = Actor::New();
container.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
ToolkitTestApplication application;
tet_infoline(" UtcDaliScrollViewPagePathEffectTest");
- Vector2 size = Stage::GetCurrent().GetSize();
+ Vector2 size = application.GetScene().GetSize();
- ScrollView scrollView = SetupTestScrollView(1, 3, size);
+ ScrollView scrollView = SetupTestScrollView(application.GetScene(), 1, 3, size);
Actor testPage = gPages[2];
Wait(application, 500);
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
Toolkit::ShadowView view = Toolkit::ShadowView::New();
DALI_TEST_CHECK( view );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, Stage::GetCurrent().GetSize());
+ view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
view.Activate();
- RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
view.Deactivate();
- RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList3 = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
END_TEST;
}
/*
- * 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.
// Create the Popup actor
Slider slider = Slider::New();
- Stage::GetCurrent().Add( slider );
+ application.GetScene().Add( slider );
slider.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
slider.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ slider.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
slider.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
const float MIN_BOUND = 0.0f;
// Create the Popup actor
Slider slider = Slider::New();
- Stage::GetCurrent().Add( slider );
+ application.GetScene().Add( slider );
slider.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
slider.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ slider.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
slider.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
const float MIN_BOUND = 0.0f;
Slider slider = Slider::New();
slider.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
slider.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ slider.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
slider.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- Stage::GetCurrent().Add(slider);
+ application.GetScene().Add(slider);
application.SendNotification();
application.Render();