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 Internal::ScenePtr internal = Internal::Scene::New( size );
35 return Scene( internal.Get() );
38 Scene Scene::DownCast( BaseHandle handle )
40 return Scene( dynamic_cast<Dali::Internal::Scene*>( handle.GetObjectPtr()) );
51 Scene::Scene( const Scene& handle )
56 Scene::Scene( Internal::Scene* internal )
57 : BaseHandle(internal)
61 Scene& Scene::operator=( const Scene& rhs )
63 BaseHandle::operator=(rhs);
67 void Scene::Add( Actor actor )
69 GetImplementation(*this).Add( GetImplementation(actor) );
72 void Scene::Remove( Actor actor )
74 GetImplementation(*this).Remove( GetImplementation(actor) );
77 Size Scene::GetSize() const
79 return GetImplementation(*this).GetSize();
82 void Scene::SetDpi( Vector2 dpi )
84 GetImplementation(*this).SetDpi( dpi );
87 Vector2 Scene::GetDpi() const
89 return GetImplementation(*this).GetDpi();
92 void Scene::SetBackgroundColor( const Vector4& color )
94 GetImplementation(*this).SetBackgroundColor( color );
97 Vector4 Scene::GetBackgroundColor() const
99 return GetImplementation(*this).GetBackgroundColor();
102 RenderTaskList Scene::GetRenderTaskList() const
104 return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
107 Layer Scene::GetRootLayer() const
109 return GetImplementation(*this).GetRootLayer();
112 uint32_t Scene::GetLayerCount() const
114 return GetImplementation(*this).GetLayerCount();
117 Layer Scene::GetLayer( uint32_t depth ) const
119 return GetImplementation(*this).GetLayer( depth );
122 void Scene::SurfaceResized( float width, float height, int orientation, bool forceUpdate )
124 GetImplementation( *this ).SurfaceResized( width, height, orientation, forceUpdate );
127 void Scene::SurfaceReplaced()
129 GetImplementation( *this ).SurfaceReplaced();
132 void Scene::Discard()
134 GetImplementation(*this).Discard();
137 Integration::Scene Scene::Get( Actor actor )
139 return Dali::Integration::Scene( &GetImplementation( actor ).GetScene() );
142 void Scene::QueueEvent( const Integration::Event& event )
144 GetImplementation(*this).QueueEvent( event );
147 void Scene::ProcessEvents()
149 GetImplementation(*this).ProcessEvents();
152 void Scene::AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
154 GetImplementation( *this ).AddFrameRenderedCallback( std::move( callback ), frameId );
157 void Scene::AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
159 GetImplementation( *this ).AddFramePresentedCallback( std::move( callback ), frameId );
162 void Scene::GetFrameRenderedCallback( FrameCallbackContainer& callbacks )
164 GetImplementation( *this ).GetFrameRenderedCallback( callbacks );
167 void Scene::GetFramePresentedCallback( FrameCallbackContainer& callbacks )
169 GetImplementation( *this ).GetFramePresentedCallback( callbacks );
172 Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
174 return GetImplementation(*this).EventProcessingFinishedSignal();
177 Scene::KeyEventSignalType& Scene::KeyEventSignal()
179 return GetImplementation(*this).KeyEventSignal();
182 Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
184 return GetImplementation(*this).KeyEventGeneratedSignal();
187 Scene::TouchSignalType& Scene::TouchSignal()
189 return GetImplementation(*this).TouchSignal();
192 Scene::WheelEventSignalType& Scene::WheelEventSignal()
194 return GetImplementation(*this).WheelEventSignal();