|
Katana Plug-in APIs 0.1
|
00001 // Copyright (c) 2012 The Foundry Visionmongers Ltd. All Rights Reserved. 00002 00003 #ifndef KATANA_PLUGINAPI_FNPLUGINSYSTEM_FNPLUGIN_H_ 00004 #define KATANA_PLUGINAPI_FNPLUGINSYSTEM_FNPLUGIN_H_ 00005 00006 #include <FnPluginSystem/FnPluginSystem.h> 00007 00008 #ifndef FnPluginAPI_h__ 00009 #define FnPluginAPI_h__ 00010 #ifdef _WIN32 00011 #define FnPluginAPI __declspec(dllexport) 00012 #else 00013 #define FnPluginAPI __attribute__ ((visibility("default"))) 00014 #endif 00015 #endif 00016 00017 #define REGISTER_PLUGIN(PLUGIN_CLASS, PLUGIN_NAME, PLUGIN_MAJOR_VERSION, PLUGIN_MINOR_VERSION) \ 00018 PLUGIN_CLASS##_plugin.name = PLUGIN_NAME; \ 00019 PLUGIN_CLASS##_plugin.apiName = PLUGIN_CLASS::_apiName; \ 00020 PLUGIN_CLASS##_plugin.apiVersion = PLUGIN_CLASS::_apiVersion; \ 00021 PLUGIN_CLASS##_plugin.pluginVersionMajor = PLUGIN_MAJOR_VERSION; \ 00022 PLUGIN_CLASS##_plugin.pluginVersionMinor = PLUGIN_MINOR_VERSION; \ 00023 PLUGIN_CLASS##_plugin.setHost = PLUGIN_CLASS::setHost; \ 00024 PLUGIN_CLASS##_plugin.getSuite = PLUGIN_CLASS##_getSuite; \ 00025 PLUGIN_CLASS##_plugin.flush = PLUGIN_CLASS::flush; \ 00026 registerPlugin(PLUGIN_CLASS##_plugin); \ 00027 00028 // Adds a plugin to the list 00029 extern "C" FnPluginAPI void registerPlugin(const FnPlugin & plugin); 00030 00031 // Function that needs to be implemented by the user once per shared object. 00032 // This function will add all the apropriate plugins to g_pluginsList 00033 extern "C" void registerPlugins(); 00034 00035 #endif // KATANA_PLUGINAPI_FNPLUGINSYSTEM_FNPLUGIN_H_
1.7.3