2 * Copyright (c) 2019 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( Integration::RenderSurface& surface )
34 Internal::ScenePtr internal = Internal::Scene::New( surface );
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::SetSurface( Integration::RenderSurface& surface )
124 GetImplementation(*this).SetSurface( surface );
127 void Scene::SurfaceResized()
129 GetImplementation( *this ).SurfaceResized();
132 Integration::RenderSurface* Scene::GetSurface() const
134 return GetImplementation(*this).GetSurface();
137 void Scene::Discard()
139 GetImplementation(*this).Discard();
142 Integration::Scene Scene::Get( Actor actor )
144 return Dali::Integration::Scene( &GetImplementation( actor ).GetScene() );
147 void Scene::QueueEvent( const Integration::Event& event )
149 GetImplementation(*this).QueueEvent( event );
152 void Scene::ProcessEvents()
154 GetImplementation(*this).ProcessEvents();
157 Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
159 return GetImplementation(*this).EventProcessingFinishedSignal();
162 Scene::KeyEventSignalType& Scene::KeyEventSignal()
164 return GetImplementation(*this).KeyEventSignal();
167 Scene::TouchSignalType& Scene::TouchSignal()
169 return GetImplementation(*this).TouchSignal();
172 Scene::WheelEventSignalType& Scene::WheelEventSignal()
174 return GetImplementation(*this).WheelEventSignal();