Merge "Fixed bug in model3d-view control" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-adaptor.cpp
1 /*
2  * Copyright (c) 2014 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/adaptors/adaptor.h>
20
21 #include <dali/public-api/object/base-object.h>
22 #include <dali/devel-api/adaptor-framework/render-surface.h>
23
24 namespace Dali
25 {
26
27 class EglInterface;
28 class DisplayConnection;
29 class ThreadSynchronizationInterface;
30
31 namespace Integration
32 {
33
34 class GlAbstraction;
35
36 } // namespace Integration
37
38 class TestRenderSurface : public RenderSurface
39 {
40 public:
41   virtual PositionSize GetPositionSize() const { PositionSize size; return size; }
42
43   virtual void InitializeEgl( EglInterface& egl ) {}
44
45   virtual void CreateEglSurface( EglInterface& egl ) {}
46
47   virtual void DestroyEglSurface( EglInterface& egl ) {}
48
49   virtual bool ReplaceEGLSurface( EglInterface& egl ) { return false; }
50
51   virtual void MoveResize( Dali::PositionSize positionSize ) {}
52
53   virtual void SetViewMode( ViewMode viewMode ) {}
54
55   virtual void StartRender() {}
56
57   virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) { return false; }
58
59   virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) {}
60
61   virtual void StopRender() {}
62
63   virtual void ReleaseLock() {}
64
65   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {}
66
67 };
68
69 namespace Internal
70 {
71 namespace Adaptor
72 {
73
74 class Adaptor: public BaseObject
75 {
76 public:
77   static Dali::Adaptor& Get();
78   Adaptor();
79   ~Adaptor();
80
81 public:
82   static Dali::RenderSurface& GetSurface();
83   static Dali::Adaptor::AdaptorSignalType& AdaptorSignal();
84 };
85
86 Dali::Adaptor& Adaptor::Get()
87 {
88   Dali::Adaptor* adaptor = new Dali::Adaptor;
89   return *adaptor;
90 }
91
92 Dali::RenderSurface& Adaptor::GetSurface()
93 {
94   Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface;
95   return *renderSurface;
96 }
97
98 Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal()
99 {
100   Dali::Adaptor::AdaptorSignalType* signal = new Dali::Adaptor::AdaptorSignalType;
101   return *signal;
102 }
103
104 }
105 }
106 }
107
108 namespace Dali
109 {
110
111 Adaptor& Adaptor::New( Window window )
112 {
113   return Internal::Adaptor::Adaptor::Get();
114 }
115
116 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
117 {
118   return Internal::Adaptor::Adaptor::Get();
119 }
120
121 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
122 {
123   return Internal::Adaptor::Adaptor::Get();
124 }
125
126 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
127 {
128   return Internal::Adaptor::Adaptor::Get();
129 }
130
131 Adaptor::~Adaptor()
132 {
133 }
134
135 void Adaptor::Start()
136 {
137 }
138
139 void Adaptor::Pause()
140 {
141 }
142
143 void Adaptor::Resume()
144 {
145 }
146
147 void Adaptor::Stop()
148 {
149 }
150
151 bool Adaptor::AddIdle( CallbackBase* callback )
152 {
153   return false;
154 }
155
156 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
157 {
158 }
159
160 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
161 {
162   return Internal::Adaptor::Adaptor::AdaptorSignal();
163 }
164
165 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
166 {
167   return Internal::Adaptor::Adaptor::AdaptorSignal();
168 }
169
170 RenderSurface& Adaptor::GetSurface()
171 {
172   return Internal::Adaptor::Adaptor::GetSurface();
173 }
174
175 Any Adaptor::GetNativeWindowHandle()
176 {
177   Any window;
178   return window;
179 }
180
181 void Adaptor::ReleaseSurfaceLock()
182 {
183 }
184
185 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
186 {
187 }
188
189 void Adaptor::SetUseHardwareVSync(bool useHardware)
190 {
191 }
192
193 Adaptor& Adaptor::Get()
194 {
195   return Internal::Adaptor::Adaptor::Get();
196 }
197
198 bool Adaptor::IsAvailable()
199 {
200   return false;
201 }
202
203 void Adaptor::NotifySceneCreated()
204 {
205 }
206
207 void Adaptor::NotifyLanguageChanged()
208 {
209 }
210
211 void Adaptor::SetMinimumPinchDistance(float distance)
212 {
213 }
214
215 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
216 {
217 }
218
219 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
220 {
221 }
222
223 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
224 {
225 }
226
227 void Adaptor::SceneCreated()
228 {
229 }
230
231 void Adaptor::SetViewMode( ViewMode mode )
232 {
233 }
234
235 void Adaptor::SetStereoBase(  float stereoBase )
236 {
237 }
238
239 Adaptor::Adaptor()
240 : mImpl( NULL )
241 {
242 }
243
244 } // namespace Dali