2 * Copyright (c) 2023 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/adaptor-framework/scene-holder.h>
22 #include <dali/integration-api/events/key-event-integ.h>
23 #include <dali/integration-api/events/touch-event-integ.h>
24 #include <dali/integration-api/events/wheel-event-integ.h>
25 #include <dali/public-api/events/wheel-event.h>
26 #include <dali/public-api/render-tasks/render-task-list.h>
29 #include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
30 #include <dali/public-api/actors/layer.h>
36 SceneHolder::SceneHolder()
40 SceneHolder::~SceneHolder()
44 SceneHolder::SceneHolder(const SceneHolder& copy) = default;
46 SceneHolder& SceneHolder::operator=(const SceneHolder& rhs) = default;
48 SceneHolder::SceneHolder(SceneHolder&& rhs) noexcept = default;
50 SceneHolder& SceneHolder::operator=(SceneHolder&& rhs) noexcept = default;
52 SceneHolder::SceneHolder(Internal::Adaptor::SceneHolder* internal)
53 : BaseHandle(internal)
57 void SceneHolder::Add(Actor actor)
59 GetImplementation(*this).Add(actor);
62 void SceneHolder::Remove(Actor actor)
64 GetImplementation(*this).Remove(actor);
67 Layer SceneHolder::GetRootLayer() const
69 return GetImplementation(*this).GetRootLayer();
72 void SceneHolder::SetBackgroundColor(Vector4 color)
74 GetImplementation(*this).SetBackgroundColor(color);
77 Vector4 SceneHolder::GetBackgroundColor() const
79 return GetImplementation(*this).GetBackgroundColor();
82 Any SceneHolder::GetNativeHandle() const
84 return GetImplementation(*this).GetNativeHandle();
87 void SceneHolder::FeedTouchPoint(Dali::TouchPoint& point, int timeStamp)
89 Integration::Point convertedPoint(point);
90 GetImplementation(*this).FeedTouchPoint(convertedPoint, timeStamp);
93 void SceneHolder::FeedWheelEvent(Dali::WheelEvent& wheelEvent)
95 Integration::WheelEvent event(static_cast<Integration::WheelEvent::Type>(wheelEvent.GetType()), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime());
96 GetImplementation(*this).FeedWheelEvent(event);
99 void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
101 Integration::KeyEvent event(keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast<Integration::KeyEvent::State>(keyEvent.GetState()), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass());
102 GetImplementation(*this).FeedKeyEvent(event);
105 void SceneHolder::FeedHoverEvent(Dali::TouchPoint& point)
107 Integration::Point convertedPoint(point);
108 GetImplementation(*this).FeedHoverEvent(convertedPoint);
111 void SceneHolder::SetGeometryHittestEnabled(bool enabled)
113 GetImplementation(*this).SetGeometryHittestEnabled(enabled);
116 bool SceneHolder::IsGeometryHittestEnabled()
118 return GetImplementation(*this).IsGeometryHittestEnabled();
121 RenderTaskList SceneHolder::GetRenderTaskList()
123 return GetImplementation(*this).GetRenderTaskList();
126 int32_t SceneHolder::GetNativeId() const
128 return GetImplementation(*this).GetNativeId();
131 SceneHolder SceneHolder::Get(Actor actor)
133 return Internal::Adaptor::SceneHolder::Get(actor);
136 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
138 return GetImplementation(*this).KeyEventSignal();
141 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
143 return GetImplementation(*this).KeyEventGeneratedSignal();
146 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::InterceptKeyEventSignal()
148 return GetImplementation(*this).InterceptKeyEventSignal();
151 SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
153 return GetImplementation(*this).TouchedSignal();
156 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
158 return GetImplementation(*this).WheelEventSignal();
161 SceneHolder::WheelEventGeneratedSignalType& SceneHolder::WheelEventGeneratedSignal()
163 return GetImplementation(*this).WheelEventGeneratedSignal();
166 } // namespace Integration