X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fadaptor-framework%2Fwindow.cpp;h=4e834a62e99d074d21824a274e0716e9a86dea63;hb=f79805402bf8bd9b7ceb4561d4c089411fb5927f;hp=9d8c8306b5d6ba85059ad618358b013617ff8026;hpb=7936b0201cab6336c494cb7d127f249e07d8e893;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 9d8c830..4e834a6 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -22,15 +22,12 @@ #include // INTERNAL INCLUDES -#include -#include #include +#include +#include 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) { return Dali::Window::New(posSize, name, "", isTransparent); @@ -41,24 +38,24 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str Window newWindow; const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable(); - bool isNewWindowAllowed = true; + bool isNewWindowAllowed = true; - if (isAdaptorAvailable) + if(isAdaptorAvailable) { Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); + isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); } - if (isNewWindowAllowed) + if(isNewWindowAllowed) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent); + Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, WindowType::NORMAL, isTransparent); Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); - if (isAdaptorAvailable) + if(isAdaptorAvailable) { Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder); } newWindow = Window(window); } @@ -78,83 +75,67 @@ Window::~Window() { } -Window::Window(const Window& handle) -: BaseHandle(handle) -{ -} +Window::Window(const Window& copy) = default; -Window& Window::operator=(const Window& rhs) -{ - BaseHandle::operator=(rhs); - return *this; -} +Window& Window::operator=(const Window& rhs) = default; -void Window::Add( Dali::Actor actor ) -{ - GetImplementation( *this ).Add( actor ); -} +Window::Window(Window&& rhs) noexcept = default; + +Window& Window::operator=(Window&& rhs) noexcept = default; -void Window::Remove( Dali::Actor actor ) +Window Window::DownCast(BaseHandle handle) { - GetImplementation( *this ).Remove( actor ); + return Window(dynamic_cast(handle.GetObjectPtr())); } -void Window::SetBackgroundColor( const Vector4& color ) +void Window::Add(Dali::Actor actor) { - GetImplementation( *this ).SetBackgroundColor( color ); + GetImplementation(*this).Add(actor); } -Vector4 Window::GetBackgroundColor() const +void Window::Remove(Dali::Actor actor) { - return GetImplementation( *this ).GetBackgroundColor(); + GetImplementation(*this).Remove(actor); } -Layer Window::GetRootLayer() const +void Window::SetBackgroundColor(const Vector4& color) { - return GetImplementation( *this ).GetRootLayer(); + GetImplementation(*this).SetBackgroundColor(color); } -uint32_t Window::GetLayerCount() const +Vector4 Window::GetBackgroundColor() const { - return GetImplementation( *this ).GetLayerCount(); + return GetImplementation(*this).GetBackgroundColor(); } -Layer Window::GetLayer( uint32_t depth ) const +Layer Window::GetRootLayer() const { - return GetImplementation( *this ).GetLayer( depth ); + return GetImplementation(*this).GetRootLayer(); } -void Window::ShowIndicator( IndicatorVisibleMode visibleMode ) +Layer Window::GetOverlayLayer() { - DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" ); - - GetImplementation(*this).ShowIndicator( visibleMode ); + return GetImplementation(*this).GetOverlayLayer(); } -Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal() +uint32_t Window::GetLayerCount() const { - DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" ); - - return GetImplementation(*this).IndicatorVisibilityChangedSignal(); + return GetImplementation(*this).GetLayerCount(); } -void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity ) +Layer Window::GetLayer(uint32_t depth) const { - DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" ); - - GetImplementation(*this).SetIndicatorBgOpacity( opacity ); + return GetImplementation(*this).GetLayer(depth); } -void Window::RotateIndicator( WindowOrientation orientation ) +Uint16Pair Window::GetDpi() const { - DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" ); - - GetImplementation(*this).RotateIndicator( orientation ); + return GetImplementation(*this).GetDpi(); } -void Window::SetClass( std::string name, std::string klass ) +void Window::SetClass(std::string name, std::string klass) { - GetImplementation(*this).SetClass( name, klass ); + GetImplementation(*this).SetClass(name, klass); } void Window::Raise() @@ -172,52 +153,39 @@ void Window::Activate() GetImplementation(*this).Activate(); } -void Window::AddAvailableOrientation( WindowOrientation orientation ) +void Window::AddAvailableOrientation(WindowOrientation orientation) { - GetImplementation(*this).AddAvailableOrientation( orientation ); + GetImplementation(*this).AddAvailableOrientation(orientation); } -void Window::RemoveAvailableOrientation( WindowOrientation orientation ) +void Window::RemoveAvailableOrientation(WindowOrientation orientation) { - GetImplementation(*this).RemoveAvailableOrientation( orientation ); + GetImplementation(*this).RemoveAvailableOrientation(orientation); } -void Window::SetPreferredOrientation( WindowOrientation orientation ) +void Window::SetPreferredOrientation(WindowOrientation orientation) { - GetImplementation(*this).SetPreferredOrientation( orientation ); + GetImplementation(*this).SetPreferredOrientation(orientation); } -Dali::Window::WindowOrientation Window::GetPreferredOrientation() +WindowOrientation Window::GetPreferredOrientation() { return GetImplementation(*this).GetPreferredOrientation(); } -DragAndDropDetector Window::GetDragAndDropDetector() const -{ - 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 { return GetImplementation(*this).GetNativeHandle(); } -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 ) +void Window::SetAcceptFocus(bool accept) { - GetImplementation(*this).SetAcceptFocus( accept ); + GetImplementation(*this).SetAcceptFocus(accept); } bool Window::IsFocusAcceptable() const @@ -245,64 +213,64 @@ unsigned int Window::GetSupportedAuxiliaryHintCount() const return GetImplementation(*this).GetSupportedAuxiliaryHintCount(); } -std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const +std::string Window::GetSupportedAuxiliaryHint(unsigned int index) const { - return GetImplementation(*this).GetSupportedAuxiliaryHint( index ); + return GetImplementation(*this).GetSupportedAuxiliaryHint(index); } -unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value ) +unsigned int Window::AddAuxiliaryHint(const std::string& hint, const std::string& value) { - return GetImplementation(*this).AddAuxiliaryHint( hint, value ); + return GetImplementation(*this).AddAuxiliaryHint(hint, value); } -bool Window::RemoveAuxiliaryHint( unsigned int id ) +bool Window::RemoveAuxiliaryHint(unsigned int id) { - return GetImplementation(*this).RemoveAuxiliaryHint( id ); + return GetImplementation(*this).RemoveAuxiliaryHint(id); } -bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value ) +bool Window::SetAuxiliaryHintValue(unsigned int id, const std::string& value) { - return GetImplementation(*this).SetAuxiliaryHintValue( id, value ); + return GetImplementation(*this).SetAuxiliaryHintValue(id, value); } -std::string Window::GetAuxiliaryHintValue( unsigned int id ) const +std::string Window::GetAuxiliaryHintValue(unsigned int id) const { - return GetImplementation(*this).GetAuxiliaryHintValue( id ); + return GetImplementation(*this).GetAuxiliaryHintValue(id); } -unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const +unsigned int Window::GetAuxiliaryHintId(const std::string& hint) const { - return GetImplementation(*this).GetAuxiliaryHintId( hint ); + return GetImplementation(*this).GetAuxiliaryHintId(hint); } -void Window::SetInputRegion( const Rect< int >& inputRegion ) +void Window::SetInputRegion(const Rect& inputRegion) { - return GetImplementation(*this).SetInputRegion( inputRegion ); + return GetImplementation(*this).SetInputRegion(inputRegion); } -void Window::SetType( Window::Type type ) +void Window::SetType(WindowType type) { - GetImplementation(*this).SetType( type ); + GetImplementation(*this).SetType(type); } -Window::Type Window::GetType() const +WindowType Window::GetType() const { return GetImplementation(*this).GetType(); } -bool Window::SetNotificationLevel( Window::NotificationLevel::Type level ) +WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level) { - return GetImplementation(*this).SetNotificationLevel( level ); + return GetImplementation(*this).SetNotificationLevel(level); } -Window::NotificationLevel::Type Window::GetNotificationLevel() const +WindowNotificationLevel Window::GetNotificationLevel() const { return GetImplementation(*this).GetNotificationLevel(); } -void Window::SetOpaqueState( bool opaque ) +void Window::SetOpaqueState(bool opaque) { - GetImplementation(*this).SetOpaqueState( opaque ); + GetImplementation(*this).SetOpaqueState(opaque); } bool Window::IsOpaqueState() const @@ -310,19 +278,19 @@ bool Window::IsOpaqueState() const return GetImplementation(*this).IsOpaqueState(); } -bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode) +WindowOperationResult Window::SetScreenOffMode(WindowScreenOffMode screenMode) { return GetImplementation(*this).SetScreenOffMode(screenMode); } -Window::ScreenOffMode::Type Window::GetScreenOffMode() const +WindowScreenOffMode Window::GetScreenOffMode() const { return GetImplementation(*this).GetScreenOffMode(); } -bool Window::SetBrightness( int brightness ) +WindowOperationResult Window::SetBrightness(int brightness) { - return GetImplementation(*this).SetBrightness( brightness ); + return GetImplementation(*this).SetBrightness(brightness); } int Window::GetBrightness() const @@ -330,20 +298,14 @@ int Window::GetBrightness() const return GetImplementation(*this).GetBrightness(); } -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 ) +void Window::SetSize(Window::WindowSize size) { - GetImplementation(*this).SetSize( size ); + GetImplementation(*this).SetSize(size); } Window::WindowSize Window::GetSize() const @@ -351,23 +313,43 @@ Window::WindowSize Window::GetSize() const return GetImplementation(*this).GetSize(); } -void Window::SetPosition( Window::WindowPosition position ) +void Window::SetPosition(Dali::Window::WindowPosition position) { - GetImplementation(*this).SetPosition( position ); + GetImplementation(*this).SetPosition(position); } -Window::WindowPosition Window::GetPosition() const +Dali::Window::WindowPosition Window::GetPosition() const { return GetImplementation(*this).GetPosition(); } -void Window::SetTransparency( bool transparent ) +void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) +{ + return GetImplementation(*this).SetLayout(numCols, numRows, column, row, colSpan, rowSpan); +} + +void Window::SetTransparency(bool transparent) +{ + GetImplementation(*this).SetTransparency(transparent); +} + +Dali::RenderTaskList Window::GetRenderTaskList() +{ + return GetImplementation(*this).GetRenderTaskList(); +} + +Window::KeyEventSignalType& Window::KeyEventSignal() +{ + return GetImplementation(*this).KeyEventSignal(); +} + +Window::TouchEventSignalType& Window::TouchedSignal() { - GetImplementation(*this).SetTransparency( transparent ); + return GetImplementation(*this).TouchedSignal(); } -Window::Window( Internal::Adaptor::Window* window ) -: BaseHandle( window ) +Window::Window(Internal::Adaptor::Window* window) +: BaseHandle(window) { }