Sun, 28 Oct 2007 18:13:50 +0000
Track the actual visibility for the buddy list (unobscured, partially and
fully obscured). This maintains the behavior from the previous commit
(raising partially obscured buddy list instead of hiding), but also
maintains refreshing of the buddy list when partially obscured which the
previous commit broke.
| 9609 | 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16788
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16788
diff
changeset
|
19 | * 02111-1301, USA. |
| 9609 | 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" | |
| 9954 | 27 | #include "version.h" |
| 9609 | 28 | |
| 29 | #include "gtkaccount.h" | |
| 30 | #include "gtkblist.h" | |
| 31 | #include "gtkconv.h" | |
| 32 | #include "gtkplugin.h" | |
| 33 | ||
| 34 | /************************************************************************** | |
| 35 | * Account subsystem signal callbacks | |
| 36 | **************************************************************************/ | |
| 37 | static void | |
| 15884 | 38 | account_modified_cb(PurpleAccount *account, void *data) { |
| 39 | purple_debug_info("gtk-signal-test", "account modified cb\n"); | |
| 9609 | 40 | } |
| 41 | ||
| 42 | /************************************************************************** | |
| 43 | * Buddy List subsystem signal callbacks | |
| 44 | **************************************************************************/ | |
| 45 | static void | |
| 15884 | 46 | blist_created_cb(PurpleBuddyList *blist, void *data) { |
| 47 | purple_debug_info("gtk-signal-test", "buddy list created\n"); | |
| 9609 | 48 | } |
| 49 | ||
| 50 | static void | |
| 15884 | 51 | blist_drawing_tooltip_cb(PurpleBlistNode *node, GString *str, gboolean full, void *data) { |
| 52 | purple_debug_info("gtk-signal-test", "drawing tooltip cb\n"); | |
| 9609 | 53 | } |
| 54 | ||
| 55 | /************************************************************************** | |
| 56 | * Conversation subsystem signal callbacks | |
| 57 | **************************************************************************/ | |
| 58 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
59 | conversation_dragging_cb(PidginWindow *source, PidginWindow *destination) { |
| 15884 | 60 | purple_debug_info("gtk-signal-test", "conversation dragging cb\n"); |
| 9609 | 61 | } |
| 62 | ||
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
63 | static gboolean |
| 15884 | 64 | displaying_im_msg_cb(PurpleAccount *account, const char *who, char **buffer, |
| 65 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
66 | { |
| 15884 | 67 | purple_debug_misc("gtk-signals test", "displaying-im-msg (%s, %s)\n", |
| 68 | purple_conversation_get_name(conv), *buffer); | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
69 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
70 | return FALSE; |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
71 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
72 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
73 | static void |
| 15884 | 74 | displayed_im_msg_cb(PurpleAccount *account, const char *who, const char *buffer, |
| 75 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
76 | { |
| 15884 | 77 | purple_debug_misc("gtk-signals test", "displayed-im-msg (%s, %s)\n", |
| 78 | purple_conversation_get_name(conv), buffer); | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
79 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
80 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
81 | static gboolean |
| 15884 | 82 | displaying_chat_msg_cb(PurpleAccount *account, const char *who, char **buffer, |
| 83 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
84 | { |
| 15884 | 85 | purple_debug_misc("gtk-signals test", "displaying-chat-msg (%s, %s)\n", |
| 86 | purple_conversation_get_name(conv), *buffer); | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
87 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
88 | return FALSE; |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
89 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
90 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
91 | static void |
| 15884 | 92 | displayed_chat_msg_cb(PurpleAccount *account, const char *who, const char *buffer, |
| 93 | PurpleConversation *conv, PurpleMessageFlags flags, void *data) | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
94 | { |
| 15884 | 95 | purple_debug_misc("gtk-signals test", "displayed-chat-msg (%s, %s)\n", |
| 96 | purple_conversation_get_name(conv), buffer); | |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
97 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
98 | |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
99 | static void |
| 15884 | 100 | conversation_switched_cb(PurpleConversation *conv, void *data) |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
101 | { |
| 15884 | 102 | purple_debug_misc("gtk-signals test", "conversation-switched (%s)\n", |
| 103 | purple_conversation_get_name(conv)); | |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
104 | } |
|
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
105 | |
| 9609 | 106 | /************************************************************************** |
| 107 | * Plugin stuff | |
| 108 | **************************************************************************/ | |
| 109 | static gboolean | |
| 15884 | 110 | plugin_load(PurplePlugin *plugin) |
| 9609 | 111 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
112 | void *accounts_handle = pidgin_account_get_handle(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
113 | void *blist_handle = pidgin_blist_get_handle(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
114 | void *conv_handle = pidgin_conversations_get_handle(); |
| 9609 | 115 | |
| 116 | /* Accounts subsystem signals */ | |
| 15884 | 117 | purple_signal_connect(accounts_handle, "account-modified", |
| 118 | plugin, PURPLE_CALLBACK(account_modified_cb), NULL); | |
| 9609 | 119 | |
| 120 | /* Buddy List subsystem signals */ | |
| 15884 | 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); | |
| 9609 | 125 | |
| 126 | /* Conversations subsystem signals */ | |
| 15884 | 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); | |
| 9609 | 139 | |
| 140 | return TRUE; | |
| 141 | } | |
| 142 | ||
| 11033 | 143 | static gboolean |
| 15884 | 144 | plugin_unload(PurplePlugin *plugin) { |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11033
diff
changeset
|
145 | return TRUE; |
| 11033 | 146 | } |
| 147 | ||
| 15884 | 148 | static PurplePluginInfo info = |
| 9609 | 149 | { |
| 15884 | 150 | PURPLE_PLUGIN_MAGIC, |
| 151 | PURPLE_MAJOR_VERSION, | |
| 152 | PURPLE_MINOR_VERSION, | |
| 153 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
154 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
| 9609 | 155 | 0, /**< flags */ |
| 156 | NULL, /**< dependencies */ | |
| 15884 | 157 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 9609 | 158 | |
| 159 | GTK_SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
| 160 | N_("GTK Signals Test"), /**< name */ | |
|
21106
b85fbef13eed
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
19859
diff
changeset
|
161 | DISPLAY_VERSION, /**< version */ |
| 9609 | 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 */ | |
| 15884 | 167 | PURPLE_WEBSITE, /**< homepage */ |
| 9609 | 168 | |
| 169 | plugin_load, /**< load */ | |
| 11033 | 170 | plugin_unload, /**< unload */ |
| 9609 | 171 | NULL, /**< destroy */ |
| 172 | ||
| 173 | NULL, /**< ui_info */ | |
| 174 | NULL, /**< extra_info */ | |
| 175 | NULL, | |
|
16788
417d0e8d6f3f
Add padding to structs to fix compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
176 | NULL, |
|
417d0e8d6f3f
Add padding to structs to fix compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
177 | |
|
417d0e8d6f3f
Add padding to structs to fix compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
178 | /* padding */ |
|
417d0e8d6f3f
Add padding to structs to fix compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
179 | NULL, |
|
417d0e8d6f3f
Add padding to structs to fix compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
180 | NULL, |
|
417d0e8d6f3f
Add padding to structs to fix compiler warnings
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
181 | NULL, |
| 9609 | 182 | NULL |
| 183 | }; | |
| 184 | ||
| 185 | static void | |
| 15884 | 186 | init_plugin(PurplePlugin *plugin) |
| 9609 | 187 | { |
| 188 | } | |
| 189 | ||
| 15884 | 190 | PURPLE_INIT_PLUGIN(gtksignalstest, init_plugin, info) |