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_api.h File Reference

#include "input_list.h"
#include "account.h"
#include "debug.h"

Include dependency graph for plugin_api.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  ebmCallbackData
struct  ebmContactData
struct  ebmImportData
struct  PLUGIN_INFO

Defines

#define API_MAJOR_VERSION   0
#define API_MINOR_VERSION   1
#define IS_ebmCallbackData(x)   (x->CDType>=ebmCALLBACKDATA)
#define EB_IMPORT_MENU   "IMPORT MENU"
#define IS_ebmImportData(x)   (x->CDType==ebmIMPORTDATA)
#define EB_PROFILE_MENU   "PROFILE MENU"
#define IS_ebmProfileData(x)   (x->CDType==ebmPROFILEDATA)
#define EB_CHAT_WINDOW_MENU   "CHAT MENU"
#define EB_CONTACT_MENU   "CONTACT MENU"
#define IS_ebmContactData(x)   (x->CDType==ebmCONTACTDATA)
#define DBG_MOD   do_plugin_debug

Typedefs

typedef int(* eb_plugin_func )()
typedef void(* eb_callback_action )(void *data, int value)
typedef void(* eb_menu_callback )(ebmCallbackData *data)
typedef void(* eb_input_function )(void *data, int source, eb_input_condition condition)

Enumerations

enum  PLUGIN_TYPE {
  PLUGIN_SERVICE = 1, PLUGIN_UTILITY, PLUGIN_SOUND, PLUGIN_LOG,
  PLUGIN_GUI, PLUGIN_UNKNOWN
}
enum  ebmType { ebmCALLBACKDATA = 10, ebmIMPORTDATA, ebmCONTACTDATA, ebmPROFILEDATA }
enum  eb_input_condition { EB_INPUT_READ = 1 << 0, EB_INPUT_WRITE = 1 << 1, EB_INPUT_EXCEPTION = 1 << 2 }

Functions

ebmCallbackDataebmProfileData_new (eb_local_account *ela)
ebmImportDataebmImportData_new ()
ebmContactDataebmContactData_new ()
void eb_set_active_menu_status (GSList *status_menu, int status)
void eb_do_dialog (char *message, char *title, eb_callback_action action, void *data)
void * eb_add_menu_item (char *label, char *menu_name, eb_menu_callback callback, ebmType type, void *data)
int eb_remove_menu_item (char *menu_name, void *tag)
int eb_input_add (int fd, eb_input_condition condition, eb_input_function function, void *callback_data)
void eb_input_remove (int tag)
const char * eb_config_dir ()

Variables

gint do_plugin_debug


Define Documentation

#define API_MAJOR_VERSION   0
 

Definition at line 33 of file plugin_api.h.

#define API_MINOR_VERSION   1
 

Definition at line 34 of file plugin_api.h.

#define DBG_MOD   do_plugin_debug
 

Definition at line 140 of file plugin_api.h.

Referenced by load_service_plugin(), load_utility_plugin(), plugin_selected(), refresh_service_contacts(), and update_plugin_prefs().

#define EB_CHAT_WINDOW_MENU   "CHAT MENU"
 

Definition at line 66 of file plugin_api.h.

Referenced by handle_click(), and init_menus().

#define EB_CONTACT_MENU   "CONTACT MENU"
 

Definition at line 67 of file plugin_api.h.

Referenced by contact_menu(), and init_menus().

#define EB_IMPORT_MENU   "IMPORT MENU"
 

Definition at line 62 of file plugin_api.h.

Referenced by eb_import_window(), and init_menus().

#define EB_PROFILE_MENU   "PROFILE MENU"
 

Definition at line 64 of file plugin_api.h.

Referenced by eb_profile_window(), and init_menus().

#define IS_ebmCallbackData      (x->CDType>=ebmCALLBACKDATA)
 

Definition at line 60 of file plugin_api.h.

Referenced by eb_generic_menu_function().

#define IS_ebmContactData      (x->CDType==ebmCONTACTDATA)
 

Definition at line 68 of file plugin_api.h.

#define IS_ebmImportData      (x->CDType==ebmIMPORTDATA)
 

