X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor.cpp;h=73fe2b331b452e13316fa78b411bff076d12cfa1;hb=15cb030e9396d29dab2de0bd298c1daf810bcf5f;hp=377a0313614e7e54f1c18aec6dc7e03dbdf9fbfd;hpb=f3b4a4a3893e310cb0d787c416d3ad7a2a01fc78;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp index 377a031..73fe2b3 100755 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 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. @@ -26,6 +26,13 @@ #include #include #include +#include + +#ifdef DALI_ADAPTOR_COMPILATION +#include +#else +#include +#endif namespace Dali { @@ -37,19 +44,44 @@ Adaptor& Adaptor::New( Window window ) Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) { + Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL ); + return *adaptor; +} + +Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface ) +{ + return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); +} + +Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) +{ + Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); + Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL ); + return *adaptor; +} + +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window ) +{ + return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); +} + +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration ) +{ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL ); return *adaptor; } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface ) { - return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); + return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } -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 ) { - Dali::RenderSurface* pSurface = const_cast(&surface); - Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL ); + Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL ); return *adaptor; } @@ -83,14 +115,25 @@ bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue ) return mImpl->AddIdle( callback, hasReturnValue, false ); } +bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode ) +{ + return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode ); +} + void Adaptor::RemoveIdle( CallbackBase* callback ) { mImpl->RemoveIdle( callback ); } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) +void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface ) { - mImpl->ReplaceSurface(nativeWindow, surface); + Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); + mImpl->ReplaceSurface( Dali::Integration::SceneHolder( sceneHolder ), surface ); +} + +void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface ) +{ + mImpl->ReplaceSurface( window, surface ); } Adaptor::AdaptorSignalType& Adaptor::ResizedSignal() @@ -103,7 +146,12 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() return mImpl->LanguageChangedSignal(); } -RenderSurface& Adaptor::GetSurface() +Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal() +{ + return mImpl->WindowCreatedSignal(); +} + +Dali::RenderSurfaceInterface& Adaptor::GetSurface() { return mImpl->GetSurface(); } @@ -113,6 +161,11 @@ Any Adaptor::GetNativeWindowHandle() return mImpl->GetNativeWindowHandle(); } +Any Adaptor::GetNativeWindowHandle( Actor actor ) +{ + return mImpl->GetNativeWindowHandle( actor ); +} + Any Adaptor::GetGraphicsDisplay() { return mImpl->GetGraphicsDisplay(); @@ -133,11 +186,6 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback ) mImpl->SetPreRenderCallback( callback ); } -void Adaptor::SetUseHardwareVSync(bool useHardware) -{ - mImpl->SetUseHardwareVSync( useHardware ); -} - Adaptor& Adaptor::Get() { return Internal::Adaptor::Adaptor::Get(); @@ -158,11 +206,6 @@ void Adaptor::NotifyLanguageChanged() mImpl->NotifyLanguageChanged(); } -void Adaptor::SetMinimumPinchDistance(float distance) -{ - mImpl->SetMinimumPinchDistance(distance); -} - void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp ) { mImpl->FeedTouchPoint(point, timeStamp); @@ -183,6 +226,16 @@ void Adaptor::SceneCreated() mImpl->SceneCreated(); } +void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize ) +{ + mImpl->SurfaceResizePrepare( surface, surfaceSize ); +} + +void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize ) +{ + mImpl->SurfaceResizeComplete( surface, surfaceSize ); +} + void Adaptor::RenderOnce() { mImpl->RenderOnce(); @@ -203,6 +256,21 @@ void Adaptor::UnregisterProcessor( Integration::Processor& processor ) mImpl->UnregisterProcessor( processor ); } +Dali::WindowContainer Adaptor::GetWindows() const +{ + return mImpl->GetWindows(); +} + +void Adaptor::OnWindowShown() +{ + mImpl->OnWindowShown(); +} + +void Adaptor::OnWindowHidden() +{ + mImpl->OnWindowHidden(); +} + Adaptor::Adaptor() : mImpl( NULL ) {