Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / scene-holder.cpp
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/integration-api/scene-holder.h>
20
21 // EXTERNAL INCLUDES
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>
26
27 // INTERNAL INCLUDES
28 #include <dali/public-api/actors/layer.h>
29 #include <dali/integration-api/scene-holder-impl.h>
30
31 namespace Dali
32 {
33
34 namespace Integration
35 {
36
37 SceneHolder::SceneHolder()
38 {
39 }
40
41 SceneHolder::~SceneHolder()
42 {
43 }
44
45 SceneHolder::SceneHolder( const SceneHolder& handle )
46 :BaseHandle(handle)
47 {
48 }
49
50 SceneHolder::SceneHolder( Internal::Adaptor::SceneHolder* internal )
51 : BaseHandle(internal)
52 {
53 }
54
55 SceneHolder& SceneHolder::operator=( const SceneHolder& rhs )
56 {
57   BaseHandle::operator=(rhs);
58   return *this;
59 }
60
61 void SceneHolder::Add( Actor actor )
62 {
63   GetImplementation(*this).Add( actor );
64 }
65
66 void SceneHolder::Remove( Actor actor )
67 {
68   GetImplementation(*this).Remove( actor );
69 }
70
71 Layer SceneHolder::GetRootLayer() const
72 {
73   return GetImplementation(*this).GetRootLayer();
74 }
75
76 void SceneHolder::SetBackgroundColor( Vector4 color )
77 {
78   GetImplementation(*this).SetBackgroundColor( color );
79 }
80
81 Vector4 SceneHolder::GetBackgroundColor() const
82 {
83   return GetImplementation(*this).GetBackgroundColor();
84 }
85
86 Any SceneHolder::GetNativeHandle() const
87 {
88   return GetImplementation(*this).GetNativeHandle();
89 }
90
91 void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
92 {
93   Integration::Point convertedPoint( point );
94   GetImplementation(*this).FeedTouchPoint( convertedPoint, timeStamp );
95 }
96
97 void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
98 {
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 );
101 }
102
103 void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
104 {
105   Integration::KeyEvent convertedEvent( keyEvent );
106   GetImplementation(*this).FeedKeyEvent( convertedEvent );
107 }
108
109 SceneHolder SceneHolder::Get( Actor actor )
110 {
111   return Internal::Adaptor::SceneHolder::Get( actor );
112 }
113
114 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
115 {
116   return GetImplementation(*this).KeyEventSignal();
117 }
118
119 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
120 {
121   return GetImplementation(*this).KeyEventGeneratedSignal();
122 }
123
124 SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
125 {
126   return GetImplementation(*this).TouchSignal();
127 }
128
129 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
130 {
131   return GetImplementation(*this).WheelEventSignal();
132 }
133
134 }// Integration
135
136 } // Dali