Sun, 20 Oct 2013 15:11:49 +0530
Changed dox files to xml files for gtk-doc, and included them in the top-level XMLs.
The contents of the xml files mostly still need to be refactored.
| 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 | |
|
32585
382b9c2150cf
Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
51 | gstroke_cleanup(gtkconv->webview); |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34655
diff
changeset
|
52 | g_object_unref(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 | |
|
32585
382b9c2150cf
Fix the gestures plugin, which really only needed a widget from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29741
diff
changeset
|
129 | gstroke_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
|
130 | 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
|
131 | 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
|
132 | 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
|
133 | 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
|
134 | 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
|
135 | 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
|
136 | 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
|
137 | gstroke_signal_connect(gtkconv->webview, "25852", stroke_new_win, conv); |
| 4390 | 138 | } |
| 139 | ||
| 140 | static void | |
| 15884 | 141 | new_conv_cb(PurpleConversation *conv) |
| 4390 | 142 | { |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
143 | if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
144 | attach_signals(conv); |
| 4390 | 145 | } |
| 146 | ||
| 147 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
148 | static void |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
149 | mouse_button_menu_cb(GtkComboBox *opt, gpointer data) |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
150 | { |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
151 | int button = gtk_combo_box_get_active(opt); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
152 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
153 | gstroke_set_mouse_button(button + 2); |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
154 | } |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
155 | #endif |
| 4390 | 156 | |
| 157 | static void | |
| 158 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 159 | { | |
| 15884 | 160 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
161 | gtk_toggle_button_get_active(toggle)); |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
162 | } |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
163 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
164 | static void |
| 15884 | 165 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
166 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
167 | { |
| 7386 | 168 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 169 | } |
| 170 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
171 | static GtkWidget * |
| 15884 | 172 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 173 | { |
| 174 | GtkWidget *ret; | |
| 175 | GtkWidget *vbox; | |
| 176 | GtkWidget *toggle; | |
| 177 | #if 0 | |
| 178 | GtkWidget *opt; | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
179 | #endif |
| 4390 | 180 | |
| 181 | /* Outside container */ | |
| 182 | ret = gtk_vbox_new(FALSE, 18); | |
| 183 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 184 | ||
| 185 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
186 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 187 | |
| 188 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
189 | /* 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
|
190 | 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
|
191 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
192 | 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
|
193 | 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
|
194 | 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
|
195 | 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
|
196 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
197 | 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
|
198 | 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
|
199 | 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
|
200 | #endif |
| 4390 | 201 | |
| 202 | /* "Visual gesture display" checkbox */ | |
| 203 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 204 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 205 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 206 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 207 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 208 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 209 | ||
| 210 | gtk_widget_show_all(ret); | |
| 211 | ||
| 212 | return ret; | |
| 213 | } | |
| 214 | ||
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
215 | static PidginPluginInfo * |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
216 | plugin_query(GError **error) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
217 | { |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
218 | const gchar * const authors[] = { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
219 | "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
|
220 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
221 | }; |
| 4390 | 222 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
223 | return pidgin_plugin_info_new( |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
224 | "id", GESTURES_PLUGIN_ID, |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
225 | "name", N_("Mouse Gestures"), |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
226 | "version", DISPLAY_VERSION, |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
227 | "category", N_("User interface"), |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
228 | "summary", N_("Provides support for mouse gestures"), |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
229 | "description", N_("Allows support for mouse gestures in " |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
230 | "conversation windows. Drag the middle " |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
231 | "mouse button to perform certain actions:\n" |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
232 | " • Drag down and then to the right to " |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
233 | "close a conversation.\n" |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
234 | " • Drag up and then to the left to switch " |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
235 | "to the previous conversation.\n" |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
236 | " • Drag up and then to the right to switch " |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
237 | "to the next conversation."), |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
238 | "authors", authors, |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
239 | "website", PURPLE_WEBSITE, |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
240 | "abi-version", PURPLE_ABI_VERSION, |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
241 | "pidgin-config-frame", get_config_frame, |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
242 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
243 | ); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
244 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
245 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
246 | static gboolean |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
247 | 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
|
248 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
249 | PurpleConversation *conv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
250 | 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
|
251 | |
| 15884 | 252 | purple_prefs_add_none("/plugins/gtk"); |
| 253 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 254 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 255 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
256 | |
| 15884 | 257 | purple_prefs_connect_callback(plugin, "/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
258 | visual_pref_cb, NULL); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
259 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
260 | for (l = purple_conversations_get_all(); l != NULL; l = l->next) { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
261 | conv = (PurpleConversation *)l->data; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
262 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
263 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
264 | continue; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
265 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
266 | attach_signals(conv); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
267 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
268 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
269 | purple_signal_connect(purple_conversations_get_handle(), |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
270 | "conversation-created", |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
271 | plugin, PURPLE_CALLBACK(new_conv_cb), NULL); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
272 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
273 | return TRUE; |
| 4390 | 274 | } |
| 275 | ||
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
276 | static gboolean |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
277 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
278 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
279 | PurpleConversation *conv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
280 | PidginConversation *gtkconv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
281 | GList *l; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
282 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
283 | for (l = purple_conversations_get_all(); l != NULL; l = l->next) { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
284 | conv = (PurpleConversation *)l->data; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
285 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
286 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
287 | continue; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
288 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
289 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
290 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
291 | gstroke_cleanup(gtkconv->webview); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
292 | gstroke_disable(gtkconv->webview); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
293 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
294 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
295 | return TRUE; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
296 | } |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
297 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
298 | PURPLE_PLUGIN_INIT(gestures, plugin_query, plugin_load, plugin_unload); |