pidgin/plugins/gestures/gestures.c

Fri, 01 May 2020 05:15:51 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 01 May 2020 05:15:51 -0500
changeset 40360
e21f3bbcc2a5
parent 40197
75ffd76260fc
child 40497
2f45a03838e9
permissions
-rw-r--r--

Update all of the pidgin code to include purple.h

4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /*
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
2 * Mouse gestures plugin for Purple
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * Copyright (C) 2003 Christian Hammond.
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
5 *
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * published by the Free Software Foundation; either version 2 of the
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 *
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful, but
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * General Public License for more details.
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
15 *
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
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: 16749
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: 16749
diff changeset
19 * 02111-1301, USA.
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 */
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5767
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: 5767
diff changeset
23
40360
e21f3bbcc2a5 Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 40197
diff changeset
24 #include <purple.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5767
diff changeset
25
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5767
diff changeset
26 #include "gtkconv.h"
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5767
diff changeset
27 #include "gtkplugin.h"
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5767
diff changeset
28 #include "gtkutils.h"
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 #include "gstroke.h"
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6225
diff changeset
32 #define GESTURES_PLUGIN_ID "gtk-x11-gestures"
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 static void
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 stroke_close(GtkWidget *widget, void *data)
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
37 PurpleConversation *conv;
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
38 PidginConversation *gtkconv;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
40 conv = (PurpleConversation *)data;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 /* Double-check */
15705
6ea0a722c797 Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents: 15692
diff changeset
43 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 return;
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
46 gtkconv = PIDGIN_CONVERSATION(conv);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47
32585
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
48 gstroke_cleanup(gtkconv->webview);
34660
68c776e3436e Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents: 34655
diff changeset
49 g_object_unref(conv);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 static void
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 35539
diff changeset
53 switch_page(PidginConvWindow *win, GtkDirectionType dir)
12912
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
54 {
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
55 int count, current;
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
56
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
57 count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(win->notebook));
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
58 current = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook));
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
59
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
60 if (dir == GTK_DIR_LEFT)
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
61 {
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
62 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), current - 1);
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
63 }
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
64 else if (dir == GTK_DIR_RIGHT)
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
65 {
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
66 if (current == count - 1)
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
67 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0);
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
68 else
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
69 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), current + 1);
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
70 }
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
71 }
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
72
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
73 static void
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 stroke_prev_tab(GtkWidget *widget, void *data)
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
76 PurpleConversation *conv;
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
77 PidginConversation *gtkconv;
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 35539
diff changeset
78 PidginConvWindow *win;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
80 conv = (PurpleConversation *)data;
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
81 gtkconv = PIDGIN_CONVERSATION(conv);
11581
5c7f44be5dfe [gaim-migrate @ 13851]
Tim Ringenbach <marv@pidgin.im>
parents: 11256
diff changeset
82 win = gtkconv->win;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83
12912
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
84 switch_page(win, GTK_DIR_LEFT);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 static void
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 stroke_next_tab(GtkWidget *widget, void *data)
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
90 PurpleConversation *conv;
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 35539
diff changeset
91 PidginConvWindow *win;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
93 conv = (PurpleConversation *)data;
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
94 win = PIDGIN_CONVERSATION(conv)->win;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95
12912
fdad9199a6e8 [gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12816
diff changeset
96 switch_page(win, GTK_DIR_RIGHT);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 11592
diff changeset
99 static void
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 stroke_new_win(GtkWidget *widget, void *data)
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 {
35610
24b06c5e7760 Renamed PidginWindow to PidginConvWindow so that introspection associates it with pidgin_conv_window_* API
Ankit Vani <a@nevitus.org>
parents: 35539
diff changeset
102 PidginConvWindow *new_win, *old_win;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
103 PurpleConversation *conv;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
105 conv = (PurpleConversation *)data;
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
106 old_win = PIDGIN_CONVERSATION(conv)->win;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
108 if (pidgin_conv_window_get_gtkconv_count(old_win) <= 1)
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 return;
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
111 new_win = pidgin_conv_window_new();
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
113 pidgin_conv_window_remove_gtkconv(old_win, PIDGIN_CONVERSATION(conv));
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
114 pidgin_conv_window_add_gtkconv(new_win, PIDGIN_CONVERSATION(conv));
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
116 pidgin_conv_window_show(new_win);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
120 attach_signals(PurpleConversation *conv)
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 {
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
122 PidginConversation *gtkconv;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
124 gtkconv = PIDGIN_CONVERSATION(conv);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125
32585
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
126 gstroke_enable(gtkconv->webview);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
127 gstroke_signal_connect(gtkconv->webview, "14789", stroke_close, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
128 gstroke_signal_connect(gtkconv->webview, "1456", stroke_close, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
129 gstroke_signal_connect(gtkconv->webview, "1489", stroke_close, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
130 gstroke_signal_connect(gtkconv->webview, "74123", stroke_next_tab, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
131 gstroke_signal_connect(gtkconv->webview, "7456", stroke_next_tab, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
132 gstroke_signal_connect(gtkconv->webview, "96321", stroke_prev_tab, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
133 gstroke_signal_connect(gtkconv->webview, "9654", stroke_prev_tab, conv);
382b9c2150cf Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29741
diff changeset
134 gstroke_signal_connect(gtkconv->webview, "25852", stroke_new_win, conv);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
138 new_conv_cb(PurpleConversation *conv)
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 {
15705
6ea0a722c797 Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents: 15692
diff changeset
140 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv))
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
141 attach_signals(conv);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 #if 0
29741
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
145 static void
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
146 mouse_button_menu_cb(GtkComboBox *opt, gpointer data)
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
147 {
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
148 int button = gtk_combo_box_get_active(opt);
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
149
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
150 gstroke_set_mouse_button(button + 2);
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
151 }
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
152 #endif
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 static void
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 toggle_draw_cb(GtkToggleButton *toggle, gpointer data)
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
157 purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual",
5767
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
158 gtk_toggle_button_get_active(toggle));
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
159 }
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
160
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
161 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
162 visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value,
5767
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
163 gpointer data)
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
164 {
7386
9cccb3792018 [gaim-migrate @ 7981]
Luke Schierer <lschiere@pidgin.im>
parents: 7118
diff changeset
165 gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) );
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5016
diff changeset
168 static GtkWidget *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
169 get_config_frame(PurplePlugin *plugin)
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 {
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 GtkWidget *ret;
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 GtkWidget *vbox;
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 GtkWidget *toggle;
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 #if 0
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 GtkWidget *opt;
29741
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
176 #endif
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 /* Outside container */
35526
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35037
diff changeset
179 ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180 gtk_container_set_border_width(GTK_CONTAINER(ret), 12);
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182 /* Configuration frame */
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
183 vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration"));
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185 #if 0
29741
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
186 /* Mouse button drop-down menu */
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
187 opt = gtk_combo_box_new_text();
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
188
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
189 gtk_combo_box_append_text(_("Middle mouse button"));
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
190 gtk_combo_box_append_text(_("Right mouse button"));
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
191 g_signal_connect(G_OBJECT(opt), "changed",
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
192 G_CALLBACK(mouse_button_menu_cb), NULL);
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
193
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
194 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0);
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
195 gtk_combo_box_set_active(GTK_COMBO_BOX(opt),
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
196 gstroke_get_mouse_button() - 2);
3fbd100877f9 Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29499
diff changeset
197 #endif
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 /* "Visual gesture display" checkbox */
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display"));
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
202 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
203 purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual"));
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204 g_signal_connect(G_OBJECT(toggle), "toggled",
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
205 G_CALLBACK(toggle_draw_cb), NULL);
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207 gtk_widget_show_all(ret);
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 return ret;
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
212 static PidginPluginInfo *
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
213 plugin_query(GError **error)
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5016
diff changeset
214 {
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
215 const gchar * const authors[] = {
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
216 "Christian Hammond <chipx86@gnupdate.org>",
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
217 NULL
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
218 };
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
219
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
220 return pidgin_plugin_info_new(
36935
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
221 "id", GESTURES_PLUGIN_ID,
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
222 "name", N_("Mouse Gestures"),
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
223 "version", DISPLAY_VERSION,
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
224 "category", N_("User interface"),
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
225 "summary", N_("Provides support for mouse gestures"),
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
226 "description", N_("Allows support for mouse gestures in "
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
227 "conversation windows. Drag the middle "
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
228 "mouse button to perform certain "
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
229 "actions:\n"
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
230 " • Drag down and then to the right to "
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
231 "close a conversation.\n"
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
232 " • Drag up and then to the left to "
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
233 "switch to the previous conversation.\n"
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
234 " • Drag up and then to the right to "
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
235 "switch to the next conversation."),
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
236 "authors", authors,
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
237 "website", PURPLE_WEBSITE,
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
238 "abi-version", PURPLE_ABI_VERSION,
5384600e613c Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents: 36934
diff changeset
239 "gtk-config-frame-cb", get_config_frame,
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
240 NULL
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
241 );
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
242 }
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5016
diff changeset
243
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
244 static gboolean
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
245 plugin_load(PurplePlugin *plugin, GError **error)
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
246 {
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
247 PurpleConversation *conv;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
248 GList *l;
16749
14a3fdc0aed7 Default plugins are done, for the release i'm not that concerned about plugins that do _NOT_ compile by default
Gary Kramlich <grim@reaperworld.com>
parents: 15884
diff changeset
249
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
250 purple_prefs_add_none("/plugins/gtk");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
251 purple_prefs_add_none("/plugins/gtk/X11");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
252 purple_prefs_add_none("/plugins/gtk/X11/gestures");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15705
diff changeset
253 purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE);
5767
8ae2df3826e8 [gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
254
35539
c3c490f4f611 Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
255 purple_prefs_connect_callback(plugin,
c3c490f4f611 Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
256 "/plugins/gtk/X11/gestures/visual", visual_pref_cb, NULL);
c3c490f4f611 Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
257 gstroke_set_draw_strokes(purple_prefs_get_bool(
c3c490f4f611 Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
258 "/plugins/gtk/X11/gestures/visual"));
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
259
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
260 for (l = purple_conversations_get_all(); l != NULL; l = l->next) {
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
261 conv = (PurpleConversation *)l->data;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
262
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
263 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
264 continue;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
265
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
266 attach_signals(conv);
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
267 }
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
268
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
269 purple_signal_connect(purple_conversations_get_handle(),
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
270 "conversation-created",
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
271 plugin, PURPLE_CALLBACK(new_conv_cb), NULL);
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
272
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
273 return TRUE;
4390
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
274 }
590cb1708f57 [gaim-migrate @ 4656]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
275
36754
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
276 static gboolean
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
277 plugin_unload(PurplePlugin *plugin, GError **error)
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
278 {
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
279 PurpleConversation *conv;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
280 PidginConversation *gtkconv;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
281 GList *l;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
282
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
283 for (l = purple_conversations_get_all(); l != NULL; l = l->next) {
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
284 conv = (PurpleConversation *)l->data;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
285
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
286 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
287 continue;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
288
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
289 gtkconv = PIDGIN_CONVERSATION(conv);
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
290
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
291 gstroke_cleanup(gtkconv->webview);
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
292 gstroke_disable(gtkconv->webview);
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
293 }
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
294
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
295 return TRUE;
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
296 }
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
297
8250d6be8c02 Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 34660
diff changeset
298 PURPLE_PLUGIN_INIT(gestures, plugin_query, plugin_load, plugin_unload);

mercurial