2 * Copyright (c) 2017 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/public-api/adaptor-framework/window.h>
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>
29 Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
31 Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
33 Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
34 Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
35 Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &sceneHolder, name, "", isTransparent );
37 return Window(window);
40 Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
42 Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
44 Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
45 Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
46 Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &sceneHolder, name, className, isTransparent );
48 return Window(window);
59 Window::Window(const Window& handle)
64 Window& Window::operator=(const Window& rhs)
66 BaseHandle::operator=(rhs);
70 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
72 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" );
74 GetImplementation(*this).ShowIndicator( visibleMode );
77 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
79 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" );
81 return GetImplementation(*this).IndicatorVisibilityChangedSignal();
84 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
86 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" );
88 GetImplementation(*this).SetIndicatorBgOpacity( opacity );
91 void Window::RotateIndicator( WindowOrientation orientation )
93 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" );
95 GetImplementation(*this).RotateIndicator( orientation );
98 void Window::SetClass( std::string name, std::string klass )
100 GetImplementation(*this).SetClass( name, klass );
105 GetImplementation(*this).Raise();
110 GetImplementation(*this).Lower();
113 void Window::Activate()
115 GetImplementation(*this).Activate();
118 void Window::AddAvailableOrientation( WindowOrientation orientation )
120 GetImplementation(*this).AddAvailableOrientation( orientation );
123 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
125 GetImplementation(*this).RemoveAvailableOrientation( orientation );
128 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
130 GetImplementation(*this).SetPreferredOrientation( orientation );
133 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
135 return GetImplementation(*this).GetPreferredOrientation();
138 DragAndDropDetector Window::GetDragAndDropDetector() const
140 return GetImplementation(*this).GetDragAndDropDetector();
143 Any Window::GetNativeHandle() const
145 return GetImplementation(*this).GetNativeHandle();
148 Window::FocusSignalType& Window::FocusChangedSignal()
150 return GetImplementation(*this).FocusChangedSignal();
153 void Window::SetAcceptFocus( bool accept )
155 GetImplementation(*this).SetAcceptFocus( accept );
158 bool Window::IsFocusAcceptable() const
160 return GetImplementation(*this).IsFocusAcceptable();
165 GetImplementation(*this).Show();
170 GetImplementation(*this).Hide();
173 bool Window::IsVisible() const
175 return GetImplementation(*this).IsVisible();
178 unsigned int Window::GetSupportedAuxiliaryHintCount() const
180 return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
183 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
185 return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
188 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
190 return GetImplementation(*this).AddAuxiliaryHint( hint, value );
193 bool Window::RemoveAuxiliaryHint( unsigned int id )
195 return GetImplementation(*this).RemoveAuxiliaryHint( id );
198 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
200 return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
203 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
205 return GetImplementation(*this).GetAuxiliaryHintValue( id );
208 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
210 return GetImplementation(*this).GetAuxiliaryHintId( hint );
213 void Window::SetInputRegion( const Rect< int >& inputRegion )
215 return GetImplementation(*this).SetInputRegion( inputRegion );
218 void Window::SetType( Window::Type type )
220 GetImplementation(*this).SetType( type );
223 Window::Type Window::GetType() const
225 return GetImplementation(*this).GetType();
228 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
230 return GetImplementation(*this).SetNotificationLevel( level );
233 Window::NotificationLevel::Type Window::GetNotificationLevel() const
235 return GetImplementation(*this).GetNotificationLevel();
238 void Window::SetOpaqueState( bool opaque )
240 GetImplementation(*this).SetOpaqueState( opaque );
243 bool Window::IsOpaqueState() const
245 return GetImplementation(*this).IsOpaqueState();
248 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
250 return GetImplementation(*this).SetScreenOffMode(screenMode);
253 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
255 return GetImplementation(*this).GetScreenOffMode();
258 bool Window::SetBrightness( int brightness )
260 return GetImplementation(*this).SetBrightness( brightness );
263 int Window::GetBrightness() const
265 return GetImplementation(*this).GetBrightness();
268 Window::ResizedSignalType& Window::ResizedSignal()
270 return GetImplementation(*this).ResizedSignal();
273 void Window::SetSize( Window::WindowSize size )
275 GetImplementation(*this).SetSize( size );
278 Window::WindowSize Window::GetSize() const
280 return GetImplementation(*this).GetSize();
283 void Window::SetPosition( Window::WindowPosition position )
285 GetImplementation(*this).SetPosition( position );
288 Window::WindowPosition Window::GetPosition() const
290 return GetImplementation(*this).GetPosition();
293 void Window::SetTransparency( bool transparent )
295 GetImplementation(*this).SetTransparency( transparent );
298 Window::Window( Internal::Adaptor::Window* window )
299 : BaseHandle( window )