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::New( Size size, int orientation )
40 Internal::ScenePtr internal = Internal::Scene::New( size, orientation );
41 return Scene( internal.Get() );
44 Scene Scene::DownCast( BaseHandle handle )
46 return Scene( dynamic_cast<Dali::Internal::Scene*>( handle.GetObjectPtr()) );
57 Scene::Scene( const Scene& handle )
62 Scene::Scene( Internal::Scene* internal )
63 : BaseHandle(internal)
67 Scene& Scene::operator=( const Scene& rhs )
69 BaseHandle::operator=(rhs);
73 void Scene::Add( Actor actor )
75 GetImplementation(*this).Add( GetImplementation(actor) );
78 void Scene::Remove( Actor actor )
80 GetImplementation(*this).Remove( GetImplementation(actor) );
83 Size Scene::GetSize() const
85 return GetImplementation(*this).GetSize();
88 void Scene::SetDpi( Vector2 dpi )
90 GetImplementation(*this).SetDpi( dpi );
93 Vector2 Scene::GetDpi() const
95 return GetImplementation(*this).GetDpi();
98 void Scene::SetBackgroundColor( const Vector4& color )
100 GetImplementation(*this).SetBackgroundColor( color );
103 Vector4 Scene::GetBackgroundColor() const
105 return GetImplementation(*this).GetBackgroundColor();
108 RenderTaskList Scene::GetRenderTaskList() const
110 return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
113 Layer Scene::GetRootLayer() const
115 return GetImplementation(*this).GetRootLayer();
118 uint32_t Scene::GetLayerCount() const
120 return GetImplementation(*this).GetLayerCount();
123 Layer Scene::GetLayer( uint32_t depth ) const
125 return GetImplementation(*this).GetLayer( depth );
128 void Scene::SurfaceResized( float width, float height, int orientation, bool forceUpdate )
130 GetImplementation( *this ).SurfaceResized( width, height, orientation, forceUpdate );
133 void Scene::SurfaceReplaced()
135 GetImplementation( *this ).SurfaceReplaced();
138 void Scene::Discard()
140 GetImplementation(*this).Discard();
143 Integration::Scene Scene::Get( Actor actor )
145 return Dali::Integration::Scene( &GetImplementation( actor ).GetScene() );
148 void Scene::QueueEvent( const Integration::Event& event )
150 GetImplementation(*this).QueueEvent( event );
153 void Scene::ProcessEvents()
155 GetImplementation(*this).ProcessEvents();
158 void Scene::AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
160 GetImplementation( *this ).AddFrameRenderedCallback( std::move( callback ), frameId );
163 void Scene::AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
165 GetImplementation( *this ).AddFramePresentedCallback( std::move( callback ), frameId );
168 void Scene::GetFrameRenderedCallback( FrameCallbackContainer& callbacks )
170 GetImplementation( *this ).GetFrameRenderedCallback( callbacks );
173 void Scene::GetFramePresentedCallback( FrameCallbackContainer& callbacks )
175 GetImplementation( *this ).GetFramePresentedCallback( callbacks );
178 Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
180 return GetImplementation(*this).EventProcessingFinishedSignal();
183 Scene::KeyEventSignalType& Scene::KeyEventSignal()
185 return GetImplementation(*this).KeyEventSignal();
188 Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
190 return GetImplementation(*this).KeyEventGeneratedSignal();
193 Scene::TouchEventSignalType& Scene::TouchedSignal()
195 return GetImplementation(*this).TouchedSignal();
198 Scene::WheelEventSignalType& Scene::WheelEventSignal()
200 return GetImplementation(*this).WheelEventSignal();