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
21 #define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test"
29 #include "gtkaccount.h"
32 #include "gtkplugin.h"
34 /**************************************************************************
35 * Account subsystem signal callbacks
36 **************************************************************************/
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 **************************************************************************/
46 blist_created_cb(PurpleBuddyList
*blist
, void *data
) {
47 purple_debug_info("gtk-signal-test", "buddy list created\n");
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 **************************************************************************/
59 conversation_dragging_cb(PidginWindow
*source
, PidginWindow
*destination
) {
60 purple_debug_info("gtk-signal-test", "conversation dragging cb\n");
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
);
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
);
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
);
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
);
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 /**************************************************************************
108 **************************************************************************/
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
);
144 plugin_unload(PurplePlugin
*plugin
) {
148 static PurplePluginInfo info
=
151 PURPLE_MAJOR_VERSION
,
152 PURPLE_MINOR_VERSION
,
153 PURPLE_PLUGIN_STANDARD
, /**< type */
154 PIDGIN_PLUGIN_TYPE
, /**< ui_requirement */
156 NULL
, /**< dependencies */
157 PURPLE_PRIORITY_DEFAULT
, /**< priority */
159 GTK_SIGNAL_TEST_PLUGIN_ID
, /**< id */
160 N_("GTK Signals Test"), /**< name */
161 VERSION
, /**< version */
163 N_("Test to see that all ui signals are working properly."),
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 */
186 init_plugin(PurplePlugin
*plugin
)
190 PURPLE_INIT_PLUGIN(gtksignalstest
, init_plugin
, info
)