Mercurial > pidgin
diff plugins/gestures/gestures.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 |
line wrap: on
line diff
--- a/plugins/gestures/gestures.c Sun Aug 17 17:55:46 2003 +0000 +++ b/plugins/gestures/gestures.c Mon Aug 18 01:03:43 2003 +0000 @@ -2,7 +2,7 @@ * Mouse gestures plugin for Gaim * * Copyright (C) 2003 Christian Hammond. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -12,7 +12,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -23,6 +23,7 @@ #include "debug.h" #include "prefs.h" +#include "signals.h" #include "gtkconv.h" #include "gtkplugin.h" @@ -127,16 +128,10 @@ } static void -new_conv_cb(char *who) +new_conv_cb(GaimConversation *conv) { - GaimConversation *conv; - - conv = gaim_find_conversation(who); - - if (conv == NULL || !GAIM_IS_GTK_CONVERSATION(conv)) - return; - - attach_signals(conv); + if (GAIM_IS_GTK_CONVERSATION(conv)) + attach_signals(conv); } #if 0 @@ -178,7 +173,9 @@ attach_signals(conv); } - gaim_signal_connect(plugin, event_new_conversation, new_conv_cb, NULL); + gaim_signal_connect(gaim_conversations_get_handle(), + "conversation-created", + plugin, GAIM_CALLBACK(new_conv_cb), NULL); return TRUE; }