Definition at line 63 of file plugin_api.h.

#define IS_ebmProfileData      (x->CDType==ebmPROFILEDATA)
 

Definition at line 65 of file plugin_api.h.


Typedef Documentation

typedef void(* eb_callback_action)(void *data, int value)
 

Definition at line 94 of file plugin_api.h.

Referenced by eb_do_dialog().

typedef void(* eb_input_function)(void *data, int source, eb_input_condition condition)
 

Definition at line 122 of file plugin_api.h.

Referenced by eb_input_add().

typedef void(* eb_menu_callback)(ebmCallbackData *data)
 

Definition at line 95 of file plugin_api.h.

Referenced by eb_add_menu_item().

typedef int(* eb_plugin_func)()
 

Definition at line 44 of file plugin_api.h.


Enumeration Type Documentation

enum eb_input_condition
 

Enumeration values:
EB_INPUT_READ 
EB_INPUT_WRITE 
EB_INPUT_EXCEPTION 

Definition at line 116 of file plugin_api.h.

Referenced by eb_input_add().

00116              {
00117     EB_INPUT_READ = 1 << 0,
00118     EB_INPUT_WRITE = 1 << 1,
00119     EB_INPUT_EXCEPTION = 1 << 2
00120 } eb_input_condition;

enum ebmType
 

Enumeration values:
ebmCALLBACKDATA 
ebmIMPORTDATA 
ebmCONTACTDATA 
ebmPROFILEDATA 

Definition at line 70 of file plugin_api.h.

Referenced by eb_add_menu_item(), and init_menu().

00070              {
00071     ebmCALLBACKDATA=10,
00072     ebmIMPORTDATA,
00073     ebmCONTACTDATA,
00074     ebmPROFILEDATA
00075 } ebmType;

enum PLUGIN_TYPE
 

Enumeration values:
PLUGIN_SERVICE 
PLUGIN_UTILITY 
PLUGIN_SOUND 
PLUGIN_LOG 
PLUGIN_GUI 
PLUGIN_UNKNOWN 

Definition at line 35 of file plugin_api.h.

00035              {
00036     PLUGIN_SERVICE=1,
00037     PLUGIN_UTILITY,
00038     PLUGIN_SOUND,
00039     PLUGIN_LOG,
00040     PLUGIN_GUI,
00041     PLUGIN_UNKNOWN
00042 } PLUGIN_TYPE;


Function Documentation

void* eb_add_menu_item char *    label,
char *    menu_name,
eb_menu_callback    callback,
ebmType    type,
void *    data
 

Definition at line 64 of file plugin_api.c.

References menu_item_data::callback, DBG_CORE, eb_debug, eb_menu_callback, ebmType, GetPref(), menu_item_data::label, menu_data::menu_items, menu_data::redraw_menu, menu_data::type, and menu_item_data::user_data.

00065 {
00066     menu_item_data *mid=NULL;
00067     menu_data *md=NULL;
00068 
00069     eb_debug(DBG_CORE, ">Adding %s to menu %s\n", label, menu_name);
00070     md = GetPref(menu_name);
00071     if(!md)  {
00072         eb_debug("Unknown menu requested: %s\n", menu_name);
00073         return(NULL);
00074     }
00075     /* Make sure they're expecting the right kind of structure to be passed back */
00076     if(type!=md->type) {
00077         eb_debug("Incorrect ebmType passed, not adding menu item: %s\n", label);
00078         return(NULL);
00079     }
00080     mid=g_new0(menu_item_data, 1);
00081     mid->user_data=data;
00082     mid->label=label;
00083     mid->callback=callback;
00084     md->menu_items = g_list_append(md->menu_items, mid);
00085     if(md->redraw_menu) {
00086         eb_debug(DBG_CORE, "Calling redraw_menu for %s\n", menu_name);
00087         md->redraw_menu();
00088     }
00089     eb_debug(DBG_CORE, "<Successfully added menu item\n");
00090     /* Return the menu_item_data pointer, so that g_list_remove can be used */
00091     return((void *)mid);
00092 }

