Minor changelog updates
[pidgin-git.git] / pidgin / plugins / gtk-signals-test.c
blobfa299cc0b3a78282648a33a2671de7aa9d4c2537
1 /*
2 * Signals test plugin.
4 * Copyright (C) 2003 Christian Hammond.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02111-1301, USA.
21 #define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test"
23 #include <gtk/gtk.h>
25 #include "internal.h"
26 #include "debug.h"
27 #include "version.h"
29 #include "gtkaccount.h"
30 #include "gtkblist.h"
31 #include "gtkconv.h"
32 #include "gtkplugin.h"
34 /**************************************************************************
35 * Account subsystem signal callbacks
36 **************************************************************************/
37 static void
38 account_modified_cb(PurpleAccount *account, void *data) {
39 purple_debug_info("gtk-signal-test", "account modified cb\n");
42 /**************************************************************************
43 * Buddy List subsystem signal callbacks
44 **************************************************************************/
45 static void
46 blist_created_cb(PurpleBuddyList *blist, void *data) {
47 purple_debug_info("gtk-signal-test", "buddy list created\n");
50 static void
51 blist_drawing_tooltip_cb(PurpleBlistNode *node, GString *str, gboolean full, void *data) {
52 purple_debug_info("gtk-signal-test", "drawing tooltip cb\n");
55 /**************************************************************************
56 * Conversation subsystem signal callbacks
57 **************************************************************************/
58 static void
59 conversation_dragging_cb(PidginWindow *source, PidginWindow *destination) {
60 purple_debug_info("gtk-signal-test", "conversation dragging cb\n");
63 static gboolean
64 displaying_im_msg_cb(PurpleAccount *account, const char *who, char **buffer,
65 PurpleConversation *conv, PurpleMessageFlags flags, void *data)
67 purple_debug_misc("gtk-signals test", "displaying-im-msg (%s, %s)\n",
68 purple_conversation_get_name(conv), *buffer);
70 return FALSE;
73 static void
74 displayed_im_msg_cb(PurpleAccount *account, const char *who, const char *buffer,
75 PurpleConversation *conv, PurpleMessageFlags flags, void *data)
77 purple_debug_misc("gtk-signals test", "displayed-im-msg (%s, %s)\n",
78 purple_conversation_get_name(conv), buffer);
81 static gboolean
82 displaying_chat_msg_cb(PurpleAccount *account, const char *who, char **buffer,
83 PurpleConversation *conv, PurpleMessageFlags flags, void *data)
85 purple_debug_misc("gtk-signals test", "displaying-chat-msg (%s, %s)\n",
86 purple_conversation_get_name(conv), *buffer);
88 return FALSE;
91 static void
92 displayed_chat_msg_cb(PurpleAccount *account, const char *who, const char *buffer,
93 PurpleConversation *conv, PurpleMessageFlags flags, void *data)
95 purple_debug_misc("gtk-signals test", "displayed-chat-msg (%s, %s)\n",
96 purple_conversation_get_name(conv), buffer);
99 static void
100 conversation_switched_cb(PurpleConversation *conv, void *data)
102 purple_debug_misc("gtk-signals test", "conversation-switched (%s)\n",
103 purple_conversation_get_name(conv));
106 /**************************************************************************
107 * Plugin stuff
108 **************************************************************************/
109 static gboolean
110 plugin_load(PurplePlugin *plugin)
112 void *accounts_handle = pidgin_account_get_handle();
113 void *blist_handle = pidgin_blist_get_handle();
114 void *conv_handle = pidgin_conversations_get_handle();
116 /* Accounts subsystem signals */
117 purple_signal_connect(accounts_handle, "account-modified",
118 plugin, PURPLE_CALLBACK(account_modified_cb), NULL);
120 /* Buddy List subsystem signals */
121 purple_signal_connect(blist_handle, "gtkblist-created",
122 plugin, PURPLE_CALLBACK(blist_created_cb), NULL);
123 purple_signal_connect(blist_handle, "drawing-tooltip",
124 plugin, PURPLE_CALLBACK(blist_drawing_tooltip_cb), NULL);
126 /* Conversations subsystem signals */
127 purple_signal_connect(conv_handle, "conversation-dragging",
128 plugin, PURPLE_CALLBACK(conversation_dragging_cb), NULL);
129 purple_signal_connect(conv_handle, "displaying-im-msg",
130 plugin, PURPLE_CALLBACK(displaying_im_msg_cb), NULL);
131 purple_signal_connect(conv_handle, "displayed-im-msg",
132 plugin, PURPLE_CALLBACK(displayed_im_msg_cb), NULL);
133 purple_signal_connect(conv_handle, "displaying-chat-msg",
134 plugin, PURPLE_CALLBACK(displaying_chat_msg_cb), NULL);
135 purple_signal_connect(conv_handle, "displayed-chat-msg",
136 plugin, PURPLE_CALLBACK(displayed_chat_msg_cb), NULL);
137 purple_signal_connect(conv_handle, "conversation-switched",
138 plugin, PURPLE_CALLBACK(conversation_switched_cb), NULL);
140 return TRUE;
143 static gboolean
144 plugin_unload(PurplePlugin *plugin) {
145 return TRUE;
148 static PurplePluginInfo info =
150 PURPLE_PLUGIN_MAGIC,
151 PURPLE_MAJOR_VERSION,
152 PURPLE_MINOR_VERSION,
153 PURPLE_PLUGIN_STANDARD, /**< type */
154 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
155 0, /**< flags */
156 NULL, /**< dependencies */
157 PURPLE_PRIORITY_DEFAULT, /**< priority */
159 GTK_SIGNAL_TEST_PLUGIN_ID, /**< id */
160 N_("GTK Signals Test"), /**< name */
161 VERSION, /**< version */
162 /** summary */
163 N_("Test to see that all ui signals are working properly."),
164 /** description */
165 N_("Test to see that all ui signals are working properly."),
166 "Gary Kramlich <amc_grim@users.sf.net>", /**< author */
167 PURPLE_WEBSITE, /**< homepage */
169 plugin_load, /**< load */
170 plugin_unload, /**< unload */
171 NULL, /**< destroy */
173 NULL, /**< ui_info */
174 NULL, /**< extra_info */
175 NULL,
176 NULL,
178 /* padding */
179 NULL,
180 NULL,
181 NULL,
182 NULL
185 static void
186 init_plugin(PurplePlugin *plugin)
190 PURPLE_INIT_PLUGIN(gtksignalstest, init_plugin, info)