Fri, 11 Apr 2008 21:51:51 +0000
Massage some plugin metadata to look better with the fixed up description pane.
| 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 | #if GTK_CHECK_VERSION(2,2,0) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
61 | count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(win->notebook)); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
62 | #else |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
63 | count = g_list_length(GTK_NOTEBOOK(win->notebook)->children); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
64 | #endif |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
65 | current = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook)); |
|
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 | if (dir == GTK_DIR_LEFT) |
|
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 | 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 | else if (dir == GTK_DIR_RIGHT) |
|
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 | if (current == count - 1) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
74 | gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
75 | else |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
76 | 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
|
77 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
78 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
79 | |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
80 | static void |
| 4390 | 81 | stroke_prev_tab(GtkWidget *widget, void *data) |
| 82 | { | |
| 15884 | 83 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
84 | PidginConversation *gtkconv; |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
85 | PidginWindow *win; |
| 4390 | 86 | |
| 15884 | 87 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
88 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 89 | win = gtkconv->win; |
| 4390 | 90 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
91 | switch_page(win, GTK_DIR_LEFT); |
| 4390 | 92 | } |
| 93 | ||
| 94 | static void | |
| 95 | stroke_next_tab(GtkWidget *widget, void *data) | |
| 96 | { | |
| 15884 | 97 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
98 | PidginWindow *win; |
| 4390 | 99 | |
| 15884 | 100 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
101 | win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 102 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
103 | switch_page(win, GTK_DIR_RIGHT); |
| 4390 | 104 | } |
| 105 | ||
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11592
diff
changeset
|
106 | static void |
| 4390 | 107 | stroke_new_win(GtkWidget *widget, void *data) |
| 108 | { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
109 | PidginWindow *new_win, *old_win; |
| 15884 | 110 | PurpleConversation *conv; |
| 4390 | 111 | |
| 15884 | 112 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
113 | old_win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 114 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
115 | if (pidgin_conv_window_get_gtkconv_count(old_win) <= 1) |
| 4390 | 116 | return; |
| 117 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
118 | new_win = pidgin_conv_window_new(); |
| 4390 | 119 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
120 | 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
|
121 | pidgin_conv_window_add_gtkconv(new_win, PIDGIN_CONVERSATION(conv)); |
| 4390 | 122 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
123 | pidgin_conv_window_show(new_win); |
| 4390 | 124 | } |
| 125 | ||
| 126 | static void | |
| 15884 | 127 | attach_signals(PurpleConversation *conv) |
| 4390 | 128 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
129 | PidginConversation *gtkconv; |
| 4390 | 130 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
131 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 132 | |
| 133 | gstroke_enable(gtkconv->imhtml); | |
| 134 | gstroke_signal_connect(gtkconv->imhtml, "14789", stroke_close, conv); | |
| 135 | gstroke_signal_connect(gtkconv->imhtml, "1456", stroke_close, conv); | |
|
5016
0e42e5f25880
[gaim-migrate @ 5352]
Christian Hammond <chipx86@chipx86.com>
parents:
4843
diff
changeset
|
136 | gstroke_signal_connect(gtkconv->imhtml, "1489", stroke_close, conv); |
| 4390 | 137 | gstroke_signal_connect(gtkconv->imhtml, "74123", stroke_next_tab, conv); |
| 138 | gstroke_signal_connect(gtkconv->imhtml, "7456", stroke_next_tab, conv); | |
| 139 | gstroke_signal_connect(gtkconv->imhtml, "96321", stroke_prev_tab, conv); | |
| 140 | gstroke_signal_connect(gtkconv->imhtml, "9654", stroke_prev_tab, conv); | |
| 141 | gstroke_signal_connect(gtkconv->imhtml, "25852", stroke_new_win, conv); | |
| 142 | } | |
| 143 | ||
| 144 | static void | |
| 15884 | 145 | new_conv_cb(PurpleConversation *conv) |
| 4390 | 146 | { |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
147 | if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
148 | attach_signals(conv); |
| 4390 | 149 | } |
| 150 | ||
| 151 | #if 0 | |
| 152 | static void | |
| 153 | mouse_button_menu_cb(GtkMenuItem *item, gpointer data) | |
| 154 | { | |
| 155 | int button = (int)data; | |
| 156 | ||
| 157 | gstroke_set_mouse_button(button + 2); | |
| 158 | } | |
| 159 | #endif | |
| 160 | ||
| 161 | static void | |
| 162 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 163 | { | |
| 15884 | 164 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
165 | gtk_toggle_button_get_active(toggle)); |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
166 | } |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
167 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
168 | static void |
| 15884 | 169 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
170 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
171 | { |
| 7386 | 172 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 173 | } |
| 174 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
175 | static gboolean |
| 15884 | 176 | plugin_load(PurplePlugin *plugin) |
| 4390 | 177 | { |
| 15884 | 178 | PurpleConversation *conv; |
| 4390 | 179 | GList *l; |
| 180 | ||
| 15884 | 181 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 182 | conv = (PurpleConversation *)l->data; | |
| 4390 | 183 | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
184 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 185 | continue; |
| 186 | ||
| 187 | attach_signals(conv); | |
| 188 | } | |
| 189 | ||
| 15884 | 190 | purple_signal_connect(purple_conversations_get_handle(), |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
191 | "conversation-created", |
| 15884 | 192 | plugin, PURPLE_CALLBACK(new_conv_cb), NULL); |
| 4390 | 193 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
194 | return TRUE; |
| 4390 | 195 | } |
| 196 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
197 | static gboolean |
| 15884 | 198 | plugin_unload(PurplePlugin *plugin) |
| 4390 | 199 | { |
| 15884 | 200 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
201 | PidginConversation *gtkconv; |
| 4390 | 202 | GList *l; |
| 203 | ||
| 15884 | 204 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 205 | conv = (PurpleConversation *)l->data; | |
| 4390 | 206 | |
|
15692
ecda27df58b9
Some more pidgininfication
Daniel Atallah <datallah@pidgin.im>
parents:
15577
diff
changeset
|
207 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 208 | continue; |
| 209 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
210 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 211 | |
| 212 | gstroke_cleanup(gtkconv->imhtml); | |
|
12667
1677da671689
[gaim-migrate @ 15010]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
213 | gstroke_disable(gtkconv->imhtml); |
| 4390 | 214 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
215 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
216 | return TRUE; |
| 4390 | 217 | } |
| 218 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
219 | static GtkWidget * |
| 15884 | 220 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 221 | { |
| 222 | GtkWidget *ret; | |
| 223 | GtkWidget *vbox; | |
| 224 | GtkWidget *toggle; | |
| 225 | #if 0 | |
| 226 | GtkWidget *opt; | |
| 227 | GtkWidget *menu, *item; | |
| 228 | #endif | |
| 229 | ||
| 230 | /* Outside container */ | |
| 231 | ret = gtk_vbox_new(FALSE, 18); | |
| 232 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 233 | ||
| 234 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
235 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 236 | |
| 237 | #if 0 | |
| 238 | /* Mouse button drop-down menu */ | |
| 239 | menu = gtk_menu_new(); | |
| 240 | opt = gtk_option_menu_new(); | |
| 241 | ||
| 242 | item = gtk_menu_item_new_with_label(_("Middle mouse button")); | |
| 243 | g_signal_connect(G_OBJECT(item), "activate", | |
| 244 | G_CALLBACK(mouse_button_menu_cb), opt); | |
| 245 | gtk_menu_append(menu, item); | |
| 246 | ||
| 247 | item = gtk_menu_item_new_with_label(_("Right mouse button")); | |
| 248 | g_signal_connect(G_OBJECT(item), "activate", | |
| 249 | G_CALLBACK(mouse_button_menu_cb), opt); | |
| 250 | gtk_menu_append(menu, item); | |
| 251 | ||
| 252 | gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); | |
| 253 | gtk_option_menu_set_menu(GTK_OPTION_MENU(opt), menu); | |
| 254 | gtk_option_menu_set_history(GTK_OPTION_MENU(opt), | |
| 255 | gstroke_get_mouse_button() - 2); | |
| 256 | #endif | |
| 257 | ||
| 258 | /* "Visual gesture display" checkbox */ | |
| 259 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 260 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 261 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 262 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 263 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 264 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 265 | ||
| 266 | gtk_widget_show_all(ret); | |
| 267 | ||
| 268 | return ret; | |
| 269 | } | |
| 270 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
271 | static PidginPluginUiInfo ui_info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
272 | { |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12323
diff
changeset
|
273 | 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
|
274 | 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
|
275 | |
|
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
|
276 | /* 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
|
277 | 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
|
278 | 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
|
279 | 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
|
280 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
281 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
282 | |
| 15884 | 283 | static PurplePluginInfo info = |
| 4390 | 284 | { |
| 15884 | 285 | PURPLE_PLUGIN_MAGIC, |
| 286 | PURPLE_MAJOR_VERSION, | |
| 287 | PURPLE_MINOR_VERSION, | |
| 288 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
289 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
290 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
291 | NULL, /**< dependencies */ |
| 15884 | 292 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 4390 | 293 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
294 | GESTURES_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
295 | N_("Mouse Gestures"), /**< name */ |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
296 | DISPLAY_VERSION, /**< version */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
297 | /** summary */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
298 | N_("Provides support for mouse gestures"), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
299 | /** 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
|
300 | 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
|
301 | "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
|
302 | " • 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
|
303 | " • 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
|
304 | "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
|
305 | " • 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
|
306 | "conversation."), |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
307 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ |
| 15884 | 308 | PURPLE_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
309 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
310 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
311 | plugin_unload, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
312 | NULL, /**< destroy */ |
|
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 | &ui_info, /**< ui_info */ |
| 8993 | 315 | NULL, /**< extra_info */ |
| 316 | 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
|
317 | 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
|
318 | |
|
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
|
319 | /* 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
|
320 | 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
|
321 | 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
|
322 | NULL, |
| 8993 | 323 | NULL |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
324 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
325 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
326 | static void |
| 15884 | 327 | init_plugin(PurplePlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
328 | { |
| 15884 | 329 | purple_prefs_add_none("/plugins/gtk"); |
| 330 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 331 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 332 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
333 | |
| 15884 | 334 | purple_prefs_connect_callback(plugin, "/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
335 | visual_pref_cb, NULL); |
| 4390 | 336 | } |
| 337 | ||
| 15884 | 338 | PURPLE_INIT_PLUGIN(gestures, init_plugin, info) |