const char* eb_config_dir  
 

void eb_do_dialog char *    message,
char *    title,
eb_callback_action    action,
void *    data
 

Definition at line 120 of file plugin_api.c.

References callback_data::action, callback_data::data, do_dialog(), eb_callback_action, eb_gtk_dialog_callback(), and title.

00121 {
00122     callback_data *cd=g_new0(callback_data,1);
00123     cd->action=action;
00124     cd->data=data;
00125     do_dialog(message, title, eb_gtk_dialog_callback, cd);
00126 }

int eb_input_add int    fd,
eb_input_condition    condition,
eb_input_function    function,
void *    callback_data
 

Definition at line 139 of file plugin_api.c.

References eb_input_condition, and eb_input_function.

00141 {
00142     return(gdk_input_add(fd, condition, function, callback_data));
00143 }

void eb_input_remove int    tag
 

Definition at line 145 of file plugin_api.c.

00146 {
00147     gdk_input_remove(tag);
00148 }

int eb_remove_menu_item char *    menu_name,
void *    tag
 

Definition at line 94 of file plugin_api.c.

References DBG_CORE, eb_debug, GetPref(), menu_item_data::label, menu_data::menu_items, and menu_data::redraw_menu.

00095 {
00096     menu_data *md=NULL;
00097     menu_item_data *mid=(menu_item_data *)tag;
00098 
00099     if(mid) {
00100         eb_debug(DBG_CORE, ">Request to remove %s from menu %s\n", mid->label, menu_name);
00101     }
00102     if(!tag) {
00103         eb_debug(DBG_CORE, "<Received request to delete from menu %s, with empty tag\n", menu_name);
00104         return(-1);
00105     }
00106     md=GetPref(menu_name);
00107     if(!md) {
00108         eb_debug(DBG_CORE, "<Requested menu %s does not exist, returning failure\n", menu_name);
00109         return(-1);
00110     }
00111     md->menu_items=g_list_remove(md->menu_items, tag);
00112     if(md->redraw_menu) {
00113         eb_debug(DBG_CORE, "Calling redraw_menu\n");
00114         md->redraw_menu();
00115     }
00116     eb_debug(DBG_CORE, "<Returning success\n");
00117     return(0);
00118 }

void eb_set_active_menu_status GSList *    status_menu,
int    status
 

Definition at line 128 of file plugin_api.c.

Referenced by eb_status().

00129 {
00130     gtk_check_menu_item_set_active
00131         (GTK_CHECK_MENU_ITEM
00132             (
00133              g_slist_nth(status_menu, status)->data
00134              ), TRUE
00135         );
00136 }

ebmContactData* ebmContactData_new  
 

Definition at line 57 of file plugin_api.c.

References ebmCONTACTDATA.

Referenced by contact_menu(), and handle_click().

00058 {
00059     ebmContactData *ecd=g_new0(ebmContactData, 1);
00060     ((ebmCallbackData *)ecd)->CDType=ebmCONTACTDATA;
00061     return(ecd);
00062 }

ebmImportData* ebmImportData_new  
 

Definition at line 41 of file plugin_api.c.

References ebmIMPORTDATA.

00042 {
00043     ebmImportData *eid=g_new0(ebmImportData, 1);
00044     ((ebmCallbackData *)eid)->CDType=ebmIMPORTDATA;
00045     return(eid);
00046 }

ebmCallbackData* ebmProfileData_new eb_local_account   ela
 

Definition at line 48 of file plugin_api.c.

References ebmPROFILEDATA, and ebmCallbackData::user_data.

00049 {
00050     ebmCallbackData *eid=g_new0(ebmCallbackData, 1);
00051     ((ebmCallbackData *)eid)->CDType=ebmPROFILEDATA;
00052     eid->user_data = ela;
00053     return(eid);
00054 }


Variable Documentation

gint do_plugin_debug
 

Definition at line 138 of file plugin_api.h.

Referenced by build_general_prefs(), cancel_general_prefs(), eb_read_prefs(), and write_general_prefs().


Contact: Andy Maloney     [Documentation generated by doxygen]