From c01b6a044893962dbc4ec47aeca60bf3b5d09766 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Mon, 13 Jul 2020 19:10:36 +0100 Subject: [PATCH] (Automated Tests) Use Scene instead of Stage Change-Id: I2c703e035e338a0879c5ce71d88484d0b7dd9131 --- .../utc-Dali-Control-internal.cpp | 8 +- .../utc-Dali-DebugRendering.cpp | 28 ++--- .../utc-Dali-ItemView-internal.cpp | 4 +- .../utc-Dali-Text-Circular.cpp | 8 +- .../utc-Dali-Text-Controller.cpp | 26 ++--- .../utc-Dali-TextField-internal.cpp | 4 +- .../utc-Dali-Visuals-internal.cpp | 10 +- .../dali-toolkit-styling/utc-Dali-StyleManager.cpp | 52 ++++----- .../dali-toolkit/utc-Dali-AccessibilityManager.cpp | 64 +++++------ .../src/dali-toolkit/utc-Dali-Alignment.cpp | 108 +++++++++--------- .../dali-toolkit/utc-Dali-AnimatedImageVisual.cpp | 24 ++-- .../utc-Dali-AnimatedVectorImageVisual.cpp | 46 ++++---- .../src/dali-toolkit/utc-Dali-ArcVisual.cpp | 8 +- .../src/dali-toolkit/utc-Dali-BloomView.cpp | 16 +-- .../src/dali-toolkit/utc-Dali-BubbleEmitter.cpp | 10 +- .../src/dali-toolkit/utc-Dali-Builder.cpp | 60 +++++----- .../src/dali-toolkit/utc-Dali-Button.cpp | 16 +-- .../src/dali-toolkit/utc-Dali-CheckBoxButton.cpp | 6 +- .../dali-toolkit/utc-Dali-ConfirmationPopup.cpp | 10 +- .../src/dali-toolkit/utc-Dali-Control.cpp | 48 ++++---- .../src/dali-toolkit/utc-Dali-ControlImpl.cpp | 122 ++++++++++----------- .../src/dali-toolkit/utc-Dali-ControlWrapper.cpp | 16 +-- .../dali-toolkit/utc-Dali-CubeTransitionEffect.cpp | 38 +++---- .../dali-toolkit/utc-Dali-DragAndDropDetector.cpp | 28 ++--- .../src/dali-toolkit/utc-Dali-EffectsView.cpp | 22 ++-- .../src/dali-toolkit/utc-Dali-FlexContainer.cpp | 16 +-- .../src/dali-toolkit/utc-Dali-FlexNode.cpp | 2 +- .../src/dali-toolkit/utc-Dali-GaussianBlurView.cpp | 38 +++---- .../src/dali-toolkit/utc-Dali-ImageAtlas.cpp | 10 +- .../src/dali-toolkit/utc-Dali-ImageView.cpp | 110 +++++++++---------- .../src/dali-toolkit/utc-Dali-ImageVisual.cpp | 112 +++++++++---------- .../src/dali-toolkit/utc-Dali-ItemLayout.cpp | 14 +-- .../src/dali-toolkit/utc-Dali-ItemView.cpp | 38 +++---- .../dali-toolkit/utc-Dali-KeyInputFocusManager.cpp | 16 +-- .../dali-toolkit/utc-Dali-KeyboardFocusManager.cpp | 56 +++++----- .../src/dali-toolkit/utc-Dali-Magnifier.cpp | 12 +- .../src/dali-toolkit/utc-Dali-Model3dView.cpp | 10 +- .../src/dali-toolkit/utc-Dali-NavigationView.cpp | 10 +- .../src/dali-toolkit/utc-Dali-PageTurnView.cpp | 16 +-- .../src/dali-toolkit/utc-Dali-Popup.cpp | 32 +++--- .../src/dali-toolkit/utc-Dali-ProgressBar.cpp | 22 ++-- .../src/dali-toolkit/utc-Dali-PushButton.cpp | 26 ++--- .../src/dali-toolkit/utc-Dali-RadioButton.cpp | 6 +- .../src/dali-toolkit/utc-Dali-ScrollBar.cpp | 58 +++++----- .../src/dali-toolkit/utc-Dali-ScrollView.cpp | 94 ++++++++-------- .../src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp | 12 +- .../src/dali-toolkit/utc-Dali-ShadowView.cpp | 14 +-- .../src/dali-toolkit/utc-Dali-Slider.cpp | 14 +-- .../src/dali-toolkit/utc-Dali-SuperBlurView.cpp | 30 ++--- .../src/dali-toolkit/utc-Dali-TableView.cpp | 18 +-- .../src/dali-toolkit/utc-Dali-TextEditor.cpp | 50 ++++----- .../src/dali-toolkit/utc-Dali-TextField.cpp | 66 +++++------ .../src/dali-toolkit/utc-Dali-TextLabel.cpp | 54 ++++----- .../dali-toolkit/utc-Dali-TextSelectionPopup.cpp | 2 +- .../src/dali-toolkit/utc-Dali-ToggleButton.cpp | 8 +- .../src/dali-toolkit/utc-Dali-Tooltip.cpp | 62 +++++------ .../src/dali-toolkit/utc-Dali-TransitionData.cpp | 26 ++--- .../src/dali-toolkit/utc-Dali-VideoView.cpp | 22 ++-- .../src/dali-toolkit/utc-Dali-Visual.cpp | 62 +++++------ .../src/dali-toolkit/utc-Dali-VisualFactory.cpp | 42 +++---- .../src/dali-toolkit/utc-Dali-WebView.cpp | 6 +- 61 files changed, 984 insertions(+), 984 deletions(-) mode change 100755 => 100644 automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-Control.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-FlexNode.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-ToggleButton.cpp mode change 100755 => 100644 automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Control-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Control-internal.cpp index 315ccd8..af84c8f 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Control-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Control-internal.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -52,7 +52,7 @@ int UtcDaliControlActionOnVisual(void) 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(); @@ -80,13 +80,13 @@ int UtcDaliControlDebugHierarchy(void) 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() ); diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp index f1adaa5..fe01738 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp @@ -39,7 +39,7 @@ const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif"; 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 ); @@ -61,7 +61,7 @@ void TestDebugVisual( Visual::Base& visual, Visual::Type actualType, Vector2 exp DummyControl actor = DummyControl::New(); DummyControlImpl& dummyImpl = static_cast(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 ) @@ -97,7 +97,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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; @@ -106,7 +106,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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; @@ -126,7 +126,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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; @@ -136,7 +136,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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: @@ -148,7 +148,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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 @@ -158,7 +158,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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 @@ -199,7 +199,7 @@ int UtcDaliDebugRenderingGetVisual1(void) 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; @@ -221,7 +221,7 @@ int UtcDaliDebugRenderingGetVisual2(void) 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(); @@ -230,7 +230,7 @@ int UtcDaliDebugRenderingGetVisual2(void) 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(); @@ -238,12 +238,12 @@ int UtcDaliDebugRenderingGetVisual2(void) 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; @@ -336,7 +336,7 @@ int UtcDaliDebugRenderingRenderText(void) try { Toolkit::TextLabel label = TextLabel::New( "Hello" ); - Stage::GetCurrent().Add( label ); + application.GetScene().Add( label ); DALI_TEST_CHECK( true ); } catch( ... ) { diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-ItemView-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-ItemView-internal.cpp index 5663d79..8e483ad 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-ItemView-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-ItemView-internal.cpp @@ -102,8 +102,8 @@ int UtcDaliItemLayoutCheckPropertiesSetBeforeActivateLayout(void) Dali::Toolkit::Internal::GridLayout* gridLayout = dynamic_cast(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 ); diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Circular.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Circular.cpp index ae3afd2..07e642a 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Circular.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Circular.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -638,9 +638,9 @@ int UtcDaliTextCircularBlend(void) 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 = ""; diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp index b32e328..b1afd34 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -425,7 +425,7 @@ int UtcDaliTextControllerTextPopupButtonTouched(void) TextSelectionPopup::CLIPBOARD ); textPopup.EnableButtons( buttonsToEnable ); - Stage::GetCurrent().Add( textPopup ); + application.GetScene().Add( textPopup ); textPopup.ShowPopup(); // Render and notify @@ -663,7 +663,7 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void) 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"); @@ -804,7 +804,7 @@ int UtcDaliTextControllerCheckBufferIndices(void) 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); @@ -855,7 +855,7 @@ int UtcDaliTextControllerCheckInputColorChanged(void) DALI_TEST_EQUALS( Controller::COLOR, static_cast( 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); @@ -904,7 +904,7 @@ int UtcDaliTextControllerCheckInputFontFamilyChanged(void) 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); @@ -953,7 +953,7 @@ int UtcDaliTextControllerCheckInputFontWeightChanged(void) 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); @@ -1002,7 +1002,7 @@ int UtcDaliTextControllerCheckInputFontWidthChanged(void) 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); @@ -1051,7 +1051,7 @@ int UtcDaliTextControllerCheckInputFontSlantChanged(void) 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); @@ -1100,7 +1100,7 @@ int UtcDaliTextControllerCheckInputFontPointSizeChanged(void) 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); @@ -1127,7 +1127,7 @@ int UtcDaliTextControllerSelectEvent(void) 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 @@ -1185,7 +1185,7 @@ int UtcDaliTextControllerRemoveTextChangeEventData(void) 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); @@ -1213,7 +1213,7 @@ int UtcDaliTextControllerCheckInputFontPointSizeUpdated(void) 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. diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp index e9eff1c..a098f73 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -41,7 +41,7 @@ int UtcDaliTextFieldMultipleBackgroundText(void) 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(); diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals-internal.cpp index 7b0e2f8..13464d3 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals-internal.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -58,7 +58,7 @@ int UtcDaliVisualAction(void) 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(); @@ -100,7 +100,7 @@ int UtcDaliVisualActionNotImplemented(void) 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(); @@ -136,7 +136,7 @@ int UtcDaliVisualSetProperties(void) 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(); @@ -202,7 +202,7 @@ int UtcDaliAnimatedVectorImageVisualSetProperties(void) 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(); diff --git a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp old mode 100755 new mode 100644 index 25b652a..2516212 --- a/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp +++ b/automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -230,8 +230,8 @@ int UtcDaliStyleManagerApplyTheme(void) // 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(); @@ -350,7 +350,7 @@ int UtcDaliStyleManagerApplyDefaultTheme(void) ToolkitTestApplication application; Test::TestButton testButton = Test::TestButton::New(); - Stage::GetCurrent().Add( testButton ); + application.GetScene().Add( testButton ); StyleChangedSignalChecker styleChangedSignalHandler; StyleManager styleManager = StyleManager::Get(); @@ -491,8 +491,8 @@ int UtcDaliStyleManagerApplyStyle(void) // 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(); @@ -559,8 +559,8 @@ int UtcDaliStyleManagerIncludeStyleP(void) // 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(); @@ -611,8 +611,8 @@ int UtcDaliStyleManagerIncludeStyleN(void) // 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(); @@ -646,13 +646,13 @@ int UtcDaliStyleManagerStyleChangedSignalFontFamily(void) 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(); @@ -727,10 +727,10 @@ int UtcDaliStyleManagerStyleChangedSignalFontSize(void) 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(); @@ -810,10 +810,10 @@ int UtcDaliStyleManagerStyleChangedSignalFontSizeTextField(void) 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; @@ -893,10 +893,10 @@ int UtcDaliStyleManagerStyleChangedSignalFontSizeTextEditor(void) 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; @@ -953,7 +953,7 @@ int UtcDaliStyleManagerSetState01(void) DummyControl actor = DummyControl::New(true); actor.SetStyleName("BasicControl"); - Stage::GetCurrent().Add(actor); + application.GetScene().Add(actor); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 ); @@ -1029,7 +1029,7 @@ int UtcDaliStyleManagerSetState02(void) DummyControl actor = DummyControl::New(true); actor.SetStyleName("BasicControl"); - Stage::GetCurrent().Add(actor); + application.GetScene().Add(actor); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); Integration::ResourcePointer ninePatch = CustomizeNinePatch( application, 30, 30 ); @@ -1109,7 +1109,7 @@ int UtcDaliStyleManagerSetState03N(void) DummyControl actor = DummyControl::New(true); actor.SetStyleName("NoStyles"); - Stage::GetCurrent().Add(actor); + application.GetScene().Add(actor); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); Property::Map propertyMap; @@ -1158,7 +1158,7 @@ int UtcDaliStyleManagerSetState04N(void) DummyControl actor = DummyControl::New(true); actor.SetStyleName("NoStateStyle"); - Stage::GetCurrent().Add(actor); + application.GetScene().Add(actor); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); Property::Map propertyMap; @@ -1208,7 +1208,7 @@ int UtcDaliStyleManagerSetSubState01(void) 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 ); @@ -1252,7 +1252,7 @@ int UtcDaliStyleManagerSetSubState02(void) 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 ); @@ -1344,7 +1344,7 @@ int UtcDaliStyleManagerConfigSectionTest(void) // 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp index 5a8b3dc..964a2c9 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp @@ -283,9 +283,9 @@ int UtcDaliAccessibilityManagerGetActorByFocusOrder(void) 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()); @@ -328,12 +328,12 @@ int UtcDaliAccessibilityManagerSetAndGetCurrentFocusActor(void) // 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(); @@ -357,7 +357,7 @@ int UtcDaliAccessibilityManagerSetAndGetCurrentFocusActor(void) 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); @@ -426,7 +426,7 @@ int UtcDaliAccessibilityManagerGetCurrentFocusGroup(void) 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(); @@ -492,13 +492,13 @@ int UtcDaliAccessibilityManagerGetCurrentFocusOrder(void) 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); @@ -554,13 +554,13 @@ int UtcDaliAccessibilityManagerMoveFocusForward(void) 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); @@ -671,13 +671,13 @@ int UtcDaliAccessibilityManagerMoveFocusBackward(void) 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); @@ -790,12 +790,12 @@ int UtcDaliAccessibilityManagerClearFocus(void) // 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()); @@ -828,12 +828,12 @@ int UtcDaliAccessibilityManagerReset(void) // 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()); @@ -875,7 +875,7 @@ int UtcDaliAccessibilityManagerFocusGroup(void) 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(); @@ -992,7 +992,7 @@ int UtcDaliAccessibilityManagerSetAndGetFocusIndicatorWithFocusedActor(void) DALI_TEST_CHECK(defaultFocusIndicatorActor); Actor focusedActor = Actor::New(); - Stage::GetCurrent().Add( focusedActor ); + application.GetScene().Add( focusedActor ); application.SendNotification(); application.Render(); @@ -1036,12 +1036,12 @@ int UtcDaliAccessibilityManagerSignalFocusChanged(void) // 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()); @@ -1087,12 +1087,12 @@ int UtcDaliAccessibilityManagerSignalFocusOvershot(void) // 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); @@ -1317,7 +1317,7 @@ int UtcDaliAccessibilityManagerActionActivateSignalP(void) 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 ); @@ -1527,7 +1527,7 @@ int UtcDaliAccessibilityManagerActionUpSignalP(void) 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(); @@ -1571,7 +1571,7 @@ int UtcDaliAccessibilityManagerActionDownSignalP(void) 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 ); @@ -2099,7 +2099,7 @@ int UtcDaliAccessibilityManagerActionZoomSignalP(void) 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 ); @@ -2303,7 +2303,7 @@ int UtcDaliAccessibilityManagerActionTouch(void) Impl::DummyControl& dummyImpl = static_cast(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 ); @@ -2328,7 +2328,7 @@ int UtcDaliAccessibilityManagerHandlePanGesture(void) 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); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp index 3b1a6f8..b1b7aba 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -239,7 +239,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -250,7 +250,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -259,7 +259,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -270,7 +270,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -279,7 +279,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -290,7 +290,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -299,7 +299,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -310,7 +310,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -319,7 +319,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -330,7 +330,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -339,7 +339,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -350,7 +350,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -359,7 +359,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -370,7 +370,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -379,7 +379,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -390,7 +390,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -399,7 +399,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -410,7 +410,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void) alignment.SetAlignmentType(type); DALI_TEST_CHECK(alignment.GetAlignmentType() & type); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -473,10 +473,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -486,10 +486,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -499,10 +499,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -512,10 +512,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -525,10 +525,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -538,10 +538,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -551,10 +551,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -564,10 +564,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -577,10 +577,10 @@ int UtcDaliAlignmentGetAlignmentType(void) 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(); } @@ -595,7 +595,7 @@ int UtcDaliAlignmentSetScaling(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -619,7 +619,7 @@ int UtcDaliAlignmentSetScaling(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -628,7 +628,7 @@ int UtcDaliAlignmentSetScaling(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -652,7 +652,7 @@ int UtcDaliAlignmentSetScaling(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -661,7 +661,7 @@ int UtcDaliAlignmentSetScaling(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -685,7 +685,7 @@ int UtcDaliAlignmentSetScaling(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -694,7 +694,7 @@ int UtcDaliAlignmentSetScaling(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -718,7 +718,7 @@ int UtcDaliAlignmentSetScaling(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -727,7 +727,7 @@ int UtcDaliAlignmentSetScaling(void) { Alignment alignment = Alignment::New(); alignment.Add(Actor::New()); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -751,7 +751,7 @@ int UtcDaliAlignmentSetScaling(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); application.Render(); application.SendNotification(); } @@ -906,7 +906,7 @@ int UtcDaliAlignmentChildAddAndRemove(void) ToolkitTestApplication application; Alignment alignment = Alignment::New(); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -926,7 +926,7 @@ int UtcDaliAlignmentChildAddAndRemove(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); END_TEST; } @@ -935,7 +935,7 @@ int UtcDaliAlignmentSizeSetP(void) ToolkitTestApplication application; Alignment alignment = Alignment::New(); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); application.Render(); application.SendNotification(); @@ -950,7 +950,7 @@ int UtcDaliAlignmentSizeSetP(void) DALI_TEST_EQUALS(size, alignment.GetTargetSize().GetVectorXY(), TEST_LOCATION); - Stage::GetCurrent().Remove(alignment); + application.GetScene().Remove(alignment); END_TEST; } @@ -969,7 +969,7 @@ int UtcDaliAlignmentOnTouchEvent(void) 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); @@ -995,7 +995,7 @@ int UtcDaliAlignmentOnKeyEvent(void) ToolkitTestApplication application; Alignment alignment = Alignment::New(); - Stage::GetCurrent().Add(alignment); + application.GetScene().Add(alignment); alignment.SetKeyInputFocus(); @@ -1016,7 +1016,7 @@ int UtcDaliAlignmentOnSizeAnimation(void) 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 ) ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp index 59be4f2..f61a8ef 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp @@ -219,7 +219,7 @@ int UtcDaliAnimatedImageVisualSynchronousLoading(void) 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); @@ -282,7 +282,7 @@ int UtcDaliAnimatedImageVisualJumpToAction(void) 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); @@ -352,7 +352,7 @@ int UtcDaliAnimatedImageVisualStopBehavior(void) 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); @@ -416,7 +416,7 @@ int UtcDaliAnimatedImageVisualAnimatedImage01(void) 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(); @@ -483,7 +483,7 @@ int UtcDaliAnimatedImageVisualMultiImage01(void) 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); @@ -576,7 +576,7 @@ int UtcDaliAnimatedImageVisualMultiImage02(void) 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); @@ -655,7 +655,7 @@ int UtcDaliAnimatedImageVisualMultiImage03(void) Impl::DummyControl& dummyImpl1 = static_cast(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); @@ -671,7 +671,7 @@ int UtcDaliAnimatedImageVisualMultiImage03(void) Impl::DummyControl& dummyImpl2 = static_cast(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); @@ -732,7 +732,7 @@ int UtcDaliAnimatedImageVisualMultiImage04(void) 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); @@ -818,7 +818,7 @@ int UtcDaliAnimatedImageVisualMultiImage05(void) 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); @@ -858,7 +858,7 @@ void TestLoopCount( ToolkitTestApplication &application, DummyControl &dummyCont TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); - Stage::GetCurrent().Add( dummyControl ); + application.GetScene().Add( dummyControl ); application.SendNotification(); application.Render(16); @@ -999,7 +999,7 @@ int UtcDaliAnimatedImageVisualPlayback(void) 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); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp index 10f7dfa..fdbd8bf 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -76,7 +76,7 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void) 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(); @@ -109,7 +109,7 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual02(void) 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(); @@ -148,7 +148,7 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual03(void) 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(); @@ -189,7 +189,7 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void) 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(); @@ -265,7 +265,7 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void) Vector2 controlSize( 20.f, 30.f ); actor.SetProperty( Actor::Property::SIZE, controlSize ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -349,7 +349,7 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) 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 ); @@ -418,7 +418,7 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void) 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); @@ -480,7 +480,7 @@ int UtcDaliAnimatedVectorImageVisualCustomShader(void) 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(); @@ -519,7 +519,7 @@ int UtcDaliAnimatedVectorImageVisualNaturalSize(void) Vector2 controlSize( 20.f, 30.f ); Vector2 naturalSize; - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -560,7 +560,7 @@ int UtcDaliAnimatedVectorImageVisualLoopCount(void) 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 ); @@ -604,7 +604,7 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void) 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 ); @@ -722,7 +722,7 @@ int UtcDaliAnimatedVectorImageVisualPlayRangeMarker(void) 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 ); @@ -821,7 +821,7 @@ int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void) 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 ); @@ -862,7 +862,7 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void) Vector2 controlSize( 20.f, 30.f ); actor.SetProperty( Actor::Property::SIZE, controlSize ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -976,7 +976,7 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void) Vector2 controlSize( 20.f, 30.f ); actor.SetProperty( Actor::Property::SIZE, controlSize ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -1088,7 +1088,7 @@ int UtcDaliAnimatedVectorImageVisualStopBehavior(void) 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 ); @@ -1183,7 +1183,7 @@ int UtcDaliAnimatedVectorImageVisualLoopingMode(void) 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 ); @@ -1261,7 +1261,7 @@ int UtcDaliAnimatedVectorImageVisualPropertyNotification(void) actor.SetProperty( Actor::Property::SIZE, controlSize ); actor.SetProperty( Actor::Property::SCALE, controlScale ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -1321,7 +1321,7 @@ int UtcDaliAnimatedVectorImageVisualMultipleInstances(void) 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 ) @@ -1336,7 +1336,7 @@ int UtcDaliAnimatedVectorImageVisualMultipleInstances(void) 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() ); @@ -1385,7 +1385,7 @@ int UtcDaliAnimatedVectorImageVisualControlVisibilityChanged(void) Vector2 controlSize( 20.f, 30.f ); actor.SetProperty( Actor::Property::SIZE, controlSize ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -1432,7 +1432,7 @@ int UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged(void) Vector2 controlSize( 20.f, 30.f ); actor.SetProperty( Actor::Property::SIZE, controlSize ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp index d6c992e..dbc326d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp @@ -56,7 +56,7 @@ int UtcDaliVisualFactoryGetArcVisual01(void) 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(); @@ -92,7 +92,7 @@ int UtcDaliVisualFactoryGetArcVisual02(void) 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(); @@ -131,7 +131,7 @@ int UtcDaliArcVisualGetPropertyMap01(void) 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(); @@ -224,7 +224,7 @@ int UtcDaliArcVisualUpdateProperty(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp index 3ac0fa3..2105c4a 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp @@ -125,9 +125,9 @@ int UtcDaliBloomViewAddRemove(void) 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 ) ); @@ -146,21 +146,21 @@ int UtcDaliBloomActivateDeactivate(void) 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; } @@ -209,7 +209,7 @@ int UtcDaliBloomOnSizeSet(void) BloomView view = Toolkit::BloomView::New(); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp index 1b15e74..3294f66 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -169,7 +169,7 @@ int UtcDaliBubbleEmitterSetBackground(void) 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 ); @@ -197,7 +197,7 @@ int UtcDaliBubbleEmitterSetBubbleScale(void) 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 ); @@ -274,7 +274,7 @@ int UtcDaliBubbleEmitterEmitBubble(void) 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]" ); @@ -320,7 +320,7 @@ int UtcDaliBubbleEmitterRestore(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp index 01b9096..52f6f98 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -136,7 +136,7 @@ int UtcDaliBuilderQuitSignal(void) ); 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 ); @@ -297,7 +297,7 @@ int UtcDaliBuilderAnimationP(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors( application.GetScene().GetRootLayer() ); Animation anim = builder.CreateAnimation("animate"); @@ -427,7 +427,7 @@ int UtcDaliBuilderAnimationN(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors( application.GetScene().GetRootLayer() ); Animation anim = builder.CreateAnimation("animate"); @@ -448,11 +448,11 @@ int UtcDaliBuilderAnimationN(void) 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); @@ -511,10 +511,10 @@ int UtcDaliBuilderConstantsP(void) 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; @@ -682,13 +682,13 @@ int UtcDaliBuilderRenderTasksP(void) 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; } @@ -723,7 +723,7 @@ int UtcDaliBuilderChildActionP(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors ( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors ( application.GetScene().GetRootLayer() ); // Render and notify application.SendNotification(); @@ -741,7 +741,7 @@ int UtcDaliBuilderChildActionP(void) 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 ) ); @@ -780,7 +780,7 @@ int UtcDaliBuilderSetPropertyActionP(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors ( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors ( application.GetScene().GetRootLayer() ); // Render and notify application.SendNotification(); @@ -798,7 +798,7 @@ int UtcDaliBuilderSetPropertyActionP(void) 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 ) ); @@ -834,7 +834,7 @@ int UtcDaliBuilderGenericActionP(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors ( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors ( application.GetScene().GetRootLayer() ); // Render and notify application.SendNotification(); @@ -852,7 +852,7 @@ int UtcDaliBuilderGenericActionP(void) 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 ) ); @@ -919,7 +919,7 @@ int UtcDaliBuilderPropertyNotificationP(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors ( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors ( application.GetScene().GetRootLayer() ); // Render and notify application.SendNotification(); @@ -941,7 +941,7 @@ int UtcDaliBuilderPropertyNotificationP(void) 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 ) ); @@ -972,7 +972,7 @@ int UtcDaliBuilderPropertyNotificationN(void) { Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors ( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors ( application.GetScene().GetRootLayer() ); DALI_TEST_CHECK( false ); } catch(...) @@ -1103,13 +1103,13 @@ int UtcDaliBuilderCustomShaderP(void) 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 ); @@ -1190,13 +1190,13 @@ int UtcDaliBuilderAddActorsP(void) 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 ) ); @@ -1396,7 +1396,7 @@ int UtcDaliBuilderPathConstraintsP(void) // For coverage Actor actor = Actor::New(); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); builder.AddActors( actor ); // Render and notify @@ -1502,7 +1502,7 @@ int UtcDaliBuilderMapping01(void) builder.LoadFromString( json ); Test::TestButton testButton = Test::TestButton::New(); - Stage::GetCurrent().Add( testButton ); + application.GetScene().Add( testButton ); // Render and notify application.SendNotification(); @@ -1574,7 +1574,7 @@ int UtcDaliBuilderMappingCycleCheck(void) builder.LoadFromString( json ); Test::TestButton testButton = Test::TestButton::New(); - Stage::GetCurrent().Add( testButton ); + application.GetScene().Add( testButton ); // Render and notify application.SendNotification(); @@ -1621,7 +1621,7 @@ int UtcDaliBuilderTypeCasts(void) ); Actor rootActor = Actor::New(); - Stage::GetCurrent().Add( rootActor ); + application.GetScene().Add( rootActor ); Builder builder = Builder::New(); builder.LoadFromString( json ); @@ -1658,7 +1658,7 @@ int UtcDaliBuilderBuilderControl(void) ); Actor rootActor = Actor::New(); - Stage::GetCurrent().Add( rootActor ); + application.GetScene().Add( rootActor ); Builder builder = Builder::New(); builder.LoadFromString( json ); @@ -1687,7 +1687,7 @@ int UtcDaliBuilderCustomControl(void) ); Actor rootActor = Actor::New(); - Stage::GetCurrent().Add( rootActor ); + application.GetScene().Add( rootActor ); Builder builder = Builder::New(); builder.LoadFromString( json ); @@ -1739,7 +1739,7 @@ int UtcDaliBuilderActionsWithParams(void) Builder builder = Builder::New(); builder.LoadFromString( json ); - builder.AddActors( Stage::GetCurrent().GetRootLayer() ); + builder.AddActors( application.GetScene().GetRootLayer() ); DALI_TEST_CHECK( true ); // For Coverage diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp index 5de1c06..92e64ec 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -362,7 +362,7 @@ int UtcDaliButtonAutoRepeatingP(void) 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(); @@ -593,7 +593,7 @@ int UtcDaliButtonPressedSignalP(void) 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(); @@ -700,7 +700,7 @@ int UtcDaliButtonClickedSignalP(void) 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(); @@ -791,7 +791,7 @@ int UtcDaliButtonStateChangedSignalP(void) button.SetProperty( Button::Property::TOGGLABLE, true); - Stage::GetCurrent().Add( button ); + application.GetScene().Add( button ); application.SendNotification(); application.Render(); @@ -851,7 +851,7 @@ int UtcDaliButtonEventConsumption(void) 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 ); @@ -905,7 +905,7 @@ int UtcDaliButtonRelease(void) 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 @@ -950,7 +950,7 @@ int UtcDaliButtonMultiTouch(void) 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 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp index b1f43b7..cc8d381 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -194,7 +194,7 @@ int UtcDaliCheckBoxSetDisabledPropertyP(void) 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" ); @@ -365,7 +365,7 @@ int UtcDaliCheckBoxSetLabelDisabledP(void) 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" ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ConfirmationPopup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ConfirmationPopup.cpp index 0b09c93..8da9eae 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ConfirmationPopup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ConfirmationPopup.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -189,7 +189,7 @@ int UtcDaliConfirmationPopupDynamicSignalGenerationP(void) DALI_TEST_CHECK( !gSignalReceivedCancel ); // Provoke the signal. - Stage::GetCurrent().Add( popup ); + application.GetScene().Add( popup ); // Check the signal has occurred. DALI_TEST_CHECK( gSignalReceivedOK ); @@ -208,7 +208,7 @@ int UtcDaliConfirmationPopupDynamicSignalGenerationP(void) 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 ); @@ -250,7 +250,7 @@ int UtcDaliConfirmationPopupDynamicSignalGenerationN(void) 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 ); @@ -272,7 +272,7 @@ int UtcDaliConfirmationPopupTypeRegistryCreation(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp old mode 100755 new mode 100644 index e7b096a..0af28c3 --- a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -230,7 +230,7 @@ int UtcDaliControlNavigationProperties(void) 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 ); @@ -261,7 +261,7 @@ int UtcDaliControlNavigationProperties(void) int UtcDaliControlKeyInputFocus(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); DummyControl control; @@ -383,14 +383,14 @@ int UtcDaliControlSignalConnectDisconnect(void) 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; @@ -417,9 +417,9 @@ int UtcDaliControlSignalAutomaticDisconnect(void) 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 @@ -437,7 +437,7 @@ int UtcDaliControlTestParameters(void) test.SetProperty( Actor::Property::SIZE, Vector3( 0.7f, 0.7f, 0.7f ) ); - Stage::GetCurrent().Add( test ); + application.GetScene().Add( test ); application.SendNotification(); application.Render(); @@ -488,7 +488,7 @@ int UtcDaliControlBackgroundColorRendererCount(void) 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 ); @@ -673,7 +673,7 @@ int UtcDaliControlKeyProperties(void) 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 ); @@ -720,7 +720,7 @@ int UtcDaliControlImplKeyInputFocusGainedSignal(void) ToolkitTestApplication application; Control control = Control::New(); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); gKeyInputFocusCallBackCalled = false; control.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback); @@ -742,7 +742,7 @@ int UtcDaliControlImplKeyInputFocusLostSignal(void) ToolkitTestApplication application; Control control = Control::New(); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); gKeyInputFocusCallBackCalled = false; control.KeyInputFocusLostSignal().Connect(&TestKeyInputFocusCallback); @@ -784,7 +784,7 @@ int UtcDaliControlAutoClipping(void) control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -807,7 +807,7 @@ int UtcDaliControlAutoClippingN(void) control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -834,7 +834,7 @@ int UtcDaliControlAutoClippingWhenAlreadyOnStage(void) DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -862,7 +862,7 @@ int UtcDaliControlAutoClippingWhenAlreadyOnStageN(void) DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -903,7 +903,7 @@ int UtcDaliControlSetTransformSize(void) 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(); @@ -958,7 +958,7 @@ int UtcDaliControlResourcesReady(void) DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION ); DALI_TEST_EQUALS( static_cast(resourceStatus), static_cast(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(); @@ -1017,7 +1017,7 @@ int UtcDaliControlResourcesReady02(void) 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(); @@ -1043,7 +1043,7 @@ int UtcDaliControlMarginProperty(void) control.SetProperty( Control::Property::MARGIN, Extents( 20, 10, 0, 0 ) ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -1074,7 +1074,7 @@ int UtcDaliControlPaddingProperty(void) control.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -1122,7 +1122,7 @@ int UtcDaliControlDoAction(void) 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 ); @@ -1184,7 +1184,7 @@ int UtcDaliControlDoActionWhenNotStage(void) 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" ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp index 483f9c7..3f83b60 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -220,7 +220,7 @@ int UtcDaliControlImplOnGestureMethods(void) 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(); @@ -255,7 +255,7 @@ int UtcDaliControlImplOnGestureMethods(void) DALI_TEST_CHECK( dummyImpl.longPressCalled == true ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; @@ -267,7 +267,7 @@ int UtcDaliControlImplChildAddAndRemove(void) { DummyControl dummy = DummyControl::New( true ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); application.Render(); @@ -291,13 +291,13 @@ int UtcDaliControlImplChildAddAndRemove(void) 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(); @@ -316,7 +316,7 @@ int UtcDaliControlImplChildAddAndRemove(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -330,13 +330,13 @@ int UtcDaliControlImplStageConnection(void) Impl::DummyControl& dummyImpl = static_cast(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 ); @@ -344,19 +344,19 @@ int UtcDaliControlImplStageConnection(void) // 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; } @@ -369,7 +369,7 @@ int UtcDaliControlImplSizeSetP(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); @@ -385,7 +385,7 @@ int UtcDaliControlImplSizeSetP(void) 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; @@ -397,7 +397,7 @@ int UtcDaliControlImplSizeSet2P(void) { 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() ); @@ -412,7 +412,7 @@ int UtcDaliControlImplSizeSet2P(void) DALI_TEST_EQUALS(size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -426,7 +426,7 @@ int UtcDaliControlImplSizeAnimation(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION ); Animation animation = Animation::New(1.0f); @@ -440,14 +440,14 @@ int UtcDaliControlImplSizeAnimation(void) 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 ) ); @@ -458,7 +458,7 @@ int UtcDaliControlImplSizeAnimation(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -475,7 +475,7 @@ int UtcDaliControlImplTouchEvent(void) 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(); @@ -492,7 +492,7 @@ int UtcDaliControlImplTouchEvent(void) application.ProcessEvent(touchEvent); DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage @@ -501,7 +501,7 @@ int UtcDaliControlImplTouchEvent(void) 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(); @@ -516,7 +516,7 @@ int UtcDaliControlImplTouchEvent(void) touchEvent.AddPoint(point); application.ProcessEvent(touchEvent); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -531,7 +531,7 @@ int UtcDaliControlImplHoverEvent(void) 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(); @@ -548,7 +548,7 @@ int UtcDaliControlImplHoverEvent(void) application.ProcessEvent( event ); DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage @@ -557,7 +557,7 @@ int UtcDaliControlImplHoverEvent(void) 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(); @@ -572,7 +572,7 @@ int UtcDaliControlImplHoverEvent(void) event.AddPoint(point); application.ProcessEvent( event ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -588,7 +588,7 @@ int UtcDaliControlImplKeyEvent(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); dummy.SetKeyInputFocus(); application.Render(); @@ -601,14 +601,14 @@ int UtcDaliControlImplKeyEvent(void) 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(); @@ -619,7 +619,7 @@ int UtcDaliControlImplKeyEvent(void) Integration::KeyEvent keyEvent; application.ProcessEvent(keyEvent); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -632,7 +632,7 @@ int UtcDaliControlImplKeyInputFocusGained(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, false, TEST_LOCATION ); @@ -640,16 +640,16 @@ int UtcDaliControlImplKeyInputFocusGained(void) 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; } @@ -662,7 +662,7 @@ int UtcDaliControlImplKeyInputFocusLost(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, false, TEST_LOCATION ); @@ -671,14 +671,14 @@ int UtcDaliControlImplKeyInputFocusLost(void) 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(); @@ -687,7 +687,7 @@ int UtcDaliControlImplKeyInputFocusLost(void) dummyImpl.IsKeyboardNavigationSupported(); dummyImpl.IsKeyboardFocusGroup(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -728,7 +728,7 @@ int UtcDaliControlImplWheelEvent(void) 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); @@ -745,7 +745,7 @@ int UtcDaliControlImplWheelEvent(void) application.ProcessEvent( event ); DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage @@ -754,7 +754,7 @@ int UtcDaliControlImplWheelEvent(void) 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); @@ -768,7 +768,7 @@ int UtcDaliControlImplWheelEvent(void) 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; } @@ -782,13 +782,13 @@ int UtcDaliControlImplSetStyleName(void) 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; } @@ -1040,7 +1040,7 @@ int UtcDaliControlImplRegisterUnregisterVisual(void) 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(); @@ -1051,7 +1051,7 @@ int UtcDaliControlImplRegisterUnregisterVisual(void) 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(); @@ -1086,7 +1086,7 @@ int UtcDaliControlImplRegisterDisabledVisual(void) 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(); @@ -1125,7 +1125,7 @@ int UtcDaliControlImplDisableRegisteredVisual(void) // Register index with a color visual dummyImpl.RegisterVisual( TEST_PROPERTY, visual ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); @@ -1167,7 +1167,7 @@ int UtcDaliControlImplEnabledVisualParentRemovedFromStage(void) // 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(); @@ -1182,13 +1182,13 @@ int UtcDaliControlImplEnabledVisualParentRemovedFromStage(void) 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(); @@ -1237,7 +1237,7 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void) // 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(); @@ -1254,13 +1254,13 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void) 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(); @@ -1293,7 +1293,7 @@ int UtcDaliControlImplAutoClippingWithVisuals(void) control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -1323,7 +1323,7 @@ int UtcDaliControlImplAutoClippingWithVisualsAlreadyOnStage(void) DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp index e575bca..2b43a89 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -319,7 +319,7 @@ int UtcDaliControlWrapperRelayoutRequest(void) 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(); @@ -519,7 +519,7 @@ int UtcDaliControlWrapperRegisterDisabledVisual(void) 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(); @@ -562,7 +562,7 @@ int UtcDaliControlWrapperRegisterDisabledVisualWithDepthIndex(void) 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(); @@ -635,7 +635,7 @@ int UtcDaliControlWrapperTransitionDataMap1N(void) 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 ); @@ -697,7 +697,7 @@ int UtcDaliControlWrapperTestControlProperties(void) 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; @@ -774,7 +774,7 @@ int UtcDaliControlWrapperAnimateVisual(void) // 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 @@ -812,7 +812,7 @@ int UtcDaliControlWrapperAnimateVisual(void) 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 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp index f812fe0..d52034c 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp @@ -261,7 +261,7 @@ int UtcDaliCubeTransitionEffectGetRoot(void) 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 ); @@ -293,7 +293,7 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) 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 ); @@ -310,7 +310,7 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) 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 ); @@ -327,7 +327,7 @@ int UtcDaliCubeTransitionEffectIsTransitioning(void) 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() ); @@ -357,7 +357,7 @@ int UtcDaliCubeTransitionEffectSetCurrentTexture(void) waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) ); waveEffect.SetCurrentTexture( texture ); - Stage::GetCurrent().Add( waveEffect ); + application.GetScene().Add( waveEffect ); application.SendNotification(); application.Render(); @@ -393,12 +393,12 @@ int UtcDaliCubeTransitionEffectSetTargetTexture(void) 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(); @@ -441,7 +441,7 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void) waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT ); waveEffect.SetCurrentTexture( texture ); - Stage::GetCurrent().Add( waveEffect ); + application.GetScene().Add( waveEffect ); application.SendNotification(); application.Render(); @@ -499,7 +499,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void) crossEffect.SetCurrentTexture( texture ); crossEffect.SetTargetTexture( texture ); - Stage::GetCurrent().Add( crossEffect ); + application.GetScene().Add( crossEffect ); application.SendNotification(); application.Render(); @@ -557,7 +557,7 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void) foldEffect.SetCurrentTexture( texture ); foldEffect.SetTargetTexture( texture ); - Stage::GetCurrent().Add( foldEffect ); + application.GetScene().Add( foldEffect ); application.SendNotification(); application.Render(); @@ -615,18 +615,18 @@ int UtcDaliCubeTransitionEffectSignalTransitionCompleted(void) 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; @@ -704,18 +704,18 @@ int UtcDaliCubeTransitionEffectPauseResumeTransition(void) 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; @@ -814,7 +814,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void) waveEffect.SetCurrentTexture( firstTexture ); waveEffect.SetTargetTexture( secondTexture ); - Stage::GetCurrent().Add( waveEffect ); + application.GetScene().Add( waveEffect ); application.SendNotification(); application.Render(); @@ -880,7 +880,7 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void) crossEffect.SetCurrentTexture( firstTexture ); crossEffect.SetTargetTexture( secondTexture ); - Stage::GetCurrent().Add( crossEffect ); + application.GetScene().Add( crossEffect ); application.SendNotification(); application.Render(); @@ -950,7 +950,7 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void) foldEffect.SetCurrentTexture( firstTexture ); foldEffect.SetTargetTexture( secondTexture ); - Stage::GetCurrent().Add( foldEffect ); + application.GetScene().Add( foldEffect ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp b/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp old mode 100755 new mode 100644 index 07f400a..ef92ce4 --- a/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -272,7 +272,7 @@ int UtcDaliDragAndDropDetectorStartSignal(void) 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(); @@ -311,8 +311,8 @@ int UtcDaliDragAndDropDetectorEnteredSignal(void) 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); @@ -354,8 +354,8 @@ int UtcDaliDragAndDropDetectorMovedSignal(void) 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); @@ -404,8 +404,8 @@ int UtcDaliDragAndDropDetectorExitedSignal(void) 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); @@ -449,8 +449,8 @@ int UtcDaliDragAndDropDetectorDroppedSignal(void) 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); @@ -497,8 +497,8 @@ int UtcDaliDragAndDropDetectorEndedSignal(void) 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); @@ -539,8 +539,8 @@ int UtcDaliDragAndDropDetectorGetContent(void) 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); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-EffectsView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-EffectsView.cpp index e7761e6..fbaa3de 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-EffectsView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-EffectsView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -45,7 +45,7 @@ int UtcDaliEffectsViewNew(void) 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 ); @@ -110,9 +110,9 @@ int UtcDaliEffectsViewAddRemoveDropShadow(void) 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() ); @@ -133,7 +133,7 @@ int UtcDaliEffectsViewAddRemoveEmboss(void) 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"); @@ -208,7 +208,7 @@ int UtcDaliEffectsViewOnStage(void) 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 ); @@ -225,7 +225,7 @@ int UtcDaliEffectsViewOffStage(void) 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 ); @@ -336,7 +336,7 @@ int UtcDaliEffectsViewOffsetProperty(void) 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; @@ -371,7 +371,7 @@ int UtcDaliEffectsViewColorProperty(void) 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; @@ -459,7 +459,7 @@ int UtcDaliEffectsViewSetRefreshOnDemandP(void) 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(); @@ -497,7 +497,7 @@ int UtcDaliEffectsViewSetRefreshOnDemandN(void) int UtcDaliEffectsViewSizeSet(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); { EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp b/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp old mode 100755 new mode 100644 index 3ae109c..a698b3c --- a/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -149,7 +149,7 @@ int UtcDaliToolkitFlexContainerSetPropertyP(void) 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(); @@ -196,7 +196,7 @@ int UtcDaliToolkitFlexContainerSetPropertyEnumP(void) 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(); @@ -242,7 +242,7 @@ int UtcDaliToolkitFlexContainerSetChildPropertyP(void) 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(); @@ -310,7 +310,7 @@ int UtcDaliToolkitFlexContainerRemoveChildP(void) 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 ); @@ -436,8 +436,8 @@ int UtcDaliToolkitFlexContainerMoveFocus(void) 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 ); @@ -505,7 +505,7 @@ int UtcDaliToolkitFlexContainerRTLSupportP(void) Actor actor0 = Actor::New(); - Stage::GetCurrent().Add( actor0 ); + application.GetScene().Add( actor0 ); actor0.Add( flexContainer ); // Create two actors and add them to the container diff --git a/automated-tests/src/dali-toolkit/utc-Dali-FlexNode.cpp b/automated-tests/src/dali-toolkit/utc-Dali-FlexNode.cpp old mode 100755 new mode 100644 index a22f57c..6415bef --- a/automated-tests/src/dali-toolkit/utc-Dali-FlexNode.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-FlexNode.cpp @@ -1,5 +1,5 @@ /* - * 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. diff --git a/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp index fd5cd98..874699f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp @@ -146,9 +146,9 @@ int UtcDaliGaussianBlurViewAddRemove(void) 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 ) ); @@ -167,22 +167,22 @@ int UtcDaliGaussianBlurActivateDeactivate(void) 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() ); @@ -202,9 +202,9 @@ int UtcDaliGaussianBlurActivateDeactivateRepeat(void) 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(); @@ -254,9 +254,9 @@ int UtcDaliGaussianBlurViewSetGetRenderTarget(void) 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 ); @@ -277,16 +277,16 @@ int UtcDaliGaussianBlurViewActivateOnce1(void) 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(); @@ -306,9 +306,9 @@ int UtcDaliGaussianBlurActivateOnce2(void) 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(); @@ -335,9 +335,9 @@ int UtcDaliGaussianBlurViewFinishedSignalN(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp index 90af333..25d83ba 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -418,9 +418,9 @@ int UtcDaliImageAtlasImageView(void) 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 ); @@ -449,7 +449,7 @@ int UtcDaliImageAtlasImageView(void) // 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); @@ -463,7 +463,7 @@ int UtcDaliImageAtlasImageView(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp index 7ece9d3..204cf23 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp @@ -221,7 +221,7 @@ int UtcDaliImageViewPreMultipliedAlphaPng(void) 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; @@ -294,7 +294,7 @@ int UtcDaliImageViewPreMultipliedAlphaPng(void) ImageView imageView2 = ImageView::New(); imageView2.SetProperty( ImageView::Property::IMAGE, imageMap ); - Stage::GetCurrent().Add( imageView2 ); + application.GetScene().Add( imageView2 ); application.SendNotification(); application.Render(); @@ -334,7 +334,7 @@ int UtcDaliImageViewPreMultipliedAlphaJpg(void) 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; @@ -375,7 +375,7 @@ int UtcDaliImageViewPreMultipliedAlphaJpg(void) // 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(); @@ -418,7 +418,7 @@ int UtcDaliImageViewPixelArea(void) .Add( ImageVisual::Property::PIXEL_AREA, pixelAreaVisual ) ); // Add to stage - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); stage.Add( gifView ); // loading started @@ -476,7 +476,7 @@ int UtcDaliImageViewAsyncLoadingWithoutAltasing(void) 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 ); @@ -517,7 +517,7 @@ int UtcDaliImageViewAsyncLoadingWithAtlasing(void) // 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); @@ -564,7 +564,7 @@ int UtcDaliImageViewAsyncLoadingWithAtlasing02(void) 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); @@ -619,7 +619,7 @@ int UtcDaliImageViewSyncLoading(void) 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); @@ -655,7 +655,7 @@ int UtcDaliImageViewSyncLoading02(void) syncLoadingMap[ "atlasing" ] = true; imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(16); @@ -685,7 +685,7 @@ int UtcDaliImageViewAddedTexture(void) propertyMap[ImageVisual::Property::URL] = url; imageView.SetProperty(ImageView::Property::IMAGE, propertyMap); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -709,7 +709,7 @@ int UtcDaliImageViewSizeWithBackground(void) } ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -741,7 +741,7 @@ int UtcDaliImageViewSizeWithBackgroundAndImage(void) imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio, 600x600 pixels - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -769,7 +769,7 @@ int UtcDaliImageViewHeightForWidthBackground(void) } ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -803,7 +803,7 @@ int UtcDaliImageViewHeightForWidthBackgroundAndImage(void) imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -858,7 +858,7 @@ int UtcDaliImageViewCheckResourceReady(void) 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 ); @@ -885,7 +885,7 @@ int UtcDaliImageViewSetImageTypeChangesP(void) 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; @@ -1001,7 +1001,7 @@ int UtcDaliImageViewReplaceImage(void) imageView.ResourceReadySignal().Connect( &ResourceReadySignal); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(16); @@ -1051,7 +1051,7 @@ int UtcDaliImageViewReplaceImageAndGetNaturalSize(void) dummyControl.Add( imageView ); dummyImpl.SetRelayoutCallback( &OnRelayoutOverride ); - Stage::GetCurrent().Add( dummyControl ); + application.GetScene().Add( dummyControl ); application.SendNotification(); application.Render(); @@ -1179,7 +1179,7 @@ int UtcDaliImageViewResourceReadySignalWithReusedImage02(void) 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 ); @@ -1200,7 +1200,7 @@ int UtcDaliImageViewPaddingProperty(void) 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(); @@ -1250,7 +1250,7 @@ int UtcDaliImageViewPaddingProperty02(void) 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(); @@ -1291,7 +1291,7 @@ int UtcDaliImageViewPaddingProperty03(void) 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(); @@ -1339,7 +1339,7 @@ int UtcDaliImageViewPaddingProperty04(void) 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(); @@ -1391,7 +1391,7 @@ int UtcDaliImageViewTransformTest01(void) 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(); @@ -1425,7 +1425,7 @@ int UtcDaliImageViewUsingAtlasAndGetNaturalSize(void) 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(); @@ -1453,7 +1453,7 @@ int UtcDaliImageViewFillMode(void) imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); // Trigger a potential relayout application.SendNotification(); @@ -1495,7 +1495,7 @@ int UtcDaliImageViewFittingModeFitKeepAspectRatio(void) 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(); @@ -1542,7 +1542,7 @@ int UtcDaliImageViewFittingModesFill(void) 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(); @@ -1588,7 +1588,7 @@ int UtcDaliImageViewFittingModesOverfitKeepAspectRatio(void) 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(); @@ -1635,7 +1635,7 @@ int UtcDaliImageViewFittingModesCenter01(void) 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(); @@ -1681,7 +1681,7 @@ int UtcDaliImageViewFittingModesCenter02(void) 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(); @@ -1726,7 +1726,7 @@ int UtcDaliImageViewFittingModesFitHeight01(void) 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(); @@ -1771,7 +1771,7 @@ int UtcDaliImageViewFittingModesFitHeight02(void) 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(); @@ -1816,7 +1816,7 @@ int UtcDaliImageViewFittingModesFitWidth01(void) 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(); @@ -1861,7 +1861,7 @@ int UtcDaliImageViewFittingModesFitWidth02(void) 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(); @@ -1908,7 +1908,7 @@ int UtcDaliImageViewFittingModesChangeFittingMode01(void) 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(); @@ -1944,7 +1944,7 @@ int UtcDaliImageViewFittingModesChangeFittingMode01(void) 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 ); @@ -1983,7 +1983,7 @@ int UtcDaliImageViewFittingModesChangeFittingMode01(void) 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(); @@ -2030,7 +2030,7 @@ int UtcDaliImageViewFittingModesChangeFittingMode02(void) 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(); @@ -2066,7 +2066,7 @@ int UtcDaliImageViewFittingModesChangeFittingMode02(void) 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 ); @@ -2105,7 +2105,7 @@ int UtcDaliImageViewFittingModesChangeFittingMode02(void) 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(); @@ -2149,7 +2149,7 @@ int UtcDaliImageViewFittingModesWithAnimatedVectorImageVisual(void) 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(); @@ -2200,7 +2200,7 @@ int UtcDaliImageViewCustomShader(void) ImageView imageView = ImageView::New(); imageView.SetProperty( ImageView::Property::IMAGE, properties ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -2234,7 +2234,7 @@ int UtcDaliImageViewCustomShader(void) 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(); @@ -2269,7 +2269,7 @@ int UtcDaliImageViewCustomShader(void) 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(); @@ -2307,7 +2307,7 @@ int UtcDaliImageViewCustomShader(void) imageView.SetProperty( ImageView::Property::IMAGE, properties1 ); imageView.SetProperty( ImageView::Property::IMAGE, properties ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -2345,7 +2345,7 @@ int UtcDaliImageViewCustomShader(void) imageView.SetProperty( ImageView::Property::IMAGE, properties ); imageView.SetProperty( ImageView::Property::IMAGE, properties1 ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); application.Render(); @@ -2439,7 +2439,7 @@ int UtcDaliImageViewLoadRemoteSVG(void) 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 ); @@ -2478,7 +2478,7 @@ int UtcDaliImageViewSyncSVGLoading(void) 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(); @@ -2513,7 +2513,7 @@ int UtcDaliImageViewAsyncSVGLoading(void) 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(); @@ -2552,7 +2552,7 @@ int UtcDaliImageViewSVGLoadingSyncSetInvalidValue(void) 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(); @@ -2587,7 +2587,7 @@ int UtcDaliImageViewSvgLoadingFailure(void) DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); @@ -2612,7 +2612,7 @@ int UtcDaliImageViewSvgLoadingFailure(void) DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION ); - Stage::GetCurrent().Add( imageView ); + application.GetScene().Add( imageView ); application.SendNotification(); @@ -2660,7 +2660,7 @@ int UtcDaliImageViewSetImageOnResourceReadySignal(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp index d34f665..6921dd3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp @@ -115,7 +115,7 @@ void TestVisualRender( ToolkitTestApplication& application, 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 @@ -184,7 +184,7 @@ int UtcDaliImageVisualPropertyMap(void) 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(); @@ -203,7 +203,7 @@ int UtcDaliImageVisualPropertyMap(void) 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; @@ -240,7 +240,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha01(void) 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(); @@ -261,7 +261,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha01(void) 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; @@ -297,7 +297,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void) 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(); @@ -343,7 +343,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void) 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(); @@ -367,7 +367,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void) 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; @@ -400,7 +400,7 @@ int UtcDaliImageVisualRemoteImageLoad(void) 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 ); @@ -411,7 +411,7 @@ int UtcDaliImageVisualRemoteImageLoad(void) 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; @@ -434,7 +434,7 @@ int UtcDaliImageVisualTextureReuse1(void) drawTrace.Enable(true); Actor actor = CreateActorWithImageVisual( propertyMap ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); // Wait for image to load @@ -451,7 +451,7 @@ int UtcDaliImageVisualTextureReuse1(void) 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 @@ -468,7 +468,7 @@ int UtcDaliImageVisualTextureReuse1(void) 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(); @@ -477,7 +477,7 @@ int UtcDaliImageVisualTextureReuse1(void) 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(); @@ -504,7 +504,7 @@ int UtcDaliImageVisualTextureReuse2(void) drawTrace.Enable(true); Actor actor = CreateActorWithImageVisual( propertyMap ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); // Wait for image to load @@ -524,7 +524,7 @@ int UtcDaliImageVisualTextureReuse2(void) 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(); @@ -550,7 +550,7 @@ int UtcDaliImageVisualTextureReuse2(void) tet_infoline("Test that removing 1 actor deletes it's texture\n"); - Stage::GetCurrent().Remove( actor ); + application.GetScene().Remove( actor ); application.SendNotification(); application.Render(); @@ -559,7 +559,7 @@ int UtcDaliImageVisualTextureReuse2(void) tet_infoline("Test that removing last actor deletes it's texture\n"); - Stage::GetCurrent().Remove( actor2 ); + application.GetScene().Remove( actor2 ); application.SendNotification(); application.Render(); @@ -608,7 +608,7 @@ int UtcDaliImageVisualCustomWrapModePixelArea(void) 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(); @@ -686,7 +686,7 @@ int UtcDaliImageVisualCustomWrapModeNoAtlas(void) 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(); @@ -745,7 +745,7 @@ int UtcDaliImageVisualAnimateMixColor(void) 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); @@ -825,7 +825,7 @@ int UtcDaliImageVisualAnimateOpacity(void) 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); @@ -963,7 +963,7 @@ int UtcDaliImageVisualAnimateOpacity02(void) 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 @@ -1024,7 +1024,7 @@ int UtcDaliImageVisualAnimatePixelArea(void) 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); @@ -1081,10 +1081,10 @@ int UtcDaliImageVisualTextureCancelRemoteLoad(void) 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 ); @@ -1120,12 +1120,12 @@ int UtcDaliImageVisualTextureCancelAsyncLoad(void) 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 ); @@ -1173,7 +1173,7 @@ int UtcDaliImageVisualSetInvalidAsyncImage(void) 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 ); @@ -1184,7 +1184,7 @@ int UtcDaliImageVisualSetInvalidAsyncImage(void) 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; @@ -1217,7 +1217,7 @@ int UtcDaliImageVisualSetInvalidSyncImage(void) 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(); @@ -1225,7 +1225,7 @@ int UtcDaliImageVisualSetInvalidSyncImage(void) 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; @@ -1258,7 +1258,7 @@ int UtcDaliImageVisualSetInvalidRemoteImage(void) 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 ); @@ -1269,7 +1269,7 @@ int UtcDaliImageVisualSetInvalidRemoteImage(void) 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; @@ -1310,7 +1310,7 @@ int UtcDaliImageVisualAlphaMask(void) 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(); @@ -1365,7 +1365,7 @@ int UtcDaliImageVisualSynchronousLoadAlphaMask(void) 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. @@ -1421,7 +1421,7 @@ int UtcDaliImageVisualRemoteAlphaMask(void) 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(); @@ -1476,7 +1476,7 @@ int UtcDaliImageVisualAlphaMaskCrop(void) 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(); @@ -1522,7 +1522,7 @@ int UtcDaliImageVisualReleasePolicy01(void) 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 ); @@ -1572,7 +1572,7 @@ int UtcDaliImageVisualReleasePolicy02(void) 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 ); @@ -1623,7 +1623,7 @@ int UtcDaliImageVisualReleasePolicy03(void) 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 ); @@ -1679,7 +1679,7 @@ int UtcDaliImageVisualReleasePolicy04(void) 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 ); @@ -1762,7 +1762,7 @@ int UtcDaliImageVisualReleasePolicy06(void) 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 ); @@ -1829,7 +1829,7 @@ int UtcDaliImageVisualReleasePolicy07(void) 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 ); @@ -1889,7 +1889,7 @@ int UtcDaliImageVisualReleasePolicy08(void) 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 ); @@ -1907,7 +1907,7 @@ int UtcDaliImageVisualReleasePolicy08(void) // 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(); @@ -1918,7 +1918,7 @@ int UtcDaliImageVisualReleasePolicy08(void) // 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(); @@ -1986,7 +1986,7 @@ int UtcDaliImageVisualLoadPolicy01(void) 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 ); @@ -2040,7 +2040,7 @@ int UtcDaliImageVisualLoadPolicy02(void) 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 ); @@ -2168,7 +2168,7 @@ int UtcDaliImageVisualLoadPolicy05(void) actor.ResourceReadySignal().Connect( &ResourceReadySignal); Impl::DummyControl& dummyImpl = static_cast(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 ); @@ -2221,7 +2221,7 @@ int UtcDaliImageVisualOrientationCorrection(void) tet_infoline( "Create control for visual, need to loaded it" ); DummyControl actor = DummyControl::New(true); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); // Wait for image to load @@ -2289,7 +2289,7 @@ int UtcDaliImageVisualCustomShader(void) 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(); @@ -2321,7 +2321,7 @@ int UtcDaliImageVisualCustomShader(void) 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 ); @@ -2380,7 +2380,7 @@ int UtcDaliImageVisualLoadReady01(void) actor.ResourceReadySignal().Connect( &ResourceReadySignal); Impl::DummyControl& dummyImpl = static_cast(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 ); @@ -2415,7 +2415,7 @@ int UtcDaliImageVisualLoadReady01(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp index 8dcb505..c1ada404 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp @@ -272,11 +272,11 @@ int UtcDaliItemLayoutSetAndGetOrientation(void) 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); @@ -587,11 +587,11 @@ int UtcDaliItemLayoutSetAndGetLayoutProperties(void) 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; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp index 8b011b8..5bf99c4 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp @@ -289,7 +289,7 @@ int UtcDaliItemViewActivateLayoutAndGetActiveLayout(void) 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 @@ -326,7 +326,7 @@ int UtcDaliItemViewDeactivateCurrentLayout(void) 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 @@ -354,7 +354,7 @@ int UtcDaliItemViewGetItemAndGetItemId(void) 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 @@ -379,7 +379,7 @@ int UtcDaliItemViewRemoveItem(void) 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 @@ -434,7 +434,7 @@ int UtcDaliItemViewGetCurrentLayoutPosition(void) 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 @@ -538,7 +538,7 @@ int UtcDaliItemViewScrollToItem(void) 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); @@ -595,7 +595,7 @@ int UtcDaliItemViewScrollToItem(void) tet_result(TET_FAIL); } - Stage::GetCurrent().Remove(view); + application.GetScene().Remove(view); END_TEST; } @@ -629,7 +629,7 @@ int UtcDaliItemViewInsertItemP(void) 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 @@ -686,7 +686,7 @@ int UtcDaliItemViewInsertItemsP(void) 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(); @@ -757,7 +757,7 @@ int UtcDaliItemViewReplaceItemP(void) 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(); @@ -783,7 +783,7 @@ int UtcDaliItemViewReplaceItemsP(void) 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; @@ -821,7 +821,7 @@ int UtcDaliItemViewGetItemsRangeP(void) 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); @@ -846,7 +846,7 @@ int UtcDaliItemViewSetItemsAnchorPointP(void) 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); @@ -871,7 +871,7 @@ int UtcDaliItemViewSetItemsParentOriginP(void) 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); @@ -903,7 +903,7 @@ int UtcDaliItemViewLayoutActivatedSignalP(void) 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 ); @@ -915,7 +915,7 @@ int UtcDaliItemViewLayoutActivatedSignalP(void) 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 @@ -1089,7 +1089,7 @@ int UtcDaliItemViewSetGetProperty(void) int UtcDaliItemViewOvershootVertical(void) { ToolkitTestApplication application; - Dali::Stage stage = Dali::Stage::GetCurrent(); + Dali::Integration::Scene stage = application.GetScene(); // Create the ItemView actor TestItemFactory factory; @@ -1155,7 +1155,7 @@ int UtcDaliItemViewOvershootVertical(void) int UtcDaliItemViewOvershootHorizontal(void) { ToolkitTestApplication application; - Dali::Stage stage = Dali::Stage::GetCurrent(); + Dali::Integration::Scene stage = application.GetScene(); // Create the ItemView actor TestItemFactory factory; @@ -1217,7 +1217,7 @@ int UtcDaliItemViewOvershootHorizontal(void) int UtcDaliItemEnableDisableRefresh(void) { ToolkitTestApplication application; - Dali::Stage stage = Dali::Stage::GetCurrent(); + Dali::Integration::Scene stage = application.GetScene(); // Create the ItemView actor TestItemFactory factory; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp old mode 100755 new mode 100644 index 0e006ec..982da9c --- a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -146,7 +146,7 @@ int UtcDaliKeyInputFocusManagerGet(void) 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"); @@ -176,7 +176,7 @@ int UtcDaliKeyInputFocusManagerSetFocus01(void) 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"); @@ -217,7 +217,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation01(void) { 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"); @@ -266,7 +266,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation02(void) { 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"); @@ -310,7 +310,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation02(void) 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)"); @@ -362,7 +362,7 @@ int UtcDaliKeyInputFocusManagerGetCurrentFocusControl(void) 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. "); @@ -393,7 +393,7 @@ int UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged(void) { ToolkitTestApplication application; KeyInputFocusManager manager = KeyInputFocusManager::Get(); - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); tet_infoline(" UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged"); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp old mode 100755 new mode 100644 index d6fd3fa..40947b2 --- a/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -298,12 +298,12 @@ int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void) // 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(); @@ -327,7 +327,7 @@ int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void) 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); @@ -369,12 +369,12 @@ int UtcDaliKeyboardFocusManagerMoveFocus(void) // 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); @@ -425,7 +425,7 @@ int UtcDaliKeyboardFocusManagerMoveFocus(void) // 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(); @@ -532,12 +532,12 @@ int UtcDaliKeyboardFocusManagerCustomAlgorithmMoveFocus(void) // 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); @@ -626,8 +626,8 @@ int UtcDaliKeyboardFocusManagerFocusablePropertiesMoveFocus(void) 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); @@ -691,7 +691,7 @@ int UtcDaliKeyboardFocusManagerFocusablePropertiesMoveFocus(void) // 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); @@ -733,12 +733,12 @@ int UtcDaliKeyboardFocusManagerClearFocus(void) // 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); @@ -820,7 +820,7 @@ int UtcDaliKeyboardFocusManagerGetFocusGroup(void) 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(); @@ -903,12 +903,12 @@ int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void) // 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); @@ -1003,22 +1003,22 @@ int UtcDaliKeyboardFocusManagerMoveFocusBackward(void) // 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); @@ -1060,7 +1060,7 @@ int UtcDaliKeyboardFocusManagerMoveFocusBackward(void) { Actor actor = Actor::New(); actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(actor); + application.GetScene().Add(actor); manager.SetCurrentFocusActor(actor); } @@ -1105,7 +1105,7 @@ int UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents(void) // 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(); @@ -1303,12 +1303,12 @@ int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void) // 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); @@ -1362,7 +1362,7 @@ int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void) // 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(); @@ -1502,7 +1502,7 @@ int UtcDaliKeyboardFocusManagerFocusedActorUnstaged(void) 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 ); @@ -1524,7 +1524,7 @@ int UtcDaliKeyboardFocusManagerEnableFocusIndicator(void) 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 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Magnifier.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Magnifier.cpp index a451e34..984518f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Magnifier.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Magnifier.cpp @@ -45,7 +45,7 @@ int UtcDaliMagnifierNew(void) magnifier = Magnifier::New(); DALI_TEST_CHECK( magnifier ); - Stage::GetCurrent().Add( magnifier ); + application.GetScene().Add( magnifier ); application.SendNotification(); application.Render(); @@ -115,7 +115,7 @@ int UtcDaliMagnifierSetSourceActorP(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); Magnifier view = Magnifier::New(); stage.Add( view ); @@ -163,7 +163,7 @@ int UtcDaliMagnifierFrameVisibility(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); Magnifier view = Magnifier::New(); stage.Add( view ); @@ -196,7 +196,7 @@ int UtcDaliMagnifierMagnificationFactor(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); Magnifier view = Magnifier::New(); stage.Add( view ); @@ -231,7 +231,7 @@ int UtcDaliMagnifierSourcePosition(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); Magnifier view = Magnifier::New(); stage.Add( view ); @@ -262,7 +262,7 @@ int UtcDaliMagnifierOnSizeSet(void) Magnifier view = Magnifier::New(); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp index 3f30df1..b13cacb 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -123,7 +123,7 @@ int UtcDaliModelViewPropertyNames(void) 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; } @@ -142,9 +142,9 @@ int UtcDaliModelViewAddRemove(void) 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 ) ); @@ -199,7 +199,7 @@ int UtcDaliModelOnSizeSet(void) Model3dView view = Toolkit::Model3dView::New(); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp index 78165d7..f6b9929 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-NavigationView.cpp @@ -64,7 +64,7 @@ int UtcDaliNavigationViewNew(void) navigationView = NavigationView::New(); DALI_TEST_CHECK( navigationView ); - Stage::GetCurrent().Add( navigationView ); + application.GetScene().Add( navigationView ); application.SendNotification(); application.Render(); @@ -115,7 +115,7 @@ int UtcDaliNavigationViewPush(void) { 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(); @@ -137,7 +137,7 @@ int UtcDaliNavigationViewPop(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); // 1 Create Navigation View NavigationView naviView = NavigationView::New(); @@ -172,7 +172,7 @@ int UtcDaliNavigationViewPushAndPop(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); // 1 Create Navigation View NavigationView naviView = NavigationView::New(); @@ -214,7 +214,7 @@ int UtcDaliNavigationViewPreventLastPop(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); // 1 Create Navigation View NavigationView naviView = NavigationView::New(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp index 9342992..040dd15 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -354,7 +354,7 @@ int UtcDaliPageTurnViewSetGetProperty(void) 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 ); @@ -402,10 +402,10 @@ int UtcDaliPageTurnPortraitViewSignals(void) 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(); @@ -540,10 +540,10 @@ int UtcDaliPageTurnLanscapeViewSignals(void) */ 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(); @@ -666,12 +666,12 @@ int UtcDaliPageTurnEmptyTextureHandle(void) 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); } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp old mode 100755 new mode 100644 index 9c5820e..e08b4b4 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -357,7 +357,7 @@ int UtcDaliPopupSetContentP(void) // 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). @@ -402,7 +402,7 @@ int UtcDaliPopupSetFooterP(void) // 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 ); @@ -446,7 +446,7 @@ int UtcDaliPopupSetControlFooterMultiple(void) // 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 ); @@ -641,7 +641,7 @@ int UtcDaliPopupPropertyTailVisibility(void) // 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 ); @@ -681,7 +681,7 @@ int UtcDaliPopupOnTouchedOutsideSignal(void) 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 ); @@ -753,7 +753,7 @@ int UtcDaliPopupPropertyAutoHide(void) 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 ); @@ -793,7 +793,7 @@ int UtcDaliPopupPropertyAnimationMode(void) 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" }; @@ -960,7 +960,7 @@ int UtcDaliPopupPropertyContextualMode(void) 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 ); @@ -1004,7 +1004,7 @@ int UtcDaliPopupPropertyBacking(void) // 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 ); @@ -1063,7 +1063,7 @@ int UtcDaliPopupPropertyBackgroundImage(void) // 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" ); @@ -1126,7 +1126,7 @@ int UtcDaliPopupPropertyCustomAnimation(void) 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++ ) @@ -1182,7 +1182,7 @@ int UtcDaliPopupPropertyTouchTransparent(void) button.ClickedSignal().Connect( &PushButtonClicked ); - Stage::GetCurrent().Add( button ); + application.GetScene().Add( button ); button.Add( popup ); @@ -1281,7 +1281,7 @@ int UtcDaliPopupPropertyTail(void) 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(); @@ -1363,7 +1363,7 @@ int UtcDaliPopupTypeToast(void) 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++ ) @@ -1412,7 +1412,7 @@ int UtcDaliPopupTypeRegistryCreation(void) 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(); @@ -1472,7 +1472,7 @@ int UtcDaliPopupOnKeyEvent(void) // 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp index d6f125d..395bd31 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -141,10 +141,10 @@ int UtcDaliProgressBarSignals(void) // 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 ); @@ -174,10 +174,10 @@ int UtcDaliProgressBarSetPropertyP(void) 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(); @@ -321,11 +321,11 @@ int UtcDaliProgressBarSetPropertyP1(void) 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(); @@ -414,8 +414,8 @@ int UtcDaliProgressBarSetPropertyP2(void) 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(); @@ -438,8 +438,8 @@ int UtcDaliProgressBarSetPropertyP3(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp index 1d18496..4d0de67 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp @@ -469,7 +469,7 @@ int UtcDaliPushButtonPressed(void) 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(); @@ -502,7 +502,7 @@ int UtcDaliPushButtonReleased(void) 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(); @@ -585,7 +585,7 @@ int UtcDaliPushButtonSelected(void) 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(); @@ -737,7 +737,7 @@ int UtcDaliPushButtonPaddingLayout(void) 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(); @@ -786,7 +786,7 @@ int UtcDaliPushButtonPaddingLayout(void) 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" ); @@ -884,7 +884,7 @@ int UtcDaliPushButtonAlignmentLayout(void) 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" ); @@ -1044,7 +1044,7 @@ int UtcDaliPushButtonSetUnSelectedVisual01P(void) 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); @@ -1064,7 +1064,7 @@ int UtcDaliPushButtonSetUnSelectedVisual01P(void) 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 ); @@ -1080,7 +1080,7 @@ int UtcDaliPushButtonSetUnSelectedVisual01P(void) 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() ); @@ -1101,7 +1101,7 @@ int UtcDaliPushButtonSetSelectedVisualN(void) 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); @@ -1109,7 +1109,7 @@ int UtcDaliPushButtonSetSelectedVisualN(void) 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); @@ -1121,7 +1121,7 @@ int UtcDaliPushButtonSetSelectedVisualN(void) 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); @@ -1142,7 +1142,7 @@ int UtcDaliPushButtonToggleSignalP(void) SetupButtonForTestTouchEvents( application, button, true ); - Stage::GetCurrent().Add( button ); + application.GetScene().Add( button ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp index bf33b39..666ce5c 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -185,7 +185,7 @@ int UtcDaliRadioButtonSelectedProperty(void) // 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 )); @@ -217,7 +217,7 @@ int UtcDaliRadioButtonSelectedProperty(void) 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 )); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp index 609621a..676bebd 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp @@ -277,11 +277,11 @@ int UtcDaliToolkitScrollBarSetScrollPropertySourceP(void) 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 ); @@ -359,7 +359,7 @@ int UtcDaliToolkitScrollBarSetScrollPropertySourceP(void) // 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 ); @@ -523,7 +523,7 @@ int UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(void) 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 ); @@ -534,7 +534,7 @@ int UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(void) // 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 ); @@ -706,11 +706,11 @@ int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void) 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 ); @@ -798,7 +798,7 @@ int UtcDaliToolkitScrollBarSetIndicatorFixedHeightP(void) 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 ); @@ -858,7 +858,7 @@ int UtcDaliToolkitScrollBarSetIndicatorShowDurationP(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -938,7 +938,7 @@ int UtcDaliToolkitScrollBarSetIndicatorShowDurationN(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1030,7 +1030,7 @@ int UtcDaliToolkitScrollBarSetIndicatorHideDurationP(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1110,7 +1110,7 @@ int UtcDaliToolkitScrollBarSetIndicatorHideDurationN(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1202,7 +1202,7 @@ int UtcDaliToolkitScrollBarShowIndicatorP(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1247,7 +1247,7 @@ int UtcDaliToolkitScrollBarShowIndicatorN(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1289,7 +1289,7 @@ int UtcDaliToolkitScrollBarHideIndicatorP(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1334,7 +1334,7 @@ int UtcDaliToolkitScrollBarHideIndicatorN(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1376,7 +1376,7 @@ int UtcDaliToolkitScrollBarActionShowIndicator(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1422,7 +1422,7 @@ int UtcDaliToolkitScrollBarActionHideIndicator(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1468,7 +1468,7 @@ int UtcDaliToolkitScrollBarActionShowTransientIndicator(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1532,7 +1532,7 @@ int UtcDaliToolkitScrollBarActionShowTransientIndicatorImmediate(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1592,7 +1592,7 @@ int UtcDaliToolkitScrollBarActionShowTransientIndicatorDuringHide(void) ScrollBar scrollBar = ScrollBar::New(); DALI_TEST_CHECK( scrollBar ); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); Actor indicator = scrollBar.GetScrollIndicator(); DALI_TEST_CHECK( indicator ); @@ -1685,7 +1685,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void) scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed); scrollBar.SetIndicatorFixedHeight(50.0f); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); // Connect the pan finished signal ConnectionTracker connectionTracker; @@ -1699,7 +1699,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void) // 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 ); @@ -1743,7 +1743,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void) scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed); scrollBar.SetIndicatorFixedHeight(50.0f); - Stage::GetCurrent().Add( scrollBar ); + application.GetScene().Add( scrollBar ); // Connect the pan finished signal ConnectionTracker connectionTracker; @@ -1761,7 +1761,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void) // 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 ); @@ -1806,7 +1806,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void) 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 @@ -1820,7 +1820,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void) // 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 ); @@ -1922,7 +1922,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void) 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 ); @@ -1933,7 +1933,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void) // 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp index 22f2181..a6c1e57 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -383,7 +383,7 @@ int UtcDaliToolkitScrollViewScrollToPositionP(void) // 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); @@ -404,7 +404,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP(void) 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 ); @@ -447,7 +447,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionP(void) // 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); @@ -476,7 +476,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP(v 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 ); @@ -524,7 +524,7 @@ int UtcDaliToolkitScrollViewScrollToPageP(void) 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 ); @@ -606,7 +606,7 @@ int UtcDaliToolkitScrollModeP1(void) 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 ); @@ -663,7 +663,7 @@ int UtcDaliToolkitScrollModeP2(void) 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 ); @@ -721,7 +721,7 @@ int UtcDaliToolkitScrollModeP3(void) 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 ); @@ -776,7 +776,7 @@ int UtcDaliToolkitScrollModeP4(void) scrollView.SetWrapMode( false ); scrollView.SetScrollSensitive( true ); - Stage::GetCurrent().Add( scrollView ); + application.GetScene().Add( scrollView ); Vector2 START_POSITION = Vector2(10.0f, 10.0f); @@ -817,7 +817,7 @@ int UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP(void) 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 ); @@ -859,7 +859,7 @@ int UtcDaliToolkitScrollViewScrollToActorP(void) 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); @@ -898,7 +898,7 @@ int UtcDaliToolkitScrollViewScrollToSnapPointP(void) 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 ); @@ -940,7 +940,7 @@ int UtcDaliToolkitScrollViewSetWrapModeP(void) tet_infoline(" UtcDaliToolkitScrollViewSetWrapModeP"); ScrollView scrollView = ScrollView::New(); - Stage::GetCurrent().Add( scrollView ); + application.GetScene().Add( scrollView ); Actor actor = Actor::New(); scrollView.Add( actor ); @@ -971,7 +971,7 @@ int UtcDaliToolkitScrollViewActorAutoSnap(void) tet_infoline(" UtcDaliToolkitScrollViewActorAutoSnap"); ScrollView scrollView = ScrollView::New(); - Stage::GetCurrent().Add( scrollView ); + application.GetScene().Add( scrollView ); // Position rulers. RulerPtr rulerX = new DefaultRuler(); @@ -1022,7 +1022,7 @@ int UtcDaliToolkitScrollViewSignalsStartComplete(void) gOnScrollCompleteCalled = false; ScrollView scrollView = ScrollView::New(); - Stage::GetCurrent().Add( scrollView ); + application.GetScene().Add( scrollView ); // Position rulers. RulerPtr rulerX = new DefaultRuler(); @@ -1052,8 +1052,8 @@ int UtcDaliToolkitScrollViewSignalsUpdate01(void) 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); @@ -1114,8 +1114,8 @@ int UtcDaliToolkitScrollViewSignalsUpdate02(void) 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); @@ -1168,7 +1168,7 @@ int UtcDaliToolkitScrollViewSignalsUpdate02(void) DALI_TEST_CHECK(scrollUpdated); DALI_TEST_CHECK(scrollCompleted); - Stage::GetCurrent().Remove( scrollView ); + application.GetScene().Remove( scrollView ); END_TEST; } @@ -1181,8 +1181,8 @@ int UtcDaliToolkitScrollViewScrollSensitive(void) // 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); @@ -1228,8 +1228,8 @@ int UtcDaliToolkitScrollViewAxisAutoLock(void) // 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); @@ -1333,8 +1333,8 @@ int UtcDaliToolkitScrollViewConstraints(void) // 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); @@ -1378,8 +1378,8 @@ int UtcDaliToolkitScrollViewBind(void) // 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); @@ -1439,8 +1439,8 @@ int UtcDaliToolkitScrollViewOvershoot(void) scrollView.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, overshootSize ); DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get(), 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); @@ -1571,8 +1571,8 @@ int UtcDaliToolkitScrollViewSnapStartedSignalP(void) // 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); @@ -1610,7 +1610,7 @@ int UtcDaliToolkitScrollViewGetCurrentPageP(void) 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 ); @@ -1641,8 +1641,8 @@ int UtcDaliToolkitScrollViewSetMaxOvershootP(void) // 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); @@ -1732,8 +1732,8 @@ int UtcDaliToolkitScrollViewSetScrollingDirectionP(void) // 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); @@ -1818,8 +1818,8 @@ int UtcDaliToolkitScrollViewRemoveScrollingDirectionP(void) // 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); @@ -1882,7 +1882,7 @@ int UtcDaliToolkitScrollViewSetRulerXP(void) 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) ); @@ -1910,7 +1910,7 @@ int UtcDaliToolkitScrollViewSetRulerYP(void) 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) ); @@ -2641,8 +2641,8 @@ int UtcDaliToolkitScrollViewConstraintsMove(void) // 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); @@ -2686,8 +2686,8 @@ int UtcDaliToolkitScrollViewConstraintsWrap(void) // 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); @@ -2763,7 +2763,7 @@ int UtcDaliToolkitScrollViewGesturePageLimit(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp index 911e537..fa26940 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -132,7 +132,7 @@ static void OnScrollComplete( const Vector2& position ) gOnScrollCompleteCalled = true; } -ScrollView SetupTestScrollView(int rows, int columns, Vector2 size) +ScrollView SetupTestScrollView(Integration::Scene scene, int rows, int columns, Vector2 size) { Constraint constraint; @@ -149,7 +149,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size) 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) @@ -171,7 +171,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size) 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); @@ -238,9 +238,9 @@ int UtcDaliScrollViewPagePathEffectTest(void) 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); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ShadowView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ShadowView.cpp index 963deea..6a4dc31 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ShadowView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ShadowView.cpp @@ -119,9 +119,9 @@ int UtcDaliShadowViewAddRemove(void) 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 ) ); @@ -140,21 +140,21 @@ int UtcDaliShadowViewActivateDeactivate(void) 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; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp index 1fdf9c0..7bada65 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -128,10 +128,10 @@ int UtcDaliSliderSignals1(void) // 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; @@ -225,10 +225,10 @@ int UtcDaliSliderSignals2(void) // 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; @@ -291,10 +291,10 @@ int UtcDaliSetPropertyP(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp index 247fa58..ada8a41 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -197,16 +197,16 @@ int UtcDaliSuperBlurViewSetTexture(void) 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; @@ -215,7 +215,7 @@ int UtcDaliSuperBlurViewSetTexture(void) int UtcDaliSuperBlurViewSetTexture2(void) { ToolkitTestApplication application; - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); tet_infoline(" UtcDaliSuperBlurViewSetTexture2 - test setting a second texture "); @@ -227,7 +227,7 @@ int UtcDaliSuperBlurViewSetTexture2(void) 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 ); @@ -238,7 +238,7 @@ int UtcDaliSuperBlurViewSetTexture2(void) 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"); @@ -248,11 +248,11 @@ int UtcDaliSuperBlurViewSetTexture2(void) 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 ); @@ -260,7 +260,7 @@ int UtcDaliSuperBlurViewSetTexture2(void) 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"); @@ -278,7 +278,7 @@ int UtcDaliSuperBlurViewSetProperty(void) 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 @@ -287,7 +287,7 @@ int UtcDaliSuperBlurViewSetProperty(void) // 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); @@ -309,7 +309,7 @@ int UtcDaliSuperBlurViewGetProperty(void) 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( SuperBlurView::Property::IMAGE_URL ); DALI_TEST_EQUALS( imageUrl, TEST_IMAGE_FILE_NAME, TEST_LOCATION ); @@ -391,13 +391,13 @@ int UtcDaliSuperBlurViewBlurSignal(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp index 6beeda4..1dd4c80 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp @@ -68,12 +68,12 @@ struct Constraint100 }; // 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(); @@ -134,7 +134,7 @@ int UtcDaliTableViewMetricsPadding(void) 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)); @@ -168,7 +168,7 @@ int UtcDaliTableViewMetricsFit(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); application.SendNotification(); application.Render(); @@ -221,7 +221,7 @@ int UtcDaliTableViewMetricsFixed(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); application.SendNotification(); application.Render(); @@ -257,7 +257,7 @@ int UtcDaliTableViewMetricsRelative(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); application.SendNotification(); application.Render(); @@ -711,7 +711,7 @@ int UtcDaliTableViewChildProperties(void) // 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 ); @@ -874,7 +874,7 @@ int UtcDaliTableViewKeyboardFocus(void) } } - Stage::GetCurrent().Add( tableView ); + application.GetScene().Add( tableView ); application.SendNotification(); application.Render(); @@ -979,7 +979,7 @@ int UtcDaliTableViewKeyboardFocusInNestedTableView(void) } } - Stage::GetCurrent().Add( tableView ); + application.GetScene().Add( tableView ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp old mode 100755 new mode 100644 index f03a330..51b1cd7 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -475,7 +475,7 @@ int UtcDaliTextEditorSetPropertyP(void) 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 @@ -876,7 +876,7 @@ int utcDaliTextEditorAtlasRenderP(void) application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); - Stage::GetCurrent().Add( editor ); + application.GetScene().Add( editor ); try { @@ -900,7 +900,7 @@ int utcDaliTextEditorTextChangedP(void) 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(); @@ -963,7 +963,7 @@ int utcDaliTextEditorInputStyleChanged01(void) bool inputStyleChangedSignal = false; editor.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) ); - Stage::GetCurrent().Add( editor ); + application.GetScene().Add( editor ); // Render and notify application.SendNotification(); @@ -1177,7 +1177,7 @@ int utcDaliTextEditorInputStyleChanged02(void) bool inputStyleChangedSignal = false; editor.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) ); - Stage::GetCurrent().Add( editor ); + application.GetScene().Add( editor ); // Render and notify application.SendNotification(); @@ -1399,7 +1399,7 @@ int utcDaliTextEditorEvent01(void) 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 ); @@ -1446,7 +1446,7 @@ int utcDaliTextEditorEvent01(void) 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(); @@ -1484,7 +1484,7 @@ int utcDaliTextEditorEvent02(void) 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 ); @@ -1618,7 +1618,7 @@ int utcDaliTextEditorEvent03(void) 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 ); @@ -1711,7 +1711,7 @@ int utcDaliTextEditorEvent04(void) 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 ); @@ -1800,7 +1800,7 @@ int utcDaliTextEditorEvent05(void) 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 ); @@ -1882,7 +1882,7 @@ int utcDaliTextEditorEvent06(void) 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 ); @@ -1972,7 +1972,7 @@ int utcDaliTextEditorEvent07(void) 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 ); @@ -2116,7 +2116,7 @@ int utcDaliTextEditorEvent08(void) 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 ); @@ -2310,7 +2310,7 @@ int utcDaliTextEditorHandles(void) 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 ); @@ -2429,7 +2429,7 @@ int utcDaliTextEditorUnderPropertyStringP(void) 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( TextEditor::Property::UNDERLINE ), underlineSettings1, TEST_LOCATION ); @@ -2473,7 +2473,7 @@ int utcDaliTextEditorShadowPropertyStringP(void) 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\"}" ); @@ -2495,7 +2495,7 @@ int utcDaliTextEditorFontStylePropertyStringP(void) 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\"}" ); @@ -2521,7 +2521,7 @@ int utcDaliTextEditorGetPropertyLinecountP(void) 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( TextEditor::Property::LINE_COUNT ); @@ -2543,7 +2543,7 @@ int utcDaliTextEditorScrollStateChangedSignalTest(void) 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 ) ); @@ -2586,7 +2586,7 @@ int UtcDaliToolkitTextEditorTextWrapMode(void) 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 ); @@ -2637,7 +2637,7 @@ int UtcDaliTextEditorSetPaddingProperty(void) 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(); @@ -2670,7 +2670,7 @@ int UtcDaliTextEditorEnableShiftSelectionProperty(void) 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(); @@ -2698,7 +2698,7 @@ int UtcDaliTextEditorEnableGrabHandleProperty(void) 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(); @@ -2726,7 +2726,7 @@ int UtcDaliTextEditorMatchSystemLanguageDirectionProperty(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp old mode 100755 new mode 100644 index b83c5e5..4751e34 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -502,7 +502,7 @@ int UtcDaliTextFieldSetPropertyP(void) 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 @@ -959,7 +959,7 @@ int utcDaliTextFieldAtlasRenderP(void) application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); try { @@ -983,7 +983,7 @@ int utcDaliTextFieldTextChangedP(void) 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(); @@ -1015,7 +1015,7 @@ int utcDaliTextFieldTextChangedN(void) 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(); @@ -1039,7 +1039,7 @@ int utcDaliTextFieldMaxCharactersReachedP(void) 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 ); @@ -1071,7 +1071,7 @@ int utcDaliTextFieldMaxCharactersReachedN(void) 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 ); @@ -1139,7 +1139,7 @@ int utcDaliTextFieldInputStyleChanged01(void) bool inputStyleChangedSignal = false; field.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); // Render and notify application.SendNotification(); @@ -1347,7 +1347,7 @@ int utcDaliTextFieldInputStyleChanged02(void) bool inputStyleChangedSignal = false; field.ConnectSignal( testTracker, "inputStyleChanged", CallbackFunctor(&inputStyleChangedSignal) ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); // Render and notify application.SendNotification(); @@ -1528,7 +1528,7 @@ int utcDaliTextFieldEvent01(void) 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 ); @@ -1585,7 +1585,7 @@ int utcDaliTextFieldEvent01(void) 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(); @@ -1624,7 +1624,7 @@ int utcDaliTextFieldEvent02(void) 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 ); @@ -1775,7 +1775,7 @@ int utcDaliTextFieldEvent03(void) 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 ); @@ -1832,7 +1832,7 @@ int utcDaliTextFieldEvent04(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -1885,7 +1885,7 @@ int utcDaliTextFieldEvent05(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -1936,7 +1936,7 @@ int utcDaliTextFieldEvent06(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -1987,7 +1987,7 @@ int utcDaliTextFieldEvent07(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -2030,7 +2030,7 @@ int utcDaliTextFieldEvent08(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -2067,7 +2067,7 @@ int utcDaliTextFieldEvent08(void) Wait(application, 500); - Stage stage = Stage::GetCurrent(); + Integration::Scene stage = application.GetScene(); Layer layer = stage.GetRootLayer(); Actor actor = layer.FindChildByName("optionPaste"); @@ -2098,7 +2098,7 @@ int utcDaliTextFieldEvent09(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -2185,7 +2185,7 @@ int utcDaliTextFieldStyleWhilstSelected(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -2293,7 +2293,7 @@ int utcDaliTextFieldEscKeyLoseFocus(void) 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 ); @@ -2367,7 +2367,7 @@ int utcDaliTextFieldSomeSpecialKeys(void) TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); LoadMarkerImages(application, field); // Render and notify application.SendNotification(); @@ -2446,7 +2446,7 @@ int utcDaliTextFieldSizeUpdate(void) // 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; @@ -2496,7 +2496,7 @@ int utcDaliTextFieldExtremlyLargePointSize(void) 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 { @@ -2517,7 +2517,7 @@ int UtcDaliTextFieldDefaultFontStylePropertyCoverage(void) tet_infoline("UtcDaliTextFieldFontStylePorpertyCoverage"); TextField field = TextField::New(); DALI_TEST_CHECK( field ); - Stage::GetCurrent().Add( field ); + application.GetScene().Add( field ); Property::Map fontStyleMapGet; @@ -2543,7 +2543,7 @@ int UtcDaliTextFieldSettingPlaceholder(void) 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; @@ -2626,7 +2626,7 @@ int UtcDaliTextFieldSetPaddingProperty(void) 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(); @@ -2659,7 +2659,7 @@ int UtcDaliTextFieldEnableShiftSelectionProperty(void) 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(); @@ -2687,7 +2687,7 @@ int UtcDaliTextFieldEnableGrabHandleProperty(void) 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(); @@ -2715,7 +2715,7 @@ int UtcDaliTextFieldMatchSystemLanguageDirectionProperty(void) 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(); @@ -2743,7 +2743,7 @@ int utcDaliTextFieldLayoutDirectionCoverage(void) 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 ); @@ -2832,7 +2832,7 @@ int UtcDaliTextFieldSelectWholeText(void) 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 ); @@ -2884,7 +2884,7 @@ int UtcDaliTextFieldSelectNone(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp old mode 100755 new mode 100644 index 07052fc..884079e --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -286,7 +286,7 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) 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 ); @@ -660,7 +660,7 @@ int UtcDaliToolkitTextlabelAtlasRenderP(void) // 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" ); @@ -709,7 +709,7 @@ int UtcDaliToolkitTextLabelLanguagesP(void) TextLabel label = TextLabel::New(); DALI_TEST_CHECK( label ); - Stage::GetCurrent().Add( label ); + application.GetScene().Add( label ); const std::string scripts( " привет мир, γειά σου Κόσμε, Hello world, مرحبا بالعالم, שלום עולם, " "բարեւ աշխարհը, მსოფლიოში, 안녕하세요, 你好世界, ひらがな, カタカナ, " @@ -734,7 +734,7 @@ int UtcDaliToolkitTextLabelEmojisP(void) TextLabel label = TextLabel::New(); DALI_TEST_CHECK( label ); - Stage::GetCurrent().Add( label ); + application.GetScene().Add( label ); TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get(); @@ -777,7 +777,7 @@ int UtcDaliToolkitTextlabelScrollingP(void) 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 ); @@ -785,7 +785,7 @@ int UtcDaliToolkitTextlabelScrollingP(void) 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 ); @@ -833,7 +833,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignP(void) 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" ); @@ -842,7 +842,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignP(void) 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" ); @@ -883,7 +883,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void) 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" ); @@ -892,7 +892,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void) 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" ); @@ -933,7 +933,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignP(void) 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" ); @@ -942,7 +942,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignP(void) 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" ); @@ -983,7 +983,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void) 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" ); @@ -992,7 +992,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void) 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" ); @@ -1031,7 +1031,7 @@ int UtcDaliToolkitTextlabelScrollingInterruptedP(void) 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 ); @@ -1084,7 +1084,7 @@ int UtcDaliToolkitTextlabelScrollingN(void) 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 ); @@ -1115,7 +1115,7 @@ int UtcDaliToolkitTextlabelScrollingWithEllipsis(void) 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 ); @@ -1163,7 +1163,7 @@ int UtcDaliToolkitTextlabelEllipsis(void) // 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 ); @@ -1230,7 +1230,7 @@ int UtcDaliToolkitTextlabelTextWrapMode(void) //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 ); @@ -1303,7 +1303,7 @@ int UtcDaliToolkitTextLabelColorComponents(void) 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 ); @@ -1343,7 +1343,7 @@ int UtcDaliToolkitTextlabelTextStyle01(void) 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; @@ -1412,7 +1412,7 @@ int UtcDaliToolkitTextlabelMultiline(void) 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(); @@ -1442,7 +1442,7 @@ int UtcDaliToolkitTextlabelTextDirection(void) 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 ); @@ -1473,7 +1473,7 @@ int UtcDaliToolkitTextlabelVerticalLineAlignment(void) 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 ); @@ -1521,7 +1521,7 @@ int UtcDaliToolkitTextLabelBitmapFont(void) // 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(); @@ -1562,7 +1562,7 @@ int UtcDaliToolkitTextlabelTextFit(void) 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(); @@ -1618,7 +1618,7 @@ int UtcDaliToolkitTextlabelMaxTextureSet(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp index c6bce30..04bbf79 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp @@ -205,7 +205,7 @@ int UtcDaliToolkitTextSelectionToolBarScrollView(void) TextSelectionToolbar toolbar = TextSelectionToolbar::New(); DALI_TEST_CHECK( toolbar ); - Stage::GetCurrent().Add( toolbar ); + application.GetScene().Add( toolbar ); Property::Map map; map["overshootEffectColor"] = Color::RED; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ToggleButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ToggleButton.cpp old mode 100755 new mode 100644 index a266532..8e6b54f --- a/automated-tests/src/dali-toolkit/utc-Dali-ToggleButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ToggleButton.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -171,7 +171,7 @@ int UtcDaliToggleButtonToggleStatesProperty(void) // 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 )); @@ -252,7 +252,7 @@ int UtcDaliToggleButtonToggleTipsProperty( void ) // 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 )); @@ -311,7 +311,7 @@ int UtcDaliToggleButtonStateChange(void) // 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp index 6eabaed..b83a7b1 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -512,7 +512,7 @@ int UtcDaliTooltipDisplay(void) 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(); @@ -520,7 +520,7 @@ int UtcDaliTooltipDisplay(void) 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 ); @@ -554,7 +554,7 @@ int UtcDaliTooltipDisplayWithTail(void) .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" )) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -562,7 +562,7 @@ int UtcDaliTooltipDisplayWithTail(void) 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 ); @@ -598,7 +598,7 @@ int UtcDaliTooltipDisplayWithContentArray(void) .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" )) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -606,7 +606,7 @@ int UtcDaliTooltipDisplayWithContentArray(void) 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 ); @@ -635,13 +635,13 @@ int UtcDaliTooltipDisplayBelow(void) .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 ); @@ -671,13 +671,13 @@ int UtcDaliTooltipDisplayAbove(void) .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 ); @@ -707,13 +707,13 @@ int UtcDaliTooltipDisplayAtHoverPoint(void) .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; @@ -747,7 +747,7 @@ int UtcDaliTooltipExceedThreshold(void) .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -756,7 +756,7 @@ int UtcDaliTooltipExceedThreshold(void) 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(); @@ -793,7 +793,7 @@ int UtcDaliTooltipGoOutOfBounds(void) 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(); @@ -802,7 +802,7 @@ int UtcDaliTooltipGoOutOfBounds(void) 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(); @@ -838,7 +838,7 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void) 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(); @@ -846,7 +846,7 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void) 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 ); @@ -886,7 +886,7 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void) .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -894,7 +894,7 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void) 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 ); @@ -930,7 +930,7 @@ int UtcDaliTooltipChangeContent(void) 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(); @@ -938,7 +938,7 @@ int UtcDaliTooltipChangeContent(void) 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" ); @@ -1009,7 +1009,7 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void) { 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(); @@ -1025,7 +1025,7 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void) .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -1051,7 +1051,7 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void) { 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(); @@ -1067,7 +1067,7 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void) .Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -1093,7 +1093,7 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void) { 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" ); @@ -1111,7 +1111,7 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void) ); control.SetProperty( Actor::Property::POSITION_X, -centerPoint.x ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -1138,7 +1138,7 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void) { 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" ); @@ -1156,7 +1156,7 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void) ); control.SetProperty( Actor::Property::POSITION_X, centerPoint.x ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp index 81bf496..3476f89 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -237,7 +237,7 @@ int UtcDaliTransitionDataMap1P(void) 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(actor.GetImplementation()); @@ -305,7 +305,7 @@ int UtcDaliTransitionDataMap2P(void) 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(actor.GetImplementation()); @@ -373,7 +373,7 @@ int UtcDaliTransitionDataMap2Pb(void) 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(actor.GetImplementation()); @@ -444,7 +444,7 @@ int UtcDaliTransitionDataMap3P(void) 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(actor.GetImplementation()); Animation anim = dummyImpl.CreateTransition( transition ); @@ -511,7 +511,7 @@ int UtcDaliTransitionDataMap4P(void) 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(actor.GetImplementation()); @@ -573,7 +573,7 @@ int UtcDaliTransitionDataMap5P(void) 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(actor.GetImplementation()); @@ -645,7 +645,7 @@ int UtcDaliTransitionDataMap6P(void) 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(actor.GetImplementation()); @@ -718,7 +718,7 @@ int UtcDaliTransitionDataMap1N(void) 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(actor.GetImplementation()); Animation anim = dummyImpl.CreateTransition( transition ); @@ -794,7 +794,7 @@ int UtcDaliTransitionDataMapN4(void) 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(actor.GetImplementation()); Property::Map visualMap; @@ -846,7 +846,7 @@ int UtcDaliTransitionDataMapN5(void) 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(actor.GetImplementation()); Property::Map visualMap; @@ -897,7 +897,7 @@ int UtcDaliTransitionDataMapN6(void) 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(actor.GetImplementation()); Property::Map visualMap; @@ -969,7 +969,7 @@ int UtcDaliTransitionDataArrayP(void) 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(actor.GetImplementation()); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp old mode 100755 new mode 100644 index b2874e2..e15a99a --- a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -152,7 +152,7 @@ int UtcDaliVideoViewProperty1b(void) 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; @@ -358,7 +358,7 @@ int UtcDaliVideoViewCustomShaderForCoverage(void) 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; @@ -387,7 +387,7 @@ int UtcDaliVideoViewMethodsForCoverage2(void) windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" ); - Stage::GetCurrent().Add( videoView ); + application.GetScene().Add( videoView ); application.SendNotification(); application.Render(); @@ -426,7 +426,7 @@ int UtcDaliVideoViewPropertyUnderlay(void) VideoView view = VideoView::New(); DALI_TEST_CHECK( view ); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); view.Play(); application.SendNotification(); @@ -474,7 +474,7 @@ int UtcDaliVideoViewPropertyPlayPosition(void) VideoView view = VideoView::New(); DALI_TEST_CHECK( view ); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); view.Play(); application.SendNotification(); @@ -501,7 +501,7 @@ int UtcDaliVideoViewNew2(void) VideoView view = VideoView::New( true ); DALI_TEST_CHECK( view ); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); view.Play(); application.SendNotification(); @@ -510,7 +510,7 @@ int UtcDaliVideoViewNew2(void) VideoView view2 = VideoView::New( "", false ); DALI_TEST_CHECK( view2 ); - Stage::GetCurrent().Add( view2 ); + application.GetScene().Add( view2 ); view2.Play(); application.SendNotification(); @@ -527,7 +527,7 @@ int UtcDaliVideoViewPropertyDisplayMode(void) VideoView view = VideoView::New(); DALI_TEST_CHECK( view ); - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); view.Play(); application.SendNotification(); @@ -555,7 +555,7 @@ int UtcDaliVideoViewCustomShader(void) 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 */ @@ -573,7 +573,7 @@ int UtcDaliVideoViewCustomShader(void) view.SetProperty( VideoView::Property::VIDEO, map ); /* do render for check custom shader */ - Stage::GetCurrent().Add( view ); + application.GetScene().Add( view ); view.Play(); application.SendNotification(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 74cab94..3e30104 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -248,7 +248,7 @@ int UtcDaliVisualSetGetDepthIndex(void) 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( Renderer::Property::DEPTH_INDEX ); @@ -418,13 +418,13 @@ int UtcDaliVisualSetOnOffStage(void) 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); @@ -455,7 +455,7 @@ int UtcDaliVisualSetOnOffStage2(void) DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); // First on/off - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); application.SendNotification(); application.Render(0); @@ -465,14 +465,14 @@ int UtcDaliVisualSetOnOffStage2(void) 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); @@ -482,7 +482,7 @@ int UtcDaliVisualSetOnOffStage2(void) textures = renderer.GetTextures(); DALI_TEST_CHECK( textures.GetTextureCount() != 0u ); - Stage::GetCurrent().Remove( actor ); + application.GetScene().Remove( actor ); application.SendNotification(); application.Render(0); @@ -618,7 +618,7 @@ int UtcDaliVisualGetPropertyMap2N(void) DummyControl dummyControl = DummyControl::New(true); Impl::DummyControl& dummyImpl = static_cast(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 ); @@ -1765,7 +1765,7 @@ int UtcDaliVisualAnimateBorderVisual01(void) 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); @@ -1833,7 +1833,7 @@ int UtcDaliVisualAnimateBorderVisual02(void) 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); @@ -1877,7 +1877,7 @@ int UtcDaliVisualAnimateColorVisual(void) 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); @@ -1933,7 +1933,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void) 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); @@ -2008,7 +2008,7 @@ int UtcDaliVisualAnimatedGradientVisual01(void) 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); @@ -2179,7 +2179,7 @@ int UtcDaliVisualAnimatedGradientVisual02(void) 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 ); @@ -2453,7 +2453,7 @@ int UtcDaliVisualAnimatedGradientVisual03(void) 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 ); @@ -2740,7 +2740,7 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis Impl::DummyControl& dummyImpl = static_cast(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 ); @@ -3036,7 +3036,7 @@ int UtcDaliNPatchVisualCustomShader(void) 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 ); @@ -3081,7 +3081,7 @@ int UtcDaliGradientVisualBlendMode(void) 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( control.GetImplementation() ); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, opaqueGradientVisual ); @@ -3119,7 +3119,7 @@ int UtcDaliVisualRendererRemovalAndReAddition(void) 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(); @@ -3127,7 +3127,7 @@ int UtcDaliVisualRendererRemovalAndReAddition(void) 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(); @@ -3135,7 +3135,7 @@ int UtcDaliVisualRendererRemovalAndReAddition(void) 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(); @@ -3181,7 +3181,7 @@ int UtcDaliVisualTextVisualRender(void) 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(); @@ -3250,7 +3250,7 @@ int UtcDaliVisualTextVisualDisableEnable(void) 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(); @@ -3378,7 +3378,7 @@ int UtcDaliRegisterVisualOrder(void) 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; } @@ -3414,7 +3414,7 @@ int UtcDaliRegisterVisualOrder02(void) 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; } @@ -3451,7 +3451,7 @@ int UtcDaliRegisterVisualWithDepthIndex(void) 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; } @@ -3532,7 +3532,7 @@ int UtcDaliSvgVisualCustomShader(void) 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(); @@ -3578,7 +3578,7 @@ int UtcDaliVisualRoundedCorner(void) 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(); @@ -3610,7 +3610,7 @@ int UtcDaliVisualRoundedCorner(void) 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(); @@ -3655,7 +3655,7 @@ int UtcDaliVisualRoundedCorner(void) 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(); @@ -3691,7 +3691,7 @@ int UtcDaliColorVisualBlurRadius(void) 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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index bad210c..2818d87 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -76,7 +76,7 @@ void TestVisualRender( ToolkitTestApplication& application, 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(); @@ -97,7 +97,7 @@ void TestVisualAsynchronousRender( ToolkitTestApplication& application, 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(); @@ -232,7 +232,7 @@ int UtcDaliVisualFactoryGetColorVisual2(void) 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; @@ -260,7 +260,7 @@ int UtcDaliVisualFactoryGetBorderVisual1(void) DummyControlImpl& dummyImpl = static_cast(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 ); @@ -308,7 +308,7 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) DummyControlImpl& dummyImpl = static_cast(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 ); @@ -340,7 +340,7 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) 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( Renderer::Property::BLEND_MODE ); DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::ON, TEST_LOCATION ); @@ -459,7 +459,7 @@ int UtcDaliVisualFactoryDefaultOffsetsGradientVisual(void) 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; @@ -771,7 +771,7 @@ int UtcDaliVisualFactoryGetNPatchVisual3(void) 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 ); @@ -797,7 +797,7 @@ int UtcDaliVisualFactoryGetNPatchVisual3(void) 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 ); } @@ -897,7 +897,7 @@ int UtcDaliVisualFactoryGetNPatchVisual6(void) 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 ); } @@ -925,7 +925,7 @@ int UtcDaliVisualFactoryGetNPatchVisual6(void) 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 ); } @@ -967,7 +967,7 @@ int UtcDaliVisualFactoryGetNPatchVisual7(void) 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(); @@ -1017,7 +1017,7 @@ int UtcDaliNPatchVisualAuxiliaryImage(void) 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(); @@ -1128,7 +1128,7 @@ int UtcDaliVisualFactoryGetSvgVisual(void) DummyControlImpl& dummyImpl = static_cast(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(); @@ -1168,7 +1168,7 @@ int UtcDaliVisualFactoryGetSvgVisualLarge(void) DummyControlImpl& dummyImpl = static_cast(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(); @@ -1213,7 +1213,7 @@ int UtcDaliVisualFactoryGetSvgVisualAtlas(void) DummyControlImpl& dummyImpl = static_cast(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(); @@ -1252,7 +1252,7 @@ void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplic DummyControlImpl& dummyImpl = static_cast(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. @@ -1295,7 +1295,7 @@ void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTest DummyControlImpl& dummyImpl = static_cast(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. @@ -1602,7 +1602,7 @@ void TestPrimitiveVisualWithProperties( Property::Map& propertyMap, ToolkitTestA 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. @@ -2043,7 +2043,7 @@ int UtcDaliVisualFactoryGetAnimatedImageVisual1(void) DummyControlImpl& dummyImpl = static_cast(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(); @@ -2131,7 +2131,7 @@ int UtcDaliVisualFactoryGetAnimatedImageVisual2(void) DummyControlImpl& dummyImpl = static_cast(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(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp index 9221ea5..781246e 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -148,7 +148,7 @@ int UtcDaliWebViewPageNavigation(void) 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 ); @@ -220,7 +220,7 @@ int UtcDaliWebViewTouchAndKeys(void) 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(); -- 2.7.4