pidgin/plugins/iconaway.c

Fri, 25 Mar 2022 02:51:58 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 25 Mar 2022 02:51:58 -0500
changeset 41314
0dc72eacd8bf
parent 41184
05b5c210352b
child 41558
2272781f531f
permissions
-rw-r--r--

Replace PURPLE_CALLBACK by G_CALLBACK

Another straight search-and-replace for 'easy' review.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/1371/

15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
1 /* purple
9791
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
2 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
9791
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
5 * source distribution.
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
6 *
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
7 * This program is free software; you can redistribute it and/or modify
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
8 * it under the terms of the GNU General Public License as published by
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
10 * (at your option) any later version.
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
11 *
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
12 * This program is distributed in the hope that it will be useful,
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
15 * GNU General Public License for more details.
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
16 *
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
17 * You should have received a copy of the GNU General Public License
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
18 * 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: 16749
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9791
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
20 */
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
21 #include <glib/gi18n-lib.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
22
40360
e21f3bbcc2a5 Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 40222
diff changeset
23 #include <purple.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
24
40502
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
25 #include <pidgin.h>
4202
8b92de3b1c07 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
26
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
27 #define ICONAWAY_PLUGIN_ID "gtk-iconaway"
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
28
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
29 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
30 iconify_windows(PurpleAccount *account, PurpleStatus *old, PurpleStatus *newstatus)
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
31 {
41184
05b5c210352b Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
32 GApplication *application = NULL;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
33 PurplePresence *presence;
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
34 GList *windows;
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
35
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
36 presence = purple_status_get_presence(newstatus);
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
37
41184
05b5c210352b Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
38 if(purple_presence_is_available(presence)) {
1406
45a8e718dd86 [gaim-migrate @ 1416]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 1405
diff changeset
39 return;
41184
05b5c210352b Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
40 }
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
41
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
42 purple_blist_set_visible(FALSE);
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
43
41184
05b5c210352b Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
44 application = g_application_get_default();
05b5c210352b Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
45 windows = gtk_application_get_windows(GTK_APPLICATION(application));
05b5c210352b Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
46 g_list_foreach(windows, (GFunc)gtk_window_iconify, NULL);
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
47 }
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
48
3630
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
49 /*
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
50 * EXPORTED FUNCTIONS
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
51 */
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
52
40894
80d9d7a73a60 Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents: 40502
diff changeset
53 static GPluginPluginInfo *
80d9d7a73a60 Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents: 40502
diff changeset
54 icon_away_query(GError **error)
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
55 {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
56 const gchar * const authors[] = {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
57 "Eric Warmenhoven <eric@warmenhoven.org>",
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
58 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
59 };
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
60
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
61 return pidgin_plugin_info_new(
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
62 "id", ICONAWAY_PLUGIN_ID,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
63 "name", N_("Iconify on Away"),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
64 "version", DISPLAY_VERSION,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
65 "category", N_("User interface"),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
66 "summary", N_("Iconifies the buddy list and your conversations "
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
67 "when you go away."),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
68 "description", N_("Iconifies the buddy list and your conversations "
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
69 "when you go away."),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
70 "authors", authors,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
71 "website", PURPLE_WEBSITE,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
72 "abi-version", PURPLE_ABI_VERSION,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
73 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
74 );
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
75 }
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
76
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
77 static gboolean
40894
80d9d7a73a60 Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents: 40502
diff changeset
78 icon_away_load(GPluginPlugin *plugin, GError **error)
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
79 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
80 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
41314
0dc72eacd8bf Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41184
diff changeset
81 plugin, G_CALLBACK(iconify_windows), NULL);
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
82
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
83 return TRUE;
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
84 }
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
85
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
86 static gboolean
41078
84e48180ef67 Update to gplugin 0.35.0
Gary Kramlich <grim@reaperworld.com>
parents: 40894
diff changeset
87 icon_away_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error)
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
88 {
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
89 return TRUE;
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
90 }
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
91
40894
80d9d7a73a60 Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents: 40502
diff changeset
92 GPLUGIN_NATIVE_PLUGIN_DECLARE(icon_away)

mercurial