Mercurial > pidgin.yaz
annotate pidgin/plugins/adiumthemes/webkit.c @ 32708:10e5000326a5
Convert code to use the purple_account accessor functions.
author | andrew.victor@mxit.com |
---|---|
date | Sat, 01 Oct 2011 21:04:35 +0000 |
parents | 78fae2fc38d5 |
children |
rev | line source |
---|---|
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
1 /* pidgin |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
2 * |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
3 * Pidgin is the legal property of its developers, whose names are too numerous |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
4 * to list here. Please refer to the COPYRIGHT file distributed with this |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
5 * source distribution. |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
6 * |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
10 * (at your option) any later version. |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
11 * |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
15 * GNU General Public License for more details. |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
16 * |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
20 * |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
21 */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
22 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
23 #define PLUGIN_ID "gtk-webview-adium-ims" |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
24 #define PLUGIN_NAME "webview-adium-ims" |
32534
0bac73a6a536
Changed the Author added copyright, etc.
tdrhq@soc.pidgin.im
parents:
32533
diff
changeset
|
25 |
0bac73a6a536
Changed the Author added copyright, etc.
tdrhq@soc.pidgin.im
parents:
32533
diff
changeset
|
26 /* |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
27 * A lot of this was originally written by Sean Egan, but I think I've |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
28 * rewrote enough to replace the author for now. |
32534
0bac73a6a536
Changed the Author added copyright, etc.
tdrhq@soc.pidgin.im
parents:
32533
diff
changeset
|
29 */ |
32582 | 30 #define PLUGIN_AUTHOR "Arnold Noronha <arnstein87@gmail.com>" |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
31 #define PURPLE_PLUGINS "Hell yeah" |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
32 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
33 /* System headers */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
34 #include <string.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
35 #include <gdk/gdk.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
36 #include <gtk/gtk.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
37 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
38 #include <webkit/webkit.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
39 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
40 /* Purple headers */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
41 #include <conversation.h> |
32547 | 42 #include <debug.h> |
32580
23b16f51e15a
Don't crash if we don't have any theme installed.
masca@cpw.pidgin.im
parents:
32575
diff
changeset
|
43 #include <internal.h> |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
44 #include <notify.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
45 #include <util.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
46 #include <version.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
47 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
48 /* Pidgin headers */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
49 #include <gtkconv.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
50 #include <gtkplugin.h> |
32532
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
51 #include <gtkwebview.h> |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
52 #include <smileyparser.h> |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
53 |
32559 | 54 #include <libxml/xmlreader.h> |
32566
59f433824040
Separated the MessageStyle loading code from the actual rendering code.
tdrhq@soc.pidgin.im
parents:
32565
diff
changeset
|
55 |
59f433824040
Separated the MessageStyle loading code from the actual rendering code.
tdrhq@soc.pidgin.im
parents:
32565
diff
changeset
|
56 #include "message-style.h" |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
57 /* GObject data keys */ |
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
58 #define MESSAGE_STYLE_KEY "message-style" |
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
59 |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
60 static char *cur_style_dir = NULL; |
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
61 static void *handle = NULL; |
32535 | 62 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
63 static inline char * |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
64 get_absolute_path(const char *path) |
32553 | 65 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
66 if (g_path_is_absolute(path)) |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
67 return g_strdup(path); |
32553 | 68 else { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
69 char *cwd, *ret; |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
70 cwd = g_get_current_dir(); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
71 ret = g_build_filename(cwd, path, NULL); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
72 g_free(cwd); |
32553 | 73 return ret; |
74 } | |
75 } | |
76 | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
77 static void webkit_on_webview_destroy(GtkObject* obj, gpointer data); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
78 |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
79 static void * |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
80 webkit_plugin_get_handle(void) |
32535 | 81 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
82 if (handle) |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
83 return handle; |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
84 else |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
85 return (handle = g_malloc(1)); |
32561 | 86 } |
87 | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
88 static void |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
89 webkit_plugin_free_handle(void) |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
90 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
91 purple_signals_disconnect_by_handle(handle); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
92 g_free(handle); |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
93 } |
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
94 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
95 static char * |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
96 replace_message_tokens( |
32582 | 97 const char *text, |
98 PurpleConversation *conv, | |
99 const char *name, | |
100 const char *alias, | |
101 const char *message, | |
102 PurpleMessageFlags flags, | |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
103 time_t mtime) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
104 { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
105 PurpleAccount *account = purple_conversation_get_account(conv); |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
106 GString *str = g_string_new(NULL); |
32568
5281f3b3ef4c
Instead of using references, use copy's. Sigh, I know this is a memory inefficient
tdrhq@soc.pidgin.im
parents:
32567
diff
changeset
|
107 const char *cur = text; |
5281f3b3ef4c
Instead of using references, use copy's. Sigh, I know this is a memory inefficient
tdrhq@soc.pidgin.im
parents:
32567
diff
changeset
|
108 const char *prev = cur; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
109 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
110 while ((cur = strchr(cur, '%'))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
111 const char *replace = NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
112 char *fin = NULL; |
32582 | 113 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
114 if (!strncmp(cur, "%message%", strlen("%message%"))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
115 replace = message; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
116 } else if (!strncmp(cur, "%messageClasses%", strlen("%messageClasses%"))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
117 replace = flags & PURPLE_MESSAGE_SEND ? "outgoing" : |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
118 flags & PURPLE_MESSAGE_RECV ? "incoming" : "event"; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
119 } else if (!strncmp(cur, "%time", strlen("%time"))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
120 char *format = NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
121 if (*(cur + strlen("%time")) == '{') { |
32568
5281f3b3ef4c
Instead of using references, use copy's. Sigh, I know this is a memory inefficient
tdrhq@soc.pidgin.im
parents:
32567
diff
changeset
|
122 const char *start = cur + strlen("%time") + 1; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
123 char *end = strstr(start, "}%"); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
124 if (!end) /* Invalid string */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
125 continue; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
126 format = g_strndup(start, end - start); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
127 fin = end + 1; |
32582 | 128 } |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
129 replace = purple_utf8_strftime(format ? format : "%X", NULL); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
130 g_free(format); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
131 } else if (!strncmp(cur, "%userIconPath%", strlen("%userIconPath%"))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
132 if (flags & PURPLE_MESSAGE_SEND) { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
133 if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) { |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
134 replace = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon"); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
135 } else { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
136 PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
137 replace = purple_imgstore_get_filename(img); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
138 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
139 if (replace == NULL || !g_file_test(replace, G_FILE_TEST_EXISTS)) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
140 replace = g_build_filename("Outgoing", "buddy_icon.png", NULL); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
141 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
142 } else if (flags & PURPLE_MESSAGE_RECV) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
143 PurpleBuddyIcon *icon = purple_conv_im_get_icon(PURPLE_CONV_IM(conv)); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
144 replace = purple_buddy_icon_get_full_path(icon); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
145 if (replace == NULL || !g_file_test(replace, G_FILE_TEST_EXISTS)) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
146 replace = g_build_filename("Incoming", "buddy_icon.png", NULL); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
147 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
148 } |
32582 | 149 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
150 } else if (!strncmp(cur, "%senderScreenName%", strlen("%senderScreenName%"))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
151 replace = name; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
152 } else if (!strncmp(cur, "%sender%", strlen("%sender%"))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
153 replace = alias; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
154 } else if (!strncmp(cur, "%service%", strlen("%service%"))) { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
155 replace = purple_account_get_protocol_name(account); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
156 } else { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
157 cur++; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
158 continue; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
159 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
160 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
161 /* Here we have a replacement to make */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
162 g_string_append_len(str, prev, cur - prev); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
163 g_string_append(str, replace); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
164 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
165 /* And update the pointers */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
166 if (fin) { |
32582 | 167 prev = cur = fin + 1; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
168 } else { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
169 prev = cur = strchr(cur + 1, '%') + 1; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
170 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
171 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
172 } |
32582 | 173 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
174 /* And wrap it up */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
175 g_string_append(str, prev); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
176 return g_string_free(str, FALSE); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
177 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
178 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
179 static char * |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
180 replace_header_tokens(char *text, PurpleConversation *conv) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
181 { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
182 PurpleAccount *account = purple_conversation_get_account(conv); |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
183 GString *str = g_string_new(NULL); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
184 char *cur = text; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
185 char *prev = cur; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
186 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
187 if (text == NULL) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
188 return NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
189 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
190 while ((cur = strchr(cur, '%'))) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
191 const char *replace = NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
192 char *fin = NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
193 |
32582 | 194 if (!strncmp(cur, "%chatName%", strlen("%chatName%"))) { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
195 replace = purple_conversation_get_name(conv); |
32582 | 196 } else if (!strncmp(cur, "%sourceName%", strlen("%sourceName%"))) { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
197 replace = purple_account_get_alias(account); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
198 if (replace == NULL) |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
199 replace = purple_account_get_username(account); |
32582 | 200 } else if (!strncmp(cur, "%destinationName%", strlen("%destinationName%"))) { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
201 PurpleBuddy *buddy = purple_find_buddy(account, purple_conversation_get_name(conv)); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
202 if (buddy) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
203 replace = purple_buddy_get_alias(buddy); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
204 } else { |
32702
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32626
diff
changeset
|
205 replace = purple_conversation_get_name(conv); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
206 } |
32582 | 207 } else if (!strncmp(cur, "%incomingIconPath%", strlen("%incomingIconPath%"))) { |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
208 PurpleBuddyIcon *icon = purple_conv_im_get_icon(PURPLE_CONV_IM(conv)); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
209 replace = purple_buddy_icon_get_full_path(icon); |
32582 | 210 } else if (!strncmp(cur, "%outgoingIconPath%", strlen("%outgoingIconPath%"))) { |
211 } else if (!strncmp(cur, "%timeOpened", strlen("%timeOpened"))) { | |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
212 char *format = NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
213 if (*(cur + strlen("%timeOpened")) == '{') { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
214 char *start = cur + strlen("%timeOpened") + 1; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
215 char *end = strstr(start, "}%"); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
216 if (!end) /* Invalid string */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
217 continue; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
218 format = g_strndup(start, end - start); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
219 fin = end + 1; |
32582 | 220 } |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
221 replace = purple_utf8_strftime(format ? format : "%X", NULL); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
222 g_free(format); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
223 } else { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
224 continue; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
225 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
226 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
227 /* Here we have a replacement to make */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
228 g_string_append_len(str, prev, cur - prev); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
229 g_string_append(str, replace); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
230 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
231 /* And update the pointers */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
232 if (fin) { |
32582 | 233 prev = cur = fin + 1; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
234 } else { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
235 prev = cur = strchr(cur + 1, '%') + 1; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
236 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
237 } |
32582 | 238 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
239 /* And wrap it up */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
240 g_string_append(str, prev); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
241 return g_string_free(str, FALSE); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
242 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
243 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
244 static char * |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
245 replace_template_tokens(PidginMessageStyle *style, char *text, char *header, char *footer) |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
246 { |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
247 GString *str = g_string_new(NULL); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
248 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
249 char **ms = g_strsplit(text, "%@", 6); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
250 char *base = NULL; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
251 char *csspath = pidgin_message_style_get_css(style); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
252 if (ms[0] == NULL || ms[1] == NULL || ms[2] == NULL || ms[3] == NULL || ms[4] == NULL || ms[5] == NULL) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
253 g_strfreev(ms); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
254 g_string_free(str, TRUE); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
255 return NULL; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
256 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
257 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
258 g_string_append(str, ms[0]); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
259 g_string_append(str, "file://"); |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
260 base = g_build_filename(style->style_dir, "Contents", "Resources", "Template.html", NULL); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
261 g_string_append(str, base); |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
262 g_free(base); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
263 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
264 g_string_append(str, ms[1]); |
32561 | 265 |
32567
285db86fcf99
load the default variant. Bring back basestyle.css.
tdrhq@soc.pidgin.im
parents:
32566
diff
changeset
|
266 g_string_append(str, style->basestyle_css); |
32561 | 267 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
268 g_string_append(str, ms[2]); |
32561 | 269 |
270 g_string_append(str, "file://"); | |
271 g_string_append(str, csspath); | |
272 | |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
273 g_string_append(str, ms[3]); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
274 if (header) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
275 g_string_append(str, header); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
276 g_string_append(str, ms[4]); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
277 if (footer) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
278 g_string_append(str, footer); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
279 g_string_append(str, ms[5]); |
32582 | 280 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
281 g_strfreev(ms); |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
282 g_free(csspath); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
283 return g_string_free(str, FALSE); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
284 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
285 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
286 static GtkWidget * |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
287 get_webkit(PurpleConversation *conv) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
288 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
289 PidginConversation *gtkconv; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
290 gtkconv = PIDGIN_CONVERSATION(conv); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
291 if (!gtkconv) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
292 return NULL; |
32582 | 293 else |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
294 return gtkconv->webview; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
295 } |
32531 | 296 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
297 static void |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
298 set_theme_webkit_settings(WebKitWebView *webview, PidginMessageStyle *style) |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
299 { |
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
300 WebKitWebSettings *settings; |
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
301 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
302 g_object_get(G_OBJECT(webview), "settings", &settings, NULL); |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
303 if (style->default_font_family) |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
304 g_object_set(G_OBJECT(settings), "default-font-family", style->default_font_family, NULL); |
32582 | 305 |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
306 if (style->default_font_size) |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
307 g_object_set(G_OBJECT(settings), "default-font-size", GINT_TO_POINTER(style->default_font_size), NULL); |
32565
53735be6950a
apparent code for webkit transparency that might not be working.
tdrhq@soc.pidgin.im
parents:
32563
diff
changeset
|
308 |
53735be6950a
apparent code for webkit transparency that might not be working.
tdrhq@soc.pidgin.im
parents:
32563
diff
changeset
|
309 /* this does not work :( */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
310 webkit_web_view_set_transparent(webview, style->default_background_is_transparent); |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
311 } |
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
312 |
32571
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
313 /* |
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
314 * The style specification says that if the conversation is a group |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
315 * chat then the <div id="Chat"> element will be given a class |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
316 * 'groupchat'. I can't add another '%@' in Template.html because |
32571
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
317 * that breaks style-specific Template.html's. I have to either use libxml |
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
318 * or conveniently play with WebKit's javascript engine. The javascript |
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
319 * engine should work, but it's not an identical behavior. |
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
320 */ |
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
321 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
322 webkit_set_groupchat(GtkWebView *webview) |
32571
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
323 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
324 gtk_webview_safe_execute_script(webview, "document.getElementById('Chat').className = 'groupchat'"); |
32571
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
325 } |
5c53eabcea93
Adds the 'groupchat' classname to #Chat when using groupchat.
tdrhq@soc.pidgin.im
parents:
32569
diff
changeset
|
326 |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
327 |
32531 | 328 /** |
329 * Called when either a new PurpleConversation is created | |
330 * or when a PidginConversation changes its active PurpleConversation | |
32539
7194ddfc8158
woo, fixed the bug. Now things are looking wonderfully stable.
tdrhq@soc.pidgin.im
parents:
32538
diff
changeset
|
331 * This will not change the theme if the theme is already set. |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
332 * (This is to prevent accidental theme changes if a new |
32539
7194ddfc8158
woo, fixed the bug. Now things are looking wonderfully stable.
tdrhq@soc.pidgin.im
parents:
32538
diff
changeset
|
333 * PurpleConversation gets added. |
32531 | 334 * |
335 * FIXME: it's not at all clear to me as to how | |
336 * Adium themes handle the case when the PurpleConversation | |
337 * changes. | |
338 */ | |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
339 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
340 init_theme_for_webkit(PurpleConversation *conv, char *style_dir) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
341 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
342 GtkWidget *webkit = PIDGIN_CONVERSATION(conv)->webview; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
343 char *header, *footer; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
344 char *template; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
345 |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
346 char* basedir; |
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
347 char* baseuri; |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
348 PidginMessageStyle *style, *oldStyle; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
349 PidginMessageStyle *copy; |
32582 | 350 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
351 oldStyle = g_object_get_data(G_OBJECT(webkit), MESSAGE_STYLE_KEY); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
352 if (oldStyle) |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
353 return; |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
354 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
355 purple_debug_info("webkit", "loading %s\n", style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
356 style = pidgin_message_style_load(style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
357 g_assert(style); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
358 g_assert(style->template_html); /* debugging test? */ |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
359 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
360 basedir = g_build_filename(style->style_dir, "Contents", "Resources", "Template.html", NULL); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
361 baseuri = g_strdup_printf("file://%s", basedir); |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
362 header = replace_header_tokens(style->header_html, conv); |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
363 g_assert(style); |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
364 footer = replace_header_tokens(style->footer_html, conv); |
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
365 template = replace_template_tokens(style, style->template_html, header, footer); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
366 |
32552 | 367 g_assert(template); |
32582 | 368 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
369 purple_debug_info("webkit", "template: %s\n", template); |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
370 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
371 set_theme_webkit_settings(WEBKIT_WEB_VIEW(webkit), style); |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
372 webkit_web_view_load_string(WEBKIT_WEB_VIEW(webkit), template, "text/html", "UTF-8", baseuri); |
32539
7194ddfc8158
woo, fixed the bug. Now things are looking wonderfully stable.
tdrhq@soc.pidgin.im
parents:
32538
diff
changeset
|
373 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
374 copy = pidgin_message_style_copy(style); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
375 g_object_set_data(G_OBJECT(webkit), MESSAGE_STYLE_KEY, copy); |
32582 | 376 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
377 pidgin_message_style_unref(style); |
32540
7b92a2b852db
Cleanly handle webkit destroy events.
tdrhq@soc.pidgin.im
parents:
32539
diff
changeset
|
378 /* I need to unref this style when the webkit object destroys */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
379 g_signal_connect(G_OBJECT(webkit), "destroy", G_CALLBACK(webkit_on_webview_destroy), copy); |
32531 | 380 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
381 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
382 webkit_set_groupchat(GTK_WEBVIEW(webkit)); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
383 g_free(basedir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
384 g_free(baseuri); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
385 g_free(header); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
386 g_free(footer); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
387 g_free(template); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
388 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
389 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
390 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
391 /* restore the non theme version of the conversation window */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
392 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
393 finalize_theme_for_webkit(PurpleConversation *conv) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
394 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
395 GtkWidget *webview = PIDGIN_CONVERSATION(conv)->webview; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
396 PidginMessageStyle *style = g_object_get_data(G_OBJECT(webview), MESSAGE_STYLE_KEY); |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
397 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
398 webkit_web_view_load_string(WEBKIT_WEB_VIEW(webview), "", "text/html", "UTF-8", ""); |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
399 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
400 g_object_set_data(G_OBJECT(webview), MESSAGE_STYLE_KEY, NULL); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
401 pidgin_message_style_unref(style); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
402 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
403 |
32540
7b92a2b852db
Cleanly handle webkit destroy events.
tdrhq@soc.pidgin.im
parents:
32539
diff
changeset
|
404 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
405 webkit_on_webview_destroy(GtkObject *object, gpointer data) |
32540
7b92a2b852db
Cleanly handle webkit destroy events.
tdrhq@soc.pidgin.im
parents:
32539
diff
changeset
|
406 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
407 pidgin_message_style_unref((PidginMessageStyle *)data); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
408 g_object_set_data(G_OBJECT(object), MESSAGE_STYLE_KEY, NULL); |
32540
7b92a2b852db
Cleanly handle webkit destroy events.
tdrhq@soc.pidgin.im
parents:
32539
diff
changeset
|
409 } |
7b92a2b852db
Cleanly handle webkit destroy events.
tdrhq@soc.pidgin.im
parents:
32539
diff
changeset
|
410 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
411 static gboolean |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
412 webkit_on_displaying_im_msg(PurpleAccount *account, |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
413 const char* name, |
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
414 char **pmessage, |
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
415 PurpleConversation *conv, |
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
416 PurpleMessageFlags flags, |
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
417 gpointer data) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
418 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
419 GtkWidget *webkit; |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
420 char *message = *pmessage; |
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
421 const char *alias = name; /* FIXME: signal doesn't give me alias */ |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
422 char *stripped; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
423 char *message_html; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
424 char *msg; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
425 char *escape; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
426 char *script; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
427 char *func = "appendMessage"; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
428 char *smileyed; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
429 time_t mtime = time(NULL); /* FIXME: this should come from the write_conv calback, but the signal doesn't pass this to me */ |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
430 |
32582 | 431 PurpleMessageFlags old_flags = GPOINTER_TO_INT(purple_conversation_get_data(conv, "webkit-lastflags")); |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
432 PidginMessageStyle *style; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
433 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
434 webkit = get_webkit(conv); |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
435 stripped = g_strdup(message); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
436 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
437 style = g_object_get_data(G_OBJECT(webkit), MESSAGE_STYLE_KEY); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
438 g_assert(style); |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
439 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
440 if (flags & PURPLE_MESSAGE_SEND && old_flags & PURPLE_MESSAGE_SEND) { |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
441 message_html = style->outgoing_next_content_html; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
442 func = "appendNextMessage"; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
443 } else if (flags & PURPLE_MESSAGE_SEND) { |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
444 message_html = style->outgoing_content_html; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
445 } else if (flags & PURPLE_MESSAGE_RECV && old_flags & PURPLE_MESSAGE_RECV) { |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
446 message_html = style->incoming_next_content_html; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
447 func = "appendNextMessage"; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
448 } else if (flags & PURPLE_MESSAGE_RECV) { |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
449 message_html = style->incoming_content_html; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
450 } else { |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
451 message_html = style->status_html; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
452 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
453 purple_conversation_set_data(conv, "webkit-lastflags", GINT_TO_POINTER(flags)); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
454 |
32708
10e5000326a5
Convert code to use the purple_account accessor functions.
andrew.victor@mxit.com
parents:
32702
diff
changeset
|
455 smileyed = smiley_parse_markup(stripped, purple_account_get_protocol_id(purple_conversation_get_account(conv))); |
32624
65bad41adf52
Using g_string_new_len here is unnecessary, and a real waste of calls
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32594
diff
changeset
|
456 msg = replace_message_tokens(message_html, conv, name, alias, smileyed, flags, mtime); |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
457 escape = gtk_webview_quote_js_string(msg); |
32532
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
458 script = g_strdup_printf("%s(%s)", func, escape); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
459 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
460 purple_debug_info("webkit", "JS: %s\n", script); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
461 gtk_webview_safe_execute_script(GTK_WEBVIEW(webkit), script); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
462 |
32542
3bd8fb942ea4
Yep, tested, and changed some code from previous commit. This is a hard
tdrhq@soc.pidgin.im
parents:
32541
diff
changeset
|
463 g_free(script); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
464 g_free(smileyed); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
465 g_free(msg); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
466 g_free(stripped); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
467 g_free(escape); |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
468 |
32539
7194ddfc8158
woo, fixed the bug. Now things are looking wonderfully stable.
tdrhq@soc.pidgin.im
parents:
32538
diff
changeset
|
469 return TRUE; /* GtkConv should not handle this IM */ |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
470 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
471 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
472 static gboolean |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
473 webkit_on_displaying_chat_msg(PurpleAccount *account, |
32533 | 474 const char *who, |
475 char **message, | |
476 PurpleConversation *conv, | |
477 PurpleMessageFlags flags, | |
478 gpointer userdata) | |
479 { | |
32539
7194ddfc8158
woo, fixed the bug. Now things are looking wonderfully stable.
tdrhq@soc.pidgin.im
parents:
32538
diff
changeset
|
480 /* handle exactly like an IM message for now */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
481 return webkit_on_displaying_im_msg(account, who, message, conv, flags, NULL); |
32533 | 482 } |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
483 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
484 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
485 webkit_on_conversation_displayed(PidginConversation *gtkconv, gpointer data) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
486 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
487 init_theme_for_webkit(gtkconv->active_conv, cur_style_dir); |
32531 | 488 } |
489 | |
490 static void | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
491 webkit_on_conversation_switched(PurpleConversation *conv, gpointer data) |
32531 | 492 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
493 init_theme_for_webkit(conv, cur_style_dir); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
494 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
495 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
496 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
497 webkit_on_conversation_hiding(PidginConversation *gtkconv, gpointer data) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
498 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
499 /* |
32532
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
500 * I'm not sure if I need to do anything here, but let's keep |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
501 * this anyway. |
32532
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
502 */ |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
503 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
504 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
505 static GList * |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
506 get_dir_dir_list(const char *dirname) |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
507 { |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
508 GList *ret = NULL; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
509 GDir *dir = g_dir_open(dirname, 0, NULL); |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
510 const char* subdir; |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
511 |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
512 if (!dir) return NULL; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
513 while ((subdir = g_dir_read_name(dir))) { |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
514 ret = g_list_append(ret, g_build_filename(dirname, subdir, NULL)); |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
515 } |
32582 | 516 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
517 g_dir_close(dir); |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
518 return ret; |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
519 } |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
520 |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
521 /** |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
522 * Get me a list of all the available themes specified by their |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
523 * directories. I don't guarrantee that these are valid themes, just |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
524 * that they are in the directories for themes. |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
525 */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
526 static GList * |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
527 get_style_directory_list(void) |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
528 { |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
529 char *user_dir, *user_style_dir, *global_style_dir; |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
530 GList *list1, *list2; |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
531 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
532 user_dir = get_absolute_path(purple_user_dir()); |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
533 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
534 user_style_dir = g_build_filename(user_dir, "styles", NULL); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
535 global_style_dir = g_build_filename(DATADIR, "pidgin", "styles", NULL); |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
536 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
537 list1 = get_dir_dir_list(user_style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
538 list2 = get_dir_dir_list(global_style_dir); |
32582 | 539 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
540 g_free(global_style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
541 g_free(user_style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
542 g_free(user_dir); |
32582 | 543 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
544 return g_list_concat(list1, list2); |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
545 } |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
546 |
32547 | 547 /** |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
548 * use heuristics or previous user options to figure out what |
32547 | 549 * theme to use as default in this Pidgin instance. |
550 */ | |
551 static void | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
552 style_set_default(void) |
32547 | 553 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
554 GList *styles = get_style_directory_list(), *iter; |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
555 const char *stylepath = purple_prefs_get_string("/plugins/gtk/adiumthemes/stylepath"); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
556 g_assert(cur_style_dir == NULL); |
32547 | 557 |
32580
23b16f51e15a
Don't crash if we don't have any theme installed.
masca@cpw.pidgin.im
parents:
32575
diff
changeset
|
558 if (stylepath && *stylepath) |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
559 styles = g_list_prepend(styles, g_strdup(stylepath)); |
32547 | 560 |
561 /* pick any one that works. Note that we have first preference | |
562 * for the one in the userdir */ | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
563 for (iter = styles; iter; iter = g_list_next(iter)) { |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
564 PidginMessageStyle *style = pidgin_message_style_load(iter->data); |
32547 | 565 if (style) { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
566 cur_style_dir = (char *)g_strdup(iter->data); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
567 pidgin_message_style_unref(style); |
32547 | 568 break; |
569 } | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
570 purple_debug_info("webkit", "Style %s is invalid\n", (char *)iter->data); |
32547 | 571 } |
572 | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
573 for (iter = styles; iter; iter = g_list_next(iter)) |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
574 g_free(iter->data); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
575 g_list_free(styles); |
32547 | 576 } |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
577 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
578 static gboolean |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
579 plugin_load(PurplePlugin *plugin) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
580 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
581 style_set_default(); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
582 if (!cur_style_dir) |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
583 return FALSE; /* couldn't find a style */ |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
584 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
585 purple_signal_connect(pidgin_conversations_get_handle(), |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
586 "displaying-im-msg", |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
587 webkit_plugin_get_handle(), |
32533 | 588 PURPLE_CALLBACK(webkit_on_displaying_im_msg), |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
589 NULL); |
32582 | 590 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
591 purple_signal_connect(pidgin_conversations_get_handle(), |
32533 | 592 "displaying-chat-msg", |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
593 webkit_plugin_get_handle(), |
32533 | 594 PURPLE_CALLBACK(webkit_on_displaying_chat_msg), |
595 NULL); | |
596 | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
597 purple_signal_connect(pidgin_conversations_get_handle(), |
32531 | 598 "conversation-displayed", |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
599 webkit_plugin_get_handle(), |
32539
7194ddfc8158
woo, fixed the bug. Now things are looking wonderfully stable.
tdrhq@soc.pidgin.im
parents:
32538
diff
changeset
|
600 PURPLE_CALLBACK(webkit_on_conversation_displayed), |
32531 | 601 NULL); |
602 | |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
603 purple_signal_connect(pidgin_conversations_get_handle(), |
32531 | 604 "conversation-switched", |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
605 webkit_plugin_get_handle(), |
32531 | 606 PURPLE_CALLBACK(webkit_on_conversation_switched), |
607 NULL); | |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
608 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
609 purple_signal_connect(pidgin_conversations_get_handle(), |
32532
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
610 "conversation-hiding", |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
611 webkit_plugin_get_handle(), |
32532
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
612 PURPLE_CALLBACK(webkit_on_conversation_hiding), |
32d7d3c4163c
* removed delete_conversation uiops and instead used signals.
tdrhq@soc.pidgin.im
parents:
32531
diff
changeset
|
613 NULL); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
614 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
615 /* finally update each of the existing conversation windows */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
616 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
617 GList *list = purple_get_conversations(); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
618 for (;list; list = g_list_next(list)) |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
619 init_theme_for_webkit(list->data, cur_style_dir); |
32582 | 620 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
621 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
622 return TRUE; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
623 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
624 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
625 static gboolean |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
626 plugin_unload(PurplePlugin *plugin) |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
627 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
628 GList *list; |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
629 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
630 webkit_plugin_free_handle(); |
32550 | 631 cur_style_dir = NULL; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
632 list = purple_get_conversations(); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
633 while (list) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
634 finalize_theme_for_webkit(list->data); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
635 list = g_list_next(list); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
636 } |
32529
50a38bbca397
use displaying-im-msg instead of write_conv uiops.
tdrhq@soc.pidgin.im
parents:
32525
diff
changeset
|
637 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
638 return TRUE; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
639 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
640 |
32561 | 641 /* |
642 * UI config code | |
643 */ | |
644 | |
32549
7d8f8c6ebae2
some code for style_changed and also default any empty file to "" rather than NULL.
tdrhq@soc.pidgin.im
parents:
32548
diff
changeset
|
645 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
646 style_changed(GtkWidget *combobox, gpointer null) |
32549
7d8f8c6ebae2
some code for style_changed and also default any empty file to "" rather than NULL.
tdrhq@soc.pidgin.im
parents:
32548
diff
changeset
|
647 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
648 char *name = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combobox)); |
32554
a6d6b0867cd3
Inform the user about how the theme change takes effect.
tdrhq@soc.pidgin.im
parents:
32553
diff
changeset
|
649 GtkWidget *dialog; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
650 GList *styles = get_style_directory_list(), *iter; |
32549
7d8f8c6ebae2
some code for style_changed and also default any empty file to "" rather than NULL.
tdrhq@soc.pidgin.im
parents:
32548
diff
changeset
|
651 |
32557
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
652 /* find the full path for this name, I wish I could store this info in the combobox itself. :( */ |
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
653 for (iter = styles; iter; iter = g_list_next(iter)) { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
654 char *basename = g_path_get_basename(iter->data); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
655 if (g_str_equal(basename, name)) { |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
656 g_free(basename); |
32557
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
657 break; |
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
658 } |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
659 g_free(basename); |
32557
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
660 } |
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
661 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
662 g_assert(iter); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
663 g_free(name); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
664 g_free(cur_style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
665 cur_style_dir = g_strdup(iter->data);; |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
666 purple_prefs_set_string("/plugins/gtk/adiumthemes/stylepath", cur_style_dir); |
32554
a6d6b0867cd3
Inform the user about how the theme change takes effect.
tdrhq@soc.pidgin.im
parents:
32553
diff
changeset
|
667 |
a6d6b0867cd3
Inform the user about how the theme change takes effect.
tdrhq@soc.pidgin.im
parents:
32553
diff
changeset
|
668 /* inform the user that existing conversations haven't changed */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
669 dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "The style for existing conversations have not been changed. Please close and re-open the conversation for the changes to take effect."); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
670 g_assert(dialog); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
671 gtk_widget_show(dialog); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
672 g_signal_connect_swapped(dialog, "response", G_CALLBACK(gtk_widget_destroy), dialog); |
32549
7d8f8c6ebae2
some code for style_changed and also default any empty file to "" rather than NULL.
tdrhq@soc.pidgin.im
parents:
32548
diff
changeset
|
673 } |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
674 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
675 static GtkWidget * |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
676 get_style_config_frame(void) |
32548
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
677 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
678 GtkWidget *combobox = gtk_combo_box_new_text(); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
679 GList *styles = get_style_directory_list(), *iter; |
32548
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
680 int index = 0, selected = 0; |
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
681 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
682 for (iter = styles; iter; iter = g_list_next(iter)) { |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
683 PidginMessageStyle *style = pidgin_message_style_load(iter->data); |
32582 | 684 |
32548
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
685 if (style) { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
686 char *text = g_path_get_basename(iter->data); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
687 gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), text); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
688 g_free(text); |
32557
d5b2b5021851
Show only the MessageStyle name and not the entire path.
tdrhq@soc.pidgin.im
parents:
32556
diff
changeset
|
689 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
690 if (g_str_equal(iter->data, cur_style_dir)) |
32548
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
691 selected = index; |
32554
a6d6b0867cd3
Inform the user about how the theme change takes effect.
tdrhq@soc.pidgin.im
parents:
32553
diff
changeset
|
692 index++; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
693 pidgin_message_style_unref(style); |
32548
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
694 } |
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
695 } |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
696 gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), selected); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
697 g_signal_connect_after(G_OBJECT(combobox), "changed", G_CALLBACK(style_changed), NULL); |
32548
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
698 return combobox; |
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
699 } |
1c84e102c8ee
some code to get a list of styles and blah blah.
tdrhq@soc.pidgin.im
parents:
32547
diff
changeset
|
700 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
701 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
702 variant_update_conversation(PurpleConversation *conv) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
703 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
704 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
705 WebKitWebView *webview = WEBKIT_WEB_VIEW(gtkconv->webview); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
706 PidginMessageStyle *style = (PidginMessageStyle *)g_object_get_data(G_OBJECT(webview), MESSAGE_STYLE_KEY); |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
707 char *script; |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
708 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
709 g_assert(style); |
32538
3b1a130f7e88
more changes, but I still can't find the stupid bug. Valgrind gives me some information
tdrhq@soc.pidgin.im
parents:
32537
diff
changeset
|
710 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
711 script = g_strdup_printf("setStylesheet(\"mainStyle\",\"%s\")", pidgin_message_style_get_css(style)); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
712 gtk_webview_safe_execute_script(GTK_WEBVIEW(webview), script); |
32563
c0cc4d60ac5c
hmm, fonts and font sizes from Info.plist.
tdrhq@soc.pidgin.im
parents:
32562
diff
changeset
|
713 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
714 set_theme_webkit_settings(WEBKIT_WEB_VIEW(gtkconv->webview), style); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
715 g_free(script); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
716 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
717 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
718 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
719 variant_changed(GtkWidget* combobox, gpointer null) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
720 { |
32561 | 721 char *name; |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
722 GList *list; |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
723 PidginMessageStyle *style = pidgin_message_style_load(cur_style_dir); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
724 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
725 g_assert(style); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
726 name = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combobox)); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
727 pidgin_message_style_set_variant(style, name); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
728 pidgin_message_style_save_state(style); |
32582 | 729 |
32561 | 730 /* update conversations */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
731 list = purple_get_conversations(); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
732 while (list) { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
733 variant_update_conversation(list->data); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
734 list = g_list_next(list); |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
735 } |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
736 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
737 g_free(name); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
738 pidgin_message_style_unref(style); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
739 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
740 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
741 static GtkWidget * |
32582 | 742 get_variant_config_frame() |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
743 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
744 PidginMessageStyle *style = pidgin_message_style_load(cur_style_dir); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
745 GList *variants = pidgin_message_style_get_variants(style), *iter; |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
746 char *cur_variant = pidgin_message_style_get_variant(style); |
32582 | 747 GtkWidget *combobox = gtk_combo_box_new_text(); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
748 int def = -1, index = 0; |
32537
9ad4257f5e8f
Ok, good part of this work of moving global variables to defined styles is
tdrhq@soc.pidgin.im
parents:
32536
diff
changeset
|
749 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
750 pidgin_message_style_unref(style); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
751 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
752 for (iter = variants; iter; iter = g_list_next(iter)) { |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
753 gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), iter->data); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
754 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
755 if (g_str_equal(cur_variant, iter->data)) |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
756 def = index; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
757 index ++; |
32582 | 758 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
759 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
760 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
761 gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), def); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
762 g_signal_connect(G_OBJECT(combobox), "changed", G_CALLBACK(variant_changed), NULL); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
763 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
764 return combobox; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
765 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
766 |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
767 static void |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
768 style_changed_reset_variants(GtkWidget* combobox, gpointer table) |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
769 { |
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
770 /* I hate to do this, I swear. But I don't know how to cleanly clean an existing combobox */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
771 GtkWidget* variants = g_object_get_data(G_OBJECT(table), "variants-cbox"); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
772 gtk_widget_destroy(variants); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
773 variants = get_variant_config_frame(); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
774 gtk_table_attach_defaults(GTK_TABLE(table), variants, 1, 2, 1, 2); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
775 gtk_widget_show_all(GTK_WIDGET(table)); |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
776 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
777 g_object_set_data(G_OBJECT(table), "variants-cbox", variants); |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
778 } |
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
779 |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
780 static GtkWidget* |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
781 get_config_frame(PurplePlugin* plugin) |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
782 { |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
783 GtkWidget *table = gtk_table_new(2, 2, FALSE); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
784 GtkWidget *style_config = get_style_config_frame(); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
785 GtkWidget *variant_config = get_variant_config_frame(); |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
786 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
787 gtk_table_attach_defaults(GTK_TABLE(table), gtk_label_new("Message Style"), 0, 1, 0, 1); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
788 gtk_table_attach_defaults(GTK_TABLE(table), style_config, 1, 2, 0, 1); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
789 gtk_table_attach_defaults(GTK_TABLE(table), gtk_label_new("Style Variant"), 0, 1, 1, 2); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
790 gtk_table_attach_defaults(GTK_TABLE(table), variant_config, 1, 2, 1, 2); |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
791 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
792 g_object_set_data(G_OBJECT(table), "variants-cbox", variant_config); |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
793 /* to clarify, this is a second signal connected on style config */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
794 g_signal_connect_after(G_OBJECT(style_config), "changed", G_CALLBACK(style_changed_reset_variants), table); |
32556
d25e6f4a239a
Reset the list of variants when the MessageStyle is changed.
tdrhq@soc.pidgin.im
parents:
32555
diff
changeset
|
795 |
32555
d1ed820fa416
use a table to display the options neatly.
tdrhq@soc.pidgin.im
parents:
32554
diff
changeset
|
796 return table; |
32545
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
797 } |
d60517f63f99
partial work towards theme selection.
tdrhq@soc.pidgin.im
parents:
32544
diff
changeset
|
798 |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
799 PidginPluginUiInfo ui_info = |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
800 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
801 get_config_frame, |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
802 0, /* page_num (Reserved) */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
803 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
804 /* padding */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
805 NULL, |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
806 NULL, |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
807 NULL, |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
808 NULL |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
809 }; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
810 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
811 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
812 static PurplePluginInfo info = |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
813 { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
814 PURPLE_PLUGIN_MAGIC, /* Magic */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
815 PURPLE_MAJOR_VERSION, /* Purple Major Version */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
816 PURPLE_MINOR_VERSION, /* Purple Minor Version */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
817 PURPLE_PLUGIN_STANDARD, /* plugin type */ |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
818 PIDGIN_PLUGIN_TYPE, /* ui requirement */ |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
819 0, /* flags */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
820 NULL, /* dependencies */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
821 PURPLE_PRIORITY_DEFAULT, /* priority */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
822 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
823 PLUGIN_ID, /* plugin id */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
824 NULL, /* name */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
825 "0.1", /* version */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
826 NULL, /* summary */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
827 NULL, /* description */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
828 PLUGIN_AUTHOR, /* author */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
829 "http://pidgin.im", /* website */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
830 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
831 plugin_load, /* load */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
832 plugin_unload, /* unload */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
833 NULL, /* destroy */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
834 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
835 &ui_info, /* ui_info */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
836 NULL, /* extra_info */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
837 NULL, /* prefs_info */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
838 NULL, /* actions */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
839 NULL, /* reserved 1 */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
840 NULL, /* reserved 2 */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
841 NULL, /* reserved 3 */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
842 NULL /* reserved 4 */ |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
843 }; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
844 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
845 static void |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
846 init_plugin(PurplePlugin *plugin) { |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
847 info.name = "Adium IMs"; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
848 info.summary = "Adium-like IMs with Pidgin"; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
849 info.description = "You can chat in Pidgin using Adium's WebKit view."; |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
850 |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
851 purple_prefs_add_none("/plugins"); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
852 purple_prefs_add_none("/plugins/gtk"); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
853 purple_prefs_add_none("/plugins/gtk/adiumthemes"); |
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
854 purple_prefs_add_string("/plugins/gtk/adiumthemes/stylepath", ""); |
32525
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
855 } |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
856 |
d0be198c4694
other files that missed my main major commit.
tdrhq@soc.pidgin.im
parents:
diff
changeset
|
857 PURPLE_INIT_PLUGIN(webkit, init_plugin, info) |
32594
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
858 |