2 * Copyright (c) 2014 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-manager.h>
26 #include <imf-manager.h>
27 #include <style-monitor.h>
29 #include <render-surface.h>
30 #include <adaptor-impl.h>
31 #include <window-impl.h>
36 Adaptor& Adaptor::New( Window window )
38 return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
41 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
43 Any winId = window.GetNativeHandle();
45 Internal::Adaptor::Window& windowImpl = GetImplementation(window);
46 Adaptor* adaptor = Internal::Adaptor::Adaptor::New( winId, windowImpl.GetSurface(), configuration );
47 windowImpl.SetAdaptor(*adaptor);
51 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
53 return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
56 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
58 Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
59 Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration );
78 void Adaptor::Resume()
88 bool Adaptor::AddIdle( CallbackBase* callback )
90 return mImpl->AddIdle( callback );
93 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
95 mImpl->ReplaceSurface(nativeWindow, surface);
98 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
100 return mImpl->ResizedSignal();
103 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
105 return mImpl->LanguageChangedSignal();
108 RenderSurface& Adaptor::GetSurface()
110 return mImpl->GetSurface();
113 void Adaptor::ReleaseSurfaceLock()
115 mImpl->ReleaseSurfaceLock();
118 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
120 mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
123 void Adaptor::SetUseHardwareVSync(bool useHardware)
125 mImpl->SetUseHardwareVSync( useHardware );
128 Adaptor& Adaptor::Get()
130 return Internal::Adaptor::Adaptor::Get();
133 bool Adaptor::IsAvailable()
135 return Internal::Adaptor::Adaptor::IsAvailable();
138 void Adaptor::NotifyLanguageChanged()
140 mImpl->NotifyLanguageChanged();
143 void Adaptor::SetMinimumPinchDistance(float distance)
145 mImpl->SetMinimumPinchDistance(distance);
148 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
150 mImpl->FeedTouchPoint(point, timeStamp);
153 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
155 mImpl->FeedWheelEvent(wheelEvent);
158 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
160 mImpl->FeedKeyEvent(keyEvent);