comparison plugins/iconaway.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 8f94cce8faa5
children bf630f7dfdcd
comparison
equal deleted inserted replaced
6484:5ced8e111473 6485:70d5122bc3ff
1 #include "gtkinternal.h" 1 #include "gtkinternal.h"
2 2
3 #include "conversation.h" 3 #include "conversation.h"
4 #include "signals.h"
4 5
5 #include "gtkconv.h" 6 #include "gtkconv.h"
6 #include "gtkplugin.h" 7 #include "gtkplugin.h"
7 8
8 #define ICONAWAY_PLUGIN_ID "gtk-iconaway" 9 #define ICONAWAY_PLUGIN_ID "gtk-iconaway"
15 16
16 #ifdef USE_APPLET 17 #ifdef USE_APPLET
17 extern void applet_destroy_buddy(); 18 extern void applet_destroy_buddy();
18 #endif 19 #endif
19 20
20 void iconify_windows(GaimConnection *gc, char *state, 21 static void
21 char *message, void *data) { 22 iconify_windows(GaimAccount *account, char *state, char *message, void *data)
23 {
22 GaimWindow *win; 24 GaimWindow *win;
23 GList *windows; 25 GList *windows;
26 GaimConnection *gc;
27
28 gc = gaim_account_get_connection(account);
24 29
25 if (!imaway || !gc->away) 30 if (!imaway || !gc->away)
26 return; 31 return;
27 32
28 gtk_window_iconify(GTK_WINDOW(imaway)); 33 gtk_window_iconify(GTK_WINDOW(imaway));
49 */ 54 */
50 55
51 static gboolean 56 static gboolean
52 plugin_load(GaimPlugin *plugin) 57 plugin_load(GaimPlugin *plugin)
53 { 58 {
54 gaim_signal_connect(plugin, event_away, iconify_windows, NULL); 59 gaim_signal_connect(gaim_accounts_get_handle(), "account-away",
60 plugin, GAIM_CALLBACK(iconify_windows), NULL);
55 61
56 return TRUE; 62 return TRUE;
57 } 63 }
58 64
59 static GaimGtkPluginUiInfo ui_info = 65 static GaimGtkPluginUiInfo ui_info =
76 /** summary */ 82 /** summary */
77 N_("Iconifies the buddy list and your conversations when you go away."), 83 N_("Iconifies the buddy list and your conversations when you go away."),
78 /** description */ 84 /** description */
79 N_("Iconifies the buddy list and your conversations when you go away."), 85 N_("Iconifies the buddy list and your conversations when you go away."),
80 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */ 86 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */
81 GAIM_WEBSITE, /**< homepage */ 87 GAIM_WEBSITE, /**< homepage */
82 88
83 plugin_load, /**< load */ 89 plugin_load, /**< load */
84 NULL, /**< unload */ 90 NULL, /**< unload */
85 NULL, /**< destroy */ 91 NULL, /**< destroy */
86 92