X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor.cpp;h=e6c37353805ae0d5c58afe24ce07882eced37844;hb=556055cba279f756420711d8b53b0b55ea4f83a7;hp=66b28eeaf2fbf11ee7bb03a2e9afc30e6eb62319;hpb=263ec21432f3d7c9f9be5b463748fdce8f6942e4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp old mode 100755 new mode 100644 index 66b28ee..e6c3735 --- 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) 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. @@ -16,40 +16,48 @@ */ // CLASS HEADER -#include +#include // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES #include #include -#include +#include +#include #include +#include namespace Dali { Adaptor& Adaptor::New( Window window ) { - return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); + Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), NULL ); + return *adaptor; } -Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface ) { - Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL ); + Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window ); + Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, NULL ); return *adaptor; } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ) +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window ) { - return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, NULL ); + return *adaptor; } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface ) { Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); - Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, NULL ); return *adaptor; } @@ -80,17 +88,37 @@ void Adaptor::Stop() bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue ) { + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); return mImpl->AddIdle( callback, hasReturnValue, false ); } +bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow ) +{ + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); + return mImpl->AddWindow( childWindow ); +} + void Adaptor::RemoveIdle( CallbackBase* callback ) { + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); mImpl->RemoveIdle( callback ); } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ) +void Adaptor::ProcessIdle() +{ + DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" ); + mImpl->ProcessIdle(); +} + +void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& 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(nativeWindow, surface); + mImpl->ReplaceSurface( window, surface ); } Adaptor::AdaptorSignalType& Adaptor::ResizedSignal() @@ -103,6 +131,11 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() return mImpl->LanguageChangedSignal(); } +Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal() +{ + return mImpl->WindowCreatedSignal(); +} + Dali::RenderSurfaceInterface& Adaptor::GetSurface() { return mImpl->GetSurface(); @@ -113,6 +146,11 @@ Any Adaptor::GetNativeWindowHandle() return mImpl->GetNativeWindowHandle(); } +Any Adaptor::GetNativeWindowHandle( Actor actor ) +{ + return mImpl->GetNativeWindowHandle( actor ); +} + Any Adaptor::GetGraphicsDisplay() { return mImpl->GetGraphicsDisplay(); @@ -133,11 +171,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 +191,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 +211,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 +241,31 @@ void Adaptor::UnregisterProcessor( Integration::Processor& processor ) mImpl->UnregisterProcessor( processor ); } +Dali::WindowContainer Adaptor::GetWindows() const +{ + return mImpl->GetWindows(); +} + +SceneHolderList Adaptor::GetSceneHolders() const +{ + return mImpl->GetSceneHolders(); +} + +Dali::ObjectRegistry Adaptor::GetObjectRegistry() const +{ + return mImpl->GetObjectRegistry(); +} + +void Adaptor::OnWindowShown() +{ + mImpl->OnWindowShown(); +} + +void Adaptor::OnWindowHidden() +{ + mImpl->OnWindowHidden(); +} + Adaptor::Adaptor() : mImpl( NULL ) {