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 backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend();
39 if(backend == FrameworkBackend::GLIB)
41 return Utils::MakeUnique<GlibCallbackManager>();
45 return Utils::MakeUnique<EcoreCallbackManager>();
49 std::unique_ptr<FileDescriptorMonitor> SystemFactoryEcore::CreateFileDescriptorMonitor(int fileDescriptor, CallbackBase* callback, int eventBitmask)
51 auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend();
52 if(backend == FrameworkBackend::GLIB)
54 return Utils::MakeUnique<FileDescriptorMonitorGlib>(fileDescriptor, callback, eventBitmask);
58 return Utils::MakeUnique<FileDescriptorMonitorEcore>(fileDescriptor, callback, eventBitmask);
62 TimerPtr SystemFactoryEcore::CreateTimer(uint32_t milliSec)
64 auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend();
65 if(backend == FrameworkBackend::GLIB)
67 return TimerGlib::New(milliSec);
71 return TimerEcore::New(milliSec);
75 std::unique_ptr<SystemFactory> GetSystemFactory()
77 return Utils::MakeUnique<SystemFactoryEcore>();
80 } // namespace Adaptor
81 } // namespace Internal