5 #ifndef CNOID_BASE_PLUGIN_H
6 #define CNOID_BASE_PLUGIN_H
9 #include <cnoid/Config>
11 #include "exportdecl.h"
25 Plugin(
const std::string& name);
28 const std::string& name()
const;
29 const std::string& filePath()
const;
31 virtual bool initialize();
32 virtual bool finalize();
35 bool isUnloadable()
const;
37 const std::string& requisite(
int index)
const;
38 int numRequisites()
const;
40 const std::string& subsequence(
int index)
const;
41 int numSubsequences()
const;
43 const std::string& oldName(
int index)
const;
44 int numOldNames()
const;
46 virtual const char* description()
const;
48 int activationPriority()
const;
50 unsigned int internalVersion()
const;
53 void setInternalVersion(
unsigned int version);
56 void setPluginScope(
Item* item);
57 void setPluginScope(
View* view);
58 void setPluginScope(
ToolBar* toolBar);
60 void setUnloadable(
bool on);
62 void require(
const std::string& pluginName);
63 void precede(
const std::string& pluginName);
72 void setActivationPriority(
int priority);
78 void addOldName(
const std::string& name);
80 #ifdef CNOID_BACKWARD_COMPATIBILITY
81 void depend(
const std::string& pluginName);
89 void setFilePath(
const std::string& filePath);
101 #define CNOID_IMPLEMENT_PLUGIN_ENTRY(PluginTypeName) \
102 extern "C" CNOID_BASE_DLLEXPORT cnoid::Plugin* getChoreonoidPlugin() \
104 cnoid::Plugin* plugin = new PluginTypeName(); \
105 plugin->setInternalVersion(CNOID_INTERNAL_VERSION); \