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.
18 #include <dali/integration-api/events/touch-event-integ.h>
19 #include <dali/integration-api/adaptors/scene-holder.h>
21 #include <toolkit-scene-holder-impl.h>
23 #include <dali/public-api/actors/actor.h>
24 #include <dali/public-api/actors/layer.h>
25 #include <dali/public-api/common/stage.h>
26 #include <dali/public-api/object/base-object.h>
28 #include <dali/integration-api/adaptors/adaptor.h>
29 #include <toolkit-adaptor-impl.h>
34 ///////////////////////////////////////////////////////////////////////////////
36 // Dali::Internal::Adaptor::SceneHolder Stub
38 ///////////////////////////////////////////////////////////////////////////////
46 SceneHolder::SceneHolder( const Dali::Rect<int>& positionSize )
47 : mRenderSurface( positionSize ),
48 mScene( Dali::Integration::Scene::New( mRenderSurface ) )
52 SceneHolder::~SceneHolder()
56 void SceneHolder::SetBackgroundColor( Vector4 color )
58 return mScene.SetBackgroundColor( color );
61 Vector4 SceneHolder::GetBackgroundColor() const
63 return mScene.GetBackgroundColor();
66 void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
70 void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
74 void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
78 Dali::Integration::SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
80 return mScene.KeyEventSignal();
83 Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
85 return mScene.KeyEventGeneratedSignal();
88 Dali::Integration::SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
90 return mScene.TouchSignal();
93 Dali::Integration::SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
95 return mScene.WheelEventSignal();
98 Integration::Scene SceneHolder::GetScene()
103 Integration::RenderSurface& SceneHolder::GetRenderSurface()
105 return mRenderSurface;
108 } // namespace Adaptor
110 } // namespace Internal
112 ///////////////////////////////////////////////////////////////////////////////
114 // Dali::Integration::SceneHolder Stub
116 ///////////////////////////////////////////////////////////////////////////////
118 namespace Integration
121 SceneHolder::SceneHolder()
123 // Dali::Internal::Adaptor::Adaptor::Get().WindowCreatedSignal().Emit( *this );
126 SceneHolder::~SceneHolder()
130 SceneHolder::SceneHolder( const SceneHolder& handle )
135 SceneHolder::SceneHolder( Internal::Adaptor::SceneHolder* internal )
136 : BaseHandle(internal)
140 SceneHolder& SceneHolder::operator=( const SceneHolder& rhs )
142 BaseHandle::operator=(rhs);
146 void SceneHolder::Add( Actor actor )
150 void SceneHolder::Remove( Actor actor )
154 Dali::Layer SceneHolder::GetRootLayer() const
156 return Dali::Stage::GetCurrent().GetRootLayer();
159 void SceneHolder::SetBackgroundColor( Vector4 color )
161 GetImplementation( *this ).SetBackgroundColor( color );
164 Vector4 SceneHolder::GetBackgroundColor() const
166 return GetImplementation( *this ).GetBackgroundColor();
169 void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
171 GetImplementation( *this ).FeedTouchPoint( point, timeStamp );
174 void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
176 GetImplementation( *this ).FeedWheelEvent( wheelEvent );
179 void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
181 GetImplementation( *this ).FeedKeyEvent( keyEvent );
184 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
186 return GetImplementation( *this ).KeyEventSignal();
189 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
191 return GetImplementation( *this ).KeyEventGeneratedSignal();
194 SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
196 return GetImplementation( *this ).TouchSignal();
199 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
201 return GetImplementation( *this ).WheelEventSignal();
204 SceneHolder SceneHolder::Get( Actor actor )
206 return SceneHolder();