/*
- * 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 );
bool& refObjectDestroyedBoolean;
};
-ObjectDestructionTracker::ObjectDestructionTracker()
- :mRefObjectDestroyed( false)
+ObjectDestructionTracker::ObjectDestructionTracker( ObjectRegistry objectRegistry )
+: mObjectRegistry( objectRegistry ),
+ mRefObjectDestroyed( false)
{
}
void ObjectDestructionTracker::Start( Actor actor )
{
ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
-
- ObjectRegistry objectRegistry = Stage::GetCurrent().GetObjectRegistry();
- objectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
+ mObjectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
}
bool ObjectDestructionTracker::IsDestroyed()
/**
* @brief Call in main part of code
+ * @param[in] objectRegistry The object Registry being used
*/
- ObjectDestructionTracker();
+ ObjectDestructionTracker( ObjectRegistry objectRegistry );
/**
* @brief Call in sub bock of code where the Actor being checked is still alive.
bool IsDestroyed();
private:
+ ObjectRegistry mObjectRegistry;
bool mRefObjectDestroyed;
};
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/base-object.h>
#include <dali/integration-api/adaptor-framework/adaptor.h>
// EXTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/base-object.h>
#define DALI_WINDOW_H
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.
{
ToolkitTestApplication application;
- //Te ensure the object is registered after creation
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ //To ensure the object is registered after creation
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
{
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);
ToolkitTestApplication application;
TestGlAbstraction& gl = application.GetGlAbstraction();
- tet_infoline( "Test that the animated visual still works with zero sized cache" );
+ tet_infoline( "Test that the animated visual has different batch and cache size." );
{
Property::Array urls;
Property::Map propertyMap;
propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 2);
+ propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 0);
+ propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 0);
propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
VisualFactory factory = VisualFactory::Get();
Visual::Base visual = factory.CreateVisual( propertyMap ); // TexMgr::Request load tId:0
- // Expect that each image is loaded each tick
+ // Check the batch size and cache size need to have minimum 2.
+ Property::Map resultMap;
+ visual.CreatePropertyMap( resultMap );
+ Property::Value* value = resultMap.Find( ImageVisual::Property::BATCH_SIZE, "batchSize" );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<int>(), 2, TEST_LOCATION );
+ value = resultMap.Find( ImageVisual::Property::CACHE_SIZE, "cacheSize" );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<int>(), 2, TEST_LOCATION );
+ visual.Reset();
+
+ // Batch size is 2 and cache size is 3
+ propertyMap.Clear();
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
+ propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
+ propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2);
+ propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 3);
+ propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+
+ visual = factory.CreateVisual( propertyMap ); // TexMgr::Request load tId:0
+ // Expect that each image is loaded each tick
DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ Impl::DummyControl& dummyImpl1 = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ visual.Reset();
dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render(16);
- tet_infoline( "Ready the visual after the visual is on stage" );
+ tet_infoline( "Ready the visual after the visual is on window" );
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ application.SendNotification();
+ application.Render(16);//glGenTextures 1 and 2
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 2, TEST_LOCATION );
+
+ tet_infoline( "Test that each tick, a new image is requested" );
+ Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:0
+ application.SendNotification();
+ application.Render(16);
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ application.SendNotification();
+ application.Render(16);//glGenTextures 3
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+
+ tet_infoline( "Test that each tick, a new image is requested" );
+ Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:1
+ application.SendNotification();
+ application.Render(16);
DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
application.SendNotification();
- application.Render(16);//glGenTextures 1
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+ application.Render(16);//glGenTextures 4
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+
+ dummyImpl1.UnregisterVisual( DummyControl::Property::TEST_VISUAL );
+ dummyControl.Unparent();
+
+
+ // Batch size is 9 and cache size is 4
+ propertyMap.Clear();
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
+ propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
+ propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 3);
+ propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 7);
+ propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+
+ visual = factory.CreateVisual( propertyMap ); // TexMgr::Request load tId:0
+
+ // Expect that each image is loaded each tick
+ dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ visual.Reset();
+
+ dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ application.GetScene().Add( dummyControl );
+ application.SendNotification();
+ application.Render(16);
+
+ tet_infoline( "Ready the visual after the visual is on window" );
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ application.SendNotification();
+ application.Render(16);//glGenTextures 1, 2, and 3
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
tet_infoline( "Test that each tick, a new image is requested" );
Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:0
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, 10 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
application.SendNotification();
- application.Render(16);//glGenTextures 2
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+ application.Render(16);//glGenTextures 4, 5, and 6
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 5, TEST_LOCATION );
tet_infoline( "Test that each tick, a new image is requested" );
- Test::EmitGlobalTimerSignal(); // Internal::~TextureSet()
+ Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:1
application.SendNotification();
- application.Render(16);//glDeleteTextures 2
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, 10 ), true, TEST_LOCATION );
+ application.Render(16);
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
application.SendNotification();
- application.Render(16);//glGenTextures 3
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+ application.Render(16);//glGenTextures 7, 1, and 2
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 7, TEST_LOCATION );
tet_infoline( "Test that each tick, a new image is requested" );
- Test::EmitGlobalTimerSignal();
+ Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:2
application.SendNotification();
- application.Render(16);//glDeleteTextures 3
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, 10 ), true, TEST_LOCATION );
+ application.Render(16);
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
application.SendNotification();
- application.Render(16);//Gen4
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+ application.Render(16);//glGenTextures 3
+ DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 7, TEST_LOCATION );
+
dummyControl.Unparent();
}
- tet_infoline("Test that removing the visual from stage deletes all textures");
+ tet_infoline("Test that removing the visual from window deletes all textures");
application.SendNotification();
application.Render(16);
DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
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.
DALI_TEST_CHECK( emitter );
// Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect( &TestCallback );
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( popup2 == popup );
// Additional check to ensure object is created by checking if it's registered.
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
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;
// Ensure the object is registered after creation
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
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;
}
{
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker;
+ Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
{
DummyControl dummy = DummyControl::New();
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();
{
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker;
+ Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
{
Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
{
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker;
+ Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
{
Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
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;
tet_infoline("Test that the control wrapper's visuals can be animated by name when registered");
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker;
+ Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
{
Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
// 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
waveEffect.Reset();
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
crossEffect.Reset();
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
foldEffect.Reset();
//Additional check to ensure object is created by checking if it is registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
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.
// Position elements in a Column
flexNode->SetFlexDirection(Flex::FlexDirection::COLUMN);
- tet_infoline("Justify to the Start, align to start");
+ tet_infoline("Justify to the Start, align to start, third item should be displayed at the top and the end");
flexNode->SetFlexJustification(Flex::Justification::FLEX_START);
flexNode->SetFlexItemsAlignment( Flex::Alignment::FLEX_START );
- // Create two actors and add them to the parent flex node
+ // Create three actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
+ Actor actor3 = Actor::New();
DALI_TEST_CHECK( actor1 );
DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK( actor3 );
DALI_TEST_EQUALS( (int)flexNode->GetFlexJustification(), (int)Flex::Justification::FLEX_START, TEST_LOCATION );
DALI_TEST_EQUALS( (int)flexNode->GetFlexItemsAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION );
flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ Flex::Node* actor3node = flexNode->AddChild(actor3, Extents(0,0,0,0), &MeasureChild, 2);
+ actor3node->SetFlexAlignmentSelf( Flex::Alignment::FLEX_END );
flexNode->CalculateLayout(480, 800, false);
Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+ tet_printf("Actor 3 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor3Frame.x, actor3Frame.y, actor3Frame.z, actor3Frame.w);
/*
---------
|1 |
|2 |
- | |
+ | 3|
| |
| |
---------
DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height *2 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor3Frame, Vector4( root.z - ITEM_SIZE.width, ITEM_SIZE.height *2, root.z, ITEM_SIZE.height *3 ), TEST_LOCATION );
- tet_infoline(" Justify to the End, items should now be displayed at the bottom");
+ tet_infoline(" Justify to the End, items should now be displayed at the bottom, third item should now be displayed at the end");
flexNode->SetFlexJustification( Flex::Justification::FLEX_END );
flexNode->SetFlexItemsAlignment( Flex::Alignment::FLEX_START );
root = flexNode->GetNodeFrame(-1); // -1 is the root
actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+ tet_printf("Actor 3 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor3Frame.x, actor3Frame.y, actor3Frame.z, actor3Frame.w);
/*
---------
| |
| |
- | |
|1 |
|2 |
+ | 3|
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, root.w - (ITEM_SIZE.height*2), ITEM_SIZE.width, root.w - ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, root.w - ITEM_SIZE.height, ITEM_SIZE.width, root.w ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, root.w - (ITEM_SIZE.height*3), ITEM_SIZE.width, root.w - (ITEM_SIZE.height*2) ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, root.w - (ITEM_SIZE.height*2), ITEM_SIZE.width, root.w - ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor3Frame, Vector4( root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w ), TEST_LOCATION );
tet_infoline(" Align to End, items should now be displayed at the bottom and the end");
flexNode->SetFlexJustification( Flex::Justification::FLEX_END );
root = flexNode->GetNodeFrame(-1); // -1 is the root
actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+ tet_printf("Actor 3 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor3Frame.x, actor3Frame.y, actor3Frame.z, actor3Frame.w);
/*
---------
| |
| |
- | |
| 1|
| 2|
+ | 3|
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height*2), root.z, root.w - ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor1Frame, Vector4( root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height*3), root.z, root.w - (ITEM_SIZE.height*2) ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2Frame, Vector4( root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height*2), root.z, root.w - ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor3Frame, Vector4( root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w ), TEST_LOCATION );
END_TEST;
}
END_TEST;
}
+
+int UtcDaliToolkitFlexNodeFlexPositionType(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitFlexNodeFlexPositionType");
+ Flex::Node* flexNode = new Flex::Node();
+ DALI_TEST_CHECK( flexNode );
+
+ tet_infoline(" FlexPositionType is RELATIVE by default");
+
+ // Create two actors and add them to the parent flex node
+ Actor actor1 = Actor::New();
+ Actor actor2 = Actor::New();
+ DALI_TEST_CHECK( actor1 );
+ DALI_TEST_CHECK( actor2 );
+
+ flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
+ Flex::Node* actor2node = flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+
+ DALI_TEST_EQUALS( (int)actor2node->GetFlexPositionType(), (int)Flex::PositionType::RELATIVE, TEST_LOCATION );
+
+ flexNode->CalculateLayout(480, 800, false);
+
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+
+ tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
+
+ tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
+ tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+
+ /*
+ ---------
+ |1 |
+ |2 |
+ | |
+ | |
+ | |
+ ---------
+ */
+
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height *2 ), TEST_LOCATION );
+
+ tet_infoline(" ABSOLUTE FlexPositionType, second item should now be ignore any properties");
+ actor2node->SetFlexPositionType( Flex::PositionType::ABSOLUTE );
+
+ // Recalulate layout
+ flexNode->CalculateLayout(480, 800, false);
+
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+
+ tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
+
+ tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
+ tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+
+ /*
+ ---------
+ |1(2) |
+ | |
+ | |
+ | |
+ | |
+ ---------
+ */
+
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitFlexNodeFlexAspectRatio(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitFlexNodeFlexAspectRatio");
+ Flex::Node* flexNode = new Flex::Node();
+ DALI_TEST_CHECK( flexNode );
+
+ // Create a actor and add them to the parent flex node
+ Actor actor1 = Actor::New();
+ DALI_TEST_CHECK( actor1 );
+
+ tet_infoline(" 1.0 FlexAspectRatio");
+ Flex::Node* actor1node = flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
+ actor1node->SetFlexAspectRatio(1.0);
+
+ DALI_TEST_EQUALS( actor1node->GetFlexAspectRatio(), 1.0f, TEST_LOCATION );
+
+ flexNode->CalculateLayout(480, 800, false);
+
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+
+ tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
+
+ tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
+
+ /*
+ ---------
+ |--- |
+ ||1| |
+ |--- |
+ | |
+ | |
+ ---------
+ */
+
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+
+ tet_infoline(" 2.0 FlexAspectRatio");
+ actor1node->SetFlexAspectRatio(2.0);
+
+ DALI_TEST_EQUALS( actor1node->GetFlexAspectRatio(), 2.0f, TEST_LOCATION );
+
+ // Recalulate layout
+ flexNode->CalculateLayout(480, 800, false);
+
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+
+ tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
+
+ tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
+
+ /*
+ ---------
+ |------ |
+ || 1 | |
+ |------ |
+ | |
+ | |
+ ---------
+ */
+
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width*2, ITEM_SIZE.height ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitFlexNodeFlexBasisShrinkGrow(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitFlexNodeFlexBasisShrinkGrow");
+ Flex::Node* flexNode = new Flex::Node();
+ DALI_TEST_CHECK( flexNode );
+
+ // Position elements as a Row
+ flexNode->SetFlexDirection(Flex::FlexDirection::ROW);
+
+ // Create three actors and add them to the parent flex node
+ Actor actor1 = Actor::New();
+ Actor actor2 = Actor::New();
+ Actor actor3 = Actor::New();
+ DALI_TEST_CHECK( actor1 );
+ DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK( actor3 );
+
+ Flex::Node* actor1node = flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
+ Flex::Node* actor2node = flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ Flex::Node* actor3node = flexNode->AddChild(actor3, Extents(0,0,0,0), &MeasureChild, 2);
+
+ float basis = 5;
+
+ actor1node->SetFlexGrow(0.0);
+ actor2node->SetFlexGrow(0.0);
+ actor3node->SetFlexGrow(0.0);
+ actor1node->SetFlexShrink(1.0);
+ actor2node->SetFlexShrink(1.0);
+ actor3node->SetFlexShrink(1.0);
+ actor1node->SetFlexBasis(basis);
+ actor2node->SetFlexBasis(basis);
+ actor3node->SetFlexBasis(basis);
+
+ DALI_TEST_EQUALS( actor1node->GetFlexGrow(), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor1node->GetFlexShrink(), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor1node->GetFlexBasis(), basis, TEST_LOCATION );
+
+ flexNode->CalculateLayout(600, 200, false);
+
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+
+ tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
+
+ tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
+ tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+ tet_printf("Actor 3 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor3Frame.x, actor3Frame.y, actor3Frame.z, actor3Frame.w);
+
+ /*
+ -------------------
+ ||1||2||3| |
+ | |
+ -------------------
+ */
+
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, basis, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2Frame, Vector4( basis, 0.0f, basis*2, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor3Frame, Vector4( basis*2, 0.0f, basis*3, ITEM_SIZE.height ), TEST_LOCATION );
+
+
+ actor2node->SetFlexGrow(1.0);
+ actor3node->SetFlexGrow(1.0);
+
+ // Recalulate layout
+ flexNode->CalculateLayout(605, 200, false);
+
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+
+ tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
+
+ tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
+ tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
+ tet_printf("Actor 3 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor3Frame.x, actor3Frame.y, actor3Frame.z, actor3Frame.w);
+
+ /*
+ -------------------
+ ||1|| 2 || 3 ||
+ | |
+ -------------------
+ */
+
+ DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, basis, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2Frame, Vector4( basis, 0.0f, basis + (root.z-basis)/2, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor3Frame, Vector4( basis + (root.z-basis)/2, 0.0f, root.z, ITEM_SIZE.height ), TEST_LOCATION );
+
+ 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 ) );
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);
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
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.
DALI_TEST_CHECK( portraitView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
DALI_TEST_CHECK( landscapeView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
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);
}
DALI_TEST_CHECK( popup2 == popup );
// Additional check to ensure object is created by checking if it's registered.
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the 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.
DALI_TEST_CHECK( progressBar3 == progressBar2 );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the 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.
DALI_TEST_CHECK( radioButton2 == radioButton );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the 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.
DALI_TEST_CHECK( scrollView2 == scrollView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the ScrollView actor
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
const Vector2 target = Vector2(100.0f, 200.0f);
const Vector2 target2 = Vector2(300.0f, 100.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
// Create the ScrollView actor
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
const Vector2 target = Vector2(100.0f, 200.0f);
const Vector2 target2 = Vector2(300.0f, 100.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
tet_infoline(" UtcDaliToolkitScrollViewScrollToPageP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 50.0f, 0.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 0.0f, 50.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 0.0f, 50.0f );
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
Vector2 START_POSITION = Vector2(10.0f, 10.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
tet_infoline(" UtcDaliToolkitScrollViewScrollToActorP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
Actor actorA = Actor::New();
const Vector3 positionA = Vector3(100.0f, 400.0f, 0.0f);
tet_infoline(" UtcDaliToolkitScrollViewScrollToSnapPointP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
tet_infoline(" UtcDaliToolkitScrollViewSetWrapModeP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
Actor actor = Actor::New();
scrollView.Add( actor );
tet_infoline(" UtcDaliToolkitScrollViewActorAutoSnap");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
DALI_TEST_CHECK(scrollUpdated);
DALI_TEST_CHECK(scrollCompleted);
- Stage::GetCurrent().Remove( scrollView );
+ application.GetScene().Remove( scrollView );
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
scrollView.SetOvershootEnabled(true);
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollView.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, overshootSize );
DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, TEST_LOCATION );
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
tet_infoline(" UtcDaliToolkitScrollViewGetCurrentPageP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
RulerPtr rulerY = new FixedRuler( 100.0f );
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
tet_infoline(" UtcDaliToolkitScrollViewSetRulerXP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerX = new FixedRuler( 100.0f );
rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
tet_infoline(" UtcDaliToolkitScrollViewSetRulerYP");
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
RulerPtr rulerY = new FixedRuler( 200.0f );
rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ application.GetScene().Add( scrollView );
+ Vector2 stageSize = application.GetScene().GetSize();
scrollView.SetProperty( Actor::Property::SIZE, stageSize);
scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
scrollView.SetWrapMode( false );
scrollView.SetScrollSensitive( true );
- Stage::GetCurrent().Add( scrollView );
+ application.GetScene().Add( scrollView );
// Set up a gesture to perform.
Vector2 startPos( 50.0f, 0.0f );
/*
- * 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.
DALI_TEST_CHECK( slider2 == slider );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the 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();
/*
- * 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( blurView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
Texture inputTexture = CreateSolidColorTexture( application, Color::GREEN, 50, 50 );
blurView.SetTexture( inputTexture );
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
{
// create renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
+ application.GetScene().Add( blurView );
Wait(application);
DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
Wait(application);
- Stage::GetCurrent().Remove( blurView );
+ application.GetScene().Remove( blurView );
}
END_TEST;
int UtcDaliSuperBlurViewSetTexture2(void)
{
ToolkitTestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" UtcDaliSuperBlurViewSetTexture2 - test setting a second texture ");
blurView.SetTexture( inputTexture );
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
{
// create renderers for the original image and each blurred image
stage.Add( blurView );
Wait(application, 1000);
tet_infoline("Remove from stage");
- Stage::GetCurrent().Remove( blurView );
+ application.GetScene().Remove( blurView );
}
tet_infoline("Test that there are no render tasks remaining");
Texture inputTexture2 = CreateSolidColorTexture( application, Color::CYAN, 50, 50 );
blurView.SetTexture( inputTexture2 );
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
{
// create renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
+ application.GetScene().Add( blurView );
Wait(application);
DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
Wait(application, 1000);
tet_infoline("Remove from stage");
- Stage::GetCurrent().Remove( blurView );
+ application.GetScene().Remove( blurView );
}
tet_infoline("Test that there are no render tasks remaining");
SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
// create renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
+ application.GetScene().Add( blurView );
blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
// Will create ResourceImage
// start multiple guassian blur call, each guassian blur creates two render tasks
- unsigned int count = Stage::GetCurrent().GetRenderTaskList().GetTaskCount();
+ unsigned int count = application.GetScene().GetRenderTaskList().GetTaskCount();
DALI_TEST_CHECK( count == 1+BLUR_LEVELS*2 );
Wait(application);
Wait(application);
// create renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
+ application.GetScene().Add( blurView );
std::string imageUrl = blurView.GetProperty<std::string>( SuperBlurView::Property::IMAGE_URL );
DALI_TEST_EQUALS( imageUrl, TEST_IMAGE_FILE_NAME, TEST_LOCATION );
Texture inputTexture = CreateSolidColorTexture( application, Color::GREEN, 50, 50 );
blurView.SetTexture( inputTexture );
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
SignalHandler signalHandler;
blurView.BlurFinishedSignal().Connect(&signalHandler, &SignalHandler::Callback);
// create renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
+ application.GetScene().Add( blurView );
Wait(application, 1000);
DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
};
// Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
-static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
+static void SetupTableViewAndActors(Integration::Scene scene, TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
{
tableView = TableView::New( 10, 10 ); // 10 by 10 grid.
DALI_TEST_CHECK( tableView );
- Stage::GetCurrent().Add( tableView );
+ scene.Add( tableView );
tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
actor1 = Actor::New();
DALI_TEST_CHECK(tableView);
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
Actor actor2;
Actor actor3;
- SetupTableViewAndActors(tableView, actor1, actor2, actor3);
+ SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
// 1. check that padding works. no padding:
tableView.SetCellPadding(Size(0.0f, 0.0f));
Actor actor2;
Actor actor3;
- SetupTableViewAndActors(tableView, actor1, actor2, actor3);
+ SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
Actor actor2;
Actor actor3;
- SetupTableViewAndActors(tableView, actor1, actor2, actor3);
+ SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
Actor actor2;
Actor actor3;
- SetupTableViewAndActors(tableView, actor1, actor2, actor3);
+ SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
// Create a 10x10 table-view
TableView tableView = TableView::New(10,10);
- Stage::GetCurrent().Add( tableView );
+ application.GetScene().Add( tableView );
tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
DALI_TEST_CHECK( tableView );
}
}
- Stage::GetCurrent().Add( tableView );
+ application.GetScene().Add( tableView );
application.SendNotification();
application.Render();
}
}
- Stage::GetCurrent().Add( tableView );
+ application.GetScene().Add( tableView );
application.SendNotification();
application.Render();
tet_infoline(" UtcDaliToolkitTextEditorSetPropertyP");
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
// Note - we can't check the defaults since the stylesheets are platform-specific
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
try
{
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
// connect to the text changed signal.
ConnectionTracker* testTracker = new ConnectionTracker();
bool inputStyleChangedSignal = false;
editor.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
// Render and notify
application.SendNotification();
bool inputStyleChangedSignal = false;
editor.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
// Render and notify
application.SendNotification();
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
editor2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
editor2.SetProperty( Actor::Property::POSITION, Vector2( 100.f, 100.f ));
- Stage::GetCurrent().Add( editor2 );
+ application.GetScene().Add( editor2 );
// Render and notify
application.SendNotification();
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "This is a long text for the size of the text-editor." );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworl" );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworl" );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "DALi" );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::TEXT, "This is a long text for the size of the text-editor." );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
std::string underlineSettings1( "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}" );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::UNDERLINE, underlineSettings1 );
DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::UNDERLINE ), underlineSettings1, TEST_LOCATION );
std::string shadowSettings( "{\"color\":\"green\",\"offset\":\"2 2\",\"blurRadius\":\"0\"}" );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::SHADOW, "{\"color\":\"green\",\"offset\":\"2 2\",\"blurRadius\":\"0\"}" );
std::string fontStyleSettings( "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
editor.SetProperty( TextEditor::Property::TEXT,
"TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST ");
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
lineCount = editor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
TextEditor editor = TextEditor::New();
DALI_TEST_CHECK( editor );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
editor.SetProperty( Actor::Property::SIZE, Vector2( 50.f, 50.f ) );
editor.SetProperty( Actor::Property::SIZE, Vector2( 150.0f, 300.f ) );
editor.SetProperty( TextEditor::Property::TEXT, "Hello world Hello world" );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
editor.SetProperty( TextEditor::Property::LINE_WRAP_MODE, "WORD" );
DALI_TEST_EQUALS( editor.GetProperty< int >( TextEditor::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
application.SendNotification();
application.Render();
editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
application.SendNotification();
application.Render();
editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
application.SendNotification();
application.Render();
editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( editor );
+ application.GetScene().Add( editor );
application.SendNotification();
application.Render();
tet_infoline(" UtcDaliToolkitTextFieldSetPropertyP");
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
// Note - we can't check the defaults since the stylesheets are platform-specific
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
try
{
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
// connect to the text changed signal.
ConnectionTracker* testTracker = new ConnectionTracker();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
// connect to the text changed signal.
ConnectionTracker* testTracker = new ConnectionTracker();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
const int maxNumberOfCharacters = 1;
field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters );
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
const int maxNumberOfCharacters = 3;
field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters );
bool inputStyleChangedSignal = false;
field.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
// Render and notify
application.SendNotification();
bool inputStyleChangedSignal = false;
field.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
field2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
field2.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
- Stage::GetCurrent().Add( field2 );
+ application.GetScene().Add( field2 );
// Render and notify
application.SendNotification();
DALI_TEST_CHECK( field );
LoadMarkerImages(application, field);
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
Wait(application, 500);
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Layer layer = stage.GetRootLayer();
Actor actor = layer.FindChildByName("optionPaste");
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
// Checks some special keys when the text is selected.
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
float previousHeight = 0.0f;
float currentHeight = 0.0f;
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
try
{
tet_infoline("UtcDaliTextFieldFontStylePorpertyCoverage");
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
Property::Map fontStyleMapGet;
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
// Check the placeholder property with pixel size
Property::Map placeholderPixelSizeMapSet;
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
application.SendNotification();
application.Render();
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
application.SendNotification();
application.Render();
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
application.SendNotification();
application.Render();
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
application.SendNotification();
application.Render();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
+ application.GetScene().Add( field );
field.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
TextField textField = TextField::New();
- Stage::GetCurrent().Add( textField );
+ application.GetScene().Add( textField );
textField.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
textField.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
TextField textField = TextField::New();
- Stage::GetCurrent().Add( textField );
+ application.GetScene().Add( textField );
textField.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
textField.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
TextLabel label = TextLabel::New();
DALI_TEST_CHECK( label );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
// Note - we can't check the defaults since the stylesheets are platform-specific
label.SetProperty( DevelTextLabel::Property::RENDERING_BACKEND, DevelText::RENDERING_SHARED_ATLAS );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
// Turn on all the effects
label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
TextLabel label = TextLabel::New();
DALI_TEST_CHECK( label );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
const std::string scripts( " привет мир, γειά σου Κόσμε, Hello world, مرحبا بالعالم, שלום עולם, "
"բարեւ աշխարհը, მსოფლიოში, 안녕하세요, 你好世界, ひらがな, カタカナ, "
TextLabel label = TextLabel::New();
DALI_TEST_CHECK( label );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
DALI_TEST_CHECK( labelFinished );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( labelImmediate );
+ application.GetScene().Add( labelImmediate );
// Turn on all the effects
labelImmediate.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
- Stage::GetCurrent().Add( labelFinished );
+ application.GetScene().Add( labelFinished );
// Turn on all the effects
labelFinished.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
DALI_TEST_CHECK( labelLong );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( labelShort );
+ application.GetScene().Add( labelShort );
// Turn on all the effects
labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
- Stage::GetCurrent().Add( labelLong );
+ application.GetScene().Add( labelLong );
// Turn on all the effects
labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
DALI_TEST_CHECK( labelLong );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( labelShort );
+ application.GetScene().Add( labelShort );
// Turn on all the effects
labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
- Stage::GetCurrent().Add( labelLong );
+ application.GetScene().Add( labelLong );
// Turn on all the effects
labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
DALI_TEST_CHECK( labelLong );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( labelShort );
+ application.GetScene().Add( labelShort );
// Turn on all the effects
labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
- Stage::GetCurrent().Add( labelLong );
+ application.GetScene().Add( labelLong );
// Turn on all the effects
labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
DALI_TEST_CHECK( labelLong );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( labelShort );
+ application.GetScene().Add( labelShort );
// Turn on all the effects
labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
- Stage::GetCurrent().Add( labelLong );
+ application.GetScene().Add( labelLong );
// Turn on all the effects
labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
DALI_TEST_CHECK( label );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
label.SetProperty( Actor::Property::SIZE, Vector2( 360.0f, 20.f ) );
// Turn on all the effects
label.SetProperty( TextLabel::Property::MULTI_LINE, false );
TextLabel label = TextLabel::New("Some text to scroll");
DALI_TEST_CHECK( label );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
TextLabel label = TextLabel::New("Some text to scroll");
DALI_TEST_CHECK( label );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
// Turn on all the effects
label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
//label.SetProperty( TextLabel::Property::POINT_SIZE, 18 );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WORD" );
DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
drawTrace.Enable( true );
label.SetProperty( Actor::Property::SIZE, Vector2( 300.0f, 300.f ) );
label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
label.SetProperty( TextLabel::Property::POINT_SIZE, 12 );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
Property::Map outlineMapSet;
Property::Map outlineMapGet;
label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world Hello world Hello world" );
label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
label.SetProperty( TextLabel::Property::MULTI_LINE, false );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
application.SendNotification();
application.Render();
label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
// Test LTR text
DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
label.SetProperty( TextLabel::Property::POINT_SIZE, 15 );
label.SetProperty( TextLabel::Property::LINE_SPACING, 12 );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::TOP ), TEST_LOCATION );
label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::MIDDLE );
// The text has been laid out with the bitmap font if the natural size is the sum of all the width (322) and 34 height.
DALI_TEST_EQUALS( label.GetNaturalSize(), Vector3(322.f, 34.f, 0.f), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
application.SendNotification();
application.Render();
label.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMapSet );
label.SetProperty( TextLabel::Property::POINT_SIZE, 120.f);
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
application.SendNotification();
application.Render();
label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
- Stage::GetCurrent().Add( label );
+ application.GetScene().Add( label );
application.SendNotification();
application.Render();
TextSelectionToolbar toolbar = TextSelectionToolbar::New();
DALI_TEST_CHECK( toolbar );
- Stage::GetCurrent().Add( toolbar );
+ application.GetScene().Add( toolbar );
Property::Map map;
map["overshootEffectColor"] = Color::RED;
/*
- * 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.
DALI_TEST_CHECK( toggleButton2 == toggleButton );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
// Create the ToggleButton actor
ToggleButton toggleButton = ToggleButton::New();
- Stage::GetCurrent().Add( toggleButton );
+ application.GetScene().Add( toggleButton );
toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
toggleButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
// Create the ToggleButton actor
ToggleButton toggleButton = ToggleButton::New();
- Stage::GetCurrent().Add( toggleButton );
+ application.GetScene().Add( toggleButton );
toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
toggleButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
// Create the ToggleButton actor
ToggleButton toggleButton = ToggleButton::New();
- Stage::GetCurrent().Add( toggleButton );
+ application.GetScene().Add( toggleButton );
toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
toggleButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
/*
- * 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.
DALI_TEST_CHECK( toolbar2 == toolbar );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
/*
- * 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.
control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
- Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
Dali::Timer timer = Timer::New( 1u );
.Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ))
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
- Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
Dali::Timer timer = Timer::New( 1u );
.Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ))
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
- Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
Dali::Timer timer = Timer::New( 1u );
.Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
application.Render();
- Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
Dali::Timer timer = Timer::New( 1u );
.Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
application.Render();
- Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
Dali::Timer timer = Timer::New( 1u );
.Add( Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
application.Render();
- const Vector2 stageSize = Stage::GetCurrent().GetSize();
+ const Vector2 stageSize = application.GetScene().GetSize();
Vector2 hoverPoint = stageSize * 0.5f;
hoverPoint.x -= 10.0f;
hoverPoint.y -= 10.0f;
.Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
tet_infoline( "Start hover" );
- Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
application.SendNotification();
control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
tet_infoline( "Start hover" );
- Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
application.SendNotification();
control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
- Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
Dali::Timer timer = Timer::New( 1u );
.Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
- Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
Dali::Timer timer = Timer::New( 1u );
control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
int rootChildCount = rootActor.GetChildCount();
- Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f;
+ Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
tet_infoline( "Change content while timer is running and ensure it matches the new value" );
{
ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
tet_infoline( "Create a control and place it at the bottom of the screen, setting the tooltip to appear below" );
Control control = Control::New();
.Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
{
ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
tet_infoline( "Create a control and place it at the top of the screen, setting the tooltip to appear above" );
Control control = Control::New();
.Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE )
);
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
{
ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Vector2 centerPoint = stageSize * 0.5f;
tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the left of the screen" );
);
control.SetProperty( Actor::Property::POSITION_X, -centerPoint.x );
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
application.SendNotification();
{
ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Vector2 centerPoint = stageSize * 0.5f;
tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the right of the screen" );
);
control.SetProperty( Actor::Property::POSITION_X, centerPoint.x );
- Actor rootActor = Stage::GetCurrent().GetRootLayer();
+ Actor rootActor = application.GetScene().GetRootLayer();
rootActor.Add( control );
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.
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
DummyControl actor = DummyControl::New();
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
Animation anim = dummyImpl.CreateTransition( transition );
DummyControl actor = DummyControl::New();
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
Animation anim = dummyImpl.CreateTransition( transition );
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
Property::Map visualMap;
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
Property::Map visualMap;
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
Property::Map visualMap;
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(0), Vector3::ZAXIS), TEST_LOCATION);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
/*
- * 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.
Toolkit::VideoView view = Toolkit::VideoView::New();
DALI_TEST_CHECK( view );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
std::string file;
Property::Map map;
bool isUnderlay = videoView.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
DALI_TEST_CHECK( !isUnderlay );
- Stage::GetCurrent().Add( videoView );
+ application.GetScene().Add( videoView );
videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" );
Property::Map customShader;
windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
- Stage::GetCurrent().Add( videoView );
+ application.GetScene().Add( videoView );
application.SendNotification();
application.Render();
VideoView view = VideoView::New();
DALI_TEST_CHECK( view );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.Play();
application.SendNotification();
VideoView view = VideoView::New();
DALI_TEST_CHECK( view );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.Play();
application.SendNotification();
VideoView view = VideoView::New( true );
DALI_TEST_CHECK( view );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.Play();
application.SendNotification();
VideoView view2 = VideoView::New( "", false );
DALI_TEST_CHECK( view2 );
- Stage::GetCurrent().Add( view2 );
+ application.GetScene().Add( view2 );
view2.Play();
application.SendNotification();
VideoView view = VideoView::New();
DALI_TEST_CHECK( view );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.Play();
application.SendNotification();
bool isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
DALI_TEST_CHECK( !isUnderlay );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.SetProperty( VideoView::Property::VIDEO, "testvideo" );
/* insert custom shader */
view.SetProperty( VideoView::Property::VIDEO, map );
/* do render for check custom shader */
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
view.Play();
application.SendNotification();
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 );
int depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
// First on/off
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render(0);
auto textures = renderer.GetTextures();
DALI_TEST_CHECK( textures.GetTextureCount() != 0u );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
// Second on/off
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render(0);
textures = renderer.GetTextures();
DALI_TEST_CHECK( textures.GetTextureCount() != 0u );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
application.SendNotification();
application.Render(0);
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 1, TEST_LOCATION );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render( 0 );
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render( 0 );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
actor.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transform );
dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transformMap );
dummy.SetProperty( Actor::Property::SIZE, Vector2( 2000.f, 2000.f ) );
dummy.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
application.SendNotification();
Renderer renderer = dummy.GetRendererAt( 0 );
DummyControl control = DummyControl::New(true);
control.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
- Stage::GetCurrent().Add( control );
+ application.GetScene().Add( control );
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>( control.GetImplementation() );
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, opaqueGradientVisual );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
tet_infoline( "Add control with visual to stage and check renderer count is 1" );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 1, TEST_LOCATION );
tet_infoline( "Remove control with visual from stage and check renderer count is 0" );
- Stage::GetCurrent().Remove( dummyControl );
+ application.GetScene().Remove( dummyControl );
application.SendNotification();
application.Render();
tet_infoline( "Re-add control with visual to stage and check renderer count is still 1" );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
dummyControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
dummyControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000, TEST_LOCATION );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
END_TEST;
}
DALI_TEST_CHECK( testVisual2.GetDepthIndex() > testVisual1.GetDepthIndex() );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
END_TEST;
}
DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( dummyControl );
+ application.GetScene().Add( dummyControl );
END_TEST;
}
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();
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();
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();
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();
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();
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();
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( actualValue, Vector3(testColor), TEST_LOCATION );
DALI_TEST_EQUALS( actualColor.a, testColor.a, TEST_LOCATION );
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
visual = factory.CreateVisual( map );
dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION );
DummyControl actor = DummyControl::New(true);
TestVisualRender( application, actor, visual );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
Vector2 naturalSize( 0.0f, 0.0f );
visual.GetNaturalSize( naturalSize );
DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
}
visual.GetNaturalSize( naturalSize );
DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
}
visual.GetNaturalSize( naturalSize );
DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
}
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 );
actor.Unparent();
application.SendNotification();
dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transformMap );
dummy.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
dummy.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- Stage::GetCurrent().Add(dummy);
+ application.GetScene().Add(dummy);
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.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f) );
application.SendNotification();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Only rasterizes when it knows control size.
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- 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.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f) );
application.SendNotification();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) );
//Ensure set on stage.
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) );
//Ensure set on stage.
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) );
//Ensure set on stage.
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
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.
view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( view );
view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
application.SendNotification();
application.Render();
# Install the pdb file.
IF( ENABLE_DEBUG )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.pdb DESTINATION ${BIN_DIR} )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/${name}.pdb DESTINATION ${BIN_DIR} )
ENDIF()
ELSE()
# Install the library so file and symlinks
// EXTERNAL INCLUDES
#include <utility> // pair
#include <iterator>
+#include <string>
#include <dali-toolkit/public-api/dali-toolkit-common.h>
namespace Dali
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Destructor() <<\n");
}
-void Node::AddChild( Actor child, Extents margin, MeasureCallback measureFunction, int index )
+Node* Node::AddChild( Actor child, Extents margin, MeasureCallback measureFunction, int index )
{
if( child )
{
YGNodeInsertChild( mImpl->mYogaNode, childNode->mImpl->mYogaNode, index );
+ Node* result = childNode.get();
mImpl->mChildNodes.emplace_back( std::move(childNode) );
+
+ return result;;
}
+ return nullptr;
}
void Node::RemoveChild( Actor child )
return static_cast<Dali::Toolkit::Flex::Alignment>( YGNodeStyleGetAlignItems( mImpl->mYogaNode ));
}
+void Node::SetFlexAlignmentSelf( Dali::Toolkit::Flex::Alignment flexAlignmentSelf )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex alignment self [%d] on mYogaNode[%p]\n", flexAlignmentSelf, mImpl->mYogaNode )
+
+ YGNodeStyleSetAlignSelf( mImpl->mYogaNode, static_cast<YGAlign>(flexAlignmentSelf) );
+}
+
+Dali::Toolkit::Flex::Alignment Node::GetFlexAlignmentSelf() const
+{
+ return static_cast<Dali::Toolkit::Flex::Alignment>(YGNodeStyleGetAlignSelf( mImpl->mYogaNode ));
+}
+
+void Node::SetFlexPositionType( Dali::Toolkit::Flex::PositionType flexPositionType )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex position type [%d] on mYogaNode[%p]\n", flexPositionType, mImpl->mYogaNode )
+
+ YGNodeStyleSetPositionType( mImpl->mYogaNode, static_cast<YGPositionType>(flexPositionType) );
+}
+
+Dali::Toolkit::Flex::PositionType Node::GetFlexPositionType() const
+{
+ return static_cast<Dali::Toolkit::Flex::PositionType>(YGNodeStyleGetPositionType( mImpl->mYogaNode ));
+}
+
+void Node::SetFlexAspectRatio( float flexAspectRatio )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex aspect ratio [%d] on mYogaNode[%p]\n", flexAspectRatio, mImpl->mYogaNode )
+
+ YGNodeStyleSetAspectRatio( mImpl->mYogaNode, static_cast<float>(flexAspectRatio) );
+}
+
+float Node::GetFlexAspectRatio() const
+{
+ return static_cast<float>(YGNodeStyleGetAspectRatio( mImpl->mYogaNode ));
+}
+
+void Node::SetFlexBasis( float flexBasis )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex basis [%d] on mYogaNode[%p]\n", flexBasis, mImpl->mYogaNode )
+
+ YGNodeStyleSetFlexBasis( mImpl->mYogaNode, static_cast<float>(flexBasis) );
+}
+
+float Node::GetFlexBasis() const
+{
+ return static_cast<float>(YGNodeStyleGetFlexBasis( mImpl->mYogaNode ).value);
+}
+
+void Node::SetFlexShrink( float flexShrink )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex shrink [%d] on mYogaNode[%p]\n", flexShrink, mImpl->mYogaNode )
+
+ YGNodeStyleSetFlexShrink( mImpl->mYogaNode, static_cast<float>(flexShrink) );
+}
+
+float Node::GetFlexShrink() const
+{
+ return static_cast<float>(YGNodeStyleGetFlexShrink( mImpl->mYogaNode ));
+}
+
+void Node::SetFlexGrow( float flexGrow )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex grow [%d] on mYogaNode[%p]\n", flexGrow, mImpl->mYogaNode )
+
+ YGNodeStyleSetFlexGrow( mImpl->mYogaNode, static_cast<float>(flexGrow) );
+}
+
+float Node::GetFlexGrow() const
+{
+ return static_cast<float>(YGNodeStyleGetFlexGrow( mImpl->mYogaNode ));
+}
+
float Node::GetFlexWidth() const
{
float flexWidth = YGNodeLayoutGetWidth( mImpl->mYogaNode );
STRETCH ///< Stretch to fit the container
};
+/**
+ * @brief Enumeration for the position type of the flex item how it is positioned within its parent.
+ */
+enum class PositionType
+{
+ RELATIVE, ///< Flex items laid out relatively
+ ABSOLUTE ///< Flex items laid out absolutely
+};
/**
* Struct used for MeasureCallback
* @param[in] margin of child Actor.
* @param[in] measureFunction for the child.
* @param[in] index to insert at.
+ * @return child node pointer
*/
- void AddChild( Actor child, Extents margin, MeasureCallback measureFunction, int index );
+ Node* AddChild( Actor child, Extents margin, MeasureCallback measureFunction, int index );
/**
* @brief Remove child from the FlexLayout at the given index.
Alignment GetFlexItemsAlignment() const;
/**
+ * @brief Set the alignment self of the layout items.
+ * @param[in] flexAlignmentSelf The alignment self of the items.
+ */
+ void SetFlexAlignmentSelf( Alignment flexAlignmentSelf );
+
+ /**
+ * @brief Get the alignment self of the layout items.
+ * @return The flex items alignment self.
+ */
+ Alignment GetFlexAlignmentSelf() const;
+
+ /**
+ * @brief Set the position type of the layout items.
+ * @param[in] flexPositionType The position type of the items.
+ */
+ void SetFlexPositionType( PositionType flexPositionType );
+
+ /**
+ * @brief Get the position type of the layout items.
+ * @return The flex position type.
+ */
+ PositionType GetFlexPositionType() const;
+
+ /**
+ * @brief Set the aspect ratio of the layout items.
+ * @param[in] flexAspectRatio The aspect ratio of the items.
+ */
+ void SetFlexAspectRatio( float flexAspectRatio );
+
+ /**
+ * @brief Get the aspect ratio of the layout items.
+ * @return The flex aspect ratio.
+ */
+ float GetFlexAspectRatio() const;
+
+ /**
+ * @brief Set the basis of the layout items.
+ * @param[in] flexBasis The basis of the items.
+ */
+ void SetFlexBasis( float flexBasis );
+
+ /**
+ * @brief Get the basis of the layout items.
+ * @return The flex basis.
+ */
+ float GetFlexBasis() const;
+
+ /**
+ * @brief Set the shrink of the layout items.
+ * @param[in] flexShrink The shrink of the items.
+ */
+ void SetFlexShrink( float flexShrink );
+
+ /**
+ * @brief Get the shrink of the layout items.
+ * @return The flex shrink.
+ */
+ float GetFlexShrink() const;
+
+ /**
+ * @brief Set the grow of the layout items.
+ * @param[in] flexGrow The grow of the items.
+ */
+ void SetFlexGrow( float flexGrow );
+
+ /**
+ * @brief Get the grow of the layout items.
+ * @return The flex grow.
+ */
+ float GetFlexGrow() const;
+
+ /**
* @brief Set the margin.
* @param[in] margin The margin value.
*/
// EXTERNAL INCLUDES
#include <dali/public-api/actors/layer.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
/*
- * 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.
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/signals/functor-delegate.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#define DALI_TOOLKIT_INTERNAL_BUILDER_H
/*
- * 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.
#include <string>
#include <list>
#include <map>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/object/base-object.h>
/*
- * 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.
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/type-info.h>
#include <dali/public-api/object/property-notification.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
#include <limits>
/*
- * 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.
#include <iomanip>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#define DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H
/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/rendering/frame-buffer.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/rendering/geometry.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
#include <iomanip>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/rendering/geometry.h>
// EXTERNAL INCLUDES
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
/*
- * 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.
#include <dali/integration-api/debug.h>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/object/type-registry.h>
/*
- * 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.
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/object/type-registry.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/object/type-registry.h>
/*
- * 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.
#include <sstream>
#include <iomanip>
#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <cmath>
#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <cstring>
#include <limits>
#include <dali/public-api/adaptor-framework/key.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/object/property-helper-devel.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <cstring>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/devel-api/adaptor-framework/key-devel.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/object/property-helper-devel.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/public-api/object/type-registry-helper.h>
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/object/property-helper-devel.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/integration-api/debug.h>
/*
- * 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.
#include <dali/public-api/events/hover-event.h>
#include <dali/public-api/adaptor-framework/timer.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/scripting/enum-helper.h>
// INTERNAL INCLUDES
/*
- * 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.
#include <cstring>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/common/stage.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/integration-api/debug.h>
#include <cstring>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/scripting/scripting.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/integration-api/debug.h>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/object-registry.h>
#include <dali/devel-api/adaptor-framework/style-monitor.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <sstream>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/rendering/renderer.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <sstream>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/rendering/renderer.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/devel-api/common/singleton-service.h>
#include <dali/devel-api/adaptor-framework/lifecycle-controller.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/object/type-registry.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/common/stage.h>
-#include <dali/devel-api/common/stage-devel.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/adaptor-framework/timer.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/events/pan-gesture.h>
#include <dali/public-api/object/property-notification.h>
/*
- * 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.
#include <dali-toolkit/internal/text/text-scroller.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/integration-api/adaptor-framework/adaptor.h>
// EXTERNAL HEADERS
#include <cstring> // for strlen()
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/scripting/scripting.h>
/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
#include <dali/devel-api/scripting/enum-helper.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/common/constants.h>
#include <dali/devel-api/object/handle-devel.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
namespace Dali