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