Thu, 06 Oct 2016 10:07:48 -0400
Merge with provide-uri-handler-desktop-file
| 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 | |
|
35526
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35037
diff
changeset
|
29 | #include "gtk3compat.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
30 | #include "gtkconv.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
31 | #include "gtkplugin.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
32 | #include "gtkutils.h" |
| 4390 | 33 | |
| 34 | #include "gstroke.h" | |
| 35 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6225
diff
changeset
|
36 | #define GESTURES_PLUGIN_ID "gtk-x11-gestures" |
| 4390 | 37 | |
| 38 | static void | |
| 39 | stroke_close(GtkWidget *widget, void *data) | |
| 40 | { | |
| 15884 | 41 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
42 | PidginConversation *gtkconv; |
| 4390 | 43 | |
| 15884 | 44 | conv = (PurpleConversation *)data; |
| 4390 | 45 | |
| 46 | /* Double-check */ | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
47 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 48 | return; |
| 49 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
50 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 51 | |
|
32585
382b9c2150cf
Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
52 | gstroke_cleanup(gtkconv->webview); |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34655
diff
changeset
|
53 | g_object_unref(conv); |
| 4390 | 54 | } |
| 55 | ||
| 56 | 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
|
57 | switch_page(PidginConvWindow *win, GtkDirectionType dir) |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
58 | { |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
59 | int count, current; |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
60 | |
|
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 | current = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook)); |
|
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 | if (dir == GTK_DIR_LEFT) |
|
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 | 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
|
67 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
68 | else if (dir == GTK_DIR_RIGHT) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
69 | { |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
70 | if (current == count - 1) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
71 | gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
72 | else |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
73 | 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
|
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 | |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
77 | static void |
| 4390 | 78 | stroke_prev_tab(GtkWidget *widget, void *data) |
| 79 | { | |
| 15884 | 80 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
81 | 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
|
82 | PidginConvWindow *win; |
| 4390 | 83 | |
| 15884 | 84 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
85 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 86 | win = gtkconv->win; |
| 4390 | 87 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
88 | switch_page(win, GTK_DIR_LEFT); |
| 4390 | 89 | } |
| 90 | ||
| 91 | static void | |
| 92 | stroke_next_tab(GtkWidget *widget, void *data) | |
| 93 | { | |
| 15884 | 94 | 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
|
95 | PidginConvWindow *win; |
| 4390 | 96 | |
| 15884 | 97 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
98 | win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 99 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
100 | switch_page(win, GTK_DIR_RIGHT); |
| 4390 | 101 | } |
| 102 | ||
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11592
diff
changeset
|
103 | static void |
| 4390 | 104 | stroke_new_win(GtkWidget *widget, void *data) |
| 105 | { | |
|
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
|
106 | PidginConvWindow *new_win, *old_win; |
| 15884 | 107 | PurpleConversation *conv; |
| 4390 | 108 | |
| 15884 | 109 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
110 | old_win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 111 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
112 | if (pidgin_conv_window_get_gtkconv_count(old_win) <= 1) |
| 4390 | 113 | return; |
| 114 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
115 | new_win = pidgin_conv_window_new(); |
| 4390 | 116 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
117 | 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
|
118 | pidgin_conv_window_add_gtkconv(new_win, PIDGIN_CONVERSATION(conv)); |
| 4390 | 119 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
120 | pidgin_conv_window_show(new_win); |
| 4390 | 121 | } |
| 122 | ||
| 123 | static void | |
| 15884 | 124 | attach_signals(PurpleConversation *conv) |
| 4390 | 125 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
126 | PidginConversation *gtkconv; |
| 4390 | 127 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
128 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 129 | |
|
32585
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_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
|
131 | 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
|
132 | 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
|
133 | 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
|
134 | 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
|
135 | 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
|
136 | 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
|
137 | 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
|
138 | gstroke_signal_connect(gtkconv->webview, "25852", stroke_new_win, conv); |
| 4390 | 139 | } |
| 140 | ||
| 141 | static void | |
| 15884 | 142 | new_conv_cb(PurpleConversation *conv) |
| 4390 | 143 | { |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
144 | if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
145 | attach_signals(conv); |
| 4390 | 146 | } |
| 147 | ||
| 148 | #if 0 | |
|
29741
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 | #endif |
| 4390 | 157 | |
| 158 | static void | |
| 159 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 160 | { | |
| 15884 | 161 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
162 | gtk_toggle_button_get_active(toggle)); |
|
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 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
165 | static void |
| 15884 | 166 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
167 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
168 | { |
| 7386 | 169 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 170 | } |
| 171 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
172 | static GtkWidget * |
| 15884 | 173 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 174 | { |
| 175 | GtkWidget *ret; | |
| 176 | GtkWidget *vbox; | |
| 177 | GtkWidget *toggle; | |
| 178 | #if 0 | |
| 179 | GtkWidget *opt; | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
180 | #endif |
| 4390 | 181 | |
| 182 | /* Outside container */ | |
|
35526
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35037
diff
changeset
|
183 | ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18); |
| 4390 | 184 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
| 185 | ||
| 186 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
187 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 188 | |
| 189 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
190 | /* 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
|
191 | 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
|
192 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
193 | 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
|
194 | 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
|
195 | 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
|
196 | 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
|
197 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
198 | 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
|
199 | 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
|
200 | 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
|
201 | #endif |
| 4390 | 202 | |
| 203 | /* "Visual gesture display" checkbox */ | |
| 204 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 205 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 206 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 207 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 208 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 209 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 210 | ||
| 211 | gtk_widget_show_all(ret); | |
| 212 | ||
| 213 | return ret; | |
| 214 | } | |
| 215 | ||
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
216 | static PidginPluginInfo * |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
217 | plugin_query(GError **error) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
218 | { |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
219 | const gchar * const authors[] = { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
220 | "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
|
221 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
222 | }; |
| 4390 | 223 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
224 | 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
|
225 | "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
|
226 | "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
|
227 | "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
|
228 | "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
|
229 | "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
|
230 | "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
|
231 | "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
|
232 | "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
|
233 | "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
|
234 | " • 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
|
235 | "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
|
236 | " • 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
|
237 | "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
|
238 | " • 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
|
239 | "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
|
240 | "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
|
241 | "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
|
242 | "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
|
243 | "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
|
244 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
245 | ); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
246 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
247 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
248 | static gboolean |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
249 | 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
|
250 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
251 | PurpleConversation *conv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
252 | 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
|
253 | |
| 15884 | 254 | purple_prefs_add_none("/plugins/gtk"); |
| 255 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 256 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 257 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
258 | |
|
35539
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
259 | purple_prefs_connect_callback(plugin, |
|
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
260 | "/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
|
261 | 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
|
262 | "/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
|
263 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
264 | 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
|
265 | conv = (PurpleConversation *)l->data; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
266 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
267 | 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
|
268 | continue; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
269 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
270 | attach_signals(conv); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
271 | } |
|
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 | 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
|
274 | "conversation-created", |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
275 | 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
|
276 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
277 | return TRUE; |
| 4390 | 278 | } |
| 279 | ||
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
280 | static gboolean |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
281 | 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
|
282 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
283 | PurpleConversation *conv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
284 | PidginConversation *gtkconv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
285 | GList *l; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
286 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
287 | 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
|
288 | conv = (PurpleConversation *)l->data; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
289 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
290 | 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
|
291 | continue; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
292 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
293 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
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 | gstroke_cleanup(gtkconv->webview); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
296 | gstroke_disable(gtkconv->webview); |
|
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 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
299 | return TRUE; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
300 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
301 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
302 | PURPLE_PLUGIN_INIT(gestures, plugin_query, plugin_load, plugin_unload); |