Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / adaptors / common / 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 <adaptor.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
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>
30
31 namespace Dali
32 {
33
34 Adaptor& Adaptor::New( Window window )
35 {
36   return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
37 }
38
39 Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
40 {
41   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
42   return *adaptor;
43 }
44
45 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
46 {
47   return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
48 }
49
50 Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
51 {
52   Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
53   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
54   return *adaptor;
55 }
56
57 Adaptor::~Adaptor()
58 {
59   delete mImpl;
60 }
61
62 void Adaptor::Start()
63 {
64   mImpl->Start();
65 }
66
67 void Adaptor::Pause()
68 {
69   mImpl->Pause();
70 }
71
72 void Adaptor::Resume()
73 {
74   mImpl->Resume();
75 }
76
77 void Adaptor::Stop()
78 {
79   mImpl->Stop();
80 }
81
82 bool Adaptor::AddIdle( CallbackBase* callback )
83 {
84   return mImpl->AddIdle( callback );
85 }
86
87 void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
88 {
89   mImpl->ReplaceSurface(nativeWindow, surface);
90 }
91
92 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
93 {
94   return mImpl->ResizedSignal();
95 }
96
97 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
98 {
99   return mImpl->LanguageChangedSignal();
100 }
101
102 RenderSurface& Adaptor::GetSurface()
103 {
104   return mImpl->GetSurface();
105 }
106
107 void Adaptor::ReleaseSurfaceLock()
108 {
109   mImpl->ReleaseSurfaceLock();
110 }
111
112 void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
113 {
114   mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
115 }
116
117 void Adaptor::SetUseHardwareVSync(bool useHardware)
118 {
119   mImpl->SetUseHardwareVSync( useHardware );
120 }
121
122 Adaptor& Adaptor::Get()
123 {
124   return Internal::Adaptor::Adaptor::Get();
125 }
126
127 bool Adaptor::IsAvailable()
128 {
129   return Internal::Adaptor::Adaptor::IsAvailable();
130 }
131
132 void Adaptor::NotifySceneCreated()
133 {
134   mImpl->NotifySceneCreated();
135 }
136
137 void Adaptor::NotifyLanguageChanged()
138 {
139   mImpl->NotifyLanguageChanged();
140 }
141
142 void Adaptor::SetMinimumPinchDistance(float distance)
143 {
144   mImpl->SetMinimumPinchDistance(distance);
145 }
146
147 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
148 {
149   mImpl->FeedTouchPoint(point, timeStamp);
150 }
151
152 void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
153 {
154   mImpl->FeedWheelEvent(wheelEvent);
155 }
156
157 void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
158 {
159   mImpl->FeedKeyEvent(keyEvent);
160 }
161
162 void Adaptor::SceneCreated()
163 {
164   mImpl->SceneCreated();
165 }
166
167 void Adaptor::SetViewMode( ViewMode mode )
168 {
169   mImpl->SetViewMode( mode );
170 }
171
172 void Adaptor::SetStereoBase(  float stereoBase )
173 {
174   mImpl->SetStereoBase( stereoBase );
175 }
176
177
178 Adaptor::Adaptor()
179 : mImpl( NULL )
180 {
181 }
182
183 } // namespace Dali