Mercurial > pidgin.yaz
changeset 9609:93211b7538d6
[gaim-migrate @ 10452]
" To write this cleanly I had to add a handle, init, and
uninit functions to gtkaccount.c
Also, made doc/gtkaccount-signals.dox as well as update
plugins/ChangeLog.API
Added plugins/gtk-signals-test.c since we're starting
to get some more ui signals, and it's a great place to
test new signals." --Gary Kramlich
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 28 Jul 2004 00:49:22 +0000 |
parents | 204f5d66a863 |
children | a6362795bf2c |
files | doc/Makefile.am doc/gtkaccount-signals.dox doc/gtkblist-signals.dox plugins/ChangeLog.API plugins/gtk-signals-test.c src/gtkaccount.c src/gtkaccount.h src/main.c |
diffstat | 8 files changed, 182 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/Makefile.am Wed Jul 28 00:29:52 2004 +0000 +++ b/doc/Makefile.am Wed Jul 28 00:49:22 2004 +0000 @@ -10,6 +10,7 @@ blist-signals.dox \ connection-signals.dox \ conversation-signals.dox \ + gtkaccount-signals.dox \ gtkblist-signals.dox \ gtkconv-signals.dox \ gtkimhtml-signals.dox \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/gtkaccount-signals.dox Wed Jul 28 00:49:22 2004 +0000 @@ -0,0 +1,17 @@ +/** @page gtkaccount-signals GtkAccount Signals + + @signals + @signal account-modified + @endsignals + + <hr> + + @signaldef account-modified + @signalproto +void (*account-modified)(GaimAccount *account); + @endsignalproto + @signaldesc + Emitted when the settings for an account have been changed and saved. + @param account The account that has been modified. + @endsignaldef +*/
--- a/doc/gtkblist-signals.dox Wed Jul 28 00:29:52 2004 +0000 +++ b/doc/gtkblist-signals.dox Wed Jul 28 00:49:22 2004 +0000 @@ -2,7 +2,6 @@ @signals @signal gtkblist-created - @signal drawing-menu @signal drawing-tooltip @endsignals @@ -17,16 +16,6 @@ @param blist The buddy list. @endsignaldef - @signaldef drawing-menu - @signalproto -void (*drawing-menu)(GtkMenu *menu, GaimBuddy *buddy); - @endsignalproto - @signaldesc - Emitted when the user right clicks on a buddy or chat in the buddy list. - @param menu The menu that will be shown. - @param buddy The buddy or chat. - @endsignaldef - @signaldef drawing-tooltip @signalproto void (*drawing-tooltip)(GaimBlistNode *node, char **text);
--- a/plugins/ChangeLog.API Wed Jul 28 00:29:52 2004 +0000 +++ b/plugins/ChangeLog.API Wed Jul 28 00:49:22 2004 +0000 @@ -27,6 +27,7 @@ * Added: chat-buddy-flags for when user's flags change gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT (required for the new chat-buddy-flags signal) + * Added: account-modified for when account settings have been changed. version 0.80 (07/15/2004): Gaim API:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/gtk-signals-test.c Wed Jul 28 00:49:22 2004 +0000 @@ -0,0 +1,123 @@ +/* + * Signals test plugin. + * + * 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 + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * 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 + * 02111-1307, USA. + */ +#define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test" + +#include <gtk/gtk.h> + +#include "internal.h" +#include "debug.h" + +#include "gtkaccount.h" +#include "gtkblist.h" +#include "gtkconv.h" +#include "gtkplugin.h" + +/************************************************************************** + * Account subsystem signal callbacks + **************************************************************************/ +static void +account_modified_cb(GaimAccount *account, void *data) { + gaim_debug_info("gtk-signal-test", "account modified cb\n"); +} + +/************************************************************************** + * Buddy List subsystem signal callbacks + **************************************************************************/ +static void +blist_created_cb(GaimBuddyList *blist, void *data) { + gaim_debug_info("gtk-signal-test", "buddy list created\n"); +} + +static void +blist_drawing_tooltip_cb(GaimBlistNode *node, char **text, void *data) { + gaim_debug_info("gtk-signal-test", "drawing tooltip cb\n"); +} + +/************************************************************************** + * Conversation subsystem signal callbacks + **************************************************************************/ +static void +conversation_drag_end_cb(GaimConvWindow *source, GaimConvWindow *destination) { + gaim_debug_info("gtk-signal-test", "conversation drag ended cb\n"); +} + +/************************************************************************** + * Plugin stuff + **************************************************************************/ +static gboolean +plugin_load(GaimPlugin *plugin) +{ + void *accounts_handle = gaim_gtk_account_get_handle(); + void *blist_handle = gaim_gtk_blist_get_handle(); + void *conv_handle = gaim_gtk_conversations_get_handle(); + + /* Accounts subsystem signals */ + gaim_signal_connect(accounts_handle, "account-modified", + plugin, GAIM_CALLBACK(account_modified_cb), NULL); + + /* Buddy List subsystem signals */ + gaim_signal_connect(blist_handle, "gtkblist-created", + plugin, GAIM_CALLBACK(blist_created_cb), NULL); + gaim_signal_connect(blist_handle, "drawing-tooltip", + plugin, GAIM_CALLBACK(blist_drawing_tooltip_cb), NULL); + + /* Conversations subsystem signals */ + gaim_signal_connect(conv_handle, "conversation-drag-ended", + plugin, GAIM_CALLBACK(conversation_drag_end_cb), NULL); + + return TRUE; +} + +static GaimPluginInfo info = +{ + GAIM_PLUGIN_API_VERSION, /**< api_version */ + GAIM_PLUGIN_STANDARD, /**< type */ + GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ + 0, /**< flags */ + NULL, /**< dependencies */ + GAIM_PRIORITY_DEFAULT, /**< priority */ + + GTK_SIGNAL_TEST_PLUGIN_ID, /**< id */ + N_("GTK Signals Test"), /**< name */ + VERSION, /**< version */ + /** summary */ + N_("Test to see that all ui signals are working properly."), + /** description */ + N_("Test to see that all ui signals are working properly."), + "Gary Kramlich <amc_grim@users.sf.net>", /**< author */ + GAIM_WEBSITE, /**< homepage */ + + plugin_load, /**< load */ + NULL, /**< unload */ + NULL, /**< destroy */ + + NULL, /**< ui_info */ + NULL, /**< extra_info */ + NULL, + NULL +}; + +static void +init_plugin(GaimPlugin *plugin) +{ +} + +GAIM_INIT_PLUGIN(gtksignalstest, init_plugin, info)
--- a/src/gtkaccount.c Wed Jul 28 00:29:52 2004 +0000 +++ b/src/gtkaccount.c Wed Jul 28 00:49:22 2004 +0000 @@ -1508,6 +1508,8 @@ account_win_destroy_cb(NULL, NULL, dialog); + gaim_signal_emit(gaim_gtk_account_get_handle(), "account-modified", ret); + return ret; } @@ -2512,3 +2514,23 @@ { return &ui_ops; } + +void * +gaim_gtk_account_get_handle() { + static int handle; + + return &handle; +} + +void +gaim_gtk_account_init(void) { + gaim_signal_register(gaim_gtk_account_get_handle(), "account-modified", + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_ACCOUNT)); +} + +void +gaim_gtk_account_uninit(void) { + gaim_signals_unregister_by_instance(gaim_gtk_blist_get_handle()); +}
--- a/src/gtkaccount.h Wed Jul 28 00:29:52 2004 +0000 +++ b/src/gtkaccount.h Wed Jul 28 00:49:22 2004 +0000 @@ -61,5 +61,21 @@ */ GaimAccountUiOps *gaim_gtk_accounts_get_ui_ops(void); +/** + * Returns the gtkaccounts handle + * + * @return The handle to the GTK+ account system + */ +void *gaim_gtk_account_get_handle(void); + +/** + * Initializes the GTK+ account system + */ +void gaim_gtk_account_init(void); + +/** + * Uninitializes the GTK+ account system + */ +void gaim_gtk_account_uninit(void); + #endif /* _GAIM_GTK_ACCOUNT_H_ */ -