X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fadaptor-framework%2Fwindow.cpp;h=9d8c8306b5d6ba85059ad618358b013617ff8026;hb=c903b5edb3947f9c1db972436ce613031f8cb1b5;hp=9eeb2d92680f64f4a630fcfb741bf7e8c0856df7;hpb=09e6892adcddf6d2bf7c88dc8442a42da2ac57f5;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index 9eeb2d9..9d8c830 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include #include @@ -26,16 +29,45 @@ namespace Dali { +class DALI_INTERNAL DragAndDropDetector : public BaseHandle {}; // Empty class only required to compile Deprecated API GetDragAndDropDetector + Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent); - return Window(window); + return Dali::Window::New(posSize, name, "", isTransparent); } Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); - return Window(window); + Window newWindow; + + const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable(); + bool isNewWindowAllowed = true; + + if (isAdaptorAvailable) + { + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); + } + + if (isNewWindowAllowed) + { + Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); + + Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); + + if (isAdaptorAvailable) + { + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); + } + newWindow = Window(window); + } + else + { + DALI_LOG_ERROR("This device can't support multiple windows.\n"); + } + + return newWindow; } Window::Window() @@ -57,23 +89,66 @@ Window& Window::operator=(const Window& rhs) return *this; } +void Window::Add( Dali::Actor actor ) +{ + GetImplementation( *this ).Add( actor ); +} + +void Window::Remove( Dali::Actor actor ) +{ + GetImplementation( *this ).Remove( actor ); +} + +void Window::SetBackgroundColor( const Vector4& color ) +{ + GetImplementation( *this ).SetBackgroundColor( color ); +} + +Vector4 Window::GetBackgroundColor() const +{ + return GetImplementation( *this ).GetBackgroundColor(); +} + +Layer Window::GetRootLayer() const +{ + return GetImplementation( *this ).GetRootLayer(); +} + +uint32_t Window::GetLayerCount() const +{ + return GetImplementation( *this ).GetLayerCount(); +} + +Layer Window::GetLayer( uint32_t depth ) const +{ + return GetImplementation( *this ).GetLayer( depth ); +} + void Window::ShowIndicator( IndicatorVisibleMode visibleMode ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" ); + GetImplementation(*this).ShowIndicator( visibleMode ); } Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" ); + return GetImplementation(*this).IndicatorVisibilityChangedSignal(); } void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" ); + GetImplementation(*this).SetIndicatorBgOpacity( opacity ); } void Window::RotateIndicator( WindowOrientation orientation ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" ); + GetImplementation(*this).RotateIndicator( orientation ); } @@ -107,7 +182,7 @@ void Window::RemoveAvailableOrientation( WindowOrientation orientation ) GetImplementation(*this).RemoveAvailableOrientation( orientation ); } -void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) +void Window::SetPreferredOrientation( WindowOrientation orientation ) { GetImplementation(*this).SetPreferredOrientation( orientation ); } @@ -119,7 +194,9 @@ Dali::Window::WindowOrientation Window::GetPreferredOrientation() DragAndDropDetector Window::GetDragAndDropDetector() const { - return GetImplementation(*this).GetDragAndDropDetector(); + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetDragAndDropDetector is deprecated and will be removed from the next release.\n" ); + DALI_ASSERT_ALWAYS( &GetImplementation( *this ) == GetObjectPtr() && "Empty Handle" ); + return Dali::DragAndDropDetector(); } Any Window::GetNativeHandle() const @@ -129,9 +206,15 @@ Any Window::GetNativeHandle() const Window::FocusSignalType& Window::FocusChangedSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: FocusChangedSignal is deprecated and will be removed from next release.\n" ); return GetImplementation(*this).FocusChangedSignal(); } +Window::FocusChangeSignalType& Window::FocusChangeSignal() +{ + return GetImplementation(*this).FocusChangeSignal(); +} + void Window::SetAcceptFocus( bool accept ) { GetImplementation(*this).SetAcceptFocus( accept ); @@ -249,9 +332,15 @@ int Window::GetBrightness() const Window::ResizedSignalType& Window::ResizedSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ResizedSignal is deprecated and will be removed from next release.\n" ); return GetImplementation(*this).ResizedSignal(); } +Window::ResizeSignalType& Window::ResizeSignal() +{ + return GetImplementation(*this).ResizeSignal(); +} + void Window::SetSize( Window::WindowSize size ) { GetImplementation(*this).SetSize( size );