Thu, 06 Aug 2020 22:22:03 -0500
pidgin.h phase3: create pidgin.h and force its usage
fix the section id of pidgincore.h
Generate our pidgin.h file
Add include guard to all pidgin/*.h files and deal with the fallout from that.
Also had to namespace PIDGIN_BLIST_COLUMN_NAME, will come back and get the rest at a later time.
Testing Done:
Compile test, including some plugins that don't build by default. Also ran everything seems fine.
Reviewed at https://reviews.imfreedom.org/r/50/
| 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 | */ |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
21 | |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
22 | #include <glib/gi18n-lib.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
23 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
24 | #include <purple.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5767
diff
changeset
|
25 | |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40497
diff
changeset
|
26 | #include <pidgin.h> |
| 4390 | 27 | |
| 28 | #include "gstroke.h" | |
| 29 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6225
diff
changeset
|
30 | #define GESTURES_PLUGIN_ID "gtk-x11-gestures" |
| 4390 | 31 | |
| 32 | static void | |
| 33 | stroke_close(GtkWidget *widget, void *data) | |
| 34 | { | |
| 15884 | 35 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
36 | PidginConversation *gtkconv; |
| 4390 | 37 | |
| 15884 | 38 | conv = (PurpleConversation *)data; |
| 4390 | 39 | |
| 40 | /* Double-check */ | |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
41 | if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
| 4390 | 42 | return; |
| 43 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
44 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 45 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
46 | gstroke_cleanup(gtkconv->history); |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34655
diff
changeset
|
47 | g_object_unref(conv); |
| 4390 | 48 | } |
| 49 | ||
| 50 | 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
|
51 | switch_page(PidginConvWindow *win, GtkDirectionType dir) |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
52 | { |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
53 | int count, current; |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
54 | |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
55 | count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(win->notebook)); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
56 | current = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook)); |
|
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 | if (dir == GTK_DIR_LEFT) |
|
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 | 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
|
61 | } |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
62 | else if (dir == GTK_DIR_RIGHT) |
|
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 (current == count - 1) |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
65 | gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook), 0); |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
66 | else |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
67 | 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
|
68 | } |
|
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 | |
|
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
71 | static void |
| 4390 | 72 | stroke_prev_tab(GtkWidget *widget, void *data) |
| 73 | { | |
| 15884 | 74 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
75 | 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
|
76 | PidginConvWindow *win; |
| 4390 | 77 | |
| 15884 | 78 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
79 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 11581 | 80 | win = gtkconv->win; |
| 4390 | 81 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
82 | switch_page(win, GTK_DIR_LEFT); |
| 4390 | 83 | } |
| 84 | ||
| 85 | static void | |
| 86 | stroke_next_tab(GtkWidget *widget, void *data) | |
| 87 | { | |
| 15884 | 88 | 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
|
89 | PidginConvWindow *win; |
| 4390 | 90 | |
| 15884 | 91 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
92 | win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 93 | |
|
12912
fdad9199a6e8
[gaim-migrate @ 15265]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12816
diff
changeset
|
94 | switch_page(win, GTK_DIR_RIGHT); |
| 4390 | 95 | } |
| 96 | ||
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11592
diff
changeset
|
97 | static void |
| 4390 | 98 | stroke_new_win(GtkWidget *widget, void *data) |
| 99 | { | |
|
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
|
100 | PidginConvWindow *new_win, *old_win; |
| 15884 | 101 | PurpleConversation *conv; |
| 4390 | 102 | |
| 15884 | 103 | conv = (PurpleConversation *)data; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
104 | old_win = PIDGIN_CONVERSATION(conv)->win; |
| 4390 | 105 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
106 | if (pidgin_conv_window_get_gtkconv_count(old_win) <= 1) |
| 4390 | 107 | return; |
| 108 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
109 | new_win = pidgin_conv_window_new(); |
| 4390 | 110 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
111 | 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
|
112 | pidgin_conv_window_add_gtkconv(new_win, PIDGIN_CONVERSATION(conv)); |
| 4390 | 113 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
114 | pidgin_conv_window_show(new_win); |
| 4390 | 115 | } |
| 116 | ||
| 117 | static void | |
| 15884 | 118 | attach_signals(PurpleConversation *conv) |
| 4390 | 119 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
120 | PidginConversation *gtkconv; |
| 4390 | 121 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
122 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 4390 | 123 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
124 | gstroke_enable(gtkconv->history); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
125 | gstroke_signal_connect(gtkconv->history, "14789", stroke_close, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
126 | gstroke_signal_connect(gtkconv->history, "1456", stroke_close, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
127 | gstroke_signal_connect(gtkconv->history, "1489", stroke_close, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
128 | gstroke_signal_connect(gtkconv->history, "74123", stroke_next_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
129 | gstroke_signal_connect(gtkconv->history, "7456", stroke_next_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
130 | gstroke_signal_connect(gtkconv->history, "96321", stroke_prev_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
131 | gstroke_signal_connect(gtkconv->history, "9654", stroke_prev_tab, conv); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
132 | gstroke_signal_connect(gtkconv->history, "25852", stroke_new_win, conv); |
| 4390 | 133 | } |
| 134 | ||
| 135 | static void | |
| 15884 | 136 | new_conv_cb(PurpleConversation *conv) |
| 4390 | 137 | { |
|
15705
6ea0a722c797
Looks like someone had a sed accident
Sean Egan <seanegan@pidgin.im>
parents:
15692
diff
changeset
|
138 | if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
139 | attach_signals(conv); |
| 4390 | 140 | } |
| 141 | ||
| 142 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
143 | static void |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
144 | 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
|
145 | { |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
146 | 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
|
147 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
148 | 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
|
149 | } |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
150 | #endif |
| 4390 | 151 | |
| 152 | static void | |
| 153 | toggle_draw_cb(GtkToggleButton *toggle, gpointer data) | |
| 154 | { | |
| 15884 | 155 | purple_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
156 | gtk_toggle_button_get_active(toggle)); |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
157 | } |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
158 | |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
159 | static void |
| 15884 | 160 | visual_pref_cb(const char *name, PurplePrefType type, gconstpointer value, |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
161 | gpointer data) |
|
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
162 | { |
| 7386 | 163 | gstroke_set_draw_strokes((gboolean) GPOINTER_TO_INT(value) ); |
| 4390 | 164 | } |
| 165 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
166 | static GtkWidget * |
| 15884 | 167 | get_config_frame(PurplePlugin *plugin) |
| 4390 | 168 | { |
| 169 | GtkWidget *ret; | |
| 170 | GtkWidget *vbox; | |
| 171 | GtkWidget *toggle; | |
| 172 | #if 0 | |
| 173 | GtkWidget *opt; | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
174 | #endif |
| 4390 | 175 | |
| 176 | /* Outside container */ | |
|
35526
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35037
diff
changeset
|
177 | ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18); |
| 4390 | 178 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
| 179 | ||
| 180 | /* Configuration frame */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
181 | vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); |
| 4390 | 182 | |
| 183 | #if 0 | |
|
29741
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
184 | /* 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
|
185 | 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
|
186 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
187 | 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
|
188 | 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
|
189 | 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
|
190 | 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
|
191 | |
|
3fbd100877f9
Pull in GtkComboBox changes from GTK+3 branch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29499
diff
changeset
|
192 | 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
|
193 | 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
|
194 | 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
|
195 | #endif |
| 4390 | 196 | |
| 197 | /* "Visual gesture display" checkbox */ | |
| 198 | toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); | |
| 199 | gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
| 200 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
| 15884 | 201 | purple_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 4390 | 202 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 203 | G_CALLBACK(toggle_draw_cb), NULL); | |
| 204 | ||
| 205 | gtk_widget_show_all(ret); | |
| 206 | ||
| 207 | return ret; | |
| 208 | } | |
| 209 | ||
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
210 | static GPluginPluginInfo * |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
211 | plugin_query(GError **error) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
212 | { |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
213 | const gchar * const authors[] = { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
214 | "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
|
215 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
216 | }; |
| 4390 | 217 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
218 | return gplugin_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
|
219 | "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
|
220 | "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
|
221 | "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
|
222 | "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
|
223 | "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
|
224 | "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
|
225 | "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
|
226 | "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
|
227 | "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
|
228 | " • 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
|
229 | "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
|
230 | " • 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
|
231 | "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
|
232 | " • 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
|
233 | "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
|
234 | "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
|
235 | "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
|
236 | "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
|
237 | "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
|
238 | NULL |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
239 | ); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
240 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5016
diff
changeset
|
241 | |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
242 | static gboolean |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
243 | 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
|
244 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
245 | PurpleConversation *conv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
246 | 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
|
247 | |
| 15884 | 248 | purple_prefs_add_none("/plugins/gtk"); |
| 249 | purple_prefs_add_none("/plugins/gtk/X11"); | |
| 250 | purple_prefs_add_none("/plugins/gtk/X11/gestures"); | |
| 251 | purple_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); | |
|
5767
8ae2df3826e8
[gaim-migrate @ 6192]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
252 | |
|
35539
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
253 | purple_prefs_connect_callback(plugin, |
|
c3c490f4f611
Gestures plugin: fix loading settings at startup
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
254 | "/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
|
255 | 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
|
256 | "/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
|
257 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
258 | 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
|
259 | conv = (PurpleConversation *)l->data; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
260 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
261 | 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
|
262 | continue; |
|
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 | attach_signals(conv); |
|
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 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
267 | 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
|
268 | "conversation-created", |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
269 | 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
|
270 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
271 | return TRUE; |
| 4390 | 272 | } |
| 273 | ||
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
274 | static gboolean |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
275 | 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
|
276 | { |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
277 | PurpleConversation *conv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
278 | PidginConversation *gtkconv; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
279 | GList *l; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
280 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
281 | 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
|
282 | conv = (PurpleConversation *)l->data; |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
283 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
284 | 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
|
285 | continue; |
|
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 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
288 | |
|
40497
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
289 | gstroke_cleanup(gtkconv->history); |
|
2f45a03838e9
Fix gestures plugin
Elliott S <quantum.analyst@gmail.com>
parents:
40360
diff
changeset
|
290 | gstroke_disable(gtkconv->history); |
|
36754
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
291 | } |
|
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 | return TRUE; |
|
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 | |
|
8250d6be8c02
Started refactoring pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
296 | PURPLE_PLUGIN_INIT(gestures, plugin_query, plugin_load, plugin_unload); |