From: Eric W. <war...@us...> - 2001-10-06 02:25:49
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv5143 Modified Files: core.c core.h gaim.h module.c ui.h Log Message: can load plugins. won't get any indication of it though. Index: core.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- core.c 2001/10/06 01:55:59 1.6 +++ core.c 2001/10/06 02:25:46 1.7 @@ -38,10 +38,6 @@ #include "gaim.h" static gint UI_fd = -1; -struct UI { - GIOChannel *channel; - guint inpa; -}; GSList *uis = NULL; gint UI_write(struct UI *ui, guchar *data, gint len) @@ -70,27 +66,27 @@ static void meta_handler(struct UI *ui, guchar subtype, guchar *data) { switch (subtype) { - case CUI_META_LIST: - break; - case CUI_META_QUIT: - while (uis) { - ui = uis->data; - uis = g_slist_remove(uis, ui); - g_io_channel_close(ui->channel); - g_source_remove(ui->inpa); - g_free(ui); - } - do_quit(); - break; - case CUI_META_DETACH: + case CUI_META_LIST: + break; + case CUI_META_QUIT: + while (uis) { + ui = uis->data; uis = g_slist_remove(uis, ui); g_io_channel_close(ui->channel); g_source_remove(ui->inpa); g_free(ui); - break; - default: - debug_printf("unhandled meta subtype %d\n", subtype); - break; + } + do_quit(); + break; + case CUI_META_DETACH: + uis = g_slist_remove(uis, ui); + g_io_channel_close(ui->channel); + g_source_remove(ui->inpa); + g_free(ui); + break; + default: + debug_printf("unhandled meta subtype %d\n", subtype); + break; } } @@ -162,10 +158,10 @@ case CUI_TYPE_META: meta_handler(ui, subtype, in); break; - /* case CUI_TYPE_PLUGIN: plugin_handler(ui, subtype, in); break; + /* case CUI_TYPE_USER: user_handler(ui, subtype, in); break; Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- core.h 2001/10/06 00:10:29 1.3 +++ core.h 2001/10/06 02:25:46 1.4 @@ -74,6 +74,11 @@ /* any others? it's easy to add... */ }; +struct UI { + GIOChannel *channel; + guint inpa; +}; + #ifdef GAIM_PLUGINS struct gaim_plugin { @@ -89,8 +94,6 @@ void *data; }; -extern GList *plugins; -extern GList *callbacks; #endif struct buddy { @@ -114,6 +117,13 @@ struct gaim_connection *gc; /* the connection it belongs to */ }; +/* Globals in core.c */ +extern GSList *uis; + +/* Globals in plugins.c */ +extern GList *plugins; +extern GList *callbacks; + /* Functions in buddy.c */ extern struct buddy *find_buddy(struct gaim_connection *, char *); extern struct group *find_group(struct gaim_connection *, char *); @@ -129,6 +139,8 @@ extern void parse_toc_buddy_list(struct gaim_connection *, char *, int); /* Functions in core.c */ +extern gint UI_write(struct UI *, guchar *, int); +extern void UI_broadcast(guchar *data, int); /* Don't ever use these; when gaim-core is done these will be * merged into the core's main() and won't be called directly */ extern int core_main(); @@ -156,9 +168,10 @@ extern void gaim_signal_connect(GModule *, enum gaim_event, void *, void *); extern void gaim_signal_disconnect(GModule *, enum gaim_event, void *); extern void gaim_plugin_unload(GModule *); +extern void remove_all_plugins(); #endif extern int plugin_event(enum gaim_event, void *, void *, void *, void *); -extern void remove_all_plugins(); +extern void plugin_handler(struct UI *, guchar, guchar *); /* Functions in server.c */ extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, gushort); Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.278 retrieving revision 1.279 diff -u -d -r1.278 -r1.279 --- gaim.h 2001/10/06 00:10:29 1.278 +++ gaim.h 2001/10/06 02:25:46 1.279 @@ -511,7 +511,6 @@ extern char *stylize(gchar *, int); extern void show_usage (int, char *); extern int do_auto_login (char *); -extern int file_is_dir (const char *, GtkWidget *); extern char *gaim_user_dir(); extern void strncpy_nohtml(gchar *, const gchar *, size_t); extern void strncpy_withhtml(gchar *, const gchar *, size_t); Index: module.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/module.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- module.c 2001/10/04 00:05:18 1.4 +++ module.c 2001/10/06 02:25:46 1.5 @@ -524,3 +524,26 @@ } } #endif + +void plugin_handler(struct UI *ui, guchar subtype, guchar *data) +{ + switch (subtype) { + /* + case CUI_PLUGIN_LIST: + break; + */ + case CUI_PLUGIN_LOAD: + load_plugin(data); + /* XXX need to broadcast to UIs that plugin has been loaded */ + break; + /* + case CUI_PLUGIN_UNLOAD: + break; + case CUI_PLUGIN_RELOAD: + break; + */ + default: + debug_printf("unhandled plugin subtype: %d\n", subtype); + break; + } +} Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ui.h 2001/10/06 00:10:29 1.4 +++ ui.h 2001/10/06 02:25:46 1.5 @@ -286,6 +286,7 @@ extern void aol_icon(GdkWindow *); extern GtkWidget *picture_button(GtkWidget *, char *, char **); extern GtkWidget *picture_button2(GtkWidget *, char *, char **, short); +extern int file_is_dir(const char *, GtkWidget *); /* Functions in multi.c */ extern void account_editor(GtkWidget *, GtkWidget *); |