comparison plugins/gtk-signals-test.c @ 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
children a9fb4493ae22
comparison
equal deleted inserted replaced
9608:204f5d66a863 9609:93211b7538d6
1 /*
2 * Signals test plugin.
3 *
4 * Copyright (C) 2003 Christian Hammond.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA.
20 */
21 #define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test"
22
23 #include <gtk/gtk.h>
24
25 #include "internal.h"
26 #include "debug.h"
27
28 #include "gtkaccount.h"
29 #include "gtkblist.h"
30 #include "gtkconv.h"
31 #include "gtkplugin.h"
32
33 /**************************************************************************
34 * Account subsystem signal callbacks
35 **************************************************************************/
36 static void
37 account_modified_cb(GaimAccount *account, void *data) {
38 gaim_debug_info("gtk-signal-test", "account modified cb\n");
39 }
40
41 /**************************************************************************
42 * Buddy List subsystem signal callbacks
43 **************************************************************************/
44 static void
45 blist_created_cb(GaimBuddyList *blist, void *data) {
46 gaim_debug_info("gtk-signal-test", "buddy list created\n");
47 }
48
49 static void
50 blist_drawing_tooltip_cb(GaimBlistNode *node, char **text, void *data) {
51 gaim_debug_info("gtk-signal-test", "drawing tooltip cb\n");
52 }
53
54 /**************************************************************************
55 * Conversation subsystem signal callbacks
56 **************************************************************************/
57 static void
58 conversation_drag_end_cb(GaimConvWindow *source, GaimConvWindow *destination) {
59 gaim_debug_info("gtk-signal-test", "conversation drag ended cb\n");
60 }
61
62 /**************************************************************************
63 * Plugin stuff
64 **************************************************************************/
65 static gboolean
66 plugin_load(GaimPlugin *plugin)
67 {
68 void *accounts_handle = gaim_gtk_account_get_handle();
69 void *blist_handle = gaim_gtk_blist_get_handle();
70 void *conv_handle = gaim_gtk_conversations_get_handle();
71
72 /* Accounts subsystem signals */
73 gaim_signal_connect(accounts_handle, "account-modified",
74 plugin, GAIM_CALLBACK(account_modified_cb), NULL);
75
76 /* Buddy List subsystem signals */
77 gaim_signal_connect(blist_handle, "gtkblist-created",
78 plugin, GAIM_CALLBACK(blist_created_cb), NULL);
79 gaim_signal_connect(blist_handle, "drawing-tooltip",
80 plugin, GAIM_CALLBACK(blist_drawing_tooltip_cb), NULL);
81
82 /* Conversations subsystem signals */
83 gaim_signal_connect(conv_handle, "conversation-drag-ended",
84 plugin, GAIM_CALLBACK(conversation_drag_end_cb), NULL);
85
86 return TRUE;
87 }
88
89 static GaimPluginInfo info =
90 {
91 GAIM_PLUGIN_API_VERSION, /**< api_version */
92 GAIM_PLUGIN_STANDARD, /**< type */
93 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */
94 0, /**< flags */
95 NULL, /**< dependencies */
96 GAIM_PRIORITY_DEFAULT, /**< priority */
97
98 GTK_SIGNAL_TEST_PLUGIN_ID, /**< id */
99 N_("GTK Signals Test"), /**< name */
100 VERSION, /**< version */
101 /** summary */
102 N_("Test to see that all ui signals are working properly."),
103 /** description */
104 N_("Test to see that all ui signals are working properly."),
105 "Gary Kramlich <amc_grim@users.sf.net>", /**< author */
106 GAIM_WEBSITE, /**< homepage */
107
108 plugin_load, /**< load */
109 NULL, /**< unload */
110 NULL, /**< destroy */
111
112 NULL, /**< ui_info */
113 NULL, /**< extra_info */
114 NULL,
115 NULL
116 };
117
118 static void
119 init_plugin(GaimPlugin *plugin)
120 {
121 }
122
123 GAIM_INIT_PLUGIN(gtksignalstest, init_plugin, info)