X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-window.cpp;h=9ab50210c199a9d79bb0a4d7e4aeccefd42e769a;hp=1424f1ad8098ca6cb715e23dbe41c73ed95a3637;hb=7018f61b640b6fcf9cb576b537bafcb6bb8240e8;hpb=65f6c9e91e0efbee208894b4cb1f9334a129b628 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp index 1424f1a..9ab5021 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -21,16 +21,12 @@ // EXTERNAL INCLUDES #include #include -#include #include #define DALI_WINDOW_H -#include +#include #include -// INTERNAL INCLUDES -#include "test-render-surface.h" - using AdaptorImpl = Dali::Internal::Adaptor::Adaptor; namespace Dali @@ -48,7 +44,11 @@ namespace Adaptor { Window::Window( const PositionSize& positionSize ) -: SceneHolder( positionSize ) +: SceneHolder( positionSize ), + mFocusChangeSignal(), + mResizeSignal(), + mRotationAngle(90), // dummy angle for test coverage + mVisibilityChangedSignal() { } @@ -82,16 +82,13 @@ 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; + +Window::Window( Window&& rhs ) = default; + +Window& Window::operator=( Window&& rhs ) = default; Dali::Window Window::New( PositionSize windowPosition, const std::string& name, bool isTransparent ) { @@ -120,11 +117,66 @@ Integration::Scene Window::GetScene() return GetImplementation( *this ).GetScene(); } -Integration::RenderSurface& Window::GetRenderSurface() +Dali::RenderSurfaceInterface& Window::GetRenderSurface() { return GetImplementation( *this ).GetRenderSurface(); } +void Window::Add( Actor actor ) +{ + GetImplementation( *this ).Add( actor ); +} + +void Window::Remove( Actor actor ) +{ + GetImplementation( *this ).Remove( actor ); +} + +Dali::Layer Window::GetRootLayer() const +{ + return GetImplementation( *this ).GetRootLayer(); +} + +void Window::SetBackgroundColor( const Vector4& color ) +{ + GetImplementation( *this ).SetBackgroundColor( color ); +} + +Vector4 Window::GetBackgroundColor() const +{ + return GetImplementation( *this ).GetBackgroundColor(); +} + +void Window::Raise() +{ + GetImplementation( *this ).mFocusChangeSignal.Emit(*this, true); +} + +void Window::Hide() +{ + GetImplementation( *this ).mVisibilityChangedSignal.Emit( *this, false ); +} + +FocusChangeSignalType& Window::FocusChangeSignal() +{ + return GetImplementation( *this ).mFocusChangeSignal; +} + +ResizeSignalType& Window::ResizeSignal() +{ + return GetImplementation( *this ).mResizeSignal; +} + +Window::KeyEventSignalType& Window::KeyEventSignal() +{ + return GetImplementation( *this ).KeyEventSignal(); +} + +Window::TouchEventSignalType& Window::TouchedSignal() +{ + return GetImplementation( *this ).TouchedSignal(); +} + namespace DevelWindow { @@ -140,30 +192,57 @@ Window Get( Actor actor ) return Dali::Window( windowImpl ); } -EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window ) +Window DownCast( BaseHandle handle ) { - return GetImplementation( window ).GetScene().EventProcessingFinishedSignal(); + Internal::Adaptor::Window* windowImpl = nullptr; + if ( Dali::Adaptor::IsAvailable() ) + { + windowImpl = dynamic_cast( handle.GetObjectPtr()); + } + return Dali::Window( windowImpl ); } -KeyEventSignalType& KeyEventSignal( Window window ) +void SetPositionSize(Window window, PositionSize positionSize) { - return GetImplementation( window ).KeyEventSignal(); + Uint16Pair newSize(positionSize.width, positionSize.height); + GetImplementation( window ).mResizeSignal.Emit(window,newSize); } -KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window ) +int GetPhysicalOrientation(Window window) { - return GetImplementation( window ).KeyEventGeneratedSignal(); + return GetImplementation( window ).mRotationAngle; } -TouchSignalType& TouchSignal( Window window ) +void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ) { - return GetImplementation( window ).TouchSignal(); + CallbackBase::Execute( *callback, frameId ); +} + +void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + CallbackBase::Execute( *callback, frameId ); +} + +EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window ) +{ + return GetImplementation( window ).GetScene().EventProcessingFinishedSignal(); +} + +KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window ) +{ + return GetImplementation( window ).KeyEventGeneratedSignal(); } WheelEventSignalType& WheelEventSignal( Window window ) { return GetImplementation( window ).WheelEventSignal(); } + +VisibilityChangedSignalType& VisibilityChangedSignal( Window window ) +{ + return GetImplementation( window ).mVisibilityChangedSignal; +} + } // namespace DevelWindow } // Dali