Fri, 09 Aug 2019 00:41:13 -0400
Split pidgin_account_option_menu into its own files.
| 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 | ||
|
28981
4e3922ab4844
Include 'internal.h' before all other headers to make some non-gcc compilers happy.
Paul Aurich <darkrain42@pidgin.im>
parents:
20288
diff
changeset
|
23 | #include "internal.h" |
|
4e3922ab4844
Include 'internal.h' before all other headers to make some non-gcc compilers happy.
Paul Aurich <darkrain42@pidgin.im>
parents:
20288
diff
changeset
|
24 | |
| 9609 | 25 | #include <gtk/gtk.h> |
| 26 | ||
| 27 | #include "debug.h" | |
| 9954 | 28 | #include "version.h" |
| 9609 | 29 | |
| 30 | #include "gtkaccount.h" | |
|
34708
dd67596485ca
Undo renames of UI blist headers back to gntblist.h and gtkblist.h
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
31 | #include "gtkblist.h" |
| 9609 | 32 | #include "gtkconv.h" |
| 33 | #include "gtkplugin.h" | |
| 34 | ||
| 35 | /************************************************************************** | |
| 36 | * Account subsystem signal callbacks | |
| 37 | **************************************************************************/ | |
| 38 | static void | |
| 15884 | 39 | account_modified_cb(PurpleAccount *account, void *data) { |
| 40 | purple_debug_info("gtk-signal-test", "account modified cb\n"); | |
| 9609 | 41 | } |
| 42 | ||
| 43 | /************************************************************************** | |
| 44 | * Buddy List subsystem signal callbacks | |
| 45 | **************************************************************************/ | |
| 46 | static void | |
| 15884 | 47 | blist_created_cb(PurpleBuddyList *blist, void *data) { |
| 48 | purple_debug_info("gtk-signal-test", "buddy list created\n"); | |
| 9609 | 49 | } |
| 50 | ||
| 51 | static void | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
52 | blist_drawing_tooltip_cb(PurpleBlistNode *node, GString *str, gboolean full, void *data) { |
| 15884 | 53 | purple_debug_info("gtk-signal-test", "drawing tooltip cb\n"); |
| 9609 | 54 | } |
| 55 | ||
| 56 | /************************************************************************** | |
| 57 | * Conversation subsystem signal callbacks | |
| 58 | **************************************************************************/ | |
| 59 | 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
|
60 | conversation_dragging_cb(PidginConvWindow *source, PidginConvWindow *destination) { |
| 15884 | 61 | purple_debug_info("gtk-signal-test", "conversation dragging cb\n"); |
| 9609 | 62 | } |
| 63 | ||
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
64 | static gboolean |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
65 | 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
|
66 | { |
| 15884 | 67 | 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
|
68 | 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
|
69 | purple_message_get_contents(pmsg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
70 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
71 | return FALSE; |
|
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 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
74 | static void |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
75 | 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
|
76 | { |
| 15884 | 77 | 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
|
78 | 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
|
79 | purple_message_get_contents(msg)); |
|
12604
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 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
82 | static gboolean |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
83 | 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
|
84 | { |
| 15884 | 85 | 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
|
86 | 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
|
87 | purple_message_get_contents(pmsg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
88 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
89 | return FALSE; |
|
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 | |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
92 | static void |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35610
diff
changeset
|
93 | 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
|
94 | { |
| 15884 | 95 | 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
|
96 | 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
|
97 | purple_message_get_contents(msg)); |
|
12604
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
98 | } |
|
893fbf89317c
[gaim-migrate @ 14939]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11848
diff
changeset
|
99 | |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
100 | static void |
| 15884 | 101 | conversation_switched_cb(PurpleConversation *conv, void *data) |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
102 | { |
| 15884 | 103 | purple_debug_misc("gtk-signals test", "conversation-switched (%s)\n", |
| 104 | purple_conversation_get_name(conv)); | |
|
12639
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
105 | } |
|
7df970d037c3
[gaim-migrate @ 14975]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12604
diff
changeset
|
106 | |
| 9609 | 107 | /************************************************************************** |
| 108 | * Plugin stuff | |
| 109 | **************************************************************************/ | |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
110 | static PidginPluginInfo * |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
111 | plugin_query(GError **error) |
|
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 | const gchar * const authors[] = { |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
114 | "Gary Kramlich <amc_grim@users.sf.net>", |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
115 | NULL |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
116 | }; |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
117 | |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
118 | return pidgin_plugin_info_new( |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
119 | "id", GTK_SIGNAL_TEST_PLUGIN_ID, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
120 | "name", N_("GTK Signals Test"), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
121 | "version", DISPLAY_VERSION, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
122 | "category", N_("Testing"), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
123 | "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
|
124 | "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
|
125 | "authors", authors, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
126 | "website", PURPLE_WEBSITE, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
127 | "abi-version", PURPLE_ABI_VERSION, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
128 | NULL |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
129 | ); |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
130 | } |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
131 | |
| 9609 | 132 | static gboolean |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
133 | plugin_load(PurplePlugin *plugin, GError **error) |
| 9609 | 134 | { |
|
34587
a3bc28bb4ef5
Refactored pidgin to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
28981
diff
changeset
|
135 | void *accounts_handle = pidgin_accounts_get_handle(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
136 | void *blist_handle = pidgin_blist_get_handle(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
137 | void *conv_handle = pidgin_conversations_get_handle(); |
| 9609 | 138 | |
| 139 | /* Accounts subsystem signals */ | |
| 15884 | 140 | purple_signal_connect(accounts_handle, "account-modified", |
| 141 | plugin, PURPLE_CALLBACK(account_modified_cb), NULL); | |
| 9609 | 142 | |
| 143 | /* Buddy List subsystem signals */ | |
| 15884 | 144 | purple_signal_connect(blist_handle, "gtkblist-created", |
| 145 | plugin, PURPLE_CALLBACK(blist_created_cb), NULL); | |
| 146 | purple_signal_connect(blist_handle, "drawing-tooltip", | |
| 147 | plugin, PURPLE_CALLBACK(blist_drawing_tooltip_cb), NULL); | |
| 9609 | 148 | |
| 149 | /* Conversations subsystem signals */ | |
| 15884 | 150 | purple_signal_connect(conv_handle, "conversation-dragging", |
| 151 | plugin, PURPLE_CALLBACK(conversation_dragging_cb), NULL); | |
| 152 | purple_signal_connect(conv_handle, "displaying-im-msg", | |
| 153 | plugin, PURPLE_CALLBACK(displaying_im_msg_cb), NULL); | |
| 154 | purple_signal_connect(conv_handle, "displayed-im-msg", | |
| 155 | plugin, PURPLE_CALLBACK(displayed_im_msg_cb), NULL); | |
| 156 | purple_signal_connect(conv_handle, "displaying-chat-msg", | |
| 157 | plugin, PURPLE_CALLBACK(displaying_chat_msg_cb), NULL); | |
| 158 | purple_signal_connect(conv_handle, "displayed-chat-msg", | |
| 159 | plugin, PURPLE_CALLBACK(displayed_chat_msg_cb), NULL); | |
| 160 | purple_signal_connect(conv_handle, "conversation-switched", | |
| 161 | plugin, PURPLE_CALLBACK(conversation_switched_cb), NULL); | |
| 9609 | 162 | |
| 163 | return TRUE; | |
| 164 | } | |
| 165 | ||
| 11033 | 166 | static gboolean |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
167 | plugin_unload(PurplePlugin *plugin, GError **error) { |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11033
diff
changeset
|
168 | return TRUE; |
| 11033 | 169 | } |
| 170 | ||
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
171 | PURPLE_PLUGIN_INIT(gtksignalstest, plugin_query, plugin_load, plugin_unload); |