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::New(Size size, int orientation)
38 Internal::ScenePtr internal = Internal::Scene::New(size, orientation);
39 return Scene(internal.Get());
42 Scene Scene::DownCast(BaseHandle handle)
44 return Scene(dynamic_cast<Dali::Internal::Scene*>(handle.GetObjectPtr()));
55 Scene::Scene(const Scene& handle)
60 Scene::Scene(Internal::Scene* internal)
61 : BaseHandle(internal)
65 Scene& Scene::operator=(const Scene& rhs)
67 BaseHandle::operator=(rhs);
71 void Scene::Add(Actor actor)
73 GetImplementation(*this).Add(GetImplementation(actor));
76 void Scene::Remove(Actor actor)
78 GetImplementation(*this).Remove(GetImplementation(actor));
81 Size Scene::GetSize() const
83 return GetImplementation(*this).GetSize();
86 void Scene::SetDpi(Vector2 dpi)
88 GetImplementation(*this).SetDpi(dpi);
91 Vector2 Scene::GetDpi() const
93 return GetImplementation(*this).GetDpi();
96 void Scene::SetBackgroundColor(const Vector4& color)
98 GetImplementation(*this).SetBackgroundColor(color);
101 Vector4 Scene::GetBackgroundColor() const
103 return GetImplementation(*this).GetBackgroundColor();
106 RenderTaskList Scene::GetRenderTaskList() const
108 return RenderTaskList(&GetImplementation(*this).GetRenderTaskList());
111 Layer Scene::GetRootLayer() const
113 return GetImplementation(*this).GetRootLayer();
116 uint32_t Scene::GetLayerCount() const
118 return GetImplementation(*this).GetLayerCount();
121 Layer Scene::GetLayer(uint32_t depth) const
123 return GetImplementation(*this).GetLayer(depth);
126 void Scene::SurfaceResized(float width, float height)
128 GetImplementation(*this).SurfaceResized(width, height);
131 void Scene::SurfaceReplaced()
133 GetImplementation(*this).SurfaceReplaced();
136 void Scene::Discard()
138 GetImplementation(*this).Discard();
141 Integration::Scene Scene::Get(Actor actor)
143 return Dali::Integration::Scene(&GetImplementation(actor).GetScene());
146 void Scene::QueueEvent(const Integration::Event& event)
148 GetImplementation(*this).QueueEvent(event);
151 void Scene::ProcessEvents()
153 GetImplementation(*this).ProcessEvents();
156 void Scene::AddFrameRenderedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
158 GetImplementation(*this).AddFrameRenderedCallback(std::move(callback), frameId);
161 void Scene::AddFramePresentedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
163 GetImplementation(*this).AddFramePresentedCallback(std::move(callback), frameId);
166 void Scene::GetFrameRenderedCallback(FrameCallbackContainer& callbacks)
168 GetImplementation(*this).GetFrameRenderedCallback(callbacks);
171 void Scene::GetFramePresentedCallback(FrameCallbackContainer& callbacks)
173 GetImplementation(*this).GetFramePresentedCallback(callbacks);
176 Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
178 return GetImplementation(*this).EventProcessingFinishedSignal();
181 Scene::KeyEventSignalType& Scene::KeyEventSignal()
183 return GetImplementation(*this).KeyEventSignal();
186 Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
188 return GetImplementation(*this).KeyEventGeneratedSignal();
191 Scene::TouchEventSignalType& Scene::TouchedSignal()
193 return GetImplementation(*this).TouchedSignal();
196 Scene::WheelEventSignalType& Scene::WheelEventSignal()
198 return GetImplementation(*this).WheelEventSignal();
201 } // namespace Integration