X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor.cpp;h=e6c37353805ae0d5c58afe24ce07882eced37844;hb=556055cba279f756420711d8b53b0b55ea4f83a7;hp=9b300bf57bc8a8e3c3246a621aa41351a165f68b;hpb=07701911d30f25234a474c97ab263ec994f8a5c0;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 9b300bf..e6c3735 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.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. @@ -16,72 +16,48 @@ */ // CLASS HEADER -#include +#include // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES #include #include -#include +#include +#include #include #include -#ifdef DALI_ADAPTOR_COMPILATION -#include -#else -#include -#endif - namespace Dali { Adaptor& Adaptor::New( Window window ) { - return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); -} - -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 ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), 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 ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, 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 ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, NULL ); return *adaptor; } Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface ) { - return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); -} - -Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) -{ Dali::RenderSurfaceInterface* pSurface = const_cast(&surface); - Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL ); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, NULL ); return *adaptor; } @@ -112,19 +88,28 @@ 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, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode ) +bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow ) { - return mImpl->AddWindow( childWindow, childWindowName, childWindowClassName, childWindowMode ); + 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::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 ); @@ -161,6 +146,11 @@ Any Adaptor::GetNativeWindowHandle() return mImpl->GetNativeWindowHandle(); } +Any Adaptor::GetNativeWindowHandle( Actor actor ) +{ + return mImpl->GetNativeWindowHandle( actor ); +} + Any Adaptor::GetGraphicsDisplay() { return mImpl->GetGraphicsDisplay(); @@ -256,6 +246,16 @@ 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();