--- a/pidgin/plugins/adiumthemes/webkit.c Sat Feb 06 22:18:05 2010 +0000
+++ b/pidgin/plugins/adiumthemes/webkit.c Thu Jun 16 04:23:48 2011 +0000
@@ -26,7 +26,7 @@
* A lot of this was originally written by Sean Egan, but I think I've
* rewrote enough to replace the author for now.
-#define PLUGIN_AUTHOR "Arnold Noronha <arnstein87@gmail.com>"
+#define PLUGIN_AUTHOR "Arnold Noronha <arnstein87@gmail.com>" #define PURPLE_PLUGINS "Hell yeah"
@@ -74,7 +74,7 @@
glist_free_all_string (GList *list)
- for (; list; list = g_list_next (list))
+ for (; list; list = g_list_next (list)) @@ -95,13 +95,13 @@
- PurpleConversation *conv,
- PurpleMessageFlags flags,
+ PurpleConversation *conv, + PurpleMessageFlags flags, GString *str = g_string_new_len(NULL, len);
@@ -111,7 +111,7 @@
while ((cur = strchr(cur, '%'))) {
const char *replace = NULL;
if (!strncmp(cur, "%message%", strlen("%message%"))) {
} else if (!strncmp(cur, "%messageClasses%", strlen("%messageClasses%"))) {
@@ -126,7 +126,7 @@
format = g_strndup(start, end - start);
replace = purple_utf8_strftime(format ? format : "%X", NULL);
} else if (!strncmp(cur, "%userIconPath%", strlen("%userIconPath%"))) {
@@ -147,7 +147,7 @@
replace = g_build_filename("Incoming", "buddy_icon.png", NULL);
} else if (!strncmp(cur, "%senderScreenName%", strlen("%senderScreenName%"))) {
} else if (!strncmp(cur, "%sender%", strlen("%sender%"))) {
@@ -165,13 +165,13 @@
/* And update the pointers */
prev = cur = strchr(cur + 1, '%') + 1;
g_string_append(str, prev);
return g_string_free(str, FALSE);
@@ -191,24 +191,24 @@
const char *replace = NULL;
- if (!strncmp(cur, "%chatName%", strlen("%chatName%"))) {
+ if (!strncmp(cur, "%chatName%", strlen("%chatName%"))) { - } else if (!strncmp(cur, "%sourceName%", strlen("%sourceName%"))) {
+ } else if (!strncmp(cur, "%sourceName%", strlen("%sourceName%"))) { replace = purple_account_get_alias(conv->account);
replace = purple_account_get_username(conv->account);
- } else if (!strncmp(cur, "%destinationName%", strlen("%destinationName%"))) {
+ } else if (!strncmp(cur, "%destinationName%", strlen("%destinationName%"))) { PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
replace = purple_buddy_get_alias(buddy);
- } else if (!strncmp(cur, "%incomingIconPath%", strlen("%incomingIconPath%"))) {
+ } else if (!strncmp(cur, "%incomingIconPath%", strlen("%incomingIconPath%"))) { PurpleBuddyIcon *icon = purple_conv_im_get_icon(PURPLE_CONV_IM(conv));
replace = purple_buddy_icon_get_full_path(icon);
- } else if (!strncmp(cur, "%outgoingIconPath%", strlen("%outgoingIconPath%"))) {
- } else if (!strncmp(cur, "%timeOpened", strlen("%timeOpened"))) {
+ } else if (!strncmp(cur, "%outgoingIconPath%", strlen("%outgoingIconPath%"))) { + } else if (!strncmp(cur, "%timeOpened", strlen("%timeOpened"))) { if (*(cur + strlen("%timeOpened")) == '{') {
char *start = cur + strlen("%timeOpened") + 1;
@@ -217,7 +217,7 @@
format = g_strndup(start, end - start);
replace = purple_utf8_strftime(format ? format : "%X", NULL);
@@ -230,12 +230,12 @@
/* And update the pointers */
prev = cur = strchr(cur + 1, '%') + 1;
g_string_append(str, prev);
return g_string_free(str, FALSE);
@@ -278,7 +278,7 @@
g_string_append(str, footer);
g_string_append(str, ms[5]);
return g_string_free (str, FALSE);
@@ -291,7 +291,7 @@
gtkconv = PIDGIN_CONVERSATION(conv);
@@ -302,7 +302,7 @@
g_object_get (G_OBJECT(webview), "settings", &settings, NULL);
if (style->default_font_family)
g_object_set (G_OBJECT (settings), "default-font-family", style->default_font_family, NULL);
if (style->default_font_size)
g_object_set (G_OBJECT (settings), "default-font-size", GINT_TO_POINTER (style->default_font_size), NULL);
@@ -347,7 +347,7 @@
PidginMessageStyle *style, *oldStyle;
oldStyle = g_object_get_data (G_OBJECT(webkit), MESSAGE_STYLE_KEY);
purple_debug_info ("webkit", "loading %s\n", style_dir);
@@ -363,7 +363,7 @@
template = replace_template_tokens(style, style->template_html, strlen(style->template_html) + strlen(style->header_html), header, footer);
purple_debug_info ("webkit", "template: %s\n", template);
set_theme_webkit_settings (WEBKIT_WEB_VIEW(webkit), style);
@@ -371,7 +371,7 @@
PidginMessageStyle *copy = pidgin_message_style_copy (style);
g_object_set_data (G_OBJECT(webkit), MESSAGE_STYLE_KEY, copy);
pidgin_message_style_unref (style);
/* I need to unref this style when the webkit object destroys */
g_signal_connect (G_OBJECT(webkit), "destroy", G_CALLBACK(webkit_on_webview_destroy), copy);
@@ -425,7 +425,7 @@
time_t mtime = time (NULL); /* FIXME: this should come from the write_conv calback, but the signal doesn't pass this to me */
- PurpleMessageFlags old_flags = GPOINTER_TO_INT(purple_conversation_get_data(conv, "webkit-lastflags"));
+ PurpleMessageFlags old_flags = GPOINTER_TO_INT(purple_conversation_get_data(conv, "webkit-lastflags")); PidginMessageStyle *style;
fprintf (stderr, "hmm.. here %s %s\n", name, message);
@@ -510,7 +510,7 @@
while ((subdir = g_dir_read_name (dir))) {
ret = g_list_append (ret, g_build_filename (dirname, subdir, NULL));
@@ -533,11 +533,11 @@
list1 = get_dir_dir_list (user_style_dir);
list2 = get_dir_dir_list (global_style_dir);
g_free (global_style_dir);
return g_list_concat (list1, list2);
@@ -557,7 +557,7 @@
purple_notify_error(handle, _("Webkit themes"),
_("Can't find installed styles"),
- _("Please install some theme and verify the installation path"));
+ _("Please install some theme and verify the installation path")); @@ -590,7 +590,7 @@
webkit_plugin_get_handle (),
PURPLE_CALLBACK(webkit_on_displaying_im_msg),
purple_signal_connect (pidgin_conversations_get_handle (),
webkit_plugin_get_handle (),
@@ -620,7 +620,7 @@
GList* list = purple_get_conversations ();
for (;list; list = g_list_next(list))
init_theme_for_webkit (list->data, cur_style_dir);
@@ -684,7 +684,7 @@
for (iter = styles; iter; iter = g_list_next (iter)) {
PidginMessageStyle *style = pidgin_message_style_load (iter->data);
char *text = g_path_get_basename (iter->data);
gtk_combo_box_append_text (GTK_COMBO_BOX(combobox), text);
@@ -729,7 +729,7 @@
name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
pidgin_message_style_set_variant (style, name);
pidgin_message_style_save_state (style);
/* update conversations */
list = purple_get_conversations ();
@@ -742,12 +742,12 @@
-get_variant_config_frame()
+get_variant_config_frame() PidginMessageStyle *style = pidgin_message_style_load (cur_style_dir);
GList *variants = pidgin_message_style_get_variants (style), *iter;
char *cur_variant = pidgin_message_style_get_variant (style);
- GtkWidget *combobox = gtk_combo_box_new_text();
+ GtkWidget *combobox = gtk_combo_box_new_text(); pidgin_message_style_unref (style);
@@ -758,7 +758,7 @@
if (g_str_equal (cur_variant, iter->data))
gtk_combo_box_set_active (GTK_COMBO_BOX(combobox), def);