pidgin: b2895a63: Mark webkit-related missing functionalit...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Sep 21 03:46:35 EDT 2011


----------------------------------------------------------------------
Revision: b2895a63d7260a2b4435f9d2182aae83f5960730
Parent:   6b6dc5c26a509d3f927a21d89147b6abad5684d8
Author:   markdoliner at pidgin.im
Date:     09/21/11 03:39:32
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b2895a63d7260a2b4435f9d2182aae83f5960730

Changelog: 

Mark webkit-related missing functionality with "TODO WEBKIT" instead of
"FIXME".  Should make it easier to grep for.

Changes against parent 6b6dc5c26a509d3f927a21d89147b6abad5684d8

  patched  pidgin/gtkconv.c
  patched  pidgin/gtkdialogs.c
  patched  pidgin/gtkthemes.c
  patched  pidgin/gtkutils.c
  patched  pidgin/gtkutils.h
  patched  pidgin/gtkwebview.c
  patched  pidgin/gtkwebview.h

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	afddf7eadbf36f4dd5b692714d9b9883c714bdb6
+++ pidgin/gtkconv.c	1482d1f74f1547edf9c99252e5d4961d40b44ddd
@@ -1052,7 +1052,35 @@ savelog_writefile_cb(void *user_data, co
 static void
 savelog_writefile_cb(void *user_data, const char *filename)
 {
-	/* TODO: I don't know how to support this using webkit yet. */
+	/* TODO WEBKIT: I don't know how to support this using webkit yet. */
+#if 0
+	PurpleConversation *conv = (PurpleConversation *)user_data;
+	FILE *fp;
+	const char *name;
+	char **lines;
+	gchar *text;
+
+	if ((fp = g_fopen(filename, "w+")) == NULL) {
+		purple_notify_error(PIDGIN_CONVERSATION(conv), NULL, _("Unable to open file."), NULL);
+		return;
+	}
+
+	name = purple_conversation_get_name(conv);
+	fprintf(fp, "<html>\n<head>\n");
+	fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n");
+	fprintf(fp, "<title>%s</title>\n</head>\n<body>\n", name);
+	fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name);
+
+	lines = gtk_imhtml_get_markup_lines(
+		GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml));
+	text = g_strjoinv("<br>\n", lines);
+	fprintf(fp, "%s", text);
+	g_free(text);
+	g_strfreev(lines);
+
+	fprintf(fp, "\n</body>\n</html>\n");
+	fclose(fp);
+#endif /* if 0 */
 }
 
 /*
@@ -1594,7 +1622,7 @@ menu_last_said_cb(GtkWidget *w, PidginCo
 static void
 menu_last_said_cb(GtkWidget *w, PidginConversation *gtkconv)
 {
-/* FIXME: This doesn't work yet, of course... */
+/* TODO WEBKIT: This doesn't work yet, of course... */
 #if 0
 	GtkTextMark *mark;
 	const char *who;
@@ -1606,7 +1634,7 @@ menu_last_said_cb(GtkWidget *w, PidginCo
 		gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(gtkconv->imhtml), mark, 0.1, FALSE, 0, 0);
 	else
 		g_return_if_reached();
-#endif
+#endif /* if 0 */
 }
 
 static GtkWidget *
@@ -1811,13 +1839,13 @@ right_click_chat_cb(GtkWidget *widget, G
 		chat_do_im(gtkconv, who);
 	} else if (event->button == 2 && event->type == GDK_BUTTON_PRESS) {
 		/* Move to user's anchor */
-/* FIXME: This isn't implemented yet. */
+/* TODO WEBKIT: This isn't implemented yet. */
 #if 0
 		GtkTextMark *mark = get_mark_for_user(gtkconv, who);
 
 		if(mark != NULL)
 			gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(gtkconv->imhtml), mark, 0.1, FALSE, 0, 0);
-#endif
+#endif /* if 0 */
 	} else if (event->button == 3 && event->type == GDK_BUTTON_PRESS) {
 		GtkWidget *menu = create_chat_menu (conv, who, gc);
 		gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
@@ -2152,19 +2180,19 @@ entry_key_press_cb(GtkWidget *entry, Gdk
 
 		case GDK_Page_Up:
 		case GDK_KP_Page_Up:
-/* FIXME: Write this. */
+/* TODO WEBKIT: Write this. */
 #if 0
 			gtk_imhtml_page_up(GTK_IMHTML(gtkconv->imhtml));
-#endif
+#endif /* if 0 */
 			return TRUE;
 			break;
 
 		case GDK_Page_Down:
 		case GDK_KP_Page_Down:
-/* FIXME: Write this. */
+/* TODO WEBKIT: Write this. */
 #if 0
 			gtk_imhtml_page_down(GTK_IMHTML(gtkconv->imhtml));
-#endif
+#endif /* if 0 */
 			return TRUE;
 			break;
 
@@ -2274,7 +2302,7 @@ pidgin_conv_switch_active_conversation(P
 	entry = GTK_IMHTML(gtkconv->entry);
 	protocol_name = purple_account_get_protocol_name(conv->account);
 	gtk_imhtml_set_protocol_name(entry, protocol_name);
-	/* FIXME: gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol_name); */
+	/* TODO WEBKIT: gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol_name); */
 
 	if (!(conv->features & PURPLE_CONNECTION_HTML))
 		gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
@@ -3663,7 +3691,7 @@ update_typing_message(PidginConversation
 static void
 update_typing_message(PidginConversation *gtkconv, const char *message)
 {
-	/* FIXME: this is not handled at all */
+	/* TODO WEBKIT: this is not handled at all */
 #if 0
 	GtkTextBuffer *buffer;
 	GtkTextMark *stmark, *enmark;
@@ -3697,7 +3725,7 @@ update_typing_message(PidginConversation
 		gtk_text_buffer_get_end_iter(buffer, &iter);
 		gtk_text_buffer_create_mark(buffer, "typing-notification-end", &iter, TRUE);
 	}
-#endif
+#endif /* if 0 */
 }
 
 static void
@@ -3939,7 +3967,7 @@ generate_send_to_items(PidginWindow *win
 						continue;
 
 					account = purple_buddy_get_account(buddy);
-					/* FIXME: */
+					/* TODO WEBKIT: (I'm not actually sure if this is webkit-related --Mark Doliner) */
 					if (purple_account_is_connected(account) /*|| account == gtkconv->active_conv->account*/)
 					{
 						/* Use the PurplePresence to get unique buddies. */
@@ -4053,12 +4081,12 @@ add_chat_buddy_common(PurpleConversation
 
 	if (is_me) {
 #if 0
-		/* FIXME: No tags in webkit stuff, yet. */
+		/* TODO WEBKIT: No tags in webkit stuff, yet. */
 		GtkTextTag *tag = gtk_text_tag_table_lookup(
 				gtk_text_buffer_get_tag_table(GTK_IMHTML(gtkconv->webview)->text_buffer),
 				"send-name");
 		g_object_get(tag, "foreground-gdk", &color, NULL);
-#endif
+#endif /* if 0 */
 	} else {
 		GtkTextTag *tag;
 		if ((tag = get_buddy_tag(conv, name, 0, FALSE)))
@@ -5495,7 +5523,7 @@ static void set_typing_font(GtkWidget *w
 
 static void set_typing_font(GtkWidget *widget, GtkStyle *style, PidginConversation *gtkconv)
 {
-/* FIXME */
+/* TODO WEBKIT */
 #if 0
 	static PangoFontDescription *font_desc = NULL;
 	static GdkColor *color = NULL;
@@ -5527,7 +5555,7 @@ static void set_typing_font(GtkWidget *w
 	}
 
 	g_signal_handlers_disconnect_by_func(G_OBJECT(widget), set_typing_font, gtkconv);
-#endif
+#endif /* if 0 */
 }
 
 /**************************************************************************
@@ -5883,7 +5911,7 @@ static GtkTextTag *get_buddy_tag(PurpleC
 static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, PurpleMessageFlags flag,
 		gboolean create)
 {
-/* FIXME */
+/* TODO WEBKIT */
 #if 0
 	PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
 	GtkTextTag *buddytag;
@@ -5918,7 +5946,7 @@ static GtkTextTag *get_buddy_tag(PurpleC
 	g_free(str);
 
 	return buddytag;
-#endif
+#endif /* if 0 */
 	return NULL;
 }
 
@@ -6335,7 +6363,7 @@ pidgin_conv_write_conv(PurpleConversatio
 
 		g_free(alias_escaped);
 
-		/* FIXME: */
+		/* TODO WEBKIT */
 #if 0
 		if (tagname)
 			tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), tagname);
@@ -6354,7 +6382,7 @@ pidgin_conv_write_conv(PurpleConversatio
 					color ? "COLOR=\"" : "", color ? color : "", color ? "\"" : "", mdate);
 			gtk_webview_append_html (GTK_WEBVIEW(gtkconv->webview), buf2);
 		}
-#endif
+#endif /* if 0 */
 		g_snprintf(buf2, BUF_LONG, "<font %s>%s</font> ", sml_attrib ? sml_attrib : "", str);
 		gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), buf2);
 
@@ -6651,7 +6679,7 @@ add_custom_smiley_for_webview(GtkWebView
 static gboolean
 add_custom_smiley_for_webview(GtkWebView *webview, const char *sml, const char *smile)
 {
-	/* FIXME: Smileys need to be added to webkit stuff */
+	/* TODO WEBKIT: Smileys need to be added to webkit stuff */
 	return TRUE;
 }
 
@@ -6696,7 +6724,7 @@ pidgin_conv_custom_smiley_write(PurpleCo
 pidgin_conv_custom_smiley_write(PurpleConversation *conv, const char *smile,
                                       const guchar *data, gsize size)
 {
-/* FIXME */
+/* TODO WEBKIT */
 #if 0
 	PidginConversation *gtkconv;
 	GtkIMHtmlSmiley *smiley;
@@ -6732,13 +6760,13 @@ pidgin_conv_custom_smiley_write(PurpleCo
 		g_object_unref(G_OBJECT(smiley->loader));
 		smiley->loader = gdk_pixbuf_loader_new();
 	}
-#endif
+#endif /* if 0 */
 }
 
 static void
 pidgin_conv_custom_smiley_close(PurpleConversation *conv, const char *smile)
 {
-/* FIXME*/
+/* TODO WEBKIT */
 #if 0
 	PidginConversation *gtkconv;
 	GtkIMHtmlSmiley *smiley;
@@ -6776,7 +6804,7 @@ pidgin_conv_custom_smiley_close(PurpleCo
 		g_object_unref(G_OBJECT(smiley->loader));
 		smiley->loader = gdk_pixbuf_loader_new();
 	}
-#endif
+#endif /* if 0 */
 }
 
 static void
@@ -7630,11 +7658,11 @@ show_timestamps_pref_cb(const char *name
 		        GTK_CHECK_MENU_ITEM(win->menu.show_timestamps),
 		        (gboolean)GPOINTER_TO_INT(value));
 
-/* FIXME: Use WebKit version of this. */
+/* TODO WEBKIT: Use WebKit version of this. */
 #if 0
 		gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),
 			(gboolean)GPOINTER_TO_INT(value));
-#endif
+#endif /* if 0 */
 	}
 }
 
============================================================
--- pidgin/gtkutils.c	79712767efd9345420d1f271cae3018d0e127014
+++ pidgin/gtkutils.c	936d5ce28bad69f8c8c415d17b1a86a399594032
@@ -308,9 +308,9 @@ pidgin_create_webview(gboolean editable,
 
 	webview = gtk_webview_new();
 #if 0
-	/* FIXME: Don't have editable webview yet. */
+	/* TODO WEBKIT: Don't have editable webview yet. */
 	gtk_webview_set_editable(GTK_WEBVIEW(webview), editable);
-#endif
+#endif /* if 0 */
 #ifdef USE_GTKSPELL
 	if (editable && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck"))
 		pidgin_setup_gtkspell(GTK_TEXT_VIEW(webview));
============================================================
--- pidgin/gtkutils.h	985acb17aa9698ff4db57fafaa17fae52f19e234
+++ pidgin/gtkutils.h	9064b2a0f8e364f5899f62ed8f12fee05471f5ea
@@ -112,7 +112,7 @@ GtkWidget *pidgin_create_imhtml(gboolean
  * Create an GtkWebView widget and associated GtkIMHtmlToolbar widget.  This
  * function puts both widgets in a nice GtkFrame.  They're separated by an
  * attractive GtkSeparator.
- * FIXME: There is no editable GtkWebView yet.
+ * TODO WEBKIT: editable isn't supported yet
  *
  * @param editable @c TRUE if this webview should be editable.  If this is
  *        @c FALSE, then the toolbar will NOT be created.  If this webview
@@ -126,6 +126,7 @@ GtkWidget *pidgin_create_imhtml(gboolean
  *        Otherwise this will be set to @c NULL.
  * @param sw_ret This will be filled with a pointer to the scrolled window
  *        widget which contains the webview.
+ *
  * @return The GtkFrame containing the toolbar and webview.
  */
 GtkWidget *pidgin_create_webview(gboolean editable, GtkWidget **webview_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret);
============================================================
--- pidgin/gtkdialogs.c	d0f8b94456e0f18ed2d4662429bc7b4b0b42f3a3
+++ pidgin/gtkdialogs.c	71888f0393d70be77133b6fc846da880e2df5017
@@ -450,13 +450,13 @@ pidgin_build_help_dialog(const char *tit
 	gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0);
 
 	frame = pidgin_create_webview(FALSE, &webview, NULL, NULL);
-	/* FIXME: Compile now and fix it later when we have a proper replacement for this function
+	/* TODO WEBKIT: Compile now and fix it later when we have a proper replacement for this function
 	gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY);
 	*/
 	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 
 	gtk_webview_append_html(GTK_WEBVIEW(webview), string->str);
-	/* FIXME: This doesn't seem to stay at the top. */
+	/* TODO WEBKIT: This doesn't seem to stay at the top. */
 	webkit_web_view_move_cursor(WEBKIT_WEB_VIEW(webview), GTK_MOVEMENT_BUFFER_ENDS, -1);
 
 	button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE,
============================================================
--- pidgin/gtkthemes.c	b2c017da275788ff321a0ec65aff345ddd26445e
+++ pidgin/gtkthemes.c	6f40a62c6138855d33c366bd1c15349d2edb6bfd
@@ -122,7 +122,7 @@ static void _pidgin_themes_smiley_themei
 
 static void _pidgin_themes_smiley_themeize(GtkWidget *imhtml, gboolean custom)
 {
-	/* FIXME: move imhtml dependency to use webview. */
+	/* TODO WEBKIT: move imhtml dependency to use webview. */
 #if 0
 	struct smiley_list *list;
 	if (!current_smiley_theme)
@@ -149,7 +149,7 @@ static void _pidgin_themes_smiley_themei
 
 		list = list->next;
 	}
-#endif
+#endif /* if 0 */
 }
 
 void pidgin_themes_smiley_themeize(GtkWidget *imhtml)
============================================================
--- pidgin/gtkwebview.c	ed16b0a86f045c7bd0ca2483f3b46367722e5957
+++ pidgin/gtkwebview.c	9522eec752ae34fcba7b20f13beb716927e3cdc9
@@ -43,7 +43,7 @@ struct GtkWebViewPriv {
 
 struct GtkWebViewPriv {
 	GHashTable *images; /**< a map from id to temporary file for the image */
-	gboolean    empty;  /**< whether anything has been appended **/
+	gboolean empty;  /**< whether anything has been appended **/
 
 	/* JS execute queue */
 	GQueue *js_queue;
============================================================
--- pidgin/gtkwebview.h	108d5500d697ab29ae5321dd5dd652e542d0b1da
+++ pidgin/gtkwebview.h	b1c755853aeb6adca057a34c1a980cf89de3a46b
@@ -103,9 +103,9 @@ void gtk_webview_load_html_string_with_i
 void gtk_webview_load_html_string_with_imgstore(GtkWebView *webview, const char *html);
 
 /**
- * FIXME: (To be changed, right now it just tests whether an append has been
- * called since the last clear or since the Widget was created. So it
- * does not test for load_string's called in between.
+ * TODO WEBKIT: Right now this just tests whether an append has been called
+ * since the last clear or since the Widget was created.  So it does not
+ * test for load_string's called in between.
  *
  * @param webview The GtkWebView object
  *


More information about the Commits mailing list