2 * Copyright (c) 2018 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/adaptor.h>
22 #include <dali/integration-api/debug.h>
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>
33 Adaptor& Adaptor::New( Window window )
35 return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
38 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
40 Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
44 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
46 return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
49 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
51 Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
52 Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
71 void Adaptor::Resume()
81 bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
83 return mImpl->AddIdle( callback, hasReturnValue, false );
86 void Adaptor::RemoveIdle( CallbackBase* callback )
88 mImpl->RemoveIdle( callback );
91 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
93 mImpl->ReplaceSurface(nativeWindow, surface);
96 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
98 return mImpl->ResizedSignal();
101 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
103 return mImpl->LanguageChangedSignal();
106 RenderSurface& Adaptor::GetSurface()
108 return mImpl->GetSurface();
111 Any Adaptor::GetNativeWindowHandle()
113 return mImpl->GetNativeWindowHandle();
116 Any Adaptor::GetGraphicsDisplay()
118 return mImpl->GetGraphicsDisplay();
121 void Adaptor::ReleaseSurfaceLock()
123 mImpl->ReleaseSurfaceLock();
126 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
128 mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
131 void Adaptor::SetPreRenderCallback( CallbackBase* callback )
133 mImpl->SetPreRenderCallback( callback );
136 void Adaptor::SetUseHardwareVSync(bool useHardware)
138 mImpl->SetUseHardwareVSync( useHardware );
141 Adaptor& Adaptor::Get()
143 return Internal::Adaptor::Adaptor::Get();
146 bool Adaptor::IsAvailable()
148 return Internal::Adaptor::Adaptor::IsAvailable();
151 void Adaptor::NotifySceneCreated()
153 mImpl->NotifySceneCreated();
156 void Adaptor::NotifyLanguageChanged()
158 mImpl->NotifyLanguageChanged();
161 void Adaptor::SetMinimumPinchDistance(float distance)
163 mImpl->SetMinimumPinchDistance(distance);
166 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
168 mImpl->FeedTouchPoint(point, timeStamp);
171 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
173 mImpl->FeedWheelEvent(wheelEvent);
176 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
178 mImpl->FeedKeyEvent(keyEvent);
181 void Adaptor::SceneCreated()
183 mImpl->SceneCreated();
186 void Adaptor::SetViewMode( ViewMode mode )
188 mImpl->SetViewMode( mode );
191 void Adaptor::SetStereoBase( float stereoBase )
193 mImpl->SetStereoBase( stereoBase );
196 void Adaptor::RenderOnce()
201 const LogFactoryInterface& Adaptor::GetLogFactory()
203 return mImpl->GetLogFactory();