2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali/internal/system/linux/system-factory-ecore.h>
21 #include <dali/internal/adaptor/common/framework-factory.h>
22 #include <dali/internal/system/glib/callback-manager-glib.h>
23 #include <dali/internal/system/glib/file-descriptor-monitor-glib.h>
24 #include <dali/internal/system/glib/timer-impl-glib.h>
25 #include <dali/internal/system/linux/callback-manager-ecore.h>
26 #include <dali/internal/system/linux/file-descriptor-monitor-ecore.h>
27 #include <dali/internal/system/linux/timer-impl-ecore.h>
28 #include <dali/internal/window-system/common/display-utils.h>
36 std::unique_ptr<CallbackManager> SystemFactoryEcore::CreateCallbackManager()
38 auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
39 if(frameworkFactory != nullptr && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::GLIB)
41 return Utils::MakeUnique<GlibCallbackManager>();
43 return Utils::MakeUnique<EcoreCallbackManager>();
46 std::unique_ptr<FileDescriptorMonitor> SystemFactoryEcore::CreateFileDescriptorMonitor(int fileDescriptor, CallbackBase* callback, int eventBitmask)
48 auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
49 if(frameworkFactory != nullptr && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::GLIB)
51 return Utils::MakeUnique<FileDescriptorMonitorGlib>(fileDescriptor, callback, eventBitmask);
53 return Utils::MakeUnique<FileDescriptorMonitorEcore>(fileDescriptor, callback, eventBitmask);
56 TimerPtr SystemFactoryEcore::CreateTimer(uint32_t milliSec)
58 auto frameworkFactory = Dali::Internal::Adaptor::GetFrameworkFactory();
59 if(frameworkFactory != nullptr && frameworkFactory->GetFrameworkBackend() == FrameworkBackend::GLIB)
61 return TimerGlib::New(milliSec);
63 return TimerEcore::New(milliSec);
66 std::unique_ptr<SystemFactory> GetSystemFactory()
68 return Utils::MakeUnique<SystemFactoryEcore>();
71 } // namespace Adaptor
72 } // namespace Internal