changeset 32660:68fe7b5211a7

Mark webkit-related missing functionality with "TODO WEBKIT" instead of "FIXME". Should make it easier to grep for.
author Mark Doliner <mark@kingant.net>
date Wed, 21 Sep 2011 07:39:32 +0000
parents 3af16402f176
children 8340143e1bd7
files pidgin/gtkconv.c pidgin/gtkdialogs.c pidgin/gtkthemes.c pidgin/gtkutils.c pidgin/gtkutils.h pidgin/gtkwebview.c pidgin/gtkwebview.h
diffstat 7 files changed, 68 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkconv.c	Wed Sep 21 07:39:32 2011 +0000
@@ -1052,7 +1052,35 @@
 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 @@
 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 @@
 		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 @@
 		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 @@
 
 		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 @@
 	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 @@
 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 @@
 		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 @@
 						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 @@
 
 	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 *widget, GtkStyle *style, PidginConversation *gtkconv)
 {
-/* FIXME */
+/* TODO WEBKIT */
 #if 0
 	static PangoFontDescription *font_desc = NULL;
 	static GdkColor *color = NULL;
@@ -5527,7 +5555,7 @@
 	}
 
 	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(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 @@
 	g_free(str);
 
 	return buddytag;
-#endif
+#endif /* if 0 */
 	return NULL;
 }
 
@@ -6335,7 +6363,7 @@
 
 		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 @@
 					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 @@
 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(PurpleConversation *conv, const char *smile,
                                       const guchar *data, gsize size)
 {
-/* FIXME */
+/* TODO WEBKIT */
 #if 0
 	PidginConversation *gtkconv;
 	GtkIMHtmlSmiley *smiley;
@@ -6732,13 +6760,13 @@
 		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 @@
 		g_object_unref(G_OBJECT(smiley->loader));
 		smiley->loader = gdk_pixbuf_loader_new();
 	}
-#endif
+#endif /* if 0 */
 }
 
 static void
@@ -7630,11 +7658,11 @@
 		        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 */
 	}
 }
 
--- a/pidgin/gtkdialogs.c	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkdialogs.c	Wed Sep 21 07:39:32 2011 +0000
@@ -450,13 +450,13 @@
 	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,
--- a/pidgin/gtkthemes.c	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkthemes.c	Wed Sep 21 07:39:32 2011 +0000
@@ -122,7 +122,7 @@
 
 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 @@
 
 		list = list->next;
 	}
-#endif
+#endif /* if 0 */
 }
 
 void pidgin_themes_smiley_themeize(GtkWidget *imhtml)
--- a/pidgin/gtkutils.c	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkutils.c	Wed Sep 21 07:39:32 2011 +0000
@@ -308,9 +308,9 @@
 
 	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));
--- a/pidgin/gtkutils.h	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkutils.h	Wed Sep 21 07:39:32 2011 +0000
@@ -112,7 +112,7 @@
  * 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 @@
  *        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);
--- a/pidgin/gtkwebview.c	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkwebview.c	Wed Sep 21 07:39:32 2011 +0000
@@ -43,7 +43,7 @@
 
 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;
--- a/pidgin/gtkwebview.h	Wed Sep 21 07:01:58 2011 +0000
+++ b/pidgin/gtkwebview.h	Wed Sep 21 07:39:32 2011 +0000
@@ -103,9 +103,9 @@
 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
  *