[Tizen] Revert "Support screen rotation"
[platform/core/uifw/dali-adaptor.git] / adaptors / common / adaptor.cpp
1 /*
2  * Copyright (c) 2017 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 <adaptor.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <accessibility-adaptor.h>
26 #include <imf-manager.h>
27 #include <style-monitor.h>
28 #include <render-surface.h>
29 #include <adaptor-impl.h>
30
31 namespace Dali
32 {
33
34 Adaptor& Adaptor::New( Window window )
35 {
36   return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
37 }
38
39 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
40 {
41   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
42   return *adaptor;
43 }
44
45 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
46 {
47   return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
48 }
49
50 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
51 {
52   Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
53   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
54   return *adaptor;
55 }
56
57 Adaptor::~Adaptor()
58 {
59   delete mImpl;
60 }
61
62 void Adaptor::Start()
63 {
64   mImpl->Start();
65 }
66
67 void Adaptor::Pause()
68 {
69   mImpl->Pause();
70 }
71
72 void Adaptor::Resume()
73 {
74   mImpl->Resume();
75 }
76
77 void Adaptor::Stop()
78 {
79   mImpl->Stop();
80 }
81
82 bool Adaptor::AddIdle( CallbackBase* callback )
83 {
84   return mImpl->AddIdle( callback );
85 }
86
87 void Adaptor::RemoveIdle( CallbackBase* callback )
88 {
89   mImpl->RemoveIdle( callback );
90 }
91
92 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
93 {
94   mImpl->ReplaceSurface(nativeWindow, surface);
95 }
96
97 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
98 {
99   return mImpl->ResizedSignal();
100 }
101
102 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
103 {
104   return mImpl->LanguageChangedSignal();
105 }
106
107 RenderSurface& Adaptor::GetSurface()
108 {
109   return mImpl->GetSurface();
110 }
111
112 Any Adaptor::GetNativeWindowHandle()
113 {
114   return mImpl->GetNativeWindowHandle();
115 }
116
117 void Adaptor::ReleaseSurfaceLock()
118 {
119   mImpl->ReleaseSurfaceLock();
120 }
121
122 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
123 {
124   mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
125 }
126
127 void Adaptor::SetUseHardwareVSync(bool useHardware)
128 {
129   mImpl->SetUseHardwareVSync( useHardware );
130 }
131
132 Adaptor& Adaptor::Get()
133 {
134   return Internal::Adaptor::Adaptor::Get();
135 }
136
137 bool Adaptor::IsAvailable()
138 {
139   return Internal::Adaptor::Adaptor::IsAvailable();
140 }
141
142 void Adaptor::NotifySceneCreated()
143 {
144   mImpl->NotifySceneCreated();
145 }
146
147 void Adaptor::NotifyLanguageChanged()
148 {
149   mImpl->NotifyLanguageChanged();
150 }
151
152 void Adaptor::SetMinimumPinchDistance(float distance)
153 {
154   mImpl->SetMinimumPinchDistance(distance);
155 }
156
157 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
158 {
159   mImpl->FeedTouchPoint(point, timeStamp);
160 }
161
162 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
163 {
164   mImpl->FeedWheelEvent(wheelEvent);
165 }
166
167 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
168 {
169   mImpl->FeedKeyEvent(keyEvent);
170 }
171
172 void Adaptor::SceneCreated()
173 {
174   mImpl->SceneCreated();
175 }
176
177 void Adaptor::SetViewMode( ViewMode mode )
178 {
179   mImpl->SetViewMode( mode );
180 }
181
182 void Adaptor::SetStereoBase(  float stereoBase )
183 {
184   mImpl->SetStereoBase( stereoBase );
185 }
186
187 void Adaptor::SurfaceSizeChanged( SurfaceSize surfaceSize )
188 {
189   mImpl->SurfaceSizeChanged( surfaceSize );
190 }
191
192 Adaptor::Adaptor()
193 : mImpl( NULL )
194 {
195 }
196
197 } // namespace Dali