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.
22 #include <dali/integration-api/debug.h>
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>
34 Adaptor& Adaptor::New( Window window )
36 return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
39 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
41 Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
45 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
47 return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
50 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
52 Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
53 Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
72 void Adaptor::Resume()
82 bool Adaptor::AddIdle( CallbackBase* callback )
84 return mImpl->AddIdle( callback );
87 void Adaptor::RemoveIdle( CallbackBase* callback )
89 mImpl->RemoveIdle( callback );
92 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
94 mImpl->ReplaceSurface(nativeWindow, surface);
97 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
99 return mImpl->ResizedSignal();
102 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
104 return mImpl->LanguageChangedSignal();
107 RenderSurface& Adaptor::GetSurface()
109 return mImpl->GetSurface();
112 Any Adaptor::GetNativeWindowHandle()
114 return mImpl->GetNativeWindowHandle();
117 void Adaptor::ReleaseSurfaceLock()
119 mImpl->ReleaseSurfaceLock();
122 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
124 mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
127 void Adaptor::SetUseHardwareVSync(bool useHardware)
129 mImpl->SetUseHardwareVSync( useHardware );
132 Adaptor& Adaptor::Get()
134 return Internal::Adaptor::Adaptor::Get();
137 bool Adaptor::IsAvailable()
139 return Internal::Adaptor::Adaptor::IsAvailable();
142 void Adaptor::NotifySceneCreated()
144 mImpl->NotifySceneCreated();
147 void Adaptor::NotifyLanguageChanged()
149 mImpl->NotifyLanguageChanged();
152 void Adaptor::SetMinimumPinchDistance(float distance)
154 mImpl->SetMinimumPinchDistance(distance);
157 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
159 mImpl->FeedTouchPoint(point, timeStamp);
162 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
164 mImpl->FeedWheelEvent(wheelEvent);
167 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
169 mImpl->FeedKeyEvent(keyEvent);
172 void Adaptor::SceneCreated()
174 mImpl->SceneCreated();
177 void Adaptor::SetViewMode( ViewMode mode )
179 mImpl->SetViewMode( mode );
182 void Adaptor::SetStereoBase( float stereoBase )
184 mImpl->SetStereoBase( stereoBase );
187 void Adaptor::SurfaceSizeChanged( const PositionSize& positionSize )
189 mImpl->SurfaceSizeChanged( positionSize );