pidgin/plugins/iconaway.c

Thu, 14 Nov 2019 21:53:50 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 14 Nov 2019 21:53:50 -0600
changeset 40222
40f2888f85c1
parent 37123
9c245220151d
child 40360
e21f3bbcc2a5
permissions
-rw-r--r--

delete gtkplugin.[ch] and deal with the repercussions

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 */
f5c5bda0b96b [gaim-migrate @ 10659]
Gary Kramlich <grim@pidgin.im>
parents: 8993
diff changeset
21 #include "internal.h"
15577
b8129373f65e More pidgin changes
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
22 #include "pidgin.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
23
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
24 #include "conversation.h"
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
25 #include "signals.h"
9943
b54a762f60fa [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
26 #include "version.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
27
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
28 #include "gtkconv.h"
40222
40f2888f85c1 delete gtkplugin.[ch] and deal with the repercussions
Gary Kramlich <grim@reaperworld.com>
parents: 37123
diff changeset
29 #include "pidginplugininfo.h"
4202
8b92de3b1c07 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
30
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
31 #define ICONAWAY_PLUGIN_ID "gtk-iconaway"
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
32
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
33 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
34 iconify_windows(PurpleAccount *account, PurpleStatus *old, PurpleStatus *newstatus)
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
35 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
36 PurplePresence *presence;
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
37 PidginConvWindow *win;
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
38 GList *windows;
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
39
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
40 presence = purple_status_get_presence(newstatus);
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
41
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
42 if (purple_presence_is_available(presence))
1406
45a8e718dd86 [gaim-migrate @ 1416]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 1405
diff changeset
43 return;
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
44
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
45 purple_blist_set_visible(FALSE);
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
46
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
47 for (windows = pidgin_conv_windows_get_list();
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
48 windows != NULL;
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
49 windows = windows->next) {
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
50
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
51 win = (PidginConvWindow *)windows->data;
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
52
12665
a370bc0f3c92 [gaim-migrate @ 15008]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11964
diff changeset
53 gtk_window_iconify(GTK_WINDOW(win->window));
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
54 }
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
55 }
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
56
3630
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
57 /*
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
58 * EXPORTED FUNCTIONS
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
59 */
caa952062dc2 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
60
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
61 static PidginPluginInfo *
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
62 plugin_query(GError **error)
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
63 {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
64 const gchar * const authors[] = {
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
65 "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
66 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
67 };
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
68
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
69 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
70 "id", ICONAWAY_PLUGIN_ID,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
71 "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
72 "version", DISPLAY_VERSION,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
73 "category", N_("User interface"),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
74 "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
75 "when you go away."),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
76 "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
77 "when you go away."),
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
78 "authors", authors,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
79 "website", PURPLE_WEBSITE,
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
80 "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
81 NULL
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
82 );
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
83 }
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
84
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
85 static gboolean
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
86 plugin_load(PurplePlugin *plugin, GError **error)
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
87 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
88 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
89 plugin, PURPLE_CALLBACK(iconify_windows), NULL);
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
90
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
91 return TRUE;
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
92 }
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
93
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
94 static gboolean
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
95 plugin_unload(PurplePlugin *plugin, GError **error)
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
96 {
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
97 return TRUE;
133
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
98 }
418de720c20d [gaim-migrate @ 143]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
99
36757
2e04586cf6e8 Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 20288
diff changeset
100 PURPLE_PLUGIN_INIT(iconaway, plugin_query, plugin_load, plugin_unload);

mercurial