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/internal/event/common/scene-impl.h>
23 #include <dali/public-api/actors/layer.h>
24 #include <dali/public-api/render-tasks/render-task-list.h>
30 Scene Scene::New(Size size)
32 Internal::ScenePtr internal = Internal::Scene::New(size);
33 return Scene(internal.Get());
36 Scene Scene::DownCast(BaseHandle handle)
38 return Scene(dynamic_cast<Dali::Internal::Scene*>(handle.GetObjectPtr()));
49 Scene::Scene(const Scene& handle)
54 Scene::Scene(Internal::Scene* internal)
55 : BaseHandle(internal)
59 Scene& Scene::operator=(const Scene& rhs)
61 BaseHandle::operator=(rhs);
65 void Scene::Add(Actor actor)
67 GetImplementation(*this).Add(GetImplementation(actor));
70 void Scene::Remove(Actor actor)
72 GetImplementation(*this).Remove(GetImplementation(actor));
75 Size Scene::GetSize() const
77 return GetImplementation(*this).GetSize();
80 void Scene::SetDpi(Vector2 dpi)
82 GetImplementation(*this).SetDpi(dpi);
85 Vector2 Scene::GetDpi() const
87 return GetImplementation(*this).GetDpi();
90 void Scene::SetBackgroundColor(const Vector4& color)
92 GetImplementation(*this).SetBackgroundColor(color);
95 Vector4 Scene::GetBackgroundColor() const
97 return GetImplementation(*this).GetBackgroundColor();
100 RenderTaskList Scene::GetRenderTaskList() const
102 return RenderTaskList(&GetImplementation(*this).GetRenderTaskList());
105 Layer Scene::GetRootLayer() const
107 return GetImplementation(*this).GetRootLayer();
110 uint32_t Scene::GetLayerCount() const
112 return GetImplementation(*this).GetLayerCount();
115 Layer Scene::GetLayer(uint32_t depth) const
117 return GetImplementation(*this).GetLayer(depth);
120 void Scene::SurfaceResized(float width, float height, int orientation, bool forceUpdate)
122 GetImplementation(*this).SurfaceResized(width, height, orientation, forceUpdate);
125 void Scene::SurfaceReplaced()
127 GetImplementation(*this).SurfaceReplaced();
130 void Scene::Discard()
132 GetImplementation(*this).Discard();
135 Integration::Scene Scene::Get(Actor actor)
137 return Dali::Integration::Scene(&GetImplementation(actor).GetScene());
140 void Scene::QueueEvent(const Integration::Event& event)
142 GetImplementation(*this).QueueEvent(event);
145 void Scene::ProcessEvents()
147 GetImplementation(*this).ProcessEvents();
150 void Scene::AddFrameRenderedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
152 GetImplementation(*this).AddFrameRenderedCallback(std::move(callback), frameId);
155 void Scene::AddFramePresentedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
157 GetImplementation(*this).AddFramePresentedCallback(std::move(callback), frameId);
160 void Scene::GetFrameRenderedCallback(FrameCallbackContainer& callbacks)
162 GetImplementation(*this).GetFrameRenderedCallback(callbacks);
165 void Scene::GetFramePresentedCallback(FrameCallbackContainer& callbacks)
167 GetImplementation(*this).GetFramePresentedCallback(callbacks);
170 Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
172 return GetImplementation(*this).EventProcessingFinishedSignal();
175 Scene::KeyEventSignalType& Scene::KeyEventSignal()
177 return GetImplementation(*this).KeyEventSignal();
180 Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
182 return GetImplementation(*this).KeyEventGeneratedSignal();
185 Scene::TouchEventSignalType& Scene::TouchedSignal()
187 return GetImplementation(*this).TouchedSignal();
190 Scene::WheelEventSignalType& Scene::WheelEventSignal()
192 return GetImplementation(*this).WheelEventSignal();
195 } // namespace Integration