annotate plugins/gtk-signals-test.c @ 9677:70ff55c0939b

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