Yattm - unified GTK instant-messaging client logo
   [Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003]

Home - Main Page - Data Structures - File List - Data Fields - Globals

plugin.h

Go to the documentation of this file.
00001 /*
00002  * Yattm 
00003  *
00004  * Copyright (C) 1999, Torrey Searle <tsearle@uci.edu>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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;         /* Information provided by the plugin */
00042     lt_dlhandle Module;     /* Reference to the shared object itself */
00043     char *path;         /* Full Path */
00044     char *name;         /* File Name */
00045     char *service;          /* Non NULL if this is a service plugin */
00046     PLUGIN_STATUS status;           /* Is the plugin loaded? */
00047     const char *status_desc;    /* Error dsecription */
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     /*FIXME: Should have some sort of conditional callback to see if menu item should be displayed */
00060     ebmCallbackData *data;
00061     void *user_data;
00062 } menu_item_data;
00063 
00064 typedef void (*menu_func)();
00065 typedef struct {
00066     GList *menu_items;  /* A GList of menu_item_data elements */
00067     menu_func redraw_menu;  /* The function to call when the menu is changed */
00068     ebmType type;       /* What kind of data structure do we send back? */
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 /* Make sure that all the plugin_api accessible menus, as defined in plugin_api.h, are initialized */
00085 int init_menus();
00086 
00087 #endif /* _PLUGIN_H */

Contact: Andy Maloney     [Documentation generated by doxygen]