2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/integration-api/scene.h>
22 #include <dali/public-api/actors/layer.h>
23 #include <dali/public-api/render-tasks/render-task-list.h>
24 #include <dali/internal/event/common/scene-impl.h>
32 Scene Scene::New( Size size )
34 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
35 Internal::ScenePtr internal = Internal::Scene::New( size );
36 return Scene( internal.Get() );
39 Scene Scene::DownCast( BaseHandle handle )
41 return Scene( dynamic_cast<Dali::Internal::Scene*>( handle.GetObjectPtr()) );
52 Scene::Scene( const Scene& handle )
57 Scene::Scene( Internal::Scene* internal )
58 : BaseHandle(internal)
62 Scene& Scene::operator=( const Scene& rhs )
64 BaseHandle::operator=(rhs);
68 void Scene::Add( Actor actor )
70 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
71 GetImplementation(*this).Add( GetImplementation(actor) );
74 void Scene::Remove( Actor actor )
76 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
77 GetImplementation(*this).Remove( GetImplementation(actor) );
80 Size Scene::GetSize() const
82 return GetImplementation(*this).GetSize();
85 void Scene::SetDpi( Vector2 dpi )
87 GetImplementation(*this).SetDpi( dpi );
90 Vector2 Scene::GetDpi() const
92 return GetImplementation(*this).GetDpi();
95 void Scene::SetBackgroundColor( const Vector4& color )
97 GetImplementation(*this).SetBackgroundColor( color );
100 Vector4 Scene::GetBackgroundColor() const
102 return GetImplementation(*this).GetBackgroundColor();
105 RenderTaskList Scene::GetRenderTaskList() const
107 return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
110 Layer Scene::GetRootLayer() const
112 return GetImplementation(*this).GetRootLayer();
115 uint32_t Scene::GetLayerCount() const
117 return GetImplementation(*this).GetLayerCount();
120 Layer Scene::GetLayer( uint32_t depth ) const
122 return GetImplementation(*this).GetLayer( depth );
125 void Scene::SurfaceResized( float width, float height, int orientation, bool forceUpdate )
127 GetImplementation( *this ).SurfaceResized( width, height, orientation, forceUpdate );
130 void Scene::SurfaceReplaced()
132 GetImplementation( *this ).SurfaceReplaced();
135 void Scene::Discard()
137 GetImplementation(*this).Discard();
140 Integration::Scene Scene::Get( Actor actor )
142 return Dali::Integration::Scene( &GetImplementation( actor ).GetScene() );
145 void Scene::QueueEvent( const Integration::Event& event )
147 GetImplementation(*this).QueueEvent( event );
150 void Scene::ProcessEvents()
152 GetImplementation(*this).ProcessEvents();
155 void Scene::AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
157 GetImplementation( *this ).AddFrameRenderedCallback( std::move( callback ), frameId );
160 void Scene::AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
162 GetImplementation( *this ).AddFramePresentedCallback( std::move( callback ), frameId );
165 void Scene::GetFrameRenderedCallback( FrameCallbackContainer& callbacks )
167 GetImplementation( *this ).GetFrameRenderedCallback( callbacks );
170 void Scene::GetFramePresentedCallback( FrameCallbackContainer& callbacks )
172 GetImplementation( *this ).GetFramePresentedCallback( callbacks );
175 Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
177 return GetImplementation(*this).EventProcessingFinishedSignal();
180 Scene::KeyEventSignalType& Scene::KeyEventSignal()
182 return GetImplementation(*this).KeyEventSignal();
185 Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
187 return GetImplementation(*this).KeyEventGeneratedSignal();
190 Scene::TouchSignalType& Scene::TouchSignal()
192 return GetImplementation(*this).TouchSignal();
195 Scene::WheelEventSignalType& Scene::WheelEventSignal()
197 return GetImplementation(*this).WheelEventSignal();