From: huiyu Date: Tue, 18 Jul 2023 04:32:14 +0000 (+0900) Subject: Returns Ecore APIs to default value X-Git-Tag: dali_2.2.36~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F85%2F295985%2F8;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Returns Ecore APIs to default value If the FrameworkFactory is not initialized, the Ecore is returned as the default value. Change-Id: If7421081ae4df092b7dd2db3d80c6191b641f4f1 Signed-off-by: huiyu --- diff --git a/dali/internal/system/linux/system-factory-ecore.cpp b/dali/internal/system/linux/system-factory-ecore.cpp index 8a4b40b..7221abe 100644 --- a/dali/internal/system/linux/system-factory-ecore.cpp +++ b/dali/internal/system/linux/system-factory-ecore.cpp @@ -35,41 +35,32 @@ namespace Adaptor { std::unique_ptr SystemFactoryEcore::CreateCallbackManager() { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::GLIB) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory != nullptr && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::GLIB) { return Utils::MakeUnique(); } - else - { - return Utils::MakeUnique(); - } + return Utils::MakeUnique(); } std::unique_ptr SystemFactoryEcore::CreateFileDescriptorMonitor(int fileDescriptor, CallbackBase* callback, int eventBitmask) { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::GLIB) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory != nullptr && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::GLIB) { return Utils::MakeUnique(fileDescriptor, callback, eventBitmask); } - else - { - return Utils::MakeUnique(fileDescriptor, callback, eventBitmask); - } + return Utils::MakeUnique(fileDescriptor, callback, eventBitmask); } TimerPtr SystemFactoryEcore::CreateTimer(uint32_t milliSec) { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::GLIB) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory != nullptr && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::GLIB) { return TimerGlib::New(milliSec); } - else - { - return TimerEcore::New(milliSec); - } + return TimerEcore::New(milliSec); } std::unique_ptr GetSystemFactory() diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp index 96f2d20..8e9a5e7 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp @@ -54,8 +54,8 @@ static int32_t gScreenHeight = 0; void Initialize() { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::DEFAULT) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT)) { ecore_wl2_init(); } @@ -63,8 +63,8 @@ void Initialize() void Shutdown() { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::DEFAULT) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT)) { ecore_wl2_shutdown(); } @@ -72,8 +72,8 @@ void Shutdown() void GetScreenSize(int32_t& width, int32_t& height) { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::DEFAULT) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT)) { if(gScreenWidth == 0 || gScreenHeight == 0) { @@ -95,8 +95,8 @@ void GetScreenSize(int32_t& width, int32_t& height) void UpdateScreenSize() { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::DEFAULT) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT)) { Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL); if(display) @@ -110,8 +110,8 @@ void UpdateScreenSize() bool SetKeyboardRepeatInfo(float rate, float delay) { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::DEFAULT) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT)) { Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(ecore_wl2_connected_display_get(NULL)); return ecore_wl2_input_keyboard_repeat_set(input, static_cast(rate), static_cast(delay)); @@ -121,8 +121,8 @@ bool SetKeyboardRepeatInfo(float rate, float delay) bool GetKeyboardRepeatInfo(float& rate, float& delay) { - auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); - if(backend == FrameworkBackend::DEFAULT) + auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory(); + if(frameworkFactory == nullptr || (frameworkFactory && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::DEFAULT)) { Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(ecore_wl2_connected_display_get(NULL)); double rateVal, delayVal;