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   GetImplementation(*this).ShowIndicator( visibleMode );
63 }
64
65 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
66 {
67   return GetImplementation(*this).IndicatorVisibilityChangedSignal();
68 }
69
70 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
71 {
72   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
73 }
74
75 void Window::RotateIndicator( WindowOrientation orientation )
76 {
77   GetImplementation(*this).RotateIndicator( orientation );
78 }
79
80 void Window::SetClass( std::string name, std::string klass )
81 {
82   GetImplementation(*this).SetClass( name, klass );
83 }
84
85 void Window::Raise()
86 {
87   GetImplementation(*this).Raise();
88 }
89
90 void Window::Lower()
91 {
92   GetImplementation(*this).Lower();
93 }
94
95 void Window::Activate()
96 {
97   GetImplementation(*this).Activate();
98 }
99
100 void Window::AddAvailableOrientation( WindowOrientation orientation )
101 {
102   GetImplementation(*this).AddAvailableOrientation( orientation );
103 }
104
105 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
106 {
107   GetImplementation(*this).RemoveAvailableOrientation( orientation );
108 }
109
110 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
111 {
112   GetImplementation(*this).SetPreferredOrientation( orientation );
113 }
114
115 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
116 {
117   return GetImplementation(*this).GetPreferredOrientation();
118 }
119
120 DragAndDropDetector Window::GetDragAndDropDetector() const
121 {
122   return GetImplementation(*this).GetDragAndDropDetector();
123 }
124
125 Any Window::GetNativeHandle() const
126 {
127   return GetImplementation(*this).GetNativeHandle();
128 }
129
130 Window::FocusSignalType& Window::FocusChangedSignal()
131 {
132   return GetImplementation(*this).FocusChangedSignal();
133 }
134
135 void Window::SetAcceptFocus( bool accept )
136 {
137   GetImplementation(*this).SetAcceptFocus( accept );
138 }
139
140 bool Window::IsFocusAcceptable() const
141 {
142   return GetImplementation(*this).IsFocusAcceptable();
143 }
144
145 void Window::Show()
146 {
147   GetImplementation(*this).Show();
148 }
149
150 void Window::Hide()
151 {
152   GetImplementation(*this).Hide();
153 }
154
155 bool Window::IsVisible() const
156 {
157   return GetImplementation(*this).IsVisible();
158 }
159
160 unsigned int Window::GetSupportedAuxiliaryHintCount() const
161 {
162   return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
163 }
164
165 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
166 {
167   return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
168 }
169
170 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
171 {
172   return GetImplementation(*this).AddAuxiliaryHint( hint, value );
173 }
174
175 bool Window::RemoveAuxiliaryHint( unsigned int id )
176 {
177   return GetImplementation(*this).RemoveAuxiliaryHint( id );
178 }
179
180 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
181 {
182   return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
183 }
184
185 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
186 {
187   return GetImplementation(*this).GetAuxiliaryHintValue( id );
188 }
189
190 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
191 {
192   return GetImplementation(*this).GetAuxiliaryHintId( hint );
193 }
194
195 void Window::SetInputRegion( const Rect< int >& inputRegion )
196 {
197   return GetImplementation(*this).SetInputRegion( inputRegion );
198 }
199
200 void Window::SetType( Window::Type type )
201 {
202   GetImplementation(*this).SetType( type );
203 }
204
205 Window::Type Window::GetType() const
206 {
207   return GetImplementation(*this).GetType();
208 }
209
210 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
211 {
212   return GetImplementation(*this).SetNotificationLevel( level );
213 }
214
215 Window::NotificationLevel::Type Window::GetNotificationLevel() const
216 {
217   return GetImplementation(*this).GetNotificationLevel();
218 }
219
220 void Window::SetOpaqueState( bool opaque )
221 {
222   GetImplementation(*this).SetOpaqueState( opaque );
223 }
224
225 bool Window::IsOpaqueState() const
226 {
227   return GetImplementation(*this).IsOpaqueState();
228 }
229
230 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
231 {
232   return GetImplementation(*this).SetScreenOffMode(screenMode);
233 }
234
235 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
236 {
237   return GetImplementation(*this).GetScreenOffMode();
238 }
239
240 bool Window::SetBrightness( int brightness )
241 {
242   return GetImplementation(*this).SetBrightness( brightness );
243 }
244
245 int Window::GetBrightness() const
246 {
247   return GetImplementation(*this).GetBrightness();
248 }
249
250 Window::ResizedSignalType& Window::ResizedSignal()
251 {
252   return GetImplementation(*this).ResizedSignal();
253 }
254
255 void Window::SetSize( Window::WindowSize size )
256 {
257   GetImplementation(*this).SetSize( size );
258 }
259
260 Window::WindowSize Window::GetSize() const
261 {
262   return GetImplementation(*this).GetSize();
263 }
264
265 void Window::SetPosition( Window::WindowPosition position )
266 {
267   GetImplementation(*this).SetPosition( position );
268 }
269
270 Window::WindowPosition Window::GetPosition() const
271 {
272   return GetImplementation(*this).GetPosition();
273 }
274
275 void Window::SetTransparency( bool transparent )
276 {
277   GetImplementation(*this).SetTransparency( transparent );
278 }
279
280 Window::Window( Internal::Adaptor::Window* window )
281 : BaseHandle( window )
282 {
283 }
284
285 } // namespace Dali