00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _PLUGIN_H
00023 #define _PLUGIN_H
00024
00025 #include <ltdl.h>
00026 #include "plugin_api.h"
00027
00028 #define EB_PLUGIN_LIST "PLUGIN::LIST"
00029
00030 extern char *PLUGIN_TYPE_TXT[];
00031 extern char *PLUGIN_STATUS_TXT[];
00032
00033 typedef enum {
00034 PLUGIN_NOT_LOADED,
00035 PLUGIN_LOADED,
00036 PLUGIN_CANNOT_LOAD,
00037 PLUGIN_NO_STATUS
00038 } PLUGIN_STATUS;
00039
00040 typedef struct {
00041 PLUGIN_INFO pi;
00042 lt_dlhandle Module;
00043 char *path;
00044 char *name;
00045 char *service;
00046 PLUGIN_STATUS status;
00047 const char *status_desc;
00048 } eb_PLUGIN_INFO;
00049
00050 typedef struct {
00051 void *data;
00052 eb_callback_action action;
00053
00054 } callback_data;
00055
00056 typedef struct {
00057 char *label;
00058 eb_menu_callback callback;
00059
00060 ebmCallbackData *data;
00061 void *user_data;
00062 } menu_item_data;
00063
00064 typedef void (*menu_func)();
00065 typedef struct {
00066 GList *menu_items;
00067 menu_func redraw_menu;
00068 ebmType type;
00069 } menu_data;
00070
00071 eb_PLUGIN_INFO *FindPluginByName(char *name);
00072 eb_PLUGIN_INFO *FindPluginByService(char *service);
00073
00074 int unload_module(eb_PLUGIN_INFO *epi);
00075 void unload_modules();
00076 int load_module(char *path, char *name);
00077 void load_modules();
00078 int load_service_plugin(lt_dlhandle Module, PLUGIN_INFO *info, char *name);
00079 int load_utility_plugin(lt_dlhandle Module, PLUGIN_INFO *info, char *name);
00080 int load_log_plugin(lt_dlhandle Module, PLUGIN_INFO *info, char *name);
00081 int load_sound_plugin(lt_dlhandle Module, PLUGIN_INFO *info, char *name);
00082 int load_gui_plugin(lt_dlhandle Module, PLUGIN_INFO *info, char *name);
00083
00084
00085 int init_menus();
00086
00087 #endif