2 * Copyright (c) 2016 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.
19 #include <dali/integration-api/adaptors/adaptor.h>
21 #include <dali/public-api/object/base-object.h>
23 #include <toolkit-adaptor-impl.h>
33 bool Adaptor::mAvailable = false;
34 Vector<CallbackBase*> Adaptor::mCallbacks = Vector<CallbackBase*>();
36 Dali::Adaptor& Adaptor::Get()
38 Dali::Adaptor* adaptor = new Dali::Adaptor;
39 Adaptor::mAvailable = true;
43 Dali::RenderSurface& Adaptor::GetSurface()
45 Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface;
46 return *renderSurface;
49 Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal()
51 Dali::Adaptor::AdaptorSignalType* signal = new Dali::Adaptor::AdaptorSignalType;
55 } // namespace Adaptor
56 } // namespace Internal
58 Adaptor& Adaptor::New( Window window )
60 return Internal::Adaptor::Adaptor::Get();
63 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
65 return Internal::Adaptor::Adaptor::Get();
68 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
70 return Internal::Adaptor::Adaptor::Get();
73 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
75 return Internal::Adaptor::Adaptor::Get();
90 void Adaptor::Resume()
98 bool Adaptor::AddIdle( CallbackBase* callback )
100 const bool isAvailable = IsAvailable();
104 Internal::Adaptor::Adaptor::mCallbacks.PushBack( callback );
110 void Adaptor::RemoveIdle( CallbackBase* callback )
112 const bool isAvailable = IsAvailable();
116 for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
117 endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
121 if( callback == *it )
123 Internal::Adaptor::Adaptor::mCallbacks.Remove( it );
130 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
134 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
136 return Internal::Adaptor::Adaptor::AdaptorSignal();
139 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
141 return Internal::Adaptor::Adaptor::AdaptorSignal();
144 RenderSurface& Adaptor::GetSurface()
146 return Internal::Adaptor::Adaptor::GetSurface();
149 Any Adaptor::GetNativeWindowHandle()
155 void Adaptor::ReleaseSurfaceLock()
159 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
163 void Adaptor::SetUseHardwareVSync(bool useHardware)
167 Adaptor& Adaptor::Get()
169 return Internal::Adaptor::Adaptor::Get();
172 bool Adaptor::IsAvailable()
174 return Internal::Adaptor::Adaptor::mAvailable;
177 void Adaptor::NotifySceneCreated()
181 void Adaptor::NotifyLanguageChanged()
185 void Adaptor::SetMinimumPinchDistance(float distance)
189 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
193 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
197 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
201 void Adaptor::SceneCreated()
205 void Adaptor::SetViewMode( ViewMode mode )
209 void Adaptor::SetStereoBase( float stereoBase )