1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "core/common/dynamic_module_helper.h" 17 18 #include <memory> 19 #include <string> 20 21 #include "compatible/components/component_loader.h" 22 #include "ui/base/utils/utils.h" 23 24 #include "base/json/json_util.h" 25 #include "base/utils/utils.h" 26 27 namespace OHOS::Ace { GetInstance()28DynamicModuleHelper& DynamicModuleHelper::GetInstance() 29 { 30 static DynamicModuleHelper instance; 31 return instance; 32 } 33 GetLoaderByName(const char * name)34std::unique_ptr<ComponentLoader> DynamicModuleHelper::GetLoaderByName(const char* name) 35 { 36 CHECK_NULL_RETURN(componentLoaderFunc_, nullptr); 37 return nullptr; 38 } 39 CreateCanvasRenderingContextModel(bool isOffscreen)40void* DynamicModuleHelper::CreateCanvasRenderingContextModel(bool isOffscreen) 41 { 42 CHECK_NULL_RETURN(canvasRenderingContextLoaderFunc_, nullptr); 43 return nullptr; 44 } 45 CreateCanvasBridge(CanvasBridgeParams & params)46void* DynamicModuleHelper::CreateCanvasBridge(CanvasBridgeParams& params) 47 { 48 CHECK_NULL_RETURN(canvasBridgeLoaderFunc_, nullptr); 49 return nullptr; 50 } 51 DynamicModuleHelper()52DynamicModuleHelper::DynamicModuleHelper() 53 { 54 LoadLibrary(); 55 } 56 ~DynamicModuleHelper()57DynamicModuleHelper::~DynamicModuleHelper() 58 { 59 CloseLibrary(); 60 } 61 LoadLibrary()62bool DynamicModuleHelper::LoadLibrary() 63 { 64 if (!compatibleLibLoaded_) { 65 compatibleLibLoaded_ = true; 66 } 67 return compatibleLibHandle_ != nullptr; 68 } 69 CloseLibrary()70void DynamicModuleHelper::CloseLibrary() {} 71 LoadSymbol(const char * symName)72void* DynamicModuleHelper::LoadSymbol(const char* symName) 73 { 74 return nullptr; 75 } 76 77 } // namespace OHOS::Ace 78