Fri, 02 Sep 2011 04:25:04 +0000
Remove deprecated buddy icon functions and @since tags.
| 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 | |
| 51 | gstroke_cleanup(gtkconv->imhtml); | |
| 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 | |
| 129 | gstroke_enable(gtkconv->imhtml); | |
| 130 | gstroke_signal_connect(gtkconv->imhtml, "14789", stroke_close, conv); | |
| 131 | gstroke_signal_connect(gtkconv->imhtml, "1456", stroke_close, conv); | |
|
5016
0e42e5f25880
[gaim-migrate @ 5352]
Christian Hammond <chipx86@chipx86.com>
parents:
4843
diff
changeset
|
132 | gstroke_signal_connect(gtkconv->imhtml, "1489", stroke_close, conv); |
| 4390 | 133 | gstroke_signal_connect(gtkconv->imhtml, "74123", stroke_next_tab, conv); |
| 134 | gstroke_signal_connect(gtkconv->imhtml, "7456", stroke_next_tab, conv); | |
| 135 | gstroke_signal_connect(gtkconv->imhtml, "96321", stroke_prev_tab, conv); | |
| 136 | gstroke_signal_connect(gtkconv->imhtml, "9654", stroke_prev_tab, conv); | |
| 137 | gstroke_signal_connect(gtkconv->imhtml, "25852", stroke_new_win, conv); | |
| 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 | #if GTK_CHECK_VERSION(2,4,0) |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
149 | static void |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
150 | 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
|
151 | { |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
152 | 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
|
153 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
154 | 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
|
155 | } |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
156 | #else |
| 4390 | 157 | static void |
| 158 | mouse_button_menu_cb(GtkMenuItem *item, gpointer data) | |
| 159 | { | |
| 160 | int button = (int)data; | |
| 161 | ||
| 162 | gstroke_set_mouse_button(button + 2); | |
| 163 | } | |
| 164 | #endif | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
165 | #endif |
| 4390 | 166 | |
| 167 | static void | |
| 168 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 169 | { | |
| 15884 | 170 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
171 | gtk_toggle_button_get_active(toggle)); |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
172 | } |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
173 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
174 | static void |
| 15884 | 175 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
176 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
177 | { |
| 7386 | 178 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 179 | } |
| 180 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
181 | static gboolean |
| 15884 | 182 | plugin_load(PurplePlugin *plugin) |
| 4390 | 183 | { |
| 15884 | 184 | PurpleConversation *conv; |
| 4390 | 185 | GList *l; |
| 186 | ||
| 15884 | 187 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 188 | conv = (PurpleConversation *)l->data; | |
| 4390 | 189 | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
190 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 191 | continue; |
| 192 | ||
| 193 | attach_signals(conv); | |
| 194 | } | |
| 195 | ||
| 15884 | 196 | purple_signal_connect(purple_conversations_get_handle(), |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
197 | "conversation-created", |
| 15884 | 198 | plugin, PURPLE_CALLBACK(new_conv_cb), NULL); |
| 4390 | 199 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
200 | return TRUE; |
| 4390 | 201 | } |
| 202 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
203 | static gboolean |
| 15884 | 204 | plugin_unload(PurplePlugin *plugin) |
| 4390 | 205 | { |
| 15884 | 206 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
207 | PidginConversation *gtkconv; |
| 4390 | 208 | GList *l; |
| 209 | ||
| 15884 | 210 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 211 | conv = (PurpleConversation *)l->data; | |
| 4390 | 212 | |
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
213 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 214 | continue; |
| 215 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
216 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 217 | |
| 218 | gstroke_cleanup(gtkconv->imhtml); | |
|
12667
1677da671689
[gaim-migrate @ 15010]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
219 | gstroke_disable(gtkconv->imhtml); |
| 4390 | 220 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
221 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
222 | return TRUE; |
| 4390 | 223 | } |
| 224 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
225 | static GtkWidget * |
| 15884 | 226 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 227 | { |
| 228 | GtkWidget *ret; | |
| 229 | GtkWidget *vbox; | |
| 230 | GtkWidget *toggle; | |
| 231 | #if 0 | |
| 232 | GtkWidget *opt; | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
233 | #if GTK_CHECK_VERSION(2,4,0) |
| 4390 | 234 | GtkWidget *menu, *item; |
| 235 | #endif | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
236 | #endif |
| 4390 | 237 | |
| 238 | /* Outside container */ | |
| 239 | ret = gtk_vbox_new(FALSE, 18); | |
| 240 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 241 | ||
| 242 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
243 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 244 | |
| 245 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
246 | #if GTK_CHECK_VERSION(2,4,0) |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
247 | /* 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
|
248 | 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
|
249 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
250 | 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
|
251 | 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
|
252 | 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
|
253 | 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
|
254 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
255 | 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
|
256 | 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
|
257 | 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
|
258 | #else |
| 4390 | 259 | /* Mouse button drop-down menu */ |
| 260 | menu = gtk_menu_new(); | |
| 261 | opt = gtk_option_menu_new(); | |
| 262 | ||
| 263 | item = gtk_menu_item_new_with_label(_("Middle mouse button")); | |
| 264 | g_signal_connect(G_OBJECT(item), "activate", | |
| 265 | G_CALLBACK(mouse_button_menu_cb), opt); | |
| 266 | gtk_menu_append(menu, item); | |
| 267 | ||
| 268 | item = gtk_menu_item_new_with_label(_("Right mouse button")); | |
| 269 | g_signal_connect(G_OBJECT(item), "activate", | |
| 270 | G_CALLBACK(mouse_button_menu_cb), opt); | |
| 271 | gtk_menu_append(menu, item); | |
| 272 | ||
| 273 | gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); | |
| 274 | gtk_option_menu_set_menu(GTK_OPTION_MENU(opt), menu); | |
| 275 | gtk_option_menu_set_history(GTK_OPTION_MENU(opt), | |
| 276 | gstroke_get_mouse_button() - 2); | |
| 277 | #endif | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
278 | #endif |
| 4390 | 279 | |
| 280 | /* "Visual gesture display" checkbox */ | |
| 281 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 282 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 283 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 284 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 285 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 286 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 287 | ||
| 288 | gtk_widget_show_all(ret); | |
| 289 | ||
| 290 | return ret; | |
| 291 | } | |
| 292 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
293 | static PidginPluginUiInfo ui_info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
294 | { |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
295 | 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
|
296 | 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
|
297 | |
|
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
|
298 | /* 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
|
299 | 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
|
300 | 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
|
301 | 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
|
302 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
303 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
304 | |
| 15884 | 305 | static PurplePluginInfo info = |
| 4390 | 306 | { |
| 15884 | 307 | PURPLE_PLUGIN_MAGIC, |
| 308 | PURPLE_MAJOR_VERSION, | |
| 309 | PURPLE_MINOR_VERSION, | |
| 310 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
311 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
312 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
313 | NULL, /**< dependencies */ |
| 15884 | 314 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 4390 | 315 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
316 | GESTURES_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
317 | N_("Mouse Gestures"), /**< name */ |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
318 | DISPLAY_VERSION, /**< version */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
319 | /** summary */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
320 | N_("Provides support for mouse gestures"), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
321 | /** 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
|
322 | 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
|
323 | "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
|
324 | " • 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
|
325 | " • 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
|
326 | "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
|
327 | " • 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
|
328 | "conversation."), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
329 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ |
| 15884 | 330 | PURPLE_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
331 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
332 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
333 | plugin_unload, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
334 | NULL, /**< destroy */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
335 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
336 | &ui_info, /**< ui_info */ |
| 8993 | 337 | NULL, /**< extra_info */ |
| 338 | 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
|
339 | 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
|
340 | |
|
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
|
341 | /* 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
|
342 | 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
|
343 | 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
|
344 | NULL, |
| 8993 | 345 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
346 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
347 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
348 | static void |
| 15884 | 349 | init_plugin(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
350 | { |
| 15884 | 351 | purple_prefs_add_none("/plugins/gtk"); |
| 352 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 353 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 354 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
355 | |
| 15884 | 356 | purple_prefs_connect_callback(plugin, "/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
357 | visual_pref_cb, NULL); |
| 4390 | 358 | } |
| 359 | ||
| 15884 | 360 | PURPLE_INIT_PLUGIN(gestures, init_plugin, info) |