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-adaptor.cpp;h=522537c02f5f7460de42c824357ed6236de9ad96;hp=dcf0560ab189ec2c1c875ab5c78f34ec5c24523e;hb=8ae521ab64a3922f3419fbbfb83dde57e6135cf5;hpb=ed980a3b418d7a235d4774b786d84974421650fd diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp index dcf0560..522537c 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.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. @@ -15,14 +15,20 @@ * */ -// CLASS HEADER +#include + +// Don't want to include the actual window.h which otherwise will be indirectly included by adaptor.h. +#define DALI_WINDOW_H #include +#include + #include #include #include #include +#include namespace Dali { @@ -34,6 +40,8 @@ namespace Adaptor bool Adaptor::mAvailable = false; Vector Adaptor::mCallbacks = Vector(); +Dali::WindowContainer Adaptor::mWindows; +Dali::Adaptor::WindowCreatedSignalType* Adaptor::mWindowCreatedSignal = nullptr; Dali::Adaptor& Adaptor::Get() { @@ -42,18 +50,33 @@ Dali::Adaptor& Adaptor::Get() return *adaptor; } -Dali::RenderSurface& Adaptor::GetSurface() +Dali::RenderSurfaceInterface& Adaptor::GetSurface() { - Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface; + Dali::RenderSurfaceInterface* renderSurface = reinterpret_cast ( new Dali::TestRenderSurface( Dali::PositionSize( 0, 0, 480, 800 ) ) ); return *renderSurface; } +Dali::WindowContainer Adaptor::GetWindows() +{ + return Adaptor::mWindows; +} + Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal() { Dali::Adaptor::AdaptorSignalType* signal = new Dali::Adaptor::AdaptorSignalType; return *signal; } +Dali::Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal() +{ + if ( !Adaptor::mWindowCreatedSignal ) + { + Adaptor::mWindowCreatedSignal = new Dali::Adaptor::WindowCreatedSignalType; + } + + return *Adaptor::mWindowCreatedSignal; +} + } // namespace Adaptor } // namespace Internal @@ -67,12 +90,32 @@ Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) return Internal::Adaptor::Adaptor::Get(); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) +Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration ) +{ + return Internal::Adaptor::Adaptor::Get(); +} + +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface ) { return Internal::Adaptor::Adaptor::Get(); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) { return Internal::Adaptor::Adaptor::Get(); } @@ -129,7 +172,11 @@ void Adaptor::RemoveIdle( CallbackBase* callback ) } } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) +void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface ) +{ +} + +void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface ) { } @@ -143,11 +190,21 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() return Internal::Adaptor::Adaptor::AdaptorSignal(); } -RenderSurface& Adaptor::GetSurface() +Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal() +{ + return Internal::Adaptor::Adaptor::WindowCreatedSignal(); +} + +Dali::RenderSurfaceInterface& Adaptor::GetSurface() { return Internal::Adaptor::Adaptor::GetSurface(); } +Dali::WindowContainer Adaptor::GetWindows() const +{ + return Internal::Adaptor::Adaptor::GetWindows(); +} + Any Adaptor::GetNativeWindowHandle() { Any window; @@ -184,10 +241,6 @@ void Adaptor::NotifyLanguageChanged() { } -void Adaptor::SetMinimumPinchDistance(float distance) -{ -} - void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp ) { } @@ -234,6 +287,12 @@ const LogFactoryInterface& Adaptor::GetLogFactory() Adaptor::Adaptor() : mImpl( NULL ) { + Dali::PositionSize win_size; + win_size.width = 640; + win_size.height = 800; + + Dali::Window window = Dali::Window::New( win_size, "" ); + Internal::Adaptor::Adaptor::mWindows.push_back( window ); } } // namespace Dali