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