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-holder.h>
22 #include <dali/public-api/events/wheel-event.h>
23 #include <dali/integration-api/events/key-event-integ.h>
24 #include <dali/integration-api/events/touch-event-integ.h>
25 #include <dali/integration-api/events/wheel-event-integ.h>
28 #include <dali/public-api/actors/layer.h>
29 #include <dali/integration-api/scene-holder-impl.h>
37 SceneHolder::SceneHolder()
41 SceneHolder::~SceneHolder()
45 SceneHolder::SceneHolder( const SceneHolder& handle )
50 SceneHolder::SceneHolder( Internal::Adaptor::SceneHolder* internal )
51 : BaseHandle(internal)
55 SceneHolder& SceneHolder::operator=( const SceneHolder& rhs )
57 BaseHandle::operator=(rhs);
61 void SceneHolder::Add( Actor actor )
63 GetImplementation(*this).Add( actor );
66 void SceneHolder::Remove( Actor actor )
68 GetImplementation(*this).Remove( actor );
71 Layer SceneHolder::GetRootLayer() const
73 return GetImplementation(*this).GetRootLayer();
76 void SceneHolder::SetBackgroundColor( Vector4 color )
78 GetImplementation(*this).SetBackgroundColor( color );
81 Vector4 SceneHolder::GetBackgroundColor() const
83 return GetImplementation(*this).GetBackgroundColor();
86 Any SceneHolder::GetNativeHandle() const
88 return GetImplementation(*this).GetNativeHandle();
91 void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
93 Integration::Point convertedPoint( point );
94 GetImplementation(*this).FeedTouchPoint( convertedPoint, timeStamp );
97 void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
99 Integration::WheelEvent event( static_cast< Integration::WheelEvent::Type >(wheelEvent.type), wheelEvent.direction, wheelEvent.modifiers, wheelEvent.point, wheelEvent.z, wheelEvent.timeStamp );
100 GetImplementation(*this).FeedWheelEvent( event );
103 void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
105 Integration::KeyEvent convertedEvent( keyEvent );
106 GetImplementation(*this).FeedKeyEvent( convertedEvent );
109 SceneHolder SceneHolder::Get( Actor actor )
111 return Internal::Adaptor::SceneHolder::Get( actor );
114 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
116 return GetImplementation(*this).KeyEventSignal();
119 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
121 return GetImplementation(*this).KeyEventGeneratedSignal();
124 SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
126 return GetImplementation(*this).TouchSignal();
129 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
131 return GetImplementation(*this).WheelEventSignal();