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/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>
28 #include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
29 #include <dali/public-api/actors/layer.h>
35 SceneHolder::SceneHolder()
39 SceneHolder::~SceneHolder()
43 SceneHolder::SceneHolder(const SceneHolder& handle)
48 SceneHolder::SceneHolder(Internal::Adaptor::SceneHolder* internal)
49 : BaseHandle(internal)
53 SceneHolder& SceneHolder::operator=(const SceneHolder& rhs)
55 BaseHandle::operator=(rhs);
59 void SceneHolder::Add(Actor actor)
61 GetImplementation(*this).Add(actor);
64 void SceneHolder::Remove(Actor actor)
66 GetImplementation(*this).Remove(actor);
69 Layer SceneHolder::GetRootLayer() const
71 return GetImplementation(*this).GetRootLayer();
74 void SceneHolder::SetBackgroundColor(Vector4 color)
76 GetImplementation(*this).SetBackgroundColor(color);
79 Vector4 SceneHolder::GetBackgroundColor() const
81 return GetImplementation(*this).GetBackgroundColor();
84 Any SceneHolder::GetNativeHandle() const
86 return GetImplementation(*this).GetNativeHandle();
89 void SceneHolder::FeedTouchPoint(Dali::TouchPoint& point, int timeStamp)
91 Integration::Point convertedPoint(point);
92 GetImplementation(*this).FeedTouchPoint(convertedPoint, timeStamp);
95 void SceneHolder::FeedWheelEvent(Dali::WheelEvent& wheelEvent)
97 Integration::WheelEvent event(static_cast<Integration::WheelEvent::Type>(wheelEvent.GetType()), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime());
98 GetImplementation(*this).FeedWheelEvent(event);
101 void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
103 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());
104 GetImplementation(*this).FeedKeyEvent(event);
107 SceneHolder SceneHolder::Get(Actor actor)
109 return Internal::Adaptor::SceneHolder::Get(actor);
112 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
114 return GetImplementation(*this).KeyEventSignal();
117 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
119 return GetImplementation(*this).KeyEventGeneratedSignal();
122 SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
124 return GetImplementation(*this).TouchedSignal();
127 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
129 return GetImplementation(*this).WheelEventSignal();
132 } // namespace Integration