Fri, 23 Dec 2011 08:21:58 +0000
A boring and large patch so I can merge heads.
| 4390 | 1 | /* |
| 15884 | 2 | * Mouse gestures plugin for Purple |
| 4390 | 3 | * |
| 4 | * Copyright (C) 2003 Christian Hammond. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
5 | * |
| 4390 | 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. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
15 | * |
| 4390 | 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:
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 | 20 | */ |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
21 | #include "internal.h" |
| 15577 | 22 | #include "pidgin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
23 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
24 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
25 | #include "prefs.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
26 | #include "signals.h" |
| 9943 | 27 | #include "version.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
28 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
29 | #include "gtkconv.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
30 | #include "gtkplugin.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
31 | #include "gtkutils.h" |
| 4390 | 32 | |
| 33 | #include "gstroke.h" | |
| 34 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6225
diff
changeset
|
35 | #define GESTURES_PLUGIN_ID "gtk-x11-gestures" |
| 4390 | 36 | |
| 37 | static void | |
| 38 | stroke_close(GtkWidget *widget, void *data) | |
| 39 | { | |
| 15884 | 40 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
41 | PidginConversation *gtkconv; |
| 4390 | 42 | |
| 15884 | 43 | conv = (PurpleConversation *)data; |
| 4390 | 44 | |
| 45 | /* Double-check */ | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
46 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 47 | return; |
| 48 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
49 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 50 | |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
51 | gstroke_cleanup(gtkconv->webview); |
| 15884 | 52 | purple_conversation_destroy(conv); |
| 4390 | 53 | } |
| 54 | ||
| 55 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
56 | switch_page(PidginWindow *win, GtkDirectionType dir) |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
57 | { |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
58 | int count, current; |
|
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 | count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(win->notebook)); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
61 | current = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook)); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
62 | |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
63 | if (dir == GTK_DIR_LEFT) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
64 | { |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
65 | 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
|
66 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
67 | else if (dir == GTK_DIR_RIGHT) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
68 | { |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
69 | if (current == count - 1) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
70 | gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
71 | else |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
72 | 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
|
73 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
74 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
75 | |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
76 | static void |
| 4390 | 77 | stroke_prev_tab(GtkWidget *widget, void *data) |
| 78 | { | |
| 15884 | 79 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
80 | PidginConversation *gtkconv; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
81 | PidginWindow *win; |
| 4390 | 82 | |
| 15884 | 83 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
84 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 85 | win = gtkconv->win; |
| 4390 | 86 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
87 | switch_page(win, GTK_DIR_LEFT); |
| 4390 | 88 | } |
| 89 | ||
| 90 | static void | |
| 91 | stroke_next_tab(GtkWidget *widget, void *data) | |
| 92 | { | |
| 15884 | 93 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
94 | PidginWindow *win; |
| 4390 | 95 | |
| 15884 | 96 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
97 | win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 98 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
99 | switch_page(win, GTK_DIR_RIGHT); |
| 4390 | 100 | } |
| 101 | ||
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11592
diff
changeset
|
102 | static void |
| 4390 | 103 | stroke_new_win(GtkWidget *widget, void *data) |
| 104 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
105 | PidginWindow *new_win, *old_win; |
| 15884 | 106 | PurpleConversation *conv; |
| 4390 | 107 | |
| 15884 | 108 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
109 | old_win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 110 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
111 | if (pidgin_conv_window_get_gtkconv_count(old_win) <= 1) |
| 4390 | 112 | return; |
| 113 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
114 | new_win = pidgin_conv_window_new(); |
| 4390 | 115 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
116 | 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
|
117 | pidgin_conv_window_add_gtkconv(new_win, PIDGIN_CONVERSATION(conv)); |
| 4390 | 118 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
119 | pidgin_conv_window_show(new_win); |
| 4390 | 120 | } |
| 121 | ||
| 122 | static void | |
| 15884 | 123 | attach_signals(PurpleConversation *conv) |
| 4390 | 124 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
125 | PidginConversation *gtkconv; |
| 4390 | 126 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
127 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 128 | |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
129 | gstroke_enable(gtkconv->webview); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
130 | gstroke_signal_connect(gtkconv->webview, "14789", stroke_close, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
131 | gstroke_signal_connect(gtkconv->webview, "1456", stroke_close, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
132 | gstroke_signal_connect(gtkconv->webview, "1489", stroke_close, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
133 | gstroke_signal_connect(gtkconv->webview, "74123", stroke_next_tab, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
134 | gstroke_signal_connect(gtkconv->webview, "7456", stroke_next_tab, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
135 | gstroke_signal_connect(gtkconv->webview, "96321", stroke_prev_tab, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
136 | gstroke_signal_connect(gtkconv->webview, "9654", stroke_prev_tab, conv); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
137 | gstroke_signal_connect(gtkconv->webview, "25852", stroke_new_win, conv); |
| 4390 | 138 | } |
| 139 | ||
| 140 | static void | |
| 15884 | 141 | new_conv_cb(PurpleConversation *conv) |
| 4390 | 142 | { |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
143 | if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
144 | attach_signals(conv); |
| 4390 | 145 | } |
| 146 | ||
| 147 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
148 | static void |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
149 | 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
|
150 | { |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
151 | 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
|
152 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
153 | 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
|
154 | } |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
155 | #endif |
| 4390 | 156 | |
| 157 | static void | |
| 158 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 159 | { | |
| 15884 | 160 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
161 | gtk_toggle_button_get_active(toggle)); |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
162 | } |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
163 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
164 | static void |
| 15884 | 165 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
166 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
167 | { |
| 7386 | 168 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 169 | } |
| 170 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
171 | static gboolean |
| 15884 | 172 | plugin_load(PurplePlugin *plugin) |
| 4390 | 173 | { |
| 15884 | 174 | PurpleConversation *conv; |
| 4390 | 175 | GList *l; |
| 176 | ||
| 15884 | 177 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 178 | conv = (PurpleConversation *)l->data; | |
| 4390 | 179 | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
180 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 181 | continue; |
| 182 | ||
| 183 | attach_signals(conv); | |
| 184 | } | |
| 185 | ||
| 15884 | 186 | purple_signal_connect(purple_conversations_get_handle(), |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
187 | "conversation-created", |
| 15884 | 188 | plugin, PURPLE_CALLBACK(new_conv_cb), NULL); |
| 4390 | 189 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
190 | return TRUE; |
| 4390 | 191 | } |
| 192 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
193 | static gboolean |
| 15884 | 194 | plugin_unload(PurplePlugin *plugin) |
| 4390 | 195 | { |
| 15884 | 196 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
197 | PidginConversation *gtkconv; |
| 4390 | 198 | GList *l; |
| 199 | ||
| 15884 | 200 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 201 | conv = (PurpleConversation *)l->data; | |
| 4390 | 202 | |
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
203 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 204 | continue; |
| 205 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
206 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 207 | |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
208 | gstroke_cleanup(gtkconv->webview); |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
209 | gstroke_disable(gtkconv->webview); |
| 4390 | 210 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
211 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
212 | return TRUE; |
| 4390 | 213 | } |
| 214 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
215 | static GtkWidget * |
| 15884 | 216 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 217 | { |
| 218 | GtkWidget *ret; | |
| 219 | GtkWidget *vbox; | |
| 220 | GtkWidget *toggle; | |
| 221 | #if 0 | |
| 222 | GtkWidget *opt; | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
223 | #endif |
| 4390 | 224 | |
| 225 | /* Outside container */ | |
| 226 | ret = gtk_vbox_new(FALSE, 18); | |
| 227 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 228 | ||
| 229 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
230 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 231 | |
| 232 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
233 | /* 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
|
234 | 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
|
235 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
236 | 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
|
237 | 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
|
238 | 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
|
239 | 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
|
240 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
241 | 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
|
242 | 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
|
243 | 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
|
244 | #endif |
| 4390 | 245 | |
| 246 | /* "Visual gesture display" checkbox */ | |
| 247 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 248 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 249 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 250 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 251 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 252 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 253 | ||
| 254 | gtk_widget_show_all(ret); | |
| 255 | ||
| 256 | return ret; | |
| 257 | } | |
| 258 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
259 | static PidginPluginUiInfo ui_info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
260 | { |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
261 | get_config_frame, |
|
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
|
262 | 0, /* page_num (Reserved) */ |
|
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
|
263 | |
|
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
|
264 | /* padding */ |
|
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
|
265 | NULL, |
|
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
|
266 | NULL, |
|
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
|
267 | NULL, |
|
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
|
268 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
269 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
270 | |
| 15884 | 271 | static PurplePluginInfo info = |
| 4390 | 272 | { |
| 15884 | 273 | PURPLE_PLUGIN_MAGIC, |
| 274 | PURPLE_MAJOR_VERSION, | |
| 275 | PURPLE_MINOR_VERSION, | |
| 276 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
277 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
278 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
279 | NULL, /**< dependencies */ |
| 15884 | 280 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 4390 | 281 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
282 | GESTURES_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
283 | N_("Mouse Gestures"), /**< name */ |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
284 | DISPLAY_VERSION, /**< version */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
285 | /** summary */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
286 | N_("Provides support for mouse gestures"), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
287 | /** description */ |
|
22782
c465a8b48510
Massage some plugin metadata to look better with the fixed up description pane.
Will Thompson <resiak@pidgin.im>
parents:
20288
diff
changeset
|
288 | N_("Allows support for mouse gestures in conversation windows. " |
|
c465a8b48510
Massage some plugin metadata to look better with the fixed up description pane.
Will Thompson <resiak@pidgin.im>
parents:
20288
diff
changeset
|
289 | "Drag the middle mouse button to perform certain actions:\n" |
|
c465a8b48510
Massage some plugin metadata to look better with the fixed up description pane.
Will Thompson <resiak@pidgin.im>
parents:
20288
diff
changeset
|
290 | " • Drag down and then to the right to close a conversation.\n" |
|
c465a8b48510
Massage some plugin metadata to look better with the fixed up description pane.
Will Thompson <resiak@pidgin.im>
parents:
20288
diff
changeset
|
291 | " • Drag up and then to the left to switch to the previous " |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
292 | "conversation.\n" |
|
22782
c465a8b48510
Massage some plugin metadata to look better with the fixed up description pane.
Will Thompson <resiak@pidgin.im>
parents:
20288
diff
changeset
|
293 | " • Drag up and then to the right to switch to the next " |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
294 | "conversation."), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
295 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ |
| 15884 | 296 | PURPLE_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
297 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
298 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
299 | plugin_unload, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
300 | NULL, /**< destroy */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
301 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
302 | &ui_info, /**< ui_info */ |
| 8993 | 303 | NULL, /**< extra_info */ |
| 304 | NULL, | |
|
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
|
305 | NULL, |
|
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
|
306 | |
|
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
|
307 | /* padding */ |
|
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
|
308 | NULL, |
|
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
|
309 | NULL, |
|
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
|
310 | NULL, |
| 8993 | 311 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
312 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
313 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
314 | static void |
| 15884 | 315 | init_plugin(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
316 | { |
| 15884 | 317 | purple_prefs_add_none("/plugins/gtk"); |
| 318 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 319 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 320 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
321 | |
| 15884 | 322 | purple_prefs_connect_callback(plugin, "/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
323 | visual_pref_cb, NULL); |
| 4390 | 324 | } |
| 325 | ||
| 15884 | 326 | PURPLE_INIT_PLUGIN(gestures, init_plugin, info) |