/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "graphics_manager.h"
#include "i_engine.h"
#include "platform_data.h"
#include "3d_widget_adapter_log.h"

namespace OHOS::Render3D {
PlatformData GraphicsManager::GetPlatformData() const
{
#define TO_STRING(name) #name
#define PLATFORM_PATH_NAME(name) TO_STRING(name)
    PlatformData data{
        PLATFORM_PATH_NAME(PLATFORM_CORE_ROOT_PATH),
        PLATFORM_PATH_NAME(PLATFORM_CORE_PLUGIN_PATH),
        PLATFORM_PATH_NAME(PLATFORM_APP_ROOT_PATH),
        PLATFORM_PATH_NAME(PLATFORM_APP_PLUGIN_PATH),
    };
#undef TO_STRING
#undef PLATFORM_PATH_NAME
    return data;
}

PlatformData GraphicsManager::GetPlatformData(const HapInfo& hapInfo) const
{
#define TO_STRING(name) #name
#define PLATFORM_PATH_NAME(name) TO_STRING(name)
    PlatformData data{
        PLATFORM_PATH_NAME(PLATFORM_CORE_ROOT_PATH),
        PLATFORM_PATH_NAME(PLATFORM_CORE_PLUGIN_PATH),
        PLATFORM_PATH_NAME(PLATFORM_APP_ROOT_PATH),
        PLATFORM_PATH_NAME(PLATFORM_APP_PLUGIN_PATH),
        hapInfo,
    };
#undef TO_STRING
#undef PLATFORM_PATH_NAME
    return data;
}

GraphicsManager& GraphicsManager::GetInstance()
{
    static GraphicsManager graphicsManager;
    return graphicsManager;
}

GraphicsManager::~GraphicsManager()
{}
}  // namespace OHOS::Render3D