Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / window.cpp
1 /*
2  * Copyright (c) 2017 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 <dali/public-api/adaptor-framework/window.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/internal/window-system/common/window-impl.h>
24 #include <dali/internal/window-system/common/orientation-impl.h>
25
26 namespace Dali
27 {
28
29 Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
30 {
31   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
32   return Window(window);
33 }
34
35 Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
36 {
37   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
38   return Window(window);
39 }
40
41 Window::Window()
42 {
43 }
44
45 Window::~Window()
46 {
47 }
48
49 Window::Window(const Window& handle)
50 : BaseHandle(handle)
51 {
52 }
53
54 Window& Window::operator=(const Window& rhs)
55 {
56   BaseHandle::operator=(rhs);
57   return *this;
58 }
59
60 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
61 {
62   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" );
63
64   GetImplementation(*this).ShowIndicator( visibleMode );
65 }
66
67 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
68 {
69   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" );
70
71   return GetImplementation(*this).IndicatorVisibilityChangedSignal();
72 }
73
74 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
75 {
76   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" );
77
78   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
79 }
80
81 void Window::RotateIndicator( WindowOrientation orientation )
82 {
83   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" );
84
85   GetImplementation(*this).RotateIndicator( orientation );
86 }
87
88 void Window::SetClass( std::string name, std::string klass )
89 {
90   GetImplementation(*this).SetClass( name, klass );
91 }
92
93 void Window::Raise()
94 {
95   GetImplementation(*this).Raise();
96 }
97
98 void Window::Lower()
99 {
100   GetImplementation(*this).Lower();
101 }
102
103 void Window::Activate()
104 {
105   GetImplementation(*this).Activate();
106 }
107
108 void Window::AddAvailableOrientation( WindowOrientation orientation )
109 {
110   GetImplementation(*this).AddAvailableOrientation( orientation );
111 }
112
113 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
114 {
115   GetImplementation(*this).RemoveAvailableOrientation( orientation );
116 }
117
118 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
119 {
120   GetImplementation(*this).SetPreferredOrientation( orientation );
121 }
122
123 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
124 {
125   return GetImplementation(*this).GetPreferredOrientation();
126 }
127
128 DragAndDropDetector Window::GetDragAndDropDetector() const
129 {
130   return GetImplementation(*this).GetDragAndDropDetector();
131 }
132
133 Any Window::GetNativeHandle() const
134 {
135   return GetImplementation(*this).GetNativeHandle();
136 }
137
138 Window::FocusSignalType& Window::FocusChangedSignal()
139 {
140   return GetImplementation(*this).FocusChangedSignal();
141 }
142
143 void Window::SetAcceptFocus( bool accept )
144 {
145   GetImplementation(*this).SetAcceptFocus( accept );
146 }
147
148 bool Window::IsFocusAcceptable() const
149 {
150   return GetImplementation(*this).IsFocusAcceptable();
151 }
152
153 void Window::Show()
154 {
155   GetImplementation(*this).Show();
156 }
157
158 void Window::Hide()
159 {
160   GetImplementation(*this).Hide();
161 }
162
163 bool Window::IsVisible() const
164 {
165   return GetImplementation(*this).IsVisible();
166 }
167
168 unsigned int Window::GetSupportedAuxiliaryHintCount() const
169 {
170   return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
171 }
172
173 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
174 {
175   return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
176 }
177
178 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
179 {
180   return GetImplementation(*this).AddAuxiliaryHint( hint, value );
181 }
182
183 bool Window::RemoveAuxiliaryHint( unsigned int id )
184 {
185   return GetImplementation(*this).RemoveAuxiliaryHint( id );
186 }
187
188 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
189 {
190   return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
191 }
192
193 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
194 {
195   return GetImplementation(*this).GetAuxiliaryHintValue( id );
196 }
197
198 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
199 {
200   return GetImplementation(*this).GetAuxiliaryHintId( hint );
201 }
202
203 void Window::SetInputRegion( const Rect< int >& inputRegion )
204 {
205   return GetImplementation(*this).SetInputRegion( inputRegion );
206 }
207
208 void Window::SetType( Window::Type type )
209 {
210   GetImplementation(*this).SetType( type );
211 }
212
213 Window::Type Window::GetType() const
214 {
215   return GetImplementation(*this).GetType();
216 }
217
218 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
219 {
220   return GetImplementation(*this).SetNotificationLevel( level );
221 }
222
223 Window::NotificationLevel::Type Window::GetNotificationLevel() const
224 {
225   return GetImplementation(*this).GetNotificationLevel();
226 }
227
228 void Window::SetOpaqueState( bool opaque )
229 {
230   GetImplementation(*this).SetOpaqueState( opaque );
231 }
232
233 bool Window::IsOpaqueState() const
234 {
235   return GetImplementation(*this).IsOpaqueState();
236 }
237
238 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
239 {
240   return GetImplementation(*this).SetScreenOffMode(screenMode);
241 }
242
243 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
244 {
245   return GetImplementation(*this).GetScreenOffMode();
246 }
247
248 bool Window::SetBrightness( int brightness )
249 {
250   return GetImplementation(*this).SetBrightness( brightness );
251 }
252
253 int Window::GetBrightness() const
254 {
255   return GetImplementation(*this).GetBrightness();
256 }
257
258 Window::ResizedSignalType& Window::ResizedSignal()
259 {
260   return GetImplementation(*this).ResizedSignal();
261 }
262
263 void Window::SetSize( Window::WindowSize size )
264 {
265   GetImplementation(*this).SetSize( size );
266 }
267
268 Window::WindowSize Window::GetSize() const
269 {
270   return GetImplementation(*this).GetSize();
271 }
272
273 void Window::SetPosition( Window::WindowPosition position )
274 {
275   GetImplementation(*this).SetPosition( position );
276 }
277
278 Window::WindowPosition Window::GetPosition() const
279 {
280   return GetImplementation(*this).GetPosition();
281 }
282
283 void Window::SetTransparency( bool transparent )
284 {
285   GetImplementation(*this).SetTransparency( transparent );
286 }
287
288 Window::Window( Internal::Adaptor::Window* window )
289 : BaseHandle( window )
290 {
291 }
292
293 } // namespace Dali