comparison src/plugin.c @ 6485:70d5122bc3ff

[gaim-migrate @ 6999] Removed the old event system and replaced it with a much better signal system. There will most likely be some bugs in this, but it seems to be working for now. Plugins can now generate their own signals, and other plugins can find those plugins and connect to them. This could give plugins a form of IPC. It's also useful for other things. It's rather flexible, except for the damn marshalling, but there's no way around that that I or the glib people can see. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 18 Aug 2003 01:03:43 +0000
parents f9428d38c03b
children fab81e4b885c
comparison
equal deleted inserted replaced
6484:5ced8e111473 6485:70d5122bc3ff
36 */ 36 */
37 #include "internal.h" 37 #include "internal.h"
38 38
39 #include "accountopt.h" 39 #include "accountopt.h"
40 #include "debug.h" 40 #include "debug.h"
41 #include "event.h"
42 #include "notify.h" 41 #include "notify.h"
43 #include "prefs.h" 42 #include "prefs.h"
44 #include "prpl.h" 43 #include "prpl.h"
45 #include "request.h" 44 #include "request.h"
45 #include "signals.h"
46 46
47 #ifdef _WIN32 47 #ifdef _WIN32
48 # define PLUGIN_EXT ".dll" 48 # define PLUGIN_EXT ".dll"
49 #else 49 #else
50 # define PLUGIN_EXT ".so" 50 # define PLUGIN_EXT ".so"
242 242
243 if (plugin->native_plugin) { 243 if (plugin->native_plugin) {
244 if (plugin->info != NULL) { 244 if (plugin->info != NULL) {
245 if (plugin->info->load != NULL) 245 if (plugin->info->load != NULL)
246 plugin->info->load(plugin); 246 plugin->info->load(plugin);
247
248 if (plugin->info->type == GAIM_PLUGIN_LOADER) {
249 GaimPluginLoaderInfo *loader_info;
250
251 loader_info = GAIM_PLUGIN_LOADER_INFO(plugin);
252
253 if (loader_info->broadcast != NULL)
254 gaim_signals_register_broadcast_func(loader_info->broadcast,
255 NULL);
256 }
257 } 247 }
258 } 248 }
259 else { 249 else {
260 GaimPlugin *loader; 250 GaimPlugin *loader;
261 GaimPluginLoaderInfo *loader_info; 251 GaimPluginLoaderInfo *loader_info;
324 if (prpl_info->user_splits != NULL) 314 if (prpl_info->user_splits != NULL)
325 g_list_free(prpl_info->user_splits); 315 g_list_free(prpl_info->user_splits);
326 316
327 if (prpl_info->protocol_options != NULL) 317 if (prpl_info->protocol_options != NULL)
328 g_list_free(prpl_info->protocol_options); 318 g_list_free(prpl_info->protocol_options);
329 }
330 else if (plugin->info->type == GAIM_PLUGIN_LOADER) {
331 GaimPluginLoaderInfo *loader_info;
332
333 loader_info = GAIM_PLUGIN_LOADER_INFO(plugin);
334
335 if (loader_info->broadcast != NULL)
336 gaim_signals_unregister_broadcast_func(loader_info->broadcast);
337 } 319 }
338 } 320 }
339 else { 321 else {
340 GaimPlugin *loader; 322 GaimPlugin *loader;
341 GaimPluginLoaderInfo *loader_info; 323 GaimPluginLoaderInfo *loader_info;