00001 #ifndef PLUGIN_H
00002 #define PLUGIN_H
00003
00004 #include <kore/kore.h>
00005 #include <kore/module.h>
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #define PLUGIN_MAIN_HDR(handle,name,path,flags) \
00034 Plugin* plugin(HMODULE handle, const char* name, const char* path, int flags)
00035 #define PLUGIN_MAIN_BODY(Type,handle,name,path,flags) \
00036 PLUGIN_MAIN_HDR(handle,name,path,flags) \
00037 { \
00038 return new Type(handle,name,path,flags); \
00039 }
00040
00041 namespace kore
00042 {
00043
00053 class KORE_API Plugin: public Module
00054 {
00055 public:
00059 Plugin();
00070 Plugin(HMODULE handle, const char* libname, const char* libpath, int flags);
00074 virtual ~Plugin();
00075
00079 virtual void pluginLoaded();
00083 virtual void unloadingPlugin();
00089 virtual void initPlugin();
00095 virtual void finalizePlugin();
00096
00101 virtual HMODULE libHandle() const;
00102 protected:
00103 private:
00104
00105 void commonInit();
00106
00107 const Version* _pluginVersion;
00108
00109 const Version* _pluginAPIVersion;
00110
00111 const Info* _pluginInfo;
00112
00113 const char* _libName;
00114
00115 const char* _libPath;
00116
00117 int _libFlags;
00118
00119 HMODULE _libHandle;
00120 };
00121
00122 };
00123
00124 #endif