Tue, 13 Oct 2020 00:42:59 -0500
Replace pidgin_set_urgent with gtk_window_set_urgency_hint
Testing Done:
Compiled and grepped for usage of the winpidgin functions that were removed.
Reviewed at https://reviews.imfreedom.org/r/161/
| 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 | ||
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
23 | #include <glib/gi18n.h> |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
24 | |
| 9609 | 25 | #include <gtk/gtk.h> |
| 26 | ||
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40222
diff
changeset
|
27 | #include <purple.h> |
| 9609 | 28 | |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
29 | #include <pidgin.h> |
| 9609 | 30 | |
| 31 | /************************************************************************** | |
| 32 | * Account subsystem signal callbacks | |
| 33 | **************************************************************************/ | |
| 34 | static void | |
| 15884 | 35 | account_modified_cb(PurpleAccount *account, void *data) { |
| 36 | purple_debug_info("gtk-signal-test", "account modified cb\n"); | |
| 9609 | 37 | } |
| 38 | ||
| 39 | /************************************************************************** | |
| 40 | * Buddy List subsystem signal callbacks | |
| 41 | **************************************************************************/ | |
| 42 | static void | |
| 15884 | 43 | blist_created_cb(PurpleBuddyList *blist, void *data) { |
| 44 | purple_debug_info("gtk-signal-test", "buddy list created\n"); | |
| 9609 | 45 | } |
| 46 | ||
| 47 | static void | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
48 | blist_drawing_tooltip_cb(PurpleBlistNode *node, GString *str, gboolean full, void *data) { |
| 15884 | 49 | purple_debug_info("gtk-signal-test", "drawing tooltip cb\n"); |
| 9609 | 50 | } |
| 51 | ||
| 52 | /************************************************************************** | |
| 53 | * Conversation subsystem signal callbacks | |
| 54 | **************************************************************************/ | |
| 55 | static void | |
|
35610
24b06c5e7760
Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
56 | conversation_dragging_cb(PidginConvWindow *source, PidginConvWindow *destination) { |
| 15884 | 57 | purple_debug_info("gtk-signal-test", "conversation dragging cb\n"); |
| 9609 | 58 | } |
| 59 | ||
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
60 | static gboolean |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
61 | displaying_im_msg_cb(PurpleConversation *conv, PurpleMessage *pmsg, gpointer data) |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
62 | { |
| 15884 | 63 | purple_debug_misc("gtk-signals test", "displaying-im-msg (%s, %s)\n", |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
64 | purple_conversation_get_name(conv), |
|
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
65 | purple_message_get_contents(pmsg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
66 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
67 | return FALSE; |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
68 | } |
|
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 | static void |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
71 | displayed_im_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data) |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
72 | { |
| 15884 | 73 | purple_debug_misc("gtk-signals test", "displayed-im-msg (%s, %s)\n", |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
74 | purple_conversation_get_name(conv), |
|
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
75 | purple_message_get_contents(msg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
76 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
77 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
78 | static gboolean |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
79 | displaying_chat_msg_cb(PurpleConversation *conv, PurpleMessage *pmsg, gpointer data) |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
80 | { |
| 15884 | 81 | purple_debug_misc("gtk-signals test", "displaying-chat-msg (%s, %s)\n", |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
82 | purple_conversation_get_name(conv), |
|
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
83 | purple_message_get_contents(pmsg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
84 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
85 | return FALSE; |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
86 | } |
|
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 | static void |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
89 | displayed_chat_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data) |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
90 | { |
| 15884 | 91 | purple_debug_misc("gtk-signals test", "displayed-chat-msg (%s, %s)\n", |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
92 | purple_conversation_get_name(conv), |
|
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
93 | purple_message_get_contents(msg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
94 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
95 | |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
96 | static void |
| 15884 | 97 | conversation_switched_cb(PurpleConversation *conv, void *data) |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
98 | { |
| 15884 | 99 | purple_debug_misc("gtk-signals test", "conversation-switched (%s)\n", |
| 100 | purple_conversation_get_name(conv)); | |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
101 | } |
|
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
102 | |
| 9609 | 103 | /************************************************************************** |
| 104 | * Plugin stuff | |
| 105 | **************************************************************************/ | |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
106 | static PidginPluginInfo * |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
107 | plugin_query(GError **error) |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
108 | { |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
109 | const gchar * const authors[] = { |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
110 | "Gary Kramlich <amc_grim@users.sf.net>", |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
111 | NULL |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
112 | }; |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
113 | |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
114 | return pidgin_plugin_info_new( |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
115 | "id", GTK_SIGNAL_TEST_PLUGIN_ID, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
116 | "name", N_("GTK Signals Test"), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
117 | "version", DISPLAY_VERSION, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
118 | "category", N_("Testing"), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
119 | "summary", N_("Test to see that all ui signals are working properly."), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
120 | "description", N_("Test to see that all ui signals are working properly."), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
121 | "authors", authors, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
122 | "website", PURPLE_WEBSITE, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
123 | "abi-version", PURPLE_ABI_VERSION, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
124 | NULL |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
125 | ); |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
126 | } |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
127 | |
| 9609 | 128 | static gboolean |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
129 | plugin_load(PurplePlugin *plugin, GError **error) |
| 9609 | 130 | { |
|
34587
a3bc28bb4ef5
Refactored pidgin to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
28981
diff
changeset
|
131 | void *accounts_handle = pidgin_accounts_get_handle(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
132 | void *blist_handle = pidgin_blist_get_handle(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
133 | void *conv_handle = pidgin_conversations_get_handle(); |
| 9609 | 134 | |
| 135 | /* Accounts subsystem signals */ | |
| 15884 | 136 | purple_signal_connect(accounts_handle, "account-modified", |
| 137 | plugin, PURPLE_CALLBACK(account_modified_cb), NULL); | |
| 9609 | 138 | |
| 139 | /* Buddy List subsystem signals */ | |
| 15884 | 140 | purple_signal_connect(blist_handle, "gtkblist-created", |
| 141 | plugin, PURPLE_CALLBACK(blist_created_cb), NULL); | |
| 142 | purple_signal_connect(blist_handle, "drawing-tooltip", | |
| 143 | plugin, PURPLE_CALLBACK(blist_drawing_tooltip_cb), NULL); | |
| 9609 | 144 | |
| 145 | /* Conversations subsystem signals */ | |
| 15884 | 146 | purple_signal_connect(conv_handle, "conversation-dragging", |
| 147 | plugin, PURPLE_CALLBACK(conversation_dragging_cb), NULL); | |
| 148 | purple_signal_connect(conv_handle, "displaying-im-msg", | |
| 149 | plugin, PURPLE_CALLBACK(displaying_im_msg_cb), NULL); | |
| 150 | purple_signal_connect(conv_handle, "displayed-im-msg", | |
| 151 | plugin, PURPLE_CALLBACK(displayed_im_msg_cb), NULL); | |
| 152 | purple_signal_connect(conv_handle, "displaying-chat-msg", | |
| 153 | plugin, PURPLE_CALLBACK(displaying_chat_msg_cb), NULL); | |
| 154 | purple_signal_connect(conv_handle, "displayed-chat-msg", | |
| 155 | plugin, PURPLE_CALLBACK(displayed_chat_msg_cb), NULL); | |
| 156 | purple_signal_connect(conv_handle, "conversation-switched", | |
| 157 | plugin, PURPLE_CALLBACK(conversation_switched_cb), NULL); | |
| 9609 | 158 | |
| 159 | return TRUE; | |
| 160 | } | |
| 161 | ||
| 11033 | 162 | static gboolean |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
163 | plugin_unload(PurplePlugin *plugin, GError **error) { |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11033
diff
changeset
|
164 | return TRUE; |
| 11033 | 165 | } |
| 166 | ||
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
167 | PURPLE_PLUGIN_INIT(gtksignalstest, plugin_query, plugin_load, plugin_unload); |