Sun, 09 Sep 2012 23:12:41 -0400
Workaround WebKit API bug.
| 5212 | 1 | /** |
| 2 | * @file gtkdebug.c GTK+ Debug API | |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16123
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 5212 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
11 | * |
| 5212 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * 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:
19065
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5212 | 25 | */ |
| 9791 | 26 | #include "internal.h" |
| 15577 | 27 | #include "pidgin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
28 | |
|
9480
b4d46aa1be7d
[gaim-migrate @ 10305]
Mark Doliner <markdoliner@pidgin.im>
parents:
8953
diff
changeset
|
29 | #include "notify.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
30 | #include "prefs.h" |
| 8953 | 31 | #include "request.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
32 | #include "util.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
33 | |
| 5212 | 34 | #include "gtkdebug.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9504
diff
changeset
|
35 | #include "gtkdialogs.h" |
| 8953 | 36 | #include "gtkutils.h" |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
37 | #include "gtkwebview.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
38 | #include "pidginstock.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
39 | |
|
11473
38b35dc600ce
[gaim-migrate @ 13714]
Gary Kramlich <grim@reaperworld.com>
parents:
11450
diff
changeset
|
40 | #include <gdk/gdkkeysyms.h> |
|
38b35dc600ce
[gaim-migrate @ 13714]
Gary Kramlich <grim@reaperworld.com>
parents:
11450
diff
changeset
|
41 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33167
diff
changeset
|
42 | #include "gtk3compat.h" |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33167
diff
changeset
|
43 | |
| 5212 | 44 | typedef struct |
| 45 | { | |
| 46 | GtkWidget *window; | |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
47 | GtkWidget *text; |
|
33092
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
48 | GtkWidget *filter; |
|
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
49 | GtkWidget *expression; |
|
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
50 | GtkWidget *filterlevel; |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
51 | |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
52 | gboolean paused; |
| 5212 | 53 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
54 | gboolean invert; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
55 | gboolean highlight; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
56 | guint timer; |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
57 | GRegex *regex; |
| 5212 | 58 | } DebugWindow; |
| 59 | ||
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
60 | #define EMPTY_HTML \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
61 | "<html><head><style>" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
62 | "body{white-space:pre-wrap;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
63 | "div.l0{color:#000000;}" /* All debug levels. */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
64 | "div.l1{color:#666666;}" /* Misc. */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
65 | "div.l2{color:#000000;}" /* Information. */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
66 | "div.l3{color:#660000;}" /* Warnings. */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
67 | "div.l4{color:#FF0000;}" /* Errors. */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
68 | "div.l5{color:#FF0000;font-weight:bold;}" /* Fatal errors. */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
69 | /* Filter levels */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
70 | "div#pause~div{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
71 | "body.l1 div.l0{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
72 | "body.l2 div.l0,body.l2 div.l1{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
73 | "body.l3 div.l0,body.l3 div.l1,body.l3 div.l2{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
74 | "body.l4 div.l0,body.l4 div.l1,body.l4 div.l2,body.l4 div.l3{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
75 | "body.l5 div.l0,body.l5 div.l1,body.l5 div.l2,body.l5 div.l3,body.l5 div.l4{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
76 | /* Regex */ \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
77 | "div.hide{display:none;}" \ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
78 | "span.regex{background-color:#ffafaf;font-weight:bold;}" \ |
|
33111
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
79 | "</style></head><body class=l%d></body></html>" |
| 5212 | 80 | |
| 81 | static DebugWindow *debug_win = NULL; | |
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
82 | static guint debug_enabled_timer = 0; |
| 5212 | 83 | |
| 84 | static gint | |
| 85 | debug_window_destroy(GtkWidget *w, GdkEvent *event, void *unused) | |
| 86 | { | |
| 15884 | 87 | purple_prefs_disconnect_by_handle(pidgin_debug_get_handle()); |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
88 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
89 | if(debug_win->timer != 0) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
90 | const gchar *text; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
91 | |
|
26753
a8dca8faae69
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
Arunan Balasubramaniam <foss@abala.me>
parents:
26482
diff
changeset
|
92 | purple_timeout_remove(debug_win->timer); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
93 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
94 | text = gtk_entry_get_text(GTK_ENTRY(debug_win->expression)); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
95 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/debug/regex", text); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
96 | } |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
97 | g_regex_unref(debug_win->regex); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
98 | |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
99 | /* If the "Save Log" dialog is open then close it */ |
| 15884 | 100 | purple_request_close_with_handle(debug_win); |
|
5704
3170b0bd2b40
[gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
101 | |
| 5212 | 102 | g_free(debug_win); |
| 103 | debug_win = NULL; | |
| 104 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
105 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", FALSE); |
|
9480
b4d46aa1be7d
[gaim-migrate @ 10305]
Mark Doliner <markdoliner@pidgin.im>
parents:
8953
diff
changeset
|
106 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
107 | return FALSE; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
108 | } |
| 5212 | 109 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
110 | static gboolean |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
111 | configure_cb(GtkWidget *w, GdkEventConfigure *event, DebugWindow *win) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
112 | { |
|
32913
af2c726febce
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32912
diff
changeset
|
113 | if (gtk_widget_get_visible(w)) { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
114 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/width", event->width); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
115 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/height", event->height); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
116 | } |
| 5212 | 117 | |
| 118 | return FALSE; | |
| 119 | } | |
| 120 | ||
| 8953 | 121 | static void |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
122 | save_writefile_cb(void *user_data, const char *filename) |
| 8953 | 123 | { |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
124 | DebugWindow *win = (DebugWindow *)user_data; |
|
9489
3ee8fdcdbac9
[gaim-migrate @ 10314]
Mark Doliner <markdoliner@pidgin.im>
parents:
9486
diff
changeset
|
125 | FILE *fp; |
| 8953 | 126 | char *tmp; |
| 127 | ||
|
10589
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10448
diff
changeset
|
128 | if ((fp = g_fopen(filename, "w+")) == NULL) { |
| 15884 | 129 | purple_notify_error(win, NULL, _("Unable to open file."), NULL); |
| 8953 | 130 | return; |
|
9480
b4d46aa1be7d
[gaim-migrate @ 10305]
Mark Doliner <markdoliner@pidgin.im>
parents:
8953
diff
changeset
|
131 | } |
| 8953 | 132 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
133 | tmp = gtk_webview_get_body_text(GTK_WEBVIEW(win->text)); |
| 15884 | 134 | fprintf(fp, "Pidgin Debug Log : %s\n", purple_date_format_full(NULL)); |
| 8953 | 135 | fprintf(fp, "%s", tmp); |
| 136 | g_free(tmp); | |
| 137 | ||
| 138 | fclose(fp); | |
| 139 | } | |
| 140 | ||
| 141 | static void | |
| 142 | save_cb(GtkWidget *w, DebugWindow *win) | |
| 143 | { | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
144 | purple_request_file(win, _("Save Debug Log"), "purple-debug.log", TRUE, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
145 | G_CALLBACK(save_writefile_cb), NULL, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
146 | NULL, NULL, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
147 | win); |
| 8953 | 148 | } |
| 149 | ||
| 150 | static void | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
151 | clear_cb(GtkWidget *w, DebugWindow *win) |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
152 | { |
|
33111
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
153 | char *tmp; |
|
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
154 | int level; |
|
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
155 | |
|
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
156 | level = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel"); |
|
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
157 | tmp = g_strdup_printf(EMPTY_HTML, level); |
|
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
158 | gtk_webview_load_html_string(GTK_WEBVIEW(win->text), tmp); |
|
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
159 | g_free(tmp); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
160 | } |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
161 | |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
162 | static void |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
163 | pause_cb(GtkWidget *w, DebugWindow *win) |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
164 | { |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
165 | win->paused = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(w)); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
166 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
167 | if (win->paused) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
168 | gtk_webview_append_html(GTK_WEBVIEW(win->text), "<div id=pause></div>"); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
169 | } else { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
170 | WebKitDOMDocument *dom; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
171 | WebKitDOMElement *pause; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
172 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
173 | dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(win->text)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
174 | pause = webkit_dom_document_get_element_by_id(dom, "pause"); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
175 | if (pause) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
176 | WebKitDOMNode *parent; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
177 | parent = webkit_dom_node_get_parent_node(WEBKIT_DOM_NODE(pause)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
178 | webkit_dom_node_remove_child(parent, WEBKIT_DOM_NODE(pause), NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
179 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
180 | } |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
181 | } |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
182 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
183 | /****************************************************************************** |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
184 | * regex stuff |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
185 | *****************************************************************************/ |
| 11033 | 186 | static void |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
187 | regex_clear_color(GtkWidget *w) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
188 | gtk_widget_modify_base(w, GTK_STATE_NORMAL, NULL); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
189 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
190 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
191 | static void |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
192 | regex_change_color(GtkWidget *w, guint16 r, guint16 g, guint16 b) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
193 | GdkColor color; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
194 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
195 | color.red = r; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
196 | color.green = g; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
197 | color.blue = b; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
198 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
199 | gtk_widget_modify_base(w, GTK_STATE_NORMAL, &color); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
200 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
201 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
202 | static void |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
203 | regex_toggle_div(WebKitDOMNode *div) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
204 | { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
205 | WebKitDOMDOMTokenList *classes; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
206 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
207 | if (!WEBKIT_DOM_IS_HTML_ELEMENT(div)) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
208 | return; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
209 | |
|
33497
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
210 | #if (WEBKIT_MAJOR_VERSION == 1 && \ |
|
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
211 | WEBKIT_MINOR_VERSION == 9 && \ |
|
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
212 | WEBKIT_MICRO_VERSION == 90) |
|
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
213 | /* Workaround WebKit API bug. */ |
|
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
214 | classes = webkit_dom_element_get_class_list(WEBKIT_DOM_ELEMENT(div)); |
|
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
215 | #else |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
216 | classes = webkit_dom_html_element_get_class_list(WEBKIT_DOM_HTML_ELEMENT(div)); |
|
33497
6c0ecaf82229
Workaround WebKit API bug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33247
diff
changeset
|
217 | #endif |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
218 | webkit_dom_dom_token_list_toggle(classes, "hide", NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
219 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
220 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
221 | static void |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
222 | regex_highlight_clear(WebKitDOMDocument *dom) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
223 | { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
224 | WebKitDOMNodeList *nodes; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
225 | gulong i; |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
226 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
227 | /* Remove highlighting SPANs */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
228 | nodes = webkit_dom_document_get_elements_by_class_name(dom, "regex"); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
229 | i = webkit_dom_node_list_get_length(nodes); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
230 | while (i--) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
231 | WebKitDOMNode *span, *parent; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
232 | char *content; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
233 | WebKitDOMText *text; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
234 | GError *err = NULL; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
235 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
236 | span = webkit_dom_node_list_item(nodes, i); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
237 | parent = webkit_dom_node_get_parent_node(span); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
238 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
239 | content = webkit_dom_node_get_text_content(span); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
240 | text = webkit_dom_document_create_text_node(dom, content); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
241 | g_free(content); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
242 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
243 | webkit_dom_node_replace_child(parent, WEBKIT_DOM_NODE(text), span, &err); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
244 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
245 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
246 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
247 | static void |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
248 | regex_highlight_text_nodes(WebKitDOMDocument *dom, WebKitDOMNode *div, |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
249 | gint start_pos, gint end_pos) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
250 | { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
251 | GSList *data = NULL; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
252 | WebKitDOMNode *node; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
253 | WebKitDOMRange *range; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
254 | WebKitDOMElement *span; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
255 | gint ind, end_ind; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
256 | gint this_start, this_end; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
257 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
258 | ind = 0; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
259 | webkit_dom_node_normalize(div); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
260 | node = div; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
261 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
262 | /* First, find the container nodes and offsets to apply highlighting. */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
263 | do { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
264 | if (webkit_dom_node_get_node_type(node) == 3/*TEXT_NODE*/) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
265 | /* The GObject model does not correctly reflect the type, hence the |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
266 | regular cast. */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
267 | end_ind = ind + webkit_dom_character_data_get_length((WebKitDOMCharacterData*)node); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
268 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
269 | if (start_pos <= ind) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
270 | this_start = 0; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
271 | else if (start_pos < end_ind) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
272 | this_start = start_pos - ind; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
273 | else |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
274 | this_start = -1; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
275 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
276 | if (end_pos < end_ind) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
277 | this_end = end_pos - ind; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
278 | else |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
279 | this_end = end_ind - ind; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
280 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
281 | if (this_start != -1 && this_start < this_end) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
282 | data = g_slist_prepend(data, GINT_TO_POINTER(this_end)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
283 | data = g_slist_prepend(data, GINT_TO_POINTER(this_start)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
284 | data = g_slist_prepend(data, node); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
285 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
286 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
287 | ind = end_ind; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
288 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
289 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
290 | if (webkit_dom_node_has_child_nodes(node)) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
291 | node = webkit_dom_node_get_first_child(node); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
292 | } else { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
293 | while (node != div) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
294 | WebKitDOMNode *next; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
295 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
296 | next = webkit_dom_node_get_next_sibling(node); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
297 | if (next) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
298 | node = next; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
299 | break; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
300 | } else { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
301 | node = webkit_dom_node_get_parent_node(node); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
302 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
303 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
304 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
305 | } while (node != div); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
306 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
307 | /* Second, apply highlighting to saved sections. Changing the DOM is |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
308 | automatically reflected in all WebKit API, so we have to do this after |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
309 | finding the offsets, or things could get complicated. */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
310 | while (data) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
311 | node = WEBKIT_DOM_NODE(data->data); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
312 | data = g_slist_delete_link(data, data); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
313 | this_start = GPOINTER_TO_INT(data->data); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
314 | data = g_slist_delete_link(data, data); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
315 | this_end = GPOINTER_TO_INT(data->data); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
316 | data = g_slist_delete_link(data, data); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
317 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
318 | range = webkit_dom_document_create_range(dom); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
319 | webkit_dom_range_set_start(range, node, this_start, NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
320 | webkit_dom_range_set_end(range, node, this_end, NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
321 | span = webkit_dom_document_create_element(dom, "span", NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
322 | webkit_dom_html_element_set_class_name(WEBKIT_DOM_HTML_ELEMENT(span), |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
323 | "regex"); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
324 | webkit_dom_range_surround_contents(range, WEBKIT_DOM_NODE(span), NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
325 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
326 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
327 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
328 | static void |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
329 | regex_match(DebugWindow *win, WebKitDOMDocument *dom, WebKitDOMNode *div) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
330 | { |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
331 | GMatchInfo *match_info; |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
332 | gchar *text; |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
333 | gchar *plaintext; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
334 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
335 | text = webkit_dom_node_get_text_content(div); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
336 | if (!text) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
337 | return; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
338 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
339 | /* I don't like having to do this, but we need it for highlighting. Plus |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
340 | * it makes the ^ and $ operators work :) |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
341 | */ |
| 15884 | 342 | plaintext = purple_markup_strip_html(text); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
343 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
344 | /* We do a first pass to see if it matches at all. If it does we work out |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
345 | * the offsets to highlight. |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
346 | */ |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
347 | if (g_regex_match(win->regex, plaintext, 0, &match_info) != win->invert) { |
|
11312
73ee18523c44
[gaim-migrate @ 13512]
Gary Kramlich <grim@reaperworld.com>
parents:
11311
diff
changeset
|
348 | /* If we're not highlighting or the expression is inverted, we're |
|
11311
0deea6aaea65
[gaim-migrate @ 13511]
Gary Kramlich <grim@reaperworld.com>
parents:
11310
diff
changeset
|
349 | * done and move on. |
|
11310
18461cc48950
[gaim-migrate @ 13510]
Gary Kramlich <grim@reaperworld.com>
parents:
11262
diff
changeset
|
350 | */ |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
351 | if (!win->highlight || win->invert) { |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
352 | g_free(plaintext); |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
353 | g_match_info_free(match_info); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
354 | return; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
355 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
356 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
357 | do { |
|
33094
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
358 | gint m, count; |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
359 | gint start_pos, end_pos; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30795
diff
changeset
|
360 | |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
361 | if (!g_match_info_matches(match_info)) |
|
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
362 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30795
diff
changeset
|
363 | |
|
33094
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
364 | count = g_match_info_get_match_count(match_info); |
|
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
365 | if (count == 1) |
|
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
366 | m = 0; |
|
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
367 | else |
|
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
368 | m = 1; |
|
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
369 | |
|
33197cba2b9d
Better handling of parenthesized searches.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33093
diff
changeset
|
370 | for (; m < count; m++) |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
371 | { |
|
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
372 | g_match_info_fetch_pos(match_info, m, &start_pos, &end_pos); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30795
diff
changeset
|
373 | |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
374 | if (end_pos == -1) |
|
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
375 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30795
diff
changeset
|
376 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
377 | regex_highlight_text_nodes(dom, div, start_pos, end_pos); |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
378 | } |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
379 | } while (g_match_info_next(match_info, NULL)); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30795
diff
changeset
|
380 | |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
381 | g_match_info_free(match_info); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
382 | } else { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
383 | regex_toggle_div(div); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
384 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
385 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
386 | g_free(plaintext); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
387 | g_free(text); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
388 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
389 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
390 | static void |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
391 | regex_toggle_filter(DebugWindow *win, gboolean filter) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
392 | { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
393 | WebKitDOMDocument *dom; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
394 | WebKitDOMNodeList *list; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
395 | gulong i; |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
396 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
397 | dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(win->text)); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
398 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
399 | if (win->highlight) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
400 | regex_highlight_clear(dom); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
401 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
402 | /* Re-show debug lines that didn't match regex */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
403 | list = webkit_dom_document_get_elements_by_class_name(dom, "hide"); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
404 | i = webkit_dom_node_list_get_length(list); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
405 | while (i--) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
406 | WebKitDOMNode *div = webkit_dom_node_list_item(list, i); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
407 | regex_toggle_div(div); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
408 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
409 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
410 | if (filter) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
411 | list = webkit_dom_document_get_elements_by_tag_name(dom, "div"); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
412 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
413 | for (i = 0; i < webkit_dom_node_list_get_length(list); i++) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
414 | WebKitDOMNode *div = webkit_dom_node_list_item(list, i); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
415 | regex_match(win, dom, div); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
416 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
417 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
418 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
419 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
420 | static void |
| 15884 | 421 | regex_pref_filter_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
422 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
423 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
424 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
425 | gboolean active = GPOINTER_TO_INT(val), current; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
426 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
427 | if (!win || !win->window) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
428 | return; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
429 | |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
430 | current = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter)); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
431 | if (active != current) |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
432 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), active); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
433 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
434 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
435 | static void |
| 15884 | 436 | regex_pref_expression_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
437 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
438 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
439 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
440 | const gchar *exp = (const gchar *)val; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
441 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
442 | gtk_entry_set_text(GTK_ENTRY(win->expression), exp); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
443 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
444 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
445 | static void |
| 15884 | 446 | regex_pref_invert_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
447 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
448 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
449 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
450 | gboolean active = GPOINTER_TO_INT(val); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
451 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
452 | win->invert = active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
453 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
454 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
455 | regex_toggle_filter(win, TRUE); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
456 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
457 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
458 | static void |
| 15884 | 459 | regex_pref_highlight_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
460 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
461 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
462 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
463 | gboolean active = GPOINTER_TO_INT(val); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
464 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
465 | win->highlight = active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
466 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
467 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
468 | regex_toggle_filter(win, TRUE); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
469 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
470 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
471 | static gboolean |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
472 | regex_timer_cb(DebugWindow *win) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
473 | const gchar *text; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
474 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
475 | text = gtk_entry_get_text(GTK_ENTRY(win->expression)); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
476 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/debug/regex", text); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
477 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
478 | win->timer = 0; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
479 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
480 | return FALSE; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
481 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
482 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
483 | static void |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
484 | regex_changed_cb(GtkWidget *w, DebugWindow *win) { |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
485 | const gchar *text; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
486 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
487 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) { |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
488 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
489 | FALSE); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
490 | } |
| 11033 | 491 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
492 | if (win->timer == 0) |
|
26753
a8dca8faae69
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
Arunan Balasubramaniam <foss@abala.me>
parents:
26482
diff
changeset
|
493 | win->timer = purple_timeout_add_seconds(5, (GSourceFunc)regex_timer_cb, win); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
494 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
495 | text = gtk_entry_get_text(GTK_ENTRY(win->expression)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
496 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
497 | if (text == NULL || *text == '\0') { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
498 | regex_clear_color(win->expression); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
499 | gtk_widget_set_sensitive(win->filter, FALSE); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
500 | return; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
501 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
502 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
503 | if (win->regex) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
504 | g_regex_unref(win->regex); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
505 | win->regex = g_regex_new(text, G_REGEX_CASELESS, 0, NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
506 | if (win->regex == NULL) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
507 | /* failed to compile */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
508 | regex_change_color(win->expression, 0xFFFF, 0xAFFF, 0xAFFF); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
509 | gtk_widget_set_sensitive(win->filter, FALSE); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
510 | } else { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
511 | /* compiled successfully */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
512 | regex_change_color(win->expression, 0xAFFF, 0xFFFF, 0xAFFF); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
513 | gtk_widget_set_sensitive(win->filter, TRUE); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
514 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
515 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
516 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
517 | static void |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
518 | regex_key_release_cb(GtkWidget *w, GdkEventKey *e, DebugWindow *win) { |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
519 | if(e->keyval == GDK_KEY_Return && |
|
32913
af2c726febce
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32912
diff
changeset
|
520 | gtk_widget_is_sensitive(win->filter) && |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
521 | !gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
522 | { |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
523 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), TRUE); |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
524 | } |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
525 | } |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
526 | |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
527 | static void |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
528 | regex_menu_cb(GtkWidget *item, const gchar *pref) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
529 | gboolean active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
530 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
531 | active = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
532 | |
| 15884 | 533 | purple_prefs_set_bool(pref, active); |
| 11033 | 534 | } |
| 535 | ||
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
536 | static void |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
537 | regex_popup_cb(GtkEntry *entry, GtkWidget *menu, DebugWindow *win) { |
| 15568 | 538 | pidgin_separator(menu); |
| 539 | pidgin_new_check_item(menu, _("Invert"), | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
540 | G_CALLBACK(regex_menu_cb), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
541 | PIDGIN_PREFS_ROOT "/debug/invert", win->invert); |
| 15568 | 542 | pidgin_new_check_item(menu, _("Highlight matches"), |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
543 | G_CALLBACK(regex_menu_cb), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
544 | PIDGIN_PREFS_ROOT "/debug/highlight", win->highlight); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
545 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
546 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
547 | static void |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
548 | regex_filter_toggled_cb(GtkToggleToolButton *button, DebugWindow *win) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
549 | { |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
550 | gboolean active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
551 | |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
552 | active = gtk_toggle_tool_button_get_active(button); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
553 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
554 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/filter", active); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
555 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
556 | if (!GTK_IS_WEBVIEW(win->text)) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
557 | return; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
558 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
559 | regex_toggle_filter(win, active); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
560 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
561 | |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
562 | static void |
| 15884 | 563 | filter_level_pref_changed(const char *name, PurplePrefType type, gconstpointer value, gpointer data) |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
564 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
565 | DebugWindow *win = data; |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
566 | WebKitDOMDocument *dom; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
567 | WebKitDOMHTMLElement *body; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
568 | int level = GPOINTER_TO_INT(value); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
569 | char *tmp; |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
570 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
571 | if (level != gtk_combo_box_get_active(GTK_COMBO_BOX(win->filterlevel))) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
572 | gtk_combo_box_set_active(GTK_COMBO_BOX(win->filterlevel), level); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
573 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
574 | dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(win->text)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
575 | body = webkit_dom_document_get_body(dom); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
576 | tmp = g_strdup_printf("l%d", level); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
577 | webkit_dom_html_element_set_class_name(body, tmp); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
578 | g_free(tmp); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
579 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
580 | |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
581 | static void |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
582 | filter_level_changed_cb(GtkWidget *combo, gpointer null) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
583 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
584 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/filterlevel", |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
585 | gtk_combo_box_get_active(GTK_COMBO_BOX(combo))); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
586 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
587 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
588 | static void |
| 15884 | 589 | toolbar_style_pref_changed_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
590 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
591 | gtk_toolbar_set_style(GTK_TOOLBAR(data), GPOINTER_TO_INT(value)); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
592 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
593 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
594 | static void |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
595 | toolbar_icon_pref_changed(GtkWidget *item, GtkWidget *toolbar) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
596 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
597 | int style = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "user_data")); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
598 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/style", style); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
599 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
600 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
601 | static gboolean |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
602 | toolbar_context(GtkWidget *toolbar, GdkEventButton *event, gpointer null) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
603 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
604 | GtkWidget *menu, *item; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
605 | const char *text[3]; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
606 | GtkToolbarStyle value[3]; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
607 | int i; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
608 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
609 | if (!(event->button == 3 && event->type == GDK_BUTTON_PRESS)) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
610 | return FALSE; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
611 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
612 | text[0] = _("_Icon Only"); value[0] = GTK_TOOLBAR_ICONS; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
613 | text[1] = _("_Text Only"); value[1] = GTK_TOOLBAR_TEXT; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
614 | text[2] = _("_Both Icon & Text"); value[2] = GTK_TOOLBAR_BOTH_HORIZ; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
615 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
616 | menu = gtk_menu_new(); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
617 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
618 | for (i = 0; i < 3; i++) { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
619 | item = gtk_check_menu_item_new_with_mnemonic(text[i]); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
620 | g_object_set_data(G_OBJECT(item), "user_data", GINT_TO_POINTER(value[i])); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
621 | g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(toolbar_icon_pref_changed), toolbar); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
622 | if (value[i] == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/style")) |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
623 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
624 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
625 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
626 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
627 | gtk_widget_show_all(menu); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
628 | |
|
33110
a2923f41d05a
We have the exact button and event time to use here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33095
diff
changeset
|
629 | gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, event->time); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
630 | return FALSE; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
631 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
632 | |
|
33242
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
633 | static void |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
634 | regex_html_appended_cb(GtkWebView *webview, WebKitDOMRange *range, DebugWindow *win) |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
635 | { |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
636 | if (!win || !win->window) |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
637 | return; |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
638 | |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
639 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) { |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
640 | WebKitDOMDocument *dom; |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
641 | WebKitDOMHTMLElement *body; |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
642 | WebKitDOMNode *div; |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
643 | |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
644 | dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(win->text)); |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
645 | body = webkit_dom_document_get_body(dom); |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
646 | div = webkit_dom_node_get_last_child(WEBKIT_DOM_NODE(body)); |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
647 | |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
648 | if (webkit_dom_element_webkit_matches_selector(WEBKIT_DOM_ELEMENT(div), |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
649 | "body>div:not(#pause)", |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
650 | NULL)) |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
651 | regex_match(win, dom, div); |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
652 | } |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
653 | } |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
654 | |
| 5212 | 655 | static DebugWindow * |
| 656 | debug_window_new(void) | |
| 657 | { | |
| 658 | DebugWindow *win; | |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
659 | GtkWidget *vbox; |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
660 | GtkWidget *toolbar; |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
661 | GtkWidget *frame; |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
662 | gint width, height; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
663 | void *handle; |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
664 | GtkToolItem *item; |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
665 | #if !GTK_CHECK_VERSION(2,12,0) |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
666 | GtkTooltips *tooltips; |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
667 | #endif |
| 5212 | 668 | |
| 669 | win = g_new0(DebugWindow, 1); | |
| 670 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
671 | width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/width"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
672 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/height"); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
673 | |
|
29321
c089a3e0092e
De-dialogify the file-transfer and debug windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29287
diff
changeset
|
674 | win->window = pidgin_create_window(_("Debug Window"), 0, "debug", TRUE); |
| 15884 | 675 | purple_debug_info("gtkdebug", "Setting dimensions to %d, %d\n", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
676 | width, height); |
|
5642
d7b8b62542a3
[gaim-migrate @ 6056]
Christian Hammond <chipx86@chipx86.com>
parents:
5636
diff
changeset
|
677 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
678 | gtk_window_set_default_size(GTK_WINDOW(win->window), width, height); |
| 5212 | 679 | |
| 680 | g_signal_connect(G_OBJECT(win->window), "delete_event", | |
| 11033 | 681 | G_CALLBACK(debug_window_destroy), NULL); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
682 | g_signal_connect(G_OBJECT(win->window), "configure_event", |
| 11033 | 683 | G_CALLBACK(configure_cb), win); |
| 5212 | 684 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
685 | handle = pidgin_debug_get_handle(); |
|
22099
8e70e3ba6096
Modified patch from Gabriel (Sylar?) Schulof to deprecate PIDGIN_DIALOG. Closes #4535. (PS: I am aware of --author).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21743
diff
changeset
|
686 | |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
687 | /* Setup the vbox */ |
|
29321
c089a3e0092e
De-dialogify the file-transfer and debug windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29287
diff
changeset
|
688 | vbox = gtk_vbox_new(FALSE, 0); |
|
c089a3e0092e
De-dialogify the file-transfer and debug windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29287
diff
changeset
|
689 | gtk_container_add(GTK_CONTAINER(win->window), vbox); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
690 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
691 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/toolbar")) { |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
692 | /* Setup our top button bar thingie. */ |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
693 | toolbar = gtk_toolbar_new(); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
694 | #if !GTK_CHECK_VERSION(2,12,0) |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
695 | tooltips = gtk_tooltips_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
696 | #endif |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
697 | #if !GTK_CHECK_VERSION(2,14,0) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
698 | gtk_toolbar_set_tooltips(GTK_TOOLBAR(toolbar), TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
699 | #endif |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
700 | gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), TRUE); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
701 | g_signal_connect(G_OBJECT(toolbar), "button-press-event", G_CALLBACK(toolbar_context), win); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
702 | |
| 11033 | 703 | gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
704 | purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/style")); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
705 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/style", |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
706 | toolbar_style_pref_changed_cb, toolbar); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
707 | gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), |
| 11033 | 708 | GTK_ICON_SIZE_SMALL_TOOLBAR); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
709 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
710 | gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
711 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
712 | /* Save */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
713 | item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE); |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
714 | gtk_tool_item_set_is_important(item, TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
715 | gtk_tool_item_set_tooltip_text(item, _("Save")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
716 | g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(save_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
717 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
718 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
719 | /* Clear button */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
720 | item = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR); |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
721 | gtk_tool_item_set_is_important(item, TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
722 | gtk_tool_item_set_tooltip_text(item, _("Clear")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
723 | g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(clear_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
724 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
725 | |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
726 | item = gtk_separator_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
727 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
728 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
729 | /* Pause */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
730 | item = gtk_toggle_tool_button_new_from_stock(PIDGIN_STOCK_PAUSE); |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
731 | gtk_tool_item_set_is_important(item, TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
732 | gtk_tool_item_set_tooltip_text(item, _("Pause")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
733 | g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(pause_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
734 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
735 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
736 | /* regex stuff */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
737 | item = gtk_separator_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
738 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 11033 | 739 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
740 | /* regex toggle button */ |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
741 | item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_FIND); |
|
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
742 | gtk_tool_item_set_is_important(item, TRUE); |
|
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
743 | win->filter = GTK_WIDGET(item); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
744 | gtk_tool_button_set_label(GTK_TOOL_BUTTON(win->filter), _("Filter")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
745 | gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(win->filter), _("Filter")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
746 | g_signal_connect(G_OBJECT(win->filter), "clicked", G_CALLBACK(regex_filter_toggled_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
747 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(win->filter)); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
748 | |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
749 | /* we purposely disable the toggle button here in case |
| 15884 | 750 | * /purple/gtk/debug/expression has an empty string. If it does not have |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
751 | * an empty string, the change signal will get called and make the |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
752 | * toggle button sensitive. |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
753 | */ |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
754 | gtk_widget_set_sensitive(win->filter, FALSE); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
755 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
756 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/filter")); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
757 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filter", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
758 | regex_pref_filter_cb, win); |
| 8953 | 759 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
760 | /* regex entry */ |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
761 | win->expression = gtk_entry_new(); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
762 | item = gtk_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
763 | gtk_widget_set_tooltip_text(win->expression, _("Right click for more options.")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
764 | gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression)); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
765 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
766 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
767 | /* this needs to be before the text is set from the pref if we want it |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
768 | * to colorize a stored expression. |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
769 | */ |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
770 | g_signal_connect(G_OBJECT(win->expression), "changed", |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
771 | G_CALLBACK(regex_changed_cb), win); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
772 | gtk_entry_set_text(GTK_ENTRY(win->expression), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
773 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/debug/regex")); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
774 | g_signal_connect(G_OBJECT(win->expression), "populate-popup", |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
775 | G_CALLBACK(regex_popup_cb), win); |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
776 | g_signal_connect(G_OBJECT(win->expression), "key-release-event", |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
777 | G_CALLBACK(regex_key_release_cb), win); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
778 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/regex", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
779 | regex_pref_expression_cb, win); |
| 11033 | 780 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
781 | /* connect the rest of our pref callbacks */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
782 | win->invert = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/invert"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
783 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/invert", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
784 | regex_pref_invert_cb, win); |
| 11033 | 785 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
786 | win->highlight = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/highlight"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
787 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/highlight", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
788 | regex_pref_highlight_cb, win); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
789 | |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
790 | item = gtk_separator_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
791 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
792 | |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
793 | item = gtk_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
794 | gtk_container_add(GTK_CONTAINER(item), gtk_label_new(_("Level "))); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
795 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
796 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
797 | win->filterlevel = gtk_combo_box_text_new(); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
798 | item = gtk_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
799 | gtk_widget_set_tooltip_text(win->filterlevel, _("Select the debug filter level.")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
800 | gtk_container_add(GTK_CONTAINER(item), win->filterlevel); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
801 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
802 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
803 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("All")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
804 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Misc")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
805 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Info")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
806 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Warning")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
807 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Error ")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
808 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Fatal Error")); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
809 | gtk_combo_box_set_active(GTK_COMBO_BOX(win->filterlevel), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
810 | purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")); |
|
33092
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
811 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
812 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filterlevel", |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
813 | filter_level_pref_changed, win); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
814 | g_signal_connect(G_OBJECT(win->filterlevel), "changed", |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
815 | G_CALLBACK(filter_level_changed_cb), NULL); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
816 | } |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
817 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
818 | /* Add the gtkwebview */ |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
819 | frame = pidgin_create_webview(FALSE, &win->text, NULL, NULL); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
820 | gtk_webview_set_format_functions(GTK_WEBVIEW(win->text), |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
821 | GTK_WEBVIEW_ALL ^ GTK_WEBVIEW_SMILEY ^ GTK_WEBVIEW_IMAGE); |
|
33247
d8d6e87ce594
Add autoscrolling for the debug window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33242
diff
changeset
|
822 | gtk_webview_set_autoscroll(GTK_WEBVIEW(win->text), TRUE); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
823 | gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
|
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
824 | gtk_widget_show(frame); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
825 | |
|
33242
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
826 | g_signal_connect(G_OBJECT(win->text), "html-appended", |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
827 | G_CALLBACK(regex_html_appended_cb), win); |
|
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
828 | |
|
33111
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
829 | clear_cb(NULL, win); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
830 | |
| 5212 | 831 | gtk_widget_show_all(win->window); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
832 | |
| 5212 | 833 | return win; |
| 834 | } | |
| 835 | ||
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
836 | static gboolean |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
837 | debug_enabled_timeout_cb(gpointer data) |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
838 | { |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
839 | debug_enabled_timer = 0; |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
840 | |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
841 | if (data) |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
842 | pidgin_debug_window_show(); |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
843 | else |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
844 | pidgin_debug_window_hide(); |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
845 | |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
846 | return FALSE; |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
847 | } |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
848 | |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
849 | static void |
| 15884 | 850 | debug_enabled_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
851 | gconstpointer value, gpointer data) |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
852 | { |
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
853 | debug_enabled_timer = g_timeout_add(0, debug_enabled_timeout_cb, GINT_TO_POINTER(GPOINTER_TO_INT(value))); |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
854 | } |
|
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
855 | |
| 7150 | 856 | static void |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
857 | pidgin_glib_log_handler(const gchar *domain, GLogLevelFlags flags, |
| 7150 | 858 | const gchar *msg, gpointer user_data) |
| 859 | { | |
| 15884 | 860 | PurpleDebugLevel level; |
| 7150 | 861 | char *new_msg = NULL; |
| 862 | char *new_domain = NULL; | |
| 863 | ||
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
864 | if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR) |
| 15884 | 865 | level = PURPLE_DEBUG_ERROR; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
866 | else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL) |
| 15884 | 867 | level = PURPLE_DEBUG_FATAL; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
868 | else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING) |
| 15884 | 869 | level = PURPLE_DEBUG_WARNING; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
870 | else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE) |
| 15884 | 871 | level = PURPLE_DEBUG_INFO; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
872 | else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO) |
| 15884 | 873 | level = PURPLE_DEBUG_INFO; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
874 | else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG) |
| 15884 | 875 | level = PURPLE_DEBUG_MISC; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
876 | else |
|
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
877 | { |
| 15884 | 878 | purple_debug_warning("gtkdebug", |
| 7150 | 879 | "Unknown glib logging level in %d\n", flags); |
| 880 | ||
| 15884 | 881 | level = PURPLE_DEBUG_MISC; /* This will never happen. */ |
| 7150 | 882 | } |
| 883 | ||
| 884 | if (msg != NULL) | |
| 15884 | 885 | new_msg = purple_utf8_try_convert(msg); |
| 7150 | 886 | |
| 887 | if (domain != NULL) | |
| 15884 | 888 | new_domain = purple_utf8_try_convert(domain); |
| 7150 | 889 | |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
890 | if (new_msg != NULL) |
|
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
891 | { |
| 15884 | 892 | purple_debug(level, (new_domain != NULL ? new_domain : "g_log"), |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
893 | "%s\n", new_msg); |
| 7150 | 894 | |
| 895 | g_free(new_msg); | |
| 896 | } | |
| 897 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13988
diff
changeset
|
898 | g_free(new_domain); |
| 7150 | 899 | } |
| 900 | ||
| 901 | #ifdef _WIN32 | |
| 902 | static void | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
903 | pidgin_glib_dummy_print_handler(const gchar *string) |
| 7150 | 904 | { |
| 905 | } | |
| 906 | #endif | |
| 907 | ||
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
908 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
909 | pidgin_debug_init(void) |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
910 | { |
| 5684 | 911 | /* Debug window preferences. */ |
| 912 | /* | |
| 913 | * NOTE: This must be set before prefs are loaded, and the callbacks | |
| 914 | * set after they are loaded, since prefs sets the enabled | |
| 915 | * preference here and that loads the window, which calls the | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8046
diff
changeset
|
916 | * configure event, which overrides the width and height! :P |
| 5684 | 917 | */ |
| 918 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
919 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/debug"); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
920 | |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
921 | /* Controls printing to the debug window */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
922 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/enabled", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
923 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/filterlevel", PURPLE_DEBUG_ALL); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
924 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/style", GTK_TOOLBAR_BOTH_HORIZ); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
925 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
926 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/toolbar", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
927 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/width", 450); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
928 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/height", 250); |
| 5684 | 929 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
930 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/debug/regex", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
931 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/filter", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
932 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/invert", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
933 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/case_insensitive", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
934 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/highlight", FALSE); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
935 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
936 | purple_prefs_connect_callback(NULL, PIDGIN_PREFS_ROOT "/debug/enabled", |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
937 | debug_enabled_cb, NULL); |
| 7150 | 938 | |
| 939 | #define REGISTER_G_LOG_HANDLER(name) \ | |
| 940 | g_log_set_handler((name), G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL \ | |
| 941 | | G_LOG_FLAG_RECURSION, \ | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
942 | pidgin_glib_log_handler, NULL) |
| 7150 | 943 | |
| 944 | /* Register the glib/gtk log handlers. */ | |
| 945 | REGISTER_G_LOG_HANDLER(NULL); | |
| 946 | REGISTER_G_LOG_HANDLER("Gdk"); | |
| 947 | REGISTER_G_LOG_HANDLER("Gtk"); | |
|
7229
0f85b503c030
[gaim-migrate @ 7799]
Herman Bloggs <herman@bluedigits.com>
parents:
7152
diff
changeset
|
948 | REGISTER_G_LOG_HANDLER("GdkPixbuf"); |
| 7150 | 949 | REGISTER_G_LOG_HANDLER("GLib"); |
| 950 | REGISTER_G_LOG_HANDLER("GModule"); | |
| 951 | REGISTER_G_LOG_HANDLER("GLib-GObject"); | |
| 952 | REGISTER_G_LOG_HANDLER("GThread"); | |
|
21743
7a0caaf628ff
applied changes from 10f341962a83e2380243c4e44bb685105e3091a2
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21630
diff
changeset
|
953 | #ifdef USE_GSTREAMER |
|
7a0caaf628ff
applied changes from 10f341962a83e2380243c4e44bb685105e3091a2
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21630
diff
changeset
|
954 | REGISTER_G_LOG_HANDLER("GStreamer"); |
|
7a0caaf628ff
applied changes from 10f341962a83e2380243c4e44bb685105e3091a2
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21630
diff
changeset
|
955 | #endif |
| 7150 | 956 | |
| 957 | #ifdef _WIN32 | |
| 15884 | 958 | if (!purple_debug_is_enabled()) |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
959 | g_set_print_handler(pidgin_glib_dummy_print_handler); |
| 7150 | 960 | #endif |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
961 | } |
|
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
962 | |
| 5212 | 963 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
964 | pidgin_debug_uninit(void) |
| 11033 | 965 | { |
| 15884 | 966 | purple_debug_set_ui_ops(NULL); |
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
967 | |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
968 | if (debug_enabled_timer != 0) |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
969 | g_source_remove(debug_enabled_timer); |
| 11033 | 970 | } |
| 971 | ||
| 972 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
973 | pidgin_debug_window_show(void) |
| 5212 | 974 | { |
| 975 | if (debug_win == NULL) | |
| 976 | debug_win = debug_window_new(); | |
| 977 | ||
| 978 | gtk_widget_show(debug_win->window); | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
979 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
980 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", TRUE); |
| 5212 | 981 | } |
| 982 | ||
| 983 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
984 | pidgin_debug_window_hide(void) |
| 5212 | 985 | { |
| 986 | if (debug_win != NULL) { | |
| 987 | gtk_widget_destroy(debug_win->window); | |
| 988 | debug_window_destroy(NULL, NULL, NULL); | |
| 989 | } | |
| 990 | } | |
| 991 | ||
| 992 | static void | |
| 15884 | 993 | pidgin_debug_print(PurpleDebugLevel level, const char *category, |
|
13988
a178d3dcbb7f
[gaim-migrate @ 16445]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
994 | const char *arg_s) |
| 5212 | 995 | { |
|
13988
a178d3dcbb7f
[gaim-migrate @ 16445]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
996 | gchar *ts_s; |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
997 | gchar *esc_s, *cat_s, *tmp, *s; |
|
17040
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
998 | const char *mdate; |
|
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
999 | time_t mtime; |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
1000 | |
|
16045
d9add5eda4cd
Check if debug_win is != NULL before checking the preference. This
Mark Doliner <markdoliner@pidgin.im>
parents:
16044
diff
changeset
|
1001 | if (debug_win == NULL || |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
1002 | !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
1003 | { |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1004 | return; |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1005 | } |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1006 | |
|
17040
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
1007 | mtime = time(NULL); |
|
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
1008 | mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); |
|
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
1009 | ts_s = g_strdup_printf("(%s) ", mdate); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1010 | if (category == NULL) |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1011 | cat_s = g_strdup(""); |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1012 | else |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1013 | cat_s = g_strdup_printf("<b>%s:</b> ", category); |
| 5212 | 1014 | |
|
33091
57771e51f8ca
I think we should verify UTF8 before using a function wanting it.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32913
diff
changeset
|
1015 | tmp = purple_utf8_try_convert(arg_s); |
|
57771e51f8ca
I think we should verify UTF8 before using a function wanting it.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32913
diff
changeset
|
1016 | esc_s = g_markup_escape_text(tmp, -1); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
1017 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
1018 | s = g_strdup_printf("<div class=\"l%d\">%s%s%s</div>", |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
1019 | level, ts_s, cat_s, esc_s); |
| 5212 | 1020 | |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1021 | g_free(ts_s); |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1022 | g_free(cat_s); |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1023 | g_free(esc_s); |
|
33091
57771e51f8ca
I think we should verify UTF8 before using a function wanting it.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32913
diff
changeset
|
1024 | g_free(tmp); |
| 5212 | 1025 | |
|
33242
f63b51e608fe
Fix debug filtering on appended items.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33238
diff
changeset
|
1026 | gtk_webview_append_html(GTK_WEBVIEW(debug_win->text), s); |
| 5212 | 1027 | |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
1028 | g_free(s); |
| 5212 | 1029 | } |
| 1030 | ||
|
16044
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
1031 | static gboolean |
|
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
1032 | pidgin_debug_is_enabled(PurpleDebugLevel level, const char *category) |
|
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
1033 | { |
|
16045
d9add5eda4cd
Check if debug_win is != NULL before checking the preference. This
Mark Doliner <markdoliner@pidgin.im>
parents:
16044
diff
changeset
|
1034 | return (debug_win != NULL && |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
1035 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); |
|
16044
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
1036 | } |
|
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
1037 | |
| 15884 | 1038 | static PurpleDebugUiOps ops = |
| 5212 | 1039 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
1040 | pidgin_debug_print, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1041 | pidgin_debug_is_enabled, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1042 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1043 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1044 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1045 | NULL |
| 5212 | 1046 | }; |
| 1047 | ||
| 15884 | 1048 | PurpleDebugUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
1049 | pidgin_debug_get_ui_ops(void) |
| 5212 | 1050 | { |
| 1051 | return &ops; | |
| 1052 | } | |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
1053 | |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
1054 | void * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
1055 | pidgin_debug_get_handle() { |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
1056 | static int handle; |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
1057 | |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
1058 | return &handle; |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
1059 | } |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
1060 |