1 /*
2  * Copyright (c) 2024 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/plugin/intf_plugin.h>
17 #if defined(CORE_PLUGIN) && (CORE_PLUGIN == 1)
18 #include <core/plugin/intf_plugin_decl.h>
19 #else
20 // Include the declarations directly from engine.
21 // NOTE: macro defined by cmake as CORE_STATIC_PLUGIN_HEADER="${CORE_ROOT_DIRECTORY}/src/static_plugin_decl.h"
22 // this is so that the core include directories are not leaked here, but we want this one header in this case.
23 #include CORE_STATIC_PLUGIN_HEADER
24 #endif
25 #include <3d/implementation_uids.h>
26 #include <3d/namespace.h>
27 #include <render/implementation_uids.h>
28 
29 CORE_BEGIN_NAMESPACE()
30 class IPluginRegister;
31 CORE_END_NAMESPACE()
32 
33 CORE3D_BEGIN_NAMESPACE()
34 CORE_NS::PluginToken RegisterInterfaces3D(CORE_NS::IPluginRegister&);
35 void UnregisterInterfaces3D(CORE_NS::PluginToken);
36 const char* GetVersionInfo();
37 CORE3D_END_NAMESPACE()
38 
39 namespace {
40 constexpr BASE_NS::Uid PLUGIN_DEPENDENCIES[] = { RENDER_NS::UID_RENDER_PLUGIN };
41 extern "C" {
PLUGIN_DATA(AGP3D)42 PLUGIN_DATA(AGP3D) {
43     { CORE_NS::IPlugin::UID },
44     // name of plugin.
45     "AGP 3D (core)",
46     // Version information of the plugin.
47     { CORE3D_NS::UID_3D_PLUGIN, CORE3D_NS::GetVersionInfo },
48     CORE3D_NS::RegisterInterfaces3D,
49     CORE3D_NS::UnregisterInterfaces3D,
50     { PLUGIN_DEPENDENCIES },
51 };
52 DEFINE_STATIC_PLUGIN(AGP3D);
53 }
54 } // namespace